From 585067c3350350ba115e3376d3443dd0adb3ff38 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 16 Oct 2020 16:35:33 +0900 Subject: [PATCH 001/719] Fix missing support for AWS Lambda's lazy listeners in #103 --- slack_bolt/adapter/aws_lambda/chalice_handler.py | 4 +++- slack_bolt/adapter/aws_lambda/handler.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/slack_bolt/adapter/aws_lambda/chalice_handler.py b/slack_bolt/adapter/aws_lambda/chalice_handler.py index d835055fb..48d64ab3a 100644 --- a/slack_bolt/adapter/aws_lambda/chalice_handler.py +++ b/slack_bolt/adapter/aws_lambda/chalice_handler.py @@ -18,7 +18,9 @@ def __init__(self, app: App, chalice: Chalice): # type: ignore self.app = app self.chalice = chalice self.logger = get_bolt_app_logger(app.name, ChaliceSlackRequestHandler) - self.app.lazy_listener_runner = ChaliceLazyListenerRunner(logger=self.logger) + self.app.listener_runner.lazy_listener_runner = ChaliceLazyListenerRunner( + logger=self.logger + ) if self.app.oauth_flow is not None: self.app.oauth_flow.settings.redirect_uri_page_renderer.install_path = "?" diff --git a/slack_bolt/adapter/aws_lambda/handler.py b/slack_bolt/adapter/aws_lambda/handler.py index 0134c6011..b4033c3a2 100644 --- a/slack_bolt/adapter/aws_lambda/handler.py +++ b/slack_bolt/adapter/aws_lambda/handler.py @@ -15,7 +15,9 @@ class SlackRequestHandler: def __init__(self, app: App): # type: ignore self.app = app self.logger = get_bolt_app_logger(app.name, SlackRequestHandler) - self.app.lazy_listener_runner = LambdaLazyListenerRunner(self.logger) + self.app.listener_runner.lazy_listener_runner = LambdaLazyListenerRunner( + self.logger + ) if self.app.oauth_flow is not None: self.app.oauth_flow.settings.redirect_uri_page_renderer.install_path = "?" From c37b104d73e2fb8b53f665151f465e3c0c1b6b3e Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 16 Oct 2020 16:38:13 +0900 Subject: [PATCH 002/719] version 0.9.3b0 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index f8184dc12..2f8ab2956 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "0.9.2b0" +__version__ = "0.9.3b0" From d2c1947e09f842d459f7fb56fe76e838b79d1fb2 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 21 Oct 2020 18:58:35 +0900 Subject: [PATCH 003/719] Fix a bug where LambdaS3OAuthFlow does not work when settings arg is given --- slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py b/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py index 66ac7e155..c87b4a59c 100644 --- a/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py +++ b/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py @@ -5,6 +5,7 @@ import boto3 +from slack_bolt.authorization.authorize import InstallationStoreAuthorize from slack_bolt.oauth import OAuthFlow from slack_sdk import WebClient from slack_sdk.oauth.installation_store.amazon_s3 import AmazonS3InstallationStore @@ -55,6 +56,16 @@ def __init__( bucket_name=installation_bucket_name, client_id=settings.client_id, ) + + # Set up authorize function to surely use this installation_store. + # When a developer use a settings initialized outside this constructor, + # the settings may already have pre-defined authorize. + # In this case, the /slack/events endpoint doesn't work along with the OAuth flow. + settings.authorize = InstallationStoreAuthorize( + logger=logger, + installation_store=settings.installation_store + ) + OAuthFlow.__init__(self, client=client, logger=logger, settings=settings) @property From bf428d096b9fcfed377953a30ba0a7dbd130e4cf Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 21 Oct 2020 19:19:28 +0900 Subject: [PATCH 004/719] Fix #118 by adding allowlist of events in ignore self middleware --- .../ignoring_self_events.py | 10 +- tests/scenario_tests/test_events.py | 174 +++++++++++++++++ tests/scenario_tests_async/test_events.py | 176 ++++++++++++++++++ 3 files changed, 358 insertions(+), 2 deletions(-) diff --git a/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.py b/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.py index 0c42141a3..d24cedb9f 100644 --- a/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.py +++ b/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.py @@ -25,14 +25,20 @@ def process( # ----------------------------------------- - @staticmethod + # Its an Events API event that isn't of type message, + # but the user ID might match our own app. Filter these out. + # However, some events still must be fired, because they can make sense. + events_that_should_be_kept = ["member_joined_channel", "member_left_channel"] + + @classmethod def _is_self_event( - auth_result: AuthorizeResult, user_id: str, body: Dict[str, Any] + cls, auth_result: AuthorizeResult, user_id: str, body: Dict[str, Any] ): return ( auth_result is not None and user_id == auth_result.bot_user_id and body.get("event") is not None + and body.get("event").get("type") not in cls.events_that_should_be_kept ) def _debug_log(self, body: dict): diff --git a/tests/scenario_tests/test_events.py b/tests/scenario_tests/test_events.py index 366490571..e3c8d89eb 100644 --- a/tests/scenario_tests/test_events.py +++ b/tests/scenario_tests/test_events.py @@ -161,3 +161,177 @@ def handle_app_mention(): ) response = app.dispatch(request) assert response.status == 200 + + def test_self_events(self): + app = App(client=self.web_client, signing_secret=self.signing_secret) + + event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "reaction_added", + "user": "W23456789", # bot_user_id + "item": { + "type": "message", + "channel": "C111", + "ts": "1599529504.000400", + }, + "reaction": "heart_eyes", + "item_user": "W111", + "event_ts": "1599616881.000800", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + + @app.event("reaction_added") + def handle_app_mention(say): + say("What's up?") + + timestamp, body = str(int(time())), json.dumps(event_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + sleep(1) # wait a bit after auto ack() + # The listener should not be executed + assert self.mock_received_requests.get("/chat.postMessage") is None + + def test_self_member_join_left_events(self): + app = App(client=self.web_client, signing_secret=self.signing_secret) + + join_event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "member_joined_channel", + "user": "W23456789", # bot_user_id + "channel": "C111", + "channel_type": "C", + "team": "T111", + "inviter": "U222", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + + left_event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "member_left_channel", + "user": "W23456789", # bot_user_id + "channel": "C111", + "channel_type": "C", + "team": "T111", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + + @app.event("member_joined_channel") + def handle_member_joined_channel(say): + say("What's up?") + + @app.event("member_left_channel") + def handle_member_left_channel(say): + say("What's up?") + + timestamp, body = str(int(time())), json.dumps(join_event_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + timestamp, body = str(int(time())), json.dumps(left_event_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 2 + + def test_member_join_left_events(self): + app = App(client=self.web_client, signing_secret=self.signing_secret) + + join_event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "member_joined_channel", + "user": "U999", # not self + "channel": "C111", + "channel_type": "C", + "team": "T111", + "inviter": "U222", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + + left_event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "member_left_channel", + "user": "U999", # not self + "channel": "C111", + "channel_type": "C", + "team": "T111", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + + @app.event("member_joined_channel") + def handle_app_mention(say): + say("What's up?") + + @app.event("member_left_channel") + def handle_app_mention(say): + say("What's up?") + + timestamp, body = str(int(time())), json.dumps(join_event_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + timestamp, body = str(int(time())), json.dumps(left_event_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + + sleep(1) # wait a bit after auto ack() + # the listeners should not be executed + assert self.mock_received_requests["/chat.postMessage"] == 2 diff --git a/tests/scenario_tests_async/test_events.py b/tests/scenario_tests_async/test_events.py index 66322cfa2..9cf1e2033 100644 --- a/tests/scenario_tests_async/test_events.py +++ b/tests/scenario_tests_async/test_events.py @@ -139,6 +139,182 @@ async def test_stable_auto_ack(self): response = await app.async_dispatch(request) assert response.status == 200 + @pytest.mark.asyncio + async def test_self_events(self): + app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app.event("reaction_added")(whats_up) + + self_event = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "reaction_added", + "user": "W23456789", # bot_user_id + "item": { + "type": "message", + "channel": "C111", + "ts": "1599529504.000400", + }, + "reaction": "heart_eyes", + "item_user": "W111", + "event_ts": "1599616881.000800", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + timestamp, body = str(int(time())), json.dumps(self_event) + request = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + await asyncio.sleep(1) # wait a bit after auto ack() + # The listener should not be executed + assert self.mock_received_requests.get("/chat.postMessage") is None + + @pytest.mark.asyncio + async def test_self_joined_left_events(self): + app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app.event("reaction_added")(whats_up) + + join_event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "member_joined_channel", + "user": "W23456789", # bot_user_id + "channel": "C111", + "channel_type": "C", + "team": "T111", + "inviter": "U222", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + + left_event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "member_left_channel", + "user": "W23456789", # bot_user_id + "channel": "C111", + "channel_type": "C", + "team": "T111", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + + @app.event("member_joined_channel") + async def handle_member_joined_channel(say): + await say("What's up?") + + @app.event("member_left_channel") + async def handle_member_left_channel(say): + await say("What's up?") + + timestamp, body = str(int(time())), json.dumps(join_event_body) + request = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + timestamp, body = str(int(time())), json.dumps(left_event_body) + request = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + + await asyncio.sleep(1) # wait a bit after auto ack() + # The listeners should be executed + assert self.mock_received_requests.get("/chat.postMessage") == 2 + + @pytest.mark.asyncio + async def test_joined_left_events(self): + app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app.event("reaction_added")(whats_up) + + join_event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "member_joined_channel", + "user": "W111", # other user + "channel": "C111", + "channel_type": "C", + "team": "T111", + "inviter": "U222", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + + left_event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "member_left_channel", + "user": "W111", # other user + "channel": "C111", + "channel_type": "C", + "team": "T111", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + + @app.event("member_joined_channel") + async def handle_member_joined_channel(say): + await say("What's up?") + + @app.event("member_left_channel") + async def handle_member_left_channel(say): + await say("What's up?") + + timestamp, body = str(int(time())), json.dumps(join_event_body) + request = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + timestamp, body = str(int(time())), json.dumps(left_event_body) + request = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + + await asyncio.sleep(1) # wait a bit after auto ack() + # The listeners should be executed + assert self.mock_received_requests.get("/chat.postMessage") == 2 + app_mention_body = { "token": "verification_token", From a9fe1017a919867b5c6195815c1f6ee20a93853c Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 22 Oct 2020 05:45:12 +0900 Subject: [PATCH 005/719] Satisfy pytype --- slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py | 3 +-- .../middleware/ignoring_self_events/ignoring_self_events.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py b/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py index c87b4a59c..1282e76f5 100644 --- a/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py +++ b/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py @@ -62,8 +62,7 @@ def __init__( # the settings may already have pre-defined authorize. # In this case, the /slack/events endpoint doesn't work along with the OAuth flow. settings.authorize = InstallationStoreAuthorize( - logger=logger, - installation_store=settings.installation_store + logger=logger, installation_store=settings.installation_store ) OAuthFlow.__init__(self, client=client, logger=logger, settings=settings) diff --git a/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.py b/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.py index d24cedb9f..e0fcbe867 100644 --- a/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.py +++ b/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.py @@ -38,7 +38,7 @@ def _is_self_event( auth_result is not None and user_id == auth_result.bot_user_id and body.get("event") is not None - and body.get("event").get("type") not in cls.events_that_should_be_kept + and body.get("event", {}).get("type") not in cls.events_that_should_be_kept ) def _debug_log(self, body: dict): From 02ea23a2f8ab84107c0acd7331fe491530418971 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 22 Oct 2020 15:30:58 +0900 Subject: [PATCH 006/719] version 0.9.4b0 --- setup.py | 2 +- slack_bolt/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 8f35239e4..c9c166120 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.0.0b0",], + install_requires=["slack_sdk>=3.0.0b1",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 2f8ab2956..bc28f6ddc 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "0.9.3b0" +__version__ = "0.9.4b0" From 495e8e789d40722caff3efff92fbd384ced11629 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 22 Oct 2020 19:14:54 +0900 Subject: [PATCH 007/719] Correct Content-Length to be valid even for non-ascii content --- slack_bolt/oauth/internals.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slack_bolt/oauth/internals.py b/slack_bolt/oauth/internals.py index 645f350a3..510f59bfb 100644 --- a/slack_bolt/oauth/internals.py +++ b/slack_bolt/oauth/internals.py @@ -35,7 +35,7 @@ def _build_callback_success_response( # type: ignore status=200, headers={ "Content-Type": "text/html; charset=utf-8", - "Content-Length": len(html), + "Content-Length": len(bytes(html, "utf-8")), "Set-Cookie": self._state_utils.build_set_cookie_for_deletion(), }, body=html, @@ -59,7 +59,7 @@ def _build_callback_failure_response( # type: ignore status=status, headers={ "Content-Type": "text/html; charset=utf-8", - "Content-Length": len(html), + "Content-Length": len(bytes(html, "utf-8")), "Set-Cookie": self._state_utils.build_set_cookie_for_deletion(), }, body=html, From 4ecce6b1283543b479aee162b20a8be70668d179 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 23 Oct 2020 07:23:40 +0900 Subject: [PATCH 008/719] Add cache_enabled option to InstallationStoreAuthorize --- slack_bolt/authorization/async_authorize.py | 16 ++- slack_bolt/authorization/authorize.py | 16 ++- tests/slack_bolt/authorization/__init__.py | 0 .../authorization/test_authorize.py | 92 +++++++++++++++ .../authorization/__init__.py | 0 .../authorization/test_async_authorize.py | 106 ++++++++++++++++++ 6 files changed, 226 insertions(+), 4 deletions(-) create mode 100644 tests/slack_bolt/authorization/__init__.py create mode 100644 tests/slack_bolt/authorization/test_authorize.py create mode 100644 tests/slack_bolt_async/authorization/__init__.py create mode 100644 tests/slack_bolt_async/authorization/test_async_authorize.py diff --git a/slack_bolt/authorization/async_authorize.py b/slack_bolt/authorization/async_authorize.py index 86eb563cd..02a61ca07 100644 --- a/slack_bolt/authorization/async_authorize.py +++ b/slack_bolt/authorization/async_authorize.py @@ -91,11 +91,18 @@ async def __call__( class AsyncInstallationStoreAuthorize(AsyncAuthorize): + authorize_result_cache: Dict[str, AuthorizeResult] = {} + def __init__( - self, *, logger: Logger, installation_store: AsyncInstallationStore, + self, + *, + logger: Logger, + installation_store: AsyncInstallationStore, + cache_enabled: bool = False, ): self.logger = logger self.installation_store = installation_store + self.cache_enabled = cache_enabled async def __call__( self, @@ -115,13 +122,18 @@ async def __call__( ) return None + if self.cache_enabled and bot.bot_token in self.authorize_result_cache: + return self.authorize_result_cache[bot.bot_token] try: auth_result = await context.client.auth_test(token=bot.bot_token) - return AuthorizeResult.from_auth_test_response( + authorize_result = AuthorizeResult.from_auth_test_response( auth_test_response=auth_result, bot_token=bot.bot_token, user_token=None, # Not yet supported ) + if self.cache_enabled: + self.authorize_result_cache[bot.bot_token] = authorize_result + return authorize_result except SlackApiError as err: self.logger.debug( f"The stored bot token for enterprise_id: {enterprise_id} team_id: {team_id} " diff --git a/slack_bolt/authorization/authorize.py b/slack_bolt/authorization/authorize.py index 47e923af4..0fea0eaab 100644 --- a/slack_bolt/authorization/authorize.py +++ b/slack_bolt/authorization/authorize.py @@ -89,11 +89,18 @@ def __call__( class InstallationStoreAuthorize(Authorize): + authorize_result_cache: Dict[str, AuthorizeResult] = {} + def __init__( - self, *, logger: Logger, installation_store: InstallationStore, + self, + *, + logger: Logger, + installation_store: InstallationStore, + cache_enabled: bool = False, ): self.logger = logger self.installation_store = installation_store + self.cache_enabled = cache_enabled def __call__( self, @@ -113,13 +120,18 @@ def __call__( ) return None + if self.cache_enabled and bot.bot_token in self.authorize_result_cache: + return self.authorize_result_cache[bot.bot_token] try: auth_result = context.client.auth_test(token=bot.bot_token) - return AuthorizeResult.from_auth_test_response( + authorize_result = AuthorizeResult.from_auth_test_response( auth_test_response=auth_result, bot_token=bot.bot_token, user_token=None, # Not yet supported ) + if self.cache_enabled: + self.authorize_result_cache[bot.bot_token] = authorize_result + return authorize_result except SlackApiError as err: self.logger.debug( f"The stored bot token for enterprise_id: {enterprise_id} team_id: {team_id} " diff --git a/tests/slack_bolt/authorization/__init__.py b/tests/slack_bolt/authorization/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/slack_bolt/authorization/test_authorize.py b/tests/slack_bolt/authorization/test_authorize.py new file mode 100644 index 000000000..600c3c626 --- /dev/null +++ b/tests/slack_bolt/authorization/test_authorize.py @@ -0,0 +1,92 @@ +import datetime +import logging +from logging import Logger +from typing import Optional + +from slack_sdk import WebClient +from slack_sdk.oauth import InstallationStore +from slack_sdk.oauth.installation_store import Bot, Installation + +from slack_bolt import BoltContext +from slack_bolt.authorization.authorize import InstallationStoreAuthorize +from tests.mock_web_api_server import ( + cleanup_mock_web_api_server, + setup_mock_web_api_server, +) + + +class TestAuthorize: + mock_api_server_base_url = "http://localhost:8888" + + def setup_method(self): + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + + def test_installation_store(self): + installation_store = MemoryInstallationStore() + authorize = InstallationStoreAuthorize( + logger=installation_store.logger, installation_store=installation_store + ) + context = BoltContext() + context["client"] = WebClient(base_url=self.mock_api_server_base_url) + result = authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert self.mock_received_requests["/auth.test"] == 1 + + result = authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert self.mock_received_requests["/auth.test"] == 2 + + def test_installation_store_cached(self): + installation_store = MemoryInstallationStore() + authorize = InstallationStoreAuthorize( + logger=installation_store.logger, + installation_store=installation_store, + cache_enabled=True, + ) + context = BoltContext() + context["client"] = WebClient(base_url=self.mock_api_server_base_url) + result = authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert self.mock_received_requests["/auth.test"] == 1 + + result = authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert self.mock_received_requests["/auth.test"] == 1 # cached + + +class MemoryInstallationStore(InstallationStore): + @property + def logger(self) -> Logger: + return logging.getLogger(__name__) + + def save(self, installation: Installation): + pass + + def find_bot( + self, *, enterprise_id: Optional[str], team_id: Optional[str] + ) -> Optional[Bot]: + return Bot( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + installed_at=datetime.datetime.now().timestamp(), + ) diff --git a/tests/slack_bolt_async/authorization/__init__.py b/tests/slack_bolt_async/authorization/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/slack_bolt_async/authorization/test_async_authorize.py b/tests/slack_bolt_async/authorization/test_async_authorize.py new file mode 100644 index 000000000..30b2d2d92 --- /dev/null +++ b/tests/slack_bolt_async/authorization/test_async_authorize.py @@ -0,0 +1,106 @@ +import asyncio +import datetime +import logging +from logging import Logger +from typing import Optional + +import pytest +from slack_sdk.oauth.installation_store import Bot, Installation +from slack_sdk.oauth.installation_store.async_installation_store import ( + AsyncInstallationStore, +) +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.authorization.async_authorize import AsyncInstallationStoreAuthorize +from slack_bolt.context.async_context import AsyncBoltContext +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestAsyncAuthorize: + mock_api_server_base_url = "http://localhost:8888" + client = AsyncWebClient(base_url=mock_api_server_base_url,) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + @pytest.mark.asyncio + async def test_installation_store(self): + installation_store = MemoryInstallationStore() + authorize = AsyncInstallationStoreAuthorize( + logger=installation_store.logger, installation_store=installation_store + ) + context = AsyncBoltContext() + context["client"] = self.client + result = await authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert self.mock_received_requests["/auth.test"] == 1 + + result = await authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert self.mock_received_requests["/auth.test"] == 2 + + @pytest.mark.asyncio + async def test_installation_store_cached(self): + installation_store = MemoryInstallationStore() + authorize = AsyncInstallationStoreAuthorize( + logger=installation_store.logger, + installation_store=installation_store, + cache_enabled=True, + ) + context = AsyncBoltContext() + context["client"] = self.client + result = await authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert self.mock_received_requests["/auth.test"] == 1 + + result = await authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert self.mock_received_requests["/auth.test"] == 1 # cached + + +class MemoryInstallationStore(AsyncInstallationStore): + @property + def logger(self) -> Logger: + return logging.getLogger(__name__) + + async def async_save(self, installation: Installation): + pass + + async def async_find_bot( + self, *, enterprise_id: Optional[str], team_id: Optional[str] + ) -> Optional[Bot]: + return Bot( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + installed_at=datetime.datetime.now().timestamp(), + ) From 7b00feff90271bde928a622f646f1f79db80fd5f Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 24 Oct 2020 09:04:04 +0900 Subject: [PATCH 009/719] Fix #121 by changing the built-in middleware --- .../async_multi_teams_authorization.py | 12 ++++ .../async_single_team_authorization.py | 13 +++- .../middleware/authorization/internals.py | 22 +++++++ .../multi_teams_authorization.py | 17 +++++- .../single_team_authorization.py | 12 ++++ .../ignoring_self_events.py | 1 + tests/scenario_tests/test_events.py | 59 +++++++++++++++++- tests/scenario_tests_async/test_events.py | 60 +++++++++++++++++++ 8 files changed, 193 insertions(+), 3 deletions(-) diff --git a/slack_bolt/middleware/authorization/async_multi_teams_authorization.py b/slack_bolt/middleware/authorization/async_multi_teams_authorization.py index 840a5fc0a..98e22aa4b 100644 --- a/slack_bolt/middleware/authorization/async_multi_teams_authorization.py +++ b/slack_bolt/middleware/authorization/async_multi_teams_authorization.py @@ -6,6 +6,7 @@ from slack_bolt.response import BoltResponse from .async_authorization import AsyncAuthorization from .async_internals import _build_error_response, _is_no_auth_required +from .internals import _is_no_auth_test_call_required from ...authorization import AuthorizeResult from ...authorization.async_authorize import AsyncAuthorize from ...util.async_utils import create_async_web_client @@ -31,6 +32,17 @@ async def async_process( ) -> BoltResponse: if _is_no_auth_required(req): return await next() + + if _is_no_auth_test_call_required(req): + req.context.set_authorize_result( + AuthorizeResult( + enterprise_id=req.context.enterprise_id, + team_id=req.context.team_id, + user_id=req.context.user_id, + ) + ) + return await next() + try: auth_result: Optional[AuthorizeResult] = await self.authorize( context=req.context, diff --git a/slack_bolt/middleware/authorization/async_single_team_authorization.py b/slack_bolt/middleware/authorization/async_single_team_authorization.py index 8a307d3da..8db49432e 100644 --- a/slack_bolt/middleware/authorization/async_single_team_authorization.py +++ b/slack_bolt/middleware/authorization/async_single_team_authorization.py @@ -7,7 +7,8 @@ from slack_sdk.web.async_slack_response import AsyncSlackResponse from slack_sdk.errors import SlackApiError from .async_internals import _build_error_response, _is_no_auth_required -from .internals import _to_authorize_result +from .internals import _to_authorize_result, _is_no_auth_test_call_required +from ...authorization import AuthorizeResult class AsyncSingleTeamAuthorization(AsyncAuthorization): @@ -26,6 +27,16 @@ async def async_process( if _is_no_auth_required(req): return await next() + if _is_no_auth_test_call_required(req): + req.context.set_authorize_result( + AuthorizeResult( + enterprise_id=req.context.enterprise_id, + team_id=req.context.team_id, + user_id=req.context.user_id, + ) + ) + return await next() + try: if self.auth_test_result is None: self.auth_test_result = await req.context.client.auth_test() diff --git a/slack_bolt/middleware/authorization/internals.py b/slack_bolt/middleware/authorization/internals.py index 3ec2d9d39..0ab025a94 100644 --- a/slack_bolt/middleware/authorization/internals.py +++ b/slack_bolt/middleware/authorization/internals.py @@ -21,10 +21,32 @@ def _is_ssl_check(req: BoltRequest) -> bool: ) +def _is_uninstallation_event(req: BoltRequest) -> bool: + return ( + req is not None + and req.body is not None + and req.body.get("type") == "event_callback" + and req.body.get("event", {}).get("type") == "app_uninstalled" + ) + + +def _is_tokens_revoked_event(req: BoltRequest) -> bool: + return ( + req is not None + and req.body is not None + and req.body.get("type") == "event_callback" + and req.body.get("event", {}).get("type") == "tokens_revoked" + ) + + def _is_no_auth_required(req: BoltRequest) -> bool: return _is_url_verification(req) or _is_ssl_check(req) +def _is_no_auth_test_call_required(req: BoltRequest) -> bool: + return _is_uninstallation_event(req) or _is_tokens_revoked_event(req) + + def _build_error_response() -> BoltResponse: # show an ephemeral message to the end-user return BoltResponse( diff --git a/slack_bolt/middleware/authorization/multi_teams_authorization.py b/slack_bolt/middleware/authorization/multi_teams_authorization.py index 7efa8ae8c..bfde5bb47 100644 --- a/slack_bolt/middleware/authorization/multi_teams_authorization.py +++ b/slack_bolt/middleware/authorization/multi_teams_authorization.py @@ -5,7 +5,11 @@ from slack_bolt.response import BoltResponse from slack_sdk.errors import SlackApiError from .authorization import Authorization -from .internals import _build_error_response, _is_no_auth_required +from .internals import ( + _build_error_response, + _is_no_auth_required, + _is_no_auth_test_call_required, +) from ...authorization import AuthorizeResult from ...authorization.authorize import Authorize from ...util.utils import create_web_client @@ -29,6 +33,17 @@ def process( ) -> BoltResponse: if _is_no_auth_required(req): return next() + + if _is_no_auth_test_call_required(req): + req.context.set_authorize_result( + AuthorizeResult( + enterprise_id=req.context.enterprise_id, + team_id=req.context.team_id, + user_id=req.context.user_id, + ) + ) + return next() + try: auth_result: Optional[AuthorizeResult] = self.authorize( context=req.context, diff --git a/slack_bolt/middleware/authorization/single_team_authorization.py b/slack_bolt/middleware/authorization/single_team_authorization.py index 8506ebff0..e09d399ab 100644 --- a/slack_bolt/middleware/authorization/single_team_authorization.py +++ b/slack_bolt/middleware/authorization/single_team_authorization.py @@ -10,7 +10,9 @@ _build_error_response, _is_no_auth_required, _to_authorize_result, + _is_no_auth_test_call_required, ) +from ...authorization import AuthorizeResult class SingleTeamAuthorization(Authorization): @@ -28,6 +30,16 @@ def process( if _is_no_auth_required(req): return next() + if _is_no_auth_test_call_required(req): + req.context.set_authorize_result( + AuthorizeResult( + enterprise_id=req.context.enterprise_id, + team_id=req.context.team_id, + user_id=req.context.user_id, + ) + ) + return next() + try: if not self.auth_test_result: self.auth_test_result = req.context.client.auth_test() diff --git a/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.py b/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.py index e0fcbe867..dd9eb93a4 100644 --- a/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.py +++ b/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.py @@ -36,6 +36,7 @@ def _is_self_event( ): return ( auth_result is not None + and user_id is not None and user_id == auth_result.bot_user_id and body.get("event") is not None and body.get("event", {}).get("type") not in cls.events_that_should_be_kept diff --git a/tests/scenario_tests/test_events.py b/tests/scenario_tests/test_events.py index e3c8d89eb..4a2b02dc8 100644 --- a/tests/scenario_tests/test_events.py +++ b/tests/scenario_tests/test_events.py @@ -4,7 +4,7 @@ from slack_sdk.signature import SignatureVerifier from slack_sdk.web import WebClient -from slack_bolt import App, BoltRequest +from slack_bolt import App, BoltRequest, Say from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, @@ -335,3 +335,60 @@ def handle_app_mention(say): sleep(1) # wait a bit after auto ack() # the listeners should not be executed assert self.mock_received_requests["/chat.postMessage"] == 2 + + def test_uninstallation_and_revokes(self): + app = App(client=self.web_client, signing_secret=self.signing_secret) + app._client = WebClient( + token="uninstalled-revoked", base_url=self.mock_api_server_base_url + ) + + @app.event("app_uninstalled") + def handler1(say: Say): + say(channel="C111", text="What's up?") + + @app.event("tokens_revoked") + def handler2(say: Say): + say(channel="C111", text="What's up?") + + app_uninstalled_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": {"type": "app_uninstalled"}, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + } + + timestamp, body = str(int(time())), json.dumps(app_uninstalled_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + + tokens_revoked_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "tokens_revoked", + "tokens": {"oauth": ["UXXXXXXXX"], "bot": ["UXXXXXXXX"]}, + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + } + + timestamp, body = str(int(time())), json.dumps(tokens_revoked_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + + assert self.mock_received_requests["/auth.test"] == 1 + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 2 diff --git a/tests/scenario_tests_async/test_events.py b/tests/scenario_tests_async/test_events.py index 9cf1e2033..67e02db0b 100644 --- a/tests/scenario_tests_async/test_events.py +++ b/tests/scenario_tests_async/test_events.py @@ -8,6 +8,7 @@ from slack_sdk.web.async_client import AsyncWebClient from slack_bolt.app.async_app import AsyncApp +from slack_bolt.context.say.async_say import AsyncSay from slack_bolt.request.async_request import AsyncBoltRequest from tests.mock_web_api_server import ( setup_mock_web_api_server, @@ -315,6 +316,65 @@ async def handle_member_left_channel(say): # The listeners should be executed assert self.mock_received_requests.get("/chat.postMessage") == 2 + @pytest.mark.asyncio + async def test_uninstallation_and_revokes(self): + app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) + app._client = AsyncWebClient( + token="uninstalled-revoked", base_url=self.mock_api_server_base_url + ) + + @app.event("app_uninstalled") + async def handler1(say: AsyncSay): + await say(channel="C111", text="What's up?") + + @app.event("tokens_revoked") + async def handler2(say: AsyncSay): + await say(channel="C111", text="What's up?") + + app_uninstalled_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": {"type": "app_uninstalled"}, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + } + + timestamp, body = str(int(time())), json.dumps(app_uninstalled_body) + request: AsyncBoltRequest = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + + tokens_revoked_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "tokens_revoked", + "tokens": {"oauth": ["UXXXXXXXX"], "bot": ["UXXXXXXXX"]}, + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + } + + timestamp, body = str(int(time())), json.dumps(tokens_revoked_body) + request: AsyncBoltRequest = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + + # AsyncApp doesn't call auth.test when booting + assert self.mock_received_requests.get("/auth.test") is None + await asyncio.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 2 + app_mention_body = { "token": "verification_token", From a1f1ca145f1c2a4bd2845eaa6cb0a23e1bb580ef Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 24 Oct 2020 10:47:45 +0900 Subject: [PATCH 010/719] Correct type hints - thanks to pytype --- .../middleware/authorization/internals.py | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/slack_bolt/middleware/authorization/internals.py b/slack_bolt/middleware/authorization/internals.py index 0ab025a94..90f65af61 100644 --- a/slack_bolt/middleware/authorization/internals.py +++ b/slack_bolt/middleware/authorization/internals.py @@ -6,8 +6,16 @@ from slack_bolt.request.request import BoltRequest from slack_bolt.response import BoltResponse +# +# NOTE: this source file intentionally avoids having a reference to +# AsyncBoltRequest, AsyncSlackResponse, and whatever Async-prefixed. +# +# The reason why we do so is to enable developers use sync version of Bolt +# without installing aiohttp library (or any others we may use for async things) +# -def _is_url_verification(req: BoltRequest) -> bool: + +def _is_url_verification(req: Union[BoltRequest, "AsyncBoltRequest"]) -> bool: # type: ignore return ( req is not None and req.body is not None @@ -15,13 +23,13 @@ def _is_url_verification(req: BoltRequest) -> bool: ) -def _is_ssl_check(req: BoltRequest) -> bool: +def _is_ssl_check(req: Union[BoltRequest, "AsyncBoltRequest"]) -> bool: # type: ignore return ( req is not None and req.body is not None and req.body.get("type") == "ssl_check" ) -def _is_uninstallation_event(req: BoltRequest) -> bool: +def _is_uninstallation_event(req: Union[BoltRequest, "AsyncBoltRequest"]) -> bool: # type: ignore return ( req is not None and req.body is not None @@ -30,7 +38,7 @@ def _is_uninstallation_event(req: BoltRequest) -> bool: ) -def _is_tokens_revoked_event(req: BoltRequest) -> bool: +def _is_tokens_revoked_event(req: Union[BoltRequest, "AsyncBoltRequest"]) -> bool: # type: ignore return ( req is not None and req.body is not None @@ -39,11 +47,11 @@ def _is_tokens_revoked_event(req: BoltRequest) -> bool: ) -def _is_no_auth_required(req: BoltRequest) -> bool: +def _is_no_auth_required(req: Union[BoltRequest, "AsyncBoltRequest"]) -> bool: # type: ignore return _is_url_verification(req) or _is_ssl_check(req) -def _is_no_auth_test_call_required(req: BoltRequest) -> bool: +def _is_no_auth_test_call_required(req: Union[BoltRequest, "AsyncBoltRequest"]) -> bool: # type: ignore return _is_uninstallation_event(req) or _is_tokens_revoked_event(req) From 736f7646a97a60f317b014f43a62c350f6388766 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sun, 25 Oct 2020 22:48:09 +0900 Subject: [PATCH 011/719] Enable WorkflowStep to have lazy listeners --- slack_bolt/app/app.py | 14 +- slack_bolt/app/async_app.py | 6 +- slack_bolt/workflows/step/async_step.py | 39 +++-- slack_bolt/workflows/step/step.py | 42 +++-- tests/scenario_tests/test_workflow_steps.py | 143 +++++++++++++--- .../test_workflow_steps.py | 153 +++++++++++++++--- 6 files changed, 322 insertions(+), 75 deletions(-) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index e4946706c..b6bd3c035 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -6,8 +6,6 @@ from http.server import SimpleHTTPRequestHandler, HTTPServer from typing import List, Union, Pattern, Callable, Dict, Optional -from slack_bolt.listener.thread_runner import ThreadListenerRunner -from slack_bolt.workflows.step import WorkflowStep, WorkflowStepMiddleware from slack_sdk.errors import SlackApiError from slack_sdk.oauth.installation_store import InstallationStore from slack_sdk.web import WebClient @@ -26,6 +24,7 @@ DefaultListenerErrorHandler, CustomListenerErrorHandler, ) +from slack_bolt.listener.thread_runner import ThreadListenerRunner from slack_bolt.listener_matcher import CustomListenerMatcher from slack_bolt.listener_matcher import builtins as builtin_matchers from slack_bolt.listener_matcher.listener_matcher import ListenerMatcher @@ -59,6 +58,7 @@ from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse from slack_bolt.util.utils import create_web_client +from slack_bolt.workflows.step import WorkflowStep, WorkflowStepMiddleware class App: @@ -358,10 +358,14 @@ def middleware(self, *args) -> Optional[Callable]: def step( self, callback_id: Union[str, Pattern, WorkflowStep], - edit: Optional[Union[Callable[..., Optional[BoltResponse]], Listener]] = None, - save: Optional[Union[Callable[..., Optional[BoltResponse]], Listener]] = None, + edit: Optional[ + Union[Callable[..., Optional[BoltResponse]], Listener, List[Callable]] + ] = None, + save: Optional[ + Union[Callable[..., Optional[BoltResponse]], Listener, List[Callable]] + ] = None, execute: Optional[ - Union[Callable[..., Optional[BoltResponse]], Listener] + Union[Callable[..., Optional[BoltResponse]], Listener, List[Callable]] ] = None, ): """Registers a new Workflow Step listener""" diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 272a01747..50e9a98ce 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -371,13 +371,13 @@ def step( self, callback_id: Union[str, Pattern, AsyncWorkflowStep], edit: Optional[ - Union[Callable[..., Optional[BoltResponse]], AsyncListener] + Union[Callable[..., Optional[BoltResponse]], AsyncListener, List[Callable]] ] = None, save: Optional[ - Union[Callable[..., Optional[BoltResponse]], AsyncListener] + Union[Callable[..., Optional[BoltResponse]], AsyncListener, List[Callable]] ] = None, execute: Optional[ - Union[Callable[..., Optional[BoltResponse]], AsyncListener] + Union[Callable[..., Optional[BoltResponse]], AsyncListener, List[Callable]] ] = None, ): """Registers a new Workflow Step listener""" diff --git a/slack_bolt/workflows/step/async_step.py b/slack_bolt/workflows/step/async_step.py index 334d98821..cf1ee73a6 100644 --- a/slack_bolt/workflows/step/async_step.py +++ b/slack_bolt/workflows/step/async_step.py @@ -1,4 +1,4 @@ -from typing import Callable, Union, Optional, Awaitable +from typing import Callable, Union, Optional, Awaitable, List from slack_bolt.context.async_context import AsyncBoltContext from slack_bolt.listener.async_listener import AsyncListener, AsyncCustomListener @@ -14,6 +14,8 @@ from .utilities.async_fail import AsyncFail from .utilities.async_complete import AsyncComplete from .utilities.async_update import AsyncUpdate +from ...listener_matcher.async_listener_matcher import AsyncListenerMatcher +from ...middleware.async_middleware import AsyncMiddleware class AsyncWorkflowStep: @@ -26,9 +28,15 @@ def __init__( self, *, callback_id: str, - edit: Union[Callable[..., Awaitable[BoltResponse]], AsyncListener], - save: Union[Callable[..., Awaitable[BoltResponse]], AsyncListener], - execute: Union[Callable[..., Awaitable[BoltResponse]], AsyncListener], + edit: Union[ + Callable[..., Awaitable[BoltResponse]], AsyncListener, List[Callable] + ], + save: Union[ + Callable[..., Awaitable[BoltResponse]], AsyncListener, List[Callable] + ], + execute: Union[ + Callable[..., Awaitable[BoltResponse]], AsyncListener, List[Callable] + ], app_name: Optional[str] = None, ): self.callback_id = callback_id @@ -40,7 +48,7 @@ def __init__( @classmethod def _build_listener( cls, callback_id: str, app_name: str, listener: AsyncListener, name: str, - ): + ) -> AsyncListener: if isinstance(listener, AsyncListener): return listener elif isinstance(listener, Callable): @@ -52,11 +60,22 @@ def _build_listener( lazy_functions=[], auto_acknowledgement=name == "execute", ) + elif isinstance(listener, list) and len(listener) > 0: + ack = listener.pop(0) + lazy = listener + return AsyncCustomListener( + app_name=app_name, + matchers=cls._build_matchers(name, callback_id), + middleware=cls._build_middleware(name, callback_id), + ack_function=ack, + lazy_functions=lazy, + auto_acknowledgement=name == "execute", + ) else: raise ValueError(f"Invalid `{name}` listener") @classmethod - def _build_matchers(cls, name: str, callback_id: str): + def _build_matchers(cls, name: str, callback_id: str) -> List[AsyncListenerMatcher]: if name == "edit": return [workflow_step_edit(callback_id, asyncio=True)] elif name == "save": @@ -67,7 +86,7 @@ def _build_matchers(cls, name: str, callback_id: str): raise ValueError(f"Invalid name {name}") @classmethod - def _build_middleware(cls, name: str, callback_id: str): + def _build_middleware(cls, name: str, callback_id: str) -> List[AsyncMiddleware]: if name == "edit": return [_build_edit_listener_middleware(callback_id)] elif name == "save": @@ -83,7 +102,7 @@ def _build_middleware(cls, name: str, callback_id: str): ####################### -def _build_edit_listener_middleware(callback_id: str): +def _build_edit_listener_middleware(callback_id: str) -> AsyncMiddleware: async def edit_listener_middleware( context: AsyncBoltContext, client: AsyncWebClient, @@ -103,7 +122,7 @@ async def edit_listener_middleware( ####################### -def _build_save_listener_middleware(): +def _build_save_listener_middleware() -> AsyncMiddleware: async def save_listener_middleware( context: AsyncBoltContext, client: AsyncWebClient, @@ -121,7 +140,7 @@ async def save_listener_middleware( ####################### -def _build_execute_listener_middleware(): +def _build_execute_listener_middleware() -> AsyncMiddleware: async def execute_listener_middleware( context: AsyncBoltContext, client: AsyncWebClient, diff --git a/slack_bolt/workflows/step/step.py b/slack_bolt/workflows/step/step.py index 3d83569ca..2fe342c57 100644 --- a/slack_bolt/workflows/step/step.py +++ b/slack_bolt/workflows/step/step.py @@ -1,13 +1,14 @@ -from typing import Callable, Union, Optional +from typing import Callable, Union, Optional, List from slack_bolt.context import BoltContext from slack_bolt.listener import Listener, CustomListener +from slack_bolt.listener_matcher import ListenerMatcher from slack_bolt.listener_matcher.builtins import ( workflow_step_edit, workflow_step_save, workflow_step_execute, ) -from slack_bolt.middleware import CustomMiddleware +from slack_bolt.middleware import CustomMiddleware, Middleware from slack_bolt.response import BoltResponse from slack_bolt.workflows.step.utilities.complete import Complete from slack_bolt.workflows.step.utilities.configure import Configure @@ -26,9 +27,9 @@ def __init__( self, *, callback_id: str, - edit: Union[Callable[..., Optional[BoltResponse]], Listener], - save: Union[Callable[..., Optional[BoltResponse]], Listener], - execute: Union[Callable[..., Optional[BoltResponse]], Listener], + edit: Union[Callable[..., Optional[BoltResponse]], Listener, List[Callable]], + save: Union[Callable[..., Optional[BoltResponse]], Listener, List[Callable]], + execute: Union[Callable[..., Optional[BoltResponse]], Listener, List[Callable]], app_name: Optional[str] = None, ): self.callback_id = callback_id @@ -38,7 +39,15 @@ def __init__( self.execute = self._build_listener(callback_id, app_name, execute, "execute") @classmethod - def _build_listener(cls, callback_id, app_name, listener, name): + def _build_listener( + cls, + callback_id: str, + app_name: str, + listener: Union[ + Callable[..., Optional[BoltResponse]], Listener, List[Callable] + ], + name: str, + ) -> Listener: if isinstance(listener, Listener): return listener elif isinstance(listener, Callable): @@ -50,11 +59,22 @@ def _build_listener(cls, callback_id, app_name, listener, name): lazy_functions=[], auto_acknowledgement=name == "execute", ) + elif isinstance(listener, list) and len(listener) > 0: + ack = listener.pop(0) + lazy = listener + return CustomListener( + app_name=app_name, + matchers=cls._build_matchers(name, callback_id), + middleware=cls._build_middleware(name, callback_id), + ack_function=ack, + lazy_functions=lazy, + auto_acknowledgement=name == "execute", + ) else: raise ValueError(f"Invalid `{name}` listener") @classmethod - def _build_matchers(cls, name, callback_id): + def _build_matchers(cls, name: str, callback_id: str) -> List[ListenerMatcher]: if name == "edit": return [workflow_step_edit(callback_id)] elif name == "save": @@ -65,7 +85,7 @@ def _build_matchers(cls, name, callback_id): raise ValueError(f"Invalid name {name}") @classmethod - def _build_middleware(cls, name, callback_id): + def _build_middleware(cls, name: str, callback_id: str) -> List[Middleware]: if name == "edit": return [_build_edit_listener_middleware(callback_id)] elif name == "save": @@ -81,7 +101,7 @@ def _build_middleware(cls, name, callback_id): ####################### -def _build_edit_listener_middleware(callback_id): +def _build_edit_listener_middleware(callback_id: str) -> Middleware: def edit_listener_middleware( context: BoltContext, client: WebClient, @@ -101,7 +121,7 @@ def edit_listener_middleware( ####################### -def _build_save_listener_middleware(): +def _build_save_listener_middleware() -> Middleware: def save_listener_middleware( context: BoltContext, client: WebClient, @@ -119,7 +139,7 @@ def save_listener_middleware( ####################### -def _build_execute_listener_middleware(): +def _build_execute_listener_middleware() -> Middleware: def execute_listener_middleware( context: BoltContext, client: WebClient, diff --git a/tests/scenario_tests/test_workflow_steps.py b/tests/scenario_tests/test_workflow_steps.py index 82a67a356..9dacd83a3 100644 --- a/tests/scenario_tests/test_workflow_steps.py +++ b/tests/scenario_tests/test_workflow_steps.py @@ -25,8 +25,6 @@ class TestWorkflowSteps: def setup_method(self): self.old_os_env = remove_os_env_temporarily() setup_mock_web_api_server(self) - self.app = App(client=self.web_client, signing_secret=self.signing_secret) - self.app.step(callback_id="copy_review", edit=edit, save=save, execute=execute) def teardown_method(self): cleanup_mock_web_api_server(self) @@ -37,7 +35,28 @@ def generate_signature(self, body: str, timestamp: str): body=body, timestamp=timestamp, ) + def build_app(self, callback_id: str): + app = App(client=self.web_client, signing_secret=self.signing_secret) + app.step(callback_id=callback_id, edit=edit, save=save, execute=execute) + return app + + def build_process_before_response_app(self, callback_id: str): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + process_before_response=True, + ) + app.step( + callback_id=callback_id, + edit=[edit_ack, edit_lazy], + save=[save_ack, save_lazy], + execute=[execute_ack, execute_lazy], + ) + return app + def test_edit(self): + app = self.build_app("copy_review") + timestamp, body = str(int(time())), f"payload={quote(json.dumps(edit_payload))}" headers = { "content-type": ["application/x-www-form-urlencoded"], @@ -45,18 +64,35 @@ def test_edit(self): "x-slack-request-timestamp": [timestamp], } request: BoltRequest = BoltRequest(body=body, headers=headers) - response = self.app.dispatch(request) + response = app.dispatch(request) assert response.status == 200 assert self.mock_received_requests["/auth.test"] == 1 - self.app = App(client=self.web_client, signing_secret=self.signing_secret) - self.app.step( - callback_id="copy_review___", edit=edit, save=save, execute=execute - ) - response = self.app.dispatch(request) + app = self.build_app("copy_review___") + response = app.dispatch(request) + assert response.status == 404 + + def test_edit_process_before_response(self): + app = self.build_process_before_response_app("copy_review") + + timestamp, body = str(int(time())), f"payload={quote(json.dumps(edit_payload))}" + headers = { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request: BoltRequest = BoltRequest(body=body, headers=headers) + response = app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + app = self.build_process_before_response_app("copy_review___") + response = app.dispatch(request) assert response.status == 404 def test_save(self): + app = self.build_app("copy_review") + timestamp, body = str(int(time())), f"payload={quote(json.dumps(save_payload))}" headers = { "content-type": ["application/x-www-form-urlencoded"], @@ -64,18 +100,35 @@ def test_save(self): "x-slack-request-timestamp": [timestamp], } request: BoltRequest = BoltRequest(body=body, headers=headers) - response = self.app.dispatch(request) + response = app.dispatch(request) assert response.status == 200 assert self.mock_received_requests["/auth.test"] == 1 - self.app = App(client=self.web_client, signing_secret=self.signing_secret) - self.app.step( - callback_id="copy_review___", edit=edit, save=save, execute=execute - ) - response = self.app.dispatch(request) + app = self.build_app("copy_review___") + response = app.dispatch(request) + assert response.status == 404 + + def test_save_process_before_response(self): + app = self.build_process_before_response_app("copy_review") + + timestamp, body = str(int(time())), f"payload={quote(json.dumps(save_payload))}" + headers = { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request: BoltRequest = BoltRequest(body=body, headers=headers) + response = app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + app = self.build_process_before_response_app("copy_review___") + response = app.dispatch(request) assert response.status == 404 def test_execute(self): + app = self.build_app("copy_review") + timestamp, body = str(int(time())), json.dumps(execute_payload) headers = { "content-type": ["application/json"], @@ -83,17 +136,34 @@ def test_execute(self): "x-slack-request-timestamp": [timestamp], } request: BoltRequest = BoltRequest(body=body, headers=headers) - response = self.app.dispatch(request) + response = app.dispatch(request) assert response.status == 200 assert self.mock_received_requests["/auth.test"] == 1 time_module.sleep(0.5) assert self.mock_received_requests["/workflows.stepCompleted"] == 1 - self.app = App(client=self.web_client, signing_secret=self.signing_secret) - self.app.step( - callback_id="copy_review___", edit=edit, save=save, execute=execute - ) - response = self.app.dispatch(request) + app = self.build_app("copy_review___") + response = app.dispatch(request) + assert response.status == 404 + + def test_execute_process_before_response(self): + app = self.build_process_before_response_app("copy_review") + + timestamp, body = str(int(time())), json.dumps(execute_payload) + headers = { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request: BoltRequest = BoltRequest(body=body, headers=headers) + response = app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + time_module.sleep(0.5) + assert self.mock_received_requests["/workflows.stepCompleted"] == 1 + + app = self.build_process_before_response_app("copy_review___") + response = app.dispatch(request) assert response.status == 404 @@ -398,3 +468,36 @@ def execute(step: dict, client: WebClient, complete: Complete, fail: Fail): ) except Exception as err: fail(error={"message": f"Something wrong! {err}"}) + + +def edit_ack(ack: Ack): + ack() + + +def edit_lazy(step, configure: Configure): + assert step is not None + configure(blocks=[]) + + +def save_ack(ack: Ack): + ack() + + +def save_lazy(step: dict, view: dict, update: Update): + assert step is not None + assert view is not None + update( + inputs={}, outputs=[], + ) + + +def execute_ack(): + pass + + +def execute_lazy(step: dict, complete: Complete, fail: Fail): + assert step is not None + try: + complete(outputs={}) + except Exception as err: + fail(error={"message": f"Something wrong! {err}"}) diff --git a/tests/scenario_tests_async/test_workflow_steps.py b/tests/scenario_tests_async/test_workflow_steps.py index de92b5b55..525a6f568 100644 --- a/tests/scenario_tests_async/test_workflow_steps.py +++ b/tests/scenario_tests_async/test_workflow_steps.py @@ -22,7 +22,7 @@ from tests.utils import remove_os_env_temporarily, restore_os_env -class TestAsyncEvents: +class TestAsyncWorkflowSteps: signing_secret = "secret" valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" @@ -34,13 +34,6 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - self.app = AsyncApp( - client=self.web_client, signing_secret=self.signing_secret - ) - self.app.step( - callback_id="copy_review", edit=edit, save=save, execute=execute - ) - loop = asyncio.get_event_loop() yield loop loop.close() @@ -53,8 +46,29 @@ def generate_signature(self, body: str, timestamp: str): body=body, timestamp=timestamp, ) + def build_app(self, callback_id: str): + app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) + app.step(callback_id=callback_id, edit=edit, save=save, execute=execute) + return app + + def build_process_before_response_app(self, callback_id: str): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + process_before_response=True, + ) + app.step( + callback_id=callback_id, + edit=[edit_ack, edit_lazy], + save=[save_ack, save_lazy], + execute=[execute_ack, execute_lazy], + ) + return app + @pytest.mark.asyncio async def test_edit(self): + app = self.build_app("copy_review") + timestamp, body = str(int(time())), f"payload={quote(json.dumps(edit_payload))}" headers = { "content-type": ["application/x-www-form-urlencoded"], @@ -62,19 +76,37 @@ async def test_edit(self): "x-slack-request-timestamp": [timestamp], } request = AsyncBoltRequest(body=body, headers=headers) - response = await self.app.async_dispatch(request) + response = await app.async_dispatch(request) assert response.status == 200 assert self.mock_received_requests["/auth.test"] == 1 - self.app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) - self.app.step( - callback_id="copy_review___", edit=edit, save=save, execute=execute - ) - response = await self.app.async_dispatch(request) + app = self.build_app("copy_review___") + response = await app.async_dispatch(request) + assert response.status == 404 + + @pytest.mark.asyncio + async def test_edit_process_before_response(self): + app = self.build_process_before_response_app("copy_review") + + timestamp, body = str(int(time())), f"payload={quote(json.dumps(edit_payload))}" + headers = { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request = AsyncBoltRequest(body=body, headers=headers) + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + app = self.build_process_before_response_app("copy_review___") + response = await app.async_dispatch(request) assert response.status == 404 @pytest.mark.asyncio async def test_save(self): + app = self.build_app("copy_review") + timestamp, body = str(int(time())), f"payload={quote(json.dumps(save_payload))}" headers = { "content-type": ["application/x-www-form-urlencoded"], @@ -82,19 +114,37 @@ async def test_save(self): "x-slack-request-timestamp": [timestamp], } request = AsyncBoltRequest(body=body, headers=headers) - response = await self.app.async_dispatch(request) + response = await app.async_dispatch(request) assert response.status == 200 assert self.mock_received_requests["/auth.test"] == 1 - self.app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) - self.app.step( - callback_id="copy_review___", edit=edit, save=save, execute=execute - ) - response = await self.app.async_dispatch(request) + app = self.build_app("copy_review___") + response = await app.async_dispatch(request) + assert response.status == 404 + + @pytest.mark.asyncio + async def test_save_process_before_response(self): + app = self.build_process_before_response_app("copy_review") + + timestamp, body = str(int(time())), f"payload={quote(json.dumps(save_payload))}" + headers = { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request = AsyncBoltRequest(body=body, headers=headers) + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + app = self.build_process_before_response_app("copy_review___") + response = await app.async_dispatch(request) assert response.status == 404 @pytest.mark.asyncio async def test_execute(self): + app = self.build_app("copy_review") + timestamp, body = str(int(time())), json.dumps(execute_payload) headers = { "content-type": ["application/json"], @@ -102,17 +152,35 @@ async def test_execute(self): "x-slack-request-timestamp": [timestamp], } request = AsyncBoltRequest(body=body, headers=headers) - response = await self.app.async_dispatch(request) + response = await app.async_dispatch(request) assert response.status == 200 assert self.mock_received_requests["/auth.test"] == 1 await asyncio.sleep(0.5) assert self.mock_received_requests["/workflows.stepCompleted"] == 1 - self.app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) - self.app.step( - callback_id="copy_review___", edit=edit, save=save, execute=execute - ) - response = await self.app.async_dispatch(request) + app = self.build_app("copy_review___") + response = await app.async_dispatch(request) + assert response.status == 404 + + @pytest.mark.asyncio + async def test_execute_process_before_response(self): + app = self.build_process_before_response_app("copy_review") + + timestamp, body = str(int(time())), json.dumps(execute_payload) + headers = { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request = AsyncBoltRequest(body=body, headers=headers) + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + await asyncio.sleep(0.5) + assert self.mock_received_requests["/workflows.stepCompleted"] == 1 + + app = self.build_process_before_response_app("copy_review___") + response = await app.async_dispatch(request) assert response.status == 404 @@ -419,3 +487,36 @@ async def execute( ) except Exception as err: await fail(error={"message": f"Something wrong! {err}"}) + + +async def edit_ack(ack: AsyncAck): + await ack() + + +async def edit_lazy(step, configure: AsyncConfigure): + assert step is not None + await configure(blocks=[]) + + +async def save_ack(ack: AsyncAck): + await ack() + + +async def save_lazy(step: dict, view: dict, update: AsyncUpdate): + assert step is not None + assert view is not None + await update( + inputs={}, outputs=[], + ) + + +async def execute_ack(): + pass + + +async def execute_lazy(step: dict, complete: AsyncComplete, fail: AsyncFail): + assert step is not None + try: + await complete(outputs={}) + except Exception as err: + await fail(error={"message": f"Something wrong! {err}"}) From b6c2f1cbfe12f3314f9291467689b2ba7391f833 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 24 Oct 2020 08:20:44 +0900 Subject: [PATCH 012/719] Fix #123 by adding a validation in constructors (App/AsyncApp) --- slack_bolt/app/app.py | 3 +++ slack_bolt/app/async_app.py | 4 ++++ slack_bolt/logger/messages.py | 4 ++++ tests/scenario_tests/test_app.py | 29 ++++++++++++++++++++++++++ tests/scenario_tests_async/test_app.py | 29 ++++++++++++++++++++++++++ 5 files changed, 69 insertions(+) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index b6bd3c035..e0e61fc20 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -41,6 +41,7 @@ debug_running_listener, error_unexpected_listener_middleware, error_client_invalid_type, + error_authorize_conflicts, ) from slack_bolt.middleware import ( Middleware, @@ -131,6 +132,8 @@ def __init__( self._authorize: Optional[Authorize] = None if authorize is not None: + if oauth_settings is not None or oauth_flow is not None: + raise BoltError(error_authorize_conflicts()) self._authorize = CallableAuthorize( logger=self._framework_logger, func=authorize ) diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 50e9a98ce..1051e0b4d 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -32,6 +32,7 @@ error_unexpected_listener_middleware, error_listener_function_must_be_coro_func, error_client_invalid_type_async, + error_authorize_conflicts, ) from slack_bolt.lazy_listener.asyncio_runner import AsyncioLazyListenerRunner from slack_bolt.listener.async_listener import AsyncListener, AsyncCustomListener @@ -138,6 +139,9 @@ def __init__( self._async_authorize: Optional[AsyncAuthorize] = None if authorize is not None: + if oauth_settings is not None or oauth_flow is not None: + raise BoltError(error_authorize_conflicts()) + self._async_authorize = AsyncCallableAuthorize( logger=self._framework_logger, func=authorize ) diff --git a/slack_bolt/logger/messages.py b/slack_bolt/logger/messages.py index 0aee513d2..75abe3e39 100644 --- a/slack_bolt/logger/messages.py +++ b/slack_bolt/logger/messages.py @@ -45,6 +45,10 @@ def error_listener_function_must_be_coro_func(func_name: str) -> str: return f"The listener function ({func_name}) is not a coroutine function." +def error_authorize_conflicts() -> str: + return "`authorize` in the top-level arguments is not allowed when you pass either `oauth_settings` or `oauth_flow`" + + # ------------------------------- # Warning # ------------------------------- diff --git a/tests/scenario_tests/test_app.py b/tests/scenario_tests/test_app.py index 4bfef046f..fcf7b29d6 100644 --- a/tests/scenario_tests/test_app.py +++ b/tests/scenario_tests/test_app.py @@ -4,6 +4,7 @@ from slack_sdk.oauth.state_store import FileOAuthStateStore from slack_bolt import App +from slack_bolt.authorization import AuthorizeResult from slack_bolt.error import BoltError from slack_bolt.oauth import OAuthFlow from slack_bolt.oauth.oauth_settings import OAuthSettings @@ -92,3 +93,31 @@ def test_valid_multi_auth_secret_absence(self): signing_secret="valid", oauth_settings=OAuthSettings(client_id="111.222", client_secret=None), ) + + def test_authorize_conflicts(self): + oauth_settings = OAuthSettings( + client_id="111.222", + client_secret="valid", + installation_store=FileInstallationStore(), + state_store=FileOAuthStateStore(expiration_seconds=120), + ) + + # no error with this + App(signing_secret="valid", oauth_settings=oauth_settings) + + def authorize() -> AuthorizeResult: + return AuthorizeResult(enterprise_id="E111", team_id="T111") + + with pytest.raises(BoltError): + App( + signing_secret="valid", + authorize=authorize, + oauth_settings=oauth_settings, + ) + + oauth_flow = OAuthFlow(settings=oauth_settings) + # no error with this + App(signing_secret="valid", oauth_flow=oauth_flow) + + with pytest.raises(BoltError): + App(signing_secret="valid", authorize=authorize, oauth_flow=oauth_flow) diff --git a/tests/scenario_tests_async/test_app.py b/tests/scenario_tests_async/test_app.py index a22c95a3e..cd3b37865 100644 --- a/tests/scenario_tests_async/test_app.py +++ b/tests/scenario_tests_async/test_app.py @@ -4,6 +4,7 @@ from slack_sdk.oauth.state_store import FileOAuthStateStore from slack_bolt.async_app import AsyncApp +from slack_bolt.authorization import AuthorizeResult from slack_bolt.error import BoltError from slack_bolt.oauth.async_oauth_flow import AsyncOAuthFlow from slack_bolt.oauth.async_oauth_settings import AsyncOAuthSettings @@ -98,3 +99,31 @@ def test_valid_multi_auth_secret_absence(self): signing_secret="valid", oauth_settings=OAuthSettings(client_id="111.222", client_secret=None), ) + + def test_authorize_conflicts(self): + oauth_settings = OAuthSettings( + client_id="111.222", + client_secret="valid", + installation_store=FileInstallationStore(), + state_store=FileOAuthStateStore(expiration_seconds=120), + ) + + # no error with this + AsyncApp(signing_secret="valid", oauth_settings=oauth_settings) + + def authorize() -> AuthorizeResult: + return AuthorizeResult(enterprise_id="E111", team_id="T111") + + with pytest.raises(BoltError): + AsyncApp( + signing_secret="valid", + authorize=authorize, + oauth_settings=oauth_settings, + ) + + oauth_flow = AsyncOAuthFlow(settings=oauth_settings) + # no error with this + AsyncApp(signing_secret="valid", oauth_flow=oauth_flow) + + with pytest.raises(BoltError): + AsyncApp(signing_secret="valid", authorize=authorize, oauth_flow=oauth_flow) From e5973803bb0523e62d486f43164ed2e0169841f1 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 27 Oct 2020 16:30:14 +0900 Subject: [PATCH 013/719] versopm 0.9.5b0 --- setup.py | 2 +- slack_bolt/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index c9c166120..b5ea3d66d 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.0.0b1",], + install_requires=["slack_sdk>=3.0.0rc1",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/version.py b/slack_bolt/version.py index bc28f6ddc..338dfbcc1 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "0.9.4b0" +__version__ = "0.9.5b0" From 9eb014f099d10083ae604da5435825a793d0c1bb Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 27 Oct 2020 19:18:16 +0900 Subject: [PATCH 014/719] Add Python 3.9 to CI builds --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 693347598..3f45f8b89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ python: - "3.6" - "3.7" - "3.8" + - "3.9" install: - python setup.py install - pip install -U pip From 8e1a8819ea68a2ddce6233698293db595eeef517 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 27 Oct 2020 20:36:37 +0900 Subject: [PATCH 015/719] Add Python 3.9 to the supported versions --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index b5ea3d66d..7d210ef96 100755 --- a/setup.py +++ b/setup.py @@ -75,6 +75,7 @@ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Programming Language :: Python :: Implementation :: CPython", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", From 3a2d50f2c71b9b3933598108b7500e99dbc04beb Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 27 Oct 2020 17:52:43 +0900 Subject: [PATCH 016/719] Update README for #128 --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b64218451..7d126c61a 100644 --- a/README.md +++ b/README.md @@ -89,17 +89,18 @@ def handle_event(event): ## Making things happen -Most of the app's functionality will be inside listener functions (the `fn` parameters above). These functions are called with a set of arguments. +Most of the app's functionality will be inside listener functions (the `fn` parameters above). These functions are called with a set of arguments. You can place the arguments in random order. Bolt resolves them by the keyword arguments' names. If you'd like to get all arguments in a single object, you can use `args`, a [`slack_bolt.kwargs_injection.Args`](https://github.com/slackapi/bolt-python/blob/main/slack_bolt/kwargs_injection/args.py) instance holding all available values in it. | Argument | Description | | :---: | :--- | +| `body` | Dictionary that contains the entire body of the request (superset of `payload`). Some accessory data is only available outside of the payload (such as `trigger_id` and `authed_users`). | `payload` | Contents of the incoming event. The payload structure depends on the listener. For example, for an Events API event, `payload` will be the [event type structure](https://api.slack.com/events-api#event_type_structure). For a block action, it will be the action from within the `actions` list. The `payload` dictionary is also accessible via the alias corresponding to the listener (`message`, `event`, `action`, `shortcut`, `view`, `command`, or `options`). For example, if you were building a `message()` listener, you could use the `payload` and `message` arguments interchangably. **An easy way to understand what's in a payload is to log it**. | -| `say` | Utility function to send a message to the channel associated with the incoming event. This argument is only available when the listener is triggered for events that contain a `channel_id` (the most common being `message` events). `say` accepts simple strings (for plain-text messages) and dictionaries (for messages containing blocks). +| `context` | Event context. This dictionary contains data about the event and app, such as the `botId`. Middleware can add additional context before the event is passed to listeners. | `ack` | Function that **must** be called to acknowledge that your app received the incoming event. `ack` exists for all actions, shortcuts, view submissions, slash command and options requests. `ack` returns a promise that resolves when complete. Read more in [Acknowledging events](https://slack.dev/bolt-python/concepts#acknowledge). -| `client` | Web API client that uses the token associated with the event. For single-workspace installations, the token is provided to the constructor. For multi-workspace installations, the token is returned by using [the OAuth library](https://slack.dev/bolt-python/concepts#authenticating-oauth), or manually using the `authorize` function. | `respond` | Utility function that responds to incoming events **if** it contains a `response_url` (shortcuts, actions, and slash commands). -| `context` | Event context. This dictionary contains data about the event and app, such as the `botId`. Middleware can add additional context before the event is passed to listeners. -| `body` | Dictionary that contains the entire body of the request (superset of `payload`). Some accessory data is only available outside of the payload (such as `trigger_id` and `authed_users`). +| `say` | Utility function to send a message to the channel associated with the incoming event. This argument is only available when the listener is triggered for events that contain a `channel_id` (the most common being `message` events). `say` accepts simple strings (for plain-text messages) and dictionaries (for messages containing blocks). +| `client` | Web API client that uses the token associated with the event. For single-workspace installations, the token is provided to the constructor. For multi-workspace installations, the token is returned by using [the OAuth library](https://slack.dev/bolt-python/concepts#authenticating-oauth), or manually using the `authorize` function. +| `logger` | The built-in [`logging.Logger`](https://docs.python.org/3/library/logging.html) instance you can use in middleware/listeners. ## Creating an async app From 1c4f4431aee686b1f4615b0754196d48d229f61a Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 28 Oct 2020 06:33:40 +0900 Subject: [PATCH 017/719] Update README.md Co-authored-by: Alissa Renz --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7d126c61a..783491def 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ def handle_event(event): ## Making things happen -Most of the app's functionality will be inside listener functions (the `fn` parameters above). These functions are called with a set of arguments. You can place the arguments in random order. Bolt resolves them by the keyword arguments' names. If you'd like to get all arguments in a single object, you can use `args`, a [`slack_bolt.kwargs_injection.Args`](https://github.com/slackapi/bolt-python/blob/main/slack_bolt/kwargs_injection/args.py) instance holding all available values in it. +Most of the app's functionality will be inside listener functions (the `fn` parameters above). These functions are called with a set of arguments, each of which can be used in any order. If you'd like to access arguments off of a single object, you can use `args`, an [`slack_bolt.kwargs_injection.Args`](https://github.com/slackapi/bolt-python/blob/main/slack_bolt/kwargs_injection/args.py) instance that contains all available arguments for that event. | Argument | Description | | :---: | :--- | From bea7fc787a1811b555c66a1d66a8fb2f343aa1f5 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 28 Oct 2020 07:28:29 +0900 Subject: [PATCH 018/719] Fix a link in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 783491def..240a72d8f 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ If you want to use another async Web framework (e.g., Sanic, FastAPI, Starlette) * [The Bolt app examples](https://github.com/slackapi/bolt-python/tree/main/examples) * [The built-in adapters](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter) -Apps can be run the same way as the syncronous example above. If you'd prefer another async Web framework (e.g., Sanic, FastAPI, Starlette), take a look at [the built-in adapters](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter) and their corresponding [sample code](https://github.com/slackapi/bolt-python/tree/main/samples). +Apps can be run the same way as the syncronous example above. If you'd prefer another async Web framework (e.g., Sanic, FastAPI, Starlette), take a look at [the built-in adapters](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter) and their corresponding [examples](https://github.com/slackapi/bolt-python/tree/main/examples). ## Getting Help From 3f67a08805be7fde2c87f5c752b21dfa0d654aeb Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 29 Oct 2020 12:42:41 +0900 Subject: [PATCH 019/719] Fix #132 by handling requestContext in AWS Lambda payloads --- scripts/install_all_and_run_tests.sh | 2 ++ slack_bolt/adapter/aws_lambda/handler.py | 3 ++ tests/adapter_tests/test_aws_lambda.py | 43 ++++++++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/scripts/install_all_and_run_tests.sh b/scripts/install_all_and_run_tests.sh index c7eb6c1a6..2d5b4c14d 100755 --- a/scripts/install_all_and_run_tests.sh +++ b/scripts/install_all_and_run_tests.sh @@ -6,6 +6,8 @@ script_dir=`dirname $0` cd ${script_dir}/.. rm -rf ./slack_bolt.egg-info +# The package causes a conflict with moto +pip uninstall python-lambda test_target="$1" diff --git a/slack_bolt/adapter/aws_lambda/handler.py b/slack_bolt/adapter/aws_lambda/handler.py index b4033c3a2..c6e1e975a 100644 --- a/slack_bolt/adapter/aws_lambda/handler.py +++ b/slack_bolt/adapter/aws_lambda/handler.py @@ -33,6 +33,9 @@ def handle(self, event, context): self.logger.debug(f"Incoming event: {event}, context: {context}") method = event.get("requestContext", {}).get("http", {}).get("method") + if method is None: + method = event.get("requestContext", {}).get("httpMethod") + if method is None: return not_found() if method == "GET": diff --git a/tests/adapter_tests/test_aws_lambda.py b/tests/adapter_tests/test_aws_lambda.py index c4463c513..62793a837 100644 --- a/tests/adapter_tests/test_aws_lambda.py +++ b/tests/adapter_tests/test_aws_lambda.py @@ -115,6 +115,17 @@ def event_handler(): assert response["statusCode"] == 200 assert self.mock_received_requests["/auth.test"] == 1 + event = { + "body": body, + "queryStringParameters": {}, + "headers": self.build_headers(timestamp, body), + "requestContext": {"httpMethod": "POST"}, + "isBase64Encoded": False, + } + response = SlackRequestHandler(app).handle(event, self.context) + assert response["statusCode"] == 200 + assert self.mock_received_requests["/auth.test"] == 1 + @mock_lambda def test_shortcuts(self): app = App(client=self.web_client, signing_secret=self.signing_secret,) @@ -151,6 +162,17 @@ def shortcut_handler(ack): assert response["statusCode"] == 200 assert self.mock_received_requests["/auth.test"] == 1 + event = { + "body": body, + "queryStringParameters": {}, + "headers": self.build_headers(timestamp, body), + "requestContext": {"httpMethod": "POST"}, + "isBase64Encoded": False, + } + response = SlackRequestHandler(app).handle(event, self.context) + assert response["statusCode"] == 200 + assert self.mock_received_requests["/auth.test"] == 1 + @mock_lambda def test_commands(self): app = App(client=self.web_client, signing_secret=self.signing_secret,) @@ -187,6 +209,17 @@ def command_handler(ack): assert response["statusCode"] == 200 assert self.mock_received_requests["/auth.test"] == 1 + event = { + "body": body, + "queryStringParameters": {}, + "headers": self.build_headers(timestamp, body), + "requestContext": {"httpMethod": "POST"}, + "isBase64Encoded": False, + } + response = SlackRequestHandler(app).handle(event, self.context) + assert response["statusCode"] == 200 + assert self.mock_received_requests["/auth.test"] == 1 + @mock_lambda def test_lazy_listeners(self): app = App(client=self.web_client, signing_secret=self.signing_secret,) @@ -251,3 +284,13 @@ def test_oauth(self): } response = SlackRequestHandler(app).handle(event, self.context) assert response["statusCode"] == 302 + + event = { + "body": "", + "queryStringParameters": {}, + "headers": {}, + "requestContext": {"httpMethod": "GET"}, + "isBase64Encoded": False, + } + response = SlackRequestHandler(app).handle(event, self.context) + assert response["statusCode"] == 302 From 8cad46e4d6d414645e653a89cb29a2baa409a960 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 29 Oct 2020 13:37:31 +0900 Subject: [PATCH 020/719] version 0.9.6b0 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 338dfbcc1..68b82ae82 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "0.9.5b0" +__version__ = "0.9.6b0" From afb7a36634d6a3177775f90a0bb175982b2dcdda Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 2 Nov 2020 08:57:24 +0900 Subject: [PATCH 021/719] Move PayloadUtils to request package --- slack_bolt/kwargs_injection/async_utils.py | 2 +- slack_bolt/kwargs_injection/utils.py | 2 +- slack_bolt/listener/async_listener_error_handler.py | 2 +- slack_bolt/listener/listener_error_handler.py | 2 +- slack_bolt/listener_matcher/builtins.py | 4 ++-- slack_bolt/{util => request}/payload_utils.py | 0 6 files changed, 6 insertions(+), 6 deletions(-) rename slack_bolt/{util => request}/payload_utils.py (100%) diff --git a/slack_bolt/kwargs_injection/async_utils.py b/slack_bolt/kwargs_injection/async_utils.py index 58704e2bc..2c8c8f68d 100644 --- a/slack_bolt/kwargs_injection/async_utils.py +++ b/slack_bolt/kwargs_injection/async_utils.py @@ -5,7 +5,7 @@ from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse from .async_args import AsyncArgs -from slack_bolt.util.payload_utils import ( +from slack_bolt.request.payload_utils import ( to_options, to_shortcut, to_action, diff --git a/slack_bolt/kwargs_injection/utils.py b/slack_bolt/kwargs_injection/utils.py index 5519b2a5e..6338e4ad2 100644 --- a/slack_bolt/kwargs_injection/utils.py +++ b/slack_bolt/kwargs_injection/utils.py @@ -5,7 +5,7 @@ from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse from .args import Args -from slack_bolt.util.payload_utils import ( +from slack_bolt.request.payload_utils import ( to_options, to_shortcut, to_action, diff --git a/slack_bolt/listener/async_listener_error_handler.py b/slack_bolt/listener/async_listener_error_handler.py index 86e311098..cbe839038 100644 --- a/slack_bolt/listener/async_listener_error_handler.py +++ b/slack_bolt/listener/async_listener_error_handler.py @@ -6,7 +6,7 @@ from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse -from slack_bolt.util.payload_utils import ( +from slack_bolt.request.payload_utils import ( to_options, to_shortcut, to_action, diff --git a/slack_bolt/listener/listener_error_handler.py b/slack_bolt/listener/listener_error_handler.py index 7526920b0..5854fb356 100644 --- a/slack_bolt/listener/listener_error_handler.py +++ b/slack_bolt/listener/listener_error_handler.py @@ -6,7 +6,7 @@ from slack_bolt.request.request import BoltRequest from slack_bolt.response.response import BoltResponse -from slack_bolt.util.payload_utils import ( +from slack_bolt.request.payload_utils import ( to_options, to_shortcut, to_action, diff --git a/slack_bolt/listener_matcher/builtins.py b/slack_bolt/listener_matcher/builtins.py index 6c0b2077a..3a34d855c 100644 --- a/slack_bolt/listener_matcher/builtins.py +++ b/slack_bolt/listener_matcher/builtins.py @@ -2,8 +2,8 @@ import inspect import sys -from ..error import BoltError -from ..util.payload_utils import ( +from slack_bolt.error import BoltError +from slack_bolt.request.payload_utils import ( is_block_actions, is_global_shortcut, is_message_shortcut, diff --git a/slack_bolt/util/payload_utils.py b/slack_bolt/request/payload_utils.py similarity index 100% rename from slack_bolt/util/payload_utils.py rename to slack_bolt/request/payload_utils.py From 31599be6a5fb2cdde8397ebfa8388481cb51dba6 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 2 Nov 2020 09:12:18 +0900 Subject: [PATCH 022/719] Add default to CallbackOptions handler args --- examples/oauth_app_settings.py | 5 ++++- slack_bolt/oauth/async_callback_options.py | 6 ++++++ slack_bolt/oauth/async_oauth_flow.py | 22 ++++++++++++++++------ slack_bolt/oauth/callback_options.py | 6 ++++++ slack_bolt/oauth/oauth_flow.py | 22 ++++++++++++++++------ 5 files changed, 48 insertions(+), 13 deletions(-) diff --git a/examples/oauth_app_settings.py b/examples/oauth_app_settings.py index 0d1e39e81..4975de519 100644 --- a/examples/oauth_app_settings.py +++ b/examples/oauth_app_settings.py @@ -18,7 +18,10 @@ def success(args: SuccessArgs) -> BoltResponse: - return BoltResponse(status=200, body="Thanks!") + # Do anything here ... + # Call the default handler to return HTTP response + return args.default.success(args) + # return BoltResponse(status=200, body="Thanks!") def failure(args: FailureArgs) -> BoltResponse: diff --git a/slack_bolt/oauth/async_callback_options.py b/slack_bolt/oauth/async_callback_options.py index 6acdbd3aa..24c453b53 100644 --- a/slack_bolt/oauth/async_callback_options.py +++ b/slack_bolt/oauth/async_callback_options.py @@ -17,16 +17,19 @@ def __init__( # type: ignore request: AsyncBoltRequest, installation: Installation, settings: "AsyncOAuthSettings", + default: "AsyncCallbackOptions", ): """The arguments for a success function. :param request: The request. :param installation: The installation data. :param settings: The settings for OAuth flow. + :param default: The default AsyncCallbackOptions. """ self.request = request self.installation = installation self.settings = settings + self.default = default class AsyncFailureArgs: @@ -38,6 +41,7 @@ def __init__( # type: ignore error: Optional[Exception] = None, suggested_status_code: int, settings: "AsyncOAuthSettings", + default: "AsyncCallbackOptions", ): """The arguments for a failure function. @@ -46,12 +50,14 @@ def __init__( # type: ignore :param error: An exception if exists. :param suggested_status_code: The recommended HTTP status code for the failure. :param settings: The settings for OAuth flow. + :param default: The default AsyncCallbackOptions. """ self.request = request self.reason = reason self.error = error self.suggested_status_code = suggested_status_code self.settings = settings + self.default = default class AsyncCallbackOptions: diff --git a/slack_bolt/oauth/async_oauth_flow.py b/slack_bolt/oauth/async_oauth_flow.py index 3ac865ca5..40c5cc315 100644 --- a/slack_bolt/oauth/async_oauth_flow.py +++ b/slack_bolt/oauth/async_oauth_flow.py @@ -69,12 +69,13 @@ def __init__( self.install_path = self.settings.install_path self.redirect_uri_path = self.settings.redirect_uri_path + self.default_callback_options = DefaultAsyncCallbackOptions( + logger=logger, + state_utils=self.settings.state_utils, + redirect_uri_page_renderer=self.settings.redirect_uri_page_renderer, + ) if settings.callback_options is None: - settings.callback_options = DefaultAsyncCallbackOptions( - logger=logger, - state_utils=self.settings.state_utils, - redirect_uri_page_renderer=self.settings.redirect_uri_page_renderer, - ) + settings.callback_options = self.default_callback_options self.success_handler = settings.callback_options.success self.failure_handler = settings.callback_options.failure @@ -186,6 +187,7 @@ async def handle_callback(self, request: AsyncBoltRequest) -> BoltResponse: reason=error, # type: ignore suggested_status_code=200, settings=self.settings, + default=self.default_callback_options, ) ) @@ -198,6 +200,7 @@ async def handle_callback(self, request: AsyncBoltRequest) -> BoltResponse: reason="invalid_browser", suggested_status_code=400, settings=self.settings, + default=self.default_callback_options, ) ) @@ -209,6 +212,7 @@ async def handle_callback(self, request: AsyncBoltRequest) -> BoltResponse: reason="invalid_state", suggested_status_code=401, settings=self.settings, + default=self.default_callback_options, ) ) @@ -221,6 +225,7 @@ async def handle_callback(self, request: AsyncBoltRequest) -> BoltResponse: reason="missing_code", suggested_status_code=401, settings=self.settings, + default=self.default_callback_options, ) ) @@ -233,6 +238,7 @@ async def handle_callback(self, request: AsyncBoltRequest) -> BoltResponse: reason="invalid_code", suggested_status_code=401, settings=self.settings, + default=self.default_callback_options, ) ) @@ -247,13 +253,17 @@ async def handle_callback(self, request: AsyncBoltRequest) -> BoltResponse: error=err, suggested_status_code=500, settings=self.settings, + default=self.default_callback_options, ) ) # display a successful completion page to the end-user return await self.success_handler( AsyncSuccessArgs( - request=request, installation=installation, settings=self.settings, + request=request, + installation=installation, + settings=self.settings, + default=self.default_callback_options, ) ) diff --git a/slack_bolt/oauth/callback_options.py b/slack_bolt/oauth/callback_options.py index e1368dae1..52a87659c 100644 --- a/slack_bolt/oauth/callback_options.py +++ b/slack_bolt/oauth/callback_options.py @@ -17,16 +17,19 @@ def __init__( # type: ignore request: BoltRequest, installation: Installation, settings: "OAuthSettings", + default: "CallbackOptions", ): """The arguments for a success function. :param request: The request. :param installation: The installation data. :param settings: The settings for OAuth flow. + :param default: The default CallbackOptions. """ self.request = request self.installation = installation self.settings = settings + self.default = default class FailureArgs: @@ -38,6 +41,7 @@ def __init__( # type: ignore error: Optional[Exception] = None, suggested_status_code: int, settings: "OAuthSettings", + default: "CallbackOptions", ): """The arguments for a failure function. @@ -46,12 +50,14 @@ def __init__( # type: ignore :param error: An exception if exists. :param suggested_status_code: The recommended HTTP status code for the failure. :param settings: The settings for OAuth flow. + :param default: The default CallbackOptions. """ self.request = request self.reason = reason self.error = error self.suggested_status_code = suggested_status_code self.settings = settings + self.default = default class CallbackOptions: diff --git a/slack_bolt/oauth/oauth_flow.py b/slack_bolt/oauth/oauth_flow.py index 8d37709d0..5b511aff7 100644 --- a/slack_bolt/oauth/oauth_flow.py +++ b/slack_bolt/oauth/oauth_flow.py @@ -69,12 +69,13 @@ def __init__( self.install_path = self.settings.install_path self.redirect_uri_path = self.settings.redirect_uri_path + self.default_callback_options = DefaultCallbackOptions( + logger=logger, + state_utils=self.settings.state_utils, + redirect_uri_page_renderer=self.settings.redirect_uri_page_renderer, + ) if settings.callback_options is None: - settings.callback_options = DefaultCallbackOptions( - logger=logger, - state_utils=self.settings.state_utils, - redirect_uri_page_renderer=self.settings.redirect_uri_page_renderer, - ) + settings.callback_options = self.default_callback_options self.success_handler = settings.callback_options.success self.failure_handler = settings.callback_options.failure @@ -186,6 +187,7 @@ def handle_callback(self, request: BoltRequest) -> BoltResponse: reason=error, suggested_status_code=200, settings=self.settings, + default=self.default_callback_options, ) ) @@ -198,6 +200,7 @@ def handle_callback(self, request: BoltRequest) -> BoltResponse: reason="invalid_browser", suggested_status_code=400, settings=self.settings, + default=self.default_callback_options, ) ) @@ -209,6 +212,7 @@ def handle_callback(self, request: BoltRequest) -> BoltResponse: reason="invalid_state", suggested_status_code=401, settings=self.settings, + default=self.default_callback_options, ) ) @@ -221,6 +225,7 @@ def handle_callback(self, request: BoltRequest) -> BoltResponse: reason="missing_code", suggested_status_code=401, settings=self.settings, + default=self.default_callback_options, ) ) @@ -233,6 +238,7 @@ def handle_callback(self, request: BoltRequest) -> BoltResponse: reason="invalid_code", suggested_status_code=401, settings=self.settings, + default=self.default_callback_options, ) ) @@ -247,13 +253,17 @@ def handle_callback(self, request: BoltRequest) -> BoltResponse: error=err, suggested_status_code=500, settings=self.settings, + default=self.default_callback_options, ) ) # display a successful completion page to the end-user return self.success_handler( SuccessArgs( - request=request, installation=installation, settings=self.settings, + request=request, + installation=installation, + settings=self.settings, + default=self.default_callback_options, ) ) From d4933199eb6c5205f376e71d6d538999a7054c3a Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 3 Nov 2020 20:17:23 +0900 Subject: [PATCH 023/719] Fix #140 by updating the default install page handler --- slack_bolt/oauth/async_oauth_flow.py | 33 +++++++++++-------- slack_bolt/oauth/internals.py | 19 +++++++++++ slack_bolt/oauth/oauth_flow.py | 33 +++++++++++-------- tests/adapter_tests/test_aws_chalice.py | 5 ++- tests/adapter_tests/test_aws_lambda.py | 10 ++++-- tests/adapter_tests/test_bottle_oauth.py | 9 ++--- tests/adapter_tests/test_cherrypy_oauth.py | 2 +- tests/adapter_tests/test_django.py | 7 +++- tests/adapter_tests/test_falcon.py | 7 ++-- tests/adapter_tests/test_fastapi.py | 9 +++-- tests/adapter_tests/test_flask.py | 2 +- tests/adapter_tests/test_pyramid.py | 5 ++- tests/adapter_tests/test_starlette.py | 9 +++-- tests/adapter_tests/test_tornado_oauth.py | 4 +-- .../adapter_tests_async/test_async_fastapi.py | 9 +++-- tests/adapter_tests_async/test_async_sanic.py | 10 +++--- .../test_async_starlette.py | 10 +++--- tests/slack_bolt/oauth/test_oauth_flow.py | 15 +++------ .../oauth/test_oauth_flow_sqlite3.py | 15 +++------ .../oauth/test_async_oauth_flow.py | 15 +++------ .../oauth/test_async_oauth_flow_sqlite3.py | 15 +++------ 21 files changed, 128 insertions(+), 115 deletions(-) diff --git a/slack_bolt/oauth/async_oauth_flow.py b/slack_bolt/oauth/async_oauth_flow.py index 40c5cc315..b5c1b2fae 100644 --- a/slack_bolt/oauth/async_oauth_flow.py +++ b/slack_bolt/oauth/async_oauth_flow.py @@ -11,6 +11,7 @@ AsyncFailureArgs, ) from slack_bolt.oauth.async_oauth_settings import AsyncOAuthSettings +from slack_bolt.oauth.internals import _build_default_install_page_html from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse from slack_sdk.errors import SlackApiError @@ -151,7 +152,20 @@ def sqlite3( async def handle_installation(self, request: AsyncBoltRequest) -> BoltResponse: state = await self.issue_new_state(request) - return await self.build_authorize_url_redirection(request, state) + url = await self.build_authorize_url(state, request) + html = await self.build_install_page_html(url, request) + set_cookie_value = self.settings.state_utils.build_set_cookie_for_new_state( + state + ) + return BoltResponse( + status=200, + body=html, + headers={ + "Content-Type": "text/html; charset=utf-8", + "Content-Length": len(bytes(html, "utf-8")), + "Set-Cookie": [set_cookie_value], + }, + ) # ---------------------- # Internal methods for Installation @@ -159,18 +173,11 @@ async def handle_installation(self, request: AsyncBoltRequest) -> BoltResponse: async def issue_new_state(self, request: AsyncBoltRequest) -> str: return await self.settings.state_store.async_issue() - async def build_authorize_url_redirection( - self, request: AsyncBoltRequest, state: str - ) -> BoltResponse: - return BoltResponse( - status=302, - headers={ - "Location": [self.settings.authorize_url_generator.generate(state)], - "Set-Cookie": [ - self.settings.state_utils.build_set_cookie_for_new_state(state) - ], - }, - ) + async def build_authorize_url(self, state: str, request: AsyncBoltRequest) -> str: + return self.settings.authorize_url_generator.generate(state) + + async def build_install_page_html(self, url: str, request: AsyncBoltRequest) -> str: + return _build_default_install_page_html(url) # ----------------------------- # Callback diff --git a/slack_bolt/oauth/internals.py b/slack_bolt/oauth/internals.py index 510f59bfb..6cfb53f4a 100644 --- a/slack_bolt/oauth/internals.py +++ b/slack_bolt/oauth/internals.py @@ -64,3 +64,22 @@ def _build_callback_failure_response( # type: ignore }, body=html, ) + + +def _build_default_install_page_html(url: str) -> str: + return f""" + + + + +

Slack App Installation

+

+ + +""" diff --git a/slack_bolt/oauth/oauth_flow.py b/slack_bolt/oauth/oauth_flow.py index 5b511aff7..c6b39023b 100644 --- a/slack_bolt/oauth/oauth_flow.py +++ b/slack_bolt/oauth/oauth_flow.py @@ -10,6 +10,7 @@ DefaultCallbackOptions, CallbackOptions, ) +from slack_bolt.oauth.internals import _build_default_install_page_html from slack_bolt.oauth.oauth_settings import OAuthSettings from slack_bolt.request import BoltRequest @@ -151,7 +152,20 @@ def sqlite3( def handle_installation(self, request: BoltRequest) -> BoltResponse: state = self.issue_new_state(request) - return self.build_authorize_url_redirection(request, state) + url = self.build_authorize_url(state, request) + html = self.build_install_page_html(url, request) + set_cookie_value = self.settings.state_utils.build_set_cookie_for_new_state( + state + ) + return BoltResponse( + status=200, + body=html, + headers={ + "Content-Type": "text/html; charset=utf-8", + "Content-Length": len(bytes(html, "utf-8")), + "Set-Cookie": [set_cookie_value], + }, + ) # ---------------------- # Internal methods for Installation @@ -159,18 +173,11 @@ def handle_installation(self, request: BoltRequest) -> BoltResponse: def issue_new_state(self, request: BoltRequest) -> str: return self.settings.state_store.issue() - def build_authorize_url_redirection( - self, request: BoltRequest, state: str - ) -> BoltResponse: - return BoltResponse( - status=302, - headers={ - "Location": [self.settings.authorize_url_generator.generate(state)], - "Set-Cookie": [ - self.settings.state_utils.build_set_cookie_for_new_state(state) - ], - }, - ) + def build_authorize_url(self, state: str, request: BoltRequest) -> str: + return self.settings.authorize_url_generator.generate(state) + + def build_install_page_html(self, url: str, request: BoltRequest) -> str: + return _build_default_install_page_html(url) # ----------------------------- # Callback diff --git a/tests/adapter_tests/test_aws_chalice.py b/tests/adapter_tests/test_aws_chalice.py index 9ee64dd49..80125027c 100644 --- a/tests/adapter_tests/test_aws_chalice.py +++ b/tests/adapter_tests/test_aws_chalice.py @@ -272,4 +272,7 @@ def install() -> Response: response: Dict[str, Any] = LocalGateway(chalice_app, Config()).handle_request( method="GET", path="/slack/install", body="", headers={} ) - assert response["statusCode"] == 302 + assert response["statusCode"] == 200 + assert response["headers"]["content-type"] == "text/html; charset=utf-8" + assert response["headers"]["content-length"] == "565" + assert response.get("body") is not None diff --git a/tests/adapter_tests/test_aws_lambda.py b/tests/adapter_tests/test_aws_lambda.py index 62793a837..4c8683c12 100644 --- a/tests/adapter_tests/test_aws_lambda.py +++ b/tests/adapter_tests/test_aws_lambda.py @@ -283,7 +283,10 @@ def test_oauth(self): "isBase64Encoded": False, } response = SlackRequestHandler(app).handle(event, self.context) - assert response["statusCode"] == 302 + assert response["statusCode"] == 200 + assert response["headers"]["content-type"] == "text/html; charset=utf-8" + assert response["headers"]["content-length"] == "565" + assert response.get("body") is not None event = { "body": "", @@ -293,4 +296,7 @@ def test_oauth(self): "isBase64Encoded": False, } response = SlackRequestHandler(app).handle(event, self.context) - assert response["statusCode"] == 302 + assert response["statusCode"] == 200 + assert response["headers"]["content-type"] == "text/html; charset=utf-8" + assert response["headers"]["content-length"] == "565" + assert response.get("body") is not None diff --git a/tests/adapter_tests/test_bottle_oauth.py b/tests/adapter_tests/test_bottle_oauth.py index b45c71631..1984bfab3 100644 --- a/tests/adapter_tests/test_bottle_oauth.py +++ b/tests/adapter_tests/test_bottle_oauth.py @@ -26,9 +26,6 @@ class TestBottle: def test_oauth(self): with boddle(method="GET", path="/slack/install"): response_body = install() - assert response_body == "" - assert response.status_code == 302 - assert re.match( - "https://slack.com/oauth/v2/authorize\\?state=[^&]+&client_id=111.111&scope=chat:write,commands&user_scope=", - response.headers["Location"], - ) + assert response.status_code == 200 + assert response.headers.get("content-type") == "text/html; charset=utf-8" + assert "https://slack.com/oauth/v2/authorize?state=" in response_body diff --git a/tests/adapter_tests/test_cherrypy_oauth.py b/tests/adapter_tests/test_cherrypy_oauth.py index cbda0b06c..ce8524bc8 100644 --- a/tests/adapter_tests/test_cherrypy_oauth.py +++ b/tests/adapter_tests/test_cherrypy_oauth.py @@ -49,4 +49,4 @@ def teardown_class(cls): def test_oauth(self): cherrypy.request.process_request_body = False self.getPage("/slack/install", method="GET") - self.assertStatus("302 Found") + self.assertStatus("200 OK") diff --git a/tests/adapter_tests/test_django.py b/tests/adapter_tests/test_django.py index 108dc256d..21836fc50 100644 --- a/tests/adapter_tests/test_django.py +++ b/tests/adapter_tests/test_django.py @@ -170,4 +170,9 @@ def test_oauth(self): ) request = self.rf.get("/slack/install") response = SlackRequestHandler(app).handle(request) - assert response.status_code == 302 + assert response.status_code == 200 + assert response.get("content-type") == "text/html; charset=utf-8" + assert response.get("content-length") == "565" + assert "https://slack.com/oauth/v2/authorize?state=" in response.content.decode( + "utf-8" + ) diff --git a/tests/adapter_tests/test_falcon.py b/tests/adapter_tests/test_falcon.py index 8a00d90fe..621b767c5 100644 --- a/tests/adapter_tests/test_falcon.py +++ b/tests/adapter_tests/test_falcon.py @@ -179,8 +179,5 @@ def test_oauth(self): client = testing.TestClient(api) response = client.simulate_get("/slack/install") - assert response.status_code == 302 - assert re.match( - "https://slack.com/oauth/v2/authorize\\?state=[^&]+&client_id=111.111&scope=chat:write,commands&user_scope=", - response.headers["Location"], - ) + assert response.status_code == 200 + assert "https://slack.com/oauth/v2/authorize?state=" in response.text diff --git a/tests/adapter_tests/test_fastapi.py b/tests/adapter_tests/test_fastapi.py index 6bc01c4ca..fa6c18feb 100644 --- a/tests/adapter_tests/test_fastapi.py +++ b/tests/adapter_tests/test_fastapi.py @@ -192,8 +192,7 @@ async def endpoint(req: Request): client = TestClient(api) response = client.get("/slack/install", allow_redirects=False) - assert response.status_code == 302 - assert re.match( - "https://slack.com/oauth/v2/authorize\\?state=[^&]+&client_id=111.111&scope=chat:write,commands&user_scope=", - response.headers["Location"], - ) + assert response.status_code == 200 + assert response.headers.get("content-type") == "text/html; charset=utf-8" + assert response.headers.get("content-length") == "565" + assert "https://slack.com/oauth/v2/authorize?state=" in response.text diff --git a/tests/adapter_tests/test_flask.py b/tests/adapter_tests/test_flask.py index 6776b98f8..30d58fc35 100644 --- a/tests/adapter_tests/test_flask.py +++ b/tests/adapter_tests/test_flask.py @@ -185,4 +185,4 @@ def endpoint(): with flask_app.test_client() as client: rv = client.get("/slack/install") - assert rv.status_code == 302 + assert rv.status_code == 200 diff --git a/tests/adapter_tests/test_pyramid.py b/tests/adapter_tests/test_pyramid.py index 5e4180151..5c5d78cd8 100644 --- a/tests/adapter_tests/test_pyramid.py +++ b/tests/adapter_tests/test_pyramid.py @@ -175,4 +175,7 @@ def test_oauth(self): request.path = "/slack/install" request.method = "GET" response: Response = SlackRequestHandler(app).handle(request) - assert response.status_code == 302 + assert response.status_code == 200 + assert "https://slack.com/oauth/v2/authorize?state=" in response.body.decode( + "utf-8" + ) diff --git a/tests/adapter_tests/test_starlette.py b/tests/adapter_tests/test_starlette.py index f662e8840..a8842c43d 100644 --- a/tests/adapter_tests/test_starlette.py +++ b/tests/adapter_tests/test_starlette.py @@ -201,8 +201,7 @@ async def endpoint(req: Request): ) client = TestClient(api) response = client.get("/slack/install", allow_redirects=False) - assert response.status_code == 302 - assert re.match( - "https://slack.com/oauth/v2/authorize\\?state=[^&]+&client_id=111.111&scope=chat:write,commands&user_scope=", - response.headers["Location"], - ) + assert response.status_code == 200 + assert response.headers.get("content-type") == "text/html; charset=utf-8" + assert response.headers.get("content-length") == "565" + assert "https://slack.com/oauth/v2/authorize?state=" in response.text diff --git a/tests/adapter_tests/test_tornado_oauth.py b/tests/adapter_tests/test_tornado_oauth.py index dd892f3bc..c42468f2a 100644 --- a/tests/adapter_tests/test_tornado_oauth.py +++ b/tests/adapter_tests/test_tornado_oauth.py @@ -37,6 +37,6 @@ async def test_oauth(self): ) try: response: HTTPResponse = await self.http_client.fetch(request) - assert response.code == 302 + assert response.code == 200 except tornado.httpclient.HTTPClientError as e: - assert e.code == 302 + assert e.code == 200 diff --git a/tests/adapter_tests_async/test_async_fastapi.py b/tests/adapter_tests_async/test_async_fastapi.py index 6c08011a4..580942a9c 100644 --- a/tests/adapter_tests_async/test_async_fastapi.py +++ b/tests/adapter_tests_async/test_async_fastapi.py @@ -192,8 +192,7 @@ async def endpoint(req: Request): client = TestClient(api) response = client.get("/slack/install", allow_redirects=False) - assert response.status_code == 302 - assert re.match( - "https://slack.com/oauth/v2/authorize\\?state=[^&]+&client_id=111.111&scope=chat:write,commands&user_scope=", - response.headers["Location"], - ) + assert response.status_code == 200 + assert response.headers.get("content-type") == "text/html; charset=utf-8" + assert response.headers.get("content-length") == "565" + assert "https://slack.com/oauth/v2/authorize?state=" in response.text diff --git a/tests/adapter_tests_async/test_async_sanic.py b/tests/adapter_tests_async/test_async_sanic.py index ef0438f1c..f9237026f 100644 --- a/tests/adapter_tests_async/test_async_sanic.py +++ b/tests/adapter_tests_async/test_async_sanic.py @@ -199,8 +199,8 @@ async def endpoint(req: Request): _, response = await api.asgi_client.get( url="/slack/install", allow_redirects=False ) - assert response.status_code == 302 - assert re.match( - "https://slack.com/oauth/v2/authorize\\?state=[^&]+&client_id=111.111&scope=chat:write,commands&user_scope=", - response.headers["Location"], - ) + assert response.status_code == 200 + assert response.status_code == 200 + assert response.headers.get("content-type") == "text/html; charset=utf-8" + assert response.headers.get("content-length") == "565" + assert "https://slack.com/oauth/v2/authorize?state=" in response.text diff --git a/tests/adapter_tests_async/test_async_starlette.py b/tests/adapter_tests_async/test_async_starlette.py index 2214e5c59..ae1903325 100644 --- a/tests/adapter_tests_async/test_async_starlette.py +++ b/tests/adapter_tests_async/test_async_starlette.py @@ -202,8 +202,8 @@ async def endpoint(req: Request): client = TestClient(api) response = client.get("/slack/install", allow_redirects=False) - assert response.status_code == 302 - assert re.match( - "https://slack.com/oauth/v2/authorize\\?state=[^&]+&client_id=111.111&scope=chat:write,commands&user_scope=", - response.headers["Location"], - ) + assert response.status_code == 200 + assert response.status_code == 200 + assert response.headers.get("content-type") == "text/html; charset=utf-8" + assert response.headers.get("content-length") == "565" + assert "https://slack.com/oauth/v2/authorize?state=" in response.text diff --git a/tests/slack_bolt/oauth/test_oauth_flow.py b/tests/slack_bolt/oauth/test_oauth_flow.py index e228890b9..f3b624c54 100644 --- a/tests/slack_bolt/oauth/test_oauth_flow.py +++ b/tests/slack_bolt/oauth/test_oauth_flow.py @@ -53,17 +53,10 @@ def test_handle_installation(self): ) req = BoltRequest(body="") resp = oauth_flow.handle_installation(req) - assert resp.status == 302 - url = resp.headers["location"][0] - assert ( - re.compile( - "https://slack.com/oauth/v2/authorize\\?state=[-0-9a-z]+." - "&client_id=111\\.222" - "&scope=chat:write,commands" - "&user_scope=" - ).match(url) - is not None - ) + assert resp.status == 200 + assert resp.headers.get("content-type") == ["text/html; charset=utf-8"] + assert resp.headers.get("content-length") == ["565"] + assert "https://slack.com/oauth/v2/authorize?state=" in resp.body def test_handle_callback(self): oauth_flow = OAuthFlow( diff --git a/tests/slack_bolt/oauth/test_oauth_flow_sqlite3.py b/tests/slack_bolt/oauth/test_oauth_flow_sqlite3.py index 367349cc2..f9e3a6aae 100644 --- a/tests/slack_bolt/oauth/test_oauth_flow_sqlite3.py +++ b/tests/slack_bolt/oauth/test_oauth_flow_sqlite3.py @@ -41,17 +41,10 @@ def test_handle_installation(self): ) req = BoltRequest(body="") resp = oauth_flow.handle_installation(req) - assert resp.status == 302 - url = resp.headers["location"][0] - assert ( - re.compile( - "https://slack.com/oauth/v2/authorize\\?state=[-0-9a-z]+." - "&client_id=111\\.222" - "&scope=chat:write,commands" - "&user_scope=" - ).match(url) - is not None - ) + assert resp.status == 200 + assert resp.headers.get("content-type") == ["text/html; charset=utf-8"] + assert resp.headers.get("content-length") == ["565"] + assert "https://slack.com/oauth/v2/authorize?state=" in resp.body def test_handle_callback(self): oauth_flow = OAuthFlow.sqlite3( diff --git a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py index c70e3dfeb..2537f6e10 100644 --- a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py +++ b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py @@ -68,17 +68,10 @@ async def test_handle_installation(self): ) req = AsyncBoltRequest(body="") resp = await oauth_flow.handle_installation(req) - assert resp.status == 302 - url = resp.headers["location"][0] - assert ( - re.compile( - "https://slack.com/oauth/v2/authorize\\?state=[-0-9a-z]+." - "&client_id=111\\.222" - "&scope=chat:write,commands" - "&user_scope=" - ).match(url) - is not None - ) + assert resp.status == 200 + assert resp.headers.get("content-type") == ["text/html; charset=utf-8"] + assert resp.headers.get("content-length") == ["565"] + assert "https://slack.com/oauth/v2/authorize?state=" in resp.body @pytest.mark.asyncio async def test_handle_callback(self): diff --git a/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py b/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py index 4697f6e2a..93a054b0f 100644 --- a/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py +++ b/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py @@ -54,17 +54,10 @@ async def test_handle_installation(self): ) req = AsyncBoltRequest(body="") resp = await oauth_flow.handle_installation(req) - assert resp.status == 302 - url = resp.headers["location"][0] - assert ( - re.compile( - "https://slack.com/oauth/v2/authorize\\?state=[-0-9a-z]+." - "&client_id=111\\.222" - "&scope=chat:write,commands" - "&user_scope=" - ).match(url) - is not None - ) + assert resp.status == 200 + assert resp.headers.get("content-type") == ["text/html; charset=utf-8"] + assert resp.headers.get("content-length") == ["565"] + assert "https://slack.com/oauth/v2/authorize?state=" in resp.body @pytest.mark.asyncio async def test_handle_callback(self): From 68e9c253cc936e0f03143cb4a2575affa0bf247e Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 4 Nov 2020 13:54:31 +0900 Subject: [PATCH 024/719] Tweak test code --- tests/adapter_tests/test_aws_chalice.py | 2 +- tests/adapter_tests/test_aws_lambda.py | 2 +- tests/adapter_tests/test_bottle_oauth.py | 2 -- tests/adapter_tests/test_falcon.py | 1 - tests/adapter_tests/test_fastapi.py | 1 - tests/adapter_tests/test_starlette.py | 1 - tests/adapter_tests_async/test_async_fastapi.py | 1 - tests/adapter_tests_async/test_async_sanic.py | 2 -- tests/adapter_tests_async/test_async_starlette.py | 2 -- tests/slack_bolt/oauth/test_oauth_flow.py | 1 - tests/slack_bolt/oauth/test_oauth_flow_sqlite3.py | 2 -- tests/slack_bolt_async/oauth/test_async_oauth_flow.py | 1 - tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py | 1 - 13 files changed, 2 insertions(+), 17 deletions(-) diff --git a/tests/adapter_tests/test_aws_chalice.py b/tests/adapter_tests/test_aws_chalice.py index 80125027c..a9f4912f7 100644 --- a/tests/adapter_tests/test_aws_chalice.py +++ b/tests/adapter_tests/test_aws_chalice.py @@ -275,4 +275,4 @@ def install() -> Response: assert response["statusCode"] == 200 assert response["headers"]["content-type"] == "text/html; charset=utf-8" assert response["headers"]["content-length"] == "565" - assert response.get("body") is not None + assert "https://slack.com/oauth/v2/authorize?state=" in response.get("body") diff --git a/tests/adapter_tests/test_aws_lambda.py b/tests/adapter_tests/test_aws_lambda.py index 4c8683c12..d2e638efd 100644 --- a/tests/adapter_tests/test_aws_lambda.py +++ b/tests/adapter_tests/test_aws_lambda.py @@ -299,4 +299,4 @@ def test_oauth(self): assert response["statusCode"] == 200 assert response["headers"]["content-type"] == "text/html; charset=utf-8" assert response["headers"]["content-length"] == "565" - assert response.get("body") is not None + assert "https://slack.com/oauth/v2/authorize?state=" in response.get("body") diff --git a/tests/adapter_tests/test_bottle_oauth.py b/tests/adapter_tests/test_bottle_oauth.py index 1984bfab3..37fd6b25d 100644 --- a/tests/adapter_tests/test_bottle_oauth.py +++ b/tests/adapter_tests/test_bottle_oauth.py @@ -1,5 +1,3 @@ -import re - from slack_bolt.adapter.bottle import SlackRequestHandler from slack_bolt.app import App from slack_bolt.oauth.oauth_settings import OAuthSettings diff --git a/tests/adapter_tests/test_falcon.py b/tests/adapter_tests/test_falcon.py index 621b767c5..e18374473 100644 --- a/tests/adapter_tests/test_falcon.py +++ b/tests/adapter_tests/test_falcon.py @@ -1,5 +1,4 @@ import json -import re from time import time from urllib.parse import quote diff --git a/tests/adapter_tests/test_fastapi.py b/tests/adapter_tests/test_fastapi.py index fa6c18feb..2de6ef069 100644 --- a/tests/adapter_tests/test_fastapi.py +++ b/tests/adapter_tests/test_fastapi.py @@ -1,5 +1,4 @@ import json -import re from time import time from urllib.parse import quote diff --git a/tests/adapter_tests/test_starlette.py b/tests/adapter_tests/test_starlette.py index a8842c43d..9ab513d26 100644 --- a/tests/adapter_tests/test_starlette.py +++ b/tests/adapter_tests/test_starlette.py @@ -1,5 +1,4 @@ import json -import re from time import time from urllib.parse import quote diff --git a/tests/adapter_tests_async/test_async_fastapi.py b/tests/adapter_tests_async/test_async_fastapi.py index 580942a9c..41b8a332e 100644 --- a/tests/adapter_tests_async/test_async_fastapi.py +++ b/tests/adapter_tests_async/test_async_fastapi.py @@ -1,5 +1,4 @@ import json -import re from time import time from urllib.parse import quote diff --git a/tests/adapter_tests_async/test_async_sanic.py b/tests/adapter_tests_async/test_async_sanic.py index f9237026f..587f858b6 100644 --- a/tests/adapter_tests_async/test_async_sanic.py +++ b/tests/adapter_tests_async/test_async_sanic.py @@ -1,6 +1,5 @@ import asyncio import json -import re from time import time from urllib.parse import quote @@ -200,7 +199,6 @@ async def endpoint(req: Request): url="/slack/install", allow_redirects=False ) assert response.status_code == 200 - assert response.status_code == 200 assert response.headers.get("content-type") == "text/html; charset=utf-8" assert response.headers.get("content-length") == "565" assert "https://slack.com/oauth/v2/authorize?state=" in response.text diff --git a/tests/adapter_tests_async/test_async_starlette.py b/tests/adapter_tests_async/test_async_starlette.py index ae1903325..17c81715f 100644 --- a/tests/adapter_tests_async/test_async_starlette.py +++ b/tests/adapter_tests_async/test_async_starlette.py @@ -1,5 +1,4 @@ import json -import re from time import time from urllib.parse import quote @@ -203,7 +202,6 @@ async def endpoint(req: Request): client = TestClient(api) response = client.get("/slack/install", allow_redirects=False) assert response.status_code == 200 - assert response.status_code == 200 assert response.headers.get("content-type") == "text/html; charset=utf-8" assert response.headers.get("content-length") == "565" assert "https://slack.com/oauth/v2/authorize?state=" in response.text diff --git a/tests/slack_bolt/oauth/test_oauth_flow.py b/tests/slack_bolt/oauth/test_oauth_flow.py index f3b624c54..5d390f7bf 100644 --- a/tests/slack_bolt/oauth/test_oauth_flow.py +++ b/tests/slack_bolt/oauth/test_oauth_flow.py @@ -1,5 +1,4 @@ import json -import re from time import time from urllib.parse import quote diff --git a/tests/slack_bolt/oauth/test_oauth_flow_sqlite3.py b/tests/slack_bolt/oauth/test_oauth_flow_sqlite3.py index f9e3a6aae..00b3ad12b 100644 --- a/tests/slack_bolt/oauth/test_oauth_flow_sqlite3.py +++ b/tests/slack_bolt/oauth/test_oauth_flow_sqlite3.py @@ -1,5 +1,3 @@ -import re - from slack_sdk import WebClient from slack_bolt import BoltRequest, BoltResponse diff --git a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py index 2537f6e10..85968ed0c 100644 --- a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py +++ b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py @@ -1,6 +1,5 @@ import asyncio import json -import re from time import time from urllib.parse import quote diff --git a/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py b/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py index 93a054b0f..3c17ca49e 100644 --- a/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py +++ b/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py @@ -1,5 +1,4 @@ import asyncio -import re import pytest from slack_sdk.web.async_client import AsyncWebClient From c2795900947eb8bc8ac8b77860edef4850d130c4 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sun, 1 Nov 2020 11:10:37 +0900 Subject: [PATCH 025/719] Improve the app.installation_store field consistency --- slack_bolt/app/app.py | 24 +++++++++---- slack_bolt/app/async_app.py | 25 +++++++++---- slack_bolt/logger/messages.py | 4 +++ slack_bolt/oauth/async_internals.py | 45 ++++++++++++++++++++++++ slack_bolt/oauth/async_oauth_settings.py | 6 ++-- slack_bolt/oauth/internals.py | 43 +++++++++++++++++++++- slack_bolt/oauth/oauth_settings.py | 6 ++-- tests/scenario_tests/test_app.py | 34 ++++++++++++++++++ tests/scenario_tests_async/test_app.py | 45 +++++++++++++++++++++--- 9 files changed, 208 insertions(+), 24 deletions(-) create mode 100644 slack_bolt/oauth/async_internals.py diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index e0e61fc20..cc97b19ba 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -55,6 +55,7 @@ from slack_bolt.middleware.message_listener_matches import MessageListenerMatches from slack_bolt.middleware.url_verification import UrlVerification from slack_bolt.oauth import OAuthFlow +from slack_bolt.oauth.internals import select_consistent_installation_store from slack_bolt.oauth.oauth_settings import OAuthSettings from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse @@ -157,17 +158,28 @@ def __init__( if oauth_flow: self._oauth_flow = oauth_flow - if self._installation_store is None: - self._installation_store = self._oauth_flow.settings.installation_store + installation_store = select_consistent_installation_store( + client_id=self._oauth_flow.client_id, + app_store=self._installation_store, + oauth_flow_store=self._oauth_flow.settings.installation_store, + logger=self._framework_logger, + ) + self._installation_store = installation_store + self._oauth_flow.settings.installation_store = installation_store + if self._oauth_flow._client is None: self._oauth_flow._client = self._client if self._authorize is None: self._authorize = self._oauth_flow.settings.authorize elif oauth_settings is not None: - if self._installation_store: - # Consistently use a single installation_store - oauth_settings.installation_store = self._installation_store - + installation_store = select_consistent_installation_store( + client_id=oauth_settings.client_id, + app_store=self._installation_store, + oauth_flow_store=oauth_settings.installation_store, + logger=self._framework_logger, + ) + self._installation_store = installation_store + oauth_settings.installation_store = installation_store self._oauth_flow = OAuthFlow( client=self.client, logger=self.logger, settings=oauth_settings ) diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 1051e0b4d..9e3db0cb4 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -7,6 +7,7 @@ from slack_bolt.middleware.message_listener_matches.async_message_listener_matches import ( AsyncMessageListenerMatches, ) +from slack_bolt.oauth.async_internals import select_consistent_installation_store from slack_bolt.workflows.step.async_step import AsyncWorkflowStep from slack_bolt.workflows.step.async_step_middleware import AsyncWorkflowStepMiddleware from slack_sdk.oauth.installation_store.async_installation_store import ( @@ -167,18 +168,28 @@ def __init__( if oauth_flow: self._async_oauth_flow = oauth_flow - if self._async_installation_store is None: - self._async_installation_store = ( - self._async_oauth_flow.settings.installation_store - ) + installation_store = select_consistent_installation_store( + client_id=self._async_oauth_flow.client_id, + app_store=self._async_installation_store, + oauth_flow_store=self._async_oauth_flow.settings.installation_store, + logger=self._framework_logger, + ) + self._async_installation_store = installation_store + self._async_oauth_flow.settings.installation_store = installation_store + if self._async_oauth_flow._async_client is None: self._async_oauth_flow._async_client = self._async_client if self._async_authorize is None: self._async_authorize = self._async_oauth_flow.settings.authorize elif oauth_settings is not None: - if self._async_installation_store: - # Consistently use a single installation_store - oauth_settings.installation_store = self._async_installation_store + installation_store = select_consistent_installation_store( + client_id=oauth_settings.client_id, + app_store=self._async_installation_store, + oauth_flow_store=oauth_settings.installation_store, + logger=self._framework_logger, + ) + self._async_installation_store = installation_store + oauth_settings.installation_store = installation_store self._async_oauth_flow = AsyncOAuthFlow( client=self._async_client, logger=self.logger, settings=oauth_settings diff --git a/slack_bolt/logger/messages.py b/slack_bolt/logger/messages.py index 75abe3e39..29ee7bfe0 100644 --- a/slack_bolt/logger/messages.py +++ b/slack_bolt/logger/messages.py @@ -64,6 +64,10 @@ def warning_token_skipped() -> str: ) +def warning_installation_store_conflicts() -> str: + return "As you gave both `installation_store` and `oauth_settings`/`auth_flow`, the top level one is unused." + + def warning_unhandled_request(req: Union[BoltRequest, "AsyncBoltRequest"]) -> str: # type: ignore return f"Unhandled request ({req.body})" diff --git a/slack_bolt/oauth/async_internals.py b/slack_bolt/oauth/async_internals.py new file mode 100644 index 000000000..be46a9d94 --- /dev/null +++ b/slack_bolt/oauth/async_internals.py @@ -0,0 +1,45 @@ +from logging import Logger +from typing import Optional + +from slack_sdk.oauth.installation_store import FileInstallationStore +from slack_sdk.oauth.installation_store.async_installation_store import ( + AsyncInstallationStore, +) + +from ..logger.messages import warning_installation_store_conflicts + +# key: client_id, value: AsyncInstallationStore +default_installation_stores = {} + + +def get_or_create_default_installation_store(client_id: str) -> AsyncInstallationStore: + store = default_installation_stores.get(client_id) + if store is None: + store = FileInstallationStore(client_id=client_id) + default_installation_stores[client_id] = store + return store + + +def select_consistent_installation_store( + client_id: str, + app_store: Optional[AsyncInstallationStore], + oauth_flow_store: Optional[AsyncInstallationStore], + logger: Logger, +) -> Optional[AsyncInstallationStore]: + default = get_or_create_default_installation_store(client_id) + if app_store is not None: + if oauth_flow_store is not None: + if oauth_flow_store is default: + # only app_store is intentionally set in this case + return app_store + + # if both are intentionally set, prioritize app_store + if oauth_flow_store is not app_store: + logger.warning(warning_installation_store_conflicts()) + return oauth_flow_store + else: + # only app_store is available + return app_store + else: + # only oauth_flow_store is available + return oauth_flow_store diff --git a/slack_bolt/oauth/async_oauth_settings.py b/slack_bolt/oauth/async_oauth_settings.py index 01b2e43a5..89fb8e625 100644 --- a/slack_bolt/oauth/async_oauth_settings.py +++ b/slack_bolt/oauth/async_oauth_settings.py @@ -8,7 +8,6 @@ AuthorizeUrlGenerator, RedirectUriPageRenderer, ) -from slack_sdk.oauth.installation_store import FileInstallationStore from slack_sdk.oauth.installation_store.async_installation_store import ( AsyncInstallationStore, ) @@ -20,6 +19,7 @@ AsyncAuthorize, ) from slack_bolt.error import BoltError +from slack_bolt.oauth.async_internals import get_or_create_default_installation_store from slack_bolt.oauth.callback_options import CallbackOptions @@ -122,8 +122,8 @@ def __init__( authorization_url or "https://slack.com/oauth/v2/authorize" ) # Installation Management - self.installation_store = installation_store or FileInstallationStore( - client_id=client_id + self.installation_store = ( + installation_store or get_or_create_default_installation_store(client_id) ) self.authorize = AsyncInstallationStoreAuthorize( logger=logger, installation_store=self.installation_store, diff --git a/slack_bolt/oauth/internals.py b/slack_bolt/oauth/internals.py index 6cfb53f4a..bc237eb7a 100644 --- a/slack_bolt/oauth/internals.py +++ b/slack_bolt/oauth/internals.py @@ -1,11 +1,15 @@ from logging import Logger -from typing import Optional, Union +from typing import Optional +from typing import Union +from slack_sdk.oauth import InstallationStore from slack_sdk.oauth import OAuthStateUtils, RedirectUriPageRenderer +from slack_sdk.oauth.installation_store import FileInstallationStore from slack_sdk.oauth.installation_store import Installation from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse +from ..logger.messages import warning_installation_store_conflicts class CallbackResponseBuilder: @@ -83,3 +87,40 @@ def _build_default_install_page_html(url: str) -> str: """ + + +# key: client_id, value: InstallationStore +default_installation_stores = {} + + +def get_or_create_default_installation_store(client_id: str) -> InstallationStore: + store = default_installation_stores.get(client_id) + if store is None: + store = FileInstallationStore(client_id=client_id) + default_installation_stores[client_id] = store + return store + + +def select_consistent_installation_store( + client_id: str, + app_store: Optional[InstallationStore], + oauth_flow_store: Optional[InstallationStore], + logger: Logger, +) -> Optional[InstallationStore]: + default = get_or_create_default_installation_store(client_id) + if app_store is not None: + if oauth_flow_store is not None: + if oauth_flow_store is default: + # only app_store is intentionally set in this case + return app_store + + # if both are intentionally set, prioritize app_store + if oauth_flow_store is not app_store: + logger.warning(warning_installation_store_conflicts()) + return oauth_flow_store + else: + # only app_store is available + return app_store + else: + # only oauth_flow_store is available + return oauth_flow_store diff --git a/slack_bolt/oauth/oauth_settings.py b/slack_bolt/oauth/oauth_settings.py index 3cc82c834..089d7440a 100644 --- a/slack_bolt/oauth/oauth_settings.py +++ b/slack_bolt/oauth/oauth_settings.py @@ -10,11 +10,11 @@ AuthorizeUrlGenerator, RedirectUriPageRenderer, ) -from slack_sdk.oauth.installation_store import FileInstallationStore from slack_sdk.oauth.state_store import FileOAuthStateStore from slack_bolt.authorization.authorize import Authorize, InstallationStoreAuthorize from slack_bolt.error import BoltError +from slack_bolt.oauth.internals import get_or_create_default_installation_store from slack_bolt.oauth.callback_options import CallbackOptions @@ -116,8 +116,8 @@ def __init__( authorization_url or "https://slack.com/oauth/v2/authorize" ) # Installation Management - self.installation_store = installation_store or FileInstallationStore( - client_id=client_id + self.installation_store = ( + installation_store or get_or_create_default_installation_store(client_id) ) self.authorize = InstallationStoreAuthorize( logger=logger, installation_store=self.installation_store, diff --git a/tests/scenario_tests/test_app.py b/tests/scenario_tests/test_app.py index fcf7b29d6..3667a7a09 100644 --- a/tests/scenario_tests/test_app.py +++ b/tests/scenario_tests/test_app.py @@ -121,3 +121,37 @@ def authorize() -> AuthorizeResult: with pytest.raises(BoltError): App(signing_secret="valid", authorize=authorize, oauth_flow=oauth_flow) + + def test_installation_store_conflicts(self): + store1 = FileInstallationStore() + store2 = FileInstallationStore() + app = App( + signing_secret="valid", + oauth_settings=OAuthSettings( + client_id="111.222", client_secret="valid", installation_store=store1, + ), + installation_store=store2, + ) + assert app.installation_store is store1 + + app = App( + signing_secret="valid", + oauth_flow=OAuthFlow( + settings=OAuthSettings( + client_id="111.222", + client_secret="valid", + installation_store=store1, + ) + ), + installation_store=store2, + ) + assert app.installation_store is store1 + + app = App( + signing_secret="valid", + oauth_flow=OAuthFlow( + settings=OAuthSettings(client_id="111.222", client_secret="valid",) + ), + installation_store=store1, + ) + assert app.installation_store is store1 diff --git a/tests/scenario_tests_async/test_app.py b/tests/scenario_tests_async/test_app.py index cd3b37865..f9e38f9ab 100644 --- a/tests/scenario_tests_async/test_app.py +++ b/tests/scenario_tests_async/test_app.py @@ -8,7 +8,6 @@ from slack_bolt.error import BoltError from slack_bolt.oauth.async_oauth_flow import AsyncOAuthFlow from slack_bolt.oauth.async_oauth_settings import AsyncOAuthSettings -from slack_bolt.oauth.oauth_settings import OAuthSettings from tests.utils import remove_os_env_temporarily, restore_os_env @@ -90,18 +89,22 @@ def test_valid_multi_auth_client_id_absence(self): with pytest.raises(BoltError): AsyncApp( signing_secret="valid", - oauth_settings=OAuthSettings(client_id=None, client_secret="valid"), + oauth_settings=AsyncOAuthSettings( + client_id=None, client_secret="valid" + ), ) def test_valid_multi_auth_secret_absence(self): with pytest.raises(BoltError): AsyncApp( signing_secret="valid", - oauth_settings=OAuthSettings(client_id="111.222", client_secret=None), + oauth_settings=AsyncOAuthSettings( + client_id="111.222", client_secret=None + ), ) def test_authorize_conflicts(self): - oauth_settings = OAuthSettings( + oauth_settings = AsyncOAuthSettings( client_id="111.222", client_secret="valid", installation_store=FileInstallationStore(), @@ -127,3 +130,37 @@ def authorize() -> AuthorizeResult: with pytest.raises(BoltError): AsyncApp(signing_secret="valid", authorize=authorize, oauth_flow=oauth_flow) + + def test_installation_store_conflicts(self): + store1 = FileInstallationStore() + store2 = FileInstallationStore() + app = AsyncApp( + signing_secret="valid", + oauth_settings=AsyncOAuthSettings( + client_id="111.222", client_secret="valid", installation_store=store1, + ), + installation_store=store2, + ) + assert app.installation_store is store1 + + app = AsyncApp( + signing_secret="valid", + oauth_flow=AsyncOAuthFlow( + settings=AsyncOAuthSettings( + client_id="111.222", + client_secret="valid", + installation_store=store1, + ) + ), + installation_store=store2, + ) + assert app.installation_store is store1 + + app = AsyncApp( + signing_secret="valid", + oauth_flow=AsyncOAuthFlow( + settings=AsyncOAuthSettings(client_id="111.222", client_secret="valid",) + ), + installation_store=store1, + ) + assert app.installation_store is store1 From aa834e05606e69facd5944e2eab4250d18cf84ba Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 6 Nov 2020 12:28:08 +0900 Subject: [PATCH 026/719] Fix CI builds with pytype in Python 3.8+ --- scripts/install_all_and_run_tests.sh | 1 + scripts/run_pytype.sh | 6 ++++-- scripts/run_tests.sh | 1 + setup.py | 1 - 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/install_all_and_run_tests.sh b/scripts/install_all_and_run_tests.sh index 2d5b4c14d..e861401c3 100755 --- a/scripts/install_all_and_run_tests.sh +++ b/scripts/install_all_and_run_tests.sh @@ -22,5 +22,6 @@ else pip install -e ".[adapter]" && \ black slack_bolt/ tests/ && \ pytest && \ + pip install -U pytype && \ pytype slack_bolt/ fi diff --git a/scripts/run_pytype.sh b/scripts/run_pytype.sh index f5424bbf0..bfdf066be 100755 --- a/scripts/run_pytype.sh +++ b/scripts/run_pytype.sh @@ -2,5 +2,7 @@ # ./scripts/run_pytype.sh script_dir=$(dirname $0) -cd ${script_dir}/.. -pip install -e ".[adapter]" && pytype slack_bolt/ +cd ${script_dir}/.. && \ + pip install -e ".[adapter]" && \ + pip install -U pytype && \ + pytype slack_bolt/ diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index 7170abeb0..a5234a525 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -20,6 +20,7 @@ else black slack_bolt/ tests/ \ && pytest \ && pip install -e ".[adapter]" \ + && pip install -U pytype \ && pytype slack_bolt/ else black slack_bolt/ tests/ && pytest diff --git a/setup.py b/setup.py index 7d210ef96..fff675429 100755 --- a/setup.py +++ b/setup.py @@ -17,7 +17,6 @@ "pytest-asyncio<1", # for async "aiohttp>=3,<4", # for async "black==19.10b0", - "pytype", ] setuptools.setup( From 7da0f7c0644836fe3485f7d8d6cb8a78af7d0993 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 6 Nov 2020 10:22:32 +0900 Subject: [PATCH 027/719] Use Sequence type hints over List for args --- slack_bolt/adapter/aws_lambda/handler.py | 4 +- slack_bolt/adapter/aws_lambda/internals.py | 4 +- slack_bolt/app/app.py | 90 +++++++++--------- slack_bolt/app/async_app.py | 94 ++++++++++--------- slack_bolt/context/ack/ack.py | 10 +- slack_bolt/context/ack/async_ack.py | 10 +- slack_bolt/context/ack/internals.py | 12 +-- slack_bolt/context/respond/async_respond.py | 6 +- slack_bolt/context/respond/internals.py | 6 +- slack_bolt/context/respond/respond.py | 6 +- slack_bolt/context/say/async_say.py | 6 +- slack_bolt/context/say/say.py | 6 +- slack_bolt/kwargs_injection/async_utils.py | 4 +- slack_bolt/kwargs_injection/utils.py | 4 +- slack_bolt/listener/async_listener.py | 24 ++--- slack_bolt/listener/custom_listener.py | 16 ++-- slack_bolt/listener/listener.py | 8 +- .../async_listener_matcher.py | 4 +- .../custom_listener_matcher.py | 4 +- .../middleware/async_custom_middleware.py | 4 +- slack_bolt/middleware/custom_middleware.py | 4 +- slack_bolt/oauth/async_oauth_flow.py | 6 +- slack_bolt/oauth/async_oauth_settings.py | 10 +- slack_bolt/oauth/oauth_flow.py | 6 +- slack_bolt/oauth/oauth_settings.py | 10 +- slack_bolt/request/async_request.py | 11 +-- slack_bolt/request/internals.py | 16 ++-- slack_bolt/request/request.py | 11 +-- slack_bolt/response/response.py | 10 +- slack_bolt/util/utils.py | 4 +- slack_bolt/workflows/step/async_step.py | 16 ++-- slack_bolt/workflows/step/step.py | 20 ++-- .../step/utilities/async_configure.py | 4 +- .../workflows/step/utilities/configure.py | 4 +- 34 files changed, 234 insertions(+), 220 deletions(-) diff --git a/slack_bolt/adapter/aws_lambda/handler.py b/slack_bolt/adapter/aws_lambda/handler.py index c6e1e975a..885115cb3 100644 --- a/slack_bolt/adapter/aws_lambda/handler.py +++ b/slack_bolt/adapter/aws_lambda/handler.py @@ -1,6 +1,6 @@ import base64 import logging -from typing import List, Dict, Any +from typing import Dict, Any, Sequence from slack_bolt.adapter.aws_lambda.internals import _first_value from slack_bolt.adapter.aws_lambda.lazy_listener_runner import LambdaLazyListenerRunner @@ -78,7 +78,7 @@ def to_bolt_request(event) -> BoltRequest: body = event.get("body", "") if event["isBase64Encoded"]: body = base64.b64decode(body).decode("utf-8") - cookies: List[str] = event.get("cookies", []) + cookies: Sequence[str] = event.get("cookies", []) headers = event.get("headers", {}) headers["cookie"] = cookies return BoltRequest( diff --git a/slack_bolt/adapter/aws_lambda/internals.py b/slack_bolt/adapter/aws_lambda/internals.py index f5700b8a8..944d17e82 100644 --- a/slack_bolt/adapter/aws_lambda/internals.py +++ b/slack_bolt/adapter/aws_lambda/internals.py @@ -1,7 +1,7 @@ -from typing import Dict, List, Optional +from typing import Dict, Optional, Sequence -def _first_value(query: Dict[str, List[str]], name: str) -> Optional[str]: +def _first_value(query: Dict[str, Sequence[str]], name: str) -> Optional[str]: if query: values = query.get(name, []) if values and len(values) > 0: diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index cc97b19ba..16fd9463f 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -4,7 +4,7 @@ import os from concurrent.futures.thread import ThreadPoolExecutor from http.server import SimpleHTTPRequestHandler, HTTPServer -from typing import List, Union, Pattern, Callable, Dict, Optional +from typing import List, Union, Pattern, Callable, Dict, Optional, Sequence from slack_sdk.errors import SlackApiError from slack_sdk.oauth.installation_store import InstallationStore @@ -374,13 +374,13 @@ def step( self, callback_id: Union[str, Pattern, WorkflowStep], edit: Optional[ - Union[Callable[..., Optional[BoltResponse]], Listener, List[Callable]] + Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]] ] = None, save: Optional[ - Union[Callable[..., Optional[BoltResponse]], Listener, List[Callable]] + Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]] ] = None, execute: Optional[ - Union[Callable[..., Optional[BoltResponse]], Listener, List[Callable]] + Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]] ] = None, ): """Registers a new Workflow Step listener""" @@ -417,8 +417,8 @@ def error( def event( self, event: Union[str, Pattern, Dict[str, str]], - matchers: Optional[List[Callable[..., bool]]] = None, - middleware: Optional[List[Union[Callable, Middleware]]] = None, + matchers: Optional[Sequence[Callable[..., bool]]] = None, + middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Optional[Callable[..., Optional[BoltResponse]]]: """Registers a new event listener. @@ -440,14 +440,14 @@ def __call__(*args, **kwargs): def message( self, keyword: Union[str, Pattern], - matchers: Optional[List[Callable[..., bool]]] = None, - middleware: Optional[List[Union[Callable, Middleware]]] = None, + matchers: Optional[Sequence[Callable[..., bool]]] = None, + middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Optional[Callable[..., Optional[BoltResponse]]]: """Registers a new message event listener. Check the #event method's docstring for details. """ - matchers = matchers if matchers else [] - middleware = middleware if middleware else [] + matchers = list(matchers) if matchers else [] + middleware = list(middleware) if middleware else [] def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -467,8 +467,8 @@ def __call__(*args, **kwargs): def command( self, command: Union[str, Pattern], - matchers: Optional[List[Callable[..., bool]]] = None, - middleware: Optional[List[Union[Callable, Middleware]]] = None, + matchers: Optional[Sequence[Callable[..., bool]]] = None, + middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Optional[Callable[..., Optional[BoltResponse]]]: """Registers a new slash command listener. @@ -493,8 +493,8 @@ def __call__(*args, **kwargs): def shortcut( self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], - matchers: Optional[List[Callable[..., bool]]] = None, - middleware: Optional[List[Union[Callable, Middleware]]] = None, + matchers: Optional[Sequence[Callable[..., bool]]] = None, + middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Optional[Callable[..., Optional[BoltResponse]]]: """Registers a new shortcut listener. @@ -516,8 +516,8 @@ def __call__(*args, **kwargs): def global_shortcut( self, callback_id: Union[str, Pattern], - matchers: Optional[List[Callable[..., bool]]] = None, - middleware: Optional[List[Union[Callable, Middleware]]] = None, + matchers: Optional[Sequence[Callable[..., bool]]] = None, + middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Optional[Callable[..., Optional[BoltResponse]]]: """Registers a new global shortcut listener.""" @@ -533,8 +533,8 @@ def __call__(*args, **kwargs): def message_shortcut( self, callback_id: Union[str, Pattern], - matchers: Optional[List[Callable[..., bool]]] = None, - middleware: Optional[List[Union[Callable, Middleware]]] = None, + matchers: Optional[Sequence[Callable[..., bool]]] = None, + middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Optional[Callable[..., Optional[BoltResponse]]]: """Registers a new message shortcut listener.""" @@ -553,8 +553,8 @@ def __call__(*args, **kwargs): def action( self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], - matchers: Optional[List[Callable[..., bool]]] = None, - middleware: Optional[List[Union[Callable, Middleware]]] = None, + matchers: Optional[Sequence[Callable[..., bool]]] = None, + middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Optional[Callable[..., Optional[BoltResponse]]]: """Registers a new action listener. @@ -576,8 +576,8 @@ def __call__(*args, **kwargs): def block_action( self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], - matchers: Optional[List[Callable[..., bool]]] = None, - middleware: Optional[List[Union[Callable, Middleware]]] = None, + matchers: Optional[Sequence[Callable[..., bool]]] = None, + middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Optional[Callable[..., Optional[BoltResponse]]]: """Registers a new block_actions listener.""" @@ -593,8 +593,8 @@ def __call__(*args, **kwargs): def attachment_action( self, callback_id: Union[str, Pattern], - matchers: Optional[List[Callable[..., bool]]] = None, - middleware: Optional[List[Union[Callable, Middleware]]] = None, + matchers: Optional[Sequence[Callable[..., bool]]] = None, + middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Optional[Callable[..., Optional[BoltResponse]]]: """Registers a new interactive_message listener.""" @@ -610,8 +610,8 @@ def __call__(*args, **kwargs): def dialog_submission( self, callback_id: Union[str, Pattern], - matchers: Optional[List[Callable[..., bool]]] = None, - middleware: Optional[List[Union[Callable, Middleware]]] = None, + matchers: Optional[Sequence[Callable[..., bool]]] = None, + middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Optional[Callable[..., Optional[BoltResponse]]]: """Registers a new dialog_submission listener.""" @@ -627,8 +627,8 @@ def __call__(*args, **kwargs): def dialog_cancellation( self, callback_id: Union[str, Pattern], - matchers: Optional[List[Callable[..., bool]]] = None, - middleware: Optional[List[Union[Callable, Middleware]]] = None, + matchers: Optional[Sequence[Callable[..., bool]]] = None, + middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Optional[Callable[..., Optional[BoltResponse]]]: """Registers a new dialog_cancellation listener.""" @@ -647,8 +647,8 @@ def __call__(*args, **kwargs): def view( self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], - matchers: Optional[List[Callable[..., bool]]] = None, - middleware: Optional[List[Union[Callable, Middleware]]] = None, + matchers: Optional[Sequence[Callable[..., bool]]] = None, + middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Optional[Callable[..., Optional[BoltResponse]]]: """Registers a new view submission/closed event listener. @@ -670,8 +670,8 @@ def __call__(*args, **kwargs): def view_submission( self, constraints: Union[str, Pattern], - matchers: Optional[List[Callable[..., bool]]] = None, - middleware: Optional[List[Union[Callable, Middleware]]] = None, + matchers: Optional[Sequence[Callable[..., bool]]] = None, + middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Optional[Callable[..., Optional[BoltResponse]]]: """Registers a new view_submission listener.""" @@ -687,8 +687,8 @@ def __call__(*args, **kwargs): def view_closed( self, constraints: Union[str, Pattern], - matchers: Optional[List[Callable[..., bool]]] = None, - middleware: Optional[List[Union[Callable, Middleware]]] = None, + matchers: Optional[Sequence[Callable[..., bool]]] = None, + middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Optional[Callable[..., Optional[BoltResponse]]]: """Registers a new view_closed listener.""" @@ -707,8 +707,8 @@ def __call__(*args, **kwargs): def options( self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], - matchers: Optional[List[Callable[..., bool]]] = None, - middleware: Optional[List[Union[Callable, Middleware]]] = None, + matchers: Optional[Sequence[Callable[..., bool]]] = None, + middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Optional[Callable[..., Optional[BoltResponse]]]: """Registers a new options listener. @@ -730,8 +730,8 @@ def __call__(*args, **kwargs): def block_suggestion( self, action_id: Union[str, Pattern], - matchers: Optional[List[Callable[..., bool]]] = None, - middleware: Optional[List[Union[Callable, Middleware]]] = None, + matchers: Optional[Sequence[Callable[..., bool]]] = None, + middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Optional[Callable[..., Optional[BoltResponse]]]: """Registers a new block_suggestion listener.""" @@ -747,8 +747,8 @@ def __call__(*args, **kwargs): def dialog_suggestion( self, callback_id: Union[str, Pattern], - matchers: Optional[List[Callable[..., bool]]] = None, - middleware: Optional[List[Union[Callable, Middleware]]] = None, + matchers: Optional[Sequence[Callable[..., bool]]] = None, + middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Optional[Callable[..., Optional[BoltResponse]]]: """Registers a new dialog_submission listener.""" @@ -771,7 +771,7 @@ def _init_context(self, req: BoltRequest): @staticmethod def _to_listener_functions( kwargs: dict, - ) -> Optional[List[Callable[..., Optional[BoltResponse]]]]: + ) -> Optional[Sequence[Callable[..., Optional[BoltResponse]]]]: if kwargs: functions = [kwargs["ack"]] for sub in kwargs["lazy"]: @@ -781,10 +781,10 @@ def _to_listener_functions( def _register_listener( self, - functions: List[Callable[..., Optional[BoltResponse]]], + functions: Sequence[Callable[..., Optional[BoltResponse]]], primary_matcher: ListenerMatcher, - matchers: Optional[List[Callable[..., bool]]], - middleware: Optional[List[Union[Callable, Middleware]]], + matchers: Optional[Sequence[Callable[..., bool]]], + middleware: Optional[Sequence[Union[Callable, Middleware]]], auto_acknowledgement: bool = False, ) -> Optional[Callable[..., Optional[BoltResponse]]]: value_to_return = None @@ -893,7 +893,7 @@ def _send_bolt_response(self, bolt_resp: BoltResponse): def _send_response( self, status: int, - headers: Dict[str, List[str]], + headers: Dict[str, Sequence[str]], body: Union[str, dict] = "", ): self.send_response(status) diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 9e3db0cb4..62adbc40e 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -1,7 +1,7 @@ import inspect import logging import os -from typing import Optional, List, Union, Callable, Pattern, Dict, Awaitable +from typing import Optional, List, Union, Callable, Pattern, Dict, Awaitable, Sequence from slack_bolt.listener.asyncio_runner import AsyncioListenerRunner from slack_bolt.middleware.message_listener_matches.async_message_listener_matches import ( @@ -386,13 +386,19 @@ def step( self, callback_id: Union[str, Pattern, AsyncWorkflowStep], edit: Optional[ - Union[Callable[..., Optional[BoltResponse]], AsyncListener, List[Callable]] + Union[ + Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable] + ] ] = None, save: Optional[ - Union[Callable[..., Optional[BoltResponse]], AsyncListener, List[Callable]] + Union[ + Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable] + ] ] = None, execute: Optional[ - Union[Callable[..., Optional[BoltResponse]], AsyncListener, List[Callable]] + Union[ + Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable] + ] ] = None, ): """Registers a new Workflow Step listener""" @@ -429,8 +435,8 @@ def error( def event( self, event: Union[str, Pattern, Dict[str, str]], - matchers: Optional[List[Callable[..., Awaitable[bool]]]] = None, - middleware: Optional[List[Union[Callable, AsyncMiddleware]]] = None, + matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, + middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: """Registers a new event listener. @@ -452,12 +458,12 @@ def __call__(*args, **kwargs): def message( self, keyword: Union[str, Pattern], - matchers: Optional[List[Callable[..., Awaitable[bool]]]] = None, - middleware: Optional[List[Union[Callable, AsyncMiddleware]]] = None, + matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, + middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: """Register a new message event listener.""" - matchers = matchers if matchers else [] - middleware = middleware if middleware else [] + matchers = list(matchers) if matchers else [] + middleware = list(middleware) if middleware else [] def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -477,8 +483,8 @@ def __call__(*args, **kwargs): def command( self, command: Union[str, Pattern], - matchers: Optional[List[Callable[..., Awaitable[bool]]]] = None, - middleware: Optional[List[Union[Callable, AsyncMiddleware]]] = None, + matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, + middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: """Registers a new slash command listener. @@ -503,8 +509,8 @@ def __call__(*args, **kwargs): def shortcut( self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], - matchers: Optional[List[Callable[..., Awaitable[bool]]]] = None, - middleware: Optional[List[Union[Callable, AsyncMiddleware]]] = None, + matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, + middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: """Registers a new shortcut listener. @@ -526,8 +532,8 @@ def __call__(*args, **kwargs): def global_shortcut( self, callback_id: Union[str, Pattern], - matchers: Optional[List[Callable[..., Awaitable[bool]]]] = None, - middleware: Optional[List[Union[Callable, AsyncMiddleware]]] = None, + matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, + middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: """Registers a new global shortcut listener.""" @@ -543,8 +549,8 @@ def __call__(*args, **kwargs): def message_shortcut( self, callback_id: Union[str, Pattern], - matchers: Optional[List[Callable[..., Awaitable[bool]]]] = None, - middleware: Optional[List[Union[Callable, AsyncMiddleware]]] = None, + matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, + middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: """Registers a new message shortcut listener.""" @@ -563,8 +569,8 @@ def __call__(*args, **kwargs): def action( self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], - matchers: Optional[List[Callable[..., Awaitable[bool]]]] = None, - middleware: Optional[List[Union[Callable, AsyncMiddleware]]] = None, + matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, + middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: """Registers a new action listener. @@ -586,8 +592,8 @@ def __call__(*args, **kwargs): def block_action( self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], - matchers: Optional[List[Callable[..., Awaitable[bool]]]] = None, - middleware: Optional[List[Union[Callable, AsyncMiddleware]]] = None, + matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, + middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: """Registers a new block_actions listener.""" @@ -603,8 +609,8 @@ def __call__(*args, **kwargs): def attachment_action( self, callback_id: Union[str, Pattern], - matchers: Optional[List[Callable[..., Awaitable[bool]]]] = None, - middleware: Optional[List[Union[Callable, AsyncMiddleware]]] = None, + matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, + middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: """Registers a new interactive_message listener.""" @@ -620,8 +626,8 @@ def __call__(*args, **kwargs): def dialog_submission( self, callback_id: Union[str, Pattern], - matchers: Optional[List[Callable[..., Awaitable[bool]]]] = None, - middleware: Optional[List[Union[Callable, AsyncMiddleware]]] = None, + matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, + middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: """Registers a new dialog_submission listener.""" @@ -637,8 +643,8 @@ def __call__(*args, **kwargs): def dialog_cancellation( self, callback_id: Union[str, Pattern], - matchers: Optional[List[Callable[..., Awaitable[bool]]]] = None, - middleware: Optional[List[Union[Callable, AsyncMiddleware]]] = None, + matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, + middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: """Registers a new dialog_cancellation listener.""" @@ -657,8 +663,8 @@ def __call__(*args, **kwargs): def view( self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], - matchers: Optional[List[Callable[..., Awaitable[bool]]]] = None, - middleware: Optional[List[Union[Callable, AsyncMiddleware]]] = None, + matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, + middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: """Registers a new view submission/closed listener. @@ -680,8 +686,8 @@ def __call__(*args, **kwargs): def view_submission( self, constraints: Union[str, Pattern], - matchers: Optional[List[Callable[..., Awaitable[bool]]]] = None, - middleware: Optional[List[Union[Callable, AsyncMiddleware]]] = None, + matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, + middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: """Registers a new view_submission listener.""" @@ -697,8 +703,8 @@ def __call__(*args, **kwargs): def view_closed( self, constraints: Union[str, Pattern], - matchers: Optional[List[Callable[..., Awaitable[bool]]]] = None, - middleware: Optional[List[Union[Callable, AsyncMiddleware]]] = None, + matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, + middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: """Registers a new view_closed listener.""" @@ -717,8 +723,8 @@ def __call__(*args, **kwargs): def options( self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], - matchers: Optional[List[Callable[..., Awaitable[bool]]]] = None, - middleware: Optional[List[Union[Callable, AsyncMiddleware]]] = None, + matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, + middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: """Registers a new options listener. @@ -740,8 +746,8 @@ def __call__(*args, **kwargs): def block_suggestion( self, action_id: Union[str, Pattern], - matchers: Optional[List[Callable[..., Awaitable[bool]]]] = None, - middleware: Optional[List[Union[Callable, AsyncMiddleware]]] = None, + matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, + middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: """Registers a new block_suggestion listener.""" @@ -757,8 +763,8 @@ def __call__(*args, **kwargs): def dialog_suggestion( self, callback_id: Union[str, Pattern], - matchers: Optional[List[Callable[..., Awaitable[bool]]]] = None, - middleware: Optional[List[Union[Callable, AsyncMiddleware]]] = None, + matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, + middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: """Registers a new dialog_submission listener.""" @@ -781,7 +787,7 @@ def _init_context(self, req: AsyncBoltRequest): @staticmethod def _to_listener_functions( kwargs: dict, - ) -> Optional[List[Callable[..., Awaitable[Optional[BoltResponse]]]]]: + ) -> Optional[Sequence[Callable[..., Awaitable[Optional[BoltResponse]]]]]: if kwargs: functions = [kwargs["ack"]] for sub in kwargs["lazy"]: @@ -791,10 +797,10 @@ def _to_listener_functions( def _register_listener( self, - functions: List[Callable[..., Awaitable[Optional[BoltResponse]]]], + functions: Sequence[Callable[..., Awaitable[Optional[BoltResponse]]]], primary_matcher: AsyncListenerMatcher, - matchers: Optional[List[Callable[..., Awaitable[bool]]]], - middleware: Optional[List[Union[Callable, AsyncMiddleware]]], + matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]], + middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]], auto_acknowledgement: bool = False, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: value_to_return = None diff --git a/slack_bolt/context/ack/ack.py b/slack_bolt/context/ack/ack.py index bc9b7c82d..69cf928cc 100644 --- a/slack_bolt/context/ack/ack.py +++ b/slack_bolt/context/ack/ack.py @@ -1,4 +1,4 @@ -from typing import List, Optional, Union, Dict +from typing import Optional, Union, Dict, Sequence from slack_sdk.models.attachments import Attachment from slack_sdk.models.blocks import Block, Option, OptionGroup @@ -17,12 +17,12 @@ def __init__(self): def __call__( self, text: Union[str, dict] = "", # text: str or whole_response: dict - blocks: Optional[List[Union[dict, Block]]] = None, - attachments: Optional[List[Union[dict, Attachment]]] = None, + blocks: Optional[Sequence[Union[dict, Block]]] = None, + attachments: Optional[Sequence[Union[dict, Attachment]]] = None, response_type: Optional[str] = None, # in_channel / ephemeral # block_suggestion / dialog_suggestion - options: Optional[List[Union[dict, Option]]] = None, - option_groups: Optional[List[Union[dict, OptionGroup]]] = None, + options: Optional[Sequence[Union[dict, Option]]] = None, + option_groups: Optional[Sequence[Union[dict, OptionGroup]]] = None, # view_submission response_action: Optional[str] = None, # errors / update / push / clear errors: Optional[Dict[str, str]] = None, diff --git a/slack_bolt/context/ack/async_ack.py b/slack_bolt/context/ack/async_ack.py index 380131e4e..3be06918a 100644 --- a/slack_bolt/context/ack/async_ack.py +++ b/slack_bolt/context/ack/async_ack.py @@ -1,4 +1,4 @@ -from typing import List, Optional, Union, Dict +from typing import Optional, Union, Dict, Sequence from slack_sdk.models.attachments import Attachment from slack_sdk.models.blocks import Block, Option, OptionGroup @@ -17,12 +17,12 @@ def __init__(self): async def __call__( self, text: Union[str, dict] = "", # text: str or whole_response: dict - blocks: Optional[List[Union[dict, Block]]] = None, - attachments: Optional[List[Union[dict, Attachment]]] = None, + blocks: Optional[Sequence[Union[dict, Block]]] = None, + attachments: Optional[Sequence[Union[dict, Attachment]]] = None, response_type: Optional[str] = None, # in_channel / ephemeral # block_suggestion / dialog_suggestion - options: Optional[List[Union[dict, Option]]] = None, - option_groups: Optional[List[Union[dict, OptionGroup]]] = None, + options: Optional[Sequence[Union[dict, Option]]] = None, + option_groups: Optional[Sequence[Union[dict, OptionGroup]]] = None, # view_submission response_action: Optional[str] = None, # errors / update / push / clear errors: Optional[Dict[str, str]] = None, diff --git a/slack_bolt/context/ack/internals.py b/slack_bolt/context/ack/internals.py index c6ee73755..8d21b6559 100644 --- a/slack_bolt/context/ack/internals.py +++ b/slack_bolt/context/ack/internals.py @@ -1,4 +1,4 @@ -from typing import Optional, List, Union, Any, Dict +from typing import Optional, Union, Any, Dict, Sequence from slack_sdk.models.attachments import Attachment from slack_sdk.models.blocks import Block, Option, OptionGroup @@ -12,15 +12,15 @@ def _set_response( self: Any, text_or_whole_response: Union[str, dict] = "", - blocks: Optional[List[Union[dict, Block]]] = None, - attachments: Optional[List[Union[dict, Attachment]]] = None, + blocks: Optional[Sequence[Union[dict, Block]]] = None, + attachments: Optional[Sequence[Union[dict, Attachment]]] = None, response_type: Optional[str] = None, # in_channel / ephemeral # block_suggestion / dialog_suggestion - options: Optional[List[Union[dict, Option]]] = None, - option_groups: Optional[List[Union[dict, OptionGroup]]] = None, + options: Optional[Sequence[Union[dict, Option]]] = None, + option_groups: Optional[Sequence[Union[dict, OptionGroup]]] = None, # view_submission response_action: Optional[str] = None, - errors: Optional[Union[Dict[str, str], List[Dict[str, str]]]] = None, + errors: Optional[Union[Dict[str, str], Sequence[Dict[str, str]]]] = None, view: Optional[Union[dict, View]] = None, ) -> BoltResponse: if isinstance(text_or_whole_response, str): diff --git a/slack_bolt/context/respond/async_respond.py b/slack_bolt/context/respond/async_respond.py index 5a87075e4..77a4665ac 100644 --- a/slack_bolt/context/respond/async_respond.py +++ b/slack_bolt/context/respond/async_respond.py @@ -1,4 +1,4 @@ -from typing import Optional, List, Union +from typing import Optional, Union, Sequence from slack_sdk.models.attachments import Attachment from slack_sdk.models.blocks import Block @@ -16,8 +16,8 @@ def __init__(self, *, response_url: Optional[str]): async def __call__( self, text: Union[str, dict] = "", - blocks: Optional[List[Union[dict, Block]]] = None, - attachments: Optional[List[Union[dict, Attachment]]] = None, + blocks: Optional[Sequence[Union[dict, Block]]] = None, + attachments: Optional[Sequence[Union[dict, Attachment]]] = None, response_type: Optional[str] = None, replace_original: Optional[bool] = None, delete_original: Optional[bool] = None, diff --git a/slack_bolt/context/respond/internals.py b/slack_bolt/context/respond/internals.py index d2e51d1b2..28cbbbec4 100644 --- a/slack_bolt/context/respond/internals.py +++ b/slack_bolt/context/respond/internals.py @@ -1,4 +1,4 @@ -from typing import Optional, List, Dict, Union, Any +from typing import Optional, Dict, Union, Any, Sequence from slack_sdk.models.attachments import Attachment from slack_sdk.models.blocks import Block @@ -8,8 +8,8 @@ def _build_message( text: str = "", - blocks: Optional[List[Union[dict, Block]]] = None, - attachments: Optional[List[Union[dict, Attachment]]] = None, + blocks: Optional[Sequence[Union[dict, Block]]] = None, + attachments: Optional[Sequence[Union[dict, Attachment]]] = None, response_type: Optional[str] = None, replace_original: Optional[bool] = None, delete_original: Optional[bool] = None, diff --git a/slack_bolt/context/respond/respond.py b/slack_bolt/context/respond/respond.py index eb085a4ee..09e2727df 100644 --- a/slack_bolt/context/respond/respond.py +++ b/slack_bolt/context/respond/respond.py @@ -1,4 +1,4 @@ -from typing import Optional, List, Union +from typing import Optional, Union, Sequence from slack_sdk.models.attachments import Attachment from slack_sdk.models.blocks import Block @@ -16,8 +16,8 @@ def __init__(self, *, response_url: Optional[str]): def __call__( self, text: Union[str, dict] = "", - blocks: Optional[List[Union[dict, Block]]] = None, - attachments: Optional[List[Union[dict, Attachment]]] = None, + blocks: Optional[Sequence[Union[dict, Block]]] = None, + attachments: Optional[Sequence[Union[dict, Attachment]]] = None, response_type: Optional[str] = None, replace_original: Optional[bool] = None, delete_original: Optional[bool] = None, diff --git a/slack_bolt/context/say/async_say.py b/slack_bolt/context/say/async_say.py index 8b9eae3df..ccbefd4f9 100644 --- a/slack_bolt/context/say/async_say.py +++ b/slack_bolt/context/say/async_say.py @@ -1,4 +1,4 @@ -from typing import Optional, List, Union, Dict +from typing import Optional, Union, Dict, Sequence from slack_bolt.context.say.internals import _can_say from slack_sdk.models.attachments import Attachment @@ -20,8 +20,8 @@ def __init__( async def __call__( self, text: Union[str, dict] = "", - blocks: Optional[List[Union[Dict, Block]]] = None, - attachments: Optional[List[Union[Dict, Attachment]]] = None, + blocks: Optional[Sequence[Union[Dict, Block]]] = None, + attachments: Optional[Sequence[Union[Dict, Attachment]]] = None, channel: Optional[str] = None, thread_ts: Optional[str] = None, **kwargs, diff --git a/slack_bolt/context/say/say.py b/slack_bolt/context/say/say.py index d8dfe145b..9c4181957 100644 --- a/slack_bolt/context/say/say.py +++ b/slack_bolt/context/say/say.py @@ -1,4 +1,4 @@ -from typing import Optional, List, Union, Dict +from typing import Optional, Union, Dict, Sequence from slack_sdk import WebClient from slack_sdk.models.attachments import Attachment @@ -21,8 +21,8 @@ def __init__( def __call__( self, text: Union[str, dict] = "", - blocks: Optional[List[Union[Dict, Block]]] = None, - attachments: Optional[List[Union[Dict, Attachment]]] = None, + blocks: Optional[Sequence[Union[Dict, Block]]] = None, + attachments: Optional[Sequence[Union[Dict, Attachment]]] = None, channel: Optional[str] = None, thread_ts: Optional[str] = None, **kwargs, diff --git a/slack_bolt/kwargs_injection/async_utils.py b/slack_bolt/kwargs_injection/async_utils.py index 2c8c8f68d..ae7773725 100644 --- a/slack_bolt/kwargs_injection/async_utils.py +++ b/slack_bolt/kwargs_injection/async_utils.py @@ -1,6 +1,6 @@ # pytype: skip-file import logging -from typing import Callable, Dict, Optional, List, Any +from typing import Callable, Dict, Optional, Any, Sequence from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse @@ -20,7 +20,7 @@ def build_async_required_kwargs( *, logger: logging.Logger, - required_arg_names: List[str], + required_arg_names: Sequence[str], request: AsyncBoltRequest, response: Optional[BoltResponse], next_func: Callable[[], None] = None, diff --git a/slack_bolt/kwargs_injection/utils.py b/slack_bolt/kwargs_injection/utils.py index 6338e4ad2..0d936cb14 100644 --- a/slack_bolt/kwargs_injection/utils.py +++ b/slack_bolt/kwargs_injection/utils.py @@ -1,6 +1,6 @@ # pytype: skip-file import logging -from typing import Callable, Dict, Optional, List, Any +from typing import Callable, Dict, Optional, Any, Sequence from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse @@ -20,7 +20,7 @@ def build_required_kwargs( *, logger: logging.Logger, - required_arg_names: List[str], + required_arg_names: Sequence[str], request: BoltRequest, response: Optional[BoltResponse], next_func: Callable[[], None] = None, diff --git a/slack_bolt/listener/async_listener.py b/slack_bolt/listener/async_listener.py index ab5cdbd79..7222b80a8 100644 --- a/slack_bolt/listener/async_listener.py +++ b/slack_bolt/listener/async_listener.py @@ -1,5 +1,5 @@ from abc import abstractmethod, ABCMeta -from typing import List, Callable, Awaitable, Tuple, Optional +from typing import Callable, Awaitable, Tuple, Optional, Sequence from slack_bolt.listener_matcher.async_listener_matcher import AsyncListenerMatcher from slack_bolt.middleware.async_middleware import AsyncMiddleware @@ -9,10 +9,10 @@ class AsyncListener(metaclass=ABCMeta): - matchers: List[AsyncListenerMatcher] - middleware: List[AsyncMiddleware] + matchers: Sequence[AsyncListenerMatcher] + middleware: Sequence[AsyncMiddleware] ack_function: Callable[..., Awaitable[BoltResponse]] - lazy_functions: List[Callable[..., Awaitable[None]]] + lazy_functions: Sequence[Callable[..., Awaitable[None]]] auto_acknowledgement: bool async def async_matches( @@ -61,7 +61,7 @@ async def run_ack_function( import inspect from logging import Logger -from typing import Callable, List, Awaitable +from typing import Callable, Awaitable from slack_bolt.listener_matcher.async_listener_matcher import AsyncListenerMatcher from slack_bolt.logger import get_bolt_app_logger @@ -73,11 +73,11 @@ async def run_ack_function( class AsyncCustomListener(AsyncListener): app_name: str ack_function: Callable[..., Awaitable[Optional[BoltResponse]]] - lazy_functions: List[Callable[..., Awaitable[None]]] - matchers: List[AsyncListenerMatcher] - middleware: List[AsyncMiddleware] + lazy_functions: Sequence[Callable[..., Awaitable[None]]] + matchers: Sequence[AsyncListenerMatcher] + middleware: Sequence[AsyncMiddleware] auto_acknowledgement: bool - arg_names: List[str] + arg_names: Sequence[str] logger: Logger def __init__( @@ -85,9 +85,9 @@ def __init__( *, app_name: str, ack_function: Callable[..., Awaitable[Optional[BoltResponse]]], - lazy_functions: List[Callable[..., Awaitable[None]]], - matchers: List[AsyncListenerMatcher], - middleware: List[AsyncMiddleware], + lazy_functions: Sequence[Callable[..., Awaitable[None]]], + matchers: Sequence[AsyncListenerMatcher], + middleware: Sequence[AsyncMiddleware], auto_acknowledgement: bool = False, ): self.app_name = app_name diff --git a/slack_bolt/listener/custom_listener.py b/slack_bolt/listener/custom_listener.py index 45e552ff6..8e8a54e98 100644 --- a/slack_bolt/listener/custom_listener.py +++ b/slack_bolt/listener/custom_listener.py @@ -1,6 +1,6 @@ import inspect from logging import Logger -from typing import Callable, List, Optional +from typing import Callable, Optional, Sequence from slack_bolt.kwargs_injection import build_required_kwargs from slack_bolt.listener_matcher import ListenerMatcher @@ -14,11 +14,11 @@ class CustomListener(Listener): app_name: str ack_function: Callable[..., Optional[BoltResponse]] - lazy_functions: List[Callable[..., None]] - matchers: List[ListenerMatcher] - middleware: List[Middleware] # type: ignore + lazy_functions: Sequence[Callable[..., None]] + matchers: Sequence[ListenerMatcher] + middleware: Sequence[Middleware] # type: ignore auto_acknowledgement: bool - arg_names: List[str] + arg_names: Sequence[str] logger: Logger def __init__( @@ -26,9 +26,9 @@ def __init__( *, app_name: str, ack_function: Callable[..., Optional[BoltResponse]], - lazy_functions: List[Callable[..., None]], - matchers: List[ListenerMatcher], - middleware: List[Middleware], # type: ignore + lazy_functions: Sequence[Callable[..., None]], + matchers: Sequence[ListenerMatcher], + middleware: Sequence[Middleware], # type: ignore auto_acknowledgement: bool = False, ): self.app_name = app_name diff --git a/slack_bolt/listener/listener.py b/slack_bolt/listener/listener.py index aa87f14ef..6f1d43c9a 100644 --- a/slack_bolt/listener/listener.py +++ b/slack_bolt/listener/listener.py @@ -1,5 +1,5 @@ from abc import abstractmethod, ABCMeta -from typing import List, Callable, Tuple +from typing import Callable, Tuple, Sequence from slack_bolt.listener_matcher import ListenerMatcher from slack_bolt.middleware import Middleware @@ -8,10 +8,10 @@ class Listener(metaclass=ABCMeta): - matchers: List[ListenerMatcher] - middleware: List[Middleware] # type: ignore + matchers: Sequence[ListenerMatcher] + middleware: Sequence[Middleware] # type: ignore ack_function: Callable[..., BoltResponse] - lazy_functions: List[Callable[..., None]] + lazy_functions: Sequence[Callable[..., None]] auto_acknowledgement: bool def matches(self, *, req: BoltRequest, resp: BoltResponse,) -> bool: diff --git a/slack_bolt/listener_matcher/async_listener_matcher.py b/slack_bolt/listener_matcher/async_listener_matcher.py index 904697026..29a107e3e 100644 --- a/slack_bolt/listener_matcher/async_listener_matcher.py +++ b/slack_bolt/listener_matcher/async_listener_matcher.py @@ -18,7 +18,7 @@ async def async_matches(self, req: AsyncBoltRequest, resp: BoltResponse) -> bool import inspect from logging import Logger -from typing import Callable, Awaitable, List +from typing import Callable, Awaitable, Sequence from slack_bolt.kwargs_injection.async_utils import build_async_required_kwargs from slack_bolt.logger import get_bolt_app_logger @@ -29,7 +29,7 @@ async def async_matches(self, req: AsyncBoltRequest, resp: BoltResponse) -> bool class AsyncCustomListenerMatcher(AsyncListenerMatcher): app_name: str func: Callable[..., Awaitable[bool]] - arg_names: List[str] + arg_names: Sequence[str] logger: Logger def __init__(self, *, app_name: str, func: Callable[..., Awaitable[bool]]): diff --git a/slack_bolt/listener_matcher/custom_listener_matcher.py b/slack_bolt/listener_matcher/custom_listener_matcher.py index 693dc6bb8..f96c4da9e 100644 --- a/slack_bolt/listener_matcher/custom_listener_matcher.py +++ b/slack_bolt/listener_matcher/custom_listener_matcher.py @@ -1,6 +1,6 @@ import inspect from logging import Logger -from typing import Callable, List +from typing import Callable, Sequence from slack_bolt.kwargs_injection import build_required_kwargs from slack_bolt.logger import get_bolt_app_logger @@ -12,7 +12,7 @@ class CustomListenerMatcher(ListenerMatcher): app_name: str func: Callable[..., bool] - arg_names: List[str] + arg_names: Sequence[str] logger: Logger def __init__(self, *, app_name: str, func: Callable[..., bool]): diff --git a/slack_bolt/middleware/async_custom_middleware.py b/slack_bolt/middleware/async_custom_middleware.py index 26bcf48a9..220a0723a 100644 --- a/slack_bolt/middleware/async_custom_middleware.py +++ b/slack_bolt/middleware/async_custom_middleware.py @@ -1,6 +1,6 @@ import inspect from logging import Logger -from typing import Callable, Awaitable, List, Any +from typing import Callable, Awaitable, Any, Sequence from slack_bolt.kwargs_injection.async_utils import build_async_required_kwargs from slack_bolt.logger import get_bolt_app_logger @@ -12,7 +12,7 @@ class AsyncCustomMiddleware(AsyncMiddleware): app_name: str func: Callable[..., Awaitable[Any]] - arg_names: List[str] + arg_names: Sequence[str] logger: Logger def __init__(self, *, app_name: str, func: Callable[..., Awaitable[Any]]): diff --git a/slack_bolt/middleware/custom_middleware.py b/slack_bolt/middleware/custom_middleware.py index d8c6f82e0..61b71bac2 100644 --- a/slack_bolt/middleware/custom_middleware.py +++ b/slack_bolt/middleware/custom_middleware.py @@ -1,6 +1,6 @@ import inspect from logging import Logger -from typing import Callable, List, Any +from typing import Callable, Any, Sequence from slack_bolt.kwargs_injection import build_required_kwargs from slack_bolt.logger import get_bolt_app_logger @@ -12,7 +12,7 @@ class CustomMiddleware(Middleware): app_name: str func: Callable[..., Any] - arg_names: List[str] + arg_names: Sequence[str] logger: Logger def __init__(self, *, app_name: str, func: Callable): diff --git a/slack_bolt/oauth/async_oauth_flow.py b/slack_bolt/oauth/async_oauth_flow.py index b5c1b2fae..1157dd632 100644 --- a/slack_bolt/oauth/async_oauth_flow.py +++ b/slack_bolt/oauth/async_oauth_flow.py @@ -1,7 +1,7 @@ import logging import os from logging import Logger -from typing import Optional, List, Dict, Callable, Awaitable +from typing import Optional, Dict, Callable, Awaitable, Sequence from slack_bolt.error import BoltError from slack_bolt.oauth.async_callback_options import ( @@ -92,8 +92,8 @@ def sqlite3( authorization_url: Optional[str] = None, client_id: Optional[str] = None, # required client_secret: Optional[str] = None, # required - scopes: Optional[List[str]] = None, - user_scopes: Optional[List[str]] = None, + scopes: Optional[Sequence[str]] = None, + user_scopes: Optional[Sequence[str]] = None, redirect_uri: Optional[str] = None, # Handler configuration install_path: Optional[str] = None, diff --git a/slack_bolt/oauth/async_oauth_settings.py b/slack_bolt/oauth/async_oauth_settings.py index 89fb8e625..6b2431ef7 100644 --- a/slack_bolt/oauth/async_oauth_settings.py +++ b/slack_bolt/oauth/async_oauth_settings.py @@ -1,7 +1,7 @@ import logging import os from logging import Logger -from typing import List, Optional +from typing import Optional, Sequence from slack_sdk.oauth import ( OAuthStateUtils, @@ -27,8 +27,8 @@ class AsyncOAuthSettings: # OAuth flow parameters/credentials client_id: str client_secret: str - scopes: Optional[List[str]] - user_scopes: Optional[List[str]] + scopes: Optional[Sequence[str]] + user_scopes: Optional[Sequence[str]] redirect_uri: Optional[str] # Handler configuration install_path: str @@ -57,8 +57,8 @@ def __init__( # OAuth flow parameters/credentials client_id: Optional[str] = None, # required client_secret: Optional[str] = None, # required - scopes: Optional[List[str]] = None, - user_scopes: Optional[List[str]] = None, + scopes: Optional[Sequence[str]] = None, + user_scopes: Optional[Sequence[str]] = None, redirect_uri: Optional[str] = None, # Handler configuration install_path: str = "/slack/install", diff --git a/slack_bolt/oauth/oauth_flow.py b/slack_bolt/oauth/oauth_flow.py index c6b39023b..8f4dbecb8 100644 --- a/slack_bolt/oauth/oauth_flow.py +++ b/slack_bolt/oauth/oauth_flow.py @@ -1,7 +1,7 @@ import logging import os from logging import Logger -from typing import Optional, List, Dict, Callable +from typing import Optional, Dict, Callable, Sequence from slack_bolt.error import BoltError from slack_bolt.oauth.callback_options import ( @@ -91,8 +91,8 @@ def sqlite3( # OAuth flow parameters/credentials client_id: Optional[str] = None, # required client_secret: Optional[str] = None, # required - scopes: Optional[List[str]] = None, - user_scopes: Optional[List[str]] = None, + scopes: Optional[Sequence[str]] = None, + user_scopes: Optional[Sequence[str]] = None, redirect_uri: Optional[str] = None, # Handler configuration install_path: Optional[str] = None, diff --git a/slack_bolt/oauth/oauth_settings.py b/slack_bolt/oauth/oauth_settings.py index 089d7440a..3dd49e1ef 100644 --- a/slack_bolt/oauth/oauth_settings.py +++ b/slack_bolt/oauth/oauth_settings.py @@ -1,7 +1,7 @@ import logging import os from logging import Logger -from typing import List, Optional +from typing import Optional, Sequence from slack_sdk.oauth import ( OAuthStateStore, @@ -22,8 +22,8 @@ class OAuthSettings: # OAuth flow parameters/credentials client_id: str client_secret: str - scopes: Optional[List[str]] - user_scopes: Optional[List[str]] + scopes: Optional[Sequence[str]] + user_scopes: Optional[Sequence[str]] redirect_uri: Optional[str] # Handler configuration install_path: str @@ -52,8 +52,8 @@ def __init__( # OAuth flow parameters/credentials client_id: Optional[str] = None, # required client_secret: Optional[str] = None, # required - scopes: Optional[List[str]] = None, - user_scopes: Optional[List[str]] = None, + scopes: Optional[Sequence[str]] = None, + user_scopes: Optional[Sequence[str]] = None, redirect_uri: Optional[str] = None, # Handler configuration install_path: str = "/slack/install", diff --git a/slack_bolt/request/async_request.py b/slack_bolt/request/async_request.py index 79a898086..032beaafd 100644 --- a/slack_bolt/request/async_request.py +++ b/slack_bolt/request/async_request.py @@ -1,4 +1,4 @@ -from typing import Dict, Optional, List, Union, Any +from typing import Dict, Optional, Union, Any, Sequence from slack_bolt.context.async_context import AsyncBoltContext from slack_bolt.request.async_internals import build_async_context @@ -13,8 +13,8 @@ class AsyncBoltRequest: raw_body: str body: Dict[str, Any] - query: Dict[str, List[str]] - headers: Dict[str, List[str]] + query: Dict[str, Sequence[str]] + headers: Dict[str, Sequence[str]] content_type: Optional[str] context: AsyncBoltContext lazy_only: bool @@ -24,9 +24,8 @@ def __init__( self, *, body: str, - query: Optional[Union[str, Dict[str, str], Dict[str, List[str]]]] = None, - # many framework use Dict[str, str] but the reality is Dict[str, List[str]] - headers: Optional[Dict[str, Union[str, List[str]]]] = None, + query: Optional[Union[str, Dict[str, str], Dict[str, Sequence[str]]]] = None, + headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, context: Optional[Dict[str, str]] = None, ): """Request to a Bolt app. diff --git a/slack_bolt/request/internals.py b/slack_bolt/request/internals.py index 4a14a46d9..7a3ea872e 100644 --- a/slack_bolt/request/internals.py +++ b/slack_bolt/request/internals.py @@ -1,19 +1,19 @@ import json -from typing import Optional, Dict, Union, List, Any +from typing import Optional, Dict, Union, Any, Sequence from urllib.parse import parse_qsl, parse_qs from slack_bolt.context import BoltContext def parse_query( - query: Optional[Union[str, Dict[str, str], Dict[str, List[str]]]] -) -> Dict[str, List[str]]: + query: Optional[Union[str, Dict[str, str], Dict[str, Sequence[str]]]] +) -> Dict[str, Sequence[str]]: if query is None: return {} elif isinstance(query, str): return parse_qs(query) elif isinstance(query, dict) or hasattr(query, "items"): - result: Dict[str, List[str]] = {} + result: Dict[str, Sequence[str]] = {} for name, value in query.items(): if isinstance(value, list): result[name] = value @@ -128,7 +128,7 @@ def build_context(context: BoltContext, payload: Dict[str, Any],) -> BoltContext return context -def extract_content_type(headers: Dict[str, List[str]]) -> Optional[str]: +def extract_content_type(headers: Dict[str, Sequence[str]]) -> Optional[str]: content_type: Optional[str] = headers.get("content-type", [None])[0] if content_type: return content_type.split(";")[0] @@ -136,9 +136,9 @@ def extract_content_type(headers: Dict[str, List[str]]) -> Optional[str]: def build_normalized_headers( - headers: Optional[Dict[str, Union[str, List[str]]]] -) -> Dict[str, List[str]]: - normalized_headers: Dict[str, List[str]] = {} + headers: Optional[Dict[str, Union[str, Sequence[str]]]] +) -> Dict[str, Sequence[str]]: + normalized_headers: Dict[str, Sequence[str]] = {} if headers is not None: for key, value in headers.items(): normalized_name = key.lower() diff --git a/slack_bolt/request/request.py b/slack_bolt/request/request.py index 71da15316..df5b2b351 100644 --- a/slack_bolt/request/request.py +++ b/slack_bolt/request/request.py @@ -1,4 +1,4 @@ -from typing import Dict, Optional, List, Union, Any +from typing import Dict, Optional, Union, Any, Sequence from slack_bolt.context.context import BoltContext from slack_bolt.request.internals import ( @@ -12,8 +12,8 @@ class BoltRequest: raw_body: str - query: Dict[str, List[str]] - headers: Dict[str, List[str]] + query: Dict[str, Sequence[str]] + headers: Dict[str, Sequence[str]] content_type: Optional[str] body: Dict[str, Any] context: BoltContext @@ -24,9 +24,8 @@ def __init__( self, *, body: str, - query: Optional[Union[str, Dict[str, str], Dict[str, List[str]]]] = None, - # many framework use Dict[str, str] but the reality is Dict[str, List[str]] - headers: Optional[Dict[str, Union[str, List[str]]]] = None, + query: Optional[Union[str, Dict[str, str], Dict[str, Sequence[str]]]] = None, + headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, context: Optional[Dict[str, str]] = None, ): """Request to a Bolt app. diff --git a/slack_bolt/response/response.py b/slack_bolt/response/response.py index 1c6014516..a9b6fdb62 100644 --- a/slack_bolt/response/response.py +++ b/slack_bolt/response/response.py @@ -1,19 +1,19 @@ import json from http.cookies import SimpleCookie -from typing import Union, Dict, List, Optional +from typing import Union, Dict, Optional, Sequence class BoltResponse: status: int body: str - headers: Dict[str, List[str]] + headers: Dict[str, Sequence[str]] def __init__( self, *, status: int, body: Union[str, dict] = "", - headers: Optional[Dict[str, Union[str, List[str]]]] = None, + headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, ): """The response from a Bolt app. @@ -23,7 +23,7 @@ def __init__( """ self.status: int = status self.body: str = json.dumps(body) if isinstance(body, dict) else body - self.headers: Dict[str, List[str]] = {} + self.headers: Dict[str, Sequence[str]] = {} if headers is not None: for name, value in headers.items(): if value is None: @@ -47,7 +47,7 @@ def first_headers(self) -> Dict[str, str]: def first_headers_without_set_cookie(self) -> Dict[str, str]: return {k: list(v)[0] for k, v in self.headers.items() if k != "set-cookie"} - def cookies(self) -> List[SimpleCookie]: + def cookies(self) -> Sequence[SimpleCookie]: header_values = self.headers.get("set-cookie", []) return [self._to_simple_cookie(v) for v in header_values] diff --git a/slack_bolt/util/utils.py b/slack_bolt/util/utils.py index 2289f85d4..e31489f69 100644 --- a/slack_bolt/util/utils.py +++ b/slack_bolt/util/utils.py @@ -1,6 +1,6 @@ import copy import sys -from typing import Optional, Union, Dict, List, Any +from typing import Optional, Union, Dict, Any, Sequence from slack_sdk import WebClient from slack_sdk.models import JsonObject @@ -13,7 +13,7 @@ def create_web_client(token: Optional[str] = None) -> WebClient: return WebClient(token=token, user_agent_prefix=f"Bolt/{bolt_version}",) -def convert_to_dict_list(objects: List[Union[Dict, JsonObject]]) -> List[Dict]: +def convert_to_dict_list(objects: Sequence[Union[Dict, JsonObject]]) -> Sequence[Dict]: return [convert_to_dict(elm) for elm in objects] diff --git a/slack_bolt/workflows/step/async_step.py b/slack_bolt/workflows/step/async_step.py index cf1ee73a6..3044ca513 100644 --- a/slack_bolt/workflows/step/async_step.py +++ b/slack_bolt/workflows/step/async_step.py @@ -1,4 +1,4 @@ -from typing import Callable, Union, Optional, Awaitable, List +from typing import Callable, Union, Optional, Awaitable, Sequence from slack_bolt.context.async_context import AsyncBoltContext from slack_bolt.listener.async_listener import AsyncListener, AsyncCustomListener @@ -29,13 +29,13 @@ def __init__( *, callback_id: str, edit: Union[ - Callable[..., Awaitable[BoltResponse]], AsyncListener, List[Callable] + Callable[..., Awaitable[BoltResponse]], AsyncListener, Sequence[Callable] ], save: Union[ - Callable[..., Awaitable[BoltResponse]], AsyncListener, List[Callable] + Callable[..., Awaitable[BoltResponse]], AsyncListener, Sequence[Callable] ], execute: Union[ - Callable[..., Awaitable[BoltResponse]], AsyncListener, List[Callable] + Callable[..., Awaitable[BoltResponse]], AsyncListener, Sequence[Callable] ], app_name: Optional[str] = None, ): @@ -75,7 +75,9 @@ def _build_listener( raise ValueError(f"Invalid `{name}` listener") @classmethod - def _build_matchers(cls, name: str, callback_id: str) -> List[AsyncListenerMatcher]: + def _build_matchers( + cls, name: str, callback_id: str + ) -> Sequence[AsyncListenerMatcher]: if name == "edit": return [workflow_step_edit(callback_id, asyncio=True)] elif name == "save": @@ -86,7 +88,9 @@ def _build_matchers(cls, name: str, callback_id: str) -> List[AsyncListenerMatch raise ValueError(f"Invalid name {name}") @classmethod - def _build_middleware(cls, name: str, callback_id: str) -> List[AsyncMiddleware]: + def _build_middleware( + cls, name: str, callback_id: str + ) -> Sequence[AsyncMiddleware]: if name == "edit": return [_build_edit_listener_middleware(callback_id)] elif name == "save": diff --git a/slack_bolt/workflows/step/step.py b/slack_bolt/workflows/step/step.py index 2fe342c57..d9e562885 100644 --- a/slack_bolt/workflows/step/step.py +++ b/slack_bolt/workflows/step/step.py @@ -1,4 +1,4 @@ -from typing import Callable, Union, Optional, List +from typing import Callable, Union, Optional, Sequence from slack_bolt.context import BoltContext from slack_bolt.listener import Listener, CustomListener @@ -27,9 +27,15 @@ def __init__( self, *, callback_id: str, - edit: Union[Callable[..., Optional[BoltResponse]], Listener, List[Callable]], - save: Union[Callable[..., Optional[BoltResponse]], Listener, List[Callable]], - execute: Union[Callable[..., Optional[BoltResponse]], Listener, List[Callable]], + edit: Union[ + Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable] + ], + save: Union[ + Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable] + ], + execute: Union[ + Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable] + ], app_name: Optional[str] = None, ): self.callback_id = callback_id @@ -44,7 +50,7 @@ def _build_listener( callback_id: str, app_name: str, listener: Union[ - Callable[..., Optional[BoltResponse]], Listener, List[Callable] + Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable] ], name: str, ) -> Listener: @@ -74,7 +80,7 @@ def _build_listener( raise ValueError(f"Invalid `{name}` listener") @classmethod - def _build_matchers(cls, name: str, callback_id: str) -> List[ListenerMatcher]: + def _build_matchers(cls, name: str, callback_id: str) -> Sequence[ListenerMatcher]: if name == "edit": return [workflow_step_edit(callback_id)] elif name == "save": @@ -85,7 +91,7 @@ def _build_matchers(cls, name: str, callback_id: str) -> List[ListenerMatcher]: raise ValueError(f"Invalid name {name}") @classmethod - def _build_middleware(cls, name: str, callback_id: str) -> List[Middleware]: + def _build_middleware(cls, name: str, callback_id: str) -> Sequence[Middleware]: if name == "edit": return [_build_edit_listener_middleware(callback_id)] elif name == "save": diff --git a/slack_bolt/workflows/step/utilities/async_configure.py b/slack_bolt/workflows/step/utilities/async_configure.py index e8011d742..f6a73dfe4 100644 --- a/slack_bolt/workflows/step/utilities/async_configure.py +++ b/slack_bolt/workflows/step/utilities/async_configure.py @@ -1,4 +1,4 @@ -from typing import List, Optional, Union +from typing import Optional, Union, Sequence from slack_sdk.web.async_client import AsyncWebClient from slack_sdk.models.blocks import Block @@ -11,7 +11,7 @@ def __init__(self, *, callback_id: str, client: AsyncWebClient, body: dict): self.body = body async def __call__( - self, *, blocks: Optional[List[Union[dict, Block]]] = None, + self, *, blocks: Optional[Sequence[Union[dict, Block]]] = None, ) -> None: await self.client.views_open( trigger_id=self.body["trigger_id"], diff --git a/slack_bolt/workflows/step/utilities/configure.py b/slack_bolt/workflows/step/utilities/configure.py index 8f1d29a90..702c94901 100644 --- a/slack_bolt/workflows/step/utilities/configure.py +++ b/slack_bolt/workflows/step/utilities/configure.py @@ -1,4 +1,4 @@ -from typing import List, Optional, Union +from typing import Optional, Union, Sequence from slack_sdk.web import WebClient from slack_sdk.models.blocks import Block @@ -11,7 +11,7 @@ def __init__(self, *, callback_id: str, client: WebClient, body: dict): self.body = body def __call__( - self, *, blocks: Optional[List[Union[dict, Block]]] = None, **kwargs + self, *, blocks: Optional[Sequence[Union[dict, Block]]] = None, **kwargs ) -> None: self.client.views_open( trigger_id=self.body["trigger_id"], From 81f9d0c5f9093f4078dd96e0f7bef4c2ebd80124 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 7 Nov 2020 08:24:02 +0900 Subject: [PATCH 028/719] version 1.0.0rc1 --- setup.py | 2 +- slack_bolt/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index fff675429..84af2afe0 100755 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.0.0rc1",], + install_requires=["slack_sdk>=3.0.0rc2",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 68b82ae82..6c93125ca 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "0.9.6b0" +__version__ = "1.0.0rc1" From 948a60c645e2a1f66e5c464e612baa59843b127e Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 7 Nov 2020 23:37:50 +0900 Subject: [PATCH 029/719] version 1.0.0rc2 --- setup.py | 4 ++-- slack_bolt/version.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 84af2afe0..09f67a79c 100755 --- a/setup.py +++ b/setup.py @@ -28,12 +28,12 @@ description="The Bolt Framework for Python", long_description=long_description, long_description_content_type="text/markdown", - url="https://github.com/slackapi/bolt-python", + url="https://github.com/slackapi/boseratlt-python", packages=setuptools.find_packages( exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.0.0rc2",], + install_requires=["slack_sdk>=3.0.0rc3",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 6c93125ca..5a662149f 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.0.0rc1" +__version__ = "1.0.0rc2" From 1c88ea2d7f3cfbd4141c47de2ce0856de4841063 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 7 Nov 2020 23:39:54 +0900 Subject: [PATCH 030/719] Fix an error in settings --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 09f67a79c..7b64860ab 100755 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ description="The Bolt Framework for Python", long_description=long_description, long_description_content_type="text/markdown", - url="https://github.com/slackapi/boseratlt-python", + url="https://github.com/slackapi/bolt-python", packages=setuptools.find_packages( exclude=["examples", "integration_tests", "tests", "tests.*",] ), From dc288f63fd98252de0110cd9878c9aa7350dde82 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 9 Nov 2020 16:18:20 +0900 Subject: [PATCH 031/719] Fix an example Dockerfile --- examples/docker/aiohttp/Dockerfile | 2 +- examples/docker/fastapi-gunicorn/Dockerfile | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/docker/aiohttp/Dockerfile b/examples/docker/aiohttp/Dockerfile index c1fd13af5..a7b78ed12 100644 --- a/examples/docker/aiohttp/Dockerfile +++ b/examples/docker/aiohttp/Dockerfile @@ -8,7 +8,7 @@ WORKDIR /build/ RUN pip install -U pip && pip install -r requirements.txt FROM python:3.8.5-slim-buster as app -COPY --from=builder /src/ /app/ +COPY --from=builder /build/ /app/ COPY --from=builder /usr/local/lib/ /usr/local/lib/ WORKDIR /app/ COPY *.py /app/ diff --git a/examples/docker/fastapi-gunicorn/Dockerfile b/examples/docker/fastapi-gunicorn/Dockerfile index eacd2c57d..c8f8b94e3 100644 --- a/examples/docker/fastapi-gunicorn/Dockerfile +++ b/examples/docker/fastapi-gunicorn/Dockerfile @@ -9,4 +9,5 @@ RUN pip install -U pip && pip install -r requirements.txt # # docker run -e SLACK_SIGNING_SECRET=$SLACK_SIGNING_SECRET -e SLACK_BOT_TOKEN=$SLACK_BOT_TOKEN -e VARIABLE_NAME="api" -p 80:80 -it your-repo/hello-bolt -# \ No newline at end of file +# or +# docker run -e SLACK_SIGNING_SECRET=$SLACK_SIGNING_SECRET -e SLACK_BOT_TOKEN=$SLACK_BOT_TOKEN -e VARIABLE_NAME="api" -p 3000:80 -it your-repo/hello-bolt From ce1a00b62552ba225695eda20826e2399f9c0ec3 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 10 Nov 2020 02:40:45 +0900 Subject: [PATCH 032/719] Remove an outdated comment --- slack_bolt/listener_matcher/builtins.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/slack_bolt/listener_matcher/builtins.py b/slack_bolt/listener_matcher/builtins.py index 3a34d855c..fce9031b1 100644 --- a/slack_bolt/listener_matcher/builtins.py +++ b/slack_bolt/listener_matcher/builtins.py @@ -212,8 +212,6 @@ def func(body: Dict[str, Any]) -> bool: return dialog_submission(constraints["callback_id"], asyncio) if action_type == "dialog_cancellation": return dialog_cancellation(constraints["callback_id"], asyncio) - - # Still in beta # https://api.slack.com/workflows/steps if action_type == "workflow_step_edit": return workflow_step_edit(constraints["callback_id"], asyncio) From eb746e11c97f4d8736d01402bf10f155893b9baa Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 10 Nov 2020 02:41:12 +0900 Subject: [PATCH 033/719] version 1.0.0 --- README.md | 2 +- setup.py | 2 +- slack_bolt/version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 240a72d8f..bf6636b21 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Bolt ![Bolt logo](docs/assets/bolt-logo.svg) for Python (beta) +# Bolt ![Bolt logo](docs/assets/bolt-logo.svg) for Python [![Python Version][python-version]][pypi-url] [![pypi package][pypi-image]][pypi-url] diff --git a/setup.py b/setup.py index 7b64860ab..143ac6549 100755 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.0.0rc3",], + install_requires=["slack_sdk>=3.0.0",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 5a662149f..5becc17c0 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.0.0rc2" +__version__ = "1.0.0" From 210d3a6e4f0e77dc612c493cb0befba9914f37a9 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 12 Nov 2020 18:34:55 +0900 Subject: [PATCH 034/719] Add unit tests for request_verification middleware --- .../request_verification/__init__.py | 0 .../test_request_verification.py | 48 +++++++++++++++ .../request_verification/__init__.py | 0 .../test_request_verification.py | 60 +++++++++++++++++++ 4 files changed, 108 insertions(+) create mode 100644 tests/slack_bolt/middleware/request_verification/__init__.py create mode 100644 tests/slack_bolt/middleware/request_verification/test_request_verification.py create mode 100644 tests/slack_bolt_async/middleware/request_verification/__init__.py create mode 100644 tests/slack_bolt_async/middleware/request_verification/test_request_verification.py diff --git a/tests/slack_bolt/middleware/request_verification/__init__.py b/tests/slack_bolt/middleware/request_verification/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/slack_bolt/middleware/request_verification/test_request_verification.py b/tests/slack_bolt/middleware/request_verification/test_request_verification.py new file mode 100644 index 000000000..dca98e7b6 --- /dev/null +++ b/tests/slack_bolt/middleware/request_verification/test_request_verification.py @@ -0,0 +1,48 @@ +from time import time + +from slack_sdk.signature import SignatureVerifier + +from slack_bolt.middleware import RequestVerification +from slack_bolt.request import BoltRequest +from slack_bolt.response import BoltResponse + + +def next(): + return BoltResponse(status=200, body="next") + + +class TestRequestVerification: + signing_secret = "secret" + signature_verifier = SignatureVerifier(signing_secret) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def test_valid(self): + middleware = RequestVerification(signing_secret=self.signing_secret) + timestamp = str(int(time())) + raw_body = "payload={}" + req = BoltRequest( + body=raw_body, headers=self.build_headers(timestamp, raw_body) + ) + resp = BoltResponse(status=404, body="default") + resp = middleware.process(req=req, resp=resp, next=next) + assert resp.status == 200 + assert resp.body == "next" + + def test_invalid(self): + middleware = RequestVerification(signing_secret=self.signing_secret) + req = BoltRequest(body="payload={}", headers={}) + resp = BoltResponse(status=404) + resp = middleware.process(req=req, resp=resp, next=next) + assert resp.status == 401 + assert resp.body == """{"error": "invalid request"}""" diff --git a/tests/slack_bolt_async/middleware/request_verification/__init__.py b/tests/slack_bolt_async/middleware/request_verification/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/slack_bolt_async/middleware/request_verification/test_request_verification.py b/tests/slack_bolt_async/middleware/request_verification/test_request_verification.py new file mode 100644 index 000000000..783927572 --- /dev/null +++ b/tests/slack_bolt_async/middleware/request_verification/test_request_verification.py @@ -0,0 +1,60 @@ +import asyncio +from time import time + +import pytest +from slack_sdk.signature import SignatureVerifier + +from slack_bolt.middleware.request_verification.async_request_verification import ( + AsyncRequestVerification, +) +from slack_bolt.request.async_request import AsyncBoltRequest +from slack_bolt.response import BoltResponse + + +async def next(): + return BoltResponse(status=200, body="next") + + +class TestAsyncRequestVerification: + signing_secret = "secret" + signature_verifier = SignatureVerifier(signing_secret) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + @pytest.fixture + def event_loop(self): + loop = asyncio.get_event_loop() + yield loop + loop.close() + + @pytest.mark.asyncio + async def test_valid(self): + middleware = AsyncRequestVerification(signing_secret="secret") + timestamp = str(int(time())) + raw_body = "payload={}" + req = AsyncBoltRequest( + body=raw_body, headers=self.build_headers(timestamp, raw_body) + ) + resp = BoltResponse(status=404) + resp = await middleware.async_process(req=req, resp=resp, next=next) + assert resp.status == 200 + assert resp.body == "next" + + @pytest.mark.asyncio + async def test_invalid(self): + middleware = AsyncRequestVerification(signing_secret="secret") + req = AsyncBoltRequest(body="payload={}", headers={}) + resp = BoltResponse(status=404) + resp = await middleware.async_process(req=req, resp=resp, next=next) + assert resp.status == 401 + assert resp.body == """{"error": "invalid request"}""" From 66992107ae51310b6a9ec9d438d83e48172e9639 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 18 Nov 2020 16:59:55 +0900 Subject: [PATCH 035/719] Fix a method name in docs --- docs/_basic/publishing_views.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_basic/publishing_views.md b/docs/_basic/publishing_views.md index 842ba74b9..fd0a7baf3 100644 --- a/docs/_basic/publishing_views.md +++ b/docs/_basic/publishing_views.md @@ -13,7 +13,7 @@ You can subscribe to the ```python @app.event("app_home_opened") -def open_modal(client, event, logger): +def update_home_tab(client, event, logger): try: # Call views.publish with the built-in client client.views_publish( From f05656b57d4f072b8f73d26989ee2684c04fd99e Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 24 Nov 2020 07:27:45 +0900 Subject: [PATCH 036/719] Replace authed_users with authorizations in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bf6636b21..7dde2c3c7 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ Most of the app's functionality will be inside listener functions (the `fn` para | Argument | Description | | :---: | :--- | -| `body` | Dictionary that contains the entire body of the request (superset of `payload`). Some accessory data is only available outside of the payload (such as `trigger_id` and `authed_users`). +| `body` | Dictionary that contains the entire body of the request (superset of `payload`). Some accessory data is only available outside of the payload (such as `trigger_id` and `authorizations`). | `payload` | Contents of the incoming event. The payload structure depends on the listener. For example, for an Events API event, `payload` will be the [event type structure](https://api.slack.com/events-api#event_type_structure). For a block action, it will be the action from within the `actions` list. The `payload` dictionary is also accessible via the alias corresponding to the listener (`message`, `event`, `action`, `shortcut`, `view`, `command`, or `options`). For example, if you were building a `message()` listener, you could use the `payload` and `message` arguments interchangably. **An easy way to understand what's in a payload is to log it**. | | `context` | Event context. This dictionary contains data about the event and app, such as the `botId`. Middleware can add additional context before the event is passed to listeners. | `ack` | Function that **must** be called to acknowledge that your app received the incoming event. `ack` exists for all actions, shortcuts, view submissions, slash command and options requests. `ack` returns a promise that resolves when complete. Read more in [Acknowledging events](https://slack.dev/bolt-python/concepts#acknowledge). From fa5a264a86ad506585931585b62bbb12a5a0a2a8 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 20 Nov 2020 12:54:27 +0900 Subject: [PATCH 037/719] Fix Events API handling issue in shared channels --- slack_bolt/app/app.py | 15 +- slack_bolt/app/async_app.py | 17 +- .../async_multi_teams_authorization.py | 5 +- .../multi_teams_authorization.py | 8 +- slack_bolt/request/internals.py | 22 +- .../test_events_shared_channels.py | 514 ++++++++++++++++ .../test_events_shared_channels.py | 564 ++++++++++++++++++ 7 files changed, 1131 insertions(+), 14 deletions(-) create mode 100644 tests/scenario_tests/test_events_shared_channels.py create mode 100644 tests/scenario_tests_async/test_events_shared_channels.py diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 16fd9463f..8b1666edf 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -766,7 +766,20 @@ def __call__(*args, **kwargs): def _init_context(self, req: BoltRequest): req.context["logger"] = get_bolt_app_logger(self.name) req.context["token"] = self._token - req.context["client"] = self._client + if self._token is not None: + # This WebClient instance can be safely singleton + req.context["client"] = self._client + else: + # Set a new dedicated instance for this request + client_per_request: WebClient = WebClient( + token=None, # the token will be set later + base_url=self._client.base_url, + timeout=self._client.timeout, + ssl=self._client.ssl, + proxy=self._client.proxy, + headers=self._client.headers, + ) + req.context["client"] = client_per_request @staticmethod def _to_listener_functions( diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 62adbc40e..b804378bd 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -782,7 +782,22 @@ def __call__(*args, **kwargs): def _init_context(self, req: AsyncBoltRequest): req.context["logger"] = get_bolt_app_logger(self.name) req.context["token"] = self._token - req.context["client"] = self._async_client + if self._token is not None: + # This AsyncWebClient instance can be safely singleton + req.context["client"] = self._async_client + else: + # Set a new dedicated instance for this request + client_per_request: AsyncWebClient = AsyncWebClient( + token=None, # the token will be set later + base_url=self._async_client.base_url, + timeout=self._async_client.timeout, + ssl=self._async_client.ssl, + proxy=self._async_client.proxy, + session=self._async_client.session, + trust_env_in_session=self._async_client.trust_env_in_session, + headers=self._async_client.headers, + ) + req.context["client"] = client_per_request @staticmethod def _to_listener_functions( diff --git a/slack_bolt/middleware/authorization/async_multi_teams_authorization.py b/slack_bolt/middleware/authorization/async_multi_teams_authorization.py index 98e22aa4b..5f6f72cda 100644 --- a/slack_bolt/middleware/authorization/async_multi_teams_authorization.py +++ b/slack_bolt/middleware/authorization/async_multi_teams_authorization.py @@ -9,7 +9,6 @@ from .internals import _is_no_auth_test_call_required from ...authorization import AuthorizeResult from ...authorization.async_authorize import AsyncAuthorize -from ...util.async_utils import create_async_web_client class AsyncMultiTeamsAuthorization(AsyncAuthorization): @@ -54,7 +53,9 @@ async def async_process( req.context.set_authorize_result(auth_result) token = auth_result.bot_token or auth_result.user_token req.context["token"] = token - req.context["client"] = create_async_web_client(token) + # As AsyncApp#_init_context() generates a new AsyncWebClient for this request, + # it's safe to modify this instance. + req.context.client.token = token return await next() else: # Just in case diff --git a/slack_bolt/middleware/authorization/multi_teams_authorization.py b/slack_bolt/middleware/authorization/multi_teams_authorization.py index bfde5bb47..5a130d623 100644 --- a/slack_bolt/middleware/authorization/multi_teams_authorization.py +++ b/slack_bolt/middleware/authorization/multi_teams_authorization.py @@ -1,9 +1,10 @@ from typing import Callable, Optional +from slack_sdk.errors import SlackApiError + from slack_bolt.logger import get_bolt_logger from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse -from slack_sdk.errors import SlackApiError from .authorization import Authorization from .internals import ( _build_error_response, @@ -12,7 +13,6 @@ ) from ...authorization import AuthorizeResult from ...authorization.authorize import Authorize -from ...util.utils import create_web_client class MultiTeamsAuthorization(Authorization): @@ -55,7 +55,9 @@ def process( req.context.set_authorize_result(auth_result) token = auth_result.bot_token or auth_result.user_token req.context["token"] = token - req.context["client"] = create_web_client(token) + # As App#_init_context() generates a new WebClient for this request, + # it's safe to modify this instance. + req.context.client.token = token return next() else: # Just in case diff --git a/slack_bolt/request/internals.py b/slack_bolt/request/internals.py index 7a3ea872e..da3332c5c 100644 --- a/slack_bolt/request/internals.py +++ b/slack_bolt/request/internals.py @@ -53,6 +53,10 @@ def extract_enterprise_id(payload: Dict[str, Any]) -> Optional[str]: return org elif "id" in org: return org.get("id") # type: ignore + if "authorizations" in payload and len(payload["authorizations"]) > 0: + # To make Events API handling functioning also for shared channels, + # we should use .authorizations[0].enterprise_id over .enterprise_id + return extract_enterprise_id(payload["authorizations"][0]) if "enterprise_id" in payload: return payload.get("enterprise_id") if "team" in payload and "enterprise_id" in payload["team"]: @@ -70,6 +74,10 @@ def extract_team_id(payload: Dict[str, Any]) -> Optional[str]: return team elif team and "id" in team: return team.get("id") + if "authorizations" in payload and len(payload["authorizations"]) > 0: + # To make Events API handling functioning also for shared channels, + # we should use .authorizations[0].team_id over .team_id + return extract_team_id(payload["authorizations"][0]) if "team_id" in payload: return payload.get("team_id") if "event" in payload: @@ -110,21 +118,21 @@ def extract_channel_id(payload: Dict[str, Any]) -> Optional[str]: return None -def build_context(context: BoltContext, payload: Dict[str, Any],) -> BoltContext: - enterprise_id = extract_enterprise_id(payload) +def build_context(context: BoltContext, body: Dict[str, Any]) -> BoltContext: + enterprise_id = extract_enterprise_id(body) if enterprise_id: context["enterprise_id"] = enterprise_id - team_id = extract_team_id(payload) + team_id = extract_team_id(body) if team_id: context["team_id"] = team_id - user_id = extract_user_id(payload) + user_id = extract_user_id(body) if user_id: context["user_id"] = user_id - channel_id = extract_channel_id(payload) + channel_id = extract_channel_id(body) if channel_id: context["channel_id"] = channel_id - if "response_url" in payload: - context["response_url"] = payload["response_url"] + if "response_url" in body: + context["response_url"] = body["response_url"] return context diff --git a/tests/scenario_tests/test_events_shared_channels.py b/tests/scenario_tests/test_events_shared_channels.py new file mode 100644 index 000000000..702b515f3 --- /dev/null +++ b/tests/scenario_tests/test_events_shared_channels.py @@ -0,0 +1,514 @@ +import json +from time import time, sleep + +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web import WebClient + +from slack_bolt import App, BoltRequest, Say +from slack_bolt.authorization import AuthorizeResult +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + +valid_token = "xoxb-valid" + + +def authorize(enterprise_id, team_id, client: WebClient): + assert enterprise_id == "E_INSTALLED" + assert team_id == "T_INSTALLED" + auth_test = client.auth_test(token=valid_token) + return AuthorizeResult.from_auth_test_response( + auth_test_response=auth_test, bot_token=valid_token, + ) + + +class TestEventsSharedChannels: + signing_secret = "secret" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client: WebClient = WebClient( + token=None, base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + valid_event_body = { + "token": "verification_token", + "team_id": "T_INSTALLED", + "enterprise_id": "E_INSTALLED", + "api_app_id": "A111", + "event": { + "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "team": "T_INSTALLED", + "channel": "C111", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, + "authorizations": [ + { + "enterprise_id": "E_INSTALLED", + "team_id": "T_INSTALLED", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + } + + def test_mock_server_is_running(self): + resp = self.web_client.api_test(token=valid_token) + assert resp != None + + def test_middleware(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + authorize=authorize, + ) + + @app.event("app_mention") + def handle_app_mention(body, say: Say, payload, event): + assert body == self.valid_event_body + assert body["event"] == payload + assert payload == event + say("What's up?") + + timestamp, body = str(int(time())), json.dumps(self.valid_event_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + def test_middleware_skip(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + authorize=authorize, + ) + + def skip_middleware(req, resp, next): + # return next() + pass + + @app.event("app_mention", middleware=[skip_middleware]) + def handle_app_mention(body, logger, payload, event): + assert body["event"] == payload + assert payload == event + logger.info(payload) + + timestamp, body = str(int(time())), json.dumps(self.valid_event_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 404 + assert self.mock_received_requests["/auth.test"] == 1 + + valid_reaction_added_body = { + "token": "verification_token", + "team_id": "T_SOURCE", + "enterprise_id": "E_SOURCE", + "api_app_id": "A111", + "event": { + "type": "reaction_added", + "user": "W111", + "item": {"type": "message", "channel": "C111", "ts": "1599529504.000400"}, + "reaction": "heart_eyes", + "item_user": "W111", + "event_ts": "1599616881.000800", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authorizations": [ + { + "enterprise_id": "E_INSTALLED", + "team_id": "T_INSTALLED", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + } + + def test_reaction_added(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + authorize=authorize, + ) + + @app.event("reaction_added") + def handle_app_mention(body, say, payload, event): + assert body == self.valid_reaction_added_body + assert body["event"] == payload + assert payload == event + say("What's up?") + + timestamp, body = str(int(time())), json.dumps(self.valid_reaction_added_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + def test_stable_auto_ack(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + authorize=authorize, + ) + + @app.event("reaction_added") + def handle_app_mention(): + raise Exception("Something wrong!") + + for _ in range(10): + timestamp, body = ( + str(int(time())), + json.dumps(self.valid_reaction_added_body), + ) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + + def test_self_events(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + authorize=authorize, + ) + + event_body = { + "token": "verification_token", + "team_id": "T_SOURCE", + "enterprise_id": "E_SOURCE", + "api_app_id": "A111", + "event": { + "type": "reaction_added", + "user": "W23456789", # bot_user_id + "item": { + "type": "message", + "channel": "C111", + "ts": "1599529504.000400", + }, + "reaction": "heart_eyes", + "item_user": "W111", + "event_ts": "1599616881.000800", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authorizations": [ + { + "enterprise_id": "E_INSTALLED", + "team_id": "T_INSTALLED", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + } + + @app.event("reaction_added") + def handle_app_mention(say): + say("What's up?") + + timestamp, body = str(int(time())), json.dumps(event_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + sleep(1) # wait a bit after auto ack() + # The listener should not be executed + assert self.mock_received_requests.get("/chat.postMessage") is None + + def test_self_member_join_left_events(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + authorize=authorize, + ) + + join_event_body = { + "token": "verification_token", + "team_id": "T_SOURCE", + "enterprise_id": "E_SOURCE", + "api_app_id": "A111", + "event": { + "type": "member_joined_channel", + "user": "W23456789", # bot_user_id + "channel": "C111", + "channel_type": "C", + "team": "T_INSTALLED", + "inviter": "U222", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authorizations": [ + { + "enterprise_id": "E_INSTALLED", + "team_id": "T_INSTALLED", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + } + + left_event_body = { + "token": "verification_token", + "team_id": "T_SOURCE", + "enterprise_id": "E_SOURCE", + "api_app_id": "A111", + "event": { + "type": "member_left_channel", + "user": "W23456789", # bot_user_id + "channel": "C111", + "channel_type": "C", + "team": "T_INSTALLED", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authorizations": [ + { + "enterprise_id": "E_INSTALLED", + "team_id": "T_INSTALLED", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + } + + @app.event("member_joined_channel") + def handle_member_joined_channel(say): + say("What's up?") + + @app.event("member_left_channel") + def handle_member_left_channel(say): + say("What's up?") + + timestamp, body = str(int(time())), json.dumps(join_event_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + timestamp, body = str(int(time())), json.dumps(left_event_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 2 + + def test_member_join_left_events(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + authorize=authorize, + ) + + join_event_body = { + "token": "verification_token", + "team_id": "T_SOURCE", + "enterprise_id": "E_SOURCE", + "api_app_id": "A111", + "event": { + "type": "member_joined_channel", + "user": "U999", # not self + "channel": "C111", + "channel_type": "C", + "team": "T_INSTALLED", + "inviter": "U222", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authorizations": [ + { + "enterprise_id": "E_INSTALLED", + "team_id": "T_INSTALLED", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + } + + left_event_body = { + "token": "verification_token", + "team_id": "T_SOURCE", + "enterprise_id": "E_SOURCE", + "api_app_id": "A111", + "event": { + "type": "member_left_channel", + "user": "U999", # not self + "channel": "C111", + "channel_type": "C", + "team": "T_INSTALLED", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authorizations": [ + { + "enterprise_id": "E_INSTALLED", + "team_id": "T_INSTALLED", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + } + + @app.event("member_joined_channel") + def handle_app_mention(say): + say("What's up?") + + @app.event("member_left_channel") + def handle_app_mention(say): + say("What's up?") + + timestamp, body = str(int(time())), json.dumps(join_event_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + timestamp, body = str(int(time())), json.dumps(left_event_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + + sleep(1) # wait a bit after auto ack() + # the listeners should not be executed + assert self.mock_received_requests["/chat.postMessage"] == 2 + + def test_uninstallation_and_revokes(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + authorize=authorize, + ) + app._client = WebClient( + token="uninstalled-revoked", base_url=self.mock_api_server_base_url + ) + + @app.event("app_uninstalled") + def handler1(say: Say): + say(channel="C111", text="What's up?") + + @app.event("tokens_revoked") + def handler2(say: Say): + say(channel="C111", text="What's up?") + + app_uninstalled_body = { + "token": "verification_token", + "team_id": "T_INSTALLED", + "enterprise_id": "E_INSTALLED", + "api_app_id": "A111", + "event": {"type": "app_uninstalled"}, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authorizations": [ + { + "enterprise_id": "E_INSTALLED", + "team_id": "T_INSTALLED", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + } + + timestamp, body = str(int(time())), json.dumps(app_uninstalled_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + + tokens_revoked_body = { + "token": "verification_token", + "team_id": "T_INSTALLED", + "enterprise_id": "E_INSTALLED", + "api_app_id": "A111", + "event": { + "type": "tokens_revoked", + "tokens": {"oauth": ["UXXXXXXXX"], "bot": ["UXXXXXXXX"]}, + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authorizations": [ + { + "enterprise_id": "E_INSTALLED", + "team_id": "T_INSTALLED", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + } + + timestamp, body = str(int(time())), json.dumps(tokens_revoked_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + + # this should not be called when we have authorize + assert self.mock_received_requests.get("/auth.test") is None + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 2 diff --git a/tests/scenario_tests_async/test_events_shared_channels.py b/tests/scenario_tests_async/test_events_shared_channels.py new file mode 100644 index 000000000..0fb85f11d --- /dev/null +++ b/tests/scenario_tests_async/test_events_shared_channels.py @@ -0,0 +1,564 @@ +import asyncio +import json +from random import random +from time import time + +import pytest +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.authorization import AuthorizeResult +from slack_bolt.context.say.async_say import AsyncSay +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + +valid_token = "xoxb-valid" + + +async def authorize(enterprise_id, team_id, client: AsyncWebClient): + assert enterprise_id == "E_INSTALLED" + assert team_id == "T_INSTALLED" + auth_test = await client.auth_test(token=valid_token) + return AuthorizeResult.from_auth_test_response( + auth_test_response=auth_test, bot_token=valid_token, + ) + + +class TestAsyncEventsSharedChannels: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = AsyncWebClient(token=None, base_url=mock_api_server_base_url) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def build_valid_app_mention_request(self) -> AsyncBoltRequest: + timestamp, body = str(int(time())), json.dumps(app_mention_body) + return AsyncBoltRequest(body=body, headers=self.build_headers(timestamp, body)) + + @pytest.mark.asyncio + async def test_mock_server_is_running(self): + resp = await self.web_client.api_test(token=valid_token) + assert resp != None + + @pytest.mark.asyncio + async def test_app_mention(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + authorize=authorize, + ) + app.event("app_mention")(whats_up) + + request = self.build_valid_app_mention_request() + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + await asyncio.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + @pytest.mark.asyncio + async def test_process_before_response(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + authorize=authorize, + process_before_response=True, + ) + app.event("app_mention")(whats_up) + + request = self.build_valid_app_mention_request() + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + # no sleep here + assert self.mock_received_requests["/chat.postMessage"] == 1 + + @pytest.mark.asyncio + async def test_middleware_skip(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + authorize=authorize, + ) + app.event("app_mention", middleware=[skip_middleware])(whats_up) + + request = self.build_valid_app_mention_request() + response = await app.async_dispatch(request) + assert response.status == 404 + assert self.mock_received_requests["/auth.test"] == 1 + + @pytest.mark.asyncio + async def test_simultaneous_requests(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + authorize=authorize, + ) + app.event("app_mention")(random_sleeper) + + request = self.build_valid_app_mention_request() + + times = 10 + tasks = [] + for i in range(times): + tasks.append(asyncio.ensure_future(app.async_dispatch(request))) + + await asyncio.sleep(5) + # Verifies all the tasks have been completed with 200 OK + assert sum([t.result().status for t in tasks if t.done()]) == 200 * times + + assert self.mock_received_requests["/auth.test"] == times + assert self.mock_received_requests["/chat.postMessage"] == times + + def build_valid_reaction_added_request(self) -> AsyncBoltRequest: + timestamp, body = str(int(time())), json.dumps(reaction_added_body) + return AsyncBoltRequest(body=body, headers=self.build_headers(timestamp, body)) + + @pytest.mark.asyncio + async def test_reaction_added(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + authorize=authorize, + ) + app.event("reaction_added")(whats_up) + + request = self.build_valid_reaction_added_request() + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + await asyncio.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + @pytest.mark.asyncio + async def test_stable_auto_ack(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + authorize=authorize, + ) + app.event("reaction_added")(always_failing) + + for _ in range(10): + request = self.build_valid_reaction_added_request() + response = await app.async_dispatch(request) + assert response.status == 200 + + @pytest.mark.asyncio + async def test_self_events(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + authorize=authorize, + ) + app.event("reaction_added")(whats_up) + + self_event = { + "token": "verification_token", + "team_id": "T_SOURCE", + "enterprise_id": "E_SOURCE", + "api_app_id": "A111", + "event": { + "type": "reaction_added", + "user": "W23456789", # bot_user_id + "item": { + "type": "message", + "channel": "C111", + "ts": "1599529504.000400", + }, + "reaction": "heart_eyes", + "item_user": "W111", + "event_ts": "1599616881.000800", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authorizations": [ + { + "enterprise_id": "E_INSTALLED", + "team_id": "T_INSTALLED", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + } + timestamp, body = str(int(time())), json.dumps(self_event) + request = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + await asyncio.sleep(1) # wait a bit after auto ack() + # The listener should not be executed + assert self.mock_received_requests.get("/chat.postMessage") is None + + @pytest.mark.asyncio + async def test_self_joined_left_events(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + authorize=authorize, + ) + app.event("reaction_added")(whats_up) + + join_event_body = { + "token": "verification_token", + "team_id": "T_SOURCE", + "enterprise_id": "E_SOURCE", + "api_app_id": "A111", + "event": { + "type": "member_joined_channel", + "user": "W23456789", # bot_user_id + "channel": "C111", + "channel_type": "C", + "team": "T_INSTALLED", + "inviter": "U222", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authorizations": [ + { + "enterprise_id": "E_INSTALLED", + "team_id": "T_INSTALLED", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + } + + left_event_body = { + "token": "verification_token", + "team_id": "T_SOURCE", + "enterprise_id": "E_SOURCE", + "api_app_id": "A111", + "event": { + "type": "member_left_channel", + "user": "W23456789", # bot_user_id + "channel": "C111", + "channel_type": "C", + "team": "T_INSTALLED", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authorizations": [ + { + "enterprise_id": "E_INSTALLED", + "team_id": "T_INSTALLED", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + } + + @app.event("member_joined_channel") + async def handle_member_joined_channel(say): + await say("What's up?") + + @app.event("member_left_channel") + async def handle_member_left_channel(say): + await say("What's up?") + + timestamp, body = str(int(time())), json.dumps(join_event_body) + request = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + timestamp, body = str(int(time())), json.dumps(left_event_body) + request = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + + await asyncio.sleep(1) # wait a bit after auto ack() + # The listeners should be executed + assert self.mock_received_requests.get("/chat.postMessage") == 2 + + @pytest.mark.asyncio + async def test_joined_left_events(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + authorize=authorize, + ) + app.event("reaction_added")(whats_up) + + join_event_body = { + "token": "verification_token", + "team_id": "T_SOURCE", + "enterprise_id": "E_SOURCE", + "api_app_id": "A111", + "event": { + "type": "member_joined_channel", + "user": "W111", # other user + "channel": "C111", + "channel_type": "C", + "team": "T_INSTALLED", + "inviter": "U222", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authorizations": [ + { + "enterprise_id": "E_INSTALLED", + "team_id": "T_INSTALLED", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + } + + left_event_body = { + "token": "verification_token", + "team_id": "T_SOURCE", + "enterprise_id": "E_SOURCE", + "api_app_id": "A111", + "event": { + "type": "member_left_channel", + "user": "W111", # other user + "channel": "C111", + "channel_type": "C", + "team": "T_INSTALLED", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authorizations": [ + { + "enterprise_id": "E_INSTALLED", + "team_id": "T_INSTALLED", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + } + + @app.event("member_joined_channel") + async def handle_member_joined_channel(say): + await say("What's up?") + + @app.event("member_left_channel") + async def handle_member_left_channel(say): + await say("What's up?") + + timestamp, body = str(int(time())), json.dumps(join_event_body) + request = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + timestamp, body = str(int(time())), json.dumps(left_event_body) + request = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + + await asyncio.sleep(1) # wait a bit after auto ack() + # The listeners should be executed + assert self.mock_received_requests.get("/chat.postMessage") == 2 + + @pytest.mark.asyncio + async def test_uninstallation_and_revokes(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + authorize=authorize, + ) + app._client = AsyncWebClient( + token="uninstalled-revoked", base_url=self.mock_api_server_base_url + ) + + @app.event("app_uninstalled") + async def handler1(say: AsyncSay): + await say(channel="C111", text="What's up?") + + @app.event("tokens_revoked") + async def handler2(say: AsyncSay): + await say(channel="C111", text="What's up?") + + app_uninstalled_body = { + "token": "verification_token", + "team_id": "T_SOURCE", + "enterprise_id": "E_SOURCE", + "api_app_id": "A111", + "event": {"type": "app_uninstalled"}, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authorizations": [ + { + "enterprise_id": "E_INSTALLED", + "team_id": "T_INSTALLED", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + } + + timestamp, body = str(int(time())), json.dumps(app_uninstalled_body) + request: AsyncBoltRequest = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + + tokens_revoked_body = { + "token": "verification_token", + "team_id": "T_SOURCE", + "enterprise_id": "E_SOURCE", + "api_app_id": "A111", + "event": { + "type": "tokens_revoked", + "tokens": {"oauth": ["UXXXXXXXX"], "bot": ["UXXXXXXXX"]}, + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authorizations": [ + { + "enterprise_id": "E_INSTALLED", + "team_id": "T_INSTALLED", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + } + + timestamp, body = str(int(time())), json.dumps(tokens_revoked_body) + request: AsyncBoltRequest = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + + # AsyncApp doesn't call auth.test when booting + assert self.mock_received_requests.get("/auth.test") is None + await asyncio.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 2 + + +app_mention_body = { + "token": "verification_token", + "team_id": "T_INSTALLED", + "enterprise_id": "E_SOURCE", + "api_app_id": "A111", + "event": { + "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "team": "T_INSTALLED", + "channel": "C111", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, + "authorizations": [ + { + "enterprise_id": "E_INSTALLED", + "team_id": "T_INSTALLED", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], +} + +reaction_added_body = { + "token": "verification_token", + "team_id": "T_SOURCE", + "enterprise_id": "E_SOURCE", + "api_app_id": "A111", + "event": { + "type": "reaction_added", + "user": "W111", + "item": {"type": "message", "channel": "C111", "ts": "1599529504.000400"}, + "reaction": "heart_eyes", + "item_user": "W111", + "event_ts": "1599616881.000800", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authorizations": [ + { + "enterprise_id": "E_INSTALLED", + "team_id": "T_INSTALLED", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], +} + + +async def random_sleeper(body, say, payload, event): + assert body == app_mention_body + assert body["event"] == payload + assert payload == event + seconds = random() + 2 # 2-3 seconds + await asyncio.sleep(seconds) + await say(f"Sending this message after sleeping for {seconds} seconds") + + +async def whats_up(body, say, payload, event): + assert body["event"] == payload + assert payload == event + await say("What's up?") + + +async def skip_middleware(req, resp, next): + # return next() + pass + + +async def always_failing(): + raise Exception("Something wrong!") From 5033ae4327cc624753a6344c0b9129dfda09c8f5 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 23 Nov 2020 16:00:07 +0900 Subject: [PATCH 038/719] Add OAuth related arg validation and flexibility --- slack_bolt/app/async_app.py | 8 ++++ slack_bolt/logger/messages.py | 8 ++++ slack_bolt/oauth/async_oauth_flow.py | 5 +++ slack_bolt/oauth/async_oauth_settings.py | 10 +++-- slack_bolt/oauth/oauth_settings.py | 10 +++-- tests/slack_bolt/oauth/test_oauth_flow.py | 13 ++++++- .../oauth/test_async_oauth_flow.py | 37 +++++++++++++++++++ 7 files changed, 84 insertions(+), 7 deletions(-) diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index b804378bd..e440bfafe 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -34,6 +34,8 @@ error_listener_function_must_be_coro_func, error_client_invalid_type_async, error_authorize_conflicts, + error_oauth_settings_invalid_type_async, + error_oauth_flow_invalid_type_async, ) from slack_bolt.lazy_listener.asyncio_runner import AsyncioLazyListenerRunner from slack_bolt.listener.async_listener import AsyncListener, AsyncCustomListener @@ -167,6 +169,9 @@ def __init__( oauth_settings = AsyncOAuthSettings() if oauth_flow: + if not isinstance(oauth_flow, AsyncOAuthFlow): + raise BoltError(error_oauth_flow_invalid_type_async()) + self._async_oauth_flow = oauth_flow installation_store = select_consistent_installation_store( client_id=self._async_oauth_flow.client_id, @@ -182,6 +187,9 @@ def __init__( if self._async_authorize is None: self._async_authorize = self._async_oauth_flow.settings.authorize elif oauth_settings is not None: + if not isinstance(oauth_settings, AsyncOAuthSettings): + raise BoltError(error_oauth_settings_invalid_type_async()) + installation_store = select_consistent_installation_store( client_id=oauth_settings.client_id, app_store=self._async_installation_store, diff --git a/slack_bolt/logger/messages.py b/slack_bolt/logger/messages.py index 29ee7bfe0..291ddf1d3 100644 --- a/slack_bolt/logger/messages.py +++ b/slack_bolt/logger/messages.py @@ -26,6 +26,14 @@ def error_client_invalid_type_async() -> str: return "`client` must be a slack_sdk.web.async_client.AsyncWebClient" +def error_oauth_flow_invalid_type_async() -> str: + return "`oauth_flow` must be a slack_bolt.oauth.async_oauth_flow.AsyncOAuthFlow" + + +def error_oauth_settings_invalid_type_async() -> str: + return "`oauth_settings` must be a slack_bolt.oauth.async_oauth_settings.AsyncOAuthSettings" + + def error_auth_test_failure(error_response: SlackResponse) -> str: return f"`token` is invalid (auth.test result: {error_response})" diff --git a/slack_bolt/oauth/async_oauth_flow.py b/slack_bolt/oauth/async_oauth_flow.py index 1157dd632..073a622e3 100644 --- a/slack_bolt/oauth/async_oauth_flow.py +++ b/slack_bolt/oauth/async_oauth_flow.py @@ -4,6 +4,7 @@ from typing import Optional, Dict, Callable, Awaitable, Sequence from slack_bolt.error import BoltError +from slack_bolt.logger.messages import error_oauth_settings_invalid_type_async from slack_bolt.oauth.async_callback_options import ( AsyncCallbackOptions, DefaultAsyncCallbackOptions, @@ -62,7 +63,11 @@ def __init__( """ self._async_client = client self._logger = logger + + if not isinstance(settings, AsyncOAuthSettings): + raise BoltError(error_oauth_settings_invalid_type_async()) self.settings = settings + self.settings.logger = self._logger self.client_id = self.settings.client_id diff --git a/slack_bolt/oauth/async_oauth_settings.py b/slack_bolt/oauth/async_oauth_settings.py index 6b2431ef7..f09df9a0d 100644 --- a/slack_bolt/oauth/async_oauth_settings.py +++ b/slack_bolt/oauth/async_oauth_settings.py @@ -1,7 +1,7 @@ import logging import os from logging import Logger -from typing import Optional, Sequence +from typing import Optional, Sequence, Union from slack_sdk.oauth import ( OAuthStateUtils, @@ -57,8 +57,8 @@ def __init__( # OAuth flow parameters/credentials client_id: Optional[str] = None, # required client_secret: Optional[str] = None, # required - scopes: Optional[Sequence[str]] = None, - user_scopes: Optional[Sequence[str]] = None, + scopes: Optional[Union[Sequence[str], str]] = None, + user_scopes: Optional[Union[Sequence[str], str]] = None, redirect_uri: Optional[str] = None, # Handler configuration install_path: str = "/slack/install", @@ -104,9 +104,13 @@ def __init__( raise BoltError("Both client_id and client_secret are required") self.scopes = scopes or os.environ.get("SLACK_SCOPES", "").split(",") + if isinstance(self.scopes, str): + self.scopes = self.scopes.split(",") self.user_scopes = user_scopes or os.environ.get("SLACK_USER_SCOPES", "").split( "," ) + if isinstance(self.user_scopes, str): + self.user_scopes = self.user_scopes.split(",") self.redirect_uri = redirect_uri or os.environ.get("SLACK_REDIRECT_URI") # Handler configuration self.install_path = install_path or os.environ.get( diff --git a/slack_bolt/oauth/oauth_settings.py b/slack_bolt/oauth/oauth_settings.py index 3dd49e1ef..1462925c2 100644 --- a/slack_bolt/oauth/oauth_settings.py +++ b/slack_bolt/oauth/oauth_settings.py @@ -1,7 +1,7 @@ import logging import os from logging import Logger -from typing import Optional, Sequence +from typing import Optional, Sequence, Union from slack_sdk.oauth import ( OAuthStateStore, @@ -52,8 +52,8 @@ def __init__( # OAuth flow parameters/credentials client_id: Optional[str] = None, # required client_secret: Optional[str] = None, # required - scopes: Optional[Sequence[str]] = None, - user_scopes: Optional[Sequence[str]] = None, + scopes: Optional[Union[Sequence[str], str]] = None, + user_scopes: Optional[Union[Sequence[str], str]] = None, redirect_uri: Optional[str] = None, # Handler configuration install_path: str = "/slack/install", @@ -98,9 +98,13 @@ def __init__( raise BoltError("Both client_id and client_secret are required") self.scopes = scopes or os.environ.get("SLACK_SCOPES", "").split(",") + if isinstance(self.scopes, str): + self.scopes = self.scopes.split(",") self.user_scopes = user_scopes or os.environ.get("SLACK_USER_SCOPES", "").split( "," ) + if isinstance(self.user_scopes, str): + self.user_scopes = self.user_scopes.split(",") self.redirect_uri = redirect_uri or os.environ.get("SLACK_REDIRECT_URI") # Handler configuration self.install_path = install_path or os.environ.get( diff --git a/tests/slack_bolt/oauth/test_oauth_flow.py b/tests/slack_bolt/oauth/test_oauth_flow.py index 5d390f7bf..a2797e5e0 100644 --- a/tests/slack_bolt/oauth/test_oauth_flow.py +++ b/tests/slack_bolt/oauth/test_oauth_flow.py @@ -46,6 +46,7 @@ def test_handle_installation(self): client_id="111.222", client_secret="xxx", scopes=["chat:write", "commands"], + user_scopes=["search:read"], installation_store=FileInstallationStore(), state_store=FileOAuthStateStore(expiration_seconds=120), ) @@ -54,9 +55,19 @@ def test_handle_installation(self): resp = oauth_flow.handle_installation(req) assert resp.status == 200 assert resp.headers.get("content-type") == ["text/html; charset=utf-8"] - assert resp.headers.get("content-length") == ["565"] + assert resp.headers.get("content-length") == ["576"] assert "https://slack.com/oauth/v2/authorize?state=" in resp.body + def test_scopes_as_str(self): + settings = OAuthSettings( + client_id="111.222", + client_secret="xxx", + scopes="chat:write,commands", + user_scopes="search:read", + ) + assert settings.scopes == ["chat:write", "commands"] + assert settings.user_scopes == ["search:read"] + def test_handle_callback(self): oauth_flow = OAuthFlow( client=WebClient(base_url=self.mock_api_server_base_url), diff --git a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py index 85968ed0c..44f4e5ea7 100644 --- a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py +++ b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py @@ -11,6 +11,7 @@ from slack_bolt import BoltResponse from slack_bolt.app.async_app import AsyncApp +from slack_bolt.error import BoltError from slack_bolt.oauth.async_callback_options import ( AsyncFailureArgs, AsyncSuccessArgs, @@ -18,6 +19,7 @@ ) from slack_bolt.oauth.async_oauth_flow import AsyncOAuthFlow from slack_bolt.oauth.async_oauth_settings import AsyncOAuthSettings +from slack_bolt.oauth.oauth_settings import OAuthSettings from slack_bolt.request.async_request import AsyncBoltRequest from tests.mock_web_api_server import ( cleanup_mock_web_api_server, @@ -46,6 +48,7 @@ async def test_instantiation(self): client_id="111.222", client_secret="xxx", scopes=["chat:write", "commands"], + user_scopes=["search:read"], installation_store=FileInstallationStore(), state_store=FileOAuthStateStore(expiration_seconds=120), ) @@ -54,6 +57,40 @@ async def test_instantiation(self): assert oauth_flow.logger is not None assert oauth_flow.client is not None + @pytest.mark.asyncio + async def test_scopes_as_str(self): + settings = AsyncOAuthSettings( + client_id="111.222", + client_secret="xxx", + scopes="chat:write,commands", + user_scopes="search:read", + ) + assert settings.scopes == ["chat:write", "commands"] + assert settings.user_scopes == ["search:read"] + + @pytest.mark.asyncio + async def test_instantiation_non_async_settings(self): + with pytest.raises(BoltError): + AsyncOAuthFlow( + settings=OAuthSettings( + client_id="111.222", + client_secret="xxx", + scopes="chat:write,commands", + ) + ) + + @pytest.mark.asyncio + async def test_instantiation_non_async_settings_to_app(self): + with pytest.raises(BoltError): + AsyncApp( + signing_secret="xxx", + oauth_settings=OAuthSettings( + client_id="111.222", + client_secret="xxx", + scopes="chat:write,commands", + ), + ) + @pytest.mark.asyncio async def test_handle_installation(self): oauth_flow = AsyncOAuthFlow( From 37d994a1abec9afd5080ca159f31b06815ea6a9f Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 23 Nov 2020 16:37:37 +0900 Subject: [PATCH 039/719] Apply internal adjustments for Socket Mode support --- slack_bolt/app/app.py | 4 - slack_bolt/app/async_app.py | 4 - slack_bolt/logger/messages.py | 8 - .../async_request_verification.py | 2 +- .../request_verification.py | 8 +- slack_bolt/request/async_request.py | 22 +- slack_bolt/request/internals.py | 8 + slack_bolt/request/request.py | 23 +- .../scenario_tests/test_events_socket_mode.py | 358 ++++++++++++++++ tests/scenario_tests_async/test_app.py | 6 - .../test_events_socket_mode.py | 401 ++++++++++++++++++ 11 files changed, 810 insertions(+), 34 deletions(-) create mode 100644 tests/scenario_tests/test_events_socket_mode.py create mode 100644 tests/scenario_tests_async/test_events_socket_mode.py diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 8b1666edf..4f59e78fa 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -30,7 +30,6 @@ from slack_bolt.listener_matcher.listener_matcher import ListenerMatcher from slack_bolt.logger import get_bolt_app_logger, get_bolt_logger from slack_bolt.logger.messages import ( - error_signing_secret_not_found, warning_client_prioritized_and_token_skipped, warning_token_skipped, error_auth_test_failure, @@ -106,9 +105,6 @@ def __init__( signing_secret = signing_secret or os.environ.get("SLACK_SIGNING_SECRET") token = token or os.environ.get("SLACK_BOT_TOKEN") - if signing_secret is None or signing_secret == "": - raise BoltError(error_signing_secret_not_found()) - self._name: str = name or inspect.stack()[1].filename.split(os.path.sep)[-1] self._signing_secret: str = signing_secret diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index e440bfafe..b80106919 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -23,7 +23,6 @@ ) from slack_bolt.error import BoltError from slack_bolt.logger.messages import ( - error_signing_secret_not_found, warning_client_prioritized_and_token_skipped, warning_token_skipped, error_token_required, @@ -115,9 +114,6 @@ def __init__( signing_secret = signing_secret or os.environ.get("SLACK_SIGNING_SECRET") token = token or os.environ.get("SLACK_BOT_TOKEN") - if signing_secret is None or signing_secret == "": - raise BoltError(error_signing_secret_not_found()) - self._name: str = name or inspect.stack()[1].filename.split(os.path.sep)[-1] self._signing_secret: str = signing_secret self._verification_token: Optional[str] = verification_token or os.environ.get( diff --git a/slack_bolt/logger/messages.py b/slack_bolt/logger/messages.py index 291ddf1d3..e01f03005 100644 --- a/slack_bolt/logger/messages.py +++ b/slack_bolt/logger/messages.py @@ -10,14 +10,6 @@ # ------------------------------- -def error_signing_secret_not_found() -> str: - return ( - "Signing secret not found, so could not initialize the Bolt app." - "Copy your Signing Secret from the Basic Information page " - "and then store it in a new environment variable" - ) - - def error_client_invalid_type() -> str: return "`client` must be a slack_sdk.web.WebClient" diff --git a/slack_bolt/middleware/request_verification/async_request_verification.py b/slack_bolt/middleware/request_verification/async_request_verification.py index c62041b89..7fde73ddd 100644 --- a/slack_bolt/middleware/request_verification/async_request_verification.py +++ b/slack_bolt/middleware/request_verification/async_request_verification.py @@ -14,7 +14,7 @@ async def async_process( resp: BoltResponse, next: Callable[[], Awaitable[BoltResponse]], ) -> BoltResponse: - if self._can_skip(req.body): + if self._can_skip(req.mode, req.body): return await next() body = req.raw_body diff --git a/slack_bolt/middleware/request_verification/request_verification.py b/slack_bolt/middleware/request_verification/request_verification.py index 8c91e65f2..538441070 100644 --- a/slack_bolt/middleware/request_verification/request_verification.py +++ b/slack_bolt/middleware/request_verification/request_verification.py @@ -21,7 +21,7 @@ def __init__(self, signing_secret: str): def process( self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse], ) -> BoltResponse: - if self._can_skip(req.body): + if self._can_skip(req.mode, req.body): return next() body = req.raw_body @@ -36,8 +36,10 @@ def process( # ----------------------------------------- @staticmethod - def _can_skip(body: Dict[str, Any]) -> bool: - return body is not None and body.get("ssl_check") == "1" + def _can_skip(mode: str, body: Dict[str, Any]) -> bool: + return mode == "socket_mode" or ( + body is not None and body.get("ssl_check") == "1" + ) @staticmethod def _build_error_response() -> BoltResponse: diff --git a/slack_bolt/request/async_request.py b/slack_bolt/request/async_request.py index 032beaafd..d1c03cbe0 100644 --- a/slack_bolt/request/async_request.py +++ b/slack_bolt/request/async_request.py @@ -1,12 +1,15 @@ from typing import Dict, Optional, Union, Any, Sequence from slack_bolt.context.async_context import AsyncBoltContext +from slack_bolt.error import BoltError from slack_bolt.request.async_internals import build_async_context from slack_bolt.request.internals import ( parse_query, parse_body, build_normalized_headers, extract_content_type, + error_message_raw_body_required_in_http_mode, + error_message_unknown_request_body_type, ) @@ -19,27 +22,37 @@ class AsyncBoltRequest: context: AsyncBoltContext lazy_only: bool lazy_function_name: Optional[str] + mode: str # either "http" or "socket_mode" def __init__( self, *, - body: str, + body: Union[str, dict], query: Optional[Union[str, Dict[str, str], Dict[str, Sequence[str]]]] = None, headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, context: Optional[Dict[str, str]] = None, + mode: str = "http", # either "http" or "socket_mode" ): """Request to a Bolt app. - :param body: The raw request body (only plain text is supported) + :param body: The raw request body (only plain text is supported for "http" mode) :param query: The query string data in any data format. :param headers: The request headers. :param context: The context in this request. + :param mode: The mode used for this request. (either "http" or "socket_mode") """ - self.raw_body = body + if mode == "http" and not isinstance(body, str): + raise BoltError(error_message_raw_body_required_in_http_mode()) + self.raw_body = body if mode == "http" else "" self.query = parse_query(query) self.headers = build_normalized_headers(headers) self.content_type = extract_content_type(self.headers) - self.body = parse_body(self.raw_body, self.content_type) + if isinstance(body, str): + self.body = parse_body(self.raw_body, self.content_type) + elif isinstance(body, dict): + self.body = body + else: + raise BoltError(error_message_unknown_request_body_type()) self.context = build_async_context( AsyncBoltContext(context if context else {}), self.body ) @@ -47,3 +60,4 @@ def __init__( self.lazy_function_name = self.headers.get( "x-slack-bolt-lazy-function-name", [None] )[0] + self.mode = mode diff --git a/slack_bolt/request/internals.py b/slack_bolt/request/internals.py index da3332c5c..634f218e3 100644 --- a/slack_bolt/request/internals.py +++ b/slack_bolt/request/internals.py @@ -159,3 +159,11 @@ def build_normalized_headers( f"Unsupported type ({type(value)}) of element in headers ({headers})" ) return normalized_headers # type: ignore + + +def error_message_raw_body_required_in_http_mode() -> str: + return "`body` must be a raw string data when running in the HTTP server mode" + + +def error_message_unknown_request_body_type() -> str: + return "`body` must be either str or dict" diff --git a/slack_bolt/request/request.py b/slack_bolt/request/request.py index df5b2b351..9a1129e84 100644 --- a/slack_bolt/request/request.py +++ b/slack_bolt/request/request.py @@ -1,12 +1,15 @@ from typing import Dict, Optional, Union, Any, Sequence from slack_bolt.context.context import BoltContext +from slack_bolt.error import BoltError from slack_bolt.request.internals import ( parse_query, parse_body, build_normalized_headers, build_context, extract_content_type, + error_message_raw_body_required_in_http_mode, + error_message_unknown_request_body_type, ) @@ -19,29 +22,41 @@ class BoltRequest: context: BoltContext lazy_only: bool lazy_function_name: Optional[str] + mode: str # either "http" or "socket_mode" def __init__( self, *, - body: str, + body: Union[str, dict], query: Optional[Union[str, Dict[str, str], Dict[str, Sequence[str]]]] = None, headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, context: Optional[Dict[str, str]] = None, + mode: str = "http", # either "http" or "socket_mode" ): """Request to a Bolt app. - :param body: The raw request body (only plain text is supported) + :param body: The raw request body (only plain text is supported for "http" mode) :param query: The query string data in any data format. :param headers: The request headers. :param context: The context in this request. + :param mode: The mode used for this request. (either "http" or "socket_mode") """ - self.raw_body = body + if mode == "http" and not isinstance(body, str): + raise BoltError(error_message_raw_body_required_in_http_mode()) + self.raw_body = body if mode == "http" else "" self.query = parse_query(query) self.headers = build_normalized_headers(headers) self.content_type = extract_content_type(self.headers) - self.body = parse_body(self.raw_body, self.content_type) + if isinstance(body, str): + self.body = parse_body(self.raw_body, self.content_type) + elif isinstance(body, dict): + self.body = body + else: + raise BoltError(error_message_unknown_request_body_type()) + self.context = build_context(BoltContext(context if context else {}), self.body) self.lazy_only = self.headers.get("x-slack-bolt-lazy-only", [False])[0] self.lazy_function_name = self.headers.get( "x-slack-bolt-lazy-function-name", [None] )[0] + self.mode = mode diff --git a/tests/scenario_tests/test_events_socket_mode.py b/tests/scenario_tests/test_events_socket_mode.py new file mode 100644 index 000000000..5a02f9624 --- /dev/null +++ b/tests/scenario_tests/test_events_socket_mode.py @@ -0,0 +1,358 @@ +from time import sleep + +import pytest +from slack_sdk.web import WebClient + +from slack_bolt import App, BoltRequest, Say +from slack_bolt.error import BoltError +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestEventsSocketMode: + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + valid_event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "team": "T111", + "channel": "C111", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, + "authed_users": ["W111"], + } + + def test_mock_server_is_running(self): + resp = self.web_client.api_test() + assert resp != None + + def test_body_validation(self): + with pytest.raises(BoltError): + BoltRequest(body={"foo": "bar"}, mode="http") + + def test_middleware(self): + app = App(client=self.web_client) + + @app.event("app_mention") + def handle_app_mention(body, say, payload, event): + assert body == self.valid_event_body + assert body["event"] == payload + assert payload == event + say("What's up?") + + request: BoltRequest = BoltRequest( + body=self.valid_event_body, mode="socket_mode" + ) + response = app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + def test_middleware_skip(self): + app = App(client=self.web_client) + + def skip_middleware(req, resp, next): + # return next() + pass + + @app.event("app_mention", middleware=[skip_middleware]) + def handle_app_mention(body, logger, payload, event): + assert body["event"] == payload + assert payload == event + logger.info(payload) + + request: BoltRequest = BoltRequest( + body=self.valid_event_body, mode="socket_mode" + ) + response = app.dispatch(request) + assert response.status == 404 + assert self.mock_received_requests["/auth.test"] == 1 + + valid_reaction_added_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "reaction_added", + "user": "W111", + "item": {"type": "message", "channel": "C111", "ts": "1599529504.000400"}, + "reaction": "heart_eyes", + "item_user": "W111", + "event_ts": "1599616881.000800", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + + def test_reaction_added(self): + app = App(client=self.web_client) + + @app.event("reaction_added") + def handle_app_mention(body, say, payload, event): + assert body == self.valid_reaction_added_body + assert body["event"] == payload + assert payload == event + say("What's up?") + + request: BoltRequest = BoltRequest( + body=self.valid_reaction_added_body, mode="socket_mode" + ) + response = app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + def test_stable_auto_ack(self): + app = App(client=self.web_client) + + @app.event("reaction_added") + def handle_app_mention(): + raise Exception("Something wrong!") + + for _ in range(10): + request: BoltRequest = BoltRequest( + body=self.valid_reaction_added_body, mode="socket_mode" + ) + response = app.dispatch(request) + assert response.status == 200 + + def test_self_events(self): + app = App(client=self.web_client) + + event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "reaction_added", + "user": "W23456789", # bot_user_id + "item": { + "type": "message", + "channel": "C111", + "ts": "1599529504.000400", + }, + "reaction": "heart_eyes", + "item_user": "W111", + "event_ts": "1599616881.000800", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + + @app.event("reaction_added") + def handle_app_mention(say): + say("What's up?") + + request: BoltRequest = BoltRequest(body=event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + sleep(1) # wait a bit after auto ack() + # The listener should not be executed + assert self.mock_received_requests.get("/chat.postMessage") is None + + def test_self_member_join_left_events(self): + app = App(client=self.web_client) + + join_event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "member_joined_channel", + "user": "W23456789", # bot_user_id + "channel": "C111", + "channel_type": "C", + "team": "T111", + "inviter": "U222", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + + left_event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "member_left_channel", + "user": "W23456789", # bot_user_id + "channel": "C111", + "channel_type": "C", + "team": "T111", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + + @app.event("member_joined_channel") + def handle_member_joined_channel(say): + say("What's up?") + + @app.event("member_left_channel") + def handle_member_left_channel(say): + say("What's up?") + + request: BoltRequest = BoltRequest(body=join_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + request: BoltRequest = BoltRequest(body=left_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 2 + + def test_member_join_left_events(self): + app = App(client=self.web_client) + + join_event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "member_joined_channel", + "user": "U999", # not self + "channel": "C111", + "channel_type": "C", + "team": "T111", + "inviter": "U222", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + + left_event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "member_left_channel", + "user": "U999", # not self + "channel": "C111", + "channel_type": "C", + "team": "T111", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + + @app.event("member_joined_channel") + def handle_app_mention(say): + say("What's up?") + + @app.event("member_left_channel") + def handle_app_mention(say): + say("What's up?") + + request: BoltRequest = BoltRequest(body=join_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + request: BoltRequest = BoltRequest(body=left_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + + sleep(1) # wait a bit after auto ack() + # the listeners should not be executed + assert self.mock_received_requests["/chat.postMessage"] == 2 + + def test_uninstallation_and_revokes(self): + app = App(client=self.web_client) + app._client = WebClient( + token="uninstalled-revoked", base_url=self.mock_api_server_base_url + ) + + @app.event("app_uninstalled") + def handler1(say: Say): + say(channel="C111", text="What's up?") + + @app.event("tokens_revoked") + def handler2(say: Say): + say(channel="C111", text="What's up?") + + app_uninstalled_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": {"type": "app_uninstalled"}, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + } + + request: BoltRequest = BoltRequest( + body=app_uninstalled_body, mode="socket_mode" + ) + response = app.dispatch(request) + assert response.status == 200 + + tokens_revoked_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "tokens_revoked", + "tokens": {"oauth": ["UXXXXXXXX"], "bot": ["UXXXXXXXX"]}, + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + } + + request: BoltRequest = BoltRequest(body=tokens_revoked_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + + assert self.mock_received_requests["/auth.test"] == 1 + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 2 diff --git a/tests/scenario_tests_async/test_app.py b/tests/scenario_tests_async/test_app.py index f9e38f9ab..6f9d0a8a8 100644 --- a/tests/scenario_tests_async/test_app.py +++ b/tests/scenario_tests_async/test_app.py @@ -18,12 +18,6 @@ def setup_method(self): def teardown_method(self): restore_os_env(self.old_os_env) - def test_signing_secret_absence(self): - with pytest.raises(BoltError): - AsyncApp(signing_secret=None, token="xoxb-xxx") - with pytest.raises(BoltError): - AsyncApp(signing_secret="", token="xoxb-xxx") - def non_coro_func(self, ack): ack() diff --git a/tests/scenario_tests_async/test_events_socket_mode.py b/tests/scenario_tests_async/test_events_socket_mode.py new file mode 100644 index 000000000..d668f963c --- /dev/null +++ b/tests/scenario_tests_async/test_events_socket_mode.py @@ -0,0 +1,401 @@ +import asyncio +from random import random + +import pytest +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.context.say.async_say import AsyncSay +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestAsyncEvents: + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + def build_valid_app_mention_request(self) -> AsyncBoltRequest: + return AsyncBoltRequest(body=app_mention_body, mode="socket_mode") + + @pytest.mark.asyncio + async def test_mock_server_is_running(self): + resp = await self.web_client.api_test() + assert resp != None + + @pytest.mark.asyncio + async def test_app_mention(self): + app = AsyncApp(client=self.web_client) + app.event("app_mention")(whats_up) + + request = self.build_valid_app_mention_request() + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + await asyncio.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + @pytest.mark.asyncio + async def test_process_before_response(self): + app = AsyncApp(client=self.web_client, process_before_response=True,) + app.event("app_mention")(whats_up) + + request = self.build_valid_app_mention_request() + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + # no sleep here + assert self.mock_received_requests["/chat.postMessage"] == 1 + + @pytest.mark.asyncio + async def test_middleware_skip(self): + app = AsyncApp(client=self.web_client) + app.event("app_mention", middleware=[skip_middleware])(whats_up) + + request = self.build_valid_app_mention_request() + response = await app.async_dispatch(request) + assert response.status == 404 + assert self.mock_received_requests["/auth.test"] == 1 + + @pytest.mark.asyncio + async def test_simultaneous_requests(self): + app = AsyncApp(client=self.web_client) + app.event("app_mention")(random_sleeper) + + request = self.build_valid_app_mention_request() + + times = 10 + tasks = [] + for i in range(times): + tasks.append(asyncio.ensure_future(app.async_dispatch(request))) + + await asyncio.sleep(5) + # Verifies all the tasks have been completed with 200 OK + assert sum([t.result().status for t in tasks if t.done()]) == 200 * times + + assert self.mock_received_requests["/auth.test"] == times + assert self.mock_received_requests["/chat.postMessage"] == times + + def build_valid_reaction_added_request(self) -> AsyncBoltRequest: + return AsyncBoltRequest(body=reaction_added_body, mode="socket_mode") + + @pytest.mark.asyncio + async def test_reaction_added(self): + app = AsyncApp(client=self.web_client) + app.event("reaction_added")(whats_up) + + request = self.build_valid_reaction_added_request() + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + await asyncio.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + @pytest.mark.asyncio + async def test_stable_auto_ack(self): + app = AsyncApp(client=self.web_client) + app.event("reaction_added")(always_failing) + + for _ in range(10): + request = self.build_valid_reaction_added_request() + response = await app.async_dispatch(request) + assert response.status == 200 + + @pytest.mark.asyncio + async def test_self_events(self): + app = AsyncApp(client=self.web_client) + app.event("reaction_added")(whats_up) + + self_event = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "reaction_added", + "user": "W23456789", # bot_user_id + "item": { + "type": "message", + "channel": "C111", + "ts": "1599529504.000400", + }, + "reaction": "heart_eyes", + "item_user": "W111", + "event_ts": "1599616881.000800", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + request = AsyncBoltRequest(body=self_event, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + await asyncio.sleep(1) # wait a bit after auto ack() + # The listener should not be executed + assert self.mock_received_requests.get("/chat.postMessage") is None + + @pytest.mark.asyncio + async def test_self_joined_left_events(self): + app = AsyncApp(client=self.web_client) + app.event("reaction_added")(whats_up) + + join_event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "member_joined_channel", + "user": "W23456789", # bot_user_id + "channel": "C111", + "channel_type": "C", + "team": "T111", + "inviter": "U222", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + + left_event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "member_left_channel", + "user": "W23456789", # bot_user_id + "channel": "C111", + "channel_type": "C", + "team": "T111", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + + @app.event("member_joined_channel") + async def handle_member_joined_channel(say): + await say("What's up?") + + @app.event("member_left_channel") + async def handle_member_left_channel(say): + await say("What's up?") + + request = AsyncBoltRequest(body=join_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + request = AsyncBoltRequest(body=left_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + + await asyncio.sleep(1) # wait a bit after auto ack() + # The listeners should be executed + assert self.mock_received_requests.get("/chat.postMessage") == 2 + + @pytest.mark.asyncio + async def test_joined_left_events(self): + app = AsyncApp(client=self.web_client) + app.event("reaction_added")(whats_up) + + join_event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "member_joined_channel", + "user": "W111", # other user + "channel": "C111", + "channel_type": "C", + "team": "T111", + "inviter": "U222", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + + left_event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "member_left_channel", + "user": "W111", # other user + "channel": "C111", + "channel_type": "C", + "team": "T111", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + + @app.event("member_joined_channel") + async def handle_member_joined_channel(say): + await say("What's up?") + + @app.event("member_left_channel") + async def handle_member_left_channel(say): + await say("What's up?") + + request = AsyncBoltRequest(body=join_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + request = AsyncBoltRequest(body=left_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + + await asyncio.sleep(1) # wait a bit after auto ack() + # The listeners should be executed + assert self.mock_received_requests.get("/chat.postMessage") == 2 + + @pytest.mark.asyncio + async def test_uninstallation_and_revokes(self): + app = AsyncApp(client=self.web_client) + app._client = AsyncWebClient( + token="uninstalled-revoked", base_url=self.mock_api_server_base_url + ) + + @app.event("app_uninstalled") + async def handler1(say: AsyncSay): + await say(channel="C111", text="What's up?") + + @app.event("tokens_revoked") + async def handler2(say: AsyncSay): + await say(channel="C111", text="What's up?") + + app_uninstalled_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": {"type": "app_uninstalled"}, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + } + + request: AsyncBoltRequest = AsyncBoltRequest( + body=app_uninstalled_body, mode="socket_mode" + ) + response = await app.async_dispatch(request) + assert response.status == 200 + + tokens_revoked_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "tokens_revoked", + "tokens": {"oauth": ["UXXXXXXXX"], "bot": ["UXXXXXXXX"]}, + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + } + + request: AsyncBoltRequest = AsyncBoltRequest( + body=tokens_revoked_body, mode="socket_mode" + ) + response = await app.async_dispatch(request) + assert response.status == 200 + + # AsyncApp doesn't call auth.test when booting + assert self.mock_received_requests.get("/auth.test") is None + await asyncio.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 2 + + +app_mention_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "team": "T111", + "channel": "C111", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, + "authed_users": ["W111"], +} + +reaction_added_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "reaction_added", + "user": "W111", + "item": {"type": "message", "channel": "C111", "ts": "1599529504.000400"}, + "reaction": "heart_eyes", + "item_user": "W111", + "event_ts": "1599616881.000800", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], +} + + +async def random_sleeper(body, say, payload, event): + assert body == app_mention_body + assert body["event"] == payload + assert payload == event + seconds = random() + 2 # 2-3 seconds + await asyncio.sleep(seconds) + await say(f"Sending this message after sleeping for {seconds} seconds") + + +async def whats_up(body, say, payload, event): + assert body["event"] == payload + assert payload == event + await say("What's up?") + + +async def skip_middleware(req, resp, next): + # return next() + pass + + +async def always_failing(): + raise Exception("Something wrong!") From 82dd4e257a2763839d045514e4f873c9a09687c4 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 24 Nov 2020 18:08:44 +0900 Subject: [PATCH 040/719] version 1.0.1 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 5becc17c0..5c4105cd3 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.0.0" +__version__ = "1.0.1" From 023a610733d34984f7127c928fe6d64ff10b3b54 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 28 Nov 2020 13:49:17 +0900 Subject: [PATCH 041/719] Update code snippets in docs to be easier-to-use --- docs/_advanced/lazy_listener.md | 4 ++-- docs/_basic/listening_modals.md | 12 ++++++------ examples/aws_lambda/lazy_aws_lambda.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/_advanced/lazy_listener.md b/docs/_advanced/lazy_listener.md index c201743a2..f685c6ba6 100644 --- a/docs/_advanced/lazy_listener.md +++ b/docs/_advanced/lazy_listener.md @@ -19,8 +19,8 @@ Lazy listeners can be a solution for this issue. Rather than acting as a decorat ```python def respond_to_slack_within_3_seconds(body, ack): - if "text" in body: - ack(":x: Usage: /start-process (description here)") + if body.get("text") is None: + ack(f":x: Usage: /start-process (description here)") else: ack(f"Accepted! (task: {body['text']})") diff --git a/docs/_basic/listening_modals.md b/docs/_basic/listening_modals.md index d8c3803ed..48aa70ba4 100644 --- a/docs/_basic/listening_modals.md +++ b/docs/_basic/listening_modals.md @@ -17,15 +17,15 @@ Read more about view submissions in our 0: ack(response_action="errors", errors=errors) return @@ -38,7 +38,7 @@ def handle_submission(ack, body, client, view): msg = "" try: # Save to DB - msg = f"Your submission of {val} was successful" + msg = f"Your submission of {hopes_and_dreams} was successful" except Exception as e: # Handle error msg = "There was an error with your submission" diff --git a/examples/aws_lambda/lazy_aws_lambda.py b/examples/aws_lambda/lazy_aws_lambda.py index c4bd25498..5e99942e9 100644 --- a/examples/aws_lambda/lazy_aws_lambda.py +++ b/examples/aws_lambda/lazy_aws_lambda.py @@ -25,7 +25,7 @@ def log_request(logger, body, next): def respond_to_slack_within_3_seconds(body, ack): - if body.get("text", None) is None: + if body.get("text") is None: ack(f":x: Usage: {command} (description here)") else: title = body["text"] From 9ab7dd52c81c390b6abc23320b795722092ab1d9 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sun, 29 Nov 2020 08:02:04 +0900 Subject: [PATCH 042/719] Add GH template for blank issues --- .github/issue_template.md | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/issue_template.md diff --git a/.github/issue_template.md b/.github/issue_template.md new file mode 100644 index 000000000..186797b8f --- /dev/null +++ b/.github/issue_template.md @@ -0,0 +1,41 @@ +(Describe your issue and goal here) + +### Reproducible in: + +```bash +pip freeze | grep slack +python --version +sw_vers && uname -v # or `ver` +``` + +#### The `slack_bolt` version + +(Paste the output of `pip freeze | grep slack`) + +#### Python runtime version + +(Paste the output of `python --version`) + +#### OS info + +(Paste the output of `sw_vers && uname -v` on macOS/Linux or `ver` on Windows OS) + +#### Steps to reproduce: + +(Share the commands to run, source code, and project settings (e.g., setup.py)) + +1. +2. +3. + +### Expected result: + +(Tell what you expected to happen) + +### Actual result: + +(Tell what actually happened with logs, screenshots) + +## Requirements + +Please read the [Contributing guidelines](https://github.com/slackapi/bolt-python/blob/main/.github/contributing.md) and [Code of Conduct](https://slackhq.github.io/code-of-conduct) before creating this issue or pull request. By submitting, you are agreeing to those rules. From 67e0286d756ba92510315d044303f43b03380b52 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sun, 29 Nov 2020 10:43:42 +0900 Subject: [PATCH 043/719] Tweak lazy listener function docs --- docs/_advanced/lazy_listener.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/_advanced/lazy_listener.md b/docs/_advanced/lazy_listener.md index f685c6ba6..84aa25952 100644 --- a/docs/_advanced/lazy_listener.md +++ b/docs/_advanced/lazy_listener.md @@ -19,7 +19,8 @@ Lazy listeners can be a solution for this issue. Rather than acting as a decorat ```python def respond_to_slack_within_3_seconds(body, ack): - if body.get("text") is None: + text = body.get("text") + if text is None or len(text) == 0: ack(f":x: Usage: /start-process (description here)") else: ack(f"Accepted! (task: {body['text']})") @@ -43,7 +44,7 @@ app.command("/start-process")(
-This example deploys the code to [AWS Lambda](https://aws.amazon.com/lambda/). There are more examples within the [`sample` folder](https://github.com/slackapi/bolt-python/tree/main/adapter). +This example deploys the code to [AWS Lambda](https://aws.amazon.com/lambda/). There are more examples within the [`examples` folder](https://github.com/slackapi/bolt-python/tree/main/examples/aws_lambda). ```bash pip install slack_bolt @@ -63,11 +64,14 @@ lambda deploy --config-file config.yaml --requirements requirements.txt ```python from slack_bolt import App +from slack_bolt.adapter.aws_lambda import SlackRequestHandler + # process_before_response must be True when running on FaaS app = App(process_before_response=True) def respond_to_slack_within_3_seconds(body, ack): - if "text" in body: + text = body.get("text") + if text is None or len(text) == 0: ack(":x: Usage: /start-process (description here)") else: ack(f"Accepted! (task: {body['text']})") @@ -82,7 +86,6 @@ app.command("/start-process")( lazy=[run_long_process] # unable to call `ack()` / can have multiple functions ) -from slack_bolt.adapter.aws_lambda import SlackRequestHandler def handler(event, context): slack_handler = SlackRequestHandler(app=app) return slack_handler.handle(event, context) From 79eecae80783eefee9517a2a5b2350c5a506b18d Mon Sep 17 00:00:00 2001 From: Kory Date: Sun, 29 Nov 2020 11:35:47 -0500 Subject: [PATCH 044/719] Update oauth_app.py Updating oauth_app.py to reflect the actual database table names that are created. --- examples/sqlalchemy/oauth_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/sqlalchemy/oauth_app.py b/examples/sqlalchemy/oauth_app.py index 3c01b78bf..40e1309ec 100644 --- a/examples/sqlalchemy/oauth_app.py +++ b/examples/sqlalchemy/oauth_app.py @@ -32,7 +32,7 @@ ) try: - engine.execute("select count(*) from bots") + engine.execute("select count(*) from slack_bots") except Exception as e: installation_store.metadata.create_all(engine) oauth_state_store.metadata.create_all(engine) From 00dc97ce36c8f4710e0da43d08b05e64ee6f3687 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 1 Dec 2020 07:06:29 +0900 Subject: [PATCH 045/719] Improve code snippet in docs --- docs/_basic/publishing_views.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_basic/publishing_views.md b/docs/_basic/publishing_views.md index fd0a7baf3..09f678e06 100644 --- a/docs/_basic/publishing_views.md +++ b/docs/_basic/publishing_views.md @@ -42,5 +42,5 @@ def update_home_tab(client, event, logger): ) except Exception as e: - logger.error(f"Error opening modal: {e}") + logger.error(f"Error publishing home tab: {e}") ``` From cb21b23079a97354e5d25ba0ccb99c8c4cc2090d Mon Sep 17 00:00:00 2001 From: Steve Gill Date: Tue, 1 Dec 2020 03:03:23 -0800 Subject: [PATCH 046/719] Add org-level installation support (#148) * added initial org app support * renamed org_dashboard_grant_access to enterprise_url * started implementing support for find_installation * Complete authorize implementation * Apply other required changes * Improve the user_token retrieval * Add default team_Id Co-authored-by: Kazuhiro Sera --- examples/oauth_sqlite3_app_org_level.py | 68 +++++ setup.py | 2 +- slack_bolt/app/app.py | 1 + slack_bolt/app/async_app.py | 1 + slack_bolt/authorization/async_authorize.py | 89 +++++- slack_bolt/authorization/authorize.py | 85 +++++- slack_bolt/context/base_context.py | 8 +- .../middleware/authorization/internals.py | 14 +- slack_bolt/oauth/internals.py | 5 +- slack_bolt/oauth/oauth_flow.py | 12 + slack_bolt/request/internals.py | 10 + tests/scenario_tests/test_events_org_apps.py | 259 +++++++++++++++++ .../test_events_org_apps.py | 271 ++++++++++++++++++ .../authorization/test_authorize.py | 92 +++++- tests/slack_bolt/request/test_internals.py | 12 + .../authorization/test_async_authorize.py | 94 +++++- 16 files changed, 975 insertions(+), 48 deletions(-) create mode 100644 examples/oauth_sqlite3_app_org_level.py create mode 100644 tests/scenario_tests/test_events_org_apps.py create mode 100644 tests/scenario_tests_async/test_events_org_apps.py diff --git a/examples/oauth_sqlite3_app_org_level.py b/examples/oauth_sqlite3_app_org_level.py new file mode 100644 index 000000000..34117e268 --- /dev/null +++ b/examples/oauth_sqlite3_app_org_level.py @@ -0,0 +1,68 @@ +# ------------------------------------------------ +# instead of slack_bolt in requirements.txt +import sys + +sys.path.insert(1, "..") +# ------------------------------------------------ + +import logging + +logging.basicConfig(level=logging.DEBUG) + +from slack_bolt import App, BoltContext +from slack_bolt.oauth import OAuthFlow +from slack_sdk import WebClient + + +app = App(oauth_flow=OAuthFlow.sqlite3(database="./slackapp.db")) + + +@app.use +def dump(context, next, logger): + logger.info(context) + next() + + +@app.use +def call_apis_with_team_id(context: BoltContext, client: WebClient, next): + # client.users_list() + client.bots_info(bot=context.bot_id) + next() + + +@app.event("app_mention") +def handle_app_mentions(body, say, logger): + logger.info(body) + say("What's up?") + + +@app.command("/org-level-command") +def command(ack): + ack("I got it!") + + +@app.shortcut("org-level-shortcut") +def shortcut(ack): + ack() + + +@app.event("team_access_granted") +def team_access_granted(event): + pass + + +@app.event("team_access_revoked") +def team_access_revoked(event): + pass + + +if __name__ == "__main__": + app.start(3000) + +# pip install slack_bolt +# export SLACK_SIGNING_SECRET=*** +# export SLACK_BOT_TOKEN=xoxb-*** +# export SLACK_CLIENT_ID=111.111 +# export SLACK_CLIENT_SECRET=*** +# export SLACK_SCOPES=app_mentions:read,channels:history,im:history,chat:write +# python oauth_app.py diff --git a/setup.py b/setup.py index 143ac6549..12813f30c 100755 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.0.0",], + install_requires=["slack_sdk==3.1.0b2",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 4f59e78fa..5b2dba6b2 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -774,6 +774,7 @@ def _init_context(self, req: BoltRequest): ssl=self._client.ssl, proxy=self._client.proxy, headers=self._client.headers, + team_id=req.context.team_id, ) req.context["client"] = client_per_request diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index b80106919..591d1ac95 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -800,6 +800,7 @@ def _init_context(self, req: AsyncBoltRequest): session=self._async_client.session, trust_env_in_session=self._async_client.trust_env_in_session, headers=self._async_client.headers, + team_id=req.context.team_id, ) req.context["client"] = client_per_request diff --git a/slack_bolt/authorization/async_authorize.py b/slack_bolt/authorization/async_authorize.py index 02a61ca07..8199ab299 100644 --- a/slack_bolt/authorization/async_authorize.py +++ b/slack_bolt/authorization/async_authorize.py @@ -3,7 +3,7 @@ from typing import Optional, Callable, Awaitable, Dict, Any from slack_sdk.errors import SlackApiError -from slack_sdk.oauth.installation_store import Bot +from slack_sdk.oauth.installation_store import Bot, Installation from slack_sdk.oauth.installation_store.async_installation_store import ( AsyncInstallationStore, ) @@ -92,6 +92,7 @@ async def __call__( class AsyncInstallationStoreAuthorize(AsyncAuthorize): authorize_result_cache: Dict[str, AuthorizeResult] = {} + find_installation_available: Optional[bool] def __init__( self, @@ -103,6 +104,7 @@ def __init__( self.logger = logger self.installation_store = installation_store self.cache_enabled = cache_enabled + self.find_installation_available = None async def __call__( self, @@ -112,27 +114,74 @@ async def __call__( team_id: str, user_id: Optional[str], ) -> Optional[AuthorizeResult]: - bot: Optional[Bot] = await self.installation_store.async_find_bot( - enterprise_id=enterprise_id, team_id=team_id, - ) - if bot is None: - self.logger.debug( - f"No installation data found " - f"for enterprise_id: {enterprise_id} team_id: {team_id}" + + if self.find_installation_available is None: + self.find_installation_available = hasattr( + self.installation_store, "async_find_installation" ) + + bot_token: Optional[str] = None + user_token: Optional[str] = None + + if self.find_installation_available: + # since v1.1, this is the default way + try: + installation: Optional[ + Installation + ] = await self.installation_store.async_find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + is_enterprise_install=context.is_enterprise_install, + ) + if installation is None: + self._debug_log_for_not_found(enterprise_id, team_id) + return None + + if installation.user_id != user_id: + # try to fetch the request user's installation + # to reflect the user's access token if exists + user_installation = await self.installation_store.async_find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + user_id=user_id, + is_enterprise_install=context.is_enterprise_install, + ) + if user_installation is not None: + installation = user_installation + + bot_token, user_token = installation.bot_token, installation.user_token + except NotImplementedError as _: + self.find_installation_available = False + + if not self.find_installation_available: + # Use find_bot to get bot value (legacy) + bot: Optional[Bot] = await self.installation_store.async_find_bot( + enterprise_id=enterprise_id, + team_id=team_id, + is_enterprise_install=context.is_enterprise_install, + ) + if bot is None: + self._debug_log_for_not_found(enterprise_id, team_id) + return None + bot_token, user_token = bot.bot_token, None + + token: Optional[str] = bot_token or user_token + if token is None: return None - if self.cache_enabled and bot.bot_token in self.authorize_result_cache: - return self.authorize_result_cache[bot.bot_token] + # Check cache to see if the bot object already exists + if self.cache_enabled and token in self.authorize_result_cache: + return self.authorize_result_cache[token] + try: - auth_result = await context.client.auth_test(token=bot.bot_token) + auth_test_api_response = await context.client.auth_test(token=token) authorize_result = AuthorizeResult.from_auth_test_response( - auth_test_response=auth_result, - bot_token=bot.bot_token, - user_token=None, # Not yet supported + auth_test_response=auth_test_api_response, + bot_token=bot_token, + user_token=user_token, ) if self.cache_enabled: - self.authorize_result_cache[bot.bot_token] = authorize_result + self.authorize_result_cache[token] = authorize_result return authorize_result except SlackApiError as err: self.logger.debug( @@ -140,3 +189,13 @@ async def __call__( f"is no longer valid. (response: {err.response})" ) return None + + # ------------------------------------------------ + + def _debug_log_for_not_found( + self, enterprise_id: Optional[str], team_id: Optional[str] + ): + self.logger.debug( + "No installation data found " + f"for enterprise_id: {enterprise_id} team_id: {team_id}" + ) diff --git a/slack_bolt/authorization/authorize.py b/slack_bolt/authorization/authorize.py index 0fea0eaab..2393d99f2 100644 --- a/slack_bolt/authorization/authorize.py +++ b/slack_bolt/authorization/authorize.py @@ -5,6 +5,7 @@ from slack_sdk.errors import SlackApiError from slack_sdk.oauth import InstallationStore from slack_sdk.oauth.installation_store import Bot +from slack_sdk.oauth.installation_store.models.installation import Installation from slack_bolt.authorization.authorize_args import AuthorizeArgs from slack_bolt.authorization.authorize_result import AuthorizeResult @@ -90,6 +91,7 @@ def __call__( class InstallationStoreAuthorize(Authorize): authorize_result_cache: Dict[str, AuthorizeResult] = {} + find_installation_available: bool def __init__( self, @@ -101,6 +103,9 @@ def __init__( self.logger = logger self.installation_store = installation_store self.cache_enabled = cache_enabled + self.find_installation_available = hasattr( + installation_store, "find_installation" + ) def __call__( self, @@ -110,27 +115,69 @@ def __call__( team_id: str, user_id: Optional[str], ) -> Optional[AuthorizeResult]: - bot: Optional[Bot] = self.installation_store.find_bot( - enterprise_id=enterprise_id, team_id=team_id, - ) - if bot is None: - self.logger.debug( - f"No installation data found " - f"for enterprise_id: {enterprise_id} team_id: {team_id}" + + bot_token: Optional[str] = None + user_token: Optional[str] = None + + if self.find_installation_available: + # since v1.1, this is the default way + try: + installation: Optional[ + Installation + ] = self.installation_store.find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + is_enterprise_install=context.is_enterprise_install, + ) + if installation is None: + self._debug_log_for_not_found(enterprise_id, team_id) + return None + + if installation.user_id != user_id: + # try to fetch the request user's installation + # to reflect the user's access token if exists + user_installation = self.installation_store.find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + user_id=user_id, + is_enterprise_install=context.is_enterprise_install, + ) + if user_installation is not None: + installation = user_installation + + bot_token, user_token = installation.bot_token, installation.user_token + except NotImplementedError as _: + self.find_installation_available = False + + if not self.find_installation_available: + # Use find_bot to get bot value (legacy) + bot: Optional[Bot] = self.installation_store.find_bot( + enterprise_id=enterprise_id, + team_id=team_id, + is_enterprise_install=context.is_enterprise_install, ) + if bot is None: + self._debug_log_for_not_found(enterprise_id, team_id) + return None + bot_token, user_token = bot.bot_token, None + + token: Optional[str] = bot_token or user_token + if token is None: return None - if self.cache_enabled and bot.bot_token in self.authorize_result_cache: - return self.authorize_result_cache[bot.bot_token] + # Check cache to see if the bot object already exists + if self.cache_enabled and token in self.authorize_result_cache: + return self.authorize_result_cache[token] + try: - auth_result = context.client.auth_test(token=bot.bot_token) + auth_test_api_response = context.client.auth_test(token=token) authorize_result = AuthorizeResult.from_auth_test_response( - auth_test_response=auth_result, - bot_token=bot.bot_token, - user_token=None, # Not yet supported + auth_test_response=auth_test_api_response, + bot_token=bot_token, + user_token=user_token, ) if self.cache_enabled: - self.authorize_result_cache[bot.bot_token] = authorize_result + self.authorize_result_cache[token] = authorize_result return authorize_result except SlackApiError as err: self.logger.debug( @@ -138,3 +185,13 @@ def __call__( f"is no longer valid. (response: {err.response})" ) return None + + # ------------------------------------------------ + + def _debug_log_for_not_found( + self, enterprise_id: Optional[str], team_id: Optional[str] + ): + self.logger.debug( + "No installation data found " + f"for enterprise_id: {enterprise_id} team_id: {team_id}" + ) diff --git a/slack_bolt/context/base_context.py b/slack_bolt/context/base_context.py index 39468b922..44e20a460 100644 --- a/slack_bolt/context/base_context.py +++ b/slack_bolt/context/base_context.py @@ -18,8 +18,12 @@ def enterprise_id(self) -> Optional[str]: return self.get("enterprise_id") @property - def team_id(self) -> str: - return self["team_id"] + def is_enterprise_install(self) -> Optional[bool]: + return self.get("is_enterprise_install") + + @property + def team_id(self) -> Optional[str]: + return self.get("team_id") @property def user_id(self) -> Optional[str]: diff --git a/slack_bolt/middleware/authorization/internals.py b/slack_bolt/middleware/authorization/internals.py index 90f65af61..cede00c42 100644 --- a/slack_bolt/middleware/authorization/internals.py +++ b/slack_bolt/middleware/authorization/internals.py @@ -29,21 +29,15 @@ def _is_ssl_check(req: Union[BoltRequest, "AsyncBoltRequest"]) -> bool: # type: ) -def _is_uninstallation_event(req: Union[BoltRequest, "AsyncBoltRequest"]) -> bool: # type: ignore - return ( - req is not None - and req.body is not None - and req.body.get("type") == "event_callback" - and req.body.get("event", {}).get("type") == "app_uninstalled" - ) +no_auth_test_events = ["app_uninstalled", "tokens_revoked", "team_access_revoked"] -def _is_tokens_revoked_event(req: Union[BoltRequest, "AsyncBoltRequest"]) -> bool: # type: ignore +def _is_no_auth_test_events(req: Union[BoltRequest, "AsyncBoltRequest"]) -> bool: # type: ignore return ( req is not None and req.body is not None and req.body.get("type") == "event_callback" - and req.body.get("event", {}).get("type") == "tokens_revoked" + and req.body.get("event", {}).get("type") in no_auth_test_events ) @@ -52,7 +46,7 @@ def _is_no_auth_required(req: Union[BoltRequest, "AsyncBoltRequest"]) -> bool: def _is_no_auth_test_call_required(req: Union[BoltRequest, "AsyncBoltRequest"]) -> bool: # type: ignore - return _is_uninstallation_event(req) or _is_tokens_revoked_event(req) + return _is_no_auth_test_events(req) def _build_error_response() -> BoltResponse: diff --git a/slack_bolt/oauth/internals.py b/slack_bolt/oauth/internals.py index bc237eb7a..e551f682f 100644 --- a/slack_bolt/oauth/internals.py +++ b/slack_bolt/oauth/internals.py @@ -33,7 +33,10 @@ def _build_callback_success_response( # type: ignore self._logger.debug(debug_message) html = self._redirect_uri_page_renderer.render_success_page( - app_id=installation.app_id, team_id=installation.team_id, + app_id=installation.app_id, + team_id=installation.team_id, + is_enterprise_install=installation.is_enterprise_install, + enterprise_url=installation.enterprise_url, ) return BoltResponse( status=200, diff --git a/slack_bolt/oauth/oauth_flow.py b/slack_bolt/oauth/oauth_flow.py index 8f4dbecb8..705975087 100644 --- a/slack_bolt/oauth/oauth_flow.py +++ b/slack_bolt/oauth/oauth_flow.py @@ -288,6 +288,9 @@ def run_installation(self, code: str) -> Optional[Installation]: installed_enterprise: Dict[str, str] = oauth_response.get( "enterprise" ) or {} + is_enterprise_install: bool = oauth_response.get( + "is_enterprise_install" + ) or False installed_team: Dict[str, str] = oauth_response.get("team") or {} installer: Dict[str, str] = oauth_response.get("authed_user") or {} incoming_webhook: Dict[str, str] = oauth_response.get( @@ -297,14 +300,20 @@ def run_installation(self, code: str) -> Optional[Installation]: bot_token: Optional[str] = oauth_response.get("access_token") # NOTE: oauth.v2.access doesn't include bot_id in response bot_id: Optional[str] = None + enterprise_url: Optional[str] = None if bot_token is not None: auth_test = self.client.auth_test(token=bot_token) bot_id = auth_test["bot_id"] + if is_enterprise_install is True: + enterprise_url = auth_test.get("url") return Installation( app_id=oauth_response.get("app_id"), enterprise_id=installed_enterprise.get("id"), + enterprise_name=installed_enterprise.get("name"), + enterprise_url=enterprise_url, team_id=installed_team.get("id"), + team_name=installed_team.get("name"), bot_token=bot_token, bot_id=bot_id, bot_user_id=oauth_response.get("bot_user_id"), @@ -313,10 +322,13 @@ def run_installation(self, code: str) -> Optional[Installation]: user_token=installer.get("access_token"), user_scopes=installer.get("scope"), # comma-separated string incoming_webhook_url=incoming_webhook.get("url"), + incoming_webhook_channel=incoming_webhook.get("channel"), incoming_webhook_channel_id=incoming_webhook.get("channel_id"), incoming_webhook_configuration_url=incoming_webhook.get( "configuration_url", None ), + is_enterprise_install=is_enterprise_install, + token_type=oauth_response.get("token_type"), ) except SlackApiError as e: diff --git a/slack_bolt/request/internals.py b/slack_bolt/request/internals.py index 634f218e3..b9a42b914 100644 --- a/slack_bolt/request/internals.py +++ b/slack_bolt/request/internals.py @@ -46,6 +46,15 @@ def parse_body(body: str, content_type: Optional[str]) -> Dict[str, Any]: return dict(parse_qsl(body)) +def extract_is_enterprise_install(payload: Dict[str, Any]) -> Optional[bool]: + if "is_enterprise_install" in payload: + is_enterprise_install = payload.get("is_enterprise_install") + return is_enterprise_install is not None and ( + is_enterprise_install is True or is_enterprise_install == "true" + ) + return False + + def extract_enterprise_id(payload: Dict[str, Any]) -> Optional[str]: if "enterprise" in payload: org = payload.get("enterprise") @@ -119,6 +128,7 @@ def extract_channel_id(payload: Dict[str, Any]) -> Optional[str]: def build_context(context: BoltContext, body: Dict[str, Any]) -> BoltContext: + context["is_enterprise_install"] = extract_is_enterprise_install(body) enterprise_id = extract_enterprise_id(body) if enterprise_id: context["enterprise_id"] = enterprise_id diff --git a/tests/scenario_tests/test_events_org_apps.py b/tests/scenario_tests/test_events_org_apps.py new file mode 100644 index 000000000..01dbe4be0 --- /dev/null +++ b/tests/scenario_tests/test_events_org_apps.py @@ -0,0 +1,259 @@ +import json +from time import time, sleep +from typing import Optional + +from slack_sdk.oauth import InstallationStore +from slack_sdk.oauth.installation_store import Installation +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web import WebClient + +from slack_bolt import App, BoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + +valid_token = "xoxb-valid" + + +class OrgAppInstallationStore(InstallationStore): + def find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False + ) -> Optional[Installation]: + assert enterprise_id == "E111" + assert team_id is None + return Installation( + enterprise_id="E111", + team_id=None, + user_id=user_id, + bot_token=valid_token, + bot_id="B111", + ) + + +class Result: + def __init__(self): + self.called = False + + +class TestEventsOrgApps: + signing_secret = "secret" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client: WebClient = WebClient( + token=None, base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def test_team_access_granted(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + installation_store=OrgAppInstallationStore(), + ) + + event_payload = { + "token": "verification-token", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "team_access_granted", + "team_ids": ["T111", "T222"], + "event_ts": "111.222", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1606805974, + } + + result = Result() + + @app.event("team_access_granted") + def handle_app_mention(body): + assert body == event_payload + result.called = True + + timestamp, body = str(int(time())), json.dumps(event_payload) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + # auth.test API call must be skipped + assert self.mock_received_requests["/auth.test"] == 1 + sleep(1) # wait a bit after auto ack() + assert result.called is True + + def test_team_access_revoked(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + installation_store=OrgAppInstallationStore(), + ) + + event_payload = { + "token": "verification-token", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "team_access_revoked", + "team_ids": ["T111", "T222"], + "event_ts": "1606805732.987656", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1606805732, + } + + result = Result() + + @app.event("team_access_revoked") + def handle_app_mention(body): + assert body == event_payload + result.called = True + + timestamp, body = str(int(time())), json.dumps(event_payload) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + # auth.test API call must be skipped + assert self.mock_received_requests.get("/auth.test") is None + sleep(1) # wait a bit after auto ack() + assert result.called is True + + def test_app_home_opened(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + installation_store=OrgAppInstallationStore(), + ) + + event_payload = { + "token": "verification-token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "app_home_opened", + "user": "W111", + "channel": "D111", + "tab": "messages", + "event_ts": "1606810927.510671", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1606810927, + "authorizations": [ + { + "enterprise_id": "E111", + "team_id": None, + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": True, + } + ], + "is_ext_shared_channel": False, + } + + result = Result() + + @app.event("app_home_opened") + def handle_app_mention(body): + assert body == event_payload + result.called = True + + timestamp, body = str(int(time())), json.dumps(event_payload) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + # auth.test API call must be skipped + assert self.mock_received_requests["/auth.test"] == 1 + sleep(1) # wait a bit after auto ack() + assert result.called is True + + def test_message(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + installation_store=OrgAppInstallationStore(), + ) + + event_payload = { + "token": "verification-token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "0186b75a-2ad4-4f36-8ccc-18608b0ac5d1", + "type": "message", + "text": "<@W222>", + "user": "W111", + "ts": "1606810819.000800", + "team": "T111", + "channel": "C111", + "event_ts": "1606810819.000800", + "channel_type": "channel", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1606810819, + "authed_users": [], + "authorizations": [ + { + "enterprise_id": "E111", + "team_id": None, + "user_id": "W222", + "is_bot": True, + "is_enterprise_install": True, + } + ], + "is_ext_shared_channel": False, + "event_context": "1-message-T111-C111", + } + + result = Result() + + @app.event("message") + def handle_app_mention(body): + assert body == event_payload + result.called = True + + timestamp, body = str(int(time())), json.dumps(event_payload) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + # auth.test API call must be skipped + assert self.mock_received_requests["/auth.test"] == 1 + sleep(1) # wait a bit after auto ack() + assert result.called is True diff --git a/tests/scenario_tests_async/test_events_org_apps.py b/tests/scenario_tests_async/test_events_org_apps.py new file mode 100644 index 000000000..04182d937 --- /dev/null +++ b/tests/scenario_tests_async/test_events_org_apps.py @@ -0,0 +1,271 @@ +import asyncio +import json +from time import time +from typing import Optional + +import pytest +from slack_sdk.oauth.installation_store import Installation +from slack_sdk.oauth.installation_store.async_installation_store import ( + AsyncInstallationStore, +) +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + +valid_token = "xoxb-valid" + + +class OrgAppInstallationStore(AsyncInstallationStore): + async def async_find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False + ) -> Optional[Installation]: + assert enterprise_id == "E111" + assert team_id is None + return Installation( + enterprise_id="E111", + team_id=None, + user_id=user_id, + bot_token=valid_token, + bot_id="B111", + ) + + +class Result: + def __init__(self): + self.called = False + + +class TestAsyncOrgApps: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = AsyncWebClient(token=None, base_url=mock_api_server_base_url) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + @pytest.mark.asyncio + async def test_team_access_granted(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + installation_store=OrgAppInstallationStore(), + ) + + event_payload = { + "token": "verification-token", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "team_access_granted", + "team_ids": ["T111", "T222"], + "event_ts": "111.222", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1606805974, + } + + result = Result() + + @app.event("team_access_granted") + async def handle_app_mention(body): + assert body == event_payload + result.called = True + + timestamp, body = str(int(time())), json.dumps(event_payload) + request: AsyncBoltRequest = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + # auth.test API call must be skipped + assert self.mock_received_requests["/auth.test"] == 1 + await asyncio.sleep(1) # wait a bit after auto ack() + assert result.called is True + + @pytest.mark.asyncio + async def test_team_access_revoked(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + installation_store=OrgAppInstallationStore(), + ) + + event_payload = { + "token": "verification-token", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "team_access_revoked", + "team_ids": ["T111", "T222"], + "event_ts": "1606805732.987656", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1606805732, + } + + result = Result() + + @app.event("team_access_revoked") + async def handle_app_mention(body): + assert body == event_payload + result.called = True + + timestamp, body = str(int(time())), json.dumps(event_payload) + request: AsyncBoltRequest = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + # auth.test API call must be skipped + assert self.mock_received_requests.get("/auth.test") is None + await asyncio.sleep(1) # wait a bit after auto ack() + assert result.called is True + + @pytest.mark.asyncio + async def test_app_home_opened(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + installation_store=OrgAppInstallationStore(), + ) + + event_payload = { + "token": "verification-token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "app_home_opened", + "user": "W111", + "channel": "D111", + "tab": "messages", + "event_ts": "1606810927.510671", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1606810927, + "authorizations": [ + { + "enterprise_id": "E111", + "team_id": None, + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": True, + } + ], + "is_ext_shared_channel": False, + } + + result = Result() + + @app.event("app_home_opened") + async def handle_app_mention(body): + assert body == event_payload + result.called = True + + timestamp, body = str(int(time())), json.dumps(event_payload) + request: AsyncBoltRequest = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + # auth.test API call must be skipped + assert self.mock_received_requests["/auth.test"] == 1 + await asyncio.sleep(1) # wait a bit after auto ack() + assert result.called is True + + @pytest.mark.asyncio + async def test_message(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + installation_store=OrgAppInstallationStore(), + ) + + event_payload = { + "token": "verification-token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "0186b75a-2ad4-4f36-8ccc-18608b0ac5d1", + "type": "message", + "text": "<@W222>", + "user": "W111", + "ts": "1606810819.000800", + "team": "T111", + "channel": "C111", + "event_ts": "1606810819.000800", + "channel_type": "channel", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1606810819, + "authed_users": [], + "authorizations": [ + { + "enterprise_id": "E111", + "team_id": None, + "user_id": "W222", + "is_bot": True, + "is_enterprise_install": True, + } + ], + "is_ext_shared_channel": False, + "event_context": "1-message-T111-C111", + } + + result = Result() + + @app.event("message") + async def handle_app_mention(body): + assert body == event_payload + result.called = True + + timestamp, body = str(int(time())), json.dumps(event_payload) + request: AsyncBoltRequest = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + # auth.test API call must be skipped + assert self.mock_received_requests["/auth.test"] == 1 + await asyncio.sleep(1) # wait a bit after auto ack() + assert result.called is True diff --git a/tests/slack_bolt/authorization/test_authorize.py b/tests/slack_bolt/authorization/test_authorize.py index 600c3c626..fff72f575 100644 --- a/tests/slack_bolt/authorization/test_authorize.py +++ b/tests/slack_bolt/authorization/test_authorize.py @@ -24,11 +24,64 @@ def setup_method(self): def teardown_method(self): cleanup_mock_web_api_server(self) + def test_installation_store_legacy(self): + installation_store = LegacyMemoryInstallationStore() + authorize = InstallationStoreAuthorize( + logger=installation_store.logger, installation_store=installation_store + ) + assert authorize.find_installation_available is True + context = BoltContext() + context["client"] = WebClient(base_url=self.mock_api_server_base_url) + result = authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert authorize.find_installation_available is False + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.user_token is None + assert self.mock_received_requests["/auth.test"] == 1 + + result = authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.user_token is None + assert self.mock_received_requests["/auth.test"] == 2 + + def test_installation_store_cached_legacy(self): + installation_store = LegacyMemoryInstallationStore() + authorize = InstallationStoreAuthorize( + logger=installation_store.logger, + installation_store=installation_store, + cache_enabled=True, + ) + assert authorize.find_installation_available is True + context = BoltContext() + context["client"] = WebClient(base_url=self.mock_api_server_base_url) + result = authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert authorize.find_installation_available is False + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.user_token is None + assert self.mock_received_requests["/auth.test"] == 1 + + result = authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.user_token is None + assert self.mock_received_requests["/auth.test"] == 1 # cached + def test_installation_store(self): installation_store = MemoryInstallationStore() authorize = InstallationStoreAuthorize( logger=installation_store.logger, installation_store=installation_store ) + assert authorize.find_installation_available is True context = BoltContext() context["client"] = WebClient(base_url=self.mock_api_server_base_url) result = authorize( @@ -36,6 +89,7 @@ def test_installation_store(self): ) assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" + assert result.user_token == "xoxp-valid" assert self.mock_received_requests["/auth.test"] == 1 result = authorize( @@ -43,6 +97,7 @@ def test_installation_store(self): ) assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" + assert result.user_token == "xoxp-valid" assert self.mock_received_requests["/auth.test"] == 2 def test_installation_store_cached(self): @@ -52,6 +107,7 @@ def test_installation_store_cached(self): installation_store=installation_store, cache_enabled=True, ) + assert authorize.find_installation_available is True context = BoltContext() context["client"] = WebClient(base_url=self.mock_api_server_base_url) result = authorize( @@ -59,6 +115,7 @@ def test_installation_store_cached(self): ) assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" + assert result.user_token == "xoxp-valid" assert self.mock_received_requests["/auth.test"] == 1 result = authorize( @@ -66,10 +123,11 @@ def test_installation_store_cached(self): ) assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" + assert result.user_token == "xoxp-valid" assert self.mock_received_requests["/auth.test"] == 1 # cached -class MemoryInstallationStore(InstallationStore): +class LegacyMemoryInstallationStore(InstallationStore): @property def logger(self) -> Logger: return logging.getLogger(__name__) @@ -78,15 +136,43 @@ def save(self, installation: Installation): pass def find_bot( - self, *, enterprise_id: Optional[str], team_id: Optional[str] + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + is_enterprise_install: Optional[bool] = False, ) -> Optional[Bot]: return Bot( app_id="A111", enterprise_id="E111", team_id="T0G9PQBBK", - bot_token="xoxb-valid", + bot_token="xoxb-valid-1", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + installed_at=datetime.datetime.now().timestamp(), + ) + + +class MemoryInstallationStore(LegacyMemoryInstallationStore): + def find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + return Installation( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid-2", bot_id="B", bot_user_id="W", bot_scopes=["commands", "chat:write"], + user_id="W11111", + user_token="xoxp-valid", + user_scopes=["search:read"], installed_at=datetime.datetime.now().timestamp(), ) diff --git a/tests/slack_bolt/request/test_internals.py b/tests/slack_bolt/request/test_internals.py index fce00681c..496f690a6 100644 --- a/tests/slack_bolt/request/test_internals.py +++ b/tests/slack_bolt/request/test_internals.py @@ -6,6 +6,7 @@ extract_team_id, extract_enterprise_id, parse_query, + extract_is_enterprise_install, ) @@ -69,6 +70,17 @@ def test_enterprise_id_extraction(self): team_id = extract_enterprise_id(req) assert team_id == "E111" + def test_is_enterprise_install_extraction(self): + for req in self.requests: + should_be_false = extract_is_enterprise_install(req) + assert should_be_false is False + assert extract_is_enterprise_install({"is_enterprise_install": True}) is True + assert extract_is_enterprise_install({"is_enterprise_install": False}) is False + assert extract_is_enterprise_install({"is_enterprise_install": "true"}) is True + assert ( + extract_is_enterprise_install({"is_enterprise_install": "false"}) is False + ) + def test_parse_query(self): expected = {"foo": ["bar"], "baz": ["123"]} diff --git a/tests/slack_bolt_async/authorization/test_async_authorize.py b/tests/slack_bolt_async/authorization/test_async_authorize.py index 30b2d2d92..5df1cd0c2 100644 --- a/tests/slack_bolt_async/authorization/test_async_authorize.py +++ b/tests/slack_bolt_async/authorization/test_async_authorize.py @@ -36,19 +36,76 @@ def event_loop(self): finally: restore_os_env(old_os_env) + @pytest.mark.asyncio + async def test_installation_store_legacy(self): + installation_store = LegacyMemoryInstallationStore() + authorize = AsyncInstallationStoreAuthorize( + logger=installation_store.logger, installation_store=installation_store + ) + assert authorize.find_installation_available is None + context = AsyncBoltContext() + context["client"] = self.client + result = await authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert authorize.find_installation_available is False + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.user_token is None + assert self.mock_received_requests["/auth.test"] == 1 + + result = await authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.user_token is None + assert self.mock_received_requests["/auth.test"] == 2 + + @pytest.mark.asyncio + async def test_installation_store_cached_legacy(self): + installation_store = LegacyMemoryInstallationStore() + authorize = AsyncInstallationStoreAuthorize( + logger=installation_store.logger, + installation_store=installation_store, + cache_enabled=True, + ) + assert authorize.find_installation_available is None + context = AsyncBoltContext() + context["client"] = self.client + result = await authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert authorize.find_installation_available is False + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.user_token is None + assert self.mock_received_requests["/auth.test"] == 1 + + result = await authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.user_token is None + assert self.mock_received_requests["/auth.test"] == 1 # cached + @pytest.mark.asyncio async def test_installation_store(self): installation_store = MemoryInstallationStore() authorize = AsyncInstallationStoreAuthorize( logger=installation_store.logger, installation_store=installation_store ) + assert authorize.find_installation_available is None context = AsyncBoltContext() context["client"] = self.client result = await authorize( context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" ) + assert authorize.find_installation_available is True assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" + assert result.user_token == "xoxp-valid" assert self.mock_received_requests["/auth.test"] == 1 result = await authorize( @@ -56,6 +113,7 @@ async def test_installation_store(self): ) assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" + assert result.user_token == "xoxp-valid" assert self.mock_received_requests["/auth.test"] == 2 @pytest.mark.asyncio @@ -66,13 +124,16 @@ async def test_installation_store_cached(self): installation_store=installation_store, cache_enabled=True, ) + assert authorize.find_installation_available is None context = AsyncBoltContext() context["client"] = self.client result = await authorize( context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" ) + assert authorize.find_installation_available is True assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" + assert result.user_token == "xoxp-valid" assert self.mock_received_requests["/auth.test"] == 1 result = await authorize( @@ -80,10 +141,11 @@ async def test_installation_store_cached(self): ) assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" + assert result.user_token == "xoxp-valid" assert self.mock_received_requests["/auth.test"] == 1 # cached -class MemoryInstallationStore(AsyncInstallationStore): +class LegacyMemoryInstallationStore(AsyncInstallationStore): @property def logger(self) -> Logger: return logging.getLogger(__name__) @@ -92,7 +154,11 @@ async def async_save(self, installation: Installation): pass async def async_find_bot( - self, *, enterprise_id: Optional[str], team_id: Optional[str] + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + is_enterprise_install: Optional[bool] = False, ) -> Optional[Bot]: return Bot( app_id="A111", @@ -104,3 +170,27 @@ async def async_find_bot( bot_scopes=["commands", "chat:write"], installed_at=datetime.datetime.now().timestamp(), ) + + +class MemoryInstallationStore(LegacyMemoryInstallationStore): + async def async_find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + return Installation( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid-2", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + user_id="W11111", + user_token="xoxp-valid", + user_scopes=["search:read"], + installed_at=datetime.datetime.now().timestamp(), + ) From c35cbdfaa175e7fb7ae1fa77d2c7cdad0b95db2f Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 1 Dec 2020 20:31:41 +0900 Subject: [PATCH 047/719] version 1.1.0rc1 --- setup.py | 4 ++-- slack_bolt/version.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 12813f30c..2c31545dd 100755 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ "pytest-cov>=2,<3", "pytest-asyncio<1", # for async "aiohttp>=3,<4", # for async - "black==19.10b0", + "black==19.10b0", # TODO: upgrading the version ] setuptools.setup( @@ -33,7 +33,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk==3.1.0b2",], + install_requires=["slack_sdk>=3.1.0rc1,<3.2",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 5c4105cd3..3b4ec64b0 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.0.1" +__version__ = "1.1.0rc1" From 72306d20cf19025e81746b3d55a86be0a3622be1 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 2 Dec 2020 12:00:17 +0900 Subject: [PATCH 048/719] version 1.1.0 --- setup.py | 2 +- slack_bolt/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 2c31545dd..b049c0102 100755 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.1.0rc1,<3.2",], + install_requires=["slack_sdk>=3.1.0,<3.2",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 3b4ec64b0..6849410aa 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.1.0rc1" +__version__ = "1.1.0" From 9ce2c350a82314037ca8557d0dea00e0c45b1ab0 Mon Sep 17 00:00:00 2001 From: Steve Gill Date: Thu, 26 Nov 2020 16:55:15 -0800 Subject: [PATCH 049/719] adding docs for org apps --- docs/_basic/authenticating_oauth.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/_basic/authenticating_oauth.md b/docs/_basic/authenticating_oauth.md index 0de17ffe9..e31acfe52 100644 --- a/docs/_basic/authenticating_oauth.md +++ b/docs/_basic/authenticating_oauth.md @@ -13,6 +13,8 @@ Bolt for Python will create a **Redirect URL** `slack/oauth_redirect`, which Sla Bolt for Python will also create a `slack/install` route, where you can find an **Add to Slack** button for your app to perform direct installs of your app. If you need any additional authorizations (user tokens) from users inside a team when your app is already installed or a reason to dynamically generate an install URL, you can pass your own custom URL generator to `oauth_settings` as `authorize_url_generator`. +Bolt for Python automatically includes support for [org wide installations](https://api.slack.com/enterprise/apps). Org wide installations can be enabled in your app configuration settings under **Org Level Apps**. + To learn more about the OAuth installation flow with Slack, [read the API documentation](https://api.slack.com/authentication/oauth-v2).
From cba6a708c1dd254f584b5ce6952212360184732d Mon Sep 17 00:00:00 2001 From: Steve Gill Date: Tue, 1 Dec 2020 15:09:21 -0800 Subject: [PATCH 050/719] Added minimum bolt-python version for org-apps --- docs/_basic/authenticating_oauth.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_basic/authenticating_oauth.md b/docs/_basic/authenticating_oauth.md index e31acfe52..48b903c14 100644 --- a/docs/_basic/authenticating_oauth.md +++ b/docs/_basic/authenticating_oauth.md @@ -13,7 +13,7 @@ Bolt for Python will create a **Redirect URL** `slack/oauth_redirect`, which Sla Bolt for Python will also create a `slack/install` route, where you can find an **Add to Slack** button for your app to perform direct installs of your app. If you need any additional authorizations (user tokens) from users inside a team when your app is already installed or a reason to dynamically generate an install URL, you can pass your own custom URL generator to `oauth_settings` as `authorize_url_generator`. -Bolt for Python automatically includes support for [org wide installations](https://api.slack.com/enterprise/apps). Org wide installations can be enabled in your app configuration settings under **Org Level Apps**. +Bolt for Python automatically includes support for [org wide installations](https://api.slack.com/enterprise/apps) in version `1.1.0+`. Org wide installations can be enabled in your app configuration settings under **Org Level Apps**. To learn more about the OAuth installation flow with Slack, [read the API documentation](https://api.slack.com/authentication/oauth-v2). From b10b4a80ed7a38dec4fbeeadb4d384bbcce6b249 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 2 Dec 2020 20:27:30 +0900 Subject: [PATCH 051/719] Add CI build action --- .github/workflows/ci-build.yml | 49 ++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/ci-build.yml diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml new file mode 100644 index 000000000..21ff8a609 --- /dev/null +++ b/.github/workflows/ci-build.yml @@ -0,0 +1,49 @@ +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions +name: CI Build + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.6', '3.7', '3.8', '3.9'] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python setup.py install + pip install -U pip + pip install "pytest>=5,<6" "pytest-cov>=2,<3" + - name: Run tests without aiohttp + run: | + pytest tests/slack_bolt/ + pytest tests/scenario_tests/ + - name: Run tests for adapters + run: | + pip install -e ".[adapter]" + pytest tests/adapter_tests/ + - name: Run async tests + run: | + pip install -e ".[async]" + pip install "pytest-asyncio<1" + pytest tests/slack_bolt_async/ + pytest tests/scenario_tests_async/ + pytest tests/adapter_tests_async/ + - name: Run pytype verification & codecov + run: | + python_version=`python -V` + if [ ${python_version:7:3} == "3.8" ]; then + pip install "pytype" && pytype slack_bolt/ + pytest --cov=slack_bolt/ && bash <(curl -s https://codecov.io/bash) + fi From 4bd526145a12ec1ad7b5a0507d4c62c4e261ecb9 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 2 Dec 2020 21:51:40 +0900 Subject: [PATCH 052/719] Update CI builds --- .github/workflows/ci-build.yml | 15 ++++++++++----- README.md | 6 +++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 21ff8a609..74f9ed8bc 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -35,11 +35,16 @@ jobs: pytest tests/adapter_tests/ - name: Run async tests run: | - pip install -e ".[async]" - pip install "pytest-asyncio<1" - pytest tests/slack_bolt_async/ - pytest tests/scenario_tests_async/ - pytest tests/adapter_tests_async/ + # As the tests here are often slow on GitHub Actions, + # we pick up only one Python version for it. + python_version=`python -V` + if [ ${python_version:7:3} == "3.9" ]; then + pip install -e ".[async]" + pip install "pytest-asyncio<1" + pytest tests/slack_bolt_async/ + pytest tests/scenario_tests_async/ + pytest tests/adapter_tests_async/ + fi - name: Run pytype verification & codecov run: | python_version=`python -V` diff --git a/README.md b/README.md index 7dde2c3c7..d046cb59d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Python Version][python-version]][pypi-url] [![pypi package][pypi-image]][pypi-url] -[![Build Status][travis-image]][travis-url] +[![Build Status][build-image]][build-url] [![Codecov][codecov-image]][codecov-url] A Python framework to build Slack apps in a flash with the latest platform features. Read the [getting started guide](https://slack.dev/bolt-python/tutorial/getting-started) and look at our [code examples](https://github.com/slackapi/bolt-python/tree/main/examples) to learn how to build apps using Bolt. @@ -156,8 +156,8 @@ If you otherwise get stuck, we're here to help. The following are the best ways [pypi-image]: https://badge.fury.io/py/slack-bolt.svg [pypi-url]: https://pypi.org/project/slack-bolt/ -[travis-image]: https://travis-ci.org/slackapi/bolt-python.svg?branch=main -[travis-url]: https://travis-ci.org/slackapi/bolt-python +[build-image]: https://github.com/slackapi/bolt-python/workflows/CI%20Build/badge.svg +[build-url]: https://github.com/slackapi/bolt-python/actions?query=workflow%3A%22CI+Build%22 [codecov-image]: https://codecov.io/gh/slackapi/bolt-python/branch/main/graph/badge.svg [codecov-url]: https://codecov.io/gh/slackapi/bolt-python [python-version]: https://img.shields.io/pypi/pyversions/slack-bolt.svg From 8586d9e862fed63d11349f1a014acf471a9aa5e8 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 2 Dec 2020 21:58:51 +0900 Subject: [PATCH 053/719] Fix build settings --- .github/workflows/ci-build.yml | 2 ++ .travis.yml | 31 ------------------------------- 2 files changed, 2 insertions(+), 31 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 74f9ed8bc..79f3e98f1 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -49,6 +49,8 @@ jobs: run: | python_version=`python -V` if [ ${python_version:7:3} == "3.8" ]; then + pip install -e ".[async]" + pip install -e ".[adapter]" pip install "pytype" && pytype slack_bolt/ pytest --cov=slack_bolt/ && bash <(curl -s https://codecov.io/bash) fi diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3f45f8b89..000000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -language: - python -python: - - "3.6" - - "3.7" - - "3.8" - - "3.9" -install: - - python setup.py install - - pip install -U pip - # https://discuss.python.org/t/announcement-pip-20-2-release/4863 - - pip config set global.use-feature 2020-resolver - - pip install "pytest>=5,<6" "pytest-cov>=2,<3" -script: - # testing without aiohttp - - travis_retry pytest tests/slack_bolt/ - - travis_retry pytest tests/scenario_tests/ - # testing for adapters - - pip install -e ".[adapter]" - - travis_retry pytest tests/adapter_tests/ - # testing with aiohttp - - pip install -e ".[async]" - - pip install "pytest-asyncio<1" - - travis_retry pytest tests/slack_bolt_async/ - - travis_retry pytest tests/scenario_tests_async/ - - travis_retry pytest tests/adapter_tests_async/ - # run all tests just in case - - travis_retry python setup.py test - # Run pytype only for Python 3.8 - - if [ ${TRAVIS_PYTHON_VERSION:0:3} == "3.8" ]; then pip install "pytype" && pytype slack_bolt/; fi - - if [ ${TRAVIS_PYTHON_VERSION:0:3} == "3.8" ]; then pytest --cov=slack_bolt/ && bash <(curl -s https://codecov.io/bash); fi From c8b28df4d311f04309c6f29938db2adc618fa4c1 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 2 Dec 2020 22:36:46 +0900 Subject: [PATCH 054/719] Switch async test execution to python 3.6 --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 79f3e98f1..0c4ca9d6f 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -38,7 +38,7 @@ jobs: # As the tests here are often slow on GitHub Actions, # we pick up only one Python version for it. python_version=`python -V` - if [ ${python_version:7:3} == "3.9" ]; then + if [ ${python_version:7:3} == "3.6" ]; then pip install -e ".[async]" pip install "pytest-asyncio<1" pytest tests/slack_bolt_async/ From f438c03430c24b63fdc86c684a28fe7f0d5f4a99 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 2 Dec 2020 16:21:16 +0900 Subject: [PATCH 055/719] Fix #165 by making AsyncApp compatible with aiohttp-devtools --- examples/aiohttp_devtools/async_app.py | 37 ++++++++++++++++++++++ examples/aiohttp_devtools/requirements.txt | 2 ++ slack_bolt/app/async_app.py | 32 ++++++++++++++++--- slack_bolt/app/async_server.py | 32 ++++++++++--------- tests/mock_web_api_server.py | 2 +- 5 files changed, 85 insertions(+), 20 deletions(-) create mode 100644 examples/aiohttp_devtools/async_app.py create mode 100644 examples/aiohttp_devtools/requirements.txt diff --git a/examples/aiohttp_devtools/async_app.py b/examples/aiohttp_devtools/async_app.py new file mode 100644 index 000000000..605b90e31 --- /dev/null +++ b/examples/aiohttp_devtools/async_app.py @@ -0,0 +1,37 @@ +# ------------------------------------------------ +# instead of slack_bolt in requirements.txt +import sys + +sys.path.insert(1, "../..") +# ------------------------------------------------ + +import logging + +logging.basicConfig(level=logging.DEBUG) + +from slack_bolt.async_app import AsyncApp + +app = AsyncApp() + + +@app.event("app_mention") +async def event_test(body, say, logger): + logger.info(body) + await say("What's up?") + + +@app.command("/hello-bolt-python") +# or app.command(re.compile(r"/hello-.+"))(test_command) +async def command(ack, body): + user_id = body["user_id"] + await ack(f"Hi <@{user_id}>!") + + +def app_factory(): + return app.web_app() + + +# pip install -r requirements.txt +# export SLACK_SIGNING_SECRET=*** +# export SLACK_BOT_TOKEN=xoxb-*** +# adev runserver --port 3000 --app-factory app_factory async_app.py diff --git a/examples/aiohttp_devtools/requirements.txt b/examples/aiohttp_devtools/requirements.txt new file mode 100644 index 000000000..2e4b095ca --- /dev/null +++ b/examples/aiohttp_devtools/requirements.txt @@ -0,0 +1,2 @@ +aiohttp>=3,<4 +aiohttp-devtools>=0.13,<0.14 \ No newline at end of file diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 591d1ac95..140d2b619 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -3,6 +3,9 @@ import os from typing import Optional, List, Union, Callable, Pattern, Dict, Awaitable, Sequence +from aiohttp import web + +from slack_bolt.app.async_server import AsyncSlackAppServer from slack_bolt.listener.asyncio_runner import AsyncioListenerRunner from slack_bolt.middleware.message_listener_matches.async_message_listener_matches import ( AsyncMessageListenerMatches, @@ -225,6 +228,8 @@ def __init__( self._init_middleware_list_done = False self._init_async_middleware_list() + self._server: Optional[AsyncSlackAppServer] = None + def _init_async_middleware_list(self): if self._init_middleware_list_done: return @@ -282,6 +287,28 @@ def listener_runner(self) -> AsyncioListenerRunner: # ------------------------- # standalone server + from .async_server import AsyncSlackAppServer + + def server( + self, port: int = 3000, path: str = "/slack/events" + ) -> AsyncSlackAppServer: + """Configure a web server using AIOHTTP. + + :param port: The port to listen on (Default: 3000) + :param path: The path to handle request from Slack (Default: /slack/events) + :return: None + """ + if ( + self._server is None + or self._server.port != port + or self._server.path != path + ): + self._server = AsyncSlackAppServer(port=port, path=path, app=self,) + return self._server + + def web_app(self, path: str = "/slack/events") -> web.Application: + return self.server(path=path).web_app + def start(self, port: int = 3000, path: str = "/slack/events") -> None: """Start a web server using AIOHTTP. @@ -289,10 +316,7 @@ def start(self, port: int = 3000, path: str = "/slack/events") -> None: :param path: The path to handle request from Slack (Default: /slack/events) :return: None """ - from .async_server import AsyncSlackAppServer - - self.server = AsyncSlackAppServer(port=port, path=path, app=self,) - self.server.start() + self.server(port=port, path=path).start() # ------------------------- # main dispatcher diff --git a/slack_bolt/app/async_server.py b/slack_bolt/app/async_server.py index f4272e710..a00938a83 100644 --- a/slack_bolt/app/async_server.py +++ b/slack_bolt/app/async_server.py @@ -7,20 +7,24 @@ class AsyncSlackAppServer: + port: int + path: str + bolt_app: "AsyncApp" + web_app: web.Application + def __init__( - self, port: int, path: str, app, # AsyncApp + self, port: int, path: str, app: "AsyncApp", ): """Standalone AIOHTTP Web Server Refer to AIOHTTP documents for details. https://docs.aiohttp.org/en/stable/web.html """ - self._port = port - self._endpoint_path = path - self._bolt_app: "AsyncApp" = app - + self.port = port + self.path = path + self.bolt_app: "AsyncApp" = app self.web_app = web.Application() - self._bolt_oauth_flow = self._bolt_app.oauth_flow + self._bolt_oauth_flow = self.bolt_app.oauth_flow if self._bolt_oauth_flow: self.web_app.add_routes( [ @@ -31,13 +35,11 @@ def __init__( self._bolt_oauth_flow.redirect_uri_path, self.handle_get_requests, ), - web.post(self._endpoint_path, self.handle_post_requests), + web.post(self.path, self.handle_post_requests), ] ) else: - self.web_app.add_routes( - [web.post(self._endpoint_path, self.handle_post_requests)] - ) + self.web_app.add_routes([web.post(self.path, self.handle_post_requests)]) async def handle_get_requests(self, request: web.Request) -> web.Response: oauth_flow = self._bolt_oauth_flow @@ -56,11 +58,11 @@ async def handle_get_requests(self, request: web.Request) -> web.Response: return web.Response(status=404) async def handle_post_requests(self, request: web.Request) -> web.Response: - if self._endpoint_path != request.path: + if self.path != request.path: return web.Response(status=404) bolt_req = await to_bolt_request(request) - bolt_resp: BoltResponse = await self._bolt_app.async_dispatch(bolt_req) + bolt_resp: BoltResponse = await self.bolt_app.async_dispatch(bolt_req) return await to_aiohttp_response(bolt_resp) def start(self) -> None: @@ -68,9 +70,9 @@ def start(self) -> None: :return: None """ - if self._bolt_app.logger.level > logging.INFO: + if self.bolt_app.logger.level > logging.INFO: print("⚡️ Bolt app is running!") else: - self._bolt_app.logger.info("⚡️ Bolt app is running!") + self.bolt_app.logger.info("⚡️ Bolt app is running!") - web.run_app(self.web_app, host="0.0.0.0", port=self._port) + web.run_app(self.web_app, host="0.0.0.0", port=self.port) diff --git a/tests/mock_web_api_server.py b/tests/mock_web_api_server.py index 41c1d09c5..db204f00b 100644 --- a/tests/mock_web_api_server.py +++ b/tests/mock_web_api_server.py @@ -168,7 +168,7 @@ def run(self): self.server = HTTPServer(("localhost", 8888), self.handler) self.test.mock_received_requests = self.handler.received_requests self.test.server_url = "http://localhost:8888" - self.test.host, self.test._port = self.server.socket.getsockname() + self.test.host, self.test.port = self.server.socket.getsockname() self.test.server_started.set() # threading.Event() self.test = None From 94015f6e4d1c32c54fbb20dc1caee58ea22260f6 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 2 Dec 2020 19:33:08 +0900 Subject: [PATCH 056/719] Add ignore comments for pytype --- slack_bolt/app/async_server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/slack_bolt/app/async_server.py b/slack_bolt/app/async_server.py index a00938a83..cb84c9142 100644 --- a/slack_bolt/app/async_server.py +++ b/slack_bolt/app/async_server.py @@ -9,11 +9,11 @@ class AsyncSlackAppServer: port: int path: str - bolt_app: "AsyncApp" + bolt_app: "AsyncApp" # type:ignore web_app: web.Application - def __init__( - self, port: int, path: str, app: "AsyncApp", + def __init__( # type:ignore + self, port: int, path: str, app: "AsyncApp", # type:ignore ): """Standalone AIOHTTP Web Server From a00a3e9ec29f77502a0e9c43cab53d7910d8e06d Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 3 Dec 2020 13:22:01 +0900 Subject: [PATCH 057/719] Update the CI build settings --- .github/workflows/ci-build.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 0c4ca9d6f..617c8d1c3 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -35,9 +35,9 @@ jobs: pytest tests/adapter_tests/ - name: Run async tests run: | - # As the tests here are often slow on GitHub Actions, - # we pick up only one Python version for it. python_version=`python -V` + # TODO: As Python 3.6 works the most stably on GitHub Actions, + # we use the version for code coverage and async tests if [ ${python_version:7:3} == "3.6" ]; then pip install -e ".[async]" pip install "pytest-asyncio<1" @@ -48,7 +48,9 @@ jobs: - name: Run pytype verification & codecov run: | python_version=`python -V` - if [ ${python_version:7:3} == "3.8" ]; then + # TODO: As Python 3.6 works the most stably on GitHub Actions, + # we use the version for code coverage and async tests + if [ ${python_version:7:3} == "3.6" ]; then pip install -e ".[async]" pip install -e ".[adapter]" pip install "pytype" && pytype slack_bolt/ From ba3ca958af61f747411c9e832a4bf49f00541011 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 3 Dec 2020 13:27:41 +0900 Subject: [PATCH 058/719] Change the Python version to run pytype --- .github/workflows/ci-build.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 617c8d1c3..7c2cc7873 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -45,7 +45,16 @@ jobs: pytest tests/scenario_tests_async/ pytest tests/adapter_tests_async/ fi - - name: Run pytype verification & codecov + - name: Run pytype verification + run: | + python_version=`python -V` + if [ ${python_version:7:3} == "3.8" ]; then + pip install -e ".[async]" + pip install -e ".[adapter]" + pip install "pytype" && pytype slack_bolt/ + fi + + - name: Run all tests for codecov run: | python_version=`python -V` # TODO: As Python 3.6 works the most stably on GitHub Actions, @@ -53,6 +62,5 @@ jobs: if [ ${python_version:7:3} == "3.6" ]; then pip install -e ".[async]" pip install -e ".[adapter]" - pip install "pytype" && pytype slack_bolt/ pytest --cov=slack_bolt/ && bash <(curl -s https://codecov.io/bash) fi From e1942cdbb6fd1469a63f2eb708efeda65dec969a Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 3 Dec 2020 17:42:09 +0900 Subject: [PATCH 059/719] Improve request parser for better compatibility with Socket Mode --- slack_bolt/request/internals.py | 30 ++++++------- tests/slack_bolt/request/test_internals.py | 51 +++++++++++++++++++++- 2 files changed, 64 insertions(+), 17 deletions(-) diff --git a/slack_bolt/request/internals.py b/slack_bolt/request/internals.py index b9a42b914..95e2d0664 100644 --- a/slack_bolt/request/internals.py +++ b/slack_bolt/request/internals.py @@ -36,9 +36,9 @@ def parse_body(body: str, content_type: Optional[str]) -> Dict[str, Any]: ) or body.startswith("{"): return json.loads(body) else: - if "payload" in body: + if "payload" in body: # This is not JSON format yet params = dict(parse_qsl(body)) - if "payload" in params: + if params.get("payload") is not None: return json.loads(params.get("payload")) else: return {} @@ -56,48 +56,48 @@ def extract_is_enterprise_install(payload: Dict[str, Any]) -> Optional[bool]: def extract_enterprise_id(payload: Dict[str, Any]) -> Optional[str]: - if "enterprise" in payload: + if payload.get("enterprise") is not None: org = payload.get("enterprise") if isinstance(org, str): return org elif "id" in org: return org.get("id") # type: ignore - if "authorizations" in payload and len(payload["authorizations"]) > 0: + if payload.get("authorizations") is not None and len(payload["authorizations"]) > 0: # To make Events API handling functioning also for shared channels, # we should use .authorizations[0].enterprise_id over .enterprise_id return extract_enterprise_id(payload["authorizations"][0]) if "enterprise_id" in payload: return payload.get("enterprise_id") - if "team" in payload and "enterprise_id" in payload["team"]: + if payload.get("team") is not None and "enterprise_id" in payload["team"]: # In the case where the type is view_submission return payload["team"].get("enterprise_id") - if "event" in payload: + if payload.get("event") is not None: return extract_enterprise_id(payload["event"]) return None def extract_team_id(payload: Dict[str, Any]) -> Optional[str]: - if "team" in payload: + if payload.get("team") is not None: team = payload.get("team") if isinstance(team, str): return team elif team and "id" in team: return team.get("id") - if "authorizations" in payload and len(payload["authorizations"]) > 0: + if payload.get("authorizations") is not None and len(payload["authorizations"]) > 0: # To make Events API handling functioning also for shared channels, # we should use .authorizations[0].team_id over .team_id return extract_team_id(payload["authorizations"][0]) if "team_id" in payload: return payload.get("team_id") - if "event" in payload: + if payload.get("event") is not None: return extract_team_id(payload["event"]) - if "user" in payload: + if payload.get("user") is not None: return payload.get("user")["team_id"] return None def extract_user_id(payload: Dict[str, Any]) -> Optional[str]: - if "user" in payload: + if payload.get("user") is not None: user = payload.get("user") if isinstance(user, str): return user @@ -105,13 +105,13 @@ def extract_user_id(payload: Dict[str, Any]) -> Optional[str]: return user.get("id") # type: ignore if "user_id" in payload: return payload.get("user_id") - if "event" in payload: + if payload.get("event") is not None: return extract_user_id(payload["event"]) return None def extract_channel_id(payload: Dict[str, Any]) -> Optional[str]: - if "channel" in payload: + if payload.get("channel") is not None: channel = payload.get("channel") if isinstance(channel, str): return channel @@ -119,9 +119,9 @@ def extract_channel_id(payload: Dict[str, Any]) -> Optional[str]: return channel.get("id") # type: ignore if "channel_id" in payload: return payload.get("channel_id") - if "event" in payload: + if payload.get("event") is not None: return extract_channel_id(payload["event"]) - if "item" in payload: + if payload.get("item") is not None: # reaction_added: body["event"]["item"] return extract_channel_id(payload["item"]) return None diff --git a/tests/slack_bolt/request/test_internals.py b/tests/slack_bolt/request/test_internals.py index 496f690a6..d30849561 100644 --- a/tests/slack_bolt/request/test_internals.py +++ b/tests/slack_bolt/request/test_internals.py @@ -50,6 +50,35 @@ def teardown_method(self): }, ] + enterprise_no_channel_requests = [ + { + "type": "shortcut", + "token": "xxx", + "action_ts": "1606983924.521157", + "team": {"id": "T111", "domain": "ddd"}, + "user": {"id": "U111", "username": "use", "team_id": "T111"}, + "is_enterprise_install": False, + "enterprise": {"id": "E111", "domain": "eee"}, + "callback_id": "run-socket-mode", + "trigger_id": "111.222.xxx", + }, + ] + + no_enterprise_no_channel_requests = [ + { + "type": "shortcut", + "token": "xxx", + "action_ts": "1606983924.521157", + "team": {"id": "T111", "domain": "ddd"}, + "user": {"id": "U111", "username": "use", "team_id": "T111"}, + "is_enterprise_install": False, + # This may be "null" in Socket Mode + "enterprise": None, + "callback_id": "run-socket-mode", + "trigger_id": "111.222.xxx", + }, + ] + def test_channel_id_extraction(self): for req in self.requests: channel_id = extract_channel_id(req) @@ -59,16 +88,34 @@ def test_user_id_extraction(self): for req in self.requests: user_id = extract_user_id(req) assert user_id == "U111" + for req in self.enterprise_no_channel_requests: + user_id = extract_user_id(req) + assert user_id == "U111" + for req in self.no_enterprise_no_channel_requests: + user_id = extract_user_id(req) + assert user_id == "U111" def test_team_id_extraction(self): for req in self.requests: team_id = extract_team_id(req) assert team_id == "T111" + for req in self.enterprise_no_channel_requests: + team_id = extract_team_id(req) + assert team_id == "T111" + for req in self.no_enterprise_no_channel_requests: + team_id = extract_team_id(req) + assert team_id == "T111" def test_enterprise_id_extraction(self): for req in self.requests: - team_id = extract_enterprise_id(req) - assert team_id == "E111" + enterprise_id = extract_enterprise_id(req) + assert enterprise_id == "E111" + for req in self.enterprise_no_channel_requests: + enterprise_id = extract_enterprise_id(req) + assert enterprise_id == "E111" + for req in self.no_enterprise_no_channel_requests: + enterprise_id = extract_enterprise_id(req) + assert enterprise_id is None def test_is_enterprise_install_extraction(self): for req in self.requests: From 4f38c0227b0b2f5af488ecad08aabbdedef47893 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 3 Dec 2020 19:29:39 +0900 Subject: [PATCH 060/719] version 1.1.1 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 6849410aa..a82b376d2 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.1.0" +__version__ = "1.1.1" From 1d0268e1c060502036f39efeb85820d82005aa14 Mon Sep 17 00:00:00 2001 From: Jinpeng LI Date: Sun, 6 Dec 2020 02:06:08 +0800 Subject: [PATCH 061/719] Fix example compatible with slack-bolt v1.1.1 - update SlackBot model; - update SlackInstallation model; - refactor find_bot; - implement find_installation; --- examples/django/slackapp/models.py | 61 ++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 3 deletions(-) diff --git a/examples/django/slackapp/models.py b/examples/django/slackapp/models.py index 8b84beaac..6069ce345 100644 --- a/examples/django/slackapp/models.py +++ b/examples/django/slackapp/models.py @@ -8,11 +8,14 @@ class SlackBot(models.Model): client_id = models.TextField(null=False) app_id = models.TextField(null=False) enterprise_id = models.TextField(null=True) + enterprise_name = models.TextField(null=True) team_id = models.TextField(null=True) + team_name = models.TextField(null=True) bot_token = models.TextField(null=True) bot_id = models.TextField(null=True) bot_user_id = models.TextField(null=True) bot_scopes = models.TextField(null=True) + is_enterprise_install = models.BooleanField(null=True) installed_at = models.DateTimeField(null=False) class Meta: @@ -27,7 +30,10 @@ class SlackInstallation(models.Model): client_id = models.TextField(null=False) app_id = models.TextField(null=False) enterprise_id = models.TextField(null=True) + enterprise_name = models.TextField(null=True) + enterprise_url = models.TextField(null=True) team_id = models.TextField(null=True) + team_name = models.TextField(null=True) bot_token = models.TextField(null=True) bot_id = models.TextField(null=True) bot_user_id = models.TextField(null=True) @@ -36,8 +42,11 @@ class SlackInstallation(models.Model): user_token = models.TextField(null=True) user_scopes = models.TextField(null=True) incoming_webhook_url = models.TextField(null=True) + incoming_webhook_channel = models.TextField(null=True) incoming_webhook_channel_id = models.TextField(null=True) incoming_webhook_configuration_url = models.TextField(null=True) + is_enterprise_install = models.BooleanField(null=True) + token_type = models.TextField(null=True) installed_at = models.DateTimeField(null=False) class Meta: @@ -95,11 +104,16 @@ def save(self, installation: Installation): SlackBot(**b).save() def find_bot( - self, *, enterprise_id: Optional[str], team_id: Optional[str] + self, *, enterprise_id: Optional[str], team_id: Optional[str], + is_enterprise_install: Optional[bool] = False ) -> Optional[Bot]: + e_id = enterprise_id or None + t_id = team_id or None + if is_enterprise_install: + t_id = None rows = ( - SlackBot.objects.filter(enterprise_id=enterprise_id) - .filter(team_id=team_id) + SlackBot.objects.filter(enterprise_id=e_id) + .filter(team_id=t_id) .order_by(F("installed_at").desc())[:1] ) if len(rows) > 0: @@ -116,6 +130,47 @@ def find_bot( ) return None + def find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + e_id = enterprise_id or None + t_id = team_id or None + if is_enterprise_install: + t_id = None + if user_id is None: + rows = (SlackInstallation.objects.filter( + enterprise_id=e_id).filter(team_id=t_id).order_by( + F("installed_at").desc())[:1]) + else: + rows = (SlackInstallation.objects.filter( + enterprise_id=e_id).filter(team_id=t_id).filter( + user_id=user_id).order_by(F("installed_at").desc())[:1]) + + if len(rows) > 0: + i = rows[0] + return Installation( + app_id=i.app_id, + enterprise_id=i.enterprise_id, + team_id=i.team_id, + bot_token=i.bot_token, + bot_id=i.bot_id, + bot_user_id=i.bot_user_id, + bot_scopes=i.bot_scopes, + user_id=i.user_id, + user_token=i.user_token, + user_scopes=i.user_scopes, + incoming_webhook_url=i.incoming_webhook_url, + incoming_webhook_channel_id=i.incoming_webhook_channel_id, + incoming_webhook_configuration_url=i.incoming_webhook_configuration_url, + installed_at=i.installed_at.timestamp(), + ) + return None + class DjangoOAuthStateStore(OAuthStateStore): expiration_seconds: int From 0603e0ff3a16b1261cd4b3de860449bd5a4a7454 Mon Sep 17 00:00:00 2001 From: Jinpeng LI Date: Sun, 6 Dec 2020 02:06:50 +0800 Subject: [PATCH 062/719] regenerate migrations --- .../slackapp/migrations/0001_initial.py | 122 +++++++----------- 1 file changed, 48 insertions(+), 74 deletions(-) diff --git a/examples/django/slackapp/migrations/0001_initial.py b/examples/django/slackapp/migrations/0001_initial.py index 84665c287..5d256685d 100644 --- a/examples/django/slackapp/migrations/0001_initial.py +++ b/examples/django/slackapp/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 3.1.1 on 2020-09-26 13:49 +# Generated by Django 3.1.4 on 2020-12-04 13:07 from django.db import migrations, models @@ -7,95 +7,69 @@ class Migration(migrations.Migration): initial = True - dependencies = [] + dependencies = [ + ] operations = [ migrations.CreateModel( - name="SlackBot", + name='SlackBot', fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("client_id", models.TextField()), - ("app_id", models.TextField()), - ("enterprise_id", models.TextField(null=True)), - ("team_id", models.TextField(null=True)), - ("bot_token", models.TextField(null=True)), - ("bot_id", models.TextField(null=True)), - ("bot_user_id", models.TextField(null=True)), - ("bot_scopes", models.TextField(null=True)), - ("installed_at", models.DateTimeField()), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('client_id', models.TextField()), + ('app_id', models.TextField()), + ('enterprise_id', models.TextField(null=True)), + ('enterprise_name', models.TextField(null=True)), + ('team_id', models.TextField(null=True)), + ('team_name', models.TextField(null=True)), + ('bot_token', models.TextField(null=True)), + ('bot_id', models.TextField(null=True)), + ('bot_user_id', models.TextField(null=True)), + ('bot_scopes', models.TextField(null=True)), + ('is_enterprise_install', models.BooleanField(null=True)), + ('installed_at', models.DateTimeField()), ], ), migrations.CreateModel( - name="SlackInstallation", + name='SlackInstallation', fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("client_id", models.TextField()), - ("app_id", models.TextField()), - ("enterprise_id", models.TextField(null=True)), - ("team_id", models.TextField(null=True)), - ("bot_token", models.TextField(null=True)), - ("bot_id", models.TextField(null=True)), - ("bot_user_id", models.TextField(null=True)), - ("bot_scopes", models.TextField(null=True)), - ("user_id", models.TextField()), - ("user_token", models.TextField(null=True)), - ("user_scopes", models.TextField(null=True)), - ("incoming_webhook_url", models.TextField(null=True)), - ("incoming_webhook_channel_id", models.TextField(null=True)), - ("incoming_webhook_configuration_url", models.TextField(null=True)), - ("installed_at", models.DateTimeField()), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('client_id', models.TextField()), + ('app_id', models.TextField()), + ('enterprise_id', models.TextField(null=True)), + ('enterprise_name', models.TextField(null=True)), + ('enterprise_url', models.TextField(null=True)), + ('team_id', models.TextField(null=True)), + ('team_name', models.TextField(null=True)), + ('bot_token', models.TextField(null=True)), + ('bot_id', models.TextField(null=True)), + ('bot_user_id', models.TextField(null=True)), + ('bot_scopes', models.TextField(null=True)), + ('user_id', models.TextField()), + ('user_token', models.TextField(null=True)), + ('user_scopes', models.TextField(null=True)), + ('incoming_webhook_url', models.TextField(null=True)), + ('incoming_webhook_channel', models.TextField(null=True)), + ('incoming_webhook_channel_id', models.TextField(null=True)), + ('incoming_webhook_configuration_url', models.TextField(null=True)), + ('is_enterprise_install', models.BooleanField(null=True)), + ('token_type', models.TextField(null=True)), + ('installed_at', models.DateTimeField()), ], ), migrations.CreateModel( - name="SlackOAuthState", + name='SlackOAuthState', fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("state", models.TextField()), - ("expire_at", models.DateTimeField()), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('state', models.TextField()), + ('expire_at', models.DateTimeField()), ], ), migrations.AddIndex( - model_name="slackinstallation", - index=models.Index( - fields=[ - "client_id", - "enterprise_id", - "team_id", - "user_id", - "installed_at", - ], - name="slackapp_sl_client__9b0d3f_idx", - ), + model_name='slackinstallation', + index=models.Index(fields=['client_id', 'enterprise_id', 'team_id', 'user_id', 'installed_at'], name='bolt_slacki_client__62c411_idx'), ), migrations.AddIndex( - model_name="slackbot", - index=models.Index( - fields=["client_id", "enterprise_id", "team_id", "installed_at"], - name="slackapp_sl_client__d220d6_idx", - ), + model_name='slackbot', + index=models.Index(fields=['client_id', 'enterprise_id', 'team_id', 'installed_at'], name='bolt_slackb_client__be066b_idx'), ), ] From f3f1455d6707bad4a583033b63522da181777bc0 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sun, 6 Dec 2020 00:22:31 +0900 Subject: [PATCH 063/719] Add v1.0 compatible mode to #148 Org-wide App support --- scripts/run_tests.sh | 2 +- .../aws_lambda/lambda_s3_oauth_flow.py | 4 +- slack_bolt/app/app.py | 4 ++ slack_bolt/app/async_app.py | 3 + slack_bolt/authorization/async_authorize.py | 11 +++- slack_bolt/authorization/authorize.py | 12 +++- slack_bolt/oauth/async_oauth_flow.py | 2 + slack_bolt/oauth/async_oauth_settings.py | 8 ++- slack_bolt/oauth/oauth_flow.py | 2 + slack_bolt/oauth/oauth_settings.py | 8 ++- .../authorization/test_authorize.py | 57 ++++++++++++++++++ .../authorization/test_async_authorize.py | 59 +++++++++++++++++++ 12 files changed, 162 insertions(+), 10 deletions(-) diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index a5234a525..a5ffb0da9 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -20,7 +20,7 @@ else black slack_bolt/ tests/ \ && pytest \ && pip install -e ".[adapter]" \ - && pip install -U pytype \ + && pip install -U pip setuptools wheel pytype \ && pytype slack_bolt/ else black slack_bolt/ tests/ && pytest diff --git a/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py b/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py index 1282e76f5..f6c8ba4d7 100644 --- a/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py +++ b/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py @@ -62,7 +62,9 @@ def __init__( # the settings may already have pre-defined authorize. # In this case, the /slack/events endpoint doesn't work along with the OAuth flow. settings.authorize = InstallationStoreAuthorize( - logger=logger, installation_store=settings.installation_store + logger=logger, + installation_store=settings.installation_store, + bot_only=settings.installation_store_bot_only, ) OAuthFlow.__init__(self, client=client, logger=logger, settings=settings) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 5b2dba6b2..ce7c019a3 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -79,6 +79,8 @@ def __init__( # for multi-workspace apps authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[InstallationStore] = None, + # for v1.0.x compatibility + installation_store_bot_only: bool = False, # for the OAuth flow oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, @@ -96,6 +98,7 @@ def __init__( :param authorize: The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data. :param installation_store: The module offering save/find operations of installation data + :param installation_store_bot_only: Use InstallationStore#find_bot if True (Default: False) :param oauth_settings: The settings related to Slack app installation flow (OAuth flow) :param oauth_flow: Manually instantiated slack_bolt.oauth.OAuthFlow. This is always prioritized over oauth_settings. @@ -140,6 +143,7 @@ def __init__( self._authorize = InstallationStoreAuthorize( installation_store=self._installation_store, logger=self._framework_logger, + bot_only=installation_store_bot_only, ) self._oauth_flow: Optional[OAuthFlow] = None diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 140d2b619..e3d8e84be 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -90,6 +90,7 @@ def __init__( client: Optional[AsyncWebClient] = None, # for multi-workspace apps installation_store: Optional[AsyncInstallationStore] = None, + installation_store_bot_only: bool = False, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, # for the OAuth flow oauth_settings: Optional[AsyncOAuthSettings] = None, @@ -106,6 +107,7 @@ def __init__( :param token: The bot access token required only for single-workspace app. :param client: The singleton slack_sdk.web.async_client.AsyncWebClient instance for this app. :param installation_store: The module offering save/find operations of installation data + :param installation_store_bot_only: Use InstallationStore#find_bot if True (Default: False) :param authorize: The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data. :param oauth_settings: The settings related to Slack app installation flow (OAuth flow) @@ -155,6 +157,7 @@ def __init__( self._async_authorize = AsyncInstallationStoreAuthorize( installation_store=self._async_installation_store, logger=self._framework_logger, + bot_only=installation_store_bot_only, ) self._async_oauth_flow: Optional[AsyncOAuthFlow] = None diff --git a/slack_bolt/authorization/async_authorize.py b/slack_bolt/authorization/async_authorize.py index 8199ab299..a78700ced 100644 --- a/slack_bolt/authorization/async_authorize.py +++ b/slack_bolt/authorization/async_authorize.py @@ -91,7 +91,7 @@ async def __call__( class AsyncInstallationStoreAuthorize(AsyncAuthorize): - authorize_result_cache: Dict[str, AuthorizeResult] = {} + authorize_result_cache: Dict[str, AuthorizeResult] find_installation_available: Optional[bool] def __init__( @@ -99,11 +99,16 @@ def __init__( *, logger: Logger, installation_store: AsyncInstallationStore, + # For v1.0.x compatibility and people who still want its simplicity + # use only InstallationStore#find_bot(enterprise_id, team_id) + bot_only: bool = False, cache_enabled: bool = False, ): self.logger = logger self.installation_store = installation_store + self.bot_only = bot_only self.cache_enabled = cache_enabled + self.authorize_result_cache = {} self.find_installation_available = None async def __call__( @@ -123,7 +128,7 @@ async def __call__( bot_token: Optional[str] = None user_token: Optional[str] = None - if self.find_installation_available: + if not self.bot_only and self.find_installation_available: # since v1.1, this is the default way try: installation: Optional[ @@ -153,7 +158,7 @@ async def __call__( except NotImplementedError as _: self.find_installation_available = False - if not self.find_installation_available: + if self.bot_only or not self.find_installation_available: # Use find_bot to get bot value (legacy) bot: Optional[Bot] = await self.installation_store.async_find_bot( enterprise_id=enterprise_id, diff --git a/slack_bolt/authorization/authorize.py b/slack_bolt/authorization/authorize.py index 2393d99f2..7e51ab97b 100644 --- a/slack_bolt/authorization/authorize.py +++ b/slack_bolt/authorization/authorize.py @@ -90,7 +90,8 @@ def __call__( class InstallationStoreAuthorize(Authorize): - authorize_result_cache: Dict[str, AuthorizeResult] = {} + authorize_result_cache: Dict[str, AuthorizeResult] + bot_only: bool find_installation_available: bool def __init__( @@ -98,11 +99,16 @@ def __init__( *, logger: Logger, installation_store: InstallationStore, + # For v1.0.x compatibility and people who still want its simplicity + # use only InstallationStore#find_bot(enterprise_id, team_id) + bot_only: bool = False, cache_enabled: bool = False, ): self.logger = logger self.installation_store = installation_store + self.bot_only = bot_only self.cache_enabled = cache_enabled + self.authorize_result_cache = {} self.find_installation_available = hasattr( installation_store, "find_installation" ) @@ -119,7 +125,7 @@ def __call__( bot_token: Optional[str] = None user_token: Optional[str] = None - if self.find_installation_available: + if not self.bot_only and self.find_installation_available: # since v1.1, this is the default way try: installation: Optional[ @@ -149,7 +155,7 @@ def __call__( except NotImplementedError as _: self.find_installation_available = False - if not self.find_installation_available: + if self.bot_only or not self.find_installation_available: # Use find_bot to get bot value (legacy) bot: Optional[Bot] = self.installation_store.find_bot( enterprise_id=enterprise_id, diff --git a/slack_bolt/oauth/async_oauth_flow.py b/slack_bolt/oauth/async_oauth_flow.py index 073a622e3..d860d8dc7 100644 --- a/slack_bolt/oauth/async_oauth_flow.py +++ b/slack_bolt/oauth/async_oauth_flow.py @@ -110,6 +110,7 @@ def sqlite3( # state parameter related configurations state_cookie_name: str = OAuthStateUtils.default_cookie_name, state_expiration_seconds: int = OAuthStateUtils.default_expiration_seconds, + installation_store_bot_only: bool = False, client: Optional[AsyncWebClient] = None, logger: Optional[Logger] = None, ) -> "AsyncOAuthFlow": @@ -140,6 +141,7 @@ def sqlite3( installation_store=SQLite3InstallationStore( database=database, client_id=client_id, logger=logger, ), + installation_store_bot_only=installation_store_bot_only, # state parameter related configurations state_store=SQLite3OAuthStateStore( database=database, diff --git a/slack_bolt/oauth/async_oauth_settings.py b/slack_bolt/oauth/async_oauth_settings.py index f09df9a0d..8e36baf2d 100644 --- a/slack_bolt/oauth/async_oauth_settings.py +++ b/slack_bolt/oauth/async_oauth_settings.py @@ -39,6 +39,7 @@ class AsyncOAuthSettings: authorization_url: str # default: https://slack.com/oauth/v2/authorize # Installation Management installation_store: AsyncInstallationStore + installation_store_bot_only: bool authorize: AsyncAuthorize # state parameter related configurations state_store: AsyncOAuthStateStore @@ -69,6 +70,7 @@ def __init__( authorization_url: Optional[str] = None, # Installation Management installation_store: Optional[AsyncInstallationStore] = None, + installation_store_bot_only: bool = False, # state parameter related configurations state_store: Optional[AsyncOAuthStateStore] = None, state_cookie_name: str = OAuthStateUtils.default_cookie_name, @@ -90,6 +92,7 @@ def __init__( :param failure_url: Set a complete URL if you want to redirect end-users when an installation fails. :param authorization_url: Set a URL if you want to customize the URL https://slack.com/oauth/v2/authorize :param installation_store: Specify the instance of InstallationStore (Default: FileInstallationStore) + :param installation_store_bot_only: Use AsyncInstallationStore#find_bot if True (Default: False) :param state_store: Specify the instance of InstallationStore (Default: FileOAuthStateStore) :param state_cookie_name: The cookie name that is set for installers' browser. (Default: slack-app-oauth-state) :param state_expiration_seconds: The seconds that the state value is alive (Default: 600 seconds) @@ -129,8 +132,11 @@ def __init__( self.installation_store = ( installation_store or get_or_create_default_installation_store(client_id) ) + self.installation_store_bot_only = installation_store_bot_only self.authorize = AsyncInstallationStoreAuthorize( - logger=logger, installation_store=self.installation_store, + logger=logger, + installation_store=self.installation_store, + bot_only=self.installation_store_bot_only, ) # state parameter related configurations self.state_store = state_store or FileOAuthStateStore( diff --git a/slack_bolt/oauth/oauth_flow.py b/slack_bolt/oauth/oauth_flow.py index 705975087..d68b9d73c 100644 --- a/slack_bolt/oauth/oauth_flow.py +++ b/slack_bolt/oauth/oauth_flow.py @@ -105,6 +105,7 @@ def sqlite3( # state parameter related configurations state_cookie_name: str = OAuthStateUtils.default_cookie_name, state_expiration_seconds: int = OAuthStateUtils.default_expiration_seconds, + installation_store_bot_only: bool = False, client: Optional[WebClient] = None, logger: Optional[Logger] = None, ) -> "OAuthFlow": @@ -135,6 +136,7 @@ def sqlite3( installation_store=SQLite3InstallationStore( database=database, client_id=client_id, logger=logger, ), + installation_store_bot_only=installation_store_bot_only, # state parameter related configurations state_store=SQLite3OAuthStateStore( database=database, diff --git a/slack_bolt/oauth/oauth_settings.py b/slack_bolt/oauth/oauth_settings.py index 1462925c2..66ff03260 100644 --- a/slack_bolt/oauth/oauth_settings.py +++ b/slack_bolt/oauth/oauth_settings.py @@ -34,6 +34,7 @@ class OAuthSettings: authorization_url: str # default: https://slack.com/oauth/v2/authorize # Installation Management installation_store: InstallationStore + installation_store_bot_only: bool authorize: Authorize # state parameter related configurations state_store: OAuthStateStore @@ -64,6 +65,7 @@ def __init__( authorization_url: Optional[str] = None, # Installation Management installation_store: Optional[InstallationStore] = None, + installation_store_bot_only: bool = False, # state parameter related configurations state_store: Optional[OAuthStateStore] = None, state_cookie_name: str = OAuthStateUtils.default_cookie_name, @@ -85,6 +87,7 @@ def __init__( :param failure_url: Set a complete URL if you want to redirect end-users when an installation fails. :param authorization_url: Set a URL if you want to customize the URL https://slack.com/oauth/v2/authorize :param installation_store: Specify the instance of InstallationStore (Default: FileInstallationStore) + :param installation_store_bot_only: Use InstallationStore#find_bot if True (Default: False) :param state_store: Specify the instance of InstallationStore (Default: FileOAuthStateStore) :param state_cookie_name: The cookie name that is set for installers' browser. (Default: slack-app-oauth-state) :param state_expiration_seconds: The seconds that the state value is alive (Default: 600 seconds) @@ -123,8 +126,11 @@ def __init__( self.installation_store = ( installation_store or get_or_create_default_installation_store(client_id) ) + self.installation_store_bot_only = installation_store_bot_only self.authorize = InstallationStoreAuthorize( - logger=logger, installation_store=self.installation_store, + logger=logger, + installation_store=self.installation_store, + bot_only=self.installation_store_bot_only, ) # state parameter related configurations self.state_store = state_store or FileOAuthStateStore( diff --git a/tests/slack_bolt/authorization/test_authorize.py b/tests/slack_bolt/authorization/test_authorize.py index fff72f575..72c419880 100644 --- a/tests/slack_bolt/authorization/test_authorize.py +++ b/tests/slack_bolt/authorization/test_authorize.py @@ -76,6 +76,63 @@ def test_installation_store_cached_legacy(self): assert result.user_token is None assert self.mock_received_requests["/auth.test"] == 1 # cached + def test_installation_store_bot_only(self): + installation_store = MemoryInstallationStore() + authorize = InstallationStoreAuthorize( + logger=installation_store.logger, + installation_store=installation_store, + bot_only=True, + ) + assert authorize.find_installation_available is True + assert authorize.bot_only is True + context = BoltContext() + context["client"] = WebClient(base_url=self.mock_api_server_base_url) + result = authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert authorize.find_installation_available is True + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.user_token is None + assert self.mock_received_requests["/auth.test"] == 1 + + result = authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.user_token is None + assert self.mock_received_requests["/auth.test"] == 2 + + def test_installation_store_cached_bot_only(self): + installation_store = MemoryInstallationStore() + authorize = InstallationStoreAuthorize( + logger=installation_store.logger, + installation_store=installation_store, + cache_enabled=True, + bot_only=True, + ) + assert authorize.find_installation_available is True + assert authorize.bot_only is True + context = BoltContext() + context["client"] = WebClient(base_url=self.mock_api_server_base_url) + result = authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert authorize.find_installation_available is True + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.user_token is None + assert self.mock_received_requests["/auth.test"] == 1 + + result = authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.user_token is None + assert self.mock_received_requests["/auth.test"] == 1 # cached + def test_installation_store(self): installation_store = MemoryInstallationStore() authorize = InstallationStoreAuthorize( diff --git a/tests/slack_bolt_async/authorization/test_async_authorize.py b/tests/slack_bolt_async/authorization/test_async_authorize.py index 5df1cd0c2..263b6a591 100644 --- a/tests/slack_bolt_async/authorization/test_async_authorize.py +++ b/tests/slack_bolt_async/authorization/test_async_authorize.py @@ -90,6 +90,65 @@ async def test_installation_store_cached_legacy(self): assert result.user_token is None assert self.mock_received_requests["/auth.test"] == 1 # cached + @pytest.mark.asyncio + async def test_installation_store_bot_only(self): + installation_store = MemoryInstallationStore() + authorize = AsyncInstallationStoreAuthorize( + logger=installation_store.logger, + installation_store=installation_store, + bot_only=True, + ) + assert authorize.find_installation_available is None + assert authorize.bot_only is True + context = AsyncBoltContext() + context["client"] = self.client + result = await authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert authorize.find_installation_available is True + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.user_token is None + assert self.mock_received_requests["/auth.test"] == 1 + + result = await authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.user_token is None + assert self.mock_received_requests["/auth.test"] == 2 + + @pytest.mark.asyncio + async def test_installation_store_cached_bot_only(self): + installation_store = MemoryInstallationStore() + authorize = AsyncInstallationStoreAuthorize( + logger=installation_store.logger, + installation_store=installation_store, + cache_enabled=True, + bot_only=True, + ) + assert authorize.find_installation_available is None + assert authorize.bot_only is True + context = AsyncBoltContext() + context["client"] = self.client + result = await authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert authorize.find_installation_available is True + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.user_token is None + assert self.mock_received_requests["/auth.test"] == 1 + + result = await authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.user_token is None + assert self.mock_received_requests["/auth.test"] == 1 # cached + @pytest.mark.asyncio async def test_installation_store(self): installation_store = MemoryInstallationStore() From 0220e89e3b726d9a5aa8eafa364afe8b0cdc472e Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sun, 6 Dec 2020 00:45:48 +0900 Subject: [PATCH 064/719] Make the tests more explicit --- tests/slack_bolt/authorization/test_authorize.py | 16 ++++++++++++++-- .../authorization/test_async_authorize.py | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/tests/slack_bolt/authorization/test_authorize.py b/tests/slack_bolt/authorization/test_authorize.py index 72c419880..792949faf 100644 --- a/tests/slack_bolt/authorization/test_authorize.py +++ b/tests/slack_bolt/authorization/test_authorize.py @@ -77,7 +77,7 @@ def test_installation_store_cached_legacy(self): assert self.mock_received_requests["/auth.test"] == 1 # cached def test_installation_store_bot_only(self): - installation_store = MemoryInstallationStore() + installation_store = BotOnlyMemoryInstallationStore() authorize = InstallationStoreAuthorize( logger=installation_store.logger, installation_store=installation_store, @@ -105,7 +105,7 @@ def test_installation_store_bot_only(self): assert self.mock_received_requests["/auth.test"] == 2 def test_installation_store_cached_bot_only(self): - installation_store = MemoryInstallationStore() + installation_store = BotOnlyMemoryInstallationStore() authorize = InstallationStoreAuthorize( logger=installation_store.logger, installation_store=installation_store, @@ -233,3 +233,15 @@ def find_installation( user_scopes=["search:read"], installed_at=datetime.datetime.now().timestamp(), ) + + +class BotOnlyMemoryInstallationStore(LegacyMemoryInstallationStore): + def find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + raise ValueError diff --git a/tests/slack_bolt_async/authorization/test_async_authorize.py b/tests/slack_bolt_async/authorization/test_async_authorize.py index 263b6a591..f8a3cc98c 100644 --- a/tests/slack_bolt_async/authorization/test_async_authorize.py +++ b/tests/slack_bolt_async/authorization/test_async_authorize.py @@ -92,7 +92,7 @@ async def test_installation_store_cached_legacy(self): @pytest.mark.asyncio async def test_installation_store_bot_only(self): - installation_store = MemoryInstallationStore() + installation_store = BotOnlyMemoryInstallationStore() authorize = AsyncInstallationStoreAuthorize( logger=installation_store.logger, installation_store=installation_store, @@ -121,7 +121,7 @@ async def test_installation_store_bot_only(self): @pytest.mark.asyncio async def test_installation_store_cached_bot_only(self): - installation_store = MemoryInstallationStore() + installation_store = BotOnlyMemoryInstallationStore() authorize = AsyncInstallationStoreAuthorize( logger=installation_store.logger, installation_store=installation_store, @@ -253,3 +253,15 @@ async def async_find_installation( user_scopes=["search:read"], installed_at=datetime.datetime.now().timestamp(), ) + + +class BotOnlyMemoryInstallationStore(LegacyMemoryInstallationStore): + async def async_find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + raise ValueError From ef42ea9c97251d018c8f009daac7de607109a126 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sun, 6 Dec 2020 10:48:47 +0900 Subject: [PATCH 065/719] Fix initialization in App/AsyncApp constructor --- slack_bolt/app/app.py | 11 +++++++++++ slack_bolt/app/async_app.py | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index ce7c019a3..e962e3326 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -130,6 +130,10 @@ def __init__( else: self._client = create_web_client(token) # NOTE: the token here can be None + # -------------------------------------- + # Authorize & OAuthFlow initialization + # -------------------------------------- + self._authorize: Optional[Authorize] = None if authorize is not None: if oauth_settings is not None or oauth_flow is not None: @@ -192,6 +196,13 @@ def __init__( self._token = None self._framework_logger.warning(warning_token_skipped()) + # after setting bot_only here, __init__ cannot replace authorize function + self._authorize.bot_only = installation_store_bot_only + + # -------------------------------------- + # Middleware Initialization + # -------------------------------------- + self._middleware_list: List[Union[Callable, Middleware]] = [] self._listeners: List[Listener] = [] diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index e3d8e84be..d88360a73 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -141,6 +141,10 @@ def __init__( # NOTE: the token here can be None self._async_client = create_async_web_client(token) + # -------------------------------------- + # Authorize & OAuthFlow initialization + # -------------------------------------- + self._async_authorize: Optional[AsyncAuthorize] = None if authorize is not None: if oauth_settings is not None or oauth_flow is not None: @@ -214,6 +218,13 @@ def __init__( self._token = None self._framework_logger.warning(warning_token_skipped()) + # after setting bot_only here, __init__ cannot replace authorize function + self._async_authorize.bot_only = installation_store_bot_only + + # -------------------------------------- + # Middleware Initialization + # -------------------------------------- + self._async_middleware_list: List[Union[Callable, AsyncMiddleware]] = [] self._async_listeners: List[AsyncListener] = [] From e922a6d0c710da06e3ce94ae42b49342a7b59d3e Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sun, 6 Dec 2020 14:49:44 +0900 Subject: [PATCH 066/719] Add existence check --- slack_bolt/app/app.py | 3 ++- slack_bolt/app/async_app.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index e962e3326..a1911af50 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -197,7 +197,8 @@ def __init__( self._framework_logger.warning(warning_token_skipped()) # after setting bot_only here, __init__ cannot replace authorize function - self._authorize.bot_only = installation_store_bot_only + if self._authorize is not None: + self._authorize.bot_only = installation_store_bot_only # -------------------------------------- # Middleware Initialization diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index d88360a73..7978eaf4c 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -219,7 +219,8 @@ def __init__( self._framework_logger.warning(warning_token_skipped()) # after setting bot_only here, __init__ cannot replace authorize function - self._async_authorize.bot_only = installation_store_bot_only + if self._async_authorize is not None: + self._async_authorize.bot_only = installation_store_bot_only # -------------------------------------- # Middleware Initialization From 2393f6b4cb7bf6f6ec2e6aa11f59288277a2d1bc Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 7 Dec 2020 11:01:52 +0900 Subject: [PATCH 067/719] Simplify CI builds --- .github/workflows/ci-build.yml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 7c2cc7873..ee5ac1722 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -33,19 +33,7 @@ jobs: run: | pip install -e ".[adapter]" pytest tests/adapter_tests/ - - name: Run async tests - run: | - python_version=`python -V` - # TODO: As Python 3.6 works the most stably on GitHub Actions, - # we use the version for code coverage and async tests - if [ ${python_version:7:3} == "3.6" ]; then - pip install -e ".[async]" - pip install "pytest-asyncio<1" - pytest tests/slack_bolt_async/ - pytest tests/scenario_tests_async/ - pytest tests/adapter_tests_async/ - fi - - name: Run pytype verification + - name: Run pytype verification (3.8 only) run: | python_version=`python -V` if [ ${python_version:7:3} == "3.8" ]; then @@ -53,8 +41,7 @@ jobs: pip install -e ".[adapter]" pip install "pytype" && pytype slack_bolt/ fi - - - name: Run all tests for codecov + - name: Run all tests for codecov (3.6 only) run: | python_version=`python -V` # TODO: As Python 3.6 works the most stably on GitHub Actions, From 256e47e6ce9df62fa30286766d9cd35a69149e4c Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sun, 6 Dec 2020 14:37:17 +0900 Subject: [PATCH 068/719] Fix #170 by removing emoji from the boot message --- slack_bolt/app/app.py | 6 +++--- slack_bolt/app/async_server.py | 5 +++-- slack_bolt/util/utils.py | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index a1911af50..7636f7f5d 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -58,7 +58,7 @@ from slack_bolt.oauth.oauth_settings import OAuthSettings from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse -from slack_bolt.util.utils import create_web_client +from slack_bolt.util.utils import create_web_client, get_boot_message from slack_bolt.workflows.step import WorkflowStep, WorkflowStepMiddleware @@ -942,9 +942,9 @@ def start(self) -> None: :return: None """ if self._bolt_app.logger.level > logging.INFO: - print("⚡️ Bolt app is running! (development server)") + print(get_boot_message(development_server=True)) else: - self._bolt_app.logger.info("⚡️ Bolt app is running! (development server)") + self._bolt_app.logger.info(get_boot_message(development_server=True)) try: self._server.serve_forever(0.05) diff --git a/slack_bolt/app/async_server.py b/slack_bolt/app/async_server.py index cb84c9142..6ae669098 100644 --- a/slack_bolt/app/async_server.py +++ b/slack_bolt/app/async_server.py @@ -4,6 +4,7 @@ from slack_bolt.adapter.aiohttp import to_bolt_request, to_aiohttp_response from slack_bolt.response import BoltResponse +from slack_bolt.util.utils import get_boot_message class AsyncSlackAppServer: @@ -71,8 +72,8 @@ def start(self) -> None: :return: None """ if self.bolt_app.logger.level > logging.INFO: - print("⚡️ Bolt app is running!") + print(get_boot_message()) else: - self.bolt_app.logger.info("⚡️ Bolt app is running!") + self.bolt_app.logger.info(get_boot_message()) web.run_app(self.web_app, host="0.0.0.0", port=self.port) diff --git a/slack_bolt/util/utils.py b/slack_bolt/util/utils.py index e31489f69..4cdc39190 100644 --- a/slack_bolt/util/utils.py +++ b/slack_bolt/util/utils.py @@ -39,3 +39,18 @@ def create_copy(original: Any) -> Any: return copy.copy(original) else: return copy.deepcopy(original) + + +def get_boot_message(development_server: bool = False) -> str: + if sys.platform == "win32": + # Some Windows environments may fail to parse this str value + # and result in UnicodeEncodeError + if development_server: + return "Bolt app is running! (development server)" + else: + return "Bolt app is running!" + + if development_server: + return "⚡️ Bolt app is running! (development server)" + else: + return "⚡️ Bolt app is running!" From ca09f618bf299e51ecaa4ceb90b37af2809301b0 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 8 Dec 2020 14:52:46 +0900 Subject: [PATCH 069/719] Fix CI build settings for properly running codecov --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index ee5ac1722..b1dad657c 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -48,6 +48,6 @@ jobs: # we use the version for code coverage and async tests if [ ${python_version:7:3} == "3.6" ]; then pip install -e ".[async]" - pip install -e ".[adapter]" + pip install -e ".[testing]" pytest --cov=slack_bolt/ && bash <(curl -s https://codecov.io/bash) fi From 3b8900f8dc464c945d581b62bdd4f82ba9b05994 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 8 Dec 2020 16:06:56 +0900 Subject: [PATCH 070/719] version 1.1.2 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index a82b376d2..72f26f596 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.1.1" +__version__ = "1.1.2" From 1d01c6798e57ca780b765ff86ed6c29ff25015ee Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 8 Dec 2020 17:04:12 +0900 Subject: [PATCH 071/719] Add timeout-minutes to CI builds --- .github/workflows/ci-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index b1dad657c..90ffbc6b7 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -10,6 +10,7 @@ on: jobs: build: runs-on: ubuntu-latest + timeout-minutes: 10 strategy: matrix: python-version: ['3.6', '3.7', '3.8', '3.9'] From 890cf3f5535f81233782252be48a3e68a28d7fde Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 11 Dec 2020 15:03:51 +0900 Subject: [PATCH 072/719] Update test runner script to avoid installation failures --- scripts/run_tests.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index a5ffb0da9..c9096048a 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -20,7 +20,8 @@ else black slack_bolt/ tests/ \ && pytest \ && pip install -e ".[adapter]" \ - && pip install -U pip setuptools wheel pytype \ + && pip install -U pip setuptools wheel \ + && pip install -U pytype \ && pytype slack_bolt/ else black slack_bolt/ tests/ && pytest From d82a7d9ee863b0c48a839e8e36319c2b02a662ad Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 11 Dec 2020 15:02:30 +0900 Subject: [PATCH 073/719] Fix #177 by updating App/AsyncApp bot_only flag initialization --- slack_bolt/app/app.py | 12 +- slack_bolt/app/async_app.py | 19 +- slack_bolt/logger/messages.py | 7 + tests/scenario_tests/test_app.py | 12 +- tests/scenario_tests/test_app_bot_only.py | 261 +++++++++++++++++ .../scenario_tests_async/test_app_bot_only.py | 262 ++++++++++++++++++ 6 files changed, 566 insertions(+), 7 deletions(-) create mode 100644 tests/scenario_tests/test_app_bot_only.py create mode 100644 tests/scenario_tests_async/test_app_bot_only.py diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 7636f7f5d..bc1f90f7b 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -41,6 +41,7 @@ error_unexpected_listener_middleware, error_client_invalid_type, error_authorize_conflicts, + warning_bot_only_conflicts, ) from slack_bolt.middleware import ( Middleware, @@ -80,7 +81,7 @@ def __init__( authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[InstallationStore] = None, # for v1.0.x compatibility - installation_store_bot_only: bool = False, + installation_store_bot_only: Optional[bool] = None, # for the OAuth flow oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, @@ -197,8 +198,13 @@ def __init__( self._framework_logger.warning(warning_token_skipped()) # after setting bot_only here, __init__ cannot replace authorize function - if self._authorize is not None: - self._authorize.bot_only = installation_store_bot_only + if installation_store_bot_only is not None and self._oauth_flow is not None: + app_bot_only = installation_store_bot_only or False + oauth_flow_bot_only = self._oauth_flow.settings.installation_store_bot_only + if app_bot_only != oauth_flow_bot_only: + self.logger.warning(warning_bot_only_conflicts()) + self._oauth_flow.settings.installation_store_bot_only = app_bot_only + self._authorize.bot_only = app_bot_only # -------------------------------------- # Middleware Initialization diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 7978eaf4c..8fdc6bca0 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -38,6 +38,7 @@ error_authorize_conflicts, error_oauth_settings_invalid_type_async, error_oauth_flow_invalid_type_async, + warning_bot_only_conflicts, ) from slack_bolt.lazy_listener.asyncio_runner import AsyncioLazyListenerRunner from slack_bolt.listener.async_listener import AsyncListener, AsyncCustomListener @@ -90,7 +91,7 @@ def __init__( client: Optional[AsyncWebClient] = None, # for multi-workspace apps installation_store: Optional[AsyncInstallationStore] = None, - installation_store_bot_only: bool = False, + installation_store_bot_only: Optional[bool] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, # for the OAuth flow oauth_settings: Optional[AsyncOAuthSettings] = None, @@ -219,8 +220,20 @@ def __init__( self._framework_logger.warning(warning_token_skipped()) # after setting bot_only here, __init__ cannot replace authorize function - if self._async_authorize is not None: - self._async_authorize.bot_only = installation_store_bot_only + if ( + installation_store_bot_only is not None + and self._async_oauth_flow is not None + ): + app_bot_only = installation_store_bot_only or False + oauth_flow_bot_only = ( + self._async_oauth_flow.settings.installation_store_bot_only + ) + if app_bot_only != oauth_flow_bot_only: + self.logger.warning(warning_bot_only_conflicts()) + self._async_oauth_flow.settings.installation_store_bot_only = ( + app_bot_only + ) + self._async_authorize.bot_only = app_bot_only # -------------------------------------- # Middleware Initialization diff --git a/slack_bolt/logger/messages.py b/slack_bolt/logger/messages.py index e01f03005..d850567a3 100644 --- a/slack_bolt/logger/messages.py +++ b/slack_bolt/logger/messages.py @@ -76,6 +76,13 @@ def warning_did_not_call_ack(listener_name: str) -> str: return f"{listener_name} didn't call ack()" +def warning_bot_only_conflicts() -> str: + return ( + "installation_store_bot_only exists in both App and OAuthFlow.settings. " + "The one passed in App constructor is used." + ) + + # ------------------------------- # Info # ------------------------------- diff --git a/tests/scenario_tests/test_app.py b/tests/scenario_tests/test_app.py index 3667a7a09..16ee40339 100644 --- a/tests/scenario_tests/test_app.py +++ b/tests/scenario_tests/test_app.py @@ -3,7 +3,7 @@ from slack_sdk.oauth.installation_store import FileInstallationStore from slack_sdk.oauth.state_store import FileOAuthStateStore -from slack_bolt import App +from slack_bolt import App, Say from slack_bolt.authorization import AuthorizeResult from slack_bolt.error import BoltError from slack_bolt.oauth import OAuthFlow @@ -29,6 +29,16 @@ def teardown_method(self): cleanup_mock_web_api_server(self) restore_os_env(self.old_os_env) + @staticmethod + def handle_app_mention(body, say: Say, payload, event): + assert body["event"] == payload + assert payload == event + say("What's up?") + + # -------------------------- + # basic tests + # -------------------------- + def test_signing_secret_absence(self): with pytest.raises(BoltError): App(signing_secret=None, token="xoxb-xxx") diff --git a/tests/scenario_tests/test_app_bot_only.py b/tests/scenario_tests/test_app_bot_only.py new file mode 100644 index 000000000..c6cfca323 --- /dev/null +++ b/tests/scenario_tests/test_app_bot_only.py @@ -0,0 +1,261 @@ +import datetime +import json +import logging +from time import time, sleep +from typing import Optional + +from slack_sdk import WebClient +from slack_sdk.oauth import InstallationStore +from slack_sdk.oauth.installation_store import Installation, Bot +from slack_sdk.oauth.state_store import FileOAuthStateStore +from slack_sdk.signature import SignatureVerifier + +from slack_bolt import App, BoltRequest, Say +from slack_bolt.oauth import OAuthFlow +from slack_bolt.oauth.oauth_settings import OAuthSettings +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class LegacyMemoryInstallationStore(InstallationStore): + @property + def logger(self) -> logging.Logger: + return logging.getLogger(__name__) + + def save(self, installation: Installation): + pass + + def find_bot( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Bot]: + return Bot( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + installed_at=datetime.datetime.now().timestamp(), + ) + + +class MemoryInstallationStore(LegacyMemoryInstallationStore): + def find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + return Installation( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid-2", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + user_id="W11111", + user_token="xoxp-valid", + user_scopes=["search:read"], + installed_at=datetime.datetime.now().timestamp(), + ) + + +class BotOnlyMemoryInstallationStore(LegacyMemoryInstallationStore): + def find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + raise ValueError + + +class TestApp: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + app_mention_request_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "team": "T111", + "channel": "C111", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, + "authed_users": ["W111"], + } + + @staticmethod + def handle_app_mention(body, say: Say, payload, event): + assert body["event"] == payload + assert payload == event + say("What's up?") + + oauth_settings_bot_only = OAuthSettings( + client_id="111.222", + client_secret="valid", + installation_store=BotOnlyMemoryInstallationStore(), + installation_store_bot_only=True, + state_store=FileOAuthStateStore(expiration_seconds=120), + ) + + oauth_settings = OAuthSettings( + client_id="111.222", + client_secret="valid", + installation_store=BotOnlyMemoryInstallationStore(), + installation_store_bot_only=False, + state_store=FileOAuthStateStore(expiration_seconds=120), + ) + + def build_app_mention_request(self): + timestamp, body = str(int(time())), json.dumps(self.app_mention_request_body) + return BoltRequest(body=body, headers=self.build_headers(timestamp, body)) + + def test_installation_store_bot_only_default(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + installation_store=MemoryInstallationStore(), + ) + + app.event("app_mention")(self.handle_app_mention) + response = app.dispatch(self.build_app_mention_request()) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + def test_installation_store_bot_only_false(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + installation_store=MemoryInstallationStore(), + # the default is False + installation_store_bot_only=False, + ) + + app.event("app_mention")(self.handle_app_mention) + response = app.dispatch(self.build_app_mention_request()) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + def test_installation_store_bot_only(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + installation_store=BotOnlyMemoryInstallationStore(), + installation_store_bot_only=True, + ) + + app.event("app_mention")(self.handle_app_mention) + response = app.dispatch(self.build_app_mention_request()) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + def test_installation_store_bot_only_oauth_settings(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + oauth_settings=self.oauth_settings_bot_only, + ) + + app.event("app_mention")(self.handle_app_mention) + response = app.dispatch(self.build_app_mention_request()) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + def test_installation_store_bot_only_oauth_settings_conflicts(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + installation_store_bot_only=True, + oauth_settings=self.oauth_settings, + ) + + app.event("app_mention")(self.handle_app_mention) + response = app.dispatch(self.build_app_mention_request()) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + def test_installation_store_bot_only_oauth_flow(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + oauth_flow=OAuthFlow(settings=self.oauth_settings_bot_only), + ) + + app.event("app_mention")(self.handle_app_mention) + response = app.dispatch(self.build_app_mention_request()) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + def test_installation_store_bot_only_oauth_flow_conflicts(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + installation_store_bot_only=True, + oauth_flow=OAuthFlow(settings=self.oauth_settings), + ) + + app.event("app_mention")(self.handle_app_mention) + response = app.dispatch(self.build_app_mention_request()) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 diff --git a/tests/scenario_tests_async/test_app_bot_only.py b/tests/scenario_tests_async/test_app_bot_only.py new file mode 100644 index 000000000..e664269bb --- /dev/null +++ b/tests/scenario_tests_async/test_app_bot_only.py @@ -0,0 +1,262 @@ +import asyncio +import datetime +import json +import logging +from time import time +from typing import Optional + +import pytest +from slack_sdk.oauth.installation_store import Installation, Bot +from slack_sdk.oauth.installation_store.async_installation_store import ( + AsyncInstallationStore, +) +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.oauth.async_oauth_flow import AsyncOAuthFlow +from slack_bolt.oauth.async_oauth_settings import AsyncOAuthSettings +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestAppBotOnly: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def build_valid_app_mention_request(self) -> AsyncBoltRequest: + timestamp, body = str(int(time())), json.dumps(app_mention_body) + return AsyncBoltRequest(body=body, headers=self.build_headers(timestamp, body)) + + @pytest.mark.asyncio + async def test_bot_only_default_off(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + installation_store=BotOnlyMemoryInstallationStore(), + ) + app.event("app_mention")(whats_up) + + request = self.build_valid_app_mention_request() + with pytest.raises(ValueError): + await app.async_dispatch(request) + + @pytest.mark.asyncio + async def test_bot_only(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + installation_store=BotOnlyMemoryInstallationStore(), + installation_store_bot_only=True, + ) + app.event("app_mention")(whats_up) + + request = self.build_valid_app_mention_request() + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + await asyncio.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + @pytest.mark.asyncio + async def test_bot_only_oauth_settings_conflicts(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + oauth_settings=oauth_settings, + installation_store_bot_only=True, + ) + app.event("app_mention")(whats_up) + + request = self.build_valid_app_mention_request() + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + await asyncio.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + @pytest.mark.asyncio + async def test_bot_only_oauth_settings(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + oauth_settings=oauth_settings_bot_only, + ) + app.event("app_mention")(whats_up) + + request = self.build_valid_app_mention_request() + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + await asyncio.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + @pytest.mark.asyncio + async def test_bot_only_oauth_flow_conflicts(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + oauth_flow=AsyncOAuthFlow(settings=oauth_settings), + installation_store_bot_only=True, + ) + app.event("app_mention")(whats_up) + + request = self.build_valid_app_mention_request() + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + await asyncio.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + @pytest.mark.asyncio + async def test_bot_only_oauth_flow(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + oauth_flow=AsyncOAuthFlow(settings=oauth_settings_bot_only), + ) + app.event("app_mention")(whats_up) + + request = self.build_valid_app_mention_request() + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + await asyncio.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + +app_mention_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "team": "T111", + "channel": "C111", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, + "authed_users": ["W111"], +} + + +async def whats_up(body, say, payload, event): + assert body["event"] == payload + assert payload == event + await say("What's up?") + + +class LegacyMemoryInstallationStore(AsyncInstallationStore): + @property + def logger(self) -> logging.Logger: + return logging.getLogger(__name__) + + async def async_save(self, installation: Installation): + pass + + async def async_find_bot( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Bot]: + return Bot( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + installed_at=datetime.datetime.now().timestamp(), + ) + + +class MemoryInstallationStore(LegacyMemoryInstallationStore): + async def async_find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + return Installation( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid-2", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + user_id="W11111", + user_token="xoxp-valid", + user_scopes=["search:read"], + installed_at=datetime.datetime.now().timestamp(), + ) + + +class BotOnlyMemoryInstallationStore(LegacyMemoryInstallationStore): + async def async_find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + raise ValueError + + +oauth_settings = AsyncOAuthSettings( + client_id="111.222", + client_secret="secret", + installation_store=BotOnlyMemoryInstallationStore(), + installation_store_bot_only=False, +) + +oauth_settings_bot_only = AsyncOAuthSettings( + client_id="111.222", + client_secret="secret", + installation_store=BotOnlyMemoryInstallationStore(), + installation_store_bot_only=True, +) From 8efa2ba9ca7e6c6d8c70ebd9f9f0da7d74154847 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 16 Dec 2020 17:11:17 +0900 Subject: [PATCH 074/719] version 1.1.3 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 72f26f596..0b2f79dbb 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.1.2" +__version__ = "1.1.3" From edd92796516939e6dded41b8e5690c9ca1fc386a Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 18 Dec 2020 21:45:24 +0900 Subject: [PATCH 075/719] Fix #158 by adding token_verification_enabled option to App --- slack_bolt/app/app.py | 12 +++++++++--- tests/scenario_tests/test_app.py | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index bc1f90f7b..75593af78 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -76,6 +76,7 @@ def __init__( signing_secret: Optional[str] = None, # for single-workspace apps token: Optional[str] = None, + token_verification_enabled: bool = True, client: Optional[WebClient] = None, # for multi-workspace apps authorize: Optional[Callable[..., AuthorizeResult]] = None, @@ -95,6 +96,7 @@ def __init__( :param process_before_response: True if this app runs on Function as a Service. (Default: False) :param signing_secret: The Signing Secret value used for verifying requests from Slack. :param token: The bot access token required only for single-workspace app. + :param token_verification_enabled: Verifies the validity of the given token if True. :param client: The singleton slack_sdk.WebClient instance for this app. :param authorize: The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data. @@ -227,9 +229,11 @@ def __init__( ) self._init_middleware_list_done = False - self._init_middleware_list() + self._init_middleware_list( + token_verification_enabled=token_verification_enabled + ) - def _init_middleware_list(self): + def _init_middleware_list(self, token_verification_enabled: bool): if self._init_middleware_list_done: return self._middleware_list.append( @@ -240,7 +244,9 @@ def _init_middleware_list(self): if self._oauth_flow is None: if self._token is not None: try: - auth_test_result = self._client.auth_test(token=self._token) + auth_test_result = None + if token_verification_enabled: + auth_test_result = self._client.auth_test(token=self._token) self._middleware_list.append( SingleTeamAuthorization(auth_test_result=auth_test_result) ) diff --git a/tests/scenario_tests/test_app.py b/tests/scenario_tests/test_app.py index 16ee40339..af2e98c34 100644 --- a/tests/scenario_tests/test_app.py +++ b/tests/scenario_tests/test_app.py @@ -67,6 +67,20 @@ def test_token_absence(self): with pytest.raises(BoltError): App(signing_secret="valid", token="") + def test_token_verification_enabled_False(self): + App( + signing_secret="valid", + client=self.web_client, + token_verification_enabled=False, + ) + App( + signing_secret="valid", + token="xoxb-invalid", + token_verification_enabled=False, + ) + + assert self.mock_received_requests.get("/auth.test") is None + # -------------------------- # multi teams auth # -------------------------- From 7d35ae361ac1376e6080b039d71e78a33166373f Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 19 Dec 2020 12:31:41 +0900 Subject: [PATCH 076/719] Upgrade black code formatter to the latest version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b049c0102..bf95537e6 100755 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ "pytest-cov>=2,<3", "pytest-asyncio<1", # for async "aiohttp>=3,<4", # for async - "black==19.10b0", # TODO: upgrading the version + "black==20.8b1", ] setuptools.setup( From 809e255bcdb6ca44c5bc08a758042d5d3d30b2f0 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 19 Dec 2020 12:33:13 +0900 Subject: [PATCH 077/719] Apply code formatter's changes --- examples/app_authorize.py | 9 +- examples/async_app_authorize.py | 7 +- examples/async_steps_from_apps.py | 23 +++- examples/async_steps_from_apps_primitive.py | 6 +- examples/aws_chalice/app.py | 5 +- examples/aws_lambda/aws_lambda_oauth.py | 5 +- examples/dialogs_app.py | 3 +- .../slackapp/migrations/0001_initial.py | 129 +++++++++++------- examples/django/slackapp/models.py | 47 +++++-- examples/django/slackapp/settings.py | 33 ++++- examples/falcon/app.py | 20 ++- examples/falcon/oauth_app.py | 20 ++- examples/fastapi/async_oauth_app.py | 1 + examples/getting_started/app.py | 22 ++- examples/lazy_async_modals_app.py | 23 +++- examples/lazy_modals_app.py | 23 +++- examples/message_events.py | 4 +- examples/modals_app.py | 28 +++- examples/modals_app_typed.py | 7 +- examples/oauth_app.py | 20 ++- examples/oauth_app_settings.py | 20 ++- examples/readme_app.py | 15 +- examples/readme_async_app.py | 17 ++- examples/sqlalchemy/async_oauth_app.py | 12 +- examples/sqlalchemy/oauth_app.py | 8 +- examples/steps_from_apps.py | 12 +- examples/steps_from_apps_primitive.py | 6 +- slack_bolt/adapter/aiohttp/__init__.py | 4 +- .../adapter/aws_lambda/chalice_handler.py | 16 ++- slack_bolt/adapter/aws_lambda/handler.py | 4 +- slack_bolt/adapter/bottle/handler.py | 6 +- slack_bolt/adapter/cherrypy/handler.py | 6 +- slack_bolt/adapter/django/handler.py | 9 +- slack_bolt/adapter/pyramid/handler.py | 4 +- slack_bolt/adapter/sanic/async_handler.py | 9 +- slack_bolt/adapter/starlette/async_handler.py | 9 +- slack_bolt/adapter/starlette/handler.py | 9 +- slack_bolt/app/app.py | 22 ++- slack_bolt/app/async_app.py | 18 ++- slack_bolt/app/async_server.py | 7 +- slack_bolt/authorization/async_authorize.py | 12 +- slack_bolt/authorization/authorize.py | 5 +- slack_bolt/context/say/async_say.py | 4 +- slack_bolt/context/say/say.py | 4 +- slack_bolt/lazy_listener/async_runner.py | 4 +- slack_bolt/lazy_listener/asyncio_runner.py | 7 +- slack_bolt/lazy_listener/internals.py | 4 +- slack_bolt/lazy_listener/runner.py | 6 +- slack_bolt/lazy_listener/thread_runner.py | 10 +- slack_bolt/listener/async_listener.py | 15 +- slack_bolt/listener/asyncio_runner.py | 12 +- slack_bolt/listener/custom_listener.py | 5 +- slack_bolt/listener/listener.py | 12 +- slack_bolt/listener/listener_error_handler.py | 15 +- slack_bolt/listener/thread_runner.py | 12 +- slack_bolt/listener_matcher/builtins.py | 71 +++++++--- .../authorization/async_internals.py | 3 +- .../middleware/authorization/internals.py | 3 +- .../multi_teams_authorization.py | 10 +- .../single_team_authorization.py | 6 +- slack_bolt/middleware/custom_middleware.py | 6 +- .../ignoring_self_events.py | 6 +- .../message_listener_matches.py | 6 +- slack_bolt/middleware/middleware.py | 6 +- .../request_verification.py | 6 +- slack_bolt/middleware/ssl_check/ssl_check.py | 6 +- .../url_verification/url_verification.py | 6 +- slack_bolt/oauth/async_callback_options.py | 7 +- slack_bolt/oauth/async_oauth_flow.py | 16 ++- slack_bolt/oauth/async_oauth_settings.py | 3 +- slack_bolt/oauth/callback_options.py | 7 +- slack_bolt/oauth/oauth_flow.py | 22 +-- slack_bolt/oauth/oauth_settings.py | 3 +- slack_bolt/request/async_internals.py | 3 +- slack_bolt/util/async_utils.py | 5 +- slack_bolt/util/utils.py | 5 +- slack_bolt/workflows/step/async_step.py | 25 +++- .../workflows/step/async_step_middleware.py | 5 +- slack_bolt/workflows/step/step.py | 19 ++- slack_bolt/workflows/step/step_middleware.py | 11 +- .../step/utilities/async_configure.py | 4 +- .../workflows/step/utilities/async_fail.py | 6 +- slack_bolt/workflows/step/utilities/fail.py | 6 +- tests/adapter_tests/test_aws_chalice.py | 23 +++- tests/adapter_tests/test_aws_lambda.py | 33 ++++- tests/adapter_tests/test_bottle.py | 13 +- tests/adapter_tests/test_bottle_oauth.py | 4 +- tests/adapter_tests/test_cherrypy.py | 13 +- tests/adapter_tests/test_cherrypy_oauth.py | 5 +- tests/adapter_tests/test_django.py | 23 +++- tests/adapter_tests/test_django_settings.py | 5 +- tests/adapter_tests/test_falcon.py | 35 +++-- tests/adapter_tests/test_fastapi.py | 35 +++-- tests/adapter_tests/test_flask.py | 35 +++-- .../test_lambda_s3_oauth_flow.py | 4 +- tests/adapter_tests/test_pyramid.py | 23 +++- tests/adapter_tests/test_starlette.py | 35 +++-- tests/adapter_tests/test_tornado.py | 13 +- tests/adapter_tests/test_tornado_oauth.py | 4 +- .../adapter_tests_async/test_async_fastapi.py | 35 +++-- tests/adapter_tests_async/test_async_sanic.py | 35 +++-- .../test_async_starlette.py | 35 +++-- tests/scenario_tests/test_app.py | 14 +- tests/scenario_tests/test_app_bot_only.py | 8 +- .../scenario_tests/test_attachment_actions.py | 57 ++++++-- tests/scenario_tests/test_authorize.py | 14 +- tests/scenario_tests/test_block_actions.py | 28 +++- tests/scenario_tests/test_block_suggestion.py | 38 ++++-- tests/scenario_tests/test_dialogs.py | 73 ++++++++-- tests/scenario_tests/test_error_handler.py | 26 +++- tests/scenario_tests/test_events.py | 8 +- tests/scenario_tests/test_events_org_apps.py | 6 +- .../test_events_shared_channels.py | 9 +- .../scenario_tests/test_events_socket_mode.py | 5 +- tests/scenario_tests/test_lazy.py | 24 +++- tests/scenario_tests/test_message.py | 38 ++++-- tests/scenario_tests/test_middleware.py | 18 ++- tests/scenario_tests/test_shortcut.py | 43 ++++-- tests/scenario_tests/test_slash_command.py | 18 ++- tests/scenario_tests/test_ssl_check.py | 8 +- tests/scenario_tests/test_view_closed.py | 53 +++++-- tests/scenario_tests/test_view_submission.py | 48 +++++-- tests/scenario_tests/test_workflow_steps.py | 34 ++++- tests/scenario_tests_async/test_app.py | 9 +- .../scenario_tests_async/test_app_bot_only.py | 8 +- .../test_attachment_actions.py | 57 ++++++-- tests/scenario_tests_async/test_authorize.py | 14 +- .../test_block_actions.py | 43 ++++-- .../test_block_suggestion.py | 38 ++++-- tests/scenario_tests_async/test_dialogs.py | 73 ++++++++-- .../test_error_handler.py | 26 +++- tests/scenario_tests_async/test_events.py | 43 ++++-- .../test_events_org_apps.py | 3 +- .../test_events_shared_channels.py | 6 +- .../test_events_socket_mode.py | 10 +- tests/scenario_tests_async/test_lazy.py | 24 +++- tests/scenario_tests_async/test_message.py | 38 ++++-- tests/scenario_tests_async/test_middleware.py | 18 ++- tests/scenario_tests_async/test_shortcut.py | 43 ++++-- .../test_slash_command.py | 18 ++- tests/scenario_tests_async/test_ssl_check.py | 8 +- .../scenario_tests_async/test_view_closed.py | 53 +++++-- .../test_view_submission.py | 48 +++++-- .../test_workflow_steps.py | 39 ++++-- tests/slack_bolt/app/test_dev_server.py | 5 +- tests/slack_bolt/context/test_ack.py | 10 +- .../test_custom_listener_matcher.py | 3 +- .../test_request_verification.py | 3 +- tests/slack_bolt_async/app/test_server.py | 5 +- .../authorization/test_async_authorize.py | 4 +- .../context/test_async_ack.py | 10 +- .../test_async_custom_listener_matcher.py | 3 +- .../test_request_verification.py | 3 +- .../oauth/test_async_oauth_flow.py | 3 +- .../oauth/test_async_oauth_flow_sqlite3.py | 5 +- 155 files changed, 2058 insertions(+), 650 deletions(-) diff --git a/examples/app_authorize.py b/examples/app_authorize.py index 0b81e9b66..3f4ab5b01 100644 --- a/examples/app_authorize.py +++ b/examples/app_authorize.py @@ -7,6 +7,7 @@ # ------------------------------------------------ import logging + logging.basicConfig(level=logging.DEBUG) import os @@ -14,6 +15,7 @@ from slack_bolt.authorization import AuthorizeResult from slack_sdk import WebClient + def authorize(enterprise_id, team_id, user_id, client: WebClient, logger): logger.info(f"{enterprise_id},{team_id},{user_id}") # You can implement your own logic here @@ -23,10 +25,9 @@ def authorize(enterprise_id, team_id, user_id, client: WebClient, logger): bot_token=token, ) -app = App( - signing_secret=os.environ["SLACK_SIGNING_SECRET"], - authorize=authorize -) + +app = App(signing_secret=os.environ["SLACK_SIGNING_SECRET"], authorize=authorize) + @app.command("/hello-bolt-python") def hello_command(ack, body): diff --git a/examples/async_app_authorize.py b/examples/async_app_authorize.py index aee349331..cb62fe925 100644 --- a/examples/async_app_authorize.py +++ b/examples/async_app_authorize.py @@ -14,6 +14,7 @@ from slack_bolt.authorization import AuthorizeResult from slack_bolt.async_app import AsyncApp + async def authorize(enterprise_id, team_id, user_id, client: AsyncWebClient, logger): logger.info(f"{enterprise_id},{team_id},{user_id}") # You can implement your own logic here @@ -24,10 +25,8 @@ async def authorize(enterprise_id, team_id, user_id, client: AsyncWebClient, log ) -app = AsyncApp( - signing_secret=os.environ["SLACK_SIGNING_SECRET"], - authorize=authorize -) +app = AsyncApp(signing_secret=os.environ["SLACK_SIGNING_SECRET"], authorize=authorize) + @app.event("app_mention") async def event_test(body, say, logger): diff --git a/examples/async_steps_from_apps.py b/examples/async_steps_from_apps.py index e38e352bb..061012eb0 100644 --- a/examples/async_steps_from_apps.py +++ b/examples/async_steps_from_apps.py @@ -9,7 +9,12 @@ from slack_sdk.web.async_client import AsyncSlackResponse, AsyncWebClient from slack_bolt.async_app import AsyncApp, AsyncAck -from slack_bolt.workflows.step.async_step import AsyncConfigure, AsyncUpdate, AsyncComplete, AsyncFail +from slack_bolt.workflows.step.async_step import ( + AsyncConfigure, + AsyncUpdate, + AsyncComplete, + AsyncFail, +) logging.basicConfig(level=logging.DEBUG) @@ -93,7 +98,11 @@ async def save(ack: AsyncAck, view: dict, update: AsyncUpdate): }, }, outputs=[ - {"name": "taskName", "type": "text", "label": "Task Name", }, + { + "name": "taskName", + "type": "text", + "label": "Task Name", + }, { "name": "taskDescription", "type": "text", @@ -104,7 +113,7 @@ async def save(ack: AsyncAck, view: dict, update: AsyncUpdate): "type": "text", "label": "Task Author Email", }, - ] + ], ) await ack() @@ -112,7 +121,9 @@ async def save(ack: AsyncAck, view: dict, update: AsyncUpdate): pseudo_database = {} -async def execute(step: dict, client: AsyncWebClient, complete: AsyncComplete, fail: AsyncFail): +async def execute( + step: dict, client: AsyncWebClient, complete: AsyncComplete, fail: AsyncFail +): try: await complete( outputs={ @@ -152,9 +163,7 @@ async def execute(step: dict, client: AsyncWebClient, complete: AsyncComplete, f }, ) except: - await fail(error={ - "message": "Something wrong!" - }) + await fail(error={"message": "Something wrong!"}) app.step( diff --git a/examples/async_steps_from_apps_primitive.py b/examples/async_steps_from_apps_primitive.py index 3c65addf0..905fc38a8 100644 --- a/examples/async_steps_from_apps_primitive.py +++ b/examples/async_steps_from_apps_primitive.py @@ -102,7 +102,11 @@ async def save(ack: AsyncAck, client: AsyncWebClient, body: dict): }, }, "outputs": [ - {"name": "taskName", "type": "text", "label": "Task Name",}, + { + "name": "taskName", + "type": "text", + "label": "Task Name", + }, { "name": "taskDescription", "type": "text", diff --git a/examples/aws_chalice/app.py b/examples/aws_chalice/app.py index 59facf400..248f58a01 100644 --- a/examples/aws_chalice/app.py +++ b/examples/aws_chalice/app.py @@ -19,13 +19,14 @@ def handle_app_mentions(body, say, logger): def respond_to_slack_within_3_seconds(ack): ack("Accepted!") + def say_it(say): time.sleep(5) say("Done!") + bolt_app.command("/hello-bolt-python-chalice")( - ack=respond_to_slack_within_3_seconds, - lazy=[say_it] + ack=respond_to_slack_within_3_seconds, lazy=[say_it] ) ChaliceSlackRequestHandler.clear_all_log_handlers() diff --git a/examples/aws_lambda/aws_lambda_oauth.py b/examples/aws_lambda/aws_lambda_oauth.py index f7210dc85..348da4b2e 100644 --- a/examples/aws_lambda/aws_lambda_oauth.py +++ b/examples/aws_lambda/aws_lambda_oauth.py @@ -12,7 +12,10 @@ from slack_bolt.adapter.aws_lambda.lambda_s3_oauth_flow import LambdaS3OAuthFlow # process_before_response must be True when running on FaaS -app = App(process_before_response=True, oauth_flow=LambdaS3OAuthFlow(),) +app = App( + process_before_response=True, + oauth_flow=LambdaS3OAuthFlow(), +) @app.event("app_mention") diff --git a/examples/dialogs_app.py b/examples/dialogs_app.py index 46265afbc..e2f23e3ed 100644 --- a/examples/dialogs_app.py +++ b/examples/dialogs_app.py @@ -64,7 +64,7 @@ def dialog_submission_or_cancellation(ack: Ack, body: dict): errors = [ { "name": "loc_origin", - "error": "Pickup Location must be longer than 3 characters" + "error": "Pickup Location must be longer than 3 characters", } ] if len(errors) > 0: @@ -116,7 +116,6 @@ def dialog_suggestion(ack): ) - if __name__ == "__main__": app.start(3000) diff --git a/examples/django/slackapp/migrations/0001_initial.py b/examples/django/slackapp/migrations/0001_initial.py index 5d256685d..a2bcb49ef 100644 --- a/examples/django/slackapp/migrations/0001_initial.py +++ b/examples/django/slackapp/migrations/0001_initial.py @@ -7,69 +7,104 @@ class Migration(migrations.Migration): initial = True - dependencies = [ - ] + dependencies = [] operations = [ migrations.CreateModel( - name='SlackBot', + name="SlackBot", fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('client_id', models.TextField()), - ('app_id', models.TextField()), - ('enterprise_id', models.TextField(null=True)), - ('enterprise_name', models.TextField(null=True)), - ('team_id', models.TextField(null=True)), - ('team_name', models.TextField(null=True)), - ('bot_token', models.TextField(null=True)), - ('bot_id', models.TextField(null=True)), - ('bot_user_id', models.TextField(null=True)), - ('bot_scopes', models.TextField(null=True)), - ('is_enterprise_install', models.BooleanField(null=True)), - ('installed_at', models.DateTimeField()), + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("client_id", models.TextField()), + ("app_id", models.TextField()), + ("enterprise_id", models.TextField(null=True)), + ("enterprise_name", models.TextField(null=True)), + ("team_id", models.TextField(null=True)), + ("team_name", models.TextField(null=True)), + ("bot_token", models.TextField(null=True)), + ("bot_id", models.TextField(null=True)), + ("bot_user_id", models.TextField(null=True)), + ("bot_scopes", models.TextField(null=True)), + ("is_enterprise_install", models.BooleanField(null=True)), + ("installed_at", models.DateTimeField()), ], ), migrations.CreateModel( - name='SlackInstallation', + name="SlackInstallation", fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('client_id', models.TextField()), - ('app_id', models.TextField()), - ('enterprise_id', models.TextField(null=True)), - ('enterprise_name', models.TextField(null=True)), - ('enterprise_url', models.TextField(null=True)), - ('team_id', models.TextField(null=True)), - ('team_name', models.TextField(null=True)), - ('bot_token', models.TextField(null=True)), - ('bot_id', models.TextField(null=True)), - ('bot_user_id', models.TextField(null=True)), - ('bot_scopes', models.TextField(null=True)), - ('user_id', models.TextField()), - ('user_token', models.TextField(null=True)), - ('user_scopes', models.TextField(null=True)), - ('incoming_webhook_url', models.TextField(null=True)), - ('incoming_webhook_channel', models.TextField(null=True)), - ('incoming_webhook_channel_id', models.TextField(null=True)), - ('incoming_webhook_configuration_url', models.TextField(null=True)), - ('is_enterprise_install', models.BooleanField(null=True)), - ('token_type', models.TextField(null=True)), - ('installed_at', models.DateTimeField()), + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("client_id", models.TextField()), + ("app_id", models.TextField()), + ("enterprise_id", models.TextField(null=True)), + ("enterprise_name", models.TextField(null=True)), + ("enterprise_url", models.TextField(null=True)), + ("team_id", models.TextField(null=True)), + ("team_name", models.TextField(null=True)), + ("bot_token", models.TextField(null=True)), + ("bot_id", models.TextField(null=True)), + ("bot_user_id", models.TextField(null=True)), + ("bot_scopes", models.TextField(null=True)), + ("user_id", models.TextField()), + ("user_token", models.TextField(null=True)), + ("user_scopes", models.TextField(null=True)), + ("incoming_webhook_url", models.TextField(null=True)), + ("incoming_webhook_channel", models.TextField(null=True)), + ("incoming_webhook_channel_id", models.TextField(null=True)), + ("incoming_webhook_configuration_url", models.TextField(null=True)), + ("is_enterprise_install", models.BooleanField(null=True)), + ("token_type", models.TextField(null=True)), + ("installed_at", models.DateTimeField()), ], ), migrations.CreateModel( - name='SlackOAuthState', + name="SlackOAuthState", fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('state', models.TextField()), - ('expire_at', models.DateTimeField()), + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("state", models.TextField()), + ("expire_at", models.DateTimeField()), ], ), migrations.AddIndex( - model_name='slackinstallation', - index=models.Index(fields=['client_id', 'enterprise_id', 'team_id', 'user_id', 'installed_at'], name='bolt_slacki_client__62c411_idx'), + model_name="slackinstallation", + index=models.Index( + fields=[ + "client_id", + "enterprise_id", + "team_id", + "user_id", + "installed_at", + ], + name="bolt_slacki_client__62c411_idx", + ), ), migrations.AddIndex( - model_name='slackbot', - index=models.Index(fields=['client_id', 'enterprise_id', 'team_id', 'installed_at'], name='bolt_slackb_client__be066b_idx'), + model_name="slackbot", + index=models.Index( + fields=["client_id", "enterprise_id", "team_id", "installed_at"], + name="bolt_slackb_client__be066b_idx", + ), ), ] diff --git a/examples/django/slackapp/models.py b/examples/django/slackapp/models.py index 6069ce345..737c4bd90 100644 --- a/examples/django/slackapp/models.py +++ b/examples/django/slackapp/models.py @@ -4,6 +4,7 @@ from django.db import models + class SlackBot(models.Model): client_id = models.TextField(null=False) app_id = models.TextField(null=False) @@ -86,7 +87,9 @@ class DjangoInstallationStore(InstallationStore): client_id: str def __init__( - self, client_id: str, logger: Logger, + self, + client_id: str, + logger: Logger, ): self.client_id = client_id self._logger = logger @@ -104,8 +107,11 @@ def save(self, installation: Installation): SlackBot(**b).save() def find_bot( - self, *, enterprise_id: Optional[str], team_id: Optional[str], - is_enterprise_install: Optional[bool] = False + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + is_enterprise_install: Optional[bool] = False, ) -> Optional[Bot]: e_id = enterprise_id or None t_id = team_id or None @@ -143,13 +149,18 @@ def find_installation( if is_enterprise_install: t_id = None if user_id is None: - rows = (SlackInstallation.objects.filter( - enterprise_id=e_id).filter(team_id=t_id).order_by( - F("installed_at").desc())[:1]) + rows = ( + SlackInstallation.objects.filter(enterprise_id=e_id) + .filter(team_id=t_id) + .order_by(F("installed_at").desc())[:1] + ) else: - rows = (SlackInstallation.objects.filter( - enterprise_id=e_id).filter(team_id=t_id).filter( - user_id=user_id).order_by(F("installed_at").desc())[:1]) + rows = ( + SlackInstallation.objects.filter(enterprise_id=e_id) + .filter(team_id=t_id) + .filter(user_id=user_id) + .order_by(F("installed_at").desc())[:1] + ) if len(rows) > 0: i = rows[0] @@ -176,7 +187,9 @@ class DjangoOAuthStateStore(OAuthStateStore): expiration_seconds: int def __init__( - self, expiration_seconds: int, logger: Logger, + self, + expiration_seconds: int, + logger: Logger, ): self.expiration_seconds = expiration_seconds self._logger = logger @@ -202,6 +215,7 @@ def consume(self, state: str) -> bool: return True return False + # ---------------------- # Slack App # ---------------------- @@ -220,11 +234,17 @@ def consume(self, state: str) -> bool: app = App( signing_secret=signing_secret, - installation_store=DjangoInstallationStore(client_id=client_id, logger=logger,), + installation_store=DjangoInstallationStore( + client_id=client_id, + logger=logger, + ), oauth_settings=OAuthSettings( client_id=client_id, client_secret=client_secret, - state_store=DjangoOAuthStateStore(expiration_seconds=120, logger=logger,), + state_store=DjangoOAuthStateStore( + expiration_seconds=120, + logger=logger, + ), ), ) @@ -234,6 +254,7 @@ def event_test(body, say, logger): logger.info(body) say("What's up?") + @app.command("/hello-bolt-python") def command(ack): - ack("This is a Django app!") \ No newline at end of file + ack("This is a Django app!") diff --git a/examples/django/slackapp/settings.py b/examples/django/slackapp/settings.py index 13252519b..1553e7df3 100644 --- a/examples/django/slackapp/settings.py +++ b/examples/django/slackapp/settings.py @@ -15,16 +15,29 @@ LOGGING = { "version": 1, "disable_existing_loggers": False, - "handlers": {"console": {"class": "logging.StreamHandler",},}, - "root": {"handlers": ["console"], "level": "INFO",}, + "handlers": { + "console": { + "class": "logging.StreamHandler", + }, + }, + "root": { + "handlers": ["console"], + "level": "INFO", + }, "loggers": { "django": { "handlers": ["console"], "level": os.getenv("DJANGO_LOG_LEVEL", "INFO"), "propagate": False, }, - "django.db.backends": {"level": "DEBUG",}, - "slack_bolt": {"handlers": ["console"], "level": "DEBUG", "propagate": False,}, + "django.db.backends": { + "level": "DEBUG", + }, + "slack_bolt": { + "handlers": ["console"], + "level": "DEBUG", + "propagate": False, + }, }, } @@ -105,9 +118,15 @@ { "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", }, - {"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",}, - {"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",}, - {"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",}, + { + "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", + }, + { + "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", + }, + { + "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", + }, ] # Internationalization diff --git a/examples/falcon/app.py b/examples/falcon/app.py index 40e32e93d..1dbf39ffb 100644 --- a/examples/falcon/app.py +++ b/examples/falcon/app.py @@ -52,14 +52,26 @@ def test_shortcut(ack, client: WebClient, logger, body): view={ "type": "modal", "callback_id": "view-id", - "title": {"type": "plain_text", "text": "My App",}, - "submit": {"type": "plain_text", "text": "Submit",}, - "close": {"type": "plain_text", "text": "Cancel",}, + "title": { + "type": "plain_text", + "text": "My App", + }, + "submit": { + "type": "plain_text", + "text": "Submit", + }, + "close": { + "type": "plain_text", + "text": "Cancel", + }, "blocks": [ { "type": "input", "element": {"type": "plain_text_input"}, - "label": {"type": "plain_text", "text": "Label",}, + "label": { + "type": "plain_text", + "text": "Label", + }, } ], }, diff --git a/examples/falcon/oauth_app.py b/examples/falcon/oauth_app.py index 167003a9c..900ffca99 100644 --- a/examples/falcon/oauth_app.py +++ b/examples/falcon/oauth_app.py @@ -52,14 +52,26 @@ def test_shortcut(ack, client: WebClient, logger, body): view={ "type": "modal", "callback_id": "view-id", - "title": {"type": "plain_text", "text": "My App",}, - "submit": {"type": "plain_text", "text": "Submit",}, - "close": {"type": "plain_text", "text": "Cancel",}, + "title": { + "type": "plain_text", + "text": "My App", + }, + "submit": { + "type": "plain_text", + "text": "Submit", + }, + "close": { + "type": "plain_text", + "text": "Cancel", + }, "blocks": [ { "type": "input", "element": {"type": "plain_text_input"}, - "label": {"type": "plain_text", "text": "Label",}, + "label": { + "type": "plain_text", + "text": "Label", + }, } ], }, diff --git a/examples/fastapi/async_oauth_app.py b/examples/fastapi/async_oauth_app.py index 8ba33668a..a19ba402c 100644 --- a/examples/fastapi/async_oauth_app.py +++ b/examples/fastapi/async_oauth_app.py @@ -6,6 +6,7 @@ # ------------------------------------------------ import logging + logging.basicConfig(level=logging.DEBUG) from slack_bolt.async_app import AsyncApp diff --git a/examples/getting_started/app.py b/examples/getting_started/app.py index 23fd2f96d..e394dd2fa 100644 --- a/examples/getting_started/app.py +++ b/examples/getting_started/app.py @@ -4,7 +4,7 @@ # Initializes your app with your bot token and signing secret app = App( token=os.environ.get("SLACK_BOT_TOKEN"), - signing_secret=os.environ.get("SLACK_SIGNING_SECRET") + signing_secret=os.environ.get("SLACK_SIGNING_SECRET"), ) # Listens to incoming messages that contain "hello" @@ -15,29 +15,25 @@ def message_hello(message, say): blocks=[ { "type": "section", - "text": { - "type": "mrkdwn", - "text": f"Hey there <@{message['user']}>!" - }, + "text": {"type": "mrkdwn", "text": f"Hey there <@{message['user']}>!"}, "accessory": { "type": "button", - "text": { - "type": "plain_text", - "text": "Click Me" - }, - "action_id": "button_click" - } + "text": {"type": "plain_text", "text": "Click Me"}, + "action_id": "button_click", + }, } ], - text=f"Hey there <@{message['user']}>!" + text=f"Hey there <@{message['user']}>!", ) + @app.action("button_click") def action_button_click(body, ack, say): # Acknowledge the action ack() say(f"<@{body['user']['id']}> clicked the button") + # Start your app if __name__ == "__main__": - app.start(port=int(os.environ.get("PORT", 3000))) \ No newline at end of file + app.start(port=int(os.environ.get("PORT", 3000))) diff --git a/examples/lazy_async_modals_app.py b/examples/lazy_async_modals_app.py index a566cdf56..7f25d5a73 100644 --- a/examples/lazy_async_modals_app.py +++ b/examples/lazy_async_modals_app.py @@ -52,14 +52,26 @@ async def open_modal(body, client, logger): view={ "type": "modal", "callback_id": "view-id", - "title": {"type": "plain_text", "text": "My App",}, - "submit": {"type": "plain_text", "text": "Submit",}, - "close": {"type": "plain_text", "text": "Cancel",}, + "title": { + "type": "plain_text", + "text": "My App", + }, + "submit": { + "type": "plain_text", + "text": "Submit", + }, + "close": { + "type": "plain_text", + "text": "Cancel", + }, "blocks": [ { "type": "input", "element": {"type": "plain_text_input"}, - "label": {"type": "plain_text", "text": "Label",}, + "label": { + "type": "plain_text", + "text": "Label", + }, }, { "type": "input", @@ -90,7 +102,8 @@ async def open_modal(body, client, logger): app.command("/hello-bolt-python")( - ack=ack_command, lazy=[post_button_message, open_modal], + ack=ack_command, + lazy=[post_button_message, open_modal], ) diff --git a/examples/lazy_modals_app.py b/examples/lazy_modals_app.py index 4de8c7778..9b668a859 100644 --- a/examples/lazy_modals_app.py +++ b/examples/lazy_modals_app.py @@ -53,14 +53,26 @@ def open_modal(body, client, logger): view={ "type": "modal", "callback_id": "view-id", - "title": {"type": "plain_text", "text": "My App",}, - "submit": {"type": "plain_text", "text": "Submit",}, - "close": {"type": "plain_text", "text": "Cancel",}, + "title": { + "type": "plain_text", + "text": "My App", + }, + "submit": { + "type": "plain_text", + "text": "Submit", + }, + "close": { + "type": "plain_text", + "text": "Cancel", + }, "blocks": [ { "type": "input", "element": {"type": "plain_text_input"}, - "label": {"type": "plain_text", "text": "Label",}, + "label": { + "type": "plain_text", + "text": "Label", + }, }, { "type": "input", @@ -91,7 +103,8 @@ def open_modal(body, client, logger): app.command("/hello-bolt-python")( - ack=ack_command, lazy=[post_button_message, open_modal], + ack=ack_command, + lazy=[post_button_message, open_modal], ) diff --git a/examples/message_events.py b/examples/message_events.py index e732fd3f6..e0693f7b6 100644 --- a/examples/message_events.py +++ b/examples/message_events.py @@ -75,7 +75,9 @@ def add_reaction( logger.info(f"subtype: {subtype}") message_ts = body["event"]["ts"] api_response = client.reactions_add( - channel=context.channel_id, timestamp=message_ts, name="eyes", + channel=context.channel_id, + timestamp=message_ts, + name="eyes", ) logger.info(f"api_response: {api_response}") diff --git a/examples/modals_app.py b/examples/modals_app.py index 7859028ff..f0da8d9f8 100644 --- a/examples/modals_app.py +++ b/examples/modals_app.py @@ -29,7 +29,10 @@ def handle_command(body, ack, respond, client, logger): { "type": "section", "block_id": "b", - "text": {"type": "mrkdwn", "text": ":white_check_mark: Accepted!",}, + "text": { + "type": "mrkdwn", + "text": ":white_check_mark: Accepted!", + }, } ], ) @@ -58,14 +61,26 @@ def handle_command(body, ack, respond, client, logger): view={ "type": "modal", "callback_id": "view-id", - "title": {"type": "plain_text", "text": "My App",}, - "submit": {"type": "plain_text", "text": "Submit",}, - "close": {"type": "plain_text", "text": "Cancel",}, + "title": { + "type": "plain_text", + "text": "My App", + }, + "submit": { + "type": "plain_text", + "text": "Submit", + }, + "close": { + "type": "plain_text", + "text": "Cancel", + }, "blocks": [ { "type": "input", "element": {"type": "plain_text_input"}, - "label": {"type": "plain_text", "text": "Label",}, + "label": { + "type": "plain_text", + "text": "Label", + }, }, { "type": "input", @@ -155,7 +170,8 @@ def button_click(ack, body, respond): ) # ephemeral / kwargs respond( - replace_original=False, text=":white_check_mark: Done!", + replace_original=False, + text=":white_check_mark: Done!", ) diff --git a/examples/modals_app_typed.py b/examples/modals_app_typed.py index 62821bb23..ffad223cf 100644 --- a/examples/modals_app_typed.py +++ b/examples/modals_app_typed.py @@ -123,7 +123,9 @@ def show_multi_options(ack: Ack) -> None: ), OptionGroup( label=PlainTextObject(text="Group 2"), - options=[Option(text=PlainTextObject(text="Option 1"), value="2-1"),], + options=[ + Option(text=PlainTextObject(text="Option 1"), value="2-1"), + ], ), ] ) @@ -148,7 +150,8 @@ def button_click(ack: Ack, body: dict, respond: Respond) -> None: ) # ephemeral / kwargs respond( - replace_original=False, text=":white_check_mark: Done!", + replace_original=False, + text=":white_check_mark: Done!", ) diff --git a/examples/oauth_app.py b/examples/oauth_app.py index 596b52fad..26b772a77 100644 --- a/examples/oauth_app.py +++ b/examples/oauth_app.py @@ -48,14 +48,26 @@ def test_command(body, respond, client, ack, logger): view={ "type": "modal", "callback_id": "view-id", - "title": {"type": "plain_text", "text": "My App",}, - "submit": {"type": "plain_text", "text": "Submit",}, - "close": {"type": "plain_text", "text": "Cancel",}, + "title": { + "type": "plain_text", + "text": "My App", + }, + "submit": { + "type": "plain_text", + "text": "Submit", + }, + "close": { + "type": "plain_text", + "text": "Cancel", + }, "blocks": [ { "type": "input", "element": {"type": "plain_text_input"}, - "label": {"type": "plain_text", "text": "Label",}, + "label": { + "type": "plain_text", + "text": "Label", + }, } ], }, diff --git a/examples/oauth_app_settings.py b/examples/oauth_app_settings.py index 4975de519..977ec0e49 100644 --- a/examples/oauth_app_settings.py +++ b/examples/oauth_app_settings.py @@ -74,14 +74,26 @@ def test_command(body, respond, client, ack, logger): view={ "type": "modal", "callback_id": "view-id", - "title": {"type": "plain_text", "text": "My App",}, - "submit": {"type": "plain_text", "text": "Submit",}, - "close": {"type": "plain_text", "text": "Cancel",}, + "title": { + "type": "plain_text", + "text": "My App", + }, + "submit": { + "type": "plain_text", + "text": "Submit", + }, + "close": { + "type": "plain_text", + "text": "Cancel", + }, "blocks": [ { "type": "input", "element": {"type": "plain_text_input"}, - "label": {"type": "plain_text", "text": "Label",}, + "label": { + "type": "plain_text", + "text": "Label", + }, } ], }, diff --git a/examples/readme_app.py b/examples/readme_app.py index 6cdbd8ec1..963938658 100644 --- a/examples/readme_app.py +++ b/examples/readme_app.py @@ -34,14 +34,23 @@ def open_modal(ack, client, logger, body): view={ "type": "modal", "callback_id": "view-id", - "title": {"type": "plain_text", "text": "My App",}, - "submit": {"type": "plain_text", "text": "Submit",}, + "title": { + "type": "plain_text", + "text": "My App", + }, + "submit": { + "type": "plain_text", + "text": "Submit", + }, "blocks": [ { "type": "input", "block_id": "b", "element": {"type": "plain_text_input", "action_id": "a"}, - "label": {"type": "plain_text", "text": "Label",}, + "label": { + "type": "plain_text", + "text": "Label", + }, } ], }, diff --git a/examples/readme_async_app.py b/examples/readme_async_app.py index 092dca64b..c43d3af32 100644 --- a/examples/readme_async_app.py +++ b/examples/readme_async_app.py @@ -14,11 +14,13 @@ app = AsyncApp() + @app.command("/hello-bolt-python") async def command(ack, body, respond): await ack() await respond(f"Hi <@{body['user_id']}>!") + # Middleware @app.middleware # or app.use(log_request) async def log_request(logger, body, next): @@ -44,14 +46,23 @@ async def open_modal(ack, client, logger, body): view={ "type": "modal", "callback_id": "view-id", - "title": {"type": "plain_text", "text": "My App",}, - "submit": {"type": "plain_text", "text": "Submit",}, + "title": { + "type": "plain_text", + "text": "My App", + }, + "submit": { + "type": "plain_text", + "text": "Submit", + }, "blocks": [ { "type": "input", "block_id": "b", "element": {"type": "plain_text_input", "action_id": "a"}, - "label": {"type": "plain_text", "text": "Label",}, + "label": { + "type": "plain_text", + "text": "Label", + }, } ], }, diff --git a/examples/sqlalchemy/async_oauth_app.py b/examples/sqlalchemy/async_oauth_app.py index 4aca131de..605e1fb1b 100644 --- a/examples/sqlalchemy/async_oauth_app.py +++ b/examples/sqlalchemy/async_oauth_app.py @@ -157,10 +157,14 @@ async def async_consume(self, state: str) -> bool: ) installation_store = AsyncSQLAlchemyInstallationStore( - client_id=client_id, database_url=database_url, logger=logger, + client_id=client_id, + database_url=database_url, + logger=logger, ) oauth_state_store = AsyncSQLAlchemyOAuthStateStore( - expiration_seconds=120, database_url=database_url, logger=logger, + expiration_seconds=120, + database_url=database_url, + logger=logger, ) app = AsyncApp( @@ -168,7 +172,9 @@ async def async_consume(self, state: str) -> bool: signing_secret=signing_secret, installation_store=installation_store, oauth_settings=AsyncOAuthSettings( - client_id=client_id, client_secret=client_secret, state_store=oauth_state_store, + client_id=client_id, + client_secret=client_secret, + state_store=oauth_state_store, ), ) app_handler = AsyncSlackRequestHandler(app) diff --git a/examples/sqlalchemy/oauth_app.py b/examples/sqlalchemy/oauth_app.py index 40e1309ec..4ad7f8ff3 100644 --- a/examples/sqlalchemy/oauth_app.py +++ b/examples/sqlalchemy/oauth_app.py @@ -25,10 +25,14 @@ engine: Engine = sqlalchemy.create_engine(database_url) installation_store = SQLAlchemyInstallationStore( - client_id=client_id, engine=engine, logger=logger, + client_id=client_id, + engine=engine, + logger=logger, ) oauth_state_store = SQLAlchemyOAuthStateStore( - expiration_seconds=120, engine=engine, logger=logger, + expiration_seconds=120, + engine=engine, + logger=logger, ) try: diff --git a/examples/steps_from_apps.py b/examples/steps_from_apps.py index ab3921062..26cc9665a 100644 --- a/examples/steps_from_apps.py +++ b/examples/steps_from_apps.py @@ -101,7 +101,11 @@ def save(ack: Ack, view: dict, update: Update): }, }, outputs=[ - {"name": "taskName", "type": "text", "label": "Task Name", }, + { + "name": "taskName", + "type": "text", + "label": "Task Name", + }, { "name": "taskDescription", "type": "text", @@ -112,7 +116,7 @@ def save(ack: Ack, view: dict, update: Update): "type": "text", "label": "Task Author Email", }, - ] + ], ) ack() @@ -161,9 +165,7 @@ def execute(step: dict, client: WebClient, complete: Complete, fail: Fail): }, ) except Exception as err: - fail(error={ - "message": "Something wrong!" - }) + fail(error={"message": "Something wrong!"}) app.step( diff --git a/examples/steps_from_apps_primitive.py b/examples/steps_from_apps_primitive.py index 9f8889cbc..efd206eda 100644 --- a/examples/steps_from_apps_primitive.py +++ b/examples/steps_from_apps_primitive.py @@ -104,7 +104,11 @@ def save(ack: Ack, client: WebClient, body: dict): }, }, "outputs": [ - {"name": "taskName", "type": "text", "label": "Task Name",}, + { + "name": "taskName", + "type": "text", + "label": "Task Name", + }, { "name": "taskDescription", "type": "text", diff --git a/slack_bolt/adapter/aiohttp/__init__.py b/slack_bolt/adapter/aiohttp/__init__.py index 6d4cb9715..02d6a1673 100644 --- a/slack_bolt/adapter/aiohttp/__init__.py +++ b/slack_bolt/adapter/aiohttp/__init__.py @@ -8,7 +8,9 @@ async def to_bolt_request(request: web.Request) -> AsyncBoltRequest: return AsyncBoltRequest( - body=await request.text(), query=request.query_string, headers=request.headers, + body=await request.text(), + query=request.query_string, + headers=request.headers, ) diff --git a/slack_bolt/adapter/aws_lambda/chalice_handler.py b/slack_bolt/adapter/aws_lambda/chalice_handler.py index 48d64ab3a..8d5fc9b21 100644 --- a/slack_bolt/adapter/aws_lambda/chalice_handler.py +++ b/slack_bolt/adapter/aws_lambda/chalice_handler.py @@ -76,14 +76,24 @@ def handle(self, request: Request): def to_bolt_request(request: Request, body: str) -> BoltRequest: - return BoltRequest(body=body, query=request.query_params, headers=request.headers,) + return BoltRequest( + body=body, + query=request.query_params, + headers=request.headers, + ) def to_chalice_response(resp: BoltResponse) -> Response: return Response( - status_code=resp.status, body=resp.body, headers=resp.first_headers(), + status_code=resp.status, + body=resp.body, + headers=resp.first_headers(), ) def not_found() -> Response: - return Response(status_code=404, body="Not Found", headers={},) + return Response( + status_code=404, + body="Not Found", + headers={}, + ) diff --git a/slack_bolt/adapter/aws_lambda/handler.py b/slack_bolt/adapter/aws_lambda/handler.py index 885115cb3..fef64094c 100644 --- a/slack_bolt/adapter/aws_lambda/handler.py +++ b/slack_bolt/adapter/aws_lambda/handler.py @@ -82,7 +82,9 @@ def to_bolt_request(event) -> BoltRequest: headers = event.get("headers", {}) headers["cookie"] = cookies return BoltRequest( - body=body, query=event.get("queryStringParameters", {}), headers=headers, + body=body, + query=event.get("queryStringParameters", {}), + headers=headers, ) diff --git a/slack_bolt/adapter/bottle/handler.py b/slack_bolt/adapter/bottle/handler.py index 4b4d9aef0..d00976c32 100644 --- a/slack_bolt/adapter/bottle/handler.py +++ b/slack_bolt/adapter/bottle/handler.py @@ -10,7 +10,11 @@ def to_bolt_request(req: Request) -> BoltRequest: body = req.body.read() if isinstance(body, bytes): body = body.decode("utf-8") - return BoltRequest(body=body, query=req.query_string, headers=req.headers,) + return BoltRequest( + body=body, + query=req.query_string, + headers=req.headers, + ) def set_response(bolt_resp: BoltResponse, resp: Response) -> None: diff --git a/slack_bolt/adapter/cherrypy/handler.py b/slack_bolt/adapter/cherrypy/handler.py index bd8dd0dc3..aa228f3f8 100644 --- a/slack_bolt/adapter/cherrypy/handler.py +++ b/slack_bolt/adapter/cherrypy/handler.py @@ -11,7 +11,11 @@ def build_bolt_request() -> BoltRequest: req = cherrypy.request body = req.raw_body if hasattr(req, "raw_body") else "" - return BoltRequest(body=body, query=req.query_string, headers=req.headers,) + return BoltRequest( + body=body, + query=req.query_string, + headers=req.headers, + ) def set_response_status_and_headers(bolt_resp: BoltResponse) -> None: diff --git a/slack_bolt/adapter/django/handler.py b/slack_bolt/adapter/django/handler.py index 1749b67de..24eb91b0e 100644 --- a/slack_bolt/adapter/django/handler.py +++ b/slack_bolt/adapter/django/handler.py @@ -11,12 +11,17 @@ def to_bolt_request(req: HttpRequest) -> BoltRequest: raw_body: bytes = req.body body: str = raw_body.decode("utf-8") if raw_body else "" - return BoltRequest(body=body, query=req.META["QUERY_STRING"], headers=req.headers,) + return BoltRequest( + body=body, + query=req.META["QUERY_STRING"], + headers=req.headers, + ) def to_django_response(bolt_resp: BoltResponse) -> HttpResponse: resp: HttpResponse = HttpResponse( - status=bolt_resp.status, content=bolt_resp.body.encode("utf-8"), + status=bolt_resp.status, + content=bolt_resp.body.encode("utf-8"), ) for k, v in bolt_resp.first_headers_without_set_cookie().items(): resp[k] = v diff --git a/slack_bolt/adapter/pyramid/handler.py b/slack_bolt/adapter/pyramid/handler.py index 47fe96645..14ba14c2c 100644 --- a/slack_bolt/adapter/pyramid/handler.py +++ b/slack_bolt/adapter/pyramid/handler.py @@ -15,7 +15,9 @@ def to_bolt_request(request: Request) -> BoltRequest: else: body = request.body bolt_req = BoltRequest( - body=body, query=request.query_string, headers=request.headers, + body=body, + query=request.query_string, + headers=request.headers, ) return bolt_req diff --git a/slack_bolt/adapter/sanic/async_handler.py b/slack_bolt/adapter/sanic/async_handler.py index a18af2250..6b3d20c15 100644 --- a/slack_bolt/adapter/sanic/async_handler.py +++ b/slack_bolt/adapter/sanic/async_handler.py @@ -10,7 +10,9 @@ def to_async_bolt_request(req: Request) -> AsyncBoltRequest: return AsyncBoltRequest( - body=req.body.decode("utf-8"), query=req.query_string, headers=req.headers, + body=req.body.decode("utf-8"), + query=req.query_string, + headers=req.headers, ) @@ -58,4 +60,7 @@ async def handle(self, req: Request) -> HTTPResponse: bolt_resp = await self.app.async_dispatch(to_async_bolt_request(req)) return to_sanic_response(bolt_resp) - return HTTPResponse(status=404, body="Not found",) + return HTTPResponse( + status=404, + body="Not found", + ) diff --git a/slack_bolt/adapter/starlette/async_handler.py b/slack_bolt/adapter/starlette/async_handler.py index a4fc0464b..bc38176bf 100644 --- a/slack_bolt/adapter/starlette/async_handler.py +++ b/slack_bolt/adapter/starlette/async_handler.py @@ -8,7 +8,9 @@ def to_async_bolt_request(req: Request, body: bytes) -> AsyncBoltRequest: return AsyncBoltRequest( - body=body.decode("utf-8"), query=req.query_params, headers=req.headers, + body=body.decode("utf-8"), + query=req.query_params, + headers=req.headers, ) @@ -56,4 +58,7 @@ async def handle(self, req: Request) -> Response: bolt_resp = await self.app.async_dispatch(to_async_bolt_request(req, body)) return to_starlette_response(bolt_resp) - return Response(status_code=404, content="Not found",) + return Response( + status_code=404, + content="Not found", + ) diff --git a/slack_bolt/adapter/starlette/handler.py b/slack_bolt/adapter/starlette/handler.py index e5e4f6057..c8cea10d4 100644 --- a/slack_bolt/adapter/starlette/handler.py +++ b/slack_bolt/adapter/starlette/handler.py @@ -7,7 +7,9 @@ def to_bolt_request(req: Request, body: bytes) -> BoltRequest: return BoltRequest( - body=body.decode("utf-8"), query=req.query_params, headers=req.headers, + body=body.decode("utf-8"), + query=req.query_params, + headers=req.headers, ) @@ -53,4 +55,7 @@ async def handle(self, req: Request) -> Response: bolt_resp = self.app.dispatch(to_bolt_request(req, body)) return to_starlette_response(bolt_resp) - return Response(status_code=404, content="Not found",) + return Response( + status_code=404, + content="Not found", + ) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 75593af78..da54e7393 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -224,7 +224,8 @@ def __init__( ), listener_executor=listener_executor, lazy_listener_runner=ThreadLazyListenerRunner( - logger=self._framework_logger, executor=listener_executor, + logger=self._framework_logger, + executor=listener_executor, ), ) @@ -306,7 +307,10 @@ def start(self, port: int = 3000, path: str = "/slack/events") -> None: :return: None """ self._development_server = SlackAppDevelopmentServer( - port=port, path=path, app=self, oauth_flow=self.oauth_flow, + port=port, + path=path, + app=self, + oauth_flow=self.oauth_flow, ) self._development_server.start() @@ -411,7 +415,10 @@ def step( step = callback_id if isinstance(callback_id, (str, Pattern)): step = WorkflowStep( - callback_id=callback_id, edit=edit, save=save, execute=execute, + callback_id=callback_id, + edit=edit, + save=save, + execute=execute, ) elif not isinstance(step, WorkflowStep): raise BoltError("Invalid step object") @@ -431,7 +438,8 @@ def error( :return: None """ self._listener_runner.listener_error_handler = CustomListenerErrorHandler( - logger=self._framework_logger, func=func, + logger=self._framework_logger, + func=func, ) return func @@ -864,7 +872,11 @@ def _register_listener( class SlackAppDevelopmentServer: def __init__( - self, port: int, path: str, app: App, oauth_flow: Optional[OAuthFlow] = None, + self, + port: int, + path: str, + app: App, + oauth_flow: Optional[OAuthFlow] = None, ): """Slack App Development Server diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 8fdc6bca0..d74ea898d 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -331,7 +331,11 @@ def server( or self._server.port != port or self._server.path != path ): - self._server = AsyncSlackAppServer(port=port, path=path, app=self,) + self._server = AsyncSlackAppServer( + port=port, + path=path, + app=self, + ) return self._server def web_app(self, path: str = "/slack/events") -> web.Application: @@ -461,7 +465,10 @@ def step( step = callback_id if isinstance(callback_id, (str, Pattern)): step = AsyncWorkflowStep( - callback_id=callback_id, edit=edit, save=save, execute=execute, + callback_id=callback_id, + edit=edit, + save=save, + execute=execute, ) elif not isinstance(step, AsyncWorkflowStep): raise BoltError("Invalid step object") @@ -480,8 +487,11 @@ def error( when getting an unhandled error in Bolt app. :return: None """ - self._async_listener_runner.listener_error_handler = AsyncCustomListenerErrorHandler( - logger=self._framework_logger, func=func, + self._async_listener_runner.listener_error_handler = ( + AsyncCustomListenerErrorHandler( + logger=self._framework_logger, + func=func, + ) ) return func diff --git a/slack_bolt/app/async_server.py b/slack_bolt/app/async_server.py index 6ae669098..aeb93fb73 100644 --- a/slack_bolt/app/async_server.py +++ b/slack_bolt/app/async_server.py @@ -14,7 +14,10 @@ class AsyncSlackAppServer: web_app: web.Application def __init__( # type:ignore - self, port: int, path: str, app: "AsyncApp", # type:ignore + self, + port: int, + path: str, + app: "AsyncApp", # type:ignore ): """Standalone AIOHTTP Web Server @@ -67,7 +70,7 @@ async def handle_post_requests(self, request: web.Request) -> web.Response: return await to_aiohttp_response(bolt_resp) def start(self) -> None: - """ Starts a new web server process. + """Starts a new web server process. :return: None """ diff --git a/slack_bolt/authorization/async_authorize.py b/slack_bolt/authorization/async_authorize.py index a78700ced..fb723f3cd 100644 --- a/slack_bolt/authorization/async_authorize.py +++ b/slack_bolt/authorization/async_authorize.py @@ -145,11 +145,13 @@ async def __call__( if installation.user_id != user_id: # try to fetch the request user's installation # to reflect the user's access token if exists - user_installation = await self.installation_store.async_find_installation( - enterprise_id=enterprise_id, - team_id=team_id, - user_id=user_id, - is_enterprise_install=context.is_enterprise_install, + user_installation = ( + await self.installation_store.async_find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + user_id=user_id, + is_enterprise_install=context.is_enterprise_install, + ) ) if user_installation is not None: installation = user_installation diff --git a/slack_bolt/authorization/authorize.py b/slack_bolt/authorization/authorize.py index 7e51ab97b..090d5113f 100644 --- a/slack_bolt/authorization/authorize.py +++ b/slack_bolt/authorization/authorize.py @@ -29,7 +29,10 @@ def __call__( class CallableAuthorize(Authorize): def __init__( - self, *, logger: Logger, func: Callable[..., AuthorizeResult], + self, + *, + logger: Logger, + func: Callable[..., AuthorizeResult], ): self.logger = logger self.func = func diff --git a/slack_bolt/context/say/async_say.py b/slack_bolt/context/say/async_say.py index ccbefd4f9..a47838e1b 100644 --- a/slack_bolt/context/say/async_say.py +++ b/slack_bolt/context/say/async_say.py @@ -12,7 +12,9 @@ class AsyncSay: channel: Optional[str] def __init__( - self, client: Optional[AsyncWebClient], channel: Optional[str], + self, + client: Optional[AsyncWebClient], + channel: Optional[str], ): self.client = client self.channel = channel diff --git a/slack_bolt/context/say/say.py b/slack_bolt/context/say/say.py index 9c4181957..ccf7d6d91 100644 --- a/slack_bolt/context/say/say.py +++ b/slack_bolt/context/say/say.py @@ -13,7 +13,9 @@ class Say: channel: Optional[str] def __init__( - self, client: Optional[WebClient], channel: Optional[str], + self, + client: Optional[WebClient], + channel: Optional[str], ): self.client = client self.channel = channel diff --git a/slack_bolt/lazy_listener/async_runner.py b/slack_bolt/lazy_listener/async_runner.py index d640d48ec..da8712da9 100644 --- a/slack_bolt/lazy_listener/async_runner.py +++ b/slack_bolt/lazy_listener/async_runner.py @@ -31,6 +31,8 @@ async def run( :return: None """ func = to_runnable_function( - internal_func=function, logger=self.logger, request=request, + internal_func=function, + logger=self.logger, + request=request, ) return await func() # type: ignore diff --git a/slack_bolt/lazy_listener/asyncio_runner.py b/slack_bolt/lazy_listener/asyncio_runner.py index f9ceb6cf3..072f3ecc6 100644 --- a/slack_bolt/lazy_listener/asyncio_runner.py +++ b/slack_bolt/lazy_listener/asyncio_runner.py @@ -11,7 +11,8 @@ class AsyncioLazyListenerRunner(AsyncLazyListenerRunner): logger: Logger def __init__( - self, logger: Logger, + self, + logger: Logger, ): self.logger = logger @@ -20,6 +21,8 @@ def start( ) -> None: asyncio.ensure_future( to_runnable_function( - internal_func=function, logger=self.logger, request=request, + internal_func=function, + logger=self.logger, + request=request, ) ) diff --git a/slack_bolt/lazy_listener/internals.py b/slack_bolt/lazy_listener/internals.py index ee6659540..f2934ef69 100644 --- a/slack_bolt/lazy_listener/internals.py +++ b/slack_bolt/lazy_listener/internals.py @@ -8,7 +8,9 @@ def build_runnable_function( - func: Callable[..., None], logger: Logger, request: BoltRequest, + func: Callable[..., None], + logger: Logger, + request: BoltRequest, ) -> Callable[[], None]: arg_names = inspect.getfullargspec(func).args diff --git a/slack_bolt/lazy_listener/runner.py b/slack_bolt/lazy_listener/runner.py index 3442693ea..4fc8bb072 100644 --- a/slack_bolt/lazy_listener/runner.py +++ b/slack_bolt/lazy_listener/runner.py @@ -26,4 +26,8 @@ def run(self, function: Callable[..., None], request: BoltRequest) -> None: :param request: The request to pass to the function. The object must be thread-safe. :return: None """ - build_runnable_function(func=function, logger=self.logger, request=request,)() + build_runnable_function( + func=function, + logger=self.logger, + request=request, + )() diff --git a/slack_bolt/lazy_listener/thread_runner.py b/slack_bolt/lazy_listener/thread_runner.py index c6812a46a..d2e7a09a0 100644 --- a/slack_bolt/lazy_listener/thread_runner.py +++ b/slack_bolt/lazy_listener/thread_runner.py @@ -11,12 +11,18 @@ class ThreadLazyListenerRunner(LazyListenerRunner): logger: Logger def __init__( - self, logger: Logger, executor: ThreadPoolExecutor, + self, + logger: Logger, + executor: ThreadPoolExecutor, ): self.logger = logger self.executor = executor def start(self, function: Callable[..., None], request: BoltRequest) -> None: self.executor.submit( - build_runnable_function(func=function, logger=self.logger, request=request,) + build_runnable_function( + func=function, + logger=self.logger, + request=request, + ) ) diff --git a/slack_bolt/listener/async_listener.py b/slack_bolt/listener/async_listener.py index 7222b80a8..21fe7b033 100644 --- a/slack_bolt/listener/async_listener.py +++ b/slack_bolt/listener/async_listener.py @@ -16,7 +16,10 @@ class AsyncListener(metaclass=ABCMeta): auto_acknowledgement: bool async def async_matches( - self, *, req: AsyncBoltRequest, resp: BoltResponse, + self, + *, + req: AsyncBoltRequest, + resp: BoltResponse, ) -> bool: is_matched: bool = False for matcher in self.matchers: @@ -26,7 +29,10 @@ async def async_matches( return is_matched async def run_async_middleware( - self, *, req: AsyncBoltRequest, resp: BoltResponse, + self, + *, + req: AsyncBoltRequest, + resp: BoltResponse, ) -> Tuple[BoltResponse, bool]: """Runs an async middleware. @@ -100,7 +106,10 @@ def __init__( self.logger = get_bolt_app_logger(app_name, self.ack_function) async def run_ack_function( - self, *, request: AsyncBoltRequest, response: BoltResponse, + self, + *, + request: AsyncBoltRequest, + response: BoltResponse, ) -> Optional[BoltResponse]: return await self.ack_function( **build_async_required_kwargs( diff --git a/slack_bolt/listener/asyncio_runner.py b/slack_bolt/listener/asyncio_runner.py index dca9d5705..c9c1d49fa 100644 --- a/slack_bolt/listener/asyncio_runner.py +++ b/slack_bolt/listener/asyncio_runner.py @@ -62,7 +62,9 @@ async def run( response = BoltResponse(status=500) response.status = 500 await self.listener_error_handler.handle( - error=e, request=request, response=response, + error=e, + request=request, + response=response, ) ack.response = response @@ -95,7 +97,9 @@ async def run( # start the listener function asynchronously # NOTE: intentionally async def run_ack_function_asynchronously( - ack: AsyncAck, request: AsyncBoltRequest, response: BoltResponse, + ack: AsyncAck, + request: AsyncBoltRequest, + response: BoltResponse, ): try: await listener.run_ack_function( @@ -111,7 +115,9 @@ async def run_ack_function_asynchronously( response = None await self.listener_error_handler.handle( - error=e, request=request, response=response, + error=e, + request=request, + response=response, ) ack.response = response diff --git a/slack_bolt/listener/custom_listener.py b/slack_bolt/listener/custom_listener.py index 8e8a54e98..99f8c353f 100644 --- a/slack_bolt/listener/custom_listener.py +++ b/slack_bolt/listener/custom_listener.py @@ -41,7 +41,10 @@ def __init__( self.logger = get_bolt_app_logger(app_name, self.ack_function) def run_ack_function( - self, *, request: BoltRequest, response: BoltResponse, + self, + *, + request: BoltRequest, + response: BoltResponse, ) -> Optional[BoltResponse]: return self.ack_function( **build_required_kwargs( diff --git a/slack_bolt/listener/listener.py b/slack_bolt/listener/listener.py index 6f1d43c9a..748392f94 100644 --- a/slack_bolt/listener/listener.py +++ b/slack_bolt/listener/listener.py @@ -14,7 +14,12 @@ class Listener(metaclass=ABCMeta): lazy_functions: Sequence[Callable[..., None]] auto_acknowledgement: bool - def matches(self, *, req: BoltRequest, resp: BoltResponse,) -> bool: + def matches( + self, + *, + req: BoltRequest, + resp: BoltResponse, + ) -> bool: is_matched: bool = False for matcher in self.matchers: is_matched = matcher.matches(req, resp) @@ -23,7 +28,10 @@ def matches(self, *, req: BoltRequest, resp: BoltResponse,) -> bool: return is_matched def run_middleware( - self, *, req: BoltRequest, resp: BoltResponse, + self, + *, + req: BoltRequest, + resp: BoltResponse, ) -> Tuple[BoltResponse, bool]: """ diff --git a/slack_bolt/listener/listener_error_handler.py b/slack_bolt/listener/listener_error_handler.py index 5854fb356..0747bd368 100644 --- a/slack_bolt/listener/listener_error_handler.py +++ b/slack_bolt/listener/listener_error_handler.py @@ -21,7 +21,10 @@ class ListenerErrorHandler(metaclass=ABCMeta): @abstractmethod def handle( - self, error: Exception, request: BoltRequest, response: Optional[BoltResponse], + self, + error: Exception, + request: BoltRequest, + response: Optional[BoltResponse], ) -> None: """Handles an unhandled exception. @@ -40,7 +43,10 @@ def __init__(self, logger: Logger, func: Callable[..., None]): self.arg_names = inspect.getfullargspec(func).args def handle( - self, error: Exception, request: BoltRequest, response: Optional[BoltResponse], + self, + error: Exception, + request: BoltRequest, + response: Optional[BoltResponse], ): all_available_args = { "logger": self.logger, @@ -95,7 +101,10 @@ def __init__(self, logger: Logger): self.logger = logger def handle( - self, error: Exception, request: BoltRequest, response: Optional[BoltResponse], + self, + error: Exception, + request: BoltRequest, + response: Optional[BoltResponse], ): message = f"Failed to run listener function (error: {error})" self.logger.exception(message) diff --git a/slack_bolt/listener/thread_runner.py b/slack_bolt/listener/thread_runner.py index dfe2a51a3..28d4051da 100644 --- a/slack_bolt/listener/thread_runner.py +++ b/slack_bolt/listener/thread_runner.py @@ -63,7 +63,9 @@ def run( # type: ignore response = BoltResponse(status=500) response.status = 500 self.listener_error_handler.handle( - error=e, request=request, response=response, + error=e, + request=request, + response=response, ) ack.response = response @@ -103,7 +105,9 @@ def run_ack_function_asynchronously(): # You can customize this by passing your own error handler. if listener.auto_acknowledgement: self.listener_error_handler.handle( - error=e, request=request, response=response, + error=e, + request=request, + response=response, ) else: if response is None: @@ -112,7 +116,9 @@ def run_ack_function_asynchronously(): if ack.response is not None: # already acknowledged response = None self.listener_error_handler.handle( - error=e, request=request, response=response, + error=e, + request=request, + response=response, ) ack.response = response diff --git a/slack_bolt/listener_matcher/builtins.py b/slack_bolt/listener_matcher/builtins.py index fce9031b1..bcba2a043 100644 --- a/slack_bolt/listener_matcher/builtins.py +++ b/slack_bolt/listener_matcher/builtins.py @@ -55,7 +55,8 @@ def matches(self, req: BoltRequest, resp: BoltResponse) -> bool: def build_listener_matcher( - func: Callable[..., bool], asyncio: bool, + func: Callable[..., bool], + asyncio: bool, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: if asyncio: from .async_builtins import AsyncBuiltinListenerMatcher @@ -73,7 +74,8 @@ async def async_fun(body: Dict[str, Any]) -> bool: def event( - constraints: Union[str, Pattern, Dict[str, str]], asyncio: bool = False, + constraints: Union[str, Pattern, Dict[str, str]], + asyncio: bool = False, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: if isinstance(constraints, (str, Pattern)): event_type: Union[str, Pattern] = constraints @@ -110,7 +112,8 @@ def func(body: Dict[str, Any]) -> bool: def workflow_step_execute( - callback_id: Union[str, Pattern], asyncio: bool = False, + callback_id: Union[str, Pattern], + asyncio: bool = False, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return ( @@ -128,7 +131,8 @@ def func(body: Dict[str, Any]) -> bool: def command( - command: Union[str, Pattern], asyncio: bool = False, + command: Union[str, Pattern], + asyncio: bool = False, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return is_slash_command(body) and _matches(command, body["command"]) @@ -164,7 +168,8 @@ def func(body: Dict[str, Any]) -> bool: def global_shortcut( - callback_id: Union[str, Pattern], asyncio: bool = False, + callback_id: Union[str, Pattern], + asyncio: bool = False, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return is_global_shortcut(body) and _matches(callback_id, body["callback_id"]) @@ -173,7 +178,8 @@ def func(body: Dict[str, Any]) -> bool: def message_shortcut( - callback_id: Union[str, Pattern], asyncio: bool = False, + callback_id: Union[str, Pattern], + asyncio: bool = False, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return is_message_shortcut(body) and _matches(callback_id, body["callback_id"]) @@ -257,12 +263,16 @@ def func(body: Dict[str, Any]) -> bool: return build_listener_matcher(func, asyncio) -def _attachment_action(callback_id: Union[str, Pattern], body: Dict[str, Any],) -> bool: +def _attachment_action( + callback_id: Union[str, Pattern], + body: Dict[str, Any], +) -> bool: return is_attachment_action(body) and _matches(callback_id, body["callback_id"]) def attachment_action( - callback_id: Union[str, Pattern], asyncio: bool = False, + callback_id: Union[str, Pattern], + asyncio: bool = False, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return _attachment_action(callback_id, body) @@ -270,12 +280,16 @@ def func(body: Dict[str, Any]) -> bool: return build_listener_matcher(func, asyncio) -def _dialog_submission(callback_id: Union[str, Pattern], body: Dict[str, Any],) -> bool: +def _dialog_submission( + callback_id: Union[str, Pattern], + body: Dict[str, Any], +) -> bool: return is_dialog_submission(body) and _matches(callback_id, body["callback_id"]) def dialog_submission( - callback_id: Union[str, Pattern], asyncio: bool = False, + callback_id: Union[str, Pattern], + asyncio: bool = False, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return _dialog_submission(callback_id, body) @@ -284,13 +298,15 @@ def func(body: Dict[str, Any]) -> bool: def _dialog_cancellation( - callback_id: Union[str, Pattern], body: Dict[str, Any], + callback_id: Union[str, Pattern], + body: Dict[str, Any], ) -> bool: return is_dialog_cancellation(body) and _matches(callback_id, body["callback_id"]) def dialog_cancellation( - callback_id: Union[str, Pattern], asyncio: bool = False, + callback_id: Union[str, Pattern], + asyncio: bool = False, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return _dialog_cancellation(callback_id, body) @@ -299,13 +315,15 @@ def func(body: Dict[str, Any]) -> bool: def _workflow_step_edit( - callback_id: Union[str, Pattern], body: Dict[str, Any], + callback_id: Union[str, Pattern], + body: Dict[str, Any], ) -> bool: return is_workflow_step_edit(body) and _matches(callback_id, body["callback_id"]) def workflow_step_edit( - callback_id: Union[str, Pattern], asyncio: bool = False, + callback_id: Union[str, Pattern], + asyncio: bool = False, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return _workflow_step_edit(callback_id, body) @@ -335,7 +353,8 @@ def view( def view_submission( - callback_id: Union[str, Pattern], asyncio: bool = False, + callback_id: Union[str, Pattern], + asyncio: bool = False, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return is_view_submission(body) and _matches( @@ -346,7 +365,8 @@ def func(body: Dict[str, Any]) -> bool: def view_closed( - callback_id: Union[str, Pattern], asyncio: bool = False, + callback_id: Union[str, Pattern], + asyncio: bool = False, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return is_view_closed(body) and _matches( @@ -357,7 +377,8 @@ def func(body: Dict[str, Any]) -> bool: def workflow_step_save( - callback_id: Union[str, Pattern], asyncio: bool = False, + callback_id: Union[str, Pattern], + asyncio: bool = False, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return is_workflow_step_save(body) and _matches( @@ -394,12 +415,16 @@ def func(body: Dict[str, Any]) -> bool: ) -def _block_suggestion(action_id: Union[str, Pattern], body: Dict[str, Any],) -> bool: +def _block_suggestion( + action_id: Union[str, Pattern], + body: Dict[str, Any], +) -> bool: return is_block_suggestion(body) and _matches(action_id, body["action_id"]) def block_suggestion( - action_id: Union[str, Pattern], asyncio: bool = False, + action_id: Union[str, Pattern], + asyncio: bool = False, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return _block_suggestion(action_id, body) @@ -407,12 +432,16 @@ def func(body: Dict[str, Any]) -> bool: return build_listener_matcher(func, asyncio) -def _dialog_suggestion(callback_id: Union[str, Pattern], body: Dict[str, Any],) -> bool: +def _dialog_suggestion( + callback_id: Union[str, Pattern], + body: Dict[str, Any], +) -> bool: return is_dialog_suggestion(body) and _matches(callback_id, body["callback_id"]) def dialog_suggestion( - callback_id: Union[str, Pattern], asyncio: bool = False, + callback_id: Union[str, Pattern], + asyncio: bool = False, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return _dialog_suggestion(callback_id, body) diff --git a/slack_bolt/middleware/authorization/async_internals.py b/slack_bolt/middleware/authorization/async_internals.py index 6a9d1b696..462e39836 100644 --- a/slack_bolt/middleware/authorization/async_internals.py +++ b/slack_bolt/middleware/authorization/async_internals.py @@ -23,5 +23,6 @@ def _is_no_auth_required(req: AsyncBoltRequest) -> bool: def _build_error_response() -> BoltResponse: # show an ephemeral message to the end-user return BoltResponse( - status=200, body=":x: Please install this app into the workspace :bow:", + status=200, + body=":x: Please install this app into the workspace :bow:", ) diff --git a/slack_bolt/middleware/authorization/internals.py b/slack_bolt/middleware/authorization/internals.py index cede00c42..42e958378 100644 --- a/slack_bolt/middleware/authorization/internals.py +++ b/slack_bolt/middleware/authorization/internals.py @@ -52,7 +52,8 @@ def _is_no_auth_test_call_required(req: Union[BoltRequest, "AsyncBoltRequest"]) def _build_error_response() -> BoltResponse: # show an ephemeral message to the end-user return BoltResponse( - status=200, body=":x: Please install this app into the workspace :bow:", + status=200, + body=":x: Please install this app into the workspace :bow:", ) diff --git a/slack_bolt/middleware/authorization/multi_teams_authorization.py b/slack_bolt/middleware/authorization/multi_teams_authorization.py index 5a130d623..20b31836a 100644 --- a/slack_bolt/middleware/authorization/multi_teams_authorization.py +++ b/slack_bolt/middleware/authorization/multi_teams_authorization.py @@ -19,7 +19,9 @@ class MultiTeamsAuthorization(Authorization): authorize: Authorize def __init__( - self, *, authorize: Authorize, + self, + *, + authorize: Authorize, ): """Multi-workspace authorization. @@ -29,7 +31,11 @@ def __init__( self.logger = get_bolt_logger(MultiTeamsAuthorization) def process( - self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse], + self, + *, + req: BoltRequest, + resp: BoltResponse, + next: Callable[[], BoltResponse], ) -> BoltResponse: if _is_no_auth_required(req): return next() diff --git a/slack_bolt/middleware/authorization/single_team_authorization.py b/slack_bolt/middleware/authorization/single_team_authorization.py index e09d399ab..9ca5b0541 100644 --- a/slack_bolt/middleware/authorization/single_team_authorization.py +++ b/slack_bolt/middleware/authorization/single_team_authorization.py @@ -25,7 +25,11 @@ def __init__(self, *, auth_test_result: Optional[SlackResponse] = None): self.logger = get_bolt_logger(SingleTeamAuthorization) def process( - self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse], + self, + *, + req: BoltRequest, + resp: BoltResponse, + next: Callable[[], BoltResponse], ) -> BoltResponse: if _is_no_auth_required(req): return next() diff --git a/slack_bolt/middleware/custom_middleware.py b/slack_bolt/middleware/custom_middleware.py index 61b71bac2..016b42ee9 100644 --- a/slack_bolt/middleware/custom_middleware.py +++ b/slack_bolt/middleware/custom_middleware.py @@ -22,7 +22,11 @@ def __init__(self, *, app_name: str, func: Callable): self.logger = get_bolt_app_logger(self.app_name, self.func) def process( - self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse], + self, + *, + req: BoltRequest, + resp: BoltResponse, + next: Callable[[], BoltResponse], ) -> BoltResponse: return self.func( **build_required_kwargs( diff --git a/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.py b/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.py index dd9eb93a4..06642b301 100644 --- a/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.py +++ b/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.py @@ -14,7 +14,11 @@ def __init__(self): self.logger = get_bolt_logger(IgnoringSelfEvents) def process( - self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse], + self, + *, + req: BoltRequest, + resp: BoltResponse, + next: Callable[[], BoltResponse], ) -> BoltResponse: auth_result = req.context.authorize_result if self._is_self_event(auth_result, req.context.user_id, req.body): diff --git a/slack_bolt/middleware/message_listener_matches/message_listener_matches.py b/slack_bolt/middleware/message_listener_matches/message_listener_matches.py index 834ab7b4b..41905b381 100644 --- a/slack_bolt/middleware/message_listener_matches/message_listener_matches.py +++ b/slack_bolt/middleware/message_listener_matches/message_listener_matches.py @@ -12,7 +12,11 @@ def __init__(self, keyword: Union[str, Pattern]): self.keyword = keyword def process( - self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse], + self, + *, + req: BoltRequest, + resp: BoltResponse, + next: Callable[[], BoltResponse], ) -> BoltResponse: text = req.body.get("event", {}).get("text", "") if text: diff --git a/slack_bolt/middleware/middleware.py b/slack_bolt/middleware/middleware.py index 8ecc20ce0..d8c5c4df6 100644 --- a/slack_bolt/middleware/middleware.py +++ b/slack_bolt/middleware/middleware.py @@ -8,7 +8,11 @@ class Middleware(metaclass=ABCMeta): @abstractmethod def process( - self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse], + self, + *, + req: BoltRequest, + resp: BoltResponse, + next: Callable[[], BoltResponse], ) -> BoltResponse: raise NotImplementedError() diff --git a/slack_bolt/middleware/request_verification/request_verification.py b/slack_bolt/middleware/request_verification/request_verification.py index 538441070..4bca8b643 100644 --- a/slack_bolt/middleware/request_verification/request_verification.py +++ b/slack_bolt/middleware/request_verification/request_verification.py @@ -19,7 +19,11 @@ def __init__(self, signing_secret: str): self.logger = get_bolt_logger(RequestVerification) def process( - self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse], + self, + *, + req: BoltRequest, + resp: BoltResponse, + next: Callable[[], BoltResponse], ) -> BoltResponse: if self._can_skip(req.mode, req.body): return next() diff --git a/slack_bolt/middleware/ssl_check/ssl_check.py b/slack_bolt/middleware/ssl_check/ssl_check.py index 43d4eca5d..3b4849ed6 100644 --- a/slack_bolt/middleware/ssl_check/ssl_check.py +++ b/slack_bolt/middleware/ssl_check/ssl_check.py @@ -18,7 +18,11 @@ def __init__(self, verification_token: str = None): self.logger = get_bolt_logger(SslCheck) def process( - self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse], + self, + *, + req: BoltRequest, + resp: BoltResponse, + next: Callable[[], BoltResponse], ) -> BoltResponse: if self._is_ssl_check_request(req.body): if self._verify_token_if_needed(req.body): diff --git a/slack_bolt/middleware/url_verification/url_verification.py b/slack_bolt/middleware/url_verification/url_verification.py index 04e95d2fd..1d1f7b2b4 100644 --- a/slack_bolt/middleware/url_verification/url_verification.py +++ b/slack_bolt/middleware/url_verification/url_verification.py @@ -15,7 +15,11 @@ def __init__(self): self.logger = get_bolt_logger(UrlVerification) def process( - self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse], + self, + *, + req: BoltRequest, + resp: BoltResponse, + next: Callable[[], BoltResponse], ) -> BoltResponse: if self._is_url_verification_request(req.body): return self._build_success_response(req.body) diff --git a/slack_bolt/oauth/async_callback_options.py b/slack_bolt/oauth/async_callback_options.py index 24c453b53..1ba66dccb 100644 --- a/slack_bolt/oauth/async_callback_options.py +++ b/slack_bolt/oauth/async_callback_options.py @@ -98,10 +98,13 @@ def __init__( async def _success_handler(self, args: AsyncSuccessArgs) -> BoltResponse: return self._response_builder._build_callback_success_response( - request=args.request, installation=args.installation, + request=args.request, + installation=args.installation, ) async def _failure_handler(self, args: AsyncFailureArgs) -> BoltResponse: return self._response_builder._build_callback_failure_response( - request=args.request, reason=args.reason, status=args.suggested_status_code, + request=args.request, + reason=args.reason, + status=args.suggested_status_code, ) diff --git a/slack_bolt/oauth/async_oauth_flow.py b/slack_bolt/oauth/async_oauth_flow.py index d860d8dc7..233c7d149 100644 --- a/slack_bolt/oauth/async_oauth_flow.py +++ b/slack_bolt/oauth/async_oauth_flow.py @@ -139,7 +139,9 @@ def sqlite3( failure_url=failure_url, # Installation Management installation_store=SQLite3InstallationStore( - database=database, client_id=client_id, logger=logger, + database=database, + client_id=client_id, + logger=logger, ), installation_store_bot_only=installation_store_bot_only, # state parameter related configurations @@ -292,14 +294,14 @@ async def run_installation(self, code: str) -> Optional[Installation]: client_secret=self.settings.client_secret, redirect_uri=self.settings.redirect_uri, # can be None ) - installed_enterprise: Dict[str, str] = oauth_response.get( - "enterprise" - ) or {} + installed_enterprise: Dict[str, str] = ( + oauth_response.get("enterprise") or {} + ) installed_team: Dict[str, str] = oauth_response.get("team") or {} installer: Dict[str, str] = oauth_response.get("authed_user") or {} - incoming_webhook: Dict[str, str] = oauth_response.get( - "incoming_webhook" - ) or {} + incoming_webhook: Dict[str, str] = ( + oauth_response.get("incoming_webhook") or {} + ) bot_token: Optional[str] = oauth_response.get("access_token") # NOTE: oauth.v2.access doesn't include bot_id in response diff --git a/slack_bolt/oauth/async_oauth_settings.py b/slack_bolt/oauth/async_oauth_settings.py index 8e36baf2d..fec1bef80 100644 --- a/slack_bolt/oauth/async_oauth_settings.py +++ b/slack_bolt/oauth/async_oauth_settings.py @@ -140,7 +140,8 @@ def __init__( ) # state parameter related configurations self.state_store = state_store or FileOAuthStateStore( - expiration_seconds=state_expiration_seconds, client_id=client_id, + expiration_seconds=state_expiration_seconds, + client_id=client_id, ) self.state_cookie_name = state_cookie_name self.state_expiration_seconds = state_expiration_seconds diff --git a/slack_bolt/oauth/callback_options.py b/slack_bolt/oauth/callback_options.py index 52a87659c..a8efa8a69 100644 --- a/slack_bolt/oauth/callback_options.py +++ b/slack_bolt/oauth/callback_options.py @@ -103,10 +103,13 @@ def __init__( def _success_handler(self, args: SuccessArgs) -> BoltResponse: return self._response_builder._build_callback_success_response( - request=args.request, installation=args.installation, + request=args.request, + installation=args.installation, ) def _failure_handler(self, args: FailureArgs) -> BoltResponse: return self._response_builder._build_callback_failure_response( - request=args.request, reason=args.reason, status=args.suggested_status_code, + request=args.request, + reason=args.reason, + status=args.suggested_status_code, ) diff --git a/slack_bolt/oauth/oauth_flow.py b/slack_bolt/oauth/oauth_flow.py index d68b9d73c..3182c255b 100644 --- a/slack_bolt/oauth/oauth_flow.py +++ b/slack_bolt/oauth/oauth_flow.py @@ -134,7 +134,9 @@ def sqlite3( authorization_url=authorization_url, # Installation Management installation_store=SQLite3InstallationStore( - database=database, client_id=client_id, logger=logger, + database=database, + client_id=client_id, + logger=logger, ), installation_store_bot_only=installation_store_bot_only, # state parameter related configurations @@ -287,17 +289,17 @@ def run_installation(self, code: str) -> Optional[Installation]: client_secret=self.settings.client_secret, redirect_uri=self.settings.redirect_uri, # can be None ) - installed_enterprise: Dict[str, str] = oauth_response.get( - "enterprise" - ) or {} - is_enterprise_install: bool = oauth_response.get( - "is_enterprise_install" - ) or False + installed_enterprise: Dict[str, str] = ( + oauth_response.get("enterprise") or {} + ) + is_enterprise_install: bool = ( + oauth_response.get("is_enterprise_install") or False + ) installed_team: Dict[str, str] = oauth_response.get("team") or {} installer: Dict[str, str] = oauth_response.get("authed_user") or {} - incoming_webhook: Dict[str, str] = oauth_response.get( - "incoming_webhook" - ) or {} + incoming_webhook: Dict[str, str] = ( + oauth_response.get("incoming_webhook") or {} + ) bot_token: Optional[str] = oauth_response.get("access_token") # NOTE: oauth.v2.access doesn't include bot_id in response diff --git a/slack_bolt/oauth/oauth_settings.py b/slack_bolt/oauth/oauth_settings.py index 66ff03260..6010e5c26 100644 --- a/slack_bolt/oauth/oauth_settings.py +++ b/slack_bolt/oauth/oauth_settings.py @@ -134,7 +134,8 @@ def __init__( ) # state parameter related configurations self.state_store = state_store or FileOAuthStateStore( - expiration_seconds=state_expiration_seconds, client_id=client_id, + expiration_seconds=state_expiration_seconds, + client_id=client_id, ) self.state_cookie_name = state_cookie_name self.state_expiration_seconds = state_expiration_seconds diff --git a/slack_bolt/request/async_internals.py b/slack_bolt/request/async_internals.py index c87707ac1..19c20dd02 100644 --- a/slack_bolt/request/async_internals.py +++ b/slack_bolt/request/async_internals.py @@ -10,7 +10,8 @@ def build_async_context( - context: AsyncBoltContext, payload: Dict[str, Any], + context: AsyncBoltContext, + payload: Dict[str, Any], ) -> AsyncBoltContext: enterprise_id = extract_enterprise_id(payload) if enterprise_id: diff --git a/slack_bolt/util/async_utils.py b/slack_bolt/util/async_utils.py index 3713f83e6..60bbe0903 100644 --- a/slack_bolt/util/async_utils.py +++ b/slack_bolt/util/async_utils.py @@ -6,4 +6,7 @@ def create_async_web_client(token: Optional[str] = None) -> AsyncWebClient: - return AsyncWebClient(token=token, user_agent_prefix=f"Bolt-Async/{bolt_version}",) + return AsyncWebClient( + token=token, + user_agent_prefix=f"Bolt-Async/{bolt_version}", + ) diff --git a/slack_bolt/util/utils.py b/slack_bolt/util/utils.py index 4cdc39190..e52a53674 100644 --- a/slack_bolt/util/utils.py +++ b/slack_bolt/util/utils.py @@ -10,7 +10,10 @@ def create_web_client(token: Optional[str] = None) -> WebClient: - return WebClient(token=token, user_agent_prefix=f"Bolt/{bolt_version}",) + return WebClient( + token=token, + user_agent_prefix=f"Bolt/{bolt_version}", + ) def convert_to_dict_list(objects: Sequence[Union[Dict, JsonObject]]) -> Sequence[Dict]: diff --git a/slack_bolt/workflows/step/async_step.py b/slack_bolt/workflows/step/async_step.py index 3044ca513..a8b4573d7 100644 --- a/slack_bolt/workflows/step/async_step.py +++ b/slack_bolt/workflows/step/async_step.py @@ -47,7 +47,11 @@ def __init__( @classmethod def _build_listener( - cls, callback_id: str, app_name: str, listener: AsyncListener, name: str, + cls, + callback_id: str, + app_name: str, + listener: AsyncListener, + name: str, ) -> AsyncListener: if isinstance(listener, AsyncListener): return listener @@ -114,7 +118,9 @@ async def edit_listener_middleware( next: Callable[[], Awaitable[BoltResponse]], ): context["configure"] = AsyncConfigure( - callback_id=callback_id, client=client, body=body, + callback_id=callback_id, + client=client, + body=body, ) return await next() @@ -133,7 +139,10 @@ async def save_listener_middleware( body: dict, next: Callable[[], Awaitable[BoltResponse]], ): - context["update"] = AsyncUpdate(client=client, body=body,) + context["update"] = AsyncUpdate( + client=client, + body=body, + ) return await next() return AsyncCustomMiddleware(app_name=__name__, func=save_listener_middleware) @@ -151,8 +160,14 @@ async def execute_listener_middleware( body: dict, next: Callable[[], Awaitable[BoltResponse]], ): - context["complete"] = AsyncComplete(client=client, body=body,) - context["fail"] = AsyncFail(client=client, body=body,) + context["complete"] = AsyncComplete( + client=client, + body=body, + ) + context["fail"] = AsyncFail( + client=client, + body=body, + ) return await next() return AsyncCustomMiddleware(app_name=__name__, func=execute_listener_middleware) diff --git a/slack_bolt/workflows/step/async_step_middleware.py b/slack_bolt/workflows/step/async_step_middleware.py index cac50d3b0..c1583aa2f 100644 --- a/slack_bolt/workflows/step/async_step_middleware.py +++ b/slack_bolt/workflows/step/async_step_middleware.py @@ -37,7 +37,10 @@ async def async_process( return await next() async def _run( - self, listener: AsyncListener, req: AsyncBoltRequest, resp: BoltResponse, + self, + listener: AsyncListener, + req: AsyncBoltRequest, + resp: BoltResponse, ) -> Optional[BoltResponse]: resp, next_was_not_called = await listener.run_async_middleware( req=req, resp=resp diff --git a/slack_bolt/workflows/step/step.py b/slack_bolt/workflows/step/step.py index d9e562885..0e1954294 100644 --- a/slack_bolt/workflows/step/step.py +++ b/slack_bolt/workflows/step/step.py @@ -115,7 +115,9 @@ def edit_listener_middleware( next: Callable[[], BoltResponse], ): context["configure"] = Configure( - callback_id=callback_id, client=client, body=body, + callback_id=callback_id, + client=client, + body=body, ) return next() @@ -134,7 +136,10 @@ def save_listener_middleware( body: dict, next: Callable[[], BoltResponse], ): - context["update"] = Update(client=client, body=body,) + context["update"] = Update( + client=client, + body=body, + ) return next() return CustomMiddleware(app_name=__name__, func=save_listener_middleware) @@ -152,8 +157,14 @@ def execute_listener_middleware( body: dict, next: Callable[[], BoltResponse], ): - context["complete"] = Complete(client=client, body=body,) - context["fail"] = Fail(client=client, body=body,) + context["complete"] = Complete( + client=client, + body=body, + ) + context["fail"] = Fail( + client=client, + body=body, + ) return next() return CustomMiddleware(app_name=__name__, func=execute_listener_middleware) diff --git a/slack_bolt/workflows/step/step_middleware.py b/slack_bolt/workflows/step/step_middleware.py index 2cbaac772..6c86b26fc 100644 --- a/slack_bolt/workflows/step/step_middleware.py +++ b/slack_bolt/workflows/step/step_middleware.py @@ -14,7 +14,11 @@ def __init__(self, step: WorkflowStep, listener_runner: ThreadListenerRunner): self.listener_runner = listener_runner def process( - self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse], + self, + *, + req: BoltRequest, + resp: BoltResponse, + next: Callable[[], BoltResponse], ) -> BoltResponse: if self.step.edit.matches(req=req, resp=resp): @@ -33,7 +37,10 @@ def process( return next() def _run( - self, listener: Listener, req: BoltRequest, resp: BoltResponse, + self, + listener: Listener, + req: BoltRequest, + resp: BoltResponse, ) -> Optional[BoltResponse]: resp, next_was_not_called = listener.run_middleware(req=req, resp=resp) if next_was_not_called: diff --git a/slack_bolt/workflows/step/utilities/async_configure.py b/slack_bolt/workflows/step/utilities/async_configure.py index f6a73dfe4..9914f3dc7 100644 --- a/slack_bolt/workflows/step/utilities/async_configure.py +++ b/slack_bolt/workflows/step/utilities/async_configure.py @@ -11,7 +11,9 @@ def __init__(self, *, callback_id: str, client: AsyncWebClient, body: dict): self.body = body async def __call__( - self, *, blocks: Optional[Sequence[Union[dict, Block]]] = None, + self, + *, + blocks: Optional[Sequence[Union[dict, Block]]] = None, ) -> None: await self.client.views_open( trigger_id=self.body["trigger_id"], diff --git a/slack_bolt/workflows/step/utilities/async_fail.py b/slack_bolt/workflows/step/utilities/async_fail.py index f2c6b1de4..e1d277ff4 100644 --- a/slack_bolt/workflows/step/utilities/async_fail.py +++ b/slack_bolt/workflows/step/utilities/async_fail.py @@ -6,7 +6,11 @@ def __init__(self, *, client: AsyncWebClient, body: dict): self.client = client self.body = body - async def __call__(self, *, error: dict,) -> None: + async def __call__( + self, + *, + error: dict, + ) -> None: await self.client.workflows_stepFailed( workflow_step_execute_id=self.body["event"]["workflow_step"][ "workflow_step_execute_id" diff --git a/slack_bolt/workflows/step/utilities/fail.py b/slack_bolt/workflows/step/utilities/fail.py index 6b82dc272..b2c3c4239 100644 --- a/slack_bolt/workflows/step/utilities/fail.py +++ b/slack_bolt/workflows/step/utilities/fail.py @@ -6,7 +6,11 @@ def __init__(self, *, client: WebClient, body: dict): self.client = client self.body = body - def __call__(self, *, error: dict,) -> None: + def __call__( + self, + *, + error: dict, + ) -> None: self.client.workflows_stepFailed( workflow_step_execute_id=self.body["event"]["workflow_step"][ "workflow_step_execute_id" diff --git a/tests/adapter_tests/test_aws_chalice.py b/tests/adapter_tests/test_aws_chalice.py index a9f4912f7..ee80f62dd 100644 --- a/tests/adapter_tests/test_aws_chalice.py +++ b/tests/adapter_tests/test_aws_chalice.py @@ -40,7 +40,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -60,7 +61,10 @@ def test_not_found(self): assert response.status_code == 404 def test_events(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) @app.event("app_mention") def event_handler(): @@ -109,7 +113,10 @@ def events() -> Response: assert self.mock_received_requests["/auth.test"] == 1 def test_shortcuts(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) @app.shortcut("test-shortcut") def shortcut_handler(ack): @@ -153,7 +160,10 @@ def events() -> Response: assert self.mock_received_requests["/auth.test"] == 1 def test_commands(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) @app.command("/hello-world") def command_handler(ack): @@ -197,7 +207,10 @@ def events() -> Response: assert self.mock_received_requests["/auth.test"] == 1 def test_lazy_listeners(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def command_handler(ack): ack() diff --git a/tests/adapter_tests/test_aws_lambda.py b/tests/adapter_tests/test_aws_lambda.py index d2e638efd..0c05e07d6 100644 --- a/tests/adapter_tests/test_aws_lambda.py +++ b/tests/adapter_tests/test_aws_lambda.py @@ -30,7 +30,10 @@ class TestAWSLambda: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) context = LambdaContext(function_name="test-function") @@ -44,7 +47,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -70,13 +74,19 @@ def test_first_value(self): @mock_lambda def test_clear_all_log_handlers(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) handler = SlackRequestHandler(app) handler.clear_all_log_handlers() @mock_lambda def test_events(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def event_handler(): pass @@ -128,7 +138,10 @@ def event_handler(): @mock_lambda def test_shortcuts(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def shortcut_handler(ack): ack() @@ -175,7 +188,10 @@ def shortcut_handler(ack): @mock_lambda def test_commands(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def command_handler(ack): ack() @@ -222,7 +238,10 @@ def command_handler(ack): @mock_lambda def test_lazy_listeners(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def command_handler(ack): ack() diff --git a/tests/adapter_tests/test_bottle.py b/tests/adapter_tests/test_bottle.py index 7cb8dffa0..2cfd5a7fb 100644 --- a/tests/adapter_tests/test_bottle.py +++ b/tests/adapter_tests/test_bottle.py @@ -48,8 +48,14 @@ def setup_method(self): self.old_os_env = remove_os_env_temporarily() setup_mock_web_api_server(self) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) - app = App(client=web_client, signing_secret=signing_secret,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + app = App( + client=web_client, + signing_secret=signing_secret, + ) TestBottle.handler = SlackRequestHandler(app) app.event("app_mention")(event_handler) app.shortcut("test-shortcut")(shortcut_handler) @@ -61,7 +67,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): diff --git a/tests/adapter_tests/test_bottle_oauth.py b/tests/adapter_tests/test_bottle_oauth.py index 37fd6b25d..52ff7a2ae 100644 --- a/tests/adapter_tests/test_bottle_oauth.py +++ b/tests/adapter_tests/test_bottle_oauth.py @@ -6,7 +6,9 @@ app = App( signing_secret=signing_secret, oauth_settings=OAuthSettings( - client_id="111.111", client_secret="xxx", scopes=["chat:write", "commands"], + client_id="111.111", + client_secret="xxx", + scopes=["chat:write", "commands"], ), ) handler = SlackRequestHandler(app) diff --git a/tests/adapter_tests/test_cherrypy.py b/tests/adapter_tests/test_cherrypy.py index fec885343..f21845911 100644 --- a/tests/adapter_tests/test_cherrypy.py +++ b/tests/adapter_tests/test_cherrypy.py @@ -29,8 +29,14 @@ def setup_server(cls): signing_secret = "secret" valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) - app = App(client=web_client, signing_secret=signing_secret,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + app = App( + client=web_client, + signing_secret=signing_secret, + ) def event_handler(): pass @@ -63,7 +69,8 @@ def teardown_class(cls): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): diff --git a/tests/adapter_tests/test_cherrypy_oauth.py b/tests/adapter_tests/test_cherrypy_oauth.py index ce8524bc8..80053331f 100644 --- a/tests/adapter_tests/test_cherrypy_oauth.py +++ b/tests/adapter_tests/test_cherrypy_oauth.py @@ -21,7 +21,10 @@ def setup_server(cls): signing_secret = "secret" valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) app = App( client=web_client, signing_secret=signing_secret, diff --git a/tests/adapter_tests/test_django.py b/tests/adapter_tests/test_django.py index 21836fc50..d1510594f 100644 --- a/tests/adapter_tests/test_django.py +++ b/tests/adapter_tests/test_django.py @@ -23,7 +23,10 @@ class TestDjango(TestCase): valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) os.environ["DJANGO_SETTINGS_MODULE"] = "tests.adapter_tests.test_django_settings" rf = RequestFactory() @@ -38,7 +41,8 @@ def tearDown(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -48,7 +52,10 @@ def build_headers(self, timestamp: str, body: str): } def test_events(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def event_handler(): pass @@ -87,7 +94,10 @@ def event_handler(): assert self.mock_received_requests["/auth.test"] == 1 def test_shortcuts(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def shortcut_handler(ack): ack() @@ -123,7 +133,10 @@ def shortcut_handler(ack): assert self.mock_received_requests["/auth.test"] == 1 def test_commands(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def command_handler(ack): ack() diff --git a/tests/adapter_tests/test_django_settings.py b/tests/adapter_tests/test_django_settings.py index 7e5f57df3..8811343fe 100644 --- a/tests/adapter_tests/test_django_settings.py +++ b/tests/adapter_tests/test_django_settings.py @@ -1,4 +1,7 @@ SECRET_KEY = "XXX" DATABASES = { - "default": {"ENGINE": "django.db.backends.sqlite3", "NAME": "logs/db.sqlite3",} + "default": { + "ENGINE": "django.db.backends.sqlite3", + "NAME": "logs/db.sqlite3", + } } diff --git a/tests/adapter_tests/test_falcon.py b/tests/adapter_tests/test_falcon.py index e18374473..263a67275 100644 --- a/tests/adapter_tests/test_falcon.py +++ b/tests/adapter_tests/test_falcon.py @@ -22,7 +22,10 @@ class TestFalcon: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -34,7 +37,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -50,7 +54,10 @@ def build_headers(self, timestamp: str, body: str): } def test_events(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def event_handler(): pass @@ -85,13 +92,18 @@ def event_handler(): client = testing.TestClient(api) response = client.simulate_post( - "/slack/events", body=body, headers=self.build_headers(timestamp, body), + "/slack/events", + body=body, + headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 assert self.mock_received_requests["/auth.test"] == 1 def test_shortcuts(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def shortcut_handler(ack): ack() @@ -121,13 +133,18 @@ def shortcut_handler(ack): client = testing.TestClient(api) response = client.simulate_post( - "/slack/events", body=body, headers=self.build_headers(timestamp, body), + "/slack/events", + body=body, + headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 assert self.mock_received_requests["/auth.test"] == 1 def test_commands(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def command_handler(ack): ack() @@ -157,7 +174,9 @@ def command_handler(ack): client = testing.TestClient(api) response = client.simulate_post( - "/slack/events", body=body, headers=self.build_headers(timestamp, body), + "/slack/events", + body=body, + headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 assert self.mock_received_requests["/auth.test"] == 1 diff --git a/tests/adapter_tests/test_fastapi.py b/tests/adapter_tests/test_fastapi.py index 2de6ef069..3e94542d0 100644 --- a/tests/adapter_tests/test_fastapi.py +++ b/tests/adapter_tests/test_fastapi.py @@ -23,7 +23,10 @@ class TestFastAPI: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -35,7 +38,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -51,7 +55,10 @@ def build_headers(self, timestamp: str, body: str): } def test_events(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def event_handler(): pass @@ -89,13 +96,18 @@ async def endpoint(req: Request): client = TestClient(api) response = client.post( - "/slack/events", data=body, headers=self.build_headers(timestamp, body), + "/slack/events", + data=body, + headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 assert self.mock_received_requests["/auth.test"] == 1 def test_shortcuts(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def shortcut_handler(ack): ack() @@ -128,13 +140,18 @@ async def endpoint(req: Request): client = TestClient(api) response = client.post( - "/slack/events", data=body, headers=self.build_headers(timestamp, body), + "/slack/events", + data=body, + headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 assert self.mock_received_requests["/auth.test"] == 1 def test_commands(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def command_handler(ack): ack() @@ -167,7 +184,9 @@ async def endpoint(req: Request): client = TestClient(api) response = client.post( - "/slack/events", data=body, headers=self.build_headers(timestamp, body), + "/slack/events", + data=body, + headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 assert self.mock_received_requests["/auth.test"] == 1 diff --git a/tests/adapter_tests/test_flask.py b/tests/adapter_tests/test_flask.py index 30d58fc35..c6f320f6d 100644 --- a/tests/adapter_tests/test_flask.py +++ b/tests/adapter_tests/test_flask.py @@ -21,7 +21,10 @@ class TestFlask: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -33,7 +36,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -49,7 +53,10 @@ def build_headers(self, timestamp: str, body: str): } def test_events(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def event_handler(): pass @@ -86,13 +93,18 @@ def endpoint(): with flask_app.test_client() as client: rv = client.post( - "/slack/events", data=body, headers=self.build_headers(timestamp, body), + "/slack/events", + data=body, + headers=self.build_headers(timestamp, body), ) assert rv.status_code == 200 assert self.mock_received_requests["/auth.test"] == 1 def test_shortcuts(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def shortcut_handler(ack): ack() @@ -124,13 +136,18 @@ def endpoint(): with flask_app.test_client() as client: rv = client.post( - "/slack/events", data=body, headers=self.build_headers(timestamp, body), + "/slack/events", + data=body, + headers=self.build_headers(timestamp, body), ) assert rv.status_code == 200 assert self.mock_received_requests["/auth.test"] == 1 def test_commands(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def command_handler(ack): ack() @@ -162,7 +179,9 @@ def endpoint(): with flask_app.test_client() as client: rv = client.post( - "/slack/events", data=body, headers=self.build_headers(timestamp, body), + "/slack/events", + data=body, + headers=self.build_headers(timestamp, body), ) assert rv.status_code == 200 assert self.mock_received_requests["/auth.test"] == 1 diff --git a/tests/adapter_tests/test_lambda_s3_oauth_flow.py b/tests/adapter_tests/test_lambda_s3_oauth_flow.py index 4e3644b64..0756bc06f 100644 --- a/tests/adapter_tests/test_lambda_s3_oauth_flow.py +++ b/tests/adapter_tests/test_lambda_s3_oauth_flow.py @@ -16,7 +16,9 @@ def teardown_method(self): def test_instantiation(self): oauth_flow = LambdaS3OAuthFlow( settings=OAuthSettings( - client_id="111.222", client_secret="xxx", scopes=["chat:write"], + client_id="111.222", + client_secret="xxx", + scopes=["chat:write"], ), installation_bucket_name="dummy-installation", oauth_state_bucket_name="dummy-state", diff --git a/tests/adapter_tests/test_pyramid.py b/tests/adapter_tests/test_pyramid.py index 5c5d78cd8..bc88b37d0 100644 --- a/tests/adapter_tests/test_pyramid.py +++ b/tests/adapter_tests/test_pyramid.py @@ -24,7 +24,10 @@ class TestPyramid(TestCase): valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setUp(self): self.config = testing.setUp() @@ -38,7 +41,8 @@ def tearDown(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -54,7 +58,10 @@ def build_headers(self, timestamp: str, body: str): } def test_events(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def event_handler(): pass @@ -93,7 +100,10 @@ def event_handler(): assert self.mock_received_requests["/auth.test"] == 1 def test_shortcuts(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def shortcut_handler(ack): ack() @@ -127,7 +137,10 @@ def shortcut_handler(ack): assert self.mock_received_requests["/auth.test"] == 1 def test_commands(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def command_handler(ack): ack() diff --git a/tests/adapter_tests/test_starlette.py b/tests/adapter_tests/test_starlette.py index 9ab513d26..4dc4059f9 100644 --- a/tests/adapter_tests/test_starlette.py +++ b/tests/adapter_tests/test_starlette.py @@ -24,7 +24,10 @@ class TestStarlette: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -36,7 +39,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -52,7 +56,10 @@ def build_headers(self, timestamp: str, body: str): } def test_events(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def event_handler(): pass @@ -92,13 +99,18 @@ async def endpoint(req: Request): ) client = TestClient(api) response = client.post( - "/slack/events", data=body, headers=self.build_headers(timestamp, body), + "/slack/events", + data=body, + headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 assert self.mock_received_requests["/auth.test"] == 1 def test_shortcuts(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def shortcut_handler(ack): ack() @@ -133,13 +145,18 @@ async def endpoint(req: Request): ) client = TestClient(api) response = client.post( - "/slack/events", data=body, headers=self.build_headers(timestamp, body), + "/slack/events", + data=body, + headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 assert self.mock_received_requests["/auth.test"] == 1 def test_commands(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) def command_handler(ack): ack() @@ -174,7 +191,9 @@ async def endpoint(req: Request): ) client = TestClient(api) response = client.post( - "/slack/events", data=body, headers=self.build_headers(timestamp, body), + "/slack/events", + data=body, + headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 assert self.mock_received_requests["/auth.test"] == 1 diff --git a/tests/adapter_tests/test_tornado.py b/tests/adapter_tests/test_tornado.py index 468690fb6..87c4ccc09 100644 --- a/tests/adapter_tests/test_tornado.py +++ b/tests/adapter_tests/test_tornado.py @@ -41,8 +41,14 @@ def setUp(self): self.old_os_env = remove_os_env_temporarily() setup_mock_web_api_server(self) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) - self.app = App(client=web_client, signing_secret=signing_secret,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + self.app = App( + client=web_client, + signing_secret=signing_secret, + ) self.app.event("app_mention")(event_handler) self.app.shortcut("test-shortcut")(shortcut_handler) self.app.command("/hello-world")(command_handler) @@ -59,7 +65,8 @@ def get_app(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): diff --git a/tests/adapter_tests/test_tornado_oauth.py b/tests/adapter_tests/test_tornado_oauth.py index c42468f2a..ae98a6ac6 100644 --- a/tests/adapter_tests/test_tornado_oauth.py +++ b/tests/adapter_tests/test_tornado_oauth.py @@ -13,7 +13,9 @@ app = App( signing_secret=signing_secret, oauth_settings=OAuthSettings( - client_id="111.111", client_secret="xxx", scopes=["chat:write", "commands"], + client_id="111.111", + client_secret="xxx", + scopes=["chat:write", "commands"], ), ) diff --git a/tests/adapter_tests_async/test_async_fastapi.py b/tests/adapter_tests_async/test_async_fastapi.py index 41b8a332e..f9c2c842b 100644 --- a/tests/adapter_tests_async/test_async_fastapi.py +++ b/tests/adapter_tests_async/test_async_fastapi.py @@ -23,7 +23,10 @@ class TestFastAPI: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -35,7 +38,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -51,7 +55,10 @@ def build_headers(self, timestamp: str, body: str): } def test_events(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) async def event_handler(): pass @@ -89,13 +96,18 @@ async def endpoint(req: Request): client = TestClient(api) response = client.post( - "/slack/events", data=body, headers=self.build_headers(timestamp, body), + "/slack/events", + data=body, + headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 assert self.mock_received_requests["/auth.test"] == 1 def test_shortcuts(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) async def shortcut_handler(ack): await ack() @@ -128,13 +140,18 @@ async def endpoint(req: Request): client = TestClient(api) response = client.post( - "/slack/events", data=body, headers=self.build_headers(timestamp, body), + "/slack/events", + data=body, + headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 assert self.mock_received_requests["/auth.test"] == 1 def test_commands(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) async def command_handler(ack): await ack() @@ -167,7 +184,9 @@ async def endpoint(req: Request): client = TestClient(api) response = client.post( - "/slack/events", data=body, headers=self.build_headers(timestamp, body), + "/slack/events", + data=body, + headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 assert self.mock_received_requests["/auth.test"] == 1 diff --git a/tests/adapter_tests_async/test_async_sanic.py b/tests/adapter_tests_async/test_async_sanic.py index 587f858b6..38d91d95a 100644 --- a/tests/adapter_tests_async/test_async_sanic.py +++ b/tests/adapter_tests_async/test_async_sanic.py @@ -24,7 +24,10 @@ class TestSanic: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) @pytest.fixture def event_loop(self): @@ -40,7 +43,8 @@ def event_loop(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -57,7 +61,10 @@ def build_headers(self, timestamp: str, body: str): @pytest.mark.asyncio async def test_events(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) async def event_handler(): pass @@ -94,14 +101,19 @@ async def endpoint(req: Request): return await app_handler.handle(req) _, response = await api.asgi_client.post( - url="/slack/events", data=body, headers=self.build_headers(timestamp, body), + url="/slack/events", + data=body, + headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 assert self.mock_received_requests["/auth.test"] == 1 @pytest.mark.asyncio async def test_shortcuts(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) async def shortcut_handler(ack): await ack() @@ -133,14 +145,19 @@ async def endpoint(req: Request): return await app_handler.handle(req) _, response = await api.asgi_client.post( - url="/slack/events", data=body, headers=self.build_headers(timestamp, body), + url="/slack/events", + data=body, + headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 assert self.mock_received_requests["/auth.test"] == 1 @pytest.mark.asyncio async def test_commands(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) async def command_handler(ack): await ack() @@ -172,7 +189,9 @@ async def endpoint(req: Request): return await app_handler.handle(req) _, response = await api.asgi_client.post( - url="/slack/events", data=body, headers=self.build_headers(timestamp, body), + url="/slack/events", + data=body, + headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 assert self.mock_received_requests["/auth.test"] == 1 diff --git a/tests/adapter_tests_async/test_async_starlette.py b/tests/adapter_tests_async/test_async_starlette.py index 17c81715f..3faba8b12 100644 --- a/tests/adapter_tests_async/test_async_starlette.py +++ b/tests/adapter_tests_async/test_async_starlette.py @@ -24,7 +24,10 @@ class TestAsyncStarlette: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -36,7 +39,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -52,7 +56,10 @@ def build_headers(self, timestamp: str, body: str): } def test_events(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) async def event_handler(): pass @@ -92,13 +99,18 @@ async def endpoint(req: Request): client = TestClient(api) response = client.post( - "/slack/events", data=body, headers=self.build_headers(timestamp, body), + "/slack/events", + data=body, + headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 assert self.mock_received_requests["/auth.test"] == 1 def test_shortcuts(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) async def shortcut_handler(ack): await ack() @@ -133,13 +145,18 @@ async def endpoint(req: Request): client = TestClient(api) response = client.post( - "/slack/events", data=body, headers=self.build_headers(timestamp, body), + "/slack/events", + data=body, + headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 assert self.mock_received_requests["/auth.test"] == 1 def test_commands(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) async def command_handler(ack): await ack() @@ -174,7 +191,9 @@ async def endpoint(req: Request): client = TestClient(api) response = client.post( - "/slack/events", data=body, headers=self.build_headers(timestamp, body), + "/slack/events", + data=body, + headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 assert self.mock_received_requests["/auth.test"] == 1 diff --git a/tests/scenario_tests/test_app.py b/tests/scenario_tests/test_app.py index af2e98c34..5d91dd577 100644 --- a/tests/scenario_tests/test_app.py +++ b/tests/scenario_tests/test_app.py @@ -19,7 +19,10 @@ class TestApp: signing_secret = "secret" valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -152,7 +155,9 @@ def test_installation_store_conflicts(self): app = App( signing_secret="valid", oauth_settings=OAuthSettings( - client_id="111.222", client_secret="valid", installation_store=store1, + client_id="111.222", + client_secret="valid", + installation_store=store1, ), installation_store=store2, ) @@ -174,7 +179,10 @@ def test_installation_store_conflicts(self): app = App( signing_secret="valid", oauth_flow=OAuthFlow( - settings=OAuthSettings(client_id="111.222", client_secret="valid",) + settings=OAuthSettings( + client_id="111.222", + client_secret="valid", + ) ), installation_store=store1, ) diff --git a/tests/scenario_tests/test_app_bot_only.py b/tests/scenario_tests/test_app_bot_only.py index c6cfca323..53da026f9 100644 --- a/tests/scenario_tests/test_app_bot_only.py +++ b/tests/scenario_tests/test_app_bot_only.py @@ -88,7 +88,10 @@ class TestApp: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -100,7 +103,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): diff --git a/tests/scenario_tests/test_attachment_actions.py b/tests/scenario_tests/test_attachment_actions.py index 3596dbcbd..c520a11ad 100644 --- a/tests/scenario_tests/test_attachment_actions.py +++ b/tests/scenario_tests/test_attachment_actions.py @@ -19,7 +19,10 @@ class TestAttachmentActions: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -31,7 +34,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -52,7 +56,10 @@ def test_mock_server_is_running(self): assert resp != None def test_success_without_type(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.action("pick_channel_for_fun")(simple_listener) request = self.build_valid_request() @@ -61,9 +68,15 @@ def test_success_without_type(self): assert self.mock_received_requests["/auth.test"] == 1 def test_success(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.action( - {"callback_id": "pick_channel_for_fun", "type": "interactive_message",} + { + "callback_id": "pick_channel_for_fun", + "type": "interactive_message", + } )(simple_listener) request = self.build_valid_request() @@ -72,7 +85,10 @@ def test_success(self): assert self.mock_received_requests["/auth.test"] == 1 def test_success_2(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.attachment_action("pick_channel_for_fun")(simple_listener) request = self.build_valid_request() @@ -87,7 +103,10 @@ def test_process_before_response(self): process_before_response=True, ) app.action( - {"callback_id": "pick_channel_for_fun", "type": "interactive_message",} + { + "callback_id": "pick_channel_for_fun", + "type": "interactive_message", + } )(simple_listener) request = self.build_valid_request() @@ -96,7 +115,10 @@ def test_process_before_response(self): assert self.mock_received_requests["/auth.test"] == 1 def test_failure_without_type(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 @@ -108,21 +130,30 @@ def test_failure_without_type(self): assert self.mock_received_requests["/auth.test"] == 1 def test_failure(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 assert self.mock_received_requests["/auth.test"] == 1 - app.action({"callback_id": "unknown", "type": "interactive_message",})( - simple_listener - ) + app.action( + { + "callback_id": "unknown", + "type": "interactive_message", + } + )(simple_listener) response = app.dispatch(request) assert response.status == 404 assert self.mock_received_requests["/auth.test"] == 1 def test_failure_2(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 diff --git a/tests/scenario_tests/test_authorize.py b/tests/scenario_tests/test_authorize.py index 86bebef7d..6bb4345e8 100644 --- a/tests/scenario_tests/test_authorize.py +++ b/tests/scenario_tests/test_authorize.py @@ -24,7 +24,8 @@ def authorize(enterprise_id, team_id, user_id, client: WebClient): assert user_id == "W99999" auth_test = client.auth_test(token=valid_token) return AuthorizeResult.from_auth_test_response( - auth_test_response=auth_test, bot_token=valid_token, + auth_test_response=auth_test, + bot_token=valid_token, ) @@ -34,7 +35,8 @@ def user_authorize(enterprise_id, team_id, user_id, client: WebClient): assert user_id == "W99999" auth_test = client.auth_test(token=valid_user_token) return AuthorizeResult.from_auth_test_response( - auth_test_response=auth_test, user_token=valid_user_token, + auth_test_response=auth_test, + user_token=valid_user_token, ) @@ -49,7 +51,10 @@ class TestAuthorize: signing_secret = "secret" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -61,7 +66,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): diff --git a/tests/scenario_tests/test_block_actions.py b/tests/scenario_tests/test_block_actions.py index bfe851c6f..6280bf6ed 100644 --- a/tests/scenario_tests/test_block_actions.py +++ b/tests/scenario_tests/test_block_actions.py @@ -19,7 +19,10 @@ class TestBlockActions: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -31,7 +34,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -52,7 +56,10 @@ def test_mock_server_is_running(self): assert resp != None def test_success(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.action("a")(simple_listener) request = self.build_valid_request() @@ -61,7 +68,10 @@ def test_success(self): assert self.mock_received_requests["/auth.test"] == 1 def test_success_2(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.block_action("a")(simple_listener) request = self.build_valid_request() @@ -110,7 +120,10 @@ def test_default_type_and_unmatched_block_id(self): assert self.mock_received_requests["/auth.test"] == 1 def test_failure(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 @@ -122,7 +135,10 @@ def test_failure(self): assert self.mock_received_requests["/auth.test"] == 1 def test_failure_2(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 diff --git a/tests/scenario_tests/test_block_suggestion.py b/tests/scenario_tests/test_block_suggestion.py index 341039377..67c5428a8 100644 --- a/tests/scenario_tests/test_block_suggestion.py +++ b/tests/scenario_tests/test_block_suggestion.py @@ -20,7 +20,10 @@ class TestBlockSuggestion: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -32,7 +35,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -59,7 +63,10 @@ def test_mock_server_is_running(self): assert resp != None def test_success(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.options("es_a")(show_options) request = self.build_valid_request() @@ -70,7 +77,10 @@ def test_success(self): assert self.mock_received_requests["/auth.test"] == 1 def test_success_2(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.block_suggestion("es_a")(show_options) request = self.build_valid_request() @@ -81,7 +91,10 @@ def test_success_2(self): assert self.mock_received_requests["/auth.test"] == 1 def test_success_multi(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.options("mes_a")(show_multi_options) request = self.build_valid_multi_request() @@ -122,7 +135,10 @@ def test_process_before_response_multi(self): assert self.mock_received_requests["/auth.test"] == 1 def test_failure(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 @@ -134,7 +150,10 @@ def test_failure(self): assert self.mock_received_requests["/auth.test"] == 1 def test_failure_2(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 @@ -146,7 +165,10 @@ def test_failure_2(self): assert self.mock_received_requests["/auth.test"] == 1 def test_failure_multi(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_multi_request() response = app.dispatch(request) assert response.status == 404 diff --git a/tests/scenario_tests/test_dialogs.py b/tests/scenario_tests/test_dialogs.py index 1d6b20c8f..671ca723e 100644 --- a/tests/scenario_tests/test_dialogs.py +++ b/tests/scenario_tests/test_dialogs.py @@ -19,7 +19,10 @@ class TestAttachmentActions: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -31,7 +34,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -50,7 +54,10 @@ def test_mock_server_is_running(self): assert resp != None def test_success_without_type(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.options("dialog-callback-id")(handle_suggestion) app.action("dialog-callback-id")(handle_submission_cancellation) @@ -74,7 +81,10 @@ def test_success_without_type(self): assert self.mock_received_requests["/auth.test"] == 1 def test_success(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.options({"type": "dialog_suggestion", "callback_id": "dialog-callback-id"})( handle_suggestion ) @@ -105,7 +115,10 @@ def test_success(self): assert self.mock_received_requests["/auth.test"] == 1 def test_success_2(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.dialog_suggestion("dialog-callback-id")(handle_suggestion) app.dialog_submission("dialog-callback-id")(handle_submission) app.dialog_cancellation("dialog-callback-id")(handle_cancellation) @@ -194,7 +207,10 @@ def test_process_before_response_2(self): assert self.mock_received_requests["/auth.test"] == 1 def test_suggestion_failure_without_type(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(suggestion_raw_body) response = app.dispatch(request) assert response.status == 404 @@ -206,7 +222,10 @@ def test_suggestion_failure_without_type(self): assert self.mock_received_requests["/auth.test"] == 1 def test_suggestion_failure(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(suggestion_raw_body) response = app.dispatch(request) assert response.status == 404 @@ -218,7 +237,10 @@ def test_suggestion_failure(self): assert self.mock_received_requests["/auth.test"] == 1 def test_suggestion_failure_2(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(suggestion_raw_body) response = app.dispatch(request) assert response.status == 404 @@ -232,7 +254,10 @@ def test_suggestion_failure_2(self): assert self.mock_received_requests["/auth.test"] == 1 def test_submission_failure_without_type(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(suggestion_raw_body) response = app.dispatch(request) assert response.status == 404 @@ -244,7 +269,10 @@ def test_submission_failure_without_type(self): assert self.mock_received_requests["/auth.test"] == 1 def test_submission_failure(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(suggestion_raw_body) response = app.dispatch(request) assert response.status == 404 @@ -256,7 +284,10 @@ def test_submission_failure(self): assert self.mock_received_requests["/auth.test"] == 1 def test_submission_failure_2(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(suggestion_raw_body) response = app.dispatch(request) assert response.status == 404 @@ -270,7 +301,10 @@ def test_submission_failure_2(self): assert self.mock_received_requests["/auth.test"] == 1 def test_cancellation_failure_without_type(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(suggestion_raw_body) response = app.dispatch(request) assert response.status == 404 @@ -282,7 +316,10 @@ def test_cancellation_failure_without_type(self): assert self.mock_received_requests["/auth.test"] == 1 def test_cancellation_failure(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(suggestion_raw_body) response = app.dispatch(request) assert response.status == 404 @@ -294,7 +331,10 @@ def test_cancellation_failure(self): assert self.mock_received_requests["/auth.test"] == 1 def test_cancellation_failure_2(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(suggestion_raw_body) response = app.dispatch(request) assert response.status == 404 @@ -381,7 +421,10 @@ def handle_submission(ack): "value": "UXD-342", }, {"label": "[FE-459] Remove the marquee tag", "value": "FE-459"}, - {"label": "[FE-238] Too many shades of gray in master CSS", "value": "FE-238",}, + { + "label": "[FE-238] Too many shades of gray in master CSS", + "value": "FE-238", + }, ] } diff --git a/tests/scenario_tests/test_error_handler.py b/tests/scenario_tests/test_error_handler.py index 131454633..7ebcc224d 100644 --- a/tests/scenario_tests/test_error_handler.py +++ b/tests/scenario_tests/test_error_handler.py @@ -19,7 +19,10 @@ class TestErrorHandler: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -35,7 +38,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -48,11 +52,15 @@ def build_headers(self, timestamp: str, body: str): def build_valid_request(self) -> BoltRequest: body = { "type": "block_actions", - "user": {"id": "W111",}, + "user": { + "id": "W111", + }, "api_app_id": "A111", "token": "verification_token", "trigger_id": "111.222.valid", - "team": {"id": "T111",}, + "team": { + "id": "T111", + }, "channel": {"id": "C111", "name": "test-channel"}, "response_url": "https://hooks.slack.com/actions/T111/111/random-value", "actions": [ @@ -80,7 +88,10 @@ def test_default(self): def failing_listener(): raise Exception("Something wrong!") - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.action("a")(failing_listener) request = self.build_valid_request() @@ -95,7 +106,10 @@ def error_handler(logger, payload, response): def failing_listener(): raise Exception("Something wrong!") - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.error(error_handler) app.action("a")(failing_listener) diff --git a/tests/scenario_tests/test_events.py b/tests/scenario_tests/test_events.py index 4a2b02dc8..12ec82742 100644 --- a/tests/scenario_tests/test_events.py +++ b/tests/scenario_tests/test_events.py @@ -17,7 +17,10 @@ class TestEvents: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -29,7 +32,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): diff --git a/tests/scenario_tests/test_events_org_apps.py b/tests/scenario_tests/test_events_org_apps.py index 01dbe4be0..c9c2e737b 100644 --- a/tests/scenario_tests/test_events_org_apps.py +++ b/tests/scenario_tests/test_events_org_apps.py @@ -47,7 +47,8 @@ class TestEventsOrgApps: mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) web_client: WebClient = WebClient( - token=None, base_url=mock_api_server_base_url, + token=None, + base_url=mock_api_server_base_url, ) def setup_method(self): @@ -60,7 +61,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): diff --git a/tests/scenario_tests/test_events_shared_channels.py b/tests/scenario_tests/test_events_shared_channels.py index 702b515f3..9829d91bc 100644 --- a/tests/scenario_tests/test_events_shared_channels.py +++ b/tests/scenario_tests/test_events_shared_channels.py @@ -20,7 +20,8 @@ def authorize(enterprise_id, team_id, client: WebClient): assert team_id == "T_INSTALLED" auth_test = client.auth_test(token=valid_token) return AuthorizeResult.from_auth_test_response( - auth_test_response=auth_test, bot_token=valid_token, + auth_test_response=auth_test, + bot_token=valid_token, ) @@ -29,7 +30,8 @@ class TestEventsSharedChannels: mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) web_client: WebClient = WebClient( - token=None, base_url=mock_api_server_base_url, + token=None, + base_url=mock_api_server_base_url, ) def setup_method(self): @@ -42,7 +44,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): diff --git a/tests/scenario_tests/test_events_socket_mode.py b/tests/scenario_tests/test_events_socket_mode.py index 5a02f9624..2bb8709e4 100644 --- a/tests/scenario_tests/test_events_socket_mode.py +++ b/tests/scenario_tests/test_events_socket_mode.py @@ -15,7 +15,10 @@ class TestEventsSocketMode: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() diff --git a/tests/scenario_tests/test_lazy.py b/tests/scenario_tests/test_lazy.py index 0a81b3488..8a633f8cc 100644 --- a/tests/scenario_tests/test_lazy.py +++ b/tests/scenario_tests/test_lazy.py @@ -19,7 +19,10 @@ class TestErrorHandler: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -35,7 +38,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -48,11 +52,15 @@ def build_headers(self, timestamp: str, body: str): def build_valid_request(self) -> BoltRequest: body = { "type": "block_actions", - "user": {"id": "W111",}, + "user": { + "id": "W111", + }, "api_app_id": "A111", "token": "verification_token", "trigger_id": "111.222.valid", - "team": {"id": "T111",}, + "team": { + "id": "T111", + }, "channel": {"id": "C111", "name": "test-channel"}, "response_url": "https://hooks.slack.com/actions/T111/111/random-value", "actions": [ @@ -88,9 +96,13 @@ def async2(say): time.sleep(0.5) say(text="lazy function 2") - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.action("a")( - ack=just_ack, lazy=[async1, async2], + ack=just_ack, + lazy=[async1, async2], ) request = self.build_valid_request() diff --git a/tests/scenario_tests/test_message.py b/tests/scenario_tests/test_message.py index 1acfe56b7..d99edffc1 100644 --- a/tests/scenario_tests/test_message.py +++ b/tests/scenario_tests/test_message.py @@ -19,7 +19,10 @@ class TestMessage: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -31,7 +34,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -50,7 +54,10 @@ def build_request2(self) -> BoltRequest: return BoltRequest(body=body, headers=self.build_headers(timestamp, body)) def test_string_keyword(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.message("Hello")(whats_up) request = self.build_request() @@ -61,7 +68,10 @@ def test_string_keyword(self): assert self.mock_received_requests["/chat.postMessage"] == 1 def test_string_keyword_capturing(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.message("We've received ([0-9]+) messages from (.+)!")(verify_matches) request = self.build_request2() @@ -72,7 +82,10 @@ def test_string_keyword_capturing(self): assert self.mock_received_requests["/chat.postMessage"] == 1 def test_string_keyword_capturing2(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.message(re.compile("We've received ([0-9]+) messages from (.+)!"))( verify_matches ) @@ -85,7 +98,10 @@ def test_string_keyword_capturing2(self): assert self.mock_received_requests["/chat.postMessage"] == 1 def test_string_keyword_unmatched(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.message("HELLO")(whats_up) request = self.build_request() @@ -94,7 +110,10 @@ def test_string_keyword_unmatched(self): assert self.mock_received_requests["/auth.test"] == 1 def test_regexp_keyword(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.message(re.compile("He.lo"))(whats_up) request = self.build_request() @@ -105,7 +124,10 @@ def test_regexp_keyword(self): assert self.mock_received_requests["/chat.postMessage"] == 1 def test_regexp_keyword_unmatched(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.message(re.compile("HELLO"))(whats_up) request = self.build_request() diff --git a/tests/scenario_tests/test_middleware.py b/tests/scenario_tests/test_middleware.py index 517c1b1ce..569dc6261 100644 --- a/tests/scenario_tests/test_middleware.py +++ b/tests/scenario_tests/test_middleware.py @@ -18,7 +18,10 @@ class TestMiddleware: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -50,7 +53,8 @@ def build_request(self) -> BoltRequest: "content-type": ["application/json"], "x-slack-signature": [ self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) ], "x-slack-request-timestamp": [timestamp], @@ -58,7 +62,10 @@ def build_request(self) -> BoltRequest: ) def test_no_next_call(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.use(no_next) app.shortcut("test-shortcut")(just_ack) @@ -67,7 +74,10 @@ def test_no_next_call(self): assert self.mock_received_requests["/auth.test"] == 1 def test_next_call(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.use(just_next) app.shortcut("test-shortcut")(just_ack) diff --git a/tests/scenario_tests/test_shortcut.py b/tests/scenario_tests/test_shortcut.py index b646d77a3..42143942a 100644 --- a/tests/scenario_tests/test_shortcut.py +++ b/tests/scenario_tests/test_shortcut.py @@ -19,7 +19,10 @@ class TestShortcut: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -31,7 +34,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -51,7 +55,10 @@ def test_mock_server_is_running(self): # NOTE: This is a compatible behavior with Bolt for JS def test_success_both_global_and_message(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.shortcut("test-shortcut")(simple_listener) request = self.build_valid_request(global_shortcut_raw_body) @@ -65,7 +72,10 @@ def test_success_both_global_and_message(self): assert self.mock_received_requests["/auth.test"] == 1 def test_success_global(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.shortcut("test-shortcut")(simple_listener) request = self.build_valid_request(global_shortcut_raw_body) @@ -74,7 +84,10 @@ def test_success_global(self): assert self.mock_received_requests["/auth.test"] == 1 def test_success_global_2(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.global_shortcut("test-shortcut")(simple_listener) request = self.build_valid_request(global_shortcut_raw_body) @@ -88,7 +101,10 @@ def test_success_global_2(self): assert self.mock_received_requests["/auth.test"] == 1 def test_success_message(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.shortcut({"type": "message_action", "callback_id": "test-shortcut"})( simple_listener ) @@ -104,7 +120,10 @@ def test_success_message(self): assert self.mock_received_requests["/auth.test"] == 1 def test_success_message_2(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.message_shortcut("test-shortcut")(simple_listener) request = self.build_valid_request(message_shortcut_raw_body) @@ -131,7 +150,10 @@ def test_process_before_response_global(self): assert self.mock_received_requests["/auth.test"] == 1 def test_failure(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(global_shortcut_raw_body) response = app.dispatch(request) assert response.status == 404 @@ -143,7 +165,10 @@ def test_failure(self): assert self.mock_received_requests["/auth.test"] == 1 def test_failure_2(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(global_shortcut_raw_body) response = app.dispatch(request) assert response.status == 404 diff --git a/tests/scenario_tests/test_slash_command.py b/tests/scenario_tests/test_slash_command.py index acfac442b..23f07dbc0 100644 --- a/tests/scenario_tests/test_slash_command.py +++ b/tests/scenario_tests/test_slash_command.py @@ -18,7 +18,10 @@ class TestSlashCommand: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -30,7 +33,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -49,7 +53,10 @@ def test_mock_server_is_running(self): assert resp != None def test_success(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.command("/hello-world")(commander) request = self.build_valid_request() @@ -71,7 +78,10 @@ def test_process_before_response(self): assert self.mock_received_requests["/auth.test"] == 1 def test_failure(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 diff --git a/tests/scenario_tests/test_ssl_check.py b/tests/scenario_tests/test_ssl_check.py index bb27939fd..3470321de 100644 --- a/tests/scenario_tests/test_ssl_check.py +++ b/tests/scenario_tests/test_ssl_check.py @@ -16,7 +16,10 @@ class TestSSLCheck: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -28,7 +31,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def test_mock_server_is_running(self): diff --git a/tests/scenario_tests/test_view_closed.py b/tests/scenario_tests/test_view_closed.py index 55c34ab4c..8294108f1 100644 --- a/tests/scenario_tests/test_view_closed.py +++ b/tests/scenario_tests/test_view_closed.py @@ -19,7 +19,10 @@ class TestViewClosed: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -31,7 +34,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -52,7 +56,10 @@ def test_mock_server_is_running(self): assert resp != None def test_success(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.view({"type": "view_closed", "callback_id": "view-id"})(simple_listener) request = self.build_valid_request() @@ -61,7 +68,10 @@ def test_success(self): assert self.mock_received_requests["/auth.test"] == 1 def test_success_2(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.view_closed("view-id")(simple_listener) request = self.build_valid_request() @@ -83,7 +93,10 @@ def test_process_before_response(self): assert self.mock_received_requests["/auth.test"] == 1 def test_failure(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 @@ -95,7 +108,10 @@ def test_failure(self): assert self.mock_received_requests["/auth.test"] == 1 def test_failure(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 @@ -107,7 +123,10 @@ def test_failure(self): assert self.mock_received_requests["/auth.test"] == 1 def test_failure_2(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 @@ -143,7 +162,10 @@ def test_failure_2(self): { "type": "input", "block_id": "hspI", - "label": {"type": "plain_text", "text": "Label",}, + "label": { + "type": "plain_text", + "text": "Label", + }, "optional": False, "element": {"type": "plain_text_input", "action_id": "maBWU"}, } @@ -152,11 +174,20 @@ def test_failure_2(self): "callback_id": "view-id", "state": {"values": {}}, "hash": "1596530361.3wRYuk3R", - "title": {"type": "plain_text", "text": "My App",}, + "title": { + "type": "plain_text", + "text": "My App", + }, "clear_on_close": False, "notify_on_close": False, - "close": {"type": "plain_text", "text": "Cancel",}, - "submit": {"type": "plain_text", "text": "Submit",}, + "close": { + "type": "plain_text", + "text": "Cancel", + }, + "submit": { + "type": "plain_text", + "text": "Submit", + }, "previous_view_id": None, "root_view_id": "V111", "app_id": "A111", diff --git a/tests/scenario_tests/test_view_submission.py b/tests/scenario_tests/test_view_submission.py index c0ecbfa2e..ced03e181 100644 --- a/tests/scenario_tests/test_view_submission.py +++ b/tests/scenario_tests/test_view_submission.py @@ -19,7 +19,10 @@ class TestViewSubmission: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -31,7 +34,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -52,7 +56,10 @@ def test_mock_server_is_running(self): assert resp != None def test_success(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.view("view-id")(simple_listener) request = self.build_valid_request() @@ -61,7 +68,10 @@ def test_success(self): assert self.mock_received_requests["/auth.test"] == 1 def test_success_2(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.view_submission("view-id")(simple_listener) request = self.build_valid_request() @@ -83,7 +93,10 @@ def test_process_before_response(self): assert self.mock_received_requests["/auth.test"] == 1 def test_failure(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 @@ -95,7 +108,10 @@ def test_failure(self): assert self.mock_received_requests["/auth.test"] == 1 def test_failure_2(self): - app = App(client=self.web_client, signing_secret=self.signing_secret,) + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 @@ -132,7 +148,10 @@ def test_failure_2(self): { "type": "input", "block_id": "hspI", - "label": {"type": "plain_text", "text": "Label",}, + "label": { + "type": "plain_text", + "text": "Label", + }, "optional": False, "element": {"type": "plain_text_input", "action_id": "maBWU"}, } @@ -143,11 +162,20 @@ def test_failure_2(self): "values": {"hspI": {"maBWU": {"type": "plain_text_input", "value": "test"}}} }, "hash": "1596530361.3wRYuk3R", - "title": {"type": "plain_text", "text": "My App",}, + "title": { + "type": "plain_text", + "text": "My App", + }, "clear_on_close": False, "notify_on_close": False, - "close": {"type": "plain_text", "text": "Cancel",}, - "submit": {"type": "plain_text", "text": "Submit",}, + "close": { + "type": "plain_text", + "text": "Cancel", + }, + "submit": { + "type": "plain_text", + "text": "Submit", + }, "previous_view_id": None, "root_view_id": "V111", "app_id": "A111", diff --git a/tests/scenario_tests/test_workflow_steps.py b/tests/scenario_tests/test_workflow_steps.py index 9dacd83a3..b41d32e12 100644 --- a/tests/scenario_tests/test_workflow_steps.py +++ b/tests/scenario_tests/test_workflow_steps.py @@ -32,7 +32,8 @@ def teardown_method(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_app(self, callback_id: str): @@ -364,7 +365,10 @@ def edit(ack: Ack, step, configure: Configure): "element": { "type": "plain_text_input", "action_id": "task_name", - "placeholder": {"type": "plain_text", "text": "Write a task name",}, + "placeholder": { + "type": "plain_text", + "text": "Write a task name", + }, }, "label": {"type": "plain_text", "text": "Task name"}, }, @@ -387,7 +391,10 @@ def edit(ack: Ack, step, configure: Configure): "element": { "type": "plain_text_input", "action_id": "task_author", - "placeholder": {"type": "plain_text", "text": "Write a task name",}, + "placeholder": { + "type": "plain_text", + "text": "Write a task name", + }, }, "label": {"type": "plain_text", "text": "Task author"}, }, @@ -414,9 +421,21 @@ def save(ack: Ack, step: dict, view: dict, update: Update): }, }, outputs=[ - {"name": "taskName", "type": "text", "label": "Task Name",}, - {"name": "taskDescription", "type": "text", "label": "Task Description",}, - {"name": "taskAuthorEmail", "type": "text", "label": "Task Author Email",}, + { + "name": "taskName", + "type": "text", + "label": "Task Name", + }, + { + "name": "taskDescription", + "type": "text", + "label": "Task Description", + }, + { + "name": "taskAuthorEmail", + "type": "text", + "label": "Task Author Email", + }, ], ) ack() @@ -487,7 +506,8 @@ def save_lazy(step: dict, view: dict, update: Update): assert step is not None assert view is not None update( - inputs={}, outputs=[], + inputs={}, + outputs=[], ) diff --git a/tests/scenario_tests_async/test_app.py b/tests/scenario_tests_async/test_app.py index 6f9d0a8a8..1640087bc 100644 --- a/tests/scenario_tests_async/test_app.py +++ b/tests/scenario_tests_async/test_app.py @@ -131,7 +131,9 @@ def test_installation_store_conflicts(self): app = AsyncApp( signing_secret="valid", oauth_settings=AsyncOAuthSettings( - client_id="111.222", client_secret="valid", installation_store=store1, + client_id="111.222", + client_secret="valid", + installation_store=store1, ), installation_store=store2, ) @@ -153,7 +155,10 @@ def test_installation_store_conflicts(self): app = AsyncApp( signing_secret="valid", oauth_flow=AsyncOAuthFlow( - settings=AsyncOAuthSettings(client_id="111.222", client_secret="valid",) + settings=AsyncOAuthSettings( + client_id="111.222", + client_secret="valid", + ) ), installation_store=store1, ) diff --git a/tests/scenario_tests_async/test_app_bot_only.py b/tests/scenario_tests_async/test_app_bot_only.py index e664269bb..58685393a 100644 --- a/tests/scenario_tests_async/test_app_bot_only.py +++ b/tests/scenario_tests_async/test_app_bot_only.py @@ -29,7 +29,10 @@ class TestAppBotOnly: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) @pytest.fixture def event_loop(self): @@ -45,7 +48,8 @@ def event_loop(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): diff --git a/tests/scenario_tests_async/test_attachment_actions.py b/tests/scenario_tests_async/test_attachment_actions.py index 34110bd38..00338c68e 100644 --- a/tests/scenario_tests_async/test_attachment_actions.py +++ b/tests/scenario_tests_async/test_attachment_actions.py @@ -21,7 +21,10 @@ class TestAsyncAttachmentActions: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) @pytest.fixture def event_loop(self): @@ -37,7 +40,8 @@ def event_loop(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -60,7 +64,10 @@ async def test_mock_server_is_running(self): @pytest.mark.asyncio async def test_success_without_type(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.action("pick_channel_for_fun")(simple_listener) request = self.build_valid_request() @@ -70,9 +77,15 @@ async def test_success_without_type(self): @pytest.mark.asyncio async def test_success(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.action( - {"callback_id": "pick_channel_for_fun", "type": "interactive_message",} + { + "callback_id": "pick_channel_for_fun", + "type": "interactive_message", + } )(simple_listener) request = self.build_valid_request() @@ -82,7 +95,10 @@ async def test_success(self): @pytest.mark.asyncio async def test_success_2(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.attachment_action("pick_channel_for_fun")(simple_listener) request = self.build_valid_request() @@ -98,7 +114,10 @@ async def test_process_before_response(self): process_before_response=True, ) app.action( - {"callback_id": "pick_channel_for_fun", "type": "interactive_message",} + { + "callback_id": "pick_channel_for_fun", + "type": "interactive_message", + } )(simple_listener) request = self.build_valid_request() @@ -122,7 +141,10 @@ async def test_process_before_response_2(self): @pytest.mark.asyncio async def test_failure_without_type(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 @@ -135,22 +157,31 @@ async def test_failure_without_type(self): @pytest.mark.asyncio async def test_failure(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 assert self.mock_received_requests["/auth.test"] == 1 - app.action({"callback_id": "unknown", "type": "interactive_message",})( - simple_listener - ) + app.action( + { + "callback_id": "unknown", + "type": "interactive_message", + } + )(simple_listener) response = await app.async_dispatch(request) assert response.status == 404 assert self.mock_received_requests["/auth.test"] == 1 @pytest.mark.asyncio async def test_failure_2(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 diff --git a/tests/scenario_tests_async/test_authorize.py b/tests/scenario_tests_async/test_authorize.py index 83e7d45a3..01a3c4331 100644 --- a/tests/scenario_tests_async/test_authorize.py +++ b/tests/scenario_tests_async/test_authorize.py @@ -26,7 +26,8 @@ async def authorize(enterprise_id, team_id, user_id, client: AsyncWebClient): assert user_id == "W99999" auth_test = await client.auth_test(token=valid_token) return AuthorizeResult.from_auth_test_response( - auth_test_response=auth_test, bot_token=valid_token, + auth_test_response=auth_test, + bot_token=valid_token, ) @@ -36,7 +37,8 @@ async def user_authorize(enterprise_id, team_id, user_id, client: AsyncWebClient assert user_id == "W99999" auth_test = await client.auth_test(token=valid_user_token) return AuthorizeResult.from_auth_test_response( - auth_test_response=auth_test, user_token=valid_user_token, + auth_test_response=auth_test, + user_token=valid_user_token, ) @@ -51,7 +53,10 @@ class TestAsyncAuthorize: signing_secret = "secret" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) @pytest.fixture def event_loop(self): @@ -67,7 +72,8 @@ def event_loop(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): diff --git a/tests/scenario_tests_async/test_block_actions.py b/tests/scenario_tests_async/test_block_actions.py index 3eab11552..4ee1b1fb1 100644 --- a/tests/scenario_tests_async/test_block_actions.py +++ b/tests/scenario_tests_async/test_block_actions.py @@ -22,7 +22,10 @@ class TestAsyncBlockActions: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) @pytest.fixture def event_loop(self): @@ -38,7 +41,8 @@ def event_loop(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -61,7 +65,10 @@ async def test_mock_server_is_running(self): @pytest.mark.asyncio async def test_success(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.action("a")(simple_listener) request = self.build_valid_request() @@ -71,7 +78,10 @@ async def test_success(self): @pytest.mark.asyncio async def test_success_2(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.block_action("a")(simple_listener) request = self.build_valid_request() @@ -81,7 +91,10 @@ async def test_success_2(self): @pytest.mark.asyncio async def test_default_type(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.action({"action_id": "a", "block_id": "b"})(simple_listener) request = self.build_valid_request() @@ -91,7 +104,10 @@ async def test_default_type(self): @pytest.mark.asyncio async def test_default_type_no_block_id(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.action({"action_id": "a"})(simple_listener) request = self.build_valid_request() @@ -101,7 +117,10 @@ async def test_default_type_no_block_id(self): @pytest.mark.asyncio async def test_default_type_unmatched_block_id(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.action({"action_id": "a", "block_id": "bbb"})(simple_listener) request = self.build_valid_request() @@ -139,7 +158,10 @@ async def test_process_before_response_2(self): @pytest.mark.asyncio async def test_failure(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 @@ -152,7 +174,10 @@ async def test_failure(self): @pytest.mark.asyncio async def test_failure_2(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 diff --git a/tests/scenario_tests_async/test_block_suggestion.py b/tests/scenario_tests_async/test_block_suggestion.py index b6f7aa80c..7351b290b 100644 --- a/tests/scenario_tests_async/test_block_suggestion.py +++ b/tests/scenario_tests_async/test_block_suggestion.py @@ -22,7 +22,10 @@ class TestAsyncBlockSuggestion: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) @pytest.fixture def event_loop(self): @@ -38,7 +41,8 @@ def event_loop(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -67,7 +71,10 @@ async def test_mock_server_is_running(self): @pytest.mark.asyncio async def test_success(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.options("es_a")(show_options) request = self.build_valid_request() @@ -79,7 +86,10 @@ async def test_success(self): @pytest.mark.asyncio async def test_success_2(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.block_suggestion("es_a")(show_options) request = self.build_valid_request() @@ -91,7 +101,10 @@ async def test_success_2(self): @pytest.mark.asyncio async def test_success_multi(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.options("mes_a")(show_multi_options) request = self.build_valid_multi_request() @@ -135,7 +148,10 @@ async def test_process_before_response_multi(self): @pytest.mark.asyncio async def test_failure(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 @@ -148,7 +164,10 @@ async def test_failure(self): @pytest.mark.asyncio async def test_failure_2(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 @@ -161,7 +180,10 @@ async def test_failure_2(self): @pytest.mark.asyncio async def test_failure_multi(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_multi_request() response = await app.async_dispatch(request) assert response.status == 404 diff --git a/tests/scenario_tests_async/test_dialogs.py b/tests/scenario_tests_async/test_dialogs.py index 2f99d468f..1cad07ff4 100644 --- a/tests/scenario_tests_async/test_dialogs.py +++ b/tests/scenario_tests_async/test_dialogs.py @@ -21,7 +21,10 @@ class TestAsyncAttachmentActions: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) @pytest.fixture def event_loop(self): @@ -37,7 +40,8 @@ def event_loop(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -58,7 +62,10 @@ async def test_mock_server_is_running(self): @pytest.mark.asyncio async def test_success_without_type(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.options("dialog-callback-id")(handle_suggestion) app.action("dialog-callback-id")(handle_submission_or_cancellation) @@ -83,7 +90,10 @@ async def test_success_without_type(self): @pytest.mark.asyncio async def test_success(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.options({"type": "dialog_suggestion", "callback_id": "dialog-callback-id"})( handle_suggestion ) @@ -115,7 +125,10 @@ async def test_success(self): @pytest.mark.asyncio async def test_success_2(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.dialog_suggestion("dialog-callback-id")(handle_suggestion) app.dialog_submission("dialog-callback-id")(handle_submission) app.dialog_cancellation("dialog-callback-id")(handle_cancellation) @@ -207,7 +220,10 @@ async def test_process_before_response_2(self): @pytest.mark.asyncio async def test_suggestion_failure_without_type(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(suggestion_raw_body) response = await app.async_dispatch(request) assert response.status == 404 @@ -220,7 +236,10 @@ async def test_suggestion_failure_without_type(self): @pytest.mark.asyncio async def test_suggestion_failure(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(suggestion_raw_body) response = await app.async_dispatch(request) assert response.status == 404 @@ -233,7 +252,10 @@ async def test_suggestion_failure(self): @pytest.mark.asyncio async def test_suggestion_failure_2(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(suggestion_raw_body) response = await app.async_dispatch(request) assert response.status == 404 @@ -248,7 +270,10 @@ async def test_suggestion_failure_2(self): @pytest.mark.asyncio async def test_submission_failure_without_type(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(suggestion_raw_body) response = await app.async_dispatch(request) assert response.status == 404 @@ -261,7 +286,10 @@ async def test_submission_failure_without_type(self): @pytest.mark.asyncio async def test_submission_failure(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(suggestion_raw_body) response = await app.async_dispatch(request) assert response.status == 404 @@ -274,7 +302,10 @@ async def test_submission_failure(self): @pytest.mark.asyncio async def test_submission_failure_2(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(suggestion_raw_body) response = await app.async_dispatch(request) assert response.status == 404 @@ -289,7 +320,10 @@ async def test_submission_failure_2(self): @pytest.mark.asyncio async def test_cancellation_failure_without_type(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(suggestion_raw_body) response = await app.async_dispatch(request) assert response.status == 404 @@ -302,7 +336,10 @@ async def test_cancellation_failure_without_type(self): @pytest.mark.asyncio async def test_cancellation_failure(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(suggestion_raw_body) response = await app.async_dispatch(request) assert response.status == 404 @@ -315,7 +352,10 @@ async def test_cancellation_failure(self): @pytest.mark.asyncio async def test_cancellation_failure_2(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(suggestion_raw_body) response = await app.async_dispatch(request) assert response.status == 404 @@ -402,7 +442,10 @@ async def handle_submission(ack): "value": "UXD-342", }, {"label": "[FE-459] Remove the marquee tag", "value": "FE-459"}, - {"label": "[FE-238] Too many shades of gray in master CSS", "value": "FE-238",}, + { + "label": "[FE-238] Too many shades of gray in master CSS", + "value": "FE-238", + }, ] } diff --git a/tests/scenario_tests_async/test_error_handler.py b/tests/scenario_tests_async/test_error_handler.py index 6a599c5a0..d0e553ff4 100644 --- a/tests/scenario_tests_async/test_error_handler.py +++ b/tests/scenario_tests_async/test_error_handler.py @@ -21,7 +21,10 @@ class TestAsyncErrorHandler: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) @pytest.fixture def event_loop(self): @@ -41,7 +44,8 @@ def event_loop(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -54,11 +58,15 @@ def build_headers(self, timestamp: str, body: str): def build_valid_request(self) -> AsyncBoltRequest: body = { "type": "block_actions", - "user": {"id": "W111",}, + "user": { + "id": "W111", + }, "api_app_id": "A111", "token": "verification_token", "trigger_id": "111.222.valid", - "team": {"id": "T111",}, + "team": { + "id": "T111", + }, "channel": {"id": "C111", "name": "test-channel"}, "response_url": "https://hooks.slack.com/actions/T111/111/random-value", "actions": [ @@ -87,7 +95,10 @@ async def test_default(self): async def failing_listener(): raise Exception("Something wrong!") - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.action("a")(failing_listener) request = self.build_valid_request() @@ -103,7 +114,10 @@ async def error_handler(logger, payload, response): async def failing_listener(): raise Exception("Something wrong!") - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.error(error_handler) app.action("a")(failing_listener) diff --git a/tests/scenario_tests_async/test_events.py b/tests/scenario_tests_async/test_events.py index 67e02db0b..346883bee 100644 --- a/tests/scenario_tests_async/test_events.py +++ b/tests/scenario_tests_async/test_events.py @@ -22,7 +22,10 @@ class TestAsyncEvents: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) @pytest.fixture def event_loop(self): @@ -38,7 +41,8 @@ def event_loop(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -59,7 +63,10 @@ async def test_mock_server_is_running(self): @pytest.mark.asyncio async def test_app_mention(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.event("app_mention")(whats_up) request = self.build_valid_app_mention_request() @@ -97,7 +104,10 @@ async def test_middleware_skip(self): @pytest.mark.asyncio async def test_simultaneous_requests(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.event("app_mention")(random_sleeper) request = self.build_valid_app_mention_request() @@ -120,7 +130,10 @@ def build_valid_reaction_added_request(self) -> AsyncBoltRequest: @pytest.mark.asyncio async def test_reaction_added(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.event("reaction_added")(whats_up) request = self.build_valid_reaction_added_request() @@ -132,7 +145,10 @@ async def test_reaction_added(self): @pytest.mark.asyncio async def test_stable_auto_ack(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.event("reaction_added")(always_failing) for _ in range(10): @@ -142,7 +158,10 @@ async def test_stable_auto_ack(self): @pytest.mark.asyncio async def test_self_events(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.event("reaction_added")(whats_up) self_event = { @@ -180,7 +199,10 @@ async def test_self_events(self): @pytest.mark.asyncio async def test_self_joined_left_events(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.event("reaction_added")(whats_up) join_event_body = { @@ -249,7 +271,10 @@ async def handle_member_left_channel(say): @pytest.mark.asyncio async def test_joined_left_events(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.event("reaction_added")(whats_up) join_event_body = { diff --git a/tests/scenario_tests_async/test_events_org_apps.py b/tests/scenario_tests_async/test_events_org_apps.py index 04182d937..596927879 100644 --- a/tests/scenario_tests_async/test_events_org_apps.py +++ b/tests/scenario_tests_async/test_events_org_apps.py @@ -68,7 +68,8 @@ def event_loop(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): diff --git a/tests/scenario_tests_async/test_events_shared_channels.py b/tests/scenario_tests_async/test_events_shared_channels.py index 0fb85f11d..b7877cf15 100644 --- a/tests/scenario_tests_async/test_events_shared_channels.py +++ b/tests/scenario_tests_async/test_events_shared_channels.py @@ -25,7 +25,8 @@ async def authorize(enterprise_id, team_id, client: AsyncWebClient): assert team_id == "T_INSTALLED" auth_test = await client.auth_test(token=valid_token) return AuthorizeResult.from_auth_test_response( - auth_test_response=auth_test, bot_token=valid_token, + auth_test_response=auth_test, + bot_token=valid_token, ) @@ -50,7 +51,8 @@ def event_loop(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): diff --git a/tests/scenario_tests_async/test_events_socket_mode.py b/tests/scenario_tests_async/test_events_socket_mode.py index d668f963c..ce6485f41 100644 --- a/tests/scenario_tests_async/test_events_socket_mode.py +++ b/tests/scenario_tests_async/test_events_socket_mode.py @@ -17,7 +17,10 @@ class TestAsyncEvents: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" - web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) @pytest.fixture def event_loop(self): @@ -53,7 +56,10 @@ async def test_app_mention(self): @pytest.mark.asyncio async def test_process_before_response(self): - app = AsyncApp(client=self.web_client, process_before_response=True,) + app = AsyncApp( + client=self.web_client, + process_before_response=True, + ) app.event("app_mention")(whats_up) request = self.build_valid_app_mention_request() diff --git a/tests/scenario_tests_async/test_lazy.py b/tests/scenario_tests_async/test_lazy.py index 229c7709b..f8fe438bc 100644 --- a/tests/scenario_tests_async/test_lazy.py +++ b/tests/scenario_tests_async/test_lazy.py @@ -21,7 +21,10 @@ class TestAsyncLazy: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) @pytest.fixture def event_loop(self): @@ -41,7 +44,8 @@ def event_loop(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -54,11 +58,15 @@ def build_headers(self, timestamp: str, body: str): def build_valid_request(self) -> AsyncBoltRequest: body = { "type": "block_actions", - "user": {"id": "W111",}, + "user": { + "id": "W111", + }, "api_app_id": "A111", "token": "verification_token", "trigger_id": "111.222.valid", - "team": {"id": "T111",}, + "team": { + "id": "T111", + }, "channel": {"id": "C111", "name": "test-channel"}, "response_url": "https://hooks.slack.com/actions/T111/111/random-value", "actions": [ @@ -95,9 +103,13 @@ async def async2(say): await asyncio.sleep(0.5) await say(text="lazy function 2") - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.action("a")( - ack=just_ack, lazy=[async1, async2], + ack=just_ack, + lazy=[async1, async2], ) request = self.build_valid_request() diff --git a/tests/scenario_tests_async/test_message.py b/tests/scenario_tests_async/test_message.py index c2d6dda52..60ed2e458 100644 --- a/tests/scenario_tests_async/test_message.py +++ b/tests/scenario_tests_async/test_message.py @@ -21,7 +21,10 @@ class TestAsyncMessage: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) @pytest.fixture def event_loop(self): @@ -37,7 +40,8 @@ def event_loop(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -57,7 +61,10 @@ def build_request2(self) -> AsyncBoltRequest: @pytest.mark.asyncio async def test_string_keyword(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.message("Hello")(whats_up) request = self.build_request() @@ -69,7 +76,10 @@ async def test_string_keyword(self): @pytest.mark.asyncio async def test_string_keyword_capturing(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.message("We've received ([0-9]+) messages from (.+)!")(verify_matches) request = self.build_request2() @@ -81,7 +91,10 @@ async def test_string_keyword_capturing(self): @pytest.mark.asyncio async def test_string_keyword_capturing2(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.message(re.compile("We've received ([0-9]+) messages from (.+)!"))( verify_matches ) @@ -95,7 +108,10 @@ async def test_string_keyword_capturing2(self): @pytest.mark.asyncio async def test_string_keyword_unmatched(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.message("HELLO")(whats_up) request = self.build_request() @@ -105,7 +121,10 @@ async def test_string_keyword_unmatched(self): @pytest.mark.asyncio async def test_regexp_keyword(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.message(re.compile("He.lo"))(whats_up) request = self.build_request() @@ -117,7 +136,10 @@ async def test_regexp_keyword(self): @pytest.mark.asyncio async def test_regexp_keyword_unmatched(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.message(re.compile("HELLO"))(whats_up) request = self.build_request() diff --git a/tests/scenario_tests_async/test_middleware.py b/tests/scenario_tests_async/test_middleware.py index 3b81a387f..bcc8d4baf 100644 --- a/tests/scenario_tests_async/test_middleware.py +++ b/tests/scenario_tests_async/test_middleware.py @@ -20,7 +20,10 @@ class TestAsyncMiddleware: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) @pytest.fixture def event_loop(self): @@ -56,7 +59,8 @@ def build_request(self) -> AsyncBoltRequest: "content-type": ["application/json"], "x-slack-signature": [ self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) ], "x-slack-request-timestamp": [timestamp], @@ -65,7 +69,10 @@ def build_request(self) -> AsyncBoltRequest: @pytest.mark.asyncio async def test_no_next_call(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.use(no_next) app.shortcut("test-shortcut")(just_ack) @@ -75,7 +82,10 @@ async def test_no_next_call(self): @pytest.mark.asyncio async def test_next_call(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.use(just_next) app.shortcut("test-shortcut")(just_ack) diff --git a/tests/scenario_tests_async/test_shortcut.py b/tests/scenario_tests_async/test_shortcut.py index aac7cde89..5627198af 100644 --- a/tests/scenario_tests_async/test_shortcut.py +++ b/tests/scenario_tests_async/test_shortcut.py @@ -21,7 +21,10 @@ class TestAsyncShortcut: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) @pytest.fixture def event_loop(self): @@ -37,7 +40,8 @@ def event_loop(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -59,7 +63,10 @@ async def test_mock_server_is_running(self): # NOTE: This is a compatible behavior with Bolt for JS @pytest.mark.asyncio async def test_success_both_global_and_message(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.shortcut("test-shortcut")(simple_listener) request = self.build_valid_request(global_shortcut_raw_body) @@ -74,7 +81,10 @@ async def test_success_both_global_and_message(self): @pytest.mark.asyncio async def test_success_global(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.shortcut("test-shortcut")(simple_listener) request = self.build_valid_request(global_shortcut_raw_body) @@ -84,7 +94,10 @@ async def test_success_global(self): @pytest.mark.asyncio async def test_success_global_2(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.global_shortcut("test-shortcut")(simple_listener) request = self.build_valid_request(global_shortcut_raw_body) @@ -99,7 +112,10 @@ async def test_success_global_2(self): @pytest.mark.asyncio async def test_success_message(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.shortcut({"type": "message_action", "callback_id": "test-shortcut"})( simple_listener ) @@ -116,7 +132,10 @@ async def test_success_message(self): @pytest.mark.asyncio async def test_success_message_2(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.message_shortcut("test-shortcut")(simple_listener) request = self.build_valid_request(message_shortcut_raw_body) @@ -145,7 +164,10 @@ async def test_process_before_response_global(self): @pytest.mark.asyncio async def test_failure(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(global_shortcut_raw_body) response = await app.async_dispatch(request) assert response.status == 404 @@ -158,7 +180,10 @@ async def test_failure(self): @pytest.mark.asyncio async def test_failure_2(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request(global_shortcut_raw_body) response = await app.async_dispatch(request) assert response.status == 404 diff --git a/tests/scenario_tests_async/test_slash_command.py b/tests/scenario_tests_async/test_slash_command.py index 84d8a44eb..44c881b9a 100644 --- a/tests/scenario_tests_async/test_slash_command.py +++ b/tests/scenario_tests_async/test_slash_command.py @@ -20,7 +20,10 @@ class TestAsyncSlashCommand: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) @pytest.fixture def event_loop(self): @@ -36,7 +39,8 @@ def event_loop(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -57,7 +61,10 @@ async def test_mock_server_is_running(self): @pytest.mark.asyncio async def test_success(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.command("/hello-world")(commander) request = self.build_valid_request() @@ -81,7 +88,10 @@ async def test_process_before_response(self): @pytest.mark.asyncio async def test_failure(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 diff --git a/tests/scenario_tests_async/test_ssl_check.py b/tests/scenario_tests_async/test_ssl_check.py index 3a22e85b8..651255903 100644 --- a/tests/scenario_tests_async/test_ssl_check.py +++ b/tests/scenario_tests_async/test_ssl_check.py @@ -19,7 +19,10 @@ class TestAsyncSSLCheck: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) @pytest.fixture def event_loop(self): @@ -35,7 +38,8 @@ def event_loop(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) @pytest.mark.asyncio diff --git a/tests/scenario_tests_async/test_view_closed.py b/tests/scenario_tests_async/test_view_closed.py index 020301284..d5af6167c 100644 --- a/tests/scenario_tests_async/test_view_closed.py +++ b/tests/scenario_tests_async/test_view_closed.py @@ -21,7 +21,10 @@ class TestAsyncViewClosed: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) @pytest.fixture def event_loop(self): @@ -37,7 +40,8 @@ def event_loop(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -60,7 +64,10 @@ async def test_mock_server_is_running(self): @pytest.mark.asyncio async def test_success(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.view({"type": "view_closed", "callback_id": "view-id"})(simple_listener) request = self.build_valid_request() @@ -70,7 +77,10 @@ async def test_success(self): @pytest.mark.asyncio async def test_success_2(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.view_closed("view-id")(simple_listener) request = self.build_valid_request() @@ -94,7 +104,10 @@ async def test_process_before_response(self): @pytest.mark.asyncio async def test_failure(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 @@ -107,7 +120,10 @@ async def test_failure(self): @pytest.mark.asyncio async def test_failure(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 @@ -120,7 +136,10 @@ async def test_failure(self): @pytest.mark.asyncio async def test_failure_2(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 @@ -156,7 +175,10 @@ async def test_failure_2(self): { "type": "input", "block_id": "hspI", - "label": {"type": "plain_text", "text": "Label",}, + "label": { + "type": "plain_text", + "text": "Label", + }, "optional": False, "element": {"type": "plain_text_input", "action_id": "maBWU"}, } @@ -165,11 +187,20 @@ async def test_failure_2(self): "callback_id": "view-id", "state": {"values": {}}, "hash": "1596530361.3wRYuk3R", - "title": {"type": "plain_text", "text": "My App",}, + "title": { + "type": "plain_text", + "text": "My App", + }, "clear_on_close": False, "notify_on_close": False, - "close": {"type": "plain_text", "text": "Cancel",}, - "submit": {"type": "plain_text", "text": "Submit",}, + "close": { + "type": "plain_text", + "text": "Cancel", + }, + "submit": { + "type": "plain_text", + "text": "Submit", + }, "previous_view_id": None, "root_view_id": "V111", "app_id": "A111", diff --git a/tests/scenario_tests_async/test_view_submission.py b/tests/scenario_tests_async/test_view_submission.py index 4c5fa672d..2d7e1d993 100644 --- a/tests/scenario_tests_async/test_view_submission.py +++ b/tests/scenario_tests_async/test_view_submission.py @@ -21,7 +21,10 @@ class TestAsyncViewSubmission: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) @pytest.fixture def event_loop(self): @@ -37,7 +40,8 @@ def event_loop(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): @@ -60,7 +64,10 @@ async def test_mock_server_is_running(self): @pytest.mark.asyncio async def test_success(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.view("view-id")(simple_listener) request = self.build_valid_request() @@ -70,7 +77,10 @@ async def test_success(self): @pytest.mark.asyncio async def test_success_2(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) app.view_submission("view-id")(simple_listener) request = self.build_valid_request() @@ -94,7 +104,10 @@ async def test_process_before_response(self): @pytest.mark.asyncio async def test_failure(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 @@ -107,7 +120,10 @@ async def test_failure(self): @pytest.mark.asyncio async def test_failure_2(self): - app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret,) + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 @@ -144,7 +160,10 @@ async def test_failure_2(self): { "type": "input", "block_id": "hspI", - "label": {"type": "plain_text", "text": "Label",}, + "label": { + "type": "plain_text", + "text": "Label", + }, "optional": False, "element": {"type": "plain_text_input", "action_id": "maBWU"}, } @@ -155,11 +174,20 @@ async def test_failure_2(self): "values": {"hspI": {"maBWU": {"type": "plain_text_input", "value": "test"}}} }, "hash": "1596530361.3wRYuk3R", - "title": {"type": "plain_text", "text": "My App",}, + "title": { + "type": "plain_text", + "text": "My App", + }, "clear_on_close": False, "notify_on_close": False, - "close": {"type": "plain_text", "text": "Cancel",}, - "submit": {"type": "plain_text", "text": "Submit",}, + "close": { + "type": "plain_text", + "text": "Cancel", + }, + "submit": { + "type": "plain_text", + "text": "Submit", + }, "previous_view_id": None, "root_view_id": "V111", "app_id": "A111", diff --git a/tests/scenario_tests_async/test_workflow_steps.py b/tests/scenario_tests_async/test_workflow_steps.py index 525a6f568..0d36ef99b 100644 --- a/tests/scenario_tests_async/test_workflow_steps.py +++ b/tests/scenario_tests_async/test_workflow_steps.py @@ -27,7 +27,10 @@ class TestAsyncWorkflowSteps: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" signature_verifier = SignatureVerifier(signing_secret) - web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) @pytest.fixture def event_loop(self): @@ -43,7 +46,8 @@ def event_loop(self): def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_app(self, callback_id: str): @@ -381,7 +385,10 @@ async def edit(ack: AsyncAck, step, configure: AsyncConfigure): "element": { "type": "plain_text_input", "action_id": "task_name", - "placeholder": {"type": "plain_text", "text": "Write a task name",}, + "placeholder": { + "type": "plain_text", + "text": "Write a task name", + }, }, "label": {"type": "plain_text", "text": "Task name"}, }, @@ -404,7 +411,10 @@ async def edit(ack: AsyncAck, step, configure: AsyncConfigure): "element": { "type": "plain_text_input", "action_id": "task_author", - "placeholder": {"type": "plain_text", "text": "Write a task name",}, + "placeholder": { + "type": "plain_text", + "text": "Write a task name", + }, }, "label": {"type": "plain_text", "text": "Task author"}, }, @@ -431,9 +441,21 @@ async def save(ack: AsyncAck, step: dict, view: dict, update: AsyncUpdate): }, }, outputs=[ - {"name": "taskName", "type": "text", "label": "Task Name",}, - {"name": "taskDescription", "type": "text", "label": "Task Description",}, - {"name": "taskAuthorEmail", "type": "text", "label": "Task Author Email",}, + { + "name": "taskName", + "type": "text", + "label": "Task Name", + }, + { + "name": "taskDescription", + "type": "text", + "label": "Task Description", + }, + { + "name": "taskAuthorEmail", + "type": "text", + "label": "Task Author Email", + }, ], ) await ack() @@ -506,7 +528,8 @@ async def save_lazy(step: dict, view: dict, update: AsyncUpdate): assert step is not None assert view is not None await update( - inputs={}, outputs=[], + inputs={}, + outputs=[], ) diff --git a/tests/slack_bolt/app/test_dev_server.py b/tests/slack_bolt/app/test_dev_server.py index 7e09c6102..978cffc3f 100644 --- a/tests/slack_bolt/app/test_dev_server.py +++ b/tests/slack_bolt/app/test_dev_server.py @@ -12,7 +12,10 @@ class TestDevServer: signing_secret = "secret" valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" - web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url,) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) def setup_method(self): self.old_os_env = remove_os_env_temporarily() diff --git a/tests/slack_bolt/context/test_ack.py b/tests/slack_bolt/context/test_ack.py index 9ecb17a69..e7d7443e9 100644 --- a/tests/slack_bolt/context/test_ack.py +++ b/tests/slack_bolt/context/test_ack.py @@ -138,8 +138,14 @@ def test_view_update(self): view={ "type": "modal", "callback_id": "view-id", - "title": {"type": "plain_text", "text": "My App",}, - "close": {"type": "plain_text", "text": "Cancel",}, + "title": { + "type": "plain_text", + "text": "My App", + }, + "close": { + "type": "plain_text", + "text": "Cancel", + }, "blocks": [{"type": "divider", "block_id": "b"}], }, ) diff --git a/tests/slack_bolt/listener_matcher/test_custom_listener_matcher.py b/tests/slack_bolt/listener_matcher/test_custom_listener_matcher.py index e241298d5..5a680f137 100644 --- a/tests/slack_bolt/listener_matcher/test_custom_listener_matcher.py +++ b/tests/slack_bolt/listener_matcher/test_custom_listener_matcher.py @@ -19,7 +19,8 @@ def teardown_method(self): def test_instantiation(self): matcher: ListenerMatcher = CustomListenerMatcher( - app_name="foo", func=func, + app_name="foo", + func=func, ) resp = BoltResponse(status=201) diff --git a/tests/slack_bolt/middleware/request_verification/test_request_verification.py b/tests/slack_bolt/middleware/request_verification/test_request_verification.py index dca98e7b6..4fdb28964 100644 --- a/tests/slack_bolt/middleware/request_verification/test_request_verification.py +++ b/tests/slack_bolt/middleware/request_verification/test_request_verification.py @@ -17,7 +17,8 @@ class TestRequestVerification: def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): diff --git a/tests/slack_bolt_async/app/test_server.py b/tests/slack_bolt_async/app/test_server.py index 1c8bbfc29..0c53f96c4 100644 --- a/tests/slack_bolt_async/app/test_server.py +++ b/tests/slack_bolt_async/app/test_server.py @@ -13,6 +13,9 @@ def test_instance(self): server = AsyncSlackAppServer( port=3001, path="/slack/events", - app=AsyncApp(signing_secret="valid", token="xoxb-valid",), + app=AsyncApp( + signing_secret="valid", + token="xoxb-valid", + ), ) assert server is not None diff --git a/tests/slack_bolt_async/authorization/test_async_authorize.py b/tests/slack_bolt_async/authorization/test_async_authorize.py index f8a3cc98c..f81927c86 100644 --- a/tests/slack_bolt_async/authorization/test_async_authorize.py +++ b/tests/slack_bolt_async/authorization/test_async_authorize.py @@ -22,7 +22,9 @@ class TestAsyncAuthorize: mock_api_server_base_url = "http://localhost:8888" - client = AsyncWebClient(base_url=mock_api_server_base_url,) + client = AsyncWebClient( + base_url=mock_api_server_base_url, + ) @pytest.fixture def event_loop(self): diff --git a/tests/slack_bolt_async/context/test_async_ack.py b/tests/slack_bolt_async/context/test_async_ack.py index fa74e198f..6004002dd 100644 --- a/tests/slack_bolt_async/context/test_async_ack.py +++ b/tests/slack_bolt_async/context/test_async_ack.py @@ -145,8 +145,14 @@ async def test_view_update(self): view={ "type": "modal", "callbAsyncAck_id": "view-id", - "title": {"type": "plain_text", "text": "My App",}, - "close": {"type": "plain_text", "text": "Cancel",}, + "title": { + "type": "plain_text", + "text": "My App", + }, + "close": { + "type": "plain_text", + "text": "Cancel", + }, "blocks": [{"type": "divider", "block_id": "b"}], }, ) diff --git a/tests/slack_bolt_async/listener_matcher/test_async_custom_listener_matcher.py b/tests/slack_bolt_async/listener_matcher/test_async_custom_listener_matcher.py index 6e226c9b6..96a407aab 100644 --- a/tests/slack_bolt_async/listener_matcher/test_async_custom_listener_matcher.py +++ b/tests/slack_bolt_async/listener_matcher/test_async_custom_listener_matcher.py @@ -20,7 +20,8 @@ class TestAsyncCustomListenerMatcher: @pytest.mark.asyncio async def test_instantiation(self): matcher: AsyncListenerMatcher = AsyncCustomListenerMatcher( - app_name="foo", func=func, + app_name="foo", + func=func, ) resp = BoltResponse(status=201) diff --git a/tests/slack_bolt_async/middleware/request_verification/test_request_verification.py b/tests/slack_bolt_async/middleware/request_verification/test_request_verification.py index 783927572..098db8b09 100644 --- a/tests/slack_bolt_async/middleware/request_verification/test_request_verification.py +++ b/tests/slack_bolt_async/middleware/request_verification/test_request_verification.py @@ -21,7 +21,8 @@ class TestAsyncRequestVerification: def generate_signature(self, body: str, timestamp: str): return self.signature_verifier.generate_signature( - body=body, timestamp=timestamp, + body=body, + timestamp=timestamp, ) def build_headers(self, timestamp: str, body: str): diff --git a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py index 44f4e5ea7..af5adbbd2 100644 --- a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py +++ b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py @@ -203,7 +203,8 @@ async def failure(args: AsyncFailureArgs) -> BoltResponse: installation_store=FileInstallationStore(), state_store=FileOAuthStateStore(expiration_seconds=120), callback_options=AsyncCallbackOptions( - success=success, failure=failure, + success=success, + failure=failure, ), ), ) diff --git a/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py b/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py index 3c17ca49e..afd3cbdac 100644 --- a/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py +++ b/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py @@ -113,7 +113,10 @@ async def failure(args: AsyncFailureArgs) -> BoltResponse: client_id="111.222", client_secret="xxx", scopes=["chat:write", "commands"], - callback_options=AsyncCallbackOptions(success=success, failure=failure,), + callback_options=AsyncCallbackOptions( + success=success, + failure=failure, + ), ) state = await oauth_flow.issue_new_state(None) req = AsyncBoltRequest( From 4660bbcfcf41052ceebeebc1e0d66ee8c458f099 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 19 Dec 2020 12:50:12 +0900 Subject: [PATCH 078/719] version 1.1.4 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 0b2f79dbb..c72e3798a 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.1.3" +__version__ = "1.1.4" From 2216935b522dfc7f511e45252b76ffff5832ecb3 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 4 Jan 2021 13:52:06 +0900 Subject: [PATCH 079/719] Update tests for Sanic adapter --- tests/adapter_tests_async/test_async_sanic.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/adapter_tests_async/test_async_sanic.py b/tests/adapter_tests_async/test_async_sanic.py index 38d91d95a..38f0fbb00 100644 --- a/tests/adapter_tests_async/test_async_sanic.py +++ b/tests/adapter_tests_async/test_async_sanic.py @@ -29,6 +29,10 @@ class TestSanic: base_url=mock_api_server_base_url, ) + @staticmethod + def unique_sanic_app_name() -> str: + return f"awesome-slack-app-{time()}" + @pytest.fixture def event_loop(self): old_os_env = remove_os_env_temporarily() @@ -93,7 +97,7 @@ async def event_handler(): } timestamp, body = str(int(time())), json.dumps(input) - api = Sanic(name="awesome-slack-app") + api = Sanic(name=self.unique_sanic_app_name()) app_handler = AsyncSlackRequestHandler(app) @api.post("/slack/events") @@ -137,7 +141,7 @@ async def shortcut_handler(ack): timestamp, body = str(int(time())), f"payload={quote(json.dumps(input))}" - api = Sanic(name="awesome-slack-app") + api = Sanic(name=self.unique_sanic_app_name()) app_handler = AsyncSlackRequestHandler(app) @api.post("/slack/events") @@ -181,7 +185,7 @@ async def command_handler(ack): ) timestamp, body = str(int(time())), input - api = Sanic(name="awesome-slack-app") + api = Sanic(name=self.unique_sanic_app_name()) app_handler = AsyncSlackRequestHandler(app) @api.post("/slack/events") @@ -207,7 +211,7 @@ async def test_oauth(self): scopes=["chat:write", "commands"], ), ) - api = Sanic(name="awesome-slack-app") + api = Sanic(name=self.unique_sanic_app_name()) app_handler = AsyncSlackRequestHandler(app) @api.get("/slack/install") From a1feaddc3d9120472c5f8ad3b984630ef2f7ec30 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 4 Jan 2021 15:57:02 +0900 Subject: [PATCH 080/719] Add more unit tests --- .../authorization/test_authorize.py | 13 +- .../listener_matcher/test_builtins.py | 157 ++++++++++++++++++ tests/slack_bolt/util/__init__.py | 0 tests/slack_bolt/util/test_util.py | 60 +++++++ .../authorization/test_async_authorize.py | 16 +- 5 files changed, 244 insertions(+), 2 deletions(-) create mode 100644 tests/slack_bolt/util/__init__.py create mode 100644 tests/slack_bolt/util/test_util.py diff --git a/tests/slack_bolt/authorization/test_authorize.py b/tests/slack_bolt/authorization/test_authorize.py index 792949faf..9dc613ded 100644 --- a/tests/slack_bolt/authorization/test_authorize.py +++ b/tests/slack_bolt/authorization/test_authorize.py @@ -3,12 +3,13 @@ from logging import Logger from typing import Optional +import pytest from slack_sdk import WebClient from slack_sdk.oauth import InstallationStore from slack_sdk.oauth.installation_store import Bot, Installation from slack_bolt import BoltContext -from slack_bolt.authorization.authorize import InstallationStoreAuthorize +from slack_bolt.authorization.authorize import InstallationStoreAuthorize, Authorize from tests.mock_web_api_server import ( cleanup_mock_web_api_server, setup_mock_web_api_server, @@ -24,6 +25,16 @@ def setup_method(self): def teardown_method(self): cleanup_mock_web_api_server(self) + def test_root_class(self): + authorize = Authorize() + with pytest.raises(NotImplementedError): + authorize( + context=BoltContext(), + enterprise_id="E111", + team_id="T111", + user_id="U111", + ) + def test_installation_store_legacy(self): installation_store = LegacyMemoryInstallationStore() authorize = InstallationStoreAuthorize( diff --git a/tests/slack_bolt/listener_matcher/test_builtins.py b/tests/slack_bolt/listener_matcher/test_builtins.py index f8185d938..38da17e1d 100644 --- a/tests/slack_bolt/listener_matcher/test_builtins.py +++ b/tests/slack_bolt/listener_matcher/test_builtins.py @@ -7,6 +7,8 @@ block_action, action, workflow_step_execute, + event, + shortcut, ) @@ -52,6 +54,7 @@ def test_block_action(self): action({"action_id": re.compile("invalid_.+")}).matches(req, resp) is False ) + # block_id + action_id assert ( action({"action_id": "valid_action_id", "block_id": "b"}).matches(req, resp) is True @@ -100,6 +103,26 @@ def test_block_action(self): is False ) + # with type + assert ( + action({"action_id": "valid_action_id", "type": "block_actions"}).matches( + req, resp + ) + is True + ) + assert ( + action( + {"callback_id": "valid_action_id", "type": "interactive_message"} + ).matches(req, resp) + is False + ) + assert ( + action( + {"callback_id": "valid_action_id", "type": "workflow_step_edit"} + ).matches(req, resp) + is False + ) + def test_workflow_step_execute(self): payload = { "team_id": "T111", @@ -135,3 +158,137 @@ def test_workflow_step_execute(self): m = workflow_step_execute(re.compile("copy_.+")) assert m.matches(request, None) == True + + def test_events(self): + request = BoltRequest(body=json.dumps(event_payload)) + + m = event("app_mention") + assert m.matches(request, None) + m = event({"type": "app_mention"}) + assert m.matches(request, None) + m = event("message") + assert not m.matches(request, None) + m = event({"type": "message"}) + assert not m.matches(request, None) + + request = BoltRequest(body=f"payload={quote(json.dumps(shortcut_payload))}") + + m = event("app_mention") + assert not m.matches(request, None) + m = event({"type": "app_mention"}) + assert not m.matches(request, None) + + def test_global_shortcuts(self): + request = BoltRequest(body=f"payload={quote(json.dumps(shortcut_payload))}") + + m = shortcut("test-shortcut") + assert m.matches(request, None) + m = shortcut({"callback_id": "test-shortcut", "type": "shortcut"}) + assert m.matches(request, None) + + m = shortcut("test-shortcut!!!") + assert not m.matches(request, None) + m = shortcut({"callback_id": "test-shortcut", "type": "message_action"}) + assert not m.matches(request, None) + m = shortcut({"callback_id": "test-shortcut!!!", "type": "shortcut"}) + assert not m.matches(request, None) + + def test_message_shortcuts(self): + request = BoltRequest( + body=f"payload={quote(json.dumps(message_shortcut_payload))}" + ) + + m = shortcut("test-shortcut") + assert m.matches(request, None) + m = shortcut({"callback_id": "test-shortcut", "type": "message_action"}) + assert m.matches(request, None) + + m = shortcut("test-shortcut!!!") + assert not m.matches(request, None) + m = shortcut({"callback_id": "test-shortcut", "type": "shortcut"}) + assert not m.matches(request, None) + m = shortcut({"callback_id": "test-shortcut!!!", "type": "message_action"}) + assert not m.matches(request, None) + + +event_payload = { + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, + "authorizations": [ + { + "enterprise_id": "E111", + "team_id": "T111", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": True, + } + ], +} + +shortcut_payload = { + "type": "shortcut", + "token": "verification_token", + "action_ts": "111.111", + "team": { + "id": "T111", + "domain": "workspace-domain", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": {"id": "W111", "username": "primary-owner", "team_id": "T111"}, + "callback_id": "test-shortcut", + "trigger_id": "111.111.xxxxxx", +} + + +message_shortcut_payload = { + "type": "message_action", + "token": "verification_token", + "action_ts": "1583637157.207593", + "team": { + "id": "T111", + "domain": "test-test", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": {"id": "W111", "name": "test-test"}, + "channel": {"id": "C111", "name": "dev"}, + "callback_id": "test-shortcut", + "trigger_id": "111.222.xxx", + "message_ts": "1583636382.000300", + "message": { + "client_msg_id": "zzzz-111-222-xxx-yyy", + "type": "message", + "text": "<@W222> test", + "user": "W111", + "ts": "1583636382.000300", + "team": "T111", + "blocks": [ + { + "type": "rich_text", + "block_id": "d7eJ", + "elements": [ + { + "type": "rich_text_section", + "elements": [ + {"type": "user", "user_id": "U222"}, + {"type": "text", "text": " test"}, + ], + } + ], + } + ], + }, + "response_url": "https://hooks.slack.com/app/T111/111/xxx", +} diff --git a/tests/slack_bolt/util/__init__.py b/tests/slack_bolt/util/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/slack_bolt/util/test_util.py b/tests/slack_bolt/util/test_util.py new file mode 100644 index 000000000..84ff5cf3b --- /dev/null +++ b/tests/slack_bolt/util/test_util.py @@ -0,0 +1,60 @@ +import sys +from typing import Set + +import pytest +from slack_sdk.models import JsonObject + +from slack_bolt.error import BoltError +from slack_bolt.util.utils import convert_to_dict, get_boot_message +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class Data: + def __init__(self, name: str): + self.name = name + + +class SerializableData(JsonObject): + @property + def attributes(self) -> Set[str]: + return {"name"} + + def __init__(self, name: str): + self.name = name + + +class TestUtil: + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + + def teardown_method(self): + restore_os_env(self.old_os_env) + + def test_convert_to_dict(self): + assert convert_to_dict({"foo": "bar"}) == {"foo": "bar"} + assert convert_to_dict(SerializableData("baz")) == {"name": "baz"} + + def test_convert_to_dict_errors(self): + with pytest.raises(BoltError): + convert_to_dict(None) + with pytest.raises(BoltError): + convert_to_dict(123) + with pytest.raises(BoltError): + convert_to_dict("test") + with pytest.raises(BoltError): + convert_to_dict(Data("baz")) + + def test_get_boot_message(self): + assert get_boot_message() == "⚡️ Bolt app is running!" + assert ( + get_boot_message(development_server=True) + == "⚡️ Bolt app is running! (development server)" + ) + + def test_get_boot_message_win32(self): + sys_platform_backup = sys.platform + try: + sys.platform = "win32" + assert get_boot_message() == "Bolt app is running!" + finally: + sys.platform = sys_platform_backup diff --git a/tests/slack_bolt_async/authorization/test_async_authorize.py b/tests/slack_bolt_async/authorization/test_async_authorize.py index f81927c86..b1dfd4685 100644 --- a/tests/slack_bolt_async/authorization/test_async_authorize.py +++ b/tests/slack_bolt_async/authorization/test_async_authorize.py @@ -11,7 +11,10 @@ ) from slack_sdk.web.async_client import AsyncWebClient -from slack_bolt.authorization.async_authorize import AsyncInstallationStoreAuthorize +from slack_bolt.authorization.async_authorize import ( + AsyncInstallationStoreAuthorize, + AsyncAuthorize, +) from slack_bolt.context.async_context import AsyncBoltContext from tests.mock_web_api_server import ( setup_mock_web_api_server, @@ -38,6 +41,17 @@ def event_loop(self): finally: restore_os_env(old_os_env) + @pytest.mark.asyncio + async def test_root_class(self): + authorize = AsyncAuthorize() + with pytest.raises(NotImplementedError): + await authorize( + context=AsyncBoltContext(), + enterprise_id="T111", + team_id="T111", + user_id="U111", + ) + @pytest.mark.asyncio async def test_installation_store_legacy(self): installation_store = LegacyMemoryInstallationStore() From 03fdd85698f769daafc3bc7e8d6c527e8accf6c7 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 4 Jan 2021 16:01:15 +0900 Subject: [PATCH 081/719] Add type hint updates missed in #148 --- slack_bolt/authorization/async_authorize.py | 6 +++--- slack_bolt/authorization/async_authorize_args.py | 4 ++-- slack_bolt/authorization/authorize.py | 6 +++--- slack_bolt/authorization/authorize_args.py | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/slack_bolt/authorization/async_authorize.py b/slack_bolt/authorization/async_authorize.py index fb723f3cd..335aff82c 100644 --- a/slack_bolt/authorization/async_authorize.py +++ b/slack_bolt/authorization/async_authorize.py @@ -22,7 +22,7 @@ async def __call__( *, context: AsyncBoltContext, enterprise_id: Optional[str], - team_id: str, + team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], ) -> Optional[AuthorizeResult]: raise NotImplementedError() @@ -41,7 +41,7 @@ async def __call__( *, context: AsyncBoltContext, enterprise_id: Optional[str], - team_id: str, + team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], ) -> Optional[AuthorizeResult]: try: @@ -116,7 +116,7 @@ async def __call__( *, context: AsyncBoltContext, enterprise_id: Optional[str], - team_id: str, + team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], ) -> Optional[AuthorizeResult]: diff --git a/slack_bolt/authorization/async_authorize_args.py b/slack_bolt/authorization/async_authorize_args.py index 5100ad19f..6d04a7f1e 100644 --- a/slack_bolt/authorization/async_authorize_args.py +++ b/slack_bolt/authorization/async_authorize_args.py @@ -11,7 +11,7 @@ class AsyncAuthorizeArgs: logger: Logger client: AsyncWebClient enterprise_id: Optional[str] - team_id: str + team_id: Optional[str] user_id: Optional[str] def __init__( @@ -19,7 +19,7 @@ def __init__( *, context: AsyncBoltContext, enterprise_id: Optional[str], - team_id: str, + team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], ): """The whole arguments that are passed to Authorize functions. diff --git a/slack_bolt/authorization/authorize.py b/slack_bolt/authorization/authorize.py index 090d5113f..56cd04161 100644 --- a/slack_bolt/authorization/authorize.py +++ b/slack_bolt/authorization/authorize.py @@ -21,7 +21,7 @@ def __call__( *, context: BoltContext, enterprise_id: Optional[str], - team_id: str, + team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], ) -> Optional[AuthorizeResult]: raise NotImplementedError() @@ -43,7 +43,7 @@ def __call__( *, context: BoltContext, enterprise_id: Optional[str], - team_id: str, + team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], ) -> Optional[AuthorizeResult]: try: @@ -121,7 +121,7 @@ def __call__( *, context: BoltContext, enterprise_id: Optional[str], - team_id: str, + team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], ) -> Optional[AuthorizeResult]: diff --git a/slack_bolt/authorization/authorize_args.py b/slack_bolt/authorization/authorize_args.py index 170cd7843..084da415d 100644 --- a/slack_bolt/authorization/authorize_args.py +++ b/slack_bolt/authorization/authorize_args.py @@ -11,7 +11,7 @@ class AuthorizeArgs: logger: Logger client: WebClient enterprise_id: Optional[str] - team_id: str + team_id: Optional[str] user_id: Optional[str] def __init__( @@ -19,7 +19,7 @@ def __init__( *, context: BoltContext, enterprise_id: Optional[str], - team_id: str, + team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], ): """The whole arguments that are passed to Authorize functions. From 55d4f16975fd7ba0d98d683527882935a3197f20 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 6 Jan 2021 15:52:32 +0900 Subject: [PATCH 082/719] Fix #193 by enabling listener middleware to return a response --- slack_bolt/app/app.py | 20 +++- slack_bolt/app/async_app.py | 23 +++- slack_bolt/listener/async_listener.py | 2 +- slack_bolt/listener/asyncio_runner.py | 3 +- slack_bolt/listener/listener.py | 4 +- slack_bolt/listener/thread_runner.py | 3 +- slack_bolt/logger/messages.py | 8 ++ slack_bolt/middleware/async_middleware.py | 4 +- slack_bolt/middleware/middleware.py | 4 +- slack_bolt/workflows/step/step_middleware.py | 2 +- .../test_listener_middleware.py | 102 ++++++++++++++++ .../test_listener_middleware.py | 113 ++++++++++++++++++ 12 files changed, 274 insertions(+), 14 deletions(-) create mode 100644 tests/scenario_tests/test_listener_middleware.py create mode 100644 tests/scenario_tests_async/test_listener_middleware.py diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index da54e7393..2d6b0b891 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -2,6 +2,7 @@ import json import logging import os +import time from concurrent.futures.thread import ThreadPoolExecutor from http.server import SimpleHTTPRequestHandler, HTTPServer from typing import List, Union, Pattern, Callable, Dict, Optional, Sequence @@ -42,6 +43,7 @@ error_client_invalid_type, error_authorize_conflicts, warning_bot_only_conflicts, + debug_return_listener_middleware_response, ) from slack_bolt.middleware import ( Middleware, @@ -323,6 +325,7 @@ def dispatch(self, req: BoltRequest) -> BoltResponse: :param req: An incoming request from Slack. :return: The response generated by this Bolt app. """ + starting_time = time.time() self._init_context(req) resp: BoltResponse = BoltResponse(status=200, body="") @@ -348,12 +351,27 @@ def middleware_next(): self._framework_logger.debug(debug_checking_listener(listener_name)) if listener.matches(req=req, resp=resp): # run all the middleware attached to this listener first - resp, next_was_not_called = listener.run_middleware(req=req, resp=resp) + middleware_resp, next_was_not_called = listener.run_middleware( + req=req, resp=resp + ) if next_was_not_called: + if middleware_resp is not None: + if self._framework_logger.level <= logging.DEBUG: + debug_message = debug_return_listener_middleware_response( + listener_name, + middleware_resp.status, + middleware_resp.body, + starting_time, + ) + self._framework_logger.debug(debug_message) + return middleware_resp # The last listener middleware didn't call next() method. # This means the listener is not for this incoming request. continue + if middleware_resp is not None: + resp = middleware_resp + self._framework_logger.debug(debug_running_listener(listener_name)) listener_response: Optional[BoltResponse] = self._listener_runner.run( request=req, diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index d74ea898d..834852724 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -1,6 +1,7 @@ import inspect import logging import os +import time from typing import Optional, List, Union, Callable, Pattern, Dict, Awaitable, Sequence from aiohttp import web @@ -39,6 +40,7 @@ error_oauth_settings_invalid_type_async, error_oauth_flow_invalid_type_async, warning_bot_only_conflicts, + debug_return_listener_middleware_response, ) from slack_bolt.lazy_listener.asyncio_runner import AsyncioLazyListenerRunner from slack_bolt.listener.async_listener import AsyncListener, AsyncCustomListener @@ -359,6 +361,7 @@ async def async_dispatch(self, req: AsyncBoltRequest) -> BoltResponse: :param req: An incoming request from Slack. :return: The response generated by this Bolt app. """ + starting_time = time.time() self._init_context(req) resp: BoltResponse = BoltResponse(status=200, body="") @@ -386,14 +389,28 @@ async def async_middleware_next(): self._framework_logger.debug(debug_checking_listener(listener_name)) if await listener.async_matches(req=req, resp=resp): # run all the middleware attached to this listener first - resp, next_was_not_called = await listener.run_async_middleware( - req=req, resp=resp - ) + ( + middleware_resp, + next_was_not_called, + ) = await listener.run_async_middleware(req=req, resp=resp) if next_was_not_called: + if middleware_resp is not None: + if self._framework_logger.level <= logging.DEBUG: + debug_message = debug_return_listener_middleware_response( + listener_name, + middleware_resp.status, + middleware_resp.body, + starting_time, + ) + self._framework_logger.debug(debug_message) + return middleware_resp # The last listener middleware didn't call next() method. # This means the listener is not for this incoming request. continue + if middleware_resp is not None: + resp = middleware_resp + self._framework_logger.debug(debug_running_listener(listener_name)) listener_response: Optional[ BoltResponse diff --git a/slack_bolt/listener/async_listener.py b/slack_bolt/listener/async_listener.py index 21fe7b033..567a51e17 100644 --- a/slack_bolt/listener/async_listener.py +++ b/slack_bolt/listener/async_listener.py @@ -33,7 +33,7 @@ async def run_async_middleware( *, req: AsyncBoltRequest, resp: BoltResponse, - ) -> Tuple[BoltResponse, bool]: + ) -> Tuple[Optional[BoltResponse], bool]: """Runs an async middleware. :param req: The incoming request diff --git a/slack_bolt/listener/asyncio_runner.py b/slack_bolt/listener/asyncio_runner.py index c9c1d49fa..1ea9de2a2 100644 --- a/slack_bolt/listener/asyncio_runner.py +++ b/slack_bolt/listener/asyncio_runner.py @@ -42,9 +42,10 @@ async def run( response: BoltResponse, listener_name: str, listener: AsyncListener, + starting_time: Optional[float] = None, ) -> Optional[BoltResponse]: ack = request.context.ack - starting_time = time.time() + starting_time = starting_time if starting_time is not None else time.time() if self.process_before_response: if not request.lazy_only: try: diff --git a/slack_bolt/listener/listener.py b/slack_bolt/listener/listener.py index 748392f94..cce1d2649 100644 --- a/slack_bolt/listener/listener.py +++ b/slack_bolt/listener/listener.py @@ -1,5 +1,5 @@ from abc import abstractmethod, ABCMeta -from typing import Callable, Tuple, Sequence +from typing import Callable, Tuple, Sequence, Optional from slack_bolt.listener_matcher import ListenerMatcher from slack_bolt.middleware import Middleware @@ -32,7 +32,7 @@ def run_middleware( *, req: BoltRequest, resp: BoltResponse, - ) -> Tuple[BoltResponse, bool]: + ) -> Tuple[Optional[BoltResponse], bool]: """ :param req: the incoming request diff --git a/slack_bolt/listener/thread_runner.py b/slack_bolt/listener/thread_runner.py index 28d4051da..2e60e1c41 100644 --- a/slack_bolt/listener/thread_runner.py +++ b/slack_bolt/listener/thread_runner.py @@ -43,9 +43,10 @@ def run( # type: ignore response: BoltResponse, listener_name: str, listener: Listener, + starting_time: Optional[float] = None, ) -> Optional[BoltResponse]: ack = request.context.ack - starting_time = time.time() + starting_time = starting_time if starting_time is not None else time.time() if self.process_before_response: if not request.lazy_only: try: diff --git a/slack_bolt/logger/messages.py b/slack_bolt/logger/messages.py index d850567a3..54e85a6d7 100644 --- a/slack_bolt/logger/messages.py +++ b/slack_bolt/logger/messages.py @@ -1,3 +1,4 @@ +import time from typing import Union from slack_sdk.web import SlackResponse @@ -111,3 +112,10 @@ def debug_running_lazy_listener(func_name: str) -> str: def debug_responding(status: int, body: str, millis: int) -> str: return f'Responding with status: {status} body: "{body}" ({millis} millis)' + + +def debug_return_listener_middleware_response( + listener_name: str, status: int, body: str, starting_time: float +) -> str: + millis = int((time.time() - starting_time) * 1000) + return f"Responding with listener middleware's response - listener: {listener_name}, status: {status}, body: {body} ({millis} millis)" diff --git a/slack_bolt/middleware/async_middleware.py b/slack_bolt/middleware/async_middleware.py index 1e846f684..88684974b 100644 --- a/slack_bolt/middleware/async_middleware.py +++ b/slack_bolt/middleware/async_middleware.py @@ -1,5 +1,5 @@ from abc import ABCMeta, abstractmethod -from typing import Callable, Awaitable +from typing import Callable, Awaitable, Optional from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse @@ -13,7 +13,7 @@ async def async_process( req: AsyncBoltRequest, resp: BoltResponse, next: Callable[[], Awaitable[BoltResponse]], - ) -> BoltResponse: + ) -> Optional[BoltResponse]: raise NotImplementedError() @property diff --git a/slack_bolt/middleware/middleware.py b/slack_bolt/middleware/middleware.py index d8c5c4df6..48b4b2120 100644 --- a/slack_bolt/middleware/middleware.py +++ b/slack_bolt/middleware/middleware.py @@ -1,5 +1,5 @@ from abc import ABCMeta, abstractmethod -from typing import Callable +from typing import Callable, Optional from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse @@ -13,7 +13,7 @@ def process( req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse], - ) -> BoltResponse: + ) -> Optional[BoltResponse]: raise NotImplementedError() @property diff --git a/slack_bolt/workflows/step/step_middleware.py b/slack_bolt/workflows/step/step_middleware.py index 6c86b26fc..5a562d30b 100644 --- a/slack_bolt/workflows/step/step_middleware.py +++ b/slack_bolt/workflows/step/step_middleware.py @@ -19,7 +19,7 @@ def process( req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse], - ) -> BoltResponse: + ) -> Optional[BoltResponse]: if self.step.edit.matches(req=req, resp=resp): resp = self._run(self.step.edit, req, resp) diff --git a/tests/scenario_tests/test_listener_middleware.py b/tests/scenario_tests/test_listener_middleware.py new file mode 100644 index 000000000..4906375d8 --- /dev/null +++ b/tests/scenario_tests/test_listener_middleware.py @@ -0,0 +1,102 @@ +import json +from time import time + +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web import WebClient + +from slack_bolt import BoltResponse +from slack_bolt.app import App +from slack_bolt.request import BoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestListenerMiddleware: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + body = { + "type": "shortcut", + "token": "verification_token", + "action_ts": "111.111", + "team": { + "id": "T111", + "domain": "workspace-domain", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": {"id": "W111", "username": "primary-owner", "team_id": "T111"}, + "callback_id": "test-shortcut", + "trigger_id": "111.111.xxxxxx", + } + + def build_request(self) -> BoltRequest: + timestamp, body = str(int(time())), json.dumps(self.body) + return BoltRequest( + body=body, + headers={ + "content-type": ["application/json"], + "x-slack-signature": [ + self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + ], + "x-slack-request-timestamp": [timestamp], + }, + ) + + def test_return_response(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + @app.shortcut( + constraints="test-shortcut", + middleware=[listener_middleware_returning_response], + ) + def handle(ack): + ack() + + response = app.dispatch(self.build_request()) + assert response.status == 200 + assert response.body == "listener middleware" + + def test_next(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + @app.shortcut(constraints="test-shortcut", middleware=[just_next]) + def handle(ack): + ack() + + response = app.dispatch(self.build_request()) + assert response.status == 200 + + +def listener_middleware_returning_response(): + return BoltResponse(status=200, body="listener middleware") + + +def just_next(next): + next() diff --git a/tests/scenario_tests_async/test_listener_middleware.py b/tests/scenario_tests_async/test_listener_middleware.py new file mode 100644 index 000000000..bf3914468 --- /dev/null +++ b/tests/scenario_tests_async/test_listener_middleware.py @@ -0,0 +1,113 @@ +import asyncio +import json +from time import time + +import pytest +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt import BoltResponse +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestAsyncListenerMiddleware: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + body = { + "type": "shortcut", + "token": "verification_token", + "action_ts": "111.111", + "team": { + "id": "T111", + "domain": "workspace-domain", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": {"id": "W111", "username": "primary-owner", "team_id": "T111"}, + "callback_id": "test-shortcut", + "trigger_id": "111.111.xxxxxx", + } + + def build_request(self) -> AsyncBoltRequest: + timestamp, body = str(int(time())), json.dumps(self.body) + return AsyncBoltRequest( + body=body, + headers={ + "content-type": ["application/json"], + "x-slack-signature": [ + self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + ], + "x-slack-request-timestamp": [timestamp], + }, + ) + + @pytest.mark.asyncio + async def test_return_response(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + @app.shortcut( + constraints="test-shortcut", + middleware=[listener_middleware_returning_response], + ) + async def handle(ack): + await ack() + + response = await app.async_dispatch(self.build_request()) + assert response.status == 200 + assert response.body == "listener middleware" + + @pytest.mark.asyncio + async def test_next(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + @app.shortcut( + constraints="test-shortcut", + middleware=[just_next], + ) + async def handle(ack): + await ack() + + response = await app.async_dispatch(self.build_request()) + assert response.status == 200 + + +async def listener_middleware_returning_response(): + return BoltResponse(status=200, body="listener middleware") + + +async def just_next(next): + await next() From 4f5cd1e393cffbb38503c085b08722c368a03ffd Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 6 Jan 2021 16:17:04 +0900 Subject: [PATCH 083/719] Add codecov.yml --- codecov.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..b24c2afb1 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,8 @@ +coverage: + status: + project: + default: + threshold: 0.3% + patch: + default: + target: 50% From b480eb0d3f4d8d8fe5be82954b220fb275c82e71 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 7 Jan 2021 12:26:00 +0900 Subject: [PATCH 084/719] Upgrade slack_sdk to 3.1.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index bf95537e6..cb789759a 100755 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.1.0,<3.2",], + install_requires=["slack_sdk>=3.1.1,<3.2",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", From e29e061928fc62c80eb162fab54dd09108e45d05 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 7 Jan 2021 12:31:48 +0900 Subject: [PATCH 085/719] version 1.1.5 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index c72e3798a..9b102be76 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.1.4" +__version__ = "1.1.5" From 899ce766c8badd31702338e5acec930069b4596b Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 5 Jan 2021 20:12:04 +0900 Subject: [PATCH 086/719] Fix #174 by enabling to use instance/class methods for listeners/middleware Co-authored-by: Yang Liu --- slack_bolt/kwargs_injection/async_utils.py | 11 + slack_bolt/kwargs_injection/utils.py | 11 + slack_bolt/logger/messages.py | 7 + .../test_app_using_methods_in_class.py | 165 +++++++++++++++ .../test_app_using_methods_in_class.py | 188 ++++++++++++++++++ 5 files changed, 382 insertions(+) create mode 100644 tests/scenario_tests/test_app_using_methods_in_class.py create mode 100644 tests/scenario_tests_async/test_app_using_methods_in_class.py diff --git a/slack_bolt/kwargs_injection/async_utils.py b/slack_bolt/kwargs_injection/async_utils.py index ae7773725..a4b069d72 100644 --- a/slack_bolt/kwargs_injection/async_utils.py +++ b/slack_bolt/kwargs_injection/async_utils.py @@ -15,6 +15,7 @@ to_message, to_step, ) +from ..logger.messages import warning_skip_uncommon_arg_name def build_async_required_kwargs( @@ -65,6 +66,16 @@ def build_async_required_kwargs( if k not in all_available_args: all_available_args[k] = v + if len(required_arg_names) > 0: + # To support instance/class methods in a class for listeners/middleware, + # check if the first argument is either self or cls + first_arg_name = required_arg_names[0] + if first_arg_name in {"self", "cls"}: + required_arg_names.pop(0) + elif first_arg_name not in all_available_args.keys(): + logger.warning(warning_skip_uncommon_arg_name(first_arg_name)) + required_arg_names.pop(0) + kwargs: Dict[str, Any] = { k: v for k, v in all_available_args.items() if k in required_arg_names } diff --git a/slack_bolt/kwargs_injection/utils.py b/slack_bolt/kwargs_injection/utils.py index 0d936cb14..e10febb59 100644 --- a/slack_bolt/kwargs_injection/utils.py +++ b/slack_bolt/kwargs_injection/utils.py @@ -15,6 +15,7 @@ to_message, to_step, ) +from ..logger.messages import warning_skip_uncommon_arg_name def build_required_kwargs( @@ -65,6 +66,16 @@ def build_required_kwargs( if k not in all_available_args: all_available_args[k] = v + if len(required_arg_names) > 0: + # To support instance/class methods in a class for listeners/middleware, + # check if the first argument is either self or cls + first_arg_name = required_arg_names[0] + if first_arg_name in {"self", "cls"}: + required_arg_names.pop(0) + elif first_arg_name not in all_available_args.keys(): + logger.warning(warning_skip_uncommon_arg_name(first_arg_name)) + required_arg_names.pop(0) + kwargs: Dict[str, Any] = { k: v for k, v in all_available_args.items() if k in required_arg_names } diff --git a/slack_bolt/logger/messages.py b/slack_bolt/logger/messages.py index 54e85a6d7..9be35c486 100644 --- a/slack_bolt/logger/messages.py +++ b/slack_bolt/logger/messages.py @@ -84,6 +84,13 @@ def warning_bot_only_conflicts() -> str: ) +def warning_skip_uncommon_arg_name(arg_name: str) -> str: + return ( + f"Bolt skips injecting a value to the first keyword argument ({arg_name}). " + "If it is self/cls of a method, we recommend using the common names." + ) + + # ------------------------------- # Info # ------------------------------- diff --git a/tests/scenario_tests/test_app_using_methods_in_class.py b/tests/scenario_tests/test_app_using_methods_in_class.py new file mode 100644 index 000000000..4102c819c --- /dev/null +++ b/tests/scenario_tests/test_app_using_methods_in_class.py @@ -0,0 +1,165 @@ +import json +from time import time, sleep +from typing import Callable + +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web import WebClient + +from slack_bolt import App, BoltRequest, Say, Ack, BoltContext +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestAppUsingMethodsInClass: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def run_app_and_verify(self, app: App): + payload = { + "type": "message_action", + "token": "verification_token", + "action_ts": "1583637157.207593", + "team": { + "id": "T111", + "domain": "test-test", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": {"id": "W111", "name": "test-test"}, + "channel": {"id": "C111", "name": "dev"}, + "callback_id": "test-shortcut", + "trigger_id": "111.222.xxx", + "message_ts": "1583636382.000300", + "message": { + "client_msg_id": "zzzz-111-222-xxx-yyy", + "type": "message", + "text": "<@W222> test", + "user": "W111", + "ts": "1583636382.000300", + "team": "T111", + "blocks": [ + { + "type": "rich_text", + "block_id": "d7eJ", + "elements": [ + { + "type": "rich_text_section", + "elements": [ + {"type": "user", "user_id": "U222"}, + {"type": "text", "text": " test"}, + ], + } + ], + } + ], + }, + "response_url": "https://hooks.slack.com/app/T111/111/xxx", + } + + timestamp, body = str(int(time())), f"payload={json.dumps(payload)}" + request: BoltRequest = BoltRequest( + body=body, + headers={ + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [ + self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + ], + "x-slack-request-timestamp": [timestamp], + }, + ) + response = app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + sleep(0.5) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + def test_class_methods(self): + app = App(client=self.web_client, signing_secret=self.signing_secret) + app.use(AwesomeClass.class_middleware) + app.shortcut("test-shortcut")(AwesomeClass.class_method) + self.run_app_and_verify(app) + + def test_class_methods_uncommon_name(self): + app = App(client=self.web_client, signing_secret=self.signing_secret) + app.use(AwesomeClass.class_middleware) + app.shortcut("test-shortcut")(AwesomeClass.class_method2) + self.run_app_and_verify(app) + + def test_instance_methods(self): + app = App(client=self.web_client, signing_secret=self.signing_secret) + awesome = AwesomeClass("Slackbot") + app.use(awesome.instance_middleware) + app.shortcut("test-shortcut")(awesome.instance_method) + self.run_app_and_verify(app) + + def test_instance_methods_uncommon_name(self): + app = App(client=self.web_client, signing_secret=self.signing_secret) + awesome = AwesomeClass("Slackbot") + app.use(awesome.instance_middleware) + app.shortcut("test-shortcut")(awesome.instance_method2) + self.run_app_and_verify(app) + + def test_static_methods(self): + app = App(client=self.web_client, signing_secret=self.signing_secret) + app.use(AwesomeClass.static_middleware) + app.shortcut("test-shortcut")(AwesomeClass.static_method) + self.run_app_and_verify(app) + + +class AwesomeClass: + def __init__(self, name: str): + self.name = name + + @classmethod + def class_middleware(cls, next: Callable): + next() + + def instance_middleware(self, next: Callable): + next() + + @staticmethod + def static_middleware(next): + next() + + @classmethod + def class_method(cls, context: BoltContext, say: Say, ack: Ack): + ack() + say(f"Hello <@{context.user_id}>!") + + @classmethod + def class_method2(xyz, context: BoltContext, say: Say, ack: Ack): + ack() + say(f"Hello <@{context.user_id}>!") + + def instance_method(self, context: BoltContext, say: Say, ack: Ack): + ack() + say(f"Hello <@{context.user_id}>! My name is {self.name}") + + def instance_method2(whatever, context: BoltContext, say: Say, ack: Ack): + ack() + say(f"Hello <@{context.user_id}>! My name is {whatever.name}") + + @staticmethod + def static_method(context: BoltContext, say: Say, ack: Ack): + ack() + say(f"Hello <@{context.user_id}>!") diff --git a/tests/scenario_tests_async/test_app_using_methods_in_class.py b/tests/scenario_tests_async/test_app_using_methods_in_class.py new file mode 100644 index 000000000..a1131fd35 --- /dev/null +++ b/tests/scenario_tests_async/test_app_using_methods_in_class.py @@ -0,0 +1,188 @@ +import asyncio +import json +from time import time +from typing import Callable + +import pytest +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.context.async_context import AsyncBoltContext +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.context.ack.async_ack import AsyncAck +from slack_bolt.context.say.async_say import AsyncSay +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestAppUsingMethodsInClass: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + async def run_app_and_verify(self, app: AsyncApp): + payload = { + "type": "message_action", + "token": "verification_token", + "action_ts": "1583637157.207593", + "team": { + "id": "T111", + "domain": "test-test", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": {"id": "W111", "name": "test-test"}, + "channel": {"id": "C111", "name": "dev"}, + "callback_id": "test-shortcut", + "trigger_id": "111.222.xxx", + "message_ts": "1583636382.000300", + "message": { + "client_msg_id": "zzzz-111-222-xxx-yyy", + "type": "message", + "text": "<@W222> test", + "user": "W111", + "ts": "1583636382.000300", + "team": "T111", + "blocks": [ + { + "type": "rich_text", + "block_id": "d7eJ", + "elements": [ + { + "type": "rich_text_section", + "elements": [ + {"type": "user", "user_id": "U222"}, + {"type": "text", "text": " test"}, + ], + } + ], + } + ], + }, + "response_url": "https://hooks.slack.com/app/T111/111/xxx", + } + + timestamp, body = str(int(time())), f"payload={json.dumps(payload)}" + request: AsyncBoltRequest = AsyncBoltRequest( + body=body, + headers={ + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [ + self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + ], + "x-slack-request-timestamp": [timestamp], + }, + ) + response = await app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + await asyncio.sleep(0.5) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + @pytest.mark.asyncio + async def test_class_methods(self): + app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) + app.use(AwesomeClass.class_middleware) + app.shortcut("test-shortcut")(AwesomeClass.class_method) + await self.run_app_and_verify(app) + + @pytest.mark.asyncio + async def test_class_methods_uncommon_name(self): + app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) + app.use(AwesomeClass.class_middleware) + app.shortcut("test-shortcut")(AwesomeClass.class_method2) + await self.run_app_and_verify(app) + + @pytest.mark.asyncio + async def test_instance_methods(self): + app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) + awesome = AwesomeClass("Slackbot") + app.use(awesome.instance_middleware) + app.shortcut("test-shortcut")(awesome.instance_method) + await self.run_app_and_verify(app) + + @pytest.mark.asyncio + async def test_instance_methods_uncommon_name(self): + app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) + awesome = AwesomeClass("Slackbot") + app.use(awesome.instance_middleware) + app.shortcut("test-shortcut")(awesome.instance_method2) + await self.run_app_and_verify(app) + + @pytest.mark.asyncio + async def test_static_methods(self): + app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) + app.use(AwesomeClass.static_middleware) + app.shortcut("test-shortcut")(AwesomeClass.static_method) + await self.run_app_and_verify(app) + + +class AwesomeClass: + def __init__(self, name: str): + self.name = name + + @classmethod + async def class_middleware(cls, next: Callable): + await next() + + async def instance_middleware(self, next: Callable): + await next() + + @staticmethod + async def static_middleware(next): + await next() + + @classmethod + async def class_method( + cls, context: AsyncBoltContext, say: AsyncSay, ack: AsyncAck + ): + await ack() + await say(f"Hello <@{context.user_id}>!") + + @classmethod + async def class_method2( + xyz, context: AsyncBoltContext, say: AsyncSay, ack: AsyncAck + ): + await ack() + await say(f"Hello <@{context.user_id}>!") + + async def instance_method( + self, context: AsyncBoltContext, say: AsyncSay, ack: AsyncAck + ): + await ack() + await say(f"Hello <@{context.user_id}>! My name is {self.name}") + + async def instance_method2( + whatever, context: AsyncBoltContext, say: AsyncSay, ack: AsyncAck + ): + await ack() + await say(f"Hello <@{context.user_id}>! My name is {whatever.name}") + + @staticmethod + async def static_method(context: AsyncBoltContext, say: AsyncSay, ack: AsyncAck): + await ack() + await say(f"Hello <@{context.user_id}>!") From 512a53c1ffa23b0dcad448ef08c2f57ca8e82e9d Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 4 Jan 2021 12:13:20 +0900 Subject: [PATCH 087/719] Fix #183 Easier way to configure the installation URL as the direct install URL on App Directory --- slack_bolt/oauth/async_oauth_flow.py | 31 +++++++++++++------ slack_bolt/oauth/async_oauth_settings.py | 4 +++ slack_bolt/oauth/oauth_flow.py | 31 +++++++++++++------ slack_bolt/oauth/oauth_settings.py | 4 +++ tests/slack_bolt/oauth/test_oauth_flow.py | 22 ++++++++++++- .../oauth/test_async_oauth_flow.py | 20 +++++++++++- 6 files changed, 90 insertions(+), 22 deletions(-) diff --git a/slack_bolt/oauth/async_oauth_flow.py b/slack_bolt/oauth/async_oauth_flow.py index 233c7d149..dc2d0f094 100644 --- a/slack_bolt/oauth/async_oauth_flow.py +++ b/slack_bolt/oauth/async_oauth_flow.py @@ -162,19 +162,30 @@ def sqlite3( async def handle_installation(self, request: AsyncBoltRequest) -> BoltResponse: state = await self.issue_new_state(request) url = await self.build_authorize_url(state, request) - html = await self.build_install_page_html(url, request) set_cookie_value = self.settings.state_utils.build_set_cookie_for_new_state( state ) - return BoltResponse( - status=200, - body=html, - headers={ - "Content-Type": "text/html; charset=utf-8", - "Content-Length": len(bytes(html, "utf-8")), - "Set-Cookie": [set_cookie_value], - }, - ) + if self.settings.install_page_rendering_enabled: + html = await self.build_install_page_html(url, request) + return BoltResponse( + status=200, + body=html, + headers={ + "Content-Type": "text/html; charset=utf-8", + "Content-Length": len(bytes(html, "utf-8")), + "Set-Cookie": [set_cookie_value], + }, + ) + else: + return BoltResponse( + status=302, + body="", + headers={ + "Content-Type": "text/html; charset=utf-8", + "Location": url, + "Set-Cookie": [set_cookie_value], + }, + ) # ---------------------- # Internal methods for Installation diff --git a/slack_bolt/oauth/async_oauth_settings.py b/slack_bolt/oauth/async_oauth_settings.py index fec1bef80..948bf7547 100644 --- a/slack_bolt/oauth/async_oauth_settings.py +++ b/slack_bolt/oauth/async_oauth_settings.py @@ -32,6 +32,7 @@ class AsyncOAuthSettings: redirect_uri: Optional[str] # Handler configuration install_path: str + install_page_rendering_enabled: bool redirect_uri_path: str callback_options: Optional[CallbackOptions] = None success_url: Optional[str] @@ -63,6 +64,7 @@ def __init__( redirect_uri: Optional[str] = None, # Handler configuration install_path: str = "/slack/install", + install_page_rendering_enabled: bool = True, redirect_uri_path: str = "/slack/oauth_redirect", callback_options: Optional[CallbackOptions] = None, success_url: Optional[str] = None, @@ -86,6 +88,7 @@ def __init__( :param user_scopes: Check the value in Settings > Manage Distribution :param redirect_uri: Check the value in Features > OAuth & Permissions > Redirect URLs :param install_path: The endpoint to start an OAuth flow (Default: /slack/install) + :param install_page_rendering_enabled: Renders a web page for install_path access if True :param redirect_uri_path: The path of Redirect URL (Default: /slack/oauth_redirect) :param callback_options: Give success/failure functions f you want to customize callback functions. :param success_url: Set a complete URL if you want to redirect end-users when an installation completes. @@ -119,6 +122,7 @@ def __init__( self.install_path = install_path or os.environ.get( "SLACK_INSTALL_PATH", "/slack/install" ) + self.install_page_rendering_enabled = install_page_rendering_enabled self.redirect_uri_path = redirect_uri_path or os.environ.get( "SLACK_REDIRECT_URI_PATH", "/slack/oauth_redirect" ) diff --git a/slack_bolt/oauth/oauth_flow.py b/slack_bolt/oauth/oauth_flow.py index 3182c255b..867c90761 100644 --- a/slack_bolt/oauth/oauth_flow.py +++ b/slack_bolt/oauth/oauth_flow.py @@ -157,19 +157,30 @@ def sqlite3( def handle_installation(self, request: BoltRequest) -> BoltResponse: state = self.issue_new_state(request) url = self.build_authorize_url(state, request) - html = self.build_install_page_html(url, request) set_cookie_value = self.settings.state_utils.build_set_cookie_for_new_state( state ) - return BoltResponse( - status=200, - body=html, - headers={ - "Content-Type": "text/html; charset=utf-8", - "Content-Length": len(bytes(html, "utf-8")), - "Set-Cookie": [set_cookie_value], - }, - ) + if self.settings.install_page_rendering_enabled: + html = self.build_install_page_html(url, request) + return BoltResponse( + status=200, + body=html, + headers={ + "Content-Type": "text/html; charset=utf-8", + "Content-Length": len(bytes(html, "utf-8")), + "Set-Cookie": [set_cookie_value], + }, + ) + else: + return BoltResponse( + status=302, + body="", + headers={ + "Content-Type": "text/html; charset=utf-8", + "Location": url, + "Set-Cookie": [set_cookie_value], + }, + ) # ---------------------- # Internal methods for Installation diff --git a/slack_bolt/oauth/oauth_settings.py b/slack_bolt/oauth/oauth_settings.py index 6010e5c26..ebb2fad27 100644 --- a/slack_bolt/oauth/oauth_settings.py +++ b/slack_bolt/oauth/oauth_settings.py @@ -27,6 +27,7 @@ class OAuthSettings: redirect_uri: Optional[str] # Handler configuration install_path: str + install_page_rendering_enabled: bool redirect_uri_path: str callback_options: Optional[CallbackOptions] = None success_url: Optional[str] @@ -58,6 +59,7 @@ def __init__( redirect_uri: Optional[str] = None, # Handler configuration install_path: str = "/slack/install", + install_page_rendering_enabled: bool = True, redirect_uri_path: str = "/slack/oauth_redirect", callback_options: Optional[CallbackOptions] = None, success_url: Optional[str] = None, @@ -81,6 +83,7 @@ def __init__( :param user_scopes: Check the value in Settings > Manage Distribution :param redirect_uri: Check the value in Features > OAuth & Permissions > Redirect URLs :param install_path: The endpoint to start an OAuth flow (Default: /slack/install) + :param install_page_rendering_enabled: Renders a web page for install_path access if True :param redirect_uri_path: The path of Redirect URL (Default: /slack/oauth_redirect) :param callback_options: Give success/failure functions f you want to customize callback functions. :param success_url: Set a complete URL if you want to redirect end-users when an installation completes. @@ -113,6 +116,7 @@ def __init__( self.install_path = install_path or os.environ.get( "SLACK_INSTALL_PATH", "/slack/install" ) + self.install_page_rendering_enabled = install_page_rendering_enabled self.redirect_uri_path = redirect_uri_path or os.environ.get( "SLACK_REDIRECT_URI_PATH", "/slack/oauth_redirect" ) diff --git a/tests/slack_bolt/oauth/test_oauth_flow.py b/tests/slack_bolt/oauth/test_oauth_flow.py index a2797e5e0..cbb119753 100644 --- a/tests/slack_bolt/oauth/test_oauth_flow.py +++ b/tests/slack_bolt/oauth/test_oauth_flow.py @@ -40,7 +40,7 @@ def test_instantiation(self): assert oauth_flow.logger is not None assert oauth_flow.client is not None - def test_handle_installation(self): + def test_handle_installation_default(self): oauth_flow = OAuthFlow( settings=OAuthSettings( client_id="111.222", @@ -58,6 +58,26 @@ def test_handle_installation(self): assert resp.headers.get("content-length") == ["576"] assert "https://slack.com/oauth/v2/authorize?state=" in resp.body + # https://github.com/slackapi/bolt-python/issues/183 + # For direct install URL suppport + def test_handle_installation_no_rendering(self): + oauth_flow = OAuthFlow( + settings=OAuthSettings( + client_id="111.222", + client_secret="xxx", + scopes=["chat:write", "commands"], + user_scopes=["search:read"], + installation_store=FileInstallationStore(), + install_page_rendering_enabled=False, # disabled + state_store=FileOAuthStateStore(expiration_seconds=120), + ) + ) + req = BoltRequest(body="") + resp = oauth_flow.handle_installation(req) + assert resp.status == 302 + location_header = resp.headers.get("location")[0] + assert "https://slack.com/oauth/v2/authorize?state=" in location_header + def test_scopes_as_str(self): settings = OAuthSettings( client_id="111.222", diff --git a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py index af5adbbd2..090429bd3 100644 --- a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py +++ b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py @@ -92,7 +92,7 @@ async def test_instantiation_non_async_settings_to_app(self): ) @pytest.mark.asyncio - async def test_handle_installation(self): + async def test_handle_installation_default(self): oauth_flow = AsyncOAuthFlow( settings=AsyncOAuthSettings( client_id="111.222", @@ -109,6 +109,24 @@ async def test_handle_installation(self): assert resp.headers.get("content-length") == ["565"] assert "https://slack.com/oauth/v2/authorize?state=" in resp.body + @pytest.mark.asyncio + async def test_handle_installation_no_rendering(self): + oauth_flow = AsyncOAuthFlow( + settings=AsyncOAuthSettings( + client_id="111.222", + client_secret="xxx", + scopes=["chat:write", "commands"], + installation_store=FileInstallationStore(), + install_page_rendering_enabled=False, # disabled + state_store=FileOAuthStateStore(expiration_seconds=120), + ) + ) + req = AsyncBoltRequest(body="") + resp = await oauth_flow.handle_installation(req) + assert resp.status == 302 + location_header = resp.headers.get("location")[0] + assert "https://slack.com/oauth/v2/authorize?state=" in location_header + @pytest.mark.asyncio async def test_handle_callback(self): oauth_flow = AsyncOAuthFlow( From 47063fa8cb471347bd50cb14804b4ca5bd70e7cf Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sun, 10 Jan 2021 16:33:19 +0900 Subject: [PATCH 088/719] Fix #197 by supporting classic bot messages in app.message --- slack_bolt/app/app.py | 11 +- slack_bolt/app/async_app.py | 9 +- slack_bolt/listener_matcher/builtins.py | 22 +- tests/scenario_tests/test_message_bot.py | 206 +++++++++++++++++ .../scenario_tests_async/test_message_bot.py | 211 ++++++++++++++++++ 5 files changed, 450 insertions(+), 9 deletions(-) create mode 100644 tests/scenario_tests/test_message_bot.py create mode 100644 tests/scenario_tests_async/test_message_bot.py diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 2d6b0b891..690eb6d36 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -466,7 +466,9 @@ def error( def event( self, - event: Union[str, Pattern, Dict[str, str]], + event: Union[ + str, Pattern, Dict[str, Union[str, Sequence[Optional[Union[str, Pattern]]]]] + ], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Optional[Callable[..., Optional[BoltResponse]]]: @@ -501,9 +503,10 @@ def message( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.event( - {"type": "message", "subtype": None} - ) + # As of Jan 2021, most bot messages no longer have the subtype bot_message. + # By contrast, messages posted using class app's bot token still have the subtype. + constraints = {"type": "message", "subtype": (None, "bot_message")} + primary_matcher = builtin_matchers.event(constraints=constraints) middleware.append(MessageListenerMatches(keyword)) return self._register_listener( list(functions), primary_matcher, matchers, middleware, True diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 834852724..d08df8e2c 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -517,7 +517,9 @@ def error( def event( self, - event: Union[str, Pattern, Dict[str, str]], + event: Union[ + str, Pattern, Dict[str, Union[str, Sequence[Optional[Union[str, Pattern]]]]] + ], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: @@ -550,8 +552,11 @@ def message( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) + # As of Jan 2021, most bot messages no longer have the subtype bot_message. + # By contrast, messages posted using class app's bot token still have the subtype. + constraints = {"type": "message", "subtype": (None, "bot_message")} primary_matcher = builtin_matchers.event( - {"type": "message", "subtype": None}, True + constraints=constraints, asyncio=True ) middleware.append(AsyncMessageListenerMatches(keyword)) return self._register_listener( diff --git a/slack_bolt/listener_matcher/builtins.py b/slack_bolt/listener_matcher/builtins.py index bcba2a043..27efa2c24 100644 --- a/slack_bolt/listener_matcher/builtins.py +++ b/slack_bolt/listener_matcher/builtins.py @@ -26,7 +26,7 @@ from re import _pattern_type as Pattern else: from re import Pattern -from typing import Callable, Awaitable, Any +from typing import Callable, Awaitable, Any, Sequence, Optional, Union from typing import Union, Optional, Dict from slack_bolt.kwargs_injection import build_required_kwargs @@ -74,7 +74,9 @@ async def async_fun(body: Dict[str, Any]) -> bool: def event( - constraints: Union[str, Pattern, Dict[str, str]], + constraints: Union[ + str, Pattern, Dict[str, Union[str, Sequence[Optional[Union[str, Pattern]]]]] + ], asyncio: bool = False, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: if isinstance(constraints, (str, Pattern)): @@ -93,10 +95,24 @@ def func(body: Dict[str, Any]) -> bool: if not _matches(constraints["type"], event["type"]): return False if "subtype" in constraints: - expected_subtype = constraints["subtype"] + expected_subtype: Union[ + str, Sequence[Optional[Union[str, Pattern]]] + ] = constraints["subtype"] if expected_subtype is None: # "subtype" in constraints is intentionally None for this pattern return "subtype" not in event + elif isinstance(expected_subtype, Sequence): + subtypes: Sequence[ + Optional[Union[str, Pattern]] + ] = expected_subtype + for expected in subtypes: + actual: Optional[str] = event.get("subtype") + if expected is None: + if actual is None: + return True + elif actual is not None and _matches(expected, actual): + return True + return False else: return "subtype" in event and _matches( expected_subtype, event["subtype"] diff --git a/tests/scenario_tests/test_message_bot.py b/tests/scenario_tests/test_message_bot.py new file mode 100644 index 000000000..be24e0fb4 --- /dev/null +++ b/tests/scenario_tests/test_message_bot.py @@ -0,0 +1,206 @@ +import json +import re +import time + +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web import WebClient + +from slack_bolt.app import App +from slack_bolt.request import BoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestBotMessage: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def build_request(self, event_payload: dict) -> BoltRequest: + timestamp, body = str(int(time.time())), json.dumps(event_payload) + return BoltRequest(body=body, headers=self.build_headers(timestamp, body)) + + def test_message_handler(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + result = {"call_count": 0} + + @app.message("Hi there!") + def handle_messages(event, logger): + logger.info(event) + result["call_count"] = result["call_count"] + 1 + + request = self.build_request(user_message_event_payload) + response = app.dispatch(request) + assert response.status == 200 + + request = self.build_request(bot_message_event_payload) + response = app.dispatch(request) + assert response.status == 200 + + request = self.build_request(classic_bot_message_event_payload) + response = app.dispatch(request) + assert response.status == 200 + + assert self.mock_received_requests["/auth.test"] == 1 + time.sleep(1) # wait a bit after auto ack() + assert result["call_count"] == 3 + + +user_message_event_payload = { + "token": "verification-token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "968c94da-c271-4f2a-8ec9-12a9985e5df4", + "type": "message", + "text": "Hi there! Thanks for sharing the info!", + "user": "W111", + "ts": "1610261659.001400", + "team": "T111", + "blocks": [ + { + "type": "rich_text", + "block_id": "bN8", + "elements": [ + { + "type": "rich_text_section", + "elements": [ + { + "type": "text", + "text": "Hi there! Thanks for sharing the info!", + } + ], + } + ], + } + ], + "channel": "C111", + "event_ts": "1610261659.001400", + "channel_type": "channel", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1610261659, + "authorizations": [ + { + "enterprise_id": "E111", + "team_id": "T111", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": False, + "event_context": "1-message-T111-C111", +} + +bot_message_event_payload = { + "token": "verification-token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "bot_id": "B999", + "type": "message", + "text": "Hi there! Thanks for sharing the info!", + "user": "UB111", + "ts": "1610261539.000900", + "team": "T111", + "bot_profile": { + "id": "B999", + "deleted": False, + "name": "other-app", + "updated": 1607307935, + "app_id": "A222", + "icons": { + "image_36": "https://a.slack-edge.com/80588/img/plugins/app/bot_36.png", + "image_48": "https://a.slack-edge.com/80588/img/plugins/app/bot_48.png", + "image_72": "https://a.slack-edge.com/80588/img/plugins/app/service_72.png", + }, + "team_id": "T111", + }, + "channel": "C111", + "event_ts": "1610261539.000900", + "channel_type": "channel", + }, + "type": "event_callback", + "event_id": "Ev222", + "event_time": 1610261539, + "authorizations": [ + { + "enterprise_id": "E111", + "team_id": "T111", + "user_id": "UB111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": False, + "event_context": "1-message-T111-C111", +} + +classic_bot_message_event_payload = { + "token": "verification-token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "message", + "subtype": "bot_message", + "text": "Hi there! Thanks for sharing the info!", + "ts": "1610262363.001600", + "username": "classic-bot", + "bot_id": "B888", + "channel": "C111", + "event_ts": "1610262363.001600", + "channel_type": "channel", + }, + "type": "event_callback", + "event_id": "Ev333", + "event_time": 1610262363, + "authorizations": [ + { + "enterprise_id": "E111", + "team_id": "T111", + "user_id": "UB222", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": False, + "event_context": "1-message-T111-C111", +} diff --git a/tests/scenario_tests_async/test_message_bot.py b/tests/scenario_tests_async/test_message_bot.py new file mode 100644 index 000000000..599848bc5 --- /dev/null +++ b/tests/scenario_tests_async/test_message_bot.py @@ -0,0 +1,211 @@ +import asyncio +import json +from time import time + +import pytest +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestAsyncMessage: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def build_request(self, event_payload: dict) -> AsyncBoltRequest: + timestamp, body = str(int(time())), json.dumps(event_payload) + return AsyncBoltRequest(body=body, headers=self.build_headers(timestamp, body)) + + @pytest.mark.asyncio + async def test_string_keyword(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + result = {"call_count": 0} + + @app.message("Hi there!") + async def handle_messages(event, logger): + logger.info(event) + result["call_count"] = result["call_count"] + 1 + + request = self.build_request(user_message_event_payload) + response = await app.async_dispatch(request) + assert response.status == 200 + + request = self.build_request(bot_message_event_payload) + response = await app.async_dispatch(request) + assert response.status == 200 + + request = self.build_request(classic_bot_message_event_payload) + response = await app.async_dispatch(request) + assert response.status == 200 + + assert self.mock_received_requests["/auth.test"] == 1 + await asyncio.sleep(1) # wait a bit after auto ack() + assert result["call_count"] == 3 + + +user_message_event_payload = { + "token": "verification-token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "968c94da-c271-4f2a-8ec9-12a9985e5df4", + "type": "message", + "text": "Hi there! Thanks for sharing the info!", + "user": "W111", + "ts": "1610261659.001400", + "team": "T111", + "blocks": [ + { + "type": "rich_text", + "block_id": "bN8", + "elements": [ + { + "type": "rich_text_section", + "elements": [ + { + "type": "text", + "text": "Hi there! Thanks for sharing the info!", + } + ], + } + ], + } + ], + "channel": "C111", + "event_ts": "1610261659.001400", + "channel_type": "channel", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1610261659, + "authorizations": [ + { + "enterprise_id": "E111", + "team_id": "T111", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": False, + "event_context": "1-message-T111-C111", +} + +bot_message_event_payload = { + "token": "verification-token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "bot_id": "B999", + "type": "message", + "text": "Hi there! Thanks for sharing the info!", + "user": "UB111", + "ts": "1610261539.000900", + "team": "T111", + "bot_profile": { + "id": "B999", + "deleted": False, + "name": "other-app", + "updated": 1607307935, + "app_id": "A222", + "icons": { + "image_36": "https://a.slack-edge.com/80588/img/plugins/app/bot_36.png", + "image_48": "https://a.slack-edge.com/80588/img/plugins/app/bot_48.png", + "image_72": "https://a.slack-edge.com/80588/img/plugins/app/service_72.png", + }, + "team_id": "T111", + }, + "channel": "C111", + "event_ts": "1610261539.000900", + "channel_type": "channel", + }, + "type": "event_callback", + "event_id": "Ev222", + "event_time": 1610261539, + "authorizations": [ + { + "enterprise_id": "E111", + "team_id": "T111", + "user_id": "UB111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": False, + "event_context": "1-message-T111-C111", +} + +classic_bot_message_event_payload = { + "token": "verification-token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "message", + "subtype": "bot_message", + "text": "Hi there! Thanks for sharing the info!", + "ts": "1610262363.001600", + "username": "classic-bot", + "bot_id": "B888", + "channel": "C111", + "event_ts": "1610262363.001600", + "channel_type": "channel", + }, + "type": "event_callback", + "event_id": "Ev333", + "event_time": 1610262363, + "authorizations": [ + { + "enterprise_id": "E111", + "team_id": "T111", + "user_id": "UB222", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": False, + "event_context": "1-message-T111-C111", +} From 3eabe68f9ffa5bc31f24cb5d71dfbccb42b2d7ef Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 12 Jan 2021 19:28:15 +0900 Subject: [PATCH 089/719] Improve #192 by using inspect module methods --- slack_bolt/kwargs_injection/async_utils.py | 10 +++- slack_bolt/kwargs_injection/utils.py | 10 +++- slack_bolt/lazy_listener/async_internals.py | 1 + slack_bolt/lazy_listener/internals.py | 1 + slack_bolt/listener/async_listener.py | 1 + slack_bolt/listener/custom_listener.py | 1 + slack_bolt/listener_matcher/async_builtins.py | 1 + .../async_listener_matcher.py | 1 + slack_bolt/listener_matcher/builtins.py | 1 + .../custom_listener_matcher.py | 1 + .../middleware/async_custom_middleware.py | 1 + slack_bolt/middleware/custom_middleware.py | 1 + .../test_app_using_methods_in_class.py | 49 +++++++++++++++++ .../test_app_using_methods_in_class.py | 53 ++++++++++++++++++- 14 files changed, 127 insertions(+), 5 deletions(-) diff --git a/slack_bolt/kwargs_injection/async_utils.py b/slack_bolt/kwargs_injection/async_utils.py index a4b069d72..dae473eea 100644 --- a/slack_bolt/kwargs_injection/async_utils.py +++ b/slack_bolt/kwargs_injection/async_utils.py @@ -1,4 +1,5 @@ # pytype: skip-file +import inspect import logging from typing import Callable, Dict, Optional, Any, Sequence @@ -25,6 +26,7 @@ def build_async_required_kwargs( request: AsyncBoltRequest, response: Optional[BoltResponse], next_func: Callable[[], None] = None, + this_func: Optional[Callable] = None, ) -> Dict[str, Any]: all_available_args = { "logger": logger, @@ -73,8 +75,12 @@ def build_async_required_kwargs( if first_arg_name in {"self", "cls"}: required_arg_names.pop(0) elif first_arg_name not in all_available_args.keys(): - logger.warning(warning_skip_uncommon_arg_name(first_arg_name)) - required_arg_names.pop(0) + if this_func is None: + logger.warning(warning_skip_uncommon_arg_name(first_arg_name)) + required_arg_names.pop(0) + elif inspect.ismethod(this_func): + # We are sure that we should skip manipulating this arg + required_arg_names.pop(0) kwargs: Dict[str, Any] = { k: v for k, v in all_available_args.items() if k in required_arg_names diff --git a/slack_bolt/kwargs_injection/utils.py b/slack_bolt/kwargs_injection/utils.py index e10febb59..2685ba342 100644 --- a/slack_bolt/kwargs_injection/utils.py +++ b/slack_bolt/kwargs_injection/utils.py @@ -1,4 +1,5 @@ # pytype: skip-file +import inspect import logging from typing import Callable, Dict, Optional, Any, Sequence @@ -25,6 +26,7 @@ def build_required_kwargs( request: BoltRequest, response: Optional[BoltResponse], next_func: Callable[[], None] = None, + this_func: Optional[Callable] = None, ) -> Dict[str, Any]: all_available_args = { "logger": logger, @@ -73,8 +75,12 @@ def build_required_kwargs( if first_arg_name in {"self", "cls"}: required_arg_names.pop(0) elif first_arg_name not in all_available_args.keys(): - logger.warning(warning_skip_uncommon_arg_name(first_arg_name)) - required_arg_names.pop(0) + if this_func is None: + logger.warning(warning_skip_uncommon_arg_name(first_arg_name)) + required_arg_names.pop(0) + elif inspect.ismethod(this_func): + # We are sure that we should skip manipulating this arg + required_arg_names.pop(0) kwargs: Dict[str, Any] = { k: v for k, v in all_available_args.items() if k in required_arg_names diff --git a/slack_bolt/lazy_listener/async_internals.py b/slack_bolt/lazy_listener/async_internals.py index a3e3bfe79..db0d21eb9 100644 --- a/slack_bolt/lazy_listener/async_internals.py +++ b/slack_bolt/lazy_listener/async_internals.py @@ -23,6 +23,7 @@ async def request_wired_wrapper() -> None: required_arg_names=arg_names, request=request, response=None, + this_func=internal_func, ) ) except Exception as e: diff --git a/slack_bolt/lazy_listener/internals.py b/slack_bolt/lazy_listener/internals.py index f2934ef69..95be376ae 100644 --- a/slack_bolt/lazy_listener/internals.py +++ b/slack_bolt/lazy_listener/internals.py @@ -23,6 +23,7 @@ def request_wired_func_wrapper() -> None: required_arg_names=arg_names, request=request, response=None, + this_func=func, ) ) except Exception as e: diff --git a/slack_bolt/listener/async_listener.py b/slack_bolt/listener/async_listener.py index 567a51e17..19326fe91 100644 --- a/slack_bolt/listener/async_listener.py +++ b/slack_bolt/listener/async_listener.py @@ -117,6 +117,7 @@ async def run_ack_function( required_arg_names=self.arg_names, request=request, response=response, + this_func=self.ack_function, ) ) diff --git a/slack_bolt/listener/custom_listener.py b/slack_bolt/listener/custom_listener.py index 99f8c353f..b38e80324 100644 --- a/slack_bolt/listener/custom_listener.py +++ b/slack_bolt/listener/custom_listener.py @@ -52,5 +52,6 @@ def run_ack_function( required_arg_names=self.arg_names, request=request, response=response, + this_func=self.ack_function, ) ) diff --git a/slack_bolt/listener_matcher/async_builtins.py b/slack_bolt/listener_matcher/async_builtins.py index 95a7b32e8..f8d05ce52 100644 --- a/slack_bolt/listener_matcher/async_builtins.py +++ b/slack_bolt/listener_matcher/async_builtins.py @@ -14,5 +14,6 @@ async def async_matches(self, req: AsyncBoltRequest, resp: BoltResponse) -> bool required_arg_names=self.arg_names, request=req, response=resp, + this_func=self.func, ) ) diff --git a/slack_bolt/listener_matcher/async_listener_matcher.py b/slack_bolt/listener_matcher/async_listener_matcher.py index 29a107e3e..b21872ed9 100644 --- a/slack_bolt/listener_matcher/async_listener_matcher.py +++ b/slack_bolt/listener_matcher/async_listener_matcher.py @@ -45,6 +45,7 @@ async def async_matches(self, req: AsyncBoltRequest, resp: BoltResponse) -> bool required_arg_names=self.arg_names, request=req, response=resp, + this_func=self.func, ) ) diff --git a/slack_bolt/listener_matcher/builtins.py b/slack_bolt/listener_matcher/builtins.py index 27efa2c24..50b64fea6 100644 --- a/slack_bolt/listener_matcher/builtins.py +++ b/slack_bolt/listener_matcher/builtins.py @@ -50,6 +50,7 @@ def matches(self, req: BoltRequest, resp: BoltResponse) -> bool: required_arg_names=self.arg_names, request=req, response=resp, + this_func=self.func, ) ) diff --git a/slack_bolt/listener_matcher/custom_listener_matcher.py b/slack_bolt/listener_matcher/custom_listener_matcher.py index f96c4da9e..4e07006d4 100644 --- a/slack_bolt/listener_matcher/custom_listener_matcher.py +++ b/slack_bolt/listener_matcher/custom_listener_matcher.py @@ -28,5 +28,6 @@ def matches(self, req: BoltRequest, resp: BoltResponse) -> bool: required_arg_names=self.arg_names, request=req, response=resp, + this_func=self.func, ) ) diff --git a/slack_bolt/middleware/async_custom_middleware.py b/slack_bolt/middleware/async_custom_middleware.py index 220a0723a..be44cf2db 100644 --- a/slack_bolt/middleware/async_custom_middleware.py +++ b/slack_bolt/middleware/async_custom_middleware.py @@ -39,6 +39,7 @@ async def async_process( request=req, response=resp, next_func=next, + this_func=self.func, ) ) diff --git a/slack_bolt/middleware/custom_middleware.py b/slack_bolt/middleware/custom_middleware.py index 016b42ee9..f3e4afff8 100644 --- a/slack_bolt/middleware/custom_middleware.py +++ b/slack_bolt/middleware/custom_middleware.py @@ -35,6 +35,7 @@ def process( request=req, response=resp, next_func=next, + this_func=self.func, ) ) diff --git a/tests/scenario_tests/test_app_using_methods_in_class.py b/tests/scenario_tests/test_app_using_methods_in_class.py index 4102c819c..642d0641d 100644 --- a/tests/scenario_tests/test_app_using_methods_in_class.py +++ b/tests/scenario_tests/test_app_using_methods_in_class.py @@ -1,3 +1,4 @@ +import inspect import json from time import time, sleep from typing import Callable @@ -31,6 +32,29 @@ def teardown_method(self): cleanup_mock_web_api_server(self) restore_os_env(self.old_os_env) + def test_inspect_behaviors(self): + def f(): + pass + + assert inspect.ismethod(f) is False + + class A: + def b(self): + pass + + @classmethod + def c(cls): + pass + + @staticmethod + def d(): + pass + + a = A() + assert inspect.ismethod(a.b) is True + assert inspect.ismethod(A.c) is True + assert inspect.ismethod(A.d) is False + def run_app_and_verify(self, app: App): payload = { "type": "message_action", @@ -119,12 +143,24 @@ def test_instance_methods_uncommon_name(self): app.shortcut("test-shortcut")(awesome.instance_method2) self.run_app_and_verify(app) + def test_instance_methods_uncommon_name_3(self): + app = App(client=self.web_client, signing_secret=self.signing_secret) + awesome = AwesomeClass("Slackbot") + app.use(awesome.instance_middleware) + app.shortcut("test-shortcut")(awesome.instance_method3) + self.run_app_and_verify(app) + def test_static_methods(self): app = App(client=self.web_client, signing_secret=self.signing_secret) app.use(AwesomeClass.static_middleware) app.shortcut("test-shortcut")(AwesomeClass.static_method) self.run_app_and_verify(app) + def test_invalid_arg_in_func(self): + app = App(client=self.web_client, signing_secret=self.signing_secret) + app.shortcut("test-shortcut")(top_level_function) + self.run_app_and_verify(app) + class AwesomeClass: def __init__(self, name: str): @@ -159,7 +195,20 @@ def instance_method2(whatever, context: BoltContext, say: Say, ack: Ack): ack() say(f"Hello <@{context.user_id}>! My name is {whatever.name}") + text = "hello world" + + def instance_method3(this, ack, logger, say): + ack() + logger.debug(this.text) + say(f"Hi there!") + @staticmethod def static_method(context: BoltContext, say: Say, ack: Ack): ack() say(f"Hello <@{context.user_id}>!") + + +def top_level_function(invalid_arg, ack, say): + assert invalid_arg is None + ack() + say("Hi") diff --git a/tests/scenario_tests_async/test_app_using_methods_in_class.py b/tests/scenario_tests_async/test_app_using_methods_in_class.py index a1131fd35..f58be3af5 100644 --- a/tests/scenario_tests_async/test_app_using_methods_in_class.py +++ b/tests/scenario_tests_async/test_app_using_methods_in_class.py @@ -1,4 +1,5 @@ import asyncio +import inspect import json from time import time from typing import Callable @@ -41,6 +42,29 @@ def event_loop(self): finally: restore_os_env(old_os_env) + def test_inspect_behaviors(self): + async def f(): + pass + + assert inspect.ismethod(f) is False + + class A: + async def b(self): + pass + + @classmethod + async def c(cls): + pass + + @staticmethod + async def d(): + pass + + a = A() + assert inspect.ismethod(a.b) is True + assert inspect.ismethod(A.c) is True + assert inspect.ismethod(A.d) is False + async def run_app_and_verify(self, app: AsyncApp): payload = { "type": "message_action", @@ -126,13 +150,21 @@ async def test_instance_methods(self): await self.run_app_and_verify(app) @pytest.mark.asyncio - async def test_instance_methods_uncommon_name(self): + async def test_instance_methods_uncommon_name_1(self): app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) awesome = AwesomeClass("Slackbot") app.use(awesome.instance_middleware) app.shortcut("test-shortcut")(awesome.instance_method2) await self.run_app_and_verify(app) + @pytest.mark.asyncio + async def test_instance_methods_uncommon_name_2(self): + app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) + awesome = AwesomeClass("Slackbot") + app.use(awesome.instance_middleware) + app.shortcut("test-shortcut")(awesome.instance_method3) + await self.run_app_and_verify(app) + @pytest.mark.asyncio async def test_static_methods(self): app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) @@ -140,6 +172,12 @@ async def test_static_methods(self): app.shortcut("test-shortcut")(AwesomeClass.static_method) await self.run_app_and_verify(app) + @pytest.mark.asyncio + async def test_invalid_arg_in_func(self): + app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) + app.shortcut("test-shortcut")(top_level_function) + await self.run_app_and_verify(app) + class AwesomeClass: def __init__(self, name: str): @@ -182,7 +220,20 @@ async def instance_method2( await ack() await say(f"Hello <@{context.user_id}>! My name is {whatever.name}") + text = "hello world" + + async def instance_method3(this, ack, logger, say): + await ack() + logger.debug(this.text) + await say(f"Hi there!") + @staticmethod async def static_method(context: AsyncBoltContext, say: AsyncSay, ack: AsyncAck): await ack() await say(f"Hello <@{context.user_id}>!") + + +async def top_level_function(invalid_arg, ack, say): + assert invalid_arg is None + await ack() + await say("Hi") From 51af9e048611deb236241aec894beae65580c77d Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 25 Nov 2020 12:40:20 +0900 Subject: [PATCH 090/719] Add Socket Mode support #159 --- examples/socket_mode.py | 39 ++++++++++++++ examples/socket_mode_async.py | 46 ++++++++++++++++ examples/socket_mode_oauth.py | 52 ++++++++++++++++++ setup.py | 2 +- slack_bolt/adapter/socket_mode/__init__.py | 0 .../adapter/socket_mode/aiohttp/__init__.py | 54 +++++++++++++++++++ .../adapter/socket_mode/async_base_handler.py | 29 ++++++++++ .../adapter/socket_mode/async_internals.py | 46 ++++++++++++++++ .../adapter/socket_mode/base_handler.py | 29 ++++++++++ slack_bolt/adapter/socket_mode/internals.py | 47 ++++++++++++++++ .../socket_mode/websocket_client/__init__.py | 30 +++++++++++ .../socket_mode/websockets/__init__.py | 54 +++++++++++++++++++ slack_bolt/version.py | 2 +- 13 files changed, 428 insertions(+), 2 deletions(-) create mode 100644 examples/socket_mode.py create mode 100644 examples/socket_mode_async.py create mode 100644 examples/socket_mode_oauth.py create mode 100644 slack_bolt/adapter/socket_mode/__init__.py create mode 100644 slack_bolt/adapter/socket_mode/aiohttp/__init__.py create mode 100644 slack_bolt/adapter/socket_mode/async_base_handler.py create mode 100644 slack_bolt/adapter/socket_mode/async_internals.py create mode 100644 slack_bolt/adapter/socket_mode/base_handler.py create mode 100644 slack_bolt/adapter/socket_mode/internals.py create mode 100644 slack_bolt/adapter/socket_mode/websocket_client/__init__.py create mode 100644 slack_bolt/adapter/socket_mode/websockets/__init__.py diff --git a/examples/socket_mode.py b/examples/socket_mode.py new file mode 100644 index 000000000..88e407397 --- /dev/null +++ b/examples/socket_mode.py @@ -0,0 +1,39 @@ +# ------------------------------------------------ +# instead of slack_bolt in requirements.txt +import sys + +sys.path.insert(1, "..") +# ------------------------------------------------ + +import logging +import os + +from slack_bolt import App +from slack_bolt.adapter.socket_mode.websocket_client import SocketModeHandler + +# Install the Slack app and get xoxb- token in advance +app = App(token=os.environ["SLACK_BOT_TOKEN"]) + + +@app.command("/hello-socket-mode") +def hello_command(ack, body): + user_id = body["user_id"] + ack(f"Hi <@{user_id}>!") + + +@app.event("app_mention") +def event_test(event, say): + say(f"Hi there, <@{event['user']}>!") + + +@app.shortcut("socket-mode") +def global_shortcut(ack): + ack() + + +if __name__ == "__main__": + logging.basicConfig(level=logging.DEBUG) + + # export SLACK_APP_TOKEN=xapp-*** + # export SLACK_BOT_TOKEN=xoxb-*** + SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]).start() diff --git a/examples/socket_mode_async.py b/examples/socket_mode_async.py new file mode 100644 index 000000000..a98424b0c --- /dev/null +++ b/examples/socket_mode_async.py @@ -0,0 +1,46 @@ +# ------------------------------------------------ +# instead of slack_bolt in requirements.txt +import sys + + +sys.path.insert(1, "..") +# ------------------------------------------------ + +import logging +import os + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.adapter.socket_mode.aiohttp import AsyncSocketModeHandler + +# Install the Slack app and get xoxb- token in advance +app = AsyncApp(token=os.environ["SLACK_BOT_TOKEN"]) + + +@app.command("/hello-socket-mode") +async def hello_command(ack, body): + user_id = body["user_id"] + await ack(f"Hi <@{user_id}>!") + + +@app.event("app_mention") +async def event_test(event, say): + await say(f"Hi there, <@{event['user']}>!") + + +@app.shortcut("socket-mode") +async def global_shortcut(ack): + await ack() + + +# export SLACK_APP_TOKEN=xapp-*** +# export SLACK_BOT_TOKEN=xoxb-*** + +async def main(): + handler = AsyncSocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]) + await handler.start_async() + + +if __name__ == "__main__": + logging.basicConfig(level=logging.DEBUG) + import asyncio + asyncio.run(main()) diff --git a/examples/socket_mode_oauth.py b/examples/socket_mode_oauth.py new file mode 100644 index 000000000..7167db68b --- /dev/null +++ b/examples/socket_mode_oauth.py @@ -0,0 +1,52 @@ +# ------------------------------------------------ +# instead of slack_bolt in requirements.txt +import sys + +sys.path.insert(1, "..") +# ------------------------------------------------ + +import logging +import os +from slack_bolt.app import App +from slack_bolt.oauth.oauth_settings import OAuthSettings +from slack_bolt.adapter.socket_mode.websocket_client import SocketModeHandler + +app = App( + signing_secret=os.environ["SLACK_SIGNING_SECRET"], + oauth_settings=OAuthSettings( + client_id=os.environ["SLACK_CLIENT_ID"], + client_secret=os.environ["SLACK_CLIENT_SECRET"], + scopes=os.environ["SLACK_SCOPES"].split(","), + ) +) + + +@app.command("/hello-socket-mode") +def hello_command(ack, body): + user_id = body["user_id"] + ack(f"Hi <@{user_id}>!") + + +@app.event("app_mention") +def event_test(event, say): + say(f"Hi there, <@{event['user']}>!") + + +@app.shortcut("socket-mode") +def global_shortcut(ack): + ack() + + +if __name__ == "__main__": + logging.basicConfig(level=logging.DEBUG) + SocketModeHandler(app, os.environ.get("SLACK_APP_TOKEN")).connect() + app.start() + + # export SLACK_APP_TOKEN= + # export SLACK_SIGNING_SECRET= + # export SLACK_CLIENT_ID= + # export SLACK_CLIENT_SECRET= + # export SLACK_SCOPES= + # pip install .[optional] + # pip install slack_bolt + # python socket_mode_oauth.py diff --git a/setup.py b/setup.py index cb789759a..817629061 100755 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.1.1,<3.2",], + install_requires=["slack_sdk>=3.2.0b1,<3.3",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/adapter/socket_mode/__init__.py b/slack_bolt/adapter/socket_mode/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/slack_bolt/adapter/socket_mode/aiohttp/__init__.py b/slack_bolt/adapter/socket_mode/aiohttp/__init__.py new file mode 100644 index 000000000..37cecd575 --- /dev/null +++ b/slack_bolt/adapter/socket_mode/aiohttp/__init__.py @@ -0,0 +1,54 @@ +import os +from time import time +from typing import Optional + +from slack_sdk.socket_mode.aiohttp import SocketModeClient +from slack_sdk.socket_mode.request import SocketModeRequest + +from slack_bolt import App +from slack_bolt.adapter.socket_mode.async_base_handler import AsyncBaseSocketModeHandler +from slack_bolt.adapter.socket_mode.async_internals import ( + send_async_response, + run_async_bolt_app, +) +from slack_bolt.adapter.socket_mode.internals import run_bolt_app +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.response import BoltResponse + + +class SocketModeHandler(AsyncBaseSocketModeHandler): + app: App + app_token: str + client: SocketModeClient + + def __init__( + self, app: App, app_token: Optional[str] = None, + ): + self.app = app + self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] + self.client = SocketModeClient(app_token=self.app_token) + self.client.socket_mode_request_listeners.append(self.handle) + + async def handle(self, client: SocketModeClient, req: SocketModeRequest) -> None: + start = time() + bolt_resp: BoltResponse = run_bolt_app(self.app, req) + await send_async_response(client, req, bolt_resp, start) + + +class AsyncSocketModeHandler(AsyncBaseSocketModeHandler): + app: AsyncApp + app_token: str + client: SocketModeClient + + def __init__( + self, app: AsyncApp, app_token: Optional[str] = None, + ): + self.app = app + self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] + self.client = SocketModeClient(app_token=self.app_token) + self.client.socket_mode_request_listeners.append(self.handle) + + async def handle(self, client: SocketModeClient, req: SocketModeRequest) -> None: + start = time() + bolt_resp: BoltResponse = await run_async_bolt_app(self.app, req) + await send_async_response(client, req, bolt_resp, start) diff --git a/slack_bolt/adapter/socket_mode/async_base_handler.py b/slack_bolt/adapter/socket_mode/async_base_handler.py new file mode 100644 index 000000000..62ee0107b --- /dev/null +++ b/slack_bolt/adapter/socket_mode/async_base_handler.py @@ -0,0 +1,29 @@ +import asyncio +import logging + +from slack_sdk.socket_mode.async_client import AsyncBaseSocketModeClient +from slack_sdk.socket_mode.request import SocketModeRequest + + +class AsyncBaseSocketModeHandler: + client: AsyncBaseSocketModeClient + + async def handle(self, client: AsyncBaseSocketModeClient, req: SocketModeRequest) -> None: + raise NotImplementedError() + + async def connect_async(self): + await self.client.connect() + + async def disconnect_async(self): + await self.client.disconnect() + + async def close_async(self): + await self.client.close() + + async def start_async(self): + await self.connect_async() + if self.app.logger.level > logging.INFO: + print("⚡️ Bolt app is running!") + else: + self.app.logger.info("⚡️ Bolt app is running!") + await asyncio.sleep(float("inf")) diff --git a/slack_bolt/adapter/socket_mode/async_internals.py b/slack_bolt/adapter/socket_mode/async_internals.py new file mode 100644 index 000000000..cd01ce7fc --- /dev/null +++ b/slack_bolt/adapter/socket_mode/async_internals.py @@ -0,0 +1,46 @@ +import logging +from time import time + +from slack_sdk.socket_mode.async_client import AsyncBaseSocketModeClient +from slack_sdk.socket_mode.request import SocketModeRequest +from slack_sdk.socket_mode.response import SocketModeResponse + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.request.async_request import AsyncBoltRequest +from slack_bolt.response import BoltResponse + + +async def run_async_bolt_app(app: AsyncApp, req: SocketModeRequest): + bolt_req: AsyncBoltRequest = AsyncBoltRequest(mode="socket_mode", body=req.payload) + bolt_resp: BoltResponse = await app.async_dispatch(bolt_req) + return bolt_resp + + +async def send_async_response( + client: AsyncBaseSocketModeClient, + req: SocketModeRequest, + bolt_resp: BoltResponse, + start_time: int, +): + if bolt_resp.status == 200: + if bolt_resp.body is None or len(bolt_resp.body) == 0: + await client.send_socket_mode_response( + SocketModeResponse(envelope_id=req.envelope_id) + ) + elif bolt_resp.body.startswith("{"): + await client.send_socket_mode_response( + SocketModeResponse(envelope_id=req.envelope_id, payload=bolt_resp.body,) + ) + else: + await client.send_socket_mode_response( + SocketModeResponse( + envelope_id=req.envelope_id, payload={"text": bolt_resp.body}, + ) + ) + if client.logger.level <= logging.DEBUG: + spent_time = int((time() - start_time) * 1000) + client.logger.debug(f"Response time: {spent_time} milliseconds") + else: + client.logger.info( + f"Unsuccessful Bolt execution result (status: {bolt_resp.status}, body: {bolt_resp.body})" + ) diff --git a/slack_bolt/adapter/socket_mode/base_handler.py b/slack_bolt/adapter/socket_mode/base_handler.py new file mode 100644 index 000000000..782fafe88 --- /dev/null +++ b/slack_bolt/adapter/socket_mode/base_handler.py @@ -0,0 +1,29 @@ +import logging +from threading import Event + +from slack_sdk.socket_mode.client import BaseSocketModeClient +from slack_sdk.socket_mode.request import SocketModeRequest + + +class BaseSocketModeHandler: + client: BaseSocketModeClient + + def handle(self, client: BaseSocketModeClient, req: SocketModeRequest) -> None: + raise NotImplementedError() + + def connect(self): + self.client.connect() + + def disconnect(self): + self.client.disconnect() + + def close(self): + self.client.close() + + def start(self): + self.connect() + if self.app.logger.level > logging.INFO: + print("⚡️ Bolt app is running!") + else: + self.app.logger.info("⚡️ Bolt app is running!") + Event().wait() diff --git a/slack_bolt/adapter/socket_mode/internals.py b/slack_bolt/adapter/socket_mode/internals.py new file mode 100644 index 000000000..8ea68ed84 --- /dev/null +++ b/slack_bolt/adapter/socket_mode/internals.py @@ -0,0 +1,47 @@ +import logging +from time import time + +from slack_sdk.socket_mode.client import BaseSocketModeClient +from slack_sdk.socket_mode.request import SocketModeRequest +from slack_sdk.socket_mode.response import SocketModeResponse + +from slack_bolt.app import App +from slack_bolt.request import BoltRequest +from slack_bolt.response import BoltResponse + + +def run_bolt_app(app: App, req: SocketModeRequest): + bolt_req: BoltRequest = BoltRequest(mode="socket_mode", body=req.payload) + bolt_resp: BoltResponse = app.dispatch(bolt_req) + return bolt_resp + + +def send_response( + client: BaseSocketModeClient, + req: SocketModeRequest, + bolt_resp: BoltResponse, + start_time: int, +): + if bolt_resp.status == 200: + if bolt_resp.body is None or len(bolt_resp.body) == 0: + client.send_socket_mode_response( + SocketModeResponse(envelope_id=req.envelope_id) + ) + elif bolt_resp.body.startswith("{"): + client.send_socket_mode_response( + SocketModeResponse(envelope_id=req.envelope_id, payload=bolt_resp.body,) + ) + else: + client.send_socket_mode_response( + SocketModeResponse( + envelope_id=req.envelope_id, payload={"text": bolt_resp.body} + ) + ) + + if client.logger.level <= logging.DEBUG: + spent_time = int((time() - start_time) * 1000) + client.logger.debug(f"Response time: {spent_time} milliseconds") + else: + client.logger.info( + f"Unsuccessful Bolt execution result (status: {bolt_resp.status}, body: {bolt_resp.body})" + ) diff --git a/slack_bolt/adapter/socket_mode/websocket_client/__init__.py b/slack_bolt/adapter/socket_mode/websocket_client/__init__.py new file mode 100644 index 000000000..433761d75 --- /dev/null +++ b/slack_bolt/adapter/socket_mode/websocket_client/__init__.py @@ -0,0 +1,30 @@ +import os +from time import time +from typing import Optional + +from slack_sdk.socket_mode.request import SocketModeRequest +from slack_sdk.socket_mode.websocket_client import SocketModeClient + +from slack_bolt import App +from slack_bolt.adapter.socket_mode.base_handler import BaseSocketModeHandler +from slack_bolt.adapter.socket_mode.internals import run_bolt_app, send_response +from slack_bolt.response import BoltResponse + + +class SocketModeHandler(BaseSocketModeHandler): + app: App + app_token: str + client: SocketModeClient + + def __init__( + self, app: App, app_token: Optional[str] = None, + ): + self.app = app + self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] + self.client = SocketModeClient(app_token=self.app_token) + self.client.socket_mode_request_listeners.append(self.handle) + + def handle(self, client: SocketModeClient, req: SocketModeRequest) -> None: + start = time() + bolt_resp: BoltResponse = run_bolt_app(self.app, req) + send_response(client, req, bolt_resp, start) diff --git a/slack_bolt/adapter/socket_mode/websockets/__init__.py b/slack_bolt/adapter/socket_mode/websockets/__init__.py new file mode 100644 index 000000000..fb9c5933d --- /dev/null +++ b/slack_bolt/adapter/socket_mode/websockets/__init__.py @@ -0,0 +1,54 @@ +import os +from time import time +from typing import Optional + +from slack_sdk.socket_mode.websockets import SocketModeClient +from slack_sdk.socket_mode.request import SocketModeRequest + +from slack_bolt import App +from slack_bolt.adapter.socket_mode.async_base_handler import AsyncBaseSocketModeHandler +from slack_bolt.adapter.socket_mode.async_internals import ( + send_async_response, + run_async_bolt_app, +) +from slack_bolt.adapter.socket_mode.internals import run_bolt_app +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.response import BoltResponse + + +class SocketModeHandler(AsyncBaseSocketModeHandler): + app: App + app_token: str + client: SocketModeClient + + def __init__( + self, app: App, app_token: Optional[str] = None, + ): + self.app = app + self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] + self.client = SocketModeClient(app_token=self.app_token) + self.client.socket_mode_request_listeners.append(self.handle) + + async def handle(self, client: SocketModeClient, req: SocketModeRequest) -> None: + start = time() + bolt_resp: BoltResponse = run_bolt_app(self.app, req) + await send_async_response(client, req, bolt_resp, start) + + +class AsyncSocketModeHandler(AsyncBaseSocketModeHandler): + app: AsyncApp + app_token: str + client: SocketModeClient + + def __init__( + self, app: AsyncApp, app_token: Optional[str] = None, + ): + self.app = app + self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] + self.client = SocketModeClient(app_token=self.app_token) + self.client.socket_mode_request_listeners.append(self.handle) + + async def handle(self, client: SocketModeClient, req: SocketModeRequest) -> None: + start = time() + bolt_resp: BoltResponse = await run_async_bolt_app(self.app, req) + await send_async_response(client, req, bolt_resp, start) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 9b102be76..48346736b 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.1.5" +__version__ = "1.2.0b1" From 16a55aba7556d53c5595684d50ccba83eb6b5298 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 1 Dec 2020 23:07:40 +0900 Subject: [PATCH 091/719] version 1.2.0b1 --- examples/socket_mode.py | 73 ++++++++++++++++-- examples/socket_mode_async.py | 74 ++++++++++++++++++- examples/socket_mode_oauth.py | 74 +++++++++++++++++-- slack_bolt/adapter/socket_mode/__init__.py | 2 + .../adapter/socket_mode/aiohttp/__init__.py | 16 ++-- .../adapter/socket_mode/async_base_handler.py | 9 ++- .../adapter/socket_mode/async_handler.py | 1 + .../adapter/socket_mode/async_internals.py | 11 ++- .../adapter/socket_mode/base_handler.py | 3 + .../adapter/socket_mode/builtin/__init__.py | 35 +++++++++ slack_bolt/adapter/socket_mode/internals.py | 11 ++- .../socket_mode/websocket_client/__init__.py | 13 +++- .../socket_mode/websockets/__init__.py | 16 ++-- 13 files changed, 299 insertions(+), 39 deletions(-) create mode 100644 slack_bolt/adapter/socket_mode/async_handler.py create mode 100644 slack_bolt/adapter/socket_mode/builtin/__init__.py diff --git a/examples/socket_mode.py b/examples/socket_mode.py index 88e407397..e4b2f10ba 100644 --- a/examples/socket_mode.py +++ b/examples/socket_mode.py @@ -6,10 +6,13 @@ # ------------------------------------------------ import logging + +logging.basicConfig(level=logging.DEBUG) + import os from slack_bolt import App -from slack_bolt.adapter.socket_mode.websocket_client import SocketModeHandler +from slack_bolt.adapter.socket_mode import SocketModeHandler # Install the Slack app and get xoxb- token in advance app = App(token=os.environ["SLACK_BOT_TOKEN"]) @@ -26,14 +29,74 @@ def event_test(event, say): say(f"Hi there, <@{event['user']}>!") -@app.shortcut("socket-mode") -def global_shortcut(ack): +def ack_shortcut(ack): ack() -if __name__ == "__main__": - logging.basicConfig(level=logging.DEBUG) +def open_modal(body, client): + client.views_open( + trigger_id=body["trigger_id"], + view={ + "type": "modal", + "callback_id": "socket_modal_submission", + "submit": {"type": "plain_text", "text": "Submit",}, + "close": {"type": "plain_text", "text": "Cancel",}, + "title": {"type": "plain_text", "text": "Socket Modal",}, + "blocks": [ + { + "type": "input", + "block_id": "q1", + "label": {"type": "plain_text", "text": "Write anything here!",}, + "element": {"action_id": "feedback", "type": "plain_text_input",}, + }, + { + "type": "input", + "block_id": "q2", + "label": { + "type": "plain_text", + "text": "Can you tell us your favorites?", + }, + "element": { + "type": "external_select", + "action_id": "favorite-animal", + "min_query_length": 0, + "placeholder": { + "type": "plain_text", + "text": "Select your favorites", + }, + }, + }, + ], + }, + ) + + +app.shortcut("socket-mode")(ack=ack_shortcut, lazy=[open_modal]) + + +all_options = [ + {"text": {"type": "plain_text", "text": ":cat: Cat"}, "value": "cat",}, + {"text": {"type": "plain_text", "text": ":dog: Dog"}, "value": "dog",}, + {"text": {"type": "plain_text", "text": ":bear: Bear"}, "value": "bear",}, +] + +@app.options("favorite-animal") +def external_data_source_handler(ack, body): + keyword = body.get("value") + if keyword is not None and len(keyword) > 0: + options = [o for o in all_options if keyword in o["text"]["text"]] + ack(options=options) + else: + ack(options=all_options) + + +@app.view("socket_modal_submission") +def submission(ack): + ack() + + +if __name__ == "__main__": # export SLACK_APP_TOKEN=xapp-*** # export SLACK_BOT_TOKEN=xoxb-*** SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]).start() diff --git a/examples/socket_mode_async.py b/examples/socket_mode_async.py index a98424b0c..99bb0ae69 100644 --- a/examples/socket_mode_async.py +++ b/examples/socket_mode_async.py @@ -7,10 +7,13 @@ # ------------------------------------------------ import logging + +logging.basicConfig(level=logging.DEBUG) + import os from slack_bolt.app.async_app import AsyncApp -from slack_bolt.adapter.socket_mode.aiohttp import AsyncSocketModeHandler +from slack_bolt.adapter.socket_mode.async_handler import AsyncSocketModeHandler # Install the Slack app and get xoxb- token in advance app = AsyncApp(token=os.environ["SLACK_BOT_TOKEN"]) @@ -27,20 +30,83 @@ async def event_test(event, say): await say(f"Hi there, <@{event['user']}>!") -@app.shortcut("socket-mode") -async def global_shortcut(ack): +async def ack_shortcut(ack): + await ack() + + +async def open_modal(body, client): + await client.views_open( + trigger_id=body["trigger_id"], + view={ + "type": "modal", + "callback_id": "socket_modal_submission", + "submit": {"type": "plain_text", "text": "Submit",}, + "close": {"type": "plain_text", "text": "Cancel",}, + "title": {"type": "plain_text", "text": "Socket Modal",}, + "blocks": [ + { + "type": "input", + "block_id": "q1", + "label": {"type": "plain_text", "text": "Write anything here!",}, + "element": {"action_id": "feedback", "type": "plain_text_input",}, + }, + { + "type": "input", + "block_id": "q2", + "label": { + "type": "plain_text", + "text": "Can you tell us your favorites?", + }, + "element": { + "type": "external_select", + "action_id": "favorite-animal", + "min_query_length": 0, + "placeholder": { + "type": "plain_text", + "text": "Select your favorites", + }, + }, + }, + ], + }, + ) + + +app.shortcut("socket-mode")(ack=ack_shortcut, lazy=[open_modal]) + + +all_options = [ + {"text": {"type": "plain_text", "text": ":cat: Cat"}, "value": "cat",}, + {"text": {"type": "plain_text", "text": ":dog: Dog"}, "value": "dog",}, + {"text": {"type": "plain_text", "text": ":bear: Bear"}, "value": "bear",}, +] + + +@app.options("favorite-animal") +async def external_data_source_handler(ack, body): + keyword = body.get("value") + if keyword is not None and len(keyword) > 0: + options = [o for o in all_options if keyword in o["text"]["text"]] + await ack(options=options) + else: + await ack(options=all_options) + + +@app.view("socket_modal_submission") +async def submission(ack): await ack() # export SLACK_APP_TOKEN=xapp-*** # export SLACK_BOT_TOKEN=xoxb-*** + async def main(): handler = AsyncSocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]) await handler.start_async() if __name__ == "__main__": - logging.basicConfig(level=logging.DEBUG) import asyncio + asyncio.run(main()) diff --git a/examples/socket_mode_oauth.py b/examples/socket_mode_oauth.py index 7167db68b..fd51b3150 100644 --- a/examples/socket_mode_oauth.py +++ b/examples/socket_mode_oauth.py @@ -6,10 +6,13 @@ # ------------------------------------------------ import logging + +logging.basicConfig(level=logging.DEBUG) + import os from slack_bolt.app import App from slack_bolt.oauth.oauth_settings import OAuthSettings -from slack_bolt.adapter.socket_mode.websocket_client import SocketModeHandler +from slack_bolt.adapter.socket_mode import SocketModeHandler app = App( signing_secret=os.environ["SLACK_SIGNING_SECRET"], @@ -17,7 +20,7 @@ client_id=os.environ["SLACK_CLIENT_ID"], client_secret=os.environ["SLACK_CLIENT_SECRET"], scopes=os.environ["SLACK_SCOPES"].split(","), - ) + ), ) @@ -32,13 +35,74 @@ def event_test(event, say): say(f"Hi there, <@{event['user']}>!") -@app.shortcut("socket-mode") -def global_shortcut(ack): +def ack_shortcut(ack): + ack() + + +def open_modal(body, client): + client.views_open( + trigger_id=body["trigger_id"], + view={ + "type": "modal", + "callback_id": "socket_modal_submission", + "submit": {"type": "plain_text", "text": "Submit",}, + "close": {"type": "plain_text", "text": "Cancel",}, + "title": {"type": "plain_text", "text": "Socket Modal",}, + "blocks": [ + { + "type": "input", + "block_id": "q1", + "label": {"type": "plain_text", "text": "Write anything here!",}, + "element": {"action_id": "feedback", "type": "plain_text_input",}, + }, + { + "type": "input", + "block_id": "q2", + "label": { + "type": "plain_text", + "text": "Can you tell us your favorites?", + }, + "element": { + "type": "external_select", + "action_id": "favorite-animal", + "min_query_length": 0, + "placeholder": { + "type": "plain_text", + "text": "Select your favorites", + }, + }, + }, + ], + }, + ) + + +app.shortcut("socket-mode")(ack=ack_shortcut, lazy=[open_modal]) + + +all_options = [ + {"text": {"type": "plain_text", "text": ":cat: Cat"}, "value": "cat",}, + {"text": {"type": "plain_text", "text": ":dog: Dog"}, "value": "dog",}, + {"text": {"type": "plain_text", "text": ":bear: Bear"}, "value": "bear",}, +] + + +@app.options("favorite-animal") +def external_data_source_handler(ack, body): + keyword = body.get("value") + if keyword is not None and len(keyword) > 0: + options = [o for o in all_options if keyword in o["text"]["text"]] + ack(options=options) + else: + ack(options=all_options) + + +@app.view("socket_modal_submission") +def submission(ack): ack() if __name__ == "__main__": - logging.basicConfig(level=logging.DEBUG) SocketModeHandler(app, os.environ.get("SLACK_APP_TOKEN")).connect() app.start() diff --git a/slack_bolt/adapter/socket_mode/__init__.py b/slack_bolt/adapter/socket_mode/__init__.py index e69de29bb..94223be4d 100644 --- a/slack_bolt/adapter/socket_mode/__init__.py +++ b/slack_bolt/adapter/socket_mode/__init__.py @@ -0,0 +1,2 @@ +# Don't add async module imports here +from .builtin import SocketModeHandler # noqa diff --git a/slack_bolt/adapter/socket_mode/aiohttp/__init__.py b/slack_bolt/adapter/socket_mode/aiohttp/__init__.py index 37cecd575..e8c9c81b4 100644 --- a/slack_bolt/adapter/socket_mode/aiohttp/__init__.py +++ b/slack_bolt/adapter/socket_mode/aiohttp/__init__.py @@ -17,12 +17,14 @@ class SocketModeHandler(AsyncBaseSocketModeHandler): - app: App + app: App # type: ignore app_token: str client: SocketModeClient - def __init__( - self, app: App, app_token: Optional[str] = None, + def __init__( # type: ignore + self, + app: App, # type: ignore + app_token: Optional[str] = None, ): self.app = app self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] @@ -36,12 +38,14 @@ async def handle(self, client: SocketModeClient, req: SocketModeRequest) -> None class AsyncSocketModeHandler(AsyncBaseSocketModeHandler): - app: AsyncApp + app: AsyncApp # type: ignore app_token: str client: SocketModeClient - def __init__( - self, app: AsyncApp, app_token: Optional[str] = None, + def __init__( # type: ignore + self, + app: AsyncApp, # type: ignore + app_token: Optional[str] = None, ): self.app = app self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] diff --git a/slack_bolt/adapter/socket_mode/async_base_handler.py b/slack_bolt/adapter/socket_mode/async_base_handler.py index 62ee0107b..2837a3d09 100644 --- a/slack_bolt/adapter/socket_mode/async_base_handler.py +++ b/slack_bolt/adapter/socket_mode/async_base_handler.py @@ -1,14 +1,21 @@ import asyncio import logging +from typing import Union from slack_sdk.socket_mode.async_client import AsyncBaseSocketModeClient from slack_sdk.socket_mode.request import SocketModeRequest +from slack_bolt import App +from slack_bolt.app.async_app import AsyncApp + class AsyncBaseSocketModeHandler: + app: Union[App, AsyncApp] # type: ignore client: AsyncBaseSocketModeClient - async def handle(self, client: AsyncBaseSocketModeClient, req: SocketModeRequest) -> None: + async def handle( + self, client: AsyncBaseSocketModeClient, req: SocketModeRequest + ) -> None: raise NotImplementedError() async def connect_async(self): diff --git a/slack_bolt/adapter/socket_mode/async_handler.py b/slack_bolt/adapter/socket_mode/async_handler.py new file mode 100644 index 000000000..08edd8004 --- /dev/null +++ b/slack_bolt/adapter/socket_mode/async_handler.py @@ -0,0 +1 @@ +from .aiohttp import AsyncSocketModeHandler # noqa diff --git a/slack_bolt/adapter/socket_mode/async_internals.py b/slack_bolt/adapter/socket_mode/async_internals.py index cd01ce7fc..e11a923d6 100644 --- a/slack_bolt/adapter/socket_mode/async_internals.py +++ b/slack_bolt/adapter/socket_mode/async_internals.py @@ -1,3 +1,4 @@ +import json import logging from time import time @@ -10,7 +11,7 @@ from slack_bolt.response import BoltResponse -async def run_async_bolt_app(app: AsyncApp, req: SocketModeRequest): +async def run_async_bolt_app(app: AsyncApp, req: SocketModeRequest): # type: ignore bolt_req: AsyncBoltRequest = AsyncBoltRequest(mode="socket_mode", body=req.payload) bolt_resp: BoltResponse = await app.async_dispatch(bolt_req) return bolt_resp @@ -20,16 +21,18 @@ async def send_async_response( client: AsyncBaseSocketModeClient, req: SocketModeRequest, bolt_resp: BoltResponse, - start_time: int, + start_time: float, ): if bolt_resp.status == 200: + content_type = bolt_resp.headers.get("content-type", [""])[0] if bolt_resp.body is None or len(bolt_resp.body) == 0: await client.send_socket_mode_response( SocketModeResponse(envelope_id=req.envelope_id) ) - elif bolt_resp.body.startswith("{"): + elif content_type.startswith("application/json"): + dict_body = json.loads(bolt_resp.body) await client.send_socket_mode_response( - SocketModeResponse(envelope_id=req.envelope_id, payload=bolt_resp.body,) + SocketModeResponse(envelope_id=req.envelope_id, payload=dict_body) ) else: await client.send_socket_mode_response( diff --git a/slack_bolt/adapter/socket_mode/base_handler.py b/slack_bolt/adapter/socket_mode/base_handler.py index 782fafe88..1cc6b2cc1 100644 --- a/slack_bolt/adapter/socket_mode/base_handler.py +++ b/slack_bolt/adapter/socket_mode/base_handler.py @@ -4,8 +4,11 @@ from slack_sdk.socket_mode.client import BaseSocketModeClient from slack_sdk.socket_mode.request import SocketModeRequest +from slack_bolt import App + class BaseSocketModeHandler: + app: App # type: ignore client: BaseSocketModeClient def handle(self, client: BaseSocketModeClient, req: SocketModeRequest) -> None: diff --git a/slack_bolt/adapter/socket_mode/builtin/__init__.py b/slack_bolt/adapter/socket_mode/builtin/__init__.py new file mode 100644 index 000000000..c9dacee1b --- /dev/null +++ b/slack_bolt/adapter/socket_mode/builtin/__init__.py @@ -0,0 +1,35 @@ +import os +from time import time +from typing import Optional + +from slack_sdk.socket_mode.request import SocketModeRequest +from slack_sdk.socket_mode.builtin import SocketModeClient + +from slack_bolt import App +from slack_bolt.adapter.socket_mode.base_handler import BaseSocketModeHandler +from slack_bolt.adapter.socket_mode.internals import run_bolt_app, send_response +from slack_bolt.response import BoltResponse + + +class SocketModeHandler(BaseSocketModeHandler): + app: App # type: ignore + app_token: str + client: SocketModeClient + + def __init__( # type: ignore + self, + app: App, # type: ignore + app_token: Optional[str] = None, + trace_enabled: bool = False, + ): + self.app = app + self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] + self.client = SocketModeClient( + app_token=self.app_token, trace_enabled=trace_enabled + ) + self.client.socket_mode_request_listeners.append(self.handle) + + def handle(self, client: SocketModeClient, req: SocketModeRequest) -> None: + start = time() + bolt_resp: BoltResponse = run_bolt_app(self.app, req) + send_response(client, req, bolt_resp, start) diff --git a/slack_bolt/adapter/socket_mode/internals.py b/slack_bolt/adapter/socket_mode/internals.py index 8ea68ed84..4f7f4d68c 100644 --- a/slack_bolt/adapter/socket_mode/internals.py +++ b/slack_bolt/adapter/socket_mode/internals.py @@ -1,3 +1,4 @@ +import json import logging from time import time @@ -10,7 +11,7 @@ from slack_bolt.response import BoltResponse -def run_bolt_app(app: App, req: SocketModeRequest): +def run_bolt_app(app: App, req: SocketModeRequest): # type: ignore bolt_req: BoltRequest = BoltRequest(mode="socket_mode", body=req.payload) bolt_resp: BoltResponse = app.dispatch(bolt_req) return bolt_resp @@ -20,16 +21,18 @@ def send_response( client: BaseSocketModeClient, req: SocketModeRequest, bolt_resp: BoltResponse, - start_time: int, + start_time: float, ): if bolt_resp.status == 200: + content_type = bolt_resp.headers.get("content-type", [""])[0] if bolt_resp.body is None or len(bolt_resp.body) == 0: client.send_socket_mode_response( SocketModeResponse(envelope_id=req.envelope_id) ) - elif bolt_resp.body.startswith("{"): + elif content_type.startswith("application/json"): + dict_body = json.loads(bolt_resp.body) client.send_socket_mode_response( - SocketModeResponse(envelope_id=req.envelope_id, payload=bolt_resp.body,) + SocketModeResponse(envelope_id=req.envelope_id, payload=dict_body) ) else: client.send_socket_mode_response( diff --git a/slack_bolt/adapter/socket_mode/websocket_client/__init__.py b/slack_bolt/adapter/socket_mode/websocket_client/__init__.py index 433761d75..d9052a465 100644 --- a/slack_bolt/adapter/socket_mode/websocket_client/__init__.py +++ b/slack_bolt/adapter/socket_mode/websocket_client/__init__.py @@ -12,16 +12,21 @@ class SocketModeHandler(BaseSocketModeHandler): - app: App + app: App # type: ignore app_token: str client: SocketModeClient - def __init__( - self, app: App, app_token: Optional[str] = None, + def __init__( # type: ignore + self, + app: App, # type: ignore + app_token: Optional[str] = None, + trace_enabled: bool = False, ): self.app = app self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] - self.client = SocketModeClient(app_token=self.app_token) + self.client = SocketModeClient( + app_token=self.app_token, trace_enabled=trace_enabled + ) self.client.socket_mode_request_listeners.append(self.handle) def handle(self, client: SocketModeClient, req: SocketModeRequest) -> None: diff --git a/slack_bolt/adapter/socket_mode/websockets/__init__.py b/slack_bolt/adapter/socket_mode/websockets/__init__.py index fb9c5933d..bf691ce1e 100644 --- a/slack_bolt/adapter/socket_mode/websockets/__init__.py +++ b/slack_bolt/adapter/socket_mode/websockets/__init__.py @@ -17,12 +17,14 @@ class SocketModeHandler(AsyncBaseSocketModeHandler): - app: App + app: App # type: ignore app_token: str client: SocketModeClient - def __init__( - self, app: App, app_token: Optional[str] = None, + def __init__( # type: ignore + self, + app: App, # type: ignore + app_token: Optional[str] = None, ): self.app = app self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] @@ -36,12 +38,14 @@ async def handle(self, client: SocketModeClient, req: SocketModeRequest) -> None class AsyncSocketModeHandler(AsyncBaseSocketModeHandler): - app: AsyncApp + app: AsyncApp # type: ignore app_token: str client: SocketModeClient - def __init__( - self, app: AsyncApp, app_token: Optional[str] = None, + def __init__( # type: ignore + self, + app: AsyncApp, # type: ignore + app_token: Optional[str] = None, ): self.app = app self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] From d8a98ab8c8c264d0e30cc88ffaf843df0e70d497 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 3 Dec 2020 20:19:36 +0900 Subject: [PATCH 092/719] version 1.2.0b2 --- setup.py | 2 +- slack_bolt/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 817629061..9ef37e5fb 100755 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.2.0b1,<3.3",], + install_requires=["slack_sdk>=3.2.0b3,<3.3",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 48346736b..9d9fa0a11 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.2.0b1" +__version__ = "1.2.0b2" From b183b0ccd5a2d1906486d106c4c89080d584c3fe Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 8 Dec 2020 22:06:39 +0900 Subject: [PATCH 093/719] version 1.2.0b3 --- setup.py | 2 +- .../adapter/socket_mode/aiohttp/__init__.py | 14 ++++++++++- .../adapter/socket_mode/builtin/__init__.py | 15 +++++++++++- .../socket_mode/websocket_client/__init__.py | 23 +++++++++++++++++-- .../socket_mode/websockets/__init__.py | 12 +++++++++- slack_bolt/version.py | 2 +- 6 files changed, 61 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 9ef37e5fb..12a0e40eb 100755 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.2.0b3,<3.3",], + install_requires=["slack_sdk>=3.2.0b5,<3.3",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/adapter/socket_mode/aiohttp/__init__.py b/slack_bolt/adapter/socket_mode/aiohttp/__init__.py index e8c9c81b4..5b26fcb9b 100644 --- a/slack_bolt/adapter/socket_mode/aiohttp/__init__.py +++ b/slack_bolt/adapter/socket_mode/aiohttp/__init__.py @@ -1,9 +1,11 @@ import os +from logging import Logger from time import time from typing import Optional from slack_sdk.socket_mode.aiohttp import SocketModeClient from slack_sdk.socket_mode.request import SocketModeRequest +from slack_sdk.web.async_client import AsyncWebClient from slack_bolt import App from slack_bolt.adapter.socket_mode.async_base_handler import AsyncBaseSocketModeHandler @@ -25,10 +27,20 @@ def __init__( # type: ignore self, app: App, # type: ignore app_token: Optional[str] = None, + logger: Optional[Logger] = None, + web_client: Optional[AsyncWebClient] = None, + proxy: Optional[str] = None, + ping_interval: float = 10, ): self.app = app self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] - self.client = SocketModeClient(app_token=self.app_token) + self.client = SocketModeClient( + app_token=self.app_token, + logger=logger, + web_client=web_client, + proxy=proxy, + ping_interval=ping_interval, + ) self.client.socket_mode_request_listeners.append(self.handle) async def handle(self, client: SocketModeClient, req: SocketModeRequest) -> None: diff --git a/slack_bolt/adapter/socket_mode/builtin/__init__.py b/slack_bolt/adapter/socket_mode/builtin/__init__.py index c9dacee1b..6659073db 100644 --- a/slack_bolt/adapter/socket_mode/builtin/__init__.py +++ b/slack_bolt/adapter/socket_mode/builtin/__init__.py @@ -1,7 +1,9 @@ import os +from logging import Logger from time import time from typing import Optional +from slack_sdk import WebClient from slack_sdk.socket_mode.request import SocketModeRequest from slack_sdk.socket_mode.builtin import SocketModeClient @@ -20,12 +22,23 @@ def __init__( # type: ignore self, app: App, # type: ignore app_token: Optional[str] = None, + logger: Optional[Logger] = None, + web_client: Optional[WebClient] = None, + ping_interval: float = 10, + concurrency: int = 10, + proxy: Optional[str] = None, trace_enabled: bool = False, ): self.app = app self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] self.client = SocketModeClient( - app_token=self.app_token, trace_enabled=trace_enabled + app_token=self.app_token, + logger=logger, + web_client=web_client, + proxy=proxy, + ping_interval=ping_interval, + concurrency=concurrency, + trace_enabled=trace_enabled, ) self.client.socket_mode_request_listeners.append(self.handle) diff --git a/slack_bolt/adapter/socket_mode/websocket_client/__init__.py b/slack_bolt/adapter/socket_mode/websocket_client/__init__.py index d9052a465..432e09651 100644 --- a/slack_bolt/adapter/socket_mode/websocket_client/__init__.py +++ b/slack_bolt/adapter/socket_mode/websocket_client/__init__.py @@ -1,7 +1,9 @@ import os +from logging import Logger from time import time -from typing import Optional +from typing import Optional, Tuple +from slack_sdk import WebClient from slack_sdk.socket_mode.request import SocketModeRequest from slack_sdk.socket_mode.websocket_client import SocketModeClient @@ -20,12 +22,29 @@ def __init__( # type: ignore self, app: App, # type: ignore app_token: Optional[str] = None, + logger: Optional[Logger] = None, + web_client: Optional[WebClient] = None, + ping_interval: float = 10, + concurrency: int = 10, + http_proxy_host: Optional[str] = None, + http_proxy_port: Optional[int] = None, + http_proxy_auth: Optional[Tuple[str, str]] = None, + proxy_type: Optional[str] = None, trace_enabled: bool = False, ): self.app = app self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] self.client = SocketModeClient( - app_token=self.app_token, trace_enabled=trace_enabled + app_token=self.app_token, + logger=logger, + web_client=web_client, + ping_interval=ping_interval, + concurrency=concurrency, + http_proxy_host=http_proxy_host, + http_proxy_port=http_proxy_port, + http_proxy_auth=http_proxy_auth, + proxy_type=proxy_type, + trace_enabled=trace_enabled, ) self.client.socket_mode_request_listeners.append(self.handle) diff --git a/slack_bolt/adapter/socket_mode/websockets/__init__.py b/slack_bolt/adapter/socket_mode/websockets/__init__.py index bf691ce1e..ba8cd5879 100644 --- a/slack_bolt/adapter/socket_mode/websockets/__init__.py +++ b/slack_bolt/adapter/socket_mode/websockets/__init__.py @@ -1,9 +1,11 @@ import os +from logging import Logger from time import time from typing import Optional from slack_sdk.socket_mode.websockets import SocketModeClient from slack_sdk.socket_mode.request import SocketModeRequest +from slack_sdk.web.async_client import AsyncWebClient from slack_bolt import App from slack_bolt.adapter.socket_mode.async_base_handler import AsyncBaseSocketModeHandler @@ -25,10 +27,18 @@ def __init__( # type: ignore self, app: App, # type: ignore app_token: Optional[str] = None, + logger: Optional[Logger] = None, + web_client: Optional[AsyncWebClient] = None, + ping_interval: float = 10, ): self.app = app self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] - self.client = SocketModeClient(app_token=self.app_token) + self.client = SocketModeClient( + app_token=self.app_token, + logger=logger, + web_client=web_client, + ping_interval=ping_interval, + ) self.client.socket_mode_request_listeners.append(self.handle) async def handle(self, client: SocketModeClient, req: SocketModeRequest) -> None: diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 9d9fa0a11..2aa5cc32a 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.2.0b2" +__version__ = "1.2.0b3" From e70705a36ccff0536551248be8282061ba44f0ec Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 14 Dec 2020 09:33:21 +0900 Subject: [PATCH 094/719] version 1.2.0b4 --- setup.py | 2 +- .../adapter/socket_mode/aiohttp/__init__.py | 16 +++++++++++++--- .../adapter/socket_mode/builtin/__init__.py | 6 +++--- .../socket_mode/websocket_client/__init__.py | 4 ++-- .../adapter/socket_mode/websockets/__init__.py | 14 +++++++++++--- 5 files changed, 30 insertions(+), 12 deletions(-) diff --git a/setup.py b/setup.py index 12a0e40eb..3750ba420 100755 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.2.0b5,<3.3",], + install_requires=["slack_sdk>=3.2.0b6,<3.3",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/adapter/socket_mode/aiohttp/__init__.py b/slack_bolt/adapter/socket_mode/aiohttp/__init__.py index 5b26fcb9b..0e3038c75 100644 --- a/slack_bolt/adapter/socket_mode/aiohttp/__init__.py +++ b/slack_bolt/adapter/socket_mode/aiohttp/__init__.py @@ -36,8 +36,8 @@ def __init__( # type: ignore self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] self.client = SocketModeClient( app_token=self.app_token, - logger=logger, - web_client=web_client, + logger=logger if logger is not None else app.logger, + web_client=web_client if web_client is not None else app.client, proxy=proxy, ping_interval=ping_interval, ) @@ -58,10 +58,20 @@ def __init__( # type: ignore self, app: AsyncApp, # type: ignore app_token: Optional[str] = None, + logger: Optional[Logger] = None, + web_client: Optional[AsyncWebClient] = None, + proxy: Optional[str] = None, + ping_interval: float = 10, ): self.app = app self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] - self.client = SocketModeClient(app_token=self.app_token) + self.client = SocketModeClient( + app_token=self.app_token, + logger=logger if logger is not None else app.logger, + web_client=web_client if web_client is not None else app.client, + proxy=proxy, + ping_interval=ping_interval, + ) self.client.socket_mode_request_listeners.append(self.handle) async def handle(self, client: SocketModeClient, req: SocketModeRequest) -> None: diff --git a/slack_bolt/adapter/socket_mode/builtin/__init__.py b/slack_bolt/adapter/socket_mode/builtin/__init__.py index 6659073db..54b4fbf9c 100644 --- a/slack_bolt/adapter/socket_mode/builtin/__init__.py +++ b/slack_bolt/adapter/socket_mode/builtin/__init__.py @@ -33,9 +33,9 @@ def __init__( # type: ignore self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] self.client = SocketModeClient( app_token=self.app_token, - logger=logger, - web_client=web_client, - proxy=proxy, + logger=logger if logger is not None else app.logger, + web_client=web_client if web_client is not None else app.client, + proxy=proxy if proxy is not None else app.client.proxy, ping_interval=ping_interval, concurrency=concurrency, trace_enabled=trace_enabled, diff --git a/slack_bolt/adapter/socket_mode/websocket_client/__init__.py b/slack_bolt/adapter/socket_mode/websocket_client/__init__.py index 432e09651..589edb80d 100644 --- a/slack_bolt/adapter/socket_mode/websocket_client/__init__.py +++ b/slack_bolt/adapter/socket_mode/websocket_client/__init__.py @@ -36,8 +36,8 @@ def __init__( # type: ignore self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] self.client = SocketModeClient( app_token=self.app_token, - logger=logger, - web_client=web_client, + logger=logger if logger is not None else app.logger, + web_client=web_client if web_client is not None else app.client, ping_interval=ping_interval, concurrency=concurrency, http_proxy_host=http_proxy_host, diff --git a/slack_bolt/adapter/socket_mode/websockets/__init__.py b/slack_bolt/adapter/socket_mode/websockets/__init__.py index ba8cd5879..878eaf5e6 100644 --- a/slack_bolt/adapter/socket_mode/websockets/__init__.py +++ b/slack_bolt/adapter/socket_mode/websockets/__init__.py @@ -35,8 +35,8 @@ def __init__( # type: ignore self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] self.client = SocketModeClient( app_token=self.app_token, - logger=logger, - web_client=web_client, + logger=logger if logger is not None else app.logger, + web_client=web_client if web_client is not None else app.client, ping_interval=ping_interval, ) self.client.socket_mode_request_listeners.append(self.handle) @@ -56,10 +56,18 @@ def __init__( # type: ignore self, app: AsyncApp, # type: ignore app_token: Optional[str] = None, + logger: Optional[Logger] = None, + web_client: Optional[AsyncWebClient] = None, + ping_interval: float = 10, ): self.app = app self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] - self.client = SocketModeClient(app_token=self.app_token) + self.client = SocketModeClient( + app_token=self.app_token, + logger=logger if logger is not None else app.logger, + web_client=web_client if web_client is not None else app.client, + ping_interval=ping_interval, + ) self.client.socket_mode_request_listeners.append(self.handle) async def handle(self, client: SocketModeClient, req: SocketModeRequest) -> None: From ae08015450938219a60c3a06bd3eb076ead5ae4e Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sun, 10 Jan 2021 02:16:25 +0900 Subject: [PATCH 095/719] Add tests --- codecov.yml | 2 +- setup.py | 3 +- .../adapter/socket_mode/async_internals.py | 3 +- slack_bolt/version.py | 2 +- tests/adapter_tests/socket_mode/__init__.py | 0 .../socket_mode/mock_socket_mode_server.py | 42 +++++ .../socket_mode/mock_web_api_server.py | 153 ++++++++++++++++++ .../socket_mode/test_interactions_builtin.py | 75 +++++++++ .../test_interactions_web_client.py | 74 +++++++++ .../socket_mode/__init__.py | 0 .../socket_mode/test_async_aiohttp.py | 78 +++++++++ .../socket_mode/test_async_websockets.py | 78 +++++++++ 12 files changed, 506 insertions(+), 4 deletions(-) create mode 100644 tests/adapter_tests/socket_mode/__init__.py create mode 100644 tests/adapter_tests/socket_mode/mock_socket_mode_server.py create mode 100644 tests/adapter_tests/socket_mode/mock_web_api_server.py create mode 100644 tests/adapter_tests/socket_mode/test_interactions_builtin.py create mode 100644 tests/adapter_tests/socket_mode/test_interactions_web_client.py create mode 100644 tests/adapter_tests_async/socket_mode/__init__.py create mode 100644 tests/adapter_tests_async/socket_mode/test_async_aiohttp.py create mode 100644 tests/adapter_tests_async/socket_mode/test_async_websockets.py diff --git a/codecov.yml b/codecov.yml index b24c2afb1..5568e5e6b 100644 --- a/codecov.yml +++ b/codecov.yml @@ -2,7 +2,7 @@ coverage: status: project: default: - threshold: 0.3% + threshold: 2.0% patch: default: target: 50% diff --git a/setup.py b/setup.py index 3750ba420..74e401edc 100755 --- a/setup.py +++ b/setup.py @@ -16,6 +16,7 @@ "pytest-cov>=2,<3", "pytest-asyncio<1", # for async "aiohttp>=3,<4", # for async + "Flask-Sockets>=0.2,<1", "black==20.8b1", ] @@ -33,7 +34,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.2.0b6,<3.3",], + install_requires=["slack_sdk>=3.2.0b7,<3.3",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/adapter/socket_mode/async_internals.py b/slack_bolt/adapter/socket_mode/async_internals.py index e11a923d6..5b5750bd1 100644 --- a/slack_bolt/adapter/socket_mode/async_internals.py +++ b/slack_bolt/adapter/socket_mode/async_internals.py @@ -37,7 +37,8 @@ async def send_async_response( else: await client.send_socket_mode_response( SocketModeResponse( - envelope_id=req.envelope_id, payload={"text": bolt_resp.body}, + envelope_id=req.envelope_id, + payload={"text": bolt_resp.body}, ) ) if client.logger.level <= logging.DEBUG: diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 2aa5cc32a..c27610a64 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.2.0b3" +__version__ = "1.2.0b4 " diff --git a/tests/adapter_tests/socket_mode/__init__.py b/tests/adapter_tests/socket_mode/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/adapter_tests/socket_mode/mock_socket_mode_server.py b/tests/adapter_tests/socket_mode/mock_socket_mode_server.py new file mode 100644 index 000000000..2b778910c --- /dev/null +++ b/tests/adapter_tests/socket_mode/mock_socket_mode_server.py @@ -0,0 +1,42 @@ +import logging +from typing import List + +socket_mode_envelopes = [ + """{"envelope_id":"57d6a792-4d35-4d0b-b6aa-3361493e1caf","payload":{"type":"shortcut","token":"xxx","action_ts":"1610198080.300836","team":{"id":"T111","domain":"seratch"},"user":{"id":"U111","username":"seratch","team_id":"T111"},"is_enterprise_install":false,"enterprise":null,"callback_id":"do-something","trigger_id":"111.222.xxx"},"type":"interactive","accepts_response_payload":false}""", + """{"envelope_id":"1d3c79ab-0ffb-41f3-a080-d19e85f53649","payload":{"token":"xxx","team_id":"T111","team_domain":"xxx","channel_id":"C111","channel_name":"random","user_id":"U111","user_name":"seratch","command":"/hello-socket-mode","text":"","api_app_id":"A111","response_url":"https://hooks.slack.com/commands/T111/111/xxx","trigger_id":"111.222.xxx"},"type":"slash_commands","accepts_response_payload":true}""", + """{"envelope_id":"08cfc559-d933-402e-a5c1-79e135afaae4","payload":{"token":"xxx","team_id":"T111","api_app_id":"A111","event":{"client_msg_id":"c9b466b5-845c-49c6-a371-57ae44359bf1","type":"message","text":"<@W111>","user":"U111","ts":"1610197986.000300","team":"T111","blocks":[{"type":"rich_text","block_id":"1HBPc","elements":[{"type":"rich_text_section","elements":[{"type":"user","user_id":"U111"}]}]}],"channel":"C111","event_ts":"1610197986.000300","channel_type":"channel"},"type":"event_callback","event_id":"Ev111","event_time":1610197986,"authorizations":[{"enterprise_id":null,"team_id":"T111","user_id":"U111","is_bot":true,"is_enterprise_install":false}],"is_ext_shared_channel":false,"event_context":"1-message-T111-C111"},"type":"events_api","accepts_response_payload":false,"retry_attempt":1,"retry_reason":"timeout"}""", +] + +from flask import Flask +from flask_sockets import Sockets + + +def start_socket_mode_server(self, port: int): + def _start_socket_mode_server(): + logger = logging.getLogger(__name__) + app: Flask = Flask(__name__) + sockets: Sockets = Sockets(app) + + envelopes_to_consume: List[str] = list(socket_mode_envelopes) + + @sockets.route("/link") + def link(ws): + while not ws.closed: + message = ws.read_message() + if message is not None: + if len(envelopes_to_consume) > 0: + e = envelopes_to_consume.pop(0) + logger.debug(f"Send an envelope: {e}") + ws.send(e) + + logger.debug(f"Server received a message: {message}") + ws.send(message) + + from gevent import pywsgi + from geventwebsocket.handler import WebSocketHandler + + server = pywsgi.WSGIServer(("", port), app, handler_class=WebSocketHandler) + self.server = server + server.serve_forever(stop_timeout=1) + + return _start_socket_mode_server diff --git a/tests/adapter_tests/socket_mode/mock_web_api_server.py b/tests/adapter_tests/socket_mode/mock_web_api_server.py new file mode 100644 index 000000000..ac30148d7 --- /dev/null +++ b/tests/adapter_tests/socket_mode/mock_web_api_server.py @@ -0,0 +1,153 @@ +import json +import logging +import re +import threading +from http import HTTPStatus +from http.server import HTTPServer, SimpleHTTPRequestHandler +from typing import Type +from unittest import TestCase +from urllib.parse import urlparse, parse_qs + + +class MockHandler(SimpleHTTPRequestHandler): + protocol_version = "HTTP/1.1" + default_request_version = "HTTP/1.1" + logger = logging.getLogger(__name__) + + pattern_for_language = re.compile("python/(\\S+)", re.IGNORECASE) + pattern_for_package_identifier = re.compile("slackclient/(\\S+)") + + def is_valid_user_agent(self): + user_agent = self.headers["User-Agent"] + return self.pattern_for_language.search( + user_agent + ) and self.pattern_for_package_identifier.search(user_agent) + + def is_valid_token(self): + if self.path.startswith("oauth"): + return True + return "Authorization" in self.headers and ( + str(self.headers["Authorization"]).startswith("Bearer xoxb-") + or str(self.headers["Authorization"]).startswith("Bearer xapp-") + ) + + def set_common_headers(self): + self.send_header("content-type", "application/json;charset=utf-8") + self.send_header("connection", "close") + self.end_headers() + + invalid_auth = { + "ok": False, + "error": "invalid_auth", + } + + not_found = { + "ok": False, + "error": "test_data_not_found", + } + + def _handle(self): + try: + if self.is_valid_token() and self.is_valid_user_agent(): + parsed_path = urlparse(self.path) + + len_header = self.headers.get("Content-Length") or 0 + content_len = int(len_header) + post_body = self.rfile.read(content_len) + request_body = None + if post_body: + try: + post_body = post_body.decode("utf-8") + if post_body.startswith("{"): + request_body = json.loads(post_body) + else: + request_body = { + k: v[0] for k, v in parse_qs(post_body).items() + } + except UnicodeDecodeError: + pass + else: + if parsed_path and parsed_path.query: + request_body = { + k: v[0] for k, v in parse_qs(parsed_path.query).items() + } + + body = {"ok": False, "error": "internal_error"} + if self.path == "/auth.test": + body = { + "ok": True, + "url": "https://xyz.slack.com/", + "team": "Testing Workspace", + "user": "bot-user", + "team_id": "T111", + "user_id": "W11", + "bot_id": "B111", + "enterprise_id": "E111", + "is_enterprise_install": False, + } + if self.path == "/apps.connections.open": + body = { + "ok": True, + "url": "ws://localhost:3011/link/?ticket=xxx&app_id=yyy", + } + if self.path == "/api.test" and request_body: + body = {"ok": True, "args": request_body} + else: + body = self.invalid_auth + + if not body: + body = self.not_found + + self.send_response(HTTPStatus.OK) + self.set_common_headers() + self.wfile.write(json.dumps(body).encode("utf-8")) + self.wfile.close() + + except Exception as e: + self.logger.error(str(e), exc_info=True) + raise + + def do_GET(self): + self._handle() + + def do_POST(self): + self._handle() + + +class MockServerThread(threading.Thread): + def __init__( + self, test: TestCase, handler: Type[SimpleHTTPRequestHandler] = MockHandler + ): + threading.Thread.__init__(self) + self.handler = handler + self.test = test + + def run(self): + self.server = HTTPServer(("localhost", 8888), self.handler) + self.test.server_url = "http://localhost:8888" + self.test.host, self.test.port = self.server.socket.getsockname() + self.test.server_started.set() # threading.Event() + + self.test = None + try: + self.server.serve_forever() + finally: + self.server.server_close() + + def stop(self): + self.server.shutdown() + self.join() + + +def setup_mock_web_api_server(test: TestCase): + test.server_started = threading.Event() + test.thread = MockServerThread(test) + test.thread.start() + + test.server_started.wait() + + +def cleanup_mock_web_api_server(test: TestCase): + test.thread.stop() + + test.thread = None diff --git a/tests/adapter_tests/socket_mode/test_interactions_builtin.py b/tests/adapter_tests/socket_mode/test_interactions_builtin.py new file mode 100644 index 000000000..cee5e3248 --- /dev/null +++ b/tests/adapter_tests/socket_mode/test_interactions_builtin.py @@ -0,0 +1,75 @@ +import logging +import time +from threading import Thread + +from slack_sdk import WebClient + +from slack_bolt import App +from slack_bolt.adapter.socket_mode import SocketModeHandler +from .mock_socket_mode_server import ( + start_socket_mode_server, +) +from .mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from ...utils import remove_os_env_temporarily, restore_os_env + + +class TestSocketModeBuiltin: + logger = logging.getLogger(__name__) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + self.web_client = WebClient( + token="xoxb-api_test", + base_url="http://localhost:8888", + ) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def test_interactions(self): + t = Thread(target=start_socket_mode_server(self, 3011)) + t.daemon = True + t.start() + time.sleep(2) # wait for the server + + app = App(client=self.web_client) + + result = {"shortcut": False, "command": False} + + @app.shortcut("do-something") + def shortcut_handler(ack): + result["shortcut"] = True + ack() + + @app.command("/hello-socket-mode") + def command_handler(ack): + result["command"] = True + ack() + + handler = SocketModeHandler( + app_token="xapp-A111-222-xyz", + app=app, + trace_enabled=True, + ) + try: + handler.client.ping_pong_trace_enabled = True + handler.client.wss_uri = "ws://127.0.0.1:3011/link" + + handler.connect() + assert handler.client.is_connected() is True + time.sleep(2) # wait for the message receiver + + handler.client.send_message("foo") + + time.sleep(2) + assert result["shortcut"] is True + assert result["command"] is True + finally: + handler.client.close() + self.server.stop() + self.server.close() diff --git a/tests/adapter_tests/socket_mode/test_interactions_web_client.py b/tests/adapter_tests/socket_mode/test_interactions_web_client.py new file mode 100644 index 000000000..7fd3ca0fc --- /dev/null +++ b/tests/adapter_tests/socket_mode/test_interactions_web_client.py @@ -0,0 +1,74 @@ +import logging +import time +from threading import Thread + +from slack_sdk import WebClient + +from slack_bolt import App +from slack_bolt.adapter.socket_mode.websocket_client import SocketModeHandler +from .mock_socket_mode_server import ( + start_socket_mode_server, +) +from .mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from ...utils import remove_os_env_temporarily, restore_os_env + + +class TestSocketModeWebsocketClient: + logger = logging.getLogger(__name__) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + self.web_client = WebClient( + token="xoxb-api_test", + base_url="http://localhost:8888", + ) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def test_interactions(self): + t = Thread(target=start_socket_mode_server(self, 3012)) + t.daemon = True + t.start() + time.sleep(1) # wait for the server + + app = App(client=self.web_client) + + result = {"shortcut": False, "command": False} + + @app.shortcut("do-something") + def shortcut_handler(ack): + result["shortcut"] = True + ack() + + @app.command("/hello-socket-mode") + def command_handler(ack): + result["command"] = True + ack() + + handler = SocketModeHandler( + app_token="xapp-A111-222-xyz", + app=app, + trace_enabled=True, + ) + try: + handler.client.wss_uri = "ws://localhost:3012/link" + + handler.connect() + assert handler.client.is_connected() is True + time.sleep(2) # wait for the message receiver + + handler.client.send_message("foo") + + time.sleep(2) + assert result["shortcut"] is True + assert result["command"] is True + finally: + handler.client.close() + self.server.stop() + self.server.close() diff --git a/tests/adapter_tests_async/socket_mode/__init__.py b/tests/adapter_tests_async/socket_mode/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py b/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py new file mode 100644 index 000000000..c8eb5b5ab --- /dev/null +++ b/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py @@ -0,0 +1,78 @@ +import asyncio +from threading import Thread + +import pytest +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.adapter.socket_mode.aiohttp import AsyncSocketModeHandler +from slack_bolt.app.async_app import AsyncApp +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env +from ...adapter_tests.socket_mode.mock_socket_mode_server import ( + start_socket_mode_server, +) + + +class TestSocketModeAiohttp: + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + @pytest.mark.asyncio + async def test_events(self): + t = Thread(target=start_socket_mode_server(self, 3021)) + t.daemon = True + t.start() + await asyncio.sleep(1) # wait for the server + + app = AsyncApp(client=self.web_client) + + result = {"shortcut": False, "command": False} + + @app.shortcut("do-something") + async def shortcut_handler(ack): + result["shortcut"] = True + await ack() + + @app.command("/hello-socket-mode") + async def command_handler(ack): + result["command"] = True + await ack() + + handler = AsyncSocketModeHandler( + app_token="xapp-A111-222-xyz", + app=app, + ) + try: + handler.client.wss_uri = "ws://localhost:3021/link" + + await handler.connect_async() + await asyncio.sleep(2) # wait for the message receiver + + await handler.client.send_message("foo") + + await asyncio.sleep(2) + assert result["shortcut"] is True + assert result["command"] is True + finally: + await handler.client.close() + self.server.stop() + self.server.close() diff --git a/tests/adapter_tests_async/socket_mode/test_async_websockets.py b/tests/adapter_tests_async/socket_mode/test_async_websockets.py new file mode 100644 index 000000000..c47d2b7fe --- /dev/null +++ b/tests/adapter_tests_async/socket_mode/test_async_websockets.py @@ -0,0 +1,78 @@ +import asyncio +from threading import Thread + +import pytest +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.adapter.socket_mode.websockets import AsyncSocketModeHandler +from slack_bolt.app.async_app import AsyncApp +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env +from ...adapter_tests.socket_mode.mock_socket_mode_server import ( + start_socket_mode_server, +) + + +class TestSocketModeWebsockets: + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + @pytest.mark.asyncio + async def test_events(self): + t = Thread(target=start_socket_mode_server(self, 3022)) + t.daemon = True + t.start() + await asyncio.sleep(1) # wait for the server + + app = AsyncApp(client=self.web_client) + + result = {"shortcut": False, "command": False} + + @app.shortcut("do-something") + async def shortcut_handler(ack): + result["shortcut"] = True + await ack() + + @app.command("/hello-socket-mode") + async def command_handler(ack): + result["command"] = True + await ack() + + handler = AsyncSocketModeHandler( + app_token="xapp-A111-222-xyz", + app=app, + ) + try: + handler.client.wss_uri = "ws://localhost:3022/link" + + await handler.connect_async() + await asyncio.sleep(2) # wait for the message receiver + + await handler.client.send_message("foo") + + await asyncio.sleep(2) + assert result["shortcut"] is True + assert result["command"] is True + finally: + await handler.client.close() + self.server.stop() + self.server.close() From c28f23110c2166df69a86136d5e37bf769c34dac Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sun, 10 Jan 2021 02:19:58 +0900 Subject: [PATCH 096/719] Fix CI builds --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 90ffbc6b7..351f9257f 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -25,7 +25,7 @@ jobs: run: | python setup.py install pip install -U pip - pip install "pytest>=5,<6" "pytest-cov>=2,<3" + pip install "pytest>=5,<6" "pytest-cov>=2,<3" "flask_sockets>0.2,<1" - name: Run tests without aiohttp run: | pytest tests/slack_bolt/ From e5800a8a6bca7061dd05afa0d669876ab7f72967 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sun, 10 Jan 2021 02:28:16 +0900 Subject: [PATCH 097/719] Replace the boot message --- slack_bolt/adapter/socket_mode/async_base_handler.py | 5 +++-- slack_bolt/adapter/socket_mode/base_handler.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/slack_bolt/adapter/socket_mode/async_base_handler.py b/slack_bolt/adapter/socket_mode/async_base_handler.py index 2837a3d09..836074fad 100644 --- a/slack_bolt/adapter/socket_mode/async_base_handler.py +++ b/slack_bolt/adapter/socket_mode/async_base_handler.py @@ -7,6 +7,7 @@ from slack_bolt import App from slack_bolt.app.async_app import AsyncApp +from slack_bolt.util.utils import get_boot_message class AsyncBaseSocketModeHandler: @@ -30,7 +31,7 @@ async def close_async(self): async def start_async(self): await self.connect_async() if self.app.logger.level > logging.INFO: - print("⚡️ Bolt app is running!") + print(get_boot_message()) else: - self.app.logger.info("⚡️ Bolt app is running!") + self.app.logger.info(get_boot_message()) await asyncio.sleep(float("inf")) diff --git a/slack_bolt/adapter/socket_mode/base_handler.py b/slack_bolt/adapter/socket_mode/base_handler.py index 1cc6b2cc1..99568754e 100644 --- a/slack_bolt/adapter/socket_mode/base_handler.py +++ b/slack_bolt/adapter/socket_mode/base_handler.py @@ -5,6 +5,7 @@ from slack_sdk.socket_mode.request import SocketModeRequest from slack_bolt import App +from slack_bolt.util.utils import get_boot_message class BaseSocketModeHandler: @@ -26,7 +27,7 @@ def close(self): def start(self): self.connect() if self.app.logger.level > logging.INFO: - print("⚡️ Bolt app is running!") + print(get_boot_message()) else: - self.app.logger.info("⚡️ Bolt app is running!") + self.app.logger.info(get_boot_message()) Event().wait() From 0cda62a4c4c05e842b43e5439b7d59d276472ced Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sun, 10 Jan 2021 14:43:01 +0900 Subject: [PATCH 098/719] version 1.2.0rc1 --- scripts/uninstall_all.sh | 3 ++- setup.py | 2 +- slack_bolt/version.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/uninstall_all.sh b/scripts/uninstall_all.sh index 188f97a41..1d3da265d 100755 --- a/scripts/uninstall_all.sh +++ b/scripts/uninstall_all.sh @@ -1,3 +1,4 @@ #!/bin/bash -pip freeze | grep -v "^-e" | xargs pip uninstall -y \ No newline at end of file +pip uninstall -y slack-bolt && \ + pip freeze | grep -v "^-e" | xargs pip uninstall -y diff --git a/setup.py b/setup.py index 74e401edc..42becd291 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.2.0b7,<3.3",], + install_requires=["slack_sdk>=3.2.0rc1,<3.3",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/version.py b/slack_bolt/version.py index c27610a64..e342e4999 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.2.0b4 " +__version__ = "1.2.0rc1" From 100f8473b46b4c706bbc60520cb855d3f6c53bad Mon Sep 17 00:00:00 2001 From: Steve Gill Date: Thu, 7 Jan 2021 16:14:24 -0800 Subject: [PATCH 099/719] added inital socket mode document --- docs/_basic/socket_mode.md | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 docs/_basic/socket_mode.md diff --git a/docs/_basic/socket_mode.md b/docs/_basic/socket_mode.md new file mode 100644 index 000000000..323a5e6be --- /dev/null +++ b/docs/_basic/socket_mode.md @@ -0,0 +1,55 @@ +--- +title: Using Socket Mode +lang: en +slug: socket-mode +order: 16 +--- + +
+With the introduction of [Socket Mode](https://api.slack.com/socket-mode), Bolt for Python introduced support in version `1.2.0`. With Socket Mode, instead of creating a server with endpoints that Slack sends payloads too, the app will instead connect to Slack via a WebSocket connection and receive data from Slack over the socket connection. Make sure to enable Socket Mode in your app configuration settings. + +To use the Socket Mode, add `SLACK_APP_TOKEN` as an environment variable. You can get your App Token in your app configuration settings under the **Basic Information** section. +
+ +```python +import os +from slack_bolt import App +from slack_bolt.adapter.socket_mode import SocketModeHandler + +# Install the Slack app and get xoxb- token in advance +app = App(token=os.environ["SLACK_BOT_TOKEN"]) + +if __name__ == "__main__": + # export SLACK_APP_TOKEN=xapp-*** + # export SLACK_BOT_TOKEN=xoxb-*** + SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]).start() +``` + +While we recommend using [the built-in Socket Mode adapter](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/builtin), there are a few other 3rd party library based implementations. Here is the list of available adapters. + +|PyPI Project|Bolt Adapter| +|-|-| +|[slack_sdk](https://pypi.org/project/slack-sdk/)|[slack_bolt.adapter.socket_mode](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/builtin)| +|[websocket_client](https://pypi.org/project/websocket_client/)|[slack_bolt.adapter.socket_mode.websocket_client](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/websocket_client)| +|[aiohttp](https://pypi.org/project/aiohttp/) (asyncio-based)|[slack_bolt.adapter.socket_mode.aiohttp](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/aiohttp)| +|[websockets](https://pypi.org/project/websockets/) (asyncio-based)|[slack_bolt.adapter.socket_mode.websockets](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/websockets)| + +To use the asyncio-based adapters such as aiohttp, your app needs to be compatible with asyncio's async/await programming model. `AsyncSocketModeHandler` is available for running `AsyncApp` and its async middleware and listeners. + +```python +from slack_bolt.app.async_app import AsyncApp +# The default is the aiohttp based implementation +from slack_bolt.adapter.socket_mode.async_handler import AsyncSocketModeHandler + +app = AsyncApp(token=os.environ["SLACK_BOT_TOKEN"]) + +async def main(): + handler = AsyncSocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]) + await handler.start_async() + +if __name__ == "__main__": + import asyncio + asyncio.run(main()) +``` + +To learn how to use `AsyncApp`, checkout the [Using Async](https://slack.dev/bolt-python/concepts#async) document and relevant [examples](https://github.com/slackapi/bolt-python/tree/main/examples). From 5cb3162b847eddb6cb7885b0b2bb600d581771ad Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 12 Jan 2021 22:34:34 +0900 Subject: [PATCH 100/719] version 1.2.0rc2 --- setup.py | 2 +- slack_bolt/adapter/socket_mode/builtin/__init__.py | 14 +++++++++++--- slack_bolt/version.py | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 42becd291..b2ba603d1 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.2.0rc1,<3.3",], + install_requires=["slack_sdk>=3.2.0rc2,<3.3",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/adapter/socket_mode/builtin/__init__.py b/slack_bolt/adapter/socket_mode/builtin/__init__.py index 54b4fbf9c..242a4d5fa 100644 --- a/slack_bolt/adapter/socket_mode/builtin/__init__.py +++ b/slack_bolt/adapter/socket_mode/builtin/__init__.py @@ -24,10 +24,14 @@ def __init__( # type: ignore app_token: Optional[str] = None, logger: Optional[Logger] = None, web_client: Optional[WebClient] = None, - ping_interval: float = 10, - concurrency: int = 10, proxy: Optional[str] = None, + auto_reconnect_enabled: bool = True, trace_enabled: bool = False, + all_message_trace_enabled: bool = False, + ping_pong_trace_enabled: bool = False, + ping_interval: float = 10, + receive_buffer_size: int = 1024, + concurrency: int = 10, ): self.app = app self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] @@ -36,9 +40,13 @@ def __init__( # type: ignore logger=logger if logger is not None else app.logger, web_client=web_client if web_client is not None else app.client, proxy=proxy if proxy is not None else app.client.proxy, + auto_reconnect_enabled=auto_reconnect_enabled, + trace_enabled=trace_enabled, + all_message_trace_enabled=all_message_trace_enabled, + ping_pong_trace_enabled=ping_pong_trace_enabled, ping_interval=ping_interval, + receive_buffer_size=receive_buffer_size, concurrency=concurrency, - trace_enabled=trace_enabled, ) self.client.socket_mode_request_listeners.append(self.handle) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index e342e4999..4ab11ba1c 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.2.0rc1" +__version__ = "1.2.0rc2" From 1c57dff471d0fbb14e8806ca1c6624876efa0af4 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 13 Jan 2021 07:11:44 +0900 Subject: [PATCH 101/719] version 1.2.0 --- docs/_basic/socket_mode.md | 2 +- setup.py | 2 +- slack_bolt/version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/_basic/socket_mode.md b/docs/_basic/socket_mode.md index 323a5e6be..f4191c696 100644 --- a/docs/_basic/socket_mode.md +++ b/docs/_basic/socket_mode.md @@ -6,7 +6,7 @@ order: 16 ---
-With the introduction of [Socket Mode](https://api.slack.com/socket-mode), Bolt for Python introduced support in version `1.2.0`. With Socket Mode, instead of creating a server with endpoints that Slack sends payloads too, the app will instead connect to Slack via a WebSocket connection and receive data from Slack over the socket connection. Make sure to enable Socket Mode in your app configuration settings. +With the introduction of [Socket Mode](https://api.slack.com/apis/connections/socket), Bolt for Python introduced support in version `1.2.0`. With Socket Mode, instead of creating a server with endpoints that Slack sends payloads too, the app will instead connect to Slack via a WebSocket connection and receive data from Slack over the socket connection. Make sure to enable Socket Mode in your app configuration settings. To use the Socket Mode, add `SLACK_APP_TOKEN` as an environment variable. You can get your App Token in your app configuration settings under the **Basic Information** section.
diff --git a/setup.py b/setup.py index b2ba603d1..4e34c5811 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.2.0rc2,<3.3",], + install_requires=["slack_sdk>=3.2.0,<3.3",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 4ab11ba1c..c68196d1c 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.2.0rc2" +__version__ = "1.2.0" From c18e0d84f4b3bd48d42628244c9f68a75e174514 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 13 Jan 2021 07:58:46 +0900 Subject: [PATCH 102/719] Fix Socket Mode document --- docs/_basic/socket_mode.md | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/docs/_basic/socket_mode.md b/docs/_basic/socket_mode.md index f4191c696..da7f1d024 100644 --- a/docs/_basic/socket_mode.md +++ b/docs/_basic/socket_mode.md @@ -9,6 +9,16 @@ order: 16 With the introduction of [Socket Mode](https://api.slack.com/apis/connections/socket), Bolt for Python introduced support in version `1.2.0`. With Socket Mode, instead of creating a server with endpoints that Slack sends payloads too, the app will instead connect to Slack via a WebSocket connection and receive data from Slack over the socket connection. Make sure to enable Socket Mode in your app configuration settings. To use the Socket Mode, add `SLACK_APP_TOKEN` as an environment variable. You can get your App Token in your app configuration settings under the **Basic Information** section. + +While we recommend using [the built-in Socket Mode adapter](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/builtin), there are a few other 3rd party library based implementations. Here is the list of available adapters. + +|PyPI Project|Bolt Adapter| +|-|-| +|[slack_sdk](https://pypi.org/project/slack-sdk/)|[slack_bolt.adapter.socket_mode](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/builtin)| +|[websocket_client](https://pypi.org/project/websocket_client/)|[slack_bolt.adapter.socket_mode.websocket_client](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/websocket_client)| +|[aiohttp](https://pypi.org/project/aiohttp/) (asyncio-based)|[slack_bolt.adapter.socket_mode.aiohttp](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/aiohttp)| +|[websockets](https://pypi.org/project/websockets/) (asyncio-based)|[slack_bolt.adapter.socket_mode.websockets](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/websockets)| + ```python @@ -19,23 +29,26 @@ from slack_bolt.adapter.socket_mode import SocketModeHandler # Install the Slack app and get xoxb- token in advance app = App(token=os.environ["SLACK_BOT_TOKEN"]) +# Add middleware / listeners here + if __name__ == "__main__": # export SLACK_APP_TOKEN=xapp-*** # export SLACK_BOT_TOKEN=xoxb-*** - SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]).start() + handler = SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]) + handler.start() ``` -While we recommend using [the built-in Socket Mode adapter](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/builtin), there are a few other 3rd party library based implementations. Here is the list of available adapters. - -|PyPI Project|Bolt Adapter| -|-|-| -|[slack_sdk](https://pypi.org/project/slack-sdk/)|[slack_bolt.adapter.socket_mode](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/builtin)| -|[websocket_client](https://pypi.org/project/websocket_client/)|[slack_bolt.adapter.socket_mode.websocket_client](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/websocket_client)| -|[aiohttp](https://pypi.org/project/aiohttp/) (asyncio-based)|[slack_bolt.adapter.socket_mode.aiohttp](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/aiohttp)| -|[websockets](https://pypi.org/project/websockets/) (asyncio-based)|[slack_bolt.adapter.socket_mode.websockets](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/websockets)| +
+ +

Using Async

+
+
To use the asyncio-based adapters such as aiohttp, your app needs to be compatible with asyncio's async/await programming model. `AsyncSocketModeHandler` is available for running `AsyncApp` and its async middleware and listeners. +To learn how to use `AsyncApp`, checkout the [Using Async](https://slack.dev/bolt-python/concepts#async) document and relevant [examples](https://github.com/slackapi/bolt-python/tree/main/examples). +
+ ```python from slack_bolt.app.async_app import AsyncApp # The default is the aiohttp based implementation @@ -43,6 +56,8 @@ from slack_bolt.adapter.socket_mode.async_handler import AsyncSocketModeHandler app = AsyncApp(token=os.environ["SLACK_BOT_TOKEN"]) +# Add middleware / listeners here + async def main(): handler = AsyncSocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]) await handler.start_async() @@ -52,4 +67,4 @@ if __name__ == "__main__": asyncio.run(main()) ``` -To learn how to use `AsyncApp`, checkout the [Using Async](https://slack.dev/bolt-python/concepts#async) document and relevant [examples](https://github.com/slackapi/bolt-python/tree/main/examples). +
From dec80e35b31def6688cb17a08b27217cf4867ff7 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 13 Jan 2021 08:39:19 +0900 Subject: [PATCH 103/719] Fix #198 bug where str subtype constraint does not work --- slack_bolt/listener_matcher/builtins.py | 4 + tests/scenario_tests/test_events.py | 157 +++++++++++++++++++++ tests/scenario_tests_async/test_events.py | 161 ++++++++++++++++++++++ 3 files changed, 322 insertions(+) diff --git a/slack_bolt/listener_matcher/builtins.py b/slack_bolt/listener_matcher/builtins.py index 50b64fea6..ae1d52dc2 100644 --- a/slack_bolt/listener_matcher/builtins.py +++ b/slack_bolt/listener_matcher/builtins.py @@ -102,6 +102,10 @@ def func(body: Dict[str, Any]) -> bool: if expected_subtype is None: # "subtype" in constraints is intentionally None for this pattern return "subtype" not in event + elif isinstance(expected_subtype, (str, Pattern)): + return "subtype" in event and _matches( + expected_subtype, event["subtype"] + ) elif isinstance(expected_subtype, Sequence): subtypes: Sequence[ Optional[Union[str, Pattern]] diff --git a/tests/scenario_tests/test_events.py b/tests/scenario_tests/test_events.py index 12ec82742..0ce15d255 100644 --- a/tests/scenario_tests/test_events.py +++ b/tests/scenario_tests/test_events.py @@ -1,4 +1,5 @@ import json +import re from time import time, sleep from slack_sdk.signature import SignatureVerifier @@ -396,3 +397,159 @@ def handler2(say: Say): assert self.mock_received_requests["/auth.test"] == 1 sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 2 + + message_file_share_body = { + "token": "verification-token", + "team_id": "T111", + "api_app_id": "A111", + "event": { + "type": "message", + "text": "Here is your file!", + "files": [ + { + "id": "F111", + "created": 1610493713, + "timestamp": 1610493713, + "name": "test.png", + "title": "test.png", + "mimetype": "image/png", + "filetype": "png", + "pretty_type": "PNG", + "user": "U111", + "editable": False, + "size": 42706, + "mode": "hosted", + "is_external": False, + "external_type": "", + "is_public": False, + "public_url_shared": False, + "display_as_bot": False, + "username": "", + "url_private": "https://files.slack.com/files-pri/T111-F111/test.png", + "url_private_download": "https://files.slack.com/files-pri/T111-F111/download/test.png", + "thumb_64": "https://files.slack.com/files-tmb/T111-F111-8d3f9a6d4b/test_64.png", + "thumb_80": "https://files.slack.com/files-tmb/T111-F111-8d3f9a6d4b/test_80.png", + "thumb_360": "https://files.slack.com/files-tmb/T111-F111-8d3f9a6d4b/test_360.png", + "thumb_360_w": 358, + "thumb_360_h": 360, + "thumb_480": "https://files.slack.com/files-tmb/T111-F111-8d3f9a6d4b/test_480.png", + "thumb_480_w": 477, + "thumb_480_h": 480, + "thumb_160": "https://files.slack.com/files-tmb/T111-F111-8d3f9a6d4b/test_160.png", + "thumb_720": "https://files.slack.com/files-tmb/T111-F111-8d3f9a6d4b/test_720.png", + "thumb_720_w": 716, + "thumb_720_h": 720, + "original_w": 736, + "original_h": 740, + "thumb_tiny": "xxx", + "permalink": "https://xxx.slack.com/files/U111/F111/test.png", + "permalink_public": "https://slack-files.com/T111-F111-3e534ef8ca", + "has_rich_preview": False, + } + ], + "upload": False, + "blocks": [ + { + "type": "rich_text", + "block_id": "gvM", + "elements": [ + { + "type": "rich_text_section", + "elements": [ + {"type": "text", "text": "Here is your file!"} + ], + } + ], + } + ], + "user": "U111", + "display_as_bot": False, + "ts": "1610493715.001000", + "channel": "G111", + "subtype": "file_share", + "event_ts": "1610493715.001000", + "channel_type": "group", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1610493715, + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T111", + "user_id": "U111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": False, + "event_context": "1-message-T111-G111", + } + + def test_message_subtypes_0(self): + app = App(client=self.web_client, signing_secret=self.signing_secret) + app._client = WebClient( + token="uninstalled-revoked", base_url=self.mock_api_server_base_url + ) + + @app.event({"type": "message", "subtype": "file_share"}) + def handler1(event): + assert event["subtype"] == "file_share" + + timestamp, body = str(int(time())), json.dumps(self.message_file_share_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + + def test_message_subtypes_1(self): + app = App(client=self.web_client, signing_secret=self.signing_secret) + app._client = WebClient( + token="uninstalled-revoked", base_url=self.mock_api_server_base_url + ) + + @app.event({"type": "message", "subtype": re.compile("file_.+")}) + def handler1(event): + assert event["subtype"] == "file_share" + + timestamp, body = str(int(time())), json.dumps(self.message_file_share_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + + def test_message_subtypes_2(self): + app = App(client=self.web_client, signing_secret=self.signing_secret) + app._client = WebClient( + token="uninstalled-revoked", base_url=self.mock_api_server_base_url + ) + + @app.event({"type": "message", "subtype": ["file_share"]}) + def handler1(event): + assert event["subtype"] == "file_share" + + timestamp, body = str(int(time())), json.dumps(self.message_file_share_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + + def test_message_subtypes_3(self): + app = App(client=self.web_client, signing_secret=self.signing_secret) + app._client = WebClient( + token="uninstalled-revoked", base_url=self.mock_api_server_base_url + ) + + @app.event("message") + def handler1(event): + assert event["subtype"] == "file_share" + + timestamp, body = str(int(time())), json.dumps(self.message_file_share_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 diff --git a/tests/scenario_tests_async/test_events.py b/tests/scenario_tests_async/test_events.py index 346883bee..9dda0b052 100644 --- a/tests/scenario_tests_async/test_events.py +++ b/tests/scenario_tests_async/test_events.py @@ -1,5 +1,6 @@ import asyncio import json +import re from random import random from time import time @@ -400,6 +401,166 @@ async def handler2(say: AsyncSay): await asyncio.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 2 + message_file_share_body = { + "token": "verification-token", + "team_id": "T111", + "api_app_id": "A111", + "event": { + "type": "message", + "text": "Here is your file!", + "files": [ + { + "id": "F111", + "created": 1610493713, + "timestamp": 1610493713, + "name": "test.png", + "title": "test.png", + "mimetype": "image/png", + "filetype": "png", + "pretty_type": "PNG", + "user": "U111", + "editable": False, + "size": 42706, + "mode": "hosted", + "is_external": False, + "external_type": "", + "is_public": False, + "public_url_shared": False, + "display_as_bot": False, + "username": "", + "url_private": "https://files.slack.com/files-pri/T111-F111/test.png", + "url_private_download": "https://files.slack.com/files-pri/T111-F111/download/test.png", + "thumb_64": "https://files.slack.com/files-tmb/T111-F111-8d3f9a6d4b/test_64.png", + "thumb_80": "https://files.slack.com/files-tmb/T111-F111-8d3f9a6d4b/test_80.png", + "thumb_360": "https://files.slack.com/files-tmb/T111-F111-8d3f9a6d4b/test_360.png", + "thumb_360_w": 358, + "thumb_360_h": 360, + "thumb_480": "https://files.slack.com/files-tmb/T111-F111-8d3f9a6d4b/test_480.png", + "thumb_480_w": 477, + "thumb_480_h": 480, + "thumb_160": "https://files.slack.com/files-tmb/T111-F111-8d3f9a6d4b/test_160.png", + "thumb_720": "https://files.slack.com/files-tmb/T111-F111-8d3f9a6d4b/test_720.png", + "thumb_720_w": 716, + "thumb_720_h": 720, + "original_w": 736, + "original_h": 740, + "thumb_tiny": "xxx", + "permalink": "https://xxx.slack.com/files/U111/F111/test.png", + "permalink_public": "https://slack-files.com/T111-F111-3e534ef8ca", + "has_rich_preview": False, + } + ], + "upload": False, + "blocks": [ + { + "type": "rich_text", + "block_id": "gvM", + "elements": [ + { + "type": "rich_text_section", + "elements": [ + {"type": "text", "text": "Here is your file!"} + ], + } + ], + } + ], + "user": "U111", + "display_as_bot": False, + "ts": "1610493715.001000", + "channel": "G111", + "subtype": "file_share", + "event_ts": "1610493715.001000", + "channel_type": "group", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1610493715, + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T111", + "user_id": "U111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": False, + "event_context": "1-message-T111-G111", + } + + @pytest.mark.asyncio + async def test_message_subtypes_0(self): + app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) + app._client = AsyncWebClient( + token="uninstalled-revoked", base_url=self.mock_api_server_base_url + ) + + @app.event({"type": "message", "subtype": "file_share"}) + async def handler1(event): + assert event["subtype"] == "file_share" + + timestamp, body = str(int(time())), json.dumps(self.message_file_share_body) + request: AsyncBoltRequest = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + + @pytest.mark.asyncio + async def test_message_subtypes_1(self): + app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) + app._client = AsyncWebClient( + token="uninstalled-revoked", base_url=self.mock_api_server_base_url + ) + + @app.event({"type": "message", "subtype": re.compile("file_.+")}) + async def handler1(event): + assert event["subtype"] == "file_share" + + timestamp, body = str(int(time())), json.dumps(self.message_file_share_body) + request: AsyncBoltRequest = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + + @pytest.mark.asyncio + async def test_message_subtypes_2(self): + app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) + app._client = AsyncWebClient( + token="uninstalled-revoked", base_url=self.mock_api_server_base_url + ) + + @app.event({"type": "message", "subtype": ["file_share"]}) + async def handler1(event): + assert event["subtype"] == "file_share" + + timestamp, body = str(int(time())), json.dumps(self.message_file_share_body) + request: AsyncBoltRequest = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + + @pytest.mark.asyncio + async def test_message_subtypes_3(self): + app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) + app._client = AsyncWebClient( + token="uninstalled-revoked", base_url=self.mock_api_server_base_url + ) + + @app.event("message") + async def handler1(event): + assert event["subtype"] == "file_share" + + timestamp, body = str(int(time())), json.dumps(self.message_file_share_body) + request: AsyncBoltRequest = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + app_mention_body = { "token": "verification_token", From a11f6d1f4e4591de3215f40f04f66bbc2e1a226e Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 13 Jan 2021 08:51:36 +0900 Subject: [PATCH 104/719] version 1.2.1 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index c68196d1c..a955fdae1 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.2.0" +__version__ = "1.2.1" From 16d2908a064f58083b2a3859f360e2404c0e7d94 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 18 Jan 2021 15:27:46 +0900 Subject: [PATCH 105/719] Fix #208 by updating AsyncOAuthFlow --- slack_bolt/oauth/async_oauth_flow.py | 14 +++++++++++++- slack_bolt/oauth/oauth_flow.py | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/slack_bolt/oauth/async_oauth_flow.py b/slack_bolt/oauth/async_oauth_flow.py index dc2d0f094..42a98c9e5 100644 --- a/slack_bolt/oauth/async_oauth_flow.py +++ b/slack_bolt/oauth/async_oauth_flow.py @@ -308,6 +308,9 @@ async def run_installation(self, code: str) -> Optional[Installation]: installed_enterprise: Dict[str, str] = ( oauth_response.get("enterprise") or {} ) + is_enterprise_install: bool = ( + oauth_response.get("is_enterprise_install") or False + ) installed_team: Dict[str, str] = oauth_response.get("team") or {} installer: Dict[str, str] = oauth_response.get("authed_user") or {} incoming_webhook: Dict[str, str] = ( @@ -317,14 +320,20 @@ async def run_installation(self, code: str) -> Optional[Installation]: bot_token: Optional[str] = oauth_response.get("access_token") # NOTE: oauth.v2.access doesn't include bot_id in response bot_id: Optional[str] = None + enterprise_url: Optional[str] = None if bot_token is not None: auth_test = await self.client.auth_test(token=bot_token) bot_id = auth_test["bot_id"] + if is_enterprise_install is True: + enterprise_url = auth_test.get("url") return Installation( app_id=oauth_response.get("app_id"), enterprise_id=installed_enterprise.get("id"), + enterprise_name=installed_enterprise.get("name"), + enterprise_url=enterprise_url, team_id=installed_team.get("id"), + team_name=installed_team.get("name"), bot_token=bot_token, bot_id=bot_id, bot_user_id=oauth_response.get("bot_user_id"), @@ -333,10 +342,13 @@ async def run_installation(self, code: str) -> Optional[Installation]: user_token=installer.get("access_token"), user_scopes=installer.get("scope"), # comma-separated string incoming_webhook_url=incoming_webhook.get("url"), + incoming_webhook_channel=incoming_webhook.get("channel"), incoming_webhook_channel_id=incoming_webhook.get("channel_id"), incoming_webhook_configuration_url=incoming_webhook.get( - "configuration_url", None + "configuration_url" ), + is_enterprise_install=is_enterprise_install, + token_type=oauth_response.get("token_type"), ) except SlackApiError as e: diff --git a/slack_bolt/oauth/oauth_flow.py b/slack_bolt/oauth/oauth_flow.py index 867c90761..c03f406d2 100644 --- a/slack_bolt/oauth/oauth_flow.py +++ b/slack_bolt/oauth/oauth_flow.py @@ -340,7 +340,7 @@ def run_installation(self, code: str) -> Optional[Installation]: incoming_webhook_channel=incoming_webhook.get("channel"), incoming_webhook_channel_id=incoming_webhook.get("channel_id"), incoming_webhook_configuration_url=incoming_webhook.get( - "configuration_url", None + "configuration_url" ), is_enterprise_install=is_enterprise_install, token_type=oauth_response.get("token_type"), From 90bfe6ab19e7dff80c615ebe3857b237c34028c6 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 18 Jan 2021 15:34:10 +0900 Subject: [PATCH 106/719] Fix #210 by correcting a type hint in async OAuth classes --- slack_bolt/oauth/async_oauth_settings.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/slack_bolt/oauth/async_oauth_settings.py b/slack_bolt/oauth/async_oauth_settings.py index 948bf7547..59aff5fae 100644 --- a/slack_bolt/oauth/async_oauth_settings.py +++ b/slack_bolt/oauth/async_oauth_settings.py @@ -19,8 +19,8 @@ AsyncAuthorize, ) from slack_bolt.error import BoltError +from slack_bolt.oauth.async_callback_options import AsyncCallbackOptions from slack_bolt.oauth.async_internals import get_or_create_default_installation_store -from slack_bolt.oauth.callback_options import CallbackOptions class AsyncOAuthSettings: @@ -34,7 +34,7 @@ class AsyncOAuthSettings: install_path: str install_page_rendering_enabled: bool redirect_uri_path: str - callback_options: Optional[CallbackOptions] = None + callback_options: Optional[AsyncCallbackOptions] = None success_url: Optional[str] failure_url: Optional[str] authorization_url: str # default: https://slack.com/oauth/v2/authorize @@ -66,7 +66,7 @@ def __init__( install_path: str = "/slack/install", install_page_rendering_enabled: bool = True, redirect_uri_path: str = "/slack/oauth_redirect", - callback_options: Optional[CallbackOptions] = None, + callback_options: Optional[AsyncCallbackOptions] = None, success_url: Optional[str] = None, failure_url: Optional[str] = None, authorization_url: Optional[str] = None, From e0422735a918798af003186ce7eaae06fc831933 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 12 Jan 2021 07:51:30 +0900 Subject: [PATCH 107/719] Improvement related to #199: add event type name validation --- slack_bolt/listener_matcher/builtins.py | 10 ++++++++ slack_bolt/logger/messages.py | 8 ++++++ tests/scenario_tests/test_events.py | 28 ++++++++++++++++++++ tests/scenario_tests_async/test_events.py | 31 +++++++++++++++++++++++ 4 files changed, 77 insertions(+) diff --git a/slack_bolt/listener_matcher/builtins.py b/slack_bolt/listener_matcher/builtins.py index ae1d52dc2..cffcf95c1 100644 --- a/slack_bolt/listener_matcher/builtins.py +++ b/slack_bolt/listener_matcher/builtins.py @@ -21,6 +21,7 @@ to_action, is_workflow_step_save, ) +from ..logger.messages import error_message_event_type if sys.version_info.major == 3 and sys.version_info.minor <= 6: from re import _pattern_type as Pattern @@ -82,6 +83,7 @@ def event( ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: if isinstance(constraints, (str, Pattern)): event_type: Union[str, Pattern] = constraints + _verify_message_event_type(event_type) def func(body: Dict[str, Any]) -> bool: return is_event(body) and _matches(event_type, body["event"]["type"]) @@ -89,6 +91,7 @@ def func(body: Dict[str, Any]) -> bool: return build_listener_matcher(func, asyncio) elif "type" in constraints: + _verify_message_event_type(constraints["type"]) def func(body: Dict[str, Any]) -> bool: if is_event(body): @@ -132,6 +135,13 @@ def func(body: Dict[str, Any]) -> bool: ) +def _verify_message_event_type(event_type: str) -> None: + if isinstance(event_type, str) and event_type.startswith("message."): + raise ValueError(error_message_event_type(event_type)) + if isinstance(event_type, Pattern) and "message\\." in event_type.pattern: + raise ValueError(error_message_event_type(event_type)) + + def workflow_step_execute( callback_id: Union[str, Pattern], asyncio: bool = False, diff --git a/slack_bolt/logger/messages.py b/slack_bolt/logger/messages.py index 9be35c486..f7bc8af7e 100644 --- a/slack_bolt/logger/messages.py +++ b/slack_bolt/logger/messages.py @@ -50,6 +50,14 @@ def error_authorize_conflicts() -> str: return "`authorize` in the top-level arguments is not allowed when you pass either `oauth_settings` or `oauth_flow`" +def error_message_event_type(event_type: str) -> str: + return ( + f'Although the document mentions "{event_type}", ' + 'it is not a valid event type. Use "message" instead. ' + "If you want to filter message events, you can use `event.channel_type` for it." + ) + + # ------------------------------- # Warning # ------------------------------- diff --git a/tests/scenario_tests/test_events.py b/tests/scenario_tests/test_events.py index 0ce15d255..c80a23bff 100644 --- a/tests/scenario_tests/test_events.py +++ b/tests/scenario_tests/test_events.py @@ -2,6 +2,7 @@ import re from time import time, sleep +import pytest from slack_sdk.signature import SignatureVerifier from slack_sdk.web import WebClient @@ -553,3 +554,30 @@ def handler1(event): ) response = app.dispatch(request) assert response.status == 200 + + # https://github.com/slackapi/bolt-python/issues/199 + def test_invalid_message_events(self): + app = App(client=self.web_client, signing_secret=self.signing_secret) + + def handle(): + pass + + # valid + app.event("message")(handle) + + with pytest.raises(ValueError): + app.event("message.channels")(handle) + with pytest.raises(ValueError): + app.event("message.groups")(handle) + with pytest.raises(ValueError): + app.event("message.im")(handle) + with pytest.raises(ValueError): + app.event("message.mpim")(handle) + + with pytest.raises(ValueError): + app.event(re.compile("message\\..*"))(handle) + + with pytest.raises(ValueError): + app.event({"type": "message.channels"})(handle) + with pytest.raises(ValueError): + app.event({"type": re.compile("message\\..*")})(handle) diff --git a/tests/scenario_tests_async/test_events.py b/tests/scenario_tests_async/test_events.py index 9dda0b052..16fb92ef3 100644 --- a/tests/scenario_tests_async/test_events.py +++ b/tests/scenario_tests_async/test_events.py @@ -561,6 +561,37 @@ async def handler1(event): response = await app.async_dispatch(request) assert response.status == 200 + # https://github.com/slackapi/bolt-python/issues/199 + @pytest.mark.asyncio + async def test_invalid_message_events(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + async def handle(): + pass + + # valid + app.event("message")(handle) + + with pytest.raises(ValueError): + app.event("message.channels")(handle) + with pytest.raises(ValueError): + app.event("message.groups")(handle) + with pytest.raises(ValueError): + app.event("message.im")(handle) + with pytest.raises(ValueError): + app.event("message.mpim")(handle) + + with pytest.raises(ValueError): + app.event(re.compile("message\\..*"))(handle) + + with pytest.raises(ValueError): + app.event({"type": "message.channels"})(handle) + with pytest.raises(ValueError): + app.event({"type": re.compile("message\\..*")})(handle) + app_mention_body = { "token": "verification_token", From 03a0ad4e562366a216e604fdd1b6cadf15705ee1 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 19 Jan 2021 13:18:10 +0900 Subject: [PATCH 108/719] version 1.2.2 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index a955fdae1..bc86c944f 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.2.1" +__version__ = "1.2.2" From 117e04ba581d3f39da8ba0e52491eb56fd0431b0 Mon Sep 17 00:00:00 2001 From: Nicko van Someren Date: Tue, 19 Jan 2021 18:13:42 -0700 Subject: [PATCH 109/719] Fixed fetching of names for callable objects (#215) Added new function name_for_callable() in util.utils. Fixed name properties for CustomMiddleware and AsyncCustomMiddleware to use the new function. Modified listener/thread_runner.py and listener/asyncio_runner.py to use the new function to name lazy functions. Added test cases for middleware and lazy function cases. --- slack_bolt/listener/asyncio_runner.py | 8 +++--- slack_bolt/listener/thread_runner.py | 8 +++--- .../middleware/async_custom_middleware.py | 3 +- slack_bolt/middleware/custom_middleware.py | 4 +-- slack_bolt/util/utils.py | 7 +++++ tests/scenario_tests/test_lazy.py | 28 +++++++++++++++++++ .../test_listener_middleware.py | 17 +++++++++++ tests/scenario_tests/test_middleware.py | 17 +++++++++++ 8 files changed, 81 insertions(+), 11 deletions(-) diff --git a/slack_bolt/listener/asyncio_runner.py b/slack_bolt/listener/asyncio_runner.py index 1ea9de2a2..b35f05e23 100644 --- a/slack_bolt/listener/asyncio_runner.py +++ b/slack_bolt/listener/asyncio_runner.py @@ -15,7 +15,7 @@ ) from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse -from slack_bolt.util.utils import create_copy +from slack_bolt.util.utils import create_copy, name_for_callable class AsyncioListenerRunner: @@ -71,7 +71,7 @@ async def run( for lazy_func in listener.lazy_functions: if request.lazy_function_name: - func_name = lazy_func.__name__ + func_name = name_for_callable(lazy_func) if func_name == request.lazy_function_name: await self.lazy_listener_runner.run( function=lazy_func, request=request @@ -128,7 +128,7 @@ async def run_ack_function_asynchronously( for lazy_func in listener.lazy_functions: if request.lazy_function_name: - func_name = lazy_func.__name__ + func_name = name_for_callable(lazy_func) if func_name == request.lazy_function_name: await self.lazy_listener_runner.run( function=lazy_func, request=request @@ -163,7 +163,7 @@ def _start_lazy_function( self, lazy_func: Callable[..., Awaitable[None]], request: AsyncBoltRequest ) -> None: # Start a lazy function asynchronously - func_name: str = lazy_func.__name__ + func_name: str = name_for_callable(lazy_func) self.logger.debug(debug_running_lazy_listener(func_name)) copied_request = self._build_lazy_request(request, func_name) self.lazy_listener_runner.start(function=lazy_func, request=copied_request) diff --git a/slack_bolt/listener/thread_runner.py b/slack_bolt/listener/thread_runner.py index 2e60e1c41..05601a511 100644 --- a/slack_bolt/listener/thread_runner.py +++ b/slack_bolt/listener/thread_runner.py @@ -13,7 +13,7 @@ ) from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse -from slack_bolt.util.utils import create_copy +from slack_bolt.util.utils import create_copy, name_for_callable class ThreadListenerRunner: @@ -72,7 +72,7 @@ def run( # type: ignore for lazy_func in listener.lazy_functions: if request.lazy_function_name: - func_name = lazy_func.__name__ + func_name = name_for_callable(lazy_func) if func_name == request.lazy_function_name: self.lazy_listener_runner.run( function=lazy_func, request=request @@ -127,7 +127,7 @@ def run_ack_function_asynchronously(): for lazy_func in listener.lazy_functions: if request.lazy_function_name: - func_name = lazy_func.__name__ + func_name = name_for_callable(lazy_func) if func_name == request.lazy_function_name: self.lazy_listener_runner.run( function=lazy_func, request=request @@ -162,7 +162,7 @@ def _start_lazy_function( self, lazy_func: Callable[..., None], request: BoltRequest ) -> None: # Start a lazy function asynchronously - func_name: str = lazy_func.__name__ + func_name: str = name_for_callable(lazy_func) self.logger.debug(debug_running_lazy_listener(func_name)) copied_request = self._build_lazy_request(request, func_name) self.lazy_listener_runner.start(function=lazy_func, request=copied_request) diff --git a/slack_bolt/middleware/async_custom_middleware.py b/slack_bolt/middleware/async_custom_middleware.py index be44cf2db..5d6b6837c 100644 --- a/slack_bolt/middleware/async_custom_middleware.py +++ b/slack_bolt/middleware/async_custom_middleware.py @@ -7,6 +7,7 @@ from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse from .async_middleware import AsyncMiddleware +from slack_bolt.util.utils import name_for_callable class AsyncCustomMiddleware(AsyncMiddleware): @@ -45,4 +46,4 @@ async def async_process( @property def name(self) -> str: - return f"AsyncCustomMiddleware(func={self.func.__name__})" + return f"AsyncCustomMiddleware(func={name_for_callable(self.func)})" diff --git a/slack_bolt/middleware/custom_middleware.py b/slack_bolt/middleware/custom_middleware.py index f3e4afff8..17c550417 100644 --- a/slack_bolt/middleware/custom_middleware.py +++ b/slack_bolt/middleware/custom_middleware.py @@ -7,7 +7,7 @@ from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse from .middleware import Middleware - +from slack_bolt.util.utils import name_for_callable class CustomMiddleware(Middleware): app_name: str @@ -41,4 +41,4 @@ def process( @property def name(self) -> str: - return f"CustomMiddleware(func={self.func.__name__})" + return f"CustomMiddleware(func={name_for_callable(self.func)})" diff --git a/slack_bolt/util/utils.py b/slack_bolt/util/utils.py index e52a53674..cac7f0d0a 100644 --- a/slack_bolt/util/utils.py +++ b/slack_bolt/util/utils.py @@ -57,3 +57,10 @@ def get_boot_message(development_server: bool = False) -> str: return "⚡️ Bolt app is running! (development server)" else: return "⚡️ Bolt app is running!" + + +def name_for_callable(func): + if hasattr(func, "__name__"): + func_name = func.__name__ + else: + func_name = f"{func.__class__.__module__}.{func.__class__.__name__}" diff --git a/tests/scenario_tests/test_lazy.py b/tests/scenario_tests/test_lazy.py index 8a633f8cc..6a2c89607 100644 --- a/tests/scenario_tests/test_lazy.py +++ b/tests/scenario_tests/test_lazy.py @@ -110,3 +110,31 @@ def async2(say): assert response.status == 200 time.sleep(1) # wait a bit assert self.mock_received_requests["/chat.postMessage"] == 2 + + def test_lazy_class(self): + def just_ack(ack): + ack() + + class LazyClass: + def __call__(self, say): + time.sleep(0.3) + say(text="lazy function 1") + + def async2(say): + time.sleep(0.5) + say(text="lazy function 2") + + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + app.action("a")( + ack=just_ack, + lazy=[LazyClass(), async2], + ) + + request = self.build_valid_request() + response = app.dispatch(request) + assert response.status == 200 + time.sleep(1) # wait a bit + assert self.mock_received_requests["/chat.postMessage"] == 2 diff --git a/tests/scenario_tests/test_listener_middleware.py b/tests/scenario_tests/test_listener_middleware.py index 4906375d8..11ca31115 100644 --- a/tests/scenario_tests/test_listener_middleware.py +++ b/tests/scenario_tests/test_listener_middleware.py @@ -93,6 +93,23 @@ def handle(ack): response = app.dispatch(self.build_request()) assert response.status == 200 + def test_class_next(self): + class NextClass: + def __call__(self, next): + next() + + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + @app.shortcut(constraints="test-shortcut", middleware=[NextClass()]) + def handle(ack): + ack() + + response = app.dispatch(self.build_request()) + assert response.status == 200 + def listener_middleware_returning_response(): return BoltResponse(status=200, body="listener middleware") diff --git a/tests/scenario_tests/test_middleware.py b/tests/scenario_tests/test_middleware.py index 569dc6261..deb677d1d 100644 --- a/tests/scenario_tests/test_middleware.py +++ b/tests/scenario_tests/test_middleware.py @@ -86,6 +86,23 @@ def test_next_call(self): assert response.body == "acknowledged!" assert self.mock_received_requests["/auth.test"] == 1 + def test_class_call(self): + class NextClass: + def __call__(self, next): + next() + + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + app.use(NextClass()) + app.shortcut("test-shortcut")(just_ack) + + response = app.dispatch(self.build_request()) + assert response.status == 200 + assert response.body == "acknowledged!" + assert self.mock_received_requests["/auth.test"] == 1 + def just_ack(ack): ack("acknowledged!") From 67601746f413ad4ee8feb065ff72c8ddcef9a802 Mon Sep 17 00:00:00 2001 From: Nicko van Someren Date: Tue, 19 Jan 2021 19:46:10 -0700 Subject: [PATCH 110/719] Fix PEP8 formatting --- slack_bolt/middleware/custom_middleware.py | 1 + 1 file changed, 1 insertion(+) diff --git a/slack_bolt/middleware/custom_middleware.py b/slack_bolt/middleware/custom_middleware.py index 17c550417..a24513c24 100644 --- a/slack_bolt/middleware/custom_middleware.py +++ b/slack_bolt/middleware/custom_middleware.py @@ -9,6 +9,7 @@ from .middleware import Middleware from slack_bolt.util.utils import name_for_callable + class CustomMiddleware(Middleware): app_name: str func: Callable[..., Any] From f0ee5a1d17fa10d53b5a5809db07a5f3a1e507f9 Mon Sep 17 00:00:00 2001 From: Nicko van Someren Date: Tue, 19 Jan 2021 20:06:06 -0700 Subject: [PATCH 111/719] Fixed return error in name_for_callable and added typing hints. --- slack_bolt/util/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/slack_bolt/util/utils.py b/slack_bolt/util/utils.py index cac7f0d0a..272c7d382 100644 --- a/slack_bolt/util/utils.py +++ b/slack_bolt/util/utils.py @@ -1,6 +1,6 @@ import copy import sys -from typing import Optional, Union, Dict, Any, Sequence +from typing import Optional, Union, Dict, Any, Sequence, Callable from slack_sdk import WebClient from slack_sdk.models import JsonObject @@ -59,8 +59,9 @@ def get_boot_message(development_server: bool = False) -> str: return "⚡️ Bolt app is running!" -def name_for_callable(func): +def name_for_callable(func: Callable) -> str: if hasattr(func, "__name__"): func_name = func.__name__ else: func_name = f"{func.__class__.__module__}.{func.__class__.__name__}" + return func_name From bbcad6364df26cbb6fe80cca2f21855cb85be6c5 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 20 Jan 2021 17:12:45 +0900 Subject: [PATCH 112/719] Apply more updates on #216 --- slack_bolt/app/app.py | 8 ++++++-- slack_bolt/app/async_app.py | 5 +++-- slack_bolt/listener/asyncio_runner.py | 8 ++++---- slack_bolt/listener/thread_runner.py | 8 ++++---- slack_bolt/middleware/async_custom_middleware.py | 4 ++-- slack_bolt/middleware/custom_middleware.py | 4 ++-- slack_bolt/util/utils.py | 12 ++++++++---- slack_bolt/workflows/step/async_step_middleware.py | 3 ++- slack_bolt/workflows/step/step_middleware.py | 3 ++- 9 files changed, 33 insertions(+), 22 deletions(-) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 690eb6d36..7d8678954 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -61,7 +61,11 @@ from slack_bolt.oauth.oauth_settings import OAuthSettings from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse -from slack_bolt.util.utils import create_web_client, get_boot_message +from slack_bolt.util.utils import ( + create_web_client, + get_boot_message, + get_name_for_callable, +) from slack_bolt.workflows.step import WorkflowStep, WorkflowStepMiddleware @@ -347,7 +351,7 @@ def middleware_next(): return resp for listener in self._listeners: - listener_name = listener.ack_function.__name__ + listener_name = get_name_for_callable(listener.ack_function) self._framework_logger.debug(debug_checking_listener(listener_name)) if listener.matches(req=req, resp=resp): # run all the middleware attached to this listener first diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index d08df8e2c..bf3b63b68 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -12,6 +12,7 @@ AsyncMessageListenerMatches, ) from slack_bolt.oauth.async_internals import select_consistent_installation_store +from slack_bolt.util.utils import get_name_for_callable from slack_bolt.workflows.step.async_step import AsyncWorkflowStep from slack_bolt.workflows.step.async_step_middleware import AsyncWorkflowStepMiddleware from slack_sdk.oauth.installation_store.async_installation_store import ( @@ -385,7 +386,7 @@ async def async_middleware_next(): return resp for listener in self._async_listeners: - listener_name = listener.ack_function.__name__ + listener_name = get_name_for_callable(listener.ack_function) self._framework_logger.debug(debug_checking_listener(listener_name)) if await listener.async_matches(req=req, resp=resp): # run all the middleware attached to this listener first @@ -917,7 +918,7 @@ def _register_listener( for func in functions: if not inspect.iscoroutinefunction(func): - name = func.__name__ + name = get_name_for_callable(func) raise BoltError(error_listener_function_must_be_coro_func(name)) listener_matchers = [ diff --git a/slack_bolt/listener/asyncio_runner.py b/slack_bolt/listener/asyncio_runner.py index b35f05e23..8ebcbde45 100644 --- a/slack_bolt/listener/asyncio_runner.py +++ b/slack_bolt/listener/asyncio_runner.py @@ -15,7 +15,7 @@ ) from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse -from slack_bolt.util.utils import create_copy, name_for_callable +from slack_bolt.util.utils import create_copy, get_name_for_callable class AsyncioListenerRunner: @@ -71,7 +71,7 @@ async def run( for lazy_func in listener.lazy_functions: if request.lazy_function_name: - func_name = name_for_callable(lazy_func) + func_name = get_name_for_callable(lazy_func) if func_name == request.lazy_function_name: await self.lazy_listener_runner.run( function=lazy_func, request=request @@ -128,7 +128,7 @@ async def run_ack_function_asynchronously( for lazy_func in listener.lazy_functions: if request.lazy_function_name: - func_name = name_for_callable(lazy_func) + func_name = get_name_for_callable(lazy_func) if func_name == request.lazy_function_name: await self.lazy_listener_runner.run( function=lazy_func, request=request @@ -163,7 +163,7 @@ def _start_lazy_function( self, lazy_func: Callable[..., Awaitable[None]], request: AsyncBoltRequest ) -> None: # Start a lazy function asynchronously - func_name: str = name_for_callable(lazy_func) + func_name: str = get_name_for_callable(lazy_func) self.logger.debug(debug_running_lazy_listener(func_name)) copied_request = self._build_lazy_request(request, func_name) self.lazy_listener_runner.start(function=lazy_func, request=copied_request) diff --git a/slack_bolt/listener/thread_runner.py b/slack_bolt/listener/thread_runner.py index 05601a511..8a02320e4 100644 --- a/slack_bolt/listener/thread_runner.py +++ b/slack_bolt/listener/thread_runner.py @@ -13,7 +13,7 @@ ) from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse -from slack_bolt.util.utils import create_copy, name_for_callable +from slack_bolt.util.utils import create_copy, get_name_for_callable class ThreadListenerRunner: @@ -72,7 +72,7 @@ def run( # type: ignore for lazy_func in listener.lazy_functions: if request.lazy_function_name: - func_name = name_for_callable(lazy_func) + func_name = get_name_for_callable(lazy_func) if func_name == request.lazy_function_name: self.lazy_listener_runner.run( function=lazy_func, request=request @@ -127,7 +127,7 @@ def run_ack_function_asynchronously(): for lazy_func in listener.lazy_functions: if request.lazy_function_name: - func_name = name_for_callable(lazy_func) + func_name = get_name_for_callable(lazy_func) if func_name == request.lazy_function_name: self.lazy_listener_runner.run( function=lazy_func, request=request @@ -162,7 +162,7 @@ def _start_lazy_function( self, lazy_func: Callable[..., None], request: BoltRequest ) -> None: # Start a lazy function asynchronously - func_name: str = name_for_callable(lazy_func) + func_name: str = get_name_for_callable(lazy_func) self.logger.debug(debug_running_lazy_listener(func_name)) copied_request = self._build_lazy_request(request, func_name) self.lazy_listener_runner.start(function=lazy_func, request=copied_request) diff --git a/slack_bolt/middleware/async_custom_middleware.py b/slack_bolt/middleware/async_custom_middleware.py index 5d6b6837c..ca50a23f9 100644 --- a/slack_bolt/middleware/async_custom_middleware.py +++ b/slack_bolt/middleware/async_custom_middleware.py @@ -7,7 +7,7 @@ from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse from .async_middleware import AsyncMiddleware -from slack_bolt.util.utils import name_for_callable +from slack_bolt.util.utils import get_name_for_callable class AsyncCustomMiddleware(AsyncMiddleware): @@ -46,4 +46,4 @@ async def async_process( @property def name(self) -> str: - return f"AsyncCustomMiddleware(func={name_for_callable(self.func)})" + return f"AsyncCustomMiddleware(func={get_name_for_callable(self.func)})" diff --git a/slack_bolt/middleware/custom_middleware.py b/slack_bolt/middleware/custom_middleware.py index a24513c24..bff3a4f93 100644 --- a/slack_bolt/middleware/custom_middleware.py +++ b/slack_bolt/middleware/custom_middleware.py @@ -7,7 +7,7 @@ from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse from .middleware import Middleware -from slack_bolt.util.utils import name_for_callable +from slack_bolt.util.utils import get_name_for_callable class CustomMiddleware(Middleware): @@ -42,4 +42,4 @@ def process( @property def name(self) -> str: - return f"CustomMiddleware(func={name_for_callable(self.func)})" + return f"CustomMiddleware(func={get_name_for_callable(self.func)})" diff --git a/slack_bolt/util/utils.py b/slack_bolt/util/utils.py index 272c7d382..15352367e 100644 --- a/slack_bolt/util/utils.py +++ b/slack_bolt/util/utils.py @@ -59,9 +59,13 @@ def get_boot_message(development_server: bool = False) -> str: return "⚡️ Bolt app is running!" -def name_for_callable(func: Callable) -> str: +def get_name_for_callable(func: Callable) -> str: + """Returns the name for the given Callable function object. + + :param func: either a Callable instance or a function, which as __name__ + :return: name of the given Callable object + """ if hasattr(func, "__name__"): - func_name = func.__name__ + return func.__name__ else: - func_name = f"{func.__class__.__module__}.{func.__class__.__name__}" - return func_name + return f"{func.__class__.__module__}.{func.__class__.__name__}" diff --git a/slack_bolt/workflows/step/async_step_middleware.py b/slack_bolt/workflows/step/async_step_middleware.py index c1583aa2f..cf8ceca9e 100644 --- a/slack_bolt/workflows/step/async_step_middleware.py +++ b/slack_bolt/workflows/step/async_step_middleware.py @@ -5,6 +5,7 @@ from slack_bolt.middleware.async_middleware import AsyncMiddleware from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse +from slack_bolt.util.utils import get_name_for_callable from slack_bolt.workflows.step.async_step import AsyncWorkflowStep @@ -51,6 +52,6 @@ async def _run( return await self.listener_runner.run( request=req, response=resp, - listener_name=listener.ack_function.__name__, + listener_name=get_name_for_callable(listener.ack_function), listener=listener, ) diff --git a/slack_bolt/workflows/step/step_middleware.py b/slack_bolt/workflows/step/step_middleware.py index 5a562d30b..4fa2de101 100644 --- a/slack_bolt/workflows/step/step_middleware.py +++ b/slack_bolt/workflows/step/step_middleware.py @@ -5,6 +5,7 @@ from slack_bolt.middleware import Middleware from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse +from slack_bolt.util.utils import get_name_for_callable from slack_bolt.workflows.step.step import WorkflowStep @@ -49,6 +50,6 @@ def _run( return self.listener_runner.run( request=req, response=resp, - listener_name=listener.ack_function.__name__, + listener_name=get_name_for_callable(listener.ack_function), listener=listener, ) From 01894d78d8378690b4f5777846bb0a186aba8d92 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 20 Jan 2021 17:27:53 +0900 Subject: [PATCH 113/719] version 1.2.3 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index bc86c944f..10aa336ce 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.2.2" +__version__ = "1.2.3" From cf3985d3993ec27e402d2b9f1af4677d958aea0b Mon Sep 17 00:00:00 2001 From: pdontha <32086188+pdontha@users.noreply.github.com> Date: Fri, 22 Jan 2021 14:35:28 -0800 Subject: [PATCH 114/719] [#220] Fix docs code sample for listening to events * Minor documentation correction in event examples * Added back closing tag for details --- docs/_basic/listening_events.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/_basic/listening_events.md b/docs/_basic/listening_events.md index ddfcd7536..a8779d826 100644 --- a/docs/_basic/listening_events.md +++ b/docs/_basic/listening_events.md @@ -17,8 +17,8 @@ The `event()` method requires an `eventType` of type `str`. # When a user joins the team, send a message in a predefined channel asking them to introduce themselves @app.event("team_join") def ask_for_introduction(event, say): - welcome_channel_id = "C12345"; - user_id = event["user"]["id"] + welcome_channel_id = "C12345" + user_id = event["user"] text = f"Welcome to the team, <@{user_id}>! 🎉 You can introduce yourself in this channel." say(text=text, channel=welcome_channel_id) ``` @@ -46,5 +46,4 @@ def log_message_change(logger, event): user, text = event["user"], event["text"] logger.info(f"The user {user} changed the message to {text}") ``` - From 2d9afd39e24f66e1364c0009fcaa0ce84a0844ed Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 27 Jan 2021 13:15:35 +0900 Subject: [PATCH 115/719] Use slack-sdk 3.2.1 or higher --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4e34c5811..49f31e050 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.2.0,<3.3",], + install_requires=["slack_sdk>=3.2.1,<3.3",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", From 3475ae78d9b791e9893da958aeb5498d778b1549 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 27 Jan 2021 23:02:21 +0900 Subject: [PATCH 116/719] Upgrade chalice minor version --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 49f31e050..8cd53987a 100755 --- a/setup.py +++ b/setup.py @@ -52,7 +52,8 @@ "moto<=2", # For AWS tests "bottle>=0.12,<1", "boddle>=0.2,<0.3", # For Bottle app tests - "chalice>=1,<2", + # TODO: https://github.com/aws/chalice/issues/1627 + "chalice>=1.22,<2", "click>=7,<8", # for chalice "CherryPy>=18,<19", "Django>=3,<4", From 6ce7bdc6c6d90efa8d5ed854cde9738e101f6890 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 27 Jan 2021 16:26:59 +0900 Subject: [PATCH 117/719] Fix #157 Improve the stability of API mock servers in unit tests --- .github/workflows/ci-build.yml | 48 +++++- tests/adapter_tests/aws/__init__.py | 0 .../{ => aws}/test_aws_chalice.py | 9 +- .../{ => aws}/test_aws_lambda.py | 15 +- .../{ => aws}/test_lambda_s3_oauth_flow.py | 0 tests/adapter_tests/bottle/__init__.py | 0 .../adapter_tests/{ => bottle}/test_bottle.py | 7 +- .../{ => bottle}/test_bottle_oauth.py | 0 tests/adapter_tests/cherrypy/__init__.py | 0 .../{ => cherrypy}/test_cherrypy.py | 0 .../{ => cherrypy}/test_cherrypy_oauth.py | 0 tests/adapter_tests/django/__init__.py | 0 .../adapter_tests/{ => django}/test_django.py | 11 +- .../{ => django}/test_django_settings.py | 0 tests/adapter_tests/falcon/__init__.py | 0 .../adapter_tests/{ => falcon}/test_falcon.py | 7 +- tests/adapter_tests/flask/__init__.py | 0 tests/adapter_tests/{ => flask}/test_flask.py | 7 +- tests/adapter_tests/pyramid/__init__.py | 0 .../{ => pyramid}/test_pyramid.py | 7 +- .../socket_mode/mock_socket_mode_server.py | 95 ++++++++++- .../socket_mode/mock_web_api_server.py | 134 ++++++++++++++- .../socket_mode/test_interactions_builtin.py | 11 +- .../test_interactions_web_client.py | 11 +- tests/adapter_tests/starlette/__init__.py | 0 .../{ => starlette}/test_fastapi.py | 7 +- .../{ => starlette}/test_starlette.py | 7 +- tests/adapter_tests/tornado/__init__.py | 0 .../{ => tornado}/test_tornado.py | 16 +- .../{ => tornado}/test_tornado_oauth.py | 9 +- .../socket_mode/test_async_aiohttp.py | 9 +- .../socket_mode/test_async_websockets.py | 9 +- .../adapter_tests_async/test_async_fastapi.py | 7 +- tests/adapter_tests_async/test_async_sanic.py | 7 +- .../test_async_starlette.py | 7 +- tests/mock_web_api_server.py | 157 +++++++++++++++++- tests/scenario_tests/test_app_bot_only.py | 15 +- .../test_app_using_methods_in_class.py | 3 +- .../scenario_tests/test_attachment_actions.py | 21 +-- tests/scenario_tests/test_authorize.py | 7 +- tests/scenario_tests/test_block_actions.py | 21 +-- tests/scenario_tests/test_block_suggestion.py | 23 +-- tests/scenario_tests/test_dialogs.py | 67 ++++---- tests/scenario_tests/test_events.py | 15 +- tests/scenario_tests/test_events_org_apps.py | 7 +- .../test_events_shared_channels.py | 13 +- .../scenario_tests/test_events_socket_mode.py | 15 +- tests/scenario_tests/test_message.py | 13 +- tests/scenario_tests/test_message_bot.py | 3 +- tests/scenario_tests/test_middleware.py | 7 +- tests/scenario_tests/test_shortcut.py | 31 ++-- tests/scenario_tests/test_slash_command.py | 9 +- tests/scenario_tests/test_view_closed.py | 19 ++- tests/scenario_tests/test_view_submission.py | 15 +- tests/scenario_tests/test_workflow_steps.py | 13 +- .../scenario_tests_async/test_app_bot_only.py | 11 +- .../test_app_using_methods_in_class.py | 3 +- .../test_attachment_actions.py | 23 +-- tests/scenario_tests_async/test_authorize.py | 7 +- .../test_block_actions.py | 23 +-- .../test_block_suggestion.py | 23 +-- tests/scenario_tests_async/test_dialogs.py | 67 ++++---- tests/scenario_tests_async/test_events.py | 15 +- .../test_events_org_apps.py | 7 +- .../test_events_shared_channels.py | 15 +- .../test_events_socket_mode.py | 15 +- tests/scenario_tests_async/test_message.py | 13 +- .../scenario_tests_async/test_message_bot.py | 3 +- tests/scenario_tests_async/test_middleware.py | 5 +- tests/scenario_tests_async/test_shortcut.py | 31 ++-- .../test_slash_command.py | 9 +- .../scenario_tests_async/test_view_closed.py | 19 ++- .../test_view_submission.py | 15 +- .../test_workflow_steps.py | 13 +- .../authorization/test_authorize.py | 25 +-- tests/slack_bolt/oauth/test_oauth_flow.py | 3 +- .../authorization/test_async_authorize.py | 25 +-- .../oauth/test_async_oauth_flow.py | 3 +- tests/utils.py | 15 ++ 79 files changed, 872 insertions(+), 430 deletions(-) create mode 100644 tests/adapter_tests/aws/__init__.py rename tests/adapter_tests/{ => aws}/test_aws_chalice.py (97%) rename tests/adapter_tests/{ => aws}/test_aws_lambda.py (95%) rename tests/adapter_tests/{ => aws}/test_lambda_s3_oauth_flow.py (100%) create mode 100644 tests/adapter_tests/bottle/__init__.py rename tests/adapter_tests/{ => bottle}/test_bottle.py (96%) rename tests/adapter_tests/{ => bottle}/test_bottle_oauth.py (100%) create mode 100644 tests/adapter_tests/cherrypy/__init__.py rename tests/adapter_tests/{ => cherrypy}/test_cherrypy.py (100%) rename tests/adapter_tests/{ => cherrypy}/test_cherrypy_oauth.py (100%) create mode 100644 tests/adapter_tests/django/__init__.py rename tests/adapter_tests/{ => django}/test_django.py (95%) rename tests/adapter_tests/{ => django}/test_django_settings.py (100%) create mode 100644 tests/adapter_tests/falcon/__init__.py rename tests/adapter_tests/{ => falcon}/test_falcon.py (97%) create mode 100644 tests/adapter_tests/flask/__init__.py rename tests/adapter_tests/{ => flask}/test_flask.py (96%) create mode 100644 tests/adapter_tests/pyramid/__init__.py rename tests/adapter_tests/{ => pyramid}/test_pyramid.py (97%) create mode 100644 tests/adapter_tests/starlette/__init__.py rename tests/adapter_tests/{ => starlette}/test_fastapi.py (97%) rename tests/adapter_tests/{ => starlette}/test_starlette.py (97%) create mode 100644 tests/adapter_tests/tornado/__init__.py rename tests/adapter_tests/{ => tornado}/test_tornado.py (93%) rename tests/adapter_tests/{ => tornado}/test_tornado_oauth.py (84%) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 351f9257f..71e345620 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -9,12 +9,15 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 timeout-minutes: 10 strategy: matrix: python-version: ['3.6', '3.7', '3.8', '3.9'] - + env: + # default: multiprocessing + # threading is more stable on GitHub Actions + BOLT_PYTHON_MOCK_SERVER_MODE: threading steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -30,10 +33,41 @@ jobs: run: | pytest tests/slack_bolt/ pytest tests/scenario_tests/ - - name: Run tests for adapters + - name: Run tests for Socket Mode adapters run: | pip install -e ".[adapter]" - pytest tests/adapter_tests/ + pytest tests/adapter_tests/socket_mode/ + - name: Run tests for HTTP Mode adapters (AWS) + run: | + pytest tests/adapter_tests/aws/ + - name: Run tests for HTTP Mode adapters (Bottle) + run: | + pytest tests/adapter_tests/bottle/ + - name: Run tests for HTTP Mode adapters (CherryPy) + run: | + pytest tests/adapter_tests/cherrypy/ + - name: Run tests for HTTP Mode adapters (Django) + run: | + pytest tests/adapter_tests/django/ + - name: Run tests for HTTP Mode adapters (Falcon) + run: | + pytest tests/adapter_tests/falcon/ + - name: Run tests for HTTP Mode adapters (Flask) + run: | + pytest tests/adapter_tests/flask/ + - name: Run tests for HTTP Mode adapters (Pyramid) + run: | + pytest tests/adapter_tests/pyramid/ + - name: Run tests for HTTP Mode adapters (Starlette) + run: | + pytest tests/adapter_tests/starlette/ + - name: Run tests for HTTP Mode adapters (Tornado) + run: | + pytest tests/adapter_tests/tornado/ + - name: Run tests for HTTP Mode adapters (asyncio-based libraries) + run: | + pip install -e ".[async]" + pytest tests/adapter_tests_async/ - name: Run pytype verification (3.8 only) run: | python_version=`python -V` @@ -42,12 +76,10 @@ jobs: pip install -e ".[adapter]" pip install "pytype" && pytype slack_bolt/ fi - - name: Run all tests for codecov (3.6 only) + - name: Run all tests for codecov (3.9 only) run: | python_version=`python -V` - # TODO: As Python 3.6 works the most stably on GitHub Actions, - # we use the version for code coverage and async tests - if [ ${python_version:7:3} == "3.6" ]; then + if [ ${python_version:7:3} == "3.9" ]; then pip install -e ".[async]" pip install -e ".[testing]" pytest --cov=slack_bolt/ && bash <(curl -s https://codecov.io/bash) diff --git a/tests/adapter_tests/aws/__init__.py b/tests/adapter_tests/aws/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/adapter_tests/test_aws_chalice.py b/tests/adapter_tests/aws/test_aws_chalice.py similarity index 97% rename from tests/adapter_tests/test_aws_chalice.py rename to tests/adapter_tests/aws/test_aws_chalice.py index ee80f62dd..bf65601d0 100644 --- a/tests/adapter_tests/test_aws_chalice.py +++ b/tests/adapter_tests/aws/test_aws_chalice.py @@ -19,6 +19,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -110,7 +111,7 @@ def events() -> Response: headers=self.build_headers(timestamp, body), ) assert response["statusCode"] == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_shortcuts(self): app = App( @@ -157,7 +158,7 @@ def events() -> Response: headers=self.build_headers(timestamp, body), ) assert response["statusCode"] == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_commands(self): app = App( @@ -204,7 +205,7 @@ def events() -> Response: headers=self.build_headers(timestamp, body), ) assert response["statusCode"] == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_lazy_listeners(self): app = App( @@ -261,7 +262,7 @@ def say_it(say): ) response: Response = slack_handler.handle(request) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) assert self.mock_received_requests["/chat.postMessage"] == 1 def test_oauth(self): diff --git a/tests/adapter_tests/test_aws_lambda.py b/tests/adapter_tests/aws/test_aws_lambda.py similarity index 95% rename from tests/adapter_tests/test_aws_lambda.py rename to tests/adapter_tests/aws/test_aws_lambda.py index 0c05e07d6..4c6a1bb14 100644 --- a/tests/adapter_tests/test_aws_lambda.py +++ b/tests/adapter_tests/aws/test_aws_lambda.py @@ -14,6 +14,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -123,7 +124,7 @@ def event_handler(): } response = SlackRequestHandler(app).handle(event, self.context) assert response["statusCode"] == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) event = { "body": body, @@ -134,7 +135,7 @@ def event_handler(): } response = SlackRequestHandler(app).handle(event, self.context) assert response["statusCode"] == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) @mock_lambda def test_shortcuts(self): @@ -173,7 +174,7 @@ def shortcut_handler(ack): } response = SlackRequestHandler(app).handle(event, self.context) assert response["statusCode"] == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) event = { "body": body, @@ -184,7 +185,7 @@ def shortcut_handler(ack): } response = SlackRequestHandler(app).handle(event, self.context) assert response["statusCode"] == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) @mock_lambda def test_commands(self): @@ -223,7 +224,7 @@ def command_handler(ack): } response = SlackRequestHandler(app).handle(event, self.context) assert response["statusCode"] == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) event = { "body": body, @@ -234,7 +235,7 @@ def command_handler(ack): } response = SlackRequestHandler(app).handle(event, self.context) assert response["statusCode"] == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) @mock_lambda def test_lazy_listeners(self): @@ -279,7 +280,7 @@ def say_it(say): } response = SlackRequestHandler(app).handle(event, self.context) assert response["statusCode"] == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) assert self.mock_received_requests["/chat.postMessage"] == 1 @mock_lambda diff --git a/tests/adapter_tests/test_lambda_s3_oauth_flow.py b/tests/adapter_tests/aws/test_lambda_s3_oauth_flow.py similarity index 100% rename from tests/adapter_tests/test_lambda_s3_oauth_flow.py rename to tests/adapter_tests/aws/test_lambda_s3_oauth_flow.py diff --git a/tests/adapter_tests/bottle/__init__.py b/tests/adapter_tests/bottle/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/adapter_tests/test_bottle.py b/tests/adapter_tests/bottle/test_bottle.py similarity index 96% rename from tests/adapter_tests/test_bottle.py rename to tests/adapter_tests/bottle/test_bottle.py index 2cfd5a7fb..bd37fcc74 100644 --- a/tests/adapter_tests/test_bottle.py +++ b/tests/adapter_tests/bottle/test_bottle.py @@ -11,6 +11,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -109,7 +110,7 @@ def test_events(self): response_body = slack_events() assert response.status_code == 200 assert response_body == "" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_shortcuts(self): input = { @@ -138,7 +139,7 @@ def test_shortcuts(self): response_body = slack_events() assert response.status_code == 200 assert response_body == "" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_commands(self): input = ( @@ -167,4 +168,4 @@ def test_commands(self): response_body = slack_events() assert response.status_code == 200 assert response_body == "" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) diff --git a/tests/adapter_tests/test_bottle_oauth.py b/tests/adapter_tests/bottle/test_bottle_oauth.py similarity index 100% rename from tests/adapter_tests/test_bottle_oauth.py rename to tests/adapter_tests/bottle/test_bottle_oauth.py diff --git a/tests/adapter_tests/cherrypy/__init__.py b/tests/adapter_tests/cherrypy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/adapter_tests/test_cherrypy.py b/tests/adapter_tests/cherrypy/test_cherrypy.py similarity index 100% rename from tests/adapter_tests/test_cherrypy.py rename to tests/adapter_tests/cherrypy/test_cherrypy.py diff --git a/tests/adapter_tests/test_cherrypy_oauth.py b/tests/adapter_tests/cherrypy/test_cherrypy_oauth.py similarity index 100% rename from tests/adapter_tests/test_cherrypy_oauth.py rename to tests/adapter_tests/cherrypy/test_cherrypy_oauth.py diff --git a/tests/adapter_tests/django/__init__.py b/tests/adapter_tests/django/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/adapter_tests/test_django.py b/tests/adapter_tests/django/test_django.py similarity index 95% rename from tests/adapter_tests/test_django.py rename to tests/adapter_tests/django/test_django.py index d1510594f..c8254c52c 100644 --- a/tests/adapter_tests/test_django.py +++ b/tests/adapter_tests/django/test_django.py @@ -14,6 +14,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -28,7 +29,9 @@ class TestDjango(TestCase): base_url=mock_api_server_base_url, ) - os.environ["DJANGO_SETTINGS_MODULE"] = "tests.adapter_tests.test_django_settings" + os.environ[ + "DJANGO_SETTINGS_MODULE" + ] = "tests.adapter_tests.django.test_django_settings" rf = RequestFactory() def setUp(self): @@ -91,7 +94,7 @@ def event_handler(): response = SlackRequestHandler(app).handle(request) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_shortcuts(self): app = App( @@ -130,7 +133,7 @@ def shortcut_handler(ack): response = SlackRequestHandler(app).handle(request) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_commands(self): app = App( @@ -169,7 +172,7 @@ def command_handler(ack): response = SlackRequestHandler(app).handle(request) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_oauth(self): app = App( diff --git a/tests/adapter_tests/test_django_settings.py b/tests/adapter_tests/django/test_django_settings.py similarity index 100% rename from tests/adapter_tests/test_django_settings.py rename to tests/adapter_tests/django/test_django_settings.py diff --git a/tests/adapter_tests/falcon/__init__.py b/tests/adapter_tests/falcon/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/adapter_tests/test_falcon.py b/tests/adapter_tests/falcon/test_falcon.py similarity index 97% rename from tests/adapter_tests/test_falcon.py rename to tests/adapter_tests/falcon/test_falcon.py index 263a67275..2cd9cdd59 100644 --- a/tests/adapter_tests/test_falcon.py +++ b/tests/adapter_tests/falcon/test_falcon.py @@ -13,6 +13,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -97,7 +98,7 @@ def event_handler(): headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_shortcuts(self): app = App( @@ -138,7 +139,7 @@ def shortcut_handler(ack): headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_commands(self): app = App( @@ -179,7 +180,7 @@ def command_handler(ack): headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_oauth(self): app = App( diff --git a/tests/adapter_tests/flask/__init__.py b/tests/adapter_tests/flask/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/adapter_tests/test_flask.py b/tests/adapter_tests/flask/test_flask.py similarity index 96% rename from tests/adapter_tests/test_flask.py rename to tests/adapter_tests/flask/test_flask.py index c6f320f6d..b8c198e68 100644 --- a/tests/adapter_tests/test_flask.py +++ b/tests/adapter_tests/flask/test_flask.py @@ -12,6 +12,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -98,7 +99,7 @@ def endpoint(): headers=self.build_headers(timestamp, body), ) assert rv.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_shortcuts(self): app = App( @@ -141,7 +142,7 @@ def endpoint(): headers=self.build_headers(timestamp, body), ) assert rv.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_commands(self): app = App( @@ -184,7 +185,7 @@ def endpoint(): headers=self.build_headers(timestamp, body), ) assert rv.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_oauth(self): app = App( diff --git a/tests/adapter_tests/pyramid/__init__.py b/tests/adapter_tests/pyramid/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/adapter_tests/test_pyramid.py b/tests/adapter_tests/pyramid/test_pyramid.py similarity index 97% rename from tests/adapter_tests/test_pyramid.py rename to tests/adapter_tests/pyramid/test_pyramid.py index bc88b37d0..7f487ce65 100644 --- a/tests/adapter_tests/test_pyramid.py +++ b/tests/adapter_tests/pyramid/test_pyramid.py @@ -15,6 +15,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -97,7 +98,7 @@ def event_handler(): request.headers = self.build_headers(timestamp, body) response: Response = SlackRequestHandler(app).handle(request) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_shortcuts(self): app = App( @@ -134,7 +135,7 @@ def shortcut_handler(ack): request.headers = self.build_headers(timestamp, body) response: Response = SlackRequestHandler(app).handle(request) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_commands(self): app = App( @@ -171,7 +172,7 @@ def command_handler(ack): request.headers = self.build_headers(timestamp, body) response: Response = SlackRequestHandler(app).handle(request) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_oauth(self): app = App( diff --git a/tests/adapter_tests/socket_mode/mock_socket_mode_server.py b/tests/adapter_tests/socket_mode/mock_socket_mode_server.py index 2b778910c..68e84db43 100644 --- a/tests/adapter_tests/socket_mode/mock_socket_mode_server.py +++ b/tests/adapter_tests/socket_mode/mock_socket_mode_server.py @@ -1,5 +1,12 @@ import logging -from typing import List +import sys +import threading +import time +from multiprocessing.context import Process +from typing import List, Optional +from unittest import TestCase + +from tests.utils import get_mock_server_mode socket_mode_envelopes = [ """{"envelope_id":"57d6a792-4d35-4d0b-b6aa-3361493e1caf","payload":{"type":"shortcut","token":"xxx","action_ts":"1610198080.300836","team":{"id":"T111","domain":"seratch"},"user":{"id":"U111","username":"seratch","team_id":"T111"},"is_enterprise_install":false,"enterprise":null,"callback_id":"do-something","trigger_id":"111.222.xxx"},"type":"interactive","accepts_response_payload":false}""", @@ -11,8 +18,8 @@ from flask_sockets import Sockets -def start_socket_mode_server(self, port: int): - def _start_socket_mode_server(): +def start_thread_socket_mode_server(test: TestCase, port: int): + def _start_thread_socket_mode_server(): logger = logging.getLogger(__name__) app: Flask = Flask(__name__) sockets: Sockets = Sockets(app) @@ -36,7 +43,85 @@ def link(ws): from geventwebsocket.handler import WebSocketHandler server = pywsgi.WSGIServer(("", port), app, handler_class=WebSocketHandler) - self.server = server + test.server = server server.serve_forever(stop_timeout=1) - return _start_socket_mode_server + return _start_thread_socket_mode_server + + +def start_process_socket_mode_server(port: int): + logger = logging.getLogger(__name__) + app: Flask = Flask(__name__) + sockets: Sockets = Sockets(app) + + envelopes_to_consume: List[str] = list(socket_mode_envelopes) + + @sockets.route("/link") + def link(ws): + while not ws.closed: + message = ws.read_message() + if message is not None: + if len(envelopes_to_consume) > 0: + e = envelopes_to_consume.pop(0) + logger.debug(f"Send an envelope: {e}") + ws.send(e) + + logger.debug(f"Server received a message: {message}") + ws.send(message) + + from gevent import pywsgi + from geventwebsocket.handler import WebSocketHandler + + server = pywsgi.WSGIServer(("", port), app, handler_class=WebSocketHandler) + server.serve_forever(stop_timeout=1) + + +def start_socket_mode_server(test, port: int): + if get_mock_server_mode() == "threading": + test.sm_thread = threading.Thread( + target=start_thread_socket_mode_server(test, port) + ) + test.sm_thread.daemon = True + test.sm_thread.start() + time.sleep(2) # wait for the server + else: + test.sm_process = Process( + target=start_process_socket_mode_server, kwargs={"port": port} + ) + test.sm_process.start() + + +def stop_socket_mode_server(test): + if get_mock_server_mode() == "threading": + print(test) + test.server.stop() + test.server.close() + else: + # terminate the process + test.sm_process.terminate() + test.sm_process.join() + # Python 3.6 does not have these methods + if sys.version_info.major == 3 and sys.version_info.minor > 6: + # cleanup the process's resources + test.sm_process.kill() + test.sm_process.close() + + test.sm_process = None + + +async def stop_socket_mode_server_async(test: TestCase): + if get_mock_server_mode() == "threading": + test.server.stop() + test.server.close() + else: + # terminate the process + test.sm_process.terminate() + test.sm_process.join() + + # Python 3.6 does not have these methods + if sys.version_info.major == 3 and sys.version_info.minor > 6: + # cleanup the process's resources + test.sm_process.kill() + test.sm_process.close() + + test.sm_process = None diff --git a/tests/adapter_tests/socket_mode/mock_web_api_server.py b/tests/adapter_tests/socket_mode/mock_web_api_server.py index ac30148d7..05e6b205e 100644 --- a/tests/adapter_tests/socket_mode/mock_web_api_server.py +++ b/tests/adapter_tests/socket_mode/mock_web_api_server.py @@ -1,12 +1,18 @@ import json import logging import re +import sys import threading +import time from http import HTTPStatus from http.server import HTTPServer, SimpleHTTPRequestHandler +from multiprocessing.context import Process from typing import Type from unittest import TestCase from urllib.parse import urlparse, parse_qs +from urllib.request import Request, urlopen + +from tests.utils import get_mock_server_mode class MockHandler(SimpleHTTPRequestHandler): @@ -48,6 +54,12 @@ def set_common_headers(self): def _handle(self): try: + if self.path == "/received_requests.json": + self.send_response(200) + self.set_common_headers() + self.wfile.write(json.dumps(self.received_requests).encode("utf-8")) + return + if self.is_valid_token() and self.is_valid_user_agent(): parsed_path = urlparse(self.path) @@ -114,6 +126,63 @@ def do_POST(self): self._handle() +# +# multiprocessing +# + + +class MockServerProcessTarget: + def __init__(self, handler: Type[SimpleHTTPRequestHandler] = MockHandler): + self.handler = handler + + def run(self): + self.handler.received_requests = {} + self.server = HTTPServer(("localhost", 8888), self.handler) + try: + self.server.serve_forever(0.05) + finally: + self.server.server_close() + + def stop(self): + self.handler.received_requests = {} + self.server.shutdown() + self.join() + + +class MonitorThread(threading.Thread): + def __init__( + self, test: TestCase, handler: Type[SimpleHTTPRequestHandler] = MockHandler + ): + threading.Thread.__init__(self, daemon=True) + self.handler = handler + self.test = test + self.test.mock_received_requests = None + self.is_running = True + + def run(self) -> None: + while self.is_running: + try: + req = Request(f"{self.test.server_url}/received_requests.json") + resp = urlopen(req, timeout=1) + self.test.mock_received_requests = json.loads( + resp.read().decode("utf-8") + ) + except Exception as e: + # skip logging for the initial request + if self.test.mock_received_requests is not None: + logging.getLogger(__name__).exception(e) + time.sleep(0.01) + + def stop(self): + self.is_running = False + self.join() + + +# +# threading +# + + class MockServerThread(threading.Thread): def __init__( self, test: TestCase, handler: Type[SimpleHTTPRequestHandler] = MockHandler @@ -140,14 +209,67 @@ def stop(self): def setup_mock_web_api_server(test: TestCase): - test.server_started = threading.Event() - test.thread = MockServerThread(test) - test.thread.start() + if get_mock_server_mode() == "threading": + test.server_started = threading.Event() + test.thread = MockServerThread(test) + test.thread.start() + test.server_started.wait() + else: + # start a mock server as another process + target = MockServerProcessTarget() + test.server_url = "http://localhost:8888" + test.host, test.port = "localhost", 8888 + test.process = Process(target=target.run, daemon=True) + test.process.start() + time.sleep(0.1) - test.server_started.wait() + # start a thread in the current process + # this thread fetches mock_received_requests from the remote process + test.monitor_thread = MonitorThread(test) + test.monitor_thread.start() + count = 0 + # wait until the first successful data retrieval + while test.mock_received_requests is None: + time.sleep(0.01) + count += 1 + if count >= 100: + raise Exception("The mock server is not yet running!") def cleanup_mock_web_api_server(test: TestCase): - test.thread.stop() + if get_mock_server_mode() == "threading": + test.thread.stop() + test.thread = None + else: + # stop the thread to fetch mock_received_requests from the remote process + test.monitor_thread.stop() + + # terminate the process + test.process.terminate() + test.process.join() + + # Python 3.6 does not have these methods + if sys.version_info.major == 3 and sys.version_info.minor > 6: + # cleanup the process's resources + test.process.kill() + test.process.close() + + test.process = None + + +def assert_auth_test_count(test: TestCase, expected_count: int): + time.sleep(0.1) + retry_count = 0 + error = None + while retry_count < 3: + try: + test.mock_received_requests["/auth.test"] == expected_count + break + except Exception as e: + error = e + retry_count += 1 + # waiting for mock_received_requests updates + time.sleep(0.1) - test.thread = None + if error is not None: + raise error diff --git a/tests/adapter_tests/socket_mode/test_interactions_builtin.py b/tests/adapter_tests/socket_mode/test_interactions_builtin.py index cee5e3248..4730ece81 100644 --- a/tests/adapter_tests/socket_mode/test_interactions_builtin.py +++ b/tests/adapter_tests/socket_mode/test_interactions_builtin.py @@ -1,6 +1,5 @@ import logging import time -from threading import Thread from slack_sdk import WebClient @@ -8,6 +7,7 @@ from slack_bolt.adapter.socket_mode import SocketModeHandler from .mock_socket_mode_server import ( start_socket_mode_server, + stop_socket_mode_server, ) from .mock_web_api_server import ( setup_mock_web_api_server, @@ -26,16 +26,15 @@ def setup_method(self): token="xoxb-api_test", base_url="http://localhost:8888", ) + start_socket_mode_server(self, 3011) + time.sleep(2) # wait for the server def teardown_method(self): cleanup_mock_web_api_server(self) restore_os_env(self.old_os_env) + stop_socket_mode_server(self) def test_interactions(self): - t = Thread(target=start_socket_mode_server(self, 3011)) - t.daemon = True - t.start() - time.sleep(2) # wait for the server app = App(client=self.web_client) @@ -71,5 +70,3 @@ def command_handler(ack): assert result["command"] is True finally: handler.client.close() - self.server.stop() - self.server.close() diff --git a/tests/adapter_tests/socket_mode/test_interactions_web_client.py b/tests/adapter_tests/socket_mode/test_interactions_web_client.py index 7fd3ca0fc..b6f8d27f3 100644 --- a/tests/adapter_tests/socket_mode/test_interactions_web_client.py +++ b/tests/adapter_tests/socket_mode/test_interactions_web_client.py @@ -1,6 +1,5 @@ import logging import time -from threading import Thread from slack_sdk import WebClient @@ -8,6 +7,7 @@ from slack_bolt.adapter.socket_mode.websocket_client import SocketModeHandler from .mock_socket_mode_server import ( start_socket_mode_server, + stop_socket_mode_server, ) from .mock_web_api_server import ( setup_mock_web_api_server, @@ -26,16 +26,15 @@ def setup_method(self): token="xoxb-api_test", base_url="http://localhost:8888", ) + start_socket_mode_server(self, 3012) + time.sleep(2) # wait for the server def teardown_method(self): cleanup_mock_web_api_server(self) restore_os_env(self.old_os_env) + stop_socket_mode_server(self) def test_interactions(self): - t = Thread(target=start_socket_mode_server(self, 3012)) - t.daemon = True - t.start() - time.sleep(1) # wait for the server app = App(client=self.web_client) @@ -70,5 +69,3 @@ def command_handler(ack): assert result["command"] is True finally: handler.client.close() - self.server.stop() - self.server.close() diff --git a/tests/adapter_tests/starlette/__init__.py b/tests/adapter_tests/starlette/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/adapter_tests/test_fastapi.py b/tests/adapter_tests/starlette/test_fastapi.py similarity index 97% rename from tests/adapter_tests/test_fastapi.py rename to tests/adapter_tests/starlette/test_fastapi.py index 3e94542d0..29282bc24 100644 --- a/tests/adapter_tests/test_fastapi.py +++ b/tests/adapter_tests/starlette/test_fastapi.py @@ -14,6 +14,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -101,7 +102,7 @@ async def endpoint(req: Request): headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_shortcuts(self): app = App( @@ -145,7 +146,7 @@ async def endpoint(req: Request): headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_commands(self): app = App( @@ -189,7 +190,7 @@ async def endpoint(req: Request): headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_oauth(self): app = App( diff --git a/tests/adapter_tests/test_starlette.py b/tests/adapter_tests/starlette/test_starlette.py similarity index 97% rename from tests/adapter_tests/test_starlette.py rename to tests/adapter_tests/starlette/test_starlette.py index 4dc4059f9..033d80f51 100644 --- a/tests/adapter_tests/test_starlette.py +++ b/tests/adapter_tests/starlette/test_starlette.py @@ -15,6 +15,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -104,7 +105,7 @@ async def endpoint(req: Request): headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_shortcuts(self): app = App( @@ -150,7 +151,7 @@ async def endpoint(req: Request): headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_commands(self): app = App( @@ -196,7 +197,7 @@ async def endpoint(req: Request): headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_oauth(self): app = App( diff --git a/tests/adapter_tests/tornado/__init__.py b/tests/adapter_tests/tornado/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/adapter_tests/test_tornado.py b/tests/adapter_tests/tornado/test_tornado.py similarity index 93% rename from tests/adapter_tests/test_tornado.py rename to tests/adapter_tests/tornado/test_tornado.py index 87c4ccc09..e8dc5f5fa 100644 --- a/tests/adapter_tests/test_tornado.py +++ b/tests/adapter_tests/tornado/test_tornado.py @@ -2,11 +2,10 @@ from time import time from urllib.parse import quote -import tornado from slack_sdk.signature import SignatureVerifier from slack_sdk.web import WebClient from tornado.httpclient import HTTPRequest, HTTPResponse -from tornado.testing import AsyncHTTPTestCase +from tornado.testing import AsyncHTTPTestCase, gen_test from tornado.web import Application from slack_bolt.adapter.tornado import SlackEventsHandler @@ -14,6 +13,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -81,7 +81,7 @@ def build_headers(self, timestamp: str, body: str): "x-slack-request-timestamp": timestamp, } - @tornado.testing.gen_test + @gen_test async def test_events(self): input = { "token": "verification_token", @@ -113,9 +113,9 @@ async def test_events(self): ) response: HTTPResponse = await self.http_client.fetch(request) assert response.code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) - @tornado.testing.gen_test + @gen_test async def test_shortcuts(self): input = { "type": "shortcut", @@ -142,9 +142,9 @@ async def test_shortcuts(self): ) response: HTTPResponse = await self.http_client.fetch(request) assert response.code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) - @tornado.testing.gen_test + @gen_test async def test_commands(self): input = ( "token=verification_token" @@ -171,4 +171,4 @@ async def test_commands(self): ) response: HTTPResponse = await self.http_client.fetch(request) assert response.code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) diff --git a/tests/adapter_tests/test_tornado_oauth.py b/tests/adapter_tests/tornado/test_tornado_oauth.py similarity index 84% rename from tests/adapter_tests/test_tornado_oauth.py rename to tests/adapter_tests/tornado/test_tornado_oauth.py index ae98a6ac6..5fbd25aa9 100644 --- a/tests/adapter_tests/test_tornado_oauth.py +++ b/tests/adapter_tests/tornado/test_tornado_oauth.py @@ -1,6 +1,5 @@ -import tornado -from tornado.httpclient import HTTPRequest, HTTPResponse -from tornado.testing import AsyncHTTPTestCase +from tornado.httpclient import HTTPRequest, HTTPResponse, HTTPClientError +from tornado.testing import AsyncHTTPTestCase, gen_test from tornado.web import Application from slack_bolt.adapter.tornado import SlackOAuthHandler @@ -32,7 +31,7 @@ def tearDown(self): AsyncHTTPTestCase.tearDown(self) restore_os_env(self.old_os_env) - @tornado.testing.gen_test + @gen_test async def test_oauth(self): request = HTTPRequest( url=self.get_url("/slack/install"), method="GET", follow_redirects=False @@ -40,5 +39,5 @@ async def test_oauth(self): try: response: HTTPResponse = await self.http_client.fetch(request) assert response.code == 200 - except tornado.httpclient.HTTPClientError as e: + except HTTPClientError as e: assert e.code == 200 diff --git a/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py b/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py index c8eb5b5ab..1877514e0 100644 --- a/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py +++ b/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py @@ -1,5 +1,4 @@ import asyncio -from threading import Thread import pytest from slack_sdk.web.async_client import AsyncWebClient @@ -13,6 +12,7 @@ from tests.utils import remove_os_env_temporarily, restore_os_env from ...adapter_tests.socket_mode.mock_socket_mode_server import ( start_socket_mode_server, + stop_socket_mode_server_async, ) @@ -38,9 +38,7 @@ def event_loop(self): @pytest.mark.asyncio async def test_events(self): - t = Thread(target=start_socket_mode_server(self, 3021)) - t.daemon = True - t.start() + start_socket_mode_server(self, 3021) await asyncio.sleep(1) # wait for the server app = AsyncApp(client=self.web_client) @@ -74,5 +72,4 @@ async def command_handler(ack): assert result["command"] is True finally: await handler.client.close() - self.server.stop() - self.server.close() + await stop_socket_mode_server_async(self) diff --git a/tests/adapter_tests_async/socket_mode/test_async_websockets.py b/tests/adapter_tests_async/socket_mode/test_async_websockets.py index c47d2b7fe..b8574e623 100644 --- a/tests/adapter_tests_async/socket_mode/test_async_websockets.py +++ b/tests/adapter_tests_async/socket_mode/test_async_websockets.py @@ -1,5 +1,4 @@ import asyncio -from threading import Thread import pytest from slack_sdk.web.async_client import AsyncWebClient @@ -13,6 +12,7 @@ from tests.utils import remove_os_env_temporarily, restore_os_env from ...adapter_tests.socket_mode.mock_socket_mode_server import ( start_socket_mode_server, + stop_socket_mode_server_async, ) @@ -38,9 +38,7 @@ def event_loop(self): @pytest.mark.asyncio async def test_events(self): - t = Thread(target=start_socket_mode_server(self, 3022)) - t.daemon = True - t.start() + start_socket_mode_server(self, 3022) await asyncio.sleep(1) # wait for the server app = AsyncApp(client=self.web_client) @@ -74,5 +72,4 @@ async def command_handler(ack): assert result["command"] is True finally: await handler.client.close() - self.server.stop() - self.server.close() + await stop_socket_mode_server_async(self) diff --git a/tests/adapter_tests_async/test_async_fastapi.py b/tests/adapter_tests_async/test_async_fastapi.py index f9c2c842b..a0ebeb81f 100644 --- a/tests/adapter_tests_async/test_async_fastapi.py +++ b/tests/adapter_tests_async/test_async_fastapi.py @@ -14,6 +14,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -101,7 +102,7 @@ async def endpoint(req: Request): headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_shortcuts(self): app = AsyncApp( @@ -145,7 +146,7 @@ async def endpoint(req: Request): headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_commands(self): app = AsyncApp( @@ -189,7 +190,7 @@ async def endpoint(req: Request): headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_oauth(self): app = AsyncApp( diff --git a/tests/adapter_tests_async/test_async_sanic.py b/tests/adapter_tests_async/test_async_sanic.py index 38f0fbb00..6bdb62ab4 100644 --- a/tests/adapter_tests_async/test_async_sanic.py +++ b/tests/adapter_tests_async/test_async_sanic.py @@ -15,6 +15,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -110,7 +111,7 @@ async def endpoint(req: Request): headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) @pytest.mark.asyncio async def test_shortcuts(self): @@ -154,7 +155,7 @@ async def endpoint(req: Request): headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) @pytest.mark.asyncio async def test_commands(self): @@ -198,7 +199,7 @@ async def endpoint(req: Request): headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) @pytest.mark.asyncio async def test_oauth(self): diff --git a/tests/adapter_tests_async/test_async_starlette.py b/tests/adapter_tests_async/test_async_starlette.py index 3faba8b12..70a8f670a 100644 --- a/tests/adapter_tests_async/test_async_starlette.py +++ b/tests/adapter_tests_async/test_async_starlette.py @@ -15,6 +15,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -104,7 +105,7 @@ async def endpoint(req: Request): headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_shortcuts(self): app = AsyncApp( @@ -150,7 +151,7 @@ async def endpoint(req: Request): headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_commands(self): app = AsyncApp( @@ -196,7 +197,7 @@ async def endpoint(req: Request): headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_oauth(self): app = AsyncApp( diff --git a/tests/mock_web_api_server.py b/tests/mock_web_api_server.py index db204f00b..799e38266 100644 --- a/tests/mock_web_api_server.py +++ b/tests/mock_web_api_server.py @@ -1,12 +1,20 @@ +import asyncio import json import logging +import sys import threading +import time from http import HTTPStatus from http.server import HTTPServer, SimpleHTTPRequestHandler from typing import Type from unittest import TestCase from urllib.parse import urlparse, parse_qs +from multiprocessing import Process +from urllib.request import urlopen, Request + +from tests.utils import get_mock_server_mode + class MockHandler(SimpleHTTPRequestHandler): protocol_version = "HTTP/1.1" @@ -84,6 +92,12 @@ def set_common_headers(self): def _handle(self): self.received_requests[self.path] = self.received_requests.get(self.path, 0) + 1 try: + if self.path == "/received_requests.json": + self.send_response(200) + self.set_common_headers() + self.wfile.write(json.dumps(self.received_requests).encode("utf-8")) + return + body = {"ok": True} if self.path == "/oauth.v2.access": self.send_response(200) @@ -156,6 +170,63 @@ def do_POST(self): self._handle() +# +# multiprocessing +# + + +class MockServerProcessTarget: + def __init__(self, handler: Type[SimpleHTTPRequestHandler] = MockHandler): + self.handler = handler + + def run(self): + self.handler.received_requests = {} + self.server = HTTPServer(("localhost", 8888), self.handler) + try: + self.server.serve_forever(0.05) + finally: + self.server.server_close() + + def stop(self): + self.handler.received_requests = {} + self.server.shutdown() + self.join() + + +class MonitorThread(threading.Thread): + def __init__( + self, test: TestCase, handler: Type[SimpleHTTPRequestHandler] = MockHandler + ): + threading.Thread.__init__(self, daemon=True) + self.handler = handler + self.test = test + self.test.mock_received_requests = None + self.is_running = True + + def run(self) -> None: + while self.is_running: + try: + req = Request(f"{self.test.server_url}/received_requests.json") + resp = urlopen(req, timeout=1) + self.test.mock_received_requests = json.loads( + resp.read().decode("utf-8") + ) + except Exception as e: + # skip logging for the initial request + if self.test.mock_received_requests is not None: + logging.getLogger(__name__).exception(e) + time.sleep(0.01) + + def stop(self): + self.is_running = False + self.join() + + +# +# threading +# + + class MockServerThread(threading.Thread): def __init__( self, test: TestCase, handler: Type[SimpleHTTPRequestHandler] = MockHandler @@ -184,12 +255,86 @@ def stop(self): def setup_mock_web_api_server(test: TestCase): - test.server_started = threading.Event() - test.thread = MockServerThread(test) - test.thread.start() - test.server_started.wait() + if get_mock_server_mode() == "threading": + test.server_started = threading.Event() + test.thread = MockServerThread(test) + test.thread.start() + test.server_started.wait() + else: + # start a mock server as another process + target = MockServerProcessTarget() + test.server_url = "http://localhost:8888" + test.host, test.port = "localhost", 8888 + test.process = Process(target=target.run, daemon=True) + test.process.start() + + time.sleep(0.1) + + # start a thread in the current process + # this thread fetches mock_received_requests from the remote process + test.monitor_thread = MonitorThread(test) + test.monitor_thread.start() + count = 0 + # wait until the first successful data retrieval + while test.mock_received_requests is None: + time.sleep(0.01) + count += 1 + if count >= 100: + raise Exception("The mock server is not yet running!") def cleanup_mock_web_api_server(test: TestCase): - test.thread.stop() - test.thread = None + if get_mock_server_mode() == "threading": + test.thread.stop() + test.thread = None + else: + # stop the thread to fetch mock_received_requests from the remote process + test.monitor_thread.stop() + + # terminate the process + test.process.terminate() + test.process.join() + + # Python 3.6 does not have these methods + if sys.version_info.major == 3 and sys.version_info.minor > 6: + # cleanup the process's resources + test.process.kill() + test.process.close() + + test.process = None + + +def assert_auth_test_count(test: TestCase, expected_count: int): + time.sleep(0.1) + retry_count = 0 + error = None + while retry_count < 3: + try: + test.mock_received_requests["/auth.test"] == expected_count + break + except Exception as e: + error = e + retry_count += 1 + # waiting for mock_received_requests updates + time.sleep(0.1) + + if error is not None: + raise error + + +async def assert_auth_test_count_async(test: TestCase, expected_count: int): + await asyncio.sleep(0.1) + retry_count = 0 + error = None + while retry_count < 3: + try: + test.mock_received_requests["/auth.test"] == expected_count + break + except Exception as e: + error = e + retry_count += 1 + # waiting for mock_received_requests updates + await asyncio.sleep(0.1) + + if error is not None: + raise error diff --git a/tests/scenario_tests/test_app_bot_only.py b/tests/scenario_tests/test_app_bot_only.py index 53da026f9..c85590e39 100644 --- a/tests/scenario_tests/test_app_bot_only.py +++ b/tests/scenario_tests/test_app_bot_only.py @@ -16,6 +16,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -171,7 +172,7 @@ def test_installation_store_bot_only_default(self): app.event("app_mention")(self.handle_app_mention) response = app.dispatch(self.build_app_mention_request()) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -187,7 +188,7 @@ def test_installation_store_bot_only_false(self): app.event("app_mention")(self.handle_app_mention) response = app.dispatch(self.build_app_mention_request()) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -202,7 +203,7 @@ def test_installation_store_bot_only(self): app.event("app_mention")(self.handle_app_mention) response = app.dispatch(self.build_app_mention_request()) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -216,7 +217,7 @@ def test_installation_store_bot_only_oauth_settings(self): app.event("app_mention")(self.handle_app_mention) response = app.dispatch(self.build_app_mention_request()) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -231,7 +232,7 @@ def test_installation_store_bot_only_oauth_settings_conflicts(self): app.event("app_mention")(self.handle_app_mention) response = app.dispatch(self.build_app_mention_request()) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -245,7 +246,7 @@ def test_installation_store_bot_only_oauth_flow(self): app.event("app_mention")(self.handle_app_mention) response = app.dispatch(self.build_app_mention_request()) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -260,6 +261,6 @@ def test_installation_store_bot_only_oauth_flow_conflicts(self): app.event("app_mention")(self.handle_app_mention) response = app.dispatch(self.build_app_mention_request()) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 diff --git a/tests/scenario_tests/test_app_using_methods_in_class.py b/tests/scenario_tests/test_app_using_methods_in_class.py index 642d0641d..c16f19884 100644 --- a/tests/scenario_tests/test_app_using_methods_in_class.py +++ b/tests/scenario_tests/test_app_using_methods_in_class.py @@ -10,6 +10,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -113,7 +114,7 @@ def run_app_and_verify(self, app: App): ) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(0.5) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 diff --git a/tests/scenario_tests/test_attachment_actions.py b/tests/scenario_tests/test_attachment_actions.py index c520a11ad..816db7cdf 100644 --- a/tests/scenario_tests/test_attachment_actions.py +++ b/tests/scenario_tests/test_attachment_actions.py @@ -10,6 +10,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -65,7 +66,7 @@ def test_success_without_type(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_success(self): app = App( @@ -82,7 +83,7 @@ def test_success(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_success_2(self): app = App( @@ -94,7 +95,7 @@ def test_success_2(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_process_before_response(self): app = App( @@ -112,7 +113,7 @@ def test_process_before_response(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_failure_without_type(self): app = App( @@ -122,12 +123,12 @@ def test_failure_without_type(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.action("unknown")(simple_listener) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_failure(self): app = App( @@ -137,7 +138,7 @@ def test_failure(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.action( { @@ -147,7 +148,7 @@ def test_failure(self): )(simple_listener) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_failure_2(self): app = App( @@ -157,12 +158,12 @@ def test_failure_2(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.attachment_action("unknown")(simple_listener) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) # https://api.slack.com/legacy/interactive-messages diff --git a/tests/scenario_tests/test_authorize.py b/tests/scenario_tests/test_authorize.py index 6bb4345e8..494c505ed 100644 --- a/tests/scenario_tests/test_authorize.py +++ b/tests/scenario_tests/test_authorize.py @@ -11,6 +11,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -95,7 +96,7 @@ def test_success(self): response = app.dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_failure(self): app = App( @@ -123,7 +124,7 @@ def test_bot_context_attributes(self): response = app.dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_user_context_attributes(self): app = App( @@ -137,7 +138,7 @@ def test_user_context_attributes(self): response = app.dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) body = { diff --git a/tests/scenario_tests/test_block_actions.py b/tests/scenario_tests/test_block_actions.py index 6280bf6ed..b7bd82199 100644 --- a/tests/scenario_tests/test_block_actions.py +++ b/tests/scenario_tests/test_block_actions.py @@ -10,6 +10,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -65,7 +66,7 @@ def test_success(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_success_2(self): app = App( @@ -77,7 +78,7 @@ def test_success_2(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_process_before_response(self): app = App( @@ -90,7 +91,7 @@ def test_process_before_response(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_default_type(self): app = App(client=self.web_client, signing_secret=self.signing_secret) @@ -99,7 +100,7 @@ def test_default_type(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_default_type_no_block_id(self): app = App(client=self.web_client, signing_secret=self.signing_secret) @@ -108,7 +109,7 @@ def test_default_type_no_block_id(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_default_type_and_unmatched_block_id(self): app = App(client=self.web_client, signing_secret=self.signing_secret) @@ -117,7 +118,7 @@ def test_default_type_and_unmatched_block_id(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_failure(self): app = App( @@ -127,12 +128,12 @@ def test_failure(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.action("aaa")(simple_listener) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_failure_2(self): app = App( @@ -142,12 +143,12 @@ def test_failure_2(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.block_action("aaa")(simple_listener) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) body = { diff --git a/tests/scenario_tests/test_block_suggestion.py b/tests/scenario_tests/test_block_suggestion.py index 67c5428a8..9c3a4fb3f 100644 --- a/tests/scenario_tests/test_block_suggestion.py +++ b/tests/scenario_tests/test_block_suggestion.py @@ -11,6 +11,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -74,7 +75,7 @@ def test_success(self): assert response.status == 200 assert response.body == expected_response_body assert response.headers["content-type"][0] == "application/json;charset=utf-8" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_success_2(self): app = App( @@ -88,7 +89,7 @@ def test_success_2(self): assert response.status == 200 assert response.body == expected_response_body assert response.headers["content-type"][0] == "application/json;charset=utf-8" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_success_multi(self): app = App( @@ -102,7 +103,7 @@ def test_success_multi(self): assert response.status == 200 assert response.body == expected_multi_response_body assert response.headers["content-type"][0] == "application/json;charset=utf-8" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_process_before_response(self): app = App( @@ -117,7 +118,7 @@ def test_process_before_response(self): assert response.status == 200 assert response.body == expected_response_body assert response.headers["content-type"][0] == "application/json;charset=utf-8" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_process_before_response_multi(self): app = App( @@ -132,7 +133,7 @@ def test_process_before_response_multi(self): assert response.status == 200 assert response.body == expected_multi_response_body assert response.headers["content-type"][0] == "application/json;charset=utf-8" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_failure(self): app = App( @@ -142,12 +143,12 @@ def test_failure(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.options("mes_a")(show_multi_options) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_failure_2(self): app = App( @@ -157,12 +158,12 @@ def test_failure_2(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.block_suggestion("mes_a")(show_multi_options) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_failure_multi(self): app = App( @@ -172,12 +173,12 @@ def test_failure_multi(self): request = self.build_valid_multi_request() response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.options("es_a")(show_options) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) body = { diff --git a/tests/scenario_tests/test_dialogs.py b/tests/scenario_tests/test_dialogs.py index 671ca723e..558ede787 100644 --- a/tests/scenario_tests/test_dialogs.py +++ b/tests/scenario_tests/test_dialogs.py @@ -10,6 +10,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -66,19 +67,19 @@ def test_success_without_type(self): assert response.status == 200 assert response.body != "" assert response.headers["content-type"][0] == "application/json;charset=utf-8" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) request = self.build_valid_request(submission_raw_body) response = app.dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) request = self.build_valid_request(cancellation_raw_body) response = app.dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_success(self): app = App( @@ -100,19 +101,19 @@ def test_success(self): assert response.status == 200 assert response.body != "" assert response.headers["content-type"][0] == "application/json;charset=utf-8" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) request = self.build_valid_request(submission_raw_body) response = app.dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) request = self.build_valid_request(cancellation_raw_body) response = app.dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_success_2(self): app = App( @@ -128,19 +129,19 @@ def test_success_2(self): assert response.status == 200 assert response.body != "" assert response.headers["content-type"][0] == "application/json;charset=utf-8" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) request = self.build_valid_request(submission_raw_body) response = app.dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) request = self.build_valid_request(cancellation_raw_body) response = app.dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_process_before_response(self): app = App( @@ -163,19 +164,19 @@ def test_process_before_response(self): assert response.status == 200 assert response.body != "" assert response.headers["content-type"][0] == "application/json;charset=utf-8" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) request = self.build_valid_request(submission_raw_body) response = app.dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) request = self.build_valid_request(cancellation_raw_body) response = app.dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_process_before_response_2(self): app = App( @@ -192,19 +193,19 @@ def test_process_before_response_2(self): assert response.status == 200 assert response.body == json.dumps(options_response) assert response.headers["content-type"][0] == "application/json;charset=utf-8" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) request = self.build_valid_request(submission_raw_body) response = app.dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) request = self.build_valid_request(cancellation_raw_body) response = app.dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_suggestion_failure_without_type(self): app = App( @@ -214,12 +215,12 @@ def test_suggestion_failure_without_type(self): request = self.build_valid_request(suggestion_raw_body) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.options("dialog-callback-iddddd")(handle_suggestion) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_suggestion_failure(self): app = App( @@ -229,12 +230,12 @@ def test_suggestion_failure(self): request = self.build_valid_request(suggestion_raw_body) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.dialog_suggestion("dialog-callback-iddddd")(handle_suggestion) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_suggestion_failure_2(self): app = App( @@ -244,14 +245,14 @@ def test_suggestion_failure_2(self): request = self.build_valid_request(suggestion_raw_body) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.options( {"type": "dialog_suggestion", "callback_id": "dialog-callback-iddddd"} )(handle_suggestion) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_submission_failure_without_type(self): app = App( @@ -261,12 +262,12 @@ def test_submission_failure_without_type(self): request = self.build_valid_request(suggestion_raw_body) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.action("dialog-callback-iddddd")(handle_submission) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_submission_failure(self): app = App( @@ -276,12 +277,12 @@ def test_submission_failure(self): request = self.build_valid_request(suggestion_raw_body) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.dialog_submission("dialog-callback-iddddd")(handle_submission) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_submission_failure_2(self): app = App( @@ -291,14 +292,14 @@ def test_submission_failure_2(self): request = self.build_valid_request(suggestion_raw_body) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.action( {"type": "dialog_submission", "callback_id": "dialog-callback-iddddd"} )(handle_submission) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_cancellation_failure_without_type(self): app = App( @@ -308,12 +309,12 @@ def test_cancellation_failure_without_type(self): request = self.build_valid_request(suggestion_raw_body) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.action("dialog-callback-iddddd")(handle_cancellation) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_cancellation_failure(self): app = App( @@ -323,12 +324,12 @@ def test_cancellation_failure(self): request = self.build_valid_request(suggestion_raw_body) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.dialog_cancellation("dialog-callback-iddddd")(handle_cancellation) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_cancellation_failure_2(self): app = App( @@ -338,14 +339,14 @@ def test_cancellation_failure_2(self): request = self.build_valid_request(suggestion_raw_body) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.action( {"type": "dialog_cancellation", "callback_id": "dialog-callback-iddddd"} )(handle_cancellation) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) suggestion_body = { diff --git a/tests/scenario_tests/test_events.py b/tests/scenario_tests/test_events.py index c80a23bff..e5a1e9f49 100644 --- a/tests/scenario_tests/test_events.py +++ b/tests/scenario_tests/test_events.py @@ -10,6 +10,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -86,7 +87,7 @@ def handle_app_mention(body, say, payload, event): ) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -109,7 +110,7 @@ def handle_app_mention(body, logger, payload, event): ) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) valid_reaction_added_body = { "token": "verification_token", @@ -146,7 +147,7 @@ def handle_app_mention(body, say, payload, event): ) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -204,7 +205,7 @@ def handle_app_mention(say): ) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() # The listener should not be executed assert self.mock_received_requests.get("/chat.postMessage") is None @@ -263,7 +264,7 @@ def handle_member_left_channel(say): ) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) timestamp, body = str(int(time())), json.dumps(left_event_body) request: BoltRequest = BoltRequest( @@ -329,7 +330,7 @@ def handle_app_mention(say): ) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) timestamp, body = str(int(time())), json.dumps(left_event_body) request: BoltRequest = BoltRequest( @@ -395,7 +396,7 @@ def handler2(say: Say): response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 2 diff --git a/tests/scenario_tests/test_events_org_apps.py b/tests/scenario_tests/test_events_org_apps.py index c9c2e737b..732e23f8b 100644 --- a/tests/scenario_tests/test_events_org_apps.py +++ b/tests/scenario_tests/test_events_org_apps.py @@ -11,6 +11,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -107,7 +108,7 @@ def handle_app_mention(body): response = app.dispatch(request) assert response.status == 200 # auth.test API call must be skipped - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() assert result.called is True @@ -198,7 +199,7 @@ def handle_app_mention(body): response = app.dispatch(request) assert response.status == 200 # auth.test API call must be skipped - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() assert result.called is True @@ -256,6 +257,6 @@ def handle_app_mention(body): response = app.dispatch(request) assert response.status == 200 # auth.test API call must be skipped - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() assert result.called is True diff --git a/tests/scenario_tests/test_events_shared_channels.py b/tests/scenario_tests/test_events_shared_channels.py index 9829d91bc..55414d10f 100644 --- a/tests/scenario_tests/test_events_shared_channels.py +++ b/tests/scenario_tests/test_events_shared_channels.py @@ -9,6 +9,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -108,7 +109,7 @@ def handle_app_mention(body, say: Say, payload, event): ) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -135,7 +136,7 @@ def handle_app_mention(body, logger, payload, event): ) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) valid_reaction_added_body = { "token": "verification_token", @@ -184,7 +185,7 @@ def handle_app_mention(body, say, payload, event): ) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -258,7 +259,7 @@ def handle_app_mention(say): ) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() # The listener should not be executed assert self.mock_received_requests.get("/chat.postMessage") is None @@ -337,7 +338,7 @@ def handle_member_left_channel(say): ) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) timestamp, body = str(int(time())), json.dumps(left_event_body) request: BoltRequest = BoltRequest( @@ -423,7 +424,7 @@ def handle_app_mention(say): ) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) timestamp, body = str(int(time())), json.dumps(left_event_body) request: BoltRequest = BoltRequest( diff --git a/tests/scenario_tests/test_events_socket_mode.py b/tests/scenario_tests/test_events_socket_mode.py index 2bb8709e4..0c15f23ce 100644 --- a/tests/scenario_tests/test_events_socket_mode.py +++ b/tests/scenario_tests/test_events_socket_mode.py @@ -8,6 +8,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -72,7 +73,7 @@ def handle_app_mention(body, say, payload, event): ) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -94,7 +95,7 @@ def handle_app_mention(body, logger, payload, event): ) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) valid_reaction_added_body = { "token": "verification_token", @@ -130,7 +131,7 @@ def handle_app_mention(body, say, payload, event): ) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -181,7 +182,7 @@ def handle_app_mention(say): request: BoltRequest = BoltRequest(body=event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() # The listener should not be executed assert self.mock_received_requests.get("/chat.postMessage") is None @@ -237,7 +238,7 @@ def handle_member_left_channel(say): request: BoltRequest = BoltRequest(body=join_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) request: BoltRequest = BoltRequest(body=left_event_body, mode="socket_mode") response = app.dispatch(request) @@ -297,7 +298,7 @@ def handle_app_mention(say): request: BoltRequest = BoltRequest(body=join_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) request: BoltRequest = BoltRequest(body=left_event_body, mode="socket_mode") response = app.dispatch(request) @@ -356,6 +357,6 @@ def handler2(say: Say): response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 2 diff --git a/tests/scenario_tests/test_message.py b/tests/scenario_tests/test_message.py index d99edffc1..e750bfd40 100644 --- a/tests/scenario_tests/test_message.py +++ b/tests/scenario_tests/test_message.py @@ -10,6 +10,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -63,7 +64,7 @@ def test_string_keyword(self): request = self.build_request() response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) time.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -77,7 +78,7 @@ def test_string_keyword_capturing(self): request = self.build_request2() response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) time.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -93,7 +94,7 @@ def test_string_keyword_capturing2(self): request = self.build_request2() response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) time.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -107,7 +108,7 @@ def test_string_keyword_unmatched(self): request = self.build_request() response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_regexp_keyword(self): app = App( @@ -119,7 +120,7 @@ def test_regexp_keyword(self): request = self.build_request() response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) time.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -133,7 +134,7 @@ def test_regexp_keyword_unmatched(self): request = self.build_request() response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) message_body = { diff --git a/tests/scenario_tests/test_message_bot.py b/tests/scenario_tests/test_message_bot.py index be24e0fb4..94eae4440 100644 --- a/tests/scenario_tests/test_message_bot.py +++ b/tests/scenario_tests/test_message_bot.py @@ -10,6 +10,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -74,7 +75,7 @@ def handle_messages(event, logger): response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) time.sleep(1) # wait a bit after auto ack() assert result["call_count"] == 3 diff --git a/tests/scenario_tests/test_middleware.py b/tests/scenario_tests/test_middleware.py index deb677d1d..3d623fc02 100644 --- a/tests/scenario_tests/test_middleware.py +++ b/tests/scenario_tests/test_middleware.py @@ -9,6 +9,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -71,7 +72,7 @@ def test_no_next_call(self): response = app.dispatch(self.build_request()) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_next_call(self): app = App( @@ -84,7 +85,7 @@ def test_next_call(self): response = app.dispatch(self.build_request()) assert response.status == 200 assert response.body == "acknowledged!" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_class_call(self): class NextClass: @@ -101,7 +102,7 @@ def __call__(self, next): response = app.dispatch(self.build_request()) assert response.status == 200 assert response.body == "acknowledged!" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def just_ack(ack): diff --git a/tests/scenario_tests/test_shortcut.py b/tests/scenario_tests/test_shortcut.py index 42143942a..2310e7c45 100644 --- a/tests/scenario_tests/test_shortcut.py +++ b/tests/scenario_tests/test_shortcut.py @@ -10,6 +10,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -64,12 +65,12 @@ def test_success_both_global_and_message(self): request = self.build_valid_request(global_shortcut_raw_body) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) request = self.build_valid_request(message_shortcut_raw_body) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_success_global(self): app = App( @@ -81,7 +82,7 @@ def test_success_global(self): request = self.build_valid_request(global_shortcut_raw_body) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_success_global_2(self): app = App( @@ -93,12 +94,12 @@ def test_success_global_2(self): request = self.build_valid_request(global_shortcut_raw_body) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) request = self.build_valid_request(message_shortcut_raw_body) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_success_message(self): app = App( @@ -112,12 +113,12 @@ def test_success_message(self): request = self.build_valid_request(message_shortcut_raw_body) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) request = self.build_valid_request(global_shortcut_raw_body) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_success_message_2(self): app = App( @@ -129,12 +130,12 @@ def test_success_message_2(self): request = self.build_valid_request(message_shortcut_raw_body) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) request = self.build_valid_request(global_shortcut_raw_body) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_process_before_response_global(self): app = App( @@ -147,7 +148,7 @@ def test_process_before_response_global(self): request = self.build_valid_request(global_shortcut_raw_body) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_failure(self): app = App( @@ -157,12 +158,12 @@ def test_failure(self): request = self.build_valid_request(global_shortcut_raw_body) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.shortcut("another-one")(simple_listener) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_failure_2(self): app = App( @@ -172,17 +173,17 @@ def test_failure_2(self): request = self.build_valid_request(global_shortcut_raw_body) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.global_shortcut("another-one")(simple_listener) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) request = self.build_valid_request(message_shortcut_raw_body) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) global_shortcut_body = { diff --git a/tests/scenario_tests/test_slash_command.py b/tests/scenario_tests/test_slash_command.py index 23f07dbc0..1db13ecca 100644 --- a/tests/scenario_tests/test_slash_command.py +++ b/tests/scenario_tests/test_slash_command.py @@ -9,6 +9,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -62,7 +63,7 @@ def test_success(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_process_before_response(self): app = App( @@ -75,7 +76,7 @@ def test_process_before_response(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_failure(self): app = App( @@ -85,12 +86,12 @@ def test_failure(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.command("/another-one")(commander) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) slash_command_body = ( diff --git a/tests/scenario_tests/test_view_closed.py b/tests/scenario_tests/test_view_closed.py index 8294108f1..babf6f911 100644 --- a/tests/scenario_tests/test_view_closed.py +++ b/tests/scenario_tests/test_view_closed.py @@ -10,6 +10,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -65,7 +66,7 @@ def test_success(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_success_2(self): app = App( @@ -77,7 +78,7 @@ def test_success_2(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_process_before_response(self): app = App( @@ -90,7 +91,7 @@ def test_process_before_response(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_failure(self): app = App( @@ -100,12 +101,12 @@ def test_failure(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.view("view-idddd")(simple_listener) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_failure(self): app = App( @@ -115,12 +116,12 @@ def test_failure(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.view({"type": "view_closed", "callback_id": "view-idddd"})(simple_listener) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_failure_2(self): app = App( @@ -130,12 +131,12 @@ def test_failure_2(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.view_closed("view-idddd")(simple_listener) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) body = { diff --git a/tests/scenario_tests/test_view_submission.py b/tests/scenario_tests/test_view_submission.py index ced03e181..9ea3c367b 100644 --- a/tests/scenario_tests/test_view_submission.py +++ b/tests/scenario_tests/test_view_submission.py @@ -10,6 +10,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -65,7 +66,7 @@ def test_success(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_success_2(self): app = App( @@ -77,7 +78,7 @@ def test_success_2(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_process_before_response(self): app = App( @@ -90,7 +91,7 @@ def test_process_before_response(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_failure(self): app = App( @@ -100,12 +101,12 @@ def test_failure(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.view("view-idddd")(simple_listener) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_failure_2(self): app = App( @@ -115,12 +116,12 @@ def test_failure_2(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app.view_submission("view-idddd")(simple_listener) response = app.dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) body = { diff --git a/tests/scenario_tests/test_workflow_steps.py b/tests/scenario_tests/test_workflow_steps.py index b41d32e12..38cc803c3 100644 --- a/tests/scenario_tests/test_workflow_steps.py +++ b/tests/scenario_tests/test_workflow_steps.py @@ -11,6 +11,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -67,7 +68,7 @@ def test_edit(self): request: BoltRequest = BoltRequest(body=body, headers=headers) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app = self.build_app("copy_review___") response = app.dispatch(request) @@ -85,7 +86,7 @@ def test_edit_process_before_response(self): request: BoltRequest = BoltRequest(body=body, headers=headers) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app = self.build_process_before_response_app("copy_review___") response = app.dispatch(request) @@ -103,7 +104,7 @@ def test_save(self): request: BoltRequest = BoltRequest(body=body, headers=headers) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app = self.build_app("copy_review___") response = app.dispatch(request) @@ -121,7 +122,7 @@ def test_save_process_before_response(self): request: BoltRequest = BoltRequest(body=body, headers=headers) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) app = self.build_process_before_response_app("copy_review___") response = app.dispatch(request) @@ -139,7 +140,7 @@ def test_execute(self): request: BoltRequest = BoltRequest(body=body, headers=headers) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) time_module.sleep(0.5) assert self.mock_received_requests["/workflows.stepCompleted"] == 1 @@ -159,7 +160,7 @@ def test_execute_process_before_response(self): request: BoltRequest = BoltRequest(body=body, headers=headers) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) time_module.sleep(0.5) assert self.mock_received_requests["/workflows.stepCompleted"] == 1 diff --git a/tests/scenario_tests_async/test_app_bot_only.py b/tests/scenario_tests_async/test_app_bot_only.py index 58685393a..a94fd497d 100644 --- a/tests/scenario_tests_async/test_app_bot_only.py +++ b/tests/scenario_tests_async/test_app_bot_only.py @@ -20,6 +20,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count_async, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -89,7 +90,7 @@ async def test_bot_only(self): request = self.build_valid_app_mention_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -106,7 +107,7 @@ async def test_bot_only_oauth_settings_conflicts(self): request = self.build_valid_app_mention_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -122,7 +123,7 @@ async def test_bot_only_oauth_settings(self): request = self.build_valid_app_mention_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -139,7 +140,7 @@ async def test_bot_only_oauth_flow_conflicts(self): request = self.build_valid_app_mention_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -155,7 +156,7 @@ async def test_bot_only_oauth_flow(self): request = self.build_valid_app_mention_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 diff --git a/tests/scenario_tests_async/test_app_using_methods_in_class.py b/tests/scenario_tests_async/test_app_using_methods_in_class.py index f58be3af5..3396090a8 100644 --- a/tests/scenario_tests_async/test_app_using_methods_in_class.py +++ b/tests/scenario_tests_async/test_app_using_methods_in_class.py @@ -16,6 +16,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count_async, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -123,7 +124,7 @@ async def run_app_and_verify(self, app: AsyncApp): ) response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(0.5) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 diff --git a/tests/scenario_tests_async/test_attachment_actions.py b/tests/scenario_tests_async/test_attachment_actions.py index 00338c68e..4dfc00cda 100644 --- a/tests/scenario_tests_async/test_attachment_actions.py +++ b/tests/scenario_tests_async/test_attachment_actions.py @@ -12,6 +12,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count_async, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -73,7 +74,7 @@ async def test_success_without_type(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_success(self): @@ -91,7 +92,7 @@ async def test_success(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_success_2(self): @@ -104,7 +105,7 @@ async def test_success_2(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_process_before_response(self): @@ -123,7 +124,7 @@ async def test_process_before_response(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_process_before_response_2(self): @@ -137,7 +138,7 @@ async def test_process_before_response_2(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_failure_without_type(self): @@ -148,12 +149,12 @@ async def test_failure_without_type(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.action("unknown")(simple_listener) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_failure(self): @@ -164,7 +165,7 @@ async def test_failure(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.action( { @@ -174,7 +175,7 @@ async def test_failure(self): )(simple_listener) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_failure_2(self): @@ -185,12 +186,12 @@ async def test_failure_2(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.attachment_action("unknown")(simple_listener) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) # https://api.slack.com/legacy/interactive-messages diff --git a/tests/scenario_tests_async/test_authorize.py b/tests/scenario_tests_async/test_authorize.py index 01a3c4331..bea81df92 100644 --- a/tests/scenario_tests_async/test_authorize.py +++ b/tests/scenario_tests_async/test_authorize.py @@ -13,6 +13,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count_async, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -102,7 +103,7 @@ async def test_success(self): response = await app.async_dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_failure(self): @@ -132,7 +133,7 @@ async def test_bot_context_attributes(self): response = await app.async_dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_user_context_attributes(self): @@ -147,7 +148,7 @@ async def test_user_context_attributes(self): response = await app.async_dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) body = { diff --git a/tests/scenario_tests_async/test_block_actions.py b/tests/scenario_tests_async/test_block_actions.py index 4ee1b1fb1..c2e371c08 100644 --- a/tests/scenario_tests_async/test_block_actions.py +++ b/tests/scenario_tests_async/test_block_actions.py @@ -13,6 +13,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count_async, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -74,7 +75,7 @@ async def test_success(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_success_2(self): @@ -87,7 +88,7 @@ async def test_success_2(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_default_type(self): @@ -100,7 +101,7 @@ async def test_default_type(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_default_type_no_block_id(self): @@ -113,7 +114,7 @@ async def test_default_type_no_block_id(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_default_type_unmatched_block_id(self): @@ -126,7 +127,7 @@ async def test_default_type_unmatched_block_id(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_process_before_response(self): @@ -140,7 +141,7 @@ async def test_process_before_response(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_process_before_response_2(self): @@ -154,7 +155,7 @@ async def test_process_before_response_2(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_failure(self): @@ -165,12 +166,12 @@ async def test_failure(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.action("aaa")(simple_listener) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_failure_2(self): @@ -181,12 +182,12 @@ async def test_failure_2(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.block_action("aaa")(simple_listener) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) body = { diff --git a/tests/scenario_tests_async/test_block_suggestion.py b/tests/scenario_tests_async/test_block_suggestion.py index 7351b290b..dc67391e0 100644 --- a/tests/scenario_tests_async/test_block_suggestion.py +++ b/tests/scenario_tests_async/test_block_suggestion.py @@ -13,6 +13,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count_async, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -82,7 +83,7 @@ async def test_success(self): assert response.status == 200 assert response.body == expected_response_body assert response.headers["content-type"][0] == "application/json;charset=utf-8" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_success_2(self): @@ -97,7 +98,7 @@ async def test_success_2(self): assert response.status == 200 assert response.body == expected_response_body assert response.headers["content-type"][0] == "application/json;charset=utf-8" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_success_multi(self): @@ -112,7 +113,7 @@ async def test_success_multi(self): assert response.status == 200 assert response.body == expected_multi_response_body assert response.headers["content-type"][0] == "application/json;charset=utf-8" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_process_before_response(self): @@ -128,7 +129,7 @@ async def test_process_before_response(self): assert response.status == 200 assert response.body == expected_response_body assert response.headers["content-type"][0] == "application/json;charset=utf-8" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_process_before_response_multi(self): @@ -144,7 +145,7 @@ async def test_process_before_response_multi(self): assert response.status == 200 assert response.body == expected_multi_response_body assert response.headers["content-type"][0] == "application/json;charset=utf-8" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_failure(self): @@ -155,12 +156,12 @@ async def test_failure(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.options("mes_a")(show_multi_options) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_failure_2(self): @@ -171,12 +172,12 @@ async def test_failure_2(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.block_suggestion("mes_a")(show_multi_options) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_failure_multi(self): @@ -187,12 +188,12 @@ async def test_failure_multi(self): request = self.build_valid_multi_request() response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.options("es_a")(show_options) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) body = { diff --git a/tests/scenario_tests_async/test_dialogs.py b/tests/scenario_tests_async/test_dialogs.py index 1cad07ff4..cb1757b2b 100644 --- a/tests/scenario_tests_async/test_dialogs.py +++ b/tests/scenario_tests_async/test_dialogs.py @@ -12,6 +12,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count_async, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -74,19 +75,19 @@ async def test_success_without_type(self): assert response.status == 200 assert response.body != "" assert response.headers["content-type"][0] == "application/json;charset=utf-8" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) request = self.build_valid_request(submission_raw_body) response = await app.async_dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) request = self.build_valid_request(cancellation_raw_body) response = await app.async_dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_success(self): @@ -109,19 +110,19 @@ async def test_success(self): assert response.status == 200 assert response.body != "" assert response.headers["content-type"][0] == "application/json;charset=utf-8" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) request = self.build_valid_request(submission_raw_body) response = await app.async_dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) request = self.build_valid_request(cancellation_raw_body) response = await app.async_dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_success_2(self): @@ -138,19 +139,19 @@ async def test_success_2(self): assert response.status == 200 assert response.body != "" assert response.headers["content-type"][0] == "application/json;charset=utf-8" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) request = self.build_valid_request(submission_raw_body) response = await app.async_dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) request = self.build_valid_request(cancellation_raw_body) response = await app.async_dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_process_before_response(self): @@ -174,19 +175,19 @@ async def test_process_before_response(self): assert response.status == 200 assert response.body != "" assert response.headers["content-type"][0] == "application/json;charset=utf-8" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) request = self.build_valid_request(submission_raw_body) response = await app.async_dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) request = self.build_valid_request(cancellation_raw_body) response = await app.async_dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_process_before_response_2(self): @@ -204,19 +205,19 @@ async def test_process_before_response_2(self): assert response.status == 200 assert response.body == json.dumps(options_response) assert response.headers["content-type"][0] == "application/json;charset=utf-8" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) request = self.build_valid_request(submission_raw_body) response = await app.async_dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) request = self.build_valid_request(cancellation_raw_body) response = await app.async_dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_suggestion_failure_without_type(self): @@ -227,12 +228,12 @@ async def test_suggestion_failure_without_type(self): request = self.build_valid_request(suggestion_raw_body) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.options("dialog-callback-iddddd")(handle_suggestion) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_suggestion_failure(self): @@ -243,12 +244,12 @@ async def test_suggestion_failure(self): request = self.build_valid_request(suggestion_raw_body) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.dialog_suggestion("dialog-callback-iddddd")(handle_suggestion) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_suggestion_failure_2(self): @@ -259,14 +260,14 @@ async def test_suggestion_failure_2(self): request = self.build_valid_request(suggestion_raw_body) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.options( {"type": "dialog_suggestion", "callback_id": "dialog-callback-iddddd"} )(handle_suggestion) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_submission_failure_without_type(self): @@ -277,12 +278,12 @@ async def test_submission_failure_without_type(self): request = self.build_valid_request(suggestion_raw_body) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.action("dialog-callback-iddddd")(handle_submission) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_submission_failure(self): @@ -293,12 +294,12 @@ async def test_submission_failure(self): request = self.build_valid_request(suggestion_raw_body) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.dialog_submission("dialog-callback-iddddd")(handle_submission) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_submission_failure_2(self): @@ -309,14 +310,14 @@ async def test_submission_failure_2(self): request = self.build_valid_request(suggestion_raw_body) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.action( {"type": "dialog_submission", "callback_id": "dialog-callback-iddddd"} )(handle_submission) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_cancellation_failure_without_type(self): @@ -327,12 +328,12 @@ async def test_cancellation_failure_without_type(self): request = self.build_valid_request(suggestion_raw_body) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.action("dialog-callback-iddddd")(handle_cancellation) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_cancellation_failure(self): @@ -343,12 +344,12 @@ async def test_cancellation_failure(self): request = self.build_valid_request(suggestion_raw_body) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.dialog_cancellation("dialog-callback-iddddd")(handle_cancellation) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_cancellation_failure_2(self): @@ -359,14 +360,14 @@ async def test_cancellation_failure_2(self): request = self.build_valid_request(suggestion_raw_body) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.action( {"type": "dialog_cancellation", "callback_id": "dialog-callback-iddddd"} )(handle_cancellation) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) suggestion_body = { diff --git a/tests/scenario_tests_async/test_events.py b/tests/scenario_tests_async/test_events.py index 16fb92ef3..7e6f25a9c 100644 --- a/tests/scenario_tests_async/test_events.py +++ b/tests/scenario_tests_async/test_events.py @@ -14,6 +14,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count_async, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -73,7 +74,7 @@ async def test_app_mention(self): request = self.build_valid_app_mention_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -89,7 +90,7 @@ async def test_process_before_response(self): request = self.build_valid_app_mention_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) # no sleep here assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -101,7 +102,7 @@ async def test_middleware_skip(self): request = self.build_valid_app_mention_request() response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_simultaneous_requests(self): @@ -140,7 +141,7 @@ async def test_reaction_added(self): request = self.build_valid_reaction_added_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -193,7 +194,7 @@ async def test_self_events(self): ) response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() # The listener should not be executed assert self.mock_received_requests.get("/chat.postMessage") is None @@ -257,7 +258,7 @@ async def handle_member_left_channel(say): ) response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) timestamp, body = str(int(time())), json.dumps(left_event_body) request = AsyncBoltRequest( @@ -329,7 +330,7 @@ async def handle_member_left_channel(say): ) response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) timestamp, body = str(int(time())), json.dumps(left_event_body) request = AsyncBoltRequest( diff --git a/tests/scenario_tests_async/test_events_org_apps.py b/tests/scenario_tests_async/test_events_org_apps.py index 596927879..9ec48ff7e 100644 --- a/tests/scenario_tests_async/test_events_org_apps.py +++ b/tests/scenario_tests_async/test_events_org_apps.py @@ -16,6 +16,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count_async, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -115,7 +116,7 @@ async def handle_app_mention(body): response = await app.async_dispatch(request) assert response.status == 200 # auth.test API call must be skipped - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() assert result.called is True @@ -208,7 +209,7 @@ async def handle_app_mention(body): response = await app.async_dispatch(request) assert response.status == 200 # auth.test API call must be skipped - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() assert result.called is True @@ -267,6 +268,6 @@ async def handle_app_mention(body): response = await app.async_dispatch(request) assert response.status == 200 # auth.test API call must be skipped - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() assert result.called is True diff --git a/tests/scenario_tests_async/test_events_shared_channels.py b/tests/scenario_tests_async/test_events_shared_channels.py index b7877cf15..8f3b4cea7 100644 --- a/tests/scenario_tests_async/test_events_shared_channels.py +++ b/tests/scenario_tests_async/test_events_shared_channels.py @@ -14,6 +14,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count_async, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -83,7 +84,7 @@ async def test_app_mention(self): request = self.build_valid_app_mention_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -100,7 +101,7 @@ async def test_process_before_response(self): request = self.build_valid_app_mention_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) # no sleep here assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -116,7 +117,7 @@ async def test_middleware_skip(self): request = self.build_valid_app_mention_request() response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_simultaneous_requests(self): @@ -157,7 +158,7 @@ async def test_reaction_added(self): request = self.build_valid_reaction_added_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -220,7 +221,7 @@ async def test_self_events(self): ) response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() # The listener should not be executed assert self.mock_received_requests.get("/chat.postMessage") is None @@ -301,7 +302,7 @@ async def handle_member_left_channel(say): ) response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) timestamp, body = str(int(time())), json.dumps(left_event_body) request = AsyncBoltRequest( @@ -390,7 +391,7 @@ async def handle_member_left_channel(say): ) response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) timestamp, body = str(int(time())), json.dumps(left_event_body) request = AsyncBoltRequest( diff --git a/tests/scenario_tests_async/test_events_socket_mode.py b/tests/scenario_tests_async/test_events_socket_mode.py index ce6485f41..107af53d4 100644 --- a/tests/scenario_tests_async/test_events_socket_mode.py +++ b/tests/scenario_tests_async/test_events_socket_mode.py @@ -10,6 +10,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count_async, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -50,7 +51,7 @@ async def test_app_mention(self): request = self.build_valid_app_mention_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -65,7 +66,7 @@ async def test_process_before_response(self): request = self.build_valid_app_mention_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) # no sleep here assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -77,7 +78,7 @@ async def test_middleware_skip(self): request = self.build_valid_app_mention_request() response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_simultaneous_requests(self): @@ -109,7 +110,7 @@ async def test_reaction_added(self): request = self.build_valid_reaction_added_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -153,7 +154,7 @@ async def test_self_events(self): request = AsyncBoltRequest(body=self_event, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() # The listener should not be executed assert self.mock_received_requests.get("/chat.postMessage") is None @@ -211,7 +212,7 @@ async def handle_member_left_channel(say): request = AsyncBoltRequest(body=join_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) request = AsyncBoltRequest(body=left_event_body, mode="socket_mode") response = await app.async_dispatch(request) @@ -274,7 +275,7 @@ async def handle_member_left_channel(say): request = AsyncBoltRequest(body=join_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) request = AsyncBoltRequest(body=left_event_body, mode="socket_mode") response = await app.async_dispatch(request) diff --git a/tests/scenario_tests_async/test_message.py b/tests/scenario_tests_async/test_message.py index 60ed2e458..b69e849f6 100644 --- a/tests/scenario_tests_async/test_message.py +++ b/tests/scenario_tests_async/test_message.py @@ -12,6 +12,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count_async, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -70,7 +71,7 @@ async def test_string_keyword(self): request = self.build_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -85,7 +86,7 @@ async def test_string_keyword_capturing(self): request = self.build_request2() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -102,7 +103,7 @@ async def test_string_keyword_capturing2(self): request = self.build_request2() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -117,7 +118,7 @@ async def test_string_keyword_unmatched(self): request = self.build_request() response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_regexp_keyword(self): @@ -130,7 +131,7 @@ async def test_regexp_keyword(self): request = self.build_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 @@ -145,7 +146,7 @@ async def test_regexp_keyword_unmatched(self): request = self.build_request() response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) message_body = { diff --git a/tests/scenario_tests_async/test_message_bot.py b/tests/scenario_tests_async/test_message_bot.py index 599848bc5..0dfe8c07e 100644 --- a/tests/scenario_tests_async/test_message_bot.py +++ b/tests/scenario_tests_async/test_message_bot.py @@ -11,6 +11,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count_async, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -79,7 +80,7 @@ async def handle_messages(event, logger): response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(1) # wait a bit after auto ack() assert result["call_count"] == 3 diff --git a/tests/scenario_tests_async/test_middleware.py b/tests/scenario_tests_async/test_middleware.py index bcc8d4baf..176d89fb2 100644 --- a/tests/scenario_tests_async/test_middleware.py +++ b/tests/scenario_tests_async/test_middleware.py @@ -11,6 +11,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count_async, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -78,7 +79,7 @@ async def test_no_next_call(self): response = await app.async_dispatch(self.build_request()) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_next_call(self): @@ -92,7 +93,7 @@ async def test_next_call(self): response = await app.async_dispatch(self.build_request()) assert response.status == 200 assert response.body == "acknowledged!" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) async def just_ack(ack): diff --git a/tests/scenario_tests_async/test_shortcut.py b/tests/scenario_tests_async/test_shortcut.py index 5627198af..61197311e 100644 --- a/tests/scenario_tests_async/test_shortcut.py +++ b/tests/scenario_tests_async/test_shortcut.py @@ -12,6 +12,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count_async, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -72,12 +73,12 @@ async def test_success_both_global_and_message(self): request = self.build_valid_request(global_shortcut_raw_body) response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) request = self.build_valid_request(message_shortcut_raw_body) response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_success_global(self): @@ -90,7 +91,7 @@ async def test_success_global(self): request = self.build_valid_request(global_shortcut_raw_body) response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_success_global_2(self): @@ -103,12 +104,12 @@ async def test_success_global_2(self): request = self.build_valid_request(global_shortcut_raw_body) response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) request = self.build_valid_request(message_shortcut_raw_body) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_success_message(self): @@ -123,12 +124,12 @@ async def test_success_message(self): request = self.build_valid_request(message_shortcut_raw_body) response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) request = self.build_valid_request(global_shortcut_raw_body) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_success_message_2(self): @@ -141,12 +142,12 @@ async def test_success_message_2(self): request = self.build_valid_request(message_shortcut_raw_body) response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) request = self.build_valid_request(global_shortcut_raw_body) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_process_before_response_global(self): @@ -160,7 +161,7 @@ async def test_process_before_response_global(self): request = self.build_valid_request(global_shortcut_raw_body) response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_failure(self): @@ -171,12 +172,12 @@ async def test_failure(self): request = self.build_valid_request(global_shortcut_raw_body) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.shortcut("another-one")(simple_listener) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_failure_2(self): @@ -187,17 +188,17 @@ async def test_failure_2(self): request = self.build_valid_request(global_shortcut_raw_body) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.global_shortcut("another-one")(simple_listener) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) request = self.build_valid_request(message_shortcut_raw_body) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) global_shortcut_body = { diff --git a/tests/scenario_tests_async/test_slash_command.py b/tests/scenario_tests_async/test_slash_command.py index 44c881b9a..42e427db0 100644 --- a/tests/scenario_tests_async/test_slash_command.py +++ b/tests/scenario_tests_async/test_slash_command.py @@ -11,6 +11,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count_async, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -70,7 +71,7 @@ async def test_success(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_process_before_response(self): @@ -84,7 +85,7 @@ async def test_process_before_response(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_failure(self): @@ -95,12 +96,12 @@ async def test_failure(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.command("/another-one")(commander) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) slash_command_body = ( diff --git a/tests/scenario_tests_async/test_view_closed.py b/tests/scenario_tests_async/test_view_closed.py index d5af6167c..4f3afdbe7 100644 --- a/tests/scenario_tests_async/test_view_closed.py +++ b/tests/scenario_tests_async/test_view_closed.py @@ -12,6 +12,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count_async, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -73,7 +74,7 @@ async def test_success(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_success_2(self): @@ -86,7 +87,7 @@ async def test_success_2(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_process_before_response(self): @@ -100,7 +101,7 @@ async def test_process_before_response(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_failure(self): @@ -111,12 +112,12 @@ async def test_failure(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.view("view-idddd")(simple_listener) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_failure(self): @@ -127,12 +128,12 @@ async def test_failure(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.view({"type": "view_closed", "callback_id": "view-idddd"})(simple_listener) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_failure_2(self): @@ -143,12 +144,12 @@ async def test_failure_2(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.view_closed("view-idddd")(simple_listener) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) body = { diff --git a/tests/scenario_tests_async/test_view_submission.py b/tests/scenario_tests_async/test_view_submission.py index 2d7e1d993..b9538537e 100644 --- a/tests/scenario_tests_async/test_view_submission.py +++ b/tests/scenario_tests_async/test_view_submission.py @@ -12,6 +12,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count_async, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -73,7 +74,7 @@ async def test_success(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_success_2(self): @@ -86,7 +87,7 @@ async def test_success_2(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_process_before_response(self): @@ -100,7 +101,7 @@ async def test_process_before_response(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_failure(self): @@ -111,12 +112,12 @@ async def test_failure(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.view("view-idddd")(simple_listener) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_failure_2(self): @@ -127,12 +128,12 @@ async def test_failure_2(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app.view_submission("view-idddd")(simple_listener) response = await app.async_dispatch(request) assert response.status == 404 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) body = { diff --git a/tests/scenario_tests_async/test_workflow_steps.py b/tests/scenario_tests_async/test_workflow_steps.py index 0d36ef99b..cf88d46b4 100644 --- a/tests/scenario_tests_async/test_workflow_steps.py +++ b/tests/scenario_tests_async/test_workflow_steps.py @@ -18,6 +18,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count_async, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -82,7 +83,7 @@ async def test_edit(self): request = AsyncBoltRequest(body=body, headers=headers) response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app = self.build_app("copy_review___") response = await app.async_dispatch(request) @@ -101,7 +102,7 @@ async def test_edit_process_before_response(self): request = AsyncBoltRequest(body=body, headers=headers) response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app = self.build_process_before_response_app("copy_review___") response = await app.async_dispatch(request) @@ -120,7 +121,7 @@ async def test_save(self): request = AsyncBoltRequest(body=body, headers=headers) response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app = self.build_app("copy_review___") response = await app.async_dispatch(request) @@ -139,7 +140,7 @@ async def test_save_process_before_response(self): request = AsyncBoltRequest(body=body, headers=headers) response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) app = self.build_process_before_response_app("copy_review___") response = await app.async_dispatch(request) @@ -158,7 +159,7 @@ async def test_execute(self): request = AsyncBoltRequest(body=body, headers=headers) response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(0.5) assert self.mock_received_requests["/workflows.stepCompleted"] == 1 @@ -179,7 +180,7 @@ async def test_execute_process_before_response(self): request = AsyncBoltRequest(body=body, headers=headers) response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) await asyncio.sleep(0.5) assert self.mock_received_requests["/workflows.stepCompleted"] == 1 diff --git a/tests/slack_bolt/authorization/test_authorize.py b/tests/slack_bolt/authorization/test_authorize.py index 9dc613ded..eb5c02087 100644 --- a/tests/slack_bolt/authorization/test_authorize.py +++ b/tests/slack_bolt/authorization/test_authorize.py @@ -13,6 +13,7 @@ from tests.mock_web_api_server import ( cleanup_mock_web_api_server, setup_mock_web_api_server, + assert_auth_test_count, ) @@ -50,7 +51,7 @@ def test_installation_store_legacy(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) result = authorize( context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" @@ -58,7 +59,7 @@ def test_installation_store_legacy(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None - assert self.mock_received_requests["/auth.test"] == 2 + assert_auth_test_count(self, 2) def test_installation_store_cached_legacy(self): installation_store = LegacyMemoryInstallationStore() @@ -77,7 +78,7 @@ def test_installation_store_cached_legacy(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) result = authorize( context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" @@ -85,7 +86,7 @@ def test_installation_store_cached_legacy(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None - assert self.mock_received_requests["/auth.test"] == 1 # cached + assert_auth_test_count(self, 1) # cached def test_installation_store_bot_only(self): installation_store = BotOnlyMemoryInstallationStore() @@ -105,7 +106,7 @@ def test_installation_store_bot_only(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) result = authorize( context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" @@ -113,7 +114,7 @@ def test_installation_store_bot_only(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None - assert self.mock_received_requests["/auth.test"] == 2 + assert_auth_test_count(self, 2) def test_installation_store_cached_bot_only(self): installation_store = BotOnlyMemoryInstallationStore() @@ -134,7 +135,7 @@ def test_installation_store_cached_bot_only(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) result = authorize( context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" @@ -142,7 +143,7 @@ def test_installation_store_cached_bot_only(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None - assert self.mock_received_requests["/auth.test"] == 1 # cached + assert_auth_test_count(self, 1) # cached def test_installation_store(self): installation_store = MemoryInstallationStore() @@ -158,7 +159,7 @@ def test_installation_store(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token == "xoxp-valid" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) result = authorize( context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" @@ -166,7 +167,7 @@ def test_installation_store(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token == "xoxp-valid" - assert self.mock_received_requests["/auth.test"] == 2 + assert_auth_test_count(self, 2) def test_installation_store_cached(self): installation_store = MemoryInstallationStore() @@ -184,7 +185,7 @@ def test_installation_store_cached(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token == "xoxp-valid" - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) result = authorize( context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" @@ -192,7 +193,7 @@ def test_installation_store_cached(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token == "xoxp-valid" - assert self.mock_received_requests["/auth.test"] == 1 # cached + assert_auth_test_count(self, 1) # cached class LegacyMemoryInstallationStore(InstallationStore): diff --git a/tests/slack_bolt/oauth/test_oauth_flow.py b/tests/slack_bolt/oauth/test_oauth_flow.py index cbb119753..9be907b66 100644 --- a/tests/slack_bolt/oauth/test_oauth_flow.py +++ b/tests/slack_bolt/oauth/test_oauth_flow.py @@ -14,6 +14,7 @@ from tests.mock_web_api_server import ( cleanup_mock_web_api_server, setup_mock_web_api_server, + assert_auth_test_count, ) @@ -139,7 +140,7 @@ def test_handle_callback(self): request = BoltRequest(body=body, headers=headers) response = app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) def test_handle_callback_invalid_state(self): oauth_flow = OAuthFlow( diff --git a/tests/slack_bolt_async/authorization/test_async_authorize.py b/tests/slack_bolt_async/authorization/test_async_authorize.py index b1dfd4685..a19190ae5 100644 --- a/tests/slack_bolt_async/authorization/test_async_authorize.py +++ b/tests/slack_bolt_async/authorization/test_async_authorize.py @@ -19,6 +19,7 @@ from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, + assert_auth_test_count_async, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -68,7 +69,7 @@ async def test_installation_store_legacy(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) result = await authorize( context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" @@ -76,7 +77,7 @@ async def test_installation_store_legacy(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None - assert self.mock_received_requests["/auth.test"] == 2 + await assert_auth_test_count_async(self, 2) @pytest.mark.asyncio async def test_installation_store_cached_legacy(self): @@ -96,7 +97,7 @@ async def test_installation_store_cached_legacy(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) result = await authorize( context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" @@ -104,7 +105,7 @@ async def test_installation_store_cached_legacy(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None - assert self.mock_received_requests["/auth.test"] == 1 # cached + await assert_auth_test_count_async(self, 1) # cached @pytest.mark.asyncio async def test_installation_store_bot_only(self): @@ -125,7 +126,7 @@ async def test_installation_store_bot_only(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) result = await authorize( context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" @@ -133,7 +134,7 @@ async def test_installation_store_bot_only(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None - assert self.mock_received_requests["/auth.test"] == 2 + await assert_auth_test_count_async(self, 2) @pytest.mark.asyncio async def test_installation_store_cached_bot_only(self): @@ -155,7 +156,7 @@ async def test_installation_store_cached_bot_only(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) result = await authorize( context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" @@ -163,7 +164,7 @@ async def test_installation_store_cached_bot_only(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None - assert self.mock_received_requests["/auth.test"] == 1 # cached + await assert_auth_test_count_async(self, 1) # cached @pytest.mark.asyncio async def test_installation_store(self): @@ -181,7 +182,7 @@ async def test_installation_store(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token == "xoxp-valid" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) result = await authorize( context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" @@ -189,7 +190,7 @@ async def test_installation_store(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token == "xoxp-valid" - assert self.mock_received_requests["/auth.test"] == 2 + await assert_auth_test_count_async(self, 2) @pytest.mark.asyncio async def test_installation_store_cached(self): @@ -209,7 +210,7 @@ async def test_installation_store_cached(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token == "xoxp-valid" - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) result = await authorize( context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111" @@ -217,7 +218,7 @@ async def test_installation_store_cached(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token == "xoxp-valid" - assert self.mock_received_requests["/auth.test"] == 1 # cached + await assert_auth_test_count_async(self, 1) # cached class LegacyMemoryInstallationStore(AsyncInstallationStore): diff --git a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py index 090429bd3..2aecaf424 100644 --- a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py +++ b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py @@ -24,6 +24,7 @@ from tests.mock_web_api_server import ( cleanup_mock_web_api_server, setup_mock_web_api_server, + assert_auth_test_count_async, ) @@ -179,7 +180,7 @@ async def test_handle_callback(self): request = AsyncBoltRequest(body=body, headers=headers) response = await app.async_dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio async def test_handle_callback_invalid_state(self): diff --git a/tests/utils.py b/tests/utils.py index 185e41b42..bf642fbd9 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -4,8 +4,23 @@ def remove_os_env_temporarily() -> dict: old_env = os.environ.copy() os.environ.clear() + for key, value in old_env.items(): + if key.startswith("BOLT_PYTHON_"): + os.environ[key] = value return old_env def restore_os_env(old_env: dict) -> None: os.environ.update(old_env) + + +def get_mock_server_mode() -> str: + """Returns a str representing the mode. + + :return: threading/multiprocessing + """ + mode = os.environ.get("BOLT_PYTHON_MOCK_SERVER_MODE") + if mode is None: + return "multiprocessing" + else: + return mode From ab9619630281b0563c7ae95068f89fd72602bf76 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 27 Jan 2021 14:13:48 +0900 Subject: [PATCH 118/719] Add Workflow step decorator --- .../async_steps_from_apps.py | 2 +- .../async_steps_from_apps_decorator.py | 201 ++++++++ .../async_steps_from_apps_primitive.py | 2 +- .../{ => workflow_steps}/steps_from_apps.py | 2 +- .../steps_from_apps_decorator.py | 200 ++++++++ .../steps_from_apps_primitive.py | 2 +- slack_bolt/app/app.py | 12 +- slack_bolt/app/async_app.py | 16 +- slack_bolt/workflows/step/async_step.py | 320 +++++++++++-- slack_bolt/workflows/step/internals.py | 6 + slack_bolt/workflows/step/step.py | 299 ++++++++++-- .../test_workflow_steps_decorator_simple.py | 425 +++++++++++++++++ ...test_workflow_steps_decorator_with_args.py | 429 +++++++++++++++++ .../test_workflow_steps_decorator_simple.py | 447 +++++++++++++++++ ...test_workflow_steps_decorator_with_args.py | 451 ++++++++++++++++++ 15 files changed, 2720 insertions(+), 94 deletions(-) rename examples/{ => workflow_steps}/async_steps_from_apps.py (99%) create mode 100644 examples/workflow_steps/async_steps_from_apps_decorator.py rename examples/{ => workflow_steps}/async_steps_from_apps_primitive.py (99%) rename examples/{ => workflow_steps}/steps_from_apps.py (99%) create mode 100644 examples/workflow_steps/steps_from_apps_decorator.py rename examples/{ => workflow_steps}/steps_from_apps_primitive.py (99%) create mode 100644 slack_bolt/workflows/step/internals.py create mode 100644 tests/scenario_tests/test_workflow_steps_decorator_simple.py create mode 100644 tests/scenario_tests/test_workflow_steps_decorator_with_args.py create mode 100644 tests/scenario_tests_async/test_workflow_steps_decorator_simple.py create mode 100644 tests/scenario_tests_async/test_workflow_steps_decorator_with_args.py diff --git a/examples/async_steps_from_apps.py b/examples/workflow_steps/async_steps_from_apps.py similarity index 99% rename from examples/async_steps_from_apps.py rename to examples/workflow_steps/async_steps_from_apps.py index 061012eb0..05b7801a7 100644 --- a/examples/async_steps_from_apps.py +++ b/examples/workflow_steps/async_steps_from_apps.py @@ -2,7 +2,7 @@ # instead of slack_bolt in requirements.txt import sys -sys.path.insert(1, "..") +sys.path.insert(1, "../..") # ------------------------------------------------ import logging diff --git a/examples/workflow_steps/async_steps_from_apps_decorator.py b/examples/workflow_steps/async_steps_from_apps_decorator.py new file mode 100644 index 000000000..e4f6b3194 --- /dev/null +++ b/examples/workflow_steps/async_steps_from_apps_decorator.py @@ -0,0 +1,201 @@ +# ------------------------------------------------ +# instead of slack_bolt in requirements.txt +import sys + +sys.path.insert(1, "../..") +# ------------------------------------------------ + +import asyncio +import logging + +from slack_sdk.web.async_client import AsyncSlackResponse, AsyncWebClient +from slack_bolt.async_app import AsyncApp, AsyncAck +from slack_bolt.workflows.step.async_step import ( + AsyncConfigure, + AsyncUpdate, + AsyncComplete, + AsyncFail, + AsyncWorkflowStep, +) + +logging.basicConfig(level=logging.DEBUG) + +# export SLACK_SIGNING_SECRET=*** +# export SLACK_BOT_TOKEN=xoxb-*** +app = AsyncApp() + + +# https://api.slack.com/tutorials/workflow-builder-steps + +copy_review_step = AsyncWorkflowStep.builder("copy_review") + + +@copy_review_step.edit +async def edit(ack: AsyncAck, step: dict, configure: AsyncConfigure): + await ack() + await configure( + blocks=[ + { + "type": "section", + "block_id": "intro-section", + "text": { + "type": "plain_text", + "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", + }, + }, + { + "type": "input", + "block_id": "task_name_input", + "element": { + "type": "plain_text_input", + "action_id": "task_name", + "placeholder": { + "type": "plain_text", + "text": "Write a task name", + }, + }, + "label": {"type": "plain_text", "text": "Task name"}, + }, + { + "type": "input", + "block_id": "task_description_input", + "element": { + "type": "plain_text_input", + "action_id": "task_description", + "placeholder": { + "type": "plain_text", + "text": "Write a description for your task", + }, + }, + "label": {"type": "plain_text", "text": "Task description"}, + }, + { + "type": "input", + "block_id": "task_author_input", + "element": { + "type": "plain_text_input", + "action_id": "task_author", + "placeholder": { + "type": "plain_text", + "text": "Write a task name", + }, + }, + "label": {"type": "plain_text", "text": "Task author"}, + }, + ] + ) + + +@copy_review_step.save +async def save(ack: AsyncAck, view: dict, update: AsyncUpdate): + state_values = view["state"]["values"] + await update( + inputs={ + "taskName": { + "value": state_values["task_name_input"]["task_name"]["value"], + }, + "taskDescription": { + "value": state_values["task_description_input"]["task_description"][ + "value" + ], + }, + "taskAuthorEmail": { + "value": state_values["task_author_input"]["task_author"]["value"], + }, + }, + outputs=[ + { + "name": "taskName", + "type": "text", + "label": "Task Name", + }, + { + "name": "taskDescription", + "type": "text", + "label": "Task Description", + }, + { + "name": "taskAuthorEmail", + "type": "text", + "label": "Task Author Email", + }, + ], + ) + await ack() + + +pseudo_database = {} + + +async def additional_matcher(step): + email = str(step.get("inputs", {}).get("taskAuthorEmail")) + if "@" not in email: + return False + return True + + +async def noop_middleware(next): + return await next() + + +async def notify_execution(client: AsyncWebClient, step: dict): + await asyncio.sleep(5) + await client.chat_postMessage( + channel="#random", text=f"Step execution: ```{step}```" + ) + + +@copy_review_step.execute( + matchers=[additional_matcher], + middleware=[noop_middleware], + lazy=[notify_execution], +) +async def execute( + step: dict, client: AsyncWebClient, complete: AsyncComplete, fail: AsyncFail +): + try: + await complete( + outputs={ + "taskName": step["inputs"]["taskName"]["value"], + "taskDescription": step["inputs"]["taskDescription"]["value"], + "taskAuthorEmail": step["inputs"]["taskAuthorEmail"]["value"], + } + ) + user_lookup: AsyncSlackResponse = await client.users_lookupByEmail( + email=step["inputs"]["taskAuthorEmail"]["value"] + ) + user_id = user_lookup["user"]["id"] + new_task = { + "task_name": step["inputs"]["taskName"]["value"], + "task_description": step["inputs"]["taskDescription"]["value"], + } + tasks = pseudo_database.get(user_id, []) + tasks.append(new_task) + pseudo_database[user_id] = tasks + + blocks = [] + for task in tasks: + blocks.append( + { + "type": "section", + "text": {"type": "plain_text", "text": task["task_name"]}, + } + ) + blocks.append({"type": "divider"}) + + await client.views_publish( + user_id=user_id, + view={ + "type": "home", + "title": {"type": "plain_text", "text": "Your tasks!"}, + "blocks": blocks, + }, + ) + except Exception as err: + await fail(error={"message": f"Something wrong! {err}"}) + + +app.step(copy_review_step) + +if __name__ == "__main__": + app.start(3000) # POST http://localhost:3000/slack/events diff --git a/examples/async_steps_from_apps_primitive.py b/examples/workflow_steps/async_steps_from_apps_primitive.py similarity index 99% rename from examples/async_steps_from_apps_primitive.py rename to examples/workflow_steps/async_steps_from_apps_primitive.py index 905fc38a8..b9da584e9 100644 --- a/examples/async_steps_from_apps_primitive.py +++ b/examples/workflow_steps/async_steps_from_apps_primitive.py @@ -2,7 +2,7 @@ # instead of slack_bolt in requirements.txt import sys -sys.path.insert(1, "..") +sys.path.insert(1, "../..") # ------------------------------------------------ import logging diff --git a/examples/steps_from_apps.py b/examples/workflow_steps/steps_from_apps.py similarity index 99% rename from examples/steps_from_apps.py rename to examples/workflow_steps/steps_from_apps.py index 26cc9665a..a34807d99 100644 --- a/examples/steps_from_apps.py +++ b/examples/workflow_steps/steps_from_apps.py @@ -2,7 +2,7 @@ # instead of slack_bolt in requirements.txt import sys -sys.path.insert(1, "..") +sys.path.insert(1, "../..") # ------------------------------------------------ import logging diff --git a/examples/workflow_steps/steps_from_apps_decorator.py b/examples/workflow_steps/steps_from_apps_decorator.py new file mode 100644 index 000000000..64946b4a3 --- /dev/null +++ b/examples/workflow_steps/steps_from_apps_decorator.py @@ -0,0 +1,200 @@ +# ------------------------------------------------ +# instead of slack_bolt in requirements.txt +import sys + +sys.path.insert(1, "../..") +# ------------------------------------------------ + +import time +import logging + +from slack_sdk import WebClient +from slack_sdk.web import SlackResponse + +from slack_bolt import App, Ack +from slack_bolt.workflows.step import Configure, Update, Complete, Fail, WorkflowStep + +logging.basicConfig(level=logging.DEBUG) + +# export SLACK_SIGNING_SECRET=*** +# export SLACK_BOT_TOKEN=xoxb-*** +app = App() + + +@app.middleware # or app.use(log_request) +def log_request(logger, body, next): + logger.debug(body) + return next() + + +# https://api.slack.com/tutorials/workflow-builder-steps + +copy_review_step = WorkflowStep.builder("copy_review") + + +@copy_review_step.edit +def edit(ack: Ack, step, configure: Configure): + ack() + configure( + blocks=[ + { + "type": "section", + "block_id": "intro-section", + "text": { + "type": "plain_text", + "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", + }, + }, + { + "type": "input", + "block_id": "task_name_input", + "element": { + "type": "plain_text_input", + "action_id": "task_name", + "placeholder": { + "type": "plain_text", + "text": "Write a task name", + }, + }, + "label": {"type": "plain_text", "text": "Task name"}, + }, + { + "type": "input", + "block_id": "task_description_input", + "element": { + "type": "plain_text_input", + "action_id": "task_description", + "placeholder": { + "type": "plain_text", + "text": "Write a description for your task", + }, + }, + "label": {"type": "plain_text", "text": "Task description"}, + }, + { + "type": "input", + "block_id": "task_author_input", + "element": { + "type": "plain_text_input", + "action_id": "task_author", + "placeholder": { + "type": "plain_text", + "text": "Write a task name", + }, + }, + "label": {"type": "plain_text", "text": "Task author"}, + }, + ] + ) + + +@copy_review_step.save +def save(ack: Ack, step: dict, view: dict, update: Update): + state_values = view["state"]["values"] + update( + inputs={ + "taskName": { + "value": state_values["task_name_input"]["task_name"]["value"], + }, + "taskDescription": { + "value": state_values["task_description_input"]["task_description"][ + "value" + ], + }, + "taskAuthorEmail": { + "value": state_values["task_author_input"]["task_author"]["value"], + }, + }, + outputs=[ + { + "name": "taskName", + "type": "text", + "label": "Task Name", + }, + { + "name": "taskDescription", + "type": "text", + "label": "Task Description", + }, + { + "name": "taskAuthorEmail", + "type": "text", + "label": "Task Author Email", + }, + ], + ) + ack() + + +pseudo_database = {} + + +def additional_matcher(step): + email = str(step.get("inputs", {}).get("taskAuthorEmail")) + if "@" not in email: + return False + return True + + +def noop_middleware(next): + return next() + + +def notify_execution(client: WebClient, step: dict): + time.sleep(5) + client.chat_postMessage(channel="#random", text=f"Step execution: ```{step}```") + + +@copy_review_step.execute( + matchers=[additional_matcher], + middleware=[noop_middleware], + lazy=[notify_execution], +) +def execute(step: dict, client: WebClient, complete: Complete, fail: Fail): + try: + complete( + outputs={ + "taskName": step["inputs"]["taskName"]["value"], + "taskDescription": step["inputs"]["taskDescription"]["value"], + "taskAuthorEmail": step["inputs"]["taskAuthorEmail"]["value"], + } + ) + + user_lookup: SlackResponse = client.users_lookupByEmail( + email=step["inputs"]["taskAuthorEmail"]["value"] + ) + user_id = user_lookup["user"]["id"] + new_task = { + "task_name": step["inputs"]["taskName"]["value"], + "task_description": step["inputs"]["taskDescription"]["value"], + } + tasks = pseudo_database.get(user_id, []) + tasks.append(new_task) + pseudo_database[user_id] = tasks + + blocks = [] + for task in tasks: + blocks.append( + { + "type": "section", + "text": {"type": "plain_text", "text": task["task_name"]}, + } + ) + blocks.append({"type": "divider"}) + + client.views_publish( + user_id=user_id, + view={ + "type": "home", + "title": {"type": "plain_text", "text": "Your tasks!"}, + "blocks": blocks, + }, + ) + except Exception as err: + fail(error={"message": f"Something wrong! {err}"}) + + +app.step(copy_review_step) + +if __name__ == "__main__": + app.start(3000) # POST http://localhost:3000/slack/events diff --git a/examples/steps_from_apps_primitive.py b/examples/workflow_steps/steps_from_apps_primitive.py similarity index 99% rename from examples/steps_from_apps_primitive.py rename to examples/workflow_steps/steps_from_apps_primitive.py index efd206eda..1777a784c 100644 --- a/examples/steps_from_apps_primitive.py +++ b/examples/workflow_steps/steps_from_apps_primitive.py @@ -2,7 +2,7 @@ # instead of slack_bolt in requirements.txt import sys -sys.path.insert(1, "..") +sys.path.insert(1, "../..") # ------------------------------------------------ import logging diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 7d8678954..fa5ec277e 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -67,6 +67,7 @@ get_name_for_callable, ) from slack_bolt.workflows.step import WorkflowStep, WorkflowStepMiddleware +from slack_bolt.workflows.step.step import WorkflowStepBuilder class App: @@ -422,7 +423,7 @@ def middleware(self, *args) -> Optional[Callable]: def step( self, - callback_id: Union[str, Pattern, WorkflowStep], + callback_id: Union[str, Pattern, WorkflowStep, WorkflowStepBuilder], edit: Optional[ Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]] ] = None, @@ -433,7 +434,10 @@ def step( Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]] ] = None, ): - """Registers a new Workflow Step listener""" + """Registers a new Workflow Step listener + Unlike others, this method doesn't behave as a decorator. If you want to register a workflow step + by a decorator, use WorkflowStepBuilder's methods. + """ step = callback_id if isinstance(callback_id, (str, Pattern)): step = WorkflowStep( @@ -442,8 +446,10 @@ def step( save=save, execute=execute, ) + elif isinstance(step, WorkflowStepBuilder): + step = step.build() elif not isinstance(step, WorkflowStep): - raise BoltError("Invalid step object") + raise BoltError(f"Invalid step object ({type(step)})") self.use(WorkflowStepMiddleware(step, self.listener_runner)) diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index bf3b63b68..f28a4b7ff 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -13,7 +13,10 @@ ) from slack_bolt.oauth.async_internals import select_consistent_installation_store from slack_bolt.util.utils import get_name_for_callable -from slack_bolt.workflows.step.async_step import AsyncWorkflowStep +from slack_bolt.workflows.step.async_step import ( + AsyncWorkflowStep, + AsyncWorkflowStepBuilder, +) from slack_bolt.workflows.step.async_step_middleware import AsyncWorkflowStepMiddleware from slack_sdk.oauth.installation_store.async_installation_store import ( AsyncInstallationStore, @@ -462,7 +465,7 @@ def middleware(self, *args) -> Optional[Callable]: def step( self, - callback_id: Union[str, Pattern, AsyncWorkflowStep], + callback_id: Union[str, Pattern, AsyncWorkflowStep, AsyncWorkflowStepBuilder], edit: Optional[ Union[ Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable] @@ -479,7 +482,10 @@ def step( ] ] = None, ): - """Registers a new Workflow Step listener""" + """Registers a new Workflow Step listener + Unlike others, this method doesn't behave as a decorator. If you want to register a workflow step + by a decorator, use AsyncWorkflowStepBuilder's methods. + """ step = callback_id if isinstance(callback_id, (str, Pattern)): step = AsyncWorkflowStep( @@ -488,8 +494,10 @@ def step( save=save, execute=execute, ) + elif isinstance(step, AsyncWorkflowStepBuilder): + step = step.build() elif not isinstance(step, AsyncWorkflowStep): - raise BoltError("Invalid step object") + raise BoltError(f"Invalid step object ({type(step)})") self.use(AsyncWorkflowStepMiddleware(step, self._async_listener_runner)) diff --git a/slack_bolt/workflows/step/async_step.py b/slack_bolt/workflows/step/async_step.py index a8b4573d7..8f6c5afdf 100644 --- a/slack_bolt/workflows/step/async_step.py +++ b/slack_bolt/workflows/step/async_step.py @@ -1,4 +1,7 @@ -from typing import Callable, Union, Optional, Awaitable, Sequence +from functools import wraps +from typing import Callable, Union, Optional, Awaitable, Sequence, List, Pattern + +from slack_sdk.web.async_client import AsyncWebClient from slack_bolt.context.async_context import AsyncBoltContext from slack_bolt.listener.async_listener import AsyncListener, AsyncCustomListener @@ -9,17 +12,241 @@ ) from slack_bolt.middleware.async_custom_middleware import AsyncCustomMiddleware from slack_bolt.response import BoltResponse -from slack_sdk.web.async_client import AsyncWebClient +from .internals import _is_used_without_argument +from .utilities.async_complete import AsyncComplete from .utilities.async_configure import AsyncConfigure from .utilities.async_fail import AsyncFail -from .utilities.async_complete import AsyncComplete from .utilities.async_update import AsyncUpdate -from ...listener_matcher.async_listener_matcher import AsyncListenerMatcher +from ...error import BoltError +from ...listener_matcher.async_listener_matcher import ( + AsyncListenerMatcher, + AsyncCustomListenerMatcher, +) from ...middleware.async_middleware import AsyncMiddleware +class AsyncWorkflowStepBuilder: + callback_id: Union[str, Pattern] + _edit: Optional[AsyncListener] + _save: Optional[AsyncListener] + _execute: Optional[AsyncListener] + + def __init__( + self, + callback_id: Union[str, Pattern], + app_name: Optional[str] = None, + ): + """This builder is supposed to be used as decorator. + my_step = AsyncWorkflowStep.builder("my_step") + @my_step.edit + async def edit_my_step(ack, configure): + pass + @my_step.save + async def save_my_step(ack, step, update): + pass + @my_step.execute + async def execute_my_step(step, complete, fail): + pass + app.step(my_step) + :param callback_id: the callback_id for the workflow + :param app_name: the application name mainly for logging + """ + self.callback_id = callback_id + self.app_name = app_name or __name__ + self._edit = None + self._save = None + self._execute = None + + def edit( + self, + *args, + matchers: Optional[ + Union[Callable[..., Awaitable[bool]], AsyncListenerMatcher] + ] = None, + middleware: Optional[Union[Callable, AsyncMiddleware]] = None, + lazy: Optional[List[Callable[..., Awaitable[None]]]] = None, + ): + """Register a new edit listener with details. + You can use this method as decorator as well. + @my_step.edit + def edit_my_step(ack, configure): + pass + It's also possible to add additional listener matchers and/or middleware + @my_step.edit(matchers=[is_valid], middleware=[update_context]) + def edit_my_step(ack, configure): + pass + """ + if _is_used_without_argument(args): + func = args[0] + self._edit = self._to_listener("edit", func, matchers, middleware) + return func + + def _inner(func): + functions = [func] + (lazy if lazy is not None else []) + self._edit = self._to_listener("edit", functions, matchers, middleware) + + @wraps(func) + async def _wrapper(*args, **kwargs): + return await func(*args, **kwargs) + + return _wrapper + + return _inner + + def save( + self, + *args, + matchers: Optional[ + Union[Callable[..., Awaitable[bool]], AsyncListenerMatcher] + ] = None, + middleware: Optional[Union[Callable, AsyncMiddleware]] = None, + lazy: Optional[List[Callable[..., Awaitable[None]]]] = None, + ): + """Register a new save listener with details. + You can use this method as decorator as well. + @my_step.save + def save_my_step(ack, step, update): + pass + It's also possible to add additional listener matchers and/or middleware + @my_step.save(matchers=[is_valid], middleware=[update_context]) + def save_my_step(ack, step, update): + pass + """ + + if _is_used_without_argument(args): + func = args[0] + self._save = self._to_listener("save", func, matchers, middleware) + return func + + def _inner(func): + functions = [func] + (lazy if lazy is not None else []) + self._save = self._to_listener("save", functions, matchers, middleware) + + @wraps(func) + async def _wrapper(*args, **kwargs): + return await func(*args, **kwargs) + + return _wrapper + + return _inner + + def execute( + self, + *args, + matchers: Optional[ + Union[Callable[..., Awaitable[bool]], AsyncListenerMatcher] + ] = None, + middleware: Optional[Union[Callable, AsyncMiddleware]] = None, + lazy: Optional[List[Callable[..., Awaitable[None]]]] = None, + ): + """Register a new execute listener with details. + You can use this method as decorator as well. + @my_step.execute + def execute_my_step(step, complete, fail): + pass + It's also possible to add additional listener matchers and/or middleware + @my_step.save(matchers=[is_valid], middleware=[update_context]) + def execute_my_step(step, complete, fail): + pass + """ + + if _is_used_without_argument(args): + func = args[0] + self._execute = self._to_listener("execute", func, matchers, middleware) + return func + + def _inner(func): + functions = [func] + (lazy if lazy is not None else []) + self._execute = self._to_listener( + "execute", functions, matchers, middleware + ) + + @wraps(func) + async def _wrapper(*args, **kwargs): + return await func(*args, **kwargs) + + return _wrapper + + return _inner + + def build(self) -> "AsyncWorkflowStep": + """Constructs a WorkflowStep object. This method may raise an exception + if the builder doesn't have enough configurations to build the object. + :return: WorkflowStep object + """ + if self._edit is None: + raise BoltError(f"edit listener is not registered") + if self._save is None: + raise BoltError(f"save listener is not registered") + if self._execute is None: + raise BoltError(f"execute listener is not registered") + + return AsyncWorkflowStep( + callback_id=self.callback_id, + edit=self._edit, + save=self._save, + execute=self._execute, + app_name=self.app_name, + ) + + # --------------------------------------- + + def _to_listener( + self, + name: str, + listener_or_functions: Union[AsyncListener, Callable, List[Callable]], + matchers: Optional[ + Union[Callable[..., Awaitable[bool]], AsyncListenerMatcher] + ] = None, + middleware: Optional[Union[Callable, AsyncMiddleware]] = None, + ) -> AsyncListener: + return AsyncWorkflowStep.build_listener( + callback_id=self.callback_id, + app_name=self.app_name, + listener_or_functions=listener_or_functions, + name=name, + matchers=self.to_listener_matchers(self.app_name, matchers), + middleware=self.to_listener_middleware(self.app_name, middleware), + ) + + @staticmethod + def to_listener_matchers( + app_name: str, + matchers: Optional[ + List[Union[Callable[..., Awaitable[bool]], AsyncListenerMatcher]] + ], + ) -> List[AsyncListenerMatcher]: + _matchers = [] + if matchers is not None: + for m in matchers: + if isinstance(m, AsyncListenerMatcher): + _matchers.append(m) + elif isinstance(m, Callable): + _matchers.append( + AsyncCustomListenerMatcher(app_name=app_name, func=m) + ) + else: + raise ValueError(f"Invalid matcher: {type(m)}") + return _matchers # type: ignore + + @staticmethod + def to_listener_middleware( + app_name: str, middleware: Optional[List[Union[Callable, AsyncMiddleware]]] + ) -> List[AsyncMiddleware]: + _middleware = [] + if middleware is not None: + for m in middleware: + if isinstance(m, AsyncMiddleware): + _middleware.append(m) + elif isinstance(m, Callable): + _middleware.append(AsyncCustomMiddleware(app_name=app_name, func=m)) + else: + raise ValueError(f"Invalid middleware: {type(m)}") + return _middleware # type: ignore + + class AsyncWorkflowStep: - callback_id: str + callback_id: Union[str, Pattern] edit: AsyncListener save: AsyncListener execute: AsyncListener @@ -27,7 +254,7 @@ class AsyncWorkflowStep: def __init__( self, *, - callback_id: str, + callback_id: Union[str, Pattern], edit: Union[ Callable[..., Awaitable[BoltResponse]], AsyncListener, Sequence[Callable] ], @@ -41,66 +268,73 @@ def __init__( ): self.callback_id = callback_id app_name = app_name or __name__ - self.edit = self._build_listener(callback_id, app_name, edit, "edit") - self.save = self._build_listener(callback_id, app_name, save, "save") - self.execute = self._build_listener(callback_id, app_name, execute, "execute") + self.edit = self.build_listener(callback_id, app_name, edit, "edit") + self.save = self.build_listener(callback_id, app_name, save, "save") + self.execute = self.build_listener(callback_id, app_name, execute, "execute") + + @classmethod + def builder(cls, callback_id: Union[str, Pattern]) -> AsyncWorkflowStepBuilder: + return AsyncWorkflowStepBuilder(callback_id) @classmethod - def _build_listener( + def build_listener( cls, - callback_id: str, + callback_id: Union[str, Pattern], app_name: str, - listener: AsyncListener, + listener_or_functions: Union[AsyncListener, Callable, List[Callable]], name: str, - ) -> AsyncListener: - if isinstance(listener, AsyncListener): - return listener - elif isinstance(listener, Callable): - return AsyncCustomListener( - app_name=app_name, - matchers=cls._build_matchers(name, callback_id), - middleware=cls._build_middleware(name, callback_id), - ack_function=listener, - lazy_functions=[], - auto_acknowledgement=name == "execute", - ) - elif isinstance(listener, list) and len(listener) > 0: - ack = listener.pop(0) - lazy = listener + matchers: Optional[List[AsyncListenerMatcher]] = None, + middleware: Optional[List[AsyncMiddleware]] = None, + ): + if listener_or_functions is None: + raise BoltError(f"{name} listener is required (callback_id: {callback_id})") + + if isinstance(listener_or_functions, Callable): + listener_or_functions = [listener_or_functions] + + if isinstance(listener_or_functions, AsyncListener): + return listener_or_functions + elif isinstance(listener_or_functions, list): + matchers = matchers if matchers else [] + matchers.insert(0, cls._build_primary_matcher(name, callback_id)) + middleware = middleware if middleware else [] + middleware.insert(0, cls._build_single_middleware(name, callback_id)) + functions = listener_or_functions + ack_function = functions.pop(0) return AsyncCustomListener( app_name=app_name, - matchers=cls._build_matchers(name, callback_id), - middleware=cls._build_middleware(name, callback_id), - ack_function=ack, - lazy_functions=lazy, + matchers=matchers, + middleware=middleware, + ack_function=ack_function, + lazy_functions=functions, auto_acknowledgement=name == "execute", ) else: - raise ValueError(f"Invalid `{name}` listener") + raise BoltError( + f"Invalid {name} listener: {type(listener_or_functions)} detected (callback_id: {callback_id})" + ) @classmethod - def _build_matchers( + def _build_primary_matcher( cls, name: str, callback_id: str - ) -> Sequence[AsyncListenerMatcher]: + ) -> AsyncListenerMatcher: if name == "edit": - return [workflow_step_edit(callback_id, asyncio=True)] + return workflow_step_edit(callback_id, asyncio=True) elif name == "save": - return [workflow_step_save(callback_id, asyncio=True)] + return workflow_step_save(callback_id, asyncio=True) elif name == "execute": - return [workflow_step_execute(callback_id, asyncio=True)] + return workflow_step_execute(callback_id, asyncio=True) else: raise ValueError(f"Invalid name {name}") @classmethod - def _build_middleware( - cls, name: str, callback_id: str - ) -> Sequence[AsyncMiddleware]: + def _build_single_middleware(cls, name: str, callback_id: str) -> AsyncMiddleware: if name == "edit": - return [_build_edit_listener_middleware(callback_id)] + return _build_edit_listener_middleware(callback_id) elif name == "save": - return [_build_save_listener_middleware()] + return _build_save_listener_middleware() elif name == "execute": - return [_build_execute_listener_middleware()] + return _build_execute_listener_middleware() else: raise ValueError(f"Invalid name {name}") diff --git a/slack_bolt/workflows/step/internals.py b/slack_bolt/workflows/step/internals.py new file mode 100644 index 000000000..24363cf16 --- /dev/null +++ b/slack_bolt/workflows/step/internals.py @@ -0,0 +1,6 @@ +def _is_used_without_argument(args): + """Tests if a decorator invocation is without () or (args). + :param args: arguments + :return: True if it's an invocation without args + """ + return len(args) == 1 diff --git a/slack_bolt/workflows/step/step.py b/slack_bolt/workflows/step/step.py index 0e1954294..286bc0b9c 100644 --- a/slack_bolt/workflows/step/step.py +++ b/slack_bolt/workflows/step/step.py @@ -1,8 +1,10 @@ -from typing import Callable, Union, Optional, Sequence +from functools import wraps +from typing import Callable, Union, Optional, Sequence, Pattern, List -from slack_bolt.context import BoltContext +from slack_bolt.context.context import BoltContext +from slack_bolt.error import BoltError from slack_bolt.listener import Listener, CustomListener -from slack_bolt.listener_matcher import ListenerMatcher +from slack_bolt.listener_matcher import ListenerMatcher, CustomListenerMatcher from slack_bolt.listener_matcher.builtins import ( workflow_step_edit, workflow_step_save, @@ -10,6 +12,7 @@ ) from slack_bolt.middleware import CustomMiddleware, Middleware from slack_bolt.response import BoltResponse +from slack_bolt.workflows.step.internals import _is_used_without_argument from slack_bolt.workflows.step.utilities.complete import Complete from slack_bolt.workflows.step.utilities.configure import Configure from slack_bolt.workflows.step.utilities.fail import Fail @@ -17,8 +20,217 @@ from slack_sdk.web import WebClient +class WorkflowStepBuilder: + callback_id: Union[str, Pattern] + _edit: Optional[Listener] + _save: Optional[Listener] + _execute: Optional[Listener] + + def __init__( + self, + callback_id: Union[str, Pattern], + app_name: Optional[str] = None, + ): + """This builder is supposed to be used as decorator. + my_step = WorkflowStep.builder("my_step") + @my_step.edit + def edit_my_step(ack, configure): + pass + @my_step.save + def save_my_step(ack, step, update): + pass + @my_step.execute + def execute_my_step(step, complete, fail): + pass + app.step(my_step) + :param callback_id: the callback_id for the workflow + :param app_name: the application name mainly for logging + """ + self.callback_id = callback_id + self.app_name = app_name or __name__ + self._edit = None + self._save = None + self._execute = None + + def edit( + self, + *args, + matchers: Optional[Union[Callable[..., bool], ListenerMatcher]] = None, + middleware: Optional[Union[Callable, Middleware]] = None, + lazy: Optional[List[Callable[..., None]]] = None, + ): + """Register a new edit listener with details. + You can use this method as decorator as well. + @my_step.edit + def edit_my_step(ack, configure): + pass + It's also possible to add additional listener matchers and/or middleware + @my_step.edit(matchers=[is_valid], middleware=[update_context]) + def edit_my_step(ack, configure): + pass + """ + + if _is_used_without_argument(args): + func = args[0] + self._edit = self._to_listener("edit", func, matchers, middleware) + return func + + def _inner(func): + functions = [func] + (lazy if lazy is not None else []) + self._edit = self._to_listener("edit", functions, matchers, middleware) + + @wraps(func) + def _wrapper(*args, **kwargs): + return func(*args, **kwargs) + + return _wrapper + + return _inner + + def save( + self, + *args, + matchers: Optional[Union[Callable[..., bool], ListenerMatcher]] = None, + middleware: Optional[Union[Callable, Middleware]] = None, + lazy: Optional[List[Callable[..., None]]] = None, + ): + """Register a new save listener with details. + You can use this method as decorator as well. + @my_step.save + def save_my_step(ack, step, update): + pass + It's also possible to add additional listener matchers and/or middleware + @my_step.save(matchers=[is_valid], middleware=[update_context]) + def save_my_step(ack, step, update): + pass + """ + + if _is_used_without_argument(args): + func = args[0] + self._save = self._to_listener("save", func, matchers, middleware) + return func + + def _inner(func): + functions = [func] + (lazy if lazy is not None else []) + self._save = self._to_listener("save", functions, matchers, middleware) + + @wraps(func) + def _wrapper(*args, **kwargs): + return func(*args, **kwargs) + + return _wrapper + + return _inner + + def execute( + self, + *args, + matchers: Optional[Union[Callable[..., bool], ListenerMatcher]] = None, + middleware: Optional[Union[Callable, Middleware]] = None, + lazy: Optional[List[Callable[..., None]]] = None, + ): + """Register a new execute listener with details. + You can use this method as decorator as well. + @my_step.execute + def execute_my_step(step, complete, fail): + pass + It's also possible to add additional listener matchers and/or middleware + @my_step.save(matchers=[is_valid], middleware=[update_context]) + def execute_my_step(step, complete, fail): + pass + """ + + if _is_used_without_argument(args): + func = args[0] + self._execute = self._to_listener("execute", func, matchers, middleware) + return func + + def _inner(func): + functions = [func] + (lazy if lazy is not None else []) + self._execute = self._to_listener( + "execute", functions, matchers, middleware + ) + + @wraps(func) + def _wrapper(*args, **kwargs): + return func(*args, **kwargs) + + return _wrapper + + return _inner + + def build(self) -> "WorkflowStep": + """Constructs a WorkflowStep object. This method may raise an exception + if the builder doesn't have enough configurations to build the object. + :return: WorkflowStep object + """ + if self._edit is None: + raise BoltError(f"edit listener is not registered") + if self._save is None: + raise BoltError(f"save listener is not registered") + if self._execute is None: + raise BoltError(f"execute listener is not registered") + + return WorkflowStep( + callback_id=self.callback_id, + edit=self._edit, + save=self._save, + execute=self._execute, + app_name=self.app_name, + ) + + # --------------------------------------- + + def _to_listener( + self, + name: str, + listener_or_functions: Union[Listener, Callable, List[Callable]], + matchers: Optional[Union[Callable[..., bool], ListenerMatcher]] = None, + middleware: Optional[Union[Callable, Middleware]] = None, + ) -> Listener: + return WorkflowStep.build_listener( + callback_id=self.callback_id, + app_name=self.app_name, + listener_or_functions=listener_or_functions, + name=name, + matchers=self.to_listener_matchers(self.app_name, matchers), + middleware=self.to_listener_middleware(self.app_name, middleware), + ) + + @staticmethod + def to_listener_matchers( + app_name: str, + matchers: Optional[List[Union[Callable[..., bool], ListenerMatcher]]], + ) -> List[ListenerMatcher]: + _matchers = [] + if matchers is not None: + for m in matchers: + if isinstance(m, ListenerMatcher): + _matchers.append(m) + elif isinstance(m, Callable): + _matchers.append(CustomListenerMatcher(app_name=app_name, func=m)) + else: + raise ValueError(f"Invalid matcher: {type(m)}") + return _matchers # type: ignore + + @staticmethod + def to_listener_middleware( + app_name: str, middleware: Optional[List[Union[Callable, Middleware]]] + ) -> List[Middleware]: + _middleware = [] + if middleware is not None: + for m in middleware: + if isinstance(m, Middleware): + _middleware.append(m) + elif isinstance(m, Callable): + _middleware.append(CustomMiddleware(app_name=app_name, func=m)) + else: + raise ValueError(f"Invalid middleware: {type(m)}") + return _middleware # type: ignore + + class WorkflowStep: - callback_id: str + callback_id: Union[str, Pattern] edit: Listener save: Listener execute: Listener @@ -26,7 +238,7 @@ class WorkflowStep: def __init__( self, *, - callback_id: str, + callback_id: Union[str, Pattern], edit: Union[ Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable] ], @@ -40,64 +252,71 @@ def __init__( ): self.callback_id = callback_id app_name = app_name or __name__ - self.edit = self._build_listener(callback_id, app_name, edit, "edit") - self.save = self._build_listener(callback_id, app_name, save, "save") - self.execute = self._build_listener(callback_id, app_name, execute, "execute") + self.edit = self.build_listener(callback_id, app_name, edit, "edit") + self.save = self.build_listener(callback_id, app_name, save, "save") + self.execute = self.build_listener(callback_id, app_name, execute, "execute") @classmethod - def _build_listener( + def builder(cls, callback_id: Union[str, Pattern]) -> WorkflowStepBuilder: + return WorkflowStepBuilder(callback_id) + + @classmethod + def build_listener( cls, - callback_id: str, + callback_id: Union[str, Pattern], app_name: str, - listener: Union[ - Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable] - ], + listener_or_functions: Union[Listener, Callable, List[Callable]], name: str, + matchers: Optional[List[ListenerMatcher]] = None, + middleware: Optional[List[Middleware]] = None, ) -> Listener: - if isinstance(listener, Listener): - return listener - elif isinstance(listener, Callable): - return CustomListener( - app_name=app_name, - matchers=cls._build_matchers(name, callback_id), - middleware=cls._build_middleware(name, callback_id), - ack_function=listener, - lazy_functions=[], - auto_acknowledgement=name == "execute", - ) - elif isinstance(listener, list) and len(listener) > 0: - ack = listener.pop(0) - lazy = listener + if listener_or_functions is None: + raise BoltError(f"{name} listener is required (callback_id: {callback_id})") + + if isinstance(listener_or_functions, Callable): + listener_or_functions = [listener_or_functions] + + if isinstance(listener_or_functions, Listener): + return listener_or_functions + elif isinstance(listener_or_functions, list): + matchers = matchers if matchers else [] + matchers.insert(0, cls._build_primary_matcher(name, callback_id)) + middleware = middleware if middleware else [] + middleware.insert(0, cls._build_single_middleware(name, callback_id)) + functions = listener_or_functions + ack_function = functions.pop(0) return CustomListener( app_name=app_name, - matchers=cls._build_matchers(name, callback_id), - middleware=cls._build_middleware(name, callback_id), - ack_function=ack, - lazy_functions=lazy, + matchers=matchers, + middleware=middleware, + ack_function=ack_function, + lazy_functions=functions, auto_acknowledgement=name == "execute", ) else: - raise ValueError(f"Invalid `{name}` listener") + raise BoltError( + f"Invalid {name} listener: {type(listener_or_functions)} detected (callback_id: {callback_id})" + ) @classmethod - def _build_matchers(cls, name: str, callback_id: str) -> Sequence[ListenerMatcher]: + def _build_primary_matcher(cls, name, callback_id) -> ListenerMatcher: if name == "edit": - return [workflow_step_edit(callback_id)] + return workflow_step_edit(callback_id) elif name == "save": - return [workflow_step_save(callback_id)] + return workflow_step_save(callback_id) elif name == "execute": - return [workflow_step_execute(callback_id)] + return workflow_step_execute(callback_id) else: raise ValueError(f"Invalid name {name}") @classmethod - def _build_middleware(cls, name: str, callback_id: str) -> Sequence[Middleware]: + def _build_single_middleware(cls, name, callback_id) -> Middleware: if name == "edit": - return [_build_edit_listener_middleware(callback_id)] + return _build_edit_listener_middleware(callback_id) elif name == "save": - return [_build_save_listener_middleware()] + return _build_save_listener_middleware() elif name == "execute": - return [_build_execute_listener_middleware()] + return _build_execute_listener_middleware() else: raise ValueError(f"Invalid name {name}") diff --git a/tests/scenario_tests/test_workflow_steps_decorator_simple.py b/tests/scenario_tests/test_workflow_steps_decorator_simple.py new file mode 100644 index 000000000..e11f4a6bf --- /dev/null +++ b/tests/scenario_tests/test_workflow_steps_decorator_simple.py @@ -0,0 +1,425 @@ +import json +import time as time_module +from time import time +from urllib.parse import quote + +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web import WebClient, SlackResponse + +from slack_bolt import App, BoltRequest, Ack +from slack_bolt.workflows.step import Complete, Fail, Update, Configure, WorkflowStep +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestWorkflowStepsDecorator: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + self.app = App(client=self.web_client, signing_secret=self.signing_secret) + self.app.step(copy_review_step) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def test_edit(self): + timestamp, body = str(int(time())), f"payload={quote(json.dumps(edit_payload))}" + headers = { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request: BoltRequest = BoltRequest(body=body, headers=headers) + response = self.app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + self.app = App(client=self.web_client, signing_secret=self.signing_secret) + self.app.step( + callback_id="copy_review___", edit=edit, save=save, execute=execute + ) + response = self.app.dispatch(request) + assert response.status == 404 + + def test_save(self): + timestamp, body = str(int(time())), f"payload={quote(json.dumps(save_payload))}" + headers = { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request: BoltRequest = BoltRequest(body=body, headers=headers) + response = self.app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + self.app = App(client=self.web_client, signing_secret=self.signing_secret) + self.app.step( + callback_id="copy_review___", edit=edit, save=save, execute=execute + ) + response = self.app.dispatch(request) + assert response.status == 404 + + def test_execute(self): + timestamp, body = str(int(time())), json.dumps(execute_payload) + headers = { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request: BoltRequest = BoltRequest(body=body, headers=headers) + response = self.app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + time_module.sleep(0.5) + assert self.mock_received_requests["/workflows.stepCompleted"] == 1 + + self.app = App(client=self.web_client, signing_secret=self.signing_secret) + self.app.step( + callback_id="copy_review___", edit=edit, save=save, execute=execute + ) + response = self.app.dispatch(request) + assert response.status == 404 + + +edit_payload = { + "type": "workflow_step_edit", + "token": "verification-token", + "action_ts": "1601541356.268786", + "team": { + "id": "T111", + "domain": "subdomain", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": {"id": "W111", "username": "primary-owner", "team_id": "T111"}, + "callback_id": "copy_review", + "trigger_id": "111.222.xxx", + "workflow_step": { + "workflow_id": "12345", + "step_id": "111-222-333-444-555", + "inputs": { + "taskAuthorEmail": {"value": "seratch@example.com"}, + "taskDescription": {"value": "This is the task for you!"}, + "taskName": {"value": "The important task"}, + }, + "outputs": [ + {"name": "taskName", "type": "text", "label": "Task Name"}, + {"name": "taskDescription", "type": "text", "label": "Task Description"}, + {"name": "taskAuthorEmail", "type": "text", "label": "Task Author Email"}, + ], + }, +} + +save_payload = { + "type": "view_submission", + "team": { + "id": "T111", + "domain": "subdomain", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": { + "id": "W111", + "username": "primary-owner", + "name": "primary-owner", + "team_id": "T111", + }, + "api_app_id": "A111", + "token": "verification-token", + "trigger_id": "111.222.xxx", + "view": { + "id": "V111", + "team_id": "T111", + "type": "workflow_step", + "blocks": [ + { + "type": "section", + "block_id": "intro-section", + "text": { + "type": "plain_text", + "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", + }, + }, + { + "type": "input", + "block_id": "task_name_input", + "label": {"type": "plain_text", "text": "Task name"}, + "optional": False, + "element": { + "type": "plain_text_input", + "action_id": "task_name", + "placeholder": {"type": "plain_text", "text": "Write a task name"}, + }, + }, + { + "type": "input", + "block_id": "task_description_input", + "label": {"type": "plain_text", "text": "Task description"}, + "optional": False, + "element": { + "type": "plain_text_input", + "action_id": "task_description", + "placeholder": { + "type": "plain_text", + "text": "Write a description for your task", + }, + }, + }, + { + "type": "input", + "block_id": "task_author_input", + "label": {"type": "plain_text", "text": "Task author"}, + "optional": False, + "element": { + "type": "plain_text_input", + "action_id": "task_author", + "placeholder": {"type": "plain_text", "text": "Write a task name"}, + }, + }, + ], + "private_metadata": "", + "callback_id": "copy_review", + "state": { + "values": { + "task_name_input": { + "task_name": { + "type": "plain_text_input", + "value": "The important task", + } + }, + "task_description_input": { + "task_description": { + "type": "plain_text_input", + "value": "This is the task for you!", + } + }, + "task_author_input": { + "task_author": { + "type": "plain_text_input", + "value": "seratch@example.com", + } + }, + } + }, + "hash": "111.zzz", + "submit_disabled": False, + "app_id": "A111", + "external_id": "", + "app_installed_team_id": "T111", + "bot_id": "B111", + }, + "response_urls": [], + "workflow_step": { + "workflow_step_edit_id": "111.222.zzz", + "workflow_id": "12345", + "step_id": "111-222-333-444-555", + }, +} + +execute_payload = { + "token": "verification-token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "workflow_step_execute", + "callback_id": "copy_review", + "workflow_step": { + "workflow_step_execute_id": "zzz-execution", + "workflow_id": "12345", + "workflow_instance_id": "11111", + "step_id": "111-222-333-444-555", + "inputs": { + "taskAuthorEmail": {"value": "ksera@slack-corp.com"}, + "taskDescription": {"value": "sdfsdf"}, + "taskName": {"value": "a"}, + }, + "outputs": [ + {"name": "taskName", "type": "text", "label": "Task Name"}, + { + "name": "taskDescription", + "type": "text", + "label": "Task Description", + }, + { + "name": "taskAuthorEmail", + "type": "text", + "label": "Task Author Email", + }, + ], + }, + "event_ts": "1601541373.225894", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1601541373, +} + + +# https://api.slack.com/tutorials/workflow-builder-steps + + +copy_review_step = WorkflowStep.builder("copy_review") + + +@copy_review_step.edit +def edit(ack: Ack, step, configure: Configure): + assert step is not None + ack() + configure( + blocks=[ + { + "type": "section", + "block_id": "intro-section", + "text": { + "type": "plain_text", + "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", + }, + }, + { + "type": "input", + "block_id": "task_name_input", + "element": { + "type": "plain_text_input", + "action_id": "task_name", + "placeholder": { + "type": "plain_text", + "text": "Write a task name", + }, + }, + "label": {"type": "plain_text", "text": "Task name"}, + }, + { + "type": "input", + "block_id": "task_description_input", + "element": { + "type": "plain_text_input", + "action_id": "task_description", + "placeholder": { + "type": "plain_text", + "text": "Write a description for your task", + }, + }, + "label": {"type": "plain_text", "text": "Task description"}, + }, + { + "type": "input", + "block_id": "task_author_input", + "element": { + "type": "plain_text_input", + "action_id": "task_author", + "placeholder": { + "type": "plain_text", + "text": "Write a task name", + }, + }, + "label": {"type": "plain_text", "text": "Task author"}, + }, + ] + ) + + +@copy_review_step.save +def save(ack: Ack, step: dict, view: dict, update: Update): + assert step is not None + assert view is not None + state_values = view["state"]["values"] + update( + inputs={ + "taskName": { + "value": state_values["task_name_input"]["task_name"]["value"], + }, + "taskDescription": { + "value": state_values["task_description_input"]["task_description"][ + "value" + ], + }, + "taskAuthorEmail": { + "value": state_values["task_author_input"]["task_author"]["value"], + }, + }, + outputs=[ + { + "name": "taskName", + "type": "text", + "label": "Task Name", + }, + { + "name": "taskDescription", + "type": "text", + "label": "Task Description", + }, + { + "name": "taskAuthorEmail", + "type": "text", + "label": "Task Author Email", + }, + ], + ) + ack() + + +pseudo_database = {} + + +@copy_review_step.execute +def execute(step: dict, client: WebClient, complete: Complete, fail: Fail): + assert step is not None + try: + complete( + outputs={ + "taskName": step["inputs"]["taskName"]["value"], + "taskDescription": step["inputs"]["taskDescription"]["value"], + "taskAuthorEmail": step["inputs"]["taskAuthorEmail"]["value"], + } + ) + + user: SlackResponse = client.users_lookupByEmail( + email=step["inputs"]["taskAuthorEmail"]["value"] + ) + user_id = user["user"]["id"] + new_task = { + "task_name": step["inputs"]["taskName"]["value"], + "task_description": step["inputs"]["taskDescription"]["value"], + } + tasks = pseudo_database.get(user_id, []) + tasks.append(new_task) + pseudo_database[user_id] = tasks + + blocks = [] + for task in tasks: + blocks.append( + { + "type": "section", + "text": {"type": "plain_text", "text": task["task_name"]}, + } + ) + blocks.append({"type": "divider"}) + + client.views_publish( + user_id=user_id, + view={ + "type": "home", + "title": {"type": "plain_text", "text": "Your tasks!"}, + "blocks": blocks, + }, + ) + except Exception as err: + fail(error={"message": f"Something wrong! {err}"}) diff --git a/tests/scenario_tests/test_workflow_steps_decorator_with_args.py b/tests/scenario_tests/test_workflow_steps_decorator_with_args.py new file mode 100644 index 000000000..32f334c14 --- /dev/null +++ b/tests/scenario_tests/test_workflow_steps_decorator_with_args.py @@ -0,0 +1,429 @@ +import json +import time as time_module +from time import time +from urllib.parse import quote + +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web import WebClient, SlackResponse + +from slack_bolt import App, BoltRequest, Ack +from slack_bolt.workflows.step import Complete, Fail, Update, Configure, WorkflowStep +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestWorkflowStepsDecorator: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + self.app = App(client=self.web_client, signing_secret=self.signing_secret) + self.app.step(copy_review_step) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def test_edit(self): + timestamp, body = str(int(time())), f"payload={quote(json.dumps(edit_payload))}" + headers = { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request: BoltRequest = BoltRequest(body=body, headers=headers) + response = self.app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + self.app = App(client=self.web_client, signing_secret=self.signing_secret) + self.app.step( + callback_id="copy_review___", edit=edit, save=save, execute=execute + ) + response = self.app.dispatch(request) + assert response.status == 404 + + def test_save(self): + timestamp, body = str(int(time())), f"payload={quote(json.dumps(save_payload))}" + headers = { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request: BoltRequest = BoltRequest(body=body, headers=headers) + response = self.app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + self.app = App(client=self.web_client, signing_secret=self.signing_secret) + self.app.step( + callback_id="copy_review___", edit=edit, save=save, execute=execute + ) + response = self.app.dispatch(request) + assert response.status == 404 + + def test_execute(self): + timestamp, body = str(int(time())), json.dumps(execute_payload) + headers = { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request: BoltRequest = BoltRequest(body=body, headers=headers) + response = self.app.dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + time_module.sleep(0.5) + assert self.mock_received_requests["/workflows.stepCompleted"] == 1 + + self.app = App(client=self.web_client, signing_secret=self.signing_secret) + self.app.step( + callback_id="copy_review___", edit=edit, save=save, execute=execute + ) + response = self.app.dispatch(request) + assert response.status == 404 + + +edit_payload = { + "type": "workflow_step_edit", + "token": "verification-token", + "action_ts": "1601541356.268786", + "team": { + "id": "T111", + "domain": "subdomain", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": {"id": "W111", "username": "primary-owner", "team_id": "T111"}, + "callback_id": "copy_review", + "trigger_id": "111.222.xxx", + "workflow_step": { + "workflow_id": "12345", + "step_id": "111-222-333-444-555", + "inputs": { + "taskAuthorEmail": {"value": "seratch@example.com"}, + "taskDescription": {"value": "This is the task for you!"}, + "taskName": {"value": "The important task"}, + }, + "outputs": [ + {"name": "taskName", "type": "text", "label": "Task Name"}, + {"name": "taskDescription", "type": "text", "label": "Task Description"}, + {"name": "taskAuthorEmail", "type": "text", "label": "Task Author Email"}, + ], + }, +} + +save_payload = { + "type": "view_submission", + "team": { + "id": "T111", + "domain": "subdomain", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": { + "id": "W111", + "username": "primary-owner", + "name": "primary-owner", + "team_id": "T111", + }, + "api_app_id": "A111", + "token": "verification-token", + "trigger_id": "111.222.xxx", + "view": { + "id": "V111", + "team_id": "T111", + "type": "workflow_step", + "blocks": [ + { + "type": "section", + "block_id": "intro-section", + "text": { + "type": "plain_text", + "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", + }, + }, + { + "type": "input", + "block_id": "task_name_input", + "label": {"type": "plain_text", "text": "Task name"}, + "optional": False, + "element": { + "type": "plain_text_input", + "action_id": "task_name", + "placeholder": {"type": "plain_text", "text": "Write a task name"}, + }, + }, + { + "type": "input", + "block_id": "task_description_input", + "label": {"type": "plain_text", "text": "Task description"}, + "optional": False, + "element": { + "type": "plain_text_input", + "action_id": "task_description", + "placeholder": { + "type": "plain_text", + "text": "Write a description for your task", + }, + }, + }, + { + "type": "input", + "block_id": "task_author_input", + "label": {"type": "plain_text", "text": "Task author"}, + "optional": False, + "element": { + "type": "plain_text_input", + "action_id": "task_author", + "placeholder": {"type": "plain_text", "text": "Write a task name"}, + }, + }, + ], + "private_metadata": "", + "callback_id": "copy_review", + "state": { + "values": { + "task_name_input": { + "task_name": { + "type": "plain_text_input", + "value": "The important task", + } + }, + "task_description_input": { + "task_description": { + "type": "plain_text_input", + "value": "This is the task for you!", + } + }, + "task_author_input": { + "task_author": { + "type": "plain_text_input", + "value": "seratch@example.com", + } + }, + } + }, + "hash": "111.zzz", + "submit_disabled": False, + "app_id": "A111", + "external_id": "", + "app_installed_team_id": "T111", + "bot_id": "B111", + }, + "response_urls": [], + "workflow_step": { + "workflow_step_edit_id": "111.222.zzz", + "workflow_id": "12345", + "step_id": "111-222-333-444-555", + }, +} + +execute_payload = { + "token": "verification-token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "workflow_step_execute", + "callback_id": "copy_review", + "workflow_step": { + "workflow_step_execute_id": "zzz-execution", + "workflow_id": "12345", + "workflow_instance_id": "11111", + "step_id": "111-222-333-444-555", + "inputs": { + "taskAuthorEmail": {"value": "ksera@slack-corp.com"}, + "taskDescription": {"value": "sdfsdf"}, + "taskName": {"value": "a"}, + }, + "outputs": [ + {"name": "taskName", "type": "text", "label": "Task Name"}, + { + "name": "taskDescription", + "type": "text", + "label": "Task Description", + }, + { + "name": "taskAuthorEmail", + "type": "text", + "label": "Task Author Email", + }, + ], + }, + "event_ts": "1601541373.225894", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1601541373, +} + + +# https://api.slack.com/tutorials/workflow-builder-steps + + +copy_review_step = WorkflowStep.builder("copy_review") + + +def noop_middleware(next): + return next() + + +@copy_review_step.edit(middleware=[noop_middleware]) +def edit(ack: Ack, step, configure: Configure): + assert step is not None + ack() + configure( + blocks=[ + { + "type": "section", + "block_id": "intro-section", + "text": { + "type": "plain_text", + "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", + }, + }, + { + "type": "input", + "block_id": "task_name_input", + "element": { + "type": "plain_text_input", + "action_id": "task_name", + "placeholder": { + "type": "plain_text", + "text": "Write a task name", + }, + }, + "label": {"type": "plain_text", "text": "Task name"}, + }, + { + "type": "input", + "block_id": "task_description_input", + "element": { + "type": "plain_text_input", + "action_id": "task_description", + "placeholder": { + "type": "plain_text", + "text": "Write a description for your task", + }, + }, + "label": {"type": "plain_text", "text": "Task description"}, + }, + { + "type": "input", + "block_id": "task_author_input", + "element": { + "type": "plain_text_input", + "action_id": "task_author", + "placeholder": { + "type": "plain_text", + "text": "Write a task name", + }, + }, + "label": {"type": "plain_text", "text": "Task author"}, + }, + ] + ) + + +@copy_review_step.save(middleware=[noop_middleware]) +def save(ack: Ack, step: dict, view: dict, update: Update): + assert step is not None + assert view is not None + state_values = view["state"]["values"] + update( + inputs={ + "taskName": { + "value": state_values["task_name_input"]["task_name"]["value"], + }, + "taskDescription": { + "value": state_values["task_description_input"]["task_description"][ + "value" + ], + }, + "taskAuthorEmail": { + "value": state_values["task_author_input"]["task_author"]["value"], + }, + }, + outputs=[ + { + "name": "taskName", + "type": "text", + "label": "Task Name", + }, + { + "name": "taskDescription", + "type": "text", + "label": "Task Description", + }, + { + "name": "taskAuthorEmail", + "type": "text", + "label": "Task Author Email", + }, + ], + ) + ack() + + +pseudo_database = {} + + +@copy_review_step.execute(middleware=[noop_middleware]) +def execute(step: dict, client: WebClient, complete: Complete, fail: Fail): + assert step is not None + try: + complete( + outputs={ + "taskName": step["inputs"]["taskName"]["value"], + "taskDescription": step["inputs"]["taskDescription"]["value"], + "taskAuthorEmail": step["inputs"]["taskAuthorEmail"]["value"], + } + ) + + user: SlackResponse = client.users_lookupByEmail( + email=step["inputs"]["taskAuthorEmail"]["value"] + ) + user_id = user["user"]["id"] + new_task = { + "task_name": step["inputs"]["taskName"]["value"], + "task_description": step["inputs"]["taskDescription"]["value"], + } + tasks = pseudo_database.get(user_id, []) + tasks.append(new_task) + pseudo_database[user_id] = tasks + + blocks = [] + for task in tasks: + blocks.append( + { + "type": "section", + "text": {"type": "plain_text", "text": task["task_name"]}, + } + ) + blocks.append({"type": "divider"}) + + client.views_publish( + user_id=user_id, + view={ + "type": "home", + "title": {"type": "plain_text", "text": "Your tasks!"}, + "blocks": blocks, + }, + ) + except Exception as err: + fail(error={"message": f"Something wrong! {err}"}) diff --git a/tests/scenario_tests_async/test_workflow_steps_decorator_simple.py b/tests/scenario_tests_async/test_workflow_steps_decorator_simple.py new file mode 100644 index 000000000..593dd0d14 --- /dev/null +++ b/tests/scenario_tests_async/test_workflow_steps_decorator_simple.py @@ -0,0 +1,447 @@ +import asyncio +import json +from time import time +from urllib.parse import quote + +import pytest +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web import SlackResponse +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.context.ack.async_ack import AsyncAck +from slack_bolt.request.async_request import AsyncBoltRequest +from slack_bolt.workflows.step.async_step import AsyncWorkflowStep +from slack_bolt.workflows.step.utilities.async_complete import AsyncComplete +from slack_bolt.workflows.step.utilities.async_configure import AsyncConfigure +from slack_bolt.workflows.step.utilities.async_fail import AsyncFail +from slack_bolt.workflows.step.utilities.async_update import AsyncUpdate +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestAsyncWorkflowStepsDecorator: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + self.app = AsyncApp( + client=self.web_client, signing_secret=self.signing_secret + ) + self.app.step(copy_review_step) + + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + @pytest.mark.asyncio + async def test_edit(self): + timestamp, body = str(int(time())), f"payload={quote(json.dumps(edit_payload))}" + headers = { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request = AsyncBoltRequest(body=body, headers=headers) + response = await self.app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + self.app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) + self.app.step( + callback_id="copy_review___", edit=edit, save=save, execute=execute + ) + response = await self.app.async_dispatch(request) + assert response.status == 404 + + @pytest.mark.asyncio + async def test_save(self): + timestamp, body = str(int(time())), f"payload={quote(json.dumps(save_payload))}" + headers = { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request = AsyncBoltRequest(body=body, headers=headers) + response = await self.app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + self.app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) + self.app.step( + callback_id="copy_review___", edit=edit, save=save, execute=execute + ) + response = await self.app.async_dispatch(request) + assert response.status == 404 + + @pytest.mark.asyncio + async def test_execute(self): + timestamp, body = str(int(time())), json.dumps(execute_payload) + headers = { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request = AsyncBoltRequest(body=body, headers=headers) + response = await self.app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + await asyncio.sleep(0.5) + assert self.mock_received_requests["/workflows.stepCompleted"] == 1 + + self.app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) + self.app.step( + callback_id="copy_review___", edit=edit, save=save, execute=execute + ) + response = await self.app.async_dispatch(request) + assert response.status == 404 + + +edit_payload = { + "type": "workflow_step_edit", + "token": "verification-token", + "action_ts": "1601541356.268786", + "team": { + "id": "T111", + "domain": "subdomain", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": {"id": "W111", "username": "primary-owner", "team_id": "T111"}, + "callback_id": "copy_review", + "trigger_id": "111.222.xxx", + "workflow_step": { + "workflow_id": "12345", + "step_id": "111-222-333-444-555", + "inputs": { + "taskAuthorEmail": {"value": "seratch@example.com"}, + "taskDescription": {"value": "This is the task for you!"}, + "taskName": {"value": "The important task"}, + }, + "outputs": [ + {"name": "taskName", "type": "text", "label": "Task Name"}, + {"name": "taskDescription", "type": "text", "label": "Task Description"}, + {"name": "taskAuthorEmail", "type": "text", "label": "Task Author Email"}, + ], + }, +} + +save_payload = { + "type": "view_submission", + "team": { + "id": "T111", + "domain": "subdomain", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": { + "id": "W111", + "username": "primary-owner", + "name": "primary-owner", + "team_id": "T111", + }, + "api_app_id": "A111", + "token": "verification-token", + "trigger_id": "111.222.xxx", + "view": { + "id": "V111", + "team_id": "T111", + "type": "workflow_step", + "blocks": [ + { + "type": "section", + "block_id": "intro-section", + "text": { + "type": "plain_text", + "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", + }, + }, + { + "type": "input", + "block_id": "task_name_input", + "label": {"type": "plain_text", "text": "Task name"}, + "optional": False, + "element": { + "type": "plain_text_input", + "action_id": "task_name", + "placeholder": {"type": "plain_text", "text": "Write a task name"}, + }, + }, + { + "type": "input", + "block_id": "task_description_input", + "label": {"type": "plain_text", "text": "Task description"}, + "optional": False, + "element": { + "type": "plain_text_input", + "action_id": "task_description", + "placeholder": { + "type": "plain_text", + "text": "Write a description for your task", + }, + }, + }, + { + "type": "input", + "block_id": "task_author_input", + "label": {"type": "plain_text", "text": "Task author"}, + "optional": False, + "element": { + "type": "plain_text_input", + "action_id": "task_author", + "placeholder": {"type": "plain_text", "text": "Write a task name"}, + }, + }, + ], + "private_metadata": "", + "callback_id": "copy_review", + "state": { + "values": { + "task_name_input": { + "task_name": { + "type": "plain_text_input", + "value": "The important task", + } + }, + "task_description_input": { + "task_description": { + "type": "plain_text_input", + "value": "This is the task for you!", + } + }, + "task_author_input": { + "task_author": { + "type": "plain_text_input", + "value": "seratch@example.com", + } + }, + } + }, + "hash": "111.zzz", + "submit_disabled": False, + "app_id": "A111", + "external_id": "", + "app_installed_team_id": "T111", + "bot_id": "B111", + }, + "response_urls": [], + "workflow_step": { + "workflow_step_edit_id": "111.222.zzz", + "workflow_id": "12345", + "step_id": "111-222-333-444-555", + }, +} + +execute_payload = { + "token": "verification-token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "workflow_step_execute", + "callback_id": "copy_review", + "workflow_step": { + "workflow_step_execute_id": "zzz-execution", + "workflow_id": "12345", + "workflow_instance_id": "11111", + "step_id": "111-222-333-444-555", + "inputs": { + "taskAuthorEmail": {"value": "ksera@slack-corp.com"}, + "taskDescription": {"value": "sdfsdf"}, + "taskName": {"value": "a"}, + }, + "outputs": [ + {"name": "taskName", "type": "text", "label": "Task Name"}, + { + "name": "taskDescription", + "type": "text", + "label": "Task Description", + }, + { + "name": "taskAuthorEmail", + "type": "text", + "label": "Task Author Email", + }, + ], + }, + "event_ts": "1601541373.225894", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1601541373, +} + + +# https://api.slack.com/tutorials/workflow-builder-steps + +copy_review_step = AsyncWorkflowStep.builder("copy_review") + + +@copy_review_step.edit +async def edit(ack: AsyncAck, step, configure: AsyncConfigure): + assert step is not None + await ack() + await configure( + blocks=[ + { + "type": "section", + "block_id": "intro-section", + "text": { + "type": "plain_text", + "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", + }, + }, + { + "type": "input", + "block_id": "task_name_input", + "element": { + "type": "plain_text_input", + "action_id": "task_name", + "placeholder": { + "type": "plain_text", + "text": "Write a task name", + }, + }, + "label": {"type": "plain_text", "text": "Task name"}, + }, + { + "type": "input", + "block_id": "task_description_input", + "element": { + "type": "plain_text_input", + "action_id": "task_description", + "placeholder": { + "type": "plain_text", + "text": "Write a description for your task", + }, + }, + "label": {"type": "plain_text", "text": "Task description"}, + }, + { + "type": "input", + "block_id": "task_author_input", + "element": { + "type": "plain_text_input", + "action_id": "task_author", + "placeholder": { + "type": "plain_text", + "text": "Write a task name", + }, + }, + "label": {"type": "plain_text", "text": "Task author"}, + }, + ] + ) + + +@copy_review_step.save +async def save(ack: AsyncAck, step: dict, view: dict, update: AsyncUpdate): + assert step is not None + assert view is not None + state_values = view["state"]["values"] + await update( + inputs={ + "taskName": { + "value": state_values["task_name_input"]["task_name"]["value"], + }, + "taskDescription": { + "value": state_values["task_description_input"]["task_description"][ + "value" + ], + }, + "taskAuthorEmail": { + "value": state_values["task_author_input"]["task_author"]["value"], + }, + }, + outputs=[ + { + "name": "taskName", + "type": "text", + "label": "Task Name", + }, + { + "name": "taskDescription", + "type": "text", + "label": "Task Description", + }, + { + "name": "taskAuthorEmail", + "type": "text", + "label": "Task Author Email", + }, + ], + ) + await ack() + + +pseudo_database = {} + + +@copy_review_step.execute +async def execute( + step: dict, client: AsyncWebClient, complete: AsyncComplete, fail: AsyncFail +): + assert step is not None + try: + await complete( + outputs={ + "taskName": step["inputs"]["taskName"]["value"], + "taskDescription": step["inputs"]["taskDescription"]["value"], + "taskAuthorEmail": step["inputs"]["taskAuthorEmail"]["value"], + } + ) + + user: SlackResponse = await client.users_lookupByEmail( + email=step["inputs"]["taskAuthorEmail"]["value"] + ) + user_id = user["user"]["id"] + new_task = { + "task_name": step["inputs"]["taskName"]["value"], + "task_description": step["inputs"]["taskDescription"]["value"], + } + tasks = pseudo_database.get(user_id, []) + tasks.append(new_task) + pseudo_database[user_id] = tasks + + blocks = [] + for task in tasks: + blocks.append( + { + "type": "section", + "text": {"type": "plain_text", "text": task["task_name"]}, + } + ) + blocks.append({"type": "divider"}) + + await client.views_publish( + user_id=user_id, + view={ + "type": "home", + "title": {"type": "plain_text", "text": "Your tasks!"}, + "blocks": blocks, + }, + ) + except Exception as err: + await fail(error={"message": f"Something wrong! {err}"}) diff --git a/tests/scenario_tests_async/test_workflow_steps_decorator_with_args.py b/tests/scenario_tests_async/test_workflow_steps_decorator_with_args.py new file mode 100644 index 000000000..1db6c8b2d --- /dev/null +++ b/tests/scenario_tests_async/test_workflow_steps_decorator_with_args.py @@ -0,0 +1,451 @@ +import asyncio +import json +from time import time +from urllib.parse import quote + +import pytest +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web import SlackResponse +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.context.ack.async_ack import AsyncAck +from slack_bolt.request.async_request import AsyncBoltRequest +from slack_bolt.workflows.step.async_step import AsyncWorkflowStep +from slack_bolt.workflows.step.utilities.async_complete import AsyncComplete +from slack_bolt.workflows.step.utilities.async_configure import AsyncConfigure +from slack_bolt.workflows.step.utilities.async_fail import AsyncFail +from slack_bolt.workflows.step.utilities.async_update import AsyncUpdate +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestAsyncWorkflowStepsDecorator: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + self.app = AsyncApp( + client=self.web_client, signing_secret=self.signing_secret + ) + self.app.step(copy_review_step) + + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + @pytest.mark.asyncio + async def test_edit(self): + timestamp, body = str(int(time())), f"payload={quote(json.dumps(edit_payload))}" + headers = { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request = AsyncBoltRequest(body=body, headers=headers) + response = await self.app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + self.app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) + self.app.step( + callback_id="copy_review___", edit=edit, save=save, execute=execute + ) + response = await self.app.async_dispatch(request) + assert response.status == 404 + + @pytest.mark.asyncio + async def test_save(self): + timestamp, body = str(int(time())), f"payload={quote(json.dumps(save_payload))}" + headers = { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request = AsyncBoltRequest(body=body, headers=headers) + response = await self.app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + + self.app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) + self.app.step( + callback_id="copy_review___", edit=edit, save=save, execute=execute + ) + response = await self.app.async_dispatch(request) + assert response.status == 404 + + @pytest.mark.asyncio + async def test_execute(self): + timestamp, body = str(int(time())), json.dumps(execute_payload) + headers = { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request = AsyncBoltRequest(body=body, headers=headers) + response = await self.app.async_dispatch(request) + assert response.status == 200 + assert self.mock_received_requests["/auth.test"] == 1 + await asyncio.sleep(0.5) + assert self.mock_received_requests["/workflows.stepCompleted"] == 1 + + self.app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) + self.app.step( + callback_id="copy_review___", edit=edit, save=save, execute=execute + ) + response = await self.app.async_dispatch(request) + assert response.status == 404 + + +edit_payload = { + "type": "workflow_step_edit", + "token": "verification-token", + "action_ts": "1601541356.268786", + "team": { + "id": "T111", + "domain": "subdomain", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": {"id": "W111", "username": "primary-owner", "team_id": "T111"}, + "callback_id": "copy_review", + "trigger_id": "111.222.xxx", + "workflow_step": { + "workflow_id": "12345", + "step_id": "111-222-333-444-555", + "inputs": { + "taskAuthorEmail": {"value": "seratch@example.com"}, + "taskDescription": {"value": "This is the task for you!"}, + "taskName": {"value": "The important task"}, + }, + "outputs": [ + {"name": "taskName", "type": "text", "label": "Task Name"}, + {"name": "taskDescription", "type": "text", "label": "Task Description"}, + {"name": "taskAuthorEmail", "type": "text", "label": "Task Author Email"}, + ], + }, +} + +save_payload = { + "type": "view_submission", + "team": { + "id": "T111", + "domain": "subdomain", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": { + "id": "W111", + "username": "primary-owner", + "name": "primary-owner", + "team_id": "T111", + }, + "api_app_id": "A111", + "token": "verification-token", + "trigger_id": "111.222.xxx", + "view": { + "id": "V111", + "team_id": "T111", + "type": "workflow_step", + "blocks": [ + { + "type": "section", + "block_id": "intro-section", + "text": { + "type": "plain_text", + "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", + }, + }, + { + "type": "input", + "block_id": "task_name_input", + "label": {"type": "plain_text", "text": "Task name"}, + "optional": False, + "element": { + "type": "plain_text_input", + "action_id": "task_name", + "placeholder": {"type": "plain_text", "text": "Write a task name"}, + }, + }, + { + "type": "input", + "block_id": "task_description_input", + "label": {"type": "plain_text", "text": "Task description"}, + "optional": False, + "element": { + "type": "plain_text_input", + "action_id": "task_description", + "placeholder": { + "type": "plain_text", + "text": "Write a description for your task", + }, + }, + }, + { + "type": "input", + "block_id": "task_author_input", + "label": {"type": "plain_text", "text": "Task author"}, + "optional": False, + "element": { + "type": "plain_text_input", + "action_id": "task_author", + "placeholder": {"type": "plain_text", "text": "Write a task name"}, + }, + }, + ], + "private_metadata": "", + "callback_id": "copy_review", + "state": { + "values": { + "task_name_input": { + "task_name": { + "type": "plain_text_input", + "value": "The important task", + } + }, + "task_description_input": { + "task_description": { + "type": "plain_text_input", + "value": "This is the task for you!", + } + }, + "task_author_input": { + "task_author": { + "type": "plain_text_input", + "value": "seratch@example.com", + } + }, + } + }, + "hash": "111.zzz", + "submit_disabled": False, + "app_id": "A111", + "external_id": "", + "app_installed_team_id": "T111", + "bot_id": "B111", + }, + "response_urls": [], + "workflow_step": { + "workflow_step_edit_id": "111.222.zzz", + "workflow_id": "12345", + "step_id": "111-222-333-444-555", + }, +} + +execute_payload = { + "token": "verification-token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "workflow_step_execute", + "callback_id": "copy_review", + "workflow_step": { + "workflow_step_execute_id": "zzz-execution", + "workflow_id": "12345", + "workflow_instance_id": "11111", + "step_id": "111-222-333-444-555", + "inputs": { + "taskAuthorEmail": {"value": "ksera@slack-corp.com"}, + "taskDescription": {"value": "sdfsdf"}, + "taskName": {"value": "a"}, + }, + "outputs": [ + {"name": "taskName", "type": "text", "label": "Task Name"}, + { + "name": "taskDescription", + "type": "text", + "label": "Task Description", + }, + { + "name": "taskAuthorEmail", + "type": "text", + "label": "Task Author Email", + }, + ], + }, + "event_ts": "1601541373.225894", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1601541373, +} + + +# https://api.slack.com/tutorials/workflow-builder-steps + +copy_review_step = AsyncWorkflowStep.builder("copy_review") + + +async def noop_middleware(next): + return await next() + + +@copy_review_step.edit(middleware=[noop_middleware]) +async def edit(ack: AsyncAck, step, configure: AsyncConfigure): + assert step is not None + await ack() + await configure( + blocks=[ + { + "type": "section", + "block_id": "intro-section", + "text": { + "type": "plain_text", + "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", + }, + }, + { + "type": "input", + "block_id": "task_name_input", + "element": { + "type": "plain_text_input", + "action_id": "task_name", + "placeholder": { + "type": "plain_text", + "text": "Write a task name", + }, + }, + "label": {"type": "plain_text", "text": "Task name"}, + }, + { + "type": "input", + "block_id": "task_description_input", + "element": { + "type": "plain_text_input", + "action_id": "task_description", + "placeholder": { + "type": "plain_text", + "text": "Write a description for your task", + }, + }, + "label": {"type": "plain_text", "text": "Task description"}, + }, + { + "type": "input", + "block_id": "task_author_input", + "element": { + "type": "plain_text_input", + "action_id": "task_author", + "placeholder": { + "type": "plain_text", + "text": "Write a task name", + }, + }, + "label": {"type": "plain_text", "text": "Task author"}, + }, + ] + ) + + +@copy_review_step.save(middleware=[noop_middleware]) +async def save(ack: AsyncAck, step: dict, view: dict, update: AsyncUpdate): + assert step is not None + assert view is not None + state_values = view["state"]["values"] + await update( + inputs={ + "taskName": { + "value": state_values["task_name_input"]["task_name"]["value"], + }, + "taskDescription": { + "value": state_values["task_description_input"]["task_description"][ + "value" + ], + }, + "taskAuthorEmail": { + "value": state_values["task_author_input"]["task_author"]["value"], + }, + }, + outputs=[ + { + "name": "taskName", + "type": "text", + "label": "Task Name", + }, + { + "name": "taskDescription", + "type": "text", + "label": "Task Description", + }, + { + "name": "taskAuthorEmail", + "type": "text", + "label": "Task Author Email", + }, + ], + ) + await ack() + + +pseudo_database = {} + + +@copy_review_step.execute(middleware=[noop_middleware]) +async def execute( + step: dict, client: AsyncWebClient, complete: AsyncComplete, fail: AsyncFail +): + assert step is not None + try: + await complete( + outputs={ + "taskName": step["inputs"]["taskName"]["value"], + "taskDescription": step["inputs"]["taskDescription"]["value"], + "taskAuthorEmail": step["inputs"]["taskAuthorEmail"]["value"], + } + ) + + user: SlackResponse = await client.users_lookupByEmail( + email=step["inputs"]["taskAuthorEmail"]["value"] + ) + user_id = user["user"]["id"] + new_task = { + "task_name": step["inputs"]["taskName"]["value"], + "task_description": step["inputs"]["taskDescription"]["value"], + } + tasks = pseudo_database.get(user_id, []) + tasks.append(new_task) + pseudo_database[user_id] = tasks + + blocks = [] + for task in tasks: + blocks.append( + { + "type": "section", + "text": {"type": "plain_text", "text": task["task_name"]}, + } + ) + blocks.append({"type": "divider"}) + + await client.views_publish( + user_id=user_id, + view={ + "type": "home", + "title": {"type": "plain_text", "text": "Your tasks!"}, + "blocks": blocks, + }, + ) + except Exception as err: + await fail(error={"message": f"Something wrong! {err}"}) From 52e1380c7699b8a3a5f71946997bc72061149fca Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 4 Feb 2021 12:04:58 +0900 Subject: [PATCH 119/719] Revert the defualt testing mdoe to threading mode for better macOS Big Sur compatibility --- .gitignore | 2 ++ tests/utils.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9e80867aa..f4aaf5133 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,8 @@ __pycache__/ # virtualenv env*/ venv/ +.venv/ +.env/ # codecov / coverage .coverage diff --git a/tests/utils.py b/tests/utils.py index bf642fbd9..e6c75903d 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -21,6 +21,9 @@ def get_mock_server_mode() -> str: """ mode = os.environ.get("BOLT_PYTHON_MOCK_SERVER_MODE") if mode is None: - return "multiprocessing" + # We used to use "multiprocessing"" for macOS until Big Sur 11.1 + # Since 11.1, the "multiprocessing" mode started failing a lot... + # Therefore, we switched the default mode back to "threading". + return "threading" else: return mode From f264dacb38214c210f206e268b1f8707c2b6c9c4 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 4 Feb 2021 14:43:23 +0900 Subject: [PATCH 120/719] version 1.3.0rc1 --- setup.py | 2 +- slack_bolt/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 8cd53987a..7f4c37d2d 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.2.1,<3.3",], + install_requires=["slack_sdk>=3.3.0rc1,<3.4",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 10aa336ce..4db542d29 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.2.3" +__version__ = "1.3.0rc1" From bc1471071f1ee0865b417ef4126d0e8d2cc0b7c2 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 4 Feb 2021 15:20:16 +0900 Subject: [PATCH 121/719] version 1.3.0 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 4db542d29..67bc602ab 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.3.0rc1" +__version__ = "1.3.0" From 2fd86749f79ee73af98c7c5c35963945edb2f0e7 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 5 Feb 2021 11:47:50 +0900 Subject: [PATCH 122/719] version 1.3.0 (final) --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7f4c37d2d..3b2b16a21 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.3.0rc1,<3.4",], + install_requires=["slack_sdk>=3.3.0,<3.4",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", From 2d67290ae9417ff091f4140535eb1e5b9a0b8d78 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sun, 7 Feb 2021 19:56:39 +0900 Subject: [PATCH 123/719] Fix #232 Unmatched message listener middleware can be called --- slack_bolt/app/app.py | 2 +- slack_bolt/app/async_app.py | 2 +- tests/scenario_tests/test_message.py | 58 ++++++++++++++++++-- tests/scenario_tests_async/test_message.py | 62 ++++++++++++++++++++-- 4 files changed, 116 insertions(+), 8 deletions(-) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index fa5ec277e..fcbbe1c51 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -517,7 +517,7 @@ def __call__(*args, **kwargs): # By contrast, messages posted using class app's bot token still have the subtype. constraints = {"type": "message", "subtype": (None, "bot_message")} primary_matcher = builtin_matchers.event(constraints=constraints) - middleware.append(MessageListenerMatches(keyword)) + middleware.insert(0, MessageListenerMatches(keyword)) return self._register_listener( list(functions), primary_matcher, matchers, middleware, True ) diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index f28a4b7ff..c82412cf5 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -567,7 +567,7 @@ def __call__(*args, **kwargs): primary_matcher = builtin_matchers.event( constraints=constraints, asyncio=True ) - middleware.append(AsyncMessageListenerMatches(keyword)) + middleware.insert(0, AsyncMessageListenerMatches(keyword)) return self._register_listener( list(functions), primary_matcher, matchers, middleware, True ) diff --git a/tests/scenario_tests/test_message.py b/tests/scenario_tests/test_message.py index e750bfd40..fe16f8245 100644 --- a/tests/scenario_tests/test_message.py +++ b/tests/scenario_tests/test_message.py @@ -5,6 +5,7 @@ from slack_sdk.signature import SignatureVerifier from slack_sdk.web import WebClient +from slack_bolt import BoltResponse from slack_bolt.app import App from slack_bolt.request import BoltRequest from tests.mock_web_api_server import ( @@ -46,13 +47,15 @@ def build_headers(self, timestamp: str, body: str): "x-slack-request-timestamp": [timestamp], } - def build_request(self) -> BoltRequest: + def build_request_from_body(self, message_body: dict) -> BoltRequest: timestamp, body = str(int(time.time())), json.dumps(message_body) return BoltRequest(body=body, headers=self.build_headers(timestamp, body)) + def build_request(self) -> BoltRequest: + return self.build_request_from_body(message_body) + def build_request2(self) -> BoltRequest: - timestamp, body = str(int(time.time())), json.dumps(message_body2) - return BoltRequest(body=body, headers=self.build_headers(timestamp, body)) + return self.build_request_from_body(message_body2) def test_string_keyword(self): app = App( @@ -136,6 +139,55 @@ def test_regexp_keyword_unmatched(self): assert response.status == 404 assert_auth_test_count(self, 1) + # https://github.com/slackapi/bolt-python/issues/232 + def test_issue_232_message_listener_middleware(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + called = { + "first": False, + "second": False, + } + + def this_should_be_skipped(): + return BoltResponse(status=500, body="failed") + + @app.message("first", middleware=[this_should_be_skipped]) + def first(): + called["first"] = True + + @app.message("second", middleware=[]) + def second(): + called["second"] = True + + request = self.build_request_from_body( + { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "a8744611-0210-4f85-9f15-5faf7fb225c8", + "type": "message", + "text": "This message should match the second listener only", + "user": "W111", + "ts": "1596183880.004200", + "team": "T111", + "channel": "C111", + "event_ts": "1596183880.004200", + "channel_type": "channel", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1596183880, + } + ) + response = app.dispatch(request) + assert response.status == 200 + assert called["first"] == False + assert called["second"] == True + message_body = { "token": "verification_token", diff --git a/tests/scenario_tests_async/test_message.py b/tests/scenario_tests_async/test_message.py index b69e849f6..b1504d550 100644 --- a/tests/scenario_tests_async/test_message.py +++ b/tests/scenario_tests_async/test_message.py @@ -7,6 +7,7 @@ from slack_sdk.signature import SignatureVerifier from slack_sdk.web.async_client import AsyncWebClient +from slack_bolt import BoltResponse from slack_bolt.app.async_app import AsyncApp from slack_bolt.request.async_request import AsyncBoltRequest from tests.mock_web_api_server import ( @@ -52,13 +53,15 @@ def build_headers(self, timestamp: str, body: str): "x-slack-request-timestamp": [timestamp], } - def build_request(self) -> AsyncBoltRequest: + def build_request_from_body(self, message_body: dict) -> AsyncBoltRequest: timestamp, body = str(int(time())), json.dumps(message_body) return AsyncBoltRequest(body=body, headers=self.build_headers(timestamp, body)) + def build_request(self) -> AsyncBoltRequest: + return self.build_request_from_body(message_body) + def build_request2(self) -> AsyncBoltRequest: - timestamp, body = str(int(time())), json.dumps(message_body2) - return AsyncBoltRequest(body=body, headers=self.build_headers(timestamp, body)) + return self.build_request_from_body(message_body2) @pytest.mark.asyncio async def test_string_keyword(self): @@ -148,6 +151,59 @@ async def test_regexp_keyword_unmatched(self): assert response.status == 404 await assert_auth_test_count_async(self, 1) + # https://github.com/slackapi/bolt-python/issues/232 + @pytest.mark.asyncio + async def test_issue_232_message_listener_middleware(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + called = { + "first": False, + "second": False, + } + + async def this_should_be_skipped(): + return BoltResponse(status=500, body="failed") + + @app.message("first", middleware=[this_should_be_skipped]) + async def first(): + called["first"] = True + + @app.message("second", middleware=[]) + async def second(): + called["second"] = True + + request = self.build_request_from_body( + { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "a8744611-0210-4f85-9f15-5faf7fb225c8", + "type": "message", + "text": "This message should match the second listener only", + "user": "W111", + "ts": "1596183880.004200", + "team": "T111", + "channel": "C111", + "event_ts": "1596183880.004200", + "channel_type": "channel", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1596183880, + } + ) + response = await app.async_dispatch(request) + assert response.status == 200 + + await asyncio.sleep(0.3) + assert called["first"] == False + assert called["second"] == True + message_body = { "token": "verification_token", From 794d0acb6942f26448fc6c4a944276c3dacaaf5b Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 9 Feb 2021 16:31:09 +0900 Subject: [PATCH 124/719] version 1.3.1 --- setup.py | 2 +- slack_bolt/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 3b2b16a21..38cfdbacd 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.3.0,<3.4",], + install_requires=["slack_sdk>=3.3.1,<3.4",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 67bc602ab..9c73af26b 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.3.0" +__version__ = "1.3.1" From c8ce2911317a711e4d1791aa9e09e230bef9309a Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 9 Feb 2021 22:03:18 +0900 Subject: [PATCH 125/719] Update GitHub Actions settings --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 71e345620..dae01f300 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -10,7 +10,7 @@ on: jobs: build: runs-on: ubuntu-20.04 - timeout-minutes: 10 + timeout-minutes: 15 strategy: matrix: python-version: ['3.6', '3.7', '3.8', '3.9'] From 15b729d0bf36f59a3655916e46e971f84c3a7928 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 12 Feb 2021 08:53:52 +0900 Subject: [PATCH 126/719] version 1.3.2 --- examples/socket_mode_proxy.py | 40 +++++++++++++++++++ setup.py | 2 +- .../adapter/socket_mode/builtin/__init__.py | 4 +- slack_bolt/version.py | 2 +- 4 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 examples/socket_mode_proxy.py diff --git a/examples/socket_mode_proxy.py b/examples/socket_mode_proxy.py new file mode 100644 index 000000000..25498ed25 --- /dev/null +++ b/examples/socket_mode_proxy.py @@ -0,0 +1,40 @@ +# ------------------------------------------------ +# instead of slack_bolt in requirements.txt +import sys + +sys.path.insert(1, "..") +# ------------------------------------------------ + +import logging + +logging.basicConfig(level=logging.DEBUG) + +import os + +from slack_sdk import WebClient +from slack_bolt import App +from slack_bolt.adapter.socket_mode import SocketModeHandler + +# pip3 install proxy.py +# proxy --port 9000 --log-level d +proxy_url = "http://localhost:9000" + +# Install the Slack app and get xoxb- token in advance +app = App( + client=WebClient(token=os.environ["SLACK_BOT_TOKEN"], proxy=proxy_url) +) + + +@app.event("app_mention") +def event_test(event, say): + say(f"Hi there, <@{event['user']}>!") + + +if __name__ == "__main__": + # export SLACK_APP_TOKEN=xapp-*** + # export SLACK_BOT_TOKEN=xoxb-*** + SocketModeHandler( + app=app, + app_token=os.environ["SLACK_APP_TOKEN"], + proxy=proxy_url, + ).start() diff --git a/setup.py b/setup.py index 38cfdbacd..e090e1e32 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.3.1,<3.4",], + install_requires=["slack_sdk>=3.3.2,<3.4",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/adapter/socket_mode/builtin/__init__.py b/slack_bolt/adapter/socket_mode/builtin/__init__.py index 242a4d5fa..f857098ba 100644 --- a/slack_bolt/adapter/socket_mode/builtin/__init__.py +++ b/slack_bolt/adapter/socket_mode/builtin/__init__.py @@ -1,7 +1,7 @@ import os from logging import Logger from time import time -from typing import Optional +from typing import Optional, Dict from slack_sdk import WebClient from slack_sdk.socket_mode.request import SocketModeRequest @@ -25,6 +25,7 @@ def __init__( # type: ignore logger: Optional[Logger] = None, web_client: Optional[WebClient] = None, proxy: Optional[str] = None, + proxy_headers: Optional[Dict[str, str]] = None, auto_reconnect_enabled: bool = True, trace_enabled: bool = False, all_message_trace_enabled: bool = False, @@ -40,6 +41,7 @@ def __init__( # type: ignore logger=logger if logger is not None else app.logger, web_client=web_client if web_client is not None else app.client, proxy=proxy if proxy is not None else app.client.proxy, + proxy_headers=proxy_headers, auto_reconnect_enabled=auto_reconnect_enabled, trace_enabled=trace_enabled, all_message_trace_enabled=all_message_trace_enabled, diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 9c73af26b..f708a9b20 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.3.1" +__version__ = "1.3.2" From 5fbf5634b35dfbb2892618c6d12b34220de42183 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 15 Feb 2021 07:53:31 +0900 Subject: [PATCH 127/719] Correct comments in App/AsyncApp --- slack_bolt/app/app.py | 2 +- slack_bolt/app/async_app.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index fcbbe1c51..2d2c8a116 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -514,7 +514,7 @@ def message( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) # As of Jan 2021, most bot messages no longer have the subtype bot_message. - # By contrast, messages posted using class app's bot token still have the subtype. + # By contrast, messages posted using classic app's bot token still have the subtype. constraints = {"type": "message", "subtype": (None, "bot_message")} primary_matcher = builtin_matchers.event(constraints=constraints) middleware.insert(0, MessageListenerMatches(keyword)) diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index c82412cf5..83242ca90 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -562,7 +562,7 @@ def message( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) # As of Jan 2021, most bot messages no longer have the subtype bot_message. - # By contrast, messages posted using class app's bot token still have the subtype. + # By contrast, messages posted using classic app's bot token still have the subtype. constraints = {"type": "message", "subtype": (None, "bot_message")} primary_matcher = builtin_matchers.event( constraints=constraints, asyncio=True From 3bde6df839895bb294ebdffcb4e3d77117839609 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 18 Feb 2021 21:49:32 +0900 Subject: [PATCH 128/719] Remove sys.path modification from examples --- examples/aiohttp_devtools/async_app.py | 7 --- examples/app.py | 7 --- examples/app_authorize.py | 8 ---- examples/async_app.py | 7 --- examples/async_app_authorize.py | 7 --- examples/aws_lambda/aws_lambda.py | 7 --- examples/aws_lambda/aws_lambda_oauth.py | 7 --- examples/aws_lambda/lazy_aws_lambda.py | 8 ---- examples/bottle/app.py | 7 --- examples/bottle/oauth_app.py | 7 --- examples/cherrypy/app.py | 7 --- examples/cherrypy/oauth_app.py | 7 --- examples/dialogs_app.py | 7 --- examples/django/manage.py | 10 ---- examples/events_app.py | 7 --- examples/falcon/app.py | 7 --- examples/falcon/oauth_app.py | 7 --- examples/fastapi/app.py | 7 --- examples/fastapi/async_app.py | 7 --- examples/fastapi/async_oauth_app.py | 7 --- examples/fastapi/oauth_app.py | 7 --- examples/flask/app.py | 7 --- examples/flask/oauth_app.py | 7 --- examples/lazy_async_modals_app.py | 7 --- examples/lazy_modals_app.py | 7 --- examples/message_events.py | 7 --- examples/modals_app.py | 7 --- examples/modals_app_typed.py | 7 --- examples/oauth_app.py | 7 --- examples/oauth_app_settings.py | 7 --- examples/oauth_sqlite3_app.py | 7 --- examples/oauth_sqlite3_app_org_level.py | 7 --- examples/pyramid/app.py | 8 ---- examples/pyramid/oauth_app.py | 8 ---- examples/sanic/async_app.py | 7 --- examples/sanic/async_oauth_app.py | 7 --- examples/socket_mode.py | 47 ++++++++++++------ examples/socket_mode_async.py | 48 ++++++++++++------- examples/socket_mode_oauth.py | 47 ++++++++++++------ examples/socket_mode_proxy.py | 11 +---- examples/starlette/app.py | 7 --- examples/starlette/async_app.py | 7 --- examples/starlette/async_oauth_app.py | 7 --- examples/starlette/oauth_app.py | 7 --- examples/tornado/app.py | 7 --- examples/tornado/oauth_app.py | 7 --- .../workflow_steps/async_steps_from_apps.py | 7 --- .../async_steps_from_apps_decorator.py | 7 --- .../async_steps_from_apps_primitive.py | 7 --- examples/workflow_steps/steps_from_apps.py | 7 --- .../steps_from_apps_decorator.py | 7 --- .../steps_from_apps_primitive.py | 7 --- scripts/install_all_and_run_tests.sh | 2 + 53 files changed, 99 insertions(+), 399 deletions(-) diff --git a/examples/aiohttp_devtools/async_app.py b/examples/aiohttp_devtools/async_app.py index 605b90e31..2b4c289e2 100644 --- a/examples/aiohttp_devtools/async_app.py +++ b/examples/aiohttp_devtools/async_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - import logging logging.basicConfig(level=logging.DEBUG) diff --git a/examples/app.py b/examples/app.py index f8759c799..6e5a10a0f 100644 --- a/examples/app.py +++ b/examples/app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "..") -# ------------------------------------------------ - import logging logging.basicConfig(level=logging.DEBUG) diff --git a/examples/app_authorize.py b/examples/app_authorize.py index 3f4ab5b01..527e2325a 100644 --- a/examples/app_authorize.py +++ b/examples/app_authorize.py @@ -1,11 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - - -sys.path.insert(1, "..") -# ------------------------------------------------ - import logging logging.basicConfig(level=logging.DEBUG) diff --git a/examples/async_app.py b/examples/async_app.py index c50416a2a..dd5172964 100644 --- a/examples/async_app.py +++ b/examples/async_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "..") -# ------------------------------------------------ - import logging logging.basicConfig(level=logging.DEBUG) diff --git a/examples/async_app_authorize.py b/examples/async_app_authorize.py index cb62fe925..218c3ef8a 100644 --- a/examples/async_app_authorize.py +++ b/examples/async_app_authorize.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "..") -# ------------------------------------------------ - import logging logging.basicConfig(level=logging.DEBUG) diff --git a/examples/aws_lambda/aws_lambda.py b/examples/aws_lambda/aws_lambda.py index e5ffc37f2..8ca79a82c 100644 --- a/examples/aws_lambda/aws_lambda.py +++ b/examples/aws_lambda/aws_lambda.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "vendor") -# ------------------------------------------------ - import logging from slack_bolt import App diff --git a/examples/aws_lambda/aws_lambda_oauth.py b/examples/aws_lambda/aws_lambda_oauth.py index 348da4b2e..f30609a1c 100644 --- a/examples/aws_lambda/aws_lambda_oauth.py +++ b/examples/aws_lambda/aws_lambda_oauth.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "vendor") -# ------------------------------------------------ - import logging from slack_bolt import App diff --git a/examples/aws_lambda/lazy_aws_lambda.py b/examples/aws_lambda/lazy_aws_lambda.py index 5e99942e9..82ef3ae98 100644 --- a/examples/aws_lambda/lazy_aws_lambda.py +++ b/examples/aws_lambda/lazy_aws_lambda.py @@ -1,11 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys -import time - -sys.path.insert(1, "vendor") -# ------------------------------------------------ - import logging from slack_bolt import App diff --git a/examples/bottle/app.py b/examples/bottle/app.py index 20959217a..8cab4d697 100644 --- a/examples/bottle/app.py +++ b/examples/bottle/app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - import logging logging.basicConfig(level=logging.DEBUG) diff --git a/examples/bottle/oauth_app.py b/examples/bottle/oauth_app.py index 63d2c5db4..8d42327c4 100644 --- a/examples/bottle/oauth_app.py +++ b/examples/bottle/oauth_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../../src") -# ------------------------------------------------ - import logging from slack_bolt import App from slack_bolt.adapter.bottle import SlackRequestHandler diff --git a/examples/cherrypy/app.py b/examples/cherrypy/app.py index 42b335b1f..85eb27797 100644 --- a/examples/cherrypy/app.py +++ b/examples/cherrypy/app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - import logging logging.basicConfig(level=logging.DEBUG) diff --git a/examples/cherrypy/oauth_app.py b/examples/cherrypy/oauth_app.py index 180f9b43e..17c697e97 100644 --- a/examples/cherrypy/oauth_app.py +++ b/examples/cherrypy/oauth_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../../src") -# ------------------------------------------------ - import logging from slack_bolt import App from slack_bolt.adapter.cherrypy import SlackRequestHandler diff --git a/examples/dialogs_app.py b/examples/dialogs_app.py index e2f23e3ed..5f2509b1a 100644 --- a/examples/dialogs_app.py +++ b/examples/dialogs_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "..") -# ------------------------------------------------ - import logging logging.basicConfig(level=logging.DEBUG) diff --git a/examples/django/manage.py b/examples/django/manage.py index c7ccae1c5..38488e78b 100755 --- a/examples/django/manage.py +++ b/examples/django/manage.py @@ -2,16 +2,6 @@ """Django's command-line utility for administrative tasks.""" import os -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt - -import sys - -sys.path.insert(1, "../../..") - - -# ------------------------------------------------ - def main(): os.environ.setdefault("DJANGO_SETTINGS_MODULE", "slackapp.settings") diff --git a/examples/events_app.py b/examples/events_app.py index f15fab9d0..1f678f0fb 100644 --- a/examples/events_app.py +++ b/examples/events_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "..") -# ------------------------------------------------ - import re import logging diff --git a/examples/falcon/app.py b/examples/falcon/app.py index 1dbf39ffb..83bb5e460 100644 --- a/examples/falcon/app.py +++ b/examples/falcon/app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - import falcon import logging import re diff --git a/examples/falcon/oauth_app.py b/examples/falcon/oauth_app.py index 900ffca99..7d9ad7f1f 100644 --- a/examples/falcon/oauth_app.py +++ b/examples/falcon/oauth_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - import falcon import logging import re diff --git a/examples/fastapi/app.py b/examples/fastapi/app.py index f1b4c7782..3bd275ce9 100644 --- a/examples/fastapi/app.py +++ b/examples/fastapi/app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - from slack_bolt import App from slack_bolt.adapter.fastapi import SlackRequestHandler diff --git a/examples/fastapi/async_app.py b/examples/fastapi/async_app.py index 5f2a77625..265cb3b3e 100644 --- a/examples/fastapi/async_app.py +++ b/examples/fastapi/async_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - import logging logging.basicConfig(level=logging.DEBUG) diff --git a/examples/fastapi/async_oauth_app.py b/examples/fastapi/async_oauth_app.py index a19ba402c..f6cdbade5 100644 --- a/examples/fastapi/async_oauth_app.py +++ b/examples/fastapi/async_oauth_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - import logging logging.basicConfig(level=logging.DEBUG) diff --git a/examples/fastapi/oauth_app.py b/examples/fastapi/oauth_app.py index dccad57ea..1ce71fc59 100644 --- a/examples/fastapi/oauth_app.py +++ b/examples/fastapi/oauth_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - from slack_bolt import App from slack_bolt.adapter.fastapi import SlackRequestHandler diff --git a/examples/flask/app.py b/examples/flask/app.py index ce239280d..ec37fddd4 100644 --- a/examples/flask/app.py +++ b/examples/flask/app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - import logging logging.basicConfig(level=logging.DEBUG) diff --git a/examples/flask/oauth_app.py b/examples/flask/oauth_app.py index c20ef5e67..d48391897 100644 --- a/examples/flask/oauth_app.py +++ b/examples/flask/oauth_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - import logging from slack_bolt import App from slack_bolt.adapter.flask import SlackRequestHandler diff --git a/examples/lazy_async_modals_app.py b/examples/lazy_async_modals_app.py index 7f25d5a73..d37292603 100644 --- a/examples/lazy_async_modals_app.py +++ b/examples/lazy_async_modals_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "..") -# ------------------------------------------------ - import asyncio import logging from slack_bolt.async_app import AsyncApp diff --git a/examples/lazy_modals_app.py b/examples/lazy_modals_app.py index 9b668a859..c27c8cb44 100644 --- a/examples/lazy_modals_app.py +++ b/examples/lazy_modals_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "..") -# ------------------------------------------------ - import logging import time diff --git a/examples/message_events.py b/examples/message_events.py index e0693f7b6..11e196683 100644 --- a/examples/message_events.py +++ b/examples/message_events.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "..") -# ------------------------------------------------ - import logging import re from typing import Callable diff --git a/examples/modals_app.py b/examples/modals_app.py index f0da8d9f8..edd162a90 100644 --- a/examples/modals_app.py +++ b/examples/modals_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "..") -# ------------------------------------------------ - import logging logging.basicConfig(level=logging.DEBUG) diff --git a/examples/modals_app_typed.py b/examples/modals_app_typed.py index ffad223cf..ccd5e69ee 100644 --- a/examples/modals_app_typed.py +++ b/examples/modals_app_typed.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "..") -# ------------------------------------------------ - import logging from typing import Callable from logging import Logger diff --git a/examples/oauth_app.py b/examples/oauth_app.py index 26b772a77..ac05bde2e 100644 --- a/examples/oauth_app.py +++ b/examples/oauth_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "..") -# ------------------------------------------------ - import logging from slack_bolt import App diff --git a/examples/oauth_app_settings.py b/examples/oauth_app_settings.py index 977ec0e49..1877b07fa 100644 --- a/examples/oauth_app_settings.py +++ b/examples/oauth_app_settings.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "..") -# ------------------------------------------------ - import logging import os from slack_bolt import App, BoltResponse diff --git a/examples/oauth_sqlite3_app.py b/examples/oauth_sqlite3_app.py index a62b4f595..ee5edc10f 100644 --- a/examples/oauth_sqlite3_app.py +++ b/examples/oauth_sqlite3_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "..") -# ------------------------------------------------ - import logging logging.basicConfig(level=logging.DEBUG) diff --git a/examples/oauth_sqlite3_app_org_level.py b/examples/oauth_sqlite3_app_org_level.py index 34117e268..d5dad1f26 100644 --- a/examples/oauth_sqlite3_app_org_level.py +++ b/examples/oauth_sqlite3_app_org_level.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "..") -# ------------------------------------------------ - import logging logging.basicConfig(level=logging.DEBUG) diff --git a/examples/pyramid/app.py b/examples/pyramid/app.py index f3befa086..5cea72bc7 100644 --- a/examples/pyramid/app.py +++ b/examples/pyramid/app.py @@ -1,11 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - - import logging from slack_bolt import App from slack_bolt.adapter.pyramid.handler import SlackRequestHandler diff --git a/examples/pyramid/oauth_app.py b/examples/pyramid/oauth_app.py index e229c85b6..c29f7370b 100644 --- a/examples/pyramid/oauth_app.py +++ b/examples/pyramid/oauth_app.py @@ -1,11 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - - import logging from slack_bolt import App from slack_bolt.adapter.pyramid.handler import SlackRequestHandler diff --git a/examples/sanic/async_app.py b/examples/sanic/async_app.py index 6a4e8c19c..c10643640 100644 --- a/examples/sanic/async_app.py +++ b/examples/sanic/async_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - import os from slack_bolt.async_app import AsyncApp from slack_bolt.adapter.sanic import AsyncSlackRequestHandler diff --git a/examples/sanic/async_oauth_app.py b/examples/sanic/async_oauth_app.py index cbadb8cab..c65c085c7 100644 --- a/examples/sanic/async_oauth_app.py +++ b/examples/sanic/async_oauth_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - import os from slack_bolt.async_app import AsyncApp from slack_bolt.adapter.sanic import AsyncSlackRequestHandler diff --git a/examples/socket_mode.py b/examples/socket_mode.py index e4b2f10ba..bef5a6a95 100644 --- a/examples/socket_mode.py +++ b/examples/socket_mode.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "..") -# ------------------------------------------------ - import logging logging.basicConfig(level=logging.DEBUG) @@ -39,15 +32,30 @@ def open_modal(body, client): view={ "type": "modal", "callback_id": "socket_modal_submission", - "submit": {"type": "plain_text", "text": "Submit",}, - "close": {"type": "plain_text", "text": "Cancel",}, - "title": {"type": "plain_text", "text": "Socket Modal",}, + "submit": { + "type": "plain_text", + "text": "Submit", + }, + "close": { + "type": "plain_text", + "text": "Cancel", + }, + "title": { + "type": "plain_text", + "text": "Socket Modal", + }, "blocks": [ { "type": "input", "block_id": "q1", - "label": {"type": "plain_text", "text": "Write anything here!",}, - "element": {"action_id": "feedback", "type": "plain_text_input",}, + "label": { + "type": "plain_text", + "text": "Write anything here!", + }, + "element": { + "action_id": "feedback", + "type": "plain_text_input", + }, }, { "type": "input", @@ -75,9 +83,18 @@ def open_modal(body, client): all_options = [ - {"text": {"type": "plain_text", "text": ":cat: Cat"}, "value": "cat",}, - {"text": {"type": "plain_text", "text": ":dog: Dog"}, "value": "dog",}, - {"text": {"type": "plain_text", "text": ":bear: Bear"}, "value": "bear",}, + { + "text": {"type": "plain_text", "text": ":cat: Cat"}, + "value": "cat", + }, + { + "text": {"type": "plain_text", "text": ":dog: Dog"}, + "value": "dog", + }, + { + "text": {"type": "plain_text", "text": ":bear: Bear"}, + "value": "bear", + }, ] diff --git a/examples/socket_mode_async.py b/examples/socket_mode_async.py index 99bb0ae69..d252fbe54 100644 --- a/examples/socket_mode_async.py +++ b/examples/socket_mode_async.py @@ -1,11 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - - -sys.path.insert(1, "..") -# ------------------------------------------------ - import logging logging.basicConfig(level=logging.DEBUG) @@ -40,15 +32,30 @@ async def open_modal(body, client): view={ "type": "modal", "callback_id": "socket_modal_submission", - "submit": {"type": "plain_text", "text": "Submit",}, - "close": {"type": "plain_text", "text": "Cancel",}, - "title": {"type": "plain_text", "text": "Socket Modal",}, + "submit": { + "type": "plain_text", + "text": "Submit", + }, + "close": { + "type": "plain_text", + "text": "Cancel", + }, + "title": { + "type": "plain_text", + "text": "Socket Modal", + }, "blocks": [ { "type": "input", "block_id": "q1", - "label": {"type": "plain_text", "text": "Write anything here!",}, - "element": {"action_id": "feedback", "type": "plain_text_input",}, + "label": { + "type": "plain_text", + "text": "Write anything here!", + }, + "element": { + "action_id": "feedback", + "type": "plain_text_input", + }, }, { "type": "input", @@ -76,9 +83,18 @@ async def open_modal(body, client): all_options = [ - {"text": {"type": "plain_text", "text": ":cat: Cat"}, "value": "cat",}, - {"text": {"type": "plain_text", "text": ":dog: Dog"}, "value": "dog",}, - {"text": {"type": "plain_text", "text": ":bear: Bear"}, "value": "bear",}, + { + "text": {"type": "plain_text", "text": ":cat: Cat"}, + "value": "cat", + }, + { + "text": {"type": "plain_text", "text": ":dog: Dog"}, + "value": "dog", + }, + { + "text": {"type": "plain_text", "text": ":bear: Bear"}, + "value": "bear", + }, ] diff --git a/examples/socket_mode_oauth.py b/examples/socket_mode_oauth.py index fd51b3150..5e1816de3 100644 --- a/examples/socket_mode_oauth.py +++ b/examples/socket_mode_oauth.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "..") -# ------------------------------------------------ - import logging logging.basicConfig(level=logging.DEBUG) @@ -45,15 +38,30 @@ def open_modal(body, client): view={ "type": "modal", "callback_id": "socket_modal_submission", - "submit": {"type": "plain_text", "text": "Submit",}, - "close": {"type": "plain_text", "text": "Cancel",}, - "title": {"type": "plain_text", "text": "Socket Modal",}, + "submit": { + "type": "plain_text", + "text": "Submit", + }, + "close": { + "type": "plain_text", + "text": "Cancel", + }, + "title": { + "type": "plain_text", + "text": "Socket Modal", + }, "blocks": [ { "type": "input", "block_id": "q1", - "label": {"type": "plain_text", "text": "Write anything here!",}, - "element": {"action_id": "feedback", "type": "plain_text_input",}, + "label": { + "type": "plain_text", + "text": "Write anything here!", + }, + "element": { + "action_id": "feedback", + "type": "plain_text_input", + }, }, { "type": "input", @@ -81,9 +89,18 @@ def open_modal(body, client): all_options = [ - {"text": {"type": "plain_text", "text": ":cat: Cat"}, "value": "cat",}, - {"text": {"type": "plain_text", "text": ":dog: Dog"}, "value": "dog",}, - {"text": {"type": "plain_text", "text": ":bear: Bear"}, "value": "bear",}, + { + "text": {"type": "plain_text", "text": ":cat: Cat"}, + "value": "cat", + }, + { + "text": {"type": "plain_text", "text": ":dog: Dog"}, + "value": "dog", + }, + { + "text": {"type": "plain_text", "text": ":bear: Bear"}, + "value": "bear", + }, ] diff --git a/examples/socket_mode_proxy.py b/examples/socket_mode_proxy.py index 25498ed25..e1e802957 100644 --- a/examples/socket_mode_proxy.py +++ b/examples/socket_mode_proxy.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "..") -# ------------------------------------------------ - import logging logging.basicConfig(level=logging.DEBUG) @@ -20,9 +13,7 @@ proxy_url = "http://localhost:9000" # Install the Slack app and get xoxb- token in advance -app = App( - client=WebClient(token=os.environ["SLACK_BOT_TOKEN"], proxy=proxy_url) -) +app = App(client=WebClient(token=os.environ["SLACK_BOT_TOKEN"], proxy=proxy_url)) @app.event("app_mention") diff --git a/examples/starlette/app.py b/examples/starlette/app.py index 14842c691..51976457d 100644 --- a/examples/starlette/app.py +++ b/examples/starlette/app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - from slack_bolt import App from slack_bolt.adapter.starlette import SlackRequestHandler diff --git a/examples/starlette/async_app.py b/examples/starlette/async_app.py index 61fc2ee39..05a8410dd 100644 --- a/examples/starlette/async_app.py +++ b/examples/starlette/async_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - from slack_bolt.async_app import AsyncApp from slack_bolt.adapter.starlette.async_handler import AsyncSlackRequestHandler diff --git a/examples/starlette/async_oauth_app.py b/examples/starlette/async_oauth_app.py index 433b2c3e5..9ea92e1a6 100644 --- a/examples/starlette/async_oauth_app.py +++ b/examples/starlette/async_oauth_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - from slack_bolt.async_app import AsyncApp from slack_bolt.adapter.starlette.async_handler import AsyncSlackRequestHandler diff --git a/examples/starlette/oauth_app.py b/examples/starlette/oauth_app.py index 64791adb3..704921298 100644 --- a/examples/starlette/oauth_app.py +++ b/examples/starlette/oauth_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - from slack_bolt import App from slack_bolt.adapter.starlette import SlackRequestHandler diff --git a/examples/tornado/app.py b/examples/tornado/app.py index a73eeb7ff..391d818fc 100644 --- a/examples/tornado/app.py +++ b/examples/tornado/app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - import logging logging.basicConfig(level=logging.DEBUG) diff --git a/examples/tornado/oauth_app.py b/examples/tornado/oauth_app.py index 2ae762eb1..ec997125e 100644 --- a/examples/tornado/oauth_app.py +++ b/examples/tornado/oauth_app.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - import logging from slack_bolt import App from slack_bolt.adapter.tornado import SlackEventsHandler, SlackOAuthHandler diff --git a/examples/workflow_steps/async_steps_from_apps.py b/examples/workflow_steps/async_steps_from_apps.py index 05b7801a7..06307be7d 100644 --- a/examples/workflow_steps/async_steps_from_apps.py +++ b/examples/workflow_steps/async_steps_from_apps.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - import logging from slack_sdk.web.async_client import AsyncSlackResponse, AsyncWebClient diff --git a/examples/workflow_steps/async_steps_from_apps_decorator.py b/examples/workflow_steps/async_steps_from_apps_decorator.py index e4f6b3194..7c88a39a0 100644 --- a/examples/workflow_steps/async_steps_from_apps_decorator.py +++ b/examples/workflow_steps/async_steps_from_apps_decorator.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - import asyncio import logging diff --git a/examples/workflow_steps/async_steps_from_apps_primitive.py b/examples/workflow_steps/async_steps_from_apps_primitive.py index b9da584e9..a343d0005 100644 --- a/examples/workflow_steps/async_steps_from_apps_primitive.py +++ b/examples/workflow_steps/async_steps_from_apps_primitive.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - import logging from slack_sdk.web.async_client import AsyncSlackResponse, AsyncWebClient diff --git a/examples/workflow_steps/steps_from_apps.py b/examples/workflow_steps/steps_from_apps.py index a34807d99..147aa5d05 100644 --- a/examples/workflow_steps/steps_from_apps.py +++ b/examples/workflow_steps/steps_from_apps.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - import logging from slack_sdk import WebClient diff --git a/examples/workflow_steps/steps_from_apps_decorator.py b/examples/workflow_steps/steps_from_apps_decorator.py index 64946b4a3..6ccccd975 100644 --- a/examples/workflow_steps/steps_from_apps_decorator.py +++ b/examples/workflow_steps/steps_from_apps_decorator.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - import time import logging diff --git a/examples/workflow_steps/steps_from_apps_primitive.py b/examples/workflow_steps/steps_from_apps_primitive.py index 1777a784c..96ad0c97b 100644 --- a/examples/workflow_steps/steps_from_apps_primitive.py +++ b/examples/workflow_steps/steps_from_apps_primitive.py @@ -1,10 +1,3 @@ -# ------------------------------------------------ -# instead of slack_bolt in requirements.txt -import sys - -sys.path.insert(1, "../..") -# ------------------------------------------------ - import logging from slack_sdk import WebClient diff --git a/scripts/install_all_and_run_tests.sh b/scripts/install_all_and_run_tests.sh index e861401c3..facbde4aa 100755 --- a/scripts/install_all_and_run_tests.sh +++ b/scripts/install_all_and_run_tests.sh @@ -11,6 +11,8 @@ pip uninstall python-lambda test_target="$1" +pip install -e . + if [[ $test_target != "" ]] then pip install -e ".[testing]" && \ From 0b7f28cc011fd68bee2a6862ecc52d683dac967c Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 19 Feb 2021 14:07:00 +0900 Subject: [PATCH 129/719] Upgrade the minimum slack-sdk version to 3.4 --- setup.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index e090e1e32..55867b415 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.3.2,<3.4",], + install_requires=["slack_sdk>=3.4,<4",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", @@ -52,8 +52,7 @@ "moto<=2", # For AWS tests "bottle>=0.12,<1", "boddle>=0.2,<0.3", # For Bottle app tests - # TODO: https://github.com/aws/chalice/issues/1627 - "chalice>=1.22,<2", + "chalice>=1.22.1,<2", "click>=7,<8", # for chalice "CherryPy>=18,<19", "Django>=3,<4", From a69abb5a80a3c34bcda441537b7b6934a45d8cbf Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 19 Feb 2021 14:40:15 +0900 Subject: [PATCH 130/719] version 1.4.0 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index f708a9b20..3e8d9f946 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.3.2" +__version__ = "1.4.0" From 32f47c45e53104d2a93f2334bc9c2efad8cd3635 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sun, 21 Feb 2021 11:56:50 +0900 Subject: [PATCH 131/719] Fix an issue where different user's token may exist in context --- slack_bolt/authorization/async_authorize.py | 7 +++++++ slack_bolt/authorization/authorize.py | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/slack_bolt/authorization/async_authorize.py b/slack_bolt/authorization/async_authorize.py index 335aff82c..80cfbd415 100644 --- a/slack_bolt/authorization/async_authorize.py +++ b/slack_bolt/authorization/async_authorize.py @@ -131,6 +131,8 @@ async def __call__( if not self.bot_only and self.find_installation_available: # since v1.1, this is the default way try: + # Note that this is the latest information for the org/workspace. + # The installer may not be the user associated with this incoming request. installation: Optional[ Installation ] = await self.installation_store.async_find_installation( @@ -143,6 +145,10 @@ async def __call__( return None if installation.user_id != user_id: + # First off, remove the user token as the installer is a different user + installation.user_token = None + installation.user_scopes = [] + # try to fetch the request user's installation # to reflect the user's access token if exists user_installation = ( @@ -154,6 +160,7 @@ async def __call__( ) ) if user_installation is not None: + # Overwrite the installation with the one for this user installation = user_installation bot_token, user_token = installation.bot_token, installation.user_token diff --git a/slack_bolt/authorization/authorize.py b/slack_bolt/authorization/authorize.py index 56cd04161..5b533b576 100644 --- a/slack_bolt/authorization/authorize.py +++ b/slack_bolt/authorization/authorize.py @@ -131,6 +131,8 @@ def __call__( if not self.bot_only and self.find_installation_available: # since v1.1, this is the default way try: + # Note that this is the latest information for the org/workspace. + # The installer may not be the user associated with this incoming request. installation: Optional[ Installation ] = self.installation_store.find_installation( @@ -143,6 +145,10 @@ def __call__( return None if installation.user_id != user_id: + # First off, remove the user token as the installer is a different user + installation.user_token = None + installation.user_scopes = [] + # try to fetch the request user's installation # to reflect the user's access token if exists user_installation = self.installation_store.find_installation( @@ -152,6 +158,7 @@ def __call__( is_enterprise_install=context.is_enterprise_install, ) if user_installation is not None: + # Overwrite the installation with the one for this user installation = user_installation bot_token, user_token = installation.bot_token, installation.user_token From f2f8532c2d363ceb6ae97c1d60253ccb59dba933 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sun, 21 Feb 2021 12:42:09 +0900 Subject: [PATCH 132/719] version 1.4.1 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 3e8d9f946..bf2561596 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.4.0" +__version__ = "1.4.1" From ea8e54ca04aa30993b07c0234c92fdf7b5682689 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 24 Feb 2021 08:40:16 +0900 Subject: [PATCH 133/719] Resolve build failures --- setup.py | 4 ++++ ...ns_web_client.py => test_interactions_websocket_client.py} | 0 2 files changed, 4 insertions(+) rename tests/adapter_tests/socket_mode/{test_interactions_web_client.py => test_interactions_websocket_client.py} (100%) diff --git a/setup.py b/setup.py index 55867b415..e527d4604 100755 --- a/setup.py +++ b/setup.py @@ -43,6 +43,8 @@ "async": [ # async features heavily depends on aiohttp "aiohttp>=3,<4", + # Socket Mode 3rd party implementation + "websockets>=8,<9", ], # pip install -e ".[adapter]" # NOTE: any of async ones requires pip install -e ".[async]" too @@ -67,6 +69,8 @@ # server "uvicorn<1", "gunicorn>=20,<21", + # Socket Mode 3rd party implementation + "websocket_client>=0.57,<1" ], # pip install -e ".[testing]" "testing": test_dependencies, diff --git a/tests/adapter_tests/socket_mode/test_interactions_web_client.py b/tests/adapter_tests/socket_mode/test_interactions_websocket_client.py similarity index 100% rename from tests/adapter_tests/socket_mode/test_interactions_web_client.py rename to tests/adapter_tests/socket_mode/test_interactions_websocket_client.py From 3e483fe2266cb5b544aaf9d93e58d2d6492eedf3 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 24 Feb 2021 08:50:48 +0900 Subject: [PATCH 134/719] Set moto version to v1 --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e527d4604..5d2ad9121 100755 --- a/setup.py +++ b/setup.py @@ -51,7 +51,8 @@ "adapter": [ # used only under src/slack_bolt/adapter "boto3<=2", - "moto<=2", # For AWS tests + # TODO: Upgrade to v2 + "moto<2", # For AWS tests "bottle>=0.12,<1", "boddle>=0.2,<0.3", # For Bottle app tests "chalice>=1.22.1,<2", From 97a55d8dd68f27321a4a40ca997537c828184f08 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 24 Feb 2021 08:01:22 +0900 Subject: [PATCH 135/719] Pass the Bolt logger in default WebClient instantiation --- slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py | 2 +- slack_bolt/app/app.py | 6 +++++- slack_bolt/app/async_app.py | 7 +++++-- slack_bolt/oauth/async_oauth_flow.py | 2 +- slack_bolt/oauth/oauth_flow.py | 2 +- slack_bolt/util/async_utils.py | 6 +++++- slack_bolt/util/utils.py | 6 +++++- 7 files changed, 23 insertions(+), 8 deletions(-) diff --git a/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py b/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py index f6c8ba4d7..14c3f41d3 100644 --- a/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py +++ b/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py @@ -72,7 +72,7 @@ def __init__( @property def client(self) -> WebClient: if self._client is None: - self._client = create_web_client() + self._client = create_web_client(logger=self.logger) return self._client @property diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 2d2c8a116..1941f129f 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -138,7 +138,11 @@ def __init__( warning_client_prioritized_and_token_skipped() ) else: - self._client = create_web_client(token) # NOTE: the token here can be None + self._client = create_web_client( + # NOTE: the token here can be None + token=token, + logger=self._framework_logger, + ) # -------------------------------------- # Authorize & OAuthFlow initialization diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 83242ca90..df4d909b4 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -145,8 +145,11 @@ def __init__( warning_client_prioritized_and_token_skipped() ) else: - # NOTE: the token here can be None - self._async_client = create_async_web_client(token) + self._async_client = create_async_web_client( + # NOTE: the token here can be None + token=token, + logger=self._framework_logger, + ) # -------------------------------------- # Authorize & OAuthFlow initialization diff --git a/slack_bolt/oauth/async_oauth_flow.py b/slack_bolt/oauth/async_oauth_flow.py index 42a98c9e5..3808c1408 100644 --- a/slack_bolt/oauth/async_oauth_flow.py +++ b/slack_bolt/oauth/async_oauth_flow.py @@ -39,7 +39,7 @@ class AsyncOAuthFlow: @property def client(self) -> AsyncWebClient: if self._async_client is None: - self._async_client = create_async_web_client() + self._async_client = create_async_web_client(logger=self.logger) return self._async_client @property diff --git a/slack_bolt/oauth/oauth_flow.py b/slack_bolt/oauth/oauth_flow.py index c03f406d2..df03ef452 100644 --- a/slack_bolt/oauth/oauth_flow.py +++ b/slack_bolt/oauth/oauth_flow.py @@ -38,7 +38,7 @@ class OAuthFlow: @property def client(self) -> WebClient: if self._client is None: - self._client = create_web_client() + self._client = create_web_client(logger=self.logger) return self._client @property diff --git a/slack_bolt/util/async_utils.py b/slack_bolt/util/async_utils.py index 60bbe0903..de01d6835 100644 --- a/slack_bolt/util/async_utils.py +++ b/slack_bolt/util/async_utils.py @@ -1,3 +1,4 @@ +from logging import Logger from typing import Optional from slack_sdk.web.async_client import AsyncWebClient @@ -5,8 +6,11 @@ from slack_bolt.version import __version__ as bolt_version -def create_async_web_client(token: Optional[str] = None) -> AsyncWebClient: +def create_async_web_client( + token: Optional[str] = None, logger: Optional[Logger] = None +) -> AsyncWebClient: return AsyncWebClient( token=token, + logger=logger, user_agent_prefix=f"Bolt-Async/{bolt_version}", ) diff --git a/slack_bolt/util/utils.py b/slack_bolt/util/utils.py index 15352367e..e603110f8 100644 --- a/slack_bolt/util/utils.py +++ b/slack_bolt/util/utils.py @@ -1,5 +1,6 @@ import copy import sys +from logging import Logger from typing import Optional, Union, Dict, Any, Sequence, Callable from slack_sdk import WebClient @@ -9,9 +10,12 @@ from slack_bolt.version import __version__ as bolt_version -def create_web_client(token: Optional[str] = None) -> WebClient: +def create_web_client( + token: Optional[str] = None, logger: Optional[Logger] = None +) -> WebClient: return WebClient( token=token, + logger=logger, user_agent_prefix=f"Bolt/{bolt_version}", ) From 8a0a3de78c4f8bd9abb001607d55b494e4716c47 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 18 Feb 2021 17:52:59 +0900 Subject: [PATCH 136/719] Add Socket Mode in README --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.md b/README.md index d046cb59d..dd710eb92 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,39 @@ python app.py ngrok http 3000 ``` +## Running a Socket Mode app + +If you use [Socket Mode](https://api.slack.com/socket-mode) for running your app, `SocketModeHandler` is available for it. + +```python +import os +from slack_bolt import App +from slack_bolt.adapter.socket_mode import SocketModeHandler + +# Install the Slack app and get xoxb- token in advance +app = App(token=os.environ["SLACK_BOT_TOKEN"]) + +# Add functionality here + +if __name__ == "__main__": + # Create an app-level token with connections:write scope + handler = SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]) + handler.start() +``` + +Run the app this way: + +```bash +export SLACK_APP_TOKEN=xapp-*** +export SLACK_BOT_TOKEN=xoxb-*** +python app.py + +# SLACK_SIGNING_SECRET is not required +# Running ngrok is not required +``` + ## Listening for events + Apps typically react to a collection of incoming events, which can correspond to [Events API events](https://api.slack.com/events-api), [actions](https://api.slack.com/interactivity/components), [shortcuts](https://api.slack.com/interactivity/shortcuts), [slash commands](https://api.slack.com/interactivity/slash-commands) or [options requests](https://api.slack.com/reference/block-kit/block-elements#external_select). For each type of request, there's a method to build a listener function. From 09c7f2c19fd177d9f32358598fd37e00d4df61a0 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 25 Feb 2021 23:55:38 +0900 Subject: [PATCH 137/719] Remove unnecessary semi-colons from code snippets in docs --- docs/_basic/opening_modals.md | 2 +- docs/_basic/responding_actions.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/_basic/opening_modals.md b/docs/_basic/opening_modals.md index 9c71763e7..2276e0c79 100644 --- a/docs/_basic/opening_modals.md +++ b/docs/_basic/opening_modals.md @@ -20,7 +20,7 @@ Read more about modal composition in the
@@ -37,7 +37,7 @@ Since `respond()` is a utility for calling the `response_url`, it behaves in the # Listens to actions triggered with action_id of “user_select” @app.action("user_select") def select_user(ack, action, respond): - ack(); + ack() respond(f"You selected <@{action['selected_user']}>") ``` From fa0fedc87c9115f7d806f8d93d446bd511a548dd Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 3 Mar 2021 11:24:04 +0900 Subject: [PATCH 138/719] version 1.4.2 --- setup.py | 2 +- slack_bolt/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 5d2ad9121..c25be3ea3 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.4,<4",], + install_requires=["slack_sdk>=3.4.1,<4",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/version.py b/slack_bolt/version.py index bf2561596..daa50c7cf 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.4.1" +__version__ = "1.4.2" From 197407b25ee21e864299663f3c4b5ce24795dc75 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 5 Mar 2021 15:42:57 +0900 Subject: [PATCH 139/719] Add Getting started guide in Japanese --- docs/_config.yml | 9 +- docs/_includes/header.html | 2 +- docs/_tutorials/ja_getting_started.md | 304 ++++++++++++++++++++++++++ docs/assets/style.css | 4 +- 4 files changed, 311 insertions(+), 8 deletions(-) create mode 100644 docs/_tutorials/ja_getting_started.md diff --git a/docs/_config.yml b/docs/_config.yml index 716bea204..8e01ded40 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -36,12 +36,11 @@ t: start: Getting started contribute: Contributing ja-jp: - basic: 基本的な概念 - # TODO: translate this title - steps: Workflow steps - advanced: 応用コンセプト +# basic: 基本的な概念 +# steps: ワークフローステップ +# advanced: 応用コンセプト start: Bolt 入門ガイド - contribute: 貢献 +# contribute: 貢献 # Metadata repo_name: bolt-python diff --git a/docs/_includes/header.html b/docs/_includes/header.html index 55924b2d4..53482748e 100644 --- a/docs/_includes/header.html +++ b/docs/_includes/header.html @@ -6,7 +6,7 @@ {% if page.lang == "ja-jp" %} English {% else %} - + 日本語 (Japanese) {% endif %} diff --git a/docs/_tutorials/ja_getting_started.md b/docs/_tutorials/ja_getting_started.md new file mode 100644 index 000000000..80a315f66 --- /dev/null +++ b/docs/_tutorials/ja_getting_started.md @@ -0,0 +1,304 @@ +--- +title: Bolt 入門ガイド +order: 0 +slug: getting-started +lang: ja-jp +layout: tutorial +permalink: /ja-jp/tutorial/getting-started +redirect_from: + - /ja-jp/getting-started + - /getting-started/ja-jp +--- +# Bolt 入門ガイド + +
+このガイドでは、Bolt for Python を使った Slack アプリの設定と起動する方法について説明します。ここで説明する手順は、新しい Slack アプリを作成し、ローカルの開発環境をセットアップし、Slack ワークスペースからのメッセージをリッスンして応答するアプリを開発するという流れになります。 +
+ +この手順を全て終わらせたら、あなたはきっと ⚡️[Slack アプリのはじめ方](https://github.com/slackapi/bolt-python/tree/main/examples/getting_started)のサンプルアプリを動作させたり、それに変更を加えたり、自分のアプリを作ったりすることができるようになるでしょう。 + +--- + +### アプリを作成する +最初にやるべきこと : Bolt での開発を始める前に、[Slack アプリを作成](https://api.slack.com/apps/new)します。 + +> 💡 いつもの仕事のさまたげにならないように、別の開発用のワークスペースを使用することをおすすめします。[新しいワークスペースは無料で作成できます](https://slack.com/get-started#create)。 + +アプリ名を入力し(_後で変更可能_)、インストール先のワークスペースを選択したら、「`Create App`」ボタンをクリックすると、アプリの **Basic Information** ページが表示されます。 + +このページでは、アプリの概要を確認できます。また、「**App Credentials**」ヘッダーの下では「`Signing Secret`」などの重要な認証情報も確認できます。これらの認証情報は後で必要になります。 + +![Basic Information ページ](../../assets/basic-information-page.png "Basic Information ページ") + +ひと通り確認し、アプリのアイコンと説明を追加したら、アプリの構成 🔩 を始めましょう。 + +--- + +### トークンとアプリのインストール +Slack アプリでは、[Slack API へのアクセスの管理に OAuth を使用します](https://api.slack.com/docs/oauth)。アプリがインストールされると、トークンが発行されます。アプリはそのトークンを使って API メソッドを呼び出すことができます。 + +Slack アプリで使用できるトークンには、ユーザートークン(`xoxp`)とボットトークン(`xoxb`)の 2 種類があります。ユーザートークンを使用すると、ユーザーがアプリをインストールまたは認証した後、アプリがそのユーザーを代理して API メソッドを呼び出すことができます。1 つのワークスペースに複数のユーザートークンが存在する可能性があります。ボットトークンはボットユーザーに関連づけられ、1 つのワークスペースでは最初に誰かがそのアプリをインストールした際に一度だけ発行されます。どのユーザーがインストールを実行しても、アプリが使用するボットトークンは同じになります。_ほとんど_のアプリで使用されるのは、ボットトークンです。 + +説明を簡潔にするために、このガイドではボットトークンを使用します。 + +左サイドバーの「**OAuth & Permissions**」をクリックし、「**Bot Token Scopes**」セクションまで下にスクロールします。「**Add an OAuth Scope**」をクリックします。 + +ここでは「[`chat:write`](https://api.slack.com/scopes/chat:write)」というスコープのみを追加します。このスコープは、アプリが参加しているチャンネルにメッセージを投稿することを許可します。 + +OAuth & Permissions ページの一番上までスクロールし、「**Install App to Workspace**」をクリックします。Slack の OAuth 確認画面 が表示されます。この画面で開発用ワークスペースへのアプリのインストールを承認します。 + +インストールを承認すると **OAuth & Permissions** ページが表示され、**Bot User OAuth Access Token** を確認できるでしょう。 + +![OAuth トークン](../../assets/bot-token.png "ボット用 OAuth トークン") + +> 💡 トークンはパスワードと同様に取り扱い、[安全な方法で保管してください](https://api.slack.com/docs/oauth-safety)。アプリはこのトークンを使って Slack ワークスペースで投稿をしたり、情報の取得をしたりします。 + +--- + +### ローカルでプロジェクトをセットアップする +初期設定が終わったら、新しい Bolt プロジェクトのセットアップを行いましょう。このプロジェクトが、あなたのアプリのロジックを処理するコードを配置する場所となります。 + +プロジェクトをまだ作成していない場合は、新しく作成しましょう。空のディレクトリを作成します。 + +```shell +mkdir first-bolt-app +cd first-bolt-app +``` + +次に、プロジェクトの依存関係を管理する方法として、[Python 仮想環境](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment)を使ったおすすめの方法を紹介します。これはシステム Python に存在するパッケージとのコンフリクトを防ぐために推奨されている優れた方法です。[Python 3.6 以降](https://www.python.org/downloads/)の仮想環境を作成し、アクティブにしてみましょう。 + +```shell +python3 -m venv .venv +source .venv/bin/activate +``` + +`python3` へのパスがプロジェクトの中を指していることを確かめることで、仮想環境がアクティブになっていることを確認できます([Windows でもこれに似たコマンドが利用できます](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#activating-a-virtual-environment))。 + +```shell +which python3 +# 出力結果 : /path/to/first-bolt-app/.venv/bin/python3 +``` + +Bolt for Python のパッケージを新しいプロジェクトにインストールする前に、アプリの設定時に作成されたボットトークンと署名シークレットを保存しましょう。これらは環境変数に保存する必要があります。バージョンコントロールには*保存しない*ようにしてください。 + +1. **Basic Information ページの署名シークレット(Signing Secret)をコピー**して、新しい環境変数に保存します。以下のコマンド例は Linux と macOS で利用できます。[Windows でもこれに似たコマンドが利用できます](https://superuser.com/questions/212150/how-to-set-env-variable-in-windows-cmd-line/212153#212153)。 +```shell +export SLACK_SIGNING_SECRET=<署名シークレット> +``` + +2. **OAuth & Permissions ページのボットトークン(xoxb)をコピー**して、別の環境変数に保存します。 +```shell +export SLACK_BOT_TOKEN=xoxb-<ボットトークン> +``` + +完了したら、アプリを作ってみましょう。以下のコマンドを使って、仮想環境に Python の `slack_bolt` パッケージをインストールします。 + +```shell +pip install slack_bolt +``` + +このディレクトリに「`app.py`」という名前の新しいファイルを作成し、以下のコードを追加します。 + +```python +import os +from slack_bolt import App + +# ボットトークンと署名シークレットを使ってアプリを初期化します +app = App( + token=os.environ.get("SLACK_BOT_TOKEN"), + signing_secret=os.environ.get("SLACK_SIGNING_SECRET") +) + +# アプリを起動します +if __name__ == "__main__": + app.start(port=int(os.environ.get("PORT", 3000))) +``` + +このようにトークンと署名シークレットだけあれば、最初の Bolt アプリが作成できます。「`app.py`」ファイルを保存して、コマンドラインで以下を実行します。 + +```script +python3 app.py +``` + +アプリが起動し、実行中であることが表示されます。 + +--- + +### イベントを設定する +アプリはワークスペース内の他のメンバーと同じように振る舞い、メッセージを投稿したり絵文字リアクションを追加したりできます。Slack ワークスペースで発生するイベント(メッセージが投稿されたときや、メッセージに対するリアクションがつけられたときなど)をリッスンするには、[Events API を使って特定の種類のイベントをサブスクライブします](https://api.slack.com/events-api)。 + +アプリをイベントに対応させるため、まずこのアプリの設定ページに戻って設定を行います。[アプリ管理ページ](https://api.slack.com/apps)でアプリをクリックします。次に、左サイドバーの「**Event Subscriptions**」をクリックします。「**Enable Events**」というラベルのスイッチをオンに切り替えます。 + +「**Request URL**」というラベルのテキスト入力フィールドが表示されます。Request URL は、指定したイベントに対応する Slack からの HTTP POST リクエストの送信先となるパブリック URL です。 + +> ⚙️ [API サイト](https://api.slack.com/docs/hosting)に、Slack の開発チームがアプリのホストによく使用する一般的なホスティングプロバイダをいくつか記載しておきました。 + +イベントが発生すると、そのイベントをトリガーしたユーザーやイベントが発生したチャンネルなど、イベントに関する情報が Slack からアプリに送信されます。アプリではこれらの情報を処理して、適切な応答を返します。 + +
+ +

開発用にローカルの Request URL を使用する

+
アプリの開発を始めたばかりの場合、パブリックにアクセスできる URL をまだ持っていないかもしれませんね。最終的には適切なものをセットアップするものとして、ここでは [ngrok](https://ngrok.com/) のような開発用プロキシを利用することにします。開発用プロキシを利用すると、リクエストを開発環境にトンネルするパブリック URL を作成できます。[Slack のローカル開発で ngrok を使用する方法](https://api.slack.com/tutorials/tunneling-with-ngrok)については、別のチュートリアルを用意していますので参考にしてください。開発用プロキシをインストールして実行を開始すると、リクエストが特定のポートに転送されるようになります(この例ではポート 3000 を使用していますが、アプリを初期化する際に使用ポートをカスタマイズしている場合は、そのポートを使用してください)。```shell ngrok http 3000 ``` ![ngrok の実行](../../assets/ngrok.gif "ngrok の実行") 利用可能な URL が生成され、出力結果に表示されます(「`https://`」で始まる URL をおすすめします)。この URL がリクエスト URL のベースになります。この例では「`https://8e8ec2d7.ngrok.io`」です。--- +
+ +これで、ローカルマシンにトンネルしてアプリで利用できるパブリック URL が用意できました。アプリの設定で指定する Request URL は、パブリック URL に、アプリがリッスンするパスを組み合わせたものになります。デフォルトでは、Bolt アプリは「`/slack/events`」をリッスンします。この場合、Request URL 全体は「`https://8e8ec2d7.ngrok.io/slack/events`」となります。 + +> ⚙️ Bolt では、`/slack/events` というエンドポイントで、すべての受信リクエストをリッスンします。これらのリクエストにはショートカット、イベント、インタラクションペイロードが含まれます。アプリの設定でエンドポイントを指定するときは、すべての Request URL の末尾に「`/slack/events`」を追加してください。 + +「**Request URL**」ボックスの「**Enable Events**」スイッチの下に URL を貼りつけます。Bolt アプリが起動した状態のままなら、URL の検証が成功するはずです。 + +Request URL の検証が完了したら、「**Subscribe to Bot Events**」まで下にスクロールします。メッセージに関連するイベントには、次の 4 つがあります。 + +- `message.channels` アプリが参加しているパブリックチャンネルのメッセージをリッスン +- `message.groups` アプリが参加しているプライベートチャンネルのメッセージをリッスン +- `message.im` あなたのアプリとユーザーのダイレクトメッセージをリッスン +- `message.mpim` あなたのアプリが追加されているグループ DM をリッスン + +ボットが参加するすべての場所のメッセージをリッスンさせるには、これら 4 つのメッセージイベントをすべて選択します。ボットにリッスンさせるメッセージイベントの種類を選択したら、「**Save Changes**」ボタンをクリックします。 + +--- + +### メッセージをリッスンして応答する +アプリにロジックを組み込む準備が整いました。まずは `message()` メソッドを使用して、メッセージのリスナーをアタッチしましょう。 + +次の例では、アプリが参加するチャンネルとダイレクトメッセージに投稿されるすべてのメッセージをリッスンし、「hello」というメッセージに応答を返します。 + +```python +import os +from slack_bolt import App + +# ボットトークンと署名シークレットを使ってアプリを初期化します +app = App( + token=os.environ.get("SLACK_BOT_TOKEN"), + signing_secret=os.environ.get("SLACK_SIGNING_SECRET") +) + +# 「hello」を含むメッセージをリッスンします +@app.message("hello") +def message_hello(message, say): + # イベントがトリガーされたチャンネルへ say() でメッセージを送信します + say(f"Hey there <@{message['user']}>!") + +# アプリを起動します +if __name__ == "__main__": + app.start(port=int(os.environ.get("PORT", 3000))) +``` + +アプリを再起動し、ボットユーザーが参加しているチャンネルまたはダイレクトメッセージに「hello」というメッセージを投稿すれば、アプリが応答するでしょう。 + +これはごく基本的なコード例ですが、最終的にやりたいことを実現するためにアプリをカスタマイズするための起点として利用できます。プレーンテキストを送信する代わりにボタンを表示するという、もう少しインタラクティブな動作を試してみましょう。 + +--- + +### アクションを送信して応答する + +インタラクティブ機能を有効にすると、ボタン、選択メニュー、日付ピッカー、モーダル、ショートカットなどの機能が利用できるようになります。イベントと同様に、Slack からのアクション(*ユーザーがボタンをクリックした*など)の送信先となる URL を設定する必要があります。 + +アプリ設定ページに戻り、左サイドメニューの「**Interactivity & Shortcuts**」をクリックします。別の **Request URL** ボックスを見つけます。 + +デフォルトでは、Bolt はイベントに使用しているのと同じエンドポイントをインタラクティブコンポーネントにも使用するように設定されているため、上記と同じリクエスト URL(この例では「`https://8e8ec2d7.ngrok.io/slack/events`」)を使用します。このままの状態で、右下隅にある「**Save Changes**」ボタンを押してください。これでインタラクティブ機能がアプリで利用できるようになりました。 + +![Request URL の設定](../../assets/request-url-config.png "Request URL の設定") + +それでは、アプリのコードに戻り、インタラクティブ機能を追加しましょう。インタラクティブ機能は 2 つのステップで構成されます。まず、ボタンを含んだメッセージをアプリから送信します。次に、ユーザーから返されるボタンクリックのアクションをリッスンし、それに応答します。 + +以下のコードの後の部分を編集し、文字列だけのメッセージの代わりに、ボタンを含んだメッセージを送信するようにしてみます。 + +```python +import os +from slack_bolt import App + +# ボットトークンと署名シークレットを使ってアプリを初期化します +app = App( + token=os.environ.get("SLACK_BOT_TOKEN"), + signing_secret=os.environ.get("SLACK_SIGNING_SECRET") +) + +# 「hello」を含むメッセージをリッスンします +@app.message("hello") +def message_hello(message, say): + # イベントがトリガーされたチャンネルへ say() でメッセージを送信します + say( + blocks=[ + { + "type": "section", + "text": {"type": "mrkdwn", "text": f"Hey there <@{message['user']}>!"}, + "accessory": { + "type": "button", + "text": {"type": "plain_text", "text":"Click Me"}, + "action_id": "button_click" + } + } + ], + text=f"Hey there <@{message['user']}>!" + ) + +# アプリを起動します +if __name__ == "__main__": + app.start(port=int(os.environ.get("PORT", 3000))) +``` + +`say()` の中の値を、「`blocks`」という配列のオブジェクトに変えました。ブロックは Slack メッセージを構成するコンポーネントであり、テキストや画像、日付ピッカーなど、さまざまなタイプのブロックがあります。この例では、「accessory」に「button」を持たせた「section」のブロックを、アプリからの応答に含めています。「`blocks`」を使用する場合、「`text`」は通知やアクセシビリティのためのフォールバックとなります。 + +ボタンを含む「`accessory`」オブジェクトでは、「`action_id`」を指定していることがわかります。これは、ボタンを一意に示す識別子として機能します。これを使って、アプリをどのアクションに応答させるかを指定できます。 + +> 💡 [Block Kit Builder](https://app.slack.com/block-kit-builder) を使用すると、インタラクティブなメッセージのプロトタイプを簡単に作成できます。自分自身やチームメンバーがメッセージのモックアップを作成し、生成される JSON をアプリに直接貼りつけることができます。 + +アプリを再起動し、アプリが参加しているチャンネルで「hello」と入力すると、ボタン付きのメッセージが表示されるようになりました。ただし、ボタンをクリックしても、*まだ*何も起こりません。 + +ハンドラーを追加して、ボタンがクリックされたときにフォローアップメッセージを送信するようにしてみましょう。 + +```python +import os +from slack_bolt import App + +# ボットトークンと署名シークレットを使ってアプリを初期化します +app = App( + token=os.environ.get("SLACK_BOT_TOKEN"), + signing_secret=os.environ.get("SLACK_SIGNING_SECRET") +) + +# 「hello」を含むメッセージをリッスンします +@app.message("hello") +def message_hello(message, say): + # イベントがトリガーされたチャンネルへ say() でメッセージを送信します + say( + blocks=[ + { + "type": "section", + "text": {"type": "mrkdwn", "text": f"Hey there <@{message['user']}>!"}, + "accessory": { + "type": "button", + "text": {"type": "plain_text", "text":"Click Me"}, + "action_id": "button_click" + } + } + ], + text=f"Hey there <@{message['user']}>!" + ) + +@app.action("button_click") +def action_button_click(body, ack, say): + # アクションを確認したことを即時で応答します + ack() + # チャンネルにメッセージを投稿します + say(f"<@{body['user']['id']}> clicked the button") + +# アプリを起動します +if __name__ == "__main__": + app.start(port=int(os.environ.get("PORT", 3000))) +``` + +`app.action()` を使って、先ほど命名した「`button_click`」という `action_id` をリッスンしています。アプリを再起動し、ボタンをクリックすると、アプリからの「clicked the button」というメッセージが新たに表示されるでしょう。 + +--- + +### 次のステップ +はじめての [Bolt for Python アプリ](https://github.com/slackapi/bolt-python/tree/main/examples/getting_started)を構築することができました。🎉 + +ここまでで基本的なアプリをセットアップして実行することはできたので、次は自分だけの Bolt アプリを作る方法を調べてみましょう。参考になりそうな記事をいくつかご紹介します。 + +* [基本的な概念](/bolt-python/concepts#basic)について読む。Bolt アプリがアクセスできるさまざまメソッドや機能について知ることができます。 +* [`events()` メソッド](/bolt-python/concepts#event-listening)でボットがリッスンできるイベントをほかにも試してみる。すべてのイベントの一覧は [API サイト](https://api.slack.com/events)で確認できます。 +* Bolt では、アプリにアタッチされたクライアントから [Web API メソッドを呼び出す](/bolt-python/concepts#web-api)ことができます。API サイトに [220 以上のメソッド](https://api.slack.com/methods)を一覧しています。 +* [API サイト](https://api.slack.com/docs/token-types)でほかのタイプのトークンを確認する。アプリで実行したいアクションによって、異なるトークンが必要になる場合があります。 \ No newline at end of file diff --git a/docs/assets/style.css b/docs/assets/style.css index 3af53a8c6..2041edc07 100644 --- a/docs/assets/style.css +++ b/docs/assets/style.css @@ -133,7 +133,7 @@ span.beta { color: var(--grey); font-weight: 700; padding: 6px 14px 9px; - font-size 0.9em; + font-size: 0.9em; } .header a.language-switcher:hover { @@ -173,7 +173,7 @@ span.beta { border-image: linear-gradient( to bottom, #FFFFFF 0%, - #F2F2F2 6% 92%, + #F2F2F2 6%, #FFFFFF 100% ) 1 100%; list-style: none; From dd9dc762766b05c6ad2ed6c27aff30ec5d902311 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 6 Mar 2021 11:49:26 +0900 Subject: [PATCH 140/719] Fix an error in Django example --- examples/django/manage.py | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/django/manage.py b/examples/django/manage.py index 38488e78b..eb1a2c09c 100755 --- a/examples/django/manage.py +++ b/examples/django/manage.py @@ -1,6 +1,7 @@ #!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os +import sys def main(): From 1efd5cd62a87d683d5df7fc0adb40efc798b5815 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 6 Mar 2021 12:07:57 +0900 Subject: [PATCH 141/719] Fix errors in AWS Lambda examples --- examples/aws_lambda/aws_lambda.py | 2 ++ examples/aws_lambda/aws_lambda_oauth.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/examples/aws_lambda/aws_lambda.py b/examples/aws_lambda/aws_lambda.py index 8ca79a82c..420ed380c 100644 --- a/examples/aws_lambda/aws_lambda.py +++ b/examples/aws_lambda/aws_lambda.py @@ -1,5 +1,7 @@ import logging +import sys +sys.path.insert(1, "vendor") from slack_bolt import App from slack_bolt.adapter.aws_lambda import SlackRequestHandler diff --git a/examples/aws_lambda/aws_lambda_oauth.py b/examples/aws_lambda/aws_lambda_oauth.py index f30609a1c..d13660c06 100644 --- a/examples/aws_lambda/aws_lambda_oauth.py +++ b/examples/aws_lambda/aws_lambda_oauth.py @@ -1,4 +1,7 @@ import logging +import sys + +sys.path.insert(1, "vendor") from slack_bolt import App from slack_bolt.adapter.aws_lambda import SlackRequestHandler From f0080b287837b32e89db93df07b9f5ecb1e96687 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 6 Mar 2021 13:14:45 +0900 Subject: [PATCH 142/719] Resolve #251 by correcting response headers --- slack_bolt/oauth/async_oauth_flow.py | 1 - slack_bolt/oauth/internals.py | 2 -- slack_bolt/oauth/oauth_flow.py | 1 - tests/adapter_tests/aws/test_aws_chalice.py | 1 - tests/adapter_tests/aws/test_aws_lambda.py | 2 -- tests/adapter_tests/django/test_django.py | 1 - tests/adapter_tests/starlette/test_fastapi.py | 1 - tests/adapter_tests/starlette/test_starlette.py | 1 - tests/slack_bolt/oauth/test_oauth_flow.py | 1 - tests/slack_bolt/oauth/test_oauth_flow_sqlite3.py | 1 - tests/slack_bolt_async/oauth/test_async_oauth_flow.py | 1 - tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py | 1 - 12 files changed, 14 deletions(-) diff --git a/slack_bolt/oauth/async_oauth_flow.py b/slack_bolt/oauth/async_oauth_flow.py index 3808c1408..ce26c3e03 100644 --- a/slack_bolt/oauth/async_oauth_flow.py +++ b/slack_bolt/oauth/async_oauth_flow.py @@ -172,7 +172,6 @@ async def handle_installation(self, request: AsyncBoltRequest) -> BoltResponse: body=html, headers={ "Content-Type": "text/html; charset=utf-8", - "Content-Length": len(bytes(html, "utf-8")), "Set-Cookie": [set_cookie_value], }, ) diff --git a/slack_bolt/oauth/internals.py b/slack_bolt/oauth/internals.py index e551f682f..39fcd9fcf 100644 --- a/slack_bolt/oauth/internals.py +++ b/slack_bolt/oauth/internals.py @@ -42,7 +42,6 @@ def _build_callback_success_response( # type: ignore status=200, headers={ "Content-Type": "text/html; charset=utf-8", - "Content-Length": len(bytes(html, "utf-8")), "Set-Cookie": self._state_utils.build_set_cookie_for_deletion(), }, body=html, @@ -66,7 +65,6 @@ def _build_callback_failure_response( # type: ignore status=status, headers={ "Content-Type": "text/html; charset=utf-8", - "Content-Length": len(bytes(html, "utf-8")), "Set-Cookie": self._state_utils.build_set_cookie_for_deletion(), }, body=html, diff --git a/slack_bolt/oauth/oauth_flow.py b/slack_bolt/oauth/oauth_flow.py index df03ef452..ccb31c826 100644 --- a/slack_bolt/oauth/oauth_flow.py +++ b/slack_bolt/oauth/oauth_flow.py @@ -167,7 +167,6 @@ def handle_installation(self, request: BoltRequest) -> BoltResponse: body=html, headers={ "Content-Type": "text/html; charset=utf-8", - "Content-Length": len(bytes(html, "utf-8")), "Set-Cookie": [set_cookie_value], }, ) diff --git a/tests/adapter_tests/aws/test_aws_chalice.py b/tests/adapter_tests/aws/test_aws_chalice.py index bf65601d0..ad9263550 100644 --- a/tests/adapter_tests/aws/test_aws_chalice.py +++ b/tests/adapter_tests/aws/test_aws_chalice.py @@ -288,5 +288,4 @@ def install() -> Response: ) assert response["statusCode"] == 200 assert response["headers"]["content-type"] == "text/html; charset=utf-8" - assert response["headers"]["content-length"] == "565" assert "https://slack.com/oauth/v2/authorize?state=" in response.get("body") diff --git a/tests/adapter_tests/aws/test_aws_lambda.py b/tests/adapter_tests/aws/test_aws_lambda.py index 4c6a1bb14..99000094d 100644 --- a/tests/adapter_tests/aws/test_aws_lambda.py +++ b/tests/adapter_tests/aws/test_aws_lambda.py @@ -305,7 +305,6 @@ def test_oauth(self): response = SlackRequestHandler(app).handle(event, self.context) assert response["statusCode"] == 200 assert response["headers"]["content-type"] == "text/html; charset=utf-8" - assert response["headers"]["content-length"] == "565" assert response.get("body") is not None event = { @@ -318,5 +317,4 @@ def test_oauth(self): response = SlackRequestHandler(app).handle(event, self.context) assert response["statusCode"] == 200 assert response["headers"]["content-type"] == "text/html; charset=utf-8" - assert response["headers"]["content-length"] == "565" assert "https://slack.com/oauth/v2/authorize?state=" in response.get("body") diff --git a/tests/adapter_tests/django/test_django.py b/tests/adapter_tests/django/test_django.py index c8254c52c..f387427a9 100644 --- a/tests/adapter_tests/django/test_django.py +++ b/tests/adapter_tests/django/test_django.py @@ -188,7 +188,6 @@ def test_oauth(self): response = SlackRequestHandler(app).handle(request) assert response.status_code == 200 assert response.get("content-type") == "text/html; charset=utf-8" - assert response.get("content-length") == "565" assert "https://slack.com/oauth/v2/authorize?state=" in response.content.decode( "utf-8" ) diff --git a/tests/adapter_tests/starlette/test_fastapi.py b/tests/adapter_tests/starlette/test_fastapi.py index 29282bc24..4b09c618a 100644 --- a/tests/adapter_tests/starlette/test_fastapi.py +++ b/tests/adapter_tests/starlette/test_fastapi.py @@ -213,5 +213,4 @@ async def endpoint(req: Request): response = client.get("/slack/install", allow_redirects=False) assert response.status_code == 200 assert response.headers.get("content-type") == "text/html; charset=utf-8" - assert response.headers.get("content-length") == "565" assert "https://slack.com/oauth/v2/authorize?state=" in response.text diff --git a/tests/adapter_tests/starlette/test_starlette.py b/tests/adapter_tests/starlette/test_starlette.py index 033d80f51..43b42cfbf 100644 --- a/tests/adapter_tests/starlette/test_starlette.py +++ b/tests/adapter_tests/starlette/test_starlette.py @@ -222,5 +222,4 @@ async def endpoint(req: Request): response = client.get("/slack/install", allow_redirects=False) assert response.status_code == 200 assert response.headers.get("content-type") == "text/html; charset=utf-8" - assert response.headers.get("content-length") == "565" assert "https://slack.com/oauth/v2/authorize?state=" in response.text diff --git a/tests/slack_bolt/oauth/test_oauth_flow.py b/tests/slack_bolt/oauth/test_oauth_flow.py index 9be907b66..a43db0b5f 100644 --- a/tests/slack_bolt/oauth/test_oauth_flow.py +++ b/tests/slack_bolt/oauth/test_oauth_flow.py @@ -56,7 +56,6 @@ def test_handle_installation_default(self): resp = oauth_flow.handle_installation(req) assert resp.status == 200 assert resp.headers.get("content-type") == ["text/html; charset=utf-8"] - assert resp.headers.get("content-length") == ["576"] assert "https://slack.com/oauth/v2/authorize?state=" in resp.body # https://github.com/slackapi/bolt-python/issues/183 diff --git a/tests/slack_bolt/oauth/test_oauth_flow_sqlite3.py b/tests/slack_bolt/oauth/test_oauth_flow_sqlite3.py index 00b3ad12b..26c54df15 100644 --- a/tests/slack_bolt/oauth/test_oauth_flow_sqlite3.py +++ b/tests/slack_bolt/oauth/test_oauth_flow_sqlite3.py @@ -41,7 +41,6 @@ def test_handle_installation(self): resp = oauth_flow.handle_installation(req) assert resp.status == 200 assert resp.headers.get("content-type") == ["text/html; charset=utf-8"] - assert resp.headers.get("content-length") == ["565"] assert "https://slack.com/oauth/v2/authorize?state=" in resp.body def test_handle_callback(self): diff --git a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py index 2aecaf424..eea474b87 100644 --- a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py +++ b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py @@ -107,7 +107,6 @@ async def test_handle_installation_default(self): resp = await oauth_flow.handle_installation(req) assert resp.status == 200 assert resp.headers.get("content-type") == ["text/html; charset=utf-8"] - assert resp.headers.get("content-length") == ["565"] assert "https://slack.com/oauth/v2/authorize?state=" in resp.body @pytest.mark.asyncio diff --git a/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py b/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py index afd3cbdac..c9190ff55 100644 --- a/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py +++ b/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py @@ -55,7 +55,6 @@ async def test_handle_installation(self): resp = await oauth_flow.handle_installation(req) assert resp.status == 200 assert resp.headers.get("content-type") == ["text/html; charset=utf-8"] - assert resp.headers.get("content-length") == ["565"] assert "https://slack.com/oauth/v2/authorize?state=" in resp.body @pytest.mark.asyncio From e80a21cec28cd7dcbeb0dce35ec3e4fcdc0ad277 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 6 Mar 2021 14:33:41 +0900 Subject: [PATCH 143/719] version 1.4.3 --- setup.py | 2 +- slack_bolt/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index c25be3ea3..cdb5bcd01 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.4.1,<4",], + install_requires=["slack_sdk>=3.4.2,<4",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/version.py b/slack_bolt/version.py index daa50c7cf..aa56ed404 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.4.2" +__version__ = "1.4.3" From 4044d5ab37656e65f2f91526c0b7d250f1018566 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 10 Mar 2021 08:35:03 +0900 Subject: [PATCH 144/719] Improve the warning message in App/AsyncApp constructor #256 --- slack_bolt/app/app.py | 7 ++++++- slack_bolt/app/async_app.py | 5 +++++ slack_bolt/logger/messages.py | 13 ++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 1941f129f..175bc0e58 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -44,6 +44,7 @@ error_authorize_conflicts, warning_bot_only_conflicts, debug_return_listener_middleware_response, + info_default_oauth_settings_loaded, ) from slack_bolt.middleware import ( Middleware, @@ -174,7 +175,11 @@ def __init__( # initialize with the default settings oauth_settings = OAuthSettings() - if oauth_flow: + if oauth_flow is None and installation_store is None: + # show info-level log for avoiding confusions + self._framework_logger.info(info_default_oauth_settings_loaded()) + + if oauth_flow is not None: self._oauth_flow = oauth_flow installation_store = select_consistent_installation_store( client_id=self._oauth_flow.client_id, diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index df4d909b4..7d1180674 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -45,6 +45,7 @@ error_oauth_flow_invalid_type_async, warning_bot_only_conflicts, debug_return_listener_middleware_response, + info_default_oauth_settings_loaded, ) from slack_bolt.lazy_listener.asyncio_runner import AsyncioLazyListenerRunner from slack_bolt.listener.async_listener import AsyncListener, AsyncCustomListener @@ -184,6 +185,10 @@ def __init__( # initialize with the default settings oauth_settings = AsyncOAuthSettings() + if oauth_flow is None and installation_store is None: + # show info-level log for avoiding confusions + self._framework_logger.info(info_default_oauth_settings_loaded()) + if oauth_flow: if not isinstance(oauth_flow, AsyncOAuthFlow): raise BoltError(error_oauth_flow_invalid_type_async()) diff --git a/slack_bolt/logger/messages.py b/slack_bolt/logger/messages.py index f7bc8af7e..24d33b956 100644 --- a/slack_bolt/logger/messages.py +++ b/slack_bolt/logger/messages.py @@ -69,7 +69,8 @@ def warning_client_prioritized_and_token_skipped() -> str: def warning_token_skipped() -> str: return ( - "As you gave `installation_store`/`authorize` as well, `token` will be unused." + "As either `installation_store` or `authorize` is enabled, " + "`token` (or SLACK_BOT_TOKEN env variable) will be unused." ) @@ -104,6 +105,16 @@ def warning_skip_uncommon_arg_name(arg_name: str) -> str: # ------------------------------- +def info_default_oauth_settings_loaded() -> str: + return ( + "As you've set SLACK_CLIENT_ID and SLACK_CLIENT_SECRET env variables, " + "Bolt enabled file-based InstallationStore/OAuthStateStore for you. " + "Note that the file based ones are for local development. " + "If you want to use a different datastore, set oauth_settings argument in App constructor. " + "Refer to https://slack.dev/bolt-python/concepts#authenticating-oauth for more details." + ) + + # ------------------------------- # Debug # ------------------------------- From dafc833e9cbc39edb87528e8e782422e87fefc5b Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 10 Mar 2021 09:28:56 +0900 Subject: [PATCH 145/719] Apply suggestions from code review Co-authored-by: Alissa Renz --- slack_bolt/logger/messages.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/slack_bolt/logger/messages.py b/slack_bolt/logger/messages.py index 24d33b956..57d12dfab 100644 --- a/slack_bolt/logger/messages.py +++ b/slack_bolt/logger/messages.py @@ -69,8 +69,8 @@ def warning_client_prioritized_and_token_skipped() -> str: def warning_token_skipped() -> str: return ( - "As either `installation_store` or `authorize` is enabled, " - "`token` (or SLACK_BOT_TOKEN env variable) will be unused." + "As `installation_store` or `authorize` has been used, " + "`token` (or SLACK_BOT_TOKEN env variable) will be ignored." ) @@ -108,10 +108,10 @@ def warning_skip_uncommon_arg_name(arg_name: str) -> str: def info_default_oauth_settings_loaded() -> str: return ( "As you've set SLACK_CLIENT_ID and SLACK_CLIENT_SECRET env variables, " - "Bolt enabled file-based InstallationStore/OAuthStateStore for you. " - "Note that the file based ones are for local development. " - "If you want to use a different datastore, set oauth_settings argument in App constructor. " - "Refer to https://slack.dev/bolt-python/concepts#authenticating-oauth for more details." + "Bolt has enabled the file-based InstallationStore/OAuthStateStore for you. " + "Note that these file-based stores are for local development. " + "If you'd like to use a different data store, set the oauth_settings argument in the App constructor. " + "Please refer to https://slack.dev/bolt-python/concepts#authenticating-oauth for more details." ) From de2ee3ea1305051795c3f2ebc72a0bba8471034d Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 19 Mar 2021 21:44:03 +0900 Subject: [PATCH 146/719] Fix #261 SocketModeHandler#start() does not terminate on Windows --- slack_bolt/adapter/socket_mode/base_handler.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/slack_bolt/adapter/socket_mode/base_handler.py b/slack_bolt/adapter/socket_mode/base_handler.py index 99568754e..d64c20c69 100644 --- a/slack_bolt/adapter/socket_mode/base_handler.py +++ b/slack_bolt/adapter/socket_mode/base_handler.py @@ -1,4 +1,6 @@ import logging +import signal +import sys from threading import Event from slack_sdk.socket_mode.client import BaseSocketModeClient @@ -30,4 +32,10 @@ def start(self): print(get_boot_message()) else: self.app.logger.info(get_boot_message()) + + if sys.platform == "win32": + # Ctrl+C etc does not work on Windows OS + # see https://bugs.python.org/issue35935 for details + signal.signal(signal.SIGINT, signal.SIG_DFL) + Event().wait() From 1282934e96e41ef73da34ce0d6786314681282f5 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 22 Mar 2021 15:23:46 +0900 Subject: [PATCH 147/719] version 1.4.4 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index aa56ed404..c0f285b05 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1 +1 @@ -__version__ = "1.4.3" +__version__ = "1.4.4" From 66aad210faeed75c04941dfb635a4556952a8868 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 24 Mar 2021 21:22:33 +0900 Subject: [PATCH 148/719] Update docstring and add the api-docs generator script --- .github/maintainers_guide.md | 6 + docs/_includes/sidebar.html | 3 + scripts/generate_api_docs.sh | 10 + slack_bolt/__init__.py | 7 + slack_bolt/adapter/__init__.py | 2 + slack_bolt/app/__init__.py | 7 + slack_bolt/app/app.py | 406 +++++++++++++---- slack_bolt/app/async_app.py | 408 ++++++++++++++---- slack_bolt/app/async_server.py | 14 +- slack_bolt/async_app.py | 46 ++ slack_bolt/authorization/__init__.py | 5 + .../authorization/async_authorize_args.py | 11 +- slack_bolt/authorization/authorize_args.py | 11 +- slack_bolt/authorization/authorize_result.py | 20 +- slack_bolt/context/__init__.py | 7 + slack_bolt/context/async_context.py | 68 +++ slack_bolt/context/base_context.py | 15 + slack_bolt/context/context.py | 68 +++ slack_bolt/error/__init__.py | 1 + slack_bolt/kwargs_injection/__init__.py | 6 + slack_bolt/kwargs_injection/args.py | 36 ++ slack_bolt/kwargs_injection/async_args.py | 36 ++ slack_bolt/lazy_listener/__init__.py | 23 + slack_bolt/lazy_listener/async_runner.py | 12 +- slack_bolt/lazy_listener/runner.py | 14 +- slack_bolt/listener/__init__.py | 5 + slack_bolt/listener/async_listener.py | 18 +- .../listener/async_listener_error_handler.py | 8 +- slack_bolt/listener/listener.py | 20 +- slack_bolt/listener/listener_error_handler.py | 8 +- slack_bolt/listener_matcher/__init__.py | 4 + .../async_listener_matcher.py | 9 +- .../listener_matcher/listener_matcher.py | 9 +- slack_bolt/logger/__init__.py | 2 + slack_bolt/middleware/__init__.py | 7 + slack_bolt/middleware/async_middleware.py | 19 + .../async_multi_teams_authorization.py | 3 +- .../multi_teams_authorization.py | 3 +- .../single_team_authorization.py | 3 +- slack_bolt/middleware/middleware.py | 19 + .../async_request_verification.py | 6 + .../request_verification.py | 7 +- slack_bolt/middleware/ssl_check/ssl_check.py | 9 +- slack_bolt/oauth/__init__.py | 5 + slack_bolt/oauth/async_callback_options.py | 22 +- slack_bolt/oauth/async_oauth_flow.py | 7 +- slack_bolt/oauth/async_oauth_settings.py | 37 +- slack_bolt/oauth/callback_options.py | 27 +- slack_bolt/oauth/oauth_flow.py | 7 +- slack_bolt/oauth/oauth_settings.py | 37 +- slack_bolt/request/__init__.py | 5 + slack_bolt/request/async_request.py | 11 +- slack_bolt/request/request.py | 11 +- slack_bolt/response/__init__.py | 8 + slack_bolt/response/response.py | 7 +- slack_bolt/util/__init__.py | 1 + slack_bolt/util/utils.py | 7 +- slack_bolt/version.py | 1 + slack_bolt/workflows/__init__.py | 10 + slack_bolt/workflows/step/async_step.py | 127 ++++-- .../workflows/step/async_step_middleware.py | 1 + slack_bolt/workflows/step/internals.py | 8 +- slack_bolt/workflows/step/step.py | 127 ++++-- slack_bolt/workflows/step/step_middleware.py | 1 + .../workflows/step/utilities/__init__.py | 19 + .../step/utilities/async_complete.py | 22 + .../step/utilities/async_configure.py | 29 ++ .../workflows/step/utilities/async_fail.py | 19 + .../workflows/step/utilities/async_update.py | 38 ++ .../workflows/step/utilities/complete.py | 22 + .../workflows/step/utilities/configure.py | 29 ++ slack_bolt/workflows/step/utilities/fail.py | 19 + slack_bolt/workflows/step/utilities/update.py | 38 ++ 73 files changed, 1719 insertions(+), 384 deletions(-) create mode 100755 scripts/generate_api_docs.sh diff --git a/.github/maintainers_guide.md b/.github/maintainers_guide.md index 6839007d8..550480f74 100644 --- a/.github/maintainers_guide.md +++ b/.github/maintainers_guide.md @@ -109,6 +109,12 @@ $ ngrok http 3000 --subdomain {your-domain} ### Releasing +#### Generate API documents + +```bash +./scripts/generate_api_docs.sh +``` + #### test.pypi.org deployment ##### $HOME/.pypirc diff --git a/docs/_includes/sidebar.html b/docs/_includes/sidebar.html index ecadae7b0..4343ff5c3 100644 --- a/docs/_includes/sidebar.html +++ b/docs/_includes/sidebar.html @@ -23,6 +23,9 @@
  • {{ site.t[page.lang].start }}
  • + +
  • API Documents
  • +
  • @@ -304,7 +328,6 @@

    app

  • app_token
  • client
  • -
  • handle
  • diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/async_base_handler.html b/docs/api-docs/slack_bolt/adapter/socket_mode/async_base_handler.html index 532ac480a..c9f7c4b53 100644 --- a/docs/api-docs/slack_bolt/adapter/socket_mode/async_base_handler.html +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/async_base_handler.html @@ -5,7 +5,7 @@ slack_bolt.adapter.socket_mode.async_base_handler API documentation - + @@ -22,11 +22,13 @@

    Module slack_bolt.adapter.socket_mode.async_base_handler

    +

    The base class of asyncio-based Socket Mode client implementation

    Expand source code -
    import asyncio
    +
    """The base class of asyncio-based Socket Mode client implementation"""
    +import asyncio
     import logging
     from typing import Union
     
    @@ -45,18 +47,31 @@ 

    Module slack_bolt.adapter.socket_mode.async_base_handler async def handle( self, client: AsyncBaseSocketModeClient, req: SocketModeRequest ) -> None: + """Handles Socket Mode envelope requests through a WebSocket connection. + + Args: + client: this Socket Mode client instance + req: the request data + """ raise NotImplementedError() async def connect_async(self): + """Establishes a new connection with the Socket Mode server""" await self.client.connect() async def disconnect_async(self): + """Disconnects the current WebSocket connection with the Socket Mode server""" await self.client.disconnect() async def close_async(self): + """Disconnects from the Socket Mode server and cleans the resources this instance holds up""" await self.client.close() async def start_async(self): + """Establishes a new connection and then starts infinite sleep + to prevent the termination of this process. + If you don't want to have the sleep, use `#connect()` method instead. + """ await self.connect_async() if self.app.logger.level > logging.INFO: print(get_boot_message()) @@ -90,18 +105,31 @@

    Classes

    async def handle( self, client: AsyncBaseSocketModeClient, req: SocketModeRequest ) -> None: + """Handles Socket Mode envelope requests through a WebSocket connection. + + Args: + client: this Socket Mode client instance + req: the request data + """ raise NotImplementedError() async def connect_async(self): + """Establishes a new connection with the Socket Mode server""" await self.client.connect() async def disconnect_async(self): + """Disconnects the current WebSocket connection with the Socket Mode server""" await self.client.disconnect() async def close_async(self): + """Disconnects from the Socket Mode server and cleans the resources this instance holds up""" await self.client.close() async def start_async(self): + """Establishes a new connection and then starts infinite sleep + to prevent the termination of this process. + If you don't want to have the sleep, use `#connect()` method instead. + """ await self.connect_async() if self.app.logger.level > logging.INFO: print(get_boot_message()) @@ -133,12 +161,13 @@

    Methods

    async def close_async(self)
    -
    +

    Disconnects from the Socket Mode server and cleans the resources this instance holds up

    Expand source code
    async def close_async(self):
    +    """Disconnects from the Socket Mode server and cleans the resources this instance holds up"""
         await self.client.close()
    @@ -146,12 +175,13 @@

    Methods

    async def connect_async(self)
    -
    +

    Establishes a new connection with the Socket Mode server

    Expand source code
    async def connect_async(self):
    +    """Establishes a new connection with the Socket Mode server"""
         await self.client.connect()
    @@ -159,12 +189,13 @@

    Methods

    async def disconnect_async(self)
    -
    +

    Disconnects the current WebSocket connection with the Socket Mode server

    Expand source code
    async def disconnect_async(self):
    +    """Disconnects the current WebSocket connection with the Socket Mode server"""
         await self.client.disconnect()
    @@ -172,7 +203,14 @@

    Methods

    async def handle(self, client: slack_sdk.socket_mode.async_client.AsyncBaseSocketModeClient, req: slack_sdk.socket_mode.request.SocketModeRequest) ‑> NoneType
    -
    +

    Handles Socket Mode envelope requests through a WebSocket connection.

    +

    Args

    +
    +
    client
    +
    this Socket Mode client instance
    +
    req
    +
    the request data
    +
    Expand source code @@ -180,6 +218,12 @@

    Methods

    async def handle(
         self, client: AsyncBaseSocketModeClient, req: SocketModeRequest
     ) -> None:
    +    """Handles Socket Mode envelope requests through a WebSocket connection.
    +
    +    Args:
    +        client: this Socket Mode client instance
    +        req: the request data
    +    """
         raise NotImplementedError()
    @@ -187,12 +231,18 @@

    Methods

    async def start_async(self)
    -
    +

    Establishes a new connection and then starts infinite sleep +to prevent the termination of this process. +If you don't want to have the sleep, use #connect() method instead.

    Expand source code
    async def start_async(self):
    +    """Establishes a new connection and then starts infinite sleep
    +    to prevent the termination of this process.
    +    If you don't want to have the sleep, use `#connect()` method instead.
    +    """
         await self.connect_async()
         if self.app.logger.level > logging.INFO:
             print(get_boot_message())
    diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/async_handler.html b/docs/api-docs/slack_bolt/adapter/socket_mode/async_handler.html
    index f6be34ed9..1e1ca2ee4 100644
    --- a/docs/api-docs/slack_bolt/adapter/socket_mode/async_handler.html
    +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/async_handler.html
    @@ -5,7 +5,7 @@
     
     
     slack_bolt.adapter.socket_mode.async_handler API documentation
    -
    +
     
     
     
    @@ -22,11 +22,13 @@
     

    Module slack_bolt.adapter.socket_mode.async_handler

    +

    Default implementation is the aiohttp-based one.

    Expand source code -
    from .aiohttp import AsyncSocketModeHandler  # noqa
    +
    """Default implementation is the aiohttp-based one."""
    +from .aiohttp import AsyncSocketModeHandler  # noqa
    diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/async_internals.html b/docs/api-docs/slack_bolt/adapter/socket_mode/async_internals.html index 5d8c62d9b..824288e56 100644 --- a/docs/api-docs/slack_bolt/adapter/socket_mode/async_internals.html +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/async_internals.html @@ -5,7 +5,7 @@ slack_bolt.adapter.socket_mode.async_internals API documentation - + @@ -22,11 +22,13 @@

    Module slack_bolt.adapter.socket_mode.async_internals

    +

    Internal functions

    Expand source code -
    import json
    +
    """Internal functions"""
    +import json
     import logging
     from time import time
     
    diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/base_handler.html b/docs/api-docs/slack_bolt/adapter/socket_mode/base_handler.html
    index 5d3d5ffe3..92518d180 100644
    --- a/docs/api-docs/slack_bolt/adapter/socket_mode/base_handler.html
    +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/base_handler.html
    @@ -5,7 +5,8 @@
     
     
     slack_bolt.adapter.socket_mode.base_handler API documentation
    -
    +
     
     
     
    @@ -22,11 +23,16 @@
     

    Module slack_bolt.adapter.socket_mode.base_handler

    +

    The base class of Socket Mode client implementation. +If you want to build asyncio-based ones, use AsyncBaseSocketModeHandler instead.

    Expand source code -
    import logging
    +
    """The base class of Socket Mode client implementation.
    +If you want to build asyncio-based ones, use `AsyncBaseSocketModeHandler` instead.
    +"""
    +import logging
     import signal
     import sys
     from threading import Event
    @@ -43,18 +49,31 @@ 

    Module slack_bolt.adapter.socket_mode.base_handlerClasses

    client: BaseSocketModeClient def handle(self, client: BaseSocketModeClient, req: SocketModeRequest) -> None: + """Handles Socket Mode envelope requests through a WebSocket connection. + + Args: + client: this Socket Mode client instance + req: the request data + """ raise NotImplementedError() def connect(self): + """Establishes a new connection with the Socket Mode server""" self.client.connect() def disconnect(self): + """Disconnects the current WebSocket connection with the Socket Mode server""" self.client.disconnect() def close(self): + """Disconnects from the Socket Mode server and cleans the resources this instance holds up""" self.client.close() def start(self): + """Establishes a new connection and then blocks the current thread + to prevent the termination of this process. + If you don't want to block the current thread, use `#connect()` method instead. + """ self.connect() if self.app.logger.level > logging.INFO: print(get_boot_message()) @@ -139,12 +171,13 @@

    Methods

    def close(self)
    -
    +

    Disconnects from the Socket Mode server and cleans the resources this instance holds up

    Expand source code
    def close(self):
    +    """Disconnects from the Socket Mode server and cleans the resources this instance holds up"""
         self.client.close()
    @@ -152,12 +185,13 @@

    Methods

    def connect(self)
    -
    +

    Establishes a new connection with the Socket Mode server

    Expand source code
    def connect(self):
    +    """Establishes a new connection with the Socket Mode server"""
         self.client.connect()
    @@ -165,12 +199,13 @@

    Methods

    def disconnect(self)
    -
    +

    Disconnects the current WebSocket connection with the Socket Mode server

    Expand source code
    def disconnect(self):
    +    """Disconnects the current WebSocket connection with the Socket Mode server"""
         self.client.disconnect()
    @@ -178,12 +213,25 @@

    Methods

    def handle(self, client: slack_sdk.socket_mode.client.BaseSocketModeClient, req: slack_sdk.socket_mode.request.SocketModeRequest) ‑> NoneType
    -
    +

    Handles Socket Mode envelope requests through a WebSocket connection.

    +

    Args

    +
    +
    client
    +
    this Socket Mode client instance
    +
    req
    +
    the request data
    +
    Expand source code
    def handle(self, client: BaseSocketModeClient, req: SocketModeRequest) -> None:
    +    """Handles Socket Mode envelope requests through a WebSocket connection.
    +
    +    Args:
    +        client: this Socket Mode client instance
    +        req: the request data
    +    """
         raise NotImplementedError()
    @@ -191,12 +239,18 @@

    Methods

    def start(self)
    -
    +

    Establishes a new connection and then blocks the current thread +to prevent the termination of this process. +If you don't want to block the current thread, use #connect() method instead.

    Expand source code
    def start(self):
    +    """Establishes a new connection and then blocks the current thread
    +    to prevent the termination of this process.
    +    If you don't want to block the current thread, use `#connect()` method instead.
    +    """
         self.connect()
         if self.app.logger.level > logging.INFO:
             print(get_boot_message())
    diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/builtin/index.html b/docs/api-docs/slack_bolt/adapter/socket_mode/builtin/index.html
    index ef6a4102c..3e050b73d 100644
    --- a/docs/api-docs/slack_bolt/adapter/socket_mode/builtin/index.html
    +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/builtin/index.html
    @@ -5,7 +5,7 @@
     
     
     slack_bolt.adapter.socket_mode.builtin API documentation
    -
    +
     
     
     
    @@ -22,11 +22,13 @@
     

    Module slack_bolt.adapter.socket_mode.builtin

    +

    The built-in implementation, which does not have any external dependencies

    Expand source code -
    import os
    +
    """The built-in implementation, which does not have any external dependencies"""
    +import os
     from logging import Logger
     from time import time
     from typing import Optional, Dict
    @@ -62,6 +64,23 @@ 

    Module slack_bolt.adapter.socket_mode.builtin

    Classes (app: App, app_token: Optional[str] = None, logger: Optional[logging.Logger] = None, web_client: Optional[slack_sdk.web.client.WebClient] = None, proxy: Optional[str] = None, proxy_headers: Optional[Dict[str, str]] = None, auto_reconnect_enabled: bool = True, trace_enabled: bool = False, all_message_trace_enabled: bool = False, ping_pong_trace_enabled: bool = False, ping_interval: float = 10, receive_buffer_size: int = 1024, concurrency: int = 10)
    -
    +

    Socket Mode adapter for Bolt apps

    +

    Args

    +
    +
    app
    +
    The Bolt app
    +
    app_token
    +
    App-level token starting with xapp-
    +
    logger
    +
    Custom logger
    +
    web_client
    +
    custom slack_sdk.web.WebClient instance
    +
    proxy
    +
    HTTP proxy URL
    +
    proxy_headers
    +
    Additional request header for proxy connections
    +
    auto_reconnect_enabled
    +
    True if the auto-reconnect logic works
    +
    trace_enabled
    +
    True if trace-level logging is enabled
    +
    all_message_trace_enabled
    +
    True if trace-logging for all received WebSocket messages is enabled
    +
    ping_pong_trace_enabled
    +
    True if trace-logging for all ping-pong communications
    +
    ping_interval
    +
    The ping-pong internal (seconds)
    +
    receive_buffer_size
    +
    The data length for a single socket recv operation
    +
    concurrency
    +
    The size of the underlying thread pool
    +
    Expand source code @@ -126,6 +174,23 @@

    Classes

    receive_buffer_size: int = 1024, concurrency: int = 10, ): + """Socket Mode adapter for Bolt apps + + Args: + app: The Bolt app + app_token: App-level token starting with `xapp-` + logger: Custom logger + web_client: custom `slack_sdk.web.WebClient` instance + proxy: HTTP proxy URL + proxy_headers: Additional request header for proxy connections + auto_reconnect_enabled: True if the auto-reconnect logic works + trace_enabled: True if trace-level logging is enabled + all_message_trace_enabled: True if trace-logging for all received WebSocket messages is enabled + ping_pong_trace_enabled: True if trace-logging for all ping-pong communications + ping_interval: The ping-pong internal (seconds) + receive_buffer_size: The data length for a single socket recv operation + concurrency: The size of the underlying thread pool + """ self.app = app self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] self.client = SocketModeClient( @@ -168,24 +233,18 @@

    Class variables

    -

    Methods

    -
    -
    -def handle(self, client: slack_sdk.socket_mode.builtin.client.SocketModeClient, req: slack_sdk.socket_mode.request.SocketModeRequest) ‑> NoneType -
    -
    -
    -
    - -Expand source code - -
    def handle(self, client: SocketModeClient, req: SocketModeRequest) -> None:
    -    start = time()
    -    bolt_resp: BoltResponse = run_bolt_app(self.app, req)
    -    send_response(client, req, bolt_resp, start)
    -
    -
    -
    +

    Inherited members

    +
    @@ -209,7 +268,6 @@

    app
  • app_token
  • client
  • -
  • handle
  • diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/index.html b/docs/api-docs/slack_bolt/adapter/socket_mode/index.html index 26b00daff..8ce6feae4 100644 --- a/docs/api-docs/slack_bolt/adapter/socket_mode/index.html +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/index.html @@ -5,7 +5,7 @@ slack_bolt.adapter.socket_mode API documentation - + @@ -22,11 +22,26 @@

    Module slack_bolt.adapter.socket_mode

    +

    Socket Mode adapter package provides the following implementations. If you don't have strong reasons to use 3rd party library based adapters, we recommend using the built-in client based one.

    +
    Expand source code -
    # Don't add async module imports here
    +
    """Socket Mode adapter package provides the following implementations. If you don't have strong reasons to use 3rd party library based adapters, we recommend using the built-in client based one.
    +
    +* `slack_bolt.adapter.socket_mode.builtin`
    +* `slack_bolt.adapter.socket_mode.websocket_client`
    +* `slack_bolt.adapter.socket_mode.aiohttp`
    +* `slack_bolt.adapter.socket_mode.websockets`
    +"""
    +
    +# Don't add async module imports here
     from .builtin import SocketModeHandler  # noqa
    @@ -35,39 +50,41 @@

    Sub-modules

    slack_bolt.adapter.socket_mode.aiohttp
    -
    +

    aiohttp based implementation / asyncio compatible

    slack_bolt.adapter.socket_mode.async_base_handler
    -
    +

    The base class of asyncio-based Socket Mode client implementation

    slack_bolt.adapter.socket_mode.async_handler
    -
    +

    Default implementation is the aiohttp-based one.

    slack_bolt.adapter.socket_mode.async_internals
    -
    +

    Internal functions

    slack_bolt.adapter.socket_mode.base_handler
    -
    +

    The base class of Socket Mode client implementation. +If you want to build asyncio-based ones, use AsyncBaseSocketModeHandler instead.

    slack_bolt.adapter.socket_mode.builtin
    -
    +

    The built-in implementation, which does not have any external dependencies

    slack_bolt.adapter.socket_mode.internals
    -
    +

    Internal functions

    slack_bolt.adapter.socket_mode.websocket_client
    -
    +

    websocket-client based implementation

    slack_bolt.adapter.socket_mode.websockets
    -
    +

    websockets based implementation +/ asyncio compatible

    diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/internals.html b/docs/api-docs/slack_bolt/adapter/socket_mode/internals.html index 2d14923a7..bf7e9141b 100644 --- a/docs/api-docs/slack_bolt/adapter/socket_mode/internals.html +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/internals.html @@ -5,7 +5,7 @@ slack_bolt.adapter.socket_mode.internals API documentation - + @@ -22,11 +22,13 @@

    Module slack_bolt.adapter.socket_mode.internals

    +

    Internal functions

    Expand source code -
    import json
    +
    """Internal functions"""
    +import json
     import logging
     from time import time
     
    diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/websocket_client/index.html b/docs/api-docs/slack_bolt/adapter/socket_mode/websocket_client/index.html
    index 12ecdf250..ad409bdef 100644
    --- a/docs/api-docs/slack_bolt/adapter/socket_mode/websocket_client/index.html
    +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/websocket_client/index.html
    @@ -5,7 +5,7 @@
     
     
     slack_bolt.adapter.socket_mode.websocket_client API documentation
    -
    +
     
     
     
    @@ -22,11 +22,13 @@
     

    Module slack_bolt.adapter.socket_mode.websocket_client

    +

    websocket-client based implementation

    Expand source code -
    import os
    +
    """[`websocket-client`](https://pypi.org/project/websocket-client/) based implementation"""
    +import os
     from logging import Logger
     from time import time
     from typing import Optional, Tuple
    @@ -60,6 +62,21 @@ 

    Module slack_bolt.adapter.socket_mode.websocket_clientClasses

    (app: App, app_token: Optional[str] = None, logger: Optional[logging.Logger] = None, web_client: Optional[slack_sdk.web.client.WebClient] = None, ping_interval: float = 10, concurrency: int = 10, http_proxy_host: Optional[str] = None, http_proxy_port: Optional[int] = None, http_proxy_auth: Optional[Tuple[str, str]] = None, proxy_type: Optional[str] = None, trace_enabled: bool = False)
    -
    +

    Socket Mode adapter for Bolt apps

    +

    Args

    +
    +
    app
    +
    The Bolt app
    +
    app_token
    +
    App-level token starting with xapp-
    +
    logger
    +
    Custom logger
    +
    web_client
    +
    custom slack_sdk.web.WebClient instance
    +
    ping_interval
    +
    The ping-pong internal (seconds)
    +
    concurrency
    +
    The size of the underlying thread pool
    +
    http_proxy_host
    +
    HTTP proxy host
    +
    http_proxy_port
    +
    HTTP proxy port
    +
    http_proxy_auth
    +
    HTTP proxy authentication (username, password)
    +
    proxy_type
    +
    Proxy type
    +
    trace_enabled
    +
    True if trace-level logging is enabled
    +
    Expand source code @@ -120,6 +162,21 @@

    Classes

    proxy_type: Optional[str] = None, trace_enabled: bool = False, ): + """Socket Mode adapter for Bolt apps + + Args: + app: The Bolt app + app_token: App-level token starting with `xapp-` + logger: Custom logger + web_client: custom `slack_sdk.web.WebClient` instance + ping_interval: The ping-pong internal (seconds) + concurrency: The size of the underlying thread pool + http_proxy_host: HTTP proxy host + http_proxy_port: HTTP proxy port + http_proxy_auth: HTTP proxy authentication (username, password) + proxy_type: Proxy type + trace_enabled: True if trace-level logging is enabled + """ self.app = app self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] self.client = SocketModeClient( @@ -160,24 +217,18 @@

    Class variables

    -

    Methods

    -
    -
    -def handle(self, client: slack_sdk.socket_mode.websocket_client.SocketModeClient, req: slack_sdk.socket_mode.request.SocketModeRequest) ‑> NoneType -
    -
    -
    -
    - -Expand source code - -
    def handle(self, client: SocketModeClient, req: SocketModeRequest) -> None:
    -    start = time()
    -    bolt_resp: BoltResponse = run_bolt_app(self.app, req)
    -    send_response(client, req, bolt_resp, start)
    -
    -
    -
    +

    Inherited members

    +
    @@ -201,7 +252,6 @@

    app
  • app_token
  • client
  • -
  • handle
  • diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/websockets/index.html b/docs/api-docs/slack_bolt/adapter/socket_mode/websockets/index.html index 96239259c..af0cc2c40 100644 --- a/docs/api-docs/slack_bolt/adapter/socket_mode/websockets/index.html +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/websockets/index.html @@ -5,7 +5,8 @@ slack_bolt.adapter.socket_mode.websockets API documentation - + @@ -22,11 +23,14 @@

    Module slack_bolt.adapter.socket_mode.websockets

    +

    websockets based implementation +/ asyncio compatible

    Expand source code -
    import os
    +
    """[`websockets`](https://pypi.org/project/websockets/) based implementation  / asyncio compatible"""
    +import os
     from logging import Logger
     from time import time
     from typing import Optional
    @@ -59,6 +63,19 @@ 

    Module slack_bolt.adapter.socket_mode.websockets< web_client: Optional[AsyncWebClient] = None, ping_interval: float = 10, ): + """Socket Mode adapter for Bolt apps. + + Please note that this adapter does not support proxy configuration + as the underlying websockets module does not support proxy-wired connections. + If you use proxy, consider using one of the other Socket Mode adapters. + + Args: + app: The Bolt app + app_token: App-level token starting with `xapp-` + logger: Custom logger + web_client: custom `slack_sdk.web.WebClient` instance + ping_interval: The ping-pong internal (seconds) + """ self.app = app self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] self.client = SocketModeClient( @@ -170,31 +187,41 @@

    Class variables

    -

    Methods

    -
    -
    -async def handle(self, client: slack_sdk.socket_mode.websockets.SocketModeClient, req: slack_sdk.socket_mode.request.SocketModeRequest) ‑> NoneType -
    -
    -
    -
    - -Expand source code - -
    async def handle(self, client: SocketModeClient, req: SocketModeRequest) -> None:
    -    start = time()
    -    bolt_resp: BoltResponse = await run_async_bolt_app(self.app, req)
    -    await send_async_response(client, req, bolt_resp, start)
    -
    -
    -
    +

    Inherited members

    +
    class SocketModeHandler (app: App, app_token: Optional[str] = None, logger: Optional[logging.Logger] = None, web_client: Optional[slack_sdk.web.async_client.AsyncWebClient] = None, ping_interval: float = 10)
    -
    +

    Socket Mode adapter for Bolt apps.

    +

    Please note that this adapter does not support proxy configuration +as the underlying websockets module does not support proxy-wired connections. +If you use proxy, consider using one of the other Socket Mode adapters.

    +

    Args

    +
    +
    app
    +
    The Bolt app
    +
    app_token
    +
    App-level token starting with xapp-
    +
    logger
    +
    Custom logger
    +
    web_client
    +
    custom slack_sdk.web.WebClient instance
    +
    ping_interval
    +
    The ping-pong internal (seconds)
    +
    Expand source code @@ -212,6 +239,19 @@

    Methods

    web_client: Optional[AsyncWebClient] = None, ping_interval: float = 10, ): + """Socket Mode adapter for Bolt apps. + + Please note that this adapter does not support proxy configuration + as the underlying websockets module does not support proxy-wired connections. + If you use proxy, consider using one of the other Socket Mode adapters. + + Args: + app: The Bolt app + app_token: App-level token starting with `xapp-` + logger: Custom logger + web_client: custom `slack_sdk.web.WebClient` instance + ping_interval: The ping-pong internal (seconds) + """ self.app = app self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] self.client = SocketModeClient( @@ -246,24 +286,18 @@

    Class variables

    -

    Methods

    -
    -
    -async def handle(self, client: slack_sdk.socket_mode.websockets.SocketModeClient, req: slack_sdk.socket_mode.request.SocketModeRequest) ‑> NoneType -
    -
    -
    -
    - -Expand source code - -
    async def handle(self, client: SocketModeClient, req: SocketModeRequest) -> None:
    -    start = time()
    -    bolt_resp: BoltResponse = run_bolt_app(self.app, req)
    -    await send_async_response(client, req, bolt_resp, start)
    -
    -
    -
    +

    Inherited members

    +
    @@ -287,7 +321,6 @@

    app
  • app_token
  • client
  • -
  • handle
  • @@ -296,7 +329,6 @@

    app

  • app_token
  • client
  • -
  • handle
  • diff --git a/slack_bolt/adapter/socket_mode/__init__.py b/slack_bolt/adapter/socket_mode/__init__.py index 94223be4d..fbb17b0f7 100644 --- a/slack_bolt/adapter/socket_mode/__init__.py +++ b/slack_bolt/adapter/socket_mode/__init__.py @@ -1,2 +1,10 @@ +"""Socket Mode adapter package provides the following implementations. If you don't have strong reasons to use 3rd party library based adapters, we recommend using the built-in client based one. + +* `slack_bolt.adapter.socket_mode.builtin` +* `slack_bolt.adapter.socket_mode.websocket_client` +* `slack_bolt.adapter.socket_mode.aiohttp` +* `slack_bolt.adapter.socket_mode.websockets` +""" + # Don't add async module imports here from .builtin import SocketModeHandler # noqa diff --git a/slack_bolt/adapter/socket_mode/aiohttp/__init__.py b/slack_bolt/adapter/socket_mode/aiohttp/__init__.py index 0e3038c75..6e47fb2ef 100644 --- a/slack_bolt/adapter/socket_mode/aiohttp/__init__.py +++ b/slack_bolt/adapter/socket_mode/aiohttp/__init__.py @@ -1,3 +1,4 @@ +"""[`aiohttp`](https://pypi.org/project/aiohttp/) based implementation / asyncio compatible""" import os from logging import Logger from time import time @@ -32,6 +33,16 @@ def __init__( # type: ignore proxy: Optional[str] = None, ping_interval: float = 10, ): + """Socket Mode adapter for Bolt apps + + Args: + app: The Bolt app + app_token: App-level token starting with `xapp-` + logger: Custom logger + web_client: custom `slack_sdk.web.WebClient` instance + proxy: HTTP proxy URL + ping_interval: The ping-pong internal (seconds) + """ self.app = app self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] self.client = SocketModeClient( diff --git a/slack_bolt/adapter/socket_mode/async_base_handler.py b/slack_bolt/adapter/socket_mode/async_base_handler.py index 836074fad..b4e21b7c5 100644 --- a/slack_bolt/adapter/socket_mode/async_base_handler.py +++ b/slack_bolt/adapter/socket_mode/async_base_handler.py @@ -1,3 +1,4 @@ +"""The base class of asyncio-based Socket Mode client implementation""" import asyncio import logging from typing import Union @@ -17,18 +18,31 @@ class AsyncBaseSocketModeHandler: async def handle( self, client: AsyncBaseSocketModeClient, req: SocketModeRequest ) -> None: + """Handles Socket Mode envelope requests through a WebSocket connection. + + Args: + client: this Socket Mode client instance + req: the request data + """ raise NotImplementedError() async def connect_async(self): + """Establishes a new connection with the Socket Mode server""" await self.client.connect() async def disconnect_async(self): + """Disconnects the current WebSocket connection with the Socket Mode server""" await self.client.disconnect() async def close_async(self): + """Disconnects from the Socket Mode server and cleans the resources this instance holds up""" await self.client.close() async def start_async(self): + """Establishes a new connection and then starts infinite sleep + to prevent the termination of this process. + If you don't want to have the sleep, use `#connect()` method instead. + """ await self.connect_async() if self.app.logger.level > logging.INFO: print(get_boot_message()) diff --git a/slack_bolt/adapter/socket_mode/async_handler.py b/slack_bolt/adapter/socket_mode/async_handler.py index 08edd8004..9c6e21ff0 100644 --- a/slack_bolt/adapter/socket_mode/async_handler.py +++ b/slack_bolt/adapter/socket_mode/async_handler.py @@ -1 +1,2 @@ +"""Default implementation is the aiohttp-based one.""" from .aiohttp import AsyncSocketModeHandler # noqa diff --git a/slack_bolt/adapter/socket_mode/async_internals.py b/slack_bolt/adapter/socket_mode/async_internals.py index 5b5750bd1..58a53902d 100644 --- a/slack_bolt/adapter/socket_mode/async_internals.py +++ b/slack_bolt/adapter/socket_mode/async_internals.py @@ -1,3 +1,4 @@ +"""Internal functions""" import json import logging from time import time diff --git a/slack_bolt/adapter/socket_mode/base_handler.py b/slack_bolt/adapter/socket_mode/base_handler.py index d64c20c69..dfa1fd750 100644 --- a/slack_bolt/adapter/socket_mode/base_handler.py +++ b/slack_bolt/adapter/socket_mode/base_handler.py @@ -1,3 +1,6 @@ +"""The base class of Socket Mode client implementation. +If you want to build asyncio-based ones, use `AsyncBaseSocketModeHandler` instead. +""" import logging import signal import sys @@ -15,18 +18,31 @@ class BaseSocketModeHandler: client: BaseSocketModeClient def handle(self, client: BaseSocketModeClient, req: SocketModeRequest) -> None: + """Handles Socket Mode envelope requests through a WebSocket connection. + + Args: + client: this Socket Mode client instance + req: the request data + """ raise NotImplementedError() def connect(self): + """Establishes a new connection with the Socket Mode server""" self.client.connect() def disconnect(self): + """Disconnects the current WebSocket connection with the Socket Mode server""" self.client.disconnect() def close(self): + """Disconnects from the Socket Mode server and cleans the resources this instance holds up""" self.client.close() def start(self): + """Establishes a new connection and then blocks the current thread + to prevent the termination of this process. + If you don't want to block the current thread, use `#connect()` method instead. + """ self.connect() if self.app.logger.level > logging.INFO: print(get_boot_message()) diff --git a/slack_bolt/adapter/socket_mode/builtin/__init__.py b/slack_bolt/adapter/socket_mode/builtin/__init__.py index f857098ba..664b68ef9 100644 --- a/slack_bolt/adapter/socket_mode/builtin/__init__.py +++ b/slack_bolt/adapter/socket_mode/builtin/__init__.py @@ -1,3 +1,4 @@ +"""The built-in implementation, which does not have any external dependencies""" import os from logging import Logger from time import time @@ -34,6 +35,23 @@ def __init__( # type: ignore receive_buffer_size: int = 1024, concurrency: int = 10, ): + """Socket Mode adapter for Bolt apps + + Args: + app: The Bolt app + app_token: App-level token starting with `xapp-` + logger: Custom logger + web_client: custom `slack_sdk.web.WebClient` instance + proxy: HTTP proxy URL + proxy_headers: Additional request header for proxy connections + auto_reconnect_enabled: True if the auto-reconnect logic works + trace_enabled: True if trace-level logging is enabled + all_message_trace_enabled: True if trace-logging for all received WebSocket messages is enabled + ping_pong_trace_enabled: True if trace-logging for all ping-pong communications + ping_interval: The ping-pong internal (seconds) + receive_buffer_size: The data length for a single socket recv operation + concurrency: The size of the underlying thread pool + """ self.app = app self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] self.client = SocketModeClient( diff --git a/slack_bolt/adapter/socket_mode/internals.py b/slack_bolt/adapter/socket_mode/internals.py index 4f7f4d68c..2274c449c 100644 --- a/slack_bolt/adapter/socket_mode/internals.py +++ b/slack_bolt/adapter/socket_mode/internals.py @@ -1,3 +1,4 @@ +"""Internal functions""" import json import logging from time import time diff --git a/slack_bolt/adapter/socket_mode/websocket_client/__init__.py b/slack_bolt/adapter/socket_mode/websocket_client/__init__.py index 589edb80d..216b6d207 100644 --- a/slack_bolt/adapter/socket_mode/websocket_client/__init__.py +++ b/slack_bolt/adapter/socket_mode/websocket_client/__init__.py @@ -1,3 +1,4 @@ +"""[`websocket-client`](https://pypi.org/project/websocket-client/) based implementation""" import os from logging import Logger from time import time @@ -32,6 +33,21 @@ def __init__( # type: ignore proxy_type: Optional[str] = None, trace_enabled: bool = False, ): + """Socket Mode adapter for Bolt apps + + Args: + app: The Bolt app + app_token: App-level token starting with `xapp-` + logger: Custom logger + web_client: custom `slack_sdk.web.WebClient` instance + ping_interval: The ping-pong internal (seconds) + concurrency: The size of the underlying thread pool + http_proxy_host: HTTP proxy host + http_proxy_port: HTTP proxy port + http_proxy_auth: HTTP proxy authentication (username, password) + proxy_type: Proxy type + trace_enabled: True if trace-level logging is enabled + """ self.app = app self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] self.client = SocketModeClient( diff --git a/slack_bolt/adapter/socket_mode/websockets/__init__.py b/slack_bolt/adapter/socket_mode/websockets/__init__.py index 878eaf5e6..424f97f3d 100644 --- a/slack_bolt/adapter/socket_mode/websockets/__init__.py +++ b/slack_bolt/adapter/socket_mode/websockets/__init__.py @@ -1,3 +1,4 @@ +"""[`websockets`](https://pypi.org/project/websockets/) based implementation / asyncio compatible""" import os from logging import Logger from time import time @@ -31,6 +32,19 @@ def __init__( # type: ignore web_client: Optional[AsyncWebClient] = None, ping_interval: float = 10, ): + """Socket Mode adapter for Bolt apps. + + Please note that this adapter does not support proxy configuration + as the underlying websockets module does not support proxy-wired connections. + If you use proxy, consider using one of the other Socket Mode adapters. + + Args: + app: The Bolt app + app_token: App-level token starting with `xapp-` + logger: Custom logger + web_client: custom `slack_sdk.web.WebClient` instance + ping_interval: The ping-pong internal (seconds) + """ self.app = app self.app_token = app_token or os.environ["SLACK_APP_TOKEN"] self.client = SocketModeClient( From cddcc9542f3c9d173725b6cdad50351dec4c3ab1 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 29 Mar 2021 19:57:55 +0900 Subject: [PATCH 151/719] Fix errors in documents --- docs/_basic/listening_actions.md | 2 +- docs/_basic/listening_events.md | 4 ++-- docs/_basic/listening_responding_shortcuts.md | 6 ++---- docs/_basic/responding_actions.md | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/docs/_basic/listening_actions.md b/docs/_basic/listening_actions.md index 131b48701..3de71d003 100644 --- a/docs/_basic/listening_actions.md +++ b/docs/_basic/listening_actions.md @@ -15,7 +15,7 @@ You’ll notice in all `action()` examples, `ack()` is used. It is required to c ```python -# Your middleware will be called every time an interactive component with the action_id "approve_button" is triggered +# Your listener will be called every time a block element with the action_id "approve_button" is triggered @app.action("approve_button") def update_message(ack): ack() diff --git a/docs/_basic/listening_events.md b/docs/_basic/listening_events.md index a8779d826..f3136b18e 100644 --- a/docs/_basic/listening_events.md +++ b/docs/_basic/listening_events.md @@ -14,7 +14,7 @@ The `event()` method requires an `eventType` of type `str`. ```python -# When a user joins the team, send a message in a predefined channel asking them to introduce themselves +# When a user joins the workspace, send a message in a predefined channel asking them to introduce themselves @app.event("team_join") def ask_for_introduction(event, say): welcome_channel_id = "C12345" @@ -37,7 +37,7 @@ You can filter on subtypes of events by passing in the additional key `subtype`. ```python -# Matches all messages from bot users +# Matches all modified messages @app.event({ "type": "message", "subtype": "message_changed" diff --git a/docs/_basic/listening_responding_shortcuts.md b/docs/_basic/listening_responding_shortcuts.md index 0a73d6de7..1e23ddb69 100644 --- a/docs/_basic/listening_responding_shortcuts.md +++ b/docs/_basic/listening_responding_shortcuts.md @@ -22,13 +22,12 @@ When setting up shortcuts within your app configuration, as with other URLs, you ```python - # The open_modal shortcut listens to a shortcut with the callback_id "open_modal" @app.shortcut("open_modal") def open_modal(ack, shortcut, client): # Acknowledge the shortcut request ack() - # Call the views_open method using one of the built-in WebClients + # Call the views_open method using the built-in WebClient client.views_open( trigger_id=shortcut["trigger_id"], # A simple view payload for a modal @@ -68,8 +67,7 @@ def open_modal(ack, shortcut, client): ```python - -# Your middleware will only be called when the callback_id matches 'open_modal' AND the type matches 'message_action' +# Your listener will only be called when the callback_id matches 'open_modal' AND the type matches 'message_action' @app.shortcut({"callback_id": "open_modal", "type": "message_action"}) def open_modal(ack, shortcut, client): # Acknowledge the shortcut request diff --git a/docs/_basic/responding_actions.md b/docs/_basic/responding_actions.md index e8dbbc301..8f432e19b 100644 --- a/docs/_basic/responding_actions.md +++ b/docs/_basic/responding_actions.md @@ -14,7 +14,7 @@ The second way to respond to actions is using `respond()`, which is a utility to ```python -# Your middleware will be called every time an interactive component with the action_id “approve_button” is triggered +# Your listener will be called every time an interactive component with the action_id “approve_button” is triggered @app.action("approve_button") def approve_request(ack, say): # Acknowledge action request From 57fdb45100b7608af389fe947504983b78119eee Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 30 Mar 2021 11:02:54 +0900 Subject: [PATCH 152/719] Add Japanese version of Basic Concepts documents --- docs/_advanced/async.md | 2 +- docs/_basic/authenticating_oauth.md | 4 +- docs/_basic/ja_acknowledging_events.md | 33 ++++++ docs/_basic/ja_authenticating_oauth.md | 103 +++++++++++++++++ docs/_basic/ja_listening_actions.md | 54 +++++++++ docs/_basic/ja_listening_events.md | 49 ++++++++ docs/_basic/ja_listening_messages.md | 45 ++++++++ docs/_basic/ja_listening_modals.md | 48 ++++++++ .../ja_listening_responding_commands.md | 27 +++++ .../_basic/ja_listening_responding_options.md | 34 ++++++ .../ja_listening_responding_shortcuts.md | 107 ++++++++++++++++++ docs/_basic/ja_opening_modals.md | 58 ++++++++++ docs/_basic/ja_publishing_views.md | 46 ++++++++ docs/_basic/ja_responding_actions.md | 44 +++++++ docs/_basic/ja_sending_messages.md | 57 ++++++++++ docs/_basic/ja_socket_mode.md | 72 ++++++++++++ docs/_basic/ja_updating_pushing_modals.md | 53 +++++++++ docs/_basic/ja_web_api.md | 26 +++++ docs/_basic/listening_actions.md | 2 +- docs/_basic/listening_messages.md | 2 +- docs/_basic/listening_responding_shortcuts.md | 2 +- docs/_basic/sending_messages.md | 2 +- docs/_basic/socket_mode.md | 4 +- docs/_basic/web_api.md | 2 +- docs/_config.yml | 2 +- docs/_includes/sidebar.html | 2 +- docs/_tutorials/ja_getting_started.md | 14 +-- 27 files changed, 875 insertions(+), 19 deletions(-) create mode 100644 docs/_basic/ja_acknowledging_events.md create mode 100644 docs/_basic/ja_authenticating_oauth.md create mode 100644 docs/_basic/ja_listening_actions.md create mode 100644 docs/_basic/ja_listening_events.md create mode 100644 docs/_basic/ja_listening_messages.md create mode 100644 docs/_basic/ja_listening_modals.md create mode 100644 docs/_basic/ja_listening_responding_commands.md create mode 100644 docs/_basic/ja_listening_responding_options.md create mode 100644 docs/_basic/ja_listening_responding_shortcuts.md create mode 100644 docs/_basic/ja_opening_modals.md create mode 100644 docs/_basic/ja_publishing_views.md create mode 100644 docs/_basic/ja_responding_actions.md create mode 100644 docs/_basic/ja_sending_messages.md create mode 100644 docs/_basic/ja_socket_mode.md create mode 100644 docs/_basic/ja_updating_pushing_modals.md create mode 100644 docs/_basic/ja_web_api.md diff --git a/docs/_advanced/async.md b/docs/_advanced/async.md index 02b60cc4e..fddf82f99 100644 --- a/docs/_advanced/async.md +++ b/docs/_advanced/async.md @@ -1,5 +1,5 @@ --- -title: Using async +title: Using async (asyncio) lang: en slug: async order: 2 diff --git a/docs/_basic/authenticating_oauth.md b/docs/_basic/authenticating_oauth.md index 48b903c14..fa1db0873 100644 --- a/docs/_basic/authenticating_oauth.md +++ b/docs/_basic/authenticating_oauth.md @@ -7,9 +7,9 @@ order: 15
    -Slack apps installed on multiple workspaces will need to implement OAuth, then store installation information (like access tokens) securely. By providing `client_id`, `client_secret`, `scopes`, `installation_store`, and `state_store` when initializing App, Bolt for Python will handle the work of setting up OAuth routes and verifying state. If you’re implementing a custom adapter, you can make use of our [OAuth library](https://slack.dev/python-slack-sdk/oauth/), which is what Bolt for Python uses under the hood. +Slack apps installed on multiple workspaces will need to implement OAuth, then store installation information (like access tokens) securely. By providing `client_id`, `client_secret`, `scopes`, `installation_store`, and `state_store` when initializing App, Bolt for Python will handle the work of setting up OAuth routes and verifying state. If you're implementing a custom adapter, you can make use of our [OAuth library](https://slack.dev/python-slack-sdk/oauth/), which is what Bolt for Python uses under the hood. -Bolt for Python will create a **Redirect URL** `slack/oauth_redirect`, which Slack uses to redirect users after they complete your app’s installation flow. You will need to add this **Redirect URL** in your app configuration settings under **OAuth and Permissions**. This path can be configured in the `OAuthSettings` argument described below. +Bolt for Python will create a **Redirect URL** `slack/oauth_redirect`, which Slack uses to redirect users after they complete your app's installation flow. You will need to add this **Redirect URL** in your app configuration settings under **OAuth and Permissions**. This path can be configured in the `OAuthSettings` argument described below. Bolt for Python will also create a `slack/install` route, where you can find an **Add to Slack** button for your app to perform direct installs of your app. If you need any additional authorizations (user tokens) from users inside a team when your app is already installed or a reason to dynamically generate an install URL, you can pass your own custom URL generator to `oauth_settings` as `authorize_url_generator`. diff --git a/docs/_basic/ja_acknowledging_events.md b/docs/_basic/ja_acknowledging_events.md new file mode 100644 index 000000000..996500347 --- /dev/null +++ b/docs/_basic/ja_acknowledging_events.md @@ -0,0 +1,33 @@ +--- +title: イベントの確認 +lang: ja-jp +slug: acknowledge +order: 7 +--- + +
    + +アクション(action)、コマンド(command)、およびオプション(options)の各イベントは、**必ず** `ack()` 関数を使って確認を行う必要があります。これによってイベントが受信されたことが Slack に認識され、Slack のユーザーインターフェイスが適切に更新されます。 + +イベントの種類によっては、確認で通知方法が異なる場合があります。例えば、外部データソースを使用する選択メニューのオプションのリクエストに対する確認では、適切な[オプション](https://api.slack.com/reference/block-kit/composition-objects#option)のリストとともに `ack()` を呼び出します。 + +確認までの猶予は 3 秒しかないため、新しいメッセージの送信や、データベースからの情報の取得は、`ack()` を呼び出した後で行うことをおすすめします。 + +
    + +```python +# 外部データを使用する選択メニューオプションに応答するサンプル +@app.options("menu_selection") +def show_menu_options(ack): + options = [ + { + "text": {"type": "plain_text", "text":"Option 1"}, + "value":"1-1", + }, + { + "text": {"type": "plain_text", "text":"Option 2"}, + "value":"1-2", + }, + ] + ack(options=options) +``` diff --git a/docs/_basic/ja_authenticating_oauth.md b/docs/_basic/ja_authenticating_oauth.md new file mode 100644 index 000000000..a10c87399 --- /dev/null +++ b/docs/_basic/ja_authenticating_oauth.md @@ -0,0 +1,103 @@ +--- +title: OAuth を使った認証 +lang: ja-jp +slug: authenticating-oauth +order: 15 +--- + +
    + +Slack アプリを複数のワークスペースにインストールできるようにするためには、OAuth フローを実装した上で、アクセストークンなどのインストールに関する情報をセキュアな方法で保存する必要があります。アプリを初期化する際に `client_id`、`client_secret`、`scopes`、`installation_store`、`state_store` を指定することで、OAuth のエンドポイントのルート情報や stateパラメーターの検証をBolt for Python にハンドリングさせることができます。カスタムのアダプターを実装する場合は、SDK が提供する組み込みの[OAuth ライブラリ](https://slack.dev/python-slack-sdk/oauth/)を利用するのが便利です。これは Slack が開発したモジュールで、Bolt for Python 内部でも利用しています。 + +Bolt for Python によって `slack/oauth_redirect` という**リダイレクト URL** が生成されます。Slack はアプリのインストールフローを完了させたユーザーをこの URL にリダイレクトします。この**リダイレクト URL** は、アプリの設定の「**OAuth and Permissions**」であらかじめ追加しておく必要があります。この URL は、後ほど説明するように `OAuthSettings` というコンストラクタの引数で指定することもできます。 + +Bolt for Python は `slack/install` というルートも生成します。これはアプリを直接インストールするための「**Add to Slack**」ボタンを表示するために使われます。すでにワークスペースへのアプリのインストールが済んでいる場合に追加で各ユーザーのユーザートークンなどの情報を取得する場合や、カスタムのインストール用の URL を動的に生成したい場合などは、`oauth_settings` の `authorize_url_generator` でカスタムの URL ジェネレーターを指定することができます。 + +バージョン 1.1.0 以降の Bolt for Python では、[OrG 全体へのインストール](https://api.slack.com/enterprise/apps)がデフォルトでサポートされています。OrG 全体へのインストールは、アプリの設定の「**Org Level Apps**」で有効化できます。 + +Slack での OAuth を使ったインストールフローについて詳しくは、[API ドキュメントを参照してください](https://api.slack.com/authentication/oauth-v2)。 + +
    + +```python +import os +from slack_bolt import App +from slack_bolt.oauth.oauth_settings import OAuthSettings +from slack_sdk.oauth.installation_store import FileInstallationStore +from slack_sdk.oauth.state_store import FileOAuthStateStore + +oauth_settings = OAuthSettings( + client_id=os.environ["SLACK_CLIENT_ID"], + client_secret=os.environ["SLACK_CLIENT_SECRET"], + scopes=["channels:read", "groups:read", "chat:write"], + installation_store=FileInstallationStore(base_dir="./data"), + state_store=FileOAuthStateStore(expiration_seconds=600, base_dir="./data") +) + +app = App( + signing_secret=os.environ["SIGNING_SECRET"], + oauth_settings=oauth_settings +) +``` + +
    + +

    OAuth デフォルト設定をカスタマイズ

    +
    + +
    +`oauth_settings` を使って OAuth モジュールのデフォルト設定を上書きすることができます。このカスタマイズされた設定は App の初期化時に渡します。以下の情報を変更可能です: + +- `install_path` : 「Add to Slack」ボタンのデフォルトのパスを上書きするために使用 +- `redirect_uri` : リダイレクト URL のデフォルトのパスを上書きするために使用 +- `callback_options` : OAuth フローの最後に表示するカスタムの成功ページと失敗ページの表示処理を提供するために使用 +- `state_store` : 組み込みの `FileOAuthStateStore` に代わる、カスタムの stateに関するデータストアを指定するために使用 +- `installation_store` : 組み込みの `FileInstallationStore` に代わる、カスタムのデータストアを指定するために使用 + +
    + +```python +from slack_bolt.oauth.callback_options import CallbackOptions, SuccessArgs, FailureArgs +from slack_bolt.response import BoltResponse + +def success(args:SuccessArgs) -> BoltResponse: + assert args.request is not None + return BoltResponse( + status=200, # ユーザーをリダイレクトすることも可能 + body="Your own response to end-users here" + ) + +def failure(args:FailureArgs) -> BoltResponse: + assert args.request is not None + assert args.reason is not None + return BoltResponse( + status=args.suggested_status_code, + body="Your own response to end-users here" + ) + +callback_options = CallbackOptions(success=success, failure=failure) + +import os +from slack_bolt import App +from slack_bolt.oauth.oauth_settings import OAuthSettings +from slack_sdk.oauth.installation_store import FileInstallationStore +from slack_sdk.oauth.state_store import FileOAuthStateStore + +app = App( + signing_secret=os.environ.get("SLACK_SIGNING_SECRET"), + installation_store=FileInstallationStore(base_dir="./data"), + oauth_settings=OAuthSettings( + client_id=os.environ.get("SLACK_CLIENT_ID"), + client_secret=os.environ.get("SLACK_CLIENT_SECRET"), + scopes=["app_mentions:read", "channels:history", "im:history", "chat:write"], + user_scopes=[], + redirect_uri=None, + install_path="/slack/install", + redirect_uri_path="/slack/oauth_redirect", + state_store=FileOAuthStateStore(expiration_seconds=600, base_dir="./data"), + callback_options=callback_options, + ), +) +``` + +
    diff --git a/docs/_basic/ja_listening_actions.md b/docs/_basic/ja_listening_actions.md new file mode 100644 index 000000000..fe4407809 --- /dev/null +++ b/docs/_basic/ja_listening_actions.md @@ -0,0 +1,54 @@ +--- +title: アクションのリスニング +lang: ja-jp +slug: action-listening +order: 5 +--- + +
    +Bolt アプリは `action` メソッドを用いて、ボタンのクリック、メニューの選択、メッセージショートカットなどのユーザーのアクションをリッスンすることができます。 + +アクションは `str` 型または `re.Pattern` 型の `action_id` でフィルタリングできます。`action_id` は、Slack プラットフォーム上のインタラクティブコンポーネントを区別する一意の識別子として機能します。 + +`action()` を使ったすべての例で `ack()` が使用されていることに注目してください。アクションのリスナー内では、Slack からのイベントを受信したことを確認するために、`ack()` 関数を呼び出す必要があります。これについては、[イベントの確認](#acknowledge)セクションで説明しています。 + +
    + +```python +# 'approve_button' という action_id のブロックエレメントがトリガーされるたびに、このリスナーが呼び出させれる +@app.action("approve_button") +def update_message(ack): + ack() + # アクションへの反応としてメッセージを更新 +``` + +
    + +

    制約付きオブジェクトを使用したアクションのリスニング

    +
    + +
    + +制約付きのオブジェクトを使用すると、`callback_id`、`block_id`、および `action_id` をそれぞれ、または任意に組み合わせてリッスンできます。オブジェクト内の制約は、`str` 型または `re.Pattern` 型で指定できます。 + +
    + +```python +# この関数は、block_id が 'assign_ticket' に一致し +# かつ action_id が 'select_user' に一致する場合にのみ呼び出される +@app.action({ + "block_id": "assign_ticket", + "action_id": "select_user" +}) +def update_message(ack, body, client): + ack() + + if "container" in body and "message_ts" in body["container"]: + client.reactions_add( + name="white_check_mark", + channel=body["channel"]["id"], + timestamp=body["container"]["message_ts"], + ) +``` + +
    diff --git a/docs/_basic/ja_listening_events.md b/docs/_basic/ja_listening_events.md new file mode 100644 index 000000000..b3ac00773 --- /dev/null +++ b/docs/_basic/ja_listening_events.md @@ -0,0 +1,49 @@ +--- +title: イベントのリスニング +lang: ja-jp +slug: event-listening +order: 3 +--- + +
    + +`event()` メソッドを使うと、[Events API](https://api.slack.com/events) の任意のイベントをリッスンできます。リッスンするイベントは、アプリの設定であらかじめサブスクライブしておく必要があります。これを利用することで、アプリがインストールされたワークスペースで何らかのイベント(例:ユーザーがメッセージにリアクションをつけた、ユーザーがチャンネルに参加した)が発生したときに、アプリに何らかのアクションを実行させることができます。 + +`event()` メソッドには `str` 型の `eventType` を指定する必要があります。 + +
    + +```python +# ユーザーがワークスペースに参加した際に、自己紹介を促すメッセージを指定のチャンネルに送信 +@app.event("team_join") +def ask_for_introduction(event, say): + welcome_channel_id = "C12345" + user_id = event["user"] + text = f"Welcome to the team, <@{user_id}>! 🎉 You can introduce yourself in this channel." + say(text=text, channel=welcome_channel_id) +``` + +
    + + +

    メッセージのサブタイプのフィルタリング

    +
    + +
    +`message()` リスナーは `event("message")` と等価の機能を提供します。 + +`subtype` という追加のキーを指定して、イベントのサブタイプでフィルタリングすることもできます。よく使われるサブタイプには、`bot_message` や `message_replied` があります。詳しくは[メッセージイベントページ](https://api.slack.com/events/message#message_subtypes)を参照してください。 + +
    + +```python +# 変更されたすべてのメッセージに一致 +@app.event({ + "type": "message", + "subtype": "message_changed" +}) +def log_message_change(logger, event): + user, text = event["user"], event["text"] + logger.info(f"The user {user} changed the message to {text}") +``` +
    diff --git a/docs/_basic/ja_listening_messages.md b/docs/_basic/ja_listening_messages.md new file mode 100644 index 000000000..d0ca9eea8 --- /dev/null +++ b/docs/_basic/ja_listening_messages.md @@ -0,0 +1,45 @@ +--- +title: メッセージのリスニング +lang: ja-jp +slug: message-listening +order: 1 +--- + +
    + +[あなたのアプリがアクセス権限を持つ](https://api.slack.com/messaging/retrieving#permissions)メッセージの投稿イベントをリッスンするには `message()` メソッドを利用します。このメソッドは `type` が `message` ではないイベントを処理対象から除外します。 + +`message()` の引数には `str` 型または `re.Pattern` オブジェクトを指定できます。この条件のパターンに一致しないメッセージは除外されます。 + +
    + +```python +# '👋' が含まれるすべてのメッセージに一致 +@app.message(":wave:") +def say_hello(message, say): + user = message['user'] + say(f"Hi there, <@{user}>!") +``` + +
    + +

    正規表現パターンの使用

    +
    + +
    + +文字列の代わりに `re.compile()` メソッドを使用すれば、より細やかな条件指定ができます。 + +
    + +```python +import re + +@app.message(re.compile("(hi|hello|hey)")) +def say_hello_regex(say, context): + # 正規表現のマッチ結果は context.matches に設定される + greeting = context['matches'][0] + say(f"{greeting}, how are you?") +``` + +
    diff --git a/docs/_basic/ja_listening_modals.md b/docs/_basic/ja_listening_modals.md new file mode 100644 index 000000000..c5986d395 --- /dev/null +++ b/docs/_basic/ja_listening_modals.md @@ -0,0 +1,48 @@ +--- +title: モーダルの送信のリスニング +lang: ja-jp +slug: view_submissions +order: 12 +--- + +
    + +モーダルのペイロードに input ブロックを含める場合、その入力値を受け取るために`view_submission` イベントをリッスンする必要があります。`view_submission` イベントのリッスンには、組み込みの`view()` メソッドを利用することができます。`view()` の引数には、`str` 型または `re.Pattern` 型の `callback_id` を指定します。 + +`input` ブロックの値にアクセスするには `state` オブジェクトを参照します。`state` 内には `values` というオブジェクトがあり、`block_id` と一意の `action_id` に紐づける形で入力値を保持しています。 + +モーダルの送信について詳しくは、API ドキュメントを参照してください。 + +
    + +```python +# view_submission イベントを処理 +@app.view("view_1") +def handle_submission(ack, body, client, view): + # `block_c`という block_id に `dreamy_input` を持つ input ブロックがある場合 + hopes_and_dreams = view["state"]["values"]["block_c"]["dreamy_input"] + user = body["user"]["id"] + # 入力値を検証 + errors = {} + if hopes_and_dreams is not None and len(hopes_and_dreams) <= 5: + errors["block_c"] = "The value must be longer than 5 characters" + if len(errors) > 0: + ack(response_action="errors", errors=errors) + return + # view_submission イベントの確認を行い、モーダルを閉じる + ack() + # 入力されたデータを使った処理を実行。このサンプルでは DB に保存する処理を行う + # そして入力値の検証結果をユーザーに送信 + + # ユーザーに送信するメッセージ + msg = "" + try: + # DB に保存 + msg = f"Your submission of {hopes_and_dreams} was successful" + except Exception as e: + # エラーをハンドリング + msg = "There was an error with your submission" + finally: + # ユーザーにメッセージを送信 + client.chat_postMessage(channel=user, text=msg) +``` diff --git a/docs/_basic/ja_listening_responding_commands.md b/docs/_basic/ja_listening_responding_commands.md new file mode 100644 index 000000000..da782ce6e --- /dev/null +++ b/docs/_basic/ja_listening_responding_commands.md @@ -0,0 +1,27 @@ +--- +title: コマンドのリスニングと応答 +lang: ja-jp +slug: commands +order: 9 +--- + +
    + +スラッシュコマンドが実行されたイベントをリッスンするには、`command()` メソッドを使用します。このメソッドでは `str` 型の `command_name` の指定が必要です。 + +コマンドイベントをアプリが受信し確認したことを Slack に通知するため、`ack()` を呼び出す必要があります。 + +スラッシュコマンドに応答する方法は 2 つあります。1 つ目は `say()` を使う方法で、文字列または JSON のペイロードを渡すことができます。2 つ目は `respond()` を使う方法です。これは `response_url` がある場合に活躍します。これらの方法は[アクションへの応答](#action-respond)セクションで詳しく説明しています。 + +アプリの設定でコマンドを登録するときは、リクエスト URL の末尾に `/slack/events` をつけます。 + +
    + +```python +# echoコマンドは受け取ったコマンドをそのまま返す +@app.command("/echo") +def repeat_text(ack, say, command): + # command リクエストを確認 + ack() + say(f"{command['text']}") +``` diff --git a/docs/_basic/ja_listening_responding_options.md b/docs/_basic/ja_listening_responding_options.md new file mode 100644 index 000000000..8bd7eb705 --- /dev/null +++ b/docs/_basic/ja_listening_responding_options.md @@ -0,0 +1,34 @@ +--- +title: オプションのリスニングと応答 +lang: ja-jp +slug: options +order: 14 +--- + +
    +`options()` メソッドは、Slack からのオプション(セレクトメニュー内の動的な選択肢)をリクエストするペイロードをリッスンします。 [`action()` と同様に](#action-listening)、文字列型の `action_id` または制約付きオブジェクトが必要です。 + +外部データソースを使って選択メニューをロードするためには、末部に `/slack/events` が付加された URL を Options Load URL として予め設定しておく必要があります。 + +`external_select` メニューでは `action_id` を指定することをおすすめしています。ただし、ダイアログを利用している場合、ダイアログが Block Kit に対応していないため、`callback_id` をフィルタリングするための制約オブジェクトを使用する必要があります。 + +オプションのリクエストに応答するときは、有効なオプションを含む `options` または `option_groups` のリストとともに `ack()` を呼び出す必要があります。API サイトにある[外部データを使用する選択メニューに応答するサンプル例](https://api.slack.com/reference/messaging/block-elements#external-select)と、[ダイアログでの応答例](https://api.slack.com/dialogs#dynamic_select_elements_external)を参考にしてください。 + +
    + +```python +# 外部データを使用する選択メニューオプションに応答するサンプル例 +@app.options("external_action") +def show_options(ack): + options = [ + { + "text": {"type": "plain_text", "text":"Option 1"}, + "value":"1-1", + }, + { + "text": {"type": "plain_text", "text":"Option 2"}, + "value":"1-2", + }, + ] + ack(options=options) +``` diff --git a/docs/_basic/ja_listening_responding_shortcuts.md b/docs/_basic/ja_listening_responding_shortcuts.md new file mode 100644 index 000000000..30af2a1aa --- /dev/null +++ b/docs/_basic/ja_listening_responding_shortcuts.md @@ -0,0 +1,107 @@ +--- +title: ショートカットのリスニングと応答 +lang: ja-jp +slug: shortcuts +order: 8 +--- + +
    + +`shortcut()` メソッドは、[グローバルショートカット](https://api.slack.com/interactivity/shortcuts/using#global_shortcuts)と[メッセージショートカット](https://api.slack.com/interactivity/shortcuts/using#message_shortcuts)の 2 つをサポートしています。 + +ショートカットは、いつでも呼び出せるアプリのエントリーポイントを提供するものです。グローバルショートカットは Slack のテキスト入力エリアや検索ウィンドウからアクセスできます。メッセージショートカットはメッセージのコンテキストメニューからアクセスできます。アプリは、ショートカットイベントをリッスンするために `shortcut()` メソッドを使用します。このメソッドには `str` 型または `re.Pattern` 型の `callback_id` パラメーターを指定します。 + +ショートカットイベントがアプリによって確認されたことを Slack に伝えるため、`ack()` を呼び出す必要があります。 + +ショートカットのペイロードには `trigger_id` が含まれます。アプリはこれを使って、ユーザーにやろうとしていることを確認するための[モーダルを開く](#creating-modals)ことができます。 + +アプリの設定でショートカットを登録する際は、他の URL と同じように、リクエスト URL の末尾に `/slack/events` をつけます。 + +⚠️ グローバルショートカットのペイロードにはチャンネル ID が **含まれません**。アプリでチャンネル ID を取得する必要がある場合は、モーダル内に [`conversations_select`](https://api.slack.com/reference/block-kit/block-elements#conversation_select) エレメントを配置します。メッセージショートカットにはチャンネル ID が含まれます。 + +
    + +```python + +# 'open_modal' という callback_id のショートカットをリッスン +@app.shortcut("open_modal") +def open_modal(ack, shortcut, client): + # ショートカットのリクエストを確認 + ack() + # 組み込みのクライアントを使って views_open メソッドを呼び出す + client.views_open( + trigger_id=shortcut["trigger_id"], + # モーダルで表示するシンプルなビューのペイロード + view={ + "type": "modal", + "title": {"type": "plain_text", "text":"My App"}, + "close": {"type": "plain_text", "text":"Close"}, + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text":"About the simplest modal you could conceive of :smile:\n\nMaybe or ." + } + }, + { + "type": "context", + "elements": [ + { + "type": "mrkdwn", + "text":"Psssst this modal was designed using " + } + ] + } + ] + } + ) +``` + +
    + +

    制約付きオブジェクトを使用したショートカットのリスニング

    +
    + +
    +制約付きオブジェクトを使って `callback_id` や `type` によるリッスンできます。オブジェクト内の制約は `str` 型または `re.Pattern` オブジェクトを使用できます。 +
    + +```python + +# このリスナーが呼び出されるのは、callback_id が 'open_modal' と一致し +# かつ type が 'message_action' と一致するときのみ +@app.shortcut({"callback_id": "open_modal", "type": "message_action"}) +def open_modal(ack, shortcut, client): + # ショートカットのリクエストを確認 + ack() + # 組み込みのクライアントを使って views_open メソッドを呼び出す + client.views_open( + trigger_id=shortcut["trigger_id"], + view={ + "type": "modal", + "title": {"type": "plain_text", "text":"My App"}, + "close": {"type": "plain_text", "text":"Close"}, + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text":"About the simplest modal you could conceive of :smile:\n\nMaybe or ." + } + }, + { + "type": "context", + "elements": [ + { + "type": "mrkdwn", + "text":"Psssst this modal was designed using " + } + ] + } + ] + } + ) +``` + +
    diff --git a/docs/_basic/ja_opening_modals.md b/docs/_basic/ja_opening_modals.md new file mode 100644 index 000000000..65aa100ce --- /dev/null +++ b/docs/_basic/ja_opening_modals.md @@ -0,0 +1,58 @@ +--- +title: モーダルの開始 +lang: ja-jp +slug: opening-modals +order: 10 +--- + +
    + +モーダルは、ユーザーからのデータの入力を受け付けたり、動的な情報を表示したりするためのインターフェイスです。組み込みの APIクライアントの `views.open` メソッドに、有効な `trigger_id` とビューのペイロードを指定してモーダルを開始します。 + +ショートカットの実行、ボタンを押下、選択メニューの操作などの操作の場合、Request URL に送信されるペイロードには `trigger_id` が含まれます。 + +モーダルの生成方法についての詳細は、API ドキュメントを参照してください。 + +
    + +```python +# ショートカットの呼び出しをリッスン +@app.shortcut("open_modal") +def open_modal(ack, body, client): + # コマンドのリクエストを確認 + ack() + # 組み込みのクライアントで views_open を呼び出し + client.views_open( + # 受け取りから 3 秒以内に有効な trigger_id を渡す + trigger_id=body["trigger_id"], + # ビューのペイロード + view={ + "type": "modal", + # ビューの識別子 + "callback_id": "view_1", + "title": {"type": "plain_text", "text":"My App"}, + "submit": {"type": "plain_text", "text":"Submit"}, + "blocks": [ + { + "type": "section", + "text": {"type": "mrkdwn", "text":"Welcome to a modal with _blocks_"}, + "accessory": { + "type": "button", + "text": {"type": "plain_text", "text":"Click me!"}, + "action_id": "button_abc" + } + }, + { + "type": "input", + "block_id": "input_c", + "label": {"type": "plain_text", "text":"What are your hopes and dreams?"}, + "element": { + "type": "plain_text_input", + "action_id": "dreamy_input", + "multiline":True + } + } + ] + } + ) +``` diff --git a/docs/_basic/ja_publishing_views.md b/docs/_basic/ja_publishing_views.md new file mode 100644 index 000000000..62278161b --- /dev/null +++ b/docs/_basic/ja_publishing_views.md @@ -0,0 +1,46 @@ +--- +title: ホームタブの更新 +lang: ja-jp +slug: app-home +order: 13 +--- + +
    +ホームタブは、サイドバーや検索画面からアクセス可能なサーフェスエリアです。アプリはこのエリアを使ってユーザーごとのビューを表示することができます。アプリ設定ページで App Home の機能を有効にすると、`views.publish` API メソッドの呼び出しで `user_id` と[ビューのペイロード](https://api.slack.com/reference/block-kit/views)を指定して、ホームタブを公開・更新することができるようになります。 + +`app_home_opened` イベントをサブスクライブすると、ユーザーが App Home を開く操作をリッスンできます。 +
    + +```python +@app.event("app_home_opened") +def update_home_tab(client, event, logger): + try: + # 組み込みのクライアントを使って views.publish を呼び出す + client.views_publish( + # イベントに関連づけられたユーザー ID を使用 + user_id=event["user"], + # アプリの設定で予めホームタブが有効になっている必要がある + view={ + "type": "home", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "*Welcome home, <@" + event["user"] + "> :house:*" + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text":"Learn how home tabs can be more useful and interactive ." + } + } + ] + } + ) + + except Exception as e: + logger.error(f"Error publishing home tab: {e}") +``` diff --git a/docs/_basic/ja_responding_actions.md b/docs/_basic/ja_responding_actions.md new file mode 100644 index 000000000..e8ddd9b30 --- /dev/null +++ b/docs/_basic/ja_responding_actions.md @@ -0,0 +1,44 @@ +--- +title: アクションへの応答 +lang: ja-jp +slug: action-respond +order: 6 +--- + +
    + +アクションへの応答には、主に 2 つの方法があります。1 つ目の最も一般的なやり方は `say()` を使用する方法です。そのイベントが発生した会話(チャンネルや DM)にメッセージを返します。 + +2 つ目は、`respond()` を使用する方法です。これは、アクションに関連づけられた `response_url` を使ったメッセージ送信を行うためのユーティリティです。 + +
    + +```python +# 'approve_button' という action_id のインタラクティブコンポーネントがトリガーされると、このリスナーが呼ばれる +@app.action("approve_button") +def approve_request(ack, say): + # アクションのリクエストを確認 + ack() + say("Request approved 👍") +``` + +
    + +

    respond() の使用

    +
    + +
    + +`respond()` は `response_url` を使って送信するときに便利なメソッドで、これらと同じような動作をします。投稿するメッセージのペイロードには JSON オブジェクトを渡すことができ、メッセージはやり取りの発生元に反映されます。オプションのプロパティとして `response_type`(値は `in_channel` または `ephemeral`)、`replace_original`、`delete_original` などを指定できます。 + +
    + +```python +# 'user_select' という action_id を持つアクションのトリガーをリッスン +@app.action("user_select") +def select_user(ack, action, respond): + ack() + respond(f"You selected <@{action['selected_user']}>") +``` + +
    diff --git a/docs/_basic/ja_sending_messages.md b/docs/_basic/ja_sending_messages.md new file mode 100644 index 000000000..40499555e --- /dev/null +++ b/docs/_basic/ja_sending_messages.md @@ -0,0 +1,57 @@ +--- +title: メッセージの送信 +lang: ja-jp +slug: message-sending +order: 2 +--- + +
    + +リスナー関数内では、関連づけられた会話(例:リスナー実行のトリガーとなったイベントまたはアクションの発生元の会話)がある場合はいつでも `say()` を使用できます。`say()` には文字列または JSON ペイロードを指定できます。文字列の場合、送信できるのはテキストベースの単純なメッセージです。より複雑なメッセージを送信するには JSON ペイロードを指定します。指定したメッセージのペイロードは、関連づけられた会話内のメッセージとして送信されます。 + +リスナー関数の外でメッセージを送信したい場合や、より高度な処理(特定のエラーの処理など)を実行したい場合は、[Bolt インスタンスにアタッチされたクライアント](#web-api)の `client.chat_postMessage` を呼び出します。 + +
    + +```python +# 'knock knock' が含まれるメッセージをリッスンし、イタリック体で 'Who's there?' と返信 +@app.message("knock knock") +def ask_who(message, say): + say("_Who's there?_") +``` + +
    + +

    ブロックを用いたメッセージの送信

    +
    + +
    +`say()` は、より複雑なメッセージペイロードを受け付けるので、メッセージに機能やリッチな構造を与えることが容易です。 + +リッチなメッセージレイアウトをアプリに追加する方法については、[API サイトのガイド](https://api.slack.com/messaging/composing/layouts)を参照してください。また、[Block Kit ビルダー](https://api.slack.com/tools/block-kit-builder?template=1)の一般的なアプリフローのテンプレートも見てみてください。 + +
    + +```python +# ユーザーが 📅 のリアクションをつけたら、日付ピッカーのついた section ブロックを送信 +@app.event("reaction_added") +def show_datepicker(event, say): + reaction = event["reaction"] + if reaction == "calendar": + blocks = [{ + "type": "section", + "text": {"type": "mrkdwn", "text":"Pick a date for me to remind you"}, + "accessory": { + "type": "datepicker", + "action_id": "datepicker_remind", + "initial_date":"2020-05-04", + "placeholder": {"type": "plain_text", "text":"Select a date"} + } + }] + say( + blocks=blocks, + text="Pick a date for me to remind you" + ) +``` + +
    diff --git a/docs/_basic/ja_socket_mode.md b/docs/_basic/ja_socket_mode.md new file mode 100644 index 000000000..7e202add0 --- /dev/null +++ b/docs/_basic/ja_socket_mode.md @@ -0,0 +1,72 @@ +--- +title: ソケットモードの使用 +lang: ja-jp +slug: socket-mode +order: 16 +--- + +
    +[ソケットモード](https://api.slack.com/apis/connections/socket)は、アプリに WebSocket での接続と、そのコネクション経由でのデータ受信を可能とします。Bolt for Python は、バージョン 1.2.0 からこれに対応しています。 + +ソケットモードでは、Slack からのペイロード送信を受け付けるエンドポイントをホストする HTTP サーバーを起動する代わりに WebSocket で Slack に接続し、そのコネクション経由でデータを受信します。ソケットモードを使う前に、アプリの管理画面でソケットモードの機能が有効になっているコオを確認しておいてください。 + +ソケットモードを使用するには、環境変数に `SLACK_APP_TOKEN` を追加します。アプリのトークン(App-Level Token)は、アプリの設定の「**Basic Information**」セクションで確認できます。 + +[組み込みのソケットモードアダプター](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/builtin)を使用するのがおすすめですが、サードパーティ製ライブラリを使ったアダプターの実装もいくつか存在しています。利用可能なアダプターの一覧です。 + +|PyPI プロジェクト|Bolt アダプター| +|-|-| +|[slack_sdk](https://pypi.org/project/slack-sdk/)|[slack_bolt.adapter.socket_mode](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/builtin)| +|[websocket_client](https://pypi.org/project/websocket_client/)|[slack_bolt.adapter.socket_mode.websocket_client](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/websocket_client)| +|[aiohttp](https://pypi.org/project/aiohttp/) (asyncio-based)|[slack_bolt.adapter.socket_mode.aiohttp](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/aiohttp)| +|[websockets](https://pypi.org/project/websockets/) (asyncio-based)|[slack_bolt.adapter.socket_mode.websockets](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/websockets)| + +
    + +```python +import os +from slack_bolt import App +from slack_bolt.adapter.socket_mode import SocketModeHandler + +# 事前に Slack アプリをインストールし 'xoxb-' で始まるトークンを入手 +app = App(token=os.environ["SLACK_BOT_TOKEN"]) + +# ここでミドルウェアとリスナーの追加を行います + +if __name__ == "__main__": + # export SLACK_APP_TOKEN=xapp-*** + # export SLACK_BOT_TOKEN=xoxb-*** + handler = SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]) + handler.start() +``` + +
    + +

    Async (asyncio) の利用

    +
    + +
    +aiohttp のような asyncio をベースとしたアダプターを使う場合、アプリケーション全体が asyncio の async/await プログラミングモデルで実装されている必要があります。`AsyncApp` を動作させるためには `AsyncSocketModeHandler` とその async なミドルウェアやリスナーを利用します。 + +`AsyncApp` の使い方についての詳細は、[Usin async (asyncio)](https://slack.dev/bolt-python/concepts#async)トや、関連する[サンプルコード例](https://github.com/slackapi/bolt-python/tree/main/examples)を参考にしてください。 +
    + +```python +from slack_bolt.app.async_app import AsyncApp +# デフォルトは aiohttp を使った実装 +from slack_bolt.adapter.socket_mode.async_handler import AsyncSocketModeHandler + +app = AsyncApp(token=os.environ["SLACK_BOT_TOKEN"]) + +# ここでミドルウェアとリスナーの追加を行います + +async def main(): + handler = AsyncSocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]) + await handler.start_async() + +if __name__ == "__main__": + import asyncio + asyncio.run(main()) +``` + +
    diff --git a/docs/_basic/ja_updating_pushing_modals.md b/docs/_basic/ja_updating_pushing_modals.md new file mode 100644 index 000000000..26fdcdc94 --- /dev/null +++ b/docs/_basic/ja_updating_pushing_modals.md @@ -0,0 +1,53 @@ +--- +title: モーダルの更新と多重表示 +lang: ja-jp +slug: updating-pushing-views +order: 11 +--- + +
    + +モーダル内では、複数のモーダルをスタックのように重ねることができます。`views_open` という APIを呼び出すと、親となるとなるモーダルビューが追加されます。この最初の呼び出しの後、`views_update` を呼び出すことでそのビューを更新することができます。また、`views_push` を呼び出すと、親のモーダルの上にさらに新しいモーダルビューを重ねることもできます。 + +**`views_update`**
    +モーダルの更新は、組み込みのクライアントで `views_update` API を呼び出します。この API呼び出しでは、ビューを開いた時に生成された `view_id` と、更新後の `blocks` のリストを含む新しい `view` を指定します。既存のモーダルに含まれるエレメントをユーザーが操作した時にビューを更新する場合は、リクエストの `body` に含まれる `view_id` が利用できます。 + +**`views_push`**
    +既存のモーダルの上に新しいモーダルをスタックのように追加する場合は、組み込みのクライアントで `views_push` API を呼び出します。この API 呼び出しでは、有効な `trigger_id` と新しいビューのペイロードを指定します。`views_push` の引数は モーダルの開始 と同じです。モーダルを開いた後、このモーダルのスタックに追加できるモーダルビューは 2 つまでです。 + +モーダルの更新と多重表示に関する詳細は、API ドキュメントを参照してください。 + +
    + +```python +# モーダルに含まれる、`button_abc` という action_id のボタンの呼び出しをリッスン +@app.action("button_abc") +def update_modal(ack, body, client): + # ボタンのリクエストを確認 + ack() + # 組み込みのクライアントで views_update を呼び出し + client.views_update( + # view_id を渡すこと + view_id=body["view"]["id"], + # 競合状態を防ぐためのビューの状態を示す文字列 + hash=body["view"]["hash"], + # 更新後の blocks を含むビューのペイロード + view={ + "type": "modal", + # ビューの識別子 + "callback_id": "view_1", + "title": {"type": "plain_text", "text":"Updated modal"}, + "blocks": [ + { + "type": "section", + "text": {"type": "plain_text", "text":"You updated the modal!"} + }, + { + "type": "image", + "image_url": "https://media.giphy.com/media/SVZGEcYt7brkFUyU90/giphy.gif", + "alt_text":"Yay!The modal was updated" + } + ] + } + ) +``` diff --git a/docs/_basic/ja_web_api.md b/docs/_basic/ja_web_api.md new file mode 100644 index 000000000..c44c8da22 --- /dev/null +++ b/docs/_basic/ja_web_api.md @@ -0,0 +1,26 @@ +--- +title: Web API の使い方 +lang: ja-jp +slug: web-api +order: 4 +--- + +
    +`app.client`、またはミドルウェア・リスナーの引数 `client` として Bolt アプリに提供されている [`WebClient`](https://slack.dev/python-slack-sdk/basic_usage.html) は必要な権限を付与されており、これを利用することで[あらゆる Web API メソッド](https://api.slack.com/methods)を呼び出すことができます。このクライアントのメソッドを呼び出すと `SlackResponse` という Slack からの応答情報を含むオブジェクトが返されます。 + +Bolt の初期化に使用するトークンは `context` オブジェクトに設定されます。このトークンは、多くの Web API メソッドを呼び出す際に必要となります。 + +
    + +```python +@app.message("wake me up") +def say_hello(client, message): + # 2020 年 9 月 30 日午後 11:59:59 を示す Unix エポック秒 + when_september_ends = 1601510399 + channel_id = message["channel"] + client.chat_scheduleMessage( + channel=channel_id, + post_at=when_september_ends, + text="Summer has come and passed" + ) +``` diff --git a/docs/_basic/listening_actions.md b/docs/_basic/listening_actions.md index 3de71d003..af85c4c4c 100644 --- a/docs/_basic/listening_actions.md +++ b/docs/_basic/listening_actions.md @@ -10,7 +10,7 @@ Your app can listen to user actions, like button clicks, and menu selects, using Actions can be filtered on an `action_id` of type `str` or `re.Pattern`. `action_id`s act as unique identifiers for interactive components on the Slack platform. -You’ll notice in all `action()` examples, `ack()` is used. It is required to call the `ack()` function within an action listener to acknowledge that the event was received from Slack. This is discussed in the [acknowledging events section](#acknowledge). +You'll notice in all `action()` examples, `ack()` is used. It is required to call the `ack()` function within an action listener to acknowledge that the event was received from Slack. This is discussed in the [acknowledging events section](#acknowledge).
    diff --git a/docs/_basic/listening_messages.md b/docs/_basic/listening_messages.md index 34c30e180..d193da141 100644 --- a/docs/_basic/listening_messages.md +++ b/docs/_basic/listening_messages.md @@ -9,7 +9,7 @@ order: 1 To listen to messages that [your app has access to receive](https://api.slack.com/messaging/retrieving#permissions), you can use the `message()` method which filters out events that aren't of type `message`. -`message()` accepts an argument of type `str` or `re.Pattern` object that filters out any messages that don’t match the pattern. +`message()` accepts an argument of type `str` or `re.Pattern` object that filters out any messages that don't match the pattern. diff --git a/docs/_basic/listening_responding_shortcuts.md b/docs/_basic/listening_responding_shortcuts.md index 1e23ddb69..a7f414501 100644 --- a/docs/_basic/listening_responding_shortcuts.md +++ b/docs/_basic/listening_responding_shortcuts.md @@ -9,7 +9,7 @@ order: 8 The `shortcut()` method supports both [global shortcuts](https://api.slack.com/interactivity/shortcuts/using#global_shortcuts) and [message shortcuts](https://api.slack.com/interactivity/shortcuts/using#message_shortcuts). -Shortcuts are invokable entry points to apps. Global shortcuts are available from within search in Slack. Message shortcuts are available in the context menus of messages. Your app can use the `shortcut()` method to listen to incoming shortcut events. The method requires a `callback_id` parameter of type `str` or `re.Pattern`. +Shortcuts are invokable entry points to apps. Global shortcuts are available from within search and text composer area in Slack. Message shortcuts are available in the context menus of messages. Your app can use the `shortcut()` method to listen to incoming shortcut events. The method requires a `callback_id` parameter of type `str` or `re.Pattern`. Shortcuts must be acknowledged with `ack()` to inform Slack that your app has received the event. diff --git a/docs/_basic/sending_messages.md b/docs/_basic/sending_messages.md index cb6170f6a..bdf9174de 100644 --- a/docs/_basic/sending_messages.md +++ b/docs/_basic/sending_messages.md @@ -9,7 +9,7 @@ order: 2 Within your listener function, `say()` is available whenever there is an associated conversation (for example, a conversation where the event or action which triggered the listener occurred). `say()` accepts a string to post simple messages and JSON payloads to send more complex messages. The message payload you pass in will be sent to the associated conversation. -In the case that you’d like to send a message outside of a listener or you want to do something more advanced (like handle specific errors), you can call `client.chat_postMessage` [using the client attached to your Bolt instance](#web-api). +In the case that you'd like to send a message outside of a listener or you want to do something more advanced (like handle specific errors), you can call `client.chat_postMessage` [using the client attached to your Bolt instance](#web-api). diff --git a/docs/_basic/socket_mode.md b/docs/_basic/socket_mode.md index da7f1d024..2e23266a9 100644 --- a/docs/_basic/socket_mode.md +++ b/docs/_basic/socket_mode.md @@ -40,11 +40,11 @@ if __name__ == "__main__":
    -

    Using Async

    +

    Using Async (asyncio)

    -To use the asyncio-based adapters such as aiohttp, your app needs to be compatible with asyncio's async/await programming model. `AsyncSocketModeHandler` is available for running `AsyncApp` and its async middleware and listeners. +To use the asyncio-based adapters such as aiohttp, your whole app needs to be compatible with asyncio's async/await programming model. `AsyncSocketModeHandler` is available for running `AsyncApp` and its async middleware and listeners. To learn how to use `AsyncApp`, checkout the [Using Async](https://slack.dev/bolt-python/concepts#async) document and relevant [examples](https://github.com/slackapi/bolt-python/tree/main/examples).
    diff --git a/docs/_basic/web_api.md b/docs/_basic/web_api.md index e29812106..d226b6e15 100644 --- a/docs/_basic/web_api.md +++ b/docs/_basic/web_api.md @@ -6,7 +6,7 @@ order: 4 ---
    -You can call [any Web API method](https://api.slack.com/methods) using the [`WebClient`](https://slack.dev/python-slack-sdk/basic_usage.html) provided to your Bolt app as `app.client` (given that your app has the appropriate scopes). When you call one the client’s methods, it returns a `SlackResponse` which contains the response from Slack. +You can call [any Web API method](https://api.slack.com/methods) using the [`WebClient`](https://slack.dev/python-slack-sdk/basic_usage.html) provided to your Bolt app as either `app.client` or `client` in middleware/listener arguments (given that your app has the appropriate scopes). When you call one the client's methods, it returns a `SlackResponse` which contains the response from Slack. The token used to initialize Bolt can be found in the `context` object, which is required to call most Web API methods. diff --git a/docs/_config.yml b/docs/_config.yml index 8e01ded40..c6437f1fa 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -36,7 +36,7 @@ t: start: Getting started contribute: Contributing ja-jp: -# basic: 基本的な概念 + basic: 基本的な概念 # steps: ワークフローステップ # advanced: 応用コンセプト start: Bolt 入門ガイド diff --git a/docs/_includes/sidebar.html b/docs/_includes/sidebar.html index 4343ff5c3..25b31dea5 100644 --- a/docs/_includes/sidebar.html +++ b/docs/_includes/sidebar.html @@ -23,7 +23,7 @@
  • {{ site.t[page.lang].start }}
  • - +
  • API Documents
  • diff --git a/docs/_tutorials/ja_getting_started.md b/docs/_tutorials/ja_getting_started.md index 80a315f66..9feb4375f 100644 --- a/docs/_tutorials/ja_getting_started.md +++ b/docs/_tutorials/ja_getting_started.md @@ -43,7 +43,7 @@ Slack アプリで使用できるトークンには、ユーザートークン 左サイドバーの「**OAuth & Permissions**」をクリックし、「**Bot Token Scopes**」セクションまで下にスクロールします。「**Add an OAuth Scope**」をクリックします。 -ここでは「[`chat:write`](https://api.slack.com/scopes/chat:write)」というスコープのみを追加します。このスコープは、アプリが参加しているチャンネルにメッセージを投稿することを許可します。 +ここでは [`chat:write`](https://api.slack.com/scopes/chat:write) というスコープのみを追加します。このスコープは、アプリが参加しているチャンネルにメッセージを投稿することを許可します。 OAuth & Permissions ページの一番上までスクロールし、「**Install App to Workspace**」をクリックします。Slack の OAuth 確認画面 が表示されます。この画面で開発用ワークスペースへのアプリのインストールを承認します。 @@ -173,7 +173,7 @@ app = App( signing_secret=os.environ.get("SLACK_SIGNING_SECRET") ) -# 「hello」を含むメッセージをリッスンします +# 'hello' を含むメッセージをリッスンします @app.message("hello") def message_hello(message, say): # イベントがトリガーされたチャンネルへ say() でメッセージを送信します @@ -214,7 +214,7 @@ app = App( signing_secret=os.environ.get("SLACK_SIGNING_SECRET") ) -# 「hello」を含むメッセージをリッスンします +# 'hello' を含むメッセージをリッスンします @app.message("hello") def message_hello(message, say): # イベントがトリガーされたチャンネルへ say() でメッセージを送信します @@ -238,9 +238,9 @@ if __name__ == "__main__": app.start(port=int(os.environ.get("PORT", 3000))) ``` -`say()` の中の値を、「`blocks`」という配列のオブジェクトに変えました。ブロックは Slack メッセージを構成するコンポーネントであり、テキストや画像、日付ピッカーなど、さまざまなタイプのブロックがあります。この例では、「accessory」に「button」を持たせた「section」のブロックを、アプリからの応答に含めています。「`blocks`」を使用する場合、「`text`」は通知やアクセシビリティのためのフォールバックとなります。 +`say()` の中の値を `blocks` という配列のオブジェクトに変えました。ブロックは Slack メッセージを構成するコンポーネントであり、テキストや画像、日付ピッカーなど、さまざまなタイプのブロックがあります。この例では `accessory` に `button` を持たせた「section」のブロックを、アプリからの応答に含めています。`blocks` を使用する場合、`text` は通知やアクセシビリティのためのフォールバックとなります。 -ボタンを含む「`accessory`」オブジェクトでは、「`action_id`」を指定していることがわかります。これは、ボタンを一意に示す識別子として機能します。これを使って、アプリをどのアクションに応答させるかを指定できます。 +ボタンを含む `accessory` オブジェクトでは、`action_id` を指定していることがわかります。これは、ボタンを一意に示す識別子として機能します。これを使って、アプリをどのアクションに応答させるかを指定できます。 > 💡 [Block Kit Builder](https://app.slack.com/block-kit-builder) を使用すると、インタラクティブなメッセージのプロトタイプを簡単に作成できます。自分自身やチームメンバーがメッセージのモックアップを作成し、生成される JSON をアプリに直接貼りつけることができます。 @@ -258,7 +258,7 @@ app = App( signing_secret=os.environ.get("SLACK_SIGNING_SECRET") ) -# 「hello」を含むメッセージをリッスンします +# 'hello' を含むメッセージをリッスンします @app.message("hello") def message_hello(message, say): # イベントがトリガーされたチャンネルへ say() でメッセージを送信します @@ -289,7 +289,7 @@ if __name__ == "__main__": app.start(port=int(os.environ.get("PORT", 3000))) ``` -`app.action()` を使って、先ほど命名した「`button_click`」という `action_id` をリッスンしています。アプリを再起動し、ボタンをクリックすると、アプリからの「clicked the button」というメッセージが新たに表示されるでしょう。 +`app.action()` を使って、先ほど命名した `button_click` という `action_id` をリッスンしています。アプリを再起動し、ボタンをクリックすると、アプリからの「clicked the button」というメッセージが新たに表示されるでしょう。 --- From 689423957172cd37a604c76ef71553f3812069aa Mon Sep 17 00:00:00 2001 From: Jeremy Lujan Date: Thu, 25 Mar 2021 09:51:43 -0500 Subject: [PATCH 153/719] Add support for lazy listeners when running with chalice local --- .../adapter/aws_lambda/chalice_handler.py | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/slack_bolt/adapter/aws_lambda/chalice_handler.py b/slack_bolt/adapter/aws_lambda/chalice_handler.py index 8d5fc9b21..a67abb117 100644 --- a/slack_bolt/adapter/aws_lambda/chalice_handler.py +++ b/slack_bolt/adapter/aws_lambda/chalice_handler.py @@ -1,6 +1,12 @@ import logging +import json +from os import getenv from chalice.app import Request, Response, Chalice +from chalice.config import Config +from chalice.test import ( + BaseClient, LambdaContext, InvokeResponse +) from slack_bolt.adapter.aws_lambda.chalice_lazy_listener_runner import ( ChaliceLazyListenerRunner, @@ -13,14 +19,41 @@ from slack_bolt.response import BoltResponse +class LocalLambdaClient(BaseClient): + """Lambda client implementing `invoke` for use when running with Chalice CLI""" + def __init__(self, app, config): + # type: (Chalice, Config) -> None + self._app = app + self._config = config + + def invoke(self, FunctionName: str = None, InvocationType: str = "Event", Payload: str = None): + # type: (str, Any) -> InvokeResponse + if Payload is None: + Payload = '{}' + scoped = self._config.scope(self._config.chalice_stage, FunctionName) + lambda_context = LambdaContext( + FunctionName, memory_size=scoped.lambda_memory_size) + + with self._patched_env_vars(scoped.environment_variables): + response = self._app(json.loads(Payload), lambda_context) + return InvokeResponse(payload=response) + + class ChaliceSlackRequestHandler: def __init__(self, app: App, chalice: Chalice): # type: ignore self.app = app self.chalice = chalice self.logger = get_bolt_app_logger(app.name, ChaliceSlackRequestHandler) + + lambda_client = None + if getenv('AWS_CHALICE_CLI_MODE') == 'true': + lambda_client = LocalLambdaClient(self.chalice, Config()) + self.app.listener_runner.lazy_listener_runner = ChaliceLazyListenerRunner( - logger=self.logger + logger=self.logger, + lambda_client=lambda_client ) + if self.app.oauth_flow is not None: self.app.oauth_flow.settings.redirect_uri_page_renderer.install_path = "?" From 86522d0bb02afa6532b0d758fec7cdf484c6daff Mon Sep 17 00:00:00 2001 From: Jeremy Lujan Date: Thu, 25 Mar 2021 14:44:37 -0500 Subject: [PATCH 154/719] Fix types in LocalLambdaClient --- .../adapter/aws_lambda/chalice_handler.py | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/slack_bolt/adapter/aws_lambda/chalice_handler.py b/slack_bolt/adapter/aws_lambda/chalice_handler.py index a67abb117..12a4f3ed4 100644 --- a/slack_bolt/adapter/aws_lambda/chalice_handler.py +++ b/slack_bolt/adapter/aws_lambda/chalice_handler.py @@ -4,9 +4,7 @@ from chalice.app import Request, Response, Chalice from chalice.config import Config -from chalice.test import ( - BaseClient, LambdaContext, InvokeResponse -) +from chalice.test import BaseClient, LambdaContext, InvokeResponse from slack_bolt.adapter.aws_lambda.chalice_lazy_listener_runner import ( ChaliceLazyListenerRunner, @@ -21,18 +19,23 @@ class LocalLambdaClient(BaseClient): """Lambda client implementing `invoke` for use when running with Chalice CLI""" - def __init__(self, app, config): - # type: (Chalice, Config) -> None + + def __init__(self, app: Chalice, config: Config) -> None: self._app = app self._config = config - def invoke(self, FunctionName: str = None, InvocationType: str = "Event", Payload: str = None): - # type: (str, Any) -> InvokeResponse + def invoke( + self, + FunctionName: str = None, + InvocationType: str = "Event", + Payload: str = None, + ) -> InvokeResponse: if Payload is None: - Payload = '{}' + Payload = "{}" scoped = self._config.scope(self._config.chalice_stage, FunctionName) lambda_context = LambdaContext( - FunctionName, memory_size=scoped.lambda_memory_size) + FunctionName, memory_size=scoped.lambda_memory_size + ) with self._patched_env_vars(scoped.environment_variables): response = self._app(json.loads(Payload), lambda_context) @@ -46,12 +49,11 @@ def __init__(self, app: App, chalice: Chalice): # type: ignore self.logger = get_bolt_app_logger(app.name, ChaliceSlackRequestHandler) lambda_client = None - if getenv('AWS_CHALICE_CLI_MODE') == 'true': + if getenv("AWS_CHALICE_CLI_MODE") == "true": lambda_client = LocalLambdaClient(self.chalice, Config()) self.app.listener_runner.lazy_listener_runner = ChaliceLazyListenerRunner( - logger=self.logger, - lambda_client=lambda_client + logger=self.logger, lambda_client=lambda_client ) if self.app.oauth_flow is not None: From 30950633472213664673f9f446692f6e003538e6 Mon Sep 17 00:00:00 2001 From: Jeremy Lujan Date: Tue, 30 Mar 2021 14:45:58 -0500 Subject: [PATCH 155/719] Add tests for chalice local lazy through LocalLambdaClient --- .../adapter/aws_lambda/chalice_handler.py | 4 +- tests/adapter_tests/aws/test_aws_chalice.py | 65 +++++++++++++++++++ 2 files changed, 66 insertions(+), 3 deletions(-) diff --git a/slack_bolt/adapter/aws_lambda/chalice_handler.py b/slack_bolt/adapter/aws_lambda/chalice_handler.py index 12a4f3ed4..f4c7220ba 100644 --- a/slack_bolt/adapter/aws_lambda/chalice_handler.py +++ b/slack_bolt/adapter/aws_lambda/chalice_handler.py @@ -28,10 +28,8 @@ def invoke( self, FunctionName: str = None, InvocationType: str = "Event", - Payload: str = None, + Payload: str = "{}", ) -> InvokeResponse: - if Payload is None: - Payload = "{}" scoped = self._config.scope(self._config.chalice_stage, FunctionName) lambda_context = LambdaContext( FunctionName, memory_size=scoped.lambda_memory_size diff --git a/tests/adapter_tests/aws/test_aws_chalice.py b/tests/adapter_tests/aws/test_aws_chalice.py index ad9263550..83ec0a3fe 100644 --- a/tests/adapter_tests/aws/test_aws_chalice.py +++ b/tests/adapter_tests/aws/test_aws_chalice.py @@ -1,12 +1,16 @@ import json +import os from time import time from typing import Dict, Any from urllib.parse import quote +from unittest import mock +import logging from chalice import Chalice, Response from chalice.app import Request from chalice.config import Config from chalice.local import LocalGateway +from chalice.test import Client from slack_sdk.signature import SignatureVerifier from slack_sdk.web import WebClient @@ -265,6 +269,67 @@ def say_it(say): assert_auth_test_count(self, 1) assert self.mock_received_requests["/chat.postMessage"] == 1 + def test_lazy_listeners_cli(self): + with mock.patch.dict(os.environ, {"AWS_CHALICE_CLI_MODE": "true"}): + assert os.environ.get("AWS_CHALICE_CLI_MODE") == "true" + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + process_before_response=True + ) + + def command_handler(ack): + ack() + + def say_it(say): + say("Done!") + + app.command("/hello-world")(ack=command_handler, lazy=[say_it]) + + input = ( + "token=verification_token" + "&team_id=T111" + "&team_domain=test-domain" + "&channel_id=C111" + "&channel_name=random" + "&user_id=W111" + "&user_name=primary-owner" + "&command=%2Fhello-world" + "&text=Hi" + "&enterprise_id=E111" + "&enterprise_name=Org+Name" + "&response_url=https%3A%2F%2Fhooks.slack.com%2Fcommands%2FT111%2F111%2Fxxxxx" + "&trigger_id=111.111.xxx" + ) + timestamp, body = str(int(time())), input + + chalice_app = Chalice(app_name="bolt-python-chalice") + slack_handler = ChaliceSlackRequestHandler(app=app, chalice=chalice_app) + + @chalice_app.route( + "/slack/events", + methods=["POST"], + content_types=["application/x-www-form-urlencoded", "application/json"], + ) + def events() -> Response: + return slack_handler.handle(chalice_app.current_request) + + headers = self.build_headers(timestamp, body) + client = Client(chalice_app, Config()) + response = client.http.post("/slack/events", headers=headers, body=body) + # + # response: Dict[str, Any] = LocalGateway(chalice_app, Config()).handle_request( + # method="POST", + # path="/slack/events", + # body=body, + # headers=self.build_headers(timestamp, body), + # ) + + # assert response["statusCode"] == 200, f"error: {response['body']}" + assert response.status_code == 200, f"Failed request: {response.body}" + assert_auth_test_count(self, 1) + assert self.mock_received_requests["/chat.postMessage"] == 1 + def test_oauth(self): app = App( client=self.web_client, From 2e32d1bf1b4b3703af2479ef0f93eb43de881e4d Mon Sep 17 00:00:00 2001 From: Jeremy Lujan Date: Tue, 30 Mar 2021 15:41:21 -0500 Subject: [PATCH 156/719] Remove commented code in test_aws_chalice --- tests/adapter_tests/aws/test_aws_chalice.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tests/adapter_tests/aws/test_aws_chalice.py b/tests/adapter_tests/aws/test_aws_chalice.py index 83ec0a3fe..7b9daad7b 100644 --- a/tests/adapter_tests/aws/test_aws_chalice.py +++ b/tests/adapter_tests/aws/test_aws_chalice.py @@ -317,15 +317,7 @@ def events() -> Response: headers = self.build_headers(timestamp, body) client = Client(chalice_app, Config()) response = client.http.post("/slack/events", headers=headers, body=body) - # - # response: Dict[str, Any] = LocalGateway(chalice_app, Config()).handle_request( - # method="POST", - # path="/slack/events", - # body=body, - # headers=self.build_headers(timestamp, body), - # ) - - # assert response["statusCode"] == 200, f"error: {response['body']}" + assert response.status_code == 200, f"Failed request: {response.body}" assert_auth_test_count(self, 1) assert self.mock_received_requests["/chat.postMessage"] == 1 From efab0105fd3ff9359a2f669eda46bbed2f6c3bec Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 2 Apr 2021 11:44:13 +0900 Subject: [PATCH 157/719] Apply black slack_bolt/ tests/ --- slack_bolt/adapter/__init__.py | 2 +- slack_bolt/error/__init__.py | 2 ++ slack_bolt/util/__init__.py | 2 +- slack_bolt/workflows/__init__.py | 2 +- slack_bolt/workflows/step/async_step.py | 1 + slack_bolt/workflows/step/async_step_middleware.py | 1 + slack_bolt/workflows/step/step.py | 1 + slack_bolt/workflows/step/step_middleware.py | 1 + slack_bolt/workflows/step/utilities/__init__.py | 2 +- slack_bolt/workflows/step/utilities/async_complete.py | 1 + slack_bolt/workflows/step/utilities/async_configure.py | 1 + slack_bolt/workflows/step/utilities/async_fail.py | 1 + slack_bolt/workflows/step/utilities/async_update.py | 1 + slack_bolt/workflows/step/utilities/complete.py | 1 + slack_bolt/workflows/step/utilities/configure.py | 1 + slack_bolt/workflows/step/utilities/fail.py | 1 + slack_bolt/workflows/step/utilities/update.py | 1 + tests/adapter_tests/aws/test_aws_chalice.py | 2 +- 18 files changed, 19 insertions(+), 5 deletions(-) diff --git a/slack_bolt/adapter/__init__.py b/slack_bolt/adapter/__init__.py index 8c6c51914..f339226bc 100644 --- a/slack_bolt/adapter/__init__.py +++ b/slack_bolt/adapter/__init__.py @@ -1,2 +1,2 @@ """Adapter modules for running Bolt apps along with Web frameworks or Socket Mode. -""" \ No newline at end of file +""" diff --git a/slack_bolt/error/__init__.py b/slack_bolt/error/__init__.py index d6f72b2f5..4201356dc 100644 --- a/slack_bolt/error/__init__.py +++ b/slack_bolt/error/__init__.py @@ -1,3 +1,5 @@ """Bolt specific error types.""" + + class BoltError(Exception): """General class in a Bolt app""" diff --git a/slack_bolt/util/__init__.py b/slack_bolt/util/__init__.py index f3c170424..2f85bff8d 100644 --- a/slack_bolt/util/__init__.py +++ b/slack_bolt/util/__init__.py @@ -1 +1 @@ -"""Internal utilities for the Bolt framework.""" \ No newline at end of file +"""Internal utilities for the Bolt framework.""" diff --git a/slack_bolt/workflows/__init__.py b/slack_bolt/workflows/__init__.py index e170de2b0..8c4b1fd03 100644 --- a/slack_bolt/workflows/__init__.py +++ b/slack_bolt/workflows/__init__.py @@ -7,4 +7,4 @@ * `slack_bolt.workflows.step.async_step` (if you use asyncio-based `AsyncApp`) Refer to https://api.slack.com/workflows/steps for details. -""" \ No newline at end of file +""" diff --git a/slack_bolt/workflows/step/async_step.py b/slack_bolt/workflows/step/async_step.py index 1a4e49517..b445962d0 100644 --- a/slack_bolt/workflows/step/async_step.py +++ b/slack_bolt/workflows/step/async_step.py @@ -29,6 +29,7 @@ class AsyncWorkflowStepBuilder: """Steps from Apps Refer to https://api.slack.com/workflows/steps for details. """ + callback_id: Union[str, Pattern] _edit: Optional[AsyncListener] _save: Optional[AsyncListener] diff --git a/slack_bolt/workflows/step/async_step_middleware.py b/slack_bolt/workflows/step/async_step_middleware.py index d9527d3cc..150729764 100644 --- a/slack_bolt/workflows/step/async_step_middleware.py +++ b/slack_bolt/workflows/step/async_step_middleware.py @@ -11,6 +11,7 @@ class AsyncWorkflowStepMiddleware(AsyncMiddleware): # type:ignore """Base middleware for workflow step specific ones""" + def __init__(self, step: AsyncWorkflowStep, listener_runner: AsyncioListenerRunner): self.step = step self.listener_runner = listener_runner diff --git a/slack_bolt/workflows/step/step.py b/slack_bolt/workflows/step/step.py index df0815e01..692ee5d1e 100644 --- a/slack_bolt/workflows/step/step.py +++ b/slack_bolt/workflows/step/step.py @@ -24,6 +24,7 @@ class WorkflowStepBuilder: """Steps from Apps Refer to https://api.slack.com/workflows/steps for details. """ + callback_id: Union[str, Pattern] _edit: Optional[Listener] _save: Optional[Listener] diff --git a/slack_bolt/workflows/step/step_middleware.py b/slack_bolt/workflows/step/step_middleware.py index 3aa32be62..f43fcbe7b 100644 --- a/slack_bolt/workflows/step/step_middleware.py +++ b/slack_bolt/workflows/step/step_middleware.py @@ -11,6 +11,7 @@ class WorkflowStepMiddleware(Middleware): # type:ignore """Base middleware for workflow step specific ones""" + def __init__(self, step: WorkflowStep, listener_runner: ThreadListenerRunner): self.step = step self.listener_runner = listener_runner diff --git a/slack_bolt/workflows/step/utilities/__init__.py b/slack_bolt/workflows/step/utilities/__init__.py index eedc9c85e..3495416ed 100644 --- a/slack_bolt/workflows/step/utilities/__init__.py +++ b/slack_bolt/workflows/step/utilities/__init__.py @@ -16,4 +16,4 @@ * `slack_bolt.workflows.step.utilities.complete` for notifying the execution completion to Slack For asyncio-based apps, refer to the corresponding `async` prefixed ones. -""" \ No newline at end of file +""" diff --git a/slack_bolt/workflows/step/utilities/async_complete.py b/slack_bolt/workflows/step/utilities/async_complete.py index 463e30ca4..0fb0b054c 100644 --- a/slack_bolt/workflows/step/utilities/async_complete.py +++ b/slack_bolt/workflows/step/utilities/async_complete.py @@ -24,6 +24,7 @@ async def execute(step, complete, fail): This utility is a thin wrapper of workflows.stepCompleted API method. Refer to https://api.slack.com/methods/workflows.stepCompleted for details. """ + def __init__(self, *, client: AsyncWebClient, body: dict): self.client = client self.body = body diff --git a/slack_bolt/workflows/step/utilities/async_configure.py b/slack_bolt/workflows/step/utilities/async_configure.py index 445f55635..721d5049c 100644 --- a/slack_bolt/workflows/step/utilities/async_configure.py +++ b/slack_bolt/workflows/step/utilities/async_configure.py @@ -34,6 +34,7 @@ async def edit(ack, step, configure): Refer to https://api.slack.com/workflows/steps for details. """ + def __init__(self, *, callback_id: str, client: AsyncWebClient, body: dict): self.callback_id = callback_id self.client = client diff --git a/slack_bolt/workflows/step/utilities/async_fail.py b/slack_bolt/workflows/step/utilities/async_fail.py index f2e272db0..751aeb4c3 100644 --- a/slack_bolt/workflows/step/utilities/async_fail.py +++ b/slack_bolt/workflows/step/utilities/async_fail.py @@ -21,6 +21,7 @@ async def execute(step, complete, fail): This utility is a thin wrapper of workflows.stepFailed API method. Refer to https://api.slack.com/methods/workflows.stepFailed for details. """ + def __init__(self, *, client: AsyncWebClient, body: dict): self.client = client self.body = body diff --git a/slack_bolt/workflows/step/utilities/async_update.py b/slack_bolt/workflows/step/utilities/async_update.py index 0528473ca..d3409bca3 100644 --- a/slack_bolt/workflows/step/utilities/async_update.py +++ b/slack_bolt/workflows/step/utilities/async_update.py @@ -40,6 +40,7 @@ async def save(ack, view, update): This utility is a thin wrapper of workflows.stepFailed API method. Refer to https://api.slack.com/methods/workflows.updateStep for details. """ + def __init__(self, *, client: AsyncWebClient, body: dict): self.client = client self.body = body diff --git a/slack_bolt/workflows/step/utilities/complete.py b/slack_bolt/workflows/step/utilities/complete.py index 7517e2677..687debf58 100644 --- a/slack_bolt/workflows/step/utilities/complete.py +++ b/slack_bolt/workflows/step/utilities/complete.py @@ -24,6 +24,7 @@ def execute(step, complete, fail): This utility is a thin wrapper of workflows.stepCompleted API method. Refer to https://api.slack.com/methods/workflows.stepCompleted for details. """ + def __init__(self, *, client: WebClient, body: dict): self.client = client self.body = body diff --git a/slack_bolt/workflows/step/utilities/configure.py b/slack_bolt/workflows/step/utilities/configure.py index 2cb82f597..92f9f0a1b 100644 --- a/slack_bolt/workflows/step/utilities/configure.py +++ b/slack_bolt/workflows/step/utilities/configure.py @@ -34,6 +34,7 @@ def edit(ack, step, configure): Refer to https://api.slack.com/workflows/steps for details. """ + def __init__(self, *, callback_id: str, client: WebClient, body: dict): self.callback_id = callback_id self.client = client diff --git a/slack_bolt/workflows/step/utilities/fail.py b/slack_bolt/workflows/step/utilities/fail.py index 7a1d9d9fa..eedbbc57e 100644 --- a/slack_bolt/workflows/step/utilities/fail.py +++ b/slack_bolt/workflows/step/utilities/fail.py @@ -21,6 +21,7 @@ def execute(step, complete, fail): This utility is a thin wrapper of workflows.stepFailed API method. Refer to https://api.slack.com/methods/workflows.stepFailed for details. """ + def __init__(self, *, client: WebClient, body: dict): self.client = client self.body = body diff --git a/slack_bolt/workflows/step/utilities/update.py b/slack_bolt/workflows/step/utilities/update.py index e15eddb12..bfc81d9d3 100644 --- a/slack_bolt/workflows/step/utilities/update.py +++ b/slack_bolt/workflows/step/utilities/update.py @@ -40,6 +40,7 @@ def save(ack, view, update): This utility is a thin wrapper of workflows.stepFailed API method. Refer to https://api.slack.com/methods/workflows.updateStep for details. """ + def __init__(self, *, client: WebClient, body: dict): self.client = client self.body = body diff --git a/tests/adapter_tests/aws/test_aws_chalice.py b/tests/adapter_tests/aws/test_aws_chalice.py index 7b9daad7b..223f961ee 100644 --- a/tests/adapter_tests/aws/test_aws_chalice.py +++ b/tests/adapter_tests/aws/test_aws_chalice.py @@ -275,7 +275,7 @@ def test_lazy_listeners_cli(self): app = App( client=self.web_client, signing_secret=self.signing_secret, - process_before_response=True + process_before_response=True, ) def command_handler(ack): From 12ce26aae6a55e20461b4dbc580d28d04dc57a87 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 9 Apr 2021 13:30:14 +0900 Subject: [PATCH 158/719] Fix #267 Mention the necessity of lambda:InvokeFunction permission in lazy listener document --- docs/_advanced/lazy_listener.md | 22 ++++++++++++++++++- .../aws_lambda/lazy_aws_lambda_config.yaml | 3 ++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/docs/_advanced/lazy_listener.md b/docs/_advanced/lazy_listener.md index 84aa25952..9ae5f9f81 100644 --- a/docs/_advanced/lazy_listener.md +++ b/docs/_advanced/lazy_listener.md @@ -54,7 +54,8 @@ pip install slack_bolt # https://pypi.org/project/python-lambda/ pip install python-lambda -# Configure config.yml properly (AWSLambdaFullAccess required) +# Configure config.yml properly +# lambda:InvokeFunction & lambda:GetFunction are required for running lazy listeners export SLACK_SIGNING_SECRET=*** export SLACK_BOT_TOKEN=xoxb-*** echo 'slack_bolt' > requirements.txt @@ -90,4 +91,23 @@ def handler(event, context): slack_handler = SlackRequestHandler(app=app) return slack_handler.handle(event, context) ``` + +Please note that the followig IAM permissions would be required for running this example app. + +```json +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "VisualEditor0", + "Effect": "Allow", + "Action": [ + "lambda:InvokeFunction", + "lambda:GetFunction" + ], + "Resource": "*" + } + ] +} +```
    diff --git a/examples/aws_lambda/lazy_aws_lambda_config.yaml b/examples/aws_lambda/lazy_aws_lambda_config.yaml index abc1654da..a0e0c9abd 100644 --- a/examples/aws_lambda/lazy_aws_lambda_config.yaml +++ b/examples/aws_lambda/lazy_aws_lambda_config.yaml @@ -5,7 +5,8 @@ handler: lazy_aws_lambda.handler description: My first lambda function runtime: python3.8 # role: lambda_basic_execution -role: bolt_python_lambda_invocation # AWSLambdaFullAccess +# Have lambda:InvokeFunction & lambda:GetFunction in the allowed actions +role: bolt_python_lambda_invocation # S3 upload requires appropriate role with s3:PutObject permission # (ex. basic_s3_upload), a destination bucket, and the key prefix From ea73760e6dfa7b980e49f0584c1c46a333c9c41f Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 2 Apr 2021 17:35:57 +0900 Subject: [PATCH 159/719] Fix #280 Django thread-local connection cleanup in multi threads --- examples/django/.gitignore | 3 +- examples/django/mysql-docker-compose.yml | 16 ++++ .../slackapp/migrations/0001_initial.py | 34 +++---- examples/django/slackapp/models.py | 67 +++++++++----- examples/django/slackapp/settings.py | 25 ++++-- slack_bolt/adapter/django/handler.py | 90 ++++++++++++++++++- slack_bolt/app/app.py | 11 +++ slack_bolt/app/async_app.py | 11 +++ slack_bolt/listener/async_internals.py | 59 ++++++++++++ .../async_listener_completion_handler.py | 67 ++++++++++++++ .../listener/async_listener_error_handler.py | 72 ++++----------- slack_bolt/listener/asyncio_runner.py | 14 +++ slack_bolt/listener/internals.py | 76 ++++++++++++++++ .../listener/listener_completion_handler.py | 63 +++++++++++++ slack_bolt/listener/listener_error_handler.py | 70 ++++----------- slack_bolt/listener/thread_runner.py | 14 +++ tests/adapter_tests/django/test_django.py | 82 +++++++++++++++++ 17 files changed, 620 insertions(+), 154 deletions(-) create mode 100644 examples/django/mysql-docker-compose.yml create mode 100644 slack_bolt/listener/async_internals.py create mode 100644 slack_bolt/listener/async_listener_completion_handler.py create mode 100644 slack_bolt/listener/internals.py create mode 100644 slack_bolt/listener/listener_completion_handler.py diff --git a/examples/django/.gitignore b/examples/django/.gitignore index ba520ccd8..68712b32b 100644 --- a/examples/django/.gitignore +++ b/examples/django/.gitignore @@ -1 +1,2 @@ -db.sqlite3 \ No newline at end of file +db.sqlite3 +db/ diff --git a/examples/django/mysql-docker-compose.yml b/examples/django/mysql-docker-compose.yml new file mode 100644 index 000000000..e1f543f56 --- /dev/null +++ b/examples/django/mysql-docker-compose.yml @@ -0,0 +1,16 @@ +version: '3.9' +services: + db: + image: mysql:8 + environment: + MYSQL_DATABASE: slackapp + MYSQL_USER: app + MYSQL_PASSWORD: password + MYSQL_ROOT_PASSWORD: password + #command: + # - '--wait_timeout=3' + volumes: + - './db:/var/lib/mysql' + ports: + - 33306:3306 + diff --git a/examples/django/slackapp/migrations/0001_initial.py b/examples/django/slackapp/migrations/0001_initial.py index a2bcb49ef..ebc013537 100644 --- a/examples/django/slackapp/migrations/0001_initial.py +++ b/examples/django/slackapp/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 3.1.4 on 2020-12-04 13:07 +# Generated by Django 3.1.7 on 2021-04-02 05:53 from django.db import migrations, models @@ -22,15 +22,15 @@ class Migration(migrations.Migration): verbose_name="ID", ), ), - ("client_id", models.TextField()), - ("app_id", models.TextField()), - ("enterprise_id", models.TextField(null=True)), + ("client_id", models.CharField(max_length=32)), + ("app_id", models.CharField(max_length=32)), + ("enterprise_id", models.CharField(max_length=32, null=True)), ("enterprise_name", models.TextField(null=True)), - ("team_id", models.TextField(null=True)), + ("team_id", models.CharField(max_length=32, null=True)), ("team_name", models.TextField(null=True)), ("bot_token", models.TextField(null=True)), - ("bot_id", models.TextField(null=True)), - ("bot_user_id", models.TextField(null=True)), + ("bot_id", models.CharField(max_length=32, null=True)), + ("bot_user_id", models.CharField(max_length=32, null=True)), ("bot_scopes", models.TextField(null=True)), ("is_enterprise_install", models.BooleanField(null=True)), ("installed_at", models.DateTimeField()), @@ -48,18 +48,18 @@ class Migration(migrations.Migration): verbose_name="ID", ), ), - ("client_id", models.TextField()), - ("app_id", models.TextField()), - ("enterprise_id", models.TextField(null=True)), + ("client_id", models.CharField(max_length=32)), + ("app_id", models.CharField(max_length=32)), + ("enterprise_id", models.CharField(max_length=32, null=True)), ("enterprise_name", models.TextField(null=True)), ("enterprise_url", models.TextField(null=True)), - ("team_id", models.TextField(null=True)), + ("team_id", models.CharField(max_length=32, null=True)), ("team_name", models.TextField(null=True)), ("bot_token", models.TextField(null=True)), - ("bot_id", models.TextField(null=True)), + ("bot_id", models.CharField(max_length=32, null=True)), ("bot_user_id", models.TextField(null=True)), ("bot_scopes", models.TextField(null=True)), - ("user_id", models.TextField()), + ("user_id", models.CharField(max_length=32)), ("user_token", models.TextField(null=True)), ("user_scopes", models.TextField(null=True)), ("incoming_webhook_url", models.TextField(null=True)), @@ -67,7 +67,7 @@ class Migration(migrations.Migration): ("incoming_webhook_channel_id", models.TextField(null=True)), ("incoming_webhook_configuration_url", models.TextField(null=True)), ("is_enterprise_install", models.BooleanField(null=True)), - ("token_type", models.TextField(null=True)), + ("token_type", models.CharField(max_length=32, null=True)), ("installed_at", models.DateTimeField()), ], ), @@ -83,7 +83,7 @@ class Migration(migrations.Migration): verbose_name="ID", ), ), - ("state", models.TextField()), + ("state", models.CharField(max_length=64)), ("expire_at", models.DateTimeField()), ], ), @@ -97,14 +97,14 @@ class Migration(migrations.Migration): "user_id", "installed_at", ], - name="bolt_slacki_client__62c411_idx", + name="slackapp_sl_client__9b0d3f_idx", ), ), migrations.AddIndex( model_name="slackbot", index=models.Index( fields=["client_id", "enterprise_id", "team_id", "installed_at"], - name="bolt_slackb_client__be066b_idx", + name="slackapp_sl_client__d220d6_idx", ), ), ] diff --git a/examples/django/slackapp/models.py b/examples/django/slackapp/models.py index 737c4bd90..cfbbd8ade 100644 --- a/examples/django/slackapp/models.py +++ b/examples/django/slackapp/models.py @@ -6,15 +6,15 @@ class SlackBot(models.Model): - client_id = models.TextField(null=False) - app_id = models.TextField(null=False) - enterprise_id = models.TextField(null=True) + client_id = models.CharField(null=False, max_length=32) + app_id = models.CharField(null=False, max_length=32) + enterprise_id = models.CharField(null=True, max_length=32) enterprise_name = models.TextField(null=True) - team_id = models.TextField(null=True) + team_id = models.CharField(null=True, max_length=32) team_name = models.TextField(null=True) bot_token = models.TextField(null=True) - bot_id = models.TextField(null=True) - bot_user_id = models.TextField(null=True) + bot_id = models.CharField(null=True, max_length=32) + bot_user_id = models.CharField(null=True, max_length=32) bot_scopes = models.TextField(null=True) is_enterprise_install = models.BooleanField(null=True) installed_at = models.DateTimeField(null=False) @@ -28,18 +28,18 @@ class Meta: class SlackInstallation(models.Model): - client_id = models.TextField(null=False) - app_id = models.TextField(null=False) - enterprise_id = models.TextField(null=True) + client_id = models.CharField(null=False, max_length=32) + app_id = models.CharField(null=False, max_length=32) + enterprise_id = models.CharField(null=True, max_length=32) enterprise_name = models.TextField(null=True) enterprise_url = models.TextField(null=True) - team_id = models.TextField(null=True) + team_id = models.CharField(null=True, max_length=32) team_name = models.TextField(null=True) bot_token = models.TextField(null=True) - bot_id = models.TextField(null=True) + bot_id = models.CharField(null=True, max_length=32) bot_user_id = models.TextField(null=True) bot_scopes = models.TextField(null=True) - user_id = models.TextField(null=False) + user_id = models.CharField(null=False, max_length=32) user_token = models.TextField(null=True) user_scopes = models.TextField(null=True) incoming_webhook_url = models.TextField(null=True) @@ -47,7 +47,7 @@ class SlackInstallation(models.Model): incoming_webhook_channel_id = models.TextField(null=True) incoming_webhook_configuration_url = models.TextField(null=True) is_enterprise_install = models.BooleanField(null=True) - token_type = models.TextField(null=True) + token_type = models.CharField(null=True, max_length=32) installed_at = models.DateTimeField(null=False) class Meta: @@ -65,7 +65,7 @@ class Meta: class SlackOAuthState(models.Model): - state = models.TextField(null=False) + state = models.CharField(null=False, max_length=64) expire_at = models.DateTimeField(null=False) @@ -81,6 +81,7 @@ class SlackOAuthState(models.Model): from django.utils import timezone from slack_sdk.oauth import InstallationStore, OAuthStateStore from slack_sdk.oauth.installation_store import Bot, Installation +from slack_sdk.webhook import WebhookClient class DjangoInstallationStore(InstallationStore): @@ -100,9 +101,13 @@ def logger(self) -> Logger: def save(self, installation: Installation): i = installation.to_dict() + if is_naive(i["installed_at"]): + i["installed_at"] = make_aware(i["installed_at"]) i["client_id"] = self.client_id SlackInstallation(**i).save() b = installation.to_bot().to_dict() + if is_naive(b["installed_at"]): + b["installed_at"] = make_aware(b["installed_at"]) b["client_id"] = self.client_id SlackBot(**b).save() @@ -222,7 +227,7 @@ def consume(self, state: str) -> bool: import logging import os -from slack_bolt import App +from slack_bolt import App, BoltContext from slack_bolt.oauth.oauth_settings import OAuthSettings logger = logging.getLogger(__name__) @@ -249,12 +254,34 @@ def consume(self, state: str) -> bool: ) -@app.event("app_mention") -def event_test(body, say, logger): +def event_test(body, say, context: BoltContext, logger): logger.info(body) - say("What's up?") + say(":wave: What's up?") + + found_rows = list( + SlackInstallation.objects.filter(enterprise_id=context.enterprise_id) + .filter(team_id=context.team_id) + .filter(incoming_webhook_url__isnull=False) + .order_by(F("installed_at").desc())[:1] + ) + if len(found_rows) > 0: + webhook_url = found_rows[0].incoming_webhook_url + logger.info(f"webhook_url: {webhook_url}") + client = WebhookClient(webhook_url) + client.send(text=":wave: This is a message posted using Incoming Webhook!") + + +# lazy listener example +def noop(): + pass + + +app.event("app_mention")( + ack=event_test, + lazy=[noop], +) -@app.command("/hello-bolt-python") +@app.command("/hello-django-app") def command(ack): - ack("This is a Django app!") + ack(":wave: Hello from a Django app :smile:") diff --git a/examples/django/slackapp/settings.py b/examples/django/slackapp/settings.py index 1553e7df3..56bdc50e9 100644 --- a/examples/django/slackapp/settings.py +++ b/examples/django/slackapp/settings.py @@ -22,7 +22,7 @@ }, "root": { "handlers": ["console"], - "level": "INFO", + "level": "DEBUG", }, "loggers": { "django": { @@ -30,7 +30,7 @@ "level": os.getenv("DJANGO_LOG_LEVEL", "INFO"), "propagate": False, }, - "django.db.backends": { + "django.db": { "level": "DEBUG", }, "slack_bolt": { @@ -105,10 +105,25 @@ # https://docs.djangoproject.com/en/3.0/ref/settings/#databases DATABASES = { + # python manage.py migrate + # python manage.py runserver 0.0.0.0:3000 + # "default": { + # "ENGINE": "django.db.backends.sqlite3", + # "NAME": os.path.join(BASE_DIR, "db.sqlite3"), + # }, + + # docker-compose -f mysql-docker-compose.yml up --build + # pip install mysqlclient + # python manage.py migrate + # python manage.py runserver 0.0.0.0:3000 "default": { - "ENGINE": "django.db.backends.sqlite3", - "NAME": os.path.join(BASE_DIR, "db.sqlite3"), - } + "ENGINE": "django.db.backends.mysql", + "NAME": "slackapp", + "USER": "app", + "PASSWORD": "password", + "HOST": "127.0.0.1", + "PORT": 33306, + }, } # Password validation diff --git a/slack_bolt/adapter/django/handler.py b/slack_bolt/adapter/django/handler.py index 24eb91b0e..2862a380b 100644 --- a/slack_bolt/adapter/django/handler.py +++ b/slack_bolt/adapter/django/handler.py @@ -1,8 +1,19 @@ -from typing import Optional +import logging +from logging import Logger +from threading import current_thread, Thread +from typing import Optional, Callable from django.http import HttpRequest, HttpResponse from slack_bolt.app import App +from slack_bolt.error import BoltError +from slack_bolt.lazy_listener import ThreadLazyListenerRunner +from slack_bolt.lazy_listener.internals import build_runnable_function +from slack_bolt.listener.listener_completion_handler import ( + ListenerCompletionHandler, + DefaultListenerCompletionHandler, +) +from slack_bolt.listener.thread_runner import ThreadListenerRunner from slack_bolt.oauth import OAuthFlow from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse @@ -43,9 +54,86 @@ def to_django_response(bolt_resp: BoltResponse) -> HttpResponse: return resp +from django.db import connections + + +def release_thread_local_connections(logger: Logger, execution_type: str): + connections.close_all() + if logger.level <= logging.DEBUG: + current: Thread = current_thread() + logger.debug( + f"Released thread-bound DB connections (thread name: {current.name}, execution type: {execution_type})" + ) + + +class DjangoListenerCompletionHandler(ListenerCompletionHandler): + """Django sets DB connections as a thread-local variable per thread. + If the thread is not managed on the Django app side, the connections won't be released by Django. + This handler releases the connections every time a ThreadListenerRunner execution completes. + """ + + def handle(self, request: BoltRequest, response: Optional[BoltResponse]) -> None: + release_thread_local_connections(request.context.logger, "listener") + + +class DjangoThreadLazyListenerRunner(ThreadLazyListenerRunner): + def start(self, function: Callable[..., None], request: BoltRequest) -> None: + func: Callable[[], None] = build_runnable_function( + func=function, + logger=self.logger, + request=request, + ) + + def wrapped_func(): + try: + func() + finally: + release_thread_local_connections( + request.context.logger, "lazy-listener" + ) + + self.executor.submit(wrapped_func) + + class SlackRequestHandler: def __init__(self, app: App): # type: ignore self.app = app + listener_runner = self.app.listener_runner + # This runner closes all thread-local connections in the thread when an execution completes + self.app.listener_runner.lazy_listener_runner = DjangoThreadLazyListenerRunner( + logger=listener_runner.logger, + executor=listener_runner.listener_executor, + ) + + if not isinstance(listener_runner, ThreadListenerRunner): + raise BoltError( + "Custom listener_runners are not compatible with this Django adapter." + ) + + if app.process_before_response is True: + # As long as the app access Django models in the same thread, + # Django cleans the connections up for you. + self.app.logger.debug("App.process_before_response is set to True") + return + + current_completion_handler = listener_runner.listener_completion_handler + if current_completion_handler is not None and not isinstance( + current_completion_handler, DefaultListenerCompletionHandler + ): + message = """As you've already set app.listener_runner.listener_completion_handler to your own one, + Bolt skipped to set it to slack_sdk.adapter.django.DjangoListenerCompletionHandler. + We strongly recommend having the following lines of code in your listener_completion_handler: + + from django.db import connections + connections.close_all() + """ + self.app.logger.warning(message) + return + # for proper management of thread-local Django DB connections + self.app.listener_runner.listener_completion_handler = ( + DjangoListenerCompletionHandler() + ) + self.app.logger.debug("DjangoListenerCompletionHandler has been enabled") def handle(self, req: HttpRequest) -> HttpResponse: if req.method == "GET": diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index b0ce87d7c..1abc01a03 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -21,6 +21,9 @@ from slack_bolt.lazy_listener.thread_runner import ThreadLazyListenerRunner from slack_bolt.listener.custom_listener import CustomListener from slack_bolt.listener.listener import Listener +from slack_bolt.listener.listener_completion_handler import ( + DefaultListenerCompletionHandler, +) from slack_bolt.listener.listener_error_handler import ( DefaultListenerErrorHandler, CustomListenerErrorHandler, @@ -255,12 +258,16 @@ def message_hello(message, say): self._listeners: List[Listener] = [] listener_executor = ThreadPoolExecutor(max_workers=5) + self._process_before_response = process_before_response self._listener_runner = ThreadListenerRunner( logger=self._framework_logger, process_before_response=process_before_response, listener_error_handler=DefaultListenerErrorHandler( logger=self._framework_logger ), + listener_completion_handler=DefaultListenerCompletionHandler( + logger=self._framework_logger + ), listener_executor=listener_executor, lazy_listener_runner=ThreadLazyListenerRunner( logger=self._framework_logger, @@ -339,6 +346,10 @@ def listener_runner(self) -> ThreadListenerRunner: """The thread executor for asynchronously running listeners.""" return self._listener_runner + @property + def process_before_response(self) -> bool: + return self._process_before_response or False + # ------------------------- # standalone server diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 97ee2f9d5..cf4385701 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -7,6 +7,9 @@ from aiohttp import web from slack_bolt.app.async_server import AsyncSlackAppServer +from slack_bolt.listener.async_listener_completion_handler import ( + AsyncDefaultListenerCompletionHandler, +) from slack_bolt.listener.asyncio_runner import AsyncioListenerRunner from slack_bolt.middleware.message_listener_matches.async_message_listener_matches import ( AsyncMessageListenerMatches, @@ -279,12 +282,16 @@ async def message_hello(message, say): # async function self._async_middleware_list: List[Union[Callable, AsyncMiddleware]] = [] self._async_listeners: List[AsyncListener] = [] + self._process_before_response = process_before_response self._async_listener_runner = AsyncioListenerRunner( logger=self._framework_logger, process_before_response=process_before_response, listener_error_handler=AsyncDefaultListenerErrorHandler( logger=self._framework_logger ), + listener_completion_handler=AsyncDefaultListenerCompletionHandler( + logger=self._framework_logger + ), lazy_listener_runner=AsyncioLazyListenerRunner( logger=self._framework_logger, ), @@ -355,6 +362,10 @@ def listener_runner(self) -> AsyncioListenerRunner: """The asyncio-based executor for asynchronously running listeners.""" return self._async_listener_runner + @property + def process_before_response(self) -> bool: + return self._process_before_response or False + # ------------------------- # standalone server diff --git a/slack_bolt/listener/async_internals.py b/slack_bolt/listener/async_internals.py new file mode 100644 index 000000000..6a8fc8ab1 --- /dev/null +++ b/slack_bolt/listener/async_internals.py @@ -0,0 +1,59 @@ +from logging import Logger +from typing import Dict, Any, Optional + +from slack_bolt.request.async_request import AsyncBoltRequest +from slack_bolt.request.payload_utils import ( + to_options, + to_shortcut, + to_action, + to_view, + to_command, + to_event, + to_message, + to_step, +) +from slack_bolt.response import BoltResponse + + +def _build_all_available_args( + logger: Logger, + request: AsyncBoltRequest, + response: Optional[BoltResponse], + error: Optional[Exception] = None, +) -> Dict[str, Any]: + all_available_args = { + "logger": logger, + "error": error, + "client": request.context.client, + "req": request, + "request": request, + "resp": response, + "response": response, + "context": request.context, + "body": request.body, + # payload + "body": request.body, + "options": to_options(request.body), + "shortcut": to_shortcut(request.body), + "action": to_action(request.body), + "view": to_view(request.body), + "command": to_command(request.body), + "event": to_event(request.body), + "message": to_message(request.body), + "step": to_step(request.body), + # utilities + "say": request.context.say, + "respond": request.context.respond, + } + all_available_args["payload"] = ( + all_available_args["options"] + or all_available_args["shortcut"] + or all_available_args["action"] + or all_available_args["view"] + or all_available_args["command"] + or all_available_args["event"] + or all_available_args["message"] + or all_available_args["step"] + or request.body + ) + return all_available_args diff --git a/slack_bolt/listener/async_listener_completion_handler.py b/slack_bolt/listener/async_listener_completion_handler.py new file mode 100644 index 000000000..e14a58a5d --- /dev/null +++ b/slack_bolt/listener/async_listener_completion_handler.py @@ -0,0 +1,67 @@ +import inspect +from abc import ABCMeta, abstractmethod +from logging import Logger +from typing import Callable, Dict, Any, Awaitable, Optional + +from slack_bolt.listener.async_internals import ( + _build_all_available_args, +) +from slack_bolt.listener.internals import ( + _convert_all_available_args_to_kwargs, +) + +from slack_bolt.request.async_request import AsyncBoltRequest +from slack_bolt.response import BoltResponse + + +class AsyncListenerCompletionHandler(metaclass=ABCMeta): + @abstractmethod + async def handle( + self, + request: AsyncBoltRequest, + response: Optional[BoltResponse], + ) -> None: + """Handles an unhandled exception. + + Args: + error: The raised exception. + request: The request. + response: The response. + """ + raise NotImplementedError() + + +class AsyncCustomListenerCompletionHandler(AsyncListenerCompletionHandler): + def __init__(self, logger: Logger, func: Callable[..., Awaitable[None]]): + self.func = func + self.logger = logger + self.arg_names = inspect.getfullargspec(func).args + + async def handle( + self, + request: AsyncBoltRequest, + response: Optional[BoltResponse], + ) -> None: + all_available_args = _build_all_available_args( + logger=self.logger, + request=request, + response=response, + ) + kwargs: Dict[str, Any] = _convert_all_available_args_to_kwargs( + all_available_args=all_available_args, + arg_names=self.arg_names, + logger=self.logger, + ) + await self.func(**kwargs) + + +class AsyncDefaultListenerCompletionHandler(AsyncListenerCompletionHandler): + def __init__(self, logger: Logger): + self.logger = logger + + async def handle( + self, + request: AsyncBoltRequest, + response: Optional[BoltResponse], + ): + pass diff --git a/slack_bolt/listener/async_listener_error_handler.py b/slack_bolt/listener/async_listener_error_handler.py index c4e55e7d9..3aa0360d8 100644 --- a/slack_bolt/listener/async_listener_error_handler.py +++ b/slack_bolt/listener/async_listener_error_handler.py @@ -3,20 +3,16 @@ from logging import Logger from typing import Callable, Dict, Any, Awaitable, Optional +from slack_bolt.listener.async_internals import ( + _build_all_available_args, +) +from slack_bolt.listener.internals import ( + _convert_all_available_args_to_kwargs, +) + from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse -from slack_bolt.request.payload_utils import ( - to_options, - to_shortcut, - to_action, - to_view, - to_command, - to_event, - to_message, - to_step, -) - class AsyncListenerErrorHandler(metaclass=ABCMeta): @abstractmethod @@ -48,51 +44,17 @@ async def handle( request: AsyncBoltRequest, response: Optional[BoltResponse], ) -> None: - all_available_args = { - "logger": self.logger, - "error": error, - "client": request.context.client, - "req": request, - "request": request, - "resp": response, - "response": response, - "context": request.context, - "body": request.body, - # payload - "body": request.body, - "options": to_options(request.body), - "shortcut": to_shortcut(request.body), - "action": to_action(request.body), - "view": to_view(request.body), - "command": to_command(request.body), - "event": to_event(request.body), - "message": to_message(request.body), - "step": to_step(request.body), - # utilities - "say": request.context.say, - "respond": request.context.respond, - } - all_available_args["payload"] = ( - all_available_args["options"] - or all_available_args["shortcut"] - or all_available_args["action"] - or all_available_args["view"] - or all_available_args["command"] - or all_available_args["event"] - or all_available_args["message"] - or all_available_args["step"] - or request.body + all_available_args = _build_all_available_args( + logger=self.logger, + error=error, + request=request, + response=response, + ) + kwargs: Dict[str, Any] = _convert_all_available_args_to_kwargs( + all_available_args=all_available_args, + arg_names=self.arg_names, + logger=self.logger, ) - - kwargs: Dict[str, Any] = { # type: ignore - k: v for k, v in all_available_args.items() if k in self.arg_names # type: ignore - } - found_arg_names = kwargs.keys() - for name in self.arg_names: - if name not in found_arg_names: - self.logger.warning(f"{name} is not a valid argument") - kwargs[name] = None - await self.func(**kwargs) diff --git a/slack_bolt/listener/asyncio_runner.py b/slack_bolt/listener/asyncio_runner.py index 8ebcbde45..37a532f3c 100644 --- a/slack_bolt/listener/asyncio_runner.py +++ b/slack_bolt/listener/asyncio_runner.py @@ -7,6 +7,9 @@ from slack_bolt.context.ack.async_ack import AsyncAck from slack_bolt.lazy_listener.async_runner import AsyncLazyListenerRunner from slack_bolt.listener.async_listener import AsyncListener +from slack_bolt.listener.async_listener_completion_handler import ( + AsyncListenerCompletionHandler, +) from slack_bolt.listener.async_listener_error_handler import AsyncListenerErrorHandler from slack_bolt.logger.messages import ( debug_responding, @@ -22,6 +25,7 @@ class AsyncioListenerRunner: logger: Logger process_before_response: bool listener_error_handler: AsyncListenerErrorHandler + listener_completion_handler: AsyncListenerCompletionHandler lazy_listener_runner: AsyncLazyListenerRunner def __init__( @@ -29,11 +33,13 @@ def __init__( logger: Logger, process_before_response: bool, listener_error_handler: AsyncListenerErrorHandler, + listener_completion_handler: AsyncListenerCompletionHandler, lazy_listener_runner: AsyncLazyListenerRunner, ): self.logger = logger self.process_before_response = process_before_response self.listener_error_handler = listener_error_handler + self.listener_completion_handler = listener_completion_handler self.lazy_listener_runner = lazy_listener_runner async def run( @@ -68,6 +74,10 @@ async def run( response=response, ) ack.response = response + finally: + await self.listener_completion_handler.handle( + request=request, response=response + ) for lazy_func in listener.lazy_functions: if request.lazy_function_name: @@ -121,6 +131,10 @@ async def run_ack_function_asynchronously( response=response, ) ack.response = response + finally: + await self.listener_completion_handler.handle( + request=request, response=response + ) _f: Future = asyncio.ensure_future( run_ack_function_asynchronously(ack, request, response) diff --git a/slack_bolt/listener/internals.py b/slack_bolt/listener/internals.py new file mode 100644 index 000000000..9c1ac3a31 --- /dev/null +++ b/slack_bolt/listener/internals.py @@ -0,0 +1,76 @@ +from logging import Logger +from typing import Optional, Dict, Any, List + +from slack_bolt.request.request import BoltRequest +from slack_bolt.response.response import BoltResponse + +from slack_bolt.request.payload_utils import ( + to_options, + to_shortcut, + to_action, + to_view, + to_command, + to_event, + to_message, + to_step, +) + + +def _build_all_available_args( + logger: Logger, + request: BoltRequest, + response: Optional[BoltResponse], + error: Optional[Exception] = None, +) -> Dict[str, Any]: + all_available_args = { + "logger": logger, + "error": error, + "client": request.context.client, + "req": request, + "request": request, + "resp": response, + "response": response, + "context": request.context, + "body": request.body, + # payload + "body": request.body, + "options": to_options(request.body), + "shortcut": to_shortcut(request.body), + "action": to_action(request.body), + "view": to_view(request.body), + "command": to_command(request.body), + "event": to_event(request.body), + "message": to_message(request.body), + "step": to_step(request.body), + # utilities + "say": request.context.say, + "respond": request.context.respond, + } + all_available_args["payload"] = ( + all_available_args["options"] + or all_available_args["shortcut"] + or all_available_args["action"] + or all_available_args["view"] + or all_available_args["command"] + or all_available_args["event"] + or all_available_args["message"] + or all_available_args["step"] + or request.body + ) + return all_available_args + + +def _convert_all_available_args_to_kwargs( + all_available_args: Dict[str, Any], + arg_names: List[str], + logger: Logger, +) -> Dict[str, Any]: + kwargs: Dict[str, Any] = { # type: ignore + k: v for k, v in all_available_args.items() if k in arg_names # type: ignore + } + found_arg_names = kwargs.keys() + for name in arg_names: + if name not in found_arg_names: + logger.warning(f"{name} is not a valid argument") + kwargs[name] = None + return kwargs diff --git a/slack_bolt/listener/listener_completion_handler.py b/slack_bolt/listener/listener_completion_handler.py new file mode 100644 index 000000000..2419bc56e --- /dev/null +++ b/slack_bolt/listener/listener_completion_handler.py @@ -0,0 +1,63 @@ +import inspect +from abc import ABCMeta, abstractmethod +from logging import Logger +from typing import Callable, Dict, Any, Optional + +from slack_bolt.listener.internals import ( + _build_all_available_args, + _convert_all_available_args_to_kwargs, +) +from slack_bolt.request.request import BoltRequest +from slack_bolt.response.response import BoltResponse + + +class ListenerCompletionHandler(metaclass=ABCMeta): + @abstractmethod + def handle( + self, + request: BoltRequest, + response: Optional[BoltResponse], + ) -> None: + """Handles an unhandled exception. + + Args: + request: The request. + response: The response. + """ + raise NotImplementedError() + + +class CustomListenerCompletionHandler(ListenerCompletionHandler): + def __init__(self, logger: Logger, func: Callable[..., None]): + self.func = func + self.logger = logger + self.arg_names = inspect.getfullargspec(func).args + + def handle( + self, + request: BoltRequest, + response: Optional[BoltResponse], + ): + all_available_args = _build_all_available_args( + logger=self.logger, + request=request, + response=response, + ) + kwargs: Dict[str, Any] = _convert_all_available_args_to_kwargs( + all_available_args=all_available_args, + arg_names=self.arg_names, + logger=self.logger, + ) + self.func(**kwargs) + + +class DefaultListenerCompletionHandler(ListenerCompletionHandler): + def __init__(self, logger: Logger): + self.logger = logger + + def handle( + self, + request: BoltRequest, + response: Optional[BoltResponse], + ): + pass diff --git a/slack_bolt/listener/listener_error_handler.py b/slack_bolt/listener/listener_error_handler.py index d4cbd98b0..fe5c9b173 100644 --- a/slack_bolt/listener/listener_error_handler.py +++ b/slack_bolt/listener/listener_error_handler.py @@ -3,20 +3,14 @@ from logging import Logger from typing import Callable, Dict, Any, Optional +from slack_bolt.listener.internals import ( + _build_all_available_args, + _convert_all_available_args_to_kwargs, +) + from slack_bolt.request.request import BoltRequest from slack_bolt.response.response import BoltResponse -from slack_bolt.request.payload_utils import ( - to_options, - to_shortcut, - to_action, - to_view, - to_command, - to_event, - to_message, - to_step, -) - class ListenerErrorHandler(metaclass=ABCMeta): @abstractmethod @@ -48,51 +42,17 @@ def handle( request: BoltRequest, response: Optional[BoltResponse], ): - all_available_args = { - "logger": self.logger, - "error": error, - "client": request.context.client, - "req": request, - "request": request, - "resp": response, - "response": response, - "context": request.context, - "body": request.body, - # payload - "body": request.body, - "options": to_options(request.body), - "shortcut": to_shortcut(request.body), - "action": to_action(request.body), - "view": to_view(request.body), - "command": to_command(request.body), - "event": to_event(request.body), - "message": to_message(request.body), - "step": to_step(request.body), - # utilities - "say": request.context.say, - "respond": request.context.respond, - } - all_available_args["payload"] = ( - all_available_args["options"] - or all_available_args["shortcut"] - or all_available_args["action"] - or all_available_args["view"] - or all_available_args["command"] - or all_available_args["event"] - or all_available_args["message"] - or all_available_args["step"] - or request.body + all_available_args = _build_all_available_args( + logger=self.logger, + error=error, + request=request, + response=response, + ) + kwargs: Dict[str, Any] = _convert_all_available_args_to_kwargs( + all_available_args=all_available_args, + arg_names=self.arg_names, + logger=self.logger, ) - - kwargs: Dict[str, Any] = { # type: ignore - k: v for k, v in all_available_args.items() if k in self.arg_names # type: ignore - } - found_arg_names = kwargs.keys() - for name in self.arg_names: - if name not in found_arg_names: - self.logger.warning(f"{name} is not a valid argument") - kwargs[name] = None - self.func(**kwargs) diff --git a/slack_bolt/listener/thread_runner.py b/slack_bolt/listener/thread_runner.py index 8a02320e4..74d20dd98 100644 --- a/slack_bolt/listener/thread_runner.py +++ b/slack_bolt/listener/thread_runner.py @@ -5,6 +5,7 @@ from slack_bolt.lazy_listener import LazyListenerRunner from slack_bolt.listener import Listener +from slack_bolt.listener.listener_completion_handler import ListenerCompletionHandler from slack_bolt.listener.listener_error_handler import ListenerErrorHandler from slack_bolt.logger.messages import ( debug_responding, @@ -20,6 +21,7 @@ class ThreadListenerRunner: logger: Logger process_before_response: bool listener_error_handler: ListenerErrorHandler + listener_completion_handler: ListenerCompletionHandler listener_executor: ThreadPoolExecutor lazy_listener_runner: LazyListenerRunner @@ -28,12 +30,14 @@ def __init__( logger: Logger, process_before_response: bool, listener_error_handler: ListenerErrorHandler, + listener_completion_handler: ListenerCompletionHandler, listener_executor: ThreadPoolExecutor, lazy_listener_runner: LazyListenerRunner, ): self.logger = logger self.process_before_response = process_before_response self.listener_error_handler = listener_error_handler + self.listener_completion_handler = listener_completion_handler self.listener_executor = listener_executor self.lazy_listener_runner = lazy_listener_runner @@ -69,6 +73,11 @@ def run( # type: ignore response=response, ) ack.response = response + finally: + self.listener_completion_handler.handle( + request=request, + response=response, + ) for lazy_func in listener.lazy_functions: if request.lazy_function_name: @@ -122,6 +131,11 @@ def run_ack_function_asynchronously(): response=response, ) ack.response = response + finally: + self.listener_completion_handler.handle( + request=request, + response=response, + ) self.listener_executor.submit(run_ack_function_asynchronously) diff --git a/tests/adapter_tests/django/test_django.py b/tests/adapter_tests/django/test_django.py index f387427a9..036ab5608 100644 --- a/tests/adapter_tests/django/test_django.py +++ b/tests/adapter_tests/django/test_django.py @@ -174,6 +174,88 @@ def command_handler(ack): assert response.status_code == 200 assert_auth_test_count(self, 1) + def test_commands_process_before_response(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + process_before_response=True, + ) + + def command_handler(ack): + ack() + + app.command("/hello-world")(command_handler) + + input = ( + "token=verification_token" + "&team_id=T111" + "&team_domain=test-domain" + "&channel_id=C111" + "&channel_name=random" + "&user_id=W111" + "&user_name=primary-owner" + "&command=%2Fhello-world" + "&text=Hi" + "&enterprise_id=E111" + "&enterprise_name=Org+Name" + "&response_url=https%3A%2F%2Fhooks.slack.com%2Fcommands%2FT111%2F111%2Fxxxxx" + "&trigger_id=111.111.xxx" + ) + timestamp, body = str(int(time())), input + + request = self.rf.post( + "/slack/events", + data=body, + content_type="application/x-www-form-urlencoded", + ) + request.headers = self.build_headers(timestamp, body) + + response = SlackRequestHandler(app).handle(request) + assert response.status_code == 200 + assert_auth_test_count(self, 1) + + def test_commands_lazy(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + def command_handler(ack): + ack() + + def lazy_handler(): + pass + + app.command("/hello-world")(ack=command_handler, lazy=[lazy_handler]) + + input = ( + "token=verification_token" + "&team_id=T111" + "&team_domain=test-domain" + "&channel_id=C111" + "&channel_name=random" + "&user_id=W111" + "&user_name=primary-owner" + "&command=%2Fhello-world" + "&text=Hi" + "&enterprise_id=E111" + "&enterprise_name=Org+Name" + "&response_url=https%3A%2F%2Fhooks.slack.com%2Fcommands%2FT111%2F111%2Fxxxxx" + "&trigger_id=111.111.xxx" + ) + timestamp, body = str(int(time())), input + + request = self.rf.post( + "/slack/events", + data=body, + content_type="application/x-www-form-urlencoded", + ) + request.headers = self.build_headers(timestamp, body) + + response = SlackRequestHandler(app).handle(request) + assert response.status_code == 200 + assert_auth_test_count(self, 1) + def test_oauth(self): app = App( client=self.web_client, From b3b55df9cdb8f2acaeb4d3b379903a949a411178 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 10 Apr 2021 08:17:28 +0900 Subject: [PATCH 160/719] Apply suggestions from code review Co-authored-by: Michael Brooks --- slack_bolt/listener/async_internals.py | 1 - slack_bolt/listener/internals.py | 1 - 2 files changed, 2 deletions(-) diff --git a/slack_bolt/listener/async_internals.py b/slack_bolt/listener/async_internals.py index 6a8fc8ab1..60347bfb6 100644 --- a/slack_bolt/listener/async_internals.py +++ b/slack_bolt/listener/async_internals.py @@ -30,7 +30,6 @@ def _build_all_available_args( "resp": response, "response": response, "context": request.context, - "body": request.body, # payload "body": request.body, "options": to_options(request.body), diff --git a/slack_bolt/listener/internals.py b/slack_bolt/listener/internals.py index 9c1ac3a31..9b0682c1d 100644 --- a/slack_bolt/listener/internals.py +++ b/slack_bolt/listener/internals.py @@ -31,7 +31,6 @@ def _build_all_available_args( "resp": response, "response": response, "context": request.context, - "body": request.body, # payload "body": request.body, "options": to_options(request.body), From b594174dfb3b1ea91a6927c34556a5a8f57aefc8 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 10 Apr 2021 10:29:06 +0900 Subject: [PATCH 161/719] Upgrade slack-sdk to 3.5.0rc1 --- setup.py | 2 +- slack_bolt/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index cdb5bcd01..b4d1e966c 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.4.2,<4",], + install_requires=["slack_sdk>=3.5.0rc1,<4",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/version.py b/slack_bolt/version.py index c7e5cd96f..536b2e8cc 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.4.4" +__version__ = "1.5.0b1" From 8babac6c69e2ec2f5c7a24d9785438b80b4962c7 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 9 Apr 2021 22:44:19 +0900 Subject: [PATCH 162/719] Enable installation_store authorize to fallback to bots (prep for #254) --- slack_bolt/authorization/async_authorize.py | 86 ++++++---- slack_bolt/authorization/authorize.py | 81 +++++---- .../test_installation_store_authorize.py | 150 +++++++++++++++++ .../test_installation_store_authorize.py | 159 ++++++++++++++++++ 4 files changed, 413 insertions(+), 63 deletions(-) create mode 100644 tests/scenario_tests/test_installation_store_authorize.py create mode 100644 tests/scenario_tests_async/test_installation_store_authorize.py diff --git a/slack_bolt/authorization/async_authorize.py b/slack_bolt/authorization/async_authorize.py index 80cfbd415..b5020b792 100644 --- a/slack_bolt/authorization/async_authorize.py +++ b/slack_bolt/authorization/async_authorize.py @@ -93,6 +93,7 @@ async def __call__( class AsyncInstallationStoreAuthorize(AsyncAuthorize): authorize_result_cache: Dict[str, AuthorizeResult] find_installation_available: Optional[bool] + find_bot_available: Optional[bool] def __init__( self, @@ -110,6 +111,7 @@ def __init__( self.cache_enabled = cache_enabled self.authorize_result_cache = {} self.find_installation_available = None + self.find_bot_available = None async def __call__( self, @@ -124,12 +126,15 @@ async def __call__( self.find_installation_available = hasattr( self.installation_store, "async_find_installation" ) + if self.find_bot_available is None: + self.find_bot_available = hasattr(self.installation_store, "async_find_bot") bot_token: Optional[str] = None user_token: Optional[str] = None if not self.bot_only and self.find_installation_available: - # since v1.1, this is the default way + # Since v1.1, this is the default way. + # If you want to use find_bot / delete_bot only, you can set bot_only as True. try: # Note that this is the latest information for the org/workspace. # The installer may not be the user associated with this incoming request. @@ -140,47 +145,64 @@ async def __call__( team_id=team_id, is_enterprise_install=context.is_enterprise_install, ) - if installation is None: - self._debug_log_for_not_found(enterprise_id, team_id) - return None - - if installation.user_id != user_id: - # First off, remove the user token as the installer is a different user - installation.user_token = None - installation.user_scopes = [] - - # try to fetch the request user's installation - # to reflect the user's access token if exists - user_installation = ( - await self.installation_store.async_find_installation( - enterprise_id=enterprise_id, - team_id=team_id, - user_id=user_id, - is_enterprise_install=context.is_enterprise_install, + + if installation is not None: + if installation.user_id != user_id: + # First off, remove the user token as the installer is a different user + installation.user_token = None + installation.user_scopes = [] + + # try to fetch the request user's installation + # to reflect the user's access token if exists + user_installation = ( + await self.installation_store.async_find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + user_id=user_id, + is_enterprise_install=context.is_enterprise_install, + ) ) + if user_installation is not None: + # Overwrite the installation with the one for this user + installation = user_installation + + bot_token, user_token = ( + installation.bot_token, + installation.user_token, ) - if user_installation is not None: - # Overwrite the installation with the one for this user - installation = user_installation - bot_token, user_token = installation.bot_token, installation.user_token except NotImplementedError as _: self.find_installation_available = False - if self.bot_only or not self.find_installation_available: - # Use find_bot to get bot value (legacy) - bot: Optional[Bot] = await self.installation_store.async_find_bot( - enterprise_id=enterprise_id, - team_id=team_id, - is_enterprise_install=context.is_enterprise_install, + if ( + # If you intentionally use only find_bot / delete_bot, + self.bot_only + # If find_installation method is not available, + or not self.find_installation_available + # If find_installation did not return data and find_bot method is available, + or ( + self.find_bot_available is True + and bot_token is None + and user_token is None ) - if bot is None: - self._debug_log_for_not_found(enterprise_id, team_id) - return None - bot_token, user_token = bot.bot_token, None + ): + try: + bot: Optional[Bot] = await self.installation_store.async_find_bot( + enterprise_id=enterprise_id, + team_id=team_id, + is_enterprise_install=context.is_enterprise_install, + ) + if bot is not None: + bot_token = bot.bot_token + except NotImplementedError as _: + self.find_bot_available = False + except Exception as e: + self.logger.info(f"Failed to call find_bot method: {e}") token: Optional[str] = bot_token or user_token if token is None: + # No valid token was found + self._debug_log_for_not_found(enterprise_id, team_id) return None # Check cache to see if the bot object already exists diff --git a/slack_bolt/authorization/authorize.py b/slack_bolt/authorization/authorize.py index 5b533b576..9ff336ec3 100644 --- a/slack_bolt/authorization/authorize.py +++ b/slack_bolt/authorization/authorize.py @@ -96,6 +96,7 @@ class InstallationStoreAuthorize(Authorize): authorize_result_cache: Dict[str, AuthorizeResult] bot_only: bool find_installation_available: bool + find_bot_available: bool def __init__( self, @@ -115,6 +116,7 @@ def __init__( self.find_installation_available = hasattr( installation_store, "find_installation" ) + self.find_bot_available = hasattr(installation_store, "find_bot") def __call__( self, @@ -129,7 +131,8 @@ def __call__( user_token: Optional[str] = None if not self.bot_only and self.find_installation_available: - # since v1.1, this is the default way + # Since v1.1, this is the default way. + # If you want to use find_bot / delete_bot only, you can set bot_only as True. try: # Note that this is the latest information for the org/workspace. # The installer may not be the user associated with this incoming request. @@ -140,45 +143,61 @@ def __call__( team_id=team_id, is_enterprise_install=context.is_enterprise_install, ) - if installation is None: - self._debug_log_for_not_found(enterprise_id, team_id) - return None - - if installation.user_id != user_id: - # First off, remove the user token as the installer is a different user - installation.user_token = None - installation.user_scopes = [] - - # try to fetch the request user's installation - # to reflect the user's access token if exists - user_installation = self.installation_store.find_installation( - enterprise_id=enterprise_id, - team_id=team_id, - user_id=user_id, - is_enterprise_install=context.is_enterprise_install, + if installation is not None: + if installation.user_id != user_id: + # First off, remove the user token as the installer is a different user + installation.user_token = None + installation.user_scopes = [] + + # try to fetch the request user's installation + # to reflect the user's access token if exists + user_installation = self.installation_store.find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + user_id=user_id, + is_enterprise_install=context.is_enterprise_install, + ) + if user_installation is not None: + # Overwrite the installation with the one for this user + installation = user_installation + + bot_token, user_token = ( + installation.bot_token, + installation.user_token, ) - if user_installation is not None: - # Overwrite the installation with the one for this user - installation = user_installation - bot_token, user_token = installation.bot_token, installation.user_token except NotImplementedError as _: self.find_installation_available = False - if self.bot_only or not self.find_installation_available: - # Use find_bot to get bot value (legacy) - bot: Optional[Bot] = self.installation_store.find_bot( - enterprise_id=enterprise_id, - team_id=team_id, - is_enterprise_install=context.is_enterprise_install, + if ( + # If you intentionally use only find_bot / delete_bot, + self.bot_only + # If find_installation method is not available, + or not self.find_installation_available + # If find_installation did not return data and find_bot method is available, + or ( + self.find_bot_available is True + and bot_token is None + and user_token is None ) - if bot is None: - self._debug_log_for_not_found(enterprise_id, team_id) - return None - bot_token, user_token = bot.bot_token, None + ): + try: + bot: Optional[Bot] = self.installation_store.find_bot( + enterprise_id=enterprise_id, + team_id=team_id, + is_enterprise_install=context.is_enterprise_install, + ) + if bot is not None: + bot_token = bot.bot_token + except NotImplementedError as _: + self.find_bot_available = False + except Exception as e: + self.logger.info(f"Failed to call find_bot method: {e}") token: Optional[str] = bot_token or user_token if token is None: + # No valid token was found + self._debug_log_for_not_found(enterprise_id, team_id) return None # Check cache to see if the bot object already exists diff --git a/tests/scenario_tests/test_installation_store_authorize.py b/tests/scenario_tests/test_installation_store_authorize.py new file mode 100644 index 000000000..056c16582 --- /dev/null +++ b/tests/scenario_tests/test_installation_store_authorize.py @@ -0,0 +1,150 @@ +import json +from time import time +from typing import Optional +from urllib.parse import quote + +from slack_sdk import WebClient +from slack_sdk.oauth import InstallationStore +from slack_sdk.oauth.installation_store import Installation, Bot +from slack_sdk.signature import SignatureVerifier + +from slack_bolt import BoltRequest +from slack_bolt.app import App +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + +valid_token = "xoxb-valid" +valid_user_token = "xoxp-valid" + + +class MyInstallationStore(InstallationStore): + def find_bot( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Bot]: + return Bot( + app_id="A111", + enterprise_id="E111", + team_id="T111", + bot_token=valid_token, + bot_id="B111", + bot_user_id="W111", + bot_scopes=["commands"], + installed_at=time(), + ) + + def find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + return None + + +class TestInstallationStoreAuthorize: + signing_secret = "secret" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def build_valid_request(self) -> BoltRequest: + timestamp = str(int(time())) + return BoltRequest( + body=raw_body, headers=self.build_headers(timestamp, raw_body) + ) + + def test_success(self): + app = App( + client=self.web_client, + installation_store=MyInstallationStore(), + signing_secret=self.signing_secret, + ) + app.action("a")(simple_listener) + + request = self.build_valid_request() + response = app.dispatch(request) + assert response.status == 200 + assert response.body == "" + assert_auth_test_count(self, 1) + + +body = { + "type": "block_actions", + "user": { + "id": "W99999", + "username": "primary-owner", + "name": "primary-owner", + "team_id": "T111", + }, + "api_app_id": "A111", + "token": "verification_token", + "container": { + "type": "message", + "message_ts": "111.222", + "channel_id": "C111", + "is_ephemeral": True, + }, + "trigger_id": "111.222.valid", + "team": { + "id": "T111", + "domain": "workspace-domain", + "enterprise_id": "E111", + "enterprise_name": "Sandbox Org", + }, + "channel": {"id": "C111", "name": "test-channel"}, + "response_url": "https://hooks.slack.com/actions/T111/111/random-value", + "actions": [ + { + "action_id": "a", + "block_id": "b", + "text": {"type": "plain_text", "text": "Button", "emoji": True}, + "value": "click_me_123", + "type": "button", + "action_ts": "1596530385.194939", + } + ], +} + +raw_body = f"payload={quote(json.dumps(body))}" + + +def simple_listener(ack, body, payload, action): + assert body["trigger_id"] == "111.222.valid" + assert body["actions"][0] == payload + assert payload == action + assert action["action_id"] == "a" + ack() diff --git a/tests/scenario_tests_async/test_installation_store_authorize.py b/tests/scenario_tests_async/test_installation_store_authorize.py new file mode 100644 index 000000000..e35dd39f1 --- /dev/null +++ b/tests/scenario_tests_async/test_installation_store_authorize.py @@ -0,0 +1,159 @@ +import asyncio +import json +from time import time +from typing import Optional +from urllib.parse import quote + +import pytest +from slack_sdk.oauth.installation_store import Installation, Bot +from slack_sdk.oauth.installation_store.async_installation_store import ( + AsyncInstallationStore, +) +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count_async, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + +valid_token = "xoxb-valid" +valid_user_token = "xoxp-valid" + + +class MyInstallationStore(AsyncInstallationStore): + async def async_find_bot( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Bot]: + return Bot( + app_id="A111", + enterprise_id="E111", + team_id="T111", + bot_token=valid_token, + bot_id="B111", + bot_user_id="W111", + bot_scopes=["commands"], + installed_at=time(), + ) + + async def async_find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + return None + + +class TestAsyncInstallationStoreAuthorize: + signing_secret = "secret" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def build_valid_request(self) -> AsyncBoltRequest: + timestamp = str(int(time())) + return AsyncBoltRequest( + body=raw_body, headers=self.build_headers(timestamp, raw_body) + ) + + @pytest.mark.asyncio + async def test_success(self): + app = AsyncApp( + client=self.web_client, + installation_store=MyInstallationStore(), + signing_secret=self.signing_secret, + ) + app.action("a")(simple_listener) + + request = self.build_valid_request() + response = await app.async_dispatch(request) + assert response.status == 200 + assert response.body == "" + await assert_auth_test_count_async(self, 1) + + +body = { + "type": "block_actions", + "user": { + "id": "W99999", + "username": "primary-owner", + "name": "primary-owner", + "team_id": "T111", + }, + "api_app_id": "A111", + "token": "verification_token", + "container": { + "type": "message", + "message_ts": "111.222", + "channel_id": "C111", + "is_ephemeral": True, + }, + "trigger_id": "111.222.valid", + "team": { + "id": "T111", + "domain": "workspace-domain", + "enterprise_id": "E111", + "enterprise_name": "Sandbox Org", + }, + "channel": {"id": "C111", "name": "test-channel"}, + "response_url": "https://hooks.slack.com/actions/T111/111/random-value", + "actions": [ + { + "action_id": "a", + "block_id": "b", + "text": {"type": "plain_text", "text": "Button", "emoji": True}, + "value": "click_me_123", + "type": "button", + "action_ts": "1596530385.194939", + } + ], +} + +raw_body = f"payload={quote(json.dumps(body))}" + + +async def simple_listener(ack, body, payload, action): + assert body["trigger_id"] == "111.222.valid" + assert body["actions"][0] == payload + assert payload == action + assert action["action_id"] == "a" + await ack() From 8786783233627060532910184fb57f2a1a2b6d0a Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 12 Apr 2021 11:48:43 +0900 Subject: [PATCH 163/719] Fix #254 Add built-in tokens_revoked/app_uninstalled event handlers --- slack_bolt/app/app.py | 29 +++ slack_bolt/app/async_app.py | 31 +++ slack_bolt/listener/async_builtins.py | 37 ++++ slack_bolt/listener/builtins.py | 35 ++++ slack_bolt/logger/messages.py | 7 + tests/mock_web_api_server.py | 4 +- .../test_events_token_revocations.py | 181 ++++++++++++++++++ .../test_events_token_revocations.py | 174 +++++++++++++++++ 8 files changed, 496 insertions(+), 2 deletions(-) create mode 100644 slack_bolt/listener/async_builtins.py create mode 100644 slack_bolt/listener/builtins.py create mode 100644 tests/scenario_tests/test_events_token_revocations.py create mode 100644 tests/scenario_tests_async/test_events_token_revocations.py diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 1abc01a03..e512812dd 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -19,6 +19,7 @@ ) from slack_bolt.error import BoltError from slack_bolt.lazy_listener.thread_runner import ThreadLazyListenerRunner +from slack_bolt.listener.builtins import TokenRevocationListeners from slack_bolt.listener.custom_listener import CustomListener from slack_bolt.listener.listener import Listener from slack_bolt.listener.listener_completion_handler import ( @@ -48,6 +49,7 @@ warning_bot_only_conflicts, debug_return_listener_middleware_response, info_default_oauth_settings_loaded, + error_installation_store_required_for_builtin_listeners, ) from slack_bolt.middleware import ( Middleware, @@ -250,6 +252,12 @@ def message_hello(message, say): self._oauth_flow.settings.installation_store_bot_only = app_bot_only self._authorize.bot_only = app_bot_only + self._tokens_revocation_listeners: Optional[TokenRevocationListeners] = None + if self._installation_store is not None: + self._tokens_revocation_listeners = TokenRevocationListeners( + self._installation_store + ) + # -------------------------------------- # Middleware Initialization # -------------------------------------- @@ -1089,6 +1097,27 @@ def __call__(*args, **kwargs): return __call__ + # ------------------------- + # built-in listener functions + + def default_tokens_revoked_event_listener( + self, + ) -> Callable[..., Optional[BoltResponse]]: + if self._tokens_revocation_listeners is None: + raise BoltError(error_installation_store_required_for_builtin_listeners()) + return self._tokens_revocation_listeners.handle_tokens_revoked_events + + def default_app_uninstalled_event_listener( + self, + ) -> Callable[..., Optional[BoltResponse]]: + if self._tokens_revocation_listeners is None: + raise BoltError(error_installation_store_required_for_builtin_listeners()) + return self._tokens_revocation_listeners.handle_app_uninstalled_events + + def enable_token_revocation_listeners(self) -> None: + self.event("tokens_revoked")(self.default_tokens_revoked_event_listener()) + self.event("app_uninstalled")(self.default_app_uninstalled_event_listener()) + # ------------------------- def _init_context(self, req: BoltRequest): diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index cf4385701..f11497071 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -7,6 +7,7 @@ from aiohttp import web from slack_bolt.app.async_server import AsyncSlackAppServer +from slack_bolt.listener.async_builtins import AsyncTokenRevocationListeners from slack_bolt.listener.async_listener_completion_handler import ( AsyncDefaultListenerCompletionHandler, ) @@ -49,6 +50,7 @@ warning_bot_only_conflicts, debug_return_listener_middleware_response, info_default_oauth_settings_loaded, + error_installation_store_required_for_builtin_listeners, ) from slack_bolt.lazy_listener.asyncio_runner import AsyncioLazyListenerRunner from slack_bolt.listener.async_listener import AsyncListener, AsyncCustomListener @@ -275,6 +277,14 @@ async def message_hello(message, say): # async function ) self._async_authorize.bot_only = app_bot_only + self._async_tokens_revocation_listeners: Optional[ + AsyncTokenRevocationListeners + ] = None + if self._async_installation_store is not None: + self._async_tokens_revocation_listeners = AsyncTokenRevocationListeners( + self._async_installation_store + ) + # -------------------------------------- # Middleware Initialization # -------------------------------------- @@ -1151,6 +1161,27 @@ def __call__(*args, **kwargs): return __call__ + # ------------------------- + # built-in listener functions + + def default_tokens_revoked_event_listener( + self, + ) -> Callable[..., Awaitable[Optional[BoltResponse]]]: + if self._async_tokens_revocation_listeners is None: + raise BoltError(error_installation_store_required_for_builtin_listeners()) + return self._async_tokens_revocation_listeners.handle_tokens_revoked_events + + def default_app_uninstalled_event_listener( + self, + ) -> Callable[..., Awaitable[Optional[BoltResponse]]]: + if self._async_tokens_revocation_listeners is None: + raise BoltError(error_installation_store_required_for_builtin_listeners()) + return self._async_tokens_revocation_listeners.handle_app_uninstalled_events + + def enable_token_revocation_listeners(self) -> None: + self.event("tokens_revoked")(self.default_tokens_revoked_event_listener()) + self.event("app_uninstalled")(self.default_app_uninstalled_event_listener()) + # ------------------------- def _init_context(self, req: AsyncBoltRequest): diff --git a/slack_bolt/listener/async_builtins.py b/slack_bolt/listener/async_builtins.py new file mode 100644 index 000000000..87f588dad --- /dev/null +++ b/slack_bolt/listener/async_builtins.py @@ -0,0 +1,37 @@ +from slack_bolt.context.async_context import AsyncBoltContext +from slack_sdk.oauth.installation_store.async_installation_store import ( + AsyncInstallationStore, +) + + +class AsyncTokenRevocationListeners: + """Listener functions to handle token revocation / uninstallation events""" + + installation_store: AsyncInstallationStore + + def __init__(self, installation_store: AsyncInstallationStore): + self.installation_store = installation_store + + async def handle_tokens_revoked_events( + self, event: dict, context: AsyncBoltContext + ) -> None: + user_ids = event.get("tokens", {}).get("oauth", []) + if len(user_ids) > 0: + for user_id in user_ids: + await self.installation_store.async_delete_installation( + enterprise_id=context.enterprise_id, + team_id=context.team_id, + user_id=user_id, + ) + bots = event.get("tokens", {}).get("bot", []) + if len(bots) > 0: + await self.installation_store.async_delete_bot( + enterprise_id=context.enterprise_id, + team_id=context.team_id, + ) + + async def handle_app_uninstalled_events(self, context: AsyncBoltContext) -> None: + await self.installation_store.async_delete_all( + enterprise_id=context.enterprise_id, + team_id=context.team_id, + ) diff --git a/slack_bolt/listener/builtins.py b/slack_bolt/listener/builtins.py new file mode 100644 index 000000000..66784d182 --- /dev/null +++ b/slack_bolt/listener/builtins.py @@ -0,0 +1,35 @@ +from slack_sdk.oauth import InstallationStore + +from slack_bolt.context.context import BoltContext +from slack_sdk.oauth.installation_store.installation_store import InstallationStore + + +class TokenRevocationListeners: + """Listener functions to handle token revocation / uninstallation events""" + + installation_store: InstallationStore + + def __init__(self, installation_store: InstallationStore): + self.installation_store = installation_store + + def handle_tokens_revoked_events(self, event: dict, context: BoltContext) -> None: + user_ids = event.get("tokens", {}).get("oauth", []) + if len(user_ids) > 0: + for user_id in user_ids: + self.installation_store.delete_installation( + enterprise_id=context.enterprise_id, + team_id=context.team_id, + user_id=user_id, + ) + bots = event.get("tokens", {}).get("bot", []) + if len(bots) > 0: + self.installation_store.delete_bot( + enterprise_id=context.enterprise_id, + team_id=context.team_id, + ) + + def handle_app_uninstalled_events(self, context: BoltContext) -> None: + self.installation_store.delete_all( + enterprise_id=context.enterprise_id, + team_id=context.team_id, + ) diff --git a/slack_bolt/logger/messages.py b/slack_bolt/logger/messages.py index 57d12dfab..7d16c2861 100644 --- a/slack_bolt/logger/messages.py +++ b/slack_bolt/logger/messages.py @@ -58,6 +58,13 @@ def error_message_event_type(event_type: str) -> str: ) +def error_installation_store_required_for_builtin_listeners() -> str: + return ( + "To use the event listeners for token revocation handling, " + "setting a valid `installation_store` to `App`/`AsyncApp` is required." + ) + + # ------------------------------- # Warning # ------------------------------- diff --git a/tests/mock_web_api_server.py b/tests/mock_web_api_server.py index 799e38266..ebc4ce2dd 100644 --- a/tests/mock_web_api_server.py +++ b/tests/mock_web_api_server.py @@ -310,7 +310,7 @@ def assert_auth_test_count(test: TestCase, expected_count: int): error = None while retry_count < 3: try: - test.mock_received_requests["/auth.test"] == expected_count + test.mock_received_requests.get("/auth.test", 0) == expected_count break except Exception as e: error = e @@ -328,7 +328,7 @@ async def assert_auth_test_count_async(test: TestCase, expected_count: int): error = None while retry_count < 3: try: - test.mock_received_requests["/auth.test"] == expected_count + test.mock_received_requests.get("/auth.test", 0) == expected_count break except Exception as e: error = e diff --git a/tests/scenario_tests/test_events_token_revocations.py b/tests/scenario_tests/test_events_token_revocations.py new file mode 100644 index 000000000..5bd9bffe7 --- /dev/null +++ b/tests/scenario_tests/test_events_token_revocations.py @@ -0,0 +1,181 @@ +import json +from time import time, sleep +from typing import Optional + +import pytest as pytest +from slack_sdk.oauth import InstallationStore +from slack_sdk.oauth.installation_store import Installation +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web import WebClient + +from slack_bolt import App, BoltRequest +from slack_bolt.error import BoltError +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + +valid_token = "xoxb-valid" + + +class MyInstallationStore(InstallationStore): + def __init__(self): + self.delete_bot_called = False + self.delete_installation_called = False + self.delete_all_called = False + + def delete_bot( + self, *, enterprise_id: Optional[str], team_id: Optional[str] + ) -> None: + self.delete_bot_called = True + + def delete_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None + ) -> None: + self.delete_installation_called = True + + def find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False + ) -> Optional[Installation]: + assert enterprise_id == "E111" + assert team_id is None + return Installation( + enterprise_id="E111", + team_id=None, + user_id=user_id, + bot_token=valid_token, + bot_id="B111", + ) + + def delete_all(self, *, enterprise_id: Optional[str], team_id: Optional[str]): + super().delete_all(enterprise_id=enterprise_id, team_id=team_id) + self.delete_all_called = True + + +class TestEventsTokenRevocations: + signing_secret = "secret" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client: WebClient = WebClient( + token=None, + base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def test_no_installation_store(self): + self.web_client.token = valid_token + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + with pytest.raises(BoltError): + app.default_tokens_revoked_event_listener() + with pytest.raises(BoltError): + app.default_app_uninstalled_event_listener() + with pytest.raises(BoltError): + app.enable_token_revocation_listeners() + + def test_tokens_revoked(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + installation_store=MyInstallationStore(), + ) + + event_payload = { + "token": "verification-token", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "tokens_revoked", + "tokens": {"oauth": ["W111"], "bot": ["W222"]}, + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1606805974, + } + + timestamp, body = str(int(time())), json.dumps(event_payload) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 404 + + # Enable the built-in event listeners + app.enable_token_revocation_listeners() + response = app.dispatch(request) + assert response.status == 200 + + # auth.test API call must be skipped + assert_auth_test_count(self, 0) + sleep(1) # wait a bit after auto ack() + assert app.installation_store.delete_bot_called is True + assert app.installation_store.delete_installation_called is True + assert app.installation_store.delete_all_called is False + + def test_app_uninstalled(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + installation_store=MyInstallationStore(), + ) + + event_payload = { + "token": "verification-token", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": {"type": "app_uninstalled"}, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1606805974, + } + + timestamp, body = str(int(time())), json.dumps(event_payload) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 404 + + # Enable the built-in event listeners + app.enable_token_revocation_listeners() + response = app.dispatch(request) + assert response.status == 200 + # auth.test API call must be skipped + assert_auth_test_count(self, 0) + sleep(1) # wait a bit after auto ack() + assert app.installation_store.delete_bot_called is True + assert app.installation_store.delete_installation_called is True + assert app.installation_store.delete_all_called is True diff --git a/tests/scenario_tests_async/test_events_token_revocations.py b/tests/scenario_tests_async/test_events_token_revocations.py new file mode 100644 index 000000000..e67e03f78 --- /dev/null +++ b/tests/scenario_tests_async/test_events_token_revocations.py @@ -0,0 +1,174 @@ +import asyncio +import json +from time import time +from typing import Optional + +import pytest +from slack_sdk.oauth.installation_store.async_installation_store import ( + AsyncInstallationStore, +) +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.error import BoltError +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count_async, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + +valid_token = "xoxb-valid" + + +class MyInstallationStore(AsyncInstallationStore): + def __init__(self): + self.delete_bot_called = False + self.delete_installation_called = False + self.delete_all_called = False + + async def async_delete_bot( + self, *, enterprise_id: Optional[str], team_id: Optional[str] + ) -> None: + self.delete_bot_called = True + + async def async_delete_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None + ) -> None: + self.delete_installation_called = True + + async def async_delete_all( + self, *, enterprise_id: Optional[str], team_id: Optional[str] + ): + self.delete_all_called = True + return await super().async_delete_all( + enterprise_id=enterprise_id, team_id=team_id + ) + + +class TestEventsTokenRevocations: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = AsyncWebClient(token=None, base_url=mock_api_server_base_url) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + @pytest.mark.asyncio + async def test_no_installation_store(self): + self.web_client.token = valid_token + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + with pytest.raises(BoltError): + app.default_tokens_revoked_event_listener() + with pytest.raises(BoltError): + app.default_app_uninstalled_event_listener() + with pytest.raises(BoltError): + app.enable_token_revocation_listeners() + + @pytest.mark.asyncio + async def test_tokens_revoked(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + installation_store=MyInstallationStore(), + ) + + event_payload = { + "token": "verification-token", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "tokens_revoked", + "tokens": {"oauth": ["W111"], "bot": ["W222"]}, + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1606805974, + } + + timestamp, body = str(int(time())), json.dumps(event_payload) + request: AsyncBoltRequest = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 404 + + # Enable the built-in event listeners + app.enable_token_revocation_listeners() + response = await app.async_dispatch(request) + assert response.status == 200 + # auth.test API call must be skipped + await assert_auth_test_count_async(self, 0) + await asyncio.sleep(1) # wait a bit after auto ack() + assert app.installation_store.delete_bot_called is True + assert app.installation_store.delete_installation_called is True + assert app.installation_store.delete_all_called is False + + @pytest.mark.asyncio + async def test_app_uninstalled(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + installation_store=MyInstallationStore(), + ) + + event_payload = { + "token": "verification-token", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": {"type": "app_uninstalled"}, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1606805974, + } + + timestamp, body = str(int(time())), json.dumps(event_payload) + request: AsyncBoltRequest = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 404 + + # Enable the built-in event listeners + app.enable_token_revocation_listeners() + response = await app.async_dispatch(request) + assert response.status == 200 + # auth.test API call must be skipped + await assert_auth_test_count_async(self, 0) + await asyncio.sleep(1) # wait a bit after auto ack() + assert app.installation_store.delete_bot_called is True + assert app.installation_store.delete_installation_called is True + assert app.installation_store.delete_all_called is True From fd10ebd1c765ffe8a1bb39dc39831da4734062e1 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 10 Apr 2021 11:17:16 +0900 Subject: [PATCH 164/719] Fix #260 Enable to use respond utility in app.view listeners (only when response_urls exists) --- slack_bolt/request/async_internals.py | 23 +- slack_bolt/request/internals.py | 16 ++ tests/mock_web_api_server.py | 6 + tests/scenario_tests/test_view_submission.py | 217 ++++++++++++------ .../test_view_submission.py | 210 +++++++++++------ 5 files changed, 323 insertions(+), 149 deletions(-) diff --git a/slack_bolt/request/async_internals.py b/slack_bolt/request/async_internals.py index 19c20dd02..3b0eca3bf 100644 --- a/slack_bolt/request/async_internals.py +++ b/slack_bolt/request/async_internals.py @@ -6,25 +6,34 @@ extract_team_id, extract_user_id, extract_channel_id, + debug_multiple_response_urls_detected, ) def build_async_context( context: AsyncBoltContext, - payload: Dict[str, Any], + body: Dict[str, Any], ) -> AsyncBoltContext: - enterprise_id = extract_enterprise_id(payload) + enterprise_id = extract_enterprise_id(body) if enterprise_id: context["enterprise_id"] = enterprise_id - team_id = extract_team_id(payload) + team_id = extract_team_id(body) if team_id: context["team_id"] = team_id - user_id = extract_user_id(payload) + user_id = extract_user_id(body) if user_id: context["user_id"] = user_id - channel_id = extract_channel_id(payload) + channel_id = extract_channel_id(body) if channel_id: context["channel_id"] = channel_id - if "response_url" in payload: - context["response_url"] = payload["response_url"] + if "response_url" in body: + context["response_url"] = body["response_url"] + elif "response_urls" in body: + # In the case where response_url_enabled: true in a modal exists + response_urls = body["response_urls"] + if len(response_urls) >= 1: + if len(response_urls) > 1: + context.logger.debug(debug_multiple_response_urls_detected()) + response_url = response_urls[0].get("response_url") + context["response_url"] = response_url return context diff --git a/slack_bolt/request/internals.py b/slack_bolt/request/internals.py index 95e2d0664..4b70df1b3 100644 --- a/slack_bolt/request/internals.py +++ b/slack_bolt/request/internals.py @@ -143,6 +143,14 @@ def build_context(context: BoltContext, body: Dict[str, Any]) -> BoltContext: context["channel_id"] = channel_id if "response_url" in body: context["response_url"] = body["response_url"] + elif "response_urls" in body: + # In the case where response_url_enabled: true in a modal exists + response_urls = body["response_urls"] + if len(response_urls) >= 1: + if len(response_urls) > 1: + context.logger.debug(debug_multiple_response_urls_detected()) + response_url = response_urls[0].get("response_url") + context["response_url"] = response_url return context @@ -177,3 +185,11 @@ def error_message_raw_body_required_in_http_mode() -> str: def error_message_unknown_request_body_type() -> str: return "`body` must be either str or dict" + + +def debug_multiple_response_urls_detected() -> str: + return ( + "`response_urls` in the body has multiple URLs in it. " + "If you would like to use non-primary one, " + "please manually extract the one from body['response_urls']." + ) diff --git a/tests/mock_web_api_server.py b/tests/mock_web_api_server.py index ebc4ce2dd..9e6d008e1 100644 --- a/tests/mock_web_api_server.py +++ b/tests/mock_web_api_server.py @@ -92,6 +92,12 @@ def set_common_headers(self): def _handle(self): self.received_requests[self.path] = self.received_requests.get(self.path, 0) + 1 try: + if self.path == "/webhook": + self.send_response(200) + self.set_common_headers() + self.wfile.write("OK".encode("utf-8")) + return + if self.path == "/received_requests.json": self.send_response(200) self.set_common_headers() diff --git a/tests/scenario_tests/test_view_submission.py b/tests/scenario_tests/test_view_submission.py index 9ea3c367b..52d667122 100644 --- a/tests/scenario_tests/test_view_submission.py +++ b/tests/scenario_tests/test_view_submission.py @@ -15,6 +15,133 @@ from tests.utils import remove_os_env_temporarily, restore_os_env +body = { + "type": "view_submission", + "team": { + "id": "T111", + "domain": "workspace-domain", + "enterprise_id": "E111", + "enterprise_name": "Sandbox Org", + }, + "user": { + "id": "W111", + "username": "primary-owner", + "name": "primary-owner", + "team_id": "T111", + }, + "api_app_id": "A111", + "token": "verification_token", + "trigger_id": "111.222.valid", + "view": { + "id": "V111", + "team_id": "T111", + "type": "modal", + "blocks": [ + { + "type": "input", + "block_id": "hspI", + "label": { + "type": "plain_text", + "text": "Label", + }, + "optional": False, + "element": {"type": "plain_text_input", "action_id": "maBWU"}, + } + ], + "private_metadata": "This is for you!", + "callback_id": "view-id", + "state": { + "values": {"hspI": {"maBWU": {"type": "plain_text_input", "value": "test"}}} + }, + "hash": "1596530361.3wRYuk3R", + "title": { + "type": "plain_text", + "text": "My App", + }, + "clear_on_close": False, + "notify_on_close": False, + "close": { + "type": "plain_text", + "text": "Cancel", + }, + "submit": { + "type": "plain_text", + "text": "Submit", + }, + "previous_view_id": None, + "root_view_id": "V111", + "app_id": "A111", + "external_id": "", + "app_installed_team_id": "T111", + "bot_id": "B111", + }, + "response_urls": [], +} + +raw_body = f"payload={quote(json.dumps(body))}" + + +def simple_listener(ack, body, payload, view): + assert body["trigger_id"] == "111.222.valid" + assert body["view"] == payload + assert payload == view + assert view["private_metadata"] == "This is for you!" + ack() + + +response_url_payload_body = { + "type": "view_submission", + "team": {"id": "T111", "domain": "test-test-test"}, + "user": { + "id": "U111", + "username": "test-test-test", + "name": "test-test-test", + "team_id": "T111", + }, + "api_app_id": "A111", + "token": "verification-token", + "trigger_id": "111.222.xxx", + "view": { + "id": "V111", + "team_id": "T111", + "type": "modal", + "blocks": [], + "callback_id": "view-id", + "state": {}, + "title": { + "type": "plain_text", + "text": "My App", + }, + "close": { + "type": "plain_text", + "text": "Cancel", + }, + "submit": { + "type": "plain_text", + "text": "Submit", + }, + "previous_view_id": None, + "root_view_id": "V111", + "app_id": "A111", + "external_id": "", + "app_installed_team_id": "T111", + "bot_id": "B111", + }, + "response_urls": [ + { + "block_id": "b", + "action_id": "a", + "channel_id": "C111", + "response_url": "http://localhost:8888/webhook", + } + ], + "is_enterprise_install": False, +} + + +raw_response_url_body = f"payload={quote(json.dumps(response_url_payload_body))}" + + class TestViewSubmission: signing_secret = "secret" valid_token = "xoxb-valid" @@ -46,11 +173,9 @@ def build_headers(self, timestamp: str, body: str): "x-slack-request-timestamp": [timestamp], } - def build_valid_request(self) -> BoltRequest: + def build_valid_request(self, body: str = raw_body) -> BoltRequest: timestamp = str(int(time())) - return BoltRequest( - body=raw_body, headers=self.build_headers(timestamp, raw_body) - ) + return BoltRequest(body=body, headers=self.build_headers(timestamp, body)) def test_mock_server_is_running(self): resp = self.web_client.api_test() @@ -123,76 +248,18 @@ def test_failure_2(self): assert response.status == 404 assert_auth_test_count(self, 1) + def test_response_urls(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) -body = { - "type": "view_submission", - "team": { - "id": "T111", - "domain": "workspace-domain", - "enterprise_id": "E111", - "enterprise_name": "Sandbox Org", - }, - "user": { - "id": "W111", - "username": "primary-owner", - "name": "primary-owner", - "team_id": "T111", - }, - "api_app_id": "A111", - "token": "verification_token", - "trigger_id": "111.222.valid", - "view": { - "id": "V111", - "team_id": "T111", - "type": "modal", - "blocks": [ - { - "type": "input", - "block_id": "hspI", - "label": { - "type": "plain_text", - "text": "Label", - }, - "optional": False, - "element": {"type": "plain_text_input", "action_id": "maBWU"}, - } - ], - "private_metadata": "This is for you!", - "callback_id": "view-id", - "state": { - "values": {"hspI": {"maBWU": {"type": "plain_text_input", "value": "test"}}} - }, - "hash": "1596530361.3wRYuk3R", - "title": { - "type": "plain_text", - "text": "My App", - }, - "clear_on_close": False, - "notify_on_close": False, - "close": { - "type": "plain_text", - "text": "Cancel", - }, - "submit": { - "type": "plain_text", - "text": "Submit", - }, - "previous_view_id": None, - "root_view_id": "V111", - "app_id": "A111", - "external_id": "", - "app_installed_team_id": "T111", - "bot_id": "B111", - }, - "response_urls": [], -} - -raw_body = f"payload={quote(json.dumps(body))}" - + @app.view("view-id") + def check(ack, respond): + respond("Hi") + ack() -def simple_listener(ack, body, payload, view): - assert body["trigger_id"] == "111.222.valid" - assert body["view"] == payload - assert payload == view - assert view["private_metadata"] == "This is for you!" - ack() + request = self.build_valid_request(raw_response_url_body) + response = app.dispatch(request) + assert response.status == 200 + assert_auth_test_count(self, 1) diff --git a/tests/scenario_tests_async/test_view_submission.py b/tests/scenario_tests_async/test_view_submission.py index b9538537e..0e89b6bb3 100644 --- a/tests/scenario_tests_async/test_view_submission.py +++ b/tests/scenario_tests_async/test_view_submission.py @@ -17,6 +17,133 @@ from tests.utils import remove_os_env_temporarily, restore_os_env +body = { + "type": "view_submission", + "team": { + "id": "T111", + "domain": "workspace-domain", + "enterprise_id": "E111", + "enterprise_name": "Sandbox Org", + }, + "user": { + "id": "W111", + "username": "primary-owner", + "name": "primary-owner", + "team_id": "T111", + }, + "api_app_id": "A111", + "token": "verification_token", + "trigger_id": "111.222.valid", + "view": { + "id": "V111", + "team_id": "T111", + "type": "modal", + "blocks": [ + { + "type": "input", + "block_id": "hspI", + "label": { + "type": "plain_text", + "text": "Label", + }, + "optional": False, + "element": {"type": "plain_text_input", "action_id": "maBWU"}, + } + ], + "private_metadata": "This is for you!", + "callback_id": "view-id", + "state": { + "values": {"hspI": {"maBWU": {"type": "plain_text_input", "value": "test"}}} + }, + "hash": "1596530361.3wRYuk3R", + "title": { + "type": "plain_text", + "text": "My App", + }, + "clear_on_close": False, + "notify_on_close": False, + "close": { + "type": "plain_text", + "text": "Cancel", + }, + "submit": { + "type": "plain_text", + "text": "Submit", + }, + "previous_view_id": None, + "root_view_id": "V111", + "app_id": "A111", + "external_id": "", + "app_installed_team_id": "T111", + "bot_id": "B111", + }, + "response_urls": [], +} + +raw_body = f"payload={quote(json.dumps(body))}" + + +def simple_listener(ack, body, payload, view): + assert body["trigger_id"] == "111.222.valid" + assert body["view"] == payload + assert payload == view + assert view["private_metadata"] == "This is for you!" + ack() + + +response_url_payload_body = { + "type": "view_submission", + "team": {"id": "T111", "domain": "test-test-test"}, + "user": { + "id": "U111", + "username": "test-test-test", + "name": "test-test-test", + "team_id": "T111", + }, + "api_app_id": "A111", + "token": "verification-token", + "trigger_id": "111.222.xxx", + "view": { + "id": "V111", + "team_id": "T111", + "type": "modal", + "blocks": [], + "callback_id": "view-id", + "state": {}, + "title": { + "type": "plain_text", + "text": "My App", + }, + "close": { + "type": "plain_text", + "text": "Cancel", + }, + "submit": { + "type": "plain_text", + "text": "Submit", + }, + "previous_view_id": None, + "root_view_id": "V111", + "app_id": "A111", + "external_id": "", + "app_installed_team_id": "T111", + "bot_id": "B111", + }, + "response_urls": [ + { + "block_id": "b", + "action_id": "a", + "channel_id": "C111", + "response_url": "http://localhost:8888/webhook", + } + ], + "is_enterprise_install": False, +} + + +raw_response_url_body = f"payload={quote(json.dumps(response_url_payload_body))}" + + class TestAsyncViewSubmission: signing_secret = "secret" valid_token = "xoxb-valid" @@ -52,11 +179,9 @@ def build_headers(self, timestamp: str, body: str): "x-slack-request-timestamp": [timestamp], } - def build_valid_request(self) -> AsyncBoltRequest: + def build_valid_request(self, body: str = raw_body) -> AsyncBoltRequest: timestamp = str(int(time())) - return AsyncBoltRequest( - body=raw_body, headers=self.build_headers(timestamp, raw_body) - ) + return AsyncBoltRequest(body=body, headers=self.build_headers(timestamp, body)) @pytest.mark.asyncio async def test_mock_server_is_running(self): @@ -135,71 +260,22 @@ async def test_failure_2(self): assert response.status == 404 await assert_auth_test_count_async(self, 1) + @pytest.mark.asyncio + async def test_response_urls(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) -body = { - "type": "view_submission", - "team": { - "id": "T111", - "domain": "workspace-domain", - "enterprise_id": "E111", - "enterprise_name": "Sandbox Org", - }, - "user": { - "id": "W111", - "username": "primary-owner", - "name": "primary-owner", - "team_id": "T111", - }, - "api_app_id": "A111", - "token": "verification_token", - "trigger_id": "111.222.valid", - "view": { - "id": "V111", - "team_id": "T111", - "type": "modal", - "blocks": [ - { - "type": "input", - "block_id": "hspI", - "label": { - "type": "plain_text", - "text": "Label", - }, - "optional": False, - "element": {"type": "plain_text_input", "action_id": "maBWU"}, - } - ], - "private_metadata": "This is for you!", - "callback_id": "view-id", - "state": { - "values": {"hspI": {"maBWU": {"type": "plain_text_input", "value": "test"}}} - }, - "hash": "1596530361.3wRYuk3R", - "title": { - "type": "plain_text", - "text": "My App", - }, - "clear_on_close": False, - "notify_on_close": False, - "close": { - "type": "plain_text", - "text": "Cancel", - }, - "submit": { - "type": "plain_text", - "text": "Submit", - }, - "previous_view_id": None, - "root_view_id": "V111", - "app_id": "A111", - "external_id": "", - "app_installed_team_id": "T111", - "bot_id": "B111", - }, - "response_urls": [], -} + @app.view("view-id") + async def check(ack, respond): + await respond("Hi") + await ack() -raw_body = f"payload={quote(json.dumps(body))}" + request = self.build_valid_request(raw_response_url_body) + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_auth_test_count_async(self, 1) async def simple_listener(ack, body, payload, view): From 684611c2c5b0b71d980543a5fb389d6b8bcb1cfe Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 12 Apr 2021 13:21:11 +0900 Subject: [PATCH 165/719] Fix #273 Enable developers to customize the way to handle unmatched requests --- slack_bolt/app/app.py | 53 ++++++++++- slack_bolt/app/async_app.py | 57 ++++++++++- slack_bolt/error/__init__.py | 20 ++++ .../listener/async_listener_error_handler.py | 12 ++- slack_bolt/listener/listener_error_handler.py | 10 +- slack_bolt/logger/messages.py | 13 ++- tests/scenario_tests/test_error_handler.py | 91 +++++++++++++++++- .../test_error_handler.py | 94 +++++++++++++++++++ 8 files changed, 334 insertions(+), 16 deletions(-) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index e512812dd..86f59b296 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -17,7 +17,7 @@ InstallationStoreAuthorize, CallableAuthorize, ) -from slack_bolt.error import BoltError +from slack_bolt.error import BoltError, BoltUnhandledRequestError from slack_bolt.lazy_listener.thread_runner import ThreadLazyListenerRunner from slack_bolt.listener.builtins import TokenRevocationListeners from slack_bolt.listener.custom_listener import CustomListener @@ -50,6 +50,7 @@ debug_return_listener_middleware_response, info_default_oauth_settings_loaded, error_installation_store_required_for_builtin_listeners, + warning_unhandled_by_global_middleware, ) from slack_bolt.middleware import ( Middleware, @@ -85,6 +86,8 @@ def __init__( name: Optional[str] = None, # Set True when you run this app on a FaaS platform process_before_response: bool = False, + # Set True if you want to handle an unhandled request as an exception + raise_error_for_unhandled_request: bool = False, # Basic Information > Credentials > Signing Secret signing_secret: Optional[str] = None, # for single-workspace apps @@ -94,7 +97,7 @@ def __init__( # for multi-workspace apps authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[InstallationStore] = None, - # for v1.0.x compatibility + # for either only bot scope usage or v1.0.x compatibility installation_store_bot_only: Optional[bool] = None, # for the OAuth flow oauth_settings: Optional[OAuthSettings] = None, @@ -132,6 +135,9 @@ def message_hello(message, say): logger: The custom logger that can be used in this app. name: The application name that will be used in logging. If absent, the source file name will be used. process_before_response: True if this app runs on Function as a Service. (Default: False) + raise_error_for_unhandled_request: True if you want to raise exceptions for unhandled requests + and use @app.error listeners instead of + the built-in handler, which pints warning logs and returns 404 to Slack (Default: False) signing_secret: The Signing Secret value used for verifying requests from Slack. token: The bot/user access token required only for single-workspace app. token_verification_enabled: Verifies the validity of the given token if True. @@ -154,6 +160,7 @@ def message_hello(message, say): "SLACK_VERIFICATION_TOKEN", None ) self._framework_logger = logger or get_bolt_logger(App) + self._raise_error_for_unhandled_request = raise_error_for_unhandled_request self._token: Optional[str] = token @@ -411,9 +418,26 @@ def middleware_next(): resp = middleware.process(req=req, resp=resp, next=middleware_next) if not middleware_state["next_called"]: if resp is None: - return BoltResponse( + # next() method was not called without providing the response to return to Slack + # This should not be an intentional handling in usual use cases. + resp = BoltResponse( status=404, body={"error": "no next() calls in middleware"} ) + if self._raise_error_for_unhandled_request is True: + self._listener_runner.listener_error_handler.handle( + error=BoltUnhandledRequestError( + request=req, + current_response=resp, + last_global_middleware_name=middleware.name, + ), + request=req, + response=resp, + ) + return resp + self._framework_logger.warning( + warning_unhandled_by_global_middleware(middleware.name, req) + ) + return resp return resp for listener in self._listeners: @@ -452,8 +476,27 @@ def middleware_next(): if listener_response is not None: return listener_response + if resp is None: + resp = BoltResponse(status=404, body={"error": "unhandled request"}) + if self._raise_error_for_unhandled_request is True: + self._listener_runner.listener_error_handler.handle( + error=BoltUnhandledRequestError( + request=req, + current_response=resp, + ), + request=req, + response=resp, + ) + return resp + return self._handle_unmatched_requests(req, resp) + + def _handle_unmatched_requests( + self, req: BoltRequest, resp: BoltResponse + ) -> BoltResponse: + # TODO: provide more info like suggestion of listeners + # e.g., You can handle this type of message with @app.event("app_mention") self._framework_logger.warning(warning_unhandled_request(req)) - return BoltResponse(status=404, body={"error": "unhandled request"}) + return resp # ------------------------- # middleware @@ -563,7 +606,7 @@ def step( # global error handler def error( - self, func: Callable[..., None] + self, func: Callable[..., Optional[BoltResponse]] ) -> Optional[Callable[..., Optional[BoltResponse]]]: """Updates the global error handler. This method can be used as either a decorator or a method. diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index f11497071..ce1b968bf 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -33,7 +33,7 @@ AsyncCallableAuthorize, AsyncInstallationStoreAuthorize, ) -from slack_bolt.error import BoltError +from slack_bolt.error import BoltError, BoltUnhandledRequestError from slack_bolt.logger.messages import ( warning_client_prioritized_and_token_skipped, warning_token_skipped, @@ -51,6 +51,7 @@ debug_return_listener_middleware_response, info_default_oauth_settings_loaded, error_installation_store_required_for_builtin_listeners, + warning_unhandled_by_global_middleware, ) from slack_bolt.lazy_listener.asyncio_runner import AsyncioLazyListenerRunner from slack_bolt.listener.async_listener import AsyncListener, AsyncCustomListener @@ -96,6 +97,8 @@ def __init__( name: Optional[str] = None, # Set True when you run this app on a FaaS platform process_before_response: bool = False, + # Set True if you want to handle an unhandled request as an exception + raise_error_for_unhandled_request: bool = False, # Basic Information > Credentials > Signing Secret signing_secret: Optional[str] = None, # for single-workspace apps @@ -103,6 +106,7 @@ def __init__( client: Optional[AsyncWebClient] = None, # for multi-workspace apps installation_store: Optional[AsyncInstallationStore] = None, + # for either only bot scope usage or v1.0.x compatibility installation_store_bot_only: Optional[bool] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, # for the OAuth flow @@ -141,6 +145,9 @@ async def message_hello(message, say): # async function logger: The custom logger that can be used in this app. name: The application name that will be used in logging. If absent, the source file name will be used. process_before_response: True if this app runs on Function as a Service. (Default: False) + raise_error_for_unhandled_request: True if you want to raise exceptions for unhandled requests + and use @app.error listeners instead of + the built-in handler, which pints warning logs and returns 404 to Slack (Default: False) signing_secret: The Signing Secret value used for verifying requests from Slack. token: The bot/user access token required only for single-workspace app. client: The singleton `slack_sdk.web.async_client.AsyncWebClient` instance for this app. @@ -161,6 +168,7 @@ async def message_hello(message, say): # async function "SLACK_VERIFICATION_TOKEN", None ) self._framework_logger = logger or get_bolt_logger(AsyncApp) + self._raise_error_for_unhandled_request = raise_error_for_unhandled_request self._token: Optional[str] = token @@ -464,9 +472,26 @@ async def async_middleware_next(): ) if not middleware_state["next_called"]: if resp is None: - return BoltResponse( + # next() method was not called without providing the response to return to Slack + # This should not be an intentional handling in usual use cases. + resp = BoltResponse( status=404, body={"error": "no next() calls in middleware"} ) + if self._raise_error_for_unhandled_request is True: + await self._async_listener_runner.listener_error_handler.handle( + error=BoltUnhandledRequestError( + request=req, + current_response=resp, + last_global_middleware_name=middleware.name, + ), + request=req, + response=resp, + ) + return resp + self._framework_logger.warning( + warning_unhandled_by_global_middleware(middleware.name, req) + ) + return resp return resp for listener in self._async_listeners: @@ -508,8 +533,27 @@ async def async_middleware_next(): if listener_response is not None: return listener_response + if resp is None: + resp = BoltResponse(status=404, body={"error": "unhandled request"}) + if self._raise_error_for_unhandled_request is True: + await self._async_listener_runner.listener_error_handler.handle( + error=BoltUnhandledRequestError( + request=req, + current_response=resp, + ), + request=req, + response=resp, + ) + return resp + return self._handle_unmatched_requests(req, resp) + + def _handle_unmatched_requests( + self, req: AsyncBoltRequest, resp: BoltResponse + ) -> BoltResponse: + # TODO: provide more info like suggestion of listeners + # e.g., You can handle this type of message with @app.event("app_mention") self._framework_logger.warning(warning_unhandled_request(req)) - return BoltResponse(status=404, body={"error": "unhandled request"}) + return resp # ------------------------- # middleware @@ -623,8 +667,8 @@ def step( # global error handler def error( - self, func: Callable[..., Awaitable[None]] - ) -> Callable[..., Awaitable[None]]: + self, func: Callable[..., Awaitable[Optional[BoltResponse]]] + ) -> Callable[..., Awaitable[Optional[BoltResponse]]]: """Updates the global error handler. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -642,6 +686,9 @@ async def custom_error_handler(error, body, logger): func: The function that is supposed to be executed when getting an unhandled error in Bolt app. """ + if not inspect.iscoroutinefunction(func): + name = get_name_for_callable(func) + raise BoltError(error_listener_function_must_be_coro_func(name)) self._async_listener_runner.listener_error_handler = ( AsyncCustomListenerErrorHandler( logger=self._framework_logger, diff --git a/slack_bolt/error/__init__.py b/slack_bolt/error/__init__.py index 4201356dc..0e03032b1 100644 --- a/slack_bolt/error/__init__.py +++ b/slack_bolt/error/__init__.py @@ -1,5 +1,25 @@ """Bolt specific error types.""" +from typing import Optional, Union class BoltError(Exception): """General class in a Bolt app""" + + +class BoltUnhandledRequestError(BoltError): + request: "BoltRequest" # type: ignore + body: dict + current_response: Optional["BoltResponse"] # type: ignore + last_global_middleware_name: Optional[str] + + def __init__( # type: ignore + self, + *, + request: Union["BoltRequest", "AsyncBoltRequest"], # type: ignore + current_response: Optional["BoltResponse"], # type: ignore + last_global_middleware_name: Optional[str] = None, + ): + self.request = request + self.body = request.body if request is not None else {} + self.current_response = current_response + self.last_global_middleware_name = last_global_middleware_name diff --git a/slack_bolt/listener/async_listener_error_handler.py b/slack_bolt/listener/async_listener_error_handler.py index 3aa0360d8..17d643d09 100644 --- a/slack_bolt/listener/async_listener_error_handler.py +++ b/slack_bolt/listener/async_listener_error_handler.py @@ -33,7 +33,9 @@ async def handle( class AsyncCustomListenerErrorHandler(AsyncListenerErrorHandler): - def __init__(self, logger: Logger, func: Callable[..., Awaitable[None]]): + def __init__( + self, logger: Logger, func: Callable[..., Awaitable[Optional[BoltResponse]]] + ): self.func = func self.logger = logger self.arg_names = inspect.getfullargspec(func).args @@ -55,7 +57,13 @@ async def handle( arg_names=self.arg_names, logger=self.logger, ) - await self.func(**kwargs) + returned_response = await self.func(**kwargs) + if returned_response is not None and isinstance( + returned_response, BoltResponse + ): + response.status = returned_response.status + response.headers = returned_response.headers + response.body = returned_response.body class AsyncDefaultListenerErrorHandler(AsyncListenerErrorHandler): diff --git a/slack_bolt/listener/listener_error_handler.py b/slack_bolt/listener/listener_error_handler.py index fe5c9b173..0ee9dde8e 100644 --- a/slack_bolt/listener/listener_error_handler.py +++ b/slack_bolt/listener/listener_error_handler.py @@ -31,7 +31,7 @@ def handle( class CustomListenerErrorHandler(ListenerErrorHandler): - def __init__(self, logger: Logger, func: Callable[..., None]): + def __init__(self, logger: Logger, func: Callable[..., Optional[BoltResponse]]): self.func = func self.logger = logger self.arg_names = inspect.getfullargspec(func).args @@ -53,7 +53,13 @@ def handle( arg_names=self.arg_names, logger=self.logger, ) - self.func(**kwargs) + returned_response = self.func(**kwargs) + if returned_response is not None and isinstance( + returned_response, BoltResponse + ): + response.status = returned_response.status + response.headers = returned_response.headers + response.body = returned_response.body class DefaultListenerErrorHandler(ListenerErrorHandler): diff --git a/slack_bolt/logger/messages.py b/slack_bolt/logger/messages.py index 7d16c2861..294997a65 100644 --- a/slack_bolt/logger/messages.py +++ b/slack_bolt/logger/messages.py @@ -85,7 +85,18 @@ def warning_installation_store_conflicts() -> str: return "As you gave both `installation_store` and `oauth_settings`/`auth_flow`, the top level one is unused." -def warning_unhandled_request(req: Union[BoltRequest, "AsyncBoltRequest"]) -> str: # type: ignore +def warning_unhandled_by_global_middleware( # type: ignore + name: str, req: Union[BoltRequest, "AsyncBoltRequest"] # type: ignore +) -> str: # type: ignore + return ( + f"A global middleware ({name}) skipped calling `next()` " + f"without providing a response for the request ({req.body})" + ) + + +def warning_unhandled_request( # type: ignore + req: Union[BoltRequest, "AsyncBoltRequest"], # type: ignore +) -> str: # type: ignore return f"Unhandled request ({req.body})" diff --git a/tests/scenario_tests/test_error_handler.py b/tests/scenario_tests/test_error_handler.py index 7ebcc224d..be744efe0 100644 --- a/tests/scenario_tests/test_error_handler.py +++ b/tests/scenario_tests/test_error_handler.py @@ -5,8 +5,9 @@ from slack_sdk import WebClient from slack_sdk.signature import SignatureVerifier -from slack_bolt import BoltRequest +from slack_bolt import BoltRequest, BoltResponse from slack_bolt.app import App +from slack_bolt.error import BoltUnhandledRequestError from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, @@ -153,3 +154,91 @@ def failing_listener(): response = app.dispatch(request) assert response.status == 500 assert response.headers["x-test-result"] == ["1"] + + def test_unhandled_errors(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + raise_error_for_unhandled_request=True, + ) + response = app.dispatch(self.build_valid_request()) + assert response.status == 404 + assert response.body == '{"error": "unhandled request"}' + + @app.error + def handle_errors(error): + assert isinstance(error, BoltUnhandledRequestError) + return BoltResponse(status=404, body="TODO") + + response = app.dispatch(self.build_valid_request()) + assert response.status == 404 + assert response.body == "TODO" + + def test_unhandled_errors_process_before_response(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + raise_error_for_unhandled_request=True, + process_before_response=True, + ) + response = app.dispatch(self.build_valid_request()) + assert response.status == 404 + assert response.body == '{"error": "unhandled request"}' + + @app.error + def handle_errors(error): + assert isinstance(error, BoltUnhandledRequestError) + return BoltResponse(status=404, body="TODO") + + response = app.dispatch(self.build_valid_request()) + assert response.status == 404 + assert response.body == "TODO" + + def test_unhandled_errors_no_next(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + raise_error_for_unhandled_request=True, + ) + + @app.middleware + def broken_middleware(): + pass + + response = app.dispatch(self.build_valid_request()) + assert response.status == 404 + assert response.body == '{"error": "no next() calls in middleware"}' + + @app.error + def handle_errors(error): + assert isinstance(error, BoltUnhandledRequestError) + return BoltResponse(status=404, body="TODO") + + response = app.dispatch(self.build_valid_request()) + assert response.status == 404 + assert response.body == "TODO" + + def test_unhandled_errors_process_before_response_no_next(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + raise_error_for_unhandled_request=True, + process_before_response=True, + ) + + @app.middleware + def broken_middleware(): + pass + + response = app.dispatch(self.build_valid_request()) + assert response.status == 404 + assert response.body == '{"error": "no next() calls in middleware"}' + + @app.error + def handle_errors(error): + assert isinstance(error, BoltUnhandledRequestError) + return BoltResponse(status=404, body="TODO") + + response = app.dispatch(self.build_valid_request()) + assert response.status == 404 + assert response.body == "TODO" diff --git a/tests/scenario_tests_async/test_error_handler.py b/tests/scenario_tests_async/test_error_handler.py index d0e553ff4..d534a764e 100644 --- a/tests/scenario_tests_async/test_error_handler.py +++ b/tests/scenario_tests_async/test_error_handler.py @@ -7,7 +7,9 @@ from slack_sdk.signature import SignatureVerifier from slack_sdk.web.async_client import AsyncWebClient +from slack_bolt import BoltResponse from slack_bolt.async_app import AsyncApp +from slack_bolt.error import BoltUnhandledRequestError from slack_bolt.request.async_request import AsyncBoltRequest from tests.mock_web_api_server import ( setup_mock_web_api_server, @@ -163,3 +165,95 @@ async def failing_listener(): response = await app.async_dispatch(request) assert response.status == 500 assert response.headers["x-test-result"] == ["1"] + + @pytest.mark.asyncio + async def test_unhandled_errors(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + raise_error_for_unhandled_request=True, + ) + response = await app.async_dispatch(self.build_valid_request()) + assert response.status == 404 + assert response.body == '{"error": "unhandled request"}' + + @app.error + async def handle_errors(error): + assert isinstance(error, BoltUnhandledRequestError) + return BoltResponse(status=404, body="TODO") + + response = await app.async_dispatch(self.build_valid_request()) + assert response.status == 404 + assert response.body == "TODO" + + @pytest.mark.asyncio + async def test_unhandled_errors_process_before_response(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + raise_error_for_unhandled_request=True, + process_before_response=True, + ) + response = await app.async_dispatch(self.build_valid_request()) + assert response.status == 404 + assert response.body == '{"error": "unhandled request"}' + + @app.error + async def handle_errors(error): + assert isinstance(error, BoltUnhandledRequestError) + return BoltResponse(status=404, body="TODO") + + response = await app.async_dispatch(self.build_valid_request()) + assert response.status == 404 + assert response.body == "TODO" + + @pytest.mark.asyncio + async def test_unhandled_errors_no_next(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + raise_error_for_unhandled_request=True, + ) + + @app.middleware + async def broken_middleware(): + pass + + response = await app.async_dispatch(self.build_valid_request()) + assert response.status == 404 + assert response.body == '{"error": "no next() calls in middleware"}' + + @app.error + async def handle_errors(error): + assert isinstance(error, BoltUnhandledRequestError) + return BoltResponse(status=404, body="TODO") + + response = await app.async_dispatch(self.build_valid_request()) + assert response.status == 404 + assert response.body == "TODO" + + @pytest.mark.asyncio + async def test_unhandled_errors_process_before_response_no_next(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + raise_error_for_unhandled_request=True, + process_before_response=True, + ) + + @app.middleware + async def broken_middleware(): + pass + + response = await app.async_dispatch(self.build_valid_request()) + assert response.status == 404 + assert response.body == '{"error": "no next() calls in middleware"}' + + @app.error + async def handle_errors(error): + assert isinstance(error, BoltUnhandledRequestError) + return BoltResponse(status=404, body="TODO") + + response = await app.async_dispatch(self.build_valid_request()) + assert response.status == 404 + assert response.body == "TODO" From ac030dd8d3775ad0ee5cbdf6b597156613707702 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 20 Apr 2021 14:57:29 +0900 Subject: [PATCH 166/719] version 1.5.0 --- setup.py | 2 +- slack_bolt/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index b4d1e966c..6a42a72dd 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ exclude=["examples", "integration_tests", "tests", "tests.*",] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.5.0rc1,<4",], + install_requires=["slack_sdk>=3.5.0,<4",], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 536b2e8cc..c73df5eee 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.5.0b1" +__version__ = "1.5.0" From 99ed6a6c1bb09c8f186b916eaf54e963073a112c Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 20 Apr 2021 14:57:45 +0900 Subject: [PATCH 167/719] Update the documents --- .../adapter/aws_lambda/chalice_handler.html | 114 ++++++- .../slack_bolt/adapter/django/handler.html | 237 +++++++++++++- docs/api-docs/slack_bolt/app/app.html | 288 ++++++++++++++++- docs/api-docs/slack_bolt/app/async_app.html | 305 +++++++++++++++++- .../authorization/async_authorize.html | 177 ++++++---- .../slack_bolt/authorization/authorize.html | 167 ++++++---- docs/api-docs/slack_bolt/error/index.html | 91 +++++- .../lazy_listener/thread_runner.html | 4 + .../slack_bolt/listener/async_builtins.html | 207 ++++++++++++ .../slack_bolt/listener/async_internals.html | 116 +++++++ .../async_listener_completion_handler.html | 292 +++++++++++++++++ .../async_listener_error_handler.html | 152 +++------ .../slack_bolt/listener/asyncio_runner.html | 40 ++- .../slack_bolt/listener/builtins.html | 201 ++++++++++++ docs/api-docs/slack_bolt/listener/index.html | 30 ++ .../slack_bolt/listener/internals.html | 133 ++++++++ .../listener/listener_completion_handler.html | 285 ++++++++++++++++ .../listener/listener_error_handler.html | 146 +++------ .../slack_bolt/listener/thread_runner.html | 44 ++- docs/api-docs/slack_bolt/logger/messages.html | 60 +++- .../slack_bolt/request/async_internals.html | 47 ++- .../slack_bolt/request/internals.html | 44 ++- docs/api-docs/slack_bolt/version.html | 2 +- .../slack_bolt/workflows/step/async_step.html | 2 + .../workflows/step/async_step_middleware.html | 2 + .../slack_bolt/workflows/step/step.html | 2 + .../workflows/step/step_middleware.html | 2 + .../step/utilities/async_complete.html | 2 + .../step/utilities/async_configure.html | 2 + .../workflows/step/utilities/async_fail.html | 2 + .../step/utilities/async_update.html | 2 + .../workflows/step/utilities/complete.html | 2 + .../workflows/step/utilities/configure.html | 2 + .../workflows/step/utilities/fail.html | 2 + .../workflows/step/utilities/update.html | 2 + 35 files changed, 2814 insertions(+), 392 deletions(-) create mode 100644 docs/api-docs/slack_bolt/listener/async_builtins.html create mode 100644 docs/api-docs/slack_bolt/listener/async_internals.html create mode 100644 docs/api-docs/slack_bolt/listener/async_listener_completion_handler.html create mode 100644 docs/api-docs/slack_bolt/listener/builtins.html create mode 100644 docs/api-docs/slack_bolt/listener/internals.html create mode 100644 docs/api-docs/slack_bolt/listener/listener_completion_handler.html diff --git a/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html b/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html index f3eaa5810..032b92679 100644 --- a/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html +++ b/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html @@ -27,8 +27,12 @@

    Module slack_bolt.adapter.aws_lambda.chalice_handlerExpand source code
    import logging
    +import json
    +from os import getenv
     
     from chalice.app import Request, Response, Chalice
    +from chalice.config import Config
    +from chalice.test import BaseClient, LambdaContext, InvokeResponse
     
     from slack_bolt.adapter.aws_lambda.chalice_lazy_listener_runner import (
         ChaliceLazyListenerRunner,
    @@ -41,14 +45,43 @@ 

    Module slack_bolt.adapter.aws_lambda.chalice_handlerClasses

    self.app = app self.chalice = chalice self.logger = get_bolt_app_logger(app.name, ChaliceSlackRequestHandler) + + lambda_client = None + if getenv("AWS_CHALICE_CLI_MODE") == "true": + lambda_client = LocalLambdaClient(self.chalice, Config()) + self.app.listener_runner.lazy_listener_runner = ChaliceLazyListenerRunner( - logger=self.logger + logger=self.logger, lambda_client=lambda_client ) + if self.app.oauth_flow is not None: self.app.oauth_flow.settings.redirect_uri_page_renderer.install_path = "?" @@ -338,6 +377,71 @@

    Methods

    +
    +class LocalLambdaClient +(app: chalice.app.Chalice, config: chalice.config.Config) +
    +
    +

    Lambda client implementing invoke for use when running with Chalice CLI

    +
    + +Expand source code + +
    class LocalLambdaClient(BaseClient):
    +    """Lambda client implementing `invoke` for use when running with Chalice CLI"""
    +
    +    def __init__(self, app: Chalice, config: Config) -> None:
    +        self._app = app
    +        self._config = config
    +
    +    def invoke(
    +        self,
    +        FunctionName: str = None,
    +        InvocationType: str = "Event",
    +        Payload: str = "{}",
    +    ) -> InvokeResponse:
    +        scoped = self._config.scope(self._config.chalice_stage, FunctionName)
    +        lambda_context = LambdaContext(
    +            FunctionName, memory_size=scoped.lambda_memory_size
    +        )
    +
    +        with self._patched_env_vars(scoped.environment_variables):
    +            response = self._app(json.loads(Payload), lambda_context)
    +        return InvokeResponse(payload=response)
    +
    +

    Ancestors

    +
      +
    • chalice.test.BaseClient
    • +
    +

    Methods

    +
    +
    +def invoke(self, FunctionName: str = None, InvocationType: str = 'Event', Payload: str = '{}') ‑> chalice.test.InvokeResponse +
    +
    +
    +
    + +Expand source code + +
    def invoke(
    +    self,
    +    FunctionName: str = None,
    +    InvocationType: str = "Event",
    +    Payload: str = "{}",
    +) -> InvokeResponse:
    +    scoped = self._config.scope(self._config.chalice_stage, FunctionName)
    +    lambda_context = LambdaContext(
    +        FunctionName, memory_size=scoped.lambda_memory_size
    +    )
    +
    +    with self._patched_env_vars(scoped.environment_variables):
    +        response = self._app(json.loads(Payload), lambda_context)
    +    return InvokeResponse(payload=response)
    +
    +
    +
    +
    @@ -368,6 +472,12 @@

    handle +
  • +

    LocalLambdaClient

    + +
  • diff --git a/docs/api-docs/slack_bolt/adapter/django/handler.html b/docs/api-docs/slack_bolt/adapter/django/handler.html index 57c631413..690876c6a 100644 --- a/docs/api-docs/slack_bolt/adapter/django/handler.html +++ b/docs/api-docs/slack_bolt/adapter/django/handler.html @@ -26,11 +26,22 @@

    Module slack_bolt.adapter.django.handler

    Expand source code -
    from typing import Optional
    +
    import logging
    +from logging import Logger
    +from threading import current_thread, Thread
    +from typing import Optional, Callable
     
     from django.http import HttpRequest, HttpResponse
     
     from slack_bolt.app import App
    +from slack_bolt.error import BoltError
    +from slack_bolt.lazy_listener import ThreadLazyListenerRunner
    +from slack_bolt.lazy_listener.internals import build_runnable_function
    +from slack_bolt.listener.listener_completion_handler import (
    +    ListenerCompletionHandler,
    +    DefaultListenerCompletionHandler,
    +)
    +from slack_bolt.listener.thread_runner import ThreadListenerRunner
     from slack_bolt.oauth import OAuthFlow
     from slack_bolt.request import BoltRequest
     from slack_bolt.response import BoltResponse
    @@ -71,9 +82,86 @@ 

    Module slack_bolt.adapter.django.handler

    return resp +from django.db import connections + + +def release_thread_local_connections(logger: Logger, execution_type: str): + connections.close_all() + if logger.level <= logging.DEBUG: + current: Thread = current_thread() + logger.debug( + f"Released thread-bound DB connections (thread name: {current.name}, execution type: {execution_type})" + ) + + +class DjangoListenerCompletionHandler(ListenerCompletionHandler): + """Django sets DB connections as a thread-local variable per thread. + If the thread is not managed on the Django app side, the connections won't be released by Django. + This handler releases the connections every time a ThreadListenerRunner execution completes. + """ + + def handle(self, request: BoltRequest, response: Optional[BoltResponse]) -> None: + release_thread_local_connections(request.context.logger, "listener") + + +class DjangoThreadLazyListenerRunner(ThreadLazyListenerRunner): + def start(self, function: Callable[..., None], request: BoltRequest) -> None: + func: Callable[[], None] = build_runnable_function( + func=function, + logger=self.logger, + request=request, + ) + + def wrapped_func(): + try: + func() + finally: + release_thread_local_connections( + request.context.logger, "lazy-listener" + ) + + self.executor.submit(wrapped_func) + + class SlackRequestHandler: def __init__(self, app: App): # type: ignore self.app = app + listener_runner = self.app.listener_runner + # This runner closes all thread-local connections in the thread when an execution completes + self.app.listener_runner.lazy_listener_runner = DjangoThreadLazyListenerRunner( + logger=listener_runner.logger, + executor=listener_runner.listener_executor, + ) + + if not isinstance(listener_runner, ThreadListenerRunner): + raise BoltError( + "Custom listener_runners are not compatible with this Django adapter." + ) + + if app.process_before_response is True: + # As long as the app access Django models in the same thread, + # Django cleans the connections up for you. + self.app.logger.debug("App.process_before_response is set to True") + return + + current_completion_handler = listener_runner.listener_completion_handler + if current_completion_handler is not None and not isinstance( + current_completion_handler, DefaultListenerCompletionHandler + ): + message = """As you've already set app.listener_runner.listener_completion_handler to your own one, + Bolt skipped to set it to slack_sdk.adapter.django.DjangoListenerCompletionHandler. + We strongly recommend having the following lines of code in your listener_completion_handler: + + from django.db import connections + connections.close_all() + """ + self.app.logger.warning(message) + return + # for proper management of thread-local Django DB connections + self.app.listener_runner.listener_completion_handler = ( + DjangoListenerCompletionHandler() + ) + self.app.logger.debug("DjangoListenerCompletionHandler has been enabled") def handle(self, req: HttpRequest) -> HttpResponse: if req.method == "GET": @@ -99,6 +187,24 @@

    Module slack_bolt.adapter.django.handler

    Functions

    +
    +def release_thread_local_connections(logger: logging.Logger, execution_type: str) +
    +
    +
    +
    + +Expand source code + +
    def release_thread_local_connections(logger: Logger, execution_type: str):
    +    connections.close_all()
    +    if logger.level <= logging.DEBUG:
    +        current: Thread = current_thread()
    +        logger.debug(
    +            f"Released thread-bound DB connections (thread name: {current.name}, execution type: {execution_type})"
    +        )
    +
    +
    def to_bolt_request(req: django.http.request.HttpRequest) ‑> BoltRequest
    @@ -157,6 +263,89 @@

    Functions

    Classes

    +
    +class DjangoListenerCompletionHandler +
    +
    +

    Django sets DB connections as a thread-local variable per thread. +If the thread is not managed on the Django app side, the connections won't be released by Django. +This handler releases the connections every time a ThreadListenerRunner execution completes.

    +
    + +Expand source code + +
    class DjangoListenerCompletionHandler(ListenerCompletionHandler):
    +    """Django sets DB connections as a thread-local variable per thread.
    +    If the thread is not managed on the Django app side, the connections won't be released by Django.
    +    This handler releases the connections every time a ThreadListenerRunner execution completes.
    +    """
    +
    +    def handle(self, request: BoltRequest, response: Optional[BoltResponse]) -> None:
    +        release_thread_local_connections(request.context.logger, "listener")
    +
    +

    Ancestors

    + +

    Inherited members

    + +
    +
    +class DjangoThreadLazyListenerRunner +(logger: logging.Logger, executor: concurrent.futures.thread.ThreadPoolExecutor) +
    +
    +
    +
    + +Expand source code + +
    class DjangoThreadLazyListenerRunner(ThreadLazyListenerRunner):
    +    def start(self, function: Callable[..., None], request: BoltRequest) -> None:
    +        func: Callable[[], None] = build_runnable_function(
    +            func=function,
    +            logger=self.logger,
    +            request=request,
    +        )
    +
    +        def wrapped_func():
    +            try:
    +                func()
    +            finally:
    +                release_thread_local_connections(
    +                    request.context.logger, "lazy-listener"
    +                )
    +
    +        self.executor.submit(wrapped_func)
    +
    +

    Ancestors

    + +

    Class variables

    +
    +
    var logger : logging.Logger
    +
    +
    +
    +
    +

    Inherited members

    + +
    class SlackRequestHandler (app: App) @@ -170,6 +359,42 @@

    Classes

    class SlackRequestHandler:
         def __init__(self, app: App):  # type: ignore
             self.app = app
    +        listener_runner = self.app.listener_runner
    +        # This runner closes all thread-local connections in the thread when an execution completes
    +        self.app.listener_runner.lazy_listener_runner = DjangoThreadLazyListenerRunner(
    +            logger=listener_runner.logger,
    +            executor=listener_runner.listener_executor,
    +        )
    +
    +        if not isinstance(listener_runner, ThreadListenerRunner):
    +            raise BoltError(
    +                "Custom listener_runners are not compatible with this Django adapter."
    +            )
    +
    +        if app.process_before_response is True:
    +            # As long as the app access Django models in the same thread,
    +            # Django cleans the connections up for you.
    +            self.app.logger.debug("App.process_before_response is set to True")
    +            return
    +
    +        current_completion_handler = listener_runner.listener_completion_handler
    +        if current_completion_handler is not None and not isinstance(
    +            current_completion_handler, DefaultListenerCompletionHandler
    +        ):
    +            message = """As you've already set app.listener_runner.listener_completion_handler to your own one,
    +            Bolt skipped to set it to slack_sdk.adapter.django.DjangoListenerCompletionHandler.
    +            We strongly recommend having the following lines of code in your listener_completion_handler:
    +
    +            from django.db import connections
    +            connections.close_all()
    +            """
    +            self.app.logger.warning(message)
    +            return
    +        # for proper management of thread-local Django DB connections
    +        self.app.listener_runner.listener_completion_handler = (
    +            DjangoListenerCompletionHandler()
    +        )
    +        self.app.logger.debug("DjangoListenerCompletionHandler has been enabled")
     
         def handle(self, req: HttpRequest) -> HttpResponse:
             if req.method == "GET":
    @@ -233,6 +458,7 @@ 

    Index

  • Functions

    @@ -240,6 +466,15 @@

    Index

  • Classes

    • +

      DjangoListenerCompletionHandler

      +
    • +
    • +

      DjangoThreadLazyListenerRunner

      + +
    • +
    • SlackRequestHandler

      • handle
      • diff --git a/docs/api-docs/slack_bolt/app/app.html b/docs/api-docs/slack_bolt/app/app.html index a89ddcc2a..559314723 100644 --- a/docs/api-docs/slack_bolt/app/app.html +++ b/docs/api-docs/slack_bolt/app/app.html @@ -45,10 +45,14 @@

        Module slack_bolt.app.app

        InstallationStoreAuthorize, CallableAuthorize, ) -from slack_bolt.error import BoltError +from slack_bolt.error import BoltError, BoltUnhandledRequestError from slack_bolt.lazy_listener.thread_runner import ThreadLazyListenerRunner +from slack_bolt.listener.builtins import TokenRevocationListeners from slack_bolt.listener.custom_listener import CustomListener from slack_bolt.listener.listener import Listener +from slack_bolt.listener.listener_completion_handler import ( + DefaultListenerCompletionHandler, +) from slack_bolt.listener.listener_error_handler import ( DefaultListenerErrorHandler, CustomListenerErrorHandler, @@ -73,6 +77,8 @@

        Module slack_bolt.app.app

        warning_bot_only_conflicts, debug_return_listener_middleware_response, info_default_oauth_settings_loaded, + error_installation_store_required_for_builtin_listeners, + warning_unhandled_by_global_middleware, ) from slack_bolt.middleware import ( Middleware, @@ -108,6 +114,8 @@

        Module slack_bolt.app.app

        name: Optional[str] = None, # Set True when you run this app on a FaaS platform process_before_response: bool = False, + # Set True if you want to handle an unhandled request as an exception + raise_error_for_unhandled_request: bool = False, # Basic Information > Credentials > Signing Secret signing_secret: Optional[str] = None, # for single-workspace apps @@ -117,7 +125,7 @@

        Module slack_bolt.app.app

        # for multi-workspace apps authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[InstallationStore] = None, - # for v1.0.x compatibility + # for either only bot scope usage or v1.0.x compatibility installation_store_bot_only: Optional[bool] = None, # for the OAuth flow oauth_settings: Optional[OAuthSettings] = None, @@ -155,6 +163,9 @@

        Module slack_bolt.app.app

        logger: The custom logger that can be used in this app. name: The application name that will be used in logging. If absent, the source file name will be used. process_before_response: True if this app runs on Function as a Service. (Default: False) + raise_error_for_unhandled_request: True if you want to raise exceptions for unhandled requests + and use @app.error listeners instead of + the built-in handler, which pints warning logs and returns 404 to Slack (Default: False) signing_secret: The Signing Secret value used for verifying requests from Slack. token: The bot/user access token required only for single-workspace app. token_verification_enabled: Verifies the validity of the given token if True. @@ -177,6 +188,7 @@

        Module slack_bolt.app.app

        "SLACK_VERIFICATION_TOKEN", None ) self._framework_logger = logger or get_bolt_logger(App) + self._raise_error_for_unhandled_request = raise_error_for_unhandled_request self._token: Optional[str] = token @@ -275,6 +287,12 @@

        Module slack_bolt.app.app

        self._oauth_flow.settings.installation_store_bot_only = app_bot_only self._authorize.bot_only = app_bot_only + self._tokens_revocation_listeners: Optional[TokenRevocationListeners] = None + if self._installation_store is not None: + self._tokens_revocation_listeners = TokenRevocationListeners( + self._installation_store + ) + # -------------------------------------- # Middleware Initialization # -------------------------------------- @@ -283,12 +301,16 @@

        Module slack_bolt.app.app

        self._listeners: List[Listener] = [] listener_executor = ThreadPoolExecutor(max_workers=5) + self._process_before_response = process_before_response self._listener_runner = ThreadListenerRunner( logger=self._framework_logger, process_before_response=process_before_response, listener_error_handler=DefaultListenerErrorHandler( logger=self._framework_logger ), + listener_completion_handler=DefaultListenerCompletionHandler( + logger=self._framework_logger + ), listener_executor=listener_executor, lazy_listener_runner=ThreadLazyListenerRunner( logger=self._framework_logger, @@ -367,6 +389,10 @@

        Module slack_bolt.app.app

        """The thread executor for asynchronously running listeners.""" return self._listener_runner + @property + def process_before_response(self) -> bool: + return self._process_before_response or False + # ------------------------- # standalone server @@ -420,9 +446,26 @@

        Module slack_bolt.app.app

        resp = middleware.process(req=req, resp=resp, next=middleware_next) if not middleware_state["next_called"]: if resp is None: - return BoltResponse( + # next() method was not called without providing the response to return to Slack + # This should not be an intentional handling in usual use cases. + resp = BoltResponse( status=404, body={"error": "no next() calls in middleware"} ) + if self._raise_error_for_unhandled_request is True: + self._listener_runner.listener_error_handler.handle( + error=BoltUnhandledRequestError( + request=req, + current_response=resp, + last_global_middleware_name=middleware.name, + ), + request=req, + response=resp, + ) + return resp + self._framework_logger.warning( + warning_unhandled_by_global_middleware(middleware.name, req) + ) + return resp return resp for listener in self._listeners: @@ -461,8 +504,27 @@

        Module slack_bolt.app.app

        if listener_response is not None: return listener_response + if resp is None: + resp = BoltResponse(status=404, body={"error": "unhandled request"}) + if self._raise_error_for_unhandled_request is True: + self._listener_runner.listener_error_handler.handle( + error=BoltUnhandledRequestError( + request=req, + current_response=resp, + ), + request=req, + response=resp, + ) + return resp + return self._handle_unmatched_requests(req, resp) + + def _handle_unmatched_requests( + self, req: BoltRequest, resp: BoltResponse + ) -> BoltResponse: + # TODO: provide more info like suggestion of listeners + # e.g., You can handle this type of message with @app.event("app_mention") self._framework_logger.warning(warning_unhandled_request(req)) - return BoltResponse(status=404, body={"error": "unhandled request"}) + return resp # ------------------------- # middleware @@ -572,7 +634,7 @@

        Module slack_bolt.app.app

        # global error handler def error( - self, func: Callable[..., None] + self, func: Callable[..., Optional[BoltResponse]] ) -> Optional[Callable[..., Optional[BoltResponse]]]: """Updates the global error handler. This method can be used as either a decorator or a method. @@ -1106,6 +1168,27 @@

        Module slack_bolt.app.app

        return __call__ + # ------------------------- + # built-in listener functions + + def default_tokens_revoked_event_listener( + self, + ) -> Callable[..., Optional[BoltResponse]]: + if self._tokens_revocation_listeners is None: + raise BoltError(error_installation_store_required_for_builtin_listeners()) + return self._tokens_revocation_listeners.handle_tokens_revoked_events + + def default_app_uninstalled_event_listener( + self, + ) -> Callable[..., Optional[BoltResponse]]: + if self._tokens_revocation_listeners is None: + raise BoltError(error_installation_store_required_for_builtin_listeners()) + return self._tokens_revocation_listeners.handle_app_uninstalled_events + + def enable_token_revocation_listeners(self) -> None: + self.event("tokens_revoked")(self.default_tokens_revoked_event_listener()) + self.event("app_uninstalled")(self.default_app_uninstalled_event_listener()) + # ------------------------- def _init_context(self, req: BoltRequest): @@ -1303,7 +1386,7 @@

        Classes

        class App -(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, token_verification_enabled: bool = True, client: Optional[slack_sdk.web.client.WebClient] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: Optional[bool] = None, oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, verification_token: Optional[str] = None) +(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, token_verification_enabled: bool = True, client: Optional[slack_sdk.web.client.WebClient] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: Optional[bool] = None, oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, verification_token: Optional[str] = None)

        Bolt App that provides functionalities to register middleware/listeners.

        @@ -1337,6 +1420,10 @@

        Args

        The application name that will be used in logging. If absent, the source file name will be used.
        process_before_response
        True if this app runs on Function as a Service. (Default: False)
        +
        raise_error_for_unhandled_request
        +
        True if you want to raise exceptions for unhandled requests +and use @app.error listeners instead of +the built-in handler, which pints warning logs and returns 404 to Slack (Default: False)
        signing_secret
        The Signing Secret value used for verifying requests from Slack.
        token
        @@ -1372,6 +1459,8 @@

        Args

        name: Optional[str] = None, # Set True when you run this app on a FaaS platform process_before_response: bool = False, + # Set True if you want to handle an unhandled request as an exception + raise_error_for_unhandled_request: bool = False, # Basic Information > Credentials > Signing Secret signing_secret: Optional[str] = None, # for single-workspace apps @@ -1381,7 +1470,7 @@

        Args

        # for multi-workspace apps authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[InstallationStore] = None, - # for v1.0.x compatibility + # for either only bot scope usage or v1.0.x compatibility installation_store_bot_only: Optional[bool] = None, # for the OAuth flow oauth_settings: Optional[OAuthSettings] = None, @@ -1419,6 +1508,9 @@

        Args

        logger: The custom logger that can be used in this app. name: The application name that will be used in logging. If absent, the source file name will be used. process_before_response: True if this app runs on Function as a Service. (Default: False) + raise_error_for_unhandled_request: True if you want to raise exceptions for unhandled requests + and use @app.error listeners instead of + the built-in handler, which pints warning logs and returns 404 to Slack (Default: False) signing_secret: The Signing Secret value used for verifying requests from Slack. token: The bot/user access token required only for single-workspace app. token_verification_enabled: Verifies the validity of the given token if True. @@ -1441,6 +1533,7 @@

        Args

        "SLACK_VERIFICATION_TOKEN", None ) self._framework_logger = logger or get_bolt_logger(App) + self._raise_error_for_unhandled_request = raise_error_for_unhandled_request self._token: Optional[str] = token @@ -1539,6 +1632,12 @@

        Args

        self._oauth_flow.settings.installation_store_bot_only = app_bot_only self._authorize.bot_only = app_bot_only + self._tokens_revocation_listeners: Optional[TokenRevocationListeners] = None + if self._installation_store is not None: + self._tokens_revocation_listeners = TokenRevocationListeners( + self._installation_store + ) + # -------------------------------------- # Middleware Initialization # -------------------------------------- @@ -1547,12 +1646,16 @@

        Args

        self._listeners: List[Listener] = [] listener_executor = ThreadPoolExecutor(max_workers=5) + self._process_before_response = process_before_response self._listener_runner = ThreadListenerRunner( logger=self._framework_logger, process_before_response=process_before_response, listener_error_handler=DefaultListenerErrorHandler( logger=self._framework_logger ), + listener_completion_handler=DefaultListenerCompletionHandler( + logger=self._framework_logger + ), listener_executor=listener_executor, lazy_listener_runner=ThreadLazyListenerRunner( logger=self._framework_logger, @@ -1631,6 +1734,10 @@

        Args

        """The thread executor for asynchronously running listeners.""" return self._listener_runner + @property + def process_before_response(self) -> bool: + return self._process_before_response or False + # ------------------------- # standalone server @@ -1684,9 +1791,26 @@

        Args

        resp = middleware.process(req=req, resp=resp, next=middleware_next) if not middleware_state["next_called"]: if resp is None: - return BoltResponse( + # next() method was not called without providing the response to return to Slack + # This should not be an intentional handling in usual use cases. + resp = BoltResponse( status=404, body={"error": "no next() calls in middleware"} ) + if self._raise_error_for_unhandled_request is True: + self._listener_runner.listener_error_handler.handle( + error=BoltUnhandledRequestError( + request=req, + current_response=resp, + last_global_middleware_name=middleware.name, + ), + request=req, + response=resp, + ) + return resp + self._framework_logger.warning( + warning_unhandled_by_global_middleware(middleware.name, req) + ) + return resp return resp for listener in self._listeners: @@ -1725,8 +1849,27 @@

        Args

        if listener_response is not None: return listener_response + if resp is None: + resp = BoltResponse(status=404, body={"error": "unhandled request"}) + if self._raise_error_for_unhandled_request is True: + self._listener_runner.listener_error_handler.handle( + error=BoltUnhandledRequestError( + request=req, + current_response=resp, + ), + request=req, + response=resp, + ) + return resp + return self._handle_unmatched_requests(req, resp) + + def _handle_unmatched_requests( + self, req: BoltRequest, resp: BoltResponse + ) -> BoltResponse: + # TODO: provide more info like suggestion of listeners + # e.g., You can handle this type of message with @app.event("app_mention") self._framework_logger.warning(warning_unhandled_request(req)) - return BoltResponse(status=404, body={"error": "unhandled request"}) + return resp # ------------------------- # middleware @@ -1836,7 +1979,7 @@

        Args

        # global error handler def error( - self, func: Callable[..., None] + self, func: Callable[..., Optional[BoltResponse]] ) -> Optional[Callable[..., Optional[BoltResponse]]]: """Updates the global error handler. This method can be used as either a decorator or a method. @@ -2370,6 +2513,27 @@

        Args

        return __call__ + # ------------------------- + # built-in listener functions + + def default_tokens_revoked_event_listener( + self, + ) -> Callable[..., Optional[BoltResponse]]: + if self._tokens_revocation_listeners is None: + raise BoltError(error_installation_store_required_for_builtin_listeners()) + return self._tokens_revocation_listeners.handle_tokens_revoked_events + + def default_app_uninstalled_event_listener( + self, + ) -> Callable[..., Optional[BoltResponse]]: + if self._tokens_revocation_listeners is None: + raise BoltError(error_installation_store_required_for_builtin_listeners()) + return self._tokens_revocation_listeners.handle_app_uninstalled_events + + def enable_token_revocation_listeners(self) -> None: + self.event("tokens_revoked")(self.default_tokens_revoked_event_listener()) + self.event("app_uninstalled")(self.default_app_uninstalled_event_listener()) + # ------------------------- def _init_context(self, req: BoltRequest): @@ -2523,6 +2687,18 @@

        Instance variables

        return self._oauth_flow
  • +
    var process_before_response : bool
    +
    +
    +
    + +Expand source code + +
    @property
    +def process_before_response(self) -> bool:
    +    return self._process_before_response or False
    +
    +

    Methods

    @@ -2760,6 +2936,40 @@

    Args

    return __call__
    +
    +def default_app_uninstalled_event_listener(self) ‑> Callable[..., Optional[BoltResponse]] +
    +
    +
    +
    + +Expand source code + +
    def default_app_uninstalled_event_listener(
    +    self,
    +) -> Callable[..., Optional[BoltResponse]]:
    +    if self._tokens_revocation_listeners is None:
    +        raise BoltError(error_installation_store_required_for_builtin_listeners())
    +    return self._tokens_revocation_listeners.handle_app_uninstalled_events
    +
    +
    +
    +def default_tokens_revoked_event_listener(self) ‑> Callable[..., Optional[BoltResponse]] +
    +
    +
    +
    + +Expand source code + +
    def default_tokens_revoked_event_listener(
    +    self,
    +) -> Callable[..., Optional[BoltResponse]]:
    +    if self._tokens_revocation_listeners is None:
    +        raise BoltError(error_installation_store_required_for_builtin_listeners())
    +    return self._tokens_revocation_listeners.handle_tokens_revoked_events
    +
    +
    def dialog_cancellation(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Optional[Callable[..., Optional[BoltResponse]]]
    @@ -2888,9 +3098,26 @@

    Returns

    resp = middleware.process(req=req, resp=resp, next=middleware_next) if not middleware_state["next_called"]: if resp is None: - return BoltResponse( + # next() method was not called without providing the response to return to Slack + # This should not be an intentional handling in usual use cases. + resp = BoltResponse( status=404, body={"error": "no next() calls in middleware"} ) + if self._raise_error_for_unhandled_request is True: + self._listener_runner.listener_error_handler.handle( + error=BoltUnhandledRequestError( + request=req, + current_response=resp, + last_global_middleware_name=middleware.name, + ), + request=req, + response=resp, + ) + return resp + self._framework_logger.warning( + warning_unhandled_by_global_middleware(middleware.name, req) + ) + return resp return resp for listener in self._listeners: @@ -2929,12 +3156,37 @@

    Returns

    if listener_response is not None: return listener_response - self._framework_logger.warning(warning_unhandled_request(req)) - return BoltResponse(status=404, body={"error": "unhandled request"})
    + if resp is None: + resp = BoltResponse(status=404, body={"error": "unhandled request"}) + if self._raise_error_for_unhandled_request is True: + self._listener_runner.listener_error_handler.handle( + error=BoltUnhandledRequestError( + request=req, + current_response=resp, + ), + request=req, + response=resp, + ) + return resp + return self._handle_unmatched_requests(req, resp)
    + + +
    +def enable_token_revocation_listeners(self) ‑> NoneType +
    +
    +
    +
    + +Expand source code + +
    def enable_token_revocation_listeners(self) -> None:
    +    self.event("tokens_revoked")(self.default_tokens_revoked_event_listener())
    +    self.event("app_uninstalled")(self.default_app_uninstalled_event_listener())
    -def error(self, func: Callable[..., NoneType]) ‑> Optional[Callable[..., Optional[BoltResponse]]] +def error(self, func: Callable[..., Optional[BoltResponse]]) ‑> Optional[Callable[..., Optional[BoltResponse]]]

    Updates the global error handler. This method can be used as either a decorator or a method.

    @@ -2959,7 +3211,7 @@

    Args

    Expand source code
    def error(
    -    self, func: Callable[..., None]
    +    self, func: Callable[..., Optional[BoltResponse]]
     ) -> Optional[Callable[..., Optional[BoltResponse]]]:
         """Updates the global error handler. This method can be used as either a decorator or a method.
     
    @@ -3928,17 +4180,20 @@ 

    Index

    • App

      -
        +
        • action
        • attachment_action
        • block_action
        • block_suggestion
        • client
        • command
        • +
        • default_app_uninstalled_event_listener
        • +
        • default_tokens_revoked_event_listener
        • dialog_cancellation
        • dialog_submission
        • dialog_suggestion
        • dispatch
        • +
        • enable_token_revocation_listeners
        • error
        • event
        • global_shortcut
        • @@ -3951,6 +4206,7 @@

          Appname
        • oauth_flow
        • options
        • +
        • process_before_response
        • shortcut
        • start
        • step
        • diff --git a/docs/api-docs/slack_bolt/app/async_app.html b/docs/api-docs/slack_bolt/app/async_app.html index 6ae9f8582..90e10ae97 100644 --- a/docs/api-docs/slack_bolt/app/async_app.html +++ b/docs/api-docs/slack_bolt/app/async_app.html @@ -35,6 +35,10 @@

          Module slack_bolt.app.async_app

          from aiohttp import web from slack_bolt.app.async_server import AsyncSlackAppServer +from slack_bolt.listener.async_builtins import AsyncTokenRevocationListeners +from slack_bolt.listener.async_listener_completion_handler import ( + AsyncDefaultListenerCompletionHandler, +) from slack_bolt.listener.asyncio_runner import AsyncioListenerRunner from slack_bolt.middleware.message_listener_matches.async_message_listener_matches import ( AsyncMessageListenerMatches, @@ -57,7 +61,7 @@

          Module slack_bolt.app.async_app

          AsyncCallableAuthorize, AsyncInstallationStoreAuthorize, ) -from slack_bolt.error import BoltError +from slack_bolt.error import BoltError, BoltUnhandledRequestError from slack_bolt.logger.messages import ( warning_client_prioritized_and_token_skipped, warning_token_skipped, @@ -74,6 +78,8 @@

          Module slack_bolt.app.async_app

          warning_bot_only_conflicts, debug_return_listener_middleware_response, info_default_oauth_settings_loaded, + error_installation_store_required_for_builtin_listeners, + warning_unhandled_by_global_middleware, ) from slack_bolt.lazy_listener.asyncio_runner import AsyncioLazyListenerRunner from slack_bolt.listener.async_listener import AsyncListener, AsyncCustomListener @@ -119,6 +125,8 @@

          Module slack_bolt.app.async_app

          name: Optional[str] = None, # Set True when you run this app on a FaaS platform process_before_response: bool = False, + # Set True if you want to handle an unhandled request as an exception + raise_error_for_unhandled_request: bool = False, # Basic Information > Credentials > Signing Secret signing_secret: Optional[str] = None, # for single-workspace apps @@ -126,6 +134,7 @@

          Module slack_bolt.app.async_app

          client: Optional[AsyncWebClient] = None, # for multi-workspace apps installation_store: Optional[AsyncInstallationStore] = None, + # for either only bot scope usage or v1.0.x compatibility installation_store_bot_only: Optional[bool] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, # for the OAuth flow @@ -164,6 +173,9 @@

          Module slack_bolt.app.async_app

          logger: The custom logger that can be used in this app. name: The application name that will be used in logging. If absent, the source file name will be used. process_before_response: True if this app runs on Function as a Service. (Default: False) + raise_error_for_unhandled_request: True if you want to raise exceptions for unhandled requests + and use @app.error listeners instead of + the built-in handler, which pints warning logs and returns 404 to Slack (Default: False) signing_secret: The Signing Secret value used for verifying requests from Slack. token: The bot/user access token required only for single-workspace app. client: The singleton `slack_sdk.web.async_client.AsyncWebClient` instance for this app. @@ -184,6 +196,7 @@

          Module slack_bolt.app.async_app

          "SLACK_VERIFICATION_TOKEN", None ) self._framework_logger = logger or get_bolt_logger(AsyncApp) + self._raise_error_for_unhandled_request = raise_error_for_unhandled_request self._token: Optional[str] = token @@ -300,6 +313,14 @@

          Module slack_bolt.app.async_app

          ) self._async_authorize.bot_only = app_bot_only + self._async_tokens_revocation_listeners: Optional[ + AsyncTokenRevocationListeners + ] = None + if self._async_installation_store is not None: + self._async_tokens_revocation_listeners = AsyncTokenRevocationListeners( + self._async_installation_store + ) + # -------------------------------------- # Middleware Initialization # -------------------------------------- @@ -307,12 +328,16 @@

          Module slack_bolt.app.async_app

          self._async_middleware_list: List[Union[Callable, AsyncMiddleware]] = [] self._async_listeners: List[AsyncListener] = [] + self._process_before_response = process_before_response self._async_listener_runner = AsyncioListenerRunner( logger=self._framework_logger, process_before_response=process_before_response, listener_error_handler=AsyncDefaultListenerErrorHandler( logger=self._framework_logger ), + listener_completion_handler=AsyncDefaultListenerCompletionHandler( + logger=self._framework_logger + ), lazy_listener_runner=AsyncioLazyListenerRunner( logger=self._framework_logger, ), @@ -383,6 +408,10 @@

          Module slack_bolt.app.async_app

          """The asyncio-based executor for asynchronously running listeners.""" return self._async_listener_runner + @property + def process_before_response(self) -> bool: + return self._process_before_response or False + # ------------------------- # standalone server @@ -471,9 +500,26 @@

          Module slack_bolt.app.async_app

          ) if not middleware_state["next_called"]: if resp is None: - return BoltResponse( + # next() method was not called without providing the response to return to Slack + # This should not be an intentional handling in usual use cases. + resp = BoltResponse( status=404, body={"error": "no next() calls in middleware"} ) + if self._raise_error_for_unhandled_request is True: + await self._async_listener_runner.listener_error_handler.handle( + error=BoltUnhandledRequestError( + request=req, + current_response=resp, + last_global_middleware_name=middleware.name, + ), + request=req, + response=resp, + ) + return resp + self._framework_logger.warning( + warning_unhandled_by_global_middleware(middleware.name, req) + ) + return resp return resp for listener in self._async_listeners: @@ -515,8 +561,27 @@

          Module slack_bolt.app.async_app

          if listener_response is not None: return listener_response + if resp is None: + resp = BoltResponse(status=404, body={"error": "unhandled request"}) + if self._raise_error_for_unhandled_request is True: + await self._async_listener_runner.listener_error_handler.handle( + error=BoltUnhandledRequestError( + request=req, + current_response=resp, + ), + request=req, + response=resp, + ) + return resp + return self._handle_unmatched_requests(req, resp) + + def _handle_unmatched_requests( + self, req: AsyncBoltRequest, resp: BoltResponse + ) -> BoltResponse: + # TODO: provide more info like suggestion of listeners + # e.g., You can handle this type of message with @app.event("app_mention") self._framework_logger.warning(warning_unhandled_request(req)) - return BoltResponse(status=404, body={"error": "unhandled request"}) + return resp # ------------------------- # middleware @@ -630,8 +695,8 @@

          Module slack_bolt.app.async_app

          # global error handler def error( - self, func: Callable[..., Awaitable[None]] - ) -> Callable[..., Awaitable[None]]: + self, func: Callable[..., Awaitable[Optional[BoltResponse]]] + ) -> Callable[..., Awaitable[Optional[BoltResponse]]]: """Updates the global error handler. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -649,6 +714,9 @@

          Module slack_bolt.app.async_app

          func: The function that is supposed to be executed when getting an unhandled error in Bolt app. """ + if not inspect.iscoroutinefunction(func): + name = get_name_for_callable(func) + raise BoltError(error_listener_function_must_be_coro_func(name)) self._async_listener_runner.listener_error_handler = ( AsyncCustomListenerErrorHandler( logger=self._framework_logger, @@ -1168,6 +1236,27 @@

          Module slack_bolt.app.async_app

          return __call__ + # ------------------------- + # built-in listener functions + + def default_tokens_revoked_event_listener( + self, + ) -> Callable[..., Awaitable[Optional[BoltResponse]]]: + if self._async_tokens_revocation_listeners is None: + raise BoltError(error_installation_store_required_for_builtin_listeners()) + return self._async_tokens_revocation_listeners.handle_tokens_revoked_events + + def default_app_uninstalled_event_listener( + self, + ) -> Callable[..., Awaitable[Optional[BoltResponse]]]: + if self._async_tokens_revocation_listeners is None: + raise BoltError(error_installation_store_required_for_builtin_listeners()) + return self._async_tokens_revocation_listeners.handle_app_uninstalled_events + + def enable_token_revocation_listeners(self) -> None: + self.event("tokens_revoked")(self.default_tokens_revoked_event_listener()) + self.event("app_uninstalled")(self.default_app_uninstalled_event_listener()) + # ------------------------- def _init_context(self, req: AsyncBoltRequest): @@ -1264,7 +1353,7 @@

          Classes

          class AsyncApp -(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, client: Optional[slack_sdk.web.async_client.AsyncWebClient] = None, installation_store: Optional[slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore] = None, installation_store_bot_only: Optional[bool] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, oauth_settings: Optional[AsyncOAuthSettings] = None, oauth_flow: Optional[AsyncOAuthFlow] = None, verification_token: Optional[str] = None) +(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, client: Optional[slack_sdk.web.async_client.AsyncWebClient] = None, installation_store: Optional[slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore] = None, installation_store_bot_only: Optional[bool] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, oauth_settings: Optional[AsyncOAuthSettings] = None, oauth_flow: Optional[AsyncOAuthFlow] = None, verification_token: Optional[str] = None)

          Bolt App that provides functionalities to register middleware/listeners.

          @@ -1298,6 +1387,10 @@

          Args

          The application name that will be used in logging. If absent, the source file name will be used.
          process_before_response
          True if this app runs on Function as a Service. (Default: False)
          +
          raise_error_for_unhandled_request
          +
          True if you want to raise exceptions for unhandled requests +and use @app.error listeners instead of +the built-in handler, which pints warning logs and returns 404 to Slack (Default: False)
          signing_secret
          The Signing Secret value used for verifying requests from Slack.
          token
          @@ -1331,6 +1424,8 @@

          Args

          name: Optional[str] = None, # Set True when you run this app on a FaaS platform process_before_response: bool = False, + # Set True if you want to handle an unhandled request as an exception + raise_error_for_unhandled_request: bool = False, # Basic Information > Credentials > Signing Secret signing_secret: Optional[str] = None, # for single-workspace apps @@ -1338,6 +1433,7 @@

          Args

          client: Optional[AsyncWebClient] = None, # for multi-workspace apps installation_store: Optional[AsyncInstallationStore] = None, + # for either only bot scope usage or v1.0.x compatibility installation_store_bot_only: Optional[bool] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, # for the OAuth flow @@ -1376,6 +1472,9 @@

          Args

          logger: The custom logger that can be used in this app. name: The application name that will be used in logging. If absent, the source file name will be used. process_before_response: True if this app runs on Function as a Service. (Default: False) + raise_error_for_unhandled_request: True if you want to raise exceptions for unhandled requests + and use @app.error listeners instead of + the built-in handler, which pints warning logs and returns 404 to Slack (Default: False) signing_secret: The Signing Secret value used for verifying requests from Slack. token: The bot/user access token required only for single-workspace app. client: The singleton `slack_sdk.web.async_client.AsyncWebClient` instance for this app. @@ -1396,6 +1495,7 @@

          Args

          "SLACK_VERIFICATION_TOKEN", None ) self._framework_logger = logger or get_bolt_logger(AsyncApp) + self._raise_error_for_unhandled_request = raise_error_for_unhandled_request self._token: Optional[str] = token @@ -1512,6 +1612,14 @@

          Args

          ) self._async_authorize.bot_only = app_bot_only + self._async_tokens_revocation_listeners: Optional[ + AsyncTokenRevocationListeners + ] = None + if self._async_installation_store is not None: + self._async_tokens_revocation_listeners = AsyncTokenRevocationListeners( + self._async_installation_store + ) + # -------------------------------------- # Middleware Initialization # -------------------------------------- @@ -1519,12 +1627,16 @@

          Args

          self._async_middleware_list: List[Union[Callable, AsyncMiddleware]] = [] self._async_listeners: List[AsyncListener] = [] + self._process_before_response = process_before_response self._async_listener_runner = AsyncioListenerRunner( logger=self._framework_logger, process_before_response=process_before_response, listener_error_handler=AsyncDefaultListenerErrorHandler( logger=self._framework_logger ), + listener_completion_handler=AsyncDefaultListenerCompletionHandler( + logger=self._framework_logger + ), lazy_listener_runner=AsyncioLazyListenerRunner( logger=self._framework_logger, ), @@ -1595,6 +1707,10 @@

          Args

          """The asyncio-based executor for asynchronously running listeners.""" return self._async_listener_runner + @property + def process_before_response(self) -> bool: + return self._process_before_response or False + # ------------------------- # standalone server @@ -1683,9 +1799,26 @@

          Args

          ) if not middleware_state["next_called"]: if resp is None: - return BoltResponse( + # next() method was not called without providing the response to return to Slack + # This should not be an intentional handling in usual use cases. + resp = BoltResponse( status=404, body={"error": "no next() calls in middleware"} ) + if self._raise_error_for_unhandled_request is True: + await self._async_listener_runner.listener_error_handler.handle( + error=BoltUnhandledRequestError( + request=req, + current_response=resp, + last_global_middleware_name=middleware.name, + ), + request=req, + response=resp, + ) + return resp + self._framework_logger.warning( + warning_unhandled_by_global_middleware(middleware.name, req) + ) + return resp return resp for listener in self._async_listeners: @@ -1727,8 +1860,27 @@

          Args

          if listener_response is not None: return listener_response + if resp is None: + resp = BoltResponse(status=404, body={"error": "unhandled request"}) + if self._raise_error_for_unhandled_request is True: + await self._async_listener_runner.listener_error_handler.handle( + error=BoltUnhandledRequestError( + request=req, + current_response=resp, + ), + request=req, + response=resp, + ) + return resp + return self._handle_unmatched_requests(req, resp) + + def _handle_unmatched_requests( + self, req: AsyncBoltRequest, resp: BoltResponse + ) -> BoltResponse: + # TODO: provide more info like suggestion of listeners + # e.g., You can handle this type of message with @app.event("app_mention") self._framework_logger.warning(warning_unhandled_request(req)) - return BoltResponse(status=404, body={"error": "unhandled request"}) + return resp # ------------------------- # middleware @@ -1842,8 +1994,8 @@

          Args

          # global error handler def error( - self, func: Callable[..., Awaitable[None]] - ) -> Callable[..., Awaitable[None]]: + self, func: Callable[..., Awaitable[Optional[BoltResponse]]] + ) -> Callable[..., Awaitable[Optional[BoltResponse]]]: """Updates the global error handler. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -1861,6 +2013,9 @@

          Args

          func: The function that is supposed to be executed when getting an unhandled error in Bolt app. """ + if not inspect.iscoroutinefunction(func): + name = get_name_for_callable(func) + raise BoltError(error_listener_function_must_be_coro_func(name)) self._async_listener_runner.listener_error_handler = ( AsyncCustomListenerErrorHandler( logger=self._framework_logger, @@ -2380,6 +2535,27 @@

          Args

          return __call__ + # ------------------------- + # built-in listener functions + + def default_tokens_revoked_event_listener( + self, + ) -> Callable[..., Awaitable[Optional[BoltResponse]]]: + if self._async_tokens_revocation_listeners is None: + raise BoltError(error_installation_store_required_for_builtin_listeners()) + return self._async_tokens_revocation_listeners.handle_tokens_revoked_events + + def default_app_uninstalled_event_listener( + self, + ) -> Callable[..., Awaitable[Optional[BoltResponse]]]: + if self._async_tokens_revocation_listeners is None: + raise BoltError(error_installation_store_required_for_builtin_listeners()) + return self._async_tokens_revocation_listeners.handle_app_uninstalled_events + + def enable_token_revocation_listeners(self) -> None: + self.event("tokens_revoked")(self.default_tokens_revoked_event_listener()) + self.event("app_uninstalled")(self.default_app_uninstalled_event_listener()) + # ------------------------- def _init_context(self, req: AsyncBoltRequest): @@ -2551,6 +2727,18 @@

          Instance variables

          return self._async_oauth_flow

    +
    var process_before_response : bool
    +
    +
    +
    + +Expand source code + +
    @property
    +def process_before_response(self) -> bool:
    +    return self._process_before_response or False
    +
    +

    Methods

    @@ -2671,9 +2859,26 @@

    Returns

    ) if not middleware_state["next_called"]: if resp is None: - return BoltResponse( + # next() method was not called without providing the response to return to Slack + # This should not be an intentional handling in usual use cases. + resp = BoltResponse( status=404, body={"error": "no next() calls in middleware"} ) + if self._raise_error_for_unhandled_request is True: + await self._async_listener_runner.listener_error_handler.handle( + error=BoltUnhandledRequestError( + request=req, + current_response=resp, + last_global_middleware_name=middleware.name, + ), + request=req, + response=resp, + ) + return resp + self._framework_logger.warning( + warning_unhandled_by_global_middleware(middleware.name, req) + ) + return resp return resp for listener in self._async_listeners: @@ -2715,8 +2920,19 @@

    Returns

    if listener_response is not None: return listener_response - self._framework_logger.warning(warning_unhandled_request(req)) - return BoltResponse(status=404, body={"error": "unhandled request"})
    + if resp is None: + resp = BoltResponse(status=404, body={"error": "unhandled request"}) + if self._raise_error_for_unhandled_request is True: + await self._async_listener_runner.listener_error_handler.handle( + error=BoltUnhandledRequestError( + request=req, + current_response=resp, + ), + request=req, + response=resp, + ) + return resp + return self._handle_unmatched_requests(req, resp)
    @@ -2879,6 +3095,40 @@

    Args

    return __call__
    +
    +def default_app_uninstalled_event_listener(self) ‑> Callable[..., Awaitable[Optional[BoltResponse]]] +
    +
    +
    +
    + +Expand source code + +
    def default_app_uninstalled_event_listener(
    +    self,
    +) -> Callable[..., Awaitable[Optional[BoltResponse]]]:
    +    if self._async_tokens_revocation_listeners is None:
    +        raise BoltError(error_installation_store_required_for_builtin_listeners())
    +    return self._async_tokens_revocation_listeners.handle_app_uninstalled_events
    +
    +
    +
    +def default_tokens_revoked_event_listener(self) ‑> Callable[..., Awaitable[Optional[BoltResponse]]] +
    +
    +
    +
    + +Expand source code + +
    def default_tokens_revoked_event_listener(
    +    self,
    +) -> Callable[..., Awaitable[Optional[BoltResponse]]]:
    +    if self._async_tokens_revocation_listeners is None:
    +        raise BoltError(error_installation_store_required_for_builtin_listeners())
    +    return self._async_tokens_revocation_listeners.handle_tokens_revoked_events
    +
    +
    def dialog_cancellation(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]
    @@ -2966,8 +3216,22 @@

    Args

    return __call__ +
    +def enable_token_revocation_listeners(self) ‑> NoneType +
    +
    +
    +
    + +Expand source code + +
    def enable_token_revocation_listeners(self) -> None:
    +    self.event("tokens_revoked")(self.default_tokens_revoked_event_listener())
    +    self.event("app_uninstalled")(self.default_app_uninstalled_event_listener())
    +
    +
    -def error(self, func: Callable[..., Awaitable[NoneType]]) ‑> Callable[..., Awaitable[NoneType]] +def error(self, func: Callable[..., Awaitable[Optional[BoltResponse]]]) ‑> Callable[..., Awaitable[Optional[BoltResponse]]]

    Updates the global error handler. This method can be used as either a decorator or a method.

    @@ -2992,8 +3256,8 @@

    Args

    Expand source code
    def error(
    -    self, func: Callable[..., Awaitable[None]]
    -) -> Callable[..., Awaitable[None]]:
    +    self, func: Callable[..., Awaitable[Optional[BoltResponse]]]
    +) -> Callable[..., Awaitable[Optional[BoltResponse]]]:
         """Updates the global error handler. This method can be used as either a decorator or a method.
     
             # Use this method as a decorator
    @@ -3011,6 +3275,9 @@ 

    Args

    func: The function that is supposed to be executed when getting an unhandled error in Bolt app. """ + if not inspect.iscoroutinefunction(func): + name = get_name_for_callable(func) + raise BoltError(error_listener_function_must_be_coro_func(name)) self._async_listener_runner.listener_error_handler = ( AsyncCustomListenerErrorHandler( logger=self._framework_logger, @@ -3876,7 +4143,7 @@

    Index

    • AsyncApp

      -
        +
        • AsyncSlackAppServer
        • action
        • async_dispatch
        • @@ -3885,9 +4152,12 @@

          block_suggestion
        • client
        • command
        • +
        • default_app_uninstalled_event_listener
        • +
        • default_tokens_revoked_event_listener
        • dialog_cancellation
        • dialog_submission
        • dialog_suggestion
        • +
        • enable_token_revocation_listeners
        • error
        • event
        • global_shortcut
        • @@ -3900,6 +4170,7 @@

          name
        • oauth_flow
        • options
        • +
        • process_before_response
        • server
        • shortcut
        • start
        • diff --git a/docs/api-docs/slack_bolt/authorization/async_authorize.html b/docs/api-docs/slack_bolt/authorization/async_authorize.html index e5d4d30de..df4ef1743 100644 --- a/docs/api-docs/slack_bolt/authorization/async_authorize.html +++ b/docs/api-docs/slack_bolt/authorization/async_authorize.html @@ -121,6 +121,7 @@

          Module slack_bolt.authorization.async_authorizeModule slack_bolt.authorization.async_authorizeModule slack_bolt.authorization.async_authorizeModule slack_bolt.authorization.async_authorizeAncestors

          class AsyncInstallationStoreAuthorize(AsyncAuthorize):
               authorize_result_cache: Dict[str, AuthorizeResult]
               find_installation_available: Optional[bool]
          +    find_bot_available: Optional[bool]
           
               def __init__(
                   self,
          @@ -387,6 +410,7 @@ 

          Ancestors

          self.cache_enabled = cache_enabled self.authorize_result_cache = {} self.find_installation_available = None + self.find_bot_available = None async def __call__( self, @@ -401,12 +425,15 @@

          Ancestors

          self.find_installation_available = hasattr( self.installation_store, "async_find_installation" ) + if self.find_bot_available is None: + self.find_bot_available = hasattr(self.installation_store, "async_find_bot") bot_token: Optional[str] = None user_token: Optional[str] = None if not self.bot_only and self.find_installation_available: - # since v1.1, this is the default way + # Since v1.1, this is the default way. + # If you want to use find_bot / delete_bot only, you can set bot_only as True. try: # Note that this is the latest information for the org/workspace. # The installer may not be the user associated with this incoming request. @@ -417,47 +444,64 @@

          Ancestors

          team_id=team_id, is_enterprise_install=context.is_enterprise_install, ) - if installation is None: - self._debug_log_for_not_found(enterprise_id, team_id) - return None - - if installation.user_id != user_id: - # First off, remove the user token as the installer is a different user - installation.user_token = None - installation.user_scopes = [] - - # try to fetch the request user's installation - # to reflect the user's access token if exists - user_installation = ( - await self.installation_store.async_find_installation( - enterprise_id=enterprise_id, - team_id=team_id, - user_id=user_id, - is_enterprise_install=context.is_enterprise_install, + + if installation is not None: + if installation.user_id != user_id: + # First off, remove the user token as the installer is a different user + installation.user_token = None + installation.user_scopes = [] + + # try to fetch the request user's installation + # to reflect the user's access token if exists + user_installation = ( + await self.installation_store.async_find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + user_id=user_id, + is_enterprise_install=context.is_enterprise_install, + ) ) + if user_installation is not None: + # Overwrite the installation with the one for this user + installation = user_installation + + bot_token, user_token = ( + installation.bot_token, + installation.user_token, ) - if user_installation is not None: - # Overwrite the installation with the one for this user - installation = user_installation - bot_token, user_token = installation.bot_token, installation.user_token except NotImplementedError as _: self.find_installation_available = False - if self.bot_only or not self.find_installation_available: - # Use find_bot to get bot value (legacy) - bot: Optional[Bot] = await self.installation_store.async_find_bot( - enterprise_id=enterprise_id, - team_id=team_id, - is_enterprise_install=context.is_enterprise_install, + if ( + # If you intentionally use only find_bot / delete_bot, + self.bot_only + # If find_installation method is not available, + or not self.find_installation_available + # If find_installation did not return data and find_bot method is available, + or ( + self.find_bot_available is True + and bot_token is None + and user_token is None ) - if bot is None: - self._debug_log_for_not_found(enterprise_id, team_id) - return None - bot_token, user_token = bot.bot_token, None + ): + try: + bot: Optional[Bot] = await self.installation_store.async_find_bot( + enterprise_id=enterprise_id, + team_id=team_id, + is_enterprise_install=context.is_enterprise_install, + ) + if bot is not None: + bot_token = bot.bot_token + except NotImplementedError as _: + self.find_bot_available = False + except Exception as e: + self.logger.info(f"Failed to call find_bot method: {e}") token: Optional[str] = bot_token or user_token if token is None: + # No valid token was found + self._debug_log_for_not_found(enterprise_id, team_id) return None # Check cache to see if the bot object already exists @@ -501,6 +545,10 @@

          Class variables

          +
          var find_bot_available : Optional[bool]
          +
          +
          +
          var find_installation_available : Optional[bool]
          @@ -533,6 +581,7 @@

          AsyncInstallationStoreAuthorize

          diff --git a/docs/api-docs/slack_bolt/authorization/authorize.html b/docs/api-docs/slack_bolt/authorization/authorize.html index d9f4819db..d498acdbf 100644 --- a/docs/api-docs/slack_bolt/authorization/authorize.html +++ b/docs/api-docs/slack_bolt/authorization/authorize.html @@ -124,6 +124,7 @@

          Module slack_bolt.authorization.authorize

          authorize_result_cache: Dict[str, AuthorizeResult] bot_only: bool find_installation_available: bool + find_bot_available: bool def __init__( self, @@ -143,6 +144,7 @@

          Module slack_bolt.authorization.authorize

          self.find_installation_available = hasattr( installation_store, "find_installation" ) + self.find_bot_available = hasattr(installation_store, "find_bot") def __call__( self, @@ -157,7 +159,8 @@

          Module slack_bolt.authorization.authorize

          user_token: Optional[str] = None if not self.bot_only and self.find_installation_available: - # since v1.1, this is the default way + # Since v1.1, this is the default way. + # If you want to use find_bot / delete_bot only, you can set bot_only as True. try: # Note that this is the latest information for the org/workspace. # The installer may not be the user associated with this incoming request. @@ -168,45 +171,61 @@

          Module slack_bolt.authorization.authorize

          team_id=team_id, is_enterprise_install=context.is_enterprise_install, ) - if installation is None: - self._debug_log_for_not_found(enterprise_id, team_id) - return None - - if installation.user_id != user_id: - # First off, remove the user token as the installer is a different user - installation.user_token = None - installation.user_scopes = [] - - # try to fetch the request user's installation - # to reflect the user's access token if exists - user_installation = self.installation_store.find_installation( - enterprise_id=enterprise_id, - team_id=team_id, - user_id=user_id, - is_enterprise_install=context.is_enterprise_install, + if installation is not None: + if installation.user_id != user_id: + # First off, remove the user token as the installer is a different user + installation.user_token = None + installation.user_scopes = [] + + # try to fetch the request user's installation + # to reflect the user's access token if exists + user_installation = self.installation_store.find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + user_id=user_id, + is_enterprise_install=context.is_enterprise_install, + ) + if user_installation is not None: + # Overwrite the installation with the one for this user + installation = user_installation + + bot_token, user_token = ( + installation.bot_token, + installation.user_token, ) - if user_installation is not None: - # Overwrite the installation with the one for this user - installation = user_installation - bot_token, user_token = installation.bot_token, installation.user_token except NotImplementedError as _: self.find_installation_available = False - if self.bot_only or not self.find_installation_available: - # Use find_bot to get bot value (legacy) - bot: Optional[Bot] = self.installation_store.find_bot( - enterprise_id=enterprise_id, - team_id=team_id, - is_enterprise_install=context.is_enterprise_install, + if ( + # If you intentionally use only find_bot / delete_bot, + self.bot_only + # If find_installation method is not available, + or not self.find_installation_available + # If find_installation did not return data and find_bot method is available, + or ( + self.find_bot_available is True + and bot_token is None + and user_token is None ) - if bot is None: - self._debug_log_for_not_found(enterprise_id, team_id) - return None - bot_token, user_token = bot.bot_token, None + ): + try: + bot: Optional[Bot] = self.installation_store.find_bot( + enterprise_id=enterprise_id, + team_id=team_id, + is_enterprise_install=context.is_enterprise_install, + ) + if bot is not None: + bot_token = bot.bot_token + except NotImplementedError as _: + self.find_bot_available = False + except Exception as e: + self.logger.info(f"Failed to call find_bot method: {e}") token: Optional[str] = bot_token or user_token if token is None: + # No valid token was found + self._debug_log_for_not_found(enterprise_id, team_id) return None # Check cache to see if the bot object already exists @@ -372,6 +391,7 @@

          Ancestors

          authorize_result_cache: Dict[str, AuthorizeResult] bot_only: bool find_installation_available: bool + find_bot_available: bool def __init__( self, @@ -391,6 +411,7 @@

          Ancestors

          self.find_installation_available = hasattr( installation_store, "find_installation" ) + self.find_bot_available = hasattr(installation_store, "find_bot") def __call__( self, @@ -405,7 +426,8 @@

          Ancestors

          user_token: Optional[str] = None if not self.bot_only and self.find_installation_available: - # since v1.1, this is the default way + # Since v1.1, this is the default way. + # If you want to use find_bot / delete_bot only, you can set bot_only as True. try: # Note that this is the latest information for the org/workspace. # The installer may not be the user associated with this incoming request. @@ -416,45 +438,61 @@

          Ancestors

          team_id=team_id, is_enterprise_install=context.is_enterprise_install, ) - if installation is None: - self._debug_log_for_not_found(enterprise_id, team_id) - return None - - if installation.user_id != user_id: - # First off, remove the user token as the installer is a different user - installation.user_token = None - installation.user_scopes = [] - - # try to fetch the request user's installation - # to reflect the user's access token if exists - user_installation = self.installation_store.find_installation( - enterprise_id=enterprise_id, - team_id=team_id, - user_id=user_id, - is_enterprise_install=context.is_enterprise_install, + if installation is not None: + if installation.user_id != user_id: + # First off, remove the user token as the installer is a different user + installation.user_token = None + installation.user_scopes = [] + + # try to fetch the request user's installation + # to reflect the user's access token if exists + user_installation = self.installation_store.find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + user_id=user_id, + is_enterprise_install=context.is_enterprise_install, + ) + if user_installation is not None: + # Overwrite the installation with the one for this user + installation = user_installation + + bot_token, user_token = ( + installation.bot_token, + installation.user_token, ) - if user_installation is not None: - # Overwrite the installation with the one for this user - installation = user_installation - bot_token, user_token = installation.bot_token, installation.user_token except NotImplementedError as _: self.find_installation_available = False - if self.bot_only or not self.find_installation_available: - # Use find_bot to get bot value (legacy) - bot: Optional[Bot] = self.installation_store.find_bot( - enterprise_id=enterprise_id, - team_id=team_id, - is_enterprise_install=context.is_enterprise_install, + if ( + # If you intentionally use only find_bot / delete_bot, + self.bot_only + # If find_installation method is not available, + or not self.find_installation_available + # If find_installation did not return data and find_bot method is available, + or ( + self.find_bot_available is True + and bot_token is None + and user_token is None ) - if bot is None: - self._debug_log_for_not_found(enterprise_id, team_id) - return None - bot_token, user_token = bot.bot_token, None + ): + try: + bot: Optional[Bot] = self.installation_store.find_bot( + enterprise_id=enterprise_id, + team_id=team_id, + is_enterprise_install=context.is_enterprise_install, + ) + if bot is not None: + bot_token = bot.bot_token + except NotImplementedError as _: + self.find_bot_available = False + except Exception as e: + self.logger.info(f"Failed to call find_bot method: {e}") token: Optional[str] = bot_token or user_token if token is None: + # No valid token was found + self._debug_log_for_not_found(enterprise_id, team_id) return None # Check cache to see if the bot object already exists @@ -502,6 +540,10 @@

          Class variables

          +
          var find_bot_available : bool
          +
          +
          +
          var find_installation_available : bool
          @@ -535,6 +577,7 @@

        • authorize_result_cache
        • bot_only
        • +
        • find_bot_available
        • find_installation_available
        diff --git a/docs/api-docs/slack_bolt/error/index.html b/docs/api-docs/slack_bolt/error/index.html index ebd564c85..9b104c4e3 100644 --- a/docs/api-docs/slack_bolt/error/index.html +++ b/docs/api-docs/slack_bolt/error/index.html @@ -28,8 +28,30 @@

        Module slack_bolt.error

        Expand source code
        """Bolt specific error types."""
        +from typing import Optional, Union
        +
        +
         class BoltError(Exception):
        -    """General class in a Bolt app"""
        + """General class in a Bolt app""" + + +class BoltUnhandledRequestError(BoltError): + request: "BoltRequest" # type: ignore + body: dict + current_response: Optional["BoltResponse"] # type: ignore + last_global_middleware_name: Optional[str] + + def __init__( # type: ignore + self, + *, + request: Union["BoltRequest", "AsyncBoltRequest"], # type: ignore + current_response: Optional["BoltResponse"], # type: ignore + last_global_middleware_name: Optional[str] = None, + ): + self.request = request + self.body = request.body if request is not None else {} + self.current_response = current_response + self.last_global_middleware_name = last_global_middleware_name
    @@ -59,6 +81,64 @@

    Ancestors

  • builtins.Exception
  • builtins.BaseException
  • +

    Subclasses

    + +
    +
    +class BoltUnhandledRequestError +(*, request: Union[ForwardRef('BoltRequest'), ForwardRef('AsyncBoltRequest')], current_response: Optional[ForwardRef('BoltResponse')], last_global_middleware_name: Optional[str] = None) +
    +
    +

    General class in a Bolt app

    +
    + +Expand source code + +
    class BoltUnhandledRequestError(BoltError):
    +    request: "BoltRequest"  # type: ignore
    +    body: dict
    +    current_response: Optional["BoltResponse"]  # type: ignore
    +    last_global_middleware_name: Optional[str]
    +
    +    def __init__(  # type: ignore
    +        self,
    +        *,
    +        request: Union["BoltRequest", "AsyncBoltRequest"],  # type: ignore
    +        current_response: Optional["BoltResponse"],  # type: ignore
    +        last_global_middleware_name: Optional[str] = None,
    +    ):
    +        self.request = request
    +        self.body = request.body if request is not None else {}
    +        self.current_response = current_response
    +        self.last_global_middleware_name = last_global_middleware_name
    +
    +

    Ancestors

    +
      +
    • BoltError
    • +
    • builtins.Exception
    • +
    • builtins.BaseException
    • +
    +

    Class variables

    +
    +
    var body : dict
    +
    +
    +
    +
    var current_response : Optional[BoltResponse]
    +
    +
    +
    +
    var last_global_middleware_name : Optional[str]
    +
    +
    +
    +
    var request : BoltRequest
    +
    +
    +
    +
    @@ -79,6 +159,15 @@

    Index

  • BoltError

  • +
  • +

    BoltUnhandledRequestError

    + +
  • diff --git a/docs/api-docs/slack_bolt/lazy_listener/thread_runner.html b/docs/api-docs/slack_bolt/lazy_listener/thread_runner.html index 022d4b2c1..9505ade3d 100644 --- a/docs/api-docs/slack_bolt/lazy_listener/thread_runner.html +++ b/docs/api-docs/slack_bolt/lazy_listener/thread_runner.html @@ -99,6 +99,10 @@

    Ancestors

    +

    Subclasses

    +

    Class variables

    var logger : logging.Logger
    diff --git a/docs/api-docs/slack_bolt/listener/async_builtins.html b/docs/api-docs/slack_bolt/listener/async_builtins.html new file mode 100644 index 000000000..f04b99904 --- /dev/null +++ b/docs/api-docs/slack_bolt/listener/async_builtins.html @@ -0,0 +1,207 @@ + + + + + + +slack_bolt.listener.async_builtins API documentation + + + + + + + + + + + +
    +
    +
    +

    Module slack_bolt.listener.async_builtins

    +
    +
    +
    + +Expand source code + +
    from slack_bolt.context.async_context import AsyncBoltContext
    +from slack_sdk.oauth.installation_store.async_installation_store import (
    +    AsyncInstallationStore,
    +)
    +
    +
    +class AsyncTokenRevocationListeners:
    +    """Listener functions to handle token revocation / uninstallation events"""
    +
    +    installation_store: AsyncInstallationStore
    +
    +    def __init__(self, installation_store: AsyncInstallationStore):
    +        self.installation_store = installation_store
    +
    +    async def handle_tokens_revoked_events(
    +        self, event: dict, context: AsyncBoltContext
    +    ) -> None:
    +        user_ids = event.get("tokens", {}).get("oauth", [])
    +        if len(user_ids) > 0:
    +            for user_id in user_ids:
    +                await self.installation_store.async_delete_installation(
    +                    enterprise_id=context.enterprise_id,
    +                    team_id=context.team_id,
    +                    user_id=user_id,
    +                )
    +        bots = event.get("tokens", {}).get("bot", [])
    +        if len(bots) > 0:
    +            await self.installation_store.async_delete_bot(
    +                enterprise_id=context.enterprise_id,
    +                team_id=context.team_id,
    +            )
    +
    +    async def handle_app_uninstalled_events(self, context: AsyncBoltContext) -> None:
    +        await self.installation_store.async_delete_all(
    +            enterprise_id=context.enterprise_id,
    +            team_id=context.team_id,
    +        )
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Classes

    +
    +
    +class AsyncTokenRevocationListeners +(installation_store: slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore) +
    +
    +

    Listener functions to handle token revocation / uninstallation events

    +
    + +Expand source code + +
    class AsyncTokenRevocationListeners:
    +    """Listener functions to handle token revocation / uninstallation events"""
    +
    +    installation_store: AsyncInstallationStore
    +
    +    def __init__(self, installation_store: AsyncInstallationStore):
    +        self.installation_store = installation_store
    +
    +    async def handle_tokens_revoked_events(
    +        self, event: dict, context: AsyncBoltContext
    +    ) -> None:
    +        user_ids = event.get("tokens", {}).get("oauth", [])
    +        if len(user_ids) > 0:
    +            for user_id in user_ids:
    +                await self.installation_store.async_delete_installation(
    +                    enterprise_id=context.enterprise_id,
    +                    team_id=context.team_id,
    +                    user_id=user_id,
    +                )
    +        bots = event.get("tokens", {}).get("bot", [])
    +        if len(bots) > 0:
    +            await self.installation_store.async_delete_bot(
    +                enterprise_id=context.enterprise_id,
    +                team_id=context.team_id,
    +            )
    +
    +    async def handle_app_uninstalled_events(self, context: AsyncBoltContext) -> None:
    +        await self.installation_store.async_delete_all(
    +            enterprise_id=context.enterprise_id,
    +            team_id=context.team_id,
    +        )
    +
    +

    Class variables

    +
    +
    var installation_store : slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore
    +
    +
    +
    +
    +

    Methods

    +
    +
    +async def handle_app_uninstalled_events(self, context: AsyncBoltContext) ‑> NoneType +
    +
    +
    +
    + +Expand source code + +
    async def handle_app_uninstalled_events(self, context: AsyncBoltContext) -> None:
    +    await self.installation_store.async_delete_all(
    +        enterprise_id=context.enterprise_id,
    +        team_id=context.team_id,
    +    )
    +
    +
    +
    +async def handle_tokens_revoked_events(self, event: dict, context: AsyncBoltContext) ‑> NoneType +
    +
    +
    +
    + +Expand source code + +
    async def handle_tokens_revoked_events(
    +    self, event: dict, context: AsyncBoltContext
    +) -> None:
    +    user_ids = event.get("tokens", {}).get("oauth", [])
    +    if len(user_ids) > 0:
    +        for user_id in user_ids:
    +            await self.installation_store.async_delete_installation(
    +                enterprise_id=context.enterprise_id,
    +                team_id=context.team_id,
    +                user_id=user_id,
    +            )
    +    bots = event.get("tokens", {}).get("bot", [])
    +    if len(bots) > 0:
    +        await self.installation_store.async_delete_bot(
    +            enterprise_id=context.enterprise_id,
    +            team_id=context.team_id,
    +        )
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/async_internals.html b/docs/api-docs/slack_bolt/listener/async_internals.html new file mode 100644 index 000000000..5b7f4a507 --- /dev/null +++ b/docs/api-docs/slack_bolt/listener/async_internals.html @@ -0,0 +1,116 @@ + + + + + + +slack_bolt.listener.async_internals API documentation + + + + + + + + + + + +
    +
    +
    +

    Module slack_bolt.listener.async_internals

    +
    +
    +
    + +Expand source code + +
    from logging import Logger
    +from typing import Dict, Any, Optional
    +
    +from slack_bolt.request.async_request import AsyncBoltRequest
    +from slack_bolt.request.payload_utils import (
    +    to_options,
    +    to_shortcut,
    +    to_action,
    +    to_view,
    +    to_command,
    +    to_event,
    +    to_message,
    +    to_step,
    +)
    +from slack_bolt.response import BoltResponse
    +
    +
    +def _build_all_available_args(
    +    logger: Logger,
    +    request: AsyncBoltRequest,
    +    response: Optional[BoltResponse],
    +    error: Optional[Exception] = None,
    +) -> Dict[str, Any]:
    +    all_available_args = {
    +        "logger": logger,
    +        "error": error,
    +        "client": request.context.client,
    +        "req": request,
    +        "request": request,
    +        "resp": response,
    +        "response": response,
    +        "context": request.context,
    +        # payload
    +        "body": request.body,
    +        "options": to_options(request.body),
    +        "shortcut": to_shortcut(request.body),
    +        "action": to_action(request.body),
    +        "view": to_view(request.body),
    +        "command": to_command(request.body),
    +        "event": to_event(request.body),
    +        "message": to_message(request.body),
    +        "step": to_step(request.body),
    +        # utilities
    +        "say": request.context.say,
    +        "respond": request.context.respond,
    +    }
    +    all_available_args["payload"] = (
    +        all_available_args["options"]
    +        or all_available_args["shortcut"]
    +        or all_available_args["action"]
    +        or all_available_args["view"]
    +        or all_available_args["command"]
    +        or all_available_args["event"]
    +        or all_available_args["message"]
    +        or all_available_args["step"]
    +        or request.body
    +    )
    +    return all_available_args
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/async_listener_completion_handler.html b/docs/api-docs/slack_bolt/listener/async_listener_completion_handler.html new file mode 100644 index 000000000..3ec3f124a --- /dev/null +++ b/docs/api-docs/slack_bolt/listener/async_listener_completion_handler.html @@ -0,0 +1,292 @@ + + + + + + +slack_bolt.listener.async_listener_completion_handler API documentation + + + + + + + + + + + +
    +
    +
    +

    Module slack_bolt.listener.async_listener_completion_handler

    +
    +
    +
    + +Expand source code + +
    import inspect
    +from abc import ABCMeta, abstractmethod
    +from logging import Logger
    +from typing import Callable, Dict, Any, Awaitable, Optional
    +
    +from slack_bolt.listener.async_internals import (
    +    _build_all_available_args,
    +)
    +from slack_bolt.listener.internals import (
    +    _convert_all_available_args_to_kwargs,
    +)
    +
    +from slack_bolt.request.async_request import AsyncBoltRequest
    +from slack_bolt.response import BoltResponse
    +
    +
    +class AsyncListenerCompletionHandler(metaclass=ABCMeta):
    +    @abstractmethod
    +    async def handle(
    +        self,
    +        request: AsyncBoltRequest,
    +        response: Optional[BoltResponse],
    +    ) -> None:
    +        """Handles an unhandled exception.
    +
    +        Args:
    +            error: The raised exception.
    +            request: The request.
    +            response: The response.
    +        """
    +        raise NotImplementedError()
    +
    +
    +class AsyncCustomListenerCompletionHandler(AsyncListenerCompletionHandler):
    +    def __init__(self, logger: Logger, func: Callable[..., Awaitable[None]]):
    +        self.func = func
    +        self.logger = logger
    +        self.arg_names = inspect.getfullargspec(func).args
    +
    +    async def handle(
    +        self,
    +        request: AsyncBoltRequest,
    +        response: Optional[BoltResponse],
    +    ) -> None:
    +        all_available_args = _build_all_available_args(
    +            logger=self.logger,
    +            request=request,
    +            response=response,
    +        )
    +        kwargs: Dict[str, Any] = _convert_all_available_args_to_kwargs(
    +            all_available_args=all_available_args,
    +            arg_names=self.arg_names,
    +            logger=self.logger,
    +        )
    +        await self.func(**kwargs)
    +
    +
    +class AsyncDefaultListenerCompletionHandler(AsyncListenerCompletionHandler):
    +    def __init__(self, logger: Logger):
    +        self.logger = logger
    +
    +    async def handle(
    +        self,
    +        request: AsyncBoltRequest,
    +        response: Optional[BoltResponse],
    +    ):
    +        pass
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Classes

    +
    +
    +class AsyncCustomListenerCompletionHandler +(logger: logging.Logger, func: Callable[..., Awaitable[NoneType]]) +
    +
    +
    +
    + +Expand source code + +
    class AsyncCustomListenerCompletionHandler(AsyncListenerCompletionHandler):
    +    def __init__(self, logger: Logger, func: Callable[..., Awaitable[None]]):
    +        self.func = func
    +        self.logger = logger
    +        self.arg_names = inspect.getfullargspec(func).args
    +
    +    async def handle(
    +        self,
    +        request: AsyncBoltRequest,
    +        response: Optional[BoltResponse],
    +    ) -> None:
    +        all_available_args = _build_all_available_args(
    +            logger=self.logger,
    +            request=request,
    +            response=response,
    +        )
    +        kwargs: Dict[str, Any] = _convert_all_available_args_to_kwargs(
    +            all_available_args=all_available_args,
    +            arg_names=self.arg_names,
    +            logger=self.logger,
    +        )
    +        await self.func(**kwargs)
    +
    +

    Ancestors

    + +

    Inherited members

    + +
    +
    +class AsyncDefaultListenerCompletionHandler +(logger: logging.Logger) +
    +
    +
    +
    + +Expand source code + +
    class AsyncDefaultListenerCompletionHandler(AsyncListenerCompletionHandler):
    +    def __init__(self, logger: Logger):
    +        self.logger = logger
    +
    +    async def handle(
    +        self,
    +        request: AsyncBoltRequest,
    +        response: Optional[BoltResponse],
    +    ):
    +        pass
    +
    +

    Ancestors

    + +

    Inherited members

    + +
    +
    +class AsyncListenerCompletionHandler +
    +
    +
    +
    + +Expand source code + +
    class AsyncListenerCompletionHandler(metaclass=ABCMeta):
    +    @abstractmethod
    +    async def handle(
    +        self,
    +        request: AsyncBoltRequest,
    +        response: Optional[BoltResponse],
    +    ) -> None:
    +        """Handles an unhandled exception.
    +
    +        Args:
    +            error: The raised exception.
    +            request: The request.
    +            response: The response.
    +        """
    +        raise NotImplementedError()
    +
    +

    Subclasses

    + +

    Methods

    +
    +
    +async def handle(self, request: AsyncBoltRequest, response: Optional[BoltResponse]) ‑> NoneType +
    +
    +

    Handles an unhandled exception.

    +

    Args

    +
    +
    error
    +
    The raised exception.
    +
    request
    +
    The request.
    +
    response
    +
    The response.
    +
    +
    + +Expand source code + +
    @abstractmethod
    +async def handle(
    +    self,
    +    request: AsyncBoltRequest,
    +    response: Optional[BoltResponse],
    +) -> None:
    +    """Handles an unhandled exception.
    +
    +    Args:
    +        error: The raised exception.
    +        request: The request.
    +        response: The response.
    +    """
    +    raise NotImplementedError()
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/async_listener_error_handler.html b/docs/api-docs/slack_bolt/listener/async_listener_error_handler.html index 156ca10f9..5d1b73662 100644 --- a/docs/api-docs/slack_bolt/listener/async_listener_error_handler.html +++ b/docs/api-docs/slack_bolt/listener/async_listener_error_handler.html @@ -31,20 +31,16 @@

    Module slack_bolt.listener.async_listener_error_handler< from logging import Logger from typing import Callable, Dict, Any, Awaitable, Optional +from slack_bolt.listener.async_internals import ( + _build_all_available_args, +) +from slack_bolt.listener.internals import ( + _convert_all_available_args_to_kwargs, +) + from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse -from slack_bolt.request.payload_utils import ( - to_options, - to_shortcut, - to_action, - to_view, - to_command, - to_event, - to_message, - to_step, -) - class AsyncListenerErrorHandler(metaclass=ABCMeta): @abstractmethod @@ -65,7 +61,9 @@

    Module slack_bolt.listener.async_listener_error_handler< class AsyncCustomListenerErrorHandler(AsyncListenerErrorHandler): - def __init__(self, logger: Logger, func: Callable[..., Awaitable[None]]): + def __init__( + self, logger: Logger, func: Callable[..., Awaitable[Optional[BoltResponse]]] + ): self.func = func self.logger = logger self.arg_names = inspect.getfullargspec(func).args @@ -76,52 +74,24 @@

    Module slack_bolt.listener.async_listener_error_handler< request: AsyncBoltRequest, response: Optional[BoltResponse], ) -> None: - all_available_args = { - "logger": self.logger, - "error": error, - "client": request.context.client, - "req": request, - "request": request, - "resp": response, - "response": response, - "context": request.context, - "body": request.body, - # payload - "body": request.body, - "options": to_options(request.body), - "shortcut": to_shortcut(request.body), - "action": to_action(request.body), - "view": to_view(request.body), - "command": to_command(request.body), - "event": to_event(request.body), - "message": to_message(request.body), - "step": to_step(request.body), - # utilities - "say": request.context.say, - "respond": request.context.respond, - } - all_available_args["payload"] = ( - all_available_args["options"] - or all_available_args["shortcut"] - or all_available_args["action"] - or all_available_args["view"] - or all_available_args["command"] - or all_available_args["event"] - or all_available_args["message"] - or all_available_args["step"] - or request.body + all_available_args = _build_all_available_args( + logger=self.logger, + error=error, + request=request, + response=response, ) - - kwargs: Dict[str, Any] = { # type: ignore - k: v for k, v in all_available_args.items() if k in self.arg_names # type: ignore - } - found_arg_names = kwargs.keys() - for name in self.arg_names: - if name not in found_arg_names: - self.logger.warning(f"{name} is not a valid argument") - kwargs[name] = None - - await self.func(**kwargs) + kwargs: Dict[str, Any] = _convert_all_available_args_to_kwargs( + all_available_args=all_available_args, + arg_names=self.arg_names, + logger=self.logger, + ) + returned_response = await self.func(**kwargs) + if returned_response is not None and isinstance( + returned_response, BoltResponse + ): + response.status = returned_response.status + response.headers = returned_response.headers + response.body = returned_response.body class AsyncDefaultListenerErrorHandler(AsyncListenerErrorHandler): @@ -149,7 +119,7 @@

    Classes

    class AsyncCustomListenerErrorHandler -(logger: logging.Logger, func: Callable[..., Awaitable[NoneType]]) +(logger: logging.Logger, func: Callable[..., Awaitable[Optional[BoltResponse]]])
    @@ -158,7 +128,9 @@

    Classes

    Expand source code
    class AsyncCustomListenerErrorHandler(AsyncListenerErrorHandler):
    -    def __init__(self, logger: Logger, func: Callable[..., Awaitable[None]]):
    +    def __init__(
    +        self, logger: Logger, func: Callable[..., Awaitable[Optional[BoltResponse]]]
    +    ):
             self.func = func
             self.logger = logger
             self.arg_names = inspect.getfullargspec(func).args
    @@ -169,52 +141,24 @@ 

    Classes

    request: AsyncBoltRequest, response: Optional[BoltResponse], ) -> None: - all_available_args = { - "logger": self.logger, - "error": error, - "client": request.context.client, - "req": request, - "request": request, - "resp": response, - "response": response, - "context": request.context, - "body": request.body, - # payload - "body": request.body, - "options": to_options(request.body), - "shortcut": to_shortcut(request.body), - "action": to_action(request.body), - "view": to_view(request.body), - "command": to_command(request.body), - "event": to_event(request.body), - "message": to_message(request.body), - "step": to_step(request.body), - # utilities - "say": request.context.say, - "respond": request.context.respond, - } - all_available_args["payload"] = ( - all_available_args["options"] - or all_available_args["shortcut"] - or all_available_args["action"] - or all_available_args["view"] - or all_available_args["command"] - or all_available_args["event"] - or all_available_args["message"] - or all_available_args["step"] - or request.body + all_available_args = _build_all_available_args( + logger=self.logger, + error=error, + request=request, + response=response, ) - - kwargs: Dict[str, Any] = { # type: ignore - k: v for k, v in all_available_args.items() if k in self.arg_names # type: ignore - } - found_arg_names = kwargs.keys() - for name in self.arg_names: - if name not in found_arg_names: - self.logger.warning(f"{name} is not a valid argument") - kwargs[name] = None - - await self.func(**kwargs)
    + kwargs: Dict[str, Any] = _convert_all_available_args_to_kwargs( + all_available_args=all_available_args, + arg_names=self.arg_names, + logger=self.logger, + ) + returned_response = await self.func(**kwargs) + if returned_response is not None and isinstance( + returned_response, BoltResponse + ): + response.status = returned_response.status + response.headers = returned_response.headers + response.body = returned_response.body

    Ancestors

      diff --git a/docs/api-docs/slack_bolt/listener/asyncio_runner.html b/docs/api-docs/slack_bolt/listener/asyncio_runner.html index 85a809379..20071b098 100644 --- a/docs/api-docs/slack_bolt/listener/asyncio_runner.html +++ b/docs/api-docs/slack_bolt/listener/asyncio_runner.html @@ -35,6 +35,9 @@

      Module slack_bolt.listener.asyncio_runner

      from slack_bolt.context.ack.async_ack import AsyncAck from slack_bolt.lazy_listener.async_runner import AsyncLazyListenerRunner from slack_bolt.listener.async_listener import AsyncListener +from slack_bolt.listener.async_listener_completion_handler import ( + AsyncListenerCompletionHandler, +) from slack_bolt.listener.async_listener_error_handler import AsyncListenerErrorHandler from slack_bolt.logger.messages import ( debug_responding, @@ -50,6 +53,7 @@

      Module slack_bolt.listener.asyncio_runner

      logger: Logger process_before_response: bool listener_error_handler: AsyncListenerErrorHandler + listener_completion_handler: AsyncListenerCompletionHandler lazy_listener_runner: AsyncLazyListenerRunner def __init__( @@ -57,11 +61,13 @@

      Module slack_bolt.listener.asyncio_runner

      logger: Logger, process_before_response: bool, listener_error_handler: AsyncListenerErrorHandler, + listener_completion_handler: AsyncListenerCompletionHandler, lazy_listener_runner: AsyncLazyListenerRunner, ): self.logger = logger self.process_before_response = process_before_response self.listener_error_handler = listener_error_handler + self.listener_completion_handler = listener_completion_handler self.lazy_listener_runner = lazy_listener_runner async def run( @@ -96,6 +102,10 @@

      Module slack_bolt.listener.asyncio_runner

      response=response, ) ack.response = response + finally: + await self.listener_completion_handler.handle( + request=request, response=response + ) for lazy_func in listener.lazy_functions: if request.lazy_function_name: @@ -149,6 +159,10 @@

      Module slack_bolt.listener.asyncio_runner

      response=response, ) ack.response = response + finally: + await self.listener_completion_handler.handle( + request=request, response=response + ) _f: Future = asyncio.ensure_future( run_ack_function_asynchronously(ack, request, response) @@ -224,7 +238,7 @@

      Classes

      class AsyncioListenerRunner -(logger: logging.Logger, process_before_response: bool, listener_error_handler: AsyncListenerErrorHandler, lazy_listener_runner: AsyncLazyListenerRunner) +(logger: logging.Logger, process_before_response: bool, listener_error_handler: AsyncListenerErrorHandler, listener_completion_handler: AsyncListenerCompletionHandler, lazy_listener_runner: AsyncLazyListenerRunner)
      @@ -236,6 +250,7 @@

      Classes

      logger: Logger process_before_response: bool listener_error_handler: AsyncListenerErrorHandler + listener_completion_handler: AsyncListenerCompletionHandler lazy_listener_runner: AsyncLazyListenerRunner def __init__( @@ -243,11 +258,13 @@

      Classes

      logger: Logger, process_before_response: bool, listener_error_handler: AsyncListenerErrorHandler, + listener_completion_handler: AsyncListenerCompletionHandler, lazy_listener_runner: AsyncLazyListenerRunner, ): self.logger = logger self.process_before_response = process_before_response self.listener_error_handler = listener_error_handler + self.listener_completion_handler = listener_completion_handler self.lazy_listener_runner = lazy_listener_runner async def run( @@ -282,6 +299,10 @@

      Classes

      response=response, ) ack.response = response + finally: + await self.listener_completion_handler.handle( + request=request, response=response + ) for lazy_func in listener.lazy_functions: if request.lazy_function_name: @@ -335,6 +356,10 @@

      Classes

      response=response, ) ack.response = response + finally: + await self.listener_completion_handler.handle( + request=request, response=response + ) _f: Future = asyncio.ensure_future( run_ack_function_asynchronously(ack, request, response) @@ -404,6 +429,10 @@

      Class variables

      +
      var listener_completion_handlerAsyncListenerCompletionHandler
      +
      +
      +
      var listener_error_handlerAsyncListenerErrorHandler
      @@ -460,6 +489,10 @@

      Methods

      response=response, ) ack.response = response + finally: + await self.listener_completion_handler.handle( + request=request, response=response + ) for lazy_func in listener.lazy_functions: if request.lazy_function_name: @@ -513,6 +546,10 @@

      Methods

      response=response, ) ack.response = response + finally: + await self.listener_completion_handler.handle( + request=request, response=response + ) _f: Future = asyncio.ensure_future( run_ack_function_asynchronously(ack, request, response) @@ -574,6 +611,7 @@

      Index

      AsyncioListenerRunner

      • lazy_listener_runner
      • +
      • listener_completion_handler
      • listener_error_handler
      • logger
      • process_before_response
      • diff --git a/docs/api-docs/slack_bolt/listener/builtins.html b/docs/api-docs/slack_bolt/listener/builtins.html new file mode 100644 index 000000000..bc0783730 --- /dev/null +++ b/docs/api-docs/slack_bolt/listener/builtins.html @@ -0,0 +1,201 @@ + + + + + + +slack_bolt.listener.builtins API documentation + + + + + + + + + + + +
        +
        +
        +

        Module slack_bolt.listener.builtins

        +
        +
        +
        + +Expand source code + +
        from slack_sdk.oauth import InstallationStore
        +
        +from slack_bolt.context.context import BoltContext
        +from slack_sdk.oauth.installation_store.installation_store import InstallationStore
        +
        +
        +class TokenRevocationListeners:
        +    """Listener functions to handle token revocation / uninstallation events"""
        +
        +    installation_store: InstallationStore
        +
        +    def __init__(self, installation_store: InstallationStore):
        +        self.installation_store = installation_store
        +
        +    def handle_tokens_revoked_events(self, event: dict, context: BoltContext) -> None:
        +        user_ids = event.get("tokens", {}).get("oauth", [])
        +        if len(user_ids) > 0:
        +            for user_id in user_ids:
        +                self.installation_store.delete_installation(
        +                    enterprise_id=context.enterprise_id,
        +                    team_id=context.team_id,
        +                    user_id=user_id,
        +                )
        +        bots = event.get("tokens", {}).get("bot", [])
        +        if len(bots) > 0:
        +            self.installation_store.delete_bot(
        +                enterprise_id=context.enterprise_id,
        +                team_id=context.team_id,
        +            )
        +
        +    def handle_app_uninstalled_events(self, context: BoltContext) -> None:
        +        self.installation_store.delete_all(
        +            enterprise_id=context.enterprise_id,
        +            team_id=context.team_id,
        +        )
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +

        Classes

        +
        +
        +class TokenRevocationListeners +(installation_store: slack_sdk.oauth.installation_store.installation_store.InstallationStore) +
        +
        +

        Listener functions to handle token revocation / uninstallation events

        +
        + +Expand source code + +
        class TokenRevocationListeners:
        +    """Listener functions to handle token revocation / uninstallation events"""
        +
        +    installation_store: InstallationStore
        +
        +    def __init__(self, installation_store: InstallationStore):
        +        self.installation_store = installation_store
        +
        +    def handle_tokens_revoked_events(self, event: dict, context: BoltContext) -> None:
        +        user_ids = event.get("tokens", {}).get("oauth", [])
        +        if len(user_ids) > 0:
        +            for user_id in user_ids:
        +                self.installation_store.delete_installation(
        +                    enterprise_id=context.enterprise_id,
        +                    team_id=context.team_id,
        +                    user_id=user_id,
        +                )
        +        bots = event.get("tokens", {}).get("bot", [])
        +        if len(bots) > 0:
        +            self.installation_store.delete_bot(
        +                enterprise_id=context.enterprise_id,
        +                team_id=context.team_id,
        +            )
        +
        +    def handle_app_uninstalled_events(self, context: BoltContext) -> None:
        +        self.installation_store.delete_all(
        +            enterprise_id=context.enterprise_id,
        +            team_id=context.team_id,
        +        )
        +
        +

        Class variables

        +
        +
        var installation_store : slack_sdk.oauth.installation_store.installation_store.InstallationStore
        +
        +
        +
        +
        +

        Methods

        +
        +
        +def handle_app_uninstalled_events(self, context: BoltContext) ‑> NoneType +
        +
        +
        +
        + +Expand source code + +
        def handle_app_uninstalled_events(self, context: BoltContext) -> None:
        +    self.installation_store.delete_all(
        +        enterprise_id=context.enterprise_id,
        +        team_id=context.team_id,
        +    )
        +
        +
        +
        +def handle_tokens_revoked_events(self, event: dict, context: BoltContext) ‑> NoneType +
        +
        +
        +
        + +Expand source code + +
        def handle_tokens_revoked_events(self, event: dict, context: BoltContext) -> None:
        +    user_ids = event.get("tokens", {}).get("oauth", [])
        +    if len(user_ids) > 0:
        +        for user_id in user_ids:
        +            self.installation_store.delete_installation(
        +                enterprise_id=context.enterprise_id,
        +                team_id=context.team_id,
        +                user_id=user_id,
        +            )
        +    bots = event.get("tokens", {}).get("bot", [])
        +    if len(bots) > 0:
        +        self.installation_store.delete_bot(
        +            enterprise_id=context.enterprise_id,
        +            team_id=context.team_id,
        +        )
        +
        +
        +
        +
        +
        +
        +
        + +
        + + + \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/index.html b/docs/api-docs/slack_bolt/listener/index.html index 1a86aaa21..0c6b922c1 100644 --- a/docs/api-docs/slack_bolt/listener/index.html +++ b/docs/api-docs/slack_bolt/listener/index.html @@ -49,10 +49,22 @@

        Module slack_bolt.listener

        Sub-modules

        +
        slack_bolt.listener.async_builtins
        +
        +
        +
        +
        slack_bolt.listener.async_internals
        +
        +
        +
        slack_bolt.listener.async_listener
        +
        slack_bolt.listener.async_listener_completion_handler
        +
        +
        +
        slack_bolt.listener.async_listener_error_handler
        @@ -61,14 +73,26 @@

        Sub-modules

        +
        slack_bolt.listener.builtins
        +
        +
        +
        slack_bolt.listener.custom_listener
        +
        slack_bolt.listener.internals
        +
        +
        +
        slack_bolt.listener.listener
        +
        slack_bolt.listener.listener_completion_handler
        +
        +
        +
        slack_bolt.listener.listener_error_handler
        @@ -99,11 +123,17 @@

        Index

      • Sub-modules

        diff --git a/docs/api-docs/slack_bolt/listener/internals.html b/docs/api-docs/slack_bolt/listener/internals.html new file mode 100644 index 000000000..c2104f104 --- /dev/null +++ b/docs/api-docs/slack_bolt/listener/internals.html @@ -0,0 +1,133 @@ + + + + + + +slack_bolt.listener.internals API documentation + + + + + + + + + + + +
        +
        +
        +

        Module slack_bolt.listener.internals

        +
        +
        +
        + +Expand source code + +
        from logging import Logger
        +from typing import Optional, Dict, Any, List
        +
        +from slack_bolt.request.request import BoltRequest
        +from slack_bolt.response.response import BoltResponse
        +
        +from slack_bolt.request.payload_utils import (
        +    to_options,
        +    to_shortcut,
        +    to_action,
        +    to_view,
        +    to_command,
        +    to_event,
        +    to_message,
        +    to_step,
        +)
        +
        +
        +def _build_all_available_args(
        +    logger: Logger,
        +    request: BoltRequest,
        +    response: Optional[BoltResponse],
        +    error: Optional[Exception] = None,
        +) -> Dict[str, Any]:
        +    all_available_args = {
        +        "logger": logger,
        +        "error": error,
        +        "client": request.context.client,
        +        "req": request,
        +        "request": request,
        +        "resp": response,
        +        "response": response,
        +        "context": request.context,
        +        # payload
        +        "body": request.body,
        +        "options": to_options(request.body),
        +        "shortcut": to_shortcut(request.body),
        +        "action": to_action(request.body),
        +        "view": to_view(request.body),
        +        "command": to_command(request.body),
        +        "event": to_event(request.body),
        +        "message": to_message(request.body),
        +        "step": to_step(request.body),
        +        # utilities
        +        "say": request.context.say,
        +        "respond": request.context.respond,
        +    }
        +    all_available_args["payload"] = (
        +        all_available_args["options"]
        +        or all_available_args["shortcut"]
        +        or all_available_args["action"]
        +        or all_available_args["view"]
        +        or all_available_args["command"]
        +        or all_available_args["event"]
        +        or all_available_args["message"]
        +        or all_available_args["step"]
        +        or request.body
        +    )
        +    return all_available_args
        +
        +
        +def _convert_all_available_args_to_kwargs(
        +    all_available_args: Dict[str, Any],
        +    arg_names: List[str],
        +    logger: Logger,
        +) -> Dict[str, Any]:
        +    kwargs: Dict[str, Any] = {  # type: ignore
        +        k: v for k, v in all_available_args.items() if k in arg_names  # type: ignore
        +    }
        +    found_arg_names = kwargs.keys()
        +    for name in arg_names:
        +        if name not in found_arg_names:
        +            logger.warning(f"{name} is not a valid argument")
        +            kwargs[name] = None
        +    return kwargs
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        + +
        + + + \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/listener_completion_handler.html b/docs/api-docs/slack_bolt/listener/listener_completion_handler.html new file mode 100644 index 000000000..c4a976548 --- /dev/null +++ b/docs/api-docs/slack_bolt/listener/listener_completion_handler.html @@ -0,0 +1,285 @@ + + + + + + +slack_bolt.listener.listener_completion_handler API documentation + + + + + + + + + + + +
        +
        +
        +

        Module slack_bolt.listener.listener_completion_handler

        +
        +
        +
        + +Expand source code + +
        import inspect
        +from abc import ABCMeta, abstractmethod
        +from logging import Logger
        +from typing import Callable, Dict, Any, Optional
        +
        +from slack_bolt.listener.internals import (
        +    _build_all_available_args,
        +    _convert_all_available_args_to_kwargs,
        +)
        +from slack_bolt.request.request import BoltRequest
        +from slack_bolt.response.response import BoltResponse
        +
        +
        +class ListenerCompletionHandler(metaclass=ABCMeta):
        +    @abstractmethod
        +    def handle(
        +        self,
        +        request: BoltRequest,
        +        response: Optional[BoltResponse],
        +    ) -> None:
        +        """Handles an unhandled exception.
        +
        +        Args:
        +            request: The request.
        +            response: The response.
        +        """
        +        raise NotImplementedError()
        +
        +
        +class CustomListenerCompletionHandler(ListenerCompletionHandler):
        +    def __init__(self, logger: Logger, func: Callable[..., None]):
        +        self.func = func
        +        self.logger = logger
        +        self.arg_names = inspect.getfullargspec(func).args
        +
        +    def handle(
        +        self,
        +        request: BoltRequest,
        +        response: Optional[BoltResponse],
        +    ):
        +        all_available_args = _build_all_available_args(
        +            logger=self.logger,
        +            request=request,
        +            response=response,
        +        )
        +        kwargs: Dict[str, Any] = _convert_all_available_args_to_kwargs(
        +            all_available_args=all_available_args,
        +            arg_names=self.arg_names,
        +            logger=self.logger,
        +        )
        +        self.func(**kwargs)
        +
        +
        +class DefaultListenerCompletionHandler(ListenerCompletionHandler):
        +    def __init__(self, logger: Logger):
        +        self.logger = logger
        +
        +    def handle(
        +        self,
        +        request: BoltRequest,
        +        response: Optional[BoltResponse],
        +    ):
        +        pass
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +

        Classes

        +
        +
        +class CustomListenerCompletionHandler +(logger: logging.Logger, func: Callable[..., NoneType]) +
        +
        +
        +
        + +Expand source code + +
        class CustomListenerCompletionHandler(ListenerCompletionHandler):
        +    def __init__(self, logger: Logger, func: Callable[..., None]):
        +        self.func = func
        +        self.logger = logger
        +        self.arg_names = inspect.getfullargspec(func).args
        +
        +    def handle(
        +        self,
        +        request: BoltRequest,
        +        response: Optional[BoltResponse],
        +    ):
        +        all_available_args = _build_all_available_args(
        +            logger=self.logger,
        +            request=request,
        +            response=response,
        +        )
        +        kwargs: Dict[str, Any] = _convert_all_available_args_to_kwargs(
        +            all_available_args=all_available_args,
        +            arg_names=self.arg_names,
        +            logger=self.logger,
        +        )
        +        self.func(**kwargs)
        +
        +

        Ancestors

        + +

        Inherited members

        + +
        +
        +class DefaultListenerCompletionHandler +(logger: logging.Logger) +
        +
        +
        +
        + +Expand source code + +
        class DefaultListenerCompletionHandler(ListenerCompletionHandler):
        +    def __init__(self, logger: Logger):
        +        self.logger = logger
        +
        +    def handle(
        +        self,
        +        request: BoltRequest,
        +        response: Optional[BoltResponse],
        +    ):
        +        pass
        +
        +

        Ancestors

        + +

        Inherited members

        + +
        +
        +class ListenerCompletionHandler +
        +
        +
        +
        + +Expand source code + +
        class ListenerCompletionHandler(metaclass=ABCMeta):
        +    @abstractmethod
        +    def handle(
        +        self,
        +        request: BoltRequest,
        +        response: Optional[BoltResponse],
        +    ) -> None:
        +        """Handles an unhandled exception.
        +
        +        Args:
        +            request: The request.
        +            response: The response.
        +        """
        +        raise NotImplementedError()
        +
        +

        Subclasses

        + +

        Methods

        +
        +
        +def handle(self, request: BoltRequest, response: Optional[BoltResponse]) ‑> NoneType +
        +
        +

        Handles an unhandled exception.

        +

        Args

        +
        +
        request
        +
        The request.
        +
        response
        +
        The response.
        +
        +
        + +Expand source code + +
        @abstractmethod
        +def handle(
        +    self,
        +    request: BoltRequest,
        +    response: Optional[BoltResponse],
        +) -> None:
        +    """Handles an unhandled exception.
        +
        +    Args:
        +        request: The request.
        +        response: The response.
        +    """
        +    raise NotImplementedError()
        +
        +
        +
        +
        +
        +
        +
        + +
        + + + \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/listener_error_handler.html b/docs/api-docs/slack_bolt/listener/listener_error_handler.html index a92ce6e33..675de1360 100644 --- a/docs/api-docs/slack_bolt/listener/listener_error_handler.html +++ b/docs/api-docs/slack_bolt/listener/listener_error_handler.html @@ -31,20 +31,14 @@

        Module slack_bolt.listener.listener_error_handler from logging import Logger from typing import Callable, Dict, Any, Optional +from slack_bolt.listener.internals import ( + _build_all_available_args, + _convert_all_available_args_to_kwargs, +) + from slack_bolt.request.request import BoltRequest from slack_bolt.response.response import BoltResponse -from slack_bolt.request.payload_utils import ( - to_options, - to_shortcut, - to_action, - to_view, - to_command, - to_event, - to_message, - to_step, -) - class ListenerErrorHandler(metaclass=ABCMeta): @abstractmethod @@ -65,7 +59,7 @@

        Module slack_bolt.listener.listener_error_handler class CustomListenerErrorHandler(ListenerErrorHandler): - def __init__(self, logger: Logger, func: Callable[..., None]): + def __init__(self, logger: Logger, func: Callable[..., Optional[BoltResponse]]): self.func = func self.logger = logger self.arg_names = inspect.getfullargspec(func).args @@ -76,52 +70,24 @@

        Module slack_bolt.listener.listener_error_handler request: BoltRequest, response: Optional[BoltResponse], ): - all_available_args = { - "logger": self.logger, - "error": error, - "client": request.context.client, - "req": request, - "request": request, - "resp": response, - "response": response, - "context": request.context, - "body": request.body, - # payload - "body": request.body, - "options": to_options(request.body), - "shortcut": to_shortcut(request.body), - "action": to_action(request.body), - "view": to_view(request.body), - "command": to_command(request.body), - "event": to_event(request.body), - "message": to_message(request.body), - "step": to_step(request.body), - # utilities - "say": request.context.say, - "respond": request.context.respond, - } - all_available_args["payload"] = ( - all_available_args["options"] - or all_available_args["shortcut"] - or all_available_args["action"] - or all_available_args["view"] - or all_available_args["command"] - or all_available_args["event"] - or all_available_args["message"] - or all_available_args["step"] - or request.body + all_available_args = _build_all_available_args( + logger=self.logger, + error=error, + request=request, + response=response, ) - - kwargs: Dict[str, Any] = { # type: ignore - k: v for k, v in all_available_args.items() if k in self.arg_names # type: ignore - } - found_arg_names = kwargs.keys() - for name in self.arg_names: - if name not in found_arg_names: - self.logger.warning(f"{name} is not a valid argument") - kwargs[name] = None - - self.func(**kwargs) + kwargs: Dict[str, Any] = _convert_all_available_args_to_kwargs( + all_available_args=all_available_args, + arg_names=self.arg_names, + logger=self.logger, + ) + returned_response = self.func(**kwargs) + if returned_response is not None and isinstance( + returned_response, BoltResponse + ): + response.status = returned_response.status + response.headers = returned_response.headers + response.body = returned_response.body class DefaultListenerErrorHandler(ListenerErrorHandler): @@ -149,7 +115,7 @@

        Classes

        class CustomListenerErrorHandler -(logger: logging.Logger, func: Callable[..., NoneType]) +(logger: logging.Logger, func: Callable[..., Optional[BoltResponse]])
        @@ -158,7 +124,7 @@

        Classes

        Expand source code
        class CustomListenerErrorHandler(ListenerErrorHandler):
        -    def __init__(self, logger: Logger, func: Callable[..., None]):
        +    def __init__(self, logger: Logger, func: Callable[..., Optional[BoltResponse]]):
                 self.func = func
                 self.logger = logger
                 self.arg_names = inspect.getfullargspec(func).args
        @@ -169,52 +135,24 @@ 

        Classes

        request: BoltRequest, response: Optional[BoltResponse], ): - all_available_args = { - "logger": self.logger, - "error": error, - "client": request.context.client, - "req": request, - "request": request, - "resp": response, - "response": response, - "context": request.context, - "body": request.body, - # payload - "body": request.body, - "options": to_options(request.body), - "shortcut": to_shortcut(request.body), - "action": to_action(request.body), - "view": to_view(request.body), - "command": to_command(request.body), - "event": to_event(request.body), - "message": to_message(request.body), - "step": to_step(request.body), - # utilities - "say": request.context.say, - "respond": request.context.respond, - } - all_available_args["payload"] = ( - all_available_args["options"] - or all_available_args["shortcut"] - or all_available_args["action"] - or all_available_args["view"] - or all_available_args["command"] - or all_available_args["event"] - or all_available_args["message"] - or all_available_args["step"] - or request.body + all_available_args = _build_all_available_args( + logger=self.logger, + error=error, + request=request, + response=response, ) - - kwargs: Dict[str, Any] = { # type: ignore - k: v for k, v in all_available_args.items() if k in self.arg_names # type: ignore - } - found_arg_names = kwargs.keys() - for name in self.arg_names: - if name not in found_arg_names: - self.logger.warning(f"{name} is not a valid argument") - kwargs[name] = None - - self.func(**kwargs)
        + kwargs: Dict[str, Any] = _convert_all_available_args_to_kwargs( + all_available_args=all_available_args, + arg_names=self.arg_names, + logger=self.logger, + ) + returned_response = self.func(**kwargs) + if returned_response is not None and isinstance( + returned_response, BoltResponse + ): + response.status = returned_response.status + response.headers = returned_response.headers + response.body = returned_response.body

        Ancestors

          diff --git a/docs/api-docs/slack_bolt/listener/thread_runner.html b/docs/api-docs/slack_bolt/listener/thread_runner.html index 94eeaa73a..d3dee70a9 100644 --- a/docs/api-docs/slack_bolt/listener/thread_runner.html +++ b/docs/api-docs/slack_bolt/listener/thread_runner.html @@ -33,6 +33,7 @@

          Module slack_bolt.listener.thread_runner

          from slack_bolt.lazy_listener import LazyListenerRunner from slack_bolt.listener import Listener +from slack_bolt.listener.listener_completion_handler import ListenerCompletionHandler from slack_bolt.listener.listener_error_handler import ListenerErrorHandler from slack_bolt.logger.messages import ( debug_responding, @@ -48,6 +49,7 @@

          Module slack_bolt.listener.thread_runner

          logger: Logger process_before_response: bool listener_error_handler: ListenerErrorHandler + listener_completion_handler: ListenerCompletionHandler listener_executor: ThreadPoolExecutor lazy_listener_runner: LazyListenerRunner @@ -56,12 +58,14 @@

          Module slack_bolt.listener.thread_runner

          logger: Logger, process_before_response: bool, listener_error_handler: ListenerErrorHandler, + listener_completion_handler: ListenerCompletionHandler, listener_executor: ThreadPoolExecutor, lazy_listener_runner: LazyListenerRunner, ): self.logger = logger self.process_before_response = process_before_response self.listener_error_handler = listener_error_handler + self.listener_completion_handler = listener_completion_handler self.listener_executor = listener_executor self.lazy_listener_runner = lazy_listener_runner @@ -97,6 +101,11 @@

          Module slack_bolt.listener.thread_runner

          response=response, ) ack.response = response + finally: + self.listener_completion_handler.handle( + request=request, + response=response, + ) for lazy_func in listener.lazy_functions: if request.lazy_function_name: @@ -150,6 +159,11 @@

          Module slack_bolt.listener.thread_runner

          response=response, ) ack.response = response + finally: + self.listener_completion_handler.handle( + request=request, + response=response, + ) self.listener_executor.submit(run_ack_function_asynchronously) @@ -221,7 +235,7 @@

          Classes

          class ThreadListenerRunner -(logger: logging.Logger, process_before_response: bool, listener_error_handler: ListenerErrorHandler, listener_executor: concurrent.futures.thread.ThreadPoolExecutor, lazy_listener_runner: LazyListenerRunner) +(logger: logging.Logger, process_before_response: bool, listener_error_handler: ListenerErrorHandler, listener_completion_handler: ListenerCompletionHandler, listener_executor: concurrent.futures.thread.ThreadPoolExecutor, lazy_listener_runner: LazyListenerRunner)
          @@ -233,6 +247,7 @@

          Classes

          logger: Logger process_before_response: bool listener_error_handler: ListenerErrorHandler + listener_completion_handler: ListenerCompletionHandler listener_executor: ThreadPoolExecutor lazy_listener_runner: LazyListenerRunner @@ -241,12 +256,14 @@

          Classes

          logger: Logger, process_before_response: bool, listener_error_handler: ListenerErrorHandler, + listener_completion_handler: ListenerCompletionHandler, listener_executor: ThreadPoolExecutor, lazy_listener_runner: LazyListenerRunner, ): self.logger = logger self.process_before_response = process_before_response self.listener_error_handler = listener_error_handler + self.listener_completion_handler = listener_completion_handler self.listener_executor = listener_executor self.lazy_listener_runner = lazy_listener_runner @@ -282,6 +299,11 @@

          Classes

          response=response, ) ack.response = response + finally: + self.listener_completion_handler.handle( + request=request, + response=response, + ) for lazy_func in listener.lazy_functions: if request.lazy_function_name: @@ -335,6 +357,11 @@

          Classes

          response=response, ) ack.response = response + finally: + self.listener_completion_handler.handle( + request=request, + response=response, + ) self.listener_executor.submit(run_ack_function_asynchronously) @@ -400,6 +427,10 @@

          Class variables

          +
          var listener_completion_handlerListenerCompletionHandler
          +
          +
          +
          var listener_error_handlerListenerErrorHandler
          @@ -460,6 +491,11 @@

          Methods

          response=response, ) ack.response = response + finally: + self.listener_completion_handler.handle( + request=request, + response=response, + ) for lazy_func in listener.lazy_functions: if request.lazy_function_name: @@ -513,6 +549,11 @@

          Methods

          response=response, ) ack.response = response + finally: + self.listener_completion_handler.handle( + request=request, + response=response, + ) self.listener_executor.submit(run_ack_function_asynchronously) @@ -572,6 +613,7 @@

          Index

          ThreadListenerRunner

          • lazy_listener_runner
          • +
          • listener_completion_handler
          • listener_error_handler
          • listener_executor
          • logger
          • diff --git a/docs/api-docs/slack_bolt/logger/messages.html b/docs/api-docs/slack_bolt/logger/messages.html index 4031c77a1..34dbd5365 100644 --- a/docs/api-docs/slack_bolt/logger/messages.html +++ b/docs/api-docs/slack_bolt/logger/messages.html @@ -86,6 +86,13 @@

            Module slack_bolt.logger.messages

            ) +def error_installation_store_required_for_builtin_listeners() -> str: + return ( + "To use the event listeners for token revocation handling, " + "setting a valid `installation_store` to `App`/`AsyncApp` is required." + ) + + # ------------------------------- # Warning # ------------------------------- @@ -106,7 +113,18 @@

            Module slack_bolt.logger.messages

            return "As you gave both `installation_store` and `oauth_settings`/`auth_flow`, the top level one is unused." -def warning_unhandled_request(req: Union[BoltRequest, "AsyncBoltRequest"]) -> str: # type: ignore +def warning_unhandled_by_global_middleware( # type: ignore + name: str, req: Union[BoltRequest, "AsyncBoltRequest"] # type: ignore +) -> str: # type: ignore + return ( + f"A global middleware ({name}) skipped calling `next()` " + f"without providing a response for the request ({req.body})" + ) + + +def warning_unhandled_request( # type: ignore + req: Union[BoltRequest, "AsyncBoltRequest"], # type: ignore +) -> str: # type: ignore return f"Unhandled request ({req.body})" @@ -315,6 +333,22 @@

            Functions

            return "`client` must be a slack_sdk.web.async_client.AsyncWebClient"
          +
          +def error_installation_store_required_for_builtin_listeners() ‑> str +
          +
          +
          +
          + +Expand source code + +
          def error_installation_store_required_for_builtin_listeners() -> str:
          +    return (
          +        "To use the event listeners for token revocation handling, "
          +        "setting a valid `installation_store` to `App`/`AsyncApp` is required."
          +    )
          +
          +
          def error_listener_function_must_be_coro_func(func_name: str) ‑> str
          @@ -506,6 +540,24 @@

          Functions

          )
        +
        +def warning_unhandled_by_global_middleware(name: str, req: Union[BoltRequest, ForwardRef('AsyncBoltRequest')]) ‑> str +
        +
        +
        +
        + +Expand source code + +
        def warning_unhandled_by_global_middleware(  # type: ignore
        +    name: str, req: Union[BoltRequest, "AsyncBoltRequest"]  # type: ignore
        +) -> str:  # type: ignore
        +    return (
        +        f"A global middleware ({name}) skipped calling `next()` "
        +        f"without providing a response for the request ({req.body})"
        +    )
        +
        +
        def warning_unhandled_request(req: Union[BoltRequest, ForwardRef('AsyncBoltRequest')]) ‑> str
        @@ -515,7 +567,9 @@

        Functions

        Expand source code -
        def warning_unhandled_request(req: Union[BoltRequest, "AsyncBoltRequest"]) -> str:  # type: ignore
        +
        def warning_unhandled_request(  # type: ignore
        +    req: Union[BoltRequest, "AsyncBoltRequest"],  # type: ignore
        +) -> str:  # type: ignore
             return f"Unhandled request ({req.body})"
      • @@ -547,6 +601,7 @@

        Index

      • error_authorize_conflicts
      • error_client_invalid_type
      • error_client_invalid_type_async
      • +
      • error_installation_store_required_for_builtin_listeners
      • error_listener_function_must_be_coro_func
      • error_message_event_type
      • error_oauth_flow_invalid_type_async
      • @@ -560,6 +615,7 @@

        Index

      • warning_installation_store_conflicts
      • warning_skip_uncommon_arg_name
      • warning_token_skipped
      • +
      • warning_unhandled_by_global_middleware
      • warning_unhandled_request
      diff --git a/docs/api-docs/slack_bolt/request/async_internals.html b/docs/api-docs/slack_bolt/request/async_internals.html index 78654c2a5..d8dec5586 100644 --- a/docs/api-docs/slack_bolt/request/async_internals.html +++ b/docs/api-docs/slack_bolt/request/async_internals.html @@ -34,27 +34,36 @@

      Module slack_bolt.request.async_internals

      extract_team_id, extract_user_id, extract_channel_id, + debug_multiple_response_urls_detected, ) def build_async_context( context: AsyncBoltContext, - payload: Dict[str, Any], + body: Dict[str, Any], ) -> AsyncBoltContext: - enterprise_id = extract_enterprise_id(payload) + enterprise_id = extract_enterprise_id(body) if enterprise_id: context["enterprise_id"] = enterprise_id - team_id = extract_team_id(payload) + team_id = extract_team_id(body) if team_id: context["team_id"] = team_id - user_id = extract_user_id(payload) + user_id = extract_user_id(body) if user_id: context["user_id"] = user_id - channel_id = extract_channel_id(payload) + channel_id = extract_channel_id(body) if channel_id: context["channel_id"] = channel_id - if "response_url" in payload: - context["response_url"] = payload["response_url"] + if "response_url" in body: + context["response_url"] = body["response_url"] + elif "response_urls" in body: + # In the case where response_url_enabled: true in a modal exists + response_urls = body["response_urls"] + if len(response_urls) >= 1: + if len(response_urls) > 1: + context.logger.debug(debug_multiple_response_urls_detected()) + response_url = response_urls[0].get("response_url") + context["response_url"] = response_url return context
      @@ -66,7 +75,7 @@

      Module slack_bolt.request.async_internals

      Functions

      -def build_async_context(context: AsyncBoltContext, payload: Dict[str, Any]) ‑> AsyncBoltContext +def build_async_context(context: AsyncBoltContext, body: Dict[str, Any]) ‑> AsyncBoltContext
      @@ -76,22 +85,30 @@

      Functions

      def build_async_context(
           context: AsyncBoltContext,
      -    payload: Dict[str, Any],
      +    body: Dict[str, Any],
       ) -> AsyncBoltContext:
      -    enterprise_id = extract_enterprise_id(payload)
      +    enterprise_id = extract_enterprise_id(body)
           if enterprise_id:
               context["enterprise_id"] = enterprise_id
      -    team_id = extract_team_id(payload)
      +    team_id = extract_team_id(body)
           if team_id:
               context["team_id"] = team_id
      -    user_id = extract_user_id(payload)
      +    user_id = extract_user_id(body)
           if user_id:
               context["user_id"] = user_id
      -    channel_id = extract_channel_id(payload)
      +    channel_id = extract_channel_id(body)
           if channel_id:
               context["channel_id"] = channel_id
      -    if "response_url" in payload:
      -        context["response_url"] = payload["response_url"]
      +    if "response_url" in body:
      +        context["response_url"] = body["response_url"]
      +    elif "response_urls" in body:
      +        # In the case where response_url_enabled: true in a modal exists
      +        response_urls = body["response_urls"]
      +        if len(response_urls) >= 1:
      +            if len(response_urls) > 1:
      +                context.logger.debug(debug_multiple_response_urls_detected())
      +            response_url = response_urls[0].get("response_url")
      +            context["response_url"] = response_url
           return context
      diff --git a/docs/api-docs/slack_bolt/request/internals.html b/docs/api-docs/slack_bolt/request/internals.html index ddde2c268..c65edf9d3 100644 --- a/docs/api-docs/slack_bolt/request/internals.html +++ b/docs/api-docs/slack_bolt/request/internals.html @@ -171,6 +171,14 @@

      Module slack_bolt.request.internals

      context["channel_id"] = channel_id if "response_url" in body: context["response_url"] = body["response_url"] + elif "response_urls" in body: + # In the case where response_url_enabled: true in a modal exists + response_urls = body["response_urls"] + if len(response_urls) >= 1: + if len(response_urls) > 1: + context.logger.debug(debug_multiple_response_urls_detected()) + response_url = response_urls[0].get("response_url") + context["response_url"] = response_url return context @@ -204,7 +212,15 @@

      Module slack_bolt.request.internals

      def error_message_unknown_request_body_type() -> str: - return "`body` must be either str or dict" + return "`body` must be either str or dict" + + +def debug_multiple_response_urls_detected() -> str: + return ( + "`response_urls` in the body has multiple URLs in it. " + "If you would like to use non-primary one, " + "please manually extract the one from body['response_urls']." + )
      @@ -239,6 +255,14 @@

      Functions

      context["channel_id"] = channel_id if "response_url" in body: context["response_url"] = body["response_url"] + elif "response_urls" in body: + # In the case where response_url_enabled: true in a modal exists + response_urls = body["response_urls"] + if len(response_urls) >= 1: + if len(response_urls) > 1: + context.logger.debug(debug_multiple_response_urls_detected()) + response_url = response_urls[0].get("response_url") + context["response_url"] = response_url return context
      @@ -269,6 +293,23 @@

      Functions

      return normalized_headers # type: ignore
    +
    +def debug_multiple_response_urls_detected() ‑> str +
    +
    +
    +
    + +Expand source code + +
    def debug_multiple_response_urls_detected() -> str:
    +    return (
    +        "`response_urls` in the body has multiple URLs in it. "
    +        "If you would like to use non-primary one, "
    +        "please manually extract the one from body['response_urls']."
    +    )
    +
    +
    def error_message_raw_body_required_in_http_mode() ‑> str
    @@ -516,6 +557,7 @@

    Index

    • build_context
    • build_normalized_headers
    • +
    • debug_multiple_response_urls_detected
    • error_message_raw_body_required_in_http_mode
    • error_message_unknown_request_body_type
    • extract_channel_id
    • diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index 25a0e96c5..ef1267173 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

      Module slack_bolt.version

      Expand source code
      """Check the latest version at https://pypi.org/project/slack-bolt/"""
      -__version__ = "1.4.4"
      +__version__ = "1.5.0"
      diff --git a/docs/api-docs/slack_bolt/workflows/step/async_step.html b/docs/api-docs/slack_bolt/workflows/step/async_step.html index e0a894ba5..ce9a05f5d 100644 --- a/docs/api-docs/slack_bolt/workflows/step/async_step.html +++ b/docs/api-docs/slack_bolt/workflows/step/async_step.html @@ -57,6 +57,7 @@

      Module slack_bolt.workflows.step.async_step

      """Steps from Apps Refer to https://api.slack.com/workflows/steps for details. """ + callback_id: Union[str, Pattern] _edit: Optional[AsyncListener] _save: Optional[AsyncListener] @@ -727,6 +728,7 @@

      Args

      """Steps from Apps Refer to https://api.slack.com/workflows/steps for details. """ + callback_id: Union[str, Pattern] _edit: Optional[AsyncListener] _save: Optional[AsyncListener] diff --git a/docs/api-docs/slack_bolt/workflows/step/async_step_middleware.html b/docs/api-docs/slack_bolt/workflows/step/async_step_middleware.html index 70729d8f4..4b6583b47 100644 --- a/docs/api-docs/slack_bolt/workflows/step/async_step_middleware.html +++ b/docs/api-docs/slack_bolt/workflows/step/async_step_middleware.html @@ -39,6 +39,7 @@

      Module slack_bolt.workflows.step.async_step_middlewareClasses

      class AsyncWorkflowStepMiddleware(AsyncMiddleware):  # type:ignore
           """Base middleware for workflow step specific ones"""
      +
           def __init__(self, step: AsyncWorkflowStep, listener_runner: AsyncioListenerRunner):
               self.step = step
               self.listener_runner = listener_runner
      diff --git a/docs/api-docs/slack_bolt/workflows/step/step.html b/docs/api-docs/slack_bolt/workflows/step/step.html
      index 79d76c480..f913db2b1 100644
      --- a/docs/api-docs/slack_bolt/workflows/step/step.html
      +++ b/docs/api-docs/slack_bolt/workflows/step/step.html
      @@ -52,6 +52,7 @@ 

      Module slack_bolt.workflows.step.step

      """Steps from Apps Refer to https://api.slack.com/workflows/steps for details. """ + callback_id: Union[str, Pattern] _edit: Optional[Listener] _save: Optional[Listener] @@ -707,6 +708,7 @@

      Args

      """Steps from Apps Refer to https://api.slack.com/workflows/steps for details. """ + callback_id: Union[str, Pattern] _edit: Optional[Listener] _save: Optional[Listener] diff --git a/docs/api-docs/slack_bolt/workflows/step/step_middleware.html b/docs/api-docs/slack_bolt/workflows/step/step_middleware.html index 4ef61250a..8be25951a 100644 --- a/docs/api-docs/slack_bolt/workflows/step/step_middleware.html +++ b/docs/api-docs/slack_bolt/workflows/step/step_middleware.html @@ -39,6 +39,7 @@

      Module slack_bolt.workflows.step.step_middleware< class WorkflowStepMiddleware(Middleware): # type:ignore """Base middleware for workflow step specific ones""" + def __init__(self, step: WorkflowStep, listener_runner: ThreadListenerRunner): self.step = step self.listener_runner = listener_runner @@ -105,6 +106,7 @@

      Classes

      class WorkflowStepMiddleware(Middleware):  # type:ignore
           """Base middleware for workflow step specific ones"""
      +
           def __init__(self, step: WorkflowStep, listener_runner: ThreadListenerRunner):
               self.step = step
               self.listener_runner = listener_runner
      diff --git a/docs/api-docs/slack_bolt/workflows/step/utilities/async_complete.html b/docs/api-docs/slack_bolt/workflows/step/utilities/async_complete.html
      index 007a22172..f75f2d8aa 100644
      --- a/docs/api-docs/slack_bolt/workflows/step/utilities/async_complete.html
      +++ b/docs/api-docs/slack_bolt/workflows/step/utilities/async_complete.html
      @@ -52,6 +52,7 @@ 

      Module slack_bolt.workflows.step.utilities.async_complet This utility is a thin wrapper of workflows.stepCompleted API method. Refer to https://api.slack.com/methods/workflows.stepCompleted for details. """ + def __init__(self, *, client: AsyncWebClient, body: dict): self.client = client self.body = body @@ -126,6 +127,7 @@

      Classes

      This utility is a thin wrapper of workflows.stepCompleted API method. Refer to https://api.slack.com/methods/workflows.stepCompleted for details. """ + def __init__(self, *, client: AsyncWebClient, body: dict): self.client = client self.body = body diff --git a/docs/api-docs/slack_bolt/workflows/step/utilities/async_configure.html b/docs/api-docs/slack_bolt/workflows/step/utilities/async_configure.html index 63fd0d2b7..e6436faef 100644 --- a/docs/api-docs/slack_bolt/workflows/step/utilities/async_configure.html +++ b/docs/api-docs/slack_bolt/workflows/step/utilities/async_configure.html @@ -62,6 +62,7 @@

      Module slack_bolt.workflows.step.utilities.async_configu Refer to https://api.slack.com/workflows/steps for details. """ + def __init__(self, *, callback_id: str, client: AsyncWebClient, body: dict): self.callback_id = callback_id self.client = client @@ -157,6 +158,7 @@

      Classes

      Refer to https://api.slack.com/workflows/steps for details. """ + def __init__(self, *, callback_id: str, client: AsyncWebClient, body: dict): self.callback_id = callback_id self.client = client diff --git a/docs/api-docs/slack_bolt/workflows/step/utilities/async_fail.html b/docs/api-docs/slack_bolt/workflows/step/utilities/async_fail.html index dccd6e8ef..56488dcd6 100644 --- a/docs/api-docs/slack_bolt/workflows/step/utilities/async_fail.html +++ b/docs/api-docs/slack_bolt/workflows/step/utilities/async_fail.html @@ -49,6 +49,7 @@

      Module slack_bolt.workflows.step.utilities.async_failClasses

      This utility is a thin wrapper of workflows.stepFailed API method. Refer to https://api.slack.com/methods/workflows.stepFailed for details. """ + def __init__(self, *, client: AsyncWebClient, body: dict): self.client = client self.body = body diff --git a/docs/api-docs/slack_bolt/workflows/step/utilities/async_update.html b/docs/api-docs/slack_bolt/workflows/step/utilities/async_update.html index 1f5309a69..ca8d703f9 100644 --- a/docs/api-docs/slack_bolt/workflows/step/utilities/async_update.html +++ b/docs/api-docs/slack_bolt/workflows/step/utilities/async_update.html @@ -68,6 +68,7 @@

      Module slack_bolt.workflows.step.utilities.async_update< This utility is a thin wrapper of workflows.stepFailed API method. Refer to https://api.slack.com/methods/workflows.updateStep for details. """ + def __init__(self, *, client: AsyncWebClient, body: dict): self.client = client self.body = body @@ -172,6 +173,7 @@

      Classes

      This utility is a thin wrapper of workflows.stepFailed API method. Refer to https://api.slack.com/methods/workflows.updateStep for details. """ + def __init__(self, *, client: AsyncWebClient, body: dict): self.client = client self.body = body diff --git a/docs/api-docs/slack_bolt/workflows/step/utilities/complete.html b/docs/api-docs/slack_bolt/workflows/step/utilities/complete.html index ff7734357..23023ee67 100644 --- a/docs/api-docs/slack_bolt/workflows/step/utilities/complete.html +++ b/docs/api-docs/slack_bolt/workflows/step/utilities/complete.html @@ -52,6 +52,7 @@

      Module slack_bolt.workflows.step.utilities.completeClasses

      This utility is a thin wrapper of workflows.stepCompleted API method. Refer to https://api.slack.com/methods/workflows.stepCompleted for details. """ + def __init__(self, *, client: WebClient, body: dict): self.client = client self.body = body diff --git a/docs/api-docs/slack_bolt/workflows/step/utilities/configure.html b/docs/api-docs/slack_bolt/workflows/step/utilities/configure.html index a3c55bd6e..92601779b 100644 --- a/docs/api-docs/slack_bolt/workflows/step/utilities/configure.html +++ b/docs/api-docs/slack_bolt/workflows/step/utilities/configure.html @@ -62,6 +62,7 @@

      Module slack_bolt.workflows.step.utilities.configureClasses

      Refer to https://api.slack.com/workflows/steps for details. """ + def __init__(self, *, callback_id: str, client: WebClient, body: dict): self.callback_id = callback_id self.client = client diff --git a/docs/api-docs/slack_bolt/workflows/step/utilities/fail.html b/docs/api-docs/slack_bolt/workflows/step/utilities/fail.html index e3fc5340b..a71efa254 100644 --- a/docs/api-docs/slack_bolt/workflows/step/utilities/fail.html +++ b/docs/api-docs/slack_bolt/workflows/step/utilities/fail.html @@ -49,6 +49,7 @@

      Module slack_bolt.workflows.step.utilities.failClasses

      This utility is a thin wrapper of workflows.stepFailed API method. Refer to https://api.slack.com/methods/workflows.stepFailed for details. """ + def __init__(self, *, client: WebClient, body: dict): self.client = client self.body = body diff --git a/docs/api-docs/slack_bolt/workflows/step/utilities/update.html b/docs/api-docs/slack_bolt/workflows/step/utilities/update.html index 3ba9f9af1..c14e8cc22 100644 --- a/docs/api-docs/slack_bolt/workflows/step/utilities/update.html +++ b/docs/api-docs/slack_bolt/workflows/step/utilities/update.html @@ -68,6 +68,7 @@

      Module slack_bolt.workflows.step.utilities.update This utility is a thin wrapper of workflows.stepFailed API method. Refer to https://api.slack.com/methods/workflows.updateStep for details. """ + def __init__(self, *, client: WebClient, body: dict): self.client = client self.body = body @@ -172,6 +173,7 @@

      Classes

      This utility is a thin wrapper of workflows.stepFailed API method. Refer to https://api.slack.com/methods/workflows.updateStep for details. """ + def __init__(self, *, client: WebClient, body: dict): self.client = client self.body = body From ee7befd1173cab368594fd8e919e264ab7d77de2 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 28 Apr 2021 10:35:58 +0900 Subject: [PATCH 168/719] Set pytype version to 2021.4.15 --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index dae01f300..7dde6f5aa 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -74,7 +74,7 @@ jobs: if [ ${python_version:7:3} == "3.8" ]; then pip install -e ".[async]" pip install -e ".[adapter]" - pip install "pytype" && pytype slack_bolt/ + pip install "pytype==2021.4.15" && pytype slack_bolt/ fi - name: Run all tests for codecov (3.9 only) run: | From 9f7f77b7cd488b9402a77c654840def8f823b4ad Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 28 Apr 2021 12:39:45 +0900 Subject: [PATCH 169/719] Add Japanese translation of Steps from Apps documents --- docs/_config.yml | 2 +- docs/_steps/adding_editing_workflow_step.md | 2 +- .../_steps/ja_adding_editing_workflow_step.md | 55 ++++++++++++++++++ docs/_steps/ja_creating_workflow_step.md | 49 ++++++++++++++++ docs/_steps/ja_executing_workflow_steps.md | 39 +++++++++++++ docs/_steps/ja_saving_workflow_step.md | 56 +++++++++++++++++++ docs/_steps/ja_workflow_steps_overview.md | 21 +++++++ 7 files changed, 222 insertions(+), 2 deletions(-) create mode 100644 docs/_steps/ja_adding_editing_workflow_step.md create mode 100644 docs/_steps/ja_creating_workflow_step.md create mode 100644 docs/_steps/ja_executing_workflow_steps.md create mode 100644 docs/_steps/ja_saving_workflow_step.md create mode 100644 docs/_steps/ja_workflow_steps_overview.md diff --git a/docs/_config.yml b/docs/_config.yml index c6437f1fa..083fa7c1d 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -37,7 +37,7 @@ t: contribute: Contributing ja-jp: basic: 基本的な概念 -# steps: ワークフローステップ + steps: ワークフローステップ # advanced: 応用コンセプト start: Bolt 入門ガイド # contribute: 貢献 diff --git a/docs/_steps/adding_editing_workflow_step.md b/docs/_steps/adding_editing_workflow_step.md index 55e040d62..bf7b5d960 100644 --- a/docs/_steps/adding_editing_workflow_step.md +++ b/docs/_steps/adding_editing_workflow_step.md @@ -9,7 +9,7 @@ order: 3 When a builder adds (or later edits) your step in their workflow, your app will receive a [`workflow_step_edit` event](https://api.slack.com/reference/workflows/workflow_step_edit). The `edit` callback in your `WorkflowStep` configuration will be run when this event is received. -Whether a builder is adding or editing a step, you need to send them a [workflow step configuration modal](https://api.slack.com/reference/workflows/configuration-view). This modal is where step-specific settings are chosen, and it has more restrictions than typical modals—most notably, it cannot include `title​`, `submit​`, or `close`​ properties. By default, the configuration modal's `callback_id` will be the same as the workflow step. +Whether a builder is adding or editing a step, you need to send them a [workflow step configuration modal](https://api.slack.com/reference/workflows/configuration-view). This modal is where step-specific settings are chosen, and it has more restrictions than typical modals—most notably, it cannot include `title`, `submit`, or `close` properties. By default, the configuration modal's `callback_id` will be the same as the workflow step. Within the `edit` callback, the `configure()` utility can be used to easily open your step's configuration modal by passing in the view's blocks with the corresponding `blocks` argument. To disable saving the configuration before certain conditions are met, you can also pass in `submit_disabled` with a value of `True`. diff --git a/docs/_steps/ja_adding_editing_workflow_step.md b/docs/_steps/ja_adding_editing_workflow_step.md new file mode 100644 index 000000000..e231825e1 --- /dev/null +++ b/docs/_steps/ja_adding_editing_workflow_step.md @@ -0,0 +1,55 @@ +--- +title: ステップの追加・編集 +lang: ja-jp +slug: adding-editing-steps +order: 3 +--- + +
      + +作成したワークフローステップがワークフローに追加またはその設定を変更されるタイミングで、[`workflow_step_edit` イベントがアプリに送信されます](https://api.slack.com/reference/workflows/workflow_step_edit)。このイベントがアプリに届くと、`WorkflowStep` で設定した `edit` コールバックが実行されます。 + +ステップの追加と編集のどちらが行われるときも、[ワークフローステップの設定モーダル](https://api.slack.com/reference/workflows/configuration-view)をビルダーに送信する必要があります。このモーダルは、そのステップ独自の設定を選択するための場所です。通常のモーダルより制限が強く、例えば `title`、`submit`、`close` のプロパティを含めることができません。設定モーダルの `callback_id` は、デフォルトではワークフローステップと同じものになります。 + +`edit` コールバック内で `configure()` ユーティリティを使用すると、対応する `blocks` 引数にビューのblocks 部分だけを渡して、ステップの設定モーダルを簡単に表示させることができます。必要な入力内容が揃うまで設定の保存を無効にするには、`True` の値をセットした `submit_disabled` を渡します。 + +設定モーダルの開き方について詳しくは、[ドキュメントを参照してください](https://api.slack.com/workflows/steps#handle_config_view)。 + +
      + +```python +def edit(ack, step, configure): + ack() + + blocks = [ + { + "type": "input", + "block_id": "task_name_input", + "element": { + "type": "plain_text_input", + "action_id": "name", + "placeholder": {"type": "plain_text", "text":"Add a task name"}, + }, + "label": {"type": "plain_text", "text":"Task name"}, + }, + { + "type": "input", + "block_id": "task_description_input", + "element": { + "type": "plain_text_input", + "action_id": "description", + "placeholder": {"type": "plain_text", "text":"Add a task description"}, + }, + "label": {"type": "plain_text", "text":"Task description"}, + }, + ] + configure(blocks=blocks) + +ws = WorkflowStep( + callback_id="add_task", + edit=edit, + save=save, + execute=execute, +) +app.step(ws) +``` diff --git a/docs/_steps/ja_creating_workflow_step.md b/docs/_steps/ja_creating_workflow_step.md new file mode 100644 index 000000000..d9438e0e4 --- /dev/null +++ b/docs/_steps/ja_creating_workflow_step.md @@ -0,0 +1,49 @@ +--- +title: ステップの定義 +lang: ja-jp +slug: creating-steps +order: 2 +--- + +
      + +ワークフローステップの作成には、Bolt が提供する `WorkflowStep` クラスを利用します。 + +ステップの `callback_id` と設定オブジェクトを指定して、`WorkflowStep` の新しいインスタンスを作成します。 + +設定オブジェクトは、`edit`、`save`、`execute` という 3 つのキーを持ちます。それぞれのキーは、単一のコールバック、またはコールバックのリストである必要があります。すべてのコールバックは、ワークフローステップのイベントに関する情報を保持する `step` オブジェクトにアクセスできます。 + +`WorkflowStep` のインスタンスを作成したら、それを`app.step()` メソッドに渡します。これによって、アプリがワークフローステップのイベントをリッスンし、設定オブジェクトで指定されたコールバックを使ってそれに応答できるようになります。 + +
      + +```python +import os +from slack_bolt import App +from slack_bolt.workflows.step import WorkflowStep + +# いつも通りBolt アプリを起動する +app = App( + token=os.environ.get("SLACK_BOT_TOKEN"), + signing_secret=os.environ.get("SLACK_SIGNING_SECRET") +) + +def edit(ack, step, configure): + pass + +def save(ack, view, update): + pass + +def execute(step, complete, fail): + pass + +# WorkflowStep の新しいインスタンスを作成する +ws = WorkflowStep( + callback_id="add_task", + edit=edit, + save=save, + execute=execute, +) +# ワークフローステップを渡してリスナーを設定する +app.step(ws) +``` diff --git a/docs/_steps/ja_executing_workflow_steps.md b/docs/_steps/ja_executing_workflow_steps.md new file mode 100644 index 000000000..c9540175d --- /dev/null +++ b/docs/_steps/ja_executing_workflow_steps.md @@ -0,0 +1,39 @@ +--- +title: ステップの実行 +lang: ja-jp +slug: executing-steps +order: 5 +--- + +
      + +エンドユーザーがワークフローステップを実行すると、アプリに [`workflow_step_execute` イベントが送信されます](https://api.slack.com/events/workflow_step_execute)。このイベントがアプリに届くと、`WorkflowStep` で設定した `execute` コールバックが実行されます。 + +`save` コールバックで取り出した `inputs` を使って、サードパーティの API を呼び出す、情報をデータベースに保存する、ユーザーのホームタブを更新するといった処理を実行することができます。また、ワークフローの後続のステップで利用する出力値を `outputs` オブジェクトに設定します。 + +`execute` コールバック内では、`complete()` を呼び出してステップの実行が成功したことを示すか、`fail()` を呼び出してステップの実行が失敗したことを示す必要があります。 + +
      + +```python +def execute(step, complete, fail): + inputs = step["inputs"] + # すべての処理が成功した場合 + outputs = { + "task_name": inputs["task_name"]["value"], + "task_description": inputs["task_description"]["value"], + } + complete(outputs=outputs) + + # 失敗した処理がある場合 + error = {"message":"Just testing step failure!"} + fail(error=error) + +ws = WorkflowStep( + callback_id="add_task", + edit=edit, + save=save, + execute=execute, +) +app.step(ws) +``` \ No newline at end of file diff --git a/docs/_steps/ja_saving_workflow_step.md b/docs/_steps/ja_saving_workflow_step.md new file mode 100644 index 000000000..80689bb41 --- /dev/null +++ b/docs/_steps/ja_saving_workflow_step.md @@ -0,0 +1,56 @@ +--- +title: ステップの設定の保存 +lang: ja-jp +slug: saving-steps +order: 4 +--- + +
      + +設定モーダルを開いた後、アプリは `view_submission` イベントをリッスンします。このイベントがアプリに届くと、`WorkflowStep` で設定した `save` コールバックが実行されます。 + +`save` コールバック内では、`update()` メソッドを使って、ワークフローに追加されたステップの設定を保存することができます。このメソッドには次の引数を指定します。 + +- `inputs` : ユーザーがワークフローステップを実行したときにアプリが受け取る予定のデータを表す辞書型の値です。 +- `outputs` : ワークフローステップの完了時にアプリが出力するデータが設定されたオブジェクトのリストです。この outputs は、ワークフローの後続のステップで利用することができます。 +- `step_name` : ステップのデフォルトの名前をオーバーライドします。 +- `step_image_url` : ステップのデフォルトの画像をオーバーライドします。 + +これらのパラメータの構成方法について詳しくは、[ドキュメントを参照してください](https://api.slack.com/reference/workflows/workflow_step)。 + +
      + +```python +def save(ack, view, update): + ack() + + values = view["state"]["values"] + task_name = values["task_name_input"]["name"] + task_description = values["task_description_input"]["description"] + + inputs = { + "task_name": {"value": task_name["value"]}, + "task_description": {"value": task_description["value"]} + } + outputs = [ + { + "type": "text", + "name": "task_name", + "label":"Task name", + }, + { + "type": "text", + "name": "task_description", + "label":"Task description", + } + ] + update(inputs=inputs, outputs=outputs) + +ws = WorkflowStep( + callback_id="add_task", + edit=edit, + save=save, + execute=execute, +) +app.step(ws) +``` \ No newline at end of file diff --git a/docs/_steps/ja_workflow_steps_overview.md b/docs/_steps/ja_workflow_steps_overview.md new file mode 100644 index 000000000..6905d82fa --- /dev/null +++ b/docs/_steps/ja_workflow_steps_overview.md @@ -0,0 +1,21 @@ +--- +title: ワークフローステップの概要 +lang: ja-jp +slug: steps-overview +order: 1 +--- + +
      +(アプリによる)ワークフローステップでは、処理をアプリ側で行うカスタムのワークフローステップを提供することができます。ユーザーは[ワークフロービルダー](https://api.slack.com/workflows)を使ってこれらのステップをワークフローに追加できます。 + +ワークフローステップは、次の 3 つのユーザーイベントで構成されます。 + +- ワークフローステップをワークフローに追加・変更する +- ワークフロー内のステップの設定内容を更新する +- エンドユーザーがそのステップを実行する + +ワークフローステップを機能させるためには、これら 3 つのイベントすべてに対応する必要があります。 + +アプリを使ったワークフローステップについて詳しくは、[API ドキュメント](https://api.slack.com/workflows/steps)を参照してください。 + +
      From 39194aee4dd0905a5f19de124f39d627a783700c Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 28 Apr 2021 12:59:34 +0900 Subject: [PATCH 170/719] Fix an error in docs --- docs/_advanced/adapters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_advanced/adapters.md b/docs/_advanced/adapters.md index 8ff882898..b6d356bd8 100644 --- a/docs/_advanced/adapters.md +++ b/docs/_advanced/adapters.md @@ -8,7 +8,7 @@ order: 0
      Adapters are responsible for handling and parsing incoming events from Slack to conform to `BoltRequest`, then dispatching those events to your Bolt app. -By default, Bolt will use the built-in `HTTPSever` adapter. While this is okay for local development, it is not recommended for production. Bolt for Python includes a collection of built-in adapters that can be imported and used with your app. The built-in adapters support a variety of popular Python frameworks including Flask, Django, and Starlette among others. Adapters support the use of any production-ready web server of your choice. +By default, Bolt will use the built-in `HTTPServer` adapter. While this is okay for local development, it is not recommended for production. Bolt for Python includes a collection of built-in adapters that can be imported and used with your app. The built-in adapters support a variety of popular Python frameworks including Flask, Django, and Starlette among others. Adapters support the use of any production-ready web server of your choice. To use an adapter, you'll create an app with the framework of your choosing and import its corresponding adapter. Then you'll initialize the adapter instance and call its function that handles and parses incoming events. From ad622e4d925b57fbd8595ecd7b89cf42de7613e1 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 29 Apr 2021 09:01:55 +0900 Subject: [PATCH 171/719] Fix #312 Typehint errors with pytype 2021.4.26 (#313) --- .github/workflows/ci-build.yml | 2 +- slack_bolt/oauth/async_callback_options.py | 6 ++++-- slack_bolt/oauth/async_oauth_settings.py | 10 ++++++---- slack_bolt/oauth/oauth_settings.py | 10 ++++++---- slack_bolt/request/async_request.py | 20 ++++++++++++++++---- slack_bolt/request/request.py | 19 +++++++++++++++---- 6 files changed, 48 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 7dde6f5aa..dae01f300 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -74,7 +74,7 @@ jobs: if [ ${python_version:7:3} == "3.8" ]; then pip install -e ".[async]" pip install -e ".[adapter]" - pip install "pytype==2021.4.15" && pytype slack_bolt/ + pip install "pytype" && pytype slack_bolt/ fi - name: Run all tests for codecov (3.9 only) run: | diff --git a/slack_bolt/oauth/async_callback_options.py b/slack_bolt/oauth/async_callback_options.py index 6adb28cca..b24417239 100644 --- a/slack_bolt/oauth/async_callback_options.py +++ b/slack_bolt/oauth/async_callback_options.py @@ -91,8 +91,10 @@ def __init__( state_utils=state_utils, redirect_uri_page_renderer=redirect_uri_page_renderer, ) - self.success = self._success_handler - self.failure = self._failure_handler + # Note that pytype 2021.4.26 misunderstands these assignments. + # Thus, we put "type: ignore" for the following two lines + self.success = self._success_handler # type: ignore + self.failure = self._failure_handler # type: ignore # -------------------------- # Internal methods diff --git a/slack_bolt/oauth/async_oauth_settings.py b/slack_bolt/oauth/async_oauth_settings.py index 318842689..9580957e3 100644 --- a/slack_bolt/oauth/async_oauth_settings.py +++ b/slack_bolt/oauth/async_oauth_settings.py @@ -103,12 +103,14 @@ def __init__( logger: The logger that will be used internally """ # OAuth flow parameters/credentials - self.client_id = client_id or os.environ.get("SLACK_CLIENT_ID") - self.client_secret = client_secret or os.environ.get( - "SLACK_CLIENT_SECRET", None + client_id: Optional[str] = client_id or os.environ.get("SLACK_CLIENT_ID") + client_secret: Optional[str] = client_secret or os.environ.get( + "SLACK_CLIENT_SECRET" ) - if self.client_id is None or self.client_secret is None: + if client_id is None or client_secret is None: raise BoltError("Both client_id and client_secret are required") + self.client_id = client_id + self.client_secret = client_secret self.scopes = scopes or os.environ.get("SLACK_SCOPES", "").split(",") if isinstance(self.scopes, str): diff --git a/slack_bolt/oauth/oauth_settings.py b/slack_bolt/oauth/oauth_settings.py index 669aacac5..9ab100fd1 100644 --- a/slack_bolt/oauth/oauth_settings.py +++ b/slack_bolt/oauth/oauth_settings.py @@ -97,12 +97,14 @@ def __init__( state_expiration_seconds: The seconds that the state value is alive (Default: 600 seconds) logger: The logger that will be used internally """ - self.client_id = client_id or os.environ.get("SLACK_CLIENT_ID") - self.client_secret = client_secret or os.environ.get( - "SLACK_CLIENT_SECRET", None + client_id: Optional[str] = client_id or os.environ.get("SLACK_CLIENT_ID") + client_secret: Optional[str] = client_secret or os.environ.get( + "SLACK_CLIENT_SECRET" ) - if self.client_id is None or self.client_secret is None: + if client_id is None or client_secret is None: raise BoltError("Both client_id and client_secret are required") + self.client_id = client_id + self.client_secret = client_secret self.scopes = scopes or os.environ.get("SLACK_SCOPES", "").split(",") if isinstance(self.scopes, str): diff --git a/slack_bolt/request/async_request.py b/slack_bolt/request/async_request.py index 77ba23f6c..97ceab159 100644 --- a/slack_bolt/request/async_request.py +++ b/slack_bolt/request/async_request.py @@ -42,9 +42,21 @@ def __init__( context: The context in this request. mode: The mode used for this request. (either "http" or "socket_mode") """ - if mode == "http" and not isinstance(body, str): - raise BoltError(error_message_raw_body_required_in_http_mode()) - self.raw_body = body if mode == "http" else "" + + if mode == "http": + # HTTP Mode + if not isinstance(body, str): + raise BoltError(error_message_raw_body_required_in_http_mode()) + self.raw_body = body if body is not None else "" + else: + # Socket Mode + if body is not None and isinstance(body, str): + self.raw_body = body + else: + # We don't convert the dict value to str + # as doing so does not guarantee to keep the original structure/format. + self.raw_body = "" + self.query = parse_query(query) self.headers = build_normalized_headers(headers) self.content_type = extract_content_type(self.headers) @@ -57,7 +69,7 @@ def __init__( self.context = build_async_context( AsyncBoltContext(context if context else {}), self.body ) - self.lazy_only = self.headers.get("x-slack-bolt-lazy-only", [False])[0] + self.lazy_only = bool(self.headers.get("x-slack-bolt-lazy-only", [False])[0]) self.lazy_function_name = self.headers.get( "x-slack-bolt-lazy-function-name", [None] )[0] diff --git a/slack_bolt/request/request.py b/slack_bolt/request/request.py index 06b27142d..5d48d7a35 100644 --- a/slack_bolt/request/request.py +++ b/slack_bolt/request/request.py @@ -42,9 +42,20 @@ def __init__( context: The context in this request. mode: The mode used for this request. (either "http" or "socket_mode") """ - if mode == "http" and not isinstance(body, str): - raise BoltError(error_message_raw_body_required_in_http_mode()) - self.raw_body = body if mode == "http" else "" + if mode == "http": + # HTTP Mode + if not isinstance(body, str): + raise BoltError(error_message_raw_body_required_in_http_mode()) + self.raw_body = body if body is not None else "" + else: + # Socket Mode + if body is not None and isinstance(body, str): + self.raw_body = body + else: + # We don't convert the dict value to str + # as doing so does not guarantee to keep the original structure/format. + self.raw_body = "" + self.query = parse_query(query) self.headers = build_normalized_headers(headers) self.content_type = extract_content_type(self.headers) @@ -56,7 +67,7 @@ def __init__( raise BoltError(error_message_unknown_request_body_type()) self.context = build_context(BoltContext(context if context else {}), self.body) - self.lazy_only = self.headers.get("x-slack-bolt-lazy-only", [False])[0] + self.lazy_only = bool(self.headers.get("x-slack-bolt-lazy-only", [False])[0]) self.lazy_function_name = self.headers.get( "x-slack-bolt-lazy-function-name", [None] )[0] From 76158a8eb0d74ece8f155b1d2040da4883a9df5a Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 30 Apr 2021 06:50:36 +0900 Subject: [PATCH 172/719] Fix #307 Add options to disable the built-in middleware (#310) --- slack_bolt/app/app.py | 53 ++++++-- slack_bolt/app/async_app.py | 58 ++++++-- tests/scenario_tests/test_events.py | 41 ------ .../scenario_tests/test_events_ignore_self.py | 85 ++++++++++++ .../test_events_request_verification.py | 110 ++++++++++++++++ .../test_events_url_verification.py | 84 ++++++++++++ tests/scenario_tests/test_ssl_check.py | 21 +++ tests/scenario_tests_async/test_events.py | 41 ------ .../test_events_ignore_self.py | 88 +++++++++++++ .../test_events_request_verification.py | 124 ++++++++++++++++++ .../test_events_url_verification.py | 88 +++++++++++++ 11 files changed, 692 insertions(+), 101 deletions(-) create mode 100644 tests/scenario_tests/test_events_ignore_self.py create mode 100644 tests/scenario_tests/test_events_request_verification.py create mode 100644 tests/scenario_tests/test_events_url_verification.py create mode 100644 tests/scenario_tests_async/test_events_ignore_self.py create mode 100644 tests/scenario_tests_async/test_events_request_verification.py create mode 100644 tests/scenario_tests_async/test_events_url_verification.py diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 86f59b296..2bf8213cb 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -99,6 +99,11 @@ def __init__( installation_store: Optional[InstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility installation_store_bot_only: Optional[bool] = None, + # for customizing the built-in middleware + request_verification_enabled: bool = True, + ignoring_self_events_enabled: bool = True, + ssl_check_enabled: bool = True, + url_verification_enabled: bool = True, # for the OAuth flow oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, @@ -146,6 +151,21 @@ def message_hello(message, say): by checking if there is a team/user in the installation data. installation_store: The module offering save/find operations of installation data installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) + request_verification_enabled: False if you would like to disable the built-in middleware (Default: True). + `RequestVerification` is a built-in middleware that verifies the signature in HTTP Mode requests. + Make sure if it's safe enough when you turn a built-in middleware off. + We strongly recommend using RequestVerification for better security. + If you have a proxy that verifies request signature in front of the Bolt app, + it's totally fine to disable RequestVerification to avoid duplication of work. + Don't turn it off just for easiness of development. + ignoring_self_events_enabled: False if you would like to disable the built-in middleware (Default: True). + `IgnoringSelfEvents` is a built-in middleware that enables Bolt apps to easily skip the events + generated by this app's bot user (this is useful for avoiding code error causing an infinite loop). + url_verification_enabled: False if you would like to disable the built-in middleware (Default: True). + `UrlVerification` is a built-in middleware that handles url_verification requests + that verify the endpoint for Events API in HTTP Mode requests. + ssl_check_enabled: bool = False if you would like to disable the built-in middleware (Default: True). + `SslCheck` is a built-in middleware that handles ssl_check requests from Slack. oauth_settings: The settings related to Slack app installation flow (OAuth flow) oauth_flow: Instantiated `slack_bolt.oauth.OAuthFlow`. This is always prioritized over oauth_settings. verification_token: Deprecated verification mechanism. This can used only for ssl_check requests. @@ -292,22 +312,37 @@ def message_hello(message, say): self._init_middleware_list_done = False self._init_middleware_list( - token_verification_enabled=token_verification_enabled + token_verification_enabled=token_verification_enabled, + request_verification_enabled=request_verification_enabled, + ignoring_self_events_enabled=ignoring_self_events_enabled, + ssl_check_enabled=ssl_check_enabled, + url_verification_enabled=url_verification_enabled, ) - def _init_middleware_list(self, token_verification_enabled: bool): + def _init_middleware_list( + self, + token_verification_enabled: bool = True, + request_verification_enabled: bool = True, + ignoring_self_events_enabled: bool = True, + ssl_check_enabled: bool = True, + url_verification_enabled: bool = True, + ): if self._init_middleware_list_done: return - self._middleware_list.append( - SslCheck(verification_token=self._verification_token) - ) - self._middleware_list.append(RequestVerification(self._signing_secret)) + if ssl_check_enabled is True: + self._middleware_list.append( + SslCheck(verification_token=self._verification_token) + ) + if request_verification_enabled is True: + self._middleware_list.append(RequestVerification(self._signing_secret)) + # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._oauth_flow is None: if self._token is not None: try: auth_test_result = None if token_verification_enabled: + # This API call is for eagerly validating the token auth_test_result = self._client.auth_test(token=self._token) self._middleware_list.append( SingleTeamAuthorization(auth_test_result=auth_test_result) @@ -324,8 +359,10 @@ def _init_middleware_list(self, token_verification_enabled: bool): self._middleware_list.append( MultiTeamsAuthorization(authorize=self._authorize) ) - self._middleware_list.append(IgnoringSelfEvents()) - self._middleware_list.append(UrlVerification()) + if ignoring_self_events_enabled is True: + self._middleware_list.append(IgnoringSelfEvents()) + if url_verification_enabled is True: + self._middleware_list.append(UrlVerification()) self._init_middleware_list_done = True # ------------------------- diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index ce1b968bf..131650262 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -105,10 +105,15 @@ def __init__( token: Optional[str] = None, client: Optional[AsyncWebClient] = None, # for multi-workspace apps + authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, installation_store: Optional[AsyncInstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility installation_store_bot_only: Optional[bool] = None, - authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, + # for customizing the built-in middleware + request_verification_enabled: bool = True, + ignoring_self_events_enabled: bool = True, + ssl_check_enabled: bool = True, + url_verification_enabled: bool = True, # for the OAuth flow oauth_settings: Optional[AsyncOAuthSettings] = None, oauth_flow: Optional[AsyncOAuthFlow] = None, @@ -155,6 +160,21 @@ async def message_hello(message, say): # async function by checking if there is a team/user in the installation data. installation_store: The module offering save/find operations of installation data installation_store_bot_only: Use `AsyncInstallationStore#async_find_bot()` if True (Default: False) + request_verification_enabled: False if you would like to disable the built-in middleware (Default: True). + `AsyncRequestVerification` is a built-in middleware that verifies the signature in HTTP Mode requests. + Make sure if it's safe enough when you turn a built-in middleware off. + We strongly recommend using RequestVerification for better security. + If you have a proxy that verifies request signature in front of the Bolt app, + it's totally fine to disable RequestVerification to avoid duplication of work. + Don't turn it off just for easiness of development. + ignoring_self_events_enabled: False if you would like to disable the built-in middleware (Default: True). + `AsyncIgnoringSelfEvents` is a built-in middleware that enables Bolt apps to easily skip the events + generated by this app's bot user (this is useful for avoiding code error causing an infinite loop). + url_verification_enabled: False if you would like to disable the built-in middleware (Default: True). + `AsyncUrlVerification` is a built-in middleware that handles url_verification requests + that verify the endpoint for Events API in HTTP Mode requests. + ssl_check_enabled: bool = False if you would like to disable the built-in middleware (Default: True). + `AsyncSslCheck` is a built-in middleware that handles ssl_check requests from Slack. oauth_settings: The settings related to Slack app installation flow (OAuth flow) oauth_flow: Instantiated `slack_bolt.oauth.AsyncOAuthFlow`. This is always prioritized over oauth_settings. verification_token: Deprecated verification mechanism. This can used only for ssl_check requests. @@ -316,19 +336,33 @@ async def message_hello(message, say): # async function ) self._init_middleware_list_done = False - self._init_async_middleware_list() + self._init_async_middleware_list( + request_verification_enabled=request_verification_enabled, + ignoring_self_events_enabled=ignoring_self_events_enabled, + ssl_check_enabled=ssl_check_enabled, + url_verification_enabled=url_verification_enabled, + ) self._server: Optional[AsyncSlackAppServer] = None - def _init_async_middleware_list(self): + def _init_async_middleware_list( + self, + request_verification_enabled: bool = True, + ignoring_self_events_enabled: bool = True, + ssl_check_enabled: bool = True, + url_verification_enabled: bool = True, + ): if self._init_middleware_list_done: return - self._async_middleware_list.append( - AsyncSslCheck(verification_token=self._verification_token) - ) - self._async_middleware_list.append( - AsyncRequestVerification(self._signing_secret) - ) + if ssl_check_enabled is True: + self._async_middleware_list.append( + AsyncSslCheck(verification_token=self._verification_token) + ) + if request_verification_enabled is True: + self._async_middleware_list.append( + AsyncRequestVerification(self._signing_secret) + ) + # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._async_oauth_flow is None: if self._token: self._async_middleware_list.append(AsyncSingleTeamAuthorization()) @@ -343,8 +377,10 @@ def _init_async_middleware_list(self): AsyncMultiTeamsAuthorization(authorize=self._async_authorize) ) - self._async_middleware_list.append(AsyncIgnoringSelfEvents()) - self._async_middleware_list.append(AsyncUrlVerification()) + if ignoring_self_events_enabled is True: + self._async_middleware_list.append(AsyncIgnoringSelfEvents()) + if url_verification_enabled is True: + self._async_middleware_list.append(AsyncUrlVerification()) self._init_middleware_list_done = True # ------------------------- diff --git a/tests/scenario_tests/test_events.py b/tests/scenario_tests/test_events.py index e5a1e9f49..49c1f409c 100644 --- a/tests/scenario_tests/test_events.py +++ b/tests/scenario_tests/test_events.py @@ -169,47 +169,6 @@ def handle_app_mention(): response = app.dispatch(request) assert response.status == 200 - def test_self_events(self): - app = App(client=self.web_client, signing_secret=self.signing_secret) - - event_body = { - "token": "verification_token", - "team_id": "T111", - "enterprise_id": "E111", - "api_app_id": "A111", - "event": { - "type": "reaction_added", - "user": "W23456789", # bot_user_id - "item": { - "type": "message", - "channel": "C111", - "ts": "1599529504.000400", - }, - "reaction": "heart_eyes", - "item_user": "W111", - "event_ts": "1599616881.000800", - }, - "type": "event_callback", - "event_id": "Ev111", - "event_time": 1599616881, - "authed_users": ["W111"], - } - - @app.event("reaction_added") - def handle_app_mention(say): - say("What's up?") - - timestamp, body = str(int(time())), json.dumps(event_body) - request: BoltRequest = BoltRequest( - body=body, headers=self.build_headers(timestamp, body) - ) - response = app.dispatch(request) - assert response.status == 200 - assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - # The listener should not be executed - assert self.mock_received_requests.get("/chat.postMessage") is None - def test_self_member_join_left_events(self): app = App(client=self.web_client, signing_secret=self.signing_secret) diff --git a/tests/scenario_tests/test_events_ignore_self.py b/tests/scenario_tests/test_events_ignore_self.py new file mode 100644 index 000000000..7fb3f2e7d --- /dev/null +++ b/tests/scenario_tests/test_events_ignore_self.py @@ -0,0 +1,85 @@ +from time import sleep + +from slack_sdk.web import WebClient + +from slack_bolt import App, BoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestEventsIgnoreSelf: + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def test_self_events(self): + app = App(client=self.web_client) + + @app.event("reaction_added") + def handle_app_mention(say): + say("What's up?") + + request: BoltRequest = BoltRequest(body=event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_auth_test_count(self, 1) + sleep(1) # wait a bit after auto ack() + # The listener should not be executed + assert self.mock_received_requests.get("/chat.postMessage") is None + + def test_self_events_disabled(self): + app = App( + client=self.web_client, + ignoring_self_events_enabled=False, + ) + + @app.event("reaction_added") + def handle_app_mention(say): + say("What's up?") + + request: BoltRequest = BoltRequest(body=event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_auth_test_count(self, 1) + sleep(1) # wait a bit after auto ack() + # The listener should be executed as the ignoring logic is disabled + assert self.mock_received_requests.get("/chat.postMessage") == 1 + + +event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "reaction_added", + "user": "W23456789", # bot_user_id + "item": { + "type": "message", + "channel": "C111", + "ts": "1599529504.000400", + }, + "reaction": "heart_eyes", + "item_user": "W111", + "event_ts": "1599616881.000800", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], +} diff --git a/tests/scenario_tests/test_events_request_verification.py b/tests/scenario_tests/test_events_request_verification.py new file mode 100644 index 000000000..c8a292a3b --- /dev/null +++ b/tests/scenario_tests/test_events_request_verification.py @@ -0,0 +1,110 @@ +import json +from time import sleep, time + +from slack_sdk.web import WebClient +from slack_sdk.signature import SignatureVerifier + +from slack_bolt import App, BoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestEventsRequestVerification: + valid_token = "xoxb-valid" + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def test_default(self): + app = App(client=self.web_client, signing_secret=self.signing_secret) + + @app.event("reaction_added") + def handle_app_mention(say): + say("What's up?") + + timestamp, body = str(int(time())), json.dumps(event_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + assert_auth_test_count(self, 1) + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests.get("/chat.postMessage") == 1 + + def test_disabled(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + request_verification_enabled=False, + ) + + @app.event("reaction_added") + def handle_app_mention(say): + say("What's up?") + + # request including invalid headers + expired = int(time()) - 3600 + timestamp, body = str(expired), json.dumps(event_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + assert_auth_test_count(self, 1) + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests.get("/chat.postMessage") == 1 + + +event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "reaction_added", + "user": "W111", + "item": { + "type": "message", + "channel": "C111", + "ts": "1599529504.000400", + }, + "reaction": "heart_eyes", + "item_user": "W111", + "event_ts": "1599616881.000800", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], +} diff --git a/tests/scenario_tests/test_events_url_verification.py b/tests/scenario_tests/test_events_url_verification.py new file mode 100644 index 000000000..4f92bca13 --- /dev/null +++ b/tests/scenario_tests/test_events_url_verification.py @@ -0,0 +1,84 @@ +import json +from time import time + +from slack_sdk.web import WebClient +from slack_sdk.signature import SignatureVerifier + +from slack_bolt import App, BoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestEventsUrlVerification: + valid_token = "xoxb-valid" + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def test_default(self): + app = App(client=self.web_client, signing_secret=self.signing_secret) + + timestamp, body = str(int(time())), json.dumps(event_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 200 + assert ( + response.body + == """{"challenge": "3eZbrw1aBm2rZgRNFdxV2595E9CY3gmdALWMmHkvFXO7tYXAYM8P"}""" + ) + assert_auth_test_count(self, 0) + + def test_disabled(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + url_verification_enabled=False, + ) + + timestamp, body = str(int(time())), json.dumps(event_body) + request: BoltRequest = BoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = app.dispatch(request) + assert response.status == 404 + assert response.body == """{"error": "unhandled request"}""" + assert_auth_test_count(self, 0) + + +event_body = { + "token": "Jhj5dZrVaK7ZwHHjRyZWjbDl", + "challenge": "3eZbrw1aBm2rZgRNFdxV2595E9CY3gmdALWMmHkvFXO7tYXAYM8P", + "type": "url_verification", +} diff --git a/tests/scenario_tests/test_ssl_check.py b/tests/scenario_tests/test_ssl_check.py index 3470321de..937f9d7e4 100644 --- a/tests/scenario_tests/test_ssl_check.py +++ b/tests/scenario_tests/test_ssl_check.py @@ -55,3 +55,24 @@ def test_ssl_check(self): response = app.dispatch(request) assert response.status == 200 assert response.body == "" + + def test_ssl_check_disabled(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ssl_check_enabled=False, + ) + + timestamp, body = str(int(time())), "token=random&ssl_check=1" + request: BoltRequest = BoltRequest( + body=body, + query={}, + headers={ + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + }, + ) + response = app.dispatch(request) + assert response.status == 404 + assert response.body == """{"error": "unhandled request"}""" diff --git a/tests/scenario_tests_async/test_events.py b/tests/scenario_tests_async/test_events.py index 7e6f25a9c..5e5af42e2 100644 --- a/tests/scenario_tests_async/test_events.py +++ b/tests/scenario_tests_async/test_events.py @@ -158,47 +158,6 @@ async def test_stable_auto_ack(self): response = await app.async_dispatch(request) assert response.status == 200 - @pytest.mark.asyncio - async def test_self_events(self): - app = AsyncApp( - client=self.web_client, - signing_secret=self.signing_secret, - ) - app.event("reaction_added")(whats_up) - - self_event = { - "token": "verification_token", - "team_id": "T111", - "enterprise_id": "E111", - "api_app_id": "A111", - "event": { - "type": "reaction_added", - "user": "W23456789", # bot_user_id - "item": { - "type": "message", - "channel": "C111", - "ts": "1599529504.000400", - }, - "reaction": "heart_eyes", - "item_user": "W111", - "event_ts": "1599616881.000800", - }, - "type": "event_callback", - "event_id": "Ev111", - "event_time": 1599616881, - "authed_users": ["W111"], - } - timestamp, body = str(int(time())), json.dumps(self_event) - request = AsyncBoltRequest( - body=body, headers=self.build_headers(timestamp, body) - ) - response = await app.async_dispatch(request) - assert response.status == 200 - await assert_auth_test_count_async(self, 1) - await asyncio.sleep(1) # wait a bit after auto ack() - # The listener should not be executed - assert self.mock_received_requests.get("/chat.postMessage") is None - @pytest.mark.asyncio async def test_self_joined_left_events(self): app = AsyncApp( diff --git a/tests/scenario_tests_async/test_events_ignore_self.py b/tests/scenario_tests_async/test_events_ignore_self.py new file mode 100644 index 000000000..5749b980b --- /dev/null +++ b/tests/scenario_tests_async/test_events_ignore_self.py @@ -0,0 +1,88 @@ +import asyncio + +import pytest +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count_async, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestAsyncEventsIgnoreSelf: + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + @pytest.mark.asyncio + async def test_self_events(self): + app = AsyncApp(client=self.web_client) + app.event("reaction_added")(whats_up) + request = AsyncBoltRequest(body=self_event, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_auth_test_count_async(self, 1) + await asyncio.sleep(1) # wait a bit after auto ack() + # The listener should not be executed + assert self.mock_received_requests.get("/chat.postMessage") is None + + @pytest.mark.asyncio + async def test_self_events_disabled(self): + app = AsyncApp(client=self.web_client, ignoring_self_events_enabled=False) + app.event("reaction_added")(whats_up) + request = AsyncBoltRequest(body=self_event, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_auth_test_count_async(self, 0) + await asyncio.sleep(1) # wait a bit after auto ack() + # The listener should be executed + assert self.mock_received_requests.get("/chat.postMessage") == 1 + + +self_event = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "reaction_added", + "user": "W23456789", # bot_user_id + "item": { + "type": "message", + "channel": "C111", + "ts": "1599529504.000400", + }, + "reaction": "heart_eyes", + "item_user": "W111", + "event_ts": "1599616881.000800", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], +} + + +async def whats_up(body, say, payload, event): + assert body["event"] == payload + assert payload == event + await say("What's up?") diff --git a/tests/scenario_tests_async/test_events_request_verification.py b/tests/scenario_tests_async/test_events_request_verification.py new file mode 100644 index 000000000..3c59c2a00 --- /dev/null +++ b/tests/scenario_tests_async/test_events_request_verification.py @@ -0,0 +1,124 @@ +import asyncio +import json +from time import time + +import pytest +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count_async, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestAsyncEventsRequestVerification: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + @pytest.mark.asyncio + async def test_default(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + app.event("app_mention")(whats_up) + + timestamp, body = str(int(time())), json.dumps(app_mention_body) + request = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_auth_test_count_async(self, 1) + await asyncio.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + @pytest.mark.asyncio + async def test_disabled(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + request_verification_enabled=False, + ) + app.event("app_mention")(whats_up) + + # request including invalid headers + expired = int(time()) - 3600 + timestamp, body = str(expired), json.dumps(app_mention_body) + request = AsyncBoltRequest( + body=body, headers=self.build_headers(timestamp, body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_auth_test_count_async(self, 1) + await asyncio.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + +app_mention_body = { + "token": "verification_token", + "team_id": "T_INSTALLED", + "enterprise_id": "E_SOURCE", + "api_app_id": "A111", + "event": { + "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "team": "T_INSTALLED", + "channel": "C111", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, + "authorizations": [ + { + "enterprise_id": "E_INSTALLED", + "team_id": "T_INSTALLED", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], +} + + +async def whats_up(body, say, payload, event): + assert body["event"] == payload + assert payload == event + await say("What's up?") diff --git a/tests/scenario_tests_async/test_events_url_verification.py b/tests/scenario_tests_async/test_events_url_verification.py new file mode 100644 index 000000000..e47efcb65 --- /dev/null +++ b/tests/scenario_tests_async/test_events_url_verification.py @@ -0,0 +1,88 @@ +import asyncio +import json +from time import time + +import pytest +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count_async, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestAsyncEventsUrlVerification: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def build_valid_request(self) -> AsyncBoltRequest: + timestamp, body = str(int(time())), json.dumps(event_body) + return AsyncBoltRequest(body=body, headers=self.build_headers(timestamp, body)) + + @pytest.mark.asyncio + async def test_default(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + request = self.build_valid_request() + response = await app.async_dispatch(request) + assert response.status == 200 + assert ( + response.body + == """{"challenge": "3eZbrw1aBm2rZgRNFdxV2595E9CY3gmdALWMmHkvFXO7tYXAYM8P"}""" + ) + await assert_auth_test_count_async(self, 0) + + @pytest.mark.asyncio + async def test_disabled(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + url_verification_enabled=False, + ) + request = self.build_valid_request() + response = await app.async_dispatch(request) + assert response.status == 404 + assert response.body == """{"error": "unhandled request"}""" + await assert_auth_test_count_async(self, 0) + + +event_body = { + "token": "Jhj5dZrVaK7ZwHHjRyZWjbDl", + "challenge": "3eZbrw1aBm2rZgRNFdxV2595E9CY3gmdALWMmHkvFXO7tYXAYM8P", + "type": "url_verification", +} From c649e2b6d432ce877e3d344ad8505d520194c8c4 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 30 Apr 2021 06:50:59 +0900 Subject: [PATCH 173/719] Fix #309 Fallback to no-emoji boot message when failing to load for some reason (#311) --- slack_bolt/util/utils.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/slack_bolt/util/utils.py b/slack_bolt/util/utils.py index ef08e3337..e5e1bb46b 100644 --- a/slack_bolt/util/utils.py +++ b/slack_bolt/util/utils.py @@ -57,10 +57,19 @@ def get_boot_message(development_server: bool = False) -> str: else: return "Bolt app is running!" - if development_server: - return "⚡️ Bolt app is running! (development server)" - else: - return "⚡️ Bolt app is running!" + try: + if development_server: + return "⚡️ Bolt app is running! (development server)" + else: + return "⚡️ Bolt app is running!" + except ValueError: + # ValueError is a runtime exception for a given value + # It's a super class of UnicodeEncodeError, which may be raised in the scenario + # see also: https://github.com/slackapi/bolt-python/issues/170 + if development_server: + return "Bolt app is running! (development server)" + else: + return "Bolt app is running!" def get_name_for_callable(func: Callable) -> str: From e1b7a6f23b2e9c9bf8ad937f43053e52be075293 Mon Sep 17 00:00:00 2001 From: Jeremy Lujan <77011427+jlujan-invitae@users.noreply.github.com> Date: Fri, 30 Apr 2021 18:41:52 -0500 Subject: [PATCH 174/719] Fix chalice deployment bug introduced in #270 (#316) * Fix chalice deployment bug introduced in #270 * Refactor LocalLambdaClient into seperate file * try/catch import when running from a deployed lambda * Updates from PR feedback, improve lazy lambda tests * Only import LocalLambdaClient if CLI and client not passed in * Add unittest for default lazy listener * Fix name of mocked lambda client in test_lazy_listeners_non_cli --- .../adapter/aws_lambda/chalice_handler.py | 44 +++++-------- .../chalice_lazy_listener_runner.py | 6 +- .../adapter/aws_lambda/local_lambda_client.py | 28 +++++++++ tests/adapter_tests/aws/test_aws_chalice.py | 63 ++++++++++++++++++- 4 files changed, 106 insertions(+), 35 deletions(-) create mode 100644 slack_bolt/adapter/aws_lambda/local_lambda_client.py diff --git a/slack_bolt/adapter/aws_lambda/chalice_handler.py b/slack_bolt/adapter/aws_lambda/chalice_handler.py index f4c7220ba..a1edd158c 100644 --- a/slack_bolt/adapter/aws_lambda/chalice_handler.py +++ b/slack_bolt/adapter/aws_lambda/chalice_handler.py @@ -1,10 +1,10 @@ import logging -import json from os import getenv +from typing import Optional + +from botocore.client import BaseClient from chalice.app import Request, Response, Chalice -from chalice.config import Config -from chalice.test import BaseClient, LambdaContext, InvokeResponse from slack_bolt.adapter.aws_lambda.chalice_lazy_listener_runner import ( ChaliceLazyListenerRunner, @@ -17,38 +17,22 @@ from slack_bolt.response import BoltResponse -class LocalLambdaClient(BaseClient): - """Lambda client implementing `invoke` for use when running with Chalice CLI""" - - def __init__(self, app: Chalice, config: Config) -> None: - self._app = app - self._config = config - - def invoke( - self, - FunctionName: str = None, - InvocationType: str = "Event", - Payload: str = "{}", - ) -> InvokeResponse: - scoped = self._config.scope(self._config.chalice_stage, FunctionName) - lambda_context = LambdaContext( - FunctionName, memory_size=scoped.lambda_memory_size - ) - - with self._patched_env_vars(scoped.environment_variables): - response = self._app(json.loads(Payload), lambda_context) - return InvokeResponse(payload=response) - - class ChaliceSlackRequestHandler: - def __init__(self, app: App, chalice: Chalice): # type: ignore + def __init__(self, app: App, chalice: Chalice, lambda_client: Optional[BaseClient] = None): # type: ignore self.app = app self.chalice = chalice self.logger = get_bolt_app_logger(app.name, ChaliceSlackRequestHandler) - lambda_client = None - if getenv("AWS_CHALICE_CLI_MODE") == "true": - lambda_client = LocalLambdaClient(self.chalice, Config()) + if getenv("AWS_CHALICE_CLI_MODE") == "true" and lambda_client is None: + try: + from slack_bolt.adapter.aws_lambda.local_lambda_client import ( + LocalLambdaClient, + ) + + lambda_client = LocalLambdaClient(self.chalice, None) + except ImportError: + logging.info("Failed to load LocalLambdaClient for CLI mode.") + pass self.app.listener_runner.lazy_listener_runner = ChaliceLazyListenerRunner( logger=self.logger, lambda_client=lambda_client diff --git a/slack_bolt/adapter/aws_lambda/chalice_lazy_listener_runner.py b/slack_bolt/adapter/aws_lambda/chalice_lazy_listener_runner.py index ce339b043..8b8cdea12 100644 --- a/slack_bolt/adapter/aws_lambda/chalice_lazy_listener_runner.py +++ b/slack_bolt/adapter/aws_lambda/chalice_lazy_listener_runner.py @@ -1,15 +1,16 @@ import json from logging import Logger -from typing import Callable, Optional, Any +from typing import Callable, Optional import boto3 +from botocore.client import BaseClient from slack_bolt import BoltRequest from slack_bolt.lazy_listener import LazyListenerRunner class ChaliceLazyListenerRunner(LazyListenerRunner): - def __init__(self, logger: Logger, lambda_client: Optional[Any] = None): + def __init__(self, logger: Logger, lambda_client: Optional[BaseClient] = None): self.lambda_client = lambda_client self.logger = logger @@ -38,4 +39,3 @@ def start(self, function: Callable[..., None], request: BoltRequest) -> None: InvocationType="Event", Payload=json.dumps(payload), ) - self.logger.info(invocation) diff --git a/slack_bolt/adapter/aws_lambda/local_lambda_client.py b/slack_bolt/adapter/aws_lambda/local_lambda_client.py new file mode 100644 index 000000000..82181062e --- /dev/null +++ b/slack_bolt/adapter/aws_lambda/local_lambda_client.py @@ -0,0 +1,28 @@ +import json + +from chalice.app import Chalice +from chalice.config import Config +from chalice.test import BaseClient, LambdaContext, InvokeResponse + + +class LocalLambdaClient(BaseClient): + """Lambda client implementing `invoke` for use when running with Chalice CLI.""" + + def __init__(self, app: Chalice, config: Config) -> None: + self._app = app + self._config = config if config else Config() + + def invoke( + self, + FunctionName: str = None, + InvocationType: str = "Event", + Payload: str = "{}", + ) -> InvokeResponse: + scoped = self._config.scope(self._config.chalice_stage, FunctionName) + lambda_context = LambdaContext( + FunctionName, memory_size=scoped.lambda_memory_size + ) + + with self._patched_env_vars(scoped.environment_variables): + response = self._app(json.loads(Payload), lambda_context) + return InvokeResponse(payload=response) diff --git a/tests/adapter_tests/aws/test_aws_chalice.py b/tests/adapter_tests/aws/test_aws_chalice.py index 223f961ee..e716583c2 100644 --- a/tests/adapter_tests/aws/test_aws_chalice.py +++ b/tests/adapter_tests/aws/test_aws_chalice.py @@ -4,7 +4,6 @@ from typing import Dict, Any from urllib.parse import quote from unittest import mock -import logging from chalice import Chalice, Response from chalice.app import Request @@ -18,6 +17,7 @@ ChaliceSlackRequestHandler, not_found, ) + from slack_bolt.app import App from slack_bolt.oauth.oauth_settings import OAuthSettings from tests.mock_web_api_server import ( @@ -315,13 +315,72 @@ def events() -> Response: return slack_handler.handle(chalice_app.current_request) headers = self.build_headers(timestamp, body) - client = Client(chalice_app, Config()) + client = Client(chalice_app) response = client.http.post("/slack/events", headers=headers, body=body) assert response.status_code == 200, f"Failed request: {response.body}" assert_auth_test_count(self, 1) assert self.mock_received_requests["/chat.postMessage"] == 1 + @mock.patch( + "slack_bolt.adapter.aws_lambda.chalice_lazy_listener_runner.boto3", + autospec=True, + ) + def test_lazy_listeners_non_cli(self, mock_boto3): + with mock.patch.dict(os.environ, {"AWS_CHALICE_CLI_MODE": "false"}): + assert os.environ.get("AWS_CHALICE_CLI_MODE") == "false" + + mock_lambda = mock.MagicMock() # mock of boto3.client('lambda') + mock_boto3.client.return_value = mock_lambda + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + process_before_response=True, + ) + + def command_handler(ack): + ack() + + def say_it(say): + say("Done!") + + app.command("/hello-world")(ack=command_handler, lazy=[say_it]) + + input = ( + "token=verification_token" + "&team_id=T111" + "&team_domain=test-domain" + "&channel_id=C111" + "&channel_name=random" + "&user_id=W111" + "&user_name=primary-owner" + "&command=%2Fhello-world" + "&text=Hi" + "&enterprise_id=E111" + "&enterprise_name=Org+Name" + "&response_url=https%3A%2F%2Fhooks.slack.com%2Fcommands%2FT111%2F111%2Fxxxxx" + "&trigger_id=111.111.xxx" + ) + timestamp, body = str(int(time())), input + + chalice_app = Chalice(app_name="bolt-python-chalice") + + slack_handler = ChaliceSlackRequestHandler(app=app, chalice=chalice_app) + + @chalice_app.route( + "/slack/events", + methods=["POST"], + content_types=["application/x-www-form-urlencoded", "application/json"], + ) + def events() -> Response: + return slack_handler.handle(chalice_app.current_request) + + headers = self.build_headers(timestamp, body) + client = Client(chalice_app) + response = client.http.post("/slack/events", headers=headers, body=body) + assert response + assert mock_lambda.invoke.called + def test_oauth(self): app = App( client=self.web_client, From ed7ef1f1bc5fe20f63da41eef8d8a58584e44e0c Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 6 May 2021 18:20:29 +0900 Subject: [PATCH 175/719] Update Django example app - ref #324 --- examples/django/README.md | 8 ++++++-- examples/django/slackapp/models.py | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/examples/django/README.md b/examples/django/README.md index 538bec95a..30e0e2adf 100644 --- a/examples/django/README.md +++ b/examples/django/README.md @@ -1,7 +1,11 @@ +Follow the instructions [here](https://slack.dev/bolt-python/concepts#authenticating-oauth) for configuring OAuth flow supported Slack apps. This example works with the default env variables such as `SLACK_CLIENT_ID`, `SLACK_CLIENT_SECRET`, `SLACK_SCOPES`, `SLACK_SIGNING_SECRET`, and so forth. + ``` pip install -r requirements.txt -export SLACK_SIGNING_SECRET=*** -export SLACK_BOT_TOKEN=xoxb-*** +export SLACK_CLIENT_ID= +export SLACK_CLIENT_SECRET= +export SLACK_SCOPES=commands.chat:write +export SLACK_SIGNING_SECRET= python manage.py migrate python manage.py runserver 0.0.0.0:3000 diff --git a/examples/django/slackapp/models.py b/examples/django/slackapp/models.py index cfbbd8ade..249de2000 100644 --- a/examples/django/slackapp/models.py +++ b/examples/django/slackapp/models.py @@ -231,10 +231,11 @@ def consume(self, state: str) -> bool: from slack_bolt.oauth.oauth_settings import OAuthSettings logger = logging.getLogger(__name__) -client_id, client_secret, signing_secret = ( +client_id, client_secret, signing_secret, scopes = ( os.environ["SLACK_CLIENT_ID"], os.environ["SLACK_CLIENT_SECRET"], os.environ["SLACK_SIGNING_SECRET"], + os.environ.get("SLACK_SCOPES", "commands").split(","), ) app = App( @@ -246,6 +247,7 @@ def consume(self, state: str) -> bool: oauth_settings=OAuthSettings( client_id=client_id, client_secret=client_secret, + scopes=scopes, state_store=DjangoOAuthStateStore( expiration_seconds=120, logger=logger, From 33bb0252a84094151d0ef079e850ebeb90a02516 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 6 May 2021 18:39:47 +0900 Subject: [PATCH 176/719] Fix #325 Django example app error by importing datetime utilities --- examples/django/slackapp/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/django/slackapp/models.py b/examples/django/slackapp/models.py index 249de2000..0db1e9b6d 100644 --- a/examples/django/slackapp/models.py +++ b/examples/django/slackapp/models.py @@ -79,6 +79,7 @@ class SlackOAuthState(models.Model): from uuid import uuid4 from django.db.models import F from django.utils import timezone +from django.utils.timezone import is_naive, make_aware from slack_sdk.oauth import InstallationStore, OAuthStateStore from slack_sdk.oauth.installation_store import Bot, Installation from slack_sdk.webhook import WebhookClient From 1e18c0dc956ef948378b93b709db50bd7e0d53a9 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 7 May 2021 09:57:18 +0900 Subject: [PATCH 177/719] Fix an error in Django example app README --- examples/django/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/django/README.md b/examples/django/README.md index 30e0e2adf..0b1ac6742 100644 --- a/examples/django/README.md +++ b/examples/django/README.md @@ -4,9 +4,9 @@ Follow the instructions [here](https://slack.dev/bolt-python/concepts#authentica pip install -r requirements.txt export SLACK_CLIENT_ID= export SLACK_CLIENT_SECRET= -export SLACK_SCOPES=commands.chat:write +export SLACK_SCOPES=commands,chat:write export SLACK_SIGNING_SECRET= python manage.py migrate python manage.py runserver 0.0.0.0:3000 -``` \ No newline at end of file +``` From c6ec722da8bebb9feb0aef735b2877b5594f99b8 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 7 May 2021 17:10:03 +0900 Subject: [PATCH 178/719] Add missing listener suggestion to the default unhandled error message (#323) * Add missing listener suggestion to the default unhandled error message * Adjust the warning log message --- scripts/run_tests.sh | 4 +- slack_bolt/app/app.py | 2 - slack_bolt/app/async_app.py | 2 - slack_bolt/logger/messages.py | 191 +++- tests/slack_bolt/logger/__init__.py | 0 .../logger/test_unmatched_suggestions.py | 858 ++++++++++++++++++ 6 files changed, 1048 insertions(+), 9 deletions(-) create mode 100644 tests/slack_bolt/logger/__init__.py create mode 100644 tests/slack_bolt/logger/test_unmatched_suggestions.py diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index c9096048a..9931f8236 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -12,13 +12,13 @@ python_version=`python --version | awk '{print $2}'` if [[ $test_target != "" ]] then black slack_bolt/ tests/ && \ - pytest $1 + pytest -vv $1 else if [ ${python_version:0:3} == "3.8" ] then # pytype's behavior can be different in older Python versions black slack_bolt/ tests/ \ - && pytest \ + && pytest -vv \ && pip install -e ".[adapter]" \ && pip install -U pip setuptools wheel \ && pip install -U pytype \ diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 2bf8213cb..e4c6a920d 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -530,8 +530,6 @@ def middleware_next(): def _handle_unmatched_requests( self, req: BoltRequest, resp: BoltResponse ) -> BoltResponse: - # TODO: provide more info like suggestion of listeners - # e.g., You can handle this type of message with @app.event("app_mention") self._framework_logger.warning(warning_unhandled_request(req)) return resp diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 131650262..8deac5f76 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -586,8 +586,6 @@ async def async_middleware_next(): def _handle_unmatched_requests( self, req: AsyncBoltRequest, resp: BoltResponse ) -> BoltResponse: - # TODO: provide more info like suggestion of listeners - # e.g., You can handle this type of message with @app.event("app_mention") self._framework_logger.warning(warning_unhandled_request(req)) return resp diff --git a/slack_bolt/logger/messages.py b/slack_bolt/logger/messages.py index 294997a65..12302631e 100644 --- a/slack_bolt/logger/messages.py +++ b/slack_bolt/logger/messages.py @@ -1,10 +1,20 @@ import time -from typing import Union +from typing import Union, Dict, Any, Optional from slack_sdk.web import SlackResponse from slack_bolt.request import BoltRequest - +from slack_bolt.request.payload_utils import ( + is_action, + is_event, + is_options, + is_shortcut, + is_slash_command, + is_view, + is_workflow_step_edit, + is_workflow_step_save, + is_workflow_step_execute, +) # ------------------------------- # Error @@ -94,10 +104,185 @@ def warning_unhandled_by_global_middleware( # type: ignore ) +_unhandled_request_suggestion_prefix = """ +--- +[Suggestion] You can handle this type of event with the following listener function: +""" + + +def _build_filtered_body(body: Optional[Dict[str, Any]]) -> dict: + if body is None: + return {} + + payload_type = body.get("type") + filtered_body = {"type": payload_type} + + if "view" in body: + view = body["view"] + # view_submission, view_closed, workflow_step_save + filtered_body["view"] = { + "type": view.get("type"), + "callback_id": view.get("callback_id"), + } + + if payload_type == "block_actions": + # Block Kit Interactivity + actions = body.get("actions", []) + if len(actions) > 0 and actions[0] is not None: + filtered_body["block_id"] = actions[0].get("block_id") + filtered_body["action_id"] = actions[0].get("action_id") + if payload_type == "block_suggestion": + # Block Kit - external data source + filtered_body["block_id"] = body.get("block_id") + filtered_body["action_id"] = body.get("action_id") + filtered_body["value"] = body.get("value") + + if payload_type == "event_callback" and "event" in body: + # Events API, workflow_step_execute + event_payload = body.get("event", {}) + filtered_event = {"type": event_payload.get("type")} + if "subtype" in body["event"]: + filtered_event["subtype"] = event_payload.get("subtype") + filtered_body["event"] = filtered_event + + if "command" in body: + # Slash Commands + filtered_body["command"] = body.get("command") + + if payload_type in ["workflow_step_edit", "shortcut", "message_action"]: + # Workflow Steps, Global Shortcuts, Message Shortcuts + filtered_body["callback_id"] = body.get("callback_id") + + if payload_type == "interactive_message": + # Actions in Attachments + filtered_body["callback_id"] = body.get("callback_id") + filtered_body["actions"] = body.get("actions") + + if payload_type == "dialog_suggestion": + # Dialogs - external data source + filtered_body["callback_id"] = body.get("callback_id") + filtered_body["value"] = body.get("value") + if payload_type == "dialog_submission": + # Dialogs - clicking submit button + filtered_body["callback_id"] = body.get("callback_id") + filtered_body["submission"] = body.get("submission") + if payload_type == "dialog_cancellation": + # Dialogs - clicking cancel button + filtered_body["callback_id"] = body.get("callback_id") + + return filtered_body + + +def _build_unhandled_request_suggestion(default_message: str, code_snippet: str): + return f"""{default_message}{_unhandled_request_suggestion_prefix}{code_snippet}""" + + def warning_unhandled_request( # type: ignore req: Union[BoltRequest, "AsyncBoltRequest"], # type: ignore ) -> str: # type: ignore - return f"Unhandled request ({req.body})" + filtered_body = _build_filtered_body(req.body) + default_message = f"Unhandled request ({filtered_body})" + if ( + is_workflow_step_edit(req.body) + or is_workflow_step_save(req.body) + or is_workflow_step_execute(req.body) + ): + # @app.step + callback_id = ( + filtered_body.get("callback_id") + or filtered_body.get("view", {}).get("callback_id") # type: ignore + or "your-callback-id" + ) + return _build_unhandled_request_suggestion( + default_message, + f""" +from slack_bolt.workflows.step import WorkflowStep +ws = WorkflowStep( + callback_id="{callback_id}", + edit=edit, + save=save, + execute=execute, +) +# Pass Step to set up listeners +app.step(ws) +""", + ) + if is_action(req.body): + # @app.action + action_id_or_callback_id = req.body.get("callback_id") + if req.body.get("type") == "block_actions": + action_id_or_callback_id = req.body.get("actions")[0].get("action_id") + return _build_unhandled_request_suggestion( + default_message, + f""" +@app.action("{action_id_or_callback_id}") +def handle_some_action(ack, body, logger): + ack() + logger.info(body) +""", + ) + if is_options(req.body): + # @app.options + constraints = '"action-id"' + if req.body.get("action_id") is not None: + constraints = '"' + req.body.get("action_id") + '"' + elif req.body.get("type") == "dialog_suggestion": + constraints = f"""{{"type": "dialog_suggestion", "callback_id": "{req.body.get('callback_id')}"}}""" + return _build_unhandled_request_suggestion( + default_message, + f""" +@app.options({constraints}) +def handle_some_options(ack): + ack(options=[ ... ]) +""", + ) + if is_shortcut(req.body): + # @app.shortcut + id = req.body.get("action_id") or req.body.get("callback_id") + return _build_unhandled_request_suggestion( + default_message, + f""" +@app.shortcut("{id}") +def handle_shortcuts(ack, body, logger): + ack() + logger.info(body) +""", + ) + if is_view(req.body): + # @app.view + return _build_unhandled_request_suggestion( + default_message, + f""" +@app.view("{req.body.get('view', {}).get('callback_id', 'modal-view-id')}") +def handle_view_events(ack, body, logger): + ack() + logger.info(body) +""", + ) + if is_event(req.body): + # @app.event + event_type = req.body.get("event", {}).get("type") + return _build_unhandled_request_suggestion( + default_message, + f""" +@app.event("{event_type}") +def handle_{event_type}_events(body, logger): + logger.info(body) +""", + ) + if is_slash_command(req.body): + # @app.command + command = req.body.get("command", "/your-command") + return _build_unhandled_request_suggestion( + default_message, + f""" +@app.command("{command}") +def handle_some_command(ack, body, logger): + ack() + logger.info(body) +""", + ) + return default_message def warning_did_not_call_ack(listener_name: str) -> str: diff --git a/tests/slack_bolt/logger/__init__.py b/tests/slack_bolt/logger/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/slack_bolt/logger/test_unmatched_suggestions.py b/tests/slack_bolt/logger/test_unmatched_suggestions.py new file mode 100644 index 000000000..eb2f0a519 --- /dev/null +++ b/tests/slack_bolt/logger/test_unmatched_suggestions.py @@ -0,0 +1,858 @@ +from slack_bolt.request import BoltRequest +from slack_bolt.logger.messages import warning_unhandled_request + + +class TestUnmatchedPatternSuggestions: + def setup_method(self): + pass + + def teardown_method(self): + pass + + def test_unknown_patterns(self): + req: BoltRequest = BoltRequest(body={"type": "foo"}, mode="socket_mode") + message = warning_unhandled_request(req) + assert f"Unhandled request ({req.body})" == message + + def test_block_actions(self): + req: BoltRequest = BoltRequest(body=block_actions, mode="socket_mode") + message = warning_unhandled_request(req) + filtered_body = { + "type": "block_actions", + "block_id": "b", + "action_id": "action-id-value", + } + assert ( + f"""Unhandled request ({filtered_body}) +--- +[Suggestion] You can handle this type of event with the following listener function: + +@app.action("action-id-value") +def handle_some_action(ack, body, logger): + ack() + logger.info(body) +""" + == message + ) + + def test_attachment_actions(self): + req: BoltRequest = BoltRequest(body=attachment_actions, mode="socket_mode") + message = warning_unhandled_request(req) + filtered_body = { + "type": "interactive_message", + "callback_id": "pick_channel_for_fun", + "actions": [ + { + "name": "channel_list", + "type": "select", + "selected_options": [{"value": "C111"}], + } + ], + } + assert ( + f"""Unhandled request ({filtered_body}) +--- +[Suggestion] You can handle this type of event with the following listener function: + +@app.action("pick_channel_for_fun") +def handle_some_action(ack, body, logger): + ack() + logger.info(body) +""" + == message + ) + + def test_app_mention_event(self): + req: BoltRequest = BoltRequest(body=app_mention_event, mode="socket_mode") + filtered_body = { + "type": "event_callback", + "event": {"type": "app_mention"}, + } + message = warning_unhandled_request(req) + assert ( + f"""Unhandled request ({filtered_body}) +--- +[Suggestion] You can handle this type of event with the following listener function: + +@app.event("app_mention") +def handle_app_mention_events(body, logger): + logger.info(body) +""" + == message + ) + + def test_commands(self): + req: BoltRequest = BoltRequest(body=slash_command, mode="socket_mode") + message = warning_unhandled_request(req) + filtered_body = { + "type": None, + "command": "/start-conv", + } + assert ( + f"""Unhandled request ({filtered_body}) +--- +[Suggestion] You can handle this type of event with the following listener function: + +@app.command("/start-conv") +def handle_some_command(ack, body, logger): + ack() + logger.info(body) +""" + == message + ) + + def test_shortcut(self): + req: BoltRequest = BoltRequest(body=global_shortcut, mode="socket_mode") + message = warning_unhandled_request(req) + filtered_body = { + "type": "shortcut", + "callback_id": "test-shortcut", + } + assert ( + f"""Unhandled request ({filtered_body}) +--- +[Suggestion] You can handle this type of event with the following listener function: + +@app.shortcut("test-shortcut") +def handle_shortcuts(ack, body, logger): + ack() + logger.info(body) +""" + == message + ) + + req: BoltRequest = BoltRequest(body=message_shortcut, mode="socket_mode") + message = warning_unhandled_request(req) + filtered_body = { + "type": "message_action", + "callback_id": "test-shortcut", + } + assert ( + f"""Unhandled request ({filtered_body}) +--- +[Suggestion] You can handle this type of event with the following listener function: + +@app.shortcut("test-shortcut") +def handle_shortcuts(ack, body, logger): + ack() + logger.info(body) +""" + == message + ) + + def test_view(self): + req: BoltRequest = BoltRequest(body=view_submission, mode="socket_mode") + message = warning_unhandled_request(req) + filtered_body = { + "type": "view_submission", + "view": {"type": "modal", "callback_id": "view-id"}, + } + assert ( + f"""Unhandled request ({filtered_body}) +--- +[Suggestion] You can handle this type of event with the following listener function: + +@app.view("view-id") +def handle_view_events(ack, body, logger): + ack() + logger.info(body) +""" + == message + ) + + req: BoltRequest = BoltRequest(body=view_closed, mode="socket_mode") + message = warning_unhandled_request(req) + filtered_body = { + "type": "view_closed", + "view": {"type": "modal", "callback_id": "view-id"}, + } + assert ( + f"""Unhandled request ({filtered_body}) +--- +[Suggestion] You can handle this type of event with the following listener function: + +@app.view("view-id") +def handle_view_events(ack, body, logger): + ack() + logger.info(body) +""" + == message + ) + + def test_block_suggestion(self): + req: BoltRequest = BoltRequest(body=block_suggestion, mode="socket_mode") + message = warning_unhandled_request(req) + filtered_body = { + "type": "block_suggestion", + "view": {"type": "modal", "callback_id": "view-id"}, + "block_id": "block-id", + "action_id": "the-id", + "value": "search word", + } + assert ( + f"""Unhandled request ({filtered_body}) +--- +[Suggestion] You can handle this type of event with the following listener function: + +@app.options("the-id") +def handle_some_options(ack): + ack(options=[ ... ]) +""" + == message + ) + + def test_dialog_suggestion(self): + req: BoltRequest = BoltRequest(body=dialog_suggestion, mode="socket_mode") + message = warning_unhandled_request(req) + filtered_body = { + "type": "dialog_suggestion", + "callback_id": "the-id", + "value": "search keyword", + } + assert ( + f"""Unhandled request ({filtered_body}) +--- +[Suggestion] You can handle this type of event with the following listener function: + +@app.options({{"type": "dialog_suggestion", "callback_id": "the-id"}}) +def handle_some_options(ack): + ack(options=[ ... ]) +""" + == message + ) + + def test_step(self): + req: BoltRequest = BoltRequest(body=step_edit_payload, mode="socket_mode") + message = warning_unhandled_request(req) + filtered_body = { + "type": "workflow_step_edit", + "callback_id": "copy_review", + } + assert ( + f"""Unhandled request ({filtered_body}) +--- +[Suggestion] You can handle this type of event with the following listener function: + +from slack_bolt.workflows.step import WorkflowStep +ws = WorkflowStep( + callback_id="copy_review", + edit=edit, + save=save, + execute=execute, +) +# Pass Step to set up listeners +app.step(ws) +""" + == message + ) + req: BoltRequest = BoltRequest(body=step_save_payload, mode="socket_mode") + message = warning_unhandled_request(req) + filtered_body = { + "type": "view_submission", + "view": {"type": "workflow_step", "callback_id": "copy_review"}, + } + assert ( + f"""Unhandled request ({filtered_body}) +--- +[Suggestion] You can handle this type of event with the following listener function: + +from slack_bolt.workflows.step import WorkflowStep +ws = WorkflowStep( + callback_id="copy_review", + edit=edit, + save=save, + execute=execute, +) +# Pass Step to set up listeners +app.step(ws) +""" + == message + ) + req: BoltRequest = BoltRequest(body=step_execute_payload, mode="socket_mode") + message = warning_unhandled_request(req) + filtered_body = { + "type": "event_callback", + "event": {"type": "workflow_step_execute"}, + } + assert ( + f"""Unhandled request ({filtered_body}) +--- +[Suggestion] You can handle this type of event with the following listener function: + +from slack_bolt.workflows.step import WorkflowStep +ws = WorkflowStep( + callback_id="your-callback-id", + edit=edit, + save=save, + execute=execute, +) +# Pass Step to set up listeners +app.step(ws) +""" + == message + ) + + +block_actions = { + "type": "block_actions", + "user": { + "id": "W111", + "username": "primary-owner", + "name": "primary-owner", + "team_id": "T111", + }, + "api_app_id": "A111", + "token": "verification_token", + "container": { + "type": "message", + "message_ts": "111.222", + "channel_id": "C111", + "is_ephemeral": True, + }, + "trigger_id": "111.222.valid", + "team": { + "id": "T111", + "domain": "workspace-domain", + "enterprise_id": "E111", + "enterprise_name": "Sandbox Org", + }, + "channel": {"id": "C111", "name": "test-channel"}, + "response_url": "https://hooks.slack.com/actions/T111/111/random-value", + "actions": [ + { + "action_id": "action-id-value", + "block_id": "b", + "text": {"type": "plain_text", "text": "Button", "emoji": True}, + "value": "click_me_123", + "type": "button", + "action_ts": "1596530385.194939", + } + ], +} + +attachment_actions = { + "type": "interactive_message", + "actions": [ + { + "name": "channel_list", + "type": "select", + "selected_options": [{"value": "C111"}], + } + ], + "callback_id": "pick_channel_for_fun", + "team": {"id": "T111", "domain": "hooli-hq"}, + "channel": {"id": "C222", "name": "triage-random"}, + "user": {"id": "U111", "name": "gbelson"}, + "action_ts": "1520966872.245369", + "message_ts": "1520965348.000538", + "attachment_id": "1", + "token": "verification_token", + "is_app_unfurl": True, + "original_message": { + "text": "", + "username": "Belson Bot", + "bot_id": "B111", + "attachments": [ + { + "callback_id": "pick_channel_for_fun", + "text": "Choose a channel", + "id": 1, + "color": "2b72cb", + "actions": [ + { + "id": "1", + "name": "channel_list", + "text": "Public channels", + "type": "select", + "data_source": "channels", + } + ], + "fallback": "Choose a channel", + } + ], + "type": "message", + "subtype": "bot_message", + "ts": "1520965348.000538", + }, + "response_url": "https://hooks.slack.com/actions/T111/111/xxxx", + "trigger_id": "111.222.valid", +} + + +app_mention_event = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "team": "T111", + "channel": "C111", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, +} + +slash_command = { + "token": "fixed-verification-token", + "team_id": "T111", + "team_domain": "maria", + "channel_id": "C111", + "channel_name": "general", + "user_id": "U111", + "user_name": "rainer", + "command": "/start-conv", + "text": "title", + "response_url": "https://xxx.slack.com/commands/T111/xxx/zzz", + "trigger_id": "111.222.xxx", +} + +step_edit_payload = { + "type": "workflow_step_edit", + "token": "verification-token", + "action_ts": "1601541356.268786", + "team": { + "id": "T111", + "domain": "subdomain", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": {"id": "W111", "username": "primary-owner", "team_id": "T111"}, + "callback_id": "copy_review", + "trigger_id": "111.222.xxx", + "workflow_step": { + "workflow_id": "12345", + "step_id": "111-222-333-444-555", + "inputs": { + "taskAuthorEmail": {"value": "seratch@example.com"}, + "taskDescription": {"value": "This is the task for you!"}, + "taskName": {"value": "The important task"}, + }, + "outputs": [ + {"name": "taskName", "type": "text", "label": "Task Name"}, + {"name": "taskDescription", "type": "text", "label": "Task Description"}, + {"name": "taskAuthorEmail", "type": "text", "label": "Task Author Email"}, + ], + }, +} + +step_save_payload = { + "type": "view_submission", + "team": { + "id": "T111", + "domain": "subdomain", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": { + "id": "W111", + "username": "primary-owner", + "name": "primary-owner", + "team_id": "T111", + }, + "api_app_id": "A111", + "token": "verification-token", + "trigger_id": "111.222.xxx", + "view": { + "id": "V111", + "team_id": "T111", + "type": "workflow_step", + "blocks": [ + { + "type": "section", + "block_id": "intro-section", + "text": { + "type": "plain_text", + "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", + }, + }, + { + "type": "input", + "block_id": "task_name_input", + "label": {"type": "plain_text", "text": "Task name"}, + "optional": False, + "element": { + "type": "plain_text_input", + "action_id": "task_name", + "placeholder": {"type": "plain_text", "text": "Write a task name"}, + }, + }, + { + "type": "input", + "block_id": "task_description_input", + "label": {"type": "plain_text", "text": "Task description"}, + "optional": False, + "element": { + "type": "plain_text_input", + "action_id": "task_description", + "placeholder": { + "type": "plain_text", + "text": "Write a description for your task", + }, + }, + }, + { + "type": "input", + "block_id": "task_author_input", + "label": {"type": "plain_text", "text": "Task author"}, + "optional": False, + "element": { + "type": "plain_text_input", + "action_id": "task_author", + "placeholder": {"type": "plain_text", "text": "Write a task name"}, + }, + }, + ], + "private_metadata": "", + "callback_id": "copy_review", + "state": { + "values": { + "task_name_input": { + "task_name": { + "type": "plain_text_input", + "value": "The important task", + } + }, + "task_description_input": { + "task_description": { + "type": "plain_text_input", + "value": "This is the task for you!", + } + }, + "task_author_input": { + "task_author": { + "type": "plain_text_input", + "value": "seratch@example.com", + } + }, + } + }, + "hash": "111.zzz", + "submit_disabled": False, + "app_id": "A111", + "external_id": "", + "app_installed_team_id": "T111", + "bot_id": "B111", + }, + "response_urls": [], + "workflow_step": { + "workflow_step_edit_id": "111.222.zzz", + "workflow_id": "12345", + "step_id": "111-222-333-444-555", + }, +} + +step_execute_payload = { + "token": "verification-token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "workflow_step_execute", + "callback_id": "copy_review", + "workflow_step": { + "workflow_step_execute_id": "zzz-execution", + "workflow_id": "12345", + "workflow_instance_id": "11111", + "step_id": "111-222-333-444-555", + "inputs": { + "taskAuthorEmail": {"value": "ksera@slack-corp.com"}, + "taskDescription": {"value": "sdfsdf"}, + "taskName": {"value": "a"}, + }, + "outputs": [ + {"name": "taskName", "type": "text", "label": "Task Name"}, + { + "name": "taskDescription", + "type": "text", + "label": "Task Description", + }, + { + "name": "taskAuthorEmail", + "type": "text", + "label": "Task Author Email", + }, + ], + }, + "event_ts": "1601541373.225894", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1601541373, +} + +global_shortcut = { + "type": "shortcut", + "token": "verification_token", + "action_ts": "111.111", + "team": { + "id": "T111", + "domain": "workspace-domain", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": {"id": "W111", "username": "primary-owner", "team_id": "T111"}, + "callback_id": "test-shortcut", + "trigger_id": "111.111.xxxxxx", +} + +message_shortcut = { + "type": "message_action", + "token": "verification_token", + "action_ts": "1583637157.207593", + "team": { + "id": "T111", + "domain": "test-test", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": {"id": "W111", "name": "test-test"}, + "channel": {"id": "C111", "name": "dev"}, + "callback_id": "test-shortcut", + "trigger_id": "111.222.xxx", + "message_ts": "1583636382.000300", + "message": { + "client_msg_id": "zzzz-111-222-xxx-yyy", + "type": "message", + "text": "<@W222> test", + "user": "W111", + "ts": "1583636382.000300", + "team": "T111", + "blocks": [ + { + "type": "rich_text", + "block_id": "d7eJ", + "elements": [ + { + "type": "rich_text_section", + "elements": [ + {"type": "user", "user_id": "U222"}, + {"type": "text", "text": " test"}, + ], + } + ], + } + ], + }, + "response_url": "https://hooks.slack.com/app/T111/111/xxx", +} + +view_submission = { + "type": "view_submission", + "team": { + "id": "T111", + "domain": "workspace-domain", + "enterprise_id": "E111", + "enterprise_name": "Sandbox Org", + }, + "user": { + "id": "W111", + "username": "primary-owner", + "name": "primary-owner", + "team_id": "T111", + }, + "api_app_id": "A111", + "token": "verification_token", + "trigger_id": "111.222.valid", + "view": { + "id": "V111", + "team_id": "T111", + "type": "modal", + "blocks": [ + { + "type": "input", + "block_id": "hspI", + "label": { + "type": "plain_text", + "text": "Label", + }, + "optional": False, + "element": {"type": "plain_text_input", "action_id": "maBWU"}, + } + ], + "private_metadata": "This is for you!", + "callback_id": "view-id", + "state": { + "values": {"hspI": {"maBWU": {"type": "plain_text_input", "value": "test"}}} + }, + "hash": "1596530361.3wRYuk3R", + "title": { + "type": "plain_text", + "text": "My App", + }, + "clear_on_close": False, + "notify_on_close": False, + "close": { + "type": "plain_text", + "text": "Cancel", + }, + "submit": { + "type": "plain_text", + "text": "Submit", + }, + "previous_view_id": None, + "root_view_id": "V111", + "app_id": "A111", + "external_id": "", + "app_installed_team_id": "T111", + "bot_id": "B111", + }, + "response_urls": [], +} + +view_closed = { + "type": "view_closed", + "team": { + "id": "T111", + "domain": "workspace-domain", + "enterprise_id": "E111", + "enterprise_name": "Sandbox Org", + }, + "user": { + "id": "W111", + "username": "primary-owner", + "name": "primary-owner", + "team_id": "T111", + }, + "api_app_id": "A111", + "token": "verification_token", + "view": { + "id": "V111", + "team_id": "T111", + "type": "modal", + "blocks": [ + { + "type": "input", + "block_id": "hspI", + "label": { + "type": "plain_text", + "text": "Label", + }, + "optional": False, + "element": {"type": "plain_text_input", "action_id": "maBWU"}, + } + ], + "private_metadata": "This is for you!", + "callback_id": "view-id", + "state": {"values": {}}, + "hash": "1596530361.3wRYuk3R", + "title": { + "type": "plain_text", + "text": "My App", + }, + "clear_on_close": False, + "notify_on_close": False, + "close": { + "type": "plain_text", + "text": "Cancel", + }, + "submit": { + "type": "plain_text", + "text": "Submit", + }, + "previous_view_id": None, + "root_view_id": "V111", + "app_id": "A111", + "external_id": "", + "app_installed_team_id": "T111", + "bot_id": "B111", + }, + "response_urls": [], +} + +block_suggestion = { + "type": "block_suggestion", + "user": { + "id": "W111", + "username": "primary-owner", + "name": "primary-owner", + "team_id": "T111", + }, + "container": {"type": "view", "view_id": "V111"}, + "api_app_id": "A111", + "token": "verification_token", + "action_id": "the-id", + "block_id": "block-id", + "value": "search word", + "team": { + "id": "T111", + "domain": "workspace-domain", + "enterprise_id": "E111", + "enterprise_name": "Sandbox Org", + }, + "view": { + "id": "V111", + "team_id": "T111", + "type": "modal", + "blocks": [ + { + "type": "input", + "block_id": "5ar+", + "label": {"type": "plain_text", "text": "Label"}, + "optional": False, + "element": {"type": "plain_text_input", "action_id": "i5IpR"}, + }, + { + "type": "input", + "block_id": "es_b", + "label": {"type": "plain_text", "text": "Search"}, + "optional": False, + "element": { + "type": "external_select", + "action_id": "es_a", + "placeholder": {"type": "plain_text", "text": "Select an item"}, + }, + }, + { + "type": "input", + "block_id": "mes_b", + "label": {"type": "plain_text", "text": "Search (multi)"}, + "optional": False, + "element": { + "type": "multi_external_select", + "action_id": "mes_a", + "placeholder": {"type": "plain_text", "text": "Select an item"}, + }, + }, + ], + "private_metadata": "", + "callback_id": "view-id", + "state": {"values": {}}, + "hash": "111.xxx", + "title": {"type": "plain_text", "text": "My App"}, + "clear_on_close": False, + "notify_on_close": False, + "close": {"type": "plain_text", "text": "Cancel"}, + "submit": {"type": "plain_text", "text": "Submit"}, + "previous_view_id": None, + "root_view_id": "V111", + "app_id": "A111", + "external_id": "", + "app_installed_team_id": "T111", + "bot_id": "B111", + }, +} + +dialog_suggestion = { + "type": "dialog_suggestion", + "token": "verification_token", + "action_ts": "1596603332.676855", + "team": { + "id": "T111", + "domain": "workspace-domain", + "enterprise_id": "E111", + "enterprise_name": "Sandbox Org", + }, + "user": {"id": "W111", "name": "primary-owner", "team_id": "T111"}, + "channel": {"id": "C111", "name": "test-channel"}, + "name": "types", + "value": "search keyword", + "callback_id": "the-id", + "state": "Limo", +} From 7d0d1eaae2575ccf93a0588f05792eca0f9a8ae1 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 7 May 2021 17:34:05 +0900 Subject: [PATCH 179/719] version 1.6.0 --- setup.py | 2 +- slack_bolt/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 6a42a72dd..bdd2db1b2 100755 --- a/setup.py +++ b/setup.py @@ -55,7 +55,7 @@ "moto<2", # For AWS tests "bottle>=0.12,<1", "boddle>=0.2,<0.3", # For Bottle app tests - "chalice>=1.22.1,<2", + "chalice>=1.22.4,<2", "click>=7,<8", # for chalice "CherryPy>=18,<19", "Django>=3,<4", diff --git a/slack_bolt/version.py b/slack_bolt/version.py index c73df5eee..dfa62616b 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.5.0" +__version__ = "1.6.0" From 31436f729871c38f596a1363aa1d61a5b4c15d0d Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 7 May 2021 17:52:11 +0900 Subject: [PATCH 180/719] Update API docs --- .../adapter/aws_lambda/chalice_handler.html | 132 ++------ .../chalice_lazy_listener_runner.html | 15 +- .../slack_bolt/adapter/aws_lambda/index.html | 5 + .../aws_lambda/local_lambda_client.html | 164 ++++++++++ docs/api-docs/slack_bolt/app/app.html | 131 ++++++-- docs/api-docs/slack_bolt/app/async_app.html | 141 +++++++-- docs/api-docs/slack_bolt/logger/messages.html | 295 +++++++++++++++++- .../oauth/async_callback_options.html | 12 +- .../oauth/async_oauth_settings.html | 20 +- .../slack_bolt/oauth/oauth_settings.html | 20 +- .../slack_bolt/request/async_request.html | 40 ++- docs/api-docs/slack_bolt/request/request.html | 38 ++- docs/api-docs/slack_bolt/util/utils.html | 34 +- docs/api-docs/slack_bolt/version.html | 2 +- 14 files changed, 838 insertions(+), 211 deletions(-) create mode 100644 docs/api-docs/slack_bolt/adapter/aws_lambda/local_lambda_client.html diff --git a/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html b/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html index 032b92679..c46bbd7df 100644 --- a/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html +++ b/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html @@ -27,12 +27,12 @@

      Module slack_bolt.adapter.aws_lambda.chalice_handlerExpand source code
      import logging
      -import json
       from os import getenv
      +from typing import Optional
      +
      +from botocore.client import BaseClient
       
       from chalice.app import Request, Response, Chalice
      -from chalice.config import Config
      -from chalice.test import BaseClient, LambdaContext, InvokeResponse
       
       from slack_bolt.adapter.aws_lambda.chalice_lazy_listener_runner import (
           ChaliceLazyListenerRunner,
      @@ -45,38 +45,22 @@ 

      Module slack_bolt.adapter.aws_lambda.chalice_handlerClasses

      class ChaliceSlackRequestHandler -(app: App, chalice: chalice.app.Chalice) +(app: App, chalice: chalice.app.Chalice, lambda_client: Optional[botocore.client.BaseClient] = None)
      @@ -234,14 +218,21 @@

      Classes

      Expand source code
      class ChaliceSlackRequestHandler:
      -    def __init__(self, app: App, chalice: Chalice):  # type: ignore
      +    def __init__(self, app: App, chalice: Chalice, lambda_client: Optional[BaseClient] = None):  # type: ignore
               self.app = app
               self.chalice = chalice
               self.logger = get_bolt_app_logger(app.name, ChaliceSlackRequestHandler)
       
      -        lambda_client = None
      -        if getenv("AWS_CHALICE_CLI_MODE") == "true":
      -            lambda_client = LocalLambdaClient(self.chalice, Config())
      +        if getenv("AWS_CHALICE_CLI_MODE") == "true" and lambda_client is None:
      +            try:
      +                from slack_bolt.adapter.aws_lambda.local_lambda_client import (
      +                    LocalLambdaClient,
      +                )
      +
      +                lambda_client = LocalLambdaClient(self.chalice, None)
      +            except ImportError:
      +                logging.info("Failed to load LocalLambdaClient for CLI mode.")
      +                pass
       
               self.app.listener_runner.lazy_listener_runner = ChaliceLazyListenerRunner(
                   logger=self.logger, lambda_client=lambda_client
      @@ -377,71 +368,6 @@ 

      Methods

      -
      -class LocalLambdaClient -(app: chalice.app.Chalice, config: chalice.config.Config) -
      -
      -

      Lambda client implementing invoke for use when running with Chalice CLI

      -
      - -Expand source code - -
      class LocalLambdaClient(BaseClient):
      -    """Lambda client implementing `invoke` for use when running with Chalice CLI"""
      -
      -    def __init__(self, app: Chalice, config: Config) -> None:
      -        self._app = app
      -        self._config = config
      -
      -    def invoke(
      -        self,
      -        FunctionName: str = None,
      -        InvocationType: str = "Event",
      -        Payload: str = "{}",
      -    ) -> InvokeResponse:
      -        scoped = self._config.scope(self._config.chalice_stage, FunctionName)
      -        lambda_context = LambdaContext(
      -            FunctionName, memory_size=scoped.lambda_memory_size
      -        )
      -
      -        with self._patched_env_vars(scoped.environment_variables):
      -            response = self._app(json.loads(Payload), lambda_context)
      -        return InvokeResponse(payload=response)
      -
      -

      Ancestors

      -
        -
      • chalice.test.BaseClient
      • -
      -

      Methods

      -
      -
      -def invoke(self, FunctionName: str = None, InvocationType: str = 'Event', Payload: str = '{}') ‑> chalice.test.InvokeResponse -
      -
      -
      -
      - -Expand source code - -
      def invoke(
      -    self,
      -    FunctionName: str = None,
      -    InvocationType: str = "Event",
      -    Payload: str = "{}",
      -) -> InvokeResponse:
      -    scoped = self._config.scope(self._config.chalice_stage, FunctionName)
      -    lambda_context = LambdaContext(
      -        FunctionName, memory_size=scoped.lambda_memory_size
      -    )
      -
      -    with self._patched_env_vars(scoped.environment_variables):
      -        response = self._app(json.loads(Payload), lambda_context)
      -    return InvokeResponse(payload=response)
      -
      -
      -
      -

    @@ -472,12 +398,6 @@

    handle -
  • -

    LocalLambdaClient

    - -
  • diff --git a/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_lazy_listener_runner.html b/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_lazy_listener_runner.html index cb1183a0d..f4780c6d9 100644 --- a/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_lazy_listener_runner.html +++ b/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_lazy_listener_runner.html @@ -28,16 +28,17 @@

    Module slack_bolt.adapter.aws_lambda.chalice_lazy_listen
    import json
     from logging import Logger
    -from typing import Callable, Optional, Any
    +from typing import Callable, Optional
     
     import boto3
    +from botocore.client import BaseClient
     
     from slack_bolt import BoltRequest
     from slack_bolt.lazy_listener import LazyListenerRunner
     
     
     class ChaliceLazyListenerRunner(LazyListenerRunner):
    -    def __init__(self, logger: Logger, lambda_client: Optional[Any] = None):
    +    def __init__(self, logger: Logger, lambda_client: Optional[BaseClient] = None):
             self.lambda_client = lambda_client
             self.logger = logger
     
    @@ -65,8 +66,7 @@ 

    Module slack_bolt.adapter.aws_lambda.chalice_lazy_listen FunctionName=request.context["aws_lambda_function_name"], InvocationType="Event", Payload=json.dumps(payload), - ) - self.logger.info(invocation)

    + )
    @@ -80,7 +80,7 @@

    Classes

    class ChaliceLazyListenerRunner -(logger: logging.Logger, lambda_client: Optional[Any] = None) +(logger: logging.Logger, lambda_client: Optional[botocore.client.BaseClient] = None)
    @@ -89,7 +89,7 @@

    Classes

    Expand source code
    class ChaliceLazyListenerRunner(LazyListenerRunner):
    -    def __init__(self, logger: Logger, lambda_client: Optional[Any] = None):
    +    def __init__(self, logger: Logger, lambda_client: Optional[BaseClient] = None):
             self.lambda_client = lambda_client
             self.logger = logger
     
    @@ -117,8 +117,7 @@ 

    Classes

    FunctionName=request.context["aws_lambda_function_name"], InvocationType="Event", Payload=json.dumps(payload), - ) - self.logger.info(invocation)
    + )

    Ancestors

      diff --git a/docs/api-docs/slack_bolt/adapter/aws_lambda/index.html b/docs/api-docs/slack_bolt/adapter/aws_lambda/index.html index 573bfaba0..0aec8cf2b 100644 --- a/docs/api-docs/slack_bolt/adapter/aws_lambda/index.html +++ b/docs/api-docs/slack_bolt/adapter/aws_lambda/index.html @@ -56,6 +56,10 @@

      Sub-modules

      +
      slack_bolt.adapter.aws_lambda.local_lambda_client
      +
      +
      +
    @@ -84,6 +88,7 @@

    Index

  • slack_bolt.adapter.aws_lambda.internals
  • slack_bolt.adapter.aws_lambda.lambda_s3_oauth_flow
  • slack_bolt.adapter.aws_lambda.lazy_listener_runner
  • +
  • slack_bolt.adapter.aws_lambda.local_lambda_client
  • diff --git a/docs/api-docs/slack_bolt/adapter/aws_lambda/local_lambda_client.html b/docs/api-docs/slack_bolt/adapter/aws_lambda/local_lambda_client.html new file mode 100644 index 000000000..c0e435bed --- /dev/null +++ b/docs/api-docs/slack_bolt/adapter/aws_lambda/local_lambda_client.html @@ -0,0 +1,164 @@ + + + + + + +slack_bolt.adapter.aws_lambda.local_lambda_client API documentation + + + + + + + + + + + +
    +
    +
    +

    Module slack_bolt.adapter.aws_lambda.local_lambda_client

    +
    +
    +
    + +Expand source code + +
    import json
    +
    +from chalice.app import Chalice
    +from chalice.config import Config
    +from chalice.test import BaseClient, LambdaContext, InvokeResponse
    +
    +
    +class LocalLambdaClient(BaseClient):
    +    """Lambda client implementing `invoke` for use when running with Chalice CLI."""
    +
    +    def __init__(self, app: Chalice, config: Config) -> None:
    +        self._app = app
    +        self._config = config if config else Config()
    +
    +    def invoke(
    +        self,
    +        FunctionName: str = None,
    +        InvocationType: str = "Event",
    +        Payload: str = "{}",
    +    ) -> InvokeResponse:
    +        scoped = self._config.scope(self._config.chalice_stage, FunctionName)
    +        lambda_context = LambdaContext(
    +            FunctionName, memory_size=scoped.lambda_memory_size
    +        )
    +
    +        with self._patched_env_vars(scoped.environment_variables):
    +            response = self._app(json.loads(Payload), lambda_context)
    +        return InvokeResponse(payload=response)
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Classes

    +
    +
    +class LocalLambdaClient +(app: chalice.app.Chalice, config: chalice.config.Config) +
    +
    +

    Lambda client implementing invoke for use when running with Chalice CLI.

    +
    + +Expand source code + +
    class LocalLambdaClient(BaseClient):
    +    """Lambda client implementing `invoke` for use when running with Chalice CLI."""
    +
    +    def __init__(self, app: Chalice, config: Config) -> None:
    +        self._app = app
    +        self._config = config if config else Config()
    +
    +    def invoke(
    +        self,
    +        FunctionName: str = None,
    +        InvocationType: str = "Event",
    +        Payload: str = "{}",
    +    ) -> InvokeResponse:
    +        scoped = self._config.scope(self._config.chalice_stage, FunctionName)
    +        lambda_context = LambdaContext(
    +            FunctionName, memory_size=scoped.lambda_memory_size
    +        )
    +
    +        with self._patched_env_vars(scoped.environment_variables):
    +            response = self._app(json.loads(Payload), lambda_context)
    +        return InvokeResponse(payload=response)
    +
    +

    Ancestors

    +
      +
    • chalice.test.BaseClient
    • +
    +

    Methods

    +
    +
    +def invoke(self, FunctionName: str = None, InvocationType: str = 'Event', Payload: str = '{}') ‑> chalice.test.InvokeResponse +
    +
    +
    +
    + +Expand source code + +
    def invoke(
    +    self,
    +    FunctionName: str = None,
    +    InvocationType: str = "Event",
    +    Payload: str = "{}",
    +) -> InvokeResponse:
    +    scoped = self._config.scope(self._config.chalice_stage, FunctionName)
    +    lambda_context = LambdaContext(
    +        FunctionName, memory_size=scoped.lambda_memory_size
    +    )
    +
    +    with self._patched_env_vars(scoped.environment_variables):
    +        response = self._app(json.loads(Payload), lambda_context)
    +    return InvokeResponse(payload=response)
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/app/app.html b/docs/api-docs/slack_bolt/app/app.html index 559314723..31bdc474a 100644 --- a/docs/api-docs/slack_bolt/app/app.html +++ b/docs/api-docs/slack_bolt/app/app.html @@ -127,6 +127,11 @@

    Module slack_bolt.app.app

    installation_store: Optional[InstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility installation_store_bot_only: Optional[bool] = None, + # for customizing the built-in middleware + request_verification_enabled: bool = True, + ignoring_self_events_enabled: bool = True, + ssl_check_enabled: bool = True, + url_verification_enabled: bool = True, # for the OAuth flow oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, @@ -174,6 +179,21 @@

    Module slack_bolt.app.app

    by checking if there is a team/user in the installation data. installation_store: The module offering save/find operations of installation data installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) + request_verification_enabled: False if you would like to disable the built-in middleware (Default: True). + `RequestVerification` is a built-in middleware that verifies the signature in HTTP Mode requests. + Make sure if it's safe enough when you turn a built-in middleware off. + We strongly recommend using RequestVerification for better security. + If you have a proxy that verifies request signature in front of the Bolt app, + it's totally fine to disable RequestVerification to avoid duplication of work. + Don't turn it off just for easiness of development. + ignoring_self_events_enabled: False if you would like to disable the built-in middleware (Default: True). + `IgnoringSelfEvents` is a built-in middleware that enables Bolt apps to easily skip the events + generated by this app's bot user (this is useful for avoiding code error causing an infinite loop). + url_verification_enabled: False if you would like to disable the built-in middleware (Default: True). + `UrlVerification` is a built-in middleware that handles url_verification requests + that verify the endpoint for Events API in HTTP Mode requests. + ssl_check_enabled: bool = False if you would like to disable the built-in middleware (Default: True). + `SslCheck` is a built-in middleware that handles ssl_check requests from Slack. oauth_settings: The settings related to Slack app installation flow (OAuth flow) oauth_flow: Instantiated `slack_bolt.oauth.OAuthFlow`. This is always prioritized over oauth_settings. verification_token: Deprecated verification mechanism. This can used only for ssl_check requests. @@ -320,22 +340,37 @@

    Module slack_bolt.app.app

    self._init_middleware_list_done = False self._init_middleware_list( - token_verification_enabled=token_verification_enabled + token_verification_enabled=token_verification_enabled, + request_verification_enabled=request_verification_enabled, + ignoring_self_events_enabled=ignoring_self_events_enabled, + ssl_check_enabled=ssl_check_enabled, + url_verification_enabled=url_verification_enabled, ) - def _init_middleware_list(self, token_verification_enabled: bool): + def _init_middleware_list( + self, + token_verification_enabled: bool = True, + request_verification_enabled: bool = True, + ignoring_self_events_enabled: bool = True, + ssl_check_enabled: bool = True, + url_verification_enabled: bool = True, + ): if self._init_middleware_list_done: return - self._middleware_list.append( - SslCheck(verification_token=self._verification_token) - ) - self._middleware_list.append(RequestVerification(self._signing_secret)) + if ssl_check_enabled is True: + self._middleware_list.append( + SslCheck(verification_token=self._verification_token) + ) + if request_verification_enabled is True: + self._middleware_list.append(RequestVerification(self._signing_secret)) + # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._oauth_flow is None: if self._token is not None: try: auth_test_result = None if token_verification_enabled: + # This API call is for eagerly validating the token auth_test_result = self._client.auth_test(token=self._token) self._middleware_list.append( SingleTeamAuthorization(auth_test_result=auth_test_result) @@ -352,8 +387,10 @@

    Module slack_bolt.app.app

    self._middleware_list.append( MultiTeamsAuthorization(authorize=self._authorize) ) - self._middleware_list.append(IgnoringSelfEvents()) - self._middleware_list.append(UrlVerification()) + if ignoring_self_events_enabled is True: + self._middleware_list.append(IgnoringSelfEvents()) + if url_verification_enabled is True: + self._middleware_list.append(UrlVerification()) self._init_middleware_list_done = True # ------------------------- @@ -521,8 +558,6 @@

    Module slack_bolt.app.app

    def _handle_unmatched_requests( self, req: BoltRequest, resp: BoltResponse ) -> BoltResponse: - # TODO: provide more info like suggestion of listeners - # e.g., You can handle this type of message with @app.event("app_mention") self._framework_logger.warning(warning_unhandled_request(req)) return resp @@ -1386,7 +1421,7 @@

    Classes

    class App -(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, token_verification_enabled: bool = True, client: Optional[slack_sdk.web.client.WebClient] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: Optional[bool] = None, oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, verification_token: Optional[str] = None) +(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, token_verification_enabled: bool = True, client: Optional[slack_sdk.web.client.WebClient] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, verification_token: Optional[str] = None)

    Bolt App that provides functionalities to register middleware/listeners.

    @@ -1439,6 +1474,25 @@

    Args

    The module offering save/find operations of installation data
    installation_store_bot_only
    Use InstallationStore#find_bot() if True (Default: False)
    +
    request_verification_enabled
    +
    False if you would like to disable the built-in middleware (Default: True). +RequestVerification is a built-in middleware that verifies the signature in HTTP Mode requests. +Make sure if it's safe enough when you turn a built-in middleware off. +We strongly recommend using RequestVerification for better security. +If you have a proxy that verifies request signature in front of the Bolt app, +it's totally fine to disable RequestVerification to avoid duplication of work. +Don't turn it off just for easiness of development.
    +
    ignoring_self_events_enabled
    +
    False if you would like to disable the built-in middleware (Default: True). +IgnoringSelfEvents is a built-in middleware that enables Bolt apps to easily skip the events +generated by this app's bot user (this is useful for avoiding code error causing an infinite loop).
    +
    url_verification_enabled
    +
    False if you would like to disable the built-in middleware (Default: True). +UrlVerification is a built-in middleware that handles url_verification requests +that verify the endpoint for Events API in HTTP Mode requests.
    +
    ssl_check_enabled
    +
    bool = False if you would like to disable the built-in middleware (Default: True). +SslCheck is a built-in middleware that handles ssl_check requests from Slack.
    oauth_settings
    The settings related to Slack app installation flow (OAuth flow)
    oauth_flow
    @@ -1472,6 +1526,11 @@

    Args

    installation_store: Optional[InstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility installation_store_bot_only: Optional[bool] = None, + # for customizing the built-in middleware + request_verification_enabled: bool = True, + ignoring_self_events_enabled: bool = True, + ssl_check_enabled: bool = True, + url_verification_enabled: bool = True, # for the OAuth flow oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, @@ -1519,6 +1578,21 @@

    Args

    by checking if there is a team/user in the installation data. installation_store: The module offering save/find operations of installation data installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) + request_verification_enabled: False if you would like to disable the built-in middleware (Default: True). + `RequestVerification` is a built-in middleware that verifies the signature in HTTP Mode requests. + Make sure if it's safe enough when you turn a built-in middleware off. + We strongly recommend using RequestVerification for better security. + If you have a proxy that verifies request signature in front of the Bolt app, + it's totally fine to disable RequestVerification to avoid duplication of work. + Don't turn it off just for easiness of development. + ignoring_self_events_enabled: False if you would like to disable the built-in middleware (Default: True). + `IgnoringSelfEvents` is a built-in middleware that enables Bolt apps to easily skip the events + generated by this app's bot user (this is useful for avoiding code error causing an infinite loop). + url_verification_enabled: False if you would like to disable the built-in middleware (Default: True). + `UrlVerification` is a built-in middleware that handles url_verification requests + that verify the endpoint for Events API in HTTP Mode requests. + ssl_check_enabled: bool = False if you would like to disable the built-in middleware (Default: True). + `SslCheck` is a built-in middleware that handles ssl_check requests from Slack. oauth_settings: The settings related to Slack app installation flow (OAuth flow) oauth_flow: Instantiated `slack_bolt.oauth.OAuthFlow`. This is always prioritized over oauth_settings. verification_token: Deprecated verification mechanism. This can used only for ssl_check requests. @@ -1665,22 +1739,37 @@

    Args

    self._init_middleware_list_done = False self._init_middleware_list( - token_verification_enabled=token_verification_enabled + token_verification_enabled=token_verification_enabled, + request_verification_enabled=request_verification_enabled, + ignoring_self_events_enabled=ignoring_self_events_enabled, + ssl_check_enabled=ssl_check_enabled, + url_verification_enabled=url_verification_enabled, ) - def _init_middleware_list(self, token_verification_enabled: bool): + def _init_middleware_list( + self, + token_verification_enabled: bool = True, + request_verification_enabled: bool = True, + ignoring_self_events_enabled: bool = True, + ssl_check_enabled: bool = True, + url_verification_enabled: bool = True, + ): if self._init_middleware_list_done: return - self._middleware_list.append( - SslCheck(verification_token=self._verification_token) - ) - self._middleware_list.append(RequestVerification(self._signing_secret)) + if ssl_check_enabled is True: + self._middleware_list.append( + SslCheck(verification_token=self._verification_token) + ) + if request_verification_enabled is True: + self._middleware_list.append(RequestVerification(self._signing_secret)) + # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._oauth_flow is None: if self._token is not None: try: auth_test_result = None if token_verification_enabled: + # This API call is for eagerly validating the token auth_test_result = self._client.auth_test(token=self._token) self._middleware_list.append( SingleTeamAuthorization(auth_test_result=auth_test_result) @@ -1697,8 +1786,10 @@

    Args

    self._middleware_list.append( MultiTeamsAuthorization(authorize=self._authorize) ) - self._middleware_list.append(IgnoringSelfEvents()) - self._middleware_list.append(UrlVerification()) + if ignoring_self_events_enabled is True: + self._middleware_list.append(IgnoringSelfEvents()) + if url_verification_enabled is True: + self._middleware_list.append(UrlVerification()) self._init_middleware_list_done = True # ------------------------- @@ -1866,8 +1957,6 @@

    Args

    def _handle_unmatched_requests( self, req: BoltRequest, resp: BoltResponse ) -> BoltResponse: - # TODO: provide more info like suggestion of listeners - # e.g., You can handle this type of message with @app.event("app_mention") self._framework_logger.warning(warning_unhandled_request(req)) return resp diff --git a/docs/api-docs/slack_bolt/app/async_app.html b/docs/api-docs/slack_bolt/app/async_app.html index 90e10ae97..adbbf75b0 100644 --- a/docs/api-docs/slack_bolt/app/async_app.html +++ b/docs/api-docs/slack_bolt/app/async_app.html @@ -133,10 +133,15 @@

    Module slack_bolt.app.async_app

    token: Optional[str] = None, client: Optional[AsyncWebClient] = None, # for multi-workspace apps + authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, installation_store: Optional[AsyncInstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility installation_store_bot_only: Optional[bool] = None, - authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, + # for customizing the built-in middleware + request_verification_enabled: bool = True, + ignoring_self_events_enabled: bool = True, + ssl_check_enabled: bool = True, + url_verification_enabled: bool = True, # for the OAuth flow oauth_settings: Optional[AsyncOAuthSettings] = None, oauth_flow: Optional[AsyncOAuthFlow] = None, @@ -183,6 +188,21 @@

    Module slack_bolt.app.async_app

    by checking if there is a team/user in the installation data. installation_store: The module offering save/find operations of installation data installation_store_bot_only: Use `AsyncInstallationStore#async_find_bot()` if True (Default: False) + request_verification_enabled: False if you would like to disable the built-in middleware (Default: True). + `AsyncRequestVerification` is a built-in middleware that verifies the signature in HTTP Mode requests. + Make sure if it's safe enough when you turn a built-in middleware off. + We strongly recommend using RequestVerification for better security. + If you have a proxy that verifies request signature in front of the Bolt app, + it's totally fine to disable RequestVerification to avoid duplication of work. + Don't turn it off just for easiness of development. + ignoring_self_events_enabled: False if you would like to disable the built-in middleware (Default: True). + `AsyncIgnoringSelfEvents` is a built-in middleware that enables Bolt apps to easily skip the events + generated by this app's bot user (this is useful for avoiding code error causing an infinite loop). + url_verification_enabled: False if you would like to disable the built-in middleware (Default: True). + `AsyncUrlVerification` is a built-in middleware that handles url_verification requests + that verify the endpoint for Events API in HTTP Mode requests. + ssl_check_enabled: bool = False if you would like to disable the built-in middleware (Default: True). + `AsyncSslCheck` is a built-in middleware that handles ssl_check requests from Slack. oauth_settings: The settings related to Slack app installation flow (OAuth flow) oauth_flow: Instantiated `slack_bolt.oauth.AsyncOAuthFlow`. This is always prioritized over oauth_settings. verification_token: Deprecated verification mechanism. This can used only for ssl_check requests. @@ -344,19 +364,33 @@

    Module slack_bolt.app.async_app

    ) self._init_middleware_list_done = False - self._init_async_middleware_list() + self._init_async_middleware_list( + request_verification_enabled=request_verification_enabled, + ignoring_self_events_enabled=ignoring_self_events_enabled, + ssl_check_enabled=ssl_check_enabled, + url_verification_enabled=url_verification_enabled, + ) self._server: Optional[AsyncSlackAppServer] = None - def _init_async_middleware_list(self): + def _init_async_middleware_list( + self, + request_verification_enabled: bool = True, + ignoring_self_events_enabled: bool = True, + ssl_check_enabled: bool = True, + url_verification_enabled: bool = True, + ): if self._init_middleware_list_done: return - self._async_middleware_list.append( - AsyncSslCheck(verification_token=self._verification_token) - ) - self._async_middleware_list.append( - AsyncRequestVerification(self._signing_secret) - ) + if ssl_check_enabled is True: + self._async_middleware_list.append( + AsyncSslCheck(verification_token=self._verification_token) + ) + if request_verification_enabled is True: + self._async_middleware_list.append( + AsyncRequestVerification(self._signing_secret) + ) + # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._async_oauth_flow is None: if self._token: self._async_middleware_list.append(AsyncSingleTeamAuthorization()) @@ -371,8 +405,10 @@

    Module slack_bolt.app.async_app

    AsyncMultiTeamsAuthorization(authorize=self._async_authorize) ) - self._async_middleware_list.append(AsyncIgnoringSelfEvents()) - self._async_middleware_list.append(AsyncUrlVerification()) + if ignoring_self_events_enabled is True: + self._async_middleware_list.append(AsyncIgnoringSelfEvents()) + if url_verification_enabled is True: + self._async_middleware_list.append(AsyncUrlVerification()) self._init_middleware_list_done = True # ------------------------- @@ -578,8 +614,6 @@

    Module slack_bolt.app.async_app

    def _handle_unmatched_requests( self, req: AsyncBoltRequest, resp: BoltResponse ) -> BoltResponse: - # TODO: provide more info like suggestion of listeners - # e.g., You can handle this type of message with @app.event("app_mention") self._framework_logger.warning(warning_unhandled_request(req)) return resp @@ -1353,7 +1387,7 @@

    Classes

    class AsyncApp -(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, client: Optional[slack_sdk.web.async_client.AsyncWebClient] = None, installation_store: Optional[slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore] = None, installation_store_bot_only: Optional[bool] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, oauth_settings: Optional[AsyncOAuthSettings] = None, oauth_flow: Optional[AsyncOAuthFlow] = None, verification_token: Optional[str] = None) +(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, client: Optional[slack_sdk.web.async_client.AsyncWebClient] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[AsyncOAuthSettings] = None, oauth_flow: Optional[AsyncOAuthFlow] = None, verification_token: Optional[str] = None)

    Bolt App that provides functionalities to register middleware/listeners.

    @@ -1404,6 +1438,25 @@

    Args

    The module offering save/find operations of installation data
    installation_store_bot_only
    Use AsyncInstallationStore#async_find_bot() if True (Default: False)
    +
    request_verification_enabled
    +
    False if you would like to disable the built-in middleware (Default: True). +AsyncRequestVerification is a built-in middleware that verifies the signature in HTTP Mode requests. +Make sure if it's safe enough when you turn a built-in middleware off. +We strongly recommend using RequestVerification for better security. +If you have a proxy that verifies request signature in front of the Bolt app, +it's totally fine to disable RequestVerification to avoid duplication of work. +Don't turn it off just for easiness of development.
    +
    ignoring_self_events_enabled
    +
    False if you would like to disable the built-in middleware (Default: True). +AsyncIgnoringSelfEvents is a built-in middleware that enables Bolt apps to easily skip the events +generated by this app's bot user (this is useful for avoiding code error causing an infinite loop).
    +
    url_verification_enabled
    +
    False if you would like to disable the built-in middleware (Default: True). +AsyncUrlVerification is a built-in middleware that handles url_verification requests +that verify the endpoint for Events API in HTTP Mode requests.
    +
    ssl_check_enabled
    +
    bool = False if you would like to disable the built-in middleware (Default: True). +AsyncSslCheck is a built-in middleware that handles ssl_check requests from Slack.
    oauth_settings
    The settings related to Slack app installation flow (OAuth flow)
    oauth_flow
    @@ -1432,10 +1485,15 @@

    Args

    token: Optional[str] = None, client: Optional[AsyncWebClient] = None, # for multi-workspace apps + authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, installation_store: Optional[AsyncInstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility installation_store_bot_only: Optional[bool] = None, - authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, + # for customizing the built-in middleware + request_verification_enabled: bool = True, + ignoring_self_events_enabled: bool = True, + ssl_check_enabled: bool = True, + url_verification_enabled: bool = True, # for the OAuth flow oauth_settings: Optional[AsyncOAuthSettings] = None, oauth_flow: Optional[AsyncOAuthFlow] = None, @@ -1482,6 +1540,21 @@

    Args

    by checking if there is a team/user in the installation data. installation_store: The module offering save/find operations of installation data installation_store_bot_only: Use `AsyncInstallationStore#async_find_bot()` if True (Default: False) + request_verification_enabled: False if you would like to disable the built-in middleware (Default: True). + `AsyncRequestVerification` is a built-in middleware that verifies the signature in HTTP Mode requests. + Make sure if it's safe enough when you turn a built-in middleware off. + We strongly recommend using RequestVerification for better security. + If you have a proxy that verifies request signature in front of the Bolt app, + it's totally fine to disable RequestVerification to avoid duplication of work. + Don't turn it off just for easiness of development. + ignoring_self_events_enabled: False if you would like to disable the built-in middleware (Default: True). + `AsyncIgnoringSelfEvents` is a built-in middleware that enables Bolt apps to easily skip the events + generated by this app's bot user (this is useful for avoiding code error causing an infinite loop). + url_verification_enabled: False if you would like to disable the built-in middleware (Default: True). + `AsyncUrlVerification` is a built-in middleware that handles url_verification requests + that verify the endpoint for Events API in HTTP Mode requests. + ssl_check_enabled: bool = False if you would like to disable the built-in middleware (Default: True). + `AsyncSslCheck` is a built-in middleware that handles ssl_check requests from Slack. oauth_settings: The settings related to Slack app installation flow (OAuth flow) oauth_flow: Instantiated `slack_bolt.oauth.AsyncOAuthFlow`. This is always prioritized over oauth_settings. verification_token: Deprecated verification mechanism. This can used only for ssl_check requests. @@ -1643,19 +1716,33 @@

    Args

    ) self._init_middleware_list_done = False - self._init_async_middleware_list() + self._init_async_middleware_list( + request_verification_enabled=request_verification_enabled, + ignoring_self_events_enabled=ignoring_self_events_enabled, + ssl_check_enabled=ssl_check_enabled, + url_verification_enabled=url_verification_enabled, + ) self._server: Optional[AsyncSlackAppServer] = None - def _init_async_middleware_list(self): + def _init_async_middleware_list( + self, + request_verification_enabled: bool = True, + ignoring_self_events_enabled: bool = True, + ssl_check_enabled: bool = True, + url_verification_enabled: bool = True, + ): if self._init_middleware_list_done: return - self._async_middleware_list.append( - AsyncSslCheck(verification_token=self._verification_token) - ) - self._async_middleware_list.append( - AsyncRequestVerification(self._signing_secret) - ) + if ssl_check_enabled is True: + self._async_middleware_list.append( + AsyncSslCheck(verification_token=self._verification_token) + ) + if request_verification_enabled is True: + self._async_middleware_list.append( + AsyncRequestVerification(self._signing_secret) + ) + # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._async_oauth_flow is None: if self._token: self._async_middleware_list.append(AsyncSingleTeamAuthorization()) @@ -1670,8 +1757,10 @@

    Args

    AsyncMultiTeamsAuthorization(authorize=self._async_authorize) ) - self._async_middleware_list.append(AsyncIgnoringSelfEvents()) - self._async_middleware_list.append(AsyncUrlVerification()) + if ignoring_self_events_enabled is True: + self._async_middleware_list.append(AsyncIgnoringSelfEvents()) + if url_verification_enabled is True: + self._async_middleware_list.append(AsyncUrlVerification()) self._init_middleware_list_done = True # ------------------------- @@ -1877,8 +1966,6 @@

    Args

    def _handle_unmatched_requests( self, req: AsyncBoltRequest, resp: BoltResponse ) -> BoltResponse: - # TODO: provide more info like suggestion of listeners - # e.g., You can handle this type of message with @app.event("app_mention") self._framework_logger.warning(warning_unhandled_request(req)) return resp diff --git a/docs/api-docs/slack_bolt/logger/messages.html b/docs/api-docs/slack_bolt/logger/messages.html index 34dbd5365..02976d2a1 100644 --- a/docs/api-docs/slack_bolt/logger/messages.html +++ b/docs/api-docs/slack_bolt/logger/messages.html @@ -27,12 +27,22 @@

    Module slack_bolt.logger.messages

    Expand source code
    import time
    -from typing import Union
    +from typing import Union, Dict, Any, Optional
     
     from slack_sdk.web import SlackResponse
     
     from slack_bolt.request import BoltRequest
    -
    +from slack_bolt.request.payload_utils import (
    +    is_action,
    +    is_event,
    +    is_options,
    +    is_shortcut,
    +    is_slash_command,
    +    is_view,
    +    is_workflow_step_edit,
    +    is_workflow_step_save,
    +    is_workflow_step_execute,
    +)
     
     # -------------------------------
     # Error
    @@ -122,10 +132,185 @@ 

    Module slack_bolt.logger.messages

    ) +_unhandled_request_suggestion_prefix = """ +--- +[Suggestion] You can handle this type of event with the following listener function: +""" + + +def _build_filtered_body(body: Optional[Dict[str, Any]]) -> dict: + if body is None: + return {} + + payload_type = body.get("type") + filtered_body = {"type": payload_type} + + if "view" in body: + view = body["view"] + # view_submission, view_closed, workflow_step_save + filtered_body["view"] = { + "type": view.get("type"), + "callback_id": view.get("callback_id"), + } + + if payload_type == "block_actions": + # Block Kit Interactivity + actions = body.get("actions", []) + if len(actions) > 0 and actions[0] is not None: + filtered_body["block_id"] = actions[0].get("block_id") + filtered_body["action_id"] = actions[0].get("action_id") + if payload_type == "block_suggestion": + # Block Kit - external data source + filtered_body["block_id"] = body.get("block_id") + filtered_body["action_id"] = body.get("action_id") + filtered_body["value"] = body.get("value") + + if payload_type == "event_callback" and "event" in body: + # Events API, workflow_step_execute + event_payload = body.get("event", {}) + filtered_event = {"type": event_payload.get("type")} + if "subtype" in body["event"]: + filtered_event["subtype"] = event_payload.get("subtype") + filtered_body["event"] = filtered_event + + if "command" in body: + # Slash Commands + filtered_body["command"] = body.get("command") + + if payload_type in ["workflow_step_edit", "shortcut", "message_action"]: + # Workflow Steps, Global Shortcuts, Message Shortcuts + filtered_body["callback_id"] = body.get("callback_id") + + if payload_type == "interactive_message": + # Actions in Attachments + filtered_body["callback_id"] = body.get("callback_id") + filtered_body["actions"] = body.get("actions") + + if payload_type == "dialog_suggestion": + # Dialogs - external data source + filtered_body["callback_id"] = body.get("callback_id") + filtered_body["value"] = body.get("value") + if payload_type == "dialog_submission": + # Dialogs - clicking submit button + filtered_body["callback_id"] = body.get("callback_id") + filtered_body["submission"] = body.get("submission") + if payload_type == "dialog_cancellation": + # Dialogs - clicking cancel button + filtered_body["callback_id"] = body.get("callback_id") + + return filtered_body + + +def _build_unhandled_request_suggestion(default_message: str, code_snippet: str): + return f"""{default_message}{_unhandled_request_suggestion_prefix}{code_snippet}""" + + def warning_unhandled_request( # type: ignore req: Union[BoltRequest, "AsyncBoltRequest"], # type: ignore ) -> str: # type: ignore - return f"Unhandled request ({req.body})" + filtered_body = _build_filtered_body(req.body) + default_message = f"Unhandled request ({filtered_body})" + if ( + is_workflow_step_edit(req.body) + or is_workflow_step_save(req.body) + or is_workflow_step_execute(req.body) + ): + # @app.step + callback_id = ( + filtered_body.get("callback_id") + or filtered_body.get("view", {}).get("callback_id") # type: ignore + or "your-callback-id" + ) + return _build_unhandled_request_suggestion( + default_message, + f""" +from slack_bolt.workflows.step import WorkflowStep +ws = WorkflowStep( + callback_id="{callback_id}", + edit=edit, + save=save, + execute=execute, +) +# Pass Step to set up listeners +app.step(ws) +""", + ) + if is_action(req.body): + # @app.action + action_id_or_callback_id = req.body.get("callback_id") + if req.body.get("type") == "block_actions": + action_id_or_callback_id = req.body.get("actions")[0].get("action_id") + return _build_unhandled_request_suggestion( + default_message, + f""" +@app.action("{action_id_or_callback_id}") +def handle_some_action(ack, body, logger): + ack() + logger.info(body) +""", + ) + if is_options(req.body): + # @app.options + constraints = '"action-id"' + if req.body.get("action_id") is not None: + constraints = '"' + req.body.get("action_id") + '"' + elif req.body.get("type") == "dialog_suggestion": + constraints = f"""{{"type": "dialog_suggestion", "callback_id": "{req.body.get('callback_id')}"}}""" + return _build_unhandled_request_suggestion( + default_message, + f""" +@app.options({constraints}) +def handle_some_options(ack): + ack(options=[ ... ]) +""", + ) + if is_shortcut(req.body): + # @app.shortcut + id = req.body.get("action_id") or req.body.get("callback_id") + return _build_unhandled_request_suggestion( + default_message, + f""" +@app.shortcut("{id}") +def handle_shortcuts(ack, body, logger): + ack() + logger.info(body) +""", + ) + if is_view(req.body): + # @app.view + return _build_unhandled_request_suggestion( + default_message, + f""" +@app.view("{req.body.get('view', {}).get('callback_id', 'modal-view-id')}") +def handle_view_events(ack, body, logger): + ack() + logger.info(body) +""", + ) + if is_event(req.body): + # @app.event + event_type = req.body.get("event", {}).get("type") + return _build_unhandled_request_suggestion( + default_message, + f""" +@app.event("{event_type}") +def handle_{event_type}_events(body, logger): + logger.info(body) +""", + ) + if is_slash_command(req.body): + # @app.command + command = req.body.get("command", "/your-command") + return _build_unhandled_request_suggestion( + default_message, + f""" +@app.command("{command}") +def handle_some_command(ack, body, logger): + ack() + logger.info(body) +""", + ) + return default_message def warning_did_not_call_ack(listener_name: str) -> str: @@ -570,7 +755,109 @@

    Functions

    def warning_unhandled_request(  # type: ignore
         req: Union[BoltRequest, "AsyncBoltRequest"],  # type: ignore
     ) -> str:  # type: ignore
    -    return f"Unhandled request ({req.body})"
    + filtered_body = _build_filtered_body(req.body) + default_message = f"Unhandled request ({filtered_body})" + if ( + is_workflow_step_edit(req.body) + or is_workflow_step_save(req.body) + or is_workflow_step_execute(req.body) + ): + # @app.step + callback_id = ( + filtered_body.get("callback_id") + or filtered_body.get("view", {}).get("callback_id") # type: ignore + or "your-callback-id" + ) + return _build_unhandled_request_suggestion( + default_message, + f""" +from slack_bolt.workflows.step import WorkflowStep +ws = WorkflowStep( + callback_id="{callback_id}", + edit=edit, + save=save, + execute=execute, +) +# Pass Step to set up listeners +app.step(ws) +""", + ) + if is_action(req.body): + # @app.action + action_id_or_callback_id = req.body.get("callback_id") + if req.body.get("type") == "block_actions": + action_id_or_callback_id = req.body.get("actions")[0].get("action_id") + return _build_unhandled_request_suggestion( + default_message, + f""" +@app.action("{action_id_or_callback_id}") +def handle_some_action(ack, body, logger): + ack() + logger.info(body) +""", + ) + if is_options(req.body): + # @app.options + constraints = '"action-id"' + if req.body.get("action_id") is not None: + constraints = '"' + req.body.get("action_id") + '"' + elif req.body.get("type") == "dialog_suggestion": + constraints = f"""{{"type": "dialog_suggestion", "callback_id": "{req.body.get('callback_id')}"}}""" + return _build_unhandled_request_suggestion( + default_message, + f""" +@app.options({constraints}) +def handle_some_options(ack): + ack(options=[ ... ]) +""", + ) + if is_shortcut(req.body): + # @app.shortcut + id = req.body.get("action_id") or req.body.get("callback_id") + return _build_unhandled_request_suggestion( + default_message, + f""" +@app.shortcut("{id}") +def handle_shortcuts(ack, body, logger): + ack() + logger.info(body) +""", + ) + if is_view(req.body): + # @app.view + return _build_unhandled_request_suggestion( + default_message, + f""" +@app.view("{req.body.get('view', {}).get('callback_id', 'modal-view-id')}") +def handle_view_events(ack, body, logger): + ack() + logger.info(body) +""", + ) + if is_event(req.body): + # @app.event + event_type = req.body.get("event", {}).get("type") + return _build_unhandled_request_suggestion( + default_message, + f""" +@app.event("{event_type}") +def handle_{event_type}_events(body, logger): + logger.info(body) +""", + ) + if is_slash_command(req.body): + # @app.command + command = req.body.get("command", "/your-command") + return _build_unhandled_request_suggestion( + default_message, + f""" +@app.command("{command}") +def handle_some_command(ack, body, logger): + ack() + logger.info(body) +""", + ) + return default_message
    diff --git a/docs/api-docs/slack_bolt/oauth/async_callback_options.html b/docs/api-docs/slack_bolt/oauth/async_callback_options.html index 668bf63ae..c09e724ae 100644 --- a/docs/api-docs/slack_bolt/oauth/async_callback_options.html +++ b/docs/api-docs/slack_bolt/oauth/async_callback_options.html @@ -119,8 +119,10 @@

    Module slack_bolt.oauth.async_callback_optionsArgs

    state_utils=state_utils, redirect_uri_page_renderer=redirect_uri_page_renderer, ) - self.success = self._success_handler - self.failure = self._failure_handler + # Note that pytype 2021.4.26 misunderstands these assignments. + # Thus, we put "type: ignore" for the following two lines + self.success = self._success_handler # type: ignore + self.failure = self._failure_handler # type: ignore # -------------------------- # Internal methods diff --git a/docs/api-docs/slack_bolt/oauth/async_oauth_settings.html b/docs/api-docs/slack_bolt/oauth/async_oauth_settings.html index d479a3f38..5c3a4a0f7 100644 --- a/docs/api-docs/slack_bolt/oauth/async_oauth_settings.html +++ b/docs/api-docs/slack_bolt/oauth/async_oauth_settings.html @@ -131,12 +131,14 @@

    Module slack_bolt.oauth.async_oauth_settings

    logger: The logger that will be used internally """ # OAuth flow parameters/credentials - self.client_id = client_id or os.environ.get("SLACK_CLIENT_ID") - self.client_secret = client_secret or os.environ.get( - "SLACK_CLIENT_SECRET", None + client_id: Optional[str] = client_id or os.environ.get("SLACK_CLIENT_ID") + client_secret: Optional[str] = client_secret or os.environ.get( + "SLACK_CLIENT_SECRET" ) - if self.client_id is None or self.client_secret is None: + if client_id is None or client_secret is None: raise BoltError("Both client_id and client_secret are required") + self.client_id = client_id + self.client_secret = client_secret self.scopes = scopes or os.environ.get("SLACK_SCOPES", "").split(",") if isinstance(self.scopes, str): @@ -336,12 +338,14 @@

    Args

    logger: The logger that will be used internally """ # OAuth flow parameters/credentials - self.client_id = client_id or os.environ.get("SLACK_CLIENT_ID") - self.client_secret = client_secret or os.environ.get( - "SLACK_CLIENT_SECRET", None + client_id: Optional[str] = client_id or os.environ.get("SLACK_CLIENT_ID") + client_secret: Optional[str] = client_secret or os.environ.get( + "SLACK_CLIENT_SECRET" ) - if self.client_id is None or self.client_secret is None: + if client_id is None or client_secret is None: raise BoltError("Both client_id and client_secret are required") + self.client_id = client_id + self.client_secret = client_secret self.scopes = scopes or os.environ.get("SLACK_SCOPES", "").split(",") if isinstance(self.scopes, str): diff --git a/docs/api-docs/slack_bolt/oauth/oauth_settings.html b/docs/api-docs/slack_bolt/oauth/oauth_settings.html index b9459f0c7..4624e9f85 100644 --- a/docs/api-docs/slack_bolt/oauth/oauth_settings.html +++ b/docs/api-docs/slack_bolt/oauth/oauth_settings.html @@ -125,12 +125,14 @@

    Module slack_bolt.oauth.oauth_settings

    state_expiration_seconds: The seconds that the state value is alive (Default: 600 seconds) logger: The logger that will be used internally """ - self.client_id = client_id or os.environ.get("SLACK_CLIENT_ID") - self.client_secret = client_secret or os.environ.get( - "SLACK_CLIENT_SECRET", None + client_id: Optional[str] = client_id or os.environ.get("SLACK_CLIENT_ID") + client_secret: Optional[str] = client_secret or os.environ.get( + "SLACK_CLIENT_SECRET" ) - if self.client_id is None or self.client_secret is None: + if client_id is None or client_secret is None: raise BoltError("Both client_id and client_secret are required") + self.client_id = client_id + self.client_secret = client_secret self.scopes = scopes or os.environ.get("SLACK_SCOPES", "").split(",") if isinstance(self.scopes, str): @@ -329,12 +331,14 @@

    Args

    state_expiration_seconds: The seconds that the state value is alive (Default: 600 seconds) logger: The logger that will be used internally """ - self.client_id = client_id or os.environ.get("SLACK_CLIENT_ID") - self.client_secret = client_secret or os.environ.get( - "SLACK_CLIENT_SECRET", None + client_id: Optional[str] = client_id or os.environ.get("SLACK_CLIENT_ID") + client_secret: Optional[str] = client_secret or os.environ.get( + "SLACK_CLIENT_SECRET" ) - if self.client_id is None or self.client_secret is None: + if client_id is None or client_secret is None: raise BoltError("Both client_id and client_secret are required") + self.client_id = client_id + self.client_secret = client_secret self.scopes = scopes or os.environ.get("SLACK_SCOPES", "").split(",") if isinstance(self.scopes, str): diff --git a/docs/api-docs/slack_bolt/request/async_request.html b/docs/api-docs/slack_bolt/request/async_request.html index 11d5fd887..97be298e9 100644 --- a/docs/api-docs/slack_bolt/request/async_request.html +++ b/docs/api-docs/slack_bolt/request/async_request.html @@ -70,9 +70,21 @@

    Module slack_bolt.request.async_request

    context: The context in this request. mode: The mode used for this request. (either "http" or "socket_mode") """ - if mode == "http" and not isinstance(body, str): - raise BoltError(error_message_raw_body_required_in_http_mode()) - self.raw_body = body if mode == "http" else "" + + if mode == "http": + # HTTP Mode + if not isinstance(body, str): + raise BoltError(error_message_raw_body_required_in_http_mode()) + self.raw_body = body if body is not None else "" + else: + # Socket Mode + if body is not None and isinstance(body, str): + self.raw_body = body + else: + # We don't convert the dict value to str + # as doing so does not guarantee to keep the original structure/format. + self.raw_body = "" + self.query = parse_query(query) self.headers = build_normalized_headers(headers) self.content_type = extract_content_type(self.headers) @@ -85,7 +97,7 @@

    Module slack_bolt.request.async_request

    self.context = build_async_context( AsyncBoltContext(context if context else {}), self.body ) - self.lazy_only = self.headers.get("x-slack-bolt-lazy-only", [False])[0] + self.lazy_only = bool(self.headers.get("x-slack-bolt-lazy-only", [False])[0]) self.lazy_function_name = self.headers.get( "x-slack-bolt-lazy-function-name", [None] )[0] @@ -153,9 +165,21 @@

    Args

    context: The context in this request. mode: The mode used for this request. (either "http" or "socket_mode") """ - if mode == "http" and not isinstance(body, str): - raise BoltError(error_message_raw_body_required_in_http_mode()) - self.raw_body = body if mode == "http" else "" + + if mode == "http": + # HTTP Mode + if not isinstance(body, str): + raise BoltError(error_message_raw_body_required_in_http_mode()) + self.raw_body = body if body is not None else "" + else: + # Socket Mode + if body is not None and isinstance(body, str): + self.raw_body = body + else: + # We don't convert the dict value to str + # as doing so does not guarantee to keep the original structure/format. + self.raw_body = "" + self.query = parse_query(query) self.headers = build_normalized_headers(headers) self.content_type = extract_content_type(self.headers) @@ -168,7 +192,7 @@

    Args

    self.context = build_async_context( AsyncBoltContext(context if context else {}), self.body ) - self.lazy_only = self.headers.get("x-slack-bolt-lazy-only", [False])[0] + self.lazy_only = bool(self.headers.get("x-slack-bolt-lazy-only", [False])[0]) self.lazy_function_name = self.headers.get( "x-slack-bolt-lazy-function-name", [None] )[0] diff --git a/docs/api-docs/slack_bolt/request/request.html b/docs/api-docs/slack_bolt/request/request.html index acb5c3176..ce8fd5b42 100644 --- a/docs/api-docs/slack_bolt/request/request.html +++ b/docs/api-docs/slack_bolt/request/request.html @@ -70,9 +70,20 @@

    Module slack_bolt.request.request

    context: The context in this request. mode: The mode used for this request. (either "http" or "socket_mode") """ - if mode == "http" and not isinstance(body, str): - raise BoltError(error_message_raw_body_required_in_http_mode()) - self.raw_body = body if mode == "http" else "" + if mode == "http": + # HTTP Mode + if not isinstance(body, str): + raise BoltError(error_message_raw_body_required_in_http_mode()) + self.raw_body = body if body is not None else "" + else: + # Socket Mode + if body is not None and isinstance(body, str): + self.raw_body = body + else: + # We don't convert the dict value to str + # as doing so does not guarantee to keep the original structure/format. + self.raw_body = "" + self.query = parse_query(query) self.headers = build_normalized_headers(headers) self.content_type = extract_content_type(self.headers) @@ -84,7 +95,7 @@

    Module slack_bolt.request.request

    raise BoltError(error_message_unknown_request_body_type()) self.context = build_context(BoltContext(context if context else {}), self.body) - self.lazy_only = self.headers.get("x-slack-bolt-lazy-only", [False])[0] + self.lazy_only = bool(self.headers.get("x-slack-bolt-lazy-only", [False])[0]) self.lazy_function_name = self.headers.get( "x-slack-bolt-lazy-function-name", [None] )[0] @@ -152,9 +163,20 @@

    Args

    context: The context in this request. mode: The mode used for this request. (either "http" or "socket_mode") """ - if mode == "http" and not isinstance(body, str): - raise BoltError(error_message_raw_body_required_in_http_mode()) - self.raw_body = body if mode == "http" else "" + if mode == "http": + # HTTP Mode + if not isinstance(body, str): + raise BoltError(error_message_raw_body_required_in_http_mode()) + self.raw_body = body if body is not None else "" + else: + # Socket Mode + if body is not None and isinstance(body, str): + self.raw_body = body + else: + # We don't convert the dict value to str + # as doing so does not guarantee to keep the original structure/format. + self.raw_body = "" + self.query = parse_query(query) self.headers = build_normalized_headers(headers) self.content_type = extract_content_type(self.headers) @@ -166,7 +188,7 @@

    Args

    raise BoltError(error_message_unknown_request_body_type()) self.context = build_context(BoltContext(context if context else {}), self.body) - self.lazy_only = self.headers.get("x-slack-bolt-lazy-only", [False])[0] + self.lazy_only = bool(self.headers.get("x-slack-bolt-lazy-only", [False])[0]) self.lazy_function_name = self.headers.get( "x-slack-bolt-lazy-function-name", [None] )[0] diff --git a/docs/api-docs/slack_bolt/util/utils.html b/docs/api-docs/slack_bolt/util/utils.html index 5b9d46594..2a18a57c3 100644 --- a/docs/api-docs/slack_bolt/util/utils.html +++ b/docs/api-docs/slack_bolt/util/utils.html @@ -85,10 +85,19 @@

    Module slack_bolt.util.utils

    else: return "Bolt app is running!" - if development_server: - return "⚡️ Bolt app is running! (development server)" - else: - return "⚡️ Bolt app is running!" + try: + if development_server: + return "⚡️ Bolt app is running! (development server)" + else: + return "⚡️ Bolt app is running!" + except ValueError: + # ValueError is a runtime exception for a given value + # It's a super class of UnicodeEncodeError, which may be raised in the scenario + # see also: https://github.com/slackapi/bolt-python/issues/170 + if development_server: + return "Bolt app is running! (development server)" + else: + return "Bolt app is running!" def get_name_for_callable(func: Callable) -> str: @@ -205,10 +214,19 @@

    Functions

    else: return "Bolt app is running!" - if development_server: - return "⚡️ Bolt app is running! (development server)" - else: - return "⚡️ Bolt app is running!"
    + try: + if development_server: + return "⚡️ Bolt app is running! (development server)" + else: + return "⚡️ Bolt app is running!" + except ValueError: + # ValueError is a runtime exception for a given value + # It's a super class of UnicodeEncodeError, which may be raised in the scenario + # see also: https://github.com/slackapi/bolt-python/issues/170 + if development_server: + return "Bolt app is running! (development server)" + else: + return "Bolt app is running!"
    diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index ef1267173..274497ee7 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.5.0"
    +__version__ = "1.6.0"
    From ace3cb842257bcdb3cd0d3894c4db6bf46af952a Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 11 May 2021 05:44:34 +0900 Subject: [PATCH 181/719] Fix #330 Potentially request.body can be None when using a custom adapter (#331) * Fix #330 Potentially request.body can be None when using a custom adapter * Add scenario tests --- slack_bolt/request/async_request.py | 7 +- slack_bolt/request/internals.py | 4 -- slack_bolt/request/request.py | 6 +- tests/scenario_tests/test_app.py | 37 +++++++++- .../scenario_tests_async/test_app_dispatch.py | 72 +++++++++++++++++++ tests/slack_bolt/request/test_request.py | 23 ++++++ tests/slack_bolt_async/request/__init__.py | 0 .../request/test_async_request.py | 21 ++++++ 8 files changed, 159 insertions(+), 11 deletions(-) create mode 100644 tests/scenario_tests_async/test_app_dispatch.py create mode 100644 tests/slack_bolt/request/test_request.py create mode 100644 tests/slack_bolt_async/request/__init__.py create mode 100644 tests/slack_bolt_async/request/test_async_request.py diff --git a/slack_bolt/request/async_request.py b/slack_bolt/request/async_request.py index 97ceab159..ad671ccc2 100644 --- a/slack_bolt/request/async_request.py +++ b/slack_bolt/request/async_request.py @@ -9,7 +9,6 @@ build_normalized_headers, extract_content_type, error_message_raw_body_required_in_http_mode, - error_message_unknown_request_body_type, ) @@ -45,7 +44,7 @@ def __init__( if mode == "http": # HTTP Mode - if not isinstance(body, str): + if body is not None and not isinstance(body, str): raise BoltError(error_message_raw_body_required_in_http_mode()) self.raw_body = body if body is not None else "" else: @@ -60,12 +59,14 @@ def __init__( self.query = parse_query(query) self.headers = build_normalized_headers(headers) self.content_type = extract_content_type(self.headers) + if isinstance(body, str): self.body = parse_body(self.raw_body, self.content_type) elif isinstance(body, dict): self.body = body else: - raise BoltError(error_message_unknown_request_body_type()) + self.body = {} + self.context = build_async_context( AsyncBoltContext(context if context else {}), self.body ) diff --git a/slack_bolt/request/internals.py b/slack_bolt/request/internals.py index 4b70df1b3..2fd0c430e 100644 --- a/slack_bolt/request/internals.py +++ b/slack_bolt/request/internals.py @@ -183,10 +183,6 @@ def error_message_raw_body_required_in_http_mode() -> str: return "`body` must be a raw string data when running in the HTTP server mode" -def error_message_unknown_request_body_type() -> str: - return "`body` must be either str or dict" - - def debug_multiple_response_urls_detected() -> str: return ( "`response_urls` in the body has multiple URLs in it. " diff --git a/slack_bolt/request/request.py b/slack_bolt/request/request.py index 5d48d7a35..d91e78ba6 100644 --- a/slack_bolt/request/request.py +++ b/slack_bolt/request/request.py @@ -9,7 +9,6 @@ build_context, extract_content_type, error_message_raw_body_required_in_http_mode, - error_message_unknown_request_body_type, ) @@ -44,7 +43,7 @@ def __init__( """ if mode == "http": # HTTP Mode - if not isinstance(body, str): + if body is not None and not isinstance(body, str): raise BoltError(error_message_raw_body_required_in_http_mode()) self.raw_body = body if body is not None else "" else: @@ -59,12 +58,13 @@ def __init__( self.query = parse_query(query) self.headers = build_normalized_headers(headers) self.content_type = extract_content_type(self.headers) + if isinstance(body, str): self.body = parse_body(self.raw_body, self.content_type) elif isinstance(body, dict): self.body = body else: - raise BoltError(error_message_unknown_request_body_type()) + self.body = {} self.context = build_context(BoltContext(context if context else {}), self.body) self.lazy_only = bool(self.headers.get("x-slack-bolt-lazy-only", [False])[0]) diff --git a/tests/scenario_tests/test_app.py b/tests/scenario_tests/test_app.py index 5d91dd577..8d3a4a3db 100644 --- a/tests/scenario_tests/test_app.py +++ b/tests/scenario_tests/test_app.py @@ -3,7 +3,7 @@ from slack_sdk.oauth.installation_store import FileInstallationStore from slack_sdk.oauth.state_store import FileOAuthStateStore -from slack_bolt import App, Say +from slack_bolt import App, Say, BoltRequest from slack_bolt.authorization import AuthorizeResult from slack_bolt.error import BoltError from slack_bolt.oauth import OAuthFlow @@ -187,3 +187,38 @@ def test_installation_store_conflicts(self): installation_store=store1, ) assert app.installation_store is store1 + + def test_none_body(self): + app = App(signing_secret="valid", client=self.web_client) + + req = BoltRequest(body=None, headers={}, mode="http") + response = app.dispatch(req) + # request verification failure + assert response.status == 401 + assert response.body == '{"error": "invalid request"}' + + req = BoltRequest(body=None, headers={}, mode="socket_mode") + response = app.dispatch(req) + # request verification is skipped for Socket Mode + assert response.status == 404 + assert response.body == '{"error": "unhandled request"}' + + def test_none_body_no_middleware(self): + app = App( + signing_secret="valid", + client=self.web_client, + ssl_check_enabled=False, + ignoring_self_events_enabled=False, + request_verification_enabled=False, + token_verification_enabled=False, + url_verification_enabled=False, + ) + req = BoltRequest(body=None, headers={}, mode="http") + response = app.dispatch(req) + assert response.status == 404 + assert response.body == '{"error": "unhandled request"}' + + req = BoltRequest(body=None, headers={}, mode="socket_mode") + response = app.dispatch(req) + assert response.status == 404 + assert response.body == '{"error": "unhandled request"}' diff --git a/tests/scenario_tests_async/test_app_dispatch.py b/tests/scenario_tests_async/test_app_dispatch.py new file mode 100644 index 000000000..34396a2d1 --- /dev/null +++ b/tests/scenario_tests_async/test_app_dispatch.py @@ -0,0 +1,72 @@ +import asyncio + +import pytest +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestAsyncAppDispatch: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + @pytest.mark.asyncio + async def test_none_body(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + req = AsyncBoltRequest(body=None, headers={}, mode="http") + response = await app.async_dispatch(req) + # request verification failure + assert response.status == 401 + assert response.body == '{"error": "invalid request"}' + + req = AsyncBoltRequest(body=None, headers={}, mode="socket_mode") + response = await app.async_dispatch(req) + # request verification is skipped for Socket Mode + assert response.status == 404 + assert response.body == '{"error": "unhandled request"}' + + @pytest.mark.asyncio + async def test_none_body_no_middleware(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ssl_check_enabled=False, + ignoring_self_events_enabled=False, + request_verification_enabled=False, + # token_verification_enabled=False, + url_verification_enabled=False, + ) + + req = AsyncBoltRequest(body=None, headers={}, mode="http") + response = await app.async_dispatch(req) + assert response.status == 404 + assert response.body == '{"error": "unhandled request"}' + + req = AsyncBoltRequest(body=None, headers={}, mode="socket_mode") + response = await app.async_dispatch(req) + assert response.status == 404 + assert response.body == '{"error": "unhandled request"}' diff --git a/tests/slack_bolt/request/test_request.py b/tests/slack_bolt/request/test_request.py new file mode 100644 index 000000000..b6a81ecca --- /dev/null +++ b/tests/slack_bolt/request/test_request.py @@ -0,0 +1,23 @@ +from slack_bolt.request.request import BoltRequest + + +class TestRequest: + def setup_method(self): + pass + + def teardown_method(self): + pass + + def test_all_none_inputs_http(self): + req = BoltRequest(body=None, headers=None, query=None, context=None) + assert req is not None + assert req.raw_body == "" + assert req.body == {} + + def test_all_none_inputs_socket_mode(self): + req = BoltRequest( + body=None, headers=None, query=None, context=None, mode="socket_mode" + ) + assert req is not None + assert req.raw_body == "" + assert req.body == {} diff --git a/tests/slack_bolt_async/request/__init__.py b/tests/slack_bolt_async/request/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/slack_bolt_async/request/test_async_request.py b/tests/slack_bolt_async/request/test_async_request.py new file mode 100644 index 000000000..e69a242cf --- /dev/null +++ b/tests/slack_bolt_async/request/test_async_request.py @@ -0,0 +1,21 @@ +import pytest + +from slack_bolt.request.async_request import AsyncBoltRequest + + +class TestAsyncRequest: + @pytest.mark.asyncio + async def test_all_none_values_http(self): + req = AsyncBoltRequest(body=None, headers=None, query=None, context=None) + assert req is not None + assert req.raw_body == "" + assert req.body == {} + + @pytest.mark.asyncio + async def test_all_none_values_socket_mode(self): + req = AsyncBoltRequest( + body=None, headers=None, query=None, context=None, mode="socket_mode" + ) + assert req is not None + assert req.raw_body == "" + assert req.body == {} From 1400f646426464f88967444951332f752234c0fb Mon Sep 17 00:00:00 2001 From: siegerts Date: Tue, 11 May 2021 23:05:55 -0400 Subject: [PATCH 182/719] chore(lazy_listener): fix typo (#338) --- docs/_advanced/lazy_listener.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_advanced/lazy_listener.md b/docs/_advanced/lazy_listener.md index 9ae5f9f81..d556b08f6 100644 --- a/docs/_advanced/lazy_listener.md +++ b/docs/_advanced/lazy_listener.md @@ -92,7 +92,7 @@ def handler(event, context): return slack_handler.handle(event, context) ``` -Please note that the followig IAM permissions would be required for running this example app. +Please note that the following IAM permissions would be required for running this example app. ```json { From c6571179253c6c288ac58468d074d5829e611962 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 12 May 2021 13:55:10 +0900 Subject: [PATCH 183/719] Set Werkzeug major version to 1 for Flask compatibility (#340) * Set Werkzeug major version to 1 for Flask-Sockets compatibility --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index bdd2db1b2..7dec70019 100755 --- a/setup.py +++ b/setup.py @@ -17,6 +17,7 @@ "pytest-asyncio<1", # for async "aiohttp>=3,<4", # for async "Flask-Sockets>=0.2,<1", + "Werkzeug<2", # Flask-Sockets is not yet compatible with the major version "black==20.8b1", ] @@ -62,6 +63,7 @@ "falcon>=2,<3", "fastapi<1", "Flask>=1,<2", + "Werkzeug<2", # Flask is not yet compatible with the major version "pyramid>=1,<2", "sanic>=20,<21", "starlette>=0.13,<1", From 6bc0fca14884682032ddc62f555ffe67568b2c69 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 12 May 2021 17:40:56 +0900 Subject: [PATCH 184/719] Add comment about the API Gateway payload format --- slack_bolt/adapter/aws_lambda/handler.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/slack_bolt/adapter/aws_lambda/handler.py b/slack_bolt/adapter/aws_lambda/handler.py index fef64094c..349123783 100644 --- a/slack_bolt/adapter/aws_lambda/handler.py +++ b/slack_bolt/adapter/aws_lambda/handler.py @@ -75,6 +75,12 @@ def handle(self, event, context): def to_bolt_request(event) -> BoltRequest: + """Note that this handler supports only the payload format 2.0. + This means you can use this with HTTP API while REST API is not supported. + + Read https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html + for more details. + """ body = event.get("body", "") if event["isBase64Encoded"]: body = base64.b64decode(body).decode("utf-8") From 51daa120da1d10d0fff3b937099eaa0fca563b96 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 12 May 2021 19:08:59 +0900 Subject: [PATCH 185/719] Update comments about Flask versions in setup.py --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 7dec70019..4a57c98ba 100755 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ "pytest-asyncio<1", # for async "aiohttp>=3,<4", # for async "Flask-Sockets>=0.2,<1", - "Werkzeug<2", # Flask-Sockets is not yet compatible with the major version + "Werkzeug<2", # TODO: support Flask 2.x "black==20.8b1", ] @@ -63,7 +63,7 @@ "falcon>=2,<3", "fastapi<1", "Flask>=1,<2", - "Werkzeug<2", # Flask is not yet compatible with the major version + "Werkzeug<2", # TODO: support Flask 2.x "pyramid>=1,<2", "sanic>=20,<21", "starlette>=0.13,<1", From 51edf84b3fc2efce88782e894c63f080a511d898 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 24 May 2021 15:24:46 +0900 Subject: [PATCH 186/719] Update the Django example (#348) --- examples/django/README.md | 83 +++++++++- examples/django/manage.py | 3 +- .../{slackapp => myslackapp}/__init__.py | 0 examples/django/myslackapp/asgi.py | 16 ++ .../{slackapp => myslackapp}/settings.py | 146 ++++++++++-------- examples/django/myslackapp/urls.py | 42 +++++ .../django/{slackapp => myslackapp}/wsgi.py | 6 +- .../migrations => oauth_app}/__init__.py | 0 examples/django/oauth_app/apps.py | 6 + .../migrations/0001_initial.py | 12 +- .../django/oauth_app/migrations/__init__.py | 0 examples/django/oauth_app/models.py | 69 +++++++++ .../slack_datastores.py} | 143 +---------------- examples/django/oauth_app/slack_listeners.py | 71 +++++++++ examples/django/oauth_app/urls.py | 25 +++ examples/django/requirements.txt | 3 +- examples/django/simple_app/__init__.py | 0 examples/django/simple_app/apps.py | 6 + .../django/simple_app/migrations/__init__.py | 0 examples/django/simple_app/models.py | 3 + examples/django/simple_app/slack_listeners.py | 19 +++ .../{slackapp/views.py => simple_app/urls.py} | 15 +- examples/django/slackapp/apps.py | 5 - examples/django/slackapp/urls.py | 9 -- 24 files changed, 441 insertions(+), 241 deletions(-) rename examples/django/{slackapp => myslackapp}/__init__.py (100%) create mode 100644 examples/django/myslackapp/asgi.py rename examples/django/{slackapp => myslackapp}/settings.py (60%) create mode 100644 examples/django/myslackapp/urls.py rename examples/django/{slackapp => myslackapp}/wsgi.py (57%) rename examples/django/{slackapp/migrations => oauth_app}/__init__.py (100%) create mode 100644 examples/django/oauth_app/apps.py rename examples/django/{slackapp => oauth_app}/migrations/0001_initial.py (93%) create mode 100644 examples/django/oauth_app/migrations/__init__.py create mode 100644 examples/django/oauth_app/models.py rename examples/django/{slackapp/models.py => oauth_app/slack_datastores.py} (51%) create mode 100644 examples/django/oauth_app/slack_listeners.py create mode 100644 examples/django/oauth_app/urls.py create mode 100644 examples/django/simple_app/__init__.py create mode 100644 examples/django/simple_app/apps.py create mode 100644 examples/django/simple_app/migrations/__init__.py create mode 100644 examples/django/simple_app/models.py create mode 100644 examples/django/simple_app/slack_listeners.py rename examples/django/{slackapp/views.py => simple_app/urls.py} (54%) delete mode 100644 examples/django/slackapp/apps.py delete mode 100644 examples/django/slackapp/urls.py diff --git a/examples/django/README.md b/examples/django/README.md index 0b1ac6742..a28039d57 100644 --- a/examples/django/README.md +++ b/examples/django/README.md @@ -1,12 +1,85 @@ -Follow the instructions [here](https://slack.dev/bolt-python/concepts#authenticating-oauth) for configuring OAuth flow supported Slack apps. This example works with the default env variables such as `SLACK_CLIENT_ID`, `SLACK_CLIENT_SECRET`, `SLACK_SCOPES`, `SLACK_SIGNING_SECRET`, and so forth. +## Bolt for Python - Django integration example +This example demonstrates how you can use Bolt for Python in your Django application. The project consists of two apps. + +### `simple_app` - Single-workspace App Example + +If you want to run a simple app like the one you've tried in the [Getting Started Guide](https://slack.dev/bolt-python/tutorial/getting-started), this is the right one for you. By default, this Django project runs this application. If you want to switch to OAuth flow supported one, modify `myslackapp/urls.py`. + +To run this app, all you need to do are: + +* Create a new Slack app configuration at https://api.slack.com/apps?new_app=1 +* Go to "OAuth & Permissions" + * Add `app_mentions:read`, `chat:write` in Scopes > Bot Token Scopes +* Go to "Install App" + * Click "Install to Workspace" + * Complete the installation flow + * Copy the "Bot User OAuth Token" value, which starts with `xoxb-` + +You can start your Django application this way: + +```bash +python -m venv .venv +source .venv/bin/activate +pip install -U pip +pip install -r requirements.txt + +export SLACK_SIGNING_SECRET=(You can find this value at Settings > Basic Information > App Credentials > Signing Secret) +export SLACK_BOT_TOKEN=(You can find this value at Settings > Install App > Bot User OAuth Token) + +python manage.py migrate +python manage.py runserver 0.0.0.0:3000 ``` + +As you did at [Getting Started Guide](https://slack.dev/bolt-python/tutorial/getting-started), configure ngrok or something similar to serve a public endpoint. Lastly, + +* Go back to the Slack app configuration page +* Go to "Event Subscriptions" + * Turn the feature on + * Set the "Request URL" to `https://{your public domain}/slack/events` +* Go to the Slack workspace you've installed this app +* Invite the app's bot user to a channel +* Mention the bot user in the channel +* You'll see a reply from your app's bot user! + +### `oauth_app` - Multiple-workspace App Example (OAuth flow supported) + +By default, this Django project runs this application. If you want to switch to OAuth flow supported one, modify `myslackapp/urls.py`. + +This example uses SQLite. If you are looking for an example using MySQL, check the `mysql-docker-compose.yml` and the comment in `myslackapp/settings.py`. + + +To run this app, all you need to do are: + +* Create a new Slack app configuration at https://api.slack.com/apps?new_app=1 +* Go to "OAuth & Permissions" + * Add `app_mentions:read`, `chat:write` in Scopes > Bot Token Scopes +* Follow the instructions [here](https://slack.dev/bolt-python/concepts#authenticating-oauth) for configuring OAuth flow supported Slack apps + +You can start your Django application this way: + +```bash +python -m venv .venv +source .venv/bin/activate +pip install -U pip pip install -r requirements.txt -export SLACK_CLIENT_ID= -export SLACK_CLIENT_SECRET= -export SLACK_SCOPES=commands,chat:write -export SLACK_SIGNING_SECRET= + +export SLACK_SIGNING_SECRET=(You can find this value at Settings > Basic Information > App Credentials > Signing Secret) +export SLACK_CLIENT_ID=(You can find this value at Settings > Basic Information > App Credentials > Client ID) +export SLACK_CLIENT_SECRET=(You can find this value at Settings > Basic Information > App Credentials > Client Secret) +export SLACK_SCOPES=app_mentions:read,chat:write python manage.py migrate python manage.py runserver 0.0.0.0:3000 ``` + +As you did at [Getting Started Guide](https://slack.dev/bolt-python/tutorial/getting-started), configure ngrok or something similar to serve a public endpoint. Lastly, + +* Go back to the Slack app configuration page +* Go to "Event Subscriptions" + * Turn the feature on + * Set the "Request URL" to `https://{your public domain}/slack/events` +* Visit `https://{your public domain}/slack/install` and complete the installation flow +* Invite the app's bot user to a channel +* Mention the bot user in the channel +* You'll see a reply from your app's bot user! diff --git a/examples/django/manage.py b/examples/django/manage.py index eb1a2c09c..cec2fe4e4 100755 --- a/examples/django/manage.py +++ b/examples/django/manage.py @@ -5,7 +5,8 @@ def main(): - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "slackapp.settings") + """Run administrative tasks.""" + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myslackapp.settings") try: from django.core.management import execute_from_command_line except ImportError as exc: diff --git a/examples/django/slackapp/__init__.py b/examples/django/myslackapp/__init__.py similarity index 100% rename from examples/django/slackapp/__init__.py rename to examples/django/myslackapp/__init__.py diff --git a/examples/django/myslackapp/asgi.py b/examples/django/myslackapp/asgi.py new file mode 100644 index 000000000..814c38df4 --- /dev/null +++ b/examples/django/myslackapp/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for myslackapp project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myslackapp.settings") + +application = get_asgi_application() diff --git a/examples/django/slackapp/settings.py b/examples/django/myslackapp/settings.py similarity index 60% rename from examples/django/slackapp/settings.py rename to examples/django/myslackapp/settings.py index 56bdc50e9..a99c91188 100644 --- a/examples/django/slackapp/settings.py +++ b/examples/django/myslackapp/settings.py @@ -1,64 +1,35 @@ """ -Django settings for slackapp project. +Django settings for myslackapp project. -Generated by 'django-admin startproject' using Django 3.0.8. +Generated by 'django-admin startproject' using Django 3.2.3. For more information on this file, see -https://docs.djangoproject.com/en/3.0/topics/settings/ +https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see -https://docs.djangoproject.com/en/3.0/ref/settings/ +https://docs.djangoproject.com/en/3.2/ref/settings/ """ - import os +from pathlib import Path -LOGGING = { - "version": 1, - "disable_existing_loggers": False, - "handlers": { - "console": { - "class": "logging.StreamHandler", - }, - }, - "root": { - "handlers": ["console"], - "level": "DEBUG", - }, - "loggers": { - "django": { - "handlers": ["console"], - "level": os.getenv("DJANGO_LOG_LEVEL", "INFO"), - "propagate": False, - }, - "django.db": { - "level": "DEBUG", - }, - "slack_bolt": { - "handlers": ["console"], - "level": "DEBUG", - "propagate": False, - }, - }, -} +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ +# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ -# SECURITY WARNING: keep the secret key used in production secret! # TODO: CHANGE THIS IF YOU REUSE THIS APP -SECRET_KEY = ( - "This is just a example. You should not expose your secret key in real apps" -) +SECRET_KEY = "This is just a example. You should not expose your secret key in real apps" # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True + # ALLOWED_HOSTS = [] ALLOWED_HOSTS = ["*"] + # Application definition INSTALLED_APPS = [ @@ -68,7 +39,8 @@ "django.contrib.sessions", "django.contrib.messages", "django.contrib.staticfiles", - "slackapp.apps.SlackAppConfig", + "simple_app.apps.SimpleAppConfig", + "oauth_app.apps.OauthAppConfig", ] MIDDLEWARE = [ @@ -81,7 +53,7 @@ "django.middleware.clickjacking.XFrameOptionsMiddleware", ] -ROOT_URLCONF = "slackapp.urls" +ROOT_URLCONF = "myslackapp.urls" TEMPLATES = [ { @@ -99,35 +71,44 @@ }, ] -WSGI_APPLICATION = "slackapp.wsgi.application" +WSGI_APPLICATION = "myslackapp.wsgi.application" + # Database -# https://docs.djangoproject.com/en/3.0/ref/settings/#databases +# https://docs.djangoproject.com/en/3.2/ref/settings/#databases DATABASES = { - # python manage.py migrate - # python manage.py runserver 0.0.0.0:3000 + # You can initialize your local database by the following steps: + # + # python manage.py migrate + # python manage.py runserver 0.0.0.0:3000 + # + "default": { + "ENGINE": "django.db.backends.sqlite3", + "NAME": BASE_DIR / "db.sqlite3", + } + # If you want to use MySQL quickly, the following steps work for you + # + # docker-compose -f mysql-docker-compose.yml up --build + # pip install mysqlclient + # python manage.py migrate + # python manage.py runserver 0.0.0.0:3000 + # + # And then, enable the following setting instead: + # # "default": { - # "ENGINE": "django.db.backends.sqlite3", - # "NAME": os.path.join(BASE_DIR, "db.sqlite3"), + # "ENGINE": "django.db.backends.mysql", + # "NAME": "slackapp", + # "USER": "app", + # "PASSWORD": "password", + # "HOST": "127.0.0.1", + # "PORT": 33306, # }, - - # docker-compose -f mysql-docker-compose.yml up --build - # pip install mysqlclient - # python manage.py migrate - # python manage.py runserver 0.0.0.0:3000 - "default": { - "ENGINE": "django.db.backends.mysql", - "NAME": "slackapp", - "USER": "app", - "PASSWORD": "password", - "HOST": "127.0.0.1", - "PORT": 33306, - }, } + # Password validation -# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators +# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { @@ -144,8 +125,9 @@ }, ] + # Internationalization -# https://docs.djangoproject.com/en/3.0/topics/i18n/ +# https://docs.djangoproject.com/en/3.2/topics/i18n/ LANGUAGE_CODE = "en-us" @@ -157,7 +139,43 @@ USE_TZ = True + # Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/3.0/howto/static-files/ +# https://docs.djangoproject.com/en/3.2/howto/static-files/ STATIC_URL = "/static/" + +# Default primary key field type +# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" + + +LOGGING = { + "version": 1, + "disable_existing_loggers": False, + "handlers": { + "console": { + "class": "logging.StreamHandler", + }, + }, + "root": { + "handlers": ["console"], + "level": "DEBUG", + }, + "loggers": { + "django": { + "handlers": ["console"], + "level": os.getenv("DJANGO_LOG_LEVEL", "INFO"), + "propagate": False, + }, + "django.db": { + "level": "DEBUG", + }, + "slack_bolt": { + "handlers": ["console"], + "level": "DEBUG", + "propagate": False, + }, + }, +} diff --git a/examples/django/myslackapp/urls.py b/examples/django/myslackapp/urls.py new file mode 100644 index 000000000..45e6cab60 --- /dev/null +++ b/examples/django/myslackapp/urls.py @@ -0,0 +1,42 @@ +"""myslackapp URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/3.2/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path + +is_simple_app = True + +if is_simple_app: + # A simple app that works only for a single Slack workspace + # (prerequisites) + # export SLACK_BOT_TOKEN= + # export SLACK_SIGNING_SECRET= + from simple_app.urls import slack_events_handler + + urlpatterns = [path("slack/events", slack_events_handler)] +else: + # OAuth flow supported app + # (prerequisites) + # export SLACK_CLIENT_ID= + # export SLACK_CLIENT_SECRET= + # export SLACK_SIGNING_SECRET= + # export SLACK_SCOPES=app_mentions:read + from oauth_app.urls import slack_events_handler, slack_oauth_handler + + urlpatterns = [ + path("slack/events", slack_events_handler, name="handle"), + path("slack/install", slack_oauth_handler, name="install"), + path("slack/oauth_redirect", slack_oauth_handler, name="oauth_redirect"), + ] diff --git a/examples/django/slackapp/wsgi.py b/examples/django/myslackapp/wsgi.py similarity index 57% rename from examples/django/slackapp/wsgi.py rename to examples/django/myslackapp/wsgi.py index efefedc30..4443e81cb 100644 --- a/examples/django/slackapp/wsgi.py +++ b/examples/django/myslackapp/wsgi.py @@ -1,16 +1,16 @@ """ -WSGI config for slackapp project. +WSGI config for myslackapp project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see -https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ +https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "slackapp.settings") +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myslackapp.settings") application = get_wsgi_application() diff --git a/examples/django/slackapp/migrations/__init__.py b/examples/django/oauth_app/__init__.py similarity index 100% rename from examples/django/slackapp/migrations/__init__.py rename to examples/django/oauth_app/__init__.py diff --git a/examples/django/oauth_app/apps.py b/examples/django/oauth_app/apps.py new file mode 100644 index 000000000..34a1577d4 --- /dev/null +++ b/examples/django/oauth_app/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class OauthAppConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" + name = "oauth_app" diff --git a/examples/django/slackapp/migrations/0001_initial.py b/examples/django/oauth_app/migrations/0001_initial.py similarity index 93% rename from examples/django/slackapp/migrations/0001_initial.py rename to examples/django/oauth_app/migrations/0001_initial.py index ebc013537..d5e3113c6 100644 --- a/examples/django/slackapp/migrations/0001_initial.py +++ b/examples/django/oauth_app/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 3.1.7 on 2021-04-02 05:53 +# Generated by Django 3.2.3 on 2021-05-24 05:50 from django.db import migrations, models @@ -15,7 +15,7 @@ class Migration(migrations.Migration): fields=[ ( "id", - models.AutoField( + models.BigAutoField( auto_created=True, primary_key=True, serialize=False, @@ -41,7 +41,7 @@ class Migration(migrations.Migration): fields=[ ( "id", - models.AutoField( + models.BigAutoField( auto_created=True, primary_key=True, serialize=False, @@ -76,7 +76,7 @@ class Migration(migrations.Migration): fields=[ ( "id", - models.AutoField( + models.BigAutoField( auto_created=True, primary_key=True, serialize=False, @@ -97,14 +97,14 @@ class Migration(migrations.Migration): "user_id", "installed_at", ], - name="slackapp_sl_client__9b0d3f_idx", + name="oauth_app_s_client__f32bc0_idx", ), ), migrations.AddIndex( model_name="slackbot", index=models.Index( fields=["client_id", "enterprise_id", "team_id", "installed_at"], - name="slackapp_sl_client__d220d6_idx", + name="oauth_app_s_client__fe2514_idx", ), ), ] diff --git a/examples/django/oauth_app/migrations/__init__.py b/examples/django/oauth_app/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/examples/django/oauth_app/models.py b/examples/django/oauth_app/models.py new file mode 100644 index 000000000..72fa342f5 --- /dev/null +++ b/examples/django/oauth_app/models.py @@ -0,0 +1,69 @@ +# ---------------------- +# Database tables +# ---------------------- + +from django.db import models + + +class SlackBot(models.Model): + client_id = models.CharField(null=False, max_length=32) + app_id = models.CharField(null=False, max_length=32) + enterprise_id = models.CharField(null=True, max_length=32) + enterprise_name = models.TextField(null=True) + team_id = models.CharField(null=True, max_length=32) + team_name = models.TextField(null=True) + bot_token = models.TextField(null=True) + bot_id = models.CharField(null=True, max_length=32) + bot_user_id = models.CharField(null=True, max_length=32) + bot_scopes = models.TextField(null=True) + is_enterprise_install = models.BooleanField(null=True) + installed_at = models.DateTimeField(null=False) + + class Meta: + indexes = [ + models.Index( + fields=["client_id", "enterprise_id", "team_id", "installed_at"] + ), + ] + + +class SlackInstallation(models.Model): + client_id = models.CharField(null=False, max_length=32) + app_id = models.CharField(null=False, max_length=32) + enterprise_id = models.CharField(null=True, max_length=32) + enterprise_name = models.TextField(null=True) + enterprise_url = models.TextField(null=True) + team_id = models.CharField(null=True, max_length=32) + team_name = models.TextField(null=True) + bot_token = models.TextField(null=True) + bot_id = models.CharField(null=True, max_length=32) + bot_user_id = models.TextField(null=True) + bot_scopes = models.TextField(null=True) + user_id = models.CharField(null=False, max_length=32) + user_token = models.TextField(null=True) + user_scopes = models.TextField(null=True) + incoming_webhook_url = models.TextField(null=True) + incoming_webhook_channel = models.TextField(null=True) + incoming_webhook_channel_id = models.TextField(null=True) + incoming_webhook_configuration_url = models.TextField(null=True) + is_enterprise_install = models.BooleanField(null=True) + token_type = models.CharField(null=True, max_length=32) + installed_at = models.DateTimeField(null=False) + + class Meta: + indexes = [ + models.Index( + fields=[ + "client_id", + "enterprise_id", + "team_id", + "user_id", + "installed_at", + ] + ), + ] + + +class SlackOAuthState(models.Model): + state = models.CharField(null=False, max_length=64) + expire_at = models.DateTimeField(null=False) diff --git a/examples/django/slackapp/models.py b/examples/django/oauth_app/slack_datastores.py similarity index 51% rename from examples/django/slackapp/models.py rename to examples/django/oauth_app/slack_datastores.py index 0db1e9b6d..5c1c3dfe9 100644 --- a/examples/django/slackapp/models.py +++ b/examples/django/oauth_app/slack_datastores.py @@ -1,79 +1,7 @@ -# ---------------------- -# Database tables -# ---------------------- - -from django.db import models - - -class SlackBot(models.Model): - client_id = models.CharField(null=False, max_length=32) - app_id = models.CharField(null=False, max_length=32) - enterprise_id = models.CharField(null=True, max_length=32) - enterprise_name = models.TextField(null=True) - team_id = models.CharField(null=True, max_length=32) - team_name = models.TextField(null=True) - bot_token = models.TextField(null=True) - bot_id = models.CharField(null=True, max_length=32) - bot_user_id = models.CharField(null=True, max_length=32) - bot_scopes = models.TextField(null=True) - is_enterprise_install = models.BooleanField(null=True) - installed_at = models.DateTimeField(null=False) - - class Meta: - indexes = [ - models.Index( - fields=["client_id", "enterprise_id", "team_id", "installed_at"] - ), - ] - - -class SlackInstallation(models.Model): - client_id = models.CharField(null=False, max_length=32) - app_id = models.CharField(null=False, max_length=32) - enterprise_id = models.CharField(null=True, max_length=32) - enterprise_name = models.TextField(null=True) - enterprise_url = models.TextField(null=True) - team_id = models.CharField(null=True, max_length=32) - team_name = models.TextField(null=True) - bot_token = models.TextField(null=True) - bot_id = models.CharField(null=True, max_length=32) - bot_user_id = models.TextField(null=True) - bot_scopes = models.TextField(null=True) - user_id = models.CharField(null=False, max_length=32) - user_token = models.TextField(null=True) - user_scopes = models.TextField(null=True) - incoming_webhook_url = models.TextField(null=True) - incoming_webhook_channel = models.TextField(null=True) - incoming_webhook_channel_id = models.TextField(null=True) - incoming_webhook_configuration_url = models.TextField(null=True) - is_enterprise_install = models.BooleanField(null=True) - token_type = models.CharField(null=True, max_length=32) - installed_at = models.DateTimeField(null=False) - - class Meta: - indexes = [ - models.Index( - fields=[ - "client_id", - "enterprise_id", - "team_id", - "user_id", - "installed_at", - ] - ), - ] - - -class SlackOAuthState(models.Model): - state = models.CharField(null=False, max_length=64) - expire_at = models.DateTimeField(null=False) - - # ---------------------- # Bolt store implementations # ---------------------- - from logging import Logger from typing import Optional from uuid import uuid4 @@ -82,7 +10,8 @@ class SlackOAuthState(models.Model): from django.utils.timezone import is_naive, make_aware from slack_sdk.oauth import InstallationStore, OAuthStateStore from slack_sdk.oauth.installation_store import Bot, Installation -from slack_sdk.webhook import WebhookClient + +from .models import SlackBot, SlackInstallation, SlackOAuthState class DjangoInstallationStore(InstallationStore): @@ -220,71 +149,3 @@ def consume(self, state: str) -> bool: row.delete() return True return False - - -# ---------------------- -# Slack App -# ---------------------- - -import logging -import os -from slack_bolt import App, BoltContext -from slack_bolt.oauth.oauth_settings import OAuthSettings - -logger = logging.getLogger(__name__) -client_id, client_secret, signing_secret, scopes = ( - os.environ["SLACK_CLIENT_ID"], - os.environ["SLACK_CLIENT_SECRET"], - os.environ["SLACK_SIGNING_SECRET"], - os.environ.get("SLACK_SCOPES", "commands").split(","), -) - -app = App( - signing_secret=signing_secret, - installation_store=DjangoInstallationStore( - client_id=client_id, - logger=logger, - ), - oauth_settings=OAuthSettings( - client_id=client_id, - client_secret=client_secret, - scopes=scopes, - state_store=DjangoOAuthStateStore( - expiration_seconds=120, - logger=logger, - ), - ), -) - - -def event_test(body, say, context: BoltContext, logger): - logger.info(body) - say(":wave: What's up?") - - found_rows = list( - SlackInstallation.objects.filter(enterprise_id=context.enterprise_id) - .filter(team_id=context.team_id) - .filter(incoming_webhook_url__isnull=False) - .order_by(F("installed_at").desc())[:1] - ) - if len(found_rows) > 0: - webhook_url = found_rows[0].incoming_webhook_url - logger.info(f"webhook_url: {webhook_url}") - client = WebhookClient(webhook_url) - client.send(text=":wave: This is a message posted using Incoming Webhook!") - - -# lazy listener example -def noop(): - pass - - -app.event("app_mention")( - ack=event_test, - lazy=[noop], -) - - -@app.command("/hello-django-app") -def command(ack): - ack(":wave: Hello from a Django app :smile:") diff --git a/examples/django/oauth_app/slack_listeners.py b/examples/django/oauth_app/slack_listeners.py new file mode 100644 index 000000000..86a05fdb2 --- /dev/null +++ b/examples/django/oauth_app/slack_listeners.py @@ -0,0 +1,71 @@ +import logging +import os + +from slack_bolt import App, BoltContext +from slack_bolt.oauth.oauth_settings import OAuthSettings +from slack_sdk.webhook import WebhookClient + +# Database models +from .models import SlackInstallation +from django.db.models import F + +# Bolt datastore implementations +from .slack_datastores import DjangoInstallationStore, DjangoOAuthStateStore + +logger = logging.getLogger(__name__) +client_id, client_secret, signing_secret, scopes = ( + os.environ["SLACK_CLIENT_ID"], + os.environ["SLACK_CLIENT_SECRET"], + os.environ["SLACK_SIGNING_SECRET"], + os.environ.get("SLACK_SCOPES", "commands").split(","), +) + +app = App( + signing_secret=signing_secret, + installation_store=DjangoInstallationStore( + client_id=client_id, + logger=logger, + ), + oauth_settings=OAuthSettings( + client_id=client_id, + client_secret=client_secret, + scopes=scopes, + state_store=DjangoOAuthStateStore( + expiration_seconds=120, + logger=logger, + ), + ), +) + + +def event_test(body, say, context: BoltContext, logger): + logger.info(body) + say(":wave: What's up?") + + found_rows = list( + SlackInstallation.objects.filter(enterprise_id=context.enterprise_id) + .filter(team_id=context.team_id) + .filter(incoming_webhook_url__isnull=False) + .order_by(F("installed_at").desc())[:1] + ) + if len(found_rows) > 0: + webhook_url = found_rows[0].incoming_webhook_url + logger.info(f"webhook_url: {webhook_url}") + client = WebhookClient(webhook_url) + client.send(text=":wave: This is a message posted using Incoming Webhook!") + + +# lazy listener example +def noop(): + pass + + +app.event("app_mention")( + ack=event_test, + lazy=[noop], +) + + +@app.command("/hello-django-app") +def command(ack): + ack(":wave: Hello from a Django app :smile:") diff --git a/examples/django/oauth_app/urls.py b/examples/django/oauth_app/urls.py new file mode 100644 index 000000000..7802c7e54 --- /dev/null +++ b/examples/django/oauth_app/urls.py @@ -0,0 +1,25 @@ +from django.urls import path + +from django.http import HttpRequest +from django.views.decorators.csrf import csrf_exempt + +from slack_bolt.adapter.django import SlackRequestHandler +from .slack_listeners import app + +handler = SlackRequestHandler(app=app) + + +@csrf_exempt +def slack_events_handler(request: HttpRequest): + return handler.handle(request) + + +def slack_oauth_handler(request: HttpRequest): + return handler.handle(request) + + +urlpatterns = [ + path("slack/events", slack_events_handler, name="handle"), + path("slack/install", slack_oauth_handler, name="install"), + path("slack/oauth_redirect", slack_oauth_handler, name="oauth_redirect"), +] diff --git a/examples/django/requirements.txt b/examples/django/requirements.txt index ec9338fd2..bee4f4a98 100644 --- a/examples/django/requirements.txt +++ b/examples/django/requirements.txt @@ -1 +1,2 @@ -Django>=3,<4 \ No newline at end of file +Django>=3.2,<4 +slack-bolt>=1.6,<2 diff --git a/examples/django/simple_app/__init__.py b/examples/django/simple_app/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/examples/django/simple_app/apps.py b/examples/django/simple_app/apps.py new file mode 100644 index 000000000..d80d269e9 --- /dev/null +++ b/examples/django/simple_app/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class SimpleAppConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" + name = "simple_app" diff --git a/examples/django/simple_app/migrations/__init__.py b/examples/django/simple_app/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/examples/django/simple_app/models.py b/examples/django/simple_app/models.py new file mode 100644 index 000000000..71a836239 --- /dev/null +++ b/examples/django/simple_app/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/examples/django/simple_app/slack_listeners.py b/examples/django/simple_app/slack_listeners.py new file mode 100644 index 000000000..c066ead1c --- /dev/null +++ b/examples/django/simple_app/slack_listeners.py @@ -0,0 +1,19 @@ +import logging +import os + +from slack_bolt import App + +logger = logging.getLogger(__name__) + +app = App( + token=os.environ["SLACK_BOT_TOKEN"], + signing_secret=os.environ["SLACK_SIGNING_SECRET"], + # disable eagerly verifying the given SLACK_BOT_TOKEN value + token_verification_enabled=False, +) + + +@app.event("app_mention") +def handle_app_mentions(logger, event, say): + logger.info(event) + say(f"Hi there, <@{event['user']}>") diff --git a/examples/django/slackapp/views.py b/examples/django/simple_app/urls.py similarity index 54% rename from examples/django/slackapp/views.py rename to examples/django/simple_app/urls.py index 5ff1c8a29..dfdd1291e 100644 --- a/examples/django/slackapp/views.py +++ b/examples/django/simple_app/urls.py @@ -1,16 +1,19 @@ -from django.http import HttpRequest -from django.views.decorators.csrf import csrf_exempt +from django.urls import path from slack_bolt.adapter.django import SlackRequestHandler -from .models import app +from .slack_listeners import app handler = SlackRequestHandler(app=app) +from django.http import HttpRequest +from django.views.decorators.csrf import csrf_exempt + @csrf_exempt -def events(request: HttpRequest): +def slack_events_handler(request: HttpRequest): return handler.handle(request) -def oauth(request: HttpRequest): - return handler.handle(request) +urlpatterns = [ + path("slack/events", slack_events_handler, name="slack_events"), +] diff --git a/examples/django/slackapp/apps.py b/examples/django/slackapp/apps.py deleted file mode 100644 index aa8cafd43..000000000 --- a/examples/django/slackapp/apps.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.apps import AppConfig - - -class SlackAppConfig(AppConfig): - name = "slackapp" diff --git a/examples/django/slackapp/urls.py b/examples/django/slackapp/urls.py deleted file mode 100644 index f875bc822..000000000 --- a/examples/django/slackapp/urls.py +++ /dev/null @@ -1,9 +0,0 @@ -from django.urls import path - -from . import views - -urlpatterns = [ - path("slack/events", views.events, name="handle"), - path("slack/install", views.oauth, name="install"), - path("slack/oauth_redirect", views.oauth, name="oauth_redirect"), -] From a289c73de9e318e7e9861faa78f7e5a220d00a29 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 27 May 2021 13:33:05 +0900 Subject: [PATCH 187/719] Fix a minor error in document --- docs/_advanced/context.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_advanced/context.md b/docs/_advanced/context.md index cc29d239c..beacfbcf7 100644 --- a/docs/_advanced/context.md +++ b/docs/_advanced/context.md @@ -12,7 +12,7 @@ All listeners have access to a `context` dictionary, which can be used to enrich ```python -# Listener middleware to fetch tasks from external system using userId +# Listener middleware to fetch tasks from external system using user ID def fetch_tasks(context, event, next): user = event["user"] try: @@ -68,4 +68,4 @@ def show_tasks(event, client, context): "blocks": context["blocks"] } ) -``` \ No newline at end of file +``` From f84bc94266b0327ca96956ab6ef58e99da1abae1 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 27 May 2021 13:46:00 +0900 Subject: [PATCH 188/719] Fix an error in document --- docs/_advanced/custom_adapters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_advanced/custom_adapters.md b/docs/_advanced/custom_adapters.md index f06af77c1..f89a1ee46 100644 --- a/docs/_advanced/custom_adapters.md +++ b/docs/_advanced/custom_adapters.md @@ -20,7 +20,7 @@ order: 1 | `headers: Dict[str, Union[str, List[str]]]` | Request headers | No | | `context: BoltContext` | Any context for the request | No | -`BoltRequest` will return [an instance of `BoltResponse`](https://github.com/slackapi/bolt-python/blob/main/slack_bolt/response/response.py) from the Bolt app. +Your adapter will return [an instance of `BoltResponse`](https://github.com/slackapi/bolt-python/blob/main/slack_bolt/response/response.py) from the Bolt app. For more in-depth examples of custom adapters, look at the implementations of the [built-in adapters](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter). From 24e64c9a7def6d19abc0cf241beab200ce3bd6b0 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 28 May 2021 14:24:16 +0900 Subject: [PATCH 189/719] Add Japanese translation of Advanced concepts pages (#354) --- docs/_advanced/errors.md | 2 +- docs/_advanced/ja_adapters.md | 45 +++++++++ docs/_advanced/ja_async.md | 81 +++++++++++++++++ docs/_advanced/ja_authorization.md | 72 +++++++++++++++ docs/_advanced/ja_context.md | 72 +++++++++++++++ docs/_advanced/ja_custom_adapters.md | 72 +++++++++++++++ docs/_advanced/ja_errors.md | 19 ++++ docs/_advanced/ja_global_middleware.md | 34 +++++++ docs/_advanced/ja_lazy_listener.md | 111 +++++++++++++++++++++++ docs/_advanced/ja_listener_middleware.md | 24 +++++ docs/_advanced/ja_logging.md | 28 ++++++ docs/_advanced/logging.md | 2 +- docs/_config.yml | 2 +- 13 files changed, 561 insertions(+), 3 deletions(-) create mode 100644 docs/_advanced/ja_adapters.md create mode 100644 docs/_advanced/ja_async.md create mode 100644 docs/_advanced/ja_authorization.md create mode 100644 docs/_advanced/ja_context.md create mode 100644 docs/_advanced/ja_custom_adapters.md create mode 100644 docs/_advanced/ja_errors.md create mode 100644 docs/_advanced/ja_global_middleware.md create mode 100644 docs/_advanced/ja_lazy_listener.md create mode 100644 docs/_advanced/ja_listener_middleware.md create mode 100644 docs/_advanced/ja_logging.md diff --git a/docs/_advanced/errors.md b/docs/_advanced/errors.md index 7899485ce..d045331db 100644 --- a/docs/_advanced/errors.md +++ b/docs/_advanced/errors.md @@ -6,7 +6,7 @@ order: 3 ---
    -If an error occurs in a listener, you can handle it directly using a `try`/`except` block. Errors associated with your app will be of type `BoltError`. Errors associated with calling Slack APIs will be of type `SlackApiError`. +If an error occurs in a listener, you can handle it directly using a try/except block. Errors associated with your app will be of type `BoltError`. Errors associated with calling Slack APIs will be of type `SlackApiError`. By default, the global error handler will log all non-handled exceptions to the console. To handle global errors yourself, you can attach a global error handler to your app using the `app.error(fn)` function.
    diff --git a/docs/_advanced/ja_adapters.md b/docs/_advanced/ja_adapters.md new file mode 100644 index 000000000..025ff6116 --- /dev/null +++ b/docs/_advanced/ja_adapters.md @@ -0,0 +1,45 @@ +--- +title: アダプター +lang: ja-jp +slug: adapters +order: 0 +--- + +
    +アダプターは Slack から届く受信イベントの受付とパーズを担当し、それらのイベントを `BoltRequest` の形式に変換して Bolt アプリに引き渡します。 + +デフォルトでは、Bolt の組み込みの `HTTPServer` アダプターが使われます。このアダプターは、ローカルで開発するのには問題がありませんが、本番環境での利用は推奨されていません。Bolt for Python には複数の組み込みのアダプターが用意されており、必要に応じてインポートしてアプリで使用することができます。組み込みのアダプターは Flask、Django、Starlette をはじめとする様々な人気の Python フレームワークをサポートしています。これらのアダプターは、あなたが選択した本番環境で利用可能な Webサーバーとともに利用することができます。 + +アダプターを使用するには、任意のフレームワークを使ってアプリを開発し、そのコードに対応するアダプターをインポートします。その後、アダプターのインスタンスを初期化して、受信イベントの受付とパーズを行う関数を呼び出します。 + +すべてのアダプターの一覧と、設定や使い方のサンプルは、リポジトリの `examples` フォルダをご覧ください。 +
    + +```python +from slack_bolt import App +app = App( + signing_secret=os.environ.get("SIGNING_SECRET"), + token=os.environ.get("SLACK_BOT_TOKEN") +) + +# ここには Flask 固有の記述はありません +# App はフレームワークやランタイムに一切依存しません +@app.command("/hello-bolt") +def hello(body, ack): + ack(f"Hi <@{body['user_id']}>!") + +# Flask アプリを初期化します +from flask import Flask, request +flask_app = Flask(__name__) + +# SlackRequestHandler は WSGI のリクエストを Bolt のインターフェイスに合った形に変換します +# Bolt レスポンスからの WSGI レスポンスの作成も行います +from slack_bolt.adapter.flask import SlackRequestHandler +handler = SlackRequestHandler(app) + +# Flask アプリへのルートを登録します +@flask_app.route("/slack/events", methods=["POST"]) +def slack_events(): + # handler はアプリのディスパッチメソッドを実行します + return handler.handle(request) +``` diff --git a/docs/_advanced/ja_async.md b/docs/_advanced/ja_async.md new file mode 100644 index 000000000..aac6a1568 --- /dev/null +++ b/docs/_advanced/ja_async.md @@ -0,0 +1,81 @@ +--- +title: Async(asyncio)の使用 +lang: ja-jp +slug: async +order: 2 +--- + +
    +非同期バージョンの Bolt を使用する場合は、`App` の代わりに `AsyncApp` インスタンスをインポートして初期化します。`AsyncApp` では AIOHTTP を使って API リクエストを行うため、`aiohttp` をインストールする必要があります(`requirements.txt` に追記するか、`pip install aiohttp` を実行します)。 + +非同期バージョンのプロジェクトのサンプルは、リポジトリの `examples` フォルダにあります。 +
    + +```python +# aiohttp のインストールが必要です +from slack_bolt.async_app import AsyncApp +app = AsyncApp() + +@app.event("app_mention") +async def handle_mentions(event, client, say): # 非同期関数 + api_response = await client.reactions_add( + channel=event["channel"], + timestamp=event["ts"], + name="eyes", + ) + await say("What's up?") + +if __name__ == "__main__": + app.start(3000) +``` + +
    + +

    他のフレームワークを使用する

    +
    + +
    + +`AsyncApp#start()` では内部的に [`AIOHTTP`](https://docs.aiohttp.org/) のWebサーバーが実装されています。必要に応じて、受信リクエストの処理に `AIOHTTP` 以外のフレームワークを使用することができます。 + +この例では [Sanic](https://sanicframework.org/) を使用しています。すべてのアダプターのリストについては、[`adapter` フォルダ](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter) を参照してください。 + +以下のコマンドを実行すると、必要なパッケージをインストールして、Sanic サーバーをポート 3000 で起動します。 + +```bash +# 必要なパッケージをインストールします +pip install slack_bolt sanic uvicorn +# ソースファイルを async_app.py として保存します +uvicorn async_app:api --reload --port 3000 --log-level debug +``` +
    + +```python +from slack_bolt.async_app import AsyncApp +app = AsyncApp() + +# ここには Sanic に固有の記述はありません +# AsyncApp はフレームワークやランタイムに依存しません +@app.event("app_mention") +async def handle_app_mentions(say): + await say("What's up?") + +import os +from sanic import Sanic +from sanic.request import Request +from slack_bolt.adapter.sanic import AsyncSlackRequestHandler + +# App のインスタンスから Sanic 用のアダプターを作成します +app_handler = AsyncSlackRequestHandler(app) +# Sanic アプリを作成します +api = Sanic(name="awesome-slack-app") + +@api.post("/slack/events") +async def endpoint(req: Request): + # app_handler では内部的にアプリのディスパッチメソッドが実行されます + return await app_handler.handle(req) + +if __name__ == "__main__": + api.run(host="0.0.0.0", port=int(os.environ.get("PORT", 3000))) +``` +
    diff --git a/docs/_advanced/ja_authorization.md b/docs/_advanced/ja_authorization.md new file mode 100644 index 000000000..c329f87c5 --- /dev/null +++ b/docs/_advanced/ja_authorization.md @@ -0,0 +1,72 @@ +--- +title: 認可(Authorization) +lang: ja-jp +slug: authorization +order: 5 +--- + +
    +認可(Authorization)は、Slack からの受信イベントを処理するにあたって、どのようなSlack +クレデンシャル (ボットトークンなど) を使用可能にするかを決定するプロセスです。 + +単一のワークスペースにインストールされるアプリでは、`token` パラメーターを使って `App` のコンストラクターにボットトークンを渡すという、シンプルな方法が使えます。それに対して、複数のワークスペースにインストールされるアプリでは、次の 2 つの方法のいずれかを使用する必要があります。簡単なのは、組み込みの OAuth サポートを使用する方法です。OAuth サポートは、OAuth フロー用のURLのセットアップとstateの検証を行います。詳細は「[OAuth を使った認証](#authenticating-oauth)」セクションを参照してください。 + +よりカスタマイズできる方法として、`App` をインスタンス化する関数に`authorize` パラメーターを指定する方法があります。`authorize` 関数から返される [`AuthorizeResult` のインスタンス](https://github.com/slackapi/bolt-python/blob/main/slack_bolt/authorization/authorize_result.py)には、どのユーザーがどこで発生させたイベントかを示す情報が含まれます。 + +`AuthorizeResult` には、いくつか特定のプロパティを指定する必要があり、いずれも `str` 型です。 + + +- **`bot_token`**(xoxb)*または* **`user_token`**(xoxp): どちらか一方が**必須**です。ほとんどのアプリでは、デフォルトの `bot_token` を使用すればよいでしょう。トークンを渡すことで、`say()` などの組み込みの関数を機能させることができます。 +- **`bot_user_id`** および **`bot_id`** : `bot_token` を使用する場合に指定します。 +- **`enterprise_id`** および **`team_id`** : アプリに届いたイベントから見つけることができます。 +- **`user_id`** : `user_token` を使用する場合に必須です。 +
    + +```python +import os +from slack_bolt import App +# AuthorizeResult クラスをインポートします +from slack_bolt.authorization import AuthorizeResult + +# これはあくまでサンプル例です(ユーザートークンがないことを想定しています) +# 実際にはセキュアな DB に認可情報を保存してください +installations = [ + { + "enterprise_id":"E1234A12AB", + "team_id":"T12345", + "bot_token": "xoxb-123abc", + "bot_id":"B1251", + "bot_user_id":"U12385" + }, + { + "team_id":"T77712", + "bot_token": "xoxb-102anc", + "bot_id":"B5910", + "bot_user_id":"U1239", + "enterprise_id":"E1234A12AB" + } +] + +def authorize(enterprise_id, team_id, logger): + # トークンを取得するためのあなたのロジックをここに記述します + for team in installations: + # 一部のチームは enterprise_id を持たない場合があります + is_valid_enterprise = True if (("enterprise_id" not in team) or (enterprise_id == team["enterprise_id"])) else False + if ((is_valid_enterprise == True) and (team["team_id"] == team_id)): + # AuthorizeResult のインスタンスを返します + # bot_id と bot_user_id を保存していない場合、bot_token を使って `from_auth_test_response` を呼び出すと、自動的に取得できます + return AuthorizeResult( + enterprise_id=enterprise_id, + team_id=team_id, + bot_token=team["bot_token"], + bot_id=team["bot_id"], + bot_user_id=team["bot_user_id"] + ) + + logger.error("No authorization information was found") + +app = App( + signing_secret=os.environ["SLACK_SIGNING_SECRET"], + authorize=authorize +) +``` diff --git a/docs/_advanced/ja_context.md b/docs/_advanced/ja_context.md new file mode 100644 index 000000000..1053cce6a --- /dev/null +++ b/docs/_advanced/ja_context.md @@ -0,0 +1,72 @@ +--- +title: コンテキストの追加 +lang: ja-jp +slug: context +order: 7 +--- + +
    +すべてのリスナーは `context` ディクショナリにアクセスできます。リスナーはこれを使ってイベントの付加情報を得ることができます。受信イベントに含まれる `user_id`、`team_id`、`channel_id`、`enterprise_id` などの情報は、Bolt によって自動的に設定されます。 + +`context` は単純なディクショナリで、変更を直接加えることもできます。 +
    + +```python +# ユーザーID を使って外部のシステムからタスクを取得するリスナーミドルウェア +def fetch_tasks(context, event, next): + user = event["user"] + try: + # get_tasks は、ユーザー ID に対応するタスクのリストを DB から取得します + user_tasks = db.get_tasks(user) + tasks = user_tasks + except Exception: + # タスクが見つからなかった場合 get_tasks() は例外を投げます + tasks = [] + finally: + # ユーザーのタスクを context に設定します + context["tasks"] = tasks + next() + +# section のブロックのリストを作成するリスナーミドルウェア +def create_sections(context, next): + task_blocks = [] + # 先ほどのミドルウェアを使って context に追加した各タスクについて、処理を繰り返します + for task in context["tasks"]: + task_blocks.append( + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": f"*{task['title']}* +{task['body']}" + }, + "accessory": { + "type": "button", + "text": { + "type": "plain_text", + "text":"See task" + }, + "url": task["url"], + } + } + ) + # ブロックのリストを context に設定します + context["blocks"] = task_blocks + next() + +# ユーザーがアプリのホームを開くのをリッスンします +# fetch_tasks ミドルウェアを含めます +@app.event( + event = "app_home_opened", + middleware = [fetch_tasks, create_sections] +) +def show_tasks(event, client, context): + # ユーザーのホームタブにビューを表示します + client.views_publish( + user_id=event["user"], + view={ + "type": "home", + "blocks": context["blocks"] + } + ) +``` \ No newline at end of file diff --git a/docs/_advanced/ja_custom_adapters.md b/docs/_advanced/ja_custom_adapters.md new file mode 100644 index 000000000..88c6c54b1 --- /dev/null +++ b/docs/_advanced/ja_custom_adapters.md @@ -0,0 +1,72 @@ +--- +title: カスタムのアダプター +lang: ja-jp +slug: custom-adapters +order: 1 +--- + +
    +[アダプター](#adapters)はフレキシブルで、あなたが使用したいフレームワークに合わせた調整も可能です。アダプターでは、次の 2 つの要素が必須となっています。 + +- `__init__(app:App)` : コンストラクター。Bolt の `App` のインスタンスを受け取り、保持します。 +- `handle(req:Request)` : Slack からの受信リクエストを受け取り、解析を行う関数。通常は `handle()` という名前です。リクエストを [`BoltRequest`](https://github.com/slackapi/bolt-python/blob/main/slack_bolt/request/request.py) のインスタンスに合った形にして、保持している Bolt アプリに引き渡します。 + +`BoltRequest` のインスタンスの作成では、以下の 4 種類のパラメーターを指定できます。 + +| パラメーター | 説明 | 必須 | +|-----------|-------------|-----------| +| `body: str` | そのままのリクエストボディ | **Yes** | +| `query: any` | クエリストリング | No | +| `headers:Dict[str, Union[str, List[str]]]` | リクエストヘッダー | No | +| `context:BoltContext` | リクエストのコンテキスト情報 | No | + +アダプターは、Bolt アプリからの [`BoltResponse` のインスタンス](https://github.com/slackapi/bolt-python/blob/main/slack_bolt/response/response.py)を返します。 + +カスタムのアダプターに関連した詳しいサンプルについては、[組み込みのアダプター](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter)の実装を参考にしてください。 +
    + +```python +# Flask で必要なパッケージをインポートします +from flask import Request, Response, make_response + +from slack_bolt.app import App +from slack_bolt.request import BoltRequest +from slack_bolt.response import BoltResponse + +# この例は Flask アダプターを簡略化したものです +# もう少し詳しい完全版のサンプルは、adapter フォルダをご覧ください +# github.com/slackapi/bolt-python/blob/main/slack_bolt/adapter/flask/handler.py + +# HTTP リクエストを取り込み、標準の BoltRequest に変換します +def to_bolt_request(req:Request) -> BoltRequest: + return BoltRequest( + body=req.get_data(as_text=True), + query=req.query_string.decode("utf-8"), + headers=req.headers, + ) + +# BoltResponse を取り込み、標準の Flask レスポンスに変換します +def to_flask_response(bolt_resp:BoltResponse) -> Response: + resp:Response = make_response(bolt_resp.body, bolt_resp.status) + for k, values in bolt_resp.headers.items(): + for v in values: + resp.headers.add_header(k, v) + return resp + +# アプリからインスタンス化します +# Flask アプリを受け取ります +class SlackRequestHandler: + def __init__(self, app:App): + self.app = app + + # Slack からリクエストが届いたときに + # Flask アプリの handle() を呼び出します + def handle(self, req:Request) -> Response: + # この例では OAuth に関する部分は扱いません + if req.method == "POST": + # Bolt へのリクエストをディスパッチし、処理とルーティングを行います + bolt_resp:BoltResponse = self.app.dispatch(to_bolt_request(req)) + return to_flask_response(bolt_resp) + + return make_response("Not Found", 404) +``` diff --git a/docs/_advanced/ja_errors.md b/docs/_advanced/ja_errors.md new file mode 100644 index 000000000..e0d9c61b0 --- /dev/null +++ b/docs/_advanced/ja_errors.md @@ -0,0 +1,19 @@ +--- +title: エラーの処理 +lang: ja-jp +slug: errors +order: 3 +--- + +
    +リスナー内でエラーが発生した場合に try/except ブロックを使用して直接エラーを処理することができます。アプリに関連するエラーは、`BoltError` 型です。Slack API の呼び出しに関連するエラーは、`SlackApiError` 型となります。 + +デフォルトでは、すべての処理されなかった例外のログはグローバルのエラーハンドラーによってコンソールに出力されます。グローバルのエラーを開発者自身で処理するには、`app.error(fn)` 関数を使ってグローバルのエラーハンドラーをアプリに設定します。 +
    + +```python +@app.error +def custom_error_handler(error, body, logger): + logger.exception(f"Error: {error}") + logger.info(f"Request body: {body}") +``` \ No newline at end of file diff --git a/docs/_advanced/ja_global_middleware.md b/docs/_advanced/ja_global_middleware.md new file mode 100644 index 000000000..9d81812c9 --- /dev/null +++ b/docs/_advanced/ja_global_middleware.md @@ -0,0 +1,34 @@ +--- +title: グローバルミドルウェア +lang: ja-jp +slug: global-middleware +order: 6 +--- + +
    +グローバルミドルウェアは、すべての受信イベントに対して、リスナーミドルウェアが呼ばれる前に実行されるものです。ミドルウェア関数を `app.use()` に渡すことで、アプリにはグローバルミドルウェアをいくつでも追加できます。ミドルウェア関数で受け取れる引数はリスナー関数と同じものに加えて`next()` 関数があります。 + +グローバルミドルウェアでもリスナーミドルウェアでも、次のミドルウェアに実行チェーンの制御をリレーするために、`next()` を呼び出す必要があります。 +
    + +```python +@app.use +def auth_abc(client, context, logger, payload, next): + slack_user_id = payload["user"] + help_channel_id = "C12345" + + try: + # Slack のユーザー ID を使って外部のシステムでユーザーを検索します + user = abc.lookup_by_id(slack_user_id) + # 結果を context に保存します + context["user"] = user + except Exception: + client.chat_postEphemeral( + channel=payload["channel"], + user=slack_user_id, + text=f"Sorry <@{slack_user_id}>, you aren't registered in ABC or there was an error with authentication.Please post in <#{help_channel_id}> for assistance" + ) + + # 次のミドルウェアに実行権を渡します + next() +``` diff --git a/docs/_advanced/ja_lazy_listener.md b/docs/_advanced/ja_lazy_listener.md new file mode 100644 index 000000000..a3cbe8fec --- /dev/null +++ b/docs/_advanced/ja_lazy_listener.md @@ -0,0 +1,111 @@ +--- +title: Lazy リスナー(FaaS) +lang: ja-jp +slug: lazy-listeners +order: 9 +--- + +
    +⚠️ Lazy リスナー関数は、FaaS 環境への Bolt for Python アプリのデプロイを容易にする、ベータ版の機能です。開発中の機能であるため、Bolt for Python の API は変更される可能性があります。 + +通常、リスナー関数では最初の手順として `ack()` を呼び出します。`ack()` を呼び出すことで、アプリがイベントを受け取り、適切な時間内(3 秒間)に処理する予定であることが Slack に伝えられます。 + +しかし、FaaS 環境や類似のランタイムで実行されるアプリでは、HTTP レスポンスを返したあとにスレッドやプロセスの実行を続けることができないため、同じパターンに従うことはできません。代わりに、`process_before_response` フラグを `True` に設定します。この設定により、`ack()` の呼び出しとイベントの処理を安全に行うリスナーを作成することができます。しかし、3 秒以内にすべての処理を完了させる必要があることは変わりません。イベント APIに応答するリスナーでは`ack()` メソッドの呼び出しを必要としませんが、この設定では処理を 3 秒以内に完了させる必要があります。 + +Lazy リスナーは、この問題を解決するためのソリューションです。Lazy リスナーは、デコレーターとして動作するものではなく、次の 2 つのキーワード引数を指定することにより動作するものです。 * `ack:Callable` : `ack()` の呼び出しを行います。 * `lazy:List[Callable]` : イベントに関係する、時間のかかるプロセスの処理を担当します。Lazy 関数からは `ack()` にアクセスできません。 +
    + +```python +def respond_to_slack_within_3_seconds(body, ack): + text = body.get("text") + if text is None or len(text) == 0: + ack(f":x:Usage: /start-process (description here)") + else: + ack(f"Accepted! (task: {body['text']})") + +import time +def run_long_process(respond, body): + time.sleep(5) # 3 秒より長い時間を指定します + respond(f"Completed! (task: {body['text']})") + +app.command("/start-process")( + # この場合でも ack() は 3 秒以内に呼ばれます + ack=respond_to_slack_within_3_seconds, + # Lazy 関数がイベントの処理を担当します + lazy=[run_long_process] +) +``` + +
    + +

    AWS Lambda を使用した例

    +
    + +
    +このサンプルは、[AWS Lambda](https://aws.amazon.com/lambda/) にコードをデプロイします。[`examples` フォルダ](https://github.com/slackapi/bolt-python/tree/main/examples/aws_lambda)にはほかにもサンプルが用意されています。 + +```bash +pip install slack_bolt +# ソースコードを main.py として保存します +# config.yaml を設定してハンドラーを `handler: main.handler` で参照できるようにします + +# https://pypi.org/project/python-lambda/ +pip install python-lambda + +# config.yml を適切に設定します +# lazy リスナーの実行には lambda:InvokeFunction と lambda:GetFunction が必要です +export SLACK_SIGNING_SECRET=*** +export SLACK_BOT_TOKEN=xoxb-*** +echo 'slack_bolt' > requirements.txt +lambda deploy --config-file config.yaml --requirements requirements.txt +``` +
    + +```python +from slack_bolt import App +from slack_bolt.adapter.aws_lambda import SlackRequestHandler + +# FaaS で実行するときは process_before_response を True にする必要があります +app = App(process_before_response=True) + +def respond_to_slack_within_3_seconds(body, ack): + text = body.get("text") + if text is None or len(text) == 0: + ack(":x: Usage: /start-process (description here)") + else: + ack(f"Accepted! (task: {body['text']})") + +import time +def run_long_process(respond, body): + time.sleep(5) # 3 秒より長い時間を指定します + respond(f"Completed! (task: {body['text']})") + +app.command("/start-process")( + ack=respond_to_slack_within_3_seconds, # `ack()` の呼び出しを担当します + lazy=[run_long_process] # `ack()` の呼び出しはできません。複数の関数を持たせることができます。 +) + +def handler(event, context): + slack_handler = SlackRequestHandler(app=app) + return slack_handler.handle(event, context) +``` + +このサンプルアプリを実行するには、以下の IAM 権限が必要になります。 + +```json +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "VisualEditor0", + "Effect": "Allow", + "Action": [ + "lambda:InvokeFunction", + "lambda:GetFunction" + ], + "Resource": "*" + } + ] +} +``` +
    diff --git a/docs/_advanced/ja_listener_middleware.md b/docs/_advanced/ja_listener_middleware.md new file mode 100644 index 000000000..0bb3f7d77 --- /dev/null +++ b/docs/_advanced/ja_listener_middleware.md @@ -0,0 +1,24 @@ +--- +title: リスナーミドルウェア +lang: ja-jp +slug: listener-middleware +order: 5 +--- + +
    +リスナーミドルウェアは、それを渡したリスナーでのみ実行されるミドルウェアです。リスナーには、`middleware` パラメーターを使ってミドルウェア関数をいくつでも渡すことができます。このパラメーターには、1 つまたは複数のミドルウェア関数からなるリストを指定します。 +
    + +```python +# "bot_message" サブタイプのメッセージを抽出するリスナーミドルウェア +def no_bot_messages(message, next): + subtype = message.get("subtype") + if subtype != "bot_message": + next() + +# このリスナーは人間によって送信されたメッセージのみを受け取ります +@app.event(event="message", middleware=[no_bot_messages]) +def log_message(logger, event): + logger.info(f"(MSG) User: {event['user']} +Message: {event['text']}") +``` diff --git a/docs/_advanced/ja_logging.md b/docs/_advanced/ja_logging.md new file mode 100644 index 000000000..91a3f4085 --- /dev/null +++ b/docs/_advanced/ja_logging.md @@ -0,0 +1,28 @@ +--- +title: ロギング +lang: ja-jp +slug: logging +order: 4 +--- + +
    +デフォルトでは、アプリからのログ情報は、既定の出力先に出力されます。`logging` モジュールをインポートすれば、`basicConfig()` の `level` パラメーターでrootのログレベルを変更することができます。指定できるログレベルは、重要度の低い方から `debug`、`info`、`warning`、`error`、および `critical` です。 + +グローバルのコンテキストとは別に、指定のログレベルに応じて単一のメッセージをログ出力することもできます。Bolt では [Python 標準の logging モジュール](https://docs.python.org/3/library/logging.html)が使われているため、このモジュールが持つすべての機能を利用できます。 +
    + +```python +import logging + +# グローバルのコンテキストの logger です +# logging をインポートする必要があります +logging.basicConfig(level=logging.DEBUG) + +@app.event("app_mention") +def handle_mention(body, say, logger): + user = body["event"]["user"] + # 単一の logger の呼び出しです + # グローバルの logger がリスナーに渡されています + logger.debug(body) + say(f"{user} mentioned your app") +``` diff --git a/docs/_advanced/logging.md b/docs/_advanced/logging.md index f36161153..9ee44f5fa 100644 --- a/docs/_advanced/logging.md +++ b/docs/_advanced/logging.md @@ -6,7 +6,7 @@ order: 4 ---
    -By default, Bolt will log information from your app to the output destination. After you've imported the logging module, you can customize the root log level by passing the `level` parameter to `basicConfig()`. The available log levels in order of least to most severe are `debug`, `info`, `warning`, `error`, and `critical`. +By default, Bolt will log information from your app to the output destination. After you've imported the `logging` module, you can customize the root log level by passing the `level` parameter to `basicConfig()`. The available log levels in order of least to most severe are `debug`, `info`, `warning`, `error`, and `critical`. Outside of a global context, you can also log a single message corresponding to a specific level. Because Bolt uses Python’s [standard logging module](https://docs.python.org/3/library/logging.html), you can use any its features.
    diff --git a/docs/_config.yml b/docs/_config.yml index 083fa7c1d..954982049 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -38,7 +38,7 @@ t: ja-jp: basic: 基本的な概念 steps: ワークフローステップ -# advanced: 応用コンセプト + advanced: 応用コンセプト start: Bolt 入門ガイド # contribute: 貢献 From 5c7399c6b24ad9d28678e9b8589e8a6126f1a1d8 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 28 May 2021 20:14:00 +0900 Subject: [PATCH 190/719] Upgrade black code formatter to veresion 21.5b1 --- examples/django/myslackapp/settings.py | 4 +++- setup.py | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/examples/django/myslackapp/settings.py b/examples/django/myslackapp/settings.py index a99c91188..3cae54402 100644 --- a/examples/django/myslackapp/settings.py +++ b/examples/django/myslackapp/settings.py @@ -20,7 +20,9 @@ # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ # TODO: CHANGE THIS IF YOU REUSE THIS APP -SECRET_KEY = "This is just a example. You should not expose your secret key in real apps" +SECRET_KEY = ( + "This is just a example. You should not expose your secret key in real apps" +) # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True diff --git a/setup.py b/setup.py index 4a57c98ba..fc6c4f5d5 100755 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ "aiohttp>=3,<4", # for async "Flask-Sockets>=0.2,<1", "Werkzeug<2", # TODO: support Flask 2.x - "black==20.8b1", + "black==21.5b1", ] setuptools.setup( @@ -32,10 +32,17 @@ long_description_content_type="text/markdown", url="https://github.com/slackapi/bolt-python", packages=setuptools.find_packages( - exclude=["examples", "integration_tests", "tests", "tests.*",] + exclude=[ + "examples", + "integration_tests", + "tests", + "tests.*", + ] ), include_package_data=True, # MANIFEST.in - install_requires=["slack_sdk>=3.5.0,<4",], + install_requires=[ + "slack_sdk>=3.5.0,<4", + ], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, test_suite="tests", @@ -53,7 +60,7 @@ # used only under src/slack_bolt/adapter "boto3<=2", # TODO: Upgrade to v2 - "moto<2", # For AWS tests + "moto<2", # For AWS tests "bottle>=0.12,<1", "boddle>=0.2,<0.3", # For Bottle app tests "chalice>=1.22.4,<2", @@ -73,7 +80,7 @@ "uvicorn<1", "gunicorn>=20,<21", # Socket Mode 3rd party implementation - "websocket_client>=0.57,<1" + "websocket_client>=0.57,<1", ], # pip install -e ".[testing]" "testing": test_dependencies, From bdba69a292f626cb1efc3c1f8fbdf48804b97665 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 2 Jun 2021 06:19:21 +0900 Subject: [PATCH 191/719] Fix #358 Add more links to listener argument guide in document pages (#360) --- docs/_advanced/global_middleware.md | 3 +++ docs/_advanced/ja_global_middleware.md | 3 +++ docs/_advanced/ja_listener_middleware.md | 3 +++ docs/_advanced/listener_middleware.md | 3 +++ docs/_basic/acknowledging_events.md | 3 +++ docs/_basic/ja_acknowledging_events.md | 3 +++ docs/_basic/ja_listening_actions.md | 3 +++ docs/_basic/ja_listening_events.md | 3 +++ docs/_basic/ja_listening_messages.md | 4 +++- docs/_basic/ja_listening_modals.md | 3 +++ docs/_basic/ja_listening_responding_commands.md | 3 +++ docs/_basic/ja_listening_responding_options.md | 3 +++ docs/_basic/ja_listening_responding_shortcuts.md | 4 +++- docs/_basic/ja_opening_modals.md | 3 +++ docs/_basic/ja_publishing_views.md | 4 +++- docs/_basic/ja_responding_actions.md | 4 +++- docs/_basic/ja_sending_messages.md | 3 +++ docs/_basic/ja_updating_pushing_modals.md | 4 ++++ docs/_basic/ja_web_api.md | 3 +++ docs/_basic/listening_actions.md | 3 +++ docs/_basic/listening_events.md | 3 +++ docs/_basic/listening_messages.md | 3 +++ docs/_basic/listening_modals.md | 3 +++ docs/_basic/listening_responding_commands.md | 3 +++ docs/_basic/listening_responding_options.md | 3 +++ docs/_basic/listening_responding_shortcuts.md | 3 +++ docs/_basic/opening_modals.md | 3 +++ docs/_basic/publishing_views.md | 4 +++- docs/_basic/responding_actions.md | 3 +++ docs/_basic/sending_messages.md | 3 +++ docs/_basic/updating_pushing_modals.md | 3 +++ docs/_basic/web_api.md | 3 +++ docs/_steps/adding_editing_workflow_step.md | 3 +++ docs/_steps/creating_workflow_step.md | 3 +++ docs/_steps/executing_workflow_steps.md | 5 ++++- docs/_steps/ja_adding_editing_workflow_step.md | 3 +++ docs/_steps/ja_creating_workflow_step.md | 3 +++ docs/_steps/ja_executing_workflow_steps.md | 5 ++++- docs/_steps/ja_saving_workflow_step.md | 5 ++++- docs/_steps/saving_workflow_step.md | 7 +++++-- docs/_tutorials/getting_started.md | 2 ++ docs/_tutorials/ja_getting_started.md | 2 ++ docs/api-docs/slack_bolt/kwargs_injection/index.html | 2 +- docs/assets/style.css | 4 ++++ examples/getting_started/app.py | 2 ++ 45 files changed, 137 insertions(+), 11 deletions(-) diff --git a/docs/_advanced/global_middleware.md b/docs/_advanced/global_middleware.md index efebea050..63703fffb 100644 --- a/docs/_advanced/global_middleware.md +++ b/docs/_advanced/global_middleware.md @@ -11,6 +11,8 @@ Global middleware is run for all incoming events, before any listener middleware Both global and listener middleware must call `next()` to pass control of the execution chain to the next middleware. +
    +Refer to the module document to learn the available listener arguments. ```python @app.use def auth_acme(client, context, logger, payload, next): @@ -32,3 +34,4 @@ def auth_acme(client, context, logger, payload, next): # Pass control to the next middleware next() ``` +
    diff --git a/docs/_advanced/ja_global_middleware.md b/docs/_advanced/ja_global_middleware.md index 9d81812c9..3588e4fcb 100644 --- a/docs/_advanced/ja_global_middleware.md +++ b/docs/_advanced/ja_global_middleware.md @@ -11,6 +11,8 @@ order: 6 グローバルミドルウェアでもリスナーミドルウェアでも、次のミドルウェアに実行チェーンの制御をリレーするために、`next()` を呼び出す必要があります。 +
    +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python @app.use def auth_abc(client, context, logger, payload, next): @@ -32,3 +34,4 @@ def auth_abc(client, context, logger, payload, next): # 次のミドルウェアに実行権を渡します next() ``` +
    \ No newline at end of file diff --git a/docs/_advanced/ja_listener_middleware.md b/docs/_advanced/ja_listener_middleware.md index 0bb3f7d77..fa4ea4dd7 100644 --- a/docs/_advanced/ja_listener_middleware.md +++ b/docs/_advanced/ja_listener_middleware.md @@ -9,6 +9,8 @@ order: 5 リスナーミドルウェアは、それを渡したリスナーでのみ実行されるミドルウェアです。リスナーには、`middleware` パラメーターを使ってミドルウェア関数をいくつでも渡すことができます。このパラメーターには、1 つまたは複数のミドルウェア関数からなるリストを指定します。 +
    +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # "bot_message" サブタイプのメッセージを抽出するリスナーミドルウェア def no_bot_messages(message, next): @@ -22,3 +24,4 @@ def log_message(logger, event): logger.info(f"(MSG) User: {event['user']} Message: {event['text']}") ``` +
    \ No newline at end of file diff --git a/docs/_advanced/listener_middleware.md b/docs/_advanced/listener_middleware.md index 73c3d3590..476be70d6 100644 --- a/docs/_advanced/listener_middleware.md +++ b/docs/_advanced/listener_middleware.md @@ -9,6 +9,8 @@ order: 5 Listener middleware is only run for the listener in which it's passed. You can pass any number of middleware functions to the listener using the `middleware` parameter, which must be a list that contains one to many middleware functions. +
    +Refer to the module document to learn the available listener arguments. ```python # Listener middleware which filters out messages with "bot_message" subtype def no_bot_messages(message, next): @@ -21,3 +23,4 @@ def no_bot_messages(message, next): def log_message(logger, event): logger.info(f"(MSG) User: {event['user']}\nMessage: {event['text']}") ``` +
    \ No newline at end of file diff --git a/docs/_basic/acknowledging_events.md b/docs/_basic/acknowledging_events.md index b341ca673..fd7b0d534 100644 --- a/docs/_basic/acknowledging_events.md +++ b/docs/_basic/acknowledging_events.md @@ -15,6 +15,8 @@ We recommend calling `ack()` right away before sending a new message or fetching +
    +Refer to the module document to learn the available listener arguments. ```python # Example of responding to an external_select options request @app.options("menu_selection") @@ -31,3 +33,4 @@ def show_menu_options(ack): ] ack(options=options) ``` +
    \ No newline at end of file diff --git a/docs/_basic/ja_acknowledging_events.md b/docs/_basic/ja_acknowledging_events.md index 996500347..51331a3ce 100644 --- a/docs/_basic/ja_acknowledging_events.md +++ b/docs/_basic/ja_acknowledging_events.md @@ -15,6 +15,8 @@ order: 7 +
    +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # 外部データを使用する選択メニューオプションに応答するサンプル @app.options("menu_selection") @@ -31,3 +33,4 @@ def show_menu_options(ack): ] ack(options=options) ``` +
    \ No newline at end of file diff --git a/docs/_basic/ja_listening_actions.md b/docs/_basic/ja_listening_actions.md index fe4407809..6456b56ab 100644 --- a/docs/_basic/ja_listening_actions.md +++ b/docs/_basic/ja_listening_actions.md @@ -14,6 +14,8 @@ Bolt アプリは `action` メソッドを用いて、ボタンのクリック +
    +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # 'approve_button' という action_id のブロックエレメントがトリガーされるたびに、このリスナーが呼び出させれる @app.action("approve_button") @@ -21,6 +23,7 @@ def update_message(ack): ack() # アクションへの反応としてメッセージを更新 ``` +
    diff --git a/docs/_basic/ja_listening_events.md b/docs/_basic/ja_listening_events.md index b3ac00773..b491af6fe 100644 --- a/docs/_basic/ja_listening_events.md +++ b/docs/_basic/ja_listening_events.md @@ -13,6 +13,8 @@ order: 3 +
    +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # ユーザーがワークスペースに参加した際に、自己紹介を促すメッセージを指定のチャンネルに送信 @app.event("team_join") @@ -22,6 +24,7 @@ def ask_for_introduction(event, say): text = f"Welcome to the team, <@{user_id}>! 🎉 You can introduce yourself in this channel." say(text=text, channel=welcome_channel_id) ``` +
    diff --git a/docs/_basic/ja_listening_messages.md b/docs/_basic/ja_listening_messages.md index d0ca9eea8..12df49493 100644 --- a/docs/_basic/ja_listening_messages.md +++ b/docs/_basic/ja_listening_messages.md @@ -10,9 +10,10 @@ order: 1 [あなたのアプリがアクセス権限を持つ](https://api.slack.com/messaging/retrieving#permissions)メッセージの投稿イベントをリッスンするには `message()` メソッドを利用します。このメソッドは `type` が `message` ではないイベントを処理対象から除外します。 `message()` の引数には `str` 型または `re.Pattern` オブジェクトを指定できます。この条件のパターンに一致しないメッセージは除外されます。 - +
    +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # '👋' が含まれるすべてのメッセージに一致 @app.message(":wave:") @@ -20,6 +21,7 @@ def say_hello(message, say): user = message['user'] say(f"Hi there, <@{user}>!") ``` +
    diff --git a/docs/_basic/ja_listening_modals.md b/docs/_basic/ja_listening_modals.md index c5986d395..16935948d 100644 --- a/docs/_basic/ja_listening_modals.md +++ b/docs/_basic/ja_listening_modals.md @@ -15,6 +15,8 @@ order: 12 +
    +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # view_submission イベントを処理 @app.view("view_1") @@ -46,3 +48,4 @@ def handle_submission(ack, body, client, view): # ユーザーにメッセージを送信 client.chat_postMessage(channel=user, text=msg) ``` +
    \ No newline at end of file diff --git a/docs/_basic/ja_listening_responding_commands.md b/docs/_basic/ja_listening_responding_commands.md index da782ce6e..3895c4d79 100644 --- a/docs/_basic/ja_listening_responding_commands.md +++ b/docs/_basic/ja_listening_responding_commands.md @@ -17,6 +17,8 @@ order: 9 +
    +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # echoコマンドは受け取ったコマンドをそのまま返す @app.command("/echo") @@ -25,3 +27,4 @@ def repeat_text(ack, say, command): ack() say(f"{command['text']}") ``` +
    diff --git a/docs/_basic/ja_listening_responding_options.md b/docs/_basic/ja_listening_responding_options.md index 8bd7eb705..e7951eeb3 100644 --- a/docs/_basic/ja_listening_responding_options.md +++ b/docs/_basic/ja_listening_responding_options.md @@ -16,6 +16,8 @@ order: 14 +
    +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # 外部データを使用する選択メニューオプションに応答するサンプル例 @app.options("external_action") @@ -32,3 +34,4 @@ def show_options(ack): ] ack(options=options) ``` +
    \ No newline at end of file diff --git a/docs/_basic/ja_listening_responding_shortcuts.md b/docs/_basic/ja_listening_responding_shortcuts.md index 30af2a1aa..03fbb7fb8 100644 --- a/docs/_basic/ja_listening_responding_shortcuts.md +++ b/docs/_basic/ja_listening_responding_shortcuts.md @@ -21,8 +21,9 @@ order: 8 +
    +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python - # 'open_modal' という callback_id のショートカットをリッスン @app.shortcut("open_modal") def open_modal(ack, shortcut, client): @@ -57,6 +58,7 @@ def open_modal(ack, shortcut, client): } ) ``` +
    diff --git a/docs/_basic/ja_opening_modals.md b/docs/_basic/ja_opening_modals.md index 65aa100ce..8a8333147 100644 --- a/docs/_basic/ja_opening_modals.md +++ b/docs/_basic/ja_opening_modals.md @@ -15,6 +15,8 @@ order: 10 +
    +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # ショートカットの呼び出しをリッスン @app.shortcut("open_modal") @@ -56,3 +58,4 @@ def open_modal(ack, body, client): } ) ``` +
    \ No newline at end of file diff --git a/docs/_basic/ja_publishing_views.md b/docs/_basic/ja_publishing_views.md index 62278161b..280643482 100644 --- a/docs/_basic/ja_publishing_views.md +++ b/docs/_basic/ja_publishing_views.md @@ -11,6 +11,8 @@ order: 13 `app_home_opened` イベントをサブスクライブすると、ユーザーが App Home を開く操作をリッスンできます。 +
    +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python @app.event("app_home_opened") def update_home_tab(client, event, logger): @@ -40,7 +42,7 @@ def update_home_tab(client, event, logger): ] } ) - except Exception as e: logger.error(f"Error publishing home tab: {e}") ``` +
    \ No newline at end of file diff --git a/docs/_basic/ja_responding_actions.md b/docs/_basic/ja_responding_actions.md index e8ddd9b30..0068073e6 100644 --- a/docs/_basic/ja_responding_actions.md +++ b/docs/_basic/ja_responding_actions.md @@ -10,9 +10,10 @@ order: 6 アクションへの応答には、主に 2 つの方法があります。1 つ目の最も一般的なやり方は `say()` を使用する方法です。そのイベントが発生した会話(チャンネルや DM)にメッセージを返します。 2 つ目は、`respond()` を使用する方法です。これは、アクションに関連づけられた `response_url` を使ったメッセージ送信を行うためのユーティリティです。 - +
    +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # 'approve_button' という action_id のインタラクティブコンポーネントがトリガーされると、このリスナーが呼ばれる @app.action("approve_button") @@ -21,6 +22,7 @@ def approve_request(ack, say): ack() say("Request approved 👍") ``` +
    diff --git a/docs/_basic/ja_sending_messages.md b/docs/_basic/ja_sending_messages.md index 40499555e..afa30d8d1 100644 --- a/docs/_basic/ja_sending_messages.md +++ b/docs/_basic/ja_sending_messages.md @@ -13,12 +13,15 @@ order: 2 +
    +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # 'knock knock' が含まれるメッセージをリッスンし、イタリック体で 'Who's there?' と返信 @app.message("knock knock") def ask_who(message, say): say("_Who's there?_") ``` +
    diff --git a/docs/_basic/ja_updating_pushing_modals.md b/docs/_basic/ja_updating_pushing_modals.md index 26fdcdc94..cf5ea4b0a 100644 --- a/docs/_basic/ja_updating_pushing_modals.md +++ b/docs/_basic/ja_updating_pushing_modals.md @@ -19,6 +19,8 @@ order: 11 +
    +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # モーダルに含まれる、`button_abc` という action_id のボタンの呼び出しをリッスン @app.action("button_abc") @@ -51,3 +53,5 @@ def update_modal(ack, body, client): } ) ``` +
    + diff --git a/docs/_basic/ja_web_api.md b/docs/_basic/ja_web_api.md index c44c8da22..7c5ab21fc 100644 --- a/docs/_basic/ja_web_api.md +++ b/docs/_basic/ja_web_api.md @@ -12,6 +12,8 @@ Bolt の初期化に使用するトークンは `context` オブジェクトに +
    +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python @app.message("wake me up") def say_hello(client, message): @@ -24,3 +26,4 @@ def say_hello(client, message): text="Summer has come and passed" ) ``` +
    \ No newline at end of file diff --git a/docs/_basic/listening_actions.md b/docs/_basic/listening_actions.md index af85c4c4c..338f77332 100644 --- a/docs/_basic/listening_actions.md +++ b/docs/_basic/listening_actions.md @@ -14,6 +14,8 @@ You'll notice in all `action()` examples, `ack()` is used. It is required to cal +
    +Refer to the module document to learn the available listener arguments. ```python # Your listener will be called every time a block element with the action_id "approve_button" is triggered @app.action("approve_button") @@ -21,6 +23,7 @@ def update_message(ack): ack() # Update the message to reflect the action ``` +
    diff --git a/docs/_basic/listening_events.md b/docs/_basic/listening_events.md index f3136b18e..e5df72952 100644 --- a/docs/_basic/listening_events.md +++ b/docs/_basic/listening_events.md @@ -13,6 +13,8 @@ The `event()` method requires an `eventType` of type `str`. +
    +Refer to the module document to learn the available listener arguments. ```python # When a user joins the workspace, send a message in a predefined channel asking them to introduce themselves @app.event("team_join") @@ -22,6 +24,7 @@ def ask_for_introduction(event, say): text = f"Welcome to the team, <@{user_id}>! 🎉 You can introduce yourself in this channel." say(text=text, channel=welcome_channel_id) ``` +
    diff --git a/docs/_basic/listening_messages.md b/docs/_basic/listening_messages.md index d193da141..f48aa5e96 100644 --- a/docs/_basic/listening_messages.md +++ b/docs/_basic/listening_messages.md @@ -13,6 +13,8 @@ To listen to messages that [your app has access to receive](https://api.slack.co +
    +Refer to the module document to learn the available listener arguments. ```python # This will match any message that contains 👋 @app.message(":wave:") @@ -20,6 +22,7 @@ def say_hello(message, say): user = message['user'] say(f"Hi there, <@{user}>!") ``` +
    diff --git a/docs/_basic/listening_modals.md b/docs/_basic/listening_modals.md index 48aa70ba4..855791160 100644 --- a/docs/_basic/listening_modals.md +++ b/docs/_basic/listening_modals.md @@ -15,6 +15,8 @@ Read more about view submissions in our Refer to the module document to learn the available listener arguments. ```python # Handle a view_submission event @app.view("view_1") @@ -46,3 +48,4 @@ def handle_submission(ack, body, client, view): # Message the user client.chat_postMessage(channel=user, text=msg) ``` + \ No newline at end of file diff --git a/docs/_basic/listening_responding_commands.md b/docs/_basic/listening_responding_commands.md index b6e1aee65..c25316228 100644 --- a/docs/_basic/listening_responding_commands.md +++ b/docs/_basic/listening_responding_commands.md @@ -17,6 +17,8 @@ When setting up commands within your app configuration, you'll append `/slack/ev +
    +Refer to the module document to learn the available listener arguments. ```python # The echo command simply echoes on command @app.command("/echo") @@ -25,3 +27,4 @@ def repeat_text(ack, say, command): ack() say(f"{command['text']}") ``` +
    \ No newline at end of file diff --git a/docs/_basic/listening_responding_options.md b/docs/_basic/listening_responding_options.md index 50997ccce..a50a3f06c 100644 --- a/docs/_basic/listening_responding_options.md +++ b/docs/_basic/listening_responding_options.md @@ -15,6 +15,8 @@ To respond to options requests, you'll need to call `ack()` with a valid `option +
    +Refer to the module document to learn the available listener arguments. ```python # Example of responding to an external_select options request @app.options("external_action") @@ -31,3 +33,4 @@ def show_options(ack): ] ack(options=options) ``` +
    \ No newline at end of file diff --git a/docs/_basic/listening_responding_shortcuts.md b/docs/_basic/listening_responding_shortcuts.md index a7f414501..662a98e07 100644 --- a/docs/_basic/listening_responding_shortcuts.md +++ b/docs/_basic/listening_responding_shortcuts.md @@ -21,6 +21,8 @@ When setting up shortcuts within your app configuration, as with other URLs, you +
    +Refer to the module document to learn the available listener arguments. ```python # The open_modal shortcut listens to a shortcut with the callback_id "open_modal" @app.shortcut("open_modal") @@ -56,6 +58,7 @@ def open_modal(ack, shortcut, client): } ) ``` +
    diff --git a/docs/_basic/opening_modals.md b/docs/_basic/opening_modals.md index 2276e0c79..c42c5fee0 100644 --- a/docs/_basic/opening_modals.md +++ b/docs/_basic/opening_modals.md @@ -15,6 +15,8 @@ Read more about modal composition in the Refer to the module document to learn the available listener arguments. ```python # Listen for a shortcut invocation @app.shortcut("open_modal") @@ -56,3 +58,4 @@ def open_modal(ack, body, client): } ) ``` + \ No newline at end of file diff --git a/docs/_basic/publishing_views.md b/docs/_basic/publishing_views.md index 09f678e06..38d4e793d 100644 --- a/docs/_basic/publishing_views.md +++ b/docs/_basic/publishing_views.md @@ -11,6 +11,8 @@ order: 13 You can subscribe to the `app_home_opened` event to listen for when users open your App Home. +
    +Refer to the module document to learn the available listener arguments. ```python @app.event("app_home_opened") def update_home_tab(client, event, logger): @@ -40,7 +42,7 @@ def update_home_tab(client, event, logger): ] } ) - except Exception as e: logger.error(f"Error publishing home tab: {e}") ``` +
    \ No newline at end of file diff --git a/docs/_basic/responding_actions.md b/docs/_basic/responding_actions.md index 8f432e19b..9f143ce18 100644 --- a/docs/_basic/responding_actions.md +++ b/docs/_basic/responding_actions.md @@ -13,6 +13,8 @@ The second way to respond to actions is using `respond()`, which is a utility to +
    +Refer to the module document to learn the available listener arguments. ```python # Your listener will be called every time an interactive component with the action_id “approve_button” is triggered @app.action("approve_button") @@ -21,6 +23,7 @@ def approve_request(ack, say): ack() say("Request approved 👍") ``` +
    diff --git a/docs/_basic/sending_messages.md b/docs/_basic/sending_messages.md index bdf9174de..adc5a5526 100644 --- a/docs/_basic/sending_messages.md +++ b/docs/_basic/sending_messages.md @@ -13,12 +13,15 @@ In the case that you'd like to send a message outside of a listener or you want +
    +Refer to the module document to learn the available listener arguments. ```python # Listens for messages containing "knock knock" and responds with an italicized "who's there?" @app.message("knock knock") def ask_who(message, say): say("_Who's there?_") ``` +
    diff --git a/docs/_basic/updating_pushing_modals.md b/docs/_basic/updating_pushing_modals.md index d017be210..353745c45 100644 --- a/docs/_basic/updating_pushing_modals.md +++ b/docs/_basic/updating_pushing_modals.md @@ -19,6 +19,8 @@ Learn more about updating and pushing views in our Refer to the module document to learn the available listener arguments. ```python # Listen for a button invocation with action_id `button_abc` (assume it's inside of a modal) @app.action("button_abc") @@ -51,3 +53,4 @@ def update_modal(ack, body, client): } ) ``` + \ No newline at end of file diff --git a/docs/_basic/web_api.md b/docs/_basic/web_api.md index d226b6e15..4e7c6e3c8 100644 --- a/docs/_basic/web_api.md +++ b/docs/_basic/web_api.md @@ -12,6 +12,8 @@ The token used to initialize Bolt can be found in the `context` object, which is +
    +Refer to the module document to learn the available listener arguments. ```python @app.message("wake me up") def say_hello(client, message): @@ -24,3 +26,4 @@ def say_hello(client, message): text="Summer has come and passed" ) ``` +
    \ No newline at end of file diff --git a/docs/_steps/adding_editing_workflow_step.md b/docs/_steps/adding_editing_workflow_step.md index bf7b5d960..de9e877e8 100644 --- a/docs/_steps/adding_editing_workflow_step.md +++ b/docs/_steps/adding_editing_workflow_step.md @@ -17,6 +17,8 @@ To learn more about opening configuration modals, [read the documentation](https +
    +Refer to the module documents (common / step-specific) to learn the available arguments. ```python def edit(ack, step, configure): ack() @@ -53,3 +55,4 @@ ws = WorkflowStep( ) app.step(ws) ``` +
    diff --git a/docs/_steps/creating_workflow_step.md b/docs/_steps/creating_workflow_step.md index 5d3db5000..8532ad57f 100644 --- a/docs/_steps/creating_workflow_step.md +++ b/docs/_steps/creating_workflow_step.md @@ -17,6 +17,8 @@ After instantiating a `WorkflowStep`, you can pass it into `app.step()`. Behind +
    +Refer to the module documents (common / step-specific) to learn the available arguments. ```python import os from slack_bolt import App @@ -47,3 +49,4 @@ ws = WorkflowStep( # Pass Step to set up listeners app.step(ws) ``` +
    diff --git a/docs/_steps/executing_workflow_steps.md b/docs/_steps/executing_workflow_steps.md index b767112a0..7b067eedb 100644 --- a/docs/_steps/executing_workflow_steps.md +++ b/docs/_steps/executing_workflow_steps.md @@ -15,6 +15,8 @@ Within the `execute` callback, your app must either call `complete()` to indicat +
    +Refer to the module documents (common / step-specific) to learn the available arguments. ```python def execute(step, complete, fail): inputs = step["inputs"] @@ -36,4 +38,5 @@ ws = WorkflowStep( execute=execute, ) app.step(ws) -``` \ No newline at end of file +``` +
    \ No newline at end of file diff --git a/docs/_steps/ja_adding_editing_workflow_step.md b/docs/_steps/ja_adding_editing_workflow_step.md index e231825e1..7f3c9d44e 100644 --- a/docs/_steps/ja_adding_editing_workflow_step.md +++ b/docs/_steps/ja_adding_editing_workflow_step.md @@ -17,6 +17,8 @@ order: 3 +
    +指定可能な引数の一覧はモジュールドキュメントを参考にしてください(共通 / ステップ用 ```python def edit(ack, step, configure): ack() @@ -53,3 +55,4 @@ ws = WorkflowStep( ) app.step(ws) ``` +
    \ No newline at end of file diff --git a/docs/_steps/ja_creating_workflow_step.md b/docs/_steps/ja_creating_workflow_step.md index d9438e0e4..0a56b9add 100644 --- a/docs/_steps/ja_creating_workflow_step.md +++ b/docs/_steps/ja_creating_workflow_step.md @@ -17,6 +17,8 @@ order: 2 +
    +指定可能な引数の一覧はモジュールドキュメントを参考にしてください(共通 / ステップ用 ```python import os from slack_bolt import App @@ -47,3 +49,4 @@ ws = WorkflowStep( # ワークフローステップを渡してリスナーを設定する app.step(ws) ``` +
    \ No newline at end of file diff --git a/docs/_steps/ja_executing_workflow_steps.md b/docs/_steps/ja_executing_workflow_steps.md index c9540175d..68e682ee3 100644 --- a/docs/_steps/ja_executing_workflow_steps.md +++ b/docs/_steps/ja_executing_workflow_steps.md @@ -15,6 +15,8 @@ order: 5 +
    +指定可能な引数の一覧はモジュールドキュメントを参考にしてください(共通 / ステップ用 ```python def execute(step, complete, fail): inputs = step["inputs"] @@ -36,4 +38,5 @@ ws = WorkflowStep( execute=execute, ) app.step(ws) -``` \ No newline at end of file +``` +
    \ No newline at end of file diff --git a/docs/_steps/ja_saving_workflow_step.md b/docs/_steps/ja_saving_workflow_step.md index 80689bb41..b6f3f3076 100644 --- a/docs/_steps/ja_saving_workflow_step.md +++ b/docs/_steps/ja_saving_workflow_step.md @@ -20,6 +20,8 @@ order: 4 +
    +指定可能な引数の一覧はモジュールドキュメントを参考にしてください(共通 / ステップ用 ```python def save(ack, view, update): ack() @@ -53,4 +55,5 @@ ws = WorkflowStep( execute=execute, ) app.step(ws) -``` \ No newline at end of file +``` +
    \ No newline at end of file diff --git a/docs/_steps/saving_workflow_step.md b/docs/_steps/saving_workflow_step.md index 34f02f6a4..4d81f955d 100644 --- a/docs/_steps/saving_workflow_step.md +++ b/docs/_steps/saving_workflow_step.md @@ -11,7 +11,7 @@ After the configuration modal is opened, your app will listen for the `view_subm Within the `save` callback, the `update()` method can be used to save the builder's step configuration by passing in the following arguments: -- `inputs` is an dictionary representing the data your app expects to receive from the user upon workflow step execution. +- `inputs` is a dictionary representing the data your app expects to receive from the user upon workflow step execution. - `outputs` is a list of objects containing data that your app will provide upon the workflow step's completion. Outputs can then be used in subsequent steps of the workflow. - `step_name` overrides the default Step name - `step_image_url` overrides the default Step image @@ -20,6 +20,8 @@ To learn more about how to structure these parameters, [read the documentation]( +
    +Refer to the module documents (common / step-specific) to learn the available arguments. ```python def save(ack, view, update): ack() @@ -53,4 +55,5 @@ ws = WorkflowStep( execute=execute, ) app.step(ws) -``` \ No newline at end of file +``` +
    \ No newline at end of file diff --git a/docs/_tutorials/getting_started.md b/docs/_tutorials/getting_started.md index c71ba9436..97fde25bb 100644 --- a/docs/_tutorials/getting_started.md +++ b/docs/_tutorials/getting_started.md @@ -186,6 +186,8 @@ app = App( ) # Listens to incoming messages that contain "hello" +# To learn available listener arguments, +# visit https://slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html @app.message("hello") def message_hello(message, say): # say() sends a message to the channel where the event was triggered diff --git a/docs/_tutorials/ja_getting_started.md b/docs/_tutorials/ja_getting_started.md index 9feb4375f..6c90c4809 100644 --- a/docs/_tutorials/ja_getting_started.md +++ b/docs/_tutorials/ja_getting_started.md @@ -174,6 +174,8 @@ app = App( ) # 'hello' を含むメッセージをリッスンします +# 指定可能なリスナーのメソッド引数の一覧は以下のモジュールドキュメントを参考にしてください: +# https://slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html @app.message("hello") def message_hello(message, say): # イベントがトリガーされたチャンネルへ say() でメッセージを送信します diff --git a/docs/api-docs/slack_bolt/kwargs_injection/index.html b/docs/api-docs/slack_bolt/kwargs_injection/index.html index 181d66960..e53d92bf2 100644 --- a/docs/api-docs/slack_bolt/kwargs_injection/index.html +++ b/docs/api-docs/slack_bolt/kwargs_injection/index.html @@ -4,7 +4,7 @@ -slack_bolt.kwargs_injection API documentation +slack_bolt.the API documentation diff --git a/docs/assets/style.css b/docs/assets/style.css index 2041edc07..411d3b5ba 100644 --- a/docs/assets/style.css +++ b/docs/assets/style.css @@ -278,6 +278,10 @@ pre tbody td.gl pre { line-height: 1.9em; } +.content .section-wrapper .annotation { + font-size: 0.7em; +} + .content .section-wrapper h3 { grid-area: head; font-size: 1.45em; diff --git a/examples/getting_started/app.py b/examples/getting_started/app.py index e394dd2fa..96944a594 100644 --- a/examples/getting_started/app.py +++ b/examples/getting_started/app.py @@ -8,6 +8,8 @@ ) # Listens to incoming messages that contain "hello" +# To learn available listener method arguments, +# visit https://slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html @app.message("hello") def message_hello(message, say): # say() sends a message to the channel where the event was triggered From 3622b6810fd87a1c69483cfef3c3de2cbb07e084 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 2 Jun 2021 11:01:58 +0900 Subject: [PATCH 192/719] Fix #206 Add error handling to view submission code snippet in docs (#359) --- docs/_basic/ja_listening_modals.md | 10 +++++++--- docs/_basic/listening_modals.md | 9 ++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/docs/_basic/ja_listening_modals.md b/docs/_basic/ja_listening_modals.md index 16935948d..66d6aa020 100644 --- a/docs/_basic/ja_listening_modals.md +++ b/docs/_basic/ja_listening_modals.md @@ -20,7 +20,7 @@ order: 12 ```python # view_submission イベントを処理 @app.view("view_1") -def handle_submission(ack, body, client, view): +def handle_submission(ack, body, client, view, logger): # `block_c`という block_id に `dreamy_input` を持つ input ブロックがある場合 hopes_and_dreams = view["state"]["values"]["block_c"]["dreamy_input"] user = body["user"]["id"] @@ -44,8 +44,12 @@ def handle_submission(ack, body, client, view): except Exception as e: # エラーをハンドリング msg = "There was an error with your submission" - finally: - # ユーザーにメッセージを送信 + + # ユーザーにメッセージを送信 + try: client.chat_postMessage(channel=user, text=msg) + except e: + logger.exception(f"Failed to post a message {e}") + ``` \ No newline at end of file diff --git a/docs/_basic/listening_modals.md b/docs/_basic/listening_modals.md index 855791160..e48e05c24 100644 --- a/docs/_basic/listening_modals.md +++ b/docs/_basic/listening_modals.md @@ -20,7 +20,7 @@ Read more about view submissions in our \ No newline at end of file From e6079cdc8865f28eb06500a3ed2c82de104b55bc Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 3 Jun 2021 16:51:36 +0900 Subject: [PATCH 193/719] Fix #346 Allow unfurl_media / unfurl_links in ack / respond (#363) --- slack_bolt/context/ack/ack.py | 4 ++++ slack_bolt/context/ack/async_ack.py | 4 ++++ slack_bolt/context/ack/internals.py | 6 ++++++ slack_bolt/context/respond/async_respond.py | 4 ++++ slack_bolt/context/respond/internals.py | 6 ++++++ slack_bolt/context/respond/respond.py | 4 ++++ slack_bolt/context/say/async_say.py | 4 ++++ slack_bolt/context/say/say.py | 4 ++++ tests/slack_bolt/context/test_ack.py | 13 +++++++++++++ tests/slack_bolt/context/test_respond.py | 6 ++++++ tests/slack_bolt/context/test_respond_internals.py | 6 ++++++ tests/slack_bolt/context/test_say.py | 7 +++++++ tests/slack_bolt_async/context/test_async_ack.py | 14 ++++++++++++++ .../slack_bolt_async/context/test_async_respond.py | 7 +++++++ tests/slack_bolt_async/context/test_async_say.py | 8 ++++++++ 15 files changed, 97 insertions(+) diff --git a/slack_bolt/context/ack/ack.py b/slack_bolt/context/ack/ack.py index 69cf928cc..5ebc5f5ad 100644 --- a/slack_bolt/context/ack/ack.py +++ b/slack_bolt/context/ack/ack.py @@ -19,6 +19,8 @@ def __call__( text: Union[str, dict] = "", # text: str or whole_response: dict blocks: Optional[Sequence[Union[dict, Block]]] = None, attachments: Optional[Sequence[Union[dict, Attachment]]] = None, + unfurl_links: Optional[bool] = None, + unfurl_media: Optional[bool] = None, response_type: Optional[str] = None, # in_channel / ephemeral # block_suggestion / dialog_suggestion options: Optional[Sequence[Union[dict, Option]]] = None, @@ -33,6 +35,8 @@ def __call__( text_or_whole_response=text, blocks=blocks, attachments=attachments, + unfurl_links=unfurl_links, + unfurl_media=unfurl_media, response_type=response_type, options=options, option_groups=option_groups, diff --git a/slack_bolt/context/ack/async_ack.py b/slack_bolt/context/ack/async_ack.py index 3be06918a..c12e7b6d2 100644 --- a/slack_bolt/context/ack/async_ack.py +++ b/slack_bolt/context/ack/async_ack.py @@ -19,6 +19,8 @@ async def __call__( text: Union[str, dict] = "", # text: str or whole_response: dict blocks: Optional[Sequence[Union[dict, Block]]] = None, attachments: Optional[Sequence[Union[dict, Attachment]]] = None, + unfurl_links: Optional[bool] = None, + unfurl_media: Optional[bool] = None, response_type: Optional[str] = None, # in_channel / ephemeral # block_suggestion / dialog_suggestion options: Optional[Sequence[Union[dict, Option]]] = None, @@ -33,6 +35,8 @@ async def __call__( text_or_whole_response=text, blocks=blocks, attachments=attachments, + unfurl_links=unfurl_links, + unfurl_media=unfurl_media, response_type=response_type, options=options, option_groups=option_groups, diff --git a/slack_bolt/context/ack/internals.py b/slack_bolt/context/ack/internals.py index 8d21b6559..1985e26ca 100644 --- a/slack_bolt/context/ack/internals.py +++ b/slack_bolt/context/ack/internals.py @@ -14,6 +14,8 @@ def _set_response( text_or_whole_response: Union[str, dict] = "", blocks: Optional[Sequence[Union[dict, Block]]] = None, attachments: Optional[Sequence[Union[dict, Attachment]]] = None, + unfurl_links: Optional[bool] = None, + unfurl_media: Optional[bool] = None, response_type: Optional[str] = None, # in_channel / ephemeral # block_suggestion / dialog_suggestion options: Optional[Sequence[Union[dict, Option]]] = None, @@ -28,6 +30,10 @@ def _set_response( body = {"text": text} if response_type: body["response_type"] = response_type + if unfurl_links is not None: + body["unfurl_links"] = unfurl_links + if unfurl_media is not None: + body["unfurl_media"] = unfurl_media if attachments and len(attachments) > 0: body.update( {"text": text, "attachments": convert_to_dict_list(attachments)} diff --git a/slack_bolt/context/respond/async_respond.py b/slack_bolt/context/respond/async_respond.py index 77a4665ac..60e4fe473 100644 --- a/slack_bolt/context/respond/async_respond.py +++ b/slack_bolt/context/respond/async_respond.py @@ -21,6 +21,8 @@ async def __call__( response_type: Optional[str] = None, replace_original: Optional[bool] = None, delete_original: Optional[bool] = None, + unfurl_links: Optional[bool] = None, + unfurl_media: Optional[bool] = None, ) -> WebhookResponse: if self.response_url is not None: client = AsyncWebhookClient(self.response_url) @@ -33,6 +35,8 @@ async def __call__( response_type=response_type, replace_original=replace_original, delete_original=delete_original, + unfurl_links=unfurl_links, + unfurl_media=unfurl_media, ) return await client.send_dict(message) elif isinstance(text_or_whole_response, dict): diff --git a/slack_bolt/context/respond/internals.py b/slack_bolt/context/respond/internals.py index 28cbbbec4..21acfaf43 100644 --- a/slack_bolt/context/respond/internals.py +++ b/slack_bolt/context/respond/internals.py @@ -13,6 +13,8 @@ def _build_message( response_type: Optional[str] = None, replace_original: Optional[bool] = None, delete_original: Optional[bool] = None, + unfurl_links: Optional[bool] = None, + unfurl_media: Optional[bool] = None, ) -> Dict[str, Any]: message = {"text": text} if blocks is not None and len(blocks) > 0: @@ -25,4 +27,8 @@ def _build_message( message["replace_original"] = replace_original if delete_original is not None: message["delete_original"] = delete_original + if unfurl_links is not None: + message["unfurl_links"] = unfurl_links + if unfurl_media is not None: + message["unfurl_media"] = unfurl_media return message diff --git a/slack_bolt/context/respond/respond.py b/slack_bolt/context/respond/respond.py index 09e2727df..21de92263 100644 --- a/slack_bolt/context/respond/respond.py +++ b/slack_bolt/context/respond/respond.py @@ -21,6 +21,8 @@ def __call__( response_type: Optional[str] = None, replace_original: Optional[bool] = None, delete_original: Optional[bool] = None, + unfurl_links: Optional[bool] = None, + unfurl_media: Optional[bool] = None, ) -> WebhookResponse: if self.response_url is not None: client = WebhookClient(self.response_url) @@ -34,6 +36,8 @@ def __call__( response_type=response_type, replace_original=replace_original, delete_original=delete_original, + unfurl_links=unfurl_links, + unfurl_media=unfurl_media, ) return client.send_dict(message) elif isinstance(text_or_whole_response, dict): diff --git a/slack_bolt/context/say/async_say.py b/slack_bolt/context/say/async_say.py index a47838e1b..88afe2533 100644 --- a/slack_bolt/context/say/async_say.py +++ b/slack_bolt/context/say/async_say.py @@ -26,6 +26,8 @@ async def __call__( attachments: Optional[Sequence[Union[Dict, Attachment]]] = None, channel: Optional[str] = None, thread_ts: Optional[str] = None, + unfurl_links: Optional[bool] = None, + unfurl_media: Optional[bool] = None, **kwargs, ) -> AsyncSlackResponse: if _can_say(self, channel): @@ -38,6 +40,8 @@ async def __call__( blocks=blocks, attachments=attachments, thread_ts=thread_ts, + unfurl_links=unfurl_links, + unfurl_media=unfurl_media, **kwargs, ) elif isinstance(text_or_whole_response, dict): diff --git a/slack_bolt/context/say/say.py b/slack_bolt/context/say/say.py index ccf7d6d91..58535da90 100644 --- a/slack_bolt/context/say/say.py +++ b/slack_bolt/context/say/say.py @@ -27,6 +27,8 @@ def __call__( attachments: Optional[Sequence[Union[Dict, Attachment]]] = None, channel: Optional[str] = None, thread_ts: Optional[str] = None, + unfurl_links: Optional[bool] = None, + unfurl_media: Optional[bool] = None, **kwargs, ) -> SlackResponse: if _can_say(self, channel): @@ -39,6 +41,8 @@ def __call__( blocks=blocks, attachments=attachments, thread_ts=thread_ts, + unfurl_links=unfurl_links, + unfurl_media=unfurl_media, **kwargs, ) elif isinstance(text_or_whole_response, dict): diff --git a/tests/slack_bolt/context/test_ack.py b/tests/slack_bolt/context/test_ack.py index e7d7443e9..2ae0b1050 100644 --- a/tests/slack_bolt/context/test_ack.py +++ b/tests/slack_bolt/context/test_ack.py @@ -54,6 +54,19 @@ def test_blocks(self): '{"text": "foo", "blocks": [{"type": "divider"}]}', ) + def test_unfurl_options(self): + ack = Ack() + response: BoltResponse = ack( + text="foo", + blocks=[{"type": "divider"}], + unfurl_links=True, + unfurl_media=True, + ) + assert (response.status, response.body) == ( + 200, + '{"text": "foo", "unfurl_links": true, "unfurl_media": true, "blocks": [{"type": "divider"}]}', + ) + sample_options = [{"text": {"type": "plain_text", "text": "Maru"}, "value": "maru"}] def test_options(self): diff --git a/tests/slack_bolt/context/test_respond.py b/tests/slack_bolt/context/test_respond.py index 1a76e507d..f108664f3 100644 --- a/tests/slack_bolt/context/test_respond.py +++ b/tests/slack_bolt/context/test_respond.py @@ -23,3 +23,9 @@ def test_respond2(self): respond = Respond(response_url=response_url) response = respond({"text": "Hi there!"}) assert response.status_code == 200 + + def test_unfurl_options(self): + response_url = "http://localhost:8888" + respond = Respond(response_url=response_url) + response = respond(text="Hi there!", unfurl_media=True, unfurl_links=True) + assert response.status_code == 200 diff --git a/tests/slack_bolt/context/test_respond_internals.py b/tests/slack_bolt/context/test_respond_internals.py index 173fdf003..facb293da 100644 --- a/tests/slack_bolt/context/test_respond_internals.py +++ b/tests/slack_bolt/context/test_respond_internals.py @@ -43,3 +43,9 @@ def test_build_message_replace_original(self): def test_build_message_delete_original(self): message = _build_message(delete_original=True) assert message is not None + + def test_build_message_unfurl_options(self): + message = _build_message(text="Hi there!", unfurl_links=True, unfurl_media=True) + assert message is not None + assert message.get("unfurl_links") is True + assert message.get("unfurl_media") is True diff --git a/tests/slack_bolt/context/test_say.py b/tests/slack_bolt/context/test_say.py index a28fbbd9d..fae42d1f0 100644 --- a/tests/slack_bolt/context/test_say.py +++ b/tests/slack_bolt/context/test_say.py @@ -26,6 +26,13 @@ def test_say(self): response: SlackResponse = say(text="Hi there!") assert response.status_code == 200 + def test_say_unfurl_options(self): + say = Say(client=self.web_client, channel="C111") + response: SlackResponse = say( + text="Hi there!", unfurl_media=True, unfurl_links=True + ) + assert response.status_code == 200 + def test_say_dict(self): say = Say(client=self.web_client, channel="C111") response: SlackResponse = say({"text": "Hi!"}) diff --git a/tests/slack_bolt_async/context/test_async_ack.py b/tests/slack_bolt_async/context/test_async_ack.py index 6004002dd..e4f498842 100644 --- a/tests/slack_bolt_async/context/test_async_ack.py +++ b/tests/slack_bolt_async/context/test_async_ack.py @@ -22,6 +22,20 @@ async def test_blocks(self): '{"text": "foo", "blocks": [{"type": "divider"}]}', ) + @pytest.mark.asyncio + async def test_unfurl_options(self): + ack = AsyncAck() + response: BoltResponse = await ack( + text="foo", + blocks=[{"type": "divider"}], + unfurl_links=True, + unfurl_media=True, + ) + assert (response.status, response.body) == ( + 200, + '{"text": "foo", "unfurl_links": true, "unfurl_media": true, "blocks": [{"type": "divider"}]}', + ) + sample_attachments = [ { "fallback": "Plain-text summary of the attachment.", diff --git a/tests/slack_bolt_async/context/test_async_respond.py b/tests/slack_bolt_async/context/test_async_respond.py index fb3083132..18ae114e8 100644 --- a/tests/slack_bolt_async/context/test_async_respond.py +++ b/tests/slack_bolt_async/context/test_async_respond.py @@ -31,3 +31,10 @@ async def test_respond2(self): respond = AsyncRespond(response_url=response_url) response = await respond({"text": "Hi there!"}) assert response.status_code == 200 + + @pytest.mark.asyncio + async def test_respond_unfurl_options(self): + response_url = "http://localhost:8888" + respond = AsyncRespond(response_url=response_url) + response = await respond(text="Hi there!", unfurl_media=True, unfurl_links=True) + assert response.status_code == 200 diff --git a/tests/slack_bolt_async/context/test_async_say.py b/tests/slack_bolt_async/context/test_async_say.py index 03a2978ec..77f846154 100644 --- a/tests/slack_bolt_async/context/test_async_say.py +++ b/tests/slack_bolt_async/context/test_async_say.py @@ -32,6 +32,14 @@ async def test_say(self): response: AsyncSlackResponse = await say(text="Hi there!") assert response.status_code == 200 + @pytest.mark.asyncio + async def test_say_unfurl_options(self): + say = AsyncSay(client=self.web_client, channel="C111") + response: AsyncSlackResponse = await say( + text="Hi there!", unfurl_links=True, unfurl_media=True + ) + assert response.status_code == 200 + @pytest.mark.asyncio async def test_say_dict(self): say = AsyncSay(client=self.web_client, channel="C111") From 0b28dfe7ac42c5239bb3e7177991b96d3a9e8195 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 3 Jun 2021 16:55:50 +0900 Subject: [PATCH 194/719] version 1.6.1 --- .../slack_bolt/adapter/aws_lambda/handler.html | 17 ++++++++++++++++- docs/api-docs/slack_bolt/context/ack/ack.html | 8 ++++++++ .../slack_bolt/context/ack/async_ack.html | 8 ++++++++ .../slack_bolt/context/ack/internals.html | 6 ++++++ .../context/respond/async_respond.html | 8 ++++++++ .../slack_bolt/context/respond/internals.html | 6 ++++++ .../slack_bolt/context/respond/respond.html | 8 ++++++++ .../slack_bolt/context/say/async_say.html | 8 ++++++++ docs/api-docs/slack_bolt/context/say/say.html | 8 ++++++++ .../slack_bolt/kwargs_injection/index.html | 2 +- .../slack_bolt/request/async_request.html | 13 ++++++++----- .../api-docs/slack_bolt/request/internals.html | 18 ------------------ docs/api-docs/slack_bolt/request/request.html | 11 ++++++----- docs/api-docs/slack_bolt/version.html | 2 +- scripts/deploy_to_prod_pypi_org.sh | 1 - scripts/deploy_to_test_pypi_org.sh | 1 - slack_bolt/version.py | 2 +- 17 files changed, 93 insertions(+), 34 deletions(-) diff --git a/docs/api-docs/slack_bolt/adapter/aws_lambda/handler.html b/docs/api-docs/slack_bolt/adapter/aws_lambda/handler.html index 848564915..43edffe39 100644 --- a/docs/api-docs/slack_bolt/adapter/aws_lambda/handler.html +++ b/docs/api-docs/slack_bolt/adapter/aws_lambda/handler.html @@ -103,6 +103,12 @@

    Module slack_bolt.adapter.aws_lambda.handler

    def to_bolt_request(event) -> BoltRequest: + """Note that this handler supports only the payload format 2.0. + This means you can use this with HTTP API while REST API is not supported. + + Read https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html + for more details. + """ body = event.get("body", "") if event["isBase64Encoded"]: body = base64.b64decode(body).decode("utf-8") @@ -177,12 +183,21 @@

    Functions

    def to_bolt_request(event) ‑> 
    BoltRequest
    -
    +

    Note that this handler supports only the payload format 2.0. +This means you can use this with HTTP API while REST API is not supported.

    +

    Read https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html +for more details.

    Expand source code
    def to_bolt_request(event) -> BoltRequest:
    +    """Note that this handler supports only the payload format 2.0.
    +    This means you can use this with HTTP API while REST API is not supported.
    +
    +    Read https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
    +    for more details.
    +    """
         body = event.get("body", "")
         if event["isBase64Encoded"]:
             body = base64.b64decode(body).decode("utf-8")
    diff --git a/docs/api-docs/slack_bolt/context/ack/ack.html b/docs/api-docs/slack_bolt/context/ack/ack.html
    index ca8c14b3b..42ea41468 100644
    --- a/docs/api-docs/slack_bolt/context/ack/ack.html
    +++ b/docs/api-docs/slack_bolt/context/ack/ack.html
    @@ -47,6 +47,8 @@ 

    Module slack_bolt.context.ack.ack

    text: Union[str, dict] = "", # text: str or whole_response: dict blocks: Optional[Sequence[Union[dict, Block]]] = None, attachments: Optional[Sequence[Union[dict, Attachment]]] = None, + unfurl_links: Optional[bool] = None, + unfurl_media: Optional[bool] = None, response_type: Optional[str] = None, # in_channel / ephemeral # block_suggestion / dialog_suggestion options: Optional[Sequence[Union[dict, Option]]] = None, @@ -61,6 +63,8 @@

    Module slack_bolt.context.ack.ack

    text_or_whole_response=text, blocks=blocks, attachments=attachments, + unfurl_links=unfurl_links, + unfurl_media=unfurl_media, response_type=response_type, options=options, option_groups=option_groups, @@ -99,6 +103,8 @@

    Classes

    text: Union[str, dict] = "", # text: str or whole_response: dict blocks: Optional[Sequence[Union[dict, Block]]] = None, attachments: Optional[Sequence[Union[dict, Attachment]]] = None, + unfurl_links: Optional[bool] = None, + unfurl_media: Optional[bool] = None, response_type: Optional[str] = None, # in_channel / ephemeral # block_suggestion / dialog_suggestion options: Optional[Sequence[Union[dict, Option]]] = None, @@ -113,6 +119,8 @@

    Classes

    text_or_whole_response=text, blocks=blocks, attachments=attachments, + unfurl_links=unfurl_links, + unfurl_media=unfurl_media, response_type=response_type, options=options, option_groups=option_groups, diff --git a/docs/api-docs/slack_bolt/context/ack/async_ack.html b/docs/api-docs/slack_bolt/context/ack/async_ack.html index 35dc126be..d662cac7f 100644 --- a/docs/api-docs/slack_bolt/context/ack/async_ack.html +++ b/docs/api-docs/slack_bolt/context/ack/async_ack.html @@ -47,6 +47,8 @@

    Module slack_bolt.context.ack.async_ack

    text: Union[str, dict] = "", # text: str or whole_response: dict blocks: Optional[Sequence[Union[dict, Block]]] = None, attachments: Optional[Sequence[Union[dict, Attachment]]] = None, + unfurl_links: Optional[bool] = None, + unfurl_media: Optional[bool] = None, response_type: Optional[str] = None, # in_channel / ephemeral # block_suggestion / dialog_suggestion options: Optional[Sequence[Union[dict, Option]]] = None, @@ -61,6 +63,8 @@

    Module slack_bolt.context.ack.async_ack

    text_or_whole_response=text, blocks=blocks, attachments=attachments, + unfurl_links=unfurl_links, + unfurl_media=unfurl_media, response_type=response_type, options=options, option_groups=option_groups, @@ -99,6 +103,8 @@

    Classes

    text: Union[str, dict] = "", # text: str or whole_response: dict blocks: Optional[Sequence[Union[dict, Block]]] = None, attachments: Optional[Sequence[Union[dict, Attachment]]] = None, + unfurl_links: Optional[bool] = None, + unfurl_media: Optional[bool] = None, response_type: Optional[str] = None, # in_channel / ephemeral # block_suggestion / dialog_suggestion options: Optional[Sequence[Union[dict, Option]]] = None, @@ -113,6 +119,8 @@

    Classes

    text_or_whole_response=text, blocks=blocks, attachments=attachments, + unfurl_links=unfurl_links, + unfurl_media=unfurl_media, response_type=response_type, options=options, option_groups=option_groups, diff --git a/docs/api-docs/slack_bolt/context/ack/internals.html b/docs/api-docs/slack_bolt/context/ack/internals.html index a5a648043..29295bd96 100644 --- a/docs/api-docs/slack_bolt/context/ack/internals.html +++ b/docs/api-docs/slack_bolt/context/ack/internals.html @@ -42,6 +42,8 @@

    Module slack_bolt.context.ack.internals

    text_or_whole_response: Union[str, dict] = "", blocks: Optional[Sequence[Union[dict, Block]]] = None, attachments: Optional[Sequence[Union[dict, Attachment]]] = None, + unfurl_links: Optional[bool] = None, + unfurl_media: Optional[bool] = None, response_type: Optional[str] = None, # in_channel / ephemeral # block_suggestion / dialog_suggestion options: Optional[Sequence[Union[dict, Option]]] = None, @@ -56,6 +58,10 @@

    Module slack_bolt.context.ack.internals

    body = {"text": text} if response_type: body["response_type"] = response_type + if unfurl_links is not None: + body["unfurl_links"] = unfurl_links + if unfurl_media is not None: + body["unfurl_media"] = unfurl_media if attachments and len(attachments) > 0: body.update( {"text": text, "attachments": convert_to_dict_list(attachments)} diff --git a/docs/api-docs/slack_bolt/context/respond/async_respond.html b/docs/api-docs/slack_bolt/context/respond/async_respond.html index 88dd9b64d..8e332b1cd 100644 --- a/docs/api-docs/slack_bolt/context/respond/async_respond.html +++ b/docs/api-docs/slack_bolt/context/respond/async_respond.html @@ -49,6 +49,8 @@

    Module slack_bolt.context.respond.async_respondModule slack_bolt.context.respond.async_respondClasses

    response_type: Optional[str] = None, replace_original: Optional[bool] = None, delete_original: Optional[bool] = None, + unfurl_links: Optional[bool] = None, + unfurl_media: Optional[bool] = None, ) -> WebhookResponse: if self.response_url is not None: client = AsyncWebhookClient(self.response_url) @@ -118,6 +124,8 @@

    Classes

    response_type=response_type, replace_original=replace_original, delete_original=delete_original, + unfurl_links=unfurl_links, + unfurl_media=unfurl_media, ) return await client.send_dict(message) elif isinstance(text_or_whole_response, dict): diff --git a/docs/api-docs/slack_bolt/context/respond/internals.html b/docs/api-docs/slack_bolt/context/respond/internals.html index bf4034832..0442915c2 100644 --- a/docs/api-docs/slack_bolt/context/respond/internals.html +++ b/docs/api-docs/slack_bolt/context/respond/internals.html @@ -41,6 +41,8 @@

    Module slack_bolt.context.respond.internals

    response_type: Optional[str] = None, replace_original: Optional[bool] = None, delete_original: Optional[bool] = None, + unfurl_links: Optional[bool] = None, + unfurl_media: Optional[bool] = None, ) -> Dict[str, Any]: message = {"text": text} if blocks is not None and len(blocks) > 0: @@ -53,6 +55,10 @@

    Module slack_bolt.context.respond.internals

    message["replace_original"] = replace_original if delete_original is not None: message["delete_original"] = delete_original + if unfurl_links is not None: + message["unfurl_links"] = unfurl_links + if unfurl_media is not None: + message["unfurl_media"] = unfurl_media return message
    diff --git a/docs/api-docs/slack_bolt/context/respond/respond.html b/docs/api-docs/slack_bolt/context/respond/respond.html index 7e921f425..54717eeaa 100644 --- a/docs/api-docs/slack_bolt/context/respond/respond.html +++ b/docs/api-docs/slack_bolt/context/respond/respond.html @@ -49,6 +49,8 @@

    Module slack_bolt.context.respond.respond

    response_type: Optional[str] = None, replace_original: Optional[bool] = None, delete_original: Optional[bool] = None, + unfurl_links: Optional[bool] = None, + unfurl_media: Optional[bool] = None, ) -> WebhookResponse: if self.response_url is not None: client = WebhookClient(self.response_url) @@ -62,6 +64,8 @@

    Module slack_bolt.context.respond.respond

    response_type=response_type, replace_original=replace_original, delete_original=delete_original, + unfurl_links=unfurl_links, + unfurl_media=unfurl_media, ) return client.send_dict(message) elif isinstance(text_or_whole_response, dict): @@ -108,6 +112,8 @@

    Classes

    response_type: Optional[str] = None, replace_original: Optional[bool] = None, delete_original: Optional[bool] = None, + unfurl_links: Optional[bool] = None, + unfurl_media: Optional[bool] = None, ) -> WebhookResponse: if self.response_url is not None: client = WebhookClient(self.response_url) @@ -121,6 +127,8 @@

    Classes

    response_type=response_type, replace_original=replace_original, delete_original=delete_original, + unfurl_links=unfurl_links, + unfurl_media=unfurl_media, ) return client.send_dict(message) elif isinstance(text_or_whole_response, dict): diff --git a/docs/api-docs/slack_bolt/context/say/async_say.html b/docs/api-docs/slack_bolt/context/say/async_say.html index 471ed618a..092d6c038 100644 --- a/docs/api-docs/slack_bolt/context/say/async_say.html +++ b/docs/api-docs/slack_bolt/context/say/async_say.html @@ -54,6 +54,8 @@

    Module slack_bolt.context.say.async_say

    attachments: Optional[Sequence[Union[Dict, Attachment]]] = None, channel: Optional[str] = None, thread_ts: Optional[str] = None, + unfurl_links: Optional[bool] = None, + unfurl_media: Optional[bool] = None, **kwargs, ) -> AsyncSlackResponse: if _can_say(self, channel): @@ -66,6 +68,8 @@

    Module slack_bolt.context.say.async_say

    blocks=blocks, attachments=attachments, thread_ts=thread_ts, + unfurl_links=unfurl_links, + unfurl_media=unfurl_media, **kwargs, ) elif isinstance(text_or_whole_response, dict): @@ -119,6 +123,8 @@

    Classes

    attachments: Optional[Sequence[Union[Dict, Attachment]]] = None, channel: Optional[str] = None, thread_ts: Optional[str] = None, + unfurl_links: Optional[bool] = None, + unfurl_media: Optional[bool] = None, **kwargs, ) -> AsyncSlackResponse: if _can_say(self, channel): @@ -131,6 +137,8 @@

    Classes

    blocks=blocks, attachments=attachments, thread_ts=thread_ts, + unfurl_links=unfurl_links, + unfurl_media=unfurl_media, **kwargs, ) elif isinstance(text_or_whole_response, dict): diff --git a/docs/api-docs/slack_bolt/context/say/say.html b/docs/api-docs/slack_bolt/context/say/say.html index ce78149f1..455e945d5 100644 --- a/docs/api-docs/slack_bolt/context/say/say.html +++ b/docs/api-docs/slack_bolt/context/say/say.html @@ -55,6 +55,8 @@

    Module slack_bolt.context.say.say

    attachments: Optional[Sequence[Union[Dict, Attachment]]] = None, channel: Optional[str] = None, thread_ts: Optional[str] = None, + unfurl_links: Optional[bool] = None, + unfurl_media: Optional[bool] = None, **kwargs, ) -> SlackResponse: if _can_say(self, channel): @@ -67,6 +69,8 @@

    Module slack_bolt.context.say.say

    blocks=blocks, attachments=attachments, thread_ts=thread_ts, + unfurl_links=unfurl_links, + unfurl_media=unfurl_media, **kwargs, ) elif isinstance(text_or_whole_response, dict): @@ -120,6 +124,8 @@

    Classes

    attachments: Optional[Sequence[Union[Dict, Attachment]]] = None, channel: Optional[str] = None, thread_ts: Optional[str] = None, + unfurl_links: Optional[bool] = None, + unfurl_media: Optional[bool] = None, **kwargs, ) -> SlackResponse: if _can_say(self, channel): @@ -132,6 +138,8 @@

    Classes

    blocks=blocks, attachments=attachments, thread_ts=thread_ts, + unfurl_links=unfurl_links, + unfurl_media=unfurl_media, **kwargs, ) elif isinstance(text_or_whole_response, dict): diff --git a/docs/api-docs/slack_bolt/kwargs_injection/index.html b/docs/api-docs/slack_bolt/kwargs_injection/index.html index e53d92bf2..181d66960 100644 --- a/docs/api-docs/slack_bolt/kwargs_injection/index.html +++ b/docs/api-docs/slack_bolt/kwargs_injection/index.html @@ -4,7 +4,7 @@ -slack_bolt.the API documentation +slack_bolt.kwargs_injection API documentation diff --git a/docs/api-docs/slack_bolt/request/async_request.html b/docs/api-docs/slack_bolt/request/async_request.html index 97be298e9..63aa9a079 100644 --- a/docs/api-docs/slack_bolt/request/async_request.html +++ b/docs/api-docs/slack_bolt/request/async_request.html @@ -37,7 +37,6 @@

    Module slack_bolt.request.async_request

    build_normalized_headers, extract_content_type, error_message_raw_body_required_in_http_mode, - error_message_unknown_request_body_type, ) @@ -73,7 +72,7 @@

    Module slack_bolt.request.async_request

    if mode == "http": # HTTP Mode - if not isinstance(body, str): + if body is not None and not isinstance(body, str): raise BoltError(error_message_raw_body_required_in_http_mode()) self.raw_body = body if body is not None else "" else: @@ -88,12 +87,14 @@

    Module slack_bolt.request.async_request

    self.query = parse_query(query) self.headers = build_normalized_headers(headers) self.content_type = extract_content_type(self.headers) + if isinstance(body, str): self.body = parse_body(self.raw_body, self.content_type) elif isinstance(body, dict): self.body = body else: - raise BoltError(error_message_unknown_request_body_type()) + self.body = {} + self.context = build_async_context( AsyncBoltContext(context if context else {}), self.body ) @@ -168,7 +169,7 @@

    Args

    if mode == "http": # HTTP Mode - if not isinstance(body, str): + if body is not None and not isinstance(body, str): raise BoltError(error_message_raw_body_required_in_http_mode()) self.raw_body = body if body is not None else "" else: @@ -183,12 +184,14 @@

    Args

    self.query = parse_query(query) self.headers = build_normalized_headers(headers) self.content_type = extract_content_type(self.headers) + if isinstance(body, str): self.body = parse_body(self.raw_body, self.content_type) elif isinstance(body, dict): self.body = body else: - raise BoltError(error_message_unknown_request_body_type()) + self.body = {} + self.context = build_async_context( AsyncBoltContext(context if context else {}), self.body ) diff --git a/docs/api-docs/slack_bolt/request/internals.html b/docs/api-docs/slack_bolt/request/internals.html index c65edf9d3..e74c966a6 100644 --- a/docs/api-docs/slack_bolt/request/internals.html +++ b/docs/api-docs/slack_bolt/request/internals.html @@ -211,10 +211,6 @@

    Module slack_bolt.request.internals

    return "`body` must be a raw string data when running in the HTTP server mode" -def error_message_unknown_request_body_type() -> str: - return "`body` must be either str or dict" - - def debug_multiple_response_urls_detected() -> str: return ( "`response_urls` in the body has multiple URLs in it. " @@ -323,19 +319,6 @@

    Functions

    return "`body` must be a raw string data when running in the HTTP server mode"
    -
    -def error_message_unknown_request_body_type() ‑> str -
    -
    -
    -
    - -Expand source code - -
    def error_message_unknown_request_body_type() -> str:
    -    return "`body` must be either str or dict"
    -
    -
    def extract_channel_id(payload: Dict[str, Any]) ‑> Optional[str]
    @@ -559,7 +542,6 @@

    Index

  • build_normalized_headers
  • debug_multiple_response_urls_detected
  • error_message_raw_body_required_in_http_mode
  • -
  • error_message_unknown_request_body_type
  • extract_channel_id
  • extract_content_type
  • extract_enterprise_id
  • diff --git a/docs/api-docs/slack_bolt/request/request.html b/docs/api-docs/slack_bolt/request/request.html index ce8fd5b42..10ddce01d 100644 --- a/docs/api-docs/slack_bolt/request/request.html +++ b/docs/api-docs/slack_bolt/request/request.html @@ -37,7 +37,6 @@

    Module slack_bolt.request.request

    build_context, extract_content_type, error_message_raw_body_required_in_http_mode, - error_message_unknown_request_body_type, ) @@ -72,7 +71,7 @@

    Module slack_bolt.request.request

    """ if mode == "http": # HTTP Mode - if not isinstance(body, str): + if body is not None and not isinstance(body, str): raise BoltError(error_message_raw_body_required_in_http_mode()) self.raw_body = body if body is not None else "" else: @@ -87,12 +86,13 @@

    Module slack_bolt.request.request

    self.query = parse_query(query) self.headers = build_normalized_headers(headers) self.content_type = extract_content_type(self.headers) + if isinstance(body, str): self.body = parse_body(self.raw_body, self.content_type) elif isinstance(body, dict): self.body = body else: - raise BoltError(error_message_unknown_request_body_type()) + self.body = {} self.context = build_context(BoltContext(context if context else {}), self.body) self.lazy_only = bool(self.headers.get("x-slack-bolt-lazy-only", [False])[0]) @@ -165,7 +165,7 @@

    Args

    """ if mode == "http": # HTTP Mode - if not isinstance(body, str): + if body is not None and not isinstance(body, str): raise BoltError(error_message_raw_body_required_in_http_mode()) self.raw_body = body if body is not None else "" else: @@ -180,12 +180,13 @@

    Args

    self.query = parse_query(query) self.headers = build_normalized_headers(headers) self.content_type = extract_content_type(self.headers) + if isinstance(body, str): self.body = parse_body(self.raw_body, self.content_type) elif isinstance(body, dict): self.body = body else: - raise BoltError(error_message_unknown_request_body_type()) + self.body = {} self.context = build_context(BoltContext(context if context else {}), self.body) self.lazy_only = bool(self.headers.get("x-slack-bolt-lazy-only", [False])[0]) diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index 274497ee7..c2b60cf6b 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.6.0"
    +__version__ = "1.6.1"
    diff --git a/scripts/deploy_to_prod_pypi_org.sh b/scripts/deploy_to_prod_pypi_org.sh index 24c09850f..5ac4c9907 100755 --- a/scripts/deploy_to_prod_pypi_org.sh +++ b/scripts/deploy_to_prod_pypi_org.sh @@ -5,7 +5,6 @@ cd ${script_dir}/.. rm -rf ./slack_bolt.egg-info pip install -U pip && \ - python setup.py test && \ pip install twine wheel && \ rm -rf dist/ build/ slack_bolt.egg-info/ && \ python setup.py sdist bdist_wheel && \ diff --git a/scripts/deploy_to_test_pypi_org.sh b/scripts/deploy_to_test_pypi_org.sh index 30bf560f4..8419aa7d5 100755 --- a/scripts/deploy_to_test_pypi_org.sh +++ b/scripts/deploy_to_test_pypi_org.sh @@ -5,7 +5,6 @@ cd ${script_dir}/.. rm -rf ./slack_bolt.egg-info pip install -U pip && \ - python setup.py test && \ pip install twine wheel && \ rm -rf dist/ build/ slack_bolt.egg-info/ && \ python setup.py sdist bdist_wheel && \ diff --git a/slack_bolt/version.py b/slack_bolt/version.py index dfa62616b..5494d958b 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.6.0" +__version__ = "1.6.1" From 0b16f56f1a1a326626c1e1fd3430dd91488280d4 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 5 Jun 2021 07:11:22 +0900 Subject: [PATCH 195/719] Update websocket_client (optional dep) version to v1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fc6c4f5d5..01e0867c6 100755 --- a/setup.py +++ b/setup.py @@ -80,7 +80,7 @@ "uvicorn<1", "gunicorn>=20,<21", # Socket Mode 3rd party implementation - "websocket_client>=0.57,<1", + "websocket_client>=1,<2", ], # pip install -e ".[testing]" "testing": test_dependencies, From 0927de45b265bc4d16570ceb6a23cb5dd0a21317 Mon Sep 17 00:00:00 2001 From: Bhavya Agarwal Date: Wed, 9 Jun 2021 21:57:24 -0700 Subject: [PATCH 196/719] Update install page to avoid favicon downloads (#375) * Update internals.py * Updating content length in tests Updating content length in tests to match the new length due to added tag. --- slack_bolt/oauth/internals.py | 1 + tests/adapter_tests_async/test_async_fastapi.py | 2 +- tests/adapter_tests_async/test_async_sanic.py | 2 +- tests/adapter_tests_async/test_async_starlette.py | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/slack_bolt/oauth/internals.py b/slack_bolt/oauth/internals.py index 39fcd9fcf..87f4e167b 100644 --- a/slack_bolt/oauth/internals.py +++ b/slack_bolt/oauth/internals.py @@ -74,6 +74,7 @@ def _build_callback_failure_response( # type: ignore def _build_default_install_page_html(url: str) -> str: return f""" + - - - - - - -
    -
    -
    -

    Module slack_bolt.listener.async_internals

    -
    -
    -
    - -Expand source code - -
    from logging import Logger
    -from typing import Dict, Any, Optional
    -
    -from slack_bolt.request.async_request import AsyncBoltRequest
    -from slack_bolt.request.payload_utils import (
    -    to_options,
    -    to_shortcut,
    -    to_action,
    -    to_view,
    -    to_command,
    -    to_event,
    -    to_message,
    -    to_step,
    -)
    -from slack_bolt.response import BoltResponse
    -
    -
    -def _build_all_available_args(
    -    logger: Logger,
    -    request: AsyncBoltRequest,
    -    response: Optional[BoltResponse],
    -    error: Optional[Exception] = None,
    -) -> Dict[str, Any]:
    -    all_available_args = {
    -        "logger": logger,
    -        "error": error,
    -        "client": request.context.client,
    -        "req": request,
    -        "request": request,
    -        "resp": response,
    -        "response": response,
    -        "context": request.context,
    -        # payload
    -        "body": request.body,
    -        "options": to_options(request.body),
    -        "shortcut": to_shortcut(request.body),
    -        "action": to_action(request.body),
    -        "view": to_view(request.body),
    -        "command": to_command(request.body),
    -        "event": to_event(request.body),
    -        "message": to_message(request.body),
    -        "step": to_step(request.body),
    -        # utilities
    -        "say": request.context.say,
    -        "respond": request.context.respond,
    -    }
    -    all_available_args["payload"] = (
    -        all_available_args["options"]
    -        or all_available_args["shortcut"]
    -        or all_available_args["action"]
    -        or all_available_args["view"]
    -        or all_available_args["command"]
    -        or all_available_args["event"]
    -        or all_available_args["message"]
    -        or all_available_args["step"]
    -        or request.body
    -    )
    -    return all_available_args
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    - - - \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/async_listener_completion_handler.html b/docs/api-docs/slack_bolt/listener/async_listener_completion_handler.html index 3ec3f124a..7152f6e44 100644 --- a/docs/api-docs/slack_bolt/listener/async_listener_completion_handler.html +++ b/docs/api-docs/slack_bolt/listener/async_listener_completion_handler.html @@ -31,13 +31,7 @@

    Module slack_bolt.listener.async_listener_completion_han from logging import Logger from typing import Callable, Dict, Any, Awaitable, Optional -from slack_bolt.listener.async_internals import ( - _build_all_available_args, -) -from slack_bolt.listener.internals import ( - _convert_all_available_args_to_kwargs, -) - +from slack_bolt.kwargs_injection.async_utils import build_async_required_kwargs from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse @@ -70,15 +64,12 @@

    Module slack_bolt.listener.async_listener_completion_han request: AsyncBoltRequest, response: Optional[BoltResponse], ) -> None: - all_available_args = _build_all_available_args( + kwargs: Dict[str, Any] = build_async_required_kwargs( + required_arg_names=self.arg_names, logger=self.logger, request=request, response=response, - ) - kwargs: Dict[str, Any] = _convert_all_available_args_to_kwargs( - all_available_args=all_available_args, - arg_names=self.arg_names, - logger=self.logger, + next_keys_required=False, ) await self.func(**kwargs) @@ -125,15 +116,12 @@

    Classes

    request: AsyncBoltRequest, response: Optional[BoltResponse], ) -> None: - all_available_args = _build_all_available_args( + kwargs: Dict[str, Any] = build_async_required_kwargs( + required_arg_names=self.arg_names, logger=self.logger, request=request, response=response, - ) - kwargs: Dict[str, Any] = _convert_all_available_args_to_kwargs( - all_available_args=all_available_args, - arg_names=self.arg_names, - logger=self.logger, + next_keys_required=False, ) await self.func(**kwargs)
    diff --git a/docs/api-docs/slack_bolt/listener/async_listener_error_handler.html b/docs/api-docs/slack_bolt/listener/async_listener_error_handler.html index 5d1b73662..26e30d4fd 100644 --- a/docs/api-docs/slack_bolt/listener/async_listener_error_handler.html +++ b/docs/api-docs/slack_bolt/listener/async_listener_error_handler.html @@ -31,13 +31,7 @@

    Module slack_bolt.listener.async_listener_error_handler< from logging import Logger from typing import Callable, Dict, Any, Awaitable, Optional -from slack_bolt.listener.async_internals import ( - _build_all_available_args, -) -from slack_bolt.listener.internals import ( - _convert_all_available_args_to_kwargs, -) - +from slack_bolt.kwargs_injection.async_utils import build_async_required_kwargs from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse @@ -74,16 +68,13 @@

    Module slack_bolt.listener.async_listener_error_handler< request: AsyncBoltRequest, response: Optional[BoltResponse], ) -> None: - all_available_args = _build_all_available_args( + kwargs: Dict[str, Any] = build_async_required_kwargs( + required_arg_names=self.arg_names, logger=self.logger, error=error, request=request, response=response, - ) - kwargs: Dict[str, Any] = _convert_all_available_args_to_kwargs( - all_available_args=all_available_args, - arg_names=self.arg_names, - logger=self.logger, + next_keys_required=False, ) returned_response = await self.func(**kwargs) if returned_response is not None and isinstance( @@ -141,16 +132,13 @@

    Classes

    request: AsyncBoltRequest, response: Optional[BoltResponse], ) -> None: - all_available_args = _build_all_available_args( + kwargs: Dict[str, Any] = build_async_required_kwargs( + required_arg_names=self.arg_names, logger=self.logger, error=error, request=request, response=response, - ) - kwargs: Dict[str, Any] = _convert_all_available_args_to_kwargs( - all_available_args=all_available_args, - arg_names=self.arg_names, - logger=self.logger, + next_keys_required=False, ) returned_response = await self.func(**kwargs) if returned_response is not None and isinstance( diff --git a/docs/api-docs/slack_bolt/listener/index.html b/docs/api-docs/slack_bolt/listener/index.html index 0c6b922c1..3b639d9b3 100644 --- a/docs/api-docs/slack_bolt/listener/index.html +++ b/docs/api-docs/slack_bolt/listener/index.html @@ -53,10 +53,6 @@

    Sub-modules

    -
    slack_bolt.listener.async_internals
    -
    -
    -
    slack_bolt.listener.async_listener
    @@ -81,10 +77,6 @@

    Sub-modules

    -
    slack_bolt.listener.internals
    -
    -
    -
    slack_bolt.listener.listener
    @@ -124,14 +116,12 @@

    Index

  • Sub-modules

    • slack_bolt.listener.async_builtins
    • -
    • slack_bolt.listener.async_internals
    • slack_bolt.listener.async_listener
    • slack_bolt.listener.async_listener_completion_handler
    • slack_bolt.listener.async_listener_error_handler
    • slack_bolt.listener.asyncio_runner
    • slack_bolt.listener.builtins
    • slack_bolt.listener.custom_listener
    • -
    • slack_bolt.listener.internals
    • slack_bolt.listener.listener
    • slack_bolt.listener.listener_completion_handler
    • slack_bolt.listener.listener_error_handler
    • diff --git a/docs/api-docs/slack_bolt/listener/internals.html b/docs/api-docs/slack_bolt/listener/internals.html deleted file mode 100644 index c2104f104..000000000 --- a/docs/api-docs/slack_bolt/listener/internals.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - -slack_bolt.listener.internals API documentation - - - - - - - - - - - -
      -
      -
      -

      Module slack_bolt.listener.internals

      -
      -
      -
      - -Expand source code - -
      from logging import Logger
      -from typing import Optional, Dict, Any, List
      -
      -from slack_bolt.request.request import BoltRequest
      -from slack_bolt.response.response import BoltResponse
      -
      -from slack_bolt.request.payload_utils import (
      -    to_options,
      -    to_shortcut,
      -    to_action,
      -    to_view,
      -    to_command,
      -    to_event,
      -    to_message,
      -    to_step,
      -)
      -
      -
      -def _build_all_available_args(
      -    logger: Logger,
      -    request: BoltRequest,
      -    response: Optional[BoltResponse],
      -    error: Optional[Exception] = None,
      -) -> Dict[str, Any]:
      -    all_available_args = {
      -        "logger": logger,
      -        "error": error,
      -        "client": request.context.client,
      -        "req": request,
      -        "request": request,
      -        "resp": response,
      -        "response": response,
      -        "context": request.context,
      -        # payload
      -        "body": request.body,
      -        "options": to_options(request.body),
      -        "shortcut": to_shortcut(request.body),
      -        "action": to_action(request.body),
      -        "view": to_view(request.body),
      -        "command": to_command(request.body),
      -        "event": to_event(request.body),
      -        "message": to_message(request.body),
      -        "step": to_step(request.body),
      -        # utilities
      -        "say": request.context.say,
      -        "respond": request.context.respond,
      -    }
      -    all_available_args["payload"] = (
      -        all_available_args["options"]
      -        or all_available_args["shortcut"]
      -        or all_available_args["action"]
      -        or all_available_args["view"]
      -        or all_available_args["command"]
      -        or all_available_args["event"]
      -        or all_available_args["message"]
      -        or all_available_args["step"]
      -        or request.body
      -    )
      -    return all_available_args
      -
      -
      -def _convert_all_available_args_to_kwargs(
      -    all_available_args: Dict[str, Any],
      -    arg_names: List[str],
      -    logger: Logger,
      -) -> Dict[str, Any]:
      -    kwargs: Dict[str, Any] = {  # type: ignore
      -        k: v for k, v in all_available_args.items() if k in arg_names  # type: ignore
      -    }
      -    found_arg_names = kwargs.keys()
      -    for name in arg_names:
      -        if name not in found_arg_names:
      -            logger.warning(f"{name} is not a valid argument")
      -            kwargs[name] = None
      -    return kwargs
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      - -
      - - - \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/listener.html b/docs/api-docs/slack_bolt/listener/listener.html index e9ebd3e61..1b27ecfe3 100644 --- a/docs/api-docs/slack_bolt/listener/listener.html +++ b/docs/api-docs/slack_bolt/listener/listener.html @@ -73,10 +73,10 @@

      Module slack_bolt.listener.listener

      for m in self.middleware: middleware_state = {"next_called": False} - def next(): + def next_(): middleware_state["next_called"] = True - resp = m.process(req=req, resp=resp, next=next) + resp = m.process(req=req, resp=resp, next=next_) if not middleware_state["next_called"]: # next() was not called in this middleware return (resp, True) @@ -154,10 +154,10 @@

      Classes

      for m in self.middleware: middleware_state = {"next_called": False} - def next(): + def next_(): middleware_state["next_called"] = True - resp = m.process(req=req, resp=resp, next=next) + resp = m.process(req=req, resp=resp, next=next_) if not middleware_state["next_called"]: # next() was not called in this middleware return (resp, True) @@ -300,10 +300,10 @@

      Returns

      for m in self.middleware: middleware_state = {"next_called": False} - def next(): + def next_(): middleware_state["next_called"] = True - resp = m.process(req=req, resp=resp, next=next) + resp = m.process(req=req, resp=resp, next=next_) if not middleware_state["next_called"]: # next() was not called in this middleware return (resp, True) diff --git a/docs/api-docs/slack_bolt/listener/listener_completion_handler.html b/docs/api-docs/slack_bolt/listener/listener_completion_handler.html index c4a976548..bac54d8dd 100644 --- a/docs/api-docs/slack_bolt/listener/listener_completion_handler.html +++ b/docs/api-docs/slack_bolt/listener/listener_completion_handler.html @@ -31,10 +31,7 @@

      Module slack_bolt.listener.listener_completion_handlerModule slack_bolt.listener.listener_completion_handlerClasses

      request: BoltRequest, response: Optional[BoltResponse], ): - all_available_args = _build_all_available_args( + kwargs: Dict[str, Any] = build_required_kwargs( + required_arg_names=self.arg_names, logger=self.logger, request=request, response=response, - ) - kwargs: Dict[str, Any] = _convert_all_available_args_to_kwargs( - all_available_args=all_available_args, - arg_names=self.arg_names, - logger=self.logger, + next_keys_required=False, ) self.func(**kwargs) diff --git a/docs/api-docs/slack_bolt/listener/listener_error_handler.html b/docs/api-docs/slack_bolt/listener/listener_error_handler.html index 675de1360..c43127b7f 100644 --- a/docs/api-docs/slack_bolt/listener/listener_error_handler.html +++ b/docs/api-docs/slack_bolt/listener/listener_error_handler.html @@ -31,11 +31,7 @@

      Module slack_bolt.listener.listener_error_handler from logging import Logger from typing import Callable, Dict, Any, Optional -from slack_bolt.listener.internals import ( - _build_all_available_args, - _convert_all_available_args_to_kwargs, -) - +from slack_bolt.kwargs_injection import build_required_kwargs from slack_bolt.request.request import BoltRequest from slack_bolt.response.response import BoltResponse @@ -70,16 +66,13 @@

      Module slack_bolt.listener.listener_error_handler request: BoltRequest, response: Optional[BoltResponse], ): - all_available_args = _build_all_available_args( + kwargs: Dict[str, Any] = build_required_kwargs( + required_arg_names=self.arg_names, logger=self.logger, error=error, request=request, response=response, - ) - kwargs: Dict[str, Any] = _convert_all_available_args_to_kwargs( - all_available_args=all_available_args, - arg_names=self.arg_names, - logger=self.logger, + next_keys_required=False, ) returned_response = self.func(**kwargs) if returned_response is not None and isinstance( @@ -135,16 +128,13 @@

      Classes

      request: BoltRequest, response: Optional[BoltResponse], ): - all_available_args = _build_all_available_args( + kwargs: Dict[str, Any] = build_required_kwargs( + required_arg_names=self.arg_names, logger=self.logger, error=error, request=request, response=response, - ) - kwargs: Dict[str, Any] = _convert_all_available_args_to_kwargs( - all_available_args=all_available_args, - arg_names=self.arg_names, - logger=self.logger, + next_keys_required=False, ) returned_response = self.func(**kwargs) if returned_response is not None and isinstance( diff --git a/docs/api-docs/slack_bolt/logger/messages.html b/docs/api-docs/slack_bolt/logger/messages.html index 02976d2a1..a8897a065 100644 --- a/docs/api-docs/slack_bolt/logger/messages.html +++ b/docs/api-docs/slack_bolt/logger/messages.html @@ -127,7 +127,7 @@

      Module slack_bolt.logger.messages

      name: str, req: Union[BoltRequest, "AsyncBoltRequest"] # type: ignore ) -> str: # type: ignore return ( - f"A global middleware ({name}) skipped calling `next()` " + f"A global middleware ({name}) skipped calling either `next()` or `next_()` " f"without providing a response for the request ({req.body})" ) @@ -210,6 +210,7 @@

      Module slack_bolt.logger.messages

      ) -> str: # type: ignore filtered_body = _build_filtered_body(req.body) default_message = f"Unhandled request ({filtered_body})" + is_async = type(req) != BoltRequest if ( is_workflow_step_edit(req.body) or is_workflow_step_save(req.body) @@ -224,8 +225,8 @@

      Module slack_bolt.logger.messages

      return _build_unhandled_request_suggestion( default_message, f""" -from slack_bolt.workflows.step import WorkflowStep -ws = WorkflowStep( +from slack_bolt.workflows.step{'.async_step' if is_async else ''} import {'Async' if is_async else ''}WorkflowStep +ws = {'Async' if is_async else ''}WorkflowStep( callback_id="{callback_id}", edit=edit, save=save, @@ -244,8 +245,8 @@

      Module slack_bolt.logger.messages

      default_message, f""" @app.action("{action_id_or_callback_id}") -def handle_some_action(ack, body, logger): - ack() +{'async ' if is_async else ''}def handle_some_action(ack, body, logger): + {'await ' if is_async else ''}ack() logger.info(body) """, ) @@ -260,8 +261,8 @@

      Module slack_bolt.logger.messages

      default_message, f""" @app.options({constraints}) -def handle_some_options(ack): - ack(options=[ ... ]) +{'async ' if is_async else ''}def handle_some_options(ack): + {'await ' if is_async else ''}ack(options=[ ... ]) """, ) if is_shortcut(req.body): @@ -271,8 +272,8 @@

      Module slack_bolt.logger.messages

      default_message, f""" @app.shortcut("{id}") -def handle_shortcuts(ack, body, logger): - ack() +{'async ' if is_async else ''}def handle_shortcuts(ack, body, logger): + {'await ' if is_async else ''}ack() logger.info(body) """, ) @@ -282,8 +283,8 @@

      Module slack_bolt.logger.messages

      default_message, f""" @app.view("{req.body.get('view', {}).get('callback_id', 'modal-view-id')}") -def handle_view_events(ack, body, logger): - ack() +{'async ' if is_async else ''}def handle_view_events(ack, body, logger): + {'await ' if is_async else ''}ack() logger.info(body) """, ) @@ -294,7 +295,7 @@

      Module slack_bolt.logger.messages

      default_message, f""" @app.event("{event_type}") -def handle_{event_type}_events(body, logger): +{'async ' if is_async else ''}def handle_{event_type}_events(body, logger): logger.info(body) """, ) @@ -305,8 +306,8 @@

      Module slack_bolt.logger.messages

      default_message, f""" @app.command("{command}") -def handle_some_command(ack, body, logger): - ack() +{'async ' if is_async else ''}def handle_some_command(ack, body, logger): + {'await ' if is_async else ''}ack() logger.info(body) """, ) @@ -738,7 +739,7 @@

      Functions

      name: str, req: Union[BoltRequest, "AsyncBoltRequest"] # type: ignore ) -> str: # type: ignore return ( - f"A global middleware ({name}) skipped calling `next()` " + f"A global middleware ({name}) skipped calling either `next()` or `next_()` " f"without providing a response for the request ({req.body})" )
      @@ -757,6 +758,7 @@

      Functions

      ) -> str: # type: ignore filtered_body = _build_filtered_body(req.body) default_message = f"Unhandled request ({filtered_body})" + is_async = type(req) != BoltRequest if ( is_workflow_step_edit(req.body) or is_workflow_step_save(req.body) @@ -771,8 +773,8 @@

      Functions

      return _build_unhandled_request_suggestion( default_message, f""" -from slack_bolt.workflows.step import WorkflowStep -ws = WorkflowStep( +from slack_bolt.workflows.step{'.async_step' if is_async else ''} import {'Async' if is_async else ''}WorkflowStep +ws = {'Async' if is_async else ''}WorkflowStep( callback_id="{callback_id}", edit=edit, save=save, @@ -791,8 +793,8 @@

      Functions

      default_message, f""" @app.action("{action_id_or_callback_id}") -def handle_some_action(ack, body, logger): - ack() +{'async ' if is_async else ''}def handle_some_action(ack, body, logger): + {'await ' if is_async else ''}ack() logger.info(body) """, ) @@ -807,8 +809,8 @@

      Functions

      default_message, f""" @app.options({constraints}) -def handle_some_options(ack): - ack(options=[ ... ]) +{'async ' if is_async else ''}def handle_some_options(ack): + {'await ' if is_async else ''}ack(options=[ ... ]) """, ) if is_shortcut(req.body): @@ -818,8 +820,8 @@

      Functions

      default_message, f""" @app.shortcut("{id}") -def handle_shortcuts(ack, body, logger): - ack() +{'async ' if is_async else ''}def handle_shortcuts(ack, body, logger): + {'await ' if is_async else ''}ack() logger.info(body) """, ) @@ -829,8 +831,8 @@

      Functions

      default_message, f""" @app.view("{req.body.get('view', {}).get('callback_id', 'modal-view-id')}") -def handle_view_events(ack, body, logger): - ack() +{'async ' if is_async else ''}def handle_view_events(ack, body, logger): + {'await ' if is_async else ''}ack() logger.info(body) """, ) @@ -841,7 +843,7 @@

      Functions

      default_message, f""" @app.event("{event_type}") -def handle_{event_type}_events(body, logger): +{'async ' if is_async else ''}def handle_{event_type}_events(body, logger): logger.info(body) """, ) @@ -852,8 +854,8 @@

      Functions

      default_message, f""" @app.command("{command}") -def handle_some_command(ack, body, logger): - ack() +{'async ' if is_async else ''}def handle_some_command(ack, body, logger): + {'await ' if is_async else ''}ack() logger.info(body) """, ) diff --git a/docs/api-docs/slack_bolt/middleware/async_custom_middleware.html b/docs/api-docs/slack_bolt/middleware/async_custom_middleware.html index 8819f3f7f..88fd3dab0 100644 --- a/docs/api-docs/slack_bolt/middleware/async_custom_middleware.html +++ b/docs/api-docs/slack_bolt/middleware/async_custom_middleware.html @@ -59,6 +59,9 @@

      Module slack_bolt.middleware.async_custom_middlewareClasses

      *, req: AsyncBoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], Awaitable[BoltResponse]], ) -> BoltResponse: return await self.func( diff --git a/docs/api-docs/slack_bolt/middleware/async_middleware.html b/docs/api-docs/slack_bolt/middleware/async_middleware.html index 6bca6bb5d..d7edd2ceb 100644 --- a/docs/api-docs/slack_bolt/middleware/async_middleware.html +++ b/docs/api-docs/slack_bolt/middleware/async_middleware.html @@ -42,6 +42,9 @@

      Module slack_bolt.middleware.async_middleware

      Module slack_bolt.middleware.async_middleware
  • Classes

    *, req: AsyncBoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], Awaitable[BoltResponse]], ) -> Optional[BoltResponse]: """Processes a request data before other middleware and listeners. @@ -105,6 +119,14 @@

    Classes

    # do something here await next() + This `async_process(req, resp, next)` method is supposed to be invoked only inside bolt-python. + If you want to avoid the name `next()` in your middleware functions, you can use `next_()` method instead. + + @app.middleware + async def simple_middleware(req, resp, next_): + # do something here + await next_() + Args: req: The incoming request resp: The response @@ -160,6 +182,13 @@

    Methods

    # do something here await next()
    +

    This async_process(req, resp, next) method is supposed to be invoked only inside bolt-python. +If you want to avoid the name next() in your middleware functions, you can use next_() method instead.

    +
    @app.middleware
    +async def simple_middleware(req, resp, next_):
    +    # do something here
    +    await next_()
    +

    Args

    req
    @@ -181,6 +210,9 @@

    Returns

    *, req: AsyncBoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], Awaitable[BoltResponse]], ) -> Optional[BoltResponse]: """Processes a request data before other middleware and listeners. @@ -191,6 +223,14 @@

    Returns

    # do something here await next() + This `async_process(req, resp, next)` method is supposed to be invoked only inside bolt-python. + If you want to avoid the name `next()` in your middleware functions, you can use `next_()` method instead. + + @app.middleware + async def simple_middleware(req, resp, next_): + # do something here + await next_() + Args: req: The incoming request resp: The response diff --git a/docs/api-docs/slack_bolt/middleware/async_middleware_error_handler.html b/docs/api-docs/slack_bolt/middleware/async_middleware_error_handler.html new file mode 100644 index 000000000..9738cc16e --- /dev/null +++ b/docs/api-docs/slack_bolt/middleware/async_middleware_error_handler.html @@ -0,0 +1,307 @@ + + + + + + +slack_bolt.middleware.async_middleware_error_handler API documentation + + + + + + + + + + + +
    +
    +
    +

    Module slack_bolt.middleware.async_middleware_error_handler

    +
    +
    +
    + +Expand source code + +
    import inspect
    +from abc import ABCMeta, abstractmethod
    +from logging import Logger
    +from typing import Callable, Dict, Any, Awaitable, Optional
    +
    +from slack_bolt.kwargs_injection.async_utils import build_async_required_kwargs
    +from slack_bolt.request.async_request import AsyncBoltRequest
    +from slack_bolt.response import BoltResponse
    +
    +
    +class AsyncMiddlewareErrorHandler(metaclass=ABCMeta):
    +    @abstractmethod
    +    async def handle(
    +        self,
    +        error: Exception,
    +        request: AsyncBoltRequest,
    +        response: Optional[BoltResponse],
    +    ) -> None:
    +        """Handles an unhandled exception.
    +
    +        Args:
    +            error: The raised exception.
    +            request: The request.
    +            response: The response.
    +        """
    +        raise NotImplementedError()
    +
    +
    +class AsyncCustomMiddlewareErrorHandler(AsyncMiddlewareErrorHandler):
    +    def __init__(
    +        self, logger: Logger, func: Callable[..., Awaitable[Optional[BoltResponse]]]
    +    ):
    +        self.func = func
    +        self.logger = logger
    +        self.arg_names = inspect.getfullargspec(func).args
    +
    +    async def handle(
    +        self,
    +        error: Exception,
    +        request: AsyncBoltRequest,
    +        response: Optional[BoltResponse],
    +    ) -> None:
    +        kwargs: Dict[str, Any] = build_async_required_kwargs(
    +            required_arg_names=self.arg_names,
    +            logger=self.logger,
    +            error=error,
    +            request=request,
    +            response=response,
    +            next_keys_required=False,
    +        )
    +        returned_response = await self.func(**kwargs)
    +        if returned_response is not None and isinstance(
    +            returned_response, BoltResponse
    +        ):
    +            response.status = returned_response.status
    +            response.headers = returned_response.headers
    +            response.body = returned_response.body
    +
    +
    +class AsyncDefaultMiddlewareErrorHandler(AsyncMiddlewareErrorHandler):
    +    def __init__(self, logger: Logger):
    +        self.logger = logger
    +
    +    async def handle(
    +        self,
    +        error: Exception,
    +        request: AsyncBoltRequest,
    +        response: Optional[BoltResponse],
    +    ):
    +        message = f"Failed to run a middleware function (error: {error})"
    +        self.logger.exception(message)
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Classes

    +
    +
    +class AsyncCustomMiddlewareErrorHandler +(logger: logging.Logger, func: Callable[..., Awaitable[Optional[BoltResponse]]]) +
    +
    +
    +
    + +Expand source code + +
    class AsyncCustomMiddlewareErrorHandler(AsyncMiddlewareErrorHandler):
    +    def __init__(
    +        self, logger: Logger, func: Callable[..., Awaitable[Optional[BoltResponse]]]
    +    ):
    +        self.func = func
    +        self.logger = logger
    +        self.arg_names = inspect.getfullargspec(func).args
    +
    +    async def handle(
    +        self,
    +        error: Exception,
    +        request: AsyncBoltRequest,
    +        response: Optional[BoltResponse],
    +    ) -> None:
    +        kwargs: Dict[str, Any] = build_async_required_kwargs(
    +            required_arg_names=self.arg_names,
    +            logger=self.logger,
    +            error=error,
    +            request=request,
    +            response=response,
    +            next_keys_required=False,
    +        )
    +        returned_response = await self.func(**kwargs)
    +        if returned_response is not None and isinstance(
    +            returned_response, BoltResponse
    +        ):
    +            response.status = returned_response.status
    +            response.headers = returned_response.headers
    +            response.body = returned_response.body
    +
    +

    Ancestors

    + +

    Inherited members

    + +
    +
    +class AsyncDefaultMiddlewareErrorHandler +(logger: logging.Logger) +
    +
    +
    +
    + +Expand source code + +
    class AsyncDefaultMiddlewareErrorHandler(AsyncMiddlewareErrorHandler):
    +    def __init__(self, logger: Logger):
    +        self.logger = logger
    +
    +    async def handle(
    +        self,
    +        error: Exception,
    +        request: AsyncBoltRequest,
    +        response: Optional[BoltResponse],
    +    ):
    +        message = f"Failed to run a middleware function (error: {error})"
    +        self.logger.exception(message)
    +
    +

    Ancestors

    + +

    Inherited members

    + +
    +
    +class AsyncMiddlewareErrorHandler +
    +
    +
    +
    + +Expand source code + +
    class AsyncMiddlewareErrorHandler(metaclass=ABCMeta):
    +    @abstractmethod
    +    async def handle(
    +        self,
    +        error: Exception,
    +        request: AsyncBoltRequest,
    +        response: Optional[BoltResponse],
    +    ) -> None:
    +        """Handles an unhandled exception.
    +
    +        Args:
    +            error: The raised exception.
    +            request: The request.
    +            response: The response.
    +        """
    +        raise NotImplementedError()
    +
    +

    Subclasses

    + +

    Methods

    +
    +
    +async def handle(self, error: Exception, request: AsyncBoltRequest, response: Optional[BoltResponse]) ‑> NoneType +
    +
    +

    Handles an unhandled exception.

    +

    Args

    +
    +
    error
    +
    The raised exception.
    +
    request
    +
    The request.
    +
    response
    +
    The response.
    +
    +
    + +Expand source code + +
    @abstractmethod
    +async def handle(
    +    self,
    +    error: Exception,
    +    request: AsyncBoltRequest,
    +    response: Optional[BoltResponse],
    +) -> None:
    +    """Handles an unhandled exception.
    +
    +    Args:
    +        error: The raised exception.
    +        request: The request.
    +        response: The response.
    +    """
    +    raise NotImplementedError()
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html b/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html index 611e8f2b8..60ef76a9d 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html @@ -56,6 +56,9 @@

    Module slack_bolt.middleware.authorization.async_multi_t *, req: AsyncBoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], Awaitable[BoltResponse]], ) -> BoltResponse: if _is_no_auth_required(req): @@ -138,6 +141,9 @@

    Args

    *, req: AsyncBoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], Awaitable[BoltResponse]], ) -> BoltResponse: if _is_no_auth_required(req): diff --git a/docs/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html b/docs/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html index 0b76ad6f1..15307fedf 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html @@ -50,6 +50,9 @@

    Module slack_bolt.middleware.authorization.async_single_ *, req: AsyncBoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], Awaitable[BoltResponse]], ) -> BoltResponse: if _is_no_auth_required(req): @@ -117,6 +120,9 @@

    Classes

    *, req: AsyncBoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], Awaitable[BoltResponse]], ) -> BoltResponse: if _is_no_auth_required(req): diff --git a/docs/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html b/docs/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html index 14da4c9ab..f588554de 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html @@ -58,6 +58,9 @@

    Module slack_bolt.middleware.authorization.single_team_a *, req: BoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], BoltResponse], ) -> BoltResponse: if _is_no_auth_required(req): @@ -135,6 +138,9 @@

    Args

    *, req: BoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], BoltResponse], ) -> BoltResponse: if _is_no_auth_required(req): diff --git a/docs/api-docs/slack_bolt/middleware/custom_middleware.html b/docs/api-docs/slack_bolt/middleware/custom_middleware.html index 6d6835d1c..39ad5cd79 100644 --- a/docs/api-docs/slack_bolt/middleware/custom_middleware.html +++ b/docs/api-docs/slack_bolt/middleware/custom_middleware.html @@ -55,6 +55,9 @@

    Module slack_bolt.middleware.custom_middlewareClasses

    *, req: BoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], BoltResponse], ) -> BoltResponse: return self.func( diff --git a/docs/api-docs/slack_bolt/middleware/index.html b/docs/api-docs/slack_bolt/middleware/index.html index fb9e2ae37..e19b89063 100644 --- a/docs/api-docs/slack_bolt/middleware/index.html +++ b/docs/api-docs/slack_bolt/middleware/index.html @@ -74,6 +74,10 @@

    Sub-modules

    +
    slack_bolt.middleware.async_middleware_error_handler
    +
    +
    +
    slack_bolt.middleware.authorization
    @@ -94,6 +98,10 @@

    Sub-modules

    +
    slack_bolt.middleware.middleware_error_handler
    +
    +
    +
    slack_bolt.middleware.request_verification
    @@ -131,11 +139,13 @@

    Index

  • slack_bolt.middleware.async_builtins
  • slack_bolt.middleware.async_custom_middleware
  • slack_bolt.middleware.async_middleware
  • +
  • slack_bolt.middleware.async_middleware_error_handler
  • slack_bolt.middleware.authorization
  • slack_bolt.middleware.custom_middleware
  • slack_bolt.middleware.ignoring_self_events
  • slack_bolt.middleware.message_listener_matches
  • slack_bolt.middleware.middleware
  • +
  • slack_bolt.middleware.middleware_error_handler
  • slack_bolt.middleware.request_verification
  • slack_bolt.middleware.ssl_check
  • slack_bolt.middleware.url_verification
  • diff --git a/docs/api-docs/slack_bolt/middleware/message_listener_matches/async_message_listener_matches.html b/docs/api-docs/slack_bolt/middleware/message_listener_matches/async_message_listener_matches.html index f9991db05..266574386 100644 --- a/docs/api-docs/slack_bolt/middleware/message_listener_matches/async_message_listener_matches.html +++ b/docs/api-docs/slack_bolt/middleware/message_listener_matches/async_message_listener_matches.html @@ -44,13 +44,20 @@

    Module slack_bolt.middleware.message_listener_matches.as *, req: AsyncBoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], Awaitable[BoltResponse]], ) -> BoltResponse: text = req.body.get("event", {}).get("text", "") if text: - m = re.search(self.keyword, text) - if m is not None: - req.context["matches"] = m.groups() # tuple + m = re.findall(self.keyword, text) + if m is not None and m != []: + if type(m[0]) is not tuple: + m = tuple(m) + else: + m = m[0] + req.context["matches"] = m # tuple or list return await next() # As the text doesn't match, skip running the listener @@ -87,13 +94,20 @@

    Classes

    *, req: AsyncBoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], Awaitable[BoltResponse]], ) -> BoltResponse: text = req.body.get("event", {}).get("text", "") if text: - m = re.search(self.keyword, text) - if m is not None: - req.context["matches"] = m.groups() # tuple + m = re.findall(self.keyword, text) + if m is not None and m != []: + if type(m[0]) is not tuple: + m = tuple(m) + else: + m = m[0] + req.context["matches"] = m # tuple or list return await next() # As the text doesn't match, skip running the listener diff --git a/docs/api-docs/slack_bolt/middleware/message_listener_matches/message_listener_matches.html b/docs/api-docs/slack_bolt/middleware/message_listener_matches/message_listener_matches.html index 336984bfc..60dc26b23 100644 --- a/docs/api-docs/slack_bolt/middleware/message_listener_matches/message_listener_matches.html +++ b/docs/api-docs/slack_bolt/middleware/message_listener_matches/message_listener_matches.html @@ -44,13 +44,20 @@

    Module slack_bolt.middleware.message_listener_matches.me *, req: BoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], BoltResponse], ) -> BoltResponse: text = req.body.get("event", {}).get("text", "") if text: - m = re.search(self.keyword, text) - if m is not None: - req.context["matches"] = m.groups() # tuple + m = re.findall(self.keyword, text) + if m is not None and m != []: + if type(m[0]) is not tuple: + m = tuple(m) + else: + m = m[0] + req.context["matches"] = m # tuple or list return next() # As the text doesn't match, skip running the listener @@ -87,13 +94,20 @@

    Classes

    *, req: BoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], BoltResponse], ) -> BoltResponse: text = req.body.get("event", {}).get("text", "") if text: - m = re.search(self.keyword, text) - if m is not None: - req.context["matches"] = m.groups() # tuple + m = re.findall(self.keyword, text) + if m is not None and m != []: + if type(m[0]) is not tuple: + m = tuple(m) + else: + m = m[0] + req.context["matches"] = m # tuple or list return next() # As the text doesn't match, skip running the listener diff --git a/docs/api-docs/slack_bolt/middleware/middleware.html b/docs/api-docs/slack_bolt/middleware/middleware.html index 39172c4b5..7c07cfb1b 100644 --- a/docs/api-docs/slack_bolt/middleware/middleware.html +++ b/docs/api-docs/slack_bolt/middleware/middleware.html @@ -42,6 +42,9 @@

    Module slack_bolt.middleware.middleware

    *, req: BoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], BoltResponse], ) -> Optional[BoltResponse]: """Processes a request data before other middleware and listeners. @@ -52,6 +55,14 @@

    Module slack_bolt.middleware.middleware

    # do something here next() + This `process(req, resp, next)` method is supposed to be invoked only inside bolt-python. + If you want to avoid the name `next()` in your middleware functions, you can use `next_()` method instead. + + @app.middleware + def simple_middleware(req, resp, next_): + # do something here + next_() + Args: req: The incoming request resp: The response @@ -95,6 +106,9 @@

    Classes

    *, req: BoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], BoltResponse], ) -> Optional[BoltResponse]: """Processes a request data before other middleware and listeners. @@ -105,6 +119,14 @@

    Classes

    # do something here next() + This `process(req, resp, next)` method is supposed to be invoked only inside bolt-python. + If you want to avoid the name `next()` in your middleware functions, you can use `next_()` method instead. + + @app.middleware + def simple_middleware(req, resp, next_): + # do something here + next_() + Args: req: The incoming request resp: The response @@ -160,6 +182,13 @@

    Methods

    # do something here next()
    +

    This process(req, resp, next) method is supposed to be invoked only inside bolt-python. +If you want to avoid the name next() in your middleware functions, you can use next_() method instead.

    +
    @app.middleware
    +def simple_middleware(req, resp, next_):
    +    # do something here
    +    next_()
    +

    Args

    req
    @@ -181,6 +210,9 @@

    Returns

    *, req: BoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], BoltResponse], ) -> Optional[BoltResponse]: """Processes a request data before other middleware and listeners. @@ -191,6 +223,14 @@

    Returns

    # do something here next() + This `process(req, resp, next)` method is supposed to be invoked only inside bolt-python. + If you want to avoid the name `next()` in your middleware functions, you can use `next_()` method instead. + + @app.middleware + def simple_middleware(req, resp, next_): + # do something here + next_() + Args: req: The incoming request resp: The response diff --git a/docs/api-docs/slack_bolt/middleware/middleware_error_handler.html b/docs/api-docs/slack_bolt/middleware/middleware_error_handler.html new file mode 100644 index 000000000..ff2d0b318 --- /dev/null +++ b/docs/api-docs/slack_bolt/middleware/middleware_error_handler.html @@ -0,0 +1,303 @@ + + + + + + +slack_bolt.middleware.middleware_error_handler API documentation + + + + + + + + + + + +
    +
    +
    +

    Module slack_bolt.middleware.middleware_error_handler

    +
    +
    +
    + +Expand source code + +
    import inspect
    +from abc import ABCMeta, abstractmethod
    +from logging import Logger
    +from typing import Callable, Optional, Any, Dict
    +
    +from slack_bolt.kwargs_injection.utils import build_required_kwargs
    +from slack_bolt.request.request import BoltRequest
    +from slack_bolt.response.response import BoltResponse
    +
    +
    +class MiddlewareErrorHandler(metaclass=ABCMeta):
    +    @abstractmethod
    +    def handle(
    +        self,
    +        error: Exception,
    +        request: BoltRequest,
    +        response: Optional[BoltResponse],
    +    ) -> None:
    +        """Handles an unhandled exception.
    +
    +        Args:
    +            error: The raised exception.
    +            request: The request.
    +            response: The response.
    +        """
    +        raise NotImplementedError()
    +
    +
    +class CustomMiddlewareErrorHandler(MiddlewareErrorHandler):
    +    def __init__(self, logger: Logger, func: Callable[..., Optional[BoltResponse]]):
    +        self.func = func
    +        self.logger = logger
    +        self.arg_names = inspect.getfullargspec(func).args
    +
    +    def handle(
    +        self,
    +        error: Exception,
    +        request: BoltRequest,
    +        response: Optional[BoltResponse],
    +    ):
    +        kwargs: Dict[str, Any] = build_required_kwargs(
    +            required_arg_names=self.arg_names,
    +            logger=self.logger,
    +            error=error,
    +            request=request,
    +            response=response,
    +            next_keys_required=False,
    +        )
    +        returned_response = self.func(**kwargs)
    +        if returned_response is not None and isinstance(
    +            returned_response, BoltResponse
    +        ):
    +            response.status = returned_response.status
    +            response.headers = returned_response.headers
    +            response.body = returned_response.body
    +
    +
    +class DefaultMiddlewareErrorHandler(MiddlewareErrorHandler):
    +    def __init__(self, logger: Logger):
    +        self.logger = logger
    +
    +    def handle(
    +        self,
    +        error: Exception,
    +        request: BoltRequest,
    +        response: Optional[BoltResponse],
    +    ):
    +        message = f"Failed to run a middleware middleware (error: {error})"
    +        self.logger.exception(message)
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Classes

    +
    +
    +class CustomMiddlewareErrorHandler +(logger: logging.Logger, func: Callable[..., Optional[BoltResponse]]) +
    +
    +
    +
    + +Expand source code + +
    class CustomMiddlewareErrorHandler(MiddlewareErrorHandler):
    +    def __init__(self, logger: Logger, func: Callable[..., Optional[BoltResponse]]):
    +        self.func = func
    +        self.logger = logger
    +        self.arg_names = inspect.getfullargspec(func).args
    +
    +    def handle(
    +        self,
    +        error: Exception,
    +        request: BoltRequest,
    +        response: Optional[BoltResponse],
    +    ):
    +        kwargs: Dict[str, Any] = build_required_kwargs(
    +            required_arg_names=self.arg_names,
    +            logger=self.logger,
    +            error=error,
    +            request=request,
    +            response=response,
    +            next_keys_required=False,
    +        )
    +        returned_response = self.func(**kwargs)
    +        if returned_response is not None and isinstance(
    +            returned_response, BoltResponse
    +        ):
    +            response.status = returned_response.status
    +            response.headers = returned_response.headers
    +            response.body = returned_response.body
    +
    +

    Ancestors

    + +

    Inherited members

    + +
    +
    +class DefaultMiddlewareErrorHandler +(logger: logging.Logger) +
    +
    +
    +
    + +Expand source code + +
    class DefaultMiddlewareErrorHandler(MiddlewareErrorHandler):
    +    def __init__(self, logger: Logger):
    +        self.logger = logger
    +
    +    def handle(
    +        self,
    +        error: Exception,
    +        request: BoltRequest,
    +        response: Optional[BoltResponse],
    +    ):
    +        message = f"Failed to run a middleware middleware (error: {error})"
    +        self.logger.exception(message)
    +
    +

    Ancestors

    + +

    Inherited members

    + +
    +
    +class MiddlewareErrorHandler +
    +
    +
    +
    + +Expand source code + +
    class MiddlewareErrorHandler(metaclass=ABCMeta):
    +    @abstractmethod
    +    def handle(
    +        self,
    +        error: Exception,
    +        request: BoltRequest,
    +        response: Optional[BoltResponse],
    +    ) -> None:
    +        """Handles an unhandled exception.
    +
    +        Args:
    +            error: The raised exception.
    +            request: The request.
    +            response: The response.
    +        """
    +        raise NotImplementedError()
    +
    +

    Subclasses

    + +

    Methods

    +
    +
    +def handle(self, error: Exception, request: BoltRequest, response: Optional[BoltResponse]) ‑> NoneType +
    +
    +

    Handles an unhandled exception.

    +

    Args

    +
    +
    error
    +
    The raised exception.
    +
    request
    +
    The request.
    +
    response
    +
    The response.
    +
    +
    + +Expand source code + +
    @abstractmethod
    +def handle(
    +    self,
    +    error: Exception,
    +    request: BoltRequest,
    +    response: Optional[BoltResponse],
    +) -> None:
    +    """Handles an unhandled exception.
    +
    +    Args:
    +        error: The raised exception.
    +        request: The request.
    +        response: The response.
    +    """
    +    raise NotImplementedError()
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/request_verification/async_request_verification.html b/docs/api-docs/slack_bolt/middleware/request_verification/async_request_verification.html index 21e726a52..5426e8beb 100644 --- a/docs/api-docs/slack_bolt/middleware/request_verification/async_request_verification.html +++ b/docs/api-docs/slack_bolt/middleware/request_verification/async_request_verification.html @@ -46,6 +46,9 @@

    Module slack_bolt.middleware.request_verification.async_ *, req: AsyncBoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], Awaitable[BoltResponse]], ) -> BoltResponse: if self._can_skip(req.mode, req.body): @@ -102,6 +105,9 @@

    Args

    *, req: AsyncBoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], Awaitable[BoltResponse]], ) -> BoltResponse: if self._can_skip(req.mode, req.body): diff --git a/docs/api-docs/slack_bolt/middleware/request_verification/request_verification.html b/docs/api-docs/slack_bolt/middleware/request_verification/request_verification.html index aac34e2e9..c6a70ec2e 100644 --- a/docs/api-docs/slack_bolt/middleware/request_verification/request_verification.html +++ b/docs/api-docs/slack_bolt/middleware/request_verification/request_verification.html @@ -54,6 +54,9 @@

    Module slack_bolt.middleware.request_verification.reques *, req: BoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], BoltResponse], ) -> BoltResponse: if self._can_skip(req.mode, req.body): @@ -132,6 +135,9 @@

    Args

    *, req: BoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], BoltResponse], ) -> BoltResponse: if self._can_skip(req.mode, req.body): diff --git a/docs/api-docs/slack_bolt/middleware/ssl_check/async_ssl_check.html b/docs/api-docs/slack_bolt/middleware/ssl_check/async_ssl_check.html index 98468b075..e29cb2a1e 100644 --- a/docs/api-docs/slack_bolt/middleware/ssl_check/async_ssl_check.html +++ b/docs/api-docs/slack_bolt/middleware/ssl_check/async_ssl_check.html @@ -40,6 +40,9 @@

    Module slack_bolt.middleware.ssl_check.async_ssl_checkClasses

    class AsyncSslCheck -(verification_token: str = None) +(verification_token: Optional[str] = None)

    A middleware can process request data before other middleware and listener functions.

    @@ -83,6 +86,9 @@

    Args

    *, req: AsyncBoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], Awaitable[BoltResponse]], ) -> BoltResponse: if self._is_ssl_check_request(req.body): @@ -98,6 +104,17 @@

    Ancestors

  • Middleware
  • AsyncMiddleware
  • +

    Class variables

    +
    +
    var logger : logging.Logger
    +
    +
    +
    +
    var verification_token : Optional[str]
    +
    +
    +
    +

    Inherited members

    • SslCheck: @@ -131,6 +148,10 @@

      Index

    • diff --git a/docs/api-docs/slack_bolt/middleware/ssl_check/ssl_check.html b/docs/api-docs/slack_bolt/middleware/ssl_check/ssl_check.html index dc8a2e9f4..cc328c988 100644 --- a/docs/api-docs/slack_bolt/middleware/ssl_check/ssl_check.html +++ b/docs/api-docs/slack_bolt/middleware/ssl_check/ssl_check.html @@ -26,7 +26,8 @@

      Module slack_bolt.middleware.ssl_check.ssl_check< Expand source code -
      from typing import Callable
      +
      from logging import Logger
      +from typing import Callable, Optional
       
       from slack_bolt.logger import get_bolt_logger
       from slack_bolt.middleware.middleware import Middleware
      @@ -35,7 +36,10 @@ 

      Module slack_bolt.middleware.ssl_check.ssl_check< class SslCheck(Middleware): # type: ignore - def __init__(self, verification_token: str = None): + verification_token: Optional[str] + logger: Logger + + def __init__(self, verification_token: Optional[str] = None): """Handles `ssl_check` requests. Refer to https://api.slack.com/interactivity/slash-commands for details. @@ -51,6 +55,9 @@

      Module slack_bolt.middleware.ssl_check.ssl_check< *, req: BoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], BoltResponse], ) -> BoltResponse: if self._is_ssl_check_request(req.body): @@ -89,7 +96,7 @@

      Classes

      class SslCheck -(verification_token: str = None) +(verification_token: Optional[str] = None)

      A middleware can process request data before other middleware and listener functions.

      @@ -106,7 +113,10 @@

      Args

      Expand source code
      class SslCheck(Middleware):  # type: ignore
      -    def __init__(self, verification_token: str = None):
      +    verification_token: Optional[str]
      +    logger: Logger
      +
      +    def __init__(self, verification_token: Optional[str] = None):
               """Handles `ssl_check` requests.
               Refer to https://api.slack.com/interactivity/slash-commands for details.
       
      @@ -122,6 +132,9 @@ 

      Args

      *, req: BoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], BoltResponse], ) -> BoltResponse: if self._is_ssl_check_request(req.body): @@ -156,6 +169,17 @@

      Subclasses

      +

      Class variables

      +
      +
      var logger : logging.Logger
      +
      +
      +
      +
      var verification_token : Optional[str]
      +
      +
      +
      +

      Inherited members

      • Middleware: @@ -184,6 +208,10 @@

        Index

      • diff --git a/docs/api-docs/slack_bolt/middleware/url_verification/url_verification.html b/docs/api-docs/slack_bolt/middleware/url_verification/url_verification.html index fdd131fb3..82789210b 100644 --- a/docs/api-docs/slack_bolt/middleware/url_verification/url_verification.html +++ b/docs/api-docs/slack_bolt/middleware/url_verification/url_verification.html @@ -47,6 +47,9 @@

        Module slack_bolt.middleware.url_verification.url_verifi *, req: BoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], BoltResponse], ) -> BoltResponse: if self._is_url_verification_request(req.body): @@ -98,6 +101,9 @@

        Classes

        *, req: BoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], BoltResponse], ) -> BoltResponse: if self._is_url_verification_request(req.body): diff --git a/docs/api-docs/slack_bolt/oauth/async_oauth_flow.html b/docs/api-docs/slack_bolt/oauth/async_oauth_flow.html index ba5439965..3730a317f 100644 --- a/docs/api-docs/slack_bolt/oauth/async_oauth_flow.html +++ b/docs/api-docs/slack_bolt/oauth/async_oauth_flow.html @@ -366,9 +366,13 @@

        Module slack_bolt.oauth.async_oauth_flow

        bot_id=bot_id, bot_user_id=oauth_response.get("bot_user_id"), bot_scopes=oauth_response.get("scope"), # comma-separated string + bot_refresh_token=oauth_response.get("refresh_token"), # since v1.7 + bot_token_expires_in=oauth_response.get("expires_in"), # since v1.7 user_id=installer.get("id"), user_token=installer.get("access_token"), user_scopes=installer.get("scope"), # comma-separated string + user_refresh_token=installer.get("refresh_token"), # since v1.7 + user_token_expires_in=installer.get("expires_in"), # since v1.7 incoming_webhook_url=incoming_webhook.get("url"), incoming_webhook_channel=incoming_webhook.get("channel"), incoming_webhook_channel_id=incoming_webhook.get("channel_id"), @@ -733,9 +737,13 @@

        Args

        bot_id=bot_id, bot_user_id=oauth_response.get("bot_user_id"), bot_scopes=oauth_response.get("scope"), # comma-separated string + bot_refresh_token=oauth_response.get("refresh_token"), # since v1.7 + bot_token_expires_in=oauth_response.get("expires_in"), # since v1.7 user_id=installer.get("id"), user_token=installer.get("access_token"), user_scopes=installer.get("scope"), # comma-separated string + user_refresh_token=installer.get("refresh_token"), # since v1.7 + user_token_expires_in=installer.get("expires_in"), # since v1.7 incoming_webhook_url=incoming_webhook.get("url"), incoming_webhook_channel=incoming_webhook.get("channel"), incoming_webhook_channel_id=incoming_webhook.get("channel_id"), @@ -1129,9 +1137,13 @@

        Methods

        bot_id=bot_id, bot_user_id=oauth_response.get("bot_user_id"), bot_scopes=oauth_response.get("scope"), # comma-separated string + bot_refresh_token=oauth_response.get("refresh_token"), # since v1.7 + bot_token_expires_in=oauth_response.get("expires_in"), # since v1.7 user_id=installer.get("id"), user_token=installer.get("access_token"), user_scopes=installer.get("scope"), # comma-separated string + user_refresh_token=installer.get("refresh_token"), # since v1.7 + user_token_expires_in=installer.get("expires_in"), # since v1.7 incoming_webhook_url=incoming_webhook.get("url"), incoming_webhook_channel=incoming_webhook.get("channel"), incoming_webhook_channel_id=incoming_webhook.get("channel_id"), diff --git a/docs/api-docs/slack_bolt/oauth/async_oauth_settings.html b/docs/api-docs/slack_bolt/oauth/async_oauth_settings.html index 5c3a4a0f7..29e0eaf01 100644 --- a/docs/api-docs/slack_bolt/oauth/async_oauth_settings.html +++ b/docs/api-docs/slack_bolt/oauth/async_oauth_settings.html @@ -69,6 +69,7 @@

        Module slack_bolt.oauth.async_oauth_settings

        # Installation Management installation_store: AsyncInstallationStore installation_store_bot_only: bool + token_rotation_expiration_minutes: int authorize: AsyncAuthorize # state parameter related configurations state_store: AsyncOAuthStateStore @@ -101,6 +102,7 @@

        Module slack_bolt.oauth.async_oauth_settings

        # Installation Management installation_store: Optional[AsyncInstallationStore] = None, installation_store_bot_only: bool = False, + token_rotation_expiration_minutes: int = 120, # state parameter related configurations state_store: Optional[AsyncOAuthStateStore] = None, state_cookie_name: str = OAuthStateUtils.default_cookie_name, @@ -125,6 +127,7 @@

        Module slack_bolt.oauth.async_oauth_settings

        authorization_url: Set a URL if you want to customize the URL `https://slack.com/oauth/v2/authorize` installation_store: Specify the instance of `InstallationStore` (Default: `FileInstallationStore`) installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) + token_rotation_expiration_minutes: Minutes before refreshing tokens (Default: 2 hours) state_store: Specify the instance of `InstallationStore` (Default: `FileOAuthStateStore`) state_cookie_name: The cookie name that is set for installers' browser. (Default: "slack-app-oauth-state") state_expiration_seconds: The seconds that the state value is alive (Default: 600 seconds) @@ -168,8 +171,12 @@

        Module slack_bolt.oauth.async_oauth_settings

        installation_store or get_or_create_default_installation_store(client_id) ) self.installation_store_bot_only = installation_store_bot_only + self.token_rotation_expiration_minutes = token_rotation_expiration_minutes self.authorize = AsyncInstallationStoreAuthorize( logger=logger, + client_id=self.client_id, + client_secret=self.client_secret, + token_rotation_expiration_minutes=self.token_rotation_expiration_minutes, installation_store=self.installation_store, bot_only=self.installation_store_bot_only, ) @@ -211,7 +218,7 @@

        Classes

        class AsyncOAuthSettings -(*, client_id: Optional[str] = None, client_secret: Optional[str] = None, scopes: Union[Sequence[str], str, NoneType] = None, user_scopes: Union[Sequence[str], str, NoneType] = None, redirect_uri: Optional[str] = None, install_path: str = '/slack/install', install_page_rendering_enabled: bool = True, redirect_uri_path: str = '/slack/oauth_redirect', callback_options: Optional[AsyncCallbackOptions] = None, success_url: Optional[str] = None, failure_url: Optional[str] = None, authorization_url: Optional[str] = None, installation_store: Optional[slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore] = None, installation_store_bot_only: bool = False, state_store: Optional[slack_sdk.oauth.state_store.async_state_store.AsyncOAuthStateStore] = None, state_cookie_name: str = 'slack-app-oauth-state', state_expiration_seconds: int = 600, logger: logging.Logger = <Logger slack_bolt.oauth.async_oauth_settings (WARNING)>) +(*, client_id: Optional[str] = None, client_secret: Optional[str] = None, scopes: Union[str, Sequence[str], NoneType] = None, user_scopes: Union[str, Sequence[str], NoneType] = None, redirect_uri: Optional[str] = None, install_path: str = '/slack/install', install_page_rendering_enabled: bool = True, redirect_uri_path: str = '/slack/oauth_redirect', callback_options: Optional[AsyncCallbackOptions] = None, success_url: Optional[str] = None, failure_url: Optional[str] = None, authorization_url: Optional[str] = None, installation_store: Optional[slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore] = None, installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, state_store: Optional[slack_sdk.oauth.state_store.async_state_store.AsyncOAuthStateStore] = None, state_cookie_name: str = 'slack-app-oauth-state', state_expiration_seconds: int = 600, logger: logging.Logger = <Logger slack_bolt.oauth.async_oauth_settings (WARNING)>)

        The settings for Slack App installation (OAuth flow).

        @@ -245,6 +252,8 @@

        Args

        Specify the instance of InstallationStore (Default: FileInstallationStore)
        installation_store_bot_only
        Use InstallationStore#find_bot() if True (Default: False)
        +
        token_rotation_expiration_minutes
        +
        Minutes before refreshing tokens (Default: 2 hours)
        state_store
        Specify the instance of InstallationStore (Default: FileOAuthStateStore)
        state_cookie_name
        @@ -276,6 +285,7 @@

        Args

        # Installation Management installation_store: AsyncInstallationStore installation_store_bot_only: bool + token_rotation_expiration_minutes: int authorize: AsyncAuthorize # state parameter related configurations state_store: AsyncOAuthStateStore @@ -308,6 +318,7 @@

        Args

        # Installation Management installation_store: Optional[AsyncInstallationStore] = None, installation_store_bot_only: bool = False, + token_rotation_expiration_minutes: int = 120, # state parameter related configurations state_store: Optional[AsyncOAuthStateStore] = None, state_cookie_name: str = OAuthStateUtils.default_cookie_name, @@ -332,6 +343,7 @@

        Args

        authorization_url: Set a URL if you want to customize the URL `https://slack.com/oauth/v2/authorize` installation_store: Specify the instance of `InstallationStore` (Default: `FileInstallationStore`) installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) + token_rotation_expiration_minutes: Minutes before refreshing tokens (Default: 2 hours) state_store: Specify the instance of `InstallationStore` (Default: `FileOAuthStateStore`) state_cookie_name: The cookie name that is set for installers' browser. (Default: "slack-app-oauth-state") state_expiration_seconds: The seconds that the state value is alive (Default: 600 seconds) @@ -375,8 +387,12 @@

        Args

        installation_store or get_or_create_default_installation_store(client_id) ) self.installation_store_bot_only = installation_store_bot_only + self.token_rotation_expiration_minutes = token_rotation_expiration_minutes self.authorize = AsyncInstallationStoreAuthorize( logger=logger, + client_id=self.client_id, + client_secret=self.client_secret, + token_rotation_expiration_minutes=self.token_rotation_expiration_minutes, installation_store=self.installation_store, bot_only=self.installation_store_bot_only, ) @@ -492,6 +508,10 @@

        Class variables

        +
        var token_rotation_expiration_minutes : int
        +
        +
        +
        var user_scopes : Optional[Sequence[str]]
        @@ -538,6 +558,7 @@

        state_store
      • state_utils
      • success_url
      • +
      • token_rotation_expiration_minutes
      • user_scopes
      diff --git a/docs/api-docs/slack_bolt/oauth/internals.html b/docs/api-docs/slack_bolt/oauth/internals.html index 30864eb75..68a5ce7bc 100644 --- a/docs/api-docs/slack_bolt/oauth/internals.html +++ b/docs/api-docs/slack_bolt/oauth/internals.html @@ -102,6 +102,7 @@

      Module slack_bolt.oauth.internals

      def _build_default_install_page_html(url: str) -> str: return f"""<html> <head> +<link rel="icon" href="data:,"> <style> body {{ padding: 10px 15px; diff --git a/docs/api-docs/slack_bolt/oauth/oauth_flow.html b/docs/api-docs/slack_bolt/oauth/oauth_flow.html index ba6b75c03..4d345e60b 100644 --- a/docs/api-docs/slack_bolt/oauth/oauth_flow.html +++ b/docs/api-docs/slack_bolt/oauth/oauth_flow.html @@ -135,6 +135,7 @@

      Module slack_bolt.oauth.oauth_flow

      state_cookie_name: str = OAuthStateUtils.default_cookie_name, state_expiration_seconds: int = OAuthStateUtils.default_expiration_seconds, installation_store_bot_only: bool = False, + token_rotation_expiration_minutes: int = 120, client: Optional[WebClient] = None, logger: Optional[Logger] = None, ) -> "OAuthFlow": @@ -168,6 +169,7 @@

      Module slack_bolt.oauth.oauth_flow

      logger=logger, ), installation_store_bot_only=installation_store_bot_only, + token_rotation_expiration_minutes=token_rotation_expiration_minutes, # state parameter related configurations state_store=SQLite3OAuthStateStore( database=database, @@ -361,9 +363,13 @@

      Module slack_bolt.oauth.oauth_flow

      bot_id=bot_id, bot_user_id=oauth_response.get("bot_user_id"), bot_scopes=oauth_response.get("scope"), # comma-separated string + bot_refresh_token=oauth_response.get("refresh_token"), # since v1.7 + bot_token_expires_in=oauth_response.get("expires_in"), # since v1.7 user_id=installer.get("id"), user_token=installer.get("access_token"), user_scopes=installer.get("scope"), # comma-separated string + user_refresh_token=installer.get("refresh_token"), # since v1.7 + user_token_expires_in=installer.get("expires_in"), # since v1.7 incoming_webhook_url=incoming_webhook.get("url"), incoming_webhook_channel=incoming_webhook.get("channel"), incoming_webhook_channel_id=incoming_webhook.get("channel_id"), @@ -496,6 +502,7 @@

      Args

      state_cookie_name: str = OAuthStateUtils.default_cookie_name, state_expiration_seconds: int = OAuthStateUtils.default_expiration_seconds, installation_store_bot_only: bool = False, + token_rotation_expiration_minutes: int = 120, client: Optional[WebClient] = None, logger: Optional[Logger] = None, ) -> "OAuthFlow": @@ -529,6 +536,7 @@

      Args

      logger=logger, ), installation_store_bot_only=installation_store_bot_only, + token_rotation_expiration_minutes=token_rotation_expiration_minutes, # state parameter related configurations state_store=SQLite3OAuthStateStore( database=database, @@ -722,9 +730,13 @@

      Args

      bot_id=bot_id, bot_user_id=oauth_response.get("bot_user_id"), bot_scopes=oauth_response.get("scope"), # comma-separated string + bot_refresh_token=oauth_response.get("refresh_token"), # since v1.7 + bot_token_expires_in=oauth_response.get("expires_in"), # since v1.7 user_id=installer.get("id"), user_token=installer.get("access_token"), user_scopes=installer.get("scope"), # comma-separated string + user_refresh_token=installer.get("refresh_token"), # since v1.7 + user_token_expires_in=installer.get("expires_in"), # since v1.7 incoming_webhook_url=incoming_webhook.get("url"), incoming_webhook_channel=incoming_webhook.get("channel"), incoming_webhook_channel_id=incoming_webhook.get("channel_id"), @@ -784,7 +796,7 @@

      Class variables

      Static methods

      -def sqlite3(database: str, client_id: Optional[str] = None, client_secret: Optional[str] = None, scopes: Optional[Sequence[str]] = None, user_scopes: Optional[Sequence[str]] = None, redirect_uri: Optional[str] = None, install_path: Optional[str] = None, redirect_uri_path: Optional[str] = None, callback_options: Optional[CallbackOptions] = None, success_url: Optional[str] = None, failure_url: Optional[str] = None, authorization_url: Optional[str] = None, state_cookie_name: str = 'slack-app-oauth-state', state_expiration_seconds: int = 600, installation_store_bot_only: bool = False, client: Optional[slack_sdk.web.client.WebClient] = None, logger: Optional[logging.Logger] = None) ‑> OAuthFlow +def sqlite3(database: str, client_id: Optional[str] = None, client_secret: Optional[str] = None, scopes: Optional[Sequence[str]] = None, user_scopes: Optional[Sequence[str]] = None, redirect_uri: Optional[str] = None, install_path: Optional[str] = None, redirect_uri_path: Optional[str] = None, callback_options: Optional[CallbackOptions] = None, success_url: Optional[str] = None, failure_url: Optional[str] = None, authorization_url: Optional[str] = None, state_cookie_name: str = 'slack-app-oauth-state', state_expiration_seconds: int = 600, installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, client: Optional[slack_sdk.web.client.WebClient] = None, logger: Optional[logging.Logger] = None) ‑> OAuthFlow
      @@ -814,6 +826,7 @@

      Static methods

      state_cookie_name: str = OAuthStateUtils.default_cookie_name, state_expiration_seconds: int = OAuthStateUtils.default_expiration_seconds, installation_store_bot_only: bool = False, + token_rotation_expiration_minutes: int = 120, client: Optional[WebClient] = None, logger: Optional[Logger] = None, ) -> "OAuthFlow": @@ -847,6 +860,7 @@

      Static methods

      logger=logger, ), installation_store_bot_only=installation_store_bot_only, + token_rotation_expiration_minutes=token_rotation_expiration_minutes, # state parameter related configurations state_store=SQLite3OAuthStateStore( database=database, @@ -1120,9 +1134,13 @@

      Methods

      bot_id=bot_id, bot_user_id=oauth_response.get("bot_user_id"), bot_scopes=oauth_response.get("scope"), # comma-separated string + bot_refresh_token=oauth_response.get("refresh_token"), # since v1.7 + bot_token_expires_in=oauth_response.get("expires_in"), # since v1.7 user_id=installer.get("id"), user_token=installer.get("access_token"), user_scopes=installer.get("scope"), # comma-separated string + user_refresh_token=installer.get("refresh_token"), # since v1.7 + user_token_expires_in=installer.get("expires_in"), # since v1.7 incoming_webhook_url=incoming_webhook.get("url"), incoming_webhook_channel=incoming_webhook.get("channel"), incoming_webhook_channel_id=incoming_webhook.get("channel_id"), diff --git a/docs/api-docs/slack_bolt/oauth/oauth_settings.html b/docs/api-docs/slack_bolt/oauth/oauth_settings.html index 4624e9f85..83cee181b 100644 --- a/docs/api-docs/slack_bolt/oauth/oauth_settings.html +++ b/docs/api-docs/slack_bolt/oauth/oauth_settings.html @@ -64,6 +64,7 @@

      Module slack_bolt.oauth.oauth_settings

      # Installation Management installation_store: InstallationStore installation_store_bot_only: bool + token_rotation_expiration_minutes: int authorize: Authorize # state parameter related configurations state_store: OAuthStateStore @@ -96,6 +97,7 @@

      Module slack_bolt.oauth.oauth_settings

      # Installation Management installation_store: Optional[InstallationStore] = None, installation_store_bot_only: bool = False, + token_rotation_expiration_minutes: int = 120, # state parameter related configurations state_store: Optional[OAuthStateStore] = None, state_cookie_name: str = OAuthStateUtils.default_cookie_name, @@ -120,6 +122,7 @@

      Module slack_bolt.oauth.oauth_settings

      authorization_url: Set a URL if you want to customize the URL `https://slack.com/oauth/v2/authorize` installation_store: Specify the instance of `InstallationStore` (Default: `FileInstallationStore`) installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) + token_rotation_expiration_minutes: Minutes before refreshing tokens (Default: 2 hours) state_store: Specify the instance of `InstallationStore` (Default: `FileOAuthStateStore`) state_cookie_name: The cookie name that is set for installers' browser. (Default: "slack-app-oauth-state") state_expiration_seconds: The seconds that the state value is alive (Default: 600 seconds) @@ -162,8 +165,12 @@

      Module slack_bolt.oauth.oauth_settings

      installation_store or get_or_create_default_installation_store(client_id) ) self.installation_store_bot_only = installation_store_bot_only + self.token_rotation_expiration_minutes = token_rotation_expiration_minutes self.authorize = InstallationStoreAuthorize( logger=logger, + client_id=self.client_id, + client_secret=self.client_secret, + token_rotation_expiration_minutes=self.token_rotation_expiration_minutes, installation_store=self.installation_store, bot_only=self.installation_store_bot_only, ) @@ -205,7 +212,7 @@

      Classes

      class OAuthSettings -(*, client_id: Optional[str] = None, client_secret: Optional[str] = None, scopes: Union[Sequence[str], str, NoneType] = None, user_scopes: Union[Sequence[str], str, NoneType] = None, redirect_uri: Optional[str] = None, install_path: str = '/slack/install', install_page_rendering_enabled: bool = True, redirect_uri_path: str = '/slack/oauth_redirect', callback_options: Optional[CallbackOptions] = None, success_url: Optional[str] = None, failure_url: Optional[str] = None, authorization_url: Optional[str] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: bool = False, state_store: Optional[slack_sdk.oauth.state_store.state_store.OAuthStateStore] = None, state_cookie_name: str = 'slack-app-oauth-state', state_expiration_seconds: int = 600, logger: logging.Logger = <Logger slack_bolt.oauth.oauth_settings (WARNING)>) +(*, client_id: Optional[str] = None, client_secret: Optional[str] = None, scopes: Union[str, Sequence[str], NoneType] = None, user_scopes: Union[str, Sequence[str], NoneType] = None, redirect_uri: Optional[str] = None, install_path: str = '/slack/install', install_page_rendering_enabled: bool = True, redirect_uri_path: str = '/slack/oauth_redirect', callback_options: Optional[CallbackOptions] = None, success_url: Optional[str] = None, failure_url: Optional[str] = None, authorization_url: Optional[str] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, state_store: Optional[slack_sdk.oauth.state_store.state_store.OAuthStateStore] = None, state_cookie_name: str = 'slack-app-oauth-state', state_expiration_seconds: int = 600, logger: logging.Logger = <Logger slack_bolt.oauth.oauth_settings (WARNING)>)

      The settings for Slack App installation (OAuth flow).

      @@ -239,6 +246,8 @@

      Args

      Specify the instance of InstallationStore (Default: FileInstallationStore)
      installation_store_bot_only
      Use InstallationStore#find_bot() if True (Default: False)
      +
      token_rotation_expiration_minutes
      +
      Minutes before refreshing tokens (Default: 2 hours)
      state_store
      Specify the instance of InstallationStore (Default: FileOAuthStateStore)
      state_cookie_name
      @@ -270,6 +279,7 @@

      Args

      # Installation Management installation_store: InstallationStore installation_store_bot_only: bool + token_rotation_expiration_minutes: int authorize: Authorize # state parameter related configurations state_store: OAuthStateStore @@ -302,6 +312,7 @@

      Args

      # Installation Management installation_store: Optional[InstallationStore] = None, installation_store_bot_only: bool = False, + token_rotation_expiration_minutes: int = 120, # state parameter related configurations state_store: Optional[OAuthStateStore] = None, state_cookie_name: str = OAuthStateUtils.default_cookie_name, @@ -326,6 +337,7 @@

      Args

      authorization_url: Set a URL if you want to customize the URL `https://slack.com/oauth/v2/authorize` installation_store: Specify the instance of `InstallationStore` (Default: `FileInstallationStore`) installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) + token_rotation_expiration_minutes: Minutes before refreshing tokens (Default: 2 hours) state_store: Specify the instance of `InstallationStore` (Default: `FileOAuthStateStore`) state_cookie_name: The cookie name that is set for installers' browser. (Default: "slack-app-oauth-state") state_expiration_seconds: The seconds that the state value is alive (Default: 600 seconds) @@ -368,8 +380,12 @@

      Args

      installation_store or get_or_create_default_installation_store(client_id) ) self.installation_store_bot_only = installation_store_bot_only + self.token_rotation_expiration_minutes = token_rotation_expiration_minutes self.authorize = InstallationStoreAuthorize( logger=logger, + client_id=self.client_id, + client_secret=self.client_secret, + token_rotation_expiration_minutes=self.token_rotation_expiration_minutes, installation_store=self.installation_store, bot_only=self.installation_store_bot_only, ) @@ -485,6 +501,10 @@

      Class variables

      +
      var token_rotation_expiration_minutes : int
      +
      +
      +
      var user_scopes : Optional[Sequence[str]]
      @@ -531,6 +551,7 @@

      state_store
    • state_utils
    • success_url
    • +
    • token_rotation_expiration_minutes
    • user_scopes
    diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index c2b60cf6b..9ad0e32f7 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.6.1"
    +__version__ = "1.8.0"

    diff --git a/docs/api-docs/slack_bolt/workflows/step/step_middleware.html b/docs/api-docs/slack_bolt/workflows/step/step_middleware.html index 8be25951a..a80d4d335 100644 --- a/docs/api-docs/slack_bolt/workflows/step/step_middleware.html +++ b/docs/api-docs/slack_bolt/workflows/step/step_middleware.html @@ -49,6 +49,9 @@

    Module slack_bolt.workflows.step.step_middleware< *, req: BoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], BoltResponse], ) -> Optional[BoltResponse]: @@ -116,6 +119,9 @@

    Classes

    *, req: BoltRequest, resp: BoltResponse, + # As this method is not supposed to be invoked by bolt-python users, + # the naming conflict with the built-in one affects + # only the internals of this method next: Callable[[], BoltResponse], ) -> Optional[BoltResponse]: diff --git a/setup.py b/setup.py index 14be59c33..fef36e7e2 100755 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ ), include_package_data=True, # MANIFEST.in install_requires=[ - "slack_sdk>=3.9.0rc1,<4", # TODO: Update once v3.9.0 is released + "slack_sdk>=3.9.0,<4", ], setup_requires=["pytest-runner==5.2"], tests_require=test_dependencies, diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 89f6876ab..f9c62ba4d 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.8.0rc1" +__version__ = "1.8.0" From 3a3e349421524be99d234d5b0feb919ea93f406d Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 26 Aug 2021 07:24:17 +0900 Subject: [PATCH 232/719] Update the entity name (#446) --- LICENSE | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index dfbeb4a96..f2e8442ad 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2020- Slack Technologies, Inc +Copyright (c) 2020- Slack Technologies, LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/setup.py b/setup.py index fef36e7e2..fd8a09e2a 100755 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ name="slack_bolt", version=__version__, license="MIT", - author="Slack Technologies, Inc.", + author="Slack Technologies, LLC", author_email="opensource@slack.com", description="The Bolt Framework for Python", long_description=long_description, From 93bd437682203aff5f4409e84ca8590612a3c49b Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 26 Aug 2021 11:26:59 +0900 Subject: [PATCH 233/719] Improve the mock server for testing to work with additional query string values --- tests/mock_web_api_server.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/mock_web_api_server.py b/tests/mock_web_api_server.py index 9e6d008e1..2c3204912 100644 --- a/tests/mock_web_api_server.py +++ b/tests/mock_web_api_server.py @@ -8,7 +8,7 @@ from http.server import HTTPServer, SimpleHTTPRequestHandler from typing import Type from unittest import TestCase -from urllib.parse import urlparse, parse_qs +from urllib.parse import urlparse, parse_qs, ParseResult from multiprocessing import Process from urllib.request import urlopen, Request @@ -90,38 +90,38 @@ def set_common_headers(self): """ def _handle(self): - self.received_requests[self.path] = self.received_requests.get(self.path, 0) + 1 + parsed_path: ParseResult = urlparse(self.path) + path = parsed_path.path + self.received_requests[path] = self.received_requests.get(path, 0) + 1 try: - if self.path == "/webhook": + if path == "/webhook": self.send_response(200) self.set_common_headers() self.wfile.write("OK".encode("utf-8")) return - if self.path == "/received_requests.json": + if path == "/received_requests.json": self.send_response(200) self.set_common_headers() self.wfile.write(json.dumps(self.received_requests).encode("utf-8")) return body = {"ok": True} - if self.path == "/oauth.v2.access": + if path == "/oauth.v2.access": self.send_response(200) self.set_common_headers() self.wfile.write(self.oauth_v2_access_response.encode("utf-8")) return if self.is_valid_user_token(): - if self.path == "/auth.test": + if path == "/auth.test": self.send_response(200) self.set_common_headers() self.wfile.write(self.user_auth_test_response.encode("utf-8")) return if self.is_valid_token(): - parsed_path = urlparse(self.path) - - if self.path == "/auth.test": + if path == "/auth.test": self.send_response(200) self.set_common_headers() self.wfile.write(self.bot_auth_test_response.encode("utf-8")) @@ -148,7 +148,7 @@ def _handle(self): k: v[0] for k, v in parse_qs(parsed_path.query).items() } - self.logger.info(f"request body: {request_body}") + self.logger.info(f"request: {path} {request_body}") header = self.headers["authorization"] pattern = str(header).split("xoxb-", 1)[1] From 4ec44449ae7e331ec01871f99aae90de7c41eaef Mon Sep 17 00:00:00 2001 From: Jennifer Kramer Date: Wed, 25 Aug 2021 21:42:09 -0500 Subject: [PATCH 234/719] Fix app.html doc typo (#449) --- docs/api-docs/slack_bolt/app/app.html | 6 +++--- docs/api-docs/slack_bolt/app/async_app.html | 6 +++--- slack_bolt/app/app.py | 2 +- slack_bolt/app/async_app.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/api-docs/slack_bolt/app/app.html b/docs/api-docs/slack_bolt/app/app.html index 9d7e7ce51..1f10657ec 100644 --- a/docs/api-docs/slack_bolt/app/app.html +++ b/docs/api-docs/slack_bolt/app/app.html @@ -165,7 +165,7 @@

    Module slack_bolt.app.app

    Refer to https://slack.dev/bolt-python/tutorial/getting-started for details. - If yoy would like to build an OAuth app for enabling the app to run with multiple workspaces, + If you would like to build an OAuth app for enabling the app to run with multiple workspaces, refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app. Args: @@ -1492,7 +1492,7 @@

    Classes

    app.start(port=int(os.environ.get("PORT", 3000)))

    Refer to https://slack.dev/bolt-python/tutorial/getting-started for details.

    -

    If yoy would like to build an OAuth app for enabling the app to run with multiple workspaces, +

    If you would like to build an OAuth app for enabling the app to run with multiple workspaces, refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app.

    Args

    @@ -1607,7 +1607,7 @@

    Args

    Refer to https://slack.dev/bolt-python/tutorial/getting-started for details. - If yoy would like to build an OAuth app for enabling the app to run with multiple workspaces, + If you would like to build an OAuth app for enabling the app to run with multiple workspaces, refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app. Args: diff --git a/docs/api-docs/slack_bolt/app/async_app.html b/docs/api-docs/slack_bolt/app/async_app.html index 64942993c..618898025 100644 --- a/docs/api-docs/slack_bolt/app/async_app.html +++ b/docs/api-docs/slack_bolt/app/async_app.html @@ -175,7 +175,7 @@

    Module slack_bolt.app.async_app

    Refer to https://slack.dev/bolt-python/concepts#async for details. - If yoy would like to build an OAuth app for enabling the app to run with multiple workspaces, + If you would like to build an OAuth app for enabling the app to run with multiple workspaces, refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app. Args: @@ -1440,7 +1440,7 @@

    Classes

    app.start(port=int(os.environ.get("PORT", 3000)))

    Refer to https://slack.dev/bolt-python/concepts#async for details.

    -

    If yoy would like to build an OAuth app for enabling the app to run with multiple workspaces, +

    If you would like to build an OAuth app for enabling the app to run with multiple workspaces, refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app.

    Args

    @@ -1552,7 +1552,7 @@

    Args

    Refer to https://slack.dev/bolt-python/concepts#async for details. - If yoy would like to build an OAuth app for enabling the app to run with multiple workspaces, + If you would like to build an OAuth app for enabling the app to run with multiple workspaces, refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app. Args: diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index db6e973eb..7f843e452 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -137,7 +137,7 @@ def message_hello(message, say): Refer to https://slack.dev/bolt-python/tutorial/getting-started for details. - If yoy would like to build an OAuth app for enabling the app to run with multiple workspaces, + If you would like to build an OAuth app for enabling the app to run with multiple workspaces, refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app. Args: diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index f89d46c4d..718955c08 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -147,7 +147,7 @@ async def message_hello(message, say): # async function Refer to https://slack.dev/bolt-python/concepts#async for details. - If yoy would like to build an OAuth app for enabling the app to run with multiple workspaces, + If you would like to build an OAuth app for enabling the app to run with multiple workspaces, refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app. Args: From 05951c6f2c9316d9c64a1b07259d9e407d5ba00f Mon Sep 17 00:00:00 2001 From: Naveen Sangapala Date: Fri, 27 Aug 2021 17:48:58 -0700 Subject: [PATCH 235/719] Try lower then uppercase key value to extract cookie (#451) --- slack_bolt/adapter/aws_lambda/handler.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/slack_bolt/adapter/aws_lambda/handler.py b/slack_bolt/adapter/aws_lambda/handler.py index dc59d92c9..9037ac397 100644 --- a/slack_bolt/adapter/aws_lambda/handler.py +++ b/slack_bolt/adapter/aws_lambda/handler.py @@ -75,12 +75,6 @@ def handle(self, event, context): def to_bolt_request(event) -> BoltRequest: - """Note that this handler supports only the payload format 2.0. - This means you can use this with HTTP API while REST API is not supported. - - Read https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html - for more details. - """ body = event.get("body", "") if event["isBase64Encoded"]: body = base64.b64decode(body).decode("utf-8") @@ -88,7 +82,10 @@ def to_bolt_request(event) -> BoltRequest: if cookies is None or len(cookies) == 0: # In the case of format v1 multiValueHeaders = event.get("multiValueHeaders", {}) - cookies = multiValueHeaders.get("Cookie", []) + cookies = multiValueHeaders.get("cookie", []) + if len(cookies) == 0: + # Try using uppercase + cookies = multiValueHeaders.get("Cookie", []) headers = event.get("headers", {}) headers["cookie"] = cookies return BoltRequest( From 1272f891549b1f59f81f00ed4ede0e3ebb17872e Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 28 Aug 2021 09:51:03 +0900 Subject: [PATCH 236/719] version 1.8.1 --- .../adapter/aws_lambda/handler.html | 27 +++++++------------ docs/api-docs/slack_bolt/version.html | 2 +- slack_bolt/version.py | 2 +- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/docs/api-docs/slack_bolt/adapter/aws_lambda/handler.html b/docs/api-docs/slack_bolt/adapter/aws_lambda/handler.html index 0ef4a7b2c..8f6af7ce6 100644 --- a/docs/api-docs/slack_bolt/adapter/aws_lambda/handler.html +++ b/docs/api-docs/slack_bolt/adapter/aws_lambda/handler.html @@ -103,12 +103,6 @@

    Module slack_bolt.adapter.aws_lambda.handler

    def to_bolt_request(event) -> BoltRequest: - """Note that this handler supports only the payload format 2.0. - This means you can use this with HTTP API while REST API is not supported. - - Read https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html - for more details. - """ body = event.get("body", "") if event["isBase64Encoded"]: body = base64.b64decode(body).decode("utf-8") @@ -116,7 +110,10 @@

    Module slack_bolt.adapter.aws_lambda.handler

    if cookies is None or len(cookies) == 0: # In the case of format v1 multiValueHeaders = event.get("multiValueHeaders", {}) - cookies = multiValueHeaders.get("Cookie", []) + cookies = multiValueHeaders.get("cookie", []) + if len(cookies) == 0: + # Try using uppercase + cookies = multiValueHeaders.get("Cookie", []) headers = event.get("headers", {}) headers["cookie"] = cookies return BoltRequest( @@ -187,21 +184,12 @@

    Functions

    def to_bolt_request(event) ‑> BoltRequest
    -

    Note that this handler supports only the payload format 2.0. -This means you can use this with HTTP API while REST API is not supported.

    -

    Read https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html -for more details.

    +
    Expand source code
    def to_bolt_request(event) -> BoltRequest:
    -    """Note that this handler supports only the payload format 2.0.
    -    This means you can use this with HTTP API while REST API is not supported.
    -
    -    Read https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
    -    for more details.
    -    """
         body = event.get("body", "")
         if event["isBase64Encoded"]:
             body = base64.b64decode(body).decode("utf-8")
    @@ -209,7 +197,10 @@ 

    Functions

    if cookies is None or len(cookies) == 0: # In the case of format v1 multiValueHeaders = event.get("multiValueHeaders", {}) - cookies = multiValueHeaders.get("Cookie", []) + cookies = multiValueHeaders.get("cookie", []) + if len(cookies) == 0: + # Try using uppercase + cookies = multiValueHeaders.get("Cookie", []) headers = event.get("headers", {}) headers["cookie"] = cookies return BoltRequest( diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index 9ad0e32f7..d82713ad6 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.8.0"
    +__version__ = "1.8.1"
    diff --git a/slack_bolt/version.py b/slack_bolt/version.py index f9c62ba4d..65174d63d 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.8.0" +__version__ = "1.8.1" From 6684df65296868b942abea704a626958d7b54a24 Mon Sep 17 00:00:00 2001 From: Chris Bouchard Date: Sun, 29 Aug 2021 04:22:28 -0400 Subject: [PATCH 237/719] Allow a custom Executor in App (#453) Co-authored-by: Kazuhiro Sera --- slack_bolt/app/app.py | 9 ++++++++- slack_bolt/lazy_listener/thread_runner.py | 4 ++-- slack_bolt/listener/thread_runner.py | 6 +++--- tests/scenario_tests/test_app.py | 18 ++++++++++++++++++ 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 7f843e452..ef52b7c02 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -3,6 +3,7 @@ import logging import os import time +from concurrent.futures import Executor from concurrent.futures.thread import ThreadPoolExecutor from http.server import SimpleHTTPRequestHandler, HTTPServer from typing import List, Union, Pattern, Callable, Dict, Optional, Sequence, Any @@ -113,6 +114,8 @@ def __init__( oauth_flow: Optional[OAuthFlow] = None, # No need to set (the value is used only in response to ssl_check requests) verification_token: Optional[str] = None, + # Set this one only when you want to customize the executor + listener_executor: Optional[Executor] = None, ): """Bolt App that provides functionalities to register middleware/listeners. @@ -173,6 +176,8 @@ def message_hello(message, say): oauth_settings: The settings related to Slack app installation flow (OAuth flow) oauth_flow: Instantiated `slack_bolt.oauth.OAuthFlow`. This is always prioritized over oauth_settings. verification_token: Deprecated verification mechanism. This can used only for ssl_check requests. + listener_executor: Custom executor to run background tasks. If absent, the default `ThreadPoolExecutor` will + be used. """ signing_secret = signing_secret or os.environ.get("SLACK_SIGNING_SECRET") token = token or os.environ.get("SLACK_BOT_TOKEN") @@ -302,7 +307,9 @@ def message_hello(message, say): self._middleware_list: List[Union[Callable, Middleware]] = [] self._listeners: List[Listener] = [] - listener_executor = ThreadPoolExecutor(max_workers=5) + if listener_executor is None: + listener_executor = ThreadPoolExecutor(max_workers=5) + self._process_before_response = process_before_response self._listener_runner = ThreadListenerRunner( logger=self._framework_logger, diff --git a/slack_bolt/lazy_listener/thread_runner.py b/slack_bolt/lazy_listener/thread_runner.py index d2e7a09a0..3720f9ac5 100644 --- a/slack_bolt/lazy_listener/thread_runner.py +++ b/slack_bolt/lazy_listener/thread_runner.py @@ -1,4 +1,4 @@ -from concurrent.futures.thread import ThreadPoolExecutor +from concurrent.futures import Executor from logging import Logger from typing import Callable @@ -13,7 +13,7 @@ class ThreadLazyListenerRunner(LazyListenerRunner): def __init__( self, logger: Logger, - executor: ThreadPoolExecutor, + executor: Executor, ): self.logger = logger self.executor = executor diff --git a/slack_bolt/listener/thread_runner.py b/slack_bolt/listener/thread_runner.py index 74d20dd98..941926722 100644 --- a/slack_bolt/listener/thread_runner.py +++ b/slack_bolt/listener/thread_runner.py @@ -1,5 +1,5 @@ import time -from concurrent.futures.thread import ThreadPoolExecutor +from concurrent.futures import Executor from logging import Logger from typing import Optional, Callable @@ -22,7 +22,7 @@ class ThreadListenerRunner: process_before_response: bool listener_error_handler: ListenerErrorHandler listener_completion_handler: ListenerCompletionHandler - listener_executor: ThreadPoolExecutor + listener_executor: Executor lazy_listener_runner: LazyListenerRunner def __init__( @@ -31,7 +31,7 @@ def __init__( process_before_response: bool, listener_error_handler: ListenerErrorHandler, listener_completion_handler: ListenerCompletionHandler, - listener_executor: ThreadPoolExecutor, + listener_executor: Executor, lazy_listener_runner: LazyListenerRunner, ): self.logger = logger diff --git a/tests/scenario_tests/test_app.py b/tests/scenario_tests/test_app.py index 8d3a4a3db..936ad68ec 100644 --- a/tests/scenario_tests/test_app.py +++ b/tests/scenario_tests/test_app.py @@ -1,3 +1,5 @@ +from concurrent.futures import Executor + import pytest from slack_sdk import WebClient from slack_sdk.oauth.installation_store import FileInstallationStore @@ -56,6 +58,22 @@ def test_listener_registration_error(self): with pytest.raises(BoltError): app.action({"type": "invalid_type", "action_id": "a"})(self.simple_listener) + def test_listener_executor(self): + class TestExecutor(Executor): + """A executor that does nothing for testing""" + + pass + + executor = TestExecutor() + app = App( + signing_secret="valid", + client=self.web_client, + listener_executor=executor, + ) + + assert app.listener_runner.listener_executor == executor + assert app.listener_runner.lazy_listener_runner.executor == executor + # -------------------------- # single team auth # -------------------------- From 908daf46d5f0facb6bc18933969528564fee5f17 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 30 Aug 2021 17:32:17 +0900 Subject: [PATCH 238/719] Update the API doc generation script to use the latest pdoc3 --- scripts/generate_api_docs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/generate_api_docs.sh b/scripts/generate_api_docs.sh index 30e29c7b8..5362849f9 100755 --- a/scripts/generate_api_docs.sh +++ b/scripts/generate_api_docs.sh @@ -4,7 +4,7 @@ script_dir=`dirname $0` cd ${script_dir}/.. -pip install pdoc3 +pip install -U pdoc3 rm -rf docs/api-docs pdoc slack_bolt --html -o docs/api-docs open docs/api-docs/slack_bolt/index.html From 9ca77da077cf21630018d1fd5a82bf2486e1dd2a Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 31 Aug 2021 13:09:12 +0900 Subject: [PATCH 239/719] Fix #454 Add oauth_settings.state_validation_enabled to customize the OAuth flow (#455) * Fix #454 Add oauth_settings.state_validation_enabled to customize the OAuth flow * Add more tests --- slack_bolt/oauth/async_oauth_flow.py | 78 +++++++++++-------- slack_bolt/oauth/async_oauth_settings.py | 4 + slack_bolt/oauth/oauth_flow.py | 77 ++++++++++-------- slack_bolt/oauth/oauth_settings.py | 4 + tests/slack_bolt/oauth/test_oauth_flow.py | 73 ++++++++++++++++- .../oauth/test_async_oauth_flow.py | 71 +++++++++++++++++ 6 files changed, 237 insertions(+), 70 deletions(-) diff --git a/slack_bolt/oauth/async_oauth_flow.py b/slack_bolt/oauth/async_oauth_flow.py index 29ccb9ef3..b086c0b2a 100644 --- a/slack_bolt/oauth/async_oauth_flow.py +++ b/slack_bolt/oauth/async_oauth_flow.py @@ -161,30 +161,32 @@ def sqlite3( # ----------------------------- async def handle_installation(self, request: AsyncBoltRequest) -> BoltResponse: - state = await self.issue_new_state(request) - url = await self.build_authorize_url(state, request) - set_cookie_value = self.settings.state_utils.build_set_cookie_for_new_state( - state - ) + set_cookie_value: Optional[str] = None + url = await self.build_authorize_url("", request) + if self.settings.state_validation_enabled is True: + state = await self.issue_new_state(request) + url = await self.build_authorize_url(state, request) + set_cookie_value = self.settings.state_utils.build_set_cookie_for_new_state( + state + ) if self.settings.install_page_rendering_enabled: html = await self.build_install_page_html(url, request) return BoltResponse( status=200, body=html, - headers={ - "Content-Type": "text/html; charset=utf-8", - "Set-Cookie": [set_cookie_value], - }, + headers=await self.append_set_cookie_headers( + {"Content-Type": "text/html; charset=utf-8"}, + set_cookie_value, + ), ) else: return BoltResponse( status=302, body="", - headers={ - "Content-Type": "text/html; charset=utf-8", - "Location": url, - "Set-Cookie": [set_cookie_value], - }, + headers=await self.append_set_cookie_headers( + {"Content-Type": "text/html; charset=utf-8", "Location": url}, + set_cookie_value, + ), ) # ---------------------- @@ -199,6 +201,13 @@ async def build_authorize_url(self, state: str, request: AsyncBoltRequest) -> st async def build_install_page_html(self, url: str, request: AsyncBoltRequest) -> str: return _build_default_install_page_html(url) + async def append_set_cookie_headers( + self, headers: dict, set_cookie_value: Optional[str] + ): + if set_cookie_value is not None: + headers["Set-Cookie"] = [set_cookie_value] + return headers + # ----------------------------- # Callback # ----------------------------- @@ -219,29 +228,30 @@ async def handle_callback(self, request: AsyncBoltRequest) -> BoltResponse: ) # state parameter verification - state: Optional[str] = request.query.get("state", [None])[0] - if not self.settings.state_utils.is_valid_browser(state, request.headers): - return await self.failure_handler( - AsyncFailureArgs( - request=request, - reason="invalid_browser", - suggested_status_code=400, - settings=self.settings, - default=self.default_callback_options, + if self.settings.state_validation_enabled is True: + state: Optional[str] = request.query.get("state", [None])[0] + if not self.settings.state_utils.is_valid_browser(state, request.headers): + return await self.failure_handler( + AsyncFailureArgs( + request=request, + reason="invalid_browser", + suggested_status_code=400, + settings=self.settings, + default=self.default_callback_options, + ) ) - ) - valid_state_consumed = await self.settings.state_store.async_consume(state) - if not valid_state_consumed: - return await self.failure_handler( - AsyncFailureArgs( - request=request, - reason="invalid_state", - suggested_status_code=401, - settings=self.settings, - default=self.default_callback_options, + valid_state_consumed = await self.settings.state_store.async_consume(state) + if not valid_state_consumed: + return await self.failure_handler( + AsyncFailureArgs( + request=request, + reason="invalid_state", + suggested_status_code=401, + settings=self.settings, + default=self.default_callback_options, + ) ) - ) # run installation code = request.query.get("code", [None])[0] diff --git a/slack_bolt/oauth/async_oauth_settings.py b/slack_bolt/oauth/async_oauth_settings.py index 7b347eed5..dc6f112c5 100644 --- a/slack_bolt/oauth/async_oauth_settings.py +++ b/slack_bolt/oauth/async_oauth_settings.py @@ -44,6 +44,7 @@ class AsyncOAuthSettings: token_rotation_expiration_minutes: int authorize: AsyncAuthorize # state parameter related configurations + state_validation_enabled: bool state_store: AsyncOAuthStateStore state_cookie_name: str state_expiration_seconds: int @@ -76,6 +77,7 @@ def __init__( installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, # state parameter related configurations + state_validation_enabled: bool = True, state_store: Optional[AsyncOAuthStateStore] = None, state_cookie_name: str = OAuthStateUtils.default_cookie_name, state_expiration_seconds: int = OAuthStateUtils.default_expiration_seconds, @@ -100,6 +102,7 @@ def __init__( installation_store: Specify the instance of `InstallationStore` (Default: `FileInstallationStore`) installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) token_rotation_expiration_minutes: Minutes before refreshing tokens (Default: 2 hours) + state_validation_enabled: Set False if your OAuth flow omits the state parameter validation (Default: True) state_store: Specify the instance of `InstallationStore` (Default: `FileOAuthStateStore`) state_cookie_name: The cookie name that is set for installers' browser. (Default: "slack-app-oauth-state") state_expiration_seconds: The seconds that the state value is alive (Default: 600 seconds) @@ -153,6 +156,7 @@ def __init__( bot_only=self.installation_store_bot_only, ) # state parameter related configurations + self.state_validation_enabled = state_validation_enabled self.state_store = state_store or FileOAuthStateStore( expiration_seconds=state_expiration_seconds, client_id=client_id, diff --git a/slack_bolt/oauth/oauth_flow.py b/slack_bolt/oauth/oauth_flow.py index 4b65858ac..daf23c761 100644 --- a/slack_bolt/oauth/oauth_flow.py +++ b/slack_bolt/oauth/oauth_flow.py @@ -158,30 +158,33 @@ def sqlite3( # ----------------------------- def handle_installation(self, request: BoltRequest) -> BoltResponse: - state = self.issue_new_state(request) - url = self.build_authorize_url(state, request) - set_cookie_value = self.settings.state_utils.build_set_cookie_for_new_state( - state - ) + set_cookie_value: Optional[str] = None + url = self.build_authorize_url("", request) + if self.settings.state_validation_enabled is True: + state = self.issue_new_state(request) + url = self.build_authorize_url(state, request) + set_cookie_value = self.settings.state_utils.build_set_cookie_for_new_state( + state + ) + if self.settings.install_page_rendering_enabled: html = self.build_install_page_html(url, request) return BoltResponse( status=200, body=html, - headers={ - "Content-Type": "text/html; charset=utf-8", - "Set-Cookie": [set_cookie_value], - }, + headers=self.append_set_cookie_headers( + {"Content-Type": "text/html; charset=utf-8"}, + set_cookie_value, + ), ) else: return BoltResponse( status=302, body="", - headers={ - "Content-Type": "text/html; charset=utf-8", - "Location": url, - "Set-Cookie": [set_cookie_value], - }, + headers=self.append_set_cookie_headers( + {"Content-Type": "text/html; charset=utf-8", "Location": url}, + set_cookie_value, + ), ) # ---------------------- @@ -196,6 +199,11 @@ def build_authorize_url(self, state: str, request: BoltRequest) -> str: def build_install_page_html(self, url: str, request: BoltRequest) -> str: return _build_default_install_page_html(url) + def append_set_cookie_headers(self, headers: dict, set_cookie_value: Optional[str]): + if set_cookie_value is not None: + headers["Set-Cookie"] = [set_cookie_value] + return headers + # ----------------------------- # Callback # ----------------------------- @@ -216,29 +224,30 @@ def handle_callback(self, request: BoltRequest) -> BoltResponse: ) # state parameter verification - state = request.query.get("state", [None])[0] - if not self.settings.state_utils.is_valid_browser(state, request.headers): - return self.failure_handler( - FailureArgs( - request=request, - reason="invalid_browser", - suggested_status_code=400, - settings=self.settings, - default=self.default_callback_options, + if self.settings.state_validation_enabled is True: + state = request.query.get("state", [None])[0] + if not self.settings.state_utils.is_valid_browser(state, request.headers): + return self.failure_handler( + FailureArgs( + request=request, + reason="invalid_browser", + suggested_status_code=400, + settings=self.settings, + default=self.default_callback_options, + ) ) - ) - valid_state_consumed = self.settings.state_store.consume(state) - if not valid_state_consumed: - return self.failure_handler( - FailureArgs( - request=request, - reason="invalid_state", - suggested_status_code=401, - settings=self.settings, - default=self.default_callback_options, + valid_state_consumed = self.settings.state_store.consume(state) + if not valid_state_consumed: + return self.failure_handler( + FailureArgs( + request=request, + reason="invalid_state", + suggested_status_code=401, + settings=self.settings, + default=self.default_callback_options, + ) ) - ) # run installation code = request.query.get("code", [None])[0] diff --git a/slack_bolt/oauth/oauth_settings.py b/slack_bolt/oauth/oauth_settings.py index 2217f65f3..88ac04567 100644 --- a/slack_bolt/oauth/oauth_settings.py +++ b/slack_bolt/oauth/oauth_settings.py @@ -39,6 +39,7 @@ class OAuthSettings: token_rotation_expiration_minutes: int authorize: Authorize # state parameter related configurations + state_validation_enabled: bool state_store: OAuthStateStore state_cookie_name: str state_expiration_seconds: int @@ -71,6 +72,7 @@ def __init__( installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, # state parameter related configurations + state_validation_enabled: bool = True, state_store: Optional[OAuthStateStore] = None, state_cookie_name: str = OAuthStateUtils.default_cookie_name, state_expiration_seconds: int = OAuthStateUtils.default_expiration_seconds, @@ -95,6 +97,7 @@ def __init__( installation_store: Specify the instance of `InstallationStore` (Default: `FileInstallationStore`) installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) token_rotation_expiration_minutes: Minutes before refreshing tokens (Default: 2 hours) + state_validation_enabled: Set False if your OAuth flow omits the state parameter validation (Default: True) state_store: Specify the instance of `InstallationStore` (Default: `FileOAuthStateStore`) state_cookie_name: The cookie name that is set for installers' browser. (Default: "slack-app-oauth-state") state_expiration_seconds: The seconds that the state value is alive (Default: 600 seconds) @@ -147,6 +150,7 @@ def __init__( bot_only=self.installation_store_bot_only, ) # state parameter related configurations + self.state_validation_enabled = state_validation_enabled self.state_store = state_store or FileOAuthStateStore( expiration_seconds=state_expiration_seconds, client_id=client_id, diff --git a/tests/slack_bolt/oauth/test_oauth_flow.py b/tests/slack_bolt/oauth/test_oauth_flow.py index a43db0b5f..fe1665660 100644 --- a/tests/slack_bolt/oauth/test_oauth_flow.py +++ b/tests/slack_bolt/oauth/test_oauth_flow.py @@ -4,7 +4,10 @@ from slack_sdk import WebClient from slack_sdk.oauth.installation_store import FileInstallationStore -from slack_sdk.oauth.state_store import FileOAuthStateStore +from slack_sdk.oauth.state_store import ( + OAuthStateStore, + FileOAuthStateStore, +) from slack_sdk.signature import SignatureVerifier from slack_bolt import BoltRequest, BoltResponse, App @@ -56,10 +59,11 @@ def test_handle_installation_default(self): resp = oauth_flow.handle_installation(req) assert resp.status == 200 assert resp.headers.get("content-type") == ["text/html; charset=utf-8"] + assert resp.headers.get("set-cookie") is not None assert "https://slack.com/oauth/v2/authorize?state=" in resp.body # https://github.com/slackapi/bolt-python/issues/183 - # For direct install URL suppport + # For direct install URL support def test_handle_installation_no_rendering(self): oauth_flow = OAuthFlow( settings=OAuthSettings( @@ -77,6 +81,25 @@ def test_handle_installation_no_rendering(self): assert resp.status == 302 location_header = resp.headers.get("location")[0] assert "https://slack.com/oauth/v2/authorize?state=" in location_header + assert resp.headers.get("set-cookie") is not None + + def test_handle_installation_no_state_validation(self): + oauth_flow = OAuthFlow( + settings=OAuthSettings( + client_id="111.222", + client_secret="xxx", + scopes=["chat:write", "commands"], + user_scopes=["search:read"], + installation_store=FileInstallationStore(), + install_page_rendering_enabled=False, # disabled + state_validation_enabled=False, # disabled + state_store=None, + ) + ) + req = BoltRequest(body="") + resp = oauth_flow.handle_installation(req) + assert resp.status == 302 + assert resp.headers.get("set-cookie") is None def test_scopes_as_str(self): settings = OAuthSettings( @@ -160,6 +183,52 @@ def test_handle_callback_invalid_state(self): resp = oauth_flow.handle_callback(req) assert resp.status == 400 + def test_handle_callback_already_expired_state(self): + class MyOAuthStateStore(OAuthStateStore): + def issue(self, *args, **kwargs) -> str: + return "expired_one" + + def consume(self, state: str) -> bool: + return False + + oauth_flow = OAuthFlow( + settings=OAuthSettings( + client_id="111.222", + client_secret="xxx", + scopes=["chat:write", "commands"], + state_store=MyOAuthStateStore(), + ) + ) + state = oauth_flow.issue_new_state(None) + req = BoltRequest( + body="", + query=f"code=foo&state={state}", + headers={"cookie": [f"{oauth_flow.settings.state_cookie_name}={state}"]}, + ) + resp = oauth_flow.handle_callback(req) + assert resp.status == 401 + + def test_handle_callback_no_state_validation(self): + oauth_flow = OAuthFlow( + client=WebClient(base_url=self.mock_api_server_base_url), + settings=OAuthSettings( + client_id="111.222", + client_secret="xxx", + scopes=["chat:write", "commands"], + installation_store=FileInstallationStore(), + state_validation_enabled=False, # disabled + state_store=None, + ), + ) + state = oauth_flow.issue_new_state(None) + req = BoltRequest( + body="", + query=f"code=foo&state=invalid", + headers={"cookie": [f"{oauth_flow.settings.state_cookie_name}={state}"]}, + ) + resp = oauth_flow.handle_callback(req) + assert resp.status == 200 + def test_handle_callback_using_options(self): def success(args: SuccessArgs) -> BoltResponse: assert args.request is not None diff --git a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py index eea474b87..9a4787a6f 100644 --- a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py +++ b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py @@ -6,6 +6,7 @@ import pytest from slack_sdk.oauth.installation_store import FileInstallationStore from slack_sdk.oauth.state_store import FileOAuthStateStore +from slack_sdk.oauth.state_store.async_state_store import AsyncOAuthStateStore from slack_sdk.signature import SignatureVerifier from slack_sdk.web.async_client import AsyncWebClient @@ -108,6 +109,7 @@ async def test_handle_installation_default(self): assert resp.status == 200 assert resp.headers.get("content-type") == ["text/html; charset=utf-8"] assert "https://slack.com/oauth/v2/authorize?state=" in resp.body + assert resp.headers.get("set-cookie") is not None @pytest.mark.asyncio async def test_handle_installation_no_rendering(self): @@ -126,6 +128,27 @@ async def test_handle_installation_no_rendering(self): assert resp.status == 302 location_header = resp.headers.get("location")[0] assert "https://slack.com/oauth/v2/authorize?state=" in location_header + assert resp.headers.get("set-cookie") is not None + + @pytest.mark.asyncio + async def test_handle_installation_no_state_validation(self): + oauth_flow = AsyncOAuthFlow( + settings=AsyncOAuthSettings( + client_id="111.222", + client_secret="xxx", + scopes=["chat:write", "commands"], + installation_store=FileInstallationStore(), + install_page_rendering_enabled=False, # disabled + state_validation_enabled=False, # disabled + state_store=FileOAuthStateStore(expiration_seconds=120), + ) + ) + req = AsyncBoltRequest(body="") + resp = await oauth_flow.handle_installation(req) + assert resp.status == 302 + location_header = resp.headers.get("location")[0] + assert "https://slack.com/oauth/v2/authorize?state=" in location_header + assert resp.headers.get("set-cookie") is None @pytest.mark.asyncio async def test_handle_callback(self): @@ -201,6 +224,54 @@ async def test_handle_callback_invalid_state(self): resp = await oauth_flow.handle_callback(req) assert resp.status == 400 + @pytest.mark.asyncio + async def test_handle_callback_invalid_state(self): + class MyOAuthStateStore(AsyncOAuthStateStore): + async def async_issue(self, *args, **kwargs) -> str: + return "expired_one" + + async def async_consume(self, state: str) -> bool: + return False + + oauth_flow = AsyncOAuthFlow( + settings=AsyncOAuthSettings( + client_id="111.222", + client_secret="xxx", + scopes=["chat:write", "commands"], + state_store=MyOAuthStateStore(), + ) + ) + state = await oauth_flow.issue_new_state(None) + req = AsyncBoltRequest( + body="", + query=f"code=foo&state={state}", + headers={"cookie": [f"{oauth_flow.settings.state_cookie_name}={state}"]}, + ) + resp = await oauth_flow.handle_callback(req) + assert resp.status == 401 + + @pytest.mark.asyncio + async def test_handle_callback_no_state_validation(self): + oauth_flow = AsyncOAuthFlow( + client=AsyncWebClient(base_url=self.mock_api_server_base_url), + settings=AsyncOAuthSettings( + client_id="111.222", + client_secret="xxx", + scopes=["chat:write", "commands"], + installation_store=FileInstallationStore(), + state_validation_enabled=False, # disabled + state_store=None, + ), + ) + state = await oauth_flow.issue_new_state(None) + req = AsyncBoltRequest( + body="", + query=f"code=foo&state=invalid", + headers={"cookie": [f"{oauth_flow.settings.state_cookie_name}={state}"]}, + ) + resp = await oauth_flow.handle_callback(req) + assert resp.status == 200 + @pytest.mark.asyncio async def test_handle_callback_using_options(self): async def success(args: AsyncSuccessArgs) -> BoltResponse: From 28824cf6231cc7a96cf2e57ffe29cf6a390b881d Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 31 Aug 2021 13:43:44 +0900 Subject: [PATCH 240/719] version 1.9.0 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 65174d63d..2e6e949f5 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.8.1" +__version__ = "1.9.0" From 568c1681fe531f3325f072f74ecc7f64c2212d12 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 31 Aug 2021 13:44:34 +0900 Subject: [PATCH 241/719] Apply API document changes for v1.9.0 --- .../slack_bolt/adapter/aiohttp/index.html | 4 +- .../adapter/aws_lambda/chalice_handler.html | 4 +- .../chalice_lazy_listener_runner.html | 4 +- .../adapter/aws_lambda/handler.html | 4 +- .../slack_bolt/adapter/aws_lambda/index.html | 4 +- .../adapter/aws_lambda/internals.html | 4 +- .../aws_lambda/lambda_s3_oauth_flow.html | 4 +- .../aws_lambda/lazy_listener_runner.html | 4 +- .../aws_lambda/local_lambda_client.html | 4 +- .../slack_bolt/adapter/bottle/handler.html | 6 +- .../slack_bolt/adapter/bottle/index.html | 4 +- .../slack_bolt/adapter/cherrypy/handler.html | 6 +- .../slack_bolt/adapter/cherrypy/index.html | 4 +- .../slack_bolt/adapter/django/handler.html | 6 +- .../slack_bolt/adapter/django/index.html | 4 +- .../slack_bolt/adapter/falcon/index.html | 4 +- .../slack_bolt/adapter/falcon/resource.html | 4 +- .../adapter/fastapi/async_handler.html | 4 +- .../slack_bolt/adapter/fastapi/index.html | 4 +- .../slack_bolt/adapter/flask/handler.html | 4 +- .../slack_bolt/adapter/flask/index.html | 4 +- docs/api-docs/slack_bolt/adapter/index.html | 4 +- .../slack_bolt/adapter/pyramid/handler.html | 4 +- .../slack_bolt/adapter/pyramid/index.html | 4 +- .../adapter/sanic/async_handler.html | 4 +- .../slack_bolt/adapter/sanic/index.html | 4 +- .../adapter/socket_mode/aiohttp/index.html | 4 +- .../socket_mode/async_base_handler.html | 6 +- .../adapter/socket_mode/async_handler.html | 4 +- .../adapter/socket_mode/async_internals.html | 4 +- .../adapter/socket_mode/base_handler.html | 6 +- .../adapter/socket_mode/builtin/index.html | 4 +- .../slack_bolt/adapter/socket_mode/index.html | 4 +- .../adapter/socket_mode/internals.html | 4 +- .../socket_mode/websocket_client/index.html | 4 +- .../adapter/socket_mode/websockets/index.html | 4 +- .../adapter/starlette/async_handler.html | 4 +- .../slack_bolt/adapter/starlette/handler.html | 4 +- .../slack_bolt/adapter/starlette/index.html | 4 +- .../slack_bolt/adapter/tornado/handler.html | 6 +- .../slack_bolt/adapter/tornado/index.html | 4 +- docs/api-docs/slack_bolt/app/app.html | 36 ++- docs/api-docs/slack_bolt/app/async_app.html | 12 +- .../api-docs/slack_bolt/app/async_server.html | 6 +- docs/api-docs/slack_bolt/app/index.html | 4 +- docs/api-docs/slack_bolt/async_app.html | 4 +- .../authorization/async_authorize.html | 4 +- .../authorization/async_authorize_args.html | 4 +- .../slack_bolt/authorization/authorize.html | 4 +- .../authorization/authorize_args.html | 4 +- .../authorization/authorize_result.html | 4 +- .../slack_bolt/authorization/index.html | 4 +- docs/api-docs/slack_bolt/context/ack/ack.html | 4 +- .../slack_bolt/context/ack/async_ack.html | 4 +- .../slack_bolt/context/ack/index.html | 4 +- .../slack_bolt/context/ack/internals.html | 4 +- .../slack_bolt/context/async_context.html | 4 +- .../slack_bolt/context/base_context.html | 4 +- docs/api-docs/slack_bolt/context/context.html | 4 +- docs/api-docs/slack_bolt/context/index.html | 4 +- .../context/respond/async_respond.html | 4 +- .../slack_bolt/context/respond/index.html | 4 +- .../slack_bolt/context/respond/internals.html | 4 +- .../slack_bolt/context/respond/respond.html | 4 +- .../slack_bolt/context/say/async_say.html | 4 +- .../slack_bolt/context/say/index.html | 4 +- .../slack_bolt/context/say/internals.html | 4 +- docs/api-docs/slack_bolt/context/say/say.html | 4 +- docs/api-docs/slack_bolt/error/index.html | 4 +- docs/api-docs/slack_bolt/index.html | 4 +- .../slack_bolt/kwargs_injection/args.html | 10 +- .../kwargs_injection/async_args.html | 10 +- .../kwargs_injection/async_utils.html | 6 +- .../slack_bolt/kwargs_injection/index.html | 4 +- .../slack_bolt/kwargs_injection/utils.html | 6 +- .../lazy_listener/async_internals.html | 6 +- .../lazy_listener/async_runner.html | 8 +- .../lazy_listener/asyncio_runner.html | 4 +- .../slack_bolt/lazy_listener/index.html | 4 +- .../slack_bolt/lazy_listener/internals.html | 6 +- .../slack_bolt/lazy_listener/runner.html | 8 +- .../lazy_listener/thread_runner.html | 12 +- .../slack_bolt/listener/async_builtins.html | 8 +- .../slack_bolt/listener/async_listener.html | 14 +- .../async_listener_completion_handler.html | 8 +- .../async_listener_error_handler.html | 6 +- .../slack_bolt/listener/asyncio_runner.html | 4 +- .../slack_bolt/listener/builtins.html | 8 +- .../slack_bolt/listener/custom_listener.html | 8 +- docs/api-docs/slack_bolt/listener/index.html | 4 +- .../slack_bolt/listener/listener.html | 6 +- .../listener/listener_completion_handler.html | 8 +- .../listener/listener_error_handler.html | 6 +- .../slack_bolt/listener/thread_runner.html | 18 +- .../listener_matcher/async_builtins.html | 4 +- .../async_listener_matcher.html | 4 +- .../slack_bolt/listener_matcher/builtins.html | 6 +- .../custom_listener_matcher.html | 4 +- .../slack_bolt/listener_matcher/index.html | 4 +- .../listener_matcher/listener_matcher.html | 4 +- docs/api-docs/slack_bolt/logger/index.html | 4 +- docs/api-docs/slack_bolt/logger/messages.html | 4 +- .../slack_bolt/middleware/async_builtins.html | 4 +- .../middleware/async_custom_middleware.html | 4 +- .../middleware/async_middleware.html | 4 +- .../async_middleware_error_handler.html | 6 +- .../authorization/async_authorization.html | 4 +- .../authorization/async_internals.html | 4 +- .../async_multi_teams_authorization.html | 4 +- .../async_single_team_authorization.html | 4 +- .../authorization/authorization.html | 4 +- .../middleware/authorization/index.html | 4 +- .../middleware/authorization/internals.html | 4 +- .../multi_teams_authorization.html | 4 +- .../single_team_authorization.html | 4 +- .../middleware/custom_middleware.html | 4 +- .../async_ignoring_self_events.html | 4 +- .../ignoring_self_events.html | 4 +- .../ignoring_self_events/index.html | 4 +- .../api-docs/slack_bolt/middleware/index.html | 4 +- .../async_message_listener_matches.html | 4 +- .../message_listener_matches/index.html | 4 +- .../message_listener_matches.html | 4 +- .../slack_bolt/middleware/middleware.html | 4 +- .../middleware/middleware_error_handler.html | 6 +- .../async_request_verification.html | 4 +- .../request_verification/index.html | 4 +- .../request_verification.html | 4 +- .../middleware/ssl_check/async_ssl_check.html | 4 +- .../middleware/ssl_check/index.html | 4 +- .../middleware/ssl_check/ssl_check.html | 4 +- .../async_url_verification.html | 4 +- .../middleware/url_verification/index.html | 4 +- .../url_verification/url_verification.html | 4 +- .../oauth/async_callback_options.html | 4 +- .../slack_bolt/oauth/async_internals.html | 4 +- .../slack_bolt/oauth/async_oauth_flow.html | 249 ++++++++++-------- .../oauth/async_oauth_settings.html | 21 +- .../slack_bolt/oauth/callback_options.html | 4 +- docs/api-docs/slack_bolt/oauth/index.html | 4 +- docs/api-docs/slack_bolt/oauth/internals.html | 4 +- .../api-docs/slack_bolt/oauth/oauth_flow.html | 246 +++++++++-------- .../slack_bolt/oauth/oauth_settings.html | 21 +- .../slack_bolt/request/async_internals.html | 4 +- .../slack_bolt/request/async_request.html | 6 +- docs/api-docs/slack_bolt/request/index.html | 4 +- .../slack_bolt/request/internals.html | 6 +- .../slack_bolt/request/payload_utils.html | 4 +- docs/api-docs/slack_bolt/request/request.html | 6 +- docs/api-docs/slack_bolt/response/index.html | 4 +- .../slack_bolt/response/response.html | 4 +- .../api-docs/slack_bolt/util/async_utils.html | 4 +- docs/api-docs/slack_bolt/util/index.html | 4 +- docs/api-docs/slack_bolt/util/utils.html | 4 +- docs/api-docs/slack_bolt/version.html | 6 +- docs/api-docs/slack_bolt/workflows/index.html | 4 +- .../slack_bolt/workflows/step/async_step.html | 10 +- .../workflows/step/async_step_middleware.html | 4 +- .../slack_bolt/workflows/step/index.html | 4 +- .../slack_bolt/workflows/step/internals.html | 4 +- .../slack_bolt/workflows/step/step.html | 10 +- .../workflows/step/step_middleware.html | 4 +- .../step/utilities/async_complete.html | 4 +- .../step/utilities/async_configure.html | 4 +- .../workflows/step/utilities/async_fail.html | 4 +- .../step/utilities/async_update.html | 4 +- .../workflows/step/utilities/complete.html | 4 +- .../workflows/step/utilities/configure.html | 4 +- .../workflows/step/utilities/fail.html | 4 +- .../workflows/step/utilities/index.html | 4 +- .../workflows/step/utilities/update.html | 4 +- 171 files changed, 748 insertions(+), 623 deletions(-) diff --git a/docs/api-docs/slack_bolt/adapter/aiohttp/index.html b/docs/api-docs/slack_bolt/adapter/aiohttp/index.html index 3e4659719..a565a067d 100644 --- a/docs/api-docs/slack_bolt/adapter/aiohttp/index.html +++ b/docs/api-docs/slack_bolt/adapter/aiohttp/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.aiohttp API documentation @@ -155,7 +155,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html b/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html index c46bbd7df..53132d9a8 100644 --- a/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html +++ b/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.aws_lambda.chalice_handler API documentation @@ -404,7 +404,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_lazy_listener_runner.html b/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_lazy_listener_runner.html index f4780c6d9..7a517cc79 100644 --- a/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_lazy_listener_runner.html +++ b/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_lazy_listener_runner.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.aws_lambda.chalice_lazy_listener_runner API documentation @@ -168,7 +168,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/aws_lambda/handler.html b/docs/api-docs/slack_bolt/adapter/aws_lambda/handler.html index 8f6af7ce6..ec31815d9 100644 --- a/docs/api-docs/slack_bolt/adapter/aws_lambda/handler.html +++ b/docs/api-docs/slack_bolt/adapter/aws_lambda/handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.aws_lambda.handler API documentation @@ -402,7 +402,7 @@

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/aws_lambda/index.html b/docs/api-docs/slack_bolt/adapter/aws_lambda/index.html index 0aec8cf2b..c82448803 100644 --- a/docs/api-docs/slack_bolt/adapter/aws_lambda/index.html +++ b/docs/api-docs/slack_bolt/adapter/aws_lambda/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.aws_lambda API documentation @@ -95,7 +95,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/aws_lambda/internals.html b/docs/api-docs/slack_bolt/adapter/aws_lambda/internals.html index 2afb7faa3..653a3c7f0 100644 --- a/docs/api-docs/slack_bolt/adapter/aws_lambda/internals.html +++ b/docs/api-docs/slack_bolt/adapter/aws_lambda/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.aws_lambda.internals API documentation @@ -61,7 +61,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.html b/docs/api-docs/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.html index 3636bcde1..18a54947e 100644 --- a/docs/api-docs/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.html +++ b/docs/api-docs/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.aws_lambda.lambda_s3_oauth_flow API documentation @@ -311,7 +311,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/aws_lambda/lazy_listener_runner.html b/docs/api-docs/slack_bolt/adapter/aws_lambda/lazy_listener_runner.html index 8cdb35c32..248bf151e 100644 --- a/docs/api-docs/slack_bolt/adapter/aws_lambda/lazy_listener_runner.html +++ b/docs/api-docs/slack_bolt/adapter/aws_lambda/lazy_listener_runner.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.aws_lambda.lazy_listener_runner API documentation @@ -151,7 +151,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/aws_lambda/local_lambda_client.html b/docs/api-docs/slack_bolt/adapter/aws_lambda/local_lambda_client.html index 64f926fcf..101024e4b 100644 --- a/docs/api-docs/slack_bolt/adapter/aws_lambda/local_lambda_client.html +++ b/docs/api-docs/slack_bolt/adapter/aws_lambda/local_lambda_client.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.aws_lambda.local_lambda_client API documentation @@ -158,7 +158,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/bottle/handler.html b/docs/api-docs/slack_bolt/adapter/bottle/handler.html index cb218e70b..dc2026611 100644 --- a/docs/api-docs/slack_bolt/adapter/bottle/handler.html +++ b/docs/api-docs/slack_bolt/adapter/bottle/handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.bottle.handler API documentation @@ -85,7 +85,7 @@

    Module slack_bolt.adapter.bottle.handler

    Functions

    -def set_response(bolt_resp: BoltResponse, resp: bottle.BaseResponse) ‑> NoneType +def set_response(bolt_resp: BoltResponse, resp: bottle.BaseResponse) ‑> None
    @@ -227,7 +227,7 @@

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/bottle/index.html b/docs/api-docs/slack_bolt/adapter/bottle/index.html index 846b83033..924b14de2 100644 --- a/docs/api-docs/slack_bolt/adapter/bottle/index.html +++ b/docs/api-docs/slack_bolt/adapter/bottle/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.bottle API documentation @@ -65,7 +65,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/cherrypy/handler.html b/docs/api-docs/slack_bolt/adapter/cherrypy/handler.html index 7260c06fc..ae21f5d27 100644 --- a/docs/api-docs/slack_bolt/adapter/cherrypy/handler.html +++ b/docs/api-docs/slack_bolt/adapter/cherrypy/handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.cherrypy.handler API documentation @@ -136,7 +136,7 @@

    Functions

    -def set_response_status_and_headers(bolt_resp: BoltResponse) ‑> NoneType +def set_response_status_and_headers(bolt_resp: BoltResponse) ‑> None
    @@ -301,7 +301,7 @@

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/cherrypy/index.html b/docs/api-docs/slack_bolt/adapter/cherrypy/index.html index 68bdf158c..e1df7c0b1 100644 --- a/docs/api-docs/slack_bolt/adapter/cherrypy/index.html +++ b/docs/api-docs/slack_bolt/adapter/cherrypy/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.cherrypy API documentation @@ -65,7 +65,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/django/handler.html b/docs/api-docs/slack_bolt/adapter/django/handler.html index 690876c6a..24e8cdf4b 100644 --- a/docs/api-docs/slack_bolt/adapter/django/handler.html +++ b/docs/api-docs/slack_bolt/adapter/django/handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.django.handler API documentation @@ -298,7 +298,7 @@

    Inherited members

    class DjangoThreadLazyListenerRunner -(logger: logging.Logger, executor: concurrent.futures.thread.ThreadPoolExecutor) +(logger: logging.Logger, executor: concurrent.futures._base.Executor)
    @@ -486,7 +486,7 @@

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/django/index.html b/docs/api-docs/slack_bolt/adapter/django/index.html index 715e263a9..9c41c9e8e 100644 --- a/docs/api-docs/slack_bolt/adapter/django/index.html +++ b/docs/api-docs/slack_bolt/adapter/django/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.django API documentation @@ -65,7 +65,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/falcon/index.html b/docs/api-docs/slack_bolt/adapter/falcon/index.html index 5d7cc5f62..10e949002 100644 --- a/docs/api-docs/slack_bolt/adapter/falcon/index.html +++ b/docs/api-docs/slack_bolt/adapter/falcon/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.falcon API documentation @@ -65,7 +65,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/falcon/resource.html b/docs/api-docs/slack_bolt/adapter/falcon/resource.html index 1b8b68f72..ae29f18b2 100644 --- a/docs/api-docs/slack_bolt/adapter/falcon/resource.html +++ b/docs/api-docs/slack_bolt/adapter/falcon/resource.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.falcon.resource API documentation @@ -262,7 +262,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/fastapi/async_handler.html b/docs/api-docs/slack_bolt/adapter/fastapi/async_handler.html index eaa539c18..d43ab4b33 100644 --- a/docs/api-docs/slack_bolt/adapter/fastapi/async_handler.html +++ b/docs/api-docs/slack_bolt/adapter/fastapi/async_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.fastapi.async_handler API documentation @@ -53,7 +53,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/fastapi/index.html b/docs/api-docs/slack_bolt/adapter/fastapi/index.html index 45c12f045..ba5c9e031 100644 --- a/docs/api-docs/slack_bolt/adapter/fastapi/index.html +++ b/docs/api-docs/slack_bolt/adapter/fastapi/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.fastapi API documentation @@ -66,7 +66,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/flask/handler.html b/docs/api-docs/slack_bolt/adapter/flask/handler.html index 3258bf8fd..247dbba15 100644 --- a/docs/api-docs/slack_bolt/adapter/flask/handler.html +++ b/docs/api-docs/slack_bolt/adapter/flask/handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.flask.handler API documentation @@ -211,7 +211,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/flask/index.html b/docs/api-docs/slack_bolt/adapter/flask/index.html index 75e489cdd..a8d8efd5d 100644 --- a/docs/api-docs/slack_bolt/adapter/flask/index.html +++ b/docs/api-docs/slack_bolt/adapter/flask/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.flask API documentation @@ -65,7 +65,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/index.html b/docs/api-docs/slack_bolt/adapter/index.html index 26067b76c..c05016afd 100644 --- a/docs/api-docs/slack_bolt/adapter/index.html +++ b/docs/api-docs/slack_bolt/adapter/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter API documentation @@ -127,7 +127,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/pyramid/handler.html b/docs/api-docs/slack_bolt/adapter/pyramid/handler.html index 87b9605e1..44b8ee923 100644 --- a/docs/api-docs/slack_bolt/adapter/pyramid/handler.html +++ b/docs/api-docs/slack_bolt/adapter/pyramid/handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.pyramid.handler API documentation @@ -241,7 +241,7 @@

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/pyramid/index.html b/docs/api-docs/slack_bolt/adapter/pyramid/index.html index f9fe67029..dbf5a8668 100644 --- a/docs/api-docs/slack_bolt/adapter/pyramid/index.html +++ b/docs/api-docs/slack_bolt/adapter/pyramid/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.pyramid API documentation @@ -65,7 +65,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/sanic/async_handler.html b/docs/api-docs/slack_bolt/adapter/sanic/async_handler.html index 95318abb8..1577a05f6 100644 --- a/docs/api-docs/slack_bolt/adapter/sanic/async_handler.html +++ b/docs/api-docs/slack_bolt/adapter/sanic/async_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.sanic.async_handler API documentation @@ -265,7 +265,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/sanic/index.html b/docs/api-docs/slack_bolt/adapter/sanic/index.html index 937cc0d40..71cb0ad94 100644 --- a/docs/api-docs/slack_bolt/adapter/sanic/index.html +++ b/docs/api-docs/slack_bolt/adapter/sanic/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.sanic API documentation @@ -65,7 +65,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/aiohttp/index.html b/docs/api-docs/slack_bolt/adapter/socket_mode/aiohttp/index.html index 5d5738a10..61e895370 100644 --- a/docs/api-docs/slack_bolt/adapter/socket_mode/aiohttp/index.html +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/aiohttp/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.socket_mode.aiohttp API documentation @@ -336,7 +336,7 @@

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/async_base_handler.html b/docs/api-docs/slack_bolt/adapter/socket_mode/async_base_handler.html index c9f7c4b53..3187a6c8d 100644 --- a/docs/api-docs/slack_bolt/adapter/socket_mode/async_base_handler.html +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/async_base_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.socket_mode.async_base_handler API documentation @@ -200,7 +200,7 @@

    Methods

    -async def handle(self, client: slack_sdk.socket_mode.async_client.AsyncBaseSocketModeClient, req: slack_sdk.socket_mode.request.SocketModeRequest) ‑> NoneType +async def handle(self, client: slack_sdk.socket_mode.async_client.AsyncBaseSocketModeClient, req: slack_sdk.socket_mode.request.SocketModeRequest) ‑> None

    Handles Socket Mode envelope requests through a WebSocket connection.

    @@ -287,7 +287,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/async_handler.html b/docs/api-docs/slack_bolt/adapter/socket_mode/async_handler.html index 1e1ca2ee4..239bd0fbe 100644 --- a/docs/api-docs/slack_bolt/adapter/socket_mode/async_handler.html +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/async_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.socket_mode.async_handler API documentation @@ -55,7 +55,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/async_internals.html b/docs/api-docs/slack_bolt/adapter/socket_mode/async_internals.html index 824288e56..5593c5d69 100644 --- a/docs/api-docs/slack_bolt/adapter/socket_mode/async_internals.html +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/async_internals.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.socket_mode.async_internals API documentation @@ -170,7 +170,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/base_handler.html b/docs/api-docs/slack_bolt/adapter/socket_mode/base_handler.html index 92518d180..dab607610 100644 --- a/docs/api-docs/slack_bolt/adapter/socket_mode/base_handler.html +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/base_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.socket_mode.base_handler API documentation @@ -210,7 +210,7 @@

    Methods

    -def handle(self, client: slack_sdk.socket_mode.client.BaseSocketModeClient, req: slack_sdk.socket_mode.request.SocketModeRequest) ‑> NoneType +def handle(self, client: slack_sdk.socket_mode.client.BaseSocketModeClient, req: slack_sdk.socket_mode.request.SocketModeRequest) ‑> None

    Handles Socket Mode envelope requests through a WebSocket connection.

    @@ -301,7 +301,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/builtin/index.html b/docs/api-docs/slack_bolt/adapter/socket_mode/builtin/index.html index 3e050b73d..5ca55c520 100644 --- a/docs/api-docs/slack_bolt/adapter/socket_mode/builtin/index.html +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/builtin/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.socket_mode.builtin API documentation @@ -276,7 +276,7 @@

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/index.html b/docs/api-docs/slack_bolt/adapter/socket_mode/index.html index 8ce6feae4..642bb5206 100644 --- a/docs/api-docs/slack_bolt/adapter/socket_mode/index.html +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.socket_mode API documentation @@ -123,7 +123,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/internals.html b/docs/api-docs/slack_bolt/adapter/socket_mode/internals.html index bf7e9141b..8fb9fc6a8 100644 --- a/docs/api-docs/slack_bolt/adapter/socket_mode/internals.html +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.socket_mode.internals API documentation @@ -170,7 +170,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/websocket_client/index.html b/docs/api-docs/slack_bolt/adapter/socket_mode/websocket_client/index.html index ad409bdef..049a23153 100644 --- a/docs/api-docs/slack_bolt/adapter/socket_mode/websocket_client/index.html +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/websocket_client/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.socket_mode.websocket_client API documentation @@ -260,7 +260,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/websockets/index.html b/docs/api-docs/slack_bolt/adapter/socket_mode/websockets/index.html index af0cc2c40..594c20a09 100644 --- a/docs/api-docs/slack_bolt/adapter/socket_mode/websockets/index.html +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/websockets/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.socket_mode.websockets API documentation @@ -337,7 +337,7 @@

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/starlette/async_handler.html b/docs/api-docs/slack_bolt/adapter/starlette/async_handler.html index d9cbd98b9..5f1ecf75a 100644 --- a/docs/api-docs/slack_bolt/adapter/starlette/async_handler.html +++ b/docs/api-docs/slack_bolt/adapter/starlette/async_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.starlette.async_handler API documentation @@ -261,7 +261,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/starlette/handler.html b/docs/api-docs/slack_bolt/adapter/starlette/handler.html index 221c63f68..cb77cba85 100644 --- a/docs/api-docs/slack_bolt/adapter/starlette/handler.html +++ b/docs/api-docs/slack_bolt/adapter/starlette/handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.starlette.handler API documentation @@ -254,7 +254,7 @@

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/starlette/index.html b/docs/api-docs/slack_bolt/adapter/starlette/index.html index 1c59cb366..bc4b3689f 100644 --- a/docs/api-docs/slack_bolt/adapter/starlette/index.html +++ b/docs/api-docs/slack_bolt/adapter/starlette/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.starlette API documentation @@ -71,7 +71,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/tornado/handler.html b/docs/api-docs/slack_bolt/adapter/tornado/handler.html index bd478bd7a..3c1ca74b2 100644 --- a/docs/api-docs/slack_bolt/adapter/tornado/handler.html +++ b/docs/api-docs/slack_bolt/adapter/tornado/handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.tornado.handler API documentation @@ -108,7 +108,7 @@

    Module slack_bolt.adapter.tornado.handler

    Functions

    -def set_response(self, bolt_resp) ‑> NoneType +def set_response(self, bolt_resp) ‑> None
    @@ -345,7 +345,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/tornado/index.html b/docs/api-docs/slack_bolt/adapter/tornado/index.html index 75031542a..4e1719a18 100644 --- a/docs/api-docs/slack_bolt/adapter/tornado/index.html +++ b/docs/api-docs/slack_bolt/adapter/tornado/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.tornado API documentation @@ -65,7 +65,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/app/app.html b/docs/api-docs/slack_bolt/app/app.html index 1f10657ec..9db31df0c 100644 --- a/docs/api-docs/slack_bolt/app/app.html +++ b/docs/api-docs/slack_bolt/app/app.html @@ -3,7 +3,7 @@ - + slack_bolt.app.app API documentation @@ -31,6 +31,7 @@

    Module slack_bolt.app.app

    import logging import os import time +from concurrent.futures import Executor from concurrent.futures.thread import ThreadPoolExecutor from http.server import SimpleHTTPRequestHandler, HTTPServer from typing import List, Union, Pattern, Callable, Dict, Optional, Sequence, Any @@ -141,6 +142,8 @@

    Module slack_bolt.app.app

    oauth_flow: Optional[OAuthFlow] = None, # No need to set (the value is used only in response to ssl_check requests) verification_token: Optional[str] = None, + # Set this one only when you want to customize the executor + listener_executor: Optional[Executor] = None, ): """Bolt App that provides functionalities to register middleware/listeners. @@ -201,6 +204,8 @@

    Module slack_bolt.app.app

    oauth_settings: The settings related to Slack app installation flow (OAuth flow) oauth_flow: Instantiated `slack_bolt.oauth.OAuthFlow`. This is always prioritized over oauth_settings. verification_token: Deprecated verification mechanism. This can used only for ssl_check requests. + listener_executor: Custom executor to run background tasks. If absent, the default `ThreadPoolExecutor` will + be used. """ signing_secret = signing_secret or os.environ.get("SLACK_SIGNING_SECRET") token = token or os.environ.get("SLACK_BOT_TOKEN") @@ -330,7 +335,9 @@

    Module slack_bolt.app.app

    self._middleware_list: List[Union[Callable, Middleware]] = [] self._listeners: List[Listener] = [] - listener_executor = ThreadPoolExecutor(max_workers=5) + if listener_executor is None: + listener_executor = ThreadPoolExecutor(max_workers=5) + self._process_before_response = process_before_response self._listener_runner = ThreadListenerRunner( logger=self._framework_logger, @@ -1468,7 +1475,7 @@

    Classes

    class App -(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, token_verification_enabled: bool = True, client: Optional[slack_sdk.web.client.WebClient] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, verification_token: Optional[str] = None) +(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, token_verification_enabled: bool = True, client: Optional[slack_sdk.web.client.WebClient] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, verification_token: Optional[str] = None, listener_executor: Optional[concurrent.futures._base.Executor] = None)

    Bolt App that provides functionalities to register middleware/listeners.

    @@ -1546,6 +1553,9 @@

    Args

    Instantiated slack_bolt.oauth.OAuthFlow. This is always prioritized over oauth_settings.
    verification_token
    Deprecated verification mechanism. This can used only for ssl_check requests.
    +
    listener_executor
    +
    Custom executor to run background tasks. If absent, the default ThreadPoolExecutor will +be used.

    @@ -1583,6 +1593,8 @@

    Args

    oauth_flow: Optional[OAuthFlow] = None, # No need to set (the value is used only in response to ssl_check requests) verification_token: Optional[str] = None, + # Set this one only when you want to customize the executor + listener_executor: Optional[Executor] = None, ): """Bolt App that provides functionalities to register middleware/listeners. @@ -1643,6 +1655,8 @@

    Args

    oauth_settings: The settings related to Slack app installation flow (OAuth flow) oauth_flow: Instantiated `slack_bolt.oauth.OAuthFlow`. This is always prioritized over oauth_settings. verification_token: Deprecated verification mechanism. This can used only for ssl_check requests. + listener_executor: Custom executor to run background tasks. If absent, the default `ThreadPoolExecutor` will + be used. """ signing_secret = signing_secret or os.environ.get("SLACK_SIGNING_SECRET") token = token or os.environ.get("SLACK_BOT_TOKEN") @@ -1772,7 +1786,9 @@

    Args

    self._middleware_list: List[Union[Callable, Middleware]] = [] self._listeners: List[Listener] = [] - listener_executor = ThreadPoolExecutor(max_workers=5) + if listener_executor is None: + listener_executor = ThreadPoolExecutor(max_workers=5) + self._process_before_response = process_before_response self._listener_runner = ThreadListenerRunner( logger=self._framework_logger, @@ -3358,7 +3374,7 @@

    Returns

    -def enable_token_revocation_listeners(self) ‑> NoneType +def enable_token_revocation_listeners(self) ‑> None
    @@ -3428,7 +3444,7 @@

    Args

    -def event(self, event: Union[str, Pattern, Dict[str, Union[str, Sequence[Union[str, Pattern, NoneType]]]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Optional[Callable[..., Optional[BoltResponse]]] +def event(self, event: Union[str, Pattern, Dict[str, Union[str, Sequence[Union[str, Pattern, ForwardRef(None)]]]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Optional[Callable[..., Optional[BoltResponse]]]

    Registers a new event listener. This method can be used as either a decorator or a method.

    @@ -3880,7 +3896,7 @@

    Args

    -def start(self, port: int = 3000, path: str = '/slack/events', http_server_logger_enabled: bool = True) ‑> NoneType +def start(self, port: int = 3000, path: str = '/slack/events', http_server_logger_enabled: bool = True) ‑> None

    Starts a web server for local development.

    @@ -3934,7 +3950,7 @@

    Args

    -def step(self, callback_id: Union[str, Pattern, WorkflowStepWorkflowStepBuilder], edit: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable], NoneType] = None, save: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable], NoneType] = None, execute: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable], NoneType] = None) +def step(self, callback_id: Union[str, Pattern, WorkflowStepWorkflowStepBuilder], edit: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable], ForwardRef(None)] = None, save: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable], ForwardRef(None)] = None, execute: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable], ForwardRef(None)] = None)

    Registers a new Workflow Step listener. @@ -4348,7 +4364,7 @@

    Args

    Methods

    -def start(self) ‑> NoneType +def start(self) ‑> None

    Starts a new web server process.

    @@ -4437,7 +4453,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/app/async_app.html b/docs/api-docs/slack_bolt/app/async_app.html index 618898025..d6424b071 100644 --- a/docs/api-docs/slack_bolt/app/async_app.html +++ b/docs/api-docs/slack_bolt/app/async_app.html @@ -3,7 +3,7 @@ - + slack_bolt.app.async_app API documentation @@ -3370,7 +3370,7 @@

    Args

    -def enable_token_revocation_listeners(self) ‑> NoneType +def enable_token_revocation_listeners(self) ‑> None
    @@ -3445,7 +3445,7 @@

    Args

    -def event(self, event: Union[str, Pattern, Dict[str, Union[str, Sequence[Union[str, Pattern, NoneType]]]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]] +def event(self, event: Union[str, Pattern, Dict[str, Union[str, Sequence[Union[str, Pattern, ForwardRef(None)]]]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]

    Registers a new event listener. This method can be used as either a decorator or a method.

    @@ -3937,7 +3937,7 @@

    Args

    -def start(self, port: int = 3000, path: str = '/slack/events') ‑> NoneType +def start(self, port: int = 3000, path: str = '/slack/events') ‑> None

    Start a web server using AIOHTTP. @@ -3964,7 +3964,7 @@

    Args

    -def step(self, callback_id: Union[str, Pattern, AsyncWorkflowStepAsyncWorkflowStepBuilder], edit: Union[Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable], NoneType] = None, save: Union[Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable], NoneType] = None, execute: Union[Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable], NoneType] = None) +def step(self, callback_id: Union[str, Pattern, AsyncWorkflowStepAsyncWorkflowStepBuilder], edit: Union[Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable], ForwardRef(None)] = None, save: Union[Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable], ForwardRef(None)] = None, execute: Union[Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable], ForwardRef(None)] = None)

    Registers a new Workflow Step listener. @@ -4345,7 +4345,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/app/async_server.html b/docs/api-docs/slack_bolt/app/async_server.html index f510d3a5a..b816d91c6 100644 --- a/docs/api-docs/slack_bolt/app/async_server.html +++ b/docs/api-docs/slack_bolt/app/async_server.html @@ -3,7 +3,7 @@ - + slack_bolt.app.async_server API documentation @@ -279,7 +279,7 @@

    Methods

    -def start(self) ‑> NoneType +def start(self) ‑> None

    Starts a new web server process.

    @@ -333,7 +333,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/app/index.html b/docs/api-docs/slack_bolt/app/index.html index 23e49d2a9..7951c6ce9 100644 --- a/docs/api-docs/slack_bolt/app/index.html +++ b/docs/api-docs/slack_bolt/app/index.html @@ -3,7 +3,7 @@ - + slack_bolt.app API documentation @@ -87,7 +87,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/async_app.html b/docs/api-docs/slack_bolt/async_app.html index 52cf44a7f..6eb811be1 100644 --- a/docs/api-docs/slack_bolt/async_app.html +++ b/docs/api-docs/slack_bolt/async_app.html @@ -3,7 +3,7 @@ - + slack_bolt.async_app API documentation @@ -145,7 +145,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/authorization/async_authorize.html b/docs/api-docs/slack_bolt/authorization/async_authorize.html index 9045f89e0..1f5c32de8 100644 --- a/docs/api-docs/slack_bolt/authorization/async_authorize.html +++ b/docs/api-docs/slack_bolt/authorization/async_authorize.html @@ -3,7 +3,7 @@ - + slack_bolt.authorization.async_authorize API documentation @@ -688,7 +688,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/authorization/async_authorize_args.html b/docs/api-docs/slack_bolt/authorization/async_authorize_args.html index 543fc73e0..3d1fc2585 100644 --- a/docs/api-docs/slack_bolt/authorization/async_authorize_args.html +++ b/docs/api-docs/slack_bolt/authorization/async_authorize_args.html @@ -3,7 +3,7 @@ - + slack_bolt.authorization.async_authorize_args API documentation @@ -188,7 +188,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/authorization/authorize.html b/docs/api-docs/slack_bolt/authorization/authorize.html index 61c036a65..e24b8c04a 100644 --- a/docs/api-docs/slack_bolt/authorization/authorize.html +++ b/docs/api-docs/slack_bolt/authorization/authorize.html @@ -3,7 +3,7 @@ - + slack_bolt.authorization.authorize API documentation @@ -687,7 +687,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/authorization/authorize_args.html b/docs/api-docs/slack_bolt/authorization/authorize_args.html index ca04c85b4..d7880c063 100644 --- a/docs/api-docs/slack_bolt/authorization/authorize_args.html +++ b/docs/api-docs/slack_bolt/authorization/authorize_args.html @@ -3,7 +3,7 @@ - + slack_bolt.authorization.authorize_args API documentation @@ -188,7 +188,7 @@

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/authorization/authorize_result.html b/docs/api-docs/slack_bolt/authorization/authorize_result.html index e6b12ed39..c4f24925e 100644 --- a/docs/api-docs/slack_bolt/authorization/authorize_result.html +++ b/docs/api-docs/slack_bolt/authorization/authorize_result.html @@ -3,7 +3,7 @@ - + slack_bolt.authorization.authorize_result API documentation @@ -324,7 +324,7 @@

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/authorization/index.html b/docs/api-docs/slack_bolt/authorization/index.html index 7fc9a86a5..d9f943a1e 100644 --- a/docs/api-docs/slack_bolt/authorization/index.html +++ b/docs/api-docs/slack_bolt/authorization/index.html @@ -3,7 +3,7 @@ - + slack_bolt.authorization API documentation @@ -94,7 +94,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/context/ack/ack.html b/docs/api-docs/slack_bolt/context/ack/ack.html index 42ea41468..b0987d0b3 100644 --- a/docs/api-docs/slack_bolt/context/ack/ack.html +++ b/docs/api-docs/slack_bolt/context/ack/ack.html @@ -3,7 +3,7 @@ - + slack_bolt.context.ack.ack API documentation @@ -165,7 +165,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/context/ack/async_ack.html b/docs/api-docs/slack_bolt/context/ack/async_ack.html index d662cac7f..4c2f5fcdc 100644 --- a/docs/api-docs/slack_bolt/context/ack/async_ack.html +++ b/docs/api-docs/slack_bolt/context/ack/async_ack.html @@ -3,7 +3,7 @@ - + slack_bolt.context.ack.async_ack API documentation @@ -165,7 +165,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/context/ack/index.html b/docs/api-docs/slack_bolt/context/ack/index.html index 4012ad063..514717149 100644 --- a/docs/api-docs/slack_bolt/context/ack/index.html +++ b/docs/api-docs/slack_bolt/context/ack/index.html @@ -3,7 +3,7 @@ - + slack_bolt.context.ack API documentation @@ -76,7 +76,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/context/ack/internals.html b/docs/api-docs/slack_bolt/context/ack/internals.html index 29295bd96..535fc4228 100644 --- a/docs/api-docs/slack_bolt/context/ack/internals.html +++ b/docs/api-docs/slack_bolt/context/ack/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.context.ack.internals API documentation @@ -159,7 +159,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/context/async_context.html b/docs/api-docs/slack_bolt/context/async_context.html index 201d549e1..a417e91b5 100644 --- a/docs/api-docs/slack_bolt/context/async_context.html +++ b/docs/api-docs/slack_bolt/context/async_context.html @@ -3,7 +3,7 @@ - + slack_bolt.context.async_context API documentation @@ -479,7 +479,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/context/base_context.html b/docs/api-docs/slack_bolt/context/base_context.html index da2cff91b..d694b9e20 100644 --- a/docs/api-docs/slack_bolt/context/base_context.html +++ b/docs/api-docs/slack_bolt/context/base_context.html @@ -3,7 +3,7 @@ - + slack_bolt.context.base_context API documentation @@ -491,7 +491,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/context/context.html b/docs/api-docs/slack_bolt/context/context.html index dcb95c554..9cbda05ba 100644 --- a/docs/api-docs/slack_bolt/context/context.html +++ b/docs/api-docs/slack_bolt/context/context.html @@ -3,7 +3,7 @@ - + slack_bolt.context.context API documentation @@ -480,7 +480,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/context/index.html b/docs/api-docs/slack_bolt/context/index.html index b2baa582b..25952a7a2 100644 --- a/docs/api-docs/slack_bolt/context/index.html +++ b/docs/api-docs/slack_bolt/context/index.html @@ -3,7 +3,7 @@ - + slack_bolt.context API documentation @@ -103,7 +103,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/context/respond/async_respond.html b/docs/api-docs/slack_bolt/context/respond/async_respond.html index 8e332b1cd..0ecb02cc5 100644 --- a/docs/api-docs/slack_bolt/context/respond/async_respond.html +++ b/docs/api-docs/slack_bolt/context/respond/async_respond.html @@ -3,7 +3,7 @@ - + slack_bolt.context.respond.async_respond API documentation @@ -173,7 +173,7 @@

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/context/respond/index.html b/docs/api-docs/slack_bolt/context/respond/index.html index e667d1094..24f1fdc1d 100644 --- a/docs/api-docs/slack_bolt/context/respond/index.html +++ b/docs/api-docs/slack_bolt/context/respond/index.html @@ -3,7 +3,7 @@ - + slack_bolt.context.respond API documentation @@ -76,7 +76,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/context/respond/internals.html b/docs/api-docs/slack_bolt/context/respond/internals.html index 0442915c2..9272c1411 100644 --- a/docs/api-docs/slack_bolt/context/respond/internals.html +++ b/docs/api-docs/slack_bolt/context/respond/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.context.respond.internals API documentation @@ -86,7 +86,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/context/respond/respond.html b/docs/api-docs/slack_bolt/context/respond/respond.html index 54717eeaa..9eaf73276 100644 --- a/docs/api-docs/slack_bolt/context/respond/respond.html +++ b/docs/api-docs/slack_bolt/context/respond/respond.html @@ -3,7 +3,7 @@ - + slack_bolt.context.respond.respond API documentation @@ -177,7 +177,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/context/say/async_say.html b/docs/api-docs/slack_bolt/context/say/async_say.html index 092d6c038..0b6dd7000 100644 --- a/docs/api-docs/slack_bolt/context/say/async_say.html +++ b/docs/api-docs/slack_bolt/context/say/async_say.html @@ -3,7 +3,7 @@ - + slack_bolt.context.say.async_say API documentation @@ -194,7 +194,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/context/say/index.html b/docs/api-docs/slack_bolt/context/say/index.html index 4e88eb90b..7f6fc657b 100644 --- a/docs/api-docs/slack_bolt/context/say/index.html +++ b/docs/api-docs/slack_bolt/context/say/index.html @@ -3,7 +3,7 @@ - + slack_bolt.context.say API documentation @@ -76,7 +76,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/context/say/internals.html b/docs/api-docs/slack_bolt/context/say/internals.html index d2e29c737..d9381bd9d 100644 --- a/docs/api-docs/slack_bolt/context/say/internals.html +++ b/docs/api-docs/slack_bolt/context/say/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.context.say.internals API documentation @@ -61,7 +61,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/context/say/say.html b/docs/api-docs/slack_bolt/context/say/say.html index 455e945d5..ce5bdbc95 100644 --- a/docs/api-docs/slack_bolt/context/say/say.html +++ b/docs/api-docs/slack_bolt/context/say/say.html @@ -3,7 +3,7 @@ - + slack_bolt.context.say.say API documentation @@ -195,7 +195,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/error/index.html b/docs/api-docs/slack_bolt/error/index.html index 9b104c4e3..827fecc42 100644 --- a/docs/api-docs/slack_bolt/error/index.html +++ b/docs/api-docs/slack_bolt/error/index.html @@ -3,7 +3,7 @@ - + slack_bolt.error API documentation @@ -174,7 +174,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/index.html b/docs/api-docs/slack_bolt/index.html index 4189aaa45..86e6b3646 100644 --- a/docs/api-docs/slack_bolt/index.html +++ b/docs/api-docs/slack_bolt/index.html @@ -3,7 +3,7 @@ - + slack_bolt API documentation @@ -173,7 +173,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/kwargs_injection/args.html b/docs/api-docs/slack_bolt/kwargs_injection/args.html index 55f0aae66..8e9c717d3 100644 --- a/docs/api-docs/slack_bolt/kwargs_injection/args.html +++ b/docs/api-docs/slack_bolt/kwargs_injection/args.html @@ -3,7 +3,7 @@ - + slack_bolt.kwargs_injection.args API documentation @@ -163,7 +163,7 @@

    Classes

    class Args -(*, logger: logging.Logger, client: slack_sdk.web.client.WebClient, req: BoltRequest, resp: BoltResponse, context: BoltContext, body: Dict[str, Any], payload: Dict[str, Any], options: Optional[Dict[str, Any]] = None, shortcut: Optional[Dict[str, Any]] = None, action: Optional[Dict[str, Any]] = None, view: Optional[Dict[str, Any]] = None, command: Optional[Dict[str, Any]] = None, event: Optional[Dict[str, Any]] = None, message: Optional[Dict[str, Any]] = None, ack: Ack, say: Say, respond: Respond, next: Callable[[], NoneType], **kwargs) +(*, logger: logging.Logger, client: slack_sdk.web.client.WebClient, req: BoltRequest, resp: BoltResponse, context: BoltContext, body: Dict[str, Any], payload: Dict[str, Any], options: Optional[Dict[str, Any]] = None, shortcut: Optional[Dict[str, Any]] = None, action: Optional[Dict[str, Any]] = None, view: Optional[Dict[str, Any]] = None, command: Optional[Dict[str, Any]] = None, event: Optional[Dict[str, Any]] = None, message: Optional[Dict[str, Any]] = None, ack: Ack, say: Say, respond: Respond, next: Callable[[], None], **kwargs)

    All the arguments in this class are available in any middleware / listeners. @@ -332,11 +332,11 @@

    Class variables

    An alias for payload in an @app.message listener

    -
    var next : Callable[[], NoneType]
    +
    var next : Callable[[], None]

    next() utility function, which tells the middleware chain that it can continue with the next one

    -
    var next_ : Callable[[], NoneType]
    +
    var next_ : Callable[[], None]

    An alias of next() for avoiding the Python built-in method overrides in middleware functions

    @@ -430,7 +430,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/kwargs_injection/async_args.html b/docs/api-docs/slack_bolt/kwargs_injection/async_args.html index 5c0a8378b..3d5d2721d 100644 --- a/docs/api-docs/slack_bolt/kwargs_injection/async_args.html +++ b/docs/api-docs/slack_bolt/kwargs_injection/async_args.html @@ -3,7 +3,7 @@ - + slack_bolt.kwargs_injection.async_args API documentation @@ -159,7 +159,7 @@

    Classes

    class AsyncArgs -(*, logger: logging.Logger, client: slack_sdk.web.async_client.AsyncWebClient, req: AsyncBoltRequest, resp: BoltResponse, context: AsyncBoltContext, body: Dict[str, Any], payload: Dict[str, Any], options: Optional[Dict[str, Any]] = None, shortcut: Optional[Dict[str, Any]] = None, action: Optional[Dict[str, Any]] = None, view: Optional[Dict[str, Any]] = None, command: Optional[Dict[str, Any]] = None, event: Optional[Dict[str, Any]] = None, message: Optional[Dict[str, Any]] = None, ack: AsyncAck, say: AsyncSay, respond: AsyncRespond, next: Callable[[], Awaitable[NoneType]], **kwargs) +(*, logger: logging.Logger, client: slack_sdk.web.async_client.AsyncWebClient, req: AsyncBoltRequest, resp: BoltResponse, context: AsyncBoltContext, body: Dict[str, Any], payload: Dict[str, Any], options: Optional[Dict[str, Any]] = None, shortcut: Optional[Dict[str, Any]] = None, action: Optional[Dict[str, Any]] = None, view: Optional[Dict[str, Any]] = None, command: Optional[Dict[str, Any]] = None, event: Optional[Dict[str, Any]] = None, message: Optional[Dict[str, Any]] = None, ack: AsyncAck, say: AsyncSay, respond: AsyncRespond, next: Callable[[], Awaitable[None]], **kwargs)

    All the arguments in this class are available in any middleware / listeners. @@ -325,11 +325,11 @@

    Class variables

    An alias for payload in an @app.message listener

    -
    var next : Callable[[], Awaitable[NoneType]]
    +
    var next : Callable[[], Awaitable[None]]

    next() utility function, which tells the middleware chain that it can continue with the next one

    -
    var next_ : Callable[[], Awaitable[NoneType]]
    +
    var next_ : Callable[[], Awaitable[None]]

    An alias of next() for avoiding the Python built-in method overrides in middleware functions

    @@ -423,7 +423,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/kwargs_injection/async_utils.html b/docs/api-docs/slack_bolt/kwargs_injection/async_utils.html index 9bb50f45e..689bf5162 100644 --- a/docs/api-docs/slack_bolt/kwargs_injection/async_utils.html +++ b/docs/api-docs/slack_bolt/kwargs_injection/async_utils.html @@ -3,7 +3,7 @@ - + slack_bolt.kwargs_injection.async_utils API documentation @@ -146,7 +146,7 @@

    Module slack_bolt.kwargs_injection.async_utilsFunctions

    -def build_async_required_kwargs(*, logger: logging.Logger, required_arg_names: Sequence[str], request: AsyncBoltRequest, response: Optional[BoltResponse], next_func: Callable[[], NoneType] = None, this_func: Optional[Callable] = None, error: Optional[Exception] = None, next_keys_required: bool = True) ‑> Dict[str, Any] +def build_async_required_kwargs(*, logger: logging.Logger, required_arg_names: Sequence[str], request: AsyncBoltRequest, response: Optional[BoltResponse], next_func: Callable[[], None] = None, this_func: Optional[Callable] = None, error: Optional[Exception] = None, next_keys_required: bool = True) ‑> Dict[str, Any]
    @@ -270,7 +270,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/kwargs_injection/index.html b/docs/api-docs/slack_bolt/kwargs_injection/index.html index 181d66960..d22d1e46c 100644 --- a/docs/api-docs/slack_bolt/kwargs_injection/index.html +++ b/docs/api-docs/slack_bolt/kwargs_injection/index.html @@ -3,7 +3,7 @@ - + slack_bolt.kwargs_injection API documentation @@ -91,7 +91,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/kwargs_injection/utils.html b/docs/api-docs/slack_bolt/kwargs_injection/utils.html index db77fefab..4b47237d3 100644 --- a/docs/api-docs/slack_bolt/kwargs_injection/utils.html +++ b/docs/api-docs/slack_bolt/kwargs_injection/utils.html @@ -3,7 +3,7 @@ - + slack_bolt.kwargs_injection.utils API documentation @@ -146,7 +146,7 @@

    Module slack_bolt.kwargs_injection.utils

    Functions

    -def build_required_kwargs(*, logger: logging.Logger, required_arg_names: Sequence[str], request: BoltRequest, response: Optional[BoltResponse], next_func: Callable[[], NoneType] = None, this_func: Optional[Callable] = None, error: Optional[Exception] = None, next_keys_required: bool = True) ‑> Dict[str, Any] +def build_required_kwargs(*, logger: logging.Logger, required_arg_names: Sequence[str], request: BoltRequest, response: Optional[BoltResponse], next_func: Callable[[], None] = None, this_func: Optional[Callable] = None, error: Optional[Exception] = None, next_keys_required: bool = True) ‑> Dict[str, Any]
    @@ -270,7 +270,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/lazy_listener/async_internals.html b/docs/api-docs/slack_bolt/lazy_listener/async_internals.html index 8b4e089ab..85eb04a93 100644 --- a/docs/api-docs/slack_bolt/lazy_listener/async_internals.html +++ b/docs/api-docs/slack_bolt/lazy_listener/async_internals.html @@ -3,7 +3,7 @@ - + slack_bolt.lazy_listener.async_internals API documentation @@ -68,7 +68,7 @@

    Module slack_bolt.lazy_listener.async_internalsFunctions

    -async def to_runnable_function(internal_func: Callable[..., Awaitable[NoneType]], logger: logging.Logger, request: AsyncBoltRequest) +async def to_runnable_function(internal_func: Callable[..., Awaitable[None]], logger: logging.Logger, request: AsyncBoltRequest)
    @@ -126,7 +126,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/lazy_listener/async_runner.html b/docs/api-docs/slack_bolt/lazy_listener/async_runner.html index 41b5d0491..8585b1c87 100644 --- a/docs/api-docs/slack_bolt/lazy_listener/async_runner.html +++ b/docs/api-docs/slack_bolt/lazy_listener/async_runner.html @@ -3,7 +3,7 @@ - + slack_bolt.lazy_listener.async_runner API documentation @@ -129,7 +129,7 @@

    Class variables

    Methods

    -async def run(self, function: Callable[..., Awaitable[NoneType]], request: AsyncBoltRequest) ‑> NoneType +async def run(self, function: Callable[..., Awaitable[None]], request: AsyncBoltRequest) ‑> None

    Synchronously run the function with a given request data.

    @@ -162,7 +162,7 @@

    Args

    -def start(self, function: Callable[..., Awaitable[NoneType]], request: AsyncBoltRequest) ‑> NoneType +def start(self, function: Callable[..., Awaitable[None]], request: AsyncBoltRequest) ‑> None

    Starts a new lazy listener execution.

    @@ -222,7 +222,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/lazy_listener/asyncio_runner.html b/docs/api-docs/slack_bolt/lazy_listener/asyncio_runner.html index 83ca3140a..d4e6edc06 100644 --- a/docs/api-docs/slack_bolt/lazy_listener/asyncio_runner.html +++ b/docs/api-docs/slack_bolt/lazy_listener/asyncio_runner.html @@ -3,7 +3,7 @@ - + slack_bolt.lazy_listener.asyncio_runner API documentation @@ -144,7 +144,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/lazy_listener/index.html b/docs/api-docs/slack_bolt/lazy_listener/index.html index e2bb0a602..e55ee8f71 100644 --- a/docs/api-docs/slack_bolt/lazy_listener/index.html +++ b/docs/api-docs/slack_bolt/lazy_listener/index.html @@ -3,7 +3,7 @@ - + slack_bolt.lazy_listener API documentation @@ -136,7 +136,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/lazy_listener/internals.html b/docs/api-docs/slack_bolt/lazy_listener/internals.html index 2b5ee8fbf..a9c0d103e 100644 --- a/docs/api-docs/slack_bolt/lazy_listener/internals.html +++ b/docs/api-docs/slack_bolt/lazy_listener/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.lazy_listener.internals API documentation @@ -68,7 +68,7 @@

    Module slack_bolt.lazy_listener.internals

    Functions

    -def build_runnable_function(func: Callable[..., NoneType], logger: logging.Logger, request: BoltRequest) ‑> Callable[[], NoneType] +def build_runnable_function(func: Callable[..., None], logger: logging.Logger, request: BoltRequest) ‑> Callable[[], None]
    @@ -126,7 +126,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/lazy_listener/runner.html b/docs/api-docs/slack_bolt/lazy_listener/runner.html index c27bdd401..baefed8f7 100644 --- a/docs/api-docs/slack_bolt/lazy_listener/runner.html +++ b/docs/api-docs/slack_bolt/lazy_listener/runner.html @@ -3,7 +3,7 @@ - + slack_bolt.lazy_listener.runner API documentation @@ -121,7 +121,7 @@

    Class variables

    Methods

    -def run(self, function: Callable[..., NoneType], request: BoltRequest) ‑> NoneType +def run(self, function: Callable[..., None], request: BoltRequest) ‑> None

    Synchronously runs the function with a given request data.

    @@ -151,7 +151,7 @@

    Args

    -def start(self, function: Callable[..., NoneType], request: BoltRequest) ‑> NoneType +def start(self, function: Callable[..., None], request: BoltRequest) ‑> None

    Starts a new lazy listener execution.

    @@ -209,7 +209,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/lazy_listener/thread_runner.html b/docs/api-docs/slack_bolt/lazy_listener/thread_runner.html index 9505ade3d..8644037b2 100644 --- a/docs/api-docs/slack_bolt/lazy_listener/thread_runner.html +++ b/docs/api-docs/slack_bolt/lazy_listener/thread_runner.html @@ -3,7 +3,7 @@ - + slack_bolt.lazy_listener.thread_runner API documentation @@ -26,7 +26,7 @@

    Module slack_bolt.lazy_listener.thread_runner

    Expand source code -
    from concurrent.futures.thread import ThreadPoolExecutor
    +
    from concurrent.futures import Executor
     from logging import Logger
     from typing import Callable
     
    @@ -41,7 +41,7 @@ 

    Module slack_bolt.lazy_listener.thread_runner

    Classes

    class ThreadLazyListenerRunner -(logger: logging.Logger, executor: concurrent.futures.thread.ThreadPoolExecutor) +(logger: logging.Logger, executor: concurrent.futures._base.Executor)
    @@ -81,7 +81,7 @@

    Classes

    def __init__( self, logger: Logger, - executor: ThreadPoolExecutor, + executor: Executor, ): self.logger = logger self.executor = executor @@ -148,7 +148,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/async_builtins.html b/docs/api-docs/slack_bolt/listener/async_builtins.html index f04b99904..e589069bc 100644 --- a/docs/api-docs/slack_bolt/listener/async_builtins.html +++ b/docs/api-docs/slack_bolt/listener/async_builtins.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.async_builtins API documentation @@ -126,7 +126,7 @@

    Class variables

    Methods

    -async def handle_app_uninstalled_events(self, context: AsyncBoltContext) ‑> NoneType +async def handle_app_uninstalled_events(self, context: AsyncBoltContext) ‑> None
    @@ -142,7 +142,7 @@

    Methods

    -async def handle_tokens_revoked_events(self, event: dict, context: AsyncBoltContext) ‑> NoneType +async def handle_tokens_revoked_events(self, event: dict, context: AsyncBoltContext) ‑> None
    @@ -201,7 +201,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/async_listener.html b/docs/api-docs/slack_bolt/listener/async_listener.html index de0cb4c4e..b36ef4c5e 100644 --- a/docs/api-docs/slack_bolt/listener/async_listener.html +++ b/docs/api-docs/slack_bolt/listener/async_listener.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.async_listener API documentation @@ -174,7 +174,7 @@

    Classes

    class AsyncCustomListener -(*, app_name: str, ack_function: Callable[..., Awaitable[Optional[BoltResponse]]], lazy_functions: Sequence[Callable[..., Awaitable[NoneType]]], matchers: Sequence[AsyncListenerMatcher], middleware: Sequence[AsyncMiddleware], auto_acknowledgement: bool = False) +(*, app_name: str, ack_function: Callable[..., Awaitable[Optional[BoltResponse]]], lazy_functions: Sequence[Callable[..., Awaitable[None]]], matchers: Sequence[AsyncListenerMatcher], middleware: Sequence[AsyncMiddleware], auto_acknowledgement: bool = False)
    @@ -249,7 +249,7 @@

    Class variables

    -
    var lazy_functions : Sequence[Callable[..., Awaitable[NoneType]]]
    +
    var lazy_functions : Sequence[Callable[..., Awaitable[None]]]
    @@ -307,7 +307,7 @@

    Returns

    class cls -(*, app_name: str, ack_function: Callable[..., Awaitable[Optional[BoltResponse]]], lazy_functions: Sequence[Callable[..., Awaitable[NoneType]]], matchers: Sequence[AsyncListenerMatcher], middleware: Sequence[AsyncMiddleware], auto_acknowledgement: bool = False) +(*, app_name: str, ack_function: Callable[..., Awaitable[Optional[BoltResponse]]], lazy_functions: Sequence[Callable[..., Awaitable[None]]], matchers: Sequence[AsyncListenerMatcher], middleware: Sequence[AsyncMiddleware], auto_acknowledgement: bool = False)
    @@ -382,7 +382,7 @@

    Class variables

    -
    var lazy_functions : Sequence[Callable[..., Awaitable[NoneType]]]
    +
    var lazy_functions : Sequence[Callable[..., Awaitable[None]]]
    @@ -494,7 +494,7 @@

    Class variables

    -
    var lazy_functions : Sequence[Callable[..., Awaitable[NoneType]]]
    +
    var lazy_functions : Sequence[Callable[..., Awaitable[None]]]
    @@ -676,7 +676,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/async_listener_completion_handler.html b/docs/api-docs/slack_bolt/listener/async_listener_completion_handler.html index 7152f6e44..e123987db 100644 --- a/docs/api-docs/slack_bolt/listener/async_listener_completion_handler.html +++ b/docs/api-docs/slack_bolt/listener/async_listener_completion_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.async_listener_completion_handler API documentation @@ -97,7 +97,7 @@

    Classes

    class AsyncCustomListenerCompletionHandler -(logger: logging.Logger, func: Callable[..., Awaitable[NoneType]]) +(logger: logging.Logger, func: Callable[..., Awaitable[None]])
    @@ -205,7 +205,7 @@

    Subclasses

    Methods

    -async def handle(self, request: AsyncBoltRequest, response: Optional[BoltResponse]) ‑> NoneType +async def handle(self, request: AsyncBoltRequest, response: Optional[BoltResponse]) ‑> None

    Handles an unhandled exception.

    @@ -274,7 +274,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/async_listener_error_handler.html b/docs/api-docs/slack_bolt/listener/async_listener_error_handler.html index 26e30d4fd..0aceea7cf 100644 --- a/docs/api-docs/slack_bolt/listener/async_listener_error_handler.html +++ b/docs/api-docs/slack_bolt/listener/async_listener_error_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.async_listener_error_handler API documentation @@ -231,7 +231,7 @@

    Subclasses

    Methods

    -async def handle(self, error: Exception, request: AsyncBoltRequest, response: Optional[BoltResponse]) ‑> NoneType +async def handle(self, error: Exception, request: AsyncBoltRequest, response: Optional[BoltResponse]) ‑> None

    Handles an unhandled exception.

    @@ -301,7 +301,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/asyncio_runner.html b/docs/api-docs/slack_bolt/listener/asyncio_runner.html index 20071b098..55b1969fa 100644 --- a/docs/api-docs/slack_bolt/listener/asyncio_runner.html +++ b/docs/api-docs/slack_bolt/listener/asyncio_runner.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.asyncio_runner API documentation @@ -624,7 +624,7 @@

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/builtins.html b/docs/api-docs/slack_bolt/listener/builtins.html index bc0783730..205e85c58 100644 --- a/docs/api-docs/slack_bolt/listener/builtins.html +++ b/docs/api-docs/slack_bolt/listener/builtins.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.builtins API documentation @@ -122,7 +122,7 @@

    Class variables

    Methods

    -def handle_app_uninstalled_events(self, context: BoltContext) ‑> NoneType +def handle_app_uninstalled_events(self, context: BoltContext) ‑> None
    @@ -138,7 +138,7 @@

    Methods

    -def handle_tokens_revoked_events(self, event: dict, context: BoltContext) ‑> NoneType +def handle_tokens_revoked_events(self, event: dict, context: BoltContext) ‑> None
    @@ -195,7 +195,7 @@

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/custom_listener.html b/docs/api-docs/slack_bolt/listener/custom_listener.html index 9cf8f1a44..a0fc17138 100644 --- a/docs/api-docs/slack_bolt/listener/custom_listener.html +++ b/docs/api-docs/slack_bolt/listener/custom_listener.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.custom_listener API documentation @@ -96,7 +96,7 @@

    Classes

    class CustomListener -(*, app_name: str, ack_function: Callable[..., Optional[BoltResponse]], lazy_functions: Sequence[Callable[..., NoneType]], matchers: Sequence[ListenerMatcher], middleware: Sequence[Middleware], auto_acknowledgement: bool = False) +(*, app_name: str, ack_function: Callable[..., Optional[BoltResponse]], lazy_functions: Sequence[Callable[..., None]], matchers: Sequence[ListenerMatcher], middleware: Sequence[Middleware], auto_acknowledgement: bool = False)
    @@ -171,7 +171,7 @@

    Class variables

    -
    var lazy_functions : Sequence[Callable[..., NoneType]]
    +
    var lazy_functions : Sequence[Callable[..., None]]
    @@ -233,7 +233,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/index.html b/docs/api-docs/slack_bolt/listener/index.html index 3b639d9b3..f0deb9b00 100644 --- a/docs/api-docs/slack_bolt/listener/index.html +++ b/docs/api-docs/slack_bolt/listener/index.html @@ -3,7 +3,7 @@ - + slack_bolt.listener API documentation @@ -132,7 +132,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/listener.html b/docs/api-docs/slack_bolt/listener/listener.html index 1b27ecfe3..069235bd8 100644 --- a/docs/api-docs/slack_bolt/listener/listener.html +++ b/docs/api-docs/slack_bolt/listener/listener.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.listener API documentation @@ -192,7 +192,7 @@

    Class variables

    -
    var lazy_functions : Sequence[Callable[..., NoneType]]
    +
    var lazy_functions : Sequence[Callable[..., None]]
    @@ -347,7 +347,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/listener_completion_handler.html b/docs/api-docs/slack_bolt/listener/listener_completion_handler.html index bac54d8dd..f5269d4e3 100644 --- a/docs/api-docs/slack_bolt/listener/listener_completion_handler.html +++ b/docs/api-docs/slack_bolt/listener/listener_completion_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.listener_completion_handler API documentation @@ -96,7 +96,7 @@

    Classes

    class CustomListenerCompletionHandler -(logger: logging.Logger, func: Callable[..., NoneType]) +(logger: logging.Logger, func: Callable[..., None])
    @@ -204,7 +204,7 @@

    Subclasses

    Methods

    -def handle(self, request: BoltRequest, response: Optional[BoltResponse]) ‑> NoneType +def handle(self, request: BoltRequest, response: Optional[BoltResponse]) ‑> None

    Handles an unhandled exception.

    @@ -270,7 +270,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/listener_error_handler.html b/docs/api-docs/slack_bolt/listener/listener_error_handler.html index c43127b7f..de3fe2aac 100644 --- a/docs/api-docs/slack_bolt/listener/listener_error_handler.html +++ b/docs/api-docs/slack_bolt/listener/listener_error_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.listener_error_handler API documentation @@ -227,7 +227,7 @@

    Subclasses

    Methods

    -def handle(self, error: Exception, request: BoltRequest, response: Optional[BoltResponse]) ‑> NoneType +def handle(self, error: Exception, request: BoltRequest, response: Optional[BoltResponse]) ‑> None

    Handles an unhandled exception.

    @@ -297,7 +297,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/thread_runner.html b/docs/api-docs/slack_bolt/listener/thread_runner.html index d3dee70a9..0105a89f7 100644 --- a/docs/api-docs/slack_bolt/listener/thread_runner.html +++ b/docs/api-docs/slack_bolt/listener/thread_runner.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.thread_runner API documentation @@ -27,7 +27,7 @@

    Module slack_bolt.listener.thread_runner

    Expand source code
    import time
    -from concurrent.futures.thread import ThreadPoolExecutor
    +from concurrent.futures import Executor
     from logging import Logger
     from typing import Optional, Callable
     
    @@ -50,7 +50,7 @@ 

    Module slack_bolt.listener.thread_runner

    process_before_response: bool listener_error_handler: ListenerErrorHandler listener_completion_handler: ListenerCompletionHandler - listener_executor: ThreadPoolExecutor + listener_executor: Executor lazy_listener_runner: LazyListenerRunner def __init__( @@ -59,7 +59,7 @@

    Module slack_bolt.listener.thread_runner

    process_before_response: bool, listener_error_handler: ListenerErrorHandler, listener_completion_handler: ListenerCompletionHandler, - listener_executor: ThreadPoolExecutor, + listener_executor: Executor, lazy_listener_runner: LazyListenerRunner, ): self.logger = logger @@ -235,7 +235,7 @@

    Classes

    class ThreadListenerRunner -(logger: logging.Logger, process_before_response: bool, listener_error_handler: ListenerErrorHandler, listener_completion_handler: ListenerCompletionHandler, listener_executor: concurrent.futures.thread.ThreadPoolExecutor, lazy_listener_runner: LazyListenerRunner) +(logger: logging.Logger, process_before_response: bool, listener_error_handler: ListenerErrorHandler, listener_completion_handler: ListenerCompletionHandler, listener_executor: concurrent.futures._base.Executor, lazy_listener_runner: LazyListenerRunner)
    @@ -248,7 +248,7 @@

    Classes

    process_before_response: bool listener_error_handler: ListenerErrorHandler listener_completion_handler: ListenerCompletionHandler - listener_executor: ThreadPoolExecutor + listener_executor: Executor lazy_listener_runner: LazyListenerRunner def __init__( @@ -257,7 +257,7 @@

    Classes

    process_before_response: bool, listener_error_handler: ListenerErrorHandler, listener_completion_handler: ListenerCompletionHandler, - listener_executor: ThreadPoolExecutor, + listener_executor: Executor, lazy_listener_runner: LazyListenerRunner, ): self.logger = logger @@ -435,7 +435,7 @@

    Class variables

    -
    var listener_executor : concurrent.futures.thread.ThreadPoolExecutor
    +
    var listener_executor : concurrent.futures._base.Executor
    @@ -627,7 +627,7 @@

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener_matcher/async_builtins.html b/docs/api-docs/slack_bolt/listener_matcher/async_builtins.html index f27e58877..2e6d19576 100644 --- a/docs/api-docs/slack_bolt/listener_matcher/async_builtins.html +++ b/docs/api-docs/slack_bolt/listener_matcher/async_builtins.html @@ -3,7 +3,7 @@ - + slack_bolt.listener_matcher.async_builtins API documentation @@ -123,7 +123,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener_matcher/async_listener_matcher.html b/docs/api-docs/slack_bolt/listener_matcher/async_listener_matcher.html index 7475c9121..3287a9b40 100644 --- a/docs/api-docs/slack_bolt/listener_matcher/async_listener_matcher.html +++ b/docs/api-docs/slack_bolt/listener_matcher/async_listener_matcher.html @@ -3,7 +3,7 @@ - + slack_bolt.listener_matcher.async_listener_matcher API documentation @@ -363,7 +363,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener_matcher/builtins.html b/docs/api-docs/slack_bolt/listener_matcher/builtins.html index fec2817de..238285f36 100644 --- a/docs/api-docs/slack_bolt/listener_matcher/builtins.html +++ b/docs/api-docs/slack_bolt/listener_matcher/builtins.html @@ -3,7 +3,7 @@ - + slack_bolt.listener_matcher.builtins API documentation @@ -742,7 +742,7 @@

    Functions

    -def event(constraints: Union[str, re.Pattern, Dict[str, Union[str, Sequence[Union[str, re.Pattern, NoneType]]]]], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def event(constraints: Union[str, re.Pattern, Dict[str, Union[str, Sequence[Union[str, re.Pattern, ForwardRef(None)]]]]], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -1142,7 +1142,7 @@

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener_matcher/custom_listener_matcher.html b/docs/api-docs/slack_bolt/listener_matcher/custom_listener_matcher.html index dc703cb18..e9c8b0d5f 100644 --- a/docs/api-docs/slack_bolt/listener_matcher/custom_listener_matcher.html +++ b/docs/api-docs/slack_bolt/listener_matcher/custom_listener_matcher.html @@ -3,7 +3,7 @@ - + slack_bolt.listener_matcher.custom_listener_matcher API documentation @@ -166,7 +166,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener_matcher/index.html b/docs/api-docs/slack_bolt/listener_matcher/index.html index e0e36b234..12f5ed614 100644 --- a/docs/api-docs/slack_bolt/listener_matcher/index.html +++ b/docs/api-docs/slack_bolt/listener_matcher/index.html @@ -3,7 +3,7 @@ - + slack_bolt.listener_matcher API documentation @@ -101,7 +101,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener_matcher/listener_matcher.html b/docs/api-docs/slack_bolt/listener_matcher/listener_matcher.html index 0a82d26b1..c9ed6ee8b 100644 --- a/docs/api-docs/slack_bolt/listener_matcher/listener_matcher.html +++ b/docs/api-docs/slack_bolt/listener_matcher/listener_matcher.html @@ -3,7 +3,7 @@ - + slack_bolt.listener_matcher.listener_matcher API documentation @@ -148,7 +148,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/logger/index.html b/docs/api-docs/slack_bolt/logger/index.html index 3797b62e5..42ad13c85 100644 --- a/docs/api-docs/slack_bolt/logger/index.html +++ b/docs/api-docs/slack_bolt/logger/index.html @@ -3,7 +3,7 @@ - + slack_bolt.logger API documentation @@ -137,7 +137,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/logger/messages.html b/docs/api-docs/slack_bolt/logger/messages.html index a8897a065..a29a8e9d0 100644 --- a/docs/api-docs/slack_bolt/logger/messages.html +++ b/docs/api-docs/slack_bolt/logger/messages.html @@ -3,7 +3,7 @@ - + slack_bolt.logger.messages API documentation @@ -912,7 +912,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/async_builtins.html b/docs/api-docs/slack_bolt/middleware/async_builtins.html index dccd18ccf..987ff15fc 100644 --- a/docs/api-docs/slack_bolt/middleware/async_builtins.html +++ b/docs/api-docs/slack_bolt/middleware/async_builtins.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.async_builtins API documentation @@ -63,7 +63,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/async_custom_middleware.html b/docs/api-docs/slack_bolt/middleware/async_custom_middleware.html index 88fd3dab0..f4f454203 100644 --- a/docs/api-docs/slack_bolt/middleware/async_custom_middleware.html +++ b/docs/api-docs/slack_bolt/middleware/async_custom_middleware.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.async_custom_middleware API documentation @@ -204,7 +204,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/async_middleware.html b/docs/api-docs/slack_bolt/middleware/async_middleware.html index d7edd2ceb..300ab3c02 100644 --- a/docs/api-docs/slack_bolt/middleware/async_middleware.html +++ b/docs/api-docs/slack_bolt/middleware/async_middleware.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.async_middleware API documentation @@ -273,7 +273,7 @@

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/async_middleware_error_handler.html b/docs/api-docs/slack_bolt/middleware/async_middleware_error_handler.html index 9738cc16e..0ca090052 100644 --- a/docs/api-docs/slack_bolt/middleware/async_middleware_error_handler.html +++ b/docs/api-docs/slack_bolt/middleware/async_middleware_error_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.async_middleware_error_handler API documentation @@ -231,7 +231,7 @@

    Subclasses

    Methods

    -async def handle(self, error: Exception, request: AsyncBoltRequest, response: Optional[BoltResponse]) ‑> NoneType +async def handle(self, error: Exception, request: AsyncBoltRequest, response: Optional[BoltResponse]) ‑> None

    Handles an unhandled exception.

    @@ -301,7 +301,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/authorization/async_authorization.html b/docs/api-docs/slack_bolt/middleware/authorization/async_authorization.html index 3fb9544af..40ca48ece 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/async_authorization.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/async_authorization.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.authorization.async_authorization API documentation @@ -101,7 +101,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/authorization/async_internals.html b/docs/api-docs/slack_bolt/middleware/authorization/async_internals.html index 452e6f147..db3304745 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/async_internals.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/async_internals.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.authorization.async_internals API documentation @@ -80,7 +80,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html b/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html index 60ef76a9d..19c95ca30 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.authorization.async_multi_teams_authorization API documentation @@ -234,7 +234,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html b/docs/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html index 15307fedf..65fac44b0 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.authorization.async_single_team_authorization API documentation @@ -200,7 +200,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/authorization/authorization.html b/docs/api-docs/slack_bolt/middleware/authorization/authorization.html index 1b99b315c..91cf574df 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/authorization.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/authorization.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.authorization.authorization API documentation @@ -98,7 +98,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/authorization/index.html b/docs/api-docs/slack_bolt/middleware/authorization/index.html index d2160f4f8..30c22c10b 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/index.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/index.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.authorization API documentation @@ -103,7 +103,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/authorization/internals.html b/docs/api-docs/slack_bolt/middleware/authorization/internals.html index 295b3928f..ce91e1b48 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/internals.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.authorization.internals API documentation @@ -130,7 +130,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/authorization/multi_teams_authorization.html b/docs/api-docs/slack_bolt/middleware/authorization/multi_teams_authorization.html index 51ec9bf56..1a208e9a1 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/multi_teams_authorization.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/multi_teams_authorization.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.authorization.multi_teams_authorization API documentation @@ -239,7 +239,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html b/docs/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html index f588554de..c59b62d7d 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.authorization.single_team_authorization API documentation @@ -217,7 +217,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/custom_middleware.html b/docs/api-docs/slack_bolt/middleware/custom_middleware.html index 39ad5cd79..901f1b928 100644 --- a/docs/api-docs/slack_bolt/middleware/custom_middleware.html +++ b/docs/api-docs/slack_bolt/middleware/custom_middleware.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.custom_middleware API documentation @@ -196,7 +196,7 @@

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/ignoring_self_events/async_ignoring_self_events.html b/docs/api-docs/slack_bolt/middleware/ignoring_self_events/async_ignoring_self_events.html index 2d26cdcfe..b04e95361 100644 --- a/docs/api-docs/slack_bolt/middleware/ignoring_self_events/async_ignoring_self_events.html +++ b/docs/api-docs/slack_bolt/middleware/ignoring_self_events/async_ignoring_self_events.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.ignoring_self_events.async_ignoring_self_events API documentation @@ -130,7 +130,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.html b/docs/api-docs/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.html index 59094c1fa..e7abb14fc 100644 --- a/docs/api-docs/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.html +++ b/docs/api-docs/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.ignoring_self_events.ignoring_self_events API documentation @@ -195,7 +195,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/ignoring_self_events/index.html b/docs/api-docs/slack_bolt/middleware/ignoring_self_events/index.html index 7ff74ced3..7a02e5fcd 100644 --- a/docs/api-docs/slack_bolt/middleware/ignoring_self_events/index.html +++ b/docs/api-docs/slack_bolt/middleware/ignoring_self_events/index.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.ignoring_self_events API documentation @@ -70,7 +70,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/index.html b/docs/api-docs/slack_bolt/middleware/index.html index e19b89063..d134d6366 100644 --- a/docs/api-docs/slack_bolt/middleware/index.html +++ b/docs/api-docs/slack_bolt/middleware/index.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware API documentation @@ -155,7 +155,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/message_listener_matches/async_message_listener_matches.html b/docs/api-docs/slack_bolt/middleware/message_listener_matches/async_message_listener_matches.html index 266574386..aa9a5cd93 100644 --- a/docs/api-docs/slack_bolt/middleware/message_listener_matches/async_message_listener_matches.html +++ b/docs/api-docs/slack_bolt/middleware/message_listener_matches/async_message_listener_matches.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.message_listener_matches.async_message_listener_matches API documentation @@ -152,7 +152,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/message_listener_matches/index.html b/docs/api-docs/slack_bolt/middleware/message_listener_matches/index.html index d8d306552..f7d2f875c 100644 --- a/docs/api-docs/slack_bolt/middleware/message_listener_matches/index.html +++ b/docs/api-docs/slack_bolt/middleware/message_listener_matches/index.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.message_listener_matches API documentation @@ -70,7 +70,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/message_listener_matches/message_listener_matches.html b/docs/api-docs/slack_bolt/middleware/message_listener_matches/message_listener_matches.html index 60dc26b23..9f294802d 100644 --- a/docs/api-docs/slack_bolt/middleware/message_listener_matches/message_listener_matches.html +++ b/docs/api-docs/slack_bolt/middleware/message_listener_matches/message_listener_matches.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.message_listener_matches.message_listener_matches API documentation @@ -152,7 +152,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/middleware.html b/docs/api-docs/slack_bolt/middleware/middleware.html index 7c07cfb1b..31559706d 100644 --- a/docs/api-docs/slack_bolt/middleware/middleware.html +++ b/docs/api-docs/slack_bolt/middleware/middleware.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.middleware API documentation @@ -273,7 +273,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/middleware_error_handler.html b/docs/api-docs/slack_bolt/middleware/middleware_error_handler.html index ff2d0b318..1771c3740 100644 --- a/docs/api-docs/slack_bolt/middleware/middleware_error_handler.html +++ b/docs/api-docs/slack_bolt/middleware/middleware_error_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.middleware_error_handler API documentation @@ -227,7 +227,7 @@

    Subclasses

    Methods

    -def handle(self, error: Exception, request: BoltRequest, response: Optional[BoltResponse]) ‑> NoneType +def handle(self, error: Exception, request: BoltRequest, response: Optional[BoltResponse]) ‑> None

    Handles an unhandled exception.

    @@ -297,7 +297,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/request_verification/async_request_verification.html b/docs/api-docs/slack_bolt/middleware/request_verification/async_request_verification.html index 5426e8beb..853eaee48 100644 --- a/docs/api-docs/slack_bolt/middleware/request_verification/async_request_verification.html +++ b/docs/api-docs/slack_bolt/middleware/request_verification/async_request_verification.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.request_verification.async_request_verification API documentation @@ -168,7 +168,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/request_verification/index.html b/docs/api-docs/slack_bolt/middleware/request_verification/index.html index 5b5e4b74b..ecf4ccbc3 100644 --- a/docs/api-docs/slack_bolt/middleware/request_verification/index.html +++ b/docs/api-docs/slack_bolt/middleware/request_verification/index.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.request_verification API documentation @@ -70,7 +70,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/request_verification/request_verification.html b/docs/api-docs/slack_bolt/middleware/request_verification/request_verification.html index c6a70ec2e..81e8e9952 100644 --- a/docs/api-docs/slack_bolt/middleware/request_verification/request_verification.html +++ b/docs/api-docs/slack_bolt/middleware/request_verification/request_verification.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.request_verification.request_verification API documentation @@ -213,7 +213,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/ssl_check/async_ssl_check.html b/docs/api-docs/slack_bolt/middleware/ssl_check/async_ssl_check.html index e29cb2a1e..76e2501a0 100644 --- a/docs/api-docs/slack_bolt/middleware/ssl_check/async_ssl_check.html +++ b/docs/api-docs/slack_bolt/middleware/ssl_check/async_ssl_check.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.ssl_check.async_ssl_check API documentation @@ -159,7 +159,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/ssl_check/index.html b/docs/api-docs/slack_bolt/middleware/ssl_check/index.html index 1e882b71e..c40c6f89a 100644 --- a/docs/api-docs/slack_bolt/middleware/ssl_check/index.html +++ b/docs/api-docs/slack_bolt/middleware/ssl_check/index.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.ssl_check API documentation @@ -70,7 +70,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/ssl_check/ssl_check.html b/docs/api-docs/slack_bolt/middleware/ssl_check/ssl_check.html index cc328c988..76dcd8647 100644 --- a/docs/api-docs/slack_bolt/middleware/ssl_check/ssl_check.html +++ b/docs/api-docs/slack_bolt/middleware/ssl_check/ssl_check.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.ssl_check.ssl_check API documentation @@ -219,7 +219,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/url_verification/async_url_verification.html b/docs/api-docs/slack_bolt/middleware/url_verification/async_url_verification.html index fefdb0e2b..8a862b3c8 100644 --- a/docs/api-docs/slack_bolt/middleware/url_verification/async_url_verification.html +++ b/docs/api-docs/slack_bolt/middleware/url_verification/async_url_verification.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.url_verification.async_url_verification API documentation @@ -134,7 +134,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/url_verification/index.html b/docs/api-docs/slack_bolt/middleware/url_verification/index.html index c05507fa0..418edf7fc 100644 --- a/docs/api-docs/slack_bolt/middleware/url_verification/index.html +++ b/docs/api-docs/slack_bolt/middleware/url_verification/index.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.url_verification API documentation @@ -70,7 +70,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/middleware/url_verification/url_verification.html b/docs/api-docs/slack_bolt/middleware/url_verification/url_verification.html index 82789210b..e1f45172d 100644 --- a/docs/api-docs/slack_bolt/middleware/url_verification/url_verification.html +++ b/docs/api-docs/slack_bolt/middleware/url_verification/url_verification.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.url_verification.url_verification API documentation @@ -164,7 +164,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/oauth/async_callback_options.html b/docs/api-docs/slack_bolt/oauth/async_callback_options.html index c09e724ae..7bf7a9274 100644 --- a/docs/api-docs/slack_bolt/oauth/async_callback_options.html +++ b/docs/api-docs/slack_bolt/oauth/async_callback_options.html @@ -3,7 +3,7 @@ - + slack_bolt.oauth.async_callback_options API documentation @@ -393,7 +393,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/oauth/async_internals.html b/docs/api-docs/slack_bolt/oauth/async_internals.html index f45a65941..f779ee254 100644 --- a/docs/api-docs/slack_bolt/oauth/async_internals.html +++ b/docs/api-docs/slack_bolt/oauth/async_internals.html @@ -3,7 +3,7 @@ - + slack_bolt.oauth.async_internals API documentation @@ -157,7 +157,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/oauth/async_oauth_flow.html b/docs/api-docs/slack_bolt/oauth/async_oauth_flow.html index 3730a317f..6aad14534 100644 --- a/docs/api-docs/slack_bolt/oauth/async_oauth_flow.html +++ b/docs/api-docs/slack_bolt/oauth/async_oauth_flow.html @@ -3,7 +3,7 @@ - + slack_bolt.oauth.async_oauth_flow API documentation @@ -189,30 +189,32 @@

    Module slack_bolt.oauth.async_oauth_flow

    # ----------------------------- async def handle_installation(self, request: AsyncBoltRequest) -> BoltResponse: - state = await self.issue_new_state(request) - url = await self.build_authorize_url(state, request) - set_cookie_value = self.settings.state_utils.build_set_cookie_for_new_state( - state - ) + set_cookie_value: Optional[str] = None + url = await self.build_authorize_url("", request) + if self.settings.state_validation_enabled is True: + state = await self.issue_new_state(request) + url = await self.build_authorize_url(state, request) + set_cookie_value = self.settings.state_utils.build_set_cookie_for_new_state( + state + ) if self.settings.install_page_rendering_enabled: html = await self.build_install_page_html(url, request) return BoltResponse( status=200, body=html, - headers={ - "Content-Type": "text/html; charset=utf-8", - "Set-Cookie": [set_cookie_value], - }, + headers=await self.append_set_cookie_headers( + {"Content-Type": "text/html; charset=utf-8"}, + set_cookie_value, + ), ) else: return BoltResponse( status=302, body="", - headers={ - "Content-Type": "text/html; charset=utf-8", - "Location": url, - "Set-Cookie": [set_cookie_value], - }, + headers=await self.append_set_cookie_headers( + {"Content-Type": "text/html; charset=utf-8", "Location": url}, + set_cookie_value, + ), ) # ---------------------- @@ -227,6 +229,13 @@

    Module slack_bolt.oauth.async_oauth_flow

    async def build_install_page_html(self, url: str, request: AsyncBoltRequest) -> str: return _build_default_install_page_html(url) + async def append_set_cookie_headers( + self, headers: dict, set_cookie_value: Optional[str] + ): + if set_cookie_value is not None: + headers["Set-Cookie"] = [set_cookie_value] + return headers + # ----------------------------- # Callback # ----------------------------- @@ -247,29 +256,30 @@

    Module slack_bolt.oauth.async_oauth_flow

    ) # state parameter verification - state: Optional[str] = request.query.get("state", [None])[0] - if not self.settings.state_utils.is_valid_browser(state, request.headers): - return await self.failure_handler( - AsyncFailureArgs( - request=request, - reason="invalid_browser", - suggested_status_code=400, - settings=self.settings, - default=self.default_callback_options, + if self.settings.state_validation_enabled is True: + state: Optional[str] = request.query.get("state", [None])[0] + if not self.settings.state_utils.is_valid_browser(state, request.headers): + return await self.failure_handler( + AsyncFailureArgs( + request=request, + reason="invalid_browser", + suggested_status_code=400, + settings=self.settings, + default=self.default_callback_options, + ) ) - ) - valid_state_consumed = await self.settings.state_store.async_consume(state) - if not valid_state_consumed: - return await self.failure_handler( - AsyncFailureArgs( - request=request, - reason="invalid_state", - suggested_status_code=401, - settings=self.settings, - default=self.default_callback_options, + valid_state_consumed = await self.settings.state_store.async_consume(state) + if not valid_state_consumed: + return await self.failure_handler( + AsyncFailureArgs( + request=request, + reason="invalid_state", + suggested_status_code=401, + settings=self.settings, + default=self.default_callback_options, + ) ) - ) # run installation code = request.query.get("code", [None])[0] @@ -560,30 +570,32 @@

    Args

    # ----------------------------- async def handle_installation(self, request: AsyncBoltRequest) -> BoltResponse: - state = await self.issue_new_state(request) - url = await self.build_authorize_url(state, request) - set_cookie_value = self.settings.state_utils.build_set_cookie_for_new_state( - state - ) + set_cookie_value: Optional[str] = None + url = await self.build_authorize_url("", request) + if self.settings.state_validation_enabled is True: + state = await self.issue_new_state(request) + url = await self.build_authorize_url(state, request) + set_cookie_value = self.settings.state_utils.build_set_cookie_for_new_state( + state + ) if self.settings.install_page_rendering_enabled: html = await self.build_install_page_html(url, request) return BoltResponse( status=200, body=html, - headers={ - "Content-Type": "text/html; charset=utf-8", - "Set-Cookie": [set_cookie_value], - }, + headers=await self.append_set_cookie_headers( + {"Content-Type": "text/html; charset=utf-8"}, + set_cookie_value, + ), ) else: return BoltResponse( status=302, body="", - headers={ - "Content-Type": "text/html; charset=utf-8", - "Location": url, - "Set-Cookie": [set_cookie_value], - }, + headers=await self.append_set_cookie_headers( + {"Content-Type": "text/html; charset=utf-8", "Location": url}, + set_cookie_value, + ), ) # ---------------------- @@ -598,6 +610,13 @@

    Args

    async def build_install_page_html(self, url: str, request: AsyncBoltRequest) -> str: return _build_default_install_page_html(url) + async def append_set_cookie_headers( + self, headers: dict, set_cookie_value: Optional[str] + ): + if set_cookie_value is not None: + headers["Set-Cookie"] = [set_cookie_value] + return headers + # ----------------------------- # Callback # ----------------------------- @@ -618,29 +637,30 @@

    Args

    ) # state parameter verification - state: Optional[str] = request.query.get("state", [None])[0] - if not self.settings.state_utils.is_valid_browser(state, request.headers): - return await self.failure_handler( - AsyncFailureArgs( - request=request, - reason="invalid_browser", - suggested_status_code=400, - settings=self.settings, - default=self.default_callback_options, + if self.settings.state_validation_enabled is True: + state: Optional[str] = request.query.get("state", [None])[0] + if not self.settings.state_utils.is_valid_browser(state, request.headers): + return await self.failure_handler( + AsyncFailureArgs( + request=request, + reason="invalid_browser", + suggested_status_code=400, + settings=self.settings, + default=self.default_callback_options, + ) ) - ) - valid_state_consumed = await self.settings.state_store.async_consume(state) - if not valid_state_consumed: - return await self.failure_handler( - AsyncFailureArgs( - request=request, - reason="invalid_state", - suggested_status_code=401, - settings=self.settings, - default=self.default_callback_options, + valid_state_consumed = await self.settings.state_store.async_consume(state) + if not valid_state_consumed: + return await self.failure_handler( + AsyncFailureArgs( + request=request, + reason="invalid_state", + suggested_status_code=401, + settings=self.settings, + default=self.default_callback_options, + ) ) - ) # run installation code = request.query.get("code", [None])[0] @@ -910,6 +930,23 @@

    Instance variables

    Methods

    + +
    +
    +
    + +Expand source code + +
    async def append_set_cookie_headers(
    +    self, headers: dict, set_cookie_value: Optional[str]
    +):
    +    if set_cookie_value is not None:
    +        headers["Set-Cookie"] = [set_cookie_value]
    +    return headers
    +
    +
    async def build_authorize_url(self, state: str, request: AsyncBoltRequest) ‑> str
    @@ -961,29 +998,30 @@

    Methods

    ) # state parameter verification - state: Optional[str] = request.query.get("state", [None])[0] - if not self.settings.state_utils.is_valid_browser(state, request.headers): - return await self.failure_handler( - AsyncFailureArgs( - request=request, - reason="invalid_browser", - suggested_status_code=400, - settings=self.settings, - default=self.default_callback_options, + if self.settings.state_validation_enabled is True: + state: Optional[str] = request.query.get("state", [None])[0] + if not self.settings.state_utils.is_valid_browser(state, request.headers): + return await self.failure_handler( + AsyncFailureArgs( + request=request, + reason="invalid_browser", + suggested_status_code=400, + settings=self.settings, + default=self.default_callback_options, + ) ) - ) - valid_state_consumed = await self.settings.state_store.async_consume(state) - if not valid_state_consumed: - return await self.failure_handler( - AsyncFailureArgs( - request=request, - reason="invalid_state", - suggested_status_code=401, - settings=self.settings, - default=self.default_callback_options, + valid_state_consumed = await self.settings.state_store.async_consume(state) + if not valid_state_consumed: + return await self.failure_handler( + AsyncFailureArgs( + request=request, + reason="invalid_state", + suggested_status_code=401, + settings=self.settings, + default=self.default_callback_options, + ) ) - ) # run installation code = request.query.get("code", [None])[0] @@ -1047,30 +1085,32 @@

    Methods

    Expand source code
    async def handle_installation(self, request: AsyncBoltRequest) -> BoltResponse:
    -    state = await self.issue_new_state(request)
    -    url = await self.build_authorize_url(state, request)
    -    set_cookie_value = self.settings.state_utils.build_set_cookie_for_new_state(
    -        state
    -    )
    +    set_cookie_value: Optional[str] = None
    +    url = await self.build_authorize_url("", request)
    +    if self.settings.state_validation_enabled is True:
    +        state = await self.issue_new_state(request)
    +        url = await self.build_authorize_url(state, request)
    +        set_cookie_value = self.settings.state_utils.build_set_cookie_for_new_state(
    +            state
    +        )
         if self.settings.install_page_rendering_enabled:
             html = await self.build_install_page_html(url, request)
             return BoltResponse(
                 status=200,
                 body=html,
    -            headers={
    -                "Content-Type": "text/html; charset=utf-8",
    -                "Set-Cookie": [set_cookie_value],
    -            },
    +            headers=await self.append_set_cookie_headers(
    +                {"Content-Type": "text/html; charset=utf-8"},
    +                set_cookie_value,
    +            ),
             )
         else:
             return BoltResponse(
                 status=302,
                 body="",
    -            headers={
    -                "Content-Type": "text/html; charset=utf-8",
    -                "Location": url,
    -                "Set-Cookie": [set_cookie_value],
    -            },
    +            headers=await self.append_set_cookie_headers(
    +                {"Content-Type": "text/html; charset=utf-8", "Location": url},
    +                set_cookie_value,
    +            ),
             )

    @@ -1199,6 +1239,7 @@

    Index

  • AsyncOAuthFlow

      +
    • append_set_cookie_headers
    • build_authorize_url
    • build_install_page_html
    • client
    • @@ -1224,7 +1265,7 @@

      -

      Generated by pdoc 0.9.2.

      +

      Generated by pdoc 0.10.0.

      \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/oauth/async_oauth_settings.html b/docs/api-docs/slack_bolt/oauth/async_oauth_settings.html index 29e0eaf01..33a984dcb 100644 --- a/docs/api-docs/slack_bolt/oauth/async_oauth_settings.html +++ b/docs/api-docs/slack_bolt/oauth/async_oauth_settings.html @@ -3,7 +3,7 @@ - + slack_bolt.oauth.async_oauth_settings API documentation @@ -72,6 +72,7 @@

      Module slack_bolt.oauth.async_oauth_settings

      token_rotation_expiration_minutes: int authorize: AsyncAuthorize # state parameter related configurations + state_validation_enabled: bool state_store: AsyncOAuthStateStore state_cookie_name: str state_expiration_seconds: int @@ -104,6 +105,7 @@

      Module slack_bolt.oauth.async_oauth_settings

      installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, # state parameter related configurations + state_validation_enabled: bool = True, state_store: Optional[AsyncOAuthStateStore] = None, state_cookie_name: str = OAuthStateUtils.default_cookie_name, state_expiration_seconds: int = OAuthStateUtils.default_expiration_seconds, @@ -128,6 +130,7 @@

      Module slack_bolt.oauth.async_oauth_settings

      installation_store: Specify the instance of `InstallationStore` (Default: `FileInstallationStore`) installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) token_rotation_expiration_minutes: Minutes before refreshing tokens (Default: 2 hours) + state_validation_enabled: Set False if your OAuth flow omits the state parameter validation (Default: True) state_store: Specify the instance of `InstallationStore` (Default: `FileOAuthStateStore`) state_cookie_name: The cookie name that is set for installers' browser. (Default: "slack-app-oauth-state") state_expiration_seconds: The seconds that the state value is alive (Default: 600 seconds) @@ -181,6 +184,7 @@

      Module slack_bolt.oauth.async_oauth_settings

      bot_only=self.installation_store_bot_only, ) # state parameter related configurations + self.state_validation_enabled = state_validation_enabled self.state_store = state_store or FileOAuthStateStore( expiration_seconds=state_expiration_seconds, client_id=client_id, @@ -218,7 +222,7 @@

      Classes

      class AsyncOAuthSettings -(*, client_id: Optional[str] = None, client_secret: Optional[str] = None, scopes: Union[str, Sequence[str], NoneType] = None, user_scopes: Union[str, Sequence[str], NoneType] = None, redirect_uri: Optional[str] = None, install_path: str = '/slack/install', install_page_rendering_enabled: bool = True, redirect_uri_path: str = '/slack/oauth_redirect', callback_options: Optional[AsyncCallbackOptions] = None, success_url: Optional[str] = None, failure_url: Optional[str] = None, authorization_url: Optional[str] = None, installation_store: Optional[slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore] = None, installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, state_store: Optional[slack_sdk.oauth.state_store.async_state_store.AsyncOAuthStateStore] = None, state_cookie_name: str = 'slack-app-oauth-state', state_expiration_seconds: int = 600, logger: logging.Logger = <Logger slack_bolt.oauth.async_oauth_settings (WARNING)>) +(*, client_id: Optional[str] = None, client_secret: Optional[str] = None, scopes: Union[str, Sequence[str], ForwardRef(None)] = None, user_scopes: Union[str, Sequence[str], ForwardRef(None)] = None, redirect_uri: Optional[str] = None, install_path: str = '/slack/install', install_page_rendering_enabled: bool = True, redirect_uri_path: str = '/slack/oauth_redirect', callback_options: Optional[AsyncCallbackOptions] = None, success_url: Optional[str] = None, failure_url: Optional[str] = None, authorization_url: Optional[str] = None, installation_store: Optional[slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore] = None, installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, state_validation_enabled: bool = True, state_store: Optional[slack_sdk.oauth.state_store.async_state_store.AsyncOAuthStateStore] = None, state_cookie_name: str = 'slack-app-oauth-state', state_expiration_seconds: int = 600, logger: logging.Logger = <Logger slack_bolt.oauth.async_oauth_settings (WARNING)>)

      The settings for Slack App installation (OAuth flow).

      @@ -254,6 +258,8 @@

      Args

      Use InstallationStore#find_bot() if True (Default: False)
      token_rotation_expiration_minutes
      Minutes before refreshing tokens (Default: 2 hours)
      +
      state_validation_enabled
      +
      Set False if your OAuth flow omits the state parameter validation (Default: True)
      state_store
      Specify the instance of InstallationStore (Default: FileOAuthStateStore)
      state_cookie_name
      @@ -288,6 +294,7 @@

      Args

      token_rotation_expiration_minutes: int authorize: AsyncAuthorize # state parameter related configurations + state_validation_enabled: bool state_store: AsyncOAuthStateStore state_cookie_name: str state_expiration_seconds: int @@ -320,6 +327,7 @@

      Args

      installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, # state parameter related configurations + state_validation_enabled: bool = True, state_store: Optional[AsyncOAuthStateStore] = None, state_cookie_name: str = OAuthStateUtils.default_cookie_name, state_expiration_seconds: int = OAuthStateUtils.default_expiration_seconds, @@ -344,6 +352,7 @@

      Args

      installation_store: Specify the instance of `InstallationStore` (Default: `FileInstallationStore`) installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) token_rotation_expiration_minutes: Minutes before refreshing tokens (Default: 2 hours) + state_validation_enabled: Set False if your OAuth flow omits the state parameter validation (Default: True) state_store: Specify the instance of `InstallationStore` (Default: `FileOAuthStateStore`) state_cookie_name: The cookie name that is set for installers' browser. (Default: "slack-app-oauth-state") state_expiration_seconds: The seconds that the state value is alive (Default: 600 seconds) @@ -397,6 +406,7 @@

      Args

      bot_only=self.installation_store_bot_only, ) # state parameter related configurations + self.state_validation_enabled = state_validation_enabled self.state_store = state_store or FileOAuthStateStore( expiration_seconds=state_expiration_seconds, client_id=client_id, @@ -504,6 +514,10 @@

      Class variables

      +
      var state_validation_enabled : bool
      +
      +
      +
      var success_url : Optional[str]
      @@ -557,6 +571,7 @@

      state_expiration_seconds
    • state_store
    • state_utils
    • +
    • state_validation_enabled
    • success_url
    • token_rotation_expiration_minutes
    • user_scopes
    • @@ -568,7 +583,7 @@

      \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/oauth/callback_options.html b/docs/api-docs/slack_bolt/oauth/callback_options.html index f0d2ccac4..f320fcba8 100644 --- a/docs/api-docs/slack_bolt/oauth/callback_options.html +++ b/docs/api-docs/slack_bolt/oauth/callback_options.html @@ -3,7 +3,7 @@ - + slack_bolt.oauth.callback_options API documentation @@ -415,7 +415,7 @@

      -

      Generated by pdoc 0.9.2.

      +

      Generated by pdoc 0.10.0.

      \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/oauth/index.html b/docs/api-docs/slack_bolt/oauth/index.html index 7ee2eab58..74db2f17b 100644 --- a/docs/api-docs/slack_bolt/oauth/index.html +++ b/docs/api-docs/slack_bolt/oauth/index.html @@ -3,7 +3,7 @@ - + slack_bolt.oauth API documentation @@ -108,7 +108,7 @@

      Index

      \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/oauth/internals.html b/docs/api-docs/slack_bolt/oauth/internals.html index 68a5ce7bc..90934dc3a 100644 --- a/docs/api-docs/slack_bolt/oauth/internals.html +++ b/docs/api-docs/slack_bolt/oauth/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.oauth.internals API documentation @@ -319,7 +319,7 @@

      -

      Generated by pdoc 0.9.2.

      +

      Generated by pdoc 0.10.0.

      \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/oauth/oauth_flow.html b/docs/api-docs/slack_bolt/oauth/oauth_flow.html index 4d345e60b..d08d228be 100644 --- a/docs/api-docs/slack_bolt/oauth/oauth_flow.html +++ b/docs/api-docs/slack_bolt/oauth/oauth_flow.html @@ -3,7 +3,7 @@ - + slack_bolt.oauth.oauth_flow API documentation @@ -186,30 +186,33 @@

      Module slack_bolt.oauth.oauth_flow

      # ----------------------------- def handle_installation(self, request: BoltRequest) -> BoltResponse: - state = self.issue_new_state(request) - url = self.build_authorize_url(state, request) - set_cookie_value = self.settings.state_utils.build_set_cookie_for_new_state( - state - ) + set_cookie_value: Optional[str] = None + url = self.build_authorize_url("", request) + if self.settings.state_validation_enabled is True: + state = self.issue_new_state(request) + url = self.build_authorize_url(state, request) + set_cookie_value = self.settings.state_utils.build_set_cookie_for_new_state( + state + ) + if self.settings.install_page_rendering_enabled: html = self.build_install_page_html(url, request) return BoltResponse( status=200, body=html, - headers={ - "Content-Type": "text/html; charset=utf-8", - "Set-Cookie": [set_cookie_value], - }, + headers=self.append_set_cookie_headers( + {"Content-Type": "text/html; charset=utf-8"}, + set_cookie_value, + ), ) else: return BoltResponse( status=302, body="", - headers={ - "Content-Type": "text/html; charset=utf-8", - "Location": url, - "Set-Cookie": [set_cookie_value], - }, + headers=self.append_set_cookie_headers( + {"Content-Type": "text/html; charset=utf-8", "Location": url}, + set_cookie_value, + ), ) # ---------------------- @@ -224,6 +227,11 @@

      Module slack_bolt.oauth.oauth_flow

      def build_install_page_html(self, url: str, request: BoltRequest) -> str: return _build_default_install_page_html(url) + def append_set_cookie_headers(self, headers: dict, set_cookie_value: Optional[str]): + if set_cookie_value is not None: + headers["Set-Cookie"] = [set_cookie_value] + return headers + # ----------------------------- # Callback # ----------------------------- @@ -244,29 +252,30 @@

      Module slack_bolt.oauth.oauth_flow

      ) # state parameter verification - state = request.query.get("state", [None])[0] - if not self.settings.state_utils.is_valid_browser(state, request.headers): - return self.failure_handler( - FailureArgs( - request=request, - reason="invalid_browser", - suggested_status_code=400, - settings=self.settings, - default=self.default_callback_options, + if self.settings.state_validation_enabled is True: + state = request.query.get("state", [None])[0] + if not self.settings.state_utils.is_valid_browser(state, request.headers): + return self.failure_handler( + FailureArgs( + request=request, + reason="invalid_browser", + suggested_status_code=400, + settings=self.settings, + default=self.default_callback_options, + ) ) - ) - valid_state_consumed = self.settings.state_store.consume(state) - if not valid_state_consumed: - return self.failure_handler( - FailureArgs( - request=request, - reason="invalid_state", - suggested_status_code=401, - settings=self.settings, - default=self.default_callback_options, + valid_state_consumed = self.settings.state_store.consume(state) + if not valid_state_consumed: + return self.failure_handler( + FailureArgs( + request=request, + reason="invalid_state", + suggested_status_code=401, + settings=self.settings, + default=self.default_callback_options, + ) ) - ) # run installation code = request.query.get("code", [None])[0] @@ -553,30 +562,33 @@

      Args

      # ----------------------------- def handle_installation(self, request: BoltRequest) -> BoltResponse: - state = self.issue_new_state(request) - url = self.build_authorize_url(state, request) - set_cookie_value = self.settings.state_utils.build_set_cookie_for_new_state( - state - ) + set_cookie_value: Optional[str] = None + url = self.build_authorize_url("", request) + if self.settings.state_validation_enabled is True: + state = self.issue_new_state(request) + url = self.build_authorize_url(state, request) + set_cookie_value = self.settings.state_utils.build_set_cookie_for_new_state( + state + ) + if self.settings.install_page_rendering_enabled: html = self.build_install_page_html(url, request) return BoltResponse( status=200, body=html, - headers={ - "Content-Type": "text/html; charset=utf-8", - "Set-Cookie": [set_cookie_value], - }, + headers=self.append_set_cookie_headers( + {"Content-Type": "text/html; charset=utf-8"}, + set_cookie_value, + ), ) else: return BoltResponse( status=302, body="", - headers={ - "Content-Type": "text/html; charset=utf-8", - "Location": url, - "Set-Cookie": [set_cookie_value], - }, + headers=self.append_set_cookie_headers( + {"Content-Type": "text/html; charset=utf-8", "Location": url}, + set_cookie_value, + ), ) # ---------------------- @@ -591,6 +603,11 @@

      Args

      def build_install_page_html(self, url: str, request: BoltRequest) -> str: return _build_default_install_page_html(url) + def append_set_cookie_headers(self, headers: dict, set_cookie_value: Optional[str]): + if set_cookie_value is not None: + headers["Set-Cookie"] = [set_cookie_value] + return headers + # ----------------------------- # Callback # ----------------------------- @@ -611,29 +628,30 @@

      Args

      ) # state parameter verification - state = request.query.get("state", [None])[0] - if not self.settings.state_utils.is_valid_browser(state, request.headers): - return self.failure_handler( - FailureArgs( - request=request, - reason="invalid_browser", - suggested_status_code=400, - settings=self.settings, - default=self.default_callback_options, + if self.settings.state_validation_enabled is True: + state = request.query.get("state", [None])[0] + if not self.settings.state_utils.is_valid_browser(state, request.headers): + return self.failure_handler( + FailureArgs( + request=request, + reason="invalid_browser", + suggested_status_code=400, + settings=self.settings, + default=self.default_callback_options, + ) ) - ) - valid_state_consumed = self.settings.state_store.consume(state) - if not valid_state_consumed: - return self.failure_handler( - FailureArgs( - request=request, - reason="invalid_state", - suggested_status_code=401, - settings=self.settings, - default=self.default_callback_options, + valid_state_consumed = self.settings.state_store.consume(state) + if not valid_state_consumed: + return self.failure_handler( + FailureArgs( + request=request, + reason="invalid_state", + suggested_status_code=401, + settings=self.settings, + default=self.default_callback_options, + ) ) - ) # run installation code = request.query.get("code", [None])[0] @@ -907,6 +925,21 @@

      Instance variables

      Methods

      + +
      +
      +
      + +Expand source code + +
      def append_set_cookie_headers(self, headers: dict, set_cookie_value: Optional[str]):
      +    if set_cookie_value is not None:
      +        headers["Set-Cookie"] = [set_cookie_value]
      +    return headers
      +
      +
      def build_authorize_url(self, state: str, request: BoltRequest) ‑> str
      @@ -958,29 +991,30 @@

      Methods

      ) # state parameter verification - state = request.query.get("state", [None])[0] - if not self.settings.state_utils.is_valid_browser(state, request.headers): - return self.failure_handler( - FailureArgs( - request=request, - reason="invalid_browser", - suggested_status_code=400, - settings=self.settings, - default=self.default_callback_options, + if self.settings.state_validation_enabled is True: + state = request.query.get("state", [None])[0] + if not self.settings.state_utils.is_valid_browser(state, request.headers): + return self.failure_handler( + FailureArgs( + request=request, + reason="invalid_browser", + suggested_status_code=400, + settings=self.settings, + default=self.default_callback_options, + ) ) - ) - valid_state_consumed = self.settings.state_store.consume(state) - if not valid_state_consumed: - return self.failure_handler( - FailureArgs( - request=request, - reason="invalid_state", - suggested_status_code=401, - settings=self.settings, - default=self.default_callback_options, + valid_state_consumed = self.settings.state_store.consume(state) + if not valid_state_consumed: + return self.failure_handler( + FailureArgs( + request=request, + reason="invalid_state", + suggested_status_code=401, + settings=self.settings, + default=self.default_callback_options, + ) ) - ) # run installation code = request.query.get("code", [None])[0] @@ -1044,30 +1078,33 @@

      Methods

      Expand source code
      def handle_installation(self, request: BoltRequest) -> BoltResponse:
      -    state = self.issue_new_state(request)
      -    url = self.build_authorize_url(state, request)
      -    set_cookie_value = self.settings.state_utils.build_set_cookie_for_new_state(
      -        state
      -    )
      +    set_cookie_value: Optional[str] = None
      +    url = self.build_authorize_url("", request)
      +    if self.settings.state_validation_enabled is True:
      +        state = self.issue_new_state(request)
      +        url = self.build_authorize_url(state, request)
      +        set_cookie_value = self.settings.state_utils.build_set_cookie_for_new_state(
      +            state
      +        )
      +
           if self.settings.install_page_rendering_enabled:
               html = self.build_install_page_html(url, request)
               return BoltResponse(
                   status=200,
                   body=html,
      -            headers={
      -                "Content-Type": "text/html; charset=utf-8",
      -                "Set-Cookie": [set_cookie_value],
      -            },
      +            headers=self.append_set_cookie_headers(
      +                {"Content-Type": "text/html; charset=utf-8"},
      +                set_cookie_value,
      +            ),
               )
           else:
               return BoltResponse(
                   status=302,
                   body="",
      -            headers={
      -                "Content-Type": "text/html; charset=utf-8",
      -                "Location": url,
      -                "Set-Cookie": [set_cookie_value],
      -            },
      +            headers=self.append_set_cookie_headers(
      +                {"Content-Type": "text/html; charset=utf-8", "Location": url},
      +                set_cookie_value,
      +            ),
               )

  • @@ -1194,6 +1231,7 @@

    Index

  • OAuthFlow

      +
    • append_set_cookie_headers
    • build_authorize_url
    • build_install_page_html
    • client
    • @@ -1219,7 +1257,7 @@

      -

      Generated by pdoc 0.9.2.

      +

      Generated by pdoc 0.10.0.

      \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/oauth/oauth_settings.html b/docs/api-docs/slack_bolt/oauth/oauth_settings.html index 83cee181b..a75cdbf60 100644 --- a/docs/api-docs/slack_bolt/oauth/oauth_settings.html +++ b/docs/api-docs/slack_bolt/oauth/oauth_settings.html @@ -3,7 +3,7 @@ - + slack_bolt.oauth.oauth_settings API documentation @@ -67,6 +67,7 @@

      Module slack_bolt.oauth.oauth_settings

      token_rotation_expiration_minutes: int authorize: Authorize # state parameter related configurations + state_validation_enabled: bool state_store: OAuthStateStore state_cookie_name: str state_expiration_seconds: int @@ -99,6 +100,7 @@

      Module slack_bolt.oauth.oauth_settings

      installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, # state parameter related configurations + state_validation_enabled: bool = True, state_store: Optional[OAuthStateStore] = None, state_cookie_name: str = OAuthStateUtils.default_cookie_name, state_expiration_seconds: int = OAuthStateUtils.default_expiration_seconds, @@ -123,6 +125,7 @@

      Module slack_bolt.oauth.oauth_settings

      installation_store: Specify the instance of `InstallationStore` (Default: `FileInstallationStore`) installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) token_rotation_expiration_minutes: Minutes before refreshing tokens (Default: 2 hours) + state_validation_enabled: Set False if your OAuth flow omits the state parameter validation (Default: True) state_store: Specify the instance of `InstallationStore` (Default: `FileOAuthStateStore`) state_cookie_name: The cookie name that is set for installers' browser. (Default: "slack-app-oauth-state") state_expiration_seconds: The seconds that the state value is alive (Default: 600 seconds) @@ -175,6 +178,7 @@

      Module slack_bolt.oauth.oauth_settings

      bot_only=self.installation_store_bot_only, ) # state parameter related configurations + self.state_validation_enabled = state_validation_enabled self.state_store = state_store or FileOAuthStateStore( expiration_seconds=state_expiration_seconds, client_id=client_id, @@ -212,7 +216,7 @@

      Classes

      class OAuthSettings -(*, client_id: Optional[str] = None, client_secret: Optional[str] = None, scopes: Union[str, Sequence[str], NoneType] = None, user_scopes: Union[str, Sequence[str], NoneType] = None, redirect_uri: Optional[str] = None, install_path: str = '/slack/install', install_page_rendering_enabled: bool = True, redirect_uri_path: str = '/slack/oauth_redirect', callback_options: Optional[CallbackOptions] = None, success_url: Optional[str] = None, failure_url: Optional[str] = None, authorization_url: Optional[str] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, state_store: Optional[slack_sdk.oauth.state_store.state_store.OAuthStateStore] = None, state_cookie_name: str = 'slack-app-oauth-state', state_expiration_seconds: int = 600, logger: logging.Logger = <Logger slack_bolt.oauth.oauth_settings (WARNING)>) +(*, client_id: Optional[str] = None, client_secret: Optional[str] = None, scopes: Union[str, Sequence[str], ForwardRef(None)] = None, user_scopes: Union[str, Sequence[str], ForwardRef(None)] = None, redirect_uri: Optional[str] = None, install_path: str = '/slack/install', install_page_rendering_enabled: bool = True, redirect_uri_path: str = '/slack/oauth_redirect', callback_options: Optional[CallbackOptions] = None, success_url: Optional[str] = None, failure_url: Optional[str] = None, authorization_url: Optional[str] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, state_validation_enabled: bool = True, state_store: Optional[slack_sdk.oauth.state_store.state_store.OAuthStateStore] = None, state_cookie_name: str = 'slack-app-oauth-state', state_expiration_seconds: int = 600, logger: logging.Logger = <Logger slack_bolt.oauth.oauth_settings (WARNING)>)

      The settings for Slack App installation (OAuth flow).

      @@ -248,6 +252,8 @@

      Args

      Use InstallationStore#find_bot() if True (Default: False)
      token_rotation_expiration_minutes
      Minutes before refreshing tokens (Default: 2 hours)
      +
      state_validation_enabled
      +
      Set False if your OAuth flow omits the state parameter validation (Default: True)
      state_store
      Specify the instance of InstallationStore (Default: FileOAuthStateStore)
      state_cookie_name
      @@ -282,6 +288,7 @@

      Args

      token_rotation_expiration_minutes: int authorize: Authorize # state parameter related configurations + state_validation_enabled: bool state_store: OAuthStateStore state_cookie_name: str state_expiration_seconds: int @@ -314,6 +321,7 @@

      Args

      installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, # state parameter related configurations + state_validation_enabled: bool = True, state_store: Optional[OAuthStateStore] = None, state_cookie_name: str = OAuthStateUtils.default_cookie_name, state_expiration_seconds: int = OAuthStateUtils.default_expiration_seconds, @@ -338,6 +346,7 @@

      Args

      installation_store: Specify the instance of `InstallationStore` (Default: `FileInstallationStore`) installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) token_rotation_expiration_minutes: Minutes before refreshing tokens (Default: 2 hours) + state_validation_enabled: Set False if your OAuth flow omits the state parameter validation (Default: True) state_store: Specify the instance of `InstallationStore` (Default: `FileOAuthStateStore`) state_cookie_name: The cookie name that is set for installers' browser. (Default: "slack-app-oauth-state") state_expiration_seconds: The seconds that the state value is alive (Default: 600 seconds) @@ -390,6 +399,7 @@

      Args

      bot_only=self.installation_store_bot_only, ) # state parameter related configurations + self.state_validation_enabled = state_validation_enabled self.state_store = state_store or FileOAuthStateStore( expiration_seconds=state_expiration_seconds, client_id=client_id, @@ -497,6 +507,10 @@

      Class variables

      +
      var state_validation_enabled : bool
      +
      +
      +
      var success_url : Optional[str]
      @@ -550,6 +564,7 @@

      state_expiration_seconds
    • state_store
    • state_utils
    • +
    • state_validation_enabled
    • success_url
    • token_rotation_expiration_minutes
    • user_scopes
    • @@ -561,7 +576,7 @@

      -

      Generated by pdoc 0.9.2.

      +

      Generated by pdoc 0.10.0.

      \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/request/async_internals.html b/docs/api-docs/slack_bolt/request/async_internals.html index d8dec5586..516d8209b 100644 --- a/docs/api-docs/slack_bolt/request/async_internals.html +++ b/docs/api-docs/slack_bolt/request/async_internals.html @@ -3,7 +3,7 @@ - + slack_bolt.request.async_internals API documentation @@ -137,7 +137,7 @@

      Index

      \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/request/async_request.html b/docs/api-docs/slack_bolt/request/async_request.html index 63aa9a079..2106594cd 100644 --- a/docs/api-docs/slack_bolt/request/async_request.html +++ b/docs/api-docs/slack_bolt/request/async_request.html @@ -3,7 +3,7 @@ - + slack_bolt.request.async_request API documentation @@ -116,7 +116,7 @@

      Classes

      class AsyncBoltRequest -(*, body: Union[str, dict], query: Union[str, Dict[str, str], Dict[str, Sequence[str]], NoneType] = None, headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, context: Optional[Dict[str, str]] = None, mode: str = 'http') +(*, body: Union[str, dict], query: Union[str, Dict[str, str], Dict[str, Sequence[str]], ForwardRef(None)] = None, headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, context: Optional[Dict[str, str]] = None, mode: str = 'http')

      Request to a Bolt app.

      @@ -277,7 +277,7 @@

      -

      Generated by pdoc 0.9.2.

      +

      Generated by pdoc 0.10.0.

      \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/request/index.html b/docs/api-docs/slack_bolt/request/index.html index e61b0a42e..20cee996a 100644 --- a/docs/api-docs/slack_bolt/request/index.html +++ b/docs/api-docs/slack_bolt/request/index.html @@ -3,7 +3,7 @@ - + slack_bolt.request API documentation @@ -94,7 +94,7 @@

      Index

      \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/request/internals.html b/docs/api-docs/slack_bolt/request/internals.html index e74c966a6..2df2c8794 100644 --- a/docs/api-docs/slack_bolt/request/internals.html +++ b/docs/api-docs/slack_bolt/request/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.request.internals API documentation @@ -489,7 +489,7 @@

      Functions

      -def parse_query(query: Union[str, Dict[str, str], Dict[str, Sequence[str]], NoneType]) ‑> Dict[str, Sequence[str]] +def parse_query(query: Union[str, Dict[str, str], Dict[str, Sequence[str]], ForwardRef(None)]) ‑> Dict[str, Sequence[str]]
      @@ -556,7 +556,7 @@

      Index

      \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/request/payload_utils.html b/docs/api-docs/slack_bolt/request/payload_utils.html index fcf365fb2..6bd31242b 100644 --- a/docs/api-docs/slack_bolt/request/payload_utils.html +++ b/docs/api-docs/slack_bolt/request/payload_utils.html @@ -3,7 +3,7 @@ - + slack_bolt.request.payload_utils API documentation @@ -760,7 +760,7 @@

      Index

      \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/request/request.html b/docs/api-docs/slack_bolt/request/request.html index 10ddce01d..deec3891a 100644 --- a/docs/api-docs/slack_bolt/request/request.html +++ b/docs/api-docs/slack_bolt/request/request.html @@ -3,7 +3,7 @@ - + slack_bolt.request.request API documentation @@ -113,7 +113,7 @@

      Classes

      class BoltRequest -(*, body: Union[str, dict], query: Union[str, Dict[str, str], Dict[str, Sequence[str]], NoneType] = None, headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, context: Optional[Dict[str, str]] = None, mode: str = 'http') +(*, body: Union[str, dict], query: Union[str, Dict[str, str], Dict[str, Sequence[str]], ForwardRef(None)] = None, headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, context: Optional[Dict[str, str]] = None, mode: str = 'http')

      Request to a Bolt app.

      @@ -271,7 +271,7 @@

      -

      Generated by pdoc 0.9.2.

      +

      Generated by pdoc 0.10.0.

      \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/response/index.html b/docs/api-docs/slack_bolt/response/index.html index 4c028367a..93ad52e73 100644 --- a/docs/api-docs/slack_bolt/response/index.html +++ b/docs/api-docs/slack_bolt/response/index.html @@ -3,7 +3,7 @@ - + slack_bolt.response API documentation @@ -77,7 +77,7 @@

      Index

      \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/response/response.html b/docs/api-docs/slack_bolt/response/response.html index 6d6967c47..e95128bf9 100644 --- a/docs/api-docs/slack_bolt/response/response.html +++ b/docs/api-docs/slack_bolt/response/response.html @@ -3,7 +3,7 @@ - + slack_bolt.response.response API documentation @@ -262,7 +262,7 @@

      -

      Generated by pdoc 0.9.2.

      +

      Generated by pdoc 0.10.0.

      \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/util/async_utils.html b/docs/api-docs/slack_bolt/util/async_utils.html index bd0bc19e8..c6b6d683e 100644 --- a/docs/api-docs/slack_bolt/util/async_utils.html +++ b/docs/api-docs/slack_bolt/util/async_utils.html @@ -3,7 +3,7 @@ - + slack_bolt.util.async_utils API documentation @@ -95,7 +95,7 @@

      Index

      \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/util/index.html b/docs/api-docs/slack_bolt/util/index.html index de3468e3f..ec43aa5a6 100644 --- a/docs/api-docs/slack_bolt/util/index.html +++ b/docs/api-docs/slack_bolt/util/index.html @@ -3,7 +3,7 @@ - + slack_bolt.util API documentation @@ -71,7 +71,7 @@

      Index

      \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/util/utils.html b/docs/api-docs/slack_bolt/util/utils.html index 2a18a57c3..400668827 100644 --- a/docs/api-docs/slack_bolt/util/utils.html +++ b/docs/api-docs/slack_bolt/util/utils.html @@ -3,7 +3,7 @@ - + slack_bolt.util.utils API documentation @@ -290,7 +290,7 @@

      Index

      \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index d82713ad6..a6b6553e4 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -3,7 +3,7 @@ - + slack_bolt.version API documentation @@ -28,7 +28,7 @@

      Module slack_bolt.version

      Expand source code
      """Check the latest version at https://pypi.org/project/slack-bolt/"""
      -__version__ = "1.8.1"
      +__version__ = "1.9.0"

  • @@ -55,7 +55,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/workflows/index.html b/docs/api-docs/slack_bolt/workflows/index.html index 547d52085..ac7f67988 100644 --- a/docs/api-docs/slack_bolt/workflows/index.html +++ b/docs/api-docs/slack_bolt/workflows/index.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows API documentation @@ -82,7 +82,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/workflows/step/async_step.html b/docs/api-docs/slack_bolt/workflows/step/async_step.html index ce9a05f5d..c0a8c39d6 100644 --- a/docs/api-docs/slack_bolt/workflows/step/async_step.html +++ b/docs/api-docs/slack_bolt/workflows/step/async_step.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.async_step API documentation @@ -1096,7 +1096,7 @@

    Returns

    -def edit(self, *args, matchers: Union[Callable[..., Awaitable[bool]], AsyncListenerMatcher, NoneType] = None, middleware: Union[Callable, AsyncMiddleware, NoneType] = None, lazy: Optional[List[Callable[..., Awaitable[NoneType]]]] = None) +def edit(self, *args, matchers: Union[Callable[..., Awaitable[bool]], AsyncListenerMatcher, ForwardRef(None)] = None, middleware: Union[Callable, AsyncMiddleware, ForwardRef(None)] = None, lazy: Optional[List[Callable[..., Awaitable[None]]]] = None)

    Registers a new edit listener with details. @@ -1179,7 +1179,7 @@

    Args

    -def execute(self, *args, matchers: Union[Callable[..., Awaitable[bool]], AsyncListenerMatcher, NoneType] = None, middleware: Union[Callable, AsyncMiddleware, NoneType] = None, lazy: Optional[List[Callable[..., Awaitable[NoneType]]]] = None) +def execute(self, *args, matchers: Union[Callable[..., Awaitable[bool]], AsyncListenerMatcher, ForwardRef(None)] = None, middleware: Union[Callable, AsyncMiddleware, ForwardRef(None)] = None, lazy: Optional[List[Callable[..., Awaitable[None]]]] = None)

    Registers a new execute listener with details. @@ -1264,7 +1264,7 @@

    Args

    -def save(self, *args, matchers: Union[Callable[..., Awaitable[bool]], AsyncListenerMatcher, NoneType] = None, middleware: Union[Callable, AsyncMiddleware, NoneType] = None, lazy: Optional[List[Callable[..., Awaitable[NoneType]]]] = None) +def save(self, *args, matchers: Union[Callable[..., Awaitable[bool]], AsyncListenerMatcher, ForwardRef(None)] = None, middleware: Union[Callable, AsyncMiddleware, ForwardRef(None)] = None, lazy: Optional[List[Callable[..., Awaitable[None]]]] = None)

    Registers a new save listener with details. @@ -1393,7 +1393,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/workflows/step/async_step_middleware.html b/docs/api-docs/slack_bolt/workflows/step/async_step_middleware.html index 4b6583b47..19a929810 100644 --- a/docs/api-docs/slack_bolt/workflows/step/async_step_middleware.html +++ b/docs/api-docs/slack_bolt/workflows/step/async_step_middleware.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.async_step_middleware API documentation @@ -194,7 +194,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/workflows/step/index.html b/docs/api-docs/slack_bolt/workflows/step/index.html index 775e948c8..3f4057cb1 100644 --- a/docs/api-docs/slack_bolt/workflows/step/index.html +++ b/docs/api-docs/slack_bolt/workflows/step/index.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step API documentation @@ -95,7 +95,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/workflows/step/internals.html b/docs/api-docs/slack_bolt/workflows/step/internals.html index 0cc20f847..ad20571a6 100644 --- a/docs/api-docs/slack_bolt/workflows/step/internals.html +++ b/docs/api-docs/slack_bolt/workflows/step/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.internals API documentation @@ -62,7 +62,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/workflows/step/step.html b/docs/api-docs/slack_bolt/workflows/step/step.html index f913db2b1..d65f4f9d1 100644 --- a/docs/api-docs/slack_bolt/workflows/step/step.html +++ b/docs/api-docs/slack_bolt/workflows/step/step.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.step API documentation @@ -1061,7 +1061,7 @@

    Returns

    -def edit(self, *args, matchers: Union[Callable[..., bool], ListenerMatcher, NoneType] = None, middleware: Union[Callable, Middleware, NoneType] = None, lazy: Optional[List[Callable[..., NoneType]]] = None) +def edit(self, *args, matchers: Union[Callable[..., bool], ListenerMatcher, ForwardRef(None)] = None, middleware: Union[Callable, Middleware, ForwardRef(None)] = None, lazy: Optional[List[Callable[..., None]]] = None)

    Registers a new edit listener with details. @@ -1143,7 +1143,7 @@

    Args

    -def execute(self, *args, matchers: Union[Callable[..., bool], ListenerMatcher, NoneType] = None, middleware: Union[Callable, Middleware, NoneType] = None, lazy: Optional[List[Callable[..., NoneType]]] = None) +def execute(self, *args, matchers: Union[Callable[..., bool], ListenerMatcher, ForwardRef(None)] = None, middleware: Union[Callable, Middleware, ForwardRef(None)] = None, lazy: Optional[List[Callable[..., None]]] = None)

    Registers a new execute listener with details. @@ -1226,7 +1226,7 @@

    Args

    -def save(self, *args, matchers: Union[Callable[..., bool], ListenerMatcher, NoneType] = None, middleware: Union[Callable, Middleware, NoneType] = None, lazy: Optional[List[Callable[..., NoneType]]] = None) +def save(self, *args, matchers: Union[Callable[..., bool], ListenerMatcher, ForwardRef(None)] = None, middleware: Union[Callable, Middleware, ForwardRef(None)] = None, lazy: Optional[List[Callable[..., None]]] = None)

    Registers a new save listener with details. @@ -1353,7 +1353,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/workflows/step/step_middleware.html b/docs/api-docs/slack_bolt/workflows/step/step_middleware.html index a80d4d335..191009385 100644 --- a/docs/api-docs/slack_bolt/workflows/step/step_middleware.html +++ b/docs/api-docs/slack_bolt/workflows/step/step_middleware.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.step_middleware API documentation @@ -196,7 +196,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/workflows/step/utilities/async_complete.html b/docs/api-docs/slack_bolt/workflows/step/utilities/async_complete.html index f75f2d8aa..f1b53e2bf 100644 --- a/docs/api-docs/slack_bolt/workflows/step/utilities/async_complete.html +++ b/docs/api-docs/slack_bolt/workflows/step/utilities/async_complete.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.utilities.async_complete API documentation @@ -166,7 +166,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/workflows/step/utilities/async_configure.html b/docs/api-docs/slack_bolt/workflows/step/utilities/async_configure.html index e6436faef..54d89a110 100644 --- a/docs/api-docs/slack_bolt/workflows/step/utilities/async_configure.html +++ b/docs/api-docs/slack_bolt/workflows/step/utilities/async_configure.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.utilities.async_configure API documentation @@ -204,7 +204,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/workflows/step/utilities/async_fail.html b/docs/api-docs/slack_bolt/workflows/step/utilities/async_fail.html index 56488dcd6..2b8a6616b 100644 --- a/docs/api-docs/slack_bolt/workflows/step/utilities/async_fail.html +++ b/docs/api-docs/slack_bolt/workflows/step/utilities/async_fail.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.utilities.async_fail API documentation @@ -165,7 +165,7 @@

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/workflows/step/utilities/async_update.html b/docs/api-docs/slack_bolt/workflows/step/utilities/async_update.html index ca8d703f9..bce9199a0 100644 --- a/docs/api-docs/slack_bolt/workflows/step/utilities/async_update.html +++ b/docs/api-docs/slack_bolt/workflows/step/utilities/async_update.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.utilities.async_update API documentation @@ -210,7 +210,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/workflows/step/utilities/complete.html b/docs/api-docs/slack_bolt/workflows/step/utilities/complete.html index 23023ee67..04fda2a77 100644 --- a/docs/api-docs/slack_bolt/workflows/step/utilities/complete.html +++ b/docs/api-docs/slack_bolt/workflows/step/utilities/complete.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.utilities.complete API documentation @@ -166,7 +166,7 @@

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/workflows/step/utilities/configure.html b/docs/api-docs/slack_bolt/workflows/step/utilities/configure.html index 92601779b..2d2e5a2ee 100644 --- a/docs/api-docs/slack_bolt/workflows/step/utilities/configure.html +++ b/docs/api-docs/slack_bolt/workflows/step/utilities/configure.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.utilities.configure API documentation @@ -202,7 +202,7 @@

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/workflows/step/utilities/fail.html b/docs/api-docs/slack_bolt/workflows/step/utilities/fail.html index a71efa254..dabf15b1d 100644 --- a/docs/api-docs/slack_bolt/workflows/step/utilities/fail.html +++ b/docs/api-docs/slack_bolt/workflows/step/utilities/fail.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.utilities.fail API documentation @@ -165,7 +165,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/workflows/step/utilities/index.html b/docs/api-docs/slack_bolt/workflows/step/utilities/index.html index b91db253f..da8e077ec 100644 --- a/docs/api-docs/slack_bolt/workflows/step/utilities/index.html +++ b/docs/api-docs/slack_bolt/workflows/step/utilities/index.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.utilities API documentation @@ -138,7 +138,7 @@

    Index

    \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/workflows/step/utilities/update.html b/docs/api-docs/slack_bolt/workflows/step/utilities/update.html index c14e8cc22..51e87b126 100644 --- a/docs/api-docs/slack_bolt/workflows/step/utilities/update.html +++ b/docs/api-docs/slack_bolt/workflows/step/utilities/update.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.utilities.update API documentation @@ -210,7 +210,7 @@

    -

    Generated by pdoc 0.9.2.

    +

    Generated by pdoc 0.10.0.

    \ No newline at end of file From a3885469b198ee58e8d3f519f7c70f43586c410c Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 7 Sep 2021 18:49:06 +0900 Subject: [PATCH 242/719] Fix #459 Invalid type hints in App / AsyncApp (#460) --- slack_bolt/app/app.py | 36 ++++++++++++++++++------------------ slack_bolt/app/async_app.py | 34 +++++++++++++++++----------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index ef52b7c02..c71afc18c 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -684,7 +684,7 @@ def step( def error( self, func: Callable[..., Optional[BoltResponse]] - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[BoltResponse]]: """Updates the global error handler. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -722,7 +722,7 @@ def event( ], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new event listener. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -763,7 +763,7 @@ def message( keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new message event listener. This method can be used as either a decorator or a method. Check the `App#event` method's docstring for details. @@ -811,7 +811,7 @@ def command( command: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new slash command listener. This method can be used as either a decorator or a method. @@ -854,7 +854,7 @@ def shortcut( constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new shortcut listener. This method can be used as either a decorator or a method. @@ -900,7 +900,7 @@ def global_shortcut( callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new global shortcut listener.""" def __call__(*args, **kwargs): @@ -917,7 +917,7 @@ def message_shortcut( callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new message shortcut listener.""" def __call__(*args, **kwargs): @@ -937,7 +937,7 @@ def action( constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new action listener. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -976,7 +976,7 @@ def block_action( constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `block_actions` action listener. Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. """ @@ -995,7 +995,7 @@ def attachment_action( callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `interactive_message` action listener. Refer to https://api.slack.com/legacy/message-buttons for details.""" @@ -1013,7 +1013,7 @@ def dialog_submission( callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_submission` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -1031,7 +1031,7 @@ def dialog_cancellation( callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_cancellation` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -1052,7 +1052,7 @@ def view( constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission`/`view_closed` event listener. This method can be used as either a decorator or a method. @@ -1102,7 +1102,7 @@ def view_submission( constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" @@ -1120,7 +1120,7 @@ def view_closed( constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_closed` listener. Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" @@ -1141,7 +1141,7 @@ def options( constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new options listener. This method can be used as either a decorator or a method. @@ -1191,7 +1191,7 @@ def block_suggestion( action_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `block_suggestion` listener.""" def __call__(*args, **kwargs): @@ -1208,7 +1208,7 @@ def dialog_suggestion( callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_suggestion` listener. Refer to https://api.slack.com/dialogs for details.""" diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 718955c08..bbf4be64f 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -770,7 +770,7 @@ def event( ], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new event listener. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -811,7 +811,7 @@ def message( keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new message event listener. This method can be used as either a decorator or a method. Check the `App#event` method's docstring for details. @@ -861,7 +861,7 @@ def command( command: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new slash command listener. This method can be used as either a decorator or a method. @@ -904,7 +904,7 @@ def shortcut( constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new shortcut listener. This method can be used as either a decorator or a method. @@ -950,7 +950,7 @@ def global_shortcut( callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new global shortcut listener.""" def __call__(*args, **kwargs): @@ -967,7 +967,7 @@ def message_shortcut( callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new message shortcut listener.""" def __call__(*args, **kwargs): @@ -987,7 +987,7 @@ def action( constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new action listener. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -1026,7 +1026,7 @@ def block_action( constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `block_actions` action listener. Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. """ @@ -1045,7 +1045,7 @@ def attachment_action( callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `interactive_message` action listener. Refer to https://api.slack.com/legacy/message-buttons for details.""" @@ -1063,7 +1063,7 @@ def dialog_submission( callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -1081,7 +1081,7 @@ def dialog_cancellation( callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -1102,7 +1102,7 @@ def view( constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_submission`/`view_closed` event listener. This method can be used as either a decorator or a method. @@ -1152,7 +1152,7 @@ def view_submission( constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_submission` listener. Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" @@ -1170,7 +1170,7 @@ def view_closed( constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_closed` listener. Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" @@ -1191,7 +1191,7 @@ def options( constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new options listener. This method can be used as either a decorator or a method. @@ -1241,7 +1241,7 @@ def block_suggestion( action_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `block_suggestion` listener.""" def __call__(*args, **kwargs): @@ -1258,7 +1258,7 @@ def dialog_suggestion( callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_suggestion` listener. Refer to https://api.slack.com/dialogs for details.""" From 70398a7ca7572797f805952ab7b74c12d0d8cb88 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 7 Sep 2021 18:51:11 +0900 Subject: [PATCH 243/719] version 1.9.1 --- docs/api-docs/slack_bolt/app/app.html | 144 ++++++++++---------- docs/api-docs/slack_bolt/app/async_app.html | 136 +++++++++--------- docs/api-docs/slack_bolt/version.html | 2 +- slack_bolt/version.py | 2 +- 4 files changed, 142 insertions(+), 142 deletions(-) diff --git a/docs/api-docs/slack_bolt/app/app.html b/docs/api-docs/slack_bolt/app/app.html index 9db31df0c..e14ef09c2 100644 --- a/docs/api-docs/slack_bolt/app/app.html +++ b/docs/api-docs/slack_bolt/app/app.html @@ -712,7 +712,7 @@

    Module slack_bolt.app.app

    def error( self, func: Callable[..., Optional[BoltResponse]] - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[BoltResponse]]: """Updates the global error handler. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -750,7 +750,7 @@

    Module slack_bolt.app.app

    ], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new event listener. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -791,7 +791,7 @@

    Module slack_bolt.app.app

    keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new message event listener. This method can be used as either a decorator or a method. Check the `App#event` method's docstring for details. @@ -839,7 +839,7 @@

    Module slack_bolt.app.app

    command: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new slash command listener. This method can be used as either a decorator or a method. @@ -882,7 +882,7 @@

    Module slack_bolt.app.app

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new shortcut listener. This method can be used as either a decorator or a method. @@ -928,7 +928,7 @@

    Module slack_bolt.app.app

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new global shortcut listener.""" def __call__(*args, **kwargs): @@ -945,7 +945,7 @@

    Module slack_bolt.app.app

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new message shortcut listener.""" def __call__(*args, **kwargs): @@ -965,7 +965,7 @@

    Module slack_bolt.app.app

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new action listener. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -1004,7 +1004,7 @@

    Module slack_bolt.app.app

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `block_actions` action listener. Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. """ @@ -1023,7 +1023,7 @@

    Module slack_bolt.app.app

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `interactive_message` action listener. Refer to https://api.slack.com/legacy/message-buttons for details.""" @@ -1041,7 +1041,7 @@

    Module slack_bolt.app.app

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_submission` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -1059,7 +1059,7 @@

    Module slack_bolt.app.app

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_cancellation` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -1080,7 +1080,7 @@

    Module slack_bolt.app.app

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission`/`view_closed` event listener. This method can be used as either a decorator or a method. @@ -1130,7 +1130,7 @@

    Module slack_bolt.app.app

    constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" @@ -1148,7 +1148,7 @@

    Module slack_bolt.app.app

    constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_closed` listener. Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" @@ -1169,7 +1169,7 @@

    Module slack_bolt.app.app

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new options listener. This method can be used as either a decorator or a method. @@ -1219,7 +1219,7 @@

    Module slack_bolt.app.app

    action_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `block_suggestion` listener.""" def __call__(*args, **kwargs): @@ -1236,7 +1236,7 @@

    Module slack_bolt.app.app

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_suggestion` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -2163,7 +2163,7 @@

    Args

    def error( self, func: Callable[..., Optional[BoltResponse]] - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[BoltResponse]]: """Updates the global error handler. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -2201,7 +2201,7 @@

    Args

    ], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new event listener. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -2242,7 +2242,7 @@

    Args

    keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new message event listener. This method can be used as either a decorator or a method. Check the `App#event` method's docstring for details. @@ -2290,7 +2290,7 @@

    Args

    command: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new slash command listener. This method can be used as either a decorator or a method. @@ -2333,7 +2333,7 @@

    Args

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new shortcut listener. This method can be used as either a decorator or a method. @@ -2379,7 +2379,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new global shortcut listener.""" def __call__(*args, **kwargs): @@ -2396,7 +2396,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new message shortcut listener.""" def __call__(*args, **kwargs): @@ -2416,7 +2416,7 @@

    Args

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new action listener. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -2455,7 +2455,7 @@

    Args

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `block_actions` action listener. Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. """ @@ -2474,7 +2474,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `interactive_message` action listener. Refer to https://api.slack.com/legacy/message-buttons for details.""" @@ -2492,7 +2492,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_submission` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -2510,7 +2510,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_cancellation` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -2531,7 +2531,7 @@

    Args

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission`/`view_closed` event listener. This method can be used as either a decorator or a method. @@ -2581,7 +2581,7 @@

    Args

    constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" @@ -2599,7 +2599,7 @@

    Args

    constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_closed` listener. Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" @@ -2620,7 +2620,7 @@

    Args

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new options listener. This method can be used as either a decorator or a method. @@ -2670,7 +2670,7 @@

    Args

    action_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `block_suggestion` listener.""" def __call__(*args, **kwargs): @@ -2687,7 +2687,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, - ) -> Optional[Callable[..., Optional[BoltResponse]]]: + ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_suggestion` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -2890,7 +2890,7 @@

    Instance variables

    Methods

    -def action(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Optional[Callable[..., Optional[BoltResponse]]] +def action(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]

    Registers a new action listener. This method can be used as either a decorator or a method.

    @@ -2928,7 +2928,7 @@

    Args

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, -) -> Optional[Callable[..., Optional[BoltResponse]]]: +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new action listener. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -2964,7 +2964,7 @@

    Args

    -def attachment_action(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Optional[Callable[..., Optional[BoltResponse]]] +def attachment_action(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]

    Registers a new interactive_message action listener. @@ -2978,7 +2978,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, -) -> Optional[Callable[..., Optional[BoltResponse]]]: +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `interactive_message` action listener. Refer to https://api.slack.com/legacy/message-buttons for details.""" @@ -2993,7 +2993,7 @@

    Args

    -def block_action(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Optional[Callable[..., Optional[BoltResponse]]] +def block_action(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]

    Registers a new block_actions action listener. @@ -3007,7 +3007,7 @@

    Args

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, -) -> Optional[Callable[..., Optional[BoltResponse]]]: +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `block_actions` action listener. Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. """ @@ -3023,7 +3023,7 @@

    Args

    -def block_suggestion(self, action_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Optional[Callable[..., Optional[BoltResponse]]] +def block_suggestion(self, action_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]

    Registers a new block_suggestion listener.

    @@ -3036,7 +3036,7 @@

    Args

    action_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, -) -> Optional[Callable[..., Optional[BoltResponse]]]: +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `block_suggestion` listener.""" def __call__(*args, **kwargs): @@ -3050,7 +3050,7 @@

    Args

    -def command(self, command: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Optional[Callable[..., Optional[BoltResponse]]] +def command(self, command: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]

    Registers a new slash command listener. @@ -3087,7 +3087,7 @@

    Args

    command: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, -) -> Optional[Callable[..., Optional[BoltResponse]]]: +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new slash command listener. This method can be used as either a decorator or a method. @@ -3158,7 +3158,7 @@

    Args

    -def dialog_cancellation(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Optional[Callable[..., Optional[BoltResponse]]] +def dialog_cancellation(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]

    Registers a new dialog_cancellation listener. @@ -3172,7 +3172,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, -) -> Optional[Callable[..., Optional[BoltResponse]]]: +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_cancellation` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -3187,7 +3187,7 @@

    Args

    -def dialog_submission(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Optional[Callable[..., Optional[BoltResponse]]] +def dialog_submission(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]

    Registers a new dialog_submission listener. @@ -3201,7 +3201,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, -) -> Optional[Callable[..., Optional[BoltResponse]]]: +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_submission` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -3216,7 +3216,7 @@

    Args

    -def dialog_suggestion(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Optional[Callable[..., Optional[BoltResponse]]] +def dialog_suggestion(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]

    Registers a new dialog_suggestion listener. @@ -3230,7 +3230,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, -) -> Optional[Callable[..., Optional[BoltResponse]]]: +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_suggestion` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -3388,7 +3388,7 @@

    Returns

    -def error(self, func: Callable[..., Optional[BoltResponse]]) ‑> Optional[Callable[..., Optional[BoltResponse]]] +def error(self, func: Callable[..., Optional[BoltResponse]]) ‑> Callable[..., Optional[BoltResponse]]

    Updates the global error handler. This method can be used as either a decorator or a method.

    @@ -3414,7 +3414,7 @@

    Args

    def error(
         self, func: Callable[..., Optional[BoltResponse]]
    -) -> Optional[Callable[..., Optional[BoltResponse]]]:
    +) -> Callable[..., Optional[BoltResponse]]:
         """Updates the global error handler. This method can be used as either a decorator or a method.
     
             # Use this method as a decorator
    @@ -3444,7 +3444,7 @@ 

    Args

    -def event(self, event: Union[str, Pattern, Dict[str, Union[str, Sequence[Union[str, Pattern, ForwardRef(None)]]]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Optional[Callable[..., Optional[BoltResponse]]] +def event(self, event: Union[str, Pattern, Dict[str, Union[str, Sequence[Union[str, Pattern, ForwardRef(None)]]]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]

    Registers a new event listener. This method can be used as either a decorator or a method.

    @@ -3484,7 +3484,7 @@

    Args

    ], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, -) -> Optional[Callable[..., Optional[BoltResponse]]]: +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new event listener. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -3522,7 +3522,7 @@

    Args

    -def global_shortcut(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Optional[Callable[..., Optional[BoltResponse]]] +def global_shortcut(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]

    Registers a new global shortcut listener.

    @@ -3535,7 +3535,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, -) -> Optional[Callable[..., Optional[BoltResponse]]]: +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new global shortcut listener.""" def __call__(*args, **kwargs): @@ -3549,7 +3549,7 @@

    Args

    -def message(self, keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Optional[Callable[..., Optional[BoltResponse]]] +def message(self, keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]

    Registers a new message event listener. This method can be used as either a decorator or a method. @@ -3585,7 +3585,7 @@

    Args

    keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, -) -> Optional[Callable[..., Optional[BoltResponse]]]: +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new message event listener. This method can be used as either a decorator or a method. Check the `App#event` method's docstring for details. @@ -3627,7 +3627,7 @@

    Args

    -def message_shortcut(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Optional[Callable[..., Optional[BoltResponse]]] +def message_shortcut(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]

    Registers a new message shortcut listener.

    @@ -3640,7 +3640,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, -) -> Optional[Callable[..., Optional[BoltResponse]]]: +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new message shortcut listener.""" def __call__(*args, **kwargs): @@ -3716,7 +3716,7 @@

    Args

    -def options(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Optional[Callable[..., Optional[BoltResponse]]] +def options(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]

    Registers a new options listener. @@ -3763,7 +3763,7 @@

    Args

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, -) -> Optional[Callable[..., Optional[BoltResponse]]]: +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new options listener. This method can be used as either a decorator or a method. @@ -3810,7 +3810,7 @@

    Args

    -def shortcut(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Optional[Callable[..., Optional[BoltResponse]]] +def shortcut(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]

    Registers a new shortcut listener. @@ -3853,7 +3853,7 @@

    Args

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, -) -> Optional[Callable[..., Optional[BoltResponse]]]: +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new shortcut listener. This method can be used as either a decorator or a method. @@ -4063,7 +4063,7 @@

    Args

    -def view(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Optional[Callable[..., Optional[BoltResponse]]] +def view(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]

    Registers a new view_submission/view_closed event listener. @@ -4110,7 +4110,7 @@

    Args

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, -) -> Optional[Callable[..., Optional[BoltResponse]]]: +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission`/`view_closed` event listener. This method can be used as either a decorator or a method. @@ -4157,7 +4157,7 @@

    Args

    -def view_closed(self, constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Optional[Callable[..., Optional[BoltResponse]]] +def view_closed(self, constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]

    Registers a new view_closed listener. @@ -4171,7 +4171,7 @@

    Args

    constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, -) -> Optional[Callable[..., Optional[BoltResponse]]]: +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_closed` listener. Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" @@ -4186,7 +4186,7 @@

    Args

    -def view_submission(self, constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Optional[Callable[..., Optional[BoltResponse]]] +def view_submission(self, constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]

    Registers a new view_submission listener. @@ -4200,7 +4200,7 @@

    Args

    constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, -) -> Optional[Callable[..., Optional[BoltResponse]]]: +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" diff --git a/docs/api-docs/slack_bolt/app/async_app.html b/docs/api-docs/slack_bolt/app/async_app.html index d6424b071..20653dbba 100644 --- a/docs/api-docs/slack_bolt/app/async_app.html +++ b/docs/api-docs/slack_bolt/app/async_app.html @@ -798,7 +798,7 @@

    Module slack_bolt.app.async_app

    ], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new event listener. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -839,7 +839,7 @@

    Module slack_bolt.app.async_app

    keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new message event listener. This method can be used as either a decorator or a method. Check the `App#event` method's docstring for details. @@ -889,7 +889,7 @@

    Module slack_bolt.app.async_app

    command: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new slash command listener. This method can be used as either a decorator or a method. @@ -932,7 +932,7 @@

    Module slack_bolt.app.async_app

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new shortcut listener. This method can be used as either a decorator or a method. @@ -978,7 +978,7 @@

    Module slack_bolt.app.async_app

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new global shortcut listener.""" def __call__(*args, **kwargs): @@ -995,7 +995,7 @@

    Module slack_bolt.app.async_app

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new message shortcut listener.""" def __call__(*args, **kwargs): @@ -1015,7 +1015,7 @@

    Module slack_bolt.app.async_app

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new action listener. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -1054,7 +1054,7 @@

    Module slack_bolt.app.async_app

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `block_actions` action listener. Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. """ @@ -1073,7 +1073,7 @@

    Module slack_bolt.app.async_app

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `interactive_message` action listener. Refer to https://api.slack.com/legacy/message-buttons for details.""" @@ -1091,7 +1091,7 @@

    Module slack_bolt.app.async_app

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -1109,7 +1109,7 @@

    Module slack_bolt.app.async_app

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -1130,7 +1130,7 @@

    Module slack_bolt.app.async_app

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_submission`/`view_closed` event listener. This method can be used as either a decorator or a method. @@ -1180,7 +1180,7 @@

    Module slack_bolt.app.async_app

    constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_submission` listener. Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" @@ -1198,7 +1198,7 @@

    Module slack_bolt.app.async_app

    constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_closed` listener. Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" @@ -1219,7 +1219,7 @@

    Module slack_bolt.app.async_app

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new options listener. This method can be used as either a decorator or a method. @@ -1269,7 +1269,7 @@

    Module slack_bolt.app.async_app

    action_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `block_suggestion` listener.""" def __call__(*args, **kwargs): @@ -1286,7 +1286,7 @@

    Module slack_bolt.app.async_app

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_suggestion` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -2175,7 +2175,7 @@

    Args

    ], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new event listener. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -2216,7 +2216,7 @@

    Args

    keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new message event listener. This method can be used as either a decorator or a method. Check the `App#event` method's docstring for details. @@ -2266,7 +2266,7 @@

    Args

    command: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new slash command listener. This method can be used as either a decorator or a method. @@ -2309,7 +2309,7 @@

    Args

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new shortcut listener. This method can be used as either a decorator or a method. @@ -2355,7 +2355,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new global shortcut listener.""" def __call__(*args, **kwargs): @@ -2372,7 +2372,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new message shortcut listener.""" def __call__(*args, **kwargs): @@ -2392,7 +2392,7 @@

    Args

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new action listener. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -2431,7 +2431,7 @@

    Args

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `block_actions` action listener. Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. """ @@ -2450,7 +2450,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `interactive_message` action listener. Refer to https://api.slack.com/legacy/message-buttons for details.""" @@ -2468,7 +2468,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -2486,7 +2486,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -2507,7 +2507,7 @@

    Args

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_submission`/`view_closed` event listener. This method can be used as either a decorator or a method. @@ -2557,7 +2557,7 @@

    Args

    constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_submission` listener. Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" @@ -2575,7 +2575,7 @@

    Args

    constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_closed` listener. Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" @@ -2596,7 +2596,7 @@

    Args

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new options listener. This method can be used as either a decorator or a method. @@ -2646,7 +2646,7 @@

    Args

    action_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `block_suggestion` listener.""" def __call__(*args, **kwargs): @@ -2663,7 +2663,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, - ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: + ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_suggestion` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -2884,7 +2884,7 @@

    Instance variables

    Methods

    -def action(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]] +def action(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]

    Registers a new action listener. This method can be used as either a decorator or a method.

    @@ -2922,7 +2922,7 @@

    Args

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, -) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new action listener. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -3089,7 +3089,7 @@

    Returns

    -def attachment_action(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]] +def attachment_action(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]

    Registers a new interactive_message action listener. @@ -3103,7 +3103,7 @@

    Returns

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, -) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `interactive_message` action listener. Refer to https://api.slack.com/legacy/message-buttons for details.""" @@ -3118,7 +3118,7 @@

    Returns

    -def block_action(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]] +def block_action(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]

    Registers a new block_actions action listener. @@ -3132,7 +3132,7 @@

    Returns

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, -) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `block_actions` action listener. Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. """ @@ -3148,7 +3148,7 @@

    Returns

    -def block_suggestion(self, action_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]] +def block_suggestion(self, action_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]

    Registers a new block_suggestion listener.

    @@ -3161,7 +3161,7 @@

    Returns

    action_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, -) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `block_suggestion` listener.""" def __call__(*args, **kwargs): @@ -3175,7 +3175,7 @@

    Returns

    -def command(self, command: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]] +def command(self, command: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]

    Registers a new slash command listener. @@ -3212,7 +3212,7 @@

    Args

    command: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, -) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new slash command listener. This method can be used as either a decorator or a method. @@ -3283,7 +3283,7 @@

    Args

    -def dialog_cancellation(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]] +def dialog_cancellation(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]

    Registers a new dialog_submission listener. @@ -3297,7 +3297,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, -) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -3312,7 +3312,7 @@

    Args

    -def dialog_submission(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]] +def dialog_submission(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]

    Registers a new dialog_submission listener. @@ -3326,7 +3326,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, -) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -3341,7 +3341,7 @@

    Args

    -def dialog_suggestion(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]] +def dialog_suggestion(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]

    Registers a new dialog_suggestion listener. @@ -3355,7 +3355,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, -) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_suggestion` listener. Refer to https://api.slack.com/dialogs for details.""" @@ -3445,7 +3445,7 @@

    Args

    -def event(self, event: Union[str, Pattern, Dict[str, Union[str, Sequence[Union[str, Pattern, ForwardRef(None)]]]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]] +def event(self, event: Union[str, Pattern, Dict[str, Union[str, Sequence[Union[str, Pattern, ForwardRef(None)]]]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]

    Registers a new event listener. This method can be used as either a decorator or a method.

    @@ -3485,7 +3485,7 @@

    Args

    ], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, -) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new event listener. This method can be used as either a decorator or a method. # Use this method as a decorator @@ -3523,7 +3523,7 @@

    Args

    -def global_shortcut(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]] +def global_shortcut(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]

    Registers a new global shortcut listener.

    @@ -3536,7 +3536,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, -) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new global shortcut listener.""" def __call__(*args, **kwargs): @@ -3550,7 +3550,7 @@

    Args

    -def message(self, keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]] +def message(self, keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]

    Registers a new message event listener. This method can be used as either a decorator or a method. @@ -3586,7 +3586,7 @@

    Args

    keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, -) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new message event listener. This method can be used as either a decorator or a method. Check the `App#event` method's docstring for details. @@ -3630,7 +3630,7 @@

    Args

    -def message_shortcut(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]] +def message_shortcut(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]

    Registers a new message shortcut listener.

    @@ -3643,7 +3643,7 @@

    Args

    callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, -) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new message shortcut listener.""" def __call__(*args, **kwargs): @@ -3718,7 +3718,7 @@

    Args

    -def options(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]] +def options(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]

    Registers a new options listener. @@ -3765,7 +3765,7 @@

    Args

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, -) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new options listener. This method can be used as either a decorator or a method. @@ -3851,7 +3851,7 @@

    Args

    -def shortcut(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]] +def shortcut(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]

    Registers a new shortcut listener. @@ -3894,7 +3894,7 @@

    Args

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, -) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new shortcut listener. This method can be used as either a decorator or a method. @@ -4080,7 +4080,7 @@

    Args

    -def view(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]] +def view(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]

    Registers a new view_submission/view_closed event listener. @@ -4127,7 +4127,7 @@

    Args

    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, -) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_submission`/`view_closed` event listener. This method can be used as either a decorator or a method. @@ -4174,7 +4174,7 @@

    Args

    -def view_closed(self, constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]] +def view_closed(self, constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]

    Registers a new view_closed listener. @@ -4188,7 +4188,7 @@

    Args

    constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, -) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_closed` listener. Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" @@ -4203,7 +4203,7 @@

    Args

    -def view_submission(self, constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]] +def view_submission(self, constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]

    Registers a new view_submission listener. @@ -4217,7 +4217,7 @@

    Args

    constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, -) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_submission` listener. Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index a6b6553e4..aaf3c299b 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.9.0"
    +__version__ = "1.9.1"

    diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 2e6e949f5..021e7cfaf 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.9.0" +__version__ = "1.9.1" From 66141d80dd69449c224a23c63ad518b2d52904fa Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 21 Sep 2021 10:25:31 +0900 Subject: [PATCH 244/719] Fix erros in Japanese documents --- docs/_basic/ja_listening_messages.md | 2 +- docs/_basic/ja_responding_actions.md | 2 +- docs/_basic/ja_socket_mode.md | 8 ++++---- docs/_steps/ja_adding_editing_workflow_step.md | 2 +- docs/_steps/ja_saving_workflow_step.md | 2 +- docs/_steps/ja_workflow_steps_overview.md | 2 +- scripts/run_jekyll.sh | 8 ++++++++ 7 files changed, 17 insertions(+), 9 deletions(-) create mode 100755 scripts/run_jekyll.sh diff --git a/docs/_basic/ja_listening_messages.md b/docs/_basic/ja_listening_messages.md index 12df49493..f27fbec9c 100644 --- a/docs/_basic/ja_listening_messages.md +++ b/docs/_basic/ja_listening_messages.md @@ -25,7 +25,7 @@ def say_hello(message, say):
    -

    正規表現パターンの使用

    +

    正規表現パターンの利用

    diff --git a/docs/_basic/ja_responding_actions.md b/docs/_basic/ja_responding_actions.md index fb6a50033..c1cb5f357 100644 --- a/docs/_basic/ja_responding_actions.md +++ b/docs/_basic/ja_responding_actions.md @@ -26,7 +26,7 @@ def approve_request(ack, say):
    -

    respond() の使用

    +

    respond() の利用

    diff --git a/docs/_basic/ja_socket_mode.md b/docs/_basic/ja_socket_mode.md index 7e202add0..2a027882e 100644 --- a/docs/_basic/ja_socket_mode.md +++ b/docs/_basic/ja_socket_mode.md @@ -1,5 +1,5 @@ --- -title: ソケットモードの使用 +title: ソケットモードの利用 lang: ja-jp slug: socket-mode order: 16 @@ -8,13 +8,13 @@ order: 16
    [ソケットモード](https://api.slack.com/apis/connections/socket)は、アプリに WebSocket での接続と、そのコネクション経由でのデータ受信を可能とします。Bolt for Python は、バージョン 1.2.0 からこれに対応しています。 -ソケットモードでは、Slack からのペイロード送信を受け付けるエンドポイントをホストする HTTP サーバーを起動する代わりに WebSocket で Slack に接続し、そのコネクション経由でデータを受信します。ソケットモードを使う前に、アプリの管理画面でソケットモードの機能が有効になっているコオを確認しておいてください。 +ソケットモードでは、Slack からのペイロード送信を受け付けるエンドポイントをホストする HTTP サーバーを起動する代わりに WebSocket で Slack に接続し、そのコネクション経由でデータを受信します。ソケットモードを使う前に、アプリの管理画面でソケットモードの機能が有効になっていることを確認しておいてください。 ソケットモードを使用するには、環境変数に `SLACK_APP_TOKEN` を追加します。アプリのトークン(App-Level Token)は、アプリの設定の「**Basic Information**」セクションで確認できます。 [組み込みのソケットモードアダプター](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/builtin)を使用するのがおすすめですが、サードパーティ製ライブラリを使ったアダプターの実装もいくつか存在しています。利用可能なアダプターの一覧です。 -|PyPI プロジェクト|Bolt アダプター| +|内部的に利用する PyPI プロジェクト名|Bolt アダプター| |-|-| |[slack_sdk](https://pypi.org/project/slack-sdk/)|[slack_bolt.adapter.socket_mode](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/builtin)| |[websocket_client](https://pypi.org/project/websocket_client/)|[slack_bolt.adapter.socket_mode.websocket_client](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter/socket_mode/websocket_client)| @@ -48,7 +48,7 @@ if __name__ == "__main__":
    aiohttp のような asyncio をベースとしたアダプターを使う場合、アプリケーション全体が asyncio の async/await プログラミングモデルで実装されている必要があります。`AsyncApp` を動作させるためには `AsyncSocketModeHandler` とその async なミドルウェアやリスナーを利用します。 -`AsyncApp` の使い方についての詳細は、[Usin async (asyncio)](https://slack.dev/bolt-python/concepts#async)トや、関連する[サンプルコード例](https://github.com/slackapi/bolt-python/tree/main/examples)を参考にしてください。 +`AsyncApp` の使い方についての詳細は、[Async (asyncio) の利用](https://slack.dev/bolt-python/ja-jp/concepts#async)や、関連する[サンプルコード例](https://github.com/slackapi/bolt-python/tree/main/examples)を参考にしてください。
    ```python diff --git a/docs/_steps/ja_adding_editing_workflow_step.md b/docs/_steps/ja_adding_editing_workflow_step.md index 7f3c9d44e..fed6d9740 100644 --- a/docs/_steps/ja_adding_editing_workflow_step.md +++ b/docs/_steps/ja_adding_editing_workflow_step.md @@ -13,7 +13,7 @@ order: 3 `edit` コールバック内で `configure()` ユーティリティを使用すると、対応する `blocks` 引数にビューのblocks 部分だけを渡して、ステップの設定モーダルを簡単に表示させることができます。必要な入力内容が揃うまで設定の保存を無効にするには、`True` の値をセットした `submit_disabled` を渡します。 -設定モーダルの開き方について詳しくは、[ドキュメントを参照してください](https://api.slack.com/workflows/steps#handle_config_view)。 +設定モーダルの開き方に関する詳細は、[こちらのドキュメント](https://api.slack.com/workflows/steps#handle_config_view)を参照してください。
    diff --git a/docs/_steps/ja_saving_workflow_step.md b/docs/_steps/ja_saving_workflow_step.md index b6f3f3076..c95f45efb 100644 --- a/docs/_steps/ja_saving_workflow_step.md +++ b/docs/_steps/ja_saving_workflow_step.md @@ -16,7 +16,7 @@ order: 4 - `step_name` : ステップのデフォルトの名前をオーバーライドします。 - `step_image_url` : ステップのデフォルトの画像をオーバーライドします。 -これらのパラメータの構成方法について詳しくは、[ドキュメントを参照してください](https://api.slack.com/reference/workflows/workflow_step)。 +これらのパラメータの構成方法に関する詳細は、[こちらのドキュメント](https://api.slack.com/reference/workflows/workflow_step)を参照してください。
    diff --git a/docs/_steps/ja_workflow_steps_overview.md b/docs/_steps/ja_workflow_steps_overview.md index 6905d82fa..4787948ee 100644 --- a/docs/_steps/ja_workflow_steps_overview.md +++ b/docs/_steps/ja_workflow_steps_overview.md @@ -16,6 +16,6 @@ order: 1 ワークフローステップを機能させるためには、これら 3 つのイベントすべてに対応する必要があります。 -アプリを使ったワークフローステップについて詳しくは、[API ドキュメント](https://api.slack.com/workflows/steps)を参照してください。 +アプリを使ったワークフローステップに関する詳細は、[API ドキュメント](https://api.slack.com/workflows/steps)を参照してください。
    diff --git a/scripts/run_jekyll.sh b/scripts/run_jekyll.sh new file mode 100755 index 000000000..34dbecf72 --- /dev/null +++ b/scripts/run_jekyll.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +script_dir=`dirname $0` +cd ${script_dir}/../docs +gem install bundler +bundle install +rm -rf _site/ +bundle exec jekyll serve -It From ba2c7e4ba2f79652060153d50e7bdc926e92fb7a Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 21 Sep 2021 15:17:31 +0900 Subject: [PATCH 245/719] Add more .venv directory patterns to .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f4aaf5133..93b86de53 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,7 @@ __pycache__/ # virtualenv env*/ venv/ -.venv/ +.venv* .env/ # codecov / coverage From 7173ef76d2f7ff9e20ec194d941bb8a2d8dedb17 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 21 Sep 2021 16:27:20 +0900 Subject: [PATCH 246/719] Add type: ignore for pytype 2021.9.9 --- slack_bolt/oauth/async_oauth_settings.py | 18 ++++++++++++++---- slack_bolt/oauth/oauth_settings.py | 17 +++++++++++++---- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/slack_bolt/oauth/async_oauth_settings.py b/slack_bolt/oauth/async_oauth_settings.py index dc6f112c5..89abbf462 100644 --- a/slack_bolt/oauth/async_oauth_settings.py +++ b/slack_bolt/oauth/async_oauth_settings.py @@ -118,14 +118,24 @@ def __init__( self.client_id = client_id self.client_secret = client_secret - self.scopes = scopes or os.environ.get("SLACK_SCOPES", "").split(",") + # NOTE: pytype says that self.scopes can be str, not Sequence[str]. + # That's true but we will check the pattern in the following if statement. + # Thus, we ignore the warnings here. This is the same for user_scopes too. + self.scopes = ( # type: ignore + scopes # type: ignore + if scopes is not None + else os.environ.get("SLACK_SCOPES", "").split(",") # type: ignore + ) # type: ignore if isinstance(self.scopes, str): self.scopes = self.scopes.split(",") - self.user_scopes = user_scopes or os.environ.get("SLACK_USER_SCOPES", "").split( - "," - ) + self.user_scopes = ( # type: ignore + user_scopes + if user_scopes is not None + else os.environ.get("SLACK_USER_SCOPES", "").split(",") # type: ignore + ) # type: ignore if isinstance(self.user_scopes, str): self.user_scopes = self.user_scopes.split(",") + self.redirect_uri = redirect_uri or os.environ.get("SLACK_REDIRECT_URI") # Handler configuration self.install_path = install_path or os.environ.get( diff --git a/slack_bolt/oauth/oauth_settings.py b/slack_bolt/oauth/oauth_settings.py index 88ac04567..b6bb2b92a 100644 --- a/slack_bolt/oauth/oauth_settings.py +++ b/slack_bolt/oauth/oauth_settings.py @@ -112,12 +112,21 @@ def __init__( self.client_id = client_id self.client_secret = client_secret - self.scopes = scopes or os.environ.get("SLACK_SCOPES", "").split(",") + # NOTE: pytype says that self.scopes can be str, not Sequence[str]. + # That's true but we will check the pattern in the following if statement. + # Thus, we ignore the warnings here. This is the same for user_scopes too. + self.scopes = ( # type: ignore + scopes # type: ignore + if scopes is not None + else os.environ.get("SLACK_SCOPES", "").split(",") # type: ignore + ) # type: ignore if isinstance(self.scopes, str): self.scopes = self.scopes.split(",") - self.user_scopes = user_scopes or os.environ.get("SLACK_USER_SCOPES", "").split( - "," - ) + self.user_scopes = ( # type: ignore + user_scopes + if user_scopes is not None + else os.environ.get("SLACK_USER_SCOPES", "").split(",") # type: ignore + ) # type: ignore if isinstance(self.user_scopes, str): self.user_scopes = self.user_scopes.split(",") self.redirect_uri = redirect_uri or os.environ.get("SLACK_REDIRECT_URI") From da7da61b0c56719599a376e38911a1775b2a5a75 Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Thu, 23 Sep 2021 15:17:29 -0700 Subject: [PATCH 247/719] update block id from listening modals (#472) current, the serial order in which a user reads the documentation sets the opening_modals example as a pre-requisite that the listening_modals builds upon. Currently, an attempt to walk through the examples in order yeilds a python `keyError: 'block_c'` This is because block_c does not match the name of the previous modal examle `input_c`. This patch updates the variable to be the same so that users can step through the documentation without the above exception. --- docs/_basic/listening_modals.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/_basic/listening_modals.md b/docs/_basic/listening_modals.md index db9dc8a2c..8a429acb2 100644 --- a/docs/_basic/listening_modals.md +++ b/docs/_basic/listening_modals.md @@ -21,13 +21,13 @@ Read more about view submissions in our 0: ack(response_action="errors", errors=errors) return From 4e0709f0578080833f9aeab984a778be81a30178 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 24 Sep 2021 07:17:35 +0900 Subject: [PATCH 248/719] Apply #472 changes to Japanese documents --- docs/_basic/ja_listening_modals.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/_basic/ja_listening_modals.md b/docs/_basic/ja_listening_modals.md index d169faeb5..27362a32f 100644 --- a/docs/_basic/ja_listening_modals.md +++ b/docs/_basic/ja_listening_modals.md @@ -21,13 +21,13 @@ order: 12 # view_submission リクエストを処理 @app.view("view_1") def handle_submission(ack, body, client, view, logger): - # `block_c`という block_id に `dreamy_input` を持つ input ブロックがある場合 - hopes_and_dreams = view["state"]["values"]["block_c"]["dreamy_input"] + # `input_c`という block_id に `dreamy_input` を持つ input ブロックがある場合 + hopes_and_dreams = view["state"]["values"]["input_c"]["dreamy_input"] user = body["user"]["id"] # 入力値を検証 errors = {} if hopes_and_dreams is not None and len(hopes_and_dreams) <= 5: - errors["block_c"] = "The value must be longer than 5 characters" + errors["input_c"] = "The value must be longer than 5 characters" if len(errors) > 0: ack(response_action="errors", errors=errors) return @@ -52,4 +52,4 @@ def handle_submission(ack, body, client, view, logger): logger.exception(f"Failed to post a message {e}") ``` - \ No newline at end of file + From 977875ed7e8a485b1c985202ee0e8357d5ce087a Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 28 Sep 2021 06:16:48 +0900 Subject: [PATCH 249/719] Improve the error message in the case where AuthorizeResult is not found (#476) --- slack_bolt/authorization/async_authorize.py | 12 ++++++++++++ slack_bolt/authorization/authorize.py | 13 ++++++++++++- .../async_multi_teams_authorization.py | 9 +++++++-- .../authorization/multi_teams_authorization.py | 9 +++++++-- 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/slack_bolt/authorization/async_authorize.py b/slack_bolt/authorization/async_authorize.py index 09db629de..d7cc19a50 100644 --- a/slack_bolt/authorization/async_authorize.py +++ b/slack_bolt/authorization/async_authorize.py @@ -16,6 +16,9 @@ class AsyncAuthorize: + """This provides authorize function that returns AuthorizeResult + for an incoming request from Slack.""" + def __init__(self): pass @@ -31,6 +34,10 @@ async def __call__( class AsyncCallableAuthorize(AsyncAuthorize): + """When you pass the authorize argument in AsyncApp constructor, + This authorize implementation will be used. + """ + def __init__( self, *, logger: Logger, func: Callable[..., Awaitable[AuthorizeResult]] ): @@ -93,6 +100,11 @@ async def __call__( class AsyncInstallationStoreAuthorize(AsyncAuthorize): + """If you use the OAuth flow settings, this authorize implementation will be used. + As long as your own InstallationStore (or the built-in ones) works as you expect, + you can expect that the authorize layer should work for you without any customization. + """ + authorize_result_cache: Dict[str, AuthorizeResult] find_installation_available: Optional[bool] find_bot_available: Optional[bool] diff --git a/slack_bolt/authorization/authorize.py b/slack_bolt/authorization/authorize.py index 43646b6b3..aaa4d2ed4 100644 --- a/slack_bolt/authorization/authorize.py +++ b/slack_bolt/authorization/authorize.py @@ -1,5 +1,4 @@ import inspect -import os from logging import Logger from typing import Optional, Callable, Dict, Any @@ -16,6 +15,9 @@ class Authorize: + """This provides authorize function that returns AuthorizeResult + for an incoming request from Slack.""" + def __init__(self): pass @@ -31,6 +33,10 @@ def __call__( class CallableAuthorize(Authorize): + """When you pass the authorize argument in AsyncApp constructor, + This authorize implementation will be used. + """ + def __init__( self, *, @@ -96,6 +102,11 @@ def __call__( class InstallationStoreAuthorize(Authorize): + """If you use the OAuth flow settings, this authorize implementation will be used. + As long as your own InstallationStore (or the built-in ones) works as you expect, + you can expect that the authorize layer should work for you without any customization. + """ + authorize_result_cache: Dict[str, AuthorizeResult] bot_only: bool find_installation_available: bool diff --git a/slack_bolt/middleware/authorization/async_multi_teams_authorization.py b/slack_bolt/middleware/authorization/async_multi_teams_authorization.py index 3d6f2e16b..85c56cc33 100644 --- a/slack_bolt/middleware/authorization/async_multi_teams_authorization.py +++ b/slack_bolt/middleware/authorization/async_multi_teams_authorization.py @@ -62,8 +62,13 @@ async def async_process( req.context.client.token = token return await next() else: - # Just in case - self.logger.error("auth.test API call result is unexpectedly None") + # This situation can arise if: + # * A developer installed the app from the "Install to Workspace" button in Slack app config page + # * The InstallationStore failed to save or deleted the installation for this workspace + self.logger.error( + "Although the app should be installed into this workspace, " + "the AuthorizeResult (returned value from authorize) for it was not found." + ) return _build_error_response() except SlackApiError as e: diff --git a/slack_bolt/middleware/authorization/multi_teams_authorization.py b/slack_bolt/middleware/authorization/multi_teams_authorization.py index 9f03e1cb7..7aeacf259 100644 --- a/slack_bolt/middleware/authorization/multi_teams_authorization.py +++ b/slack_bolt/middleware/authorization/multi_teams_authorization.py @@ -67,8 +67,13 @@ def process( req.context.client.token = token return next() else: - # Just in case - self.logger.error("auth.test API call result is unexpectedly None") + # This situation can arise if: + # * A developer installed the app from the "Install to Workspace" button in Slack app config page + # * The InstallationStore failed to save or deleted the installation for this workspace + self.logger.error( + "Although the app should be installed into this workspace, " + "the AuthorizeResult (returned value from authorize) for it was not found." + ) return _build_error_response() except SlackApiError as e: From 7daf5c8743f7eebfe4df1762e725334d025d3d9d Mon Sep 17 00:00:00 2001 From: Sarah Jiang Date: Mon, 27 Sep 2021 14:20:31 -0700 Subject: [PATCH 250/719] Adds update view on submission docs (#479) --- docs/_basic/listening_modals.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/_basic/listening_modals.md b/docs/_basic/listening_modals.md index 8a429acb2..a0146c453 100644 --- a/docs/_basic/listening_modals.md +++ b/docs/_basic/listening_modals.md @@ -11,6 +11,19 @@ If a view payload You can access the value of the `input` blocks by accessing the `state` object. `state` contains a `values` object that uses the `block_id` and unique `action_id` to store the input values. +--- + +##### Update views on submission + +To update a view in response to a `view_submission` event, you may pass a `response_action` of type `update` with a newly composed `view` to display in your acknowledgement. + +```python +# Update the view on submission +@app.view("view_1") +def handle_submission(ack, body): + ack(response_action="update", view=build_new_view(body)) +``` +Similarly, there are options for [displaying errors](https://api.slack.com/surfaces/modals/using#displaying_errors) in response to view submissions. Read more about view submissions in our API documentation. From 24a94b1720eedf613c76fc0917c846d1738cbab6 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 28 Sep 2021 06:39:45 +0900 Subject: [PATCH 251/719] Add more guide message in the HTML generated by the default failure handler (#477) * Add more guide message in the HTML generated by the default failure handler * Add more tests * Apply suggestions from code review Co-authored-by: Fil Maj Co-authored-by: Alissa Renz --- slack_bolt/oauth/internals.py | 22 ++++++++++++++++- tests/slack_bolt/oauth/test_internals.py | 31 ++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 tests/slack_bolt/oauth/test_internals.py diff --git a/slack_bolt/oauth/internals.py b/slack_bolt/oauth/internals.py index 87f4e167b..9fedc6e8f 100644 --- a/slack_bolt/oauth/internals.py +++ b/slack_bolt/oauth/internals.py @@ -60,7 +60,10 @@ def _build_callback_failure_response( # type: ignore ) self._logger.debug(debug_message) - html = self._redirect_uri_page_renderer.render_failure_page(reason) + # Adding a bit more details to the error code to help installers understand what's happening. + # This modification in the HTML page works only when developers use this built-in failure handler. + detailed_error = build_detailed_error(reason) + html = self._redirect_uri_page_renderer.render_failure_page(detailed_error) return BoltResponse( status=status, headers={ @@ -126,3 +129,20 @@ def select_consistent_installation_store( else: # only oauth_flow_store is available return oauth_flow_store + + +def build_detailed_error(reason: str) -> str: + if reason == "invalid_browser": + return ( + f"{reason}: This can occur due to page reload, " + "not beginning the OAuth flow from the valid starting URL, or " + "the /slack/install URL not using https://" + ) + elif reason == "invalid_state": + return f"{reason}: The state parameter is no longer valid." + elif reason == "missing_code": + return f"{reason}: The code parameter is missing in this redirection." + elif reason == "storage_error": + return f"{reason}: The app's server encountered an issue. Contact the app developer." + else: + return f"{reason}: This error code is returned from Slack. Refer to the documents for details." diff --git a/tests/slack_bolt/oauth/test_internals.py b/tests/slack_bolt/oauth/test_internals.py new file mode 100644 index 000000000..16a0d133c --- /dev/null +++ b/tests/slack_bolt/oauth/test_internals.py @@ -0,0 +1,31 @@ +from slack_bolt.oauth.internals import build_detailed_error + + +class TestOAuthInternals: + def test_build_detailed_error_invalid_browser(self): + result = build_detailed_error("invalid_browser") + assert result.startswith("invalid_browser: This can occur due to page reload, ") + + def test_build_detailed_error_invalid_state(self): + result = build_detailed_error("invalid_state") + assert result.startswith( + "invalid_state: The state parameter is no longer valid." + ) + + def test_build_detailed_error_missing_code(self): + result = build_detailed_error("missing_code") + assert result.startswith( + "missing_code: The code parameter is missing in this redirection." + ) + + def test_build_detailed_error_storage_error(self): + result = build_detailed_error("storage_error") + assert result.startswith( + "storage_error: The app's server encountered an issue. Contact the app developer." + ) + + def test_build_detailed_error_others(self): + result = build_detailed_error("access_denied") + assert result.startswith( + "access_denied: This error code is returned from Slack. Refer to the documents for details." + ) From 302fe3583819cf6efcfa40219be4ddd0c7fdaa94 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 28 Sep 2021 15:17:40 +0900 Subject: [PATCH 252/719] Upgrade black code formatter --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fd8a09e2a..8d5e65851 100755 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ "aiohttp>=3,<4", # for async "Flask-Sockets>=0.2,<1", "Werkzeug<2", # TODO: support Flask 2.x - "black==21.7b0", + "black==21.9b0", ] setuptools.setup( From 4c8b33fc3d61a9aa909638a28fe89dd0c942296c Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 28 Sep 2021 15:18:29 +0900 Subject: [PATCH 253/719] version 1.9.2 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 021e7cfaf..8800b5e8c 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.9.1" +__version__ = "1.9.2" From 7b692e89f150316dcb0bba76fa74531a4294493a Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 29 Sep 2021 14:41:00 +0900 Subject: [PATCH 254/719] Update API documents --- .../authorization/async_authorize.html | 34 ++++++++++- .../slack_bolt/authorization/authorize.html | 35 ++++++++++-- .../async_multi_teams_authorization.html | 18 ++++-- .../multi_teams_authorization.html | 18 ++++-- .../oauth/async_oauth_settings.html | 36 +++++++++--- docs/api-docs/slack_bolt/oauth/internals.html | 56 ++++++++++++++++++- .../slack_bolt/oauth/oauth_settings.html | 34 ++++++++--- docs/api-docs/slack_bolt/version.html | 2 +- 8 files changed, 198 insertions(+), 35 deletions(-) diff --git a/docs/api-docs/slack_bolt/authorization/async_authorize.html b/docs/api-docs/slack_bolt/authorization/async_authorize.html index 1f5c32de8..1f9413b83 100644 --- a/docs/api-docs/slack_bolt/authorization/async_authorize.html +++ b/docs/api-docs/slack_bolt/authorization/async_authorize.html @@ -44,6 +44,9 @@

    Module slack_bolt.authorization.async_authorizeModule slack_bolt.authorization.async_authorizeModule slack_bolt.authorization.async_authorizeClasses

    class AsyncAuthorize
    -
    +

    This provides authorize function that returns AuthorizeResult +for an incoming request from Slack.

    Expand source code
    class AsyncAuthorize:
    +    """This provides authorize function that returns AuthorizeResult
    +    for an incoming request from Slack."""
    +
         def __init__(self):
             pass
     
    @@ -355,12 +371,17 @@ 

    Subclasses

    (*, logger: logging.Logger, func: Callable[..., Awaitable[AuthorizeResult]])
    -
    +

    When you pass the authorize argument in AsyncApp constructor, +This authorize implementation will be used.

    Expand source code
    class AsyncCallableAuthorize(AsyncAuthorize):
    +    """When you pass the authorize argument in AsyncApp constructor,
    +    This authorize implementation will be used.
    +    """
    +
         def __init__(
             self, *, logger: Logger, func: Callable[..., Awaitable[AuthorizeResult]]
         ):
    @@ -431,12 +452,19 @@ 

    Ancestors

    (*, logger: logging.Logger, installation_store: slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore, client_id: Optional[str] = None, client_secret: Optional[str] = None, token_rotation_expiration_minutes: Optional[int] = None, bot_only: bool = False, cache_enabled: bool = False)
    -
    +

    If you use the OAuth flow settings, this authorize implementation will be used. +As long as your own InstallationStore (or the built-in ones) works as you expect, +you can expect that the authorize layer should work for you without any customization.

    Expand source code
    class AsyncInstallationStoreAuthorize(AsyncAuthorize):
    +    """If you use the OAuth flow settings, this authorize implementation will be used.
    +    As long as your own InstallationStore (or the built-in ones) works as you expect,
    +    you can expect that the authorize layer should work for you without any customization.
    +    """
    +
         authorize_result_cache: Dict[str, AuthorizeResult]
         find_installation_available: Optional[bool]
         find_bot_available: Optional[bool]
    diff --git a/docs/api-docs/slack_bolt/authorization/authorize.html b/docs/api-docs/slack_bolt/authorization/authorize.html
    index e24b8c04a..197913bce 100644
    --- a/docs/api-docs/slack_bolt/authorization/authorize.html
    +++ b/docs/api-docs/slack_bolt/authorization/authorize.html
    @@ -27,7 +27,6 @@ 

    Module slack_bolt.authorization.authorize

    Expand source code
    import inspect
    -import os
     from logging import Logger
     from typing import Optional, Callable, Dict, Any
     
    @@ -44,6 +43,9 @@ 

    Module slack_bolt.authorization.authorize

    class Authorize: + """This provides authorize function that returns AuthorizeResult + for an incoming request from Slack.""" + def __init__(self): pass @@ -59,6 +61,10 @@

    Module slack_bolt.authorization.authorize

    class CallableAuthorize(Authorize): + """When you pass the authorize argument in AsyncApp constructor, + This authorize implementation will be used. + """ + def __init__( self, *, @@ -124,6 +130,11 @@

    Module slack_bolt.authorization.authorize

    class InstallationStoreAuthorize(Authorize): + """If you use the OAuth flow settings, this authorize implementation will be used. + As long as your own InstallationStore (or the built-in ones) works as you expect, + you can expect that the authorize layer should work for you without any customization. + """ + authorize_result_cache: Dict[str, AuthorizeResult] bot_only: bool find_installation_available: bool @@ -322,12 +333,16 @@

    Classes

    class Authorize
    -
    +

    This provides authorize function that returns AuthorizeResult +for an incoming request from Slack.

    Expand source code
    class Authorize:
    +    """This provides authorize function that returns AuthorizeResult
    +    for an incoming request from Slack."""
    +
         def __init__(self):
             pass
     
    @@ -352,12 +367,17 @@ 

    Subclasses

    (*, logger: logging.Logger, func: Callable[..., AuthorizeResult])
    -
    +

    When you pass the authorize argument in AsyncApp constructor, +This authorize implementation will be used.

    Expand source code
    class CallableAuthorize(Authorize):
    +    """When you pass the authorize argument in AsyncApp constructor,
    +    This authorize implementation will be used.
    +    """
    +
         def __init__(
             self,
             *,
    @@ -431,12 +451,19 @@ 

    Ancestors

    (*, logger: logging.Logger, installation_store: slack_sdk.oauth.installation_store.installation_store.InstallationStore, client_id: Optional[str] = None, client_secret: Optional[str] = None, token_rotation_expiration_minutes: Optional[int] = None, bot_only: bool = False, cache_enabled: bool = False)
    -
    +

    If you use the OAuth flow settings, this authorize implementation will be used. +As long as your own InstallationStore (or the built-in ones) works as you expect, +you can expect that the authorize layer should work for you without any customization.

    Expand source code
    class InstallationStoreAuthorize(Authorize):
    +    """If you use the OAuth flow settings, this authorize implementation will be used.
    +    As long as your own InstallationStore (or the built-in ones) works as you expect,
    +    you can expect that the authorize layer should work for you without any customization.
    +    """
    +
         authorize_result_cache: Dict[str, AuthorizeResult]
         bot_only: bool
         find_installation_available: bool
    diff --git a/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html b/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html
    index 19c95ca30..5c6528140 100644
    --- a/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html
    +++ b/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html
    @@ -90,8 +90,13 @@ 

    Module slack_bolt.middleware.authorization.async_multi_t req.context.client.token = token return await next() else: - # Just in case - self.logger.error("auth.test API call result is unexpectedly None") + # This situation can arise if: + # * A developer installed the app from the "Install to Workspace" button in Slack app config page + # * The InstallationStore failed to save or deleted the installation for this workspace + self.logger.error( + "Although the app should be installed into this workspace, " + "the AuthorizeResult (returned value from authorize) for it was not found." + ) return _build_error_response() except SlackApiError as e: @@ -175,8 +180,13 @@

    Args

    req.context.client.token = token return await next() else: - # Just in case - self.logger.error("auth.test API call result is unexpectedly None") + # This situation can arise if: + # * A developer installed the app from the "Install to Workspace" button in Slack app config page + # * The InstallationStore failed to save or deleted the installation for this workspace + self.logger.error( + "Although the app should be installed into this workspace, " + "the AuthorizeResult (returned value from authorize) for it was not found." + ) return _build_error_response() except SlackApiError as e: diff --git a/docs/api-docs/slack_bolt/middleware/authorization/multi_teams_authorization.html b/docs/api-docs/slack_bolt/middleware/authorization/multi_teams_authorization.html index 1a208e9a1..31d6c1621 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/multi_teams_authorization.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/multi_teams_authorization.html @@ -95,8 +95,13 @@

    Module slack_bolt.middleware.authorization.multi_teams_a req.context.client.token = token return next() else: - # Just in case - self.logger.error("auth.test API call result is unexpectedly None") + # This situation can arise if: + # * A developer installed the app from the "Install to Workspace" button in Slack app config page + # * The InstallationStore failed to save or deleted the installation for this workspace + self.logger.error( + "Although the app should be installed into this workspace, " + "the AuthorizeResult (returned value from authorize) for it was not found." + ) return _build_error_response() except SlackApiError as e: @@ -181,8 +186,13 @@

    Args

    req.context.client.token = token return next() else: - # Just in case - self.logger.error("auth.test API call result is unexpectedly None") + # This situation can arise if: + # * A developer installed the app from the "Install to Workspace" button in Slack app config page + # * The InstallationStore failed to save or deleted the installation for this workspace + self.logger.error( + "Although the app should be installed into this workspace, " + "the AuthorizeResult (returned value from authorize) for it was not found." + ) return _build_error_response() except SlackApiError as e: diff --git a/docs/api-docs/slack_bolt/oauth/async_oauth_settings.html b/docs/api-docs/slack_bolt/oauth/async_oauth_settings.html index 33a984dcb..998743ae3 100644 --- a/docs/api-docs/slack_bolt/oauth/async_oauth_settings.html +++ b/docs/api-docs/slack_bolt/oauth/async_oauth_settings.html @@ -146,14 +146,24 @@

    Module slack_bolt.oauth.async_oauth_settings

    self.client_id = client_id self.client_secret = client_secret - self.scopes = scopes or os.environ.get("SLACK_SCOPES", "").split(",") + # NOTE: pytype says that self.scopes can be str, not Sequence[str]. + # That's true but we will check the pattern in the following if statement. + # Thus, we ignore the warnings here. This is the same for user_scopes too. + self.scopes = ( # type: ignore + scopes # type: ignore + if scopes is not None + else os.environ.get("SLACK_SCOPES", "").split(",") # type: ignore + ) # type: ignore if isinstance(self.scopes, str): self.scopes = self.scopes.split(",") - self.user_scopes = user_scopes or os.environ.get("SLACK_USER_SCOPES", "").split( - "," - ) + self.user_scopes = ( # type: ignore + user_scopes + if user_scopes is not None + else os.environ.get("SLACK_USER_SCOPES", "").split(",") # type: ignore + ) # type: ignore if isinstance(self.user_scopes, str): self.user_scopes = self.user_scopes.split(",") + self.redirect_uri = redirect_uri or os.environ.get("SLACK_REDIRECT_URI") # Handler configuration self.install_path = install_path or os.environ.get( @@ -368,14 +378,24 @@

    Args

    self.client_id = client_id self.client_secret = client_secret - self.scopes = scopes or os.environ.get("SLACK_SCOPES", "").split(",") + # NOTE: pytype says that self.scopes can be str, not Sequence[str]. + # That's true but we will check the pattern in the following if statement. + # Thus, we ignore the warnings here. This is the same for user_scopes too. + self.scopes = ( # type: ignore + scopes # type: ignore + if scopes is not None + else os.environ.get("SLACK_SCOPES", "").split(",") # type: ignore + ) # type: ignore if isinstance(self.scopes, str): self.scopes = self.scopes.split(",") - self.user_scopes = user_scopes or os.environ.get("SLACK_USER_SCOPES", "").split( - "," - ) + self.user_scopes = ( # type: ignore + user_scopes + if user_scopes is not None + else os.environ.get("SLACK_USER_SCOPES", "").split(",") # type: ignore + ) # type: ignore if isinstance(self.user_scopes, str): self.user_scopes = self.user_scopes.split(",") + self.redirect_uri = redirect_uri or os.environ.get("SLACK_REDIRECT_URI") # Handler configuration self.install_path = install_path or os.environ.get( diff --git a/docs/api-docs/slack_bolt/oauth/internals.html b/docs/api-docs/slack_bolt/oauth/internals.html index 90934dc3a..23db0f934 100644 --- a/docs/api-docs/slack_bolt/oauth/internals.html +++ b/docs/api-docs/slack_bolt/oauth/internals.html @@ -88,7 +88,10 @@

    Module slack_bolt.oauth.internals

    ) self._logger.debug(debug_message) - html = self._redirect_uri_page_renderer.render_failure_page(reason) + # Adding a bit more details to the error code to help installers understand what's happening. + # This modification in the HTML page works only when developers use this built-in failure handler. + detailed_error = build_detailed_error(reason) + html = self._redirect_uri_page_renderer.render_failure_page(detailed_error) return BoltResponse( status=status, headers={ @@ -153,7 +156,24 @@

    Module slack_bolt.oauth.internals

    return app_store else: # only oauth_flow_store is available - return oauth_flow_store

    + return oauth_flow_store + + +def build_detailed_error(reason: str) -> str: + if reason == "invalid_browser": + return ( + f"{reason}: This can occur due to page reload, " + "not beginning the OAuth flow from the valid starting URL, or " + "the /slack/install URL not using https://" + ) + elif reason == "invalid_state": + return f"{reason}: The state parameter is no longer valid." + elif reason == "missing_code": + return f"{reason}: The code parameter is missing in this redirection." + elif reason == "storage_error": + return f"{reason}: The app's server encountered an issue. Contact the app developer." + else: + return f"{reason}: This error code is returned from Slack. Refer to the documents for details."
    @@ -163,6 +183,32 @@

    Module slack_bolt.oauth.internals

    Functions

    +
    +def build_detailed_error(reason: str) ‑> str +
    +
    +
    +
    + +Expand source code + +
    def build_detailed_error(reason: str) -> str:
    +    if reason == "invalid_browser":
    +        return (
    +            f"{reason}: This can occur due to page reload, "
    +            "not beginning the OAuth flow from the valid starting URL, or "
    +            "the /slack/install URL not using https://"
    +        )
    +    elif reason == "invalid_state":
    +        return f"{reason}: The state parameter is no longer valid."
    +    elif reason == "missing_code":
    +        return f"{reason}: The code parameter is missing in this redirection."
    +    elif reason == "storage_error":
    +        return f"{reason}: The app's server encountered an issue. Contact the app developer."
    +    else:
    +        return f"{reason}: This error code is returned from Slack. Refer to the documents for details."
    +
    +
    def get_or_create_default_installation_store(client_id: str) ‑> slack_sdk.oauth.installation_store.installation_store.InstallationStore
    @@ -277,7 +323,10 @@

    Classes

    ) self._logger.debug(debug_message) - html = self._redirect_uri_page_renderer.render_failure_page(reason) + # Adding a bit more details to the error code to help installers understand what's happening. + # This modification in the HTML page works only when developers use this built-in failure handler. + detailed_error = build_detailed_error(reason) + html = self._redirect_uri_page_renderer.render_failure_page(detailed_error) return BoltResponse( status=status, headers={ @@ -304,6 +353,7 @@

    Index

  • Functions

    diff --git a/docs/api-docs/slack_bolt/oauth/oauth_settings.html b/docs/api-docs/slack_bolt/oauth/oauth_settings.html index a75cdbf60..fc7b07414 100644 --- a/docs/api-docs/slack_bolt/oauth/oauth_settings.html +++ b/docs/api-docs/slack_bolt/oauth/oauth_settings.html @@ -140,12 +140,21 @@

    Module slack_bolt.oauth.oauth_settings

    self.client_id = client_id self.client_secret = client_secret - self.scopes = scopes or os.environ.get("SLACK_SCOPES", "").split(",") + # NOTE: pytype says that self.scopes can be str, not Sequence[str]. + # That's true but we will check the pattern in the following if statement. + # Thus, we ignore the warnings here. This is the same for user_scopes too. + self.scopes = ( # type: ignore + scopes # type: ignore + if scopes is not None + else os.environ.get("SLACK_SCOPES", "").split(",") # type: ignore + ) # type: ignore if isinstance(self.scopes, str): self.scopes = self.scopes.split(",") - self.user_scopes = user_scopes or os.environ.get("SLACK_USER_SCOPES", "").split( - "," - ) + self.user_scopes = ( # type: ignore + user_scopes + if user_scopes is not None + else os.environ.get("SLACK_USER_SCOPES", "").split(",") # type: ignore + ) # type: ignore if isinstance(self.user_scopes, str): self.user_scopes = self.user_scopes.split(",") self.redirect_uri = redirect_uri or os.environ.get("SLACK_REDIRECT_URI") @@ -361,12 +370,21 @@

    Args

    self.client_id = client_id self.client_secret = client_secret - self.scopes = scopes or os.environ.get("SLACK_SCOPES", "").split(",") + # NOTE: pytype says that self.scopes can be str, not Sequence[str]. + # That's true but we will check the pattern in the following if statement. + # Thus, we ignore the warnings here. This is the same for user_scopes too. + self.scopes = ( # type: ignore + scopes # type: ignore + if scopes is not None + else os.environ.get("SLACK_SCOPES", "").split(",") # type: ignore + ) # type: ignore if isinstance(self.scopes, str): self.scopes = self.scopes.split(",") - self.user_scopes = user_scopes or os.environ.get("SLACK_USER_SCOPES", "").split( - "," - ) + self.user_scopes = ( # type: ignore + user_scopes + if user_scopes is not None + else os.environ.get("SLACK_USER_SCOPES", "").split(",") # type: ignore + ) # type: ignore if isinstance(self.user_scopes, str): self.user_scopes = self.user_scopes.split(",") self.redirect_uri = redirect_uri or os.environ.get("SLACK_REDIRECT_URI") diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index aaf3c299b..ab23705b3 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.9.1"
    +__version__ = "1.9.2"
  • From 16ea0bd9a32e62fa04e6e894cea9734a7a134ba8 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 13 Oct 2021 16:45:28 +0900 Subject: [PATCH 255/719] Lock the pytype version for now --- .github/workflows/ci-build.yml | 3 ++- scripts/run_pytype.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index dae01f300..44463ccb3 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -74,7 +74,8 @@ jobs: if [ ${python_version:7:3} == "3.8" ]; then pip install -e ".[async]" pip install -e ".[adapter]" - pip install "pytype" && pytype slack_bolt/ + # TODO: upgrade pytype + pip install "pytype==2021.9.27" && pytype slack_bolt/ fi - name: Run all tests for codecov (3.9 only) run: | diff --git a/scripts/run_pytype.sh b/scripts/run_pytype.sh index bfdf066be..b76aea800 100755 --- a/scripts/run_pytype.sh +++ b/scripts/run_pytype.sh @@ -4,5 +4,6 @@ script_dir=$(dirname $0) cd ${script_dir}/.. && \ pip install -e ".[adapter]" && \ - pip install -U pytype && \ + # TODO: upgrade pytype + pip install "pytype==2021.9.27" && \ pytype slack_bolt/ From 01ec9b6c695ade68080e6d65ad2f35c34700df1d Mon Sep 17 00:00:00 2001 From: Jason Wong Date: Wed, 13 Oct 2021 17:16:39 +0900 Subject: [PATCH 256/719] Fix #480 Adds updating views on submission for Japanese docs (#494) * fix #480 #479 for Japanese docs * add in changes from Kazs comments * Update docs/_basic/ja_listening_modals.md Co-authored-by: Kazuhiro Sera --- docs/_basic/ja_listening_modals.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/_basic/ja_listening_modals.md b/docs/_basic/ja_listening_modals.md index 27362a32f..fb469eea1 100644 --- a/docs/_basic/ja_listening_modals.md +++ b/docs/_basic/ja_listening_modals.md @@ -7,10 +7,24 @@ order: 12
    -モーダルのペイロードに input ブロックを含める場合、その入力値を受け取るために`view_submission` リクエストをリッスンする必要があります。`view_submission` リクエストのリッスンには、組み込みの`view()` メソッドを利用することができます。`view()` の引数には、`str` 型または `re.Pattern` 型の `callback_id` を指定します。 +モーダルのペイロードに `input` ブロックを含める場合、その入力値を受け取るために`view_submission` リクエストをリッスンする必要があります。`view_submission` リクエストのリッスンには、組み込みの`view()` メソッドを利用することができます。`view()` の引数には、`str` 型または `re.Pattern` 型の `callback_id` を指定します。 `input` ブロックの値にアクセスするには `state` オブジェクトを参照します。`state` 内には `values` というオブジェクトがあり、`block_id` と一意の `action_id` に紐づける形で入力値を保持しています。 +--- + +##### モーダル送信でのビューの更新 + +`view_submission` リクエストに対してモーダルを更新するには、リクエストの確認の中で `update` という `response_action` と新しく作成した `view` を指定します。 + +```python +# モーダル送信でのビューの更新 +@app.view("view_1") +def handle_submission(ack, body): + ack(response_action="update", view=build_new_view(body)) +``` +この例と同様に、モーダルでの送信リクエストに対して、エラーを表示するためのオプションもあります。 + モーダルの送信について詳しくは、API ドキュメントを参照してください。
    From d2d9ffdc6433f56c54d525faa8e6d8f0b2503613 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 13 Oct 2021 17:17:03 +0900 Subject: [PATCH 257/719] Fix #488 app.message listeners do not catch messages with subtype: thread_broadcast (#489) * Fix #488 app.message listeners do not catch messages with subtype: thread_broadcast * Add more comments * Update slack_bolt/app/async_app.py --- slack_bolt/app/app.py | 16 ++- slack_bolt/app/async_app.py | 16 ++- .../test_message_thread_broadcast.py | 123 +++++++++++++++++ .../test_message_thread_broadcast.py | 129 ++++++++++++++++++ 4 files changed, 278 insertions(+), 6 deletions(-) create mode 100644 tests/scenario_tests/test_message_thread_broadcast.py create mode 100644 tests/scenario_tests_async/test_message_thread_broadcast.py diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index c71afc18c..2a2defda8 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -792,9 +792,19 @@ def say_hello(message, say): def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - # As of Jan 2021, most bot messages no longer have the subtype bot_message. - # By contrast, messages posted using classic app's bot token still have the subtype. - constraints = {"type": "message", "subtype": (None, "bot_message")} + constraints = { + "type": "message", + "subtype": ( + # In most cases, new message events come with no subtype. + None, + # As of Jan 2021, most bot messages no longer have the subtype bot_message. + # By contrast, messages posted using classic app's bot token still have the subtype. + "bot_message", + # If an end-user posts a message with "Also send to #channel" checked, + # the message event comes with this subtype. + "thread_broadcast", + ), + } primary_matcher = builtin_matchers.event(constraints=constraints) middleware.insert(0, MessageListenerMatches(keyword)) return self._register_listener( diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index bbf4be64f..ee2f84783 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -840,9 +840,19 @@ async def say_hello(message, say): def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - # As of Jan 2021, most bot messages no longer have the subtype bot_message. - # By contrast, messages posted using classic app's bot token still have the subtype. - constraints = {"type": "message", "subtype": (None, "bot_message")} + constraints = { + "type": "message", + "subtype": ( + # In most cases, new message events come with no subtype. + None, + # As of Jan 2021, most bot messages no longer have the subtype bot_message. + # By contrast, messages posted using classic app's bot token still have the subtype. + "bot_message", + # If an end-user posts a message with "Also send to #channel" checked, + # the message event comes with this subtype. + "thread_broadcast", + ), + } primary_matcher = builtin_matchers.event( constraints=constraints, asyncio=True ) diff --git a/tests/scenario_tests/test_message_thread_broadcast.py b/tests/scenario_tests/test_message_thread_broadcast.py new file mode 100644 index 000000000..a69147782 --- /dev/null +++ b/tests/scenario_tests/test_message_thread_broadcast.py @@ -0,0 +1,123 @@ +import json +import time + +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web import WebClient + +from slack_bolt.app import App +from slack_bolt.request import BoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestMessageThreadBroadcast: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def build_request(self, event_payload: dict) -> BoltRequest: + timestamp, body = str(int(time.time())), json.dumps(event_payload) + return BoltRequest(body=body, headers=self.build_headers(timestamp, body)) + + def test_message_handler(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + result = {"call_count": 0} + + @app.message("Hi there!") + def handle_messages(event, logger): + logger.info(event) + result["call_count"] = result["call_count"] + 1 + + request = self.build_request(event_payload) + response = app.dispatch(request) + assert response.status == 200 + + request = self.build_request(event_payload) + response = app.dispatch(request) + assert response.status == 200 + + assert_auth_test_count(self, 1) + time.sleep(1) # wait a bit after auto ack() + assert result["call_count"] == 2 + + +event_payload = { + "token": "verification-token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "message", + "subtype": "thread_broadcast", + "text": "Hi there!", + "user": "U111", + "ts": "1633670813.007500", + "thread_ts": "1633663824.000500", + "root": { + "client_msg_id": "111-222-333-444-555", + "type": "message", + "text": "Write in the thread :bow:", + "user": "U111", + "ts": "1633663824.000500", + "team": "T111", + "thread_ts": "1633663824.000500", + "reply_count": 17, + "reply_users_count": 1, + "latest_reply": "1633670813.007500", + "reply_users": ["U111"], + "is_locked": False, + }, + "client_msg_id": "111-222-333-444-666", + "channel": "C111", + "event_ts": "1633670813.007500", + "channel_type": "channel", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1610261659, + "authorizations": [ + { + "enterprise_id": "E111", + "team_id": "T111", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": False, + "event_context": "1-message-T111-C111", +} diff --git a/tests/scenario_tests_async/test_message_thread_broadcast.py b/tests/scenario_tests_async/test_message_thread_broadcast.py new file mode 100644 index 000000000..84ae3ea93 --- /dev/null +++ b/tests/scenario_tests_async/test_message_thread_broadcast.py @@ -0,0 +1,129 @@ +import asyncio +import json +from time import time + +import pytest +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count_async, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestAsyncMessageThreadBroadcast: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def build_request(self, event_payload: dict) -> AsyncBoltRequest: + timestamp, body = str(int(time())), json.dumps(event_payload) + return AsyncBoltRequest(body=body, headers=self.build_headers(timestamp, body)) + + @pytest.mark.asyncio + async def test_string_keyword(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + result = {"call_count": 0} + + @app.message("Hi there!") + async def handle_messages(event, logger): + logger.info(event) + result["call_count"] = result["call_count"] + 1 + + request = self.build_request(event_payload) + response = await app.async_dispatch(request) + assert response.status == 200 + + request = self.build_request(event_payload) + response = await app.async_dispatch(request) + assert response.status == 200 + + await assert_auth_test_count_async(self, 1) + await asyncio.sleep(1) # wait a bit after auto ack() + assert result["call_count"] == 2 + + +event_payload = { + "token": "verification-token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "message", + "subtype": "thread_broadcast", + "text": "Hi there!", + "user": "U111", + "ts": "1633670813.007500", + "thread_ts": "1633663824.000500", + "root": { + "client_msg_id": "111-222-333-444-555", + "type": "message", + "text": "Write in the thread :bow:", + "user": "U111", + "ts": "1633663824.000500", + "team": "T111", + "thread_ts": "1633663824.000500", + "reply_count": 17, + "reply_users_count": 1, + "latest_reply": "1633670813.007500", + "reply_users": ["U111"], + "is_locked": False, + }, + "client_msg_id": "111-222-333-444-666", + "channel": "C111", + "event_ts": "1633670813.007500", + "channel_type": "channel", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1610261659, + "authorizations": [ + { + "enterprise_id": "E111", + "team_id": "T111", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": False, + "event_context": "1-message-T111-C111", +} From 81d0e7a8b7199e675faf7e4038d8f3215ad98735 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 13 Oct 2021 17:20:52 +0900 Subject: [PATCH 258/719] version 1.9.3 --- docs/api-docs/slack_bolt/app/app.html | 48 +++++++++++++++++---- docs/api-docs/slack_bolt/app/async_app.html | 48 +++++++++++++++++---- docs/api-docs/slack_bolt/version.html | 2 +- slack_bolt/version.py | 2 +- 4 files changed, 80 insertions(+), 20 deletions(-) diff --git a/docs/api-docs/slack_bolt/app/app.html b/docs/api-docs/slack_bolt/app/app.html index e14ef09c2..e192514d2 100644 --- a/docs/api-docs/slack_bolt/app/app.html +++ b/docs/api-docs/slack_bolt/app/app.html @@ -820,9 +820,19 @@

    Module slack_bolt.app.app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - # As of Jan 2021, most bot messages no longer have the subtype bot_message. - # By contrast, messages posted using classic app's bot token still have the subtype. - constraints = {"type": "message", "subtype": (None, "bot_message")} + constraints = { + "type": "message", + "subtype": ( + # In most cases, new message events come with no subtype. + None, + # As of Jan 2021, most bot messages no longer have the subtype bot_message. + # By contrast, messages posted using classic app's bot token still have the subtype. + "bot_message", + # If an end-user posts a message with "Also send to #channel" checked, + # the message event comes with this subtype. + "thread_broadcast", + ), + } primary_matcher = builtin_matchers.event(constraints=constraints) middleware.insert(0, MessageListenerMatches(keyword)) return self._register_listener( @@ -2271,9 +2281,19 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - # As of Jan 2021, most bot messages no longer have the subtype bot_message. - # By contrast, messages posted using classic app's bot token still have the subtype. - constraints = {"type": "message", "subtype": (None, "bot_message")} + constraints = { + "type": "message", + "subtype": ( + # In most cases, new message events come with no subtype. + None, + # As of Jan 2021, most bot messages no longer have the subtype bot_message. + # By contrast, messages posted using classic app's bot token still have the subtype. + "bot_message", + # If an end-user posts a message with "Also send to #channel" checked, + # the message event comes with this subtype. + "thread_broadcast", + ), + } primary_matcher = builtin_matchers.event(constraints=constraints) middleware.insert(0, MessageListenerMatches(keyword)) return self._register_listener( @@ -3614,9 +3634,19 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - # As of Jan 2021, most bot messages no longer have the subtype bot_message. - # By contrast, messages posted using classic app's bot token still have the subtype. - constraints = {"type": "message", "subtype": (None, "bot_message")} + constraints = { + "type": "message", + "subtype": ( + # In most cases, new message events come with no subtype. + None, + # As of Jan 2021, most bot messages no longer have the subtype bot_message. + # By contrast, messages posted using classic app's bot token still have the subtype. + "bot_message", + # If an end-user posts a message with "Also send to #channel" checked, + # the message event comes with this subtype. + "thread_broadcast", + ), + } primary_matcher = builtin_matchers.event(constraints=constraints) middleware.insert(0, MessageListenerMatches(keyword)) return self._register_listener( diff --git a/docs/api-docs/slack_bolt/app/async_app.html b/docs/api-docs/slack_bolt/app/async_app.html index 20653dbba..dd8f1deaf 100644 --- a/docs/api-docs/slack_bolt/app/async_app.html +++ b/docs/api-docs/slack_bolt/app/async_app.html @@ -868,9 +868,19 @@

    Module slack_bolt.app.async_app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - # As of Jan 2021, most bot messages no longer have the subtype bot_message. - # By contrast, messages posted using classic app's bot token still have the subtype. - constraints = {"type": "message", "subtype": (None, "bot_message")} + constraints = { + "type": "message", + "subtype": ( + # In most cases, new message events come with no subtype. + None, + # As of Jan 2021, most bot messages no longer have the subtype bot_message. + # By contrast, messages posted using classic app's bot token still have the subtype. + "bot_message", + # If an end-user posts a message with "Also send to #channel" checked, + # the message event comes with this subtype. + "thread_broadcast", + ), + } primary_matcher = builtin_matchers.event( constraints=constraints, asyncio=True ) @@ -2245,9 +2255,19 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - # As of Jan 2021, most bot messages no longer have the subtype bot_message. - # By contrast, messages posted using classic app's bot token still have the subtype. - constraints = {"type": "message", "subtype": (None, "bot_message")} + constraints = { + "type": "message", + "subtype": ( + # In most cases, new message events come with no subtype. + None, + # As of Jan 2021, most bot messages no longer have the subtype bot_message. + # By contrast, messages posted using classic app's bot token still have the subtype. + "bot_message", + # If an end-user posts a message with "Also send to #channel" checked, + # the message event comes with this subtype. + "thread_broadcast", + ), + } primary_matcher = builtin_matchers.event( constraints=constraints, asyncio=True ) @@ -3615,9 +3635,19 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - # As of Jan 2021, most bot messages no longer have the subtype bot_message. - # By contrast, messages posted using classic app's bot token still have the subtype. - constraints = {"type": "message", "subtype": (None, "bot_message")} + constraints = { + "type": "message", + "subtype": ( + # In most cases, new message events come with no subtype. + None, + # As of Jan 2021, most bot messages no longer have the subtype bot_message. + # By contrast, messages posted using classic app's bot token still have the subtype. + "bot_message", + # If an end-user posts a message with "Also send to #channel" checked, + # the message event comes with this subtype. + "thread_broadcast", + ), + } primary_matcher = builtin_matchers.event( constraints=constraints, asyncio=True ) diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index ab23705b3..b8cdbd7f2 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.9.2"
    +__version__ = "1.9.3"
    diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 8800b5e8c..8c955e58c 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.9.2" +__version__ = "1.9.3" From bfe6216e1292e7c2e8dfd41cdc7231960e2625eb Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 18 Oct 2021 09:21:00 +0900 Subject: [PATCH 259/719] Upgrade pytype to the latest (#496) --- .github/workflows/ci-build.yml | 5 +---- scripts/run_pytype.sh | 4 ++-- slack_bolt/app/app.py | 9 +++++---- slack_bolt/app/async_app.py | 9 +++++---- slack_bolt/app/async_server.py | 2 +- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 44463ccb3..7dfeed51f 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -72,10 +72,7 @@ jobs: run: | python_version=`python -V` if [ ${python_version:7:3} == "3.8" ]; then - pip install -e ".[async]" - pip install -e ".[adapter]" - # TODO: upgrade pytype - pip install "pytype==2021.9.27" && pytype slack_bolt/ + ./scripts/run_pytype.sh fi - name: Run all tests for codecov (3.9 only) run: | diff --git a/scripts/run_pytype.sh b/scripts/run_pytype.sh index b76aea800..88ad68ac4 100755 --- a/scripts/run_pytype.sh +++ b/scripts/run_pytype.sh @@ -3,7 +3,7 @@ script_dir=$(dirname $0) cd ${script_dir}/.. && \ + pip install -e ".[async]" && \ pip install -e ".[adapter]" && \ - # TODO: upgrade pytype - pip install "pytype==2021.9.27" && \ + pip install "pytype==2021.10.11" && \ pytype slack_bolt/ diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 2a2defda8..dc10cfc53 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -179,7 +179,7 @@ def message_hello(message, say): listener_executor: Custom executor to run background tasks. If absent, the default `ThreadPoolExecutor` will be used. """ - signing_secret = signing_secret or os.environ.get("SLACK_SIGNING_SECRET") + signing_secret = signing_secret or os.environ.get("SLACK_SIGNING_SECRET", "") token = token or os.environ.get("SLACK_BOT_TOKEN") self._name: str = name or inspect.stack()[1].filename.split(os.path.sep)[-1] @@ -304,7 +304,7 @@ def message_hello(message, say): # Middleware Initialization # -------------------------------------- - self._middleware_list: List[Union[Callable, Middleware]] = [] + self._middleware_list: List[Middleware] = [] self._listeners: List[Listener] = [] if listener_executor is None: @@ -469,7 +469,7 @@ def dispatch(self, req: BoltRequest) -> BoltResponse: starting_time = time.time() self._init_context(req) - resp: BoltResponse = BoltResponse(status=200, body="") + resp: Optional[BoltResponse] = BoltResponse(status=200, body="") middleware_state = {"next_called": False} def middleware_next(): @@ -607,7 +607,8 @@ def middleware_func(logger, body, next): if len(args) > 0: middleware_or_callable = args[0] if isinstance(middleware_or_callable, Middleware): - self._middleware_list.append(middleware_or_callable) + middleware: Middleware = middleware_or_callable + self._middleware_list.append(middleware) elif isinstance(middleware_or_callable, Callable): self._middleware_list.append( CustomMiddleware(app_name=self.name, func=middleware_or_callable) diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index ee2f84783..449a1daac 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -183,7 +183,7 @@ async def message_hello(message, say): # async function oauth_flow: Instantiated `slack_bolt.oauth.AsyncOAuthFlow`. This is always prioritized over oauth_settings. verification_token: Deprecated verification mechanism. This can used only for ssl_check requests. """ - signing_secret = signing_secret or os.environ.get("SLACK_SIGNING_SECRET") + signing_secret = signing_secret or os.environ.get("SLACK_SIGNING_SECRET", "") token = token or os.environ.get("SLACK_BOT_TOKEN") self._name: str = name or inspect.stack()[1].filename.split(os.path.sep)[-1] @@ -327,7 +327,7 @@ async def message_hello(message, say): # async function # Middleware Initialization # -------------------------------------- - self._async_middleware_list: List[Union[Callable, AsyncMiddleware]] = [] + self._async_middleware_list: List[AsyncMiddleware] = [] self._async_listeners: List[AsyncListener] = [] self._process_before_response = process_before_response @@ -506,7 +506,7 @@ async def async_dispatch(self, req: AsyncBoltRequest) -> BoltResponse: starting_time = time.time() self._init_context(req) - resp: BoltResponse = BoltResponse(status=200, body="") + resp: Optional[BoltResponse] = BoltResponse(status=200, body="") middleware_state = {"next_called": False} async def async_middleware_next(): @@ -642,7 +642,8 @@ async def middleware_func(logger, body, next): if len(args) > 0: middleware_or_callable = args[0] if isinstance(middleware_or_callable, AsyncMiddleware): - self._async_middleware_list.append(middleware_or_callable) + middleware: AsyncMiddleware = middleware_or_callable + self._async_middleware_list.append(middleware) elif isinstance(middleware_or_callable, Callable): self._async_middleware_list.append( AsyncCustomMiddleware( diff --git a/slack_bolt/app/async_server.py b/slack_bolt/app/async_server.py index 6bb05588e..e5176fab2 100644 --- a/slack_bolt/app/async_server.py +++ b/slack_bolt/app/async_server.py @@ -29,7 +29,7 @@ def __init__( # type:ignore """ self.port = port self.path = path - self.bolt_app: "AsyncApp" = app + self.bolt_app: "AsyncApp" = app # type: ignore self.web_app = web.Application() self._bolt_oauth_flow = self.bolt_app.oauth_flow if self._bolt_oauth_flow: From e671691807c7845c1049c7455016870cb145c1ab Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 18 Oct 2021 09:21:20 +0900 Subject: [PATCH 260/719] Add Python 3.10 to the supported versions (#497) * Add Python 3.10 to the supported versions * Upgrade pytest to run tests in Python 3.10 * refactor --- .github/workflows/ci-build.yml | 4 ++-- setup.py | 16 +++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 7dfeed51f..e2f362e5f 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -13,7 +13,7 @@ jobs: timeout-minutes: 15 strategy: matrix: - python-version: ['3.6', '3.7', '3.8', '3.9'] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] env: # default: multiprocessing # threading is more stable on GitHub Actions @@ -28,7 +28,7 @@ jobs: run: | python setup.py install pip install -U pip - pip install "pytest>=5,<6" "pytest-cov>=2,<3" "flask_sockets>0.2,<1" + pip install -e ".[testing_without_asyncio]" - name: Run tests without aiohttp run: | pytest tests/slack_bolt/ diff --git a/setup.py b/setup.py index 8d5e65851..0ea7278ee 100755 --- a/setup.py +++ b/setup.py @@ -13,15 +13,18 @@ long_description = fh.read() test_dependencies = [ - "pytest>=5,<6", + "pytest>=6.2.5,<7", "pytest-cov>=2,<3", - "pytest-asyncio<1", # for async - "aiohttp>=3,<4", # for async "Flask-Sockets>=0.2,<1", "Werkzeug<2", # TODO: support Flask 2.x "black==21.9b0", ] +async_test_dependencies = test_dependencies + [ + "pytest-asyncio<1", # for async + "aiohttp>=3,<4", # for async +] + setuptools.setup( name="slack_bolt", version=__version__, @@ -45,7 +48,7 @@ "slack_sdk>=3.9.0,<4", ], setup_requires=["pytest-runner==5.2"], - tests_require=test_dependencies, + tests_require=async_test_dependencies, test_suite="tests", extras_require={ # pip install -e ".[async]" @@ -84,14 +87,17 @@ # Socket Mode 3rd party implementation "websocket_client>=1,<2", ], + # pip install -e ".[testing_without_asyncio]" + "testing_without_asyncio": test_dependencies, # pip install -e ".[testing]" - "testing": test_dependencies, + "testing": async_test_dependencies, }, classifiers=[ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Programming Language :: Python :: Implementation :: CPython", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", From c98710ebe6d38b8d9655a792a7ed0c45e3e2d8f2 Mon Sep 17 00:00:00 2001 From: Jason Wong Date: Fri, 22 Oct 2021 12:33:40 +0900 Subject: [PATCH 261/719] update link to point to jp docs instead of en (#500) --- docs/_advanced/ja_token_rotation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_advanced/ja_token_rotation.md b/docs/_advanced/ja_token_rotation.md index 6a733a87f..c8eb1cc56 100644 --- a/docs/_advanced/ja_token_rotation.md +++ b/docs/_advanced/ja_token_rotation.md @@ -10,7 +10,7 @@ Bolt for Python [v1.7.0](https://github.com/slackapi/bolt-python/releases/tag/v1 既存の Slack アプリではアクセストークンが無期限に存在し続けるのに対して、トークンローテーションを有効にしたアプリではアクセストークンが失効するようになります。リフレッシュトークンを利用して、アクセストークンを長期間にわたって更新し続けることができます。 -[Bolt for Python の組み込みの OAuth 機能](https://slack.dev/bolt-python/concepts#authenticating-oauth) を使用していれば、Bolt for Python が自動的にトークンローテーションの処理をハンドリングします。 +[Bolt for Python の組み込みの OAuth 機能](https://slack.dev/bolt-python/ja-jp/concepts#authenticating-oauth) を使用していれば、Bolt for Python が自動的にトークンローテーションの処理をハンドリングします。 トークンローテーションに関する詳細は [API ドキュメント](https://api.slack.com/authentication/rotation)を参照してください。 From 292e9c7ec2855612c33fa3192dc721c32ea5ae2d Mon Sep 17 00:00:00 2001 From: D Rutter <47083572+dkzk22@users.noreply.github.com> Date: Fri, 29 Oct 2021 15:30:26 +0100 Subject: [PATCH 262/719] fix perform_token_rotation kwarg (#503) --- slack_bolt/authorization/async_authorize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/authorization/async_authorize.py b/slack_bolt/authorization/async_authorize.py index d7cc19a50..09aa9c179 100644 --- a/slack_bolt/authorization/async_authorize.py +++ b/slack_bolt/authorization/async_authorize.py @@ -209,7 +209,7 @@ async def __call__( raise BoltError(self._config_error_message) refreshed = await self.token_rotator.perform_token_rotation( installation=installation, - token_rotation_expiration_minutes=self.token_rotation_expiration_minutes, + minutes_before_expiration=self.token_rotation_expiration_minutes, ) if refreshed is not None: await self.installation_store.async_save(refreshed) From f9c28198b3385311e31aec58e2842d33abafd6df Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 30 Oct 2021 00:11:32 +0900 Subject: [PATCH 263/719] Bump optional dependencies for v1.9.4 release (#504) --- examples/aws_lambda/.gitignore | 2 ++ setup.py | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/aws_lambda/.gitignore b/examples/aws_lambda/.gitignore index 2ab4a5771..dac781e7f 100644 --- a/examples/aws_lambda/.gitignore +++ b/examples/aws_lambda/.gitignore @@ -1,2 +1,4 @@ slack-bolt/ +slack_bolt/ +vendor/ .env diff --git a/setup.py b/setup.py index 0ea7278ee..f2925072f 100755 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ test_dependencies = [ "pytest>=6.2.5,<7", - "pytest-cov>=2,<3", + "pytest-cov>=3,<4", "Flask-Sockets>=0.2,<1", "Werkzeug<2", # TODO: support Flask 2.x "black==21.9b0", @@ -67,18 +67,18 @@ "moto<2", # For AWS tests "bottle>=0.12,<1", "boddle>=0.2,<0.3", # For Bottle app tests - "chalice>=1.22.4,<2", + "chalice>=1.26.1,<2", "click>=7,<8", # for chalice "CherryPy>=18,<19", "Django>=3,<4", "falcon>=2,<3", - "fastapi<1", + "fastapi>=0.70.0,<1", "Flask>=1,<2", "Werkzeug<2", # TODO: support Flask 2.x "pyramid>=1,<2", "sanic>=21,<22" if sys.version_info.minor > 6 else "sanic>=20,<21", - "sanic-testing>=0.6" if sys.version_info.minor > 6 else "", - "starlette>=0.13,<1", + "sanic-testing>=0.7" if sys.version_info.minor > 6 else "", + "starlette>=0.14,<1", "requests>=2,<3", # For starlette's TestClient "tornado>=6,<7", # server From e112c7e75f743b2cef619946903237a4f526ce23 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 30 Oct 2021 00:13:25 +0900 Subject: [PATCH 264/719] version 1.9.4 --- docs/api-docs/slack_bolt/app/app.html | 23 +++++++++++-------- docs/api-docs/slack_bolt/app/async_app.html | 23 +++++++++++-------- .../api-docs/slack_bolt/app/async_server.html | 4 ++-- .../authorization/async_authorize.html | 4 ++-- docs/api-docs/slack_bolt/version.html | 2 +- slack_bolt/version.py | 2 +- 6 files changed, 32 insertions(+), 26 deletions(-) diff --git a/docs/api-docs/slack_bolt/app/app.html b/docs/api-docs/slack_bolt/app/app.html index e192514d2..70faf2c9d 100644 --- a/docs/api-docs/slack_bolt/app/app.html +++ b/docs/api-docs/slack_bolt/app/app.html @@ -207,7 +207,7 @@

    Module slack_bolt.app.app

    listener_executor: Custom executor to run background tasks. If absent, the default `ThreadPoolExecutor` will be used. """ - signing_secret = signing_secret or os.environ.get("SLACK_SIGNING_SECRET") + signing_secret = signing_secret or os.environ.get("SLACK_SIGNING_SECRET", "") token = token or os.environ.get("SLACK_BOT_TOKEN") self._name: str = name or inspect.stack()[1].filename.split(os.path.sep)[-1] @@ -332,7 +332,7 @@

    Module slack_bolt.app.app

    # Middleware Initialization # -------------------------------------- - self._middleware_list: List[Union[Callable, Middleware]] = [] + self._middleware_list: List[Middleware] = [] self._listeners: List[Listener] = [] if listener_executor is None: @@ -497,7 +497,7 @@

    Module slack_bolt.app.app

    starting_time = time.time() self._init_context(req) - resp: BoltResponse = BoltResponse(status=200, body="") + resp: Optional[BoltResponse] = BoltResponse(status=200, body="") middleware_state = {"next_called": False} def middleware_next(): @@ -635,7 +635,8 @@

    Module slack_bolt.app.app

    if len(args) > 0: middleware_or_callable = args[0] if isinstance(middleware_or_callable, Middleware): - self._middleware_list.append(middleware_or_callable) + middleware: Middleware = middleware_or_callable + self._middleware_list.append(middleware) elif isinstance(middleware_or_callable, Callable): self._middleware_list.append( CustomMiddleware(app_name=self.name, func=middleware_or_callable) @@ -1668,7 +1669,7 @@

    Args

    listener_executor: Custom executor to run background tasks. If absent, the default `ThreadPoolExecutor` will be used. """ - signing_secret = signing_secret or os.environ.get("SLACK_SIGNING_SECRET") + signing_secret = signing_secret or os.environ.get("SLACK_SIGNING_SECRET", "") token = token or os.environ.get("SLACK_BOT_TOKEN") self._name: str = name or inspect.stack()[1].filename.split(os.path.sep)[-1] @@ -1793,7 +1794,7 @@

    Args

    # Middleware Initialization # -------------------------------------- - self._middleware_list: List[Union[Callable, Middleware]] = [] + self._middleware_list: List[Middleware] = [] self._listeners: List[Listener] = [] if listener_executor is None: @@ -1958,7 +1959,7 @@

    Args

    starting_time = time.time() self._init_context(req) - resp: BoltResponse = BoltResponse(status=200, body="") + resp: Optional[BoltResponse] = BoltResponse(status=200, body="") middleware_state = {"next_called": False} def middleware_next(): @@ -2096,7 +2097,8 @@

    Args

    if len(args) > 0: middleware_or_callable = args[0] if isinstance(middleware_or_callable, Middleware): - self._middleware_list.append(middleware_or_callable) + middleware: Middleware = middleware_or_callable + self._middleware_list.append(middleware) elif isinstance(middleware_or_callable, Callable): self._middleware_list.append( CustomMiddleware(app_name=self.name, func=middleware_or_callable) @@ -3292,7 +3294,7 @@

    Returns

    starting_time = time.time() self._init_context(req) - resp: BoltResponse = BoltResponse(status=200, body="") + resp: Optional[BoltResponse] = BoltResponse(status=200, body="") middleware_state = {"next_called": False} def middleware_next(): @@ -3732,7 +3734,8 @@

    Args

    if len(args) > 0: middleware_or_callable = args[0] if isinstance(middleware_or_callable, Middleware): - self._middleware_list.append(middleware_or_callable) + middleware: Middleware = middleware_or_callable + self._middleware_list.append(middleware) elif isinstance(middleware_or_callable, Callable): self._middleware_list.append( CustomMiddleware(app_name=self.name, func=middleware_or_callable) diff --git a/docs/api-docs/slack_bolt/app/async_app.html b/docs/api-docs/slack_bolt/app/async_app.html index dd8f1deaf..0296dd263 100644 --- a/docs/api-docs/slack_bolt/app/async_app.html +++ b/docs/api-docs/slack_bolt/app/async_app.html @@ -211,7 +211,7 @@

    Module slack_bolt.app.async_app

    oauth_flow: Instantiated `slack_bolt.oauth.AsyncOAuthFlow`. This is always prioritized over oauth_settings. verification_token: Deprecated verification mechanism. This can used only for ssl_check requests. """ - signing_secret = signing_secret or os.environ.get("SLACK_SIGNING_SECRET") + signing_secret = signing_secret or os.environ.get("SLACK_SIGNING_SECRET", "") token = token or os.environ.get("SLACK_BOT_TOKEN") self._name: str = name or inspect.stack()[1].filename.split(os.path.sep)[-1] @@ -355,7 +355,7 @@

    Module slack_bolt.app.async_app

    # Middleware Initialization # -------------------------------------- - self._async_middleware_list: List[Union[Callable, AsyncMiddleware]] = [] + self._async_middleware_list: List[AsyncMiddleware] = [] self._async_listeners: List[AsyncListener] = [] self._process_before_response = process_before_response @@ -534,7 +534,7 @@

    Module slack_bolt.app.async_app

    starting_time = time.time() self._init_context(req) - resp: BoltResponse = BoltResponse(status=200, body="") + resp: Optional[BoltResponse] = BoltResponse(status=200, body="") middleware_state = {"next_called": False} async def async_middleware_next(): @@ -670,7 +670,8 @@

    Module slack_bolt.app.async_app

    if len(args) > 0: middleware_or_callable = args[0] if isinstance(middleware_or_callable, AsyncMiddleware): - self._async_middleware_list.append(middleware_or_callable) + middleware: AsyncMiddleware = middleware_or_callable + self._async_middleware_list.append(middleware) elif isinstance(middleware_or_callable, Callable): self._async_middleware_list.append( AsyncCustomMiddleware( @@ -1598,7 +1599,7 @@

    Args

    oauth_flow: Instantiated `slack_bolt.oauth.AsyncOAuthFlow`. This is always prioritized over oauth_settings. verification_token: Deprecated verification mechanism. This can used only for ssl_check requests. """ - signing_secret = signing_secret or os.environ.get("SLACK_SIGNING_SECRET") + signing_secret = signing_secret or os.environ.get("SLACK_SIGNING_SECRET", "") token = token or os.environ.get("SLACK_BOT_TOKEN") self._name: str = name or inspect.stack()[1].filename.split(os.path.sep)[-1] @@ -1742,7 +1743,7 @@

    Args

    # Middleware Initialization # -------------------------------------- - self._async_middleware_list: List[Union[Callable, AsyncMiddleware]] = [] + self._async_middleware_list: List[AsyncMiddleware] = [] self._async_listeners: List[AsyncListener] = [] self._process_before_response = process_before_response @@ -1921,7 +1922,7 @@

    Args

    starting_time = time.time() self._init_context(req) - resp: BoltResponse = BoltResponse(status=200, body="") + resp: Optional[BoltResponse] = BoltResponse(status=200, body="") middleware_state = {"next_called": False} async def async_middleware_next(): @@ -2057,7 +2058,8 @@

    Args

    if len(args) > 0: middleware_or_callable = args[0] if isinstance(middleware_or_callable, AsyncMiddleware): - self._async_middleware_list.append(middleware_or_callable) + middleware: AsyncMiddleware = middleware_or_callable + self._async_middleware_list.append(middleware) elif isinstance(middleware_or_callable, Callable): self._async_middleware_list.append( AsyncCustomMiddleware( @@ -3005,7 +3007,7 @@

    Returns

    starting_time = time.time() self._init_context(req) - resp: BoltResponse = BoltResponse(status=200, body="") + resp: Optional[BoltResponse] = BoltResponse(status=200, body="") middleware_state = {"next_called": False} async def async_middleware_next(): @@ -3732,7 +3734,8 @@

    Args

    if len(args) > 0: middleware_or_callable = args[0] if isinstance(middleware_or_callable, AsyncMiddleware): - self._async_middleware_list.append(middleware_or_callable) + middleware: AsyncMiddleware = middleware_or_callable + self._async_middleware_list.append(middleware) elif isinstance(middleware_or_callable, Callable): self._async_middleware_list.append( AsyncCustomMiddleware( diff --git a/docs/api-docs/slack_bolt/app/async_server.html b/docs/api-docs/slack_bolt/app/async_server.html index b816d91c6..24961f59a 100644 --- a/docs/api-docs/slack_bolt/app/async_server.html +++ b/docs/api-docs/slack_bolt/app/async_server.html @@ -57,7 +57,7 @@

    Module slack_bolt.app.async_server

    """ self.port = port self.path = path - self.bolt_app: "AsyncApp" = app + self.bolt_app: "AsyncApp" = app # type: ignore self.web_app = web.Application() self._bolt_oauth_flow = self.bolt_app.oauth_flow if self._bolt_oauth_flow: @@ -161,7 +161,7 @@

    Args

    """ self.port = port self.path = path - self.bolt_app: "AsyncApp" = app + self.bolt_app: "AsyncApp" = app # type: ignore self.web_app = web.Application() self._bolt_oauth_flow = self.bolt_app.oauth_flow if self._bolt_oauth_flow: diff --git a/docs/api-docs/slack_bolt/authorization/async_authorize.html b/docs/api-docs/slack_bolt/authorization/async_authorize.html index 1f9413b83..e919b6161 100644 --- a/docs/api-docs/slack_bolt/authorization/async_authorize.html +++ b/docs/api-docs/slack_bolt/authorization/async_authorize.html @@ -237,7 +237,7 @@

    Module slack_bolt.authorization.async_authorizeAncestors

    raise BoltError(self._config_error_message) refreshed = await self.token_rotator.perform_token_rotation( installation=installation, - token_rotation_expiration_minutes=self.token_rotation_expiration_minutes, + minutes_before_expiration=self.token_rotation_expiration_minutes, ) if refreshed is not None: await self.installation_store.async_save(refreshed) diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index b8cdbd7f2..dfb472789 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.9.3"
    +__version__ = "1.9.4"
    diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 8c955e58c..3f785e181 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.9.3" +__version__ = "1.9.4" From 8a0c87ee14a70cbeb462515cef1bbef68dcf0732 Mon Sep 17 00:00:00 2001 From: TORIFUKUKaiou Date: Sat, 30 Oct 2021 10:37:43 +0900 Subject: [PATCH 265/719] delete action_button_click(body, ack, say) (#507) The document of getting_started.md has not already been implemented action_button_click at this time. --- docs/_tutorials/ja_getting_started.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/_tutorials/ja_getting_started.md b/docs/_tutorials/ja_getting_started.md index 8151f82d0..669092550 100644 --- a/docs/_tutorials/ja_getting_started.md +++ b/docs/_tutorials/ja_getting_started.md @@ -228,12 +228,6 @@ def message_hello(message, say): text=f"Hey there <@{message['user']}>!" ) -@app.action("button_click") -def action_button_click(body, ack, say): - # アクションのリクエストを確認 - ack() - say(f"<@{body['user']['id']}> clicked the button") - # アプリを起動します if __name__ == "__main__": SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]).start() From 8534905d378f8b7dddaaa24becad4a0a5c037cf2 Mon Sep 17 00:00:00 2001 From: TORIFUKUKaiou Date: Sat, 30 Oct 2021 10:43:48 +0900 Subject: [PATCH 266/719] app-level (xapp) token can be gotton from the Basic Information page (#508) --- docs/_tutorials/ja_getting_started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_tutorials/ja_getting_started.md b/docs/_tutorials/ja_getting_started.md index 669092550..4aa564b11 100644 --- a/docs/_tutorials/ja_getting_started.md +++ b/docs/_tutorials/ja_getting_started.md @@ -95,7 +95,7 @@ Bolt for Python のパッケージを新しいプロジェクトにインスト export SLACK_BOT_TOKEN=xoxb-<ボットトークン> ``` -2. **OAuth & Permissions ページのアプリレベルトークン(xapp)をコピー**して、別の環境変数に保存します。 +2. **Basic Information ページのアプリレベルトークン(xapp)をコピー**して、別の環境変数に保存します。 ```shell export SLACK_APP_TOKEN=<アプリレベルトークン> ``` From 4d6448462468fe8abee80b8ad3e94dda980803bb Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 2 Nov 2021 18:23:15 +0900 Subject: [PATCH 267/719] Upgrade pytype version to 2021.10.25 (#511) --- scripts/run_pytype.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run_pytype.sh b/scripts/run_pytype.sh index 88ad68ac4..4b305f1b6 100755 --- a/scripts/run_pytype.sh +++ b/scripts/run_pytype.sh @@ -5,5 +5,5 @@ script_dir=$(dirname $0) cd ${script_dir}/.. && \ pip install -e ".[async]" && \ pip install -e ".[adapter]" && \ - pip install "pytype==2021.10.11" && \ + pip install "pytype==2021.10.25" && \ pytype slack_bolt/ From cf3951e4eebe7f72daf235d285023fbda090d24a Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 3 Nov 2021 06:28:00 +0900 Subject: [PATCH 268/719] Improve the Django DB connection management #509 (#512) --- slack_bolt/adapter/django/handler.py | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/slack_bolt/adapter/django/handler.py b/slack_bolt/adapter/django/handler.py index 2862a380b..2cb9754c0 100644 --- a/slack_bolt/adapter/django/handler.py +++ b/slack_bolt/adapter/django/handler.py @@ -54,15 +54,16 @@ def to_django_response(bolt_resp: BoltResponse) -> HttpResponse: return resp -from django.db import connections +from django.db import close_old_connections -def release_thread_local_connections(logger: Logger, execution_type: str): - connections.close_all() +def release_thread_local_connections(logger: Logger, execution_timing: str): + close_old_connections() if logger.level <= logging.DEBUG: current: Thread = current_thread() logger.debug( - f"Released thread-bound DB connections (thread name: {current.name}, execution type: {execution_type})" + "Released thread-bound old DB connections " + f"(thread name: {current.name}, execution timing: {execution_timing})" ) @@ -73,7 +74,7 @@ class DjangoListenerCompletionHandler(ListenerCompletionHandler): """ def handle(self, request: BoltRequest, response: Optional[BoltResponse]) -> None: - release_thread_local_connections(request.context.logger, "listener") + release_thread_local_connections(request.context.logger, "listener-completion") class DjangoThreadLazyListenerRunner(ThreadLazyListenerRunner): @@ -89,7 +90,7 @@ def wrapped_func(): func() finally: release_thread_local_connections( - request.context.logger, "lazy-listener" + request.context.logger, "lazy-listener-completion" ) self.executor.submit(wrapped_func) @@ -120,14 +121,12 @@ def __init__(self, app: App): # type: ignore if current_completion_handler is not None and not isinstance( current_completion_handler, DefaultListenerCompletionHandler ): + # As we run release_thread_local_connections() before listener executions, + # it's okay to skip calling the same connection clean-up method at the listener completion. message = """As you've already set app.listener_runner.listener_completion_handler to your own one, Bolt skipped to set it to slack_sdk.adapter.django.DjangoListenerCompletionHandler. - We strongly recommend having the following lines of code in your listener_completion_handler: - - from django.db import connections - connections.close_all() """ - self.app.logger.warning(message) + self.app.logger.info(message) return # for proper management of thread-local Django DB connections self.app.listener_runner.listener_completion_handler = ( @@ -146,6 +145,13 @@ def handle(self, req: HttpRequest) -> HttpResponse: bolt_resp = oauth_flow.handle_callback(to_bolt_request(req)) return to_django_response(bolt_resp) elif req.method == "POST": + # As bolt-python utilizes threads for async `ack()` method execution, + # we have to manually clean old/stale Django ORM connections bound to the "unmanaged" threads + # Refer to https://github.com/slackapi/bolt-python/issues/280 for more details. + release_thread_local_connections( + self.app.logger, "before-listener-invocation" + ) + # And then, run the App listener/lazy listener here bolt_resp: BoltResponse = self.app.dispatch(to_bolt_request(req)) return to_django_response(bolt_resp) From fc7013b575fb7b54ea02b644c52472ed596a2b9d Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 4 Nov 2021 06:39:23 +0900 Subject: [PATCH 269/719] Introduce ListenerStartHandler in the listener runner for better managing Django DB connections (#514) --- slack_bolt/adapter/django/handler.py | 47 +++++++++++--- slack_bolt/app/app.py | 4 ++ slack_bolt/app/async_app.py | 6 ++ .../async_listener_completion_handler.py | 3 +- .../listener/async_listener_start_handler.py | 57 +++++++++++++++++ slack_bolt/listener/asyncio_runner.py | 12 ++++ .../listener/listener_completion_handler.py | 2 +- slack_bolt/listener/listener_start_handler.py | 61 +++++++++++++++++++ slack_bolt/listener/thread_runner.py | 12 ++++ slack_bolt/version.py | 2 +- 10 files changed, 195 insertions(+), 11 deletions(-) create mode 100644 slack_bolt/listener/async_listener_start_handler.py create mode 100644 slack_bolt/listener/listener_start_handler.py diff --git a/slack_bolt/adapter/django/handler.py b/slack_bolt/adapter/django/handler.py index 2cb9754c0..7d86adfbe 100644 --- a/slack_bolt/adapter/django/handler.py +++ b/slack_bolt/adapter/django/handler.py @@ -9,6 +9,10 @@ from slack_bolt.error import BoltError from slack_bolt.lazy_listener import ThreadLazyListenerRunner from slack_bolt.lazy_listener.internals import build_runnable_function +from slack_bolt.listener.listener_start_handler import ( + ListenerStartHandler, + DefaultListenerStartHandler, +) from slack_bolt.listener.listener_completion_handler import ( ListenerCompletionHandler, DefaultListenerCompletionHandler, @@ -67,6 +71,16 @@ def release_thread_local_connections(logger: Logger, execution_timing: str): ) +class DjangoListenerStartHandler(ListenerStartHandler): + """Django sets DB connections as a thread-local variable per thread. + If the thread is not managed on the Django app side, the connections won't be released by Django. + This handler releases the connections every time a ThreadListenerRunner execution completes. + """ + + def handle(self, request: BoltRequest, response: Optional[BoltResponse]) -> None: + release_thread_local_connections(request.context.logger, "listener-start") + + class DjangoListenerCompletionHandler(ListenerCompletionHandler): """Django sets DB connections as a thread-local variable per thread. If the thread is not managed on the Django app side, the connections won't be released by Django. @@ -86,6 +100,9 @@ def start(self, function: Callable[..., None], request: BoltRequest) -> None: ) def wrapped_func(): + release_thread_local_connections( + request.context.logger, "before-lazy-listener" + ) try: func() finally: @@ -117,6 +134,29 @@ def __init__(self, app: App): # type: ignore self.app.logger.debug("App.process_before_response is set to True") return + current_start_handler = listener_runner.listener_start_handler + if current_start_handler is not None and not isinstance( + current_start_handler, DefaultListenerStartHandler + ): + # As we run release_thread_local_connections() before listener executions, + # it's okay to skip calling the same connection clean-up method at the listener completion. + message = """As you've already set app.listener_runner.listener_start_handler to your own one, + Bolt skipped to set it to slack_sdk.adapter.django.DjangoListenerStartHandler. + + If you go with your own handler here, we highly recommend having the following lines of code + in your handle() method to clean up unmanaged stale/old database connections: + + from django.db import close_old_connections + close_old_connections() + """ + self.app.logger.info(message) + else: + # for proper management of thread-local Django DB connections + self.app.listener_runner.listener_start_handler = ( + DjangoListenerStartHandler() + ) + self.app.logger.debug("DjangoListenerStartHandler has been enabled") + current_completion_handler = listener_runner.listener_completion_handler if current_completion_handler is not None and not isinstance( current_completion_handler, DefaultListenerCompletionHandler @@ -145,13 +185,6 @@ def handle(self, req: HttpRequest) -> HttpResponse: bolt_resp = oauth_flow.handle_callback(to_bolt_request(req)) return to_django_response(bolt_resp) elif req.method == "POST": - # As bolt-python utilizes threads for async `ack()` method execution, - # we have to manually clean old/stale Django ORM connections bound to the "unmanaged" threads - # Refer to https://github.com/slackapi/bolt-python/issues/280 for more details. - release_thread_local_connections( - self.app.logger, "before-listener-invocation" - ) - # And then, run the App listener/lazy listener here bolt_resp: BoltResponse = self.app.dispatch(to_bolt_request(req)) return to_django_response(bolt_resp) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index dc10cfc53..e3eea413f 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -23,6 +23,7 @@ from slack_bolt.listener.builtins import TokenRevocationListeners from slack_bolt.listener.custom_listener import CustomListener from slack_bolt.listener.listener import Listener +from slack_bolt.listener.listener_start_handler import DefaultListenerStartHandler from slack_bolt.listener.listener_completion_handler import ( DefaultListenerCompletionHandler, ) @@ -317,6 +318,9 @@ def message_hello(message, say): listener_error_handler=DefaultListenerErrorHandler( logger=self._framework_logger ), + listener_start_handler=DefaultListenerStartHandler( + logger=self._framework_logger + ), listener_completion_handler=DefaultListenerCompletionHandler( logger=self._framework_logger ), diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 449a1daac..e44d1d59d 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -8,6 +8,9 @@ from slack_bolt.app.async_server import AsyncSlackAppServer from slack_bolt.listener.async_builtins import AsyncTokenRevocationListeners +from slack_bolt.listener.async_listener_start_handler import ( + AsyncDefaultListenerStartHandler, +) from slack_bolt.listener.async_listener_completion_handler import ( AsyncDefaultListenerCompletionHandler, ) @@ -337,6 +340,9 @@ async def message_hello(message, say): # async function listener_error_handler=AsyncDefaultListenerErrorHandler( logger=self._framework_logger ), + listener_start_handler=AsyncDefaultListenerStartHandler( + logger=self._framework_logger + ), listener_completion_handler=AsyncDefaultListenerCompletionHandler( logger=self._framework_logger ), diff --git a/slack_bolt/listener/async_listener_completion_handler.py b/slack_bolt/listener/async_listener_completion_handler.py index 14a4d8e91..6f70fdc5d 100644 --- a/slack_bolt/listener/async_listener_completion_handler.py +++ b/slack_bolt/listener/async_listener_completion_handler.py @@ -15,10 +15,9 @@ async def handle( request: AsyncBoltRequest, response: Optional[BoltResponse], ) -> None: - """Handles an unhandled exception. + """Do something extra after the listener execution Args: - error: The raised exception. request: The request. response: The response. """ diff --git a/slack_bolt/listener/async_listener_start_handler.py b/slack_bolt/listener/async_listener_start_handler.py new file mode 100644 index 000000000..080c83b1a --- /dev/null +++ b/slack_bolt/listener/async_listener_start_handler.py @@ -0,0 +1,57 @@ +import inspect +from abc import ABCMeta, abstractmethod +from logging import Logger +from typing import Callable, Dict, Any, Awaitable, Optional + +from slack_bolt.kwargs_injection.async_utils import build_async_required_kwargs +from slack_bolt.request.async_request import AsyncBoltRequest +from slack_bolt.response import BoltResponse + + +class AsyncListenerStartHandler(metaclass=ABCMeta): + @abstractmethod + async def handle( + self, + request: AsyncBoltRequest, + response: Optional[BoltResponse], + ) -> None: + """Do something extra before the listener execution + + Args: + request: The request. + response: The response. + """ + raise NotImplementedError() + + +class AsyncCustomListenerStartHandler(AsyncListenerStartHandler): + def __init__(self, logger: Logger, func: Callable[..., Awaitable[None]]): + self.func = func + self.logger = logger + self.arg_names = inspect.getfullargspec(func).args + + async def handle( + self, + request: AsyncBoltRequest, + response: Optional[BoltResponse], + ) -> None: + kwargs: Dict[str, Any] = build_async_required_kwargs( + required_arg_names=self.arg_names, + logger=self.logger, + request=request, + response=response, + next_keys_required=False, + ) + await self.func(**kwargs) + + +class AsyncDefaultListenerStartHandler(AsyncListenerStartHandler): + def __init__(self, logger: Logger): + self.logger = logger + + async def handle( + self, + request: AsyncBoltRequest, + response: Optional[BoltResponse], + ): + pass diff --git a/slack_bolt/listener/asyncio_runner.py b/slack_bolt/listener/asyncio_runner.py index 37a532f3c..ecd66568b 100644 --- a/slack_bolt/listener/asyncio_runner.py +++ b/slack_bolt/listener/asyncio_runner.py @@ -7,6 +7,9 @@ from slack_bolt.context.ack.async_ack import AsyncAck from slack_bolt.lazy_listener.async_runner import AsyncLazyListenerRunner from slack_bolt.listener.async_listener import AsyncListener +from slack_bolt.listener.async_listener_start_handler import ( + AsyncListenerStartHandler, +) from slack_bolt.listener.async_listener_completion_handler import ( AsyncListenerCompletionHandler, ) @@ -25,6 +28,7 @@ class AsyncioListenerRunner: logger: Logger process_before_response: bool listener_error_handler: AsyncListenerErrorHandler + listener_start_handler: AsyncListenerStartHandler listener_completion_handler: AsyncListenerCompletionHandler lazy_listener_runner: AsyncLazyListenerRunner @@ -33,12 +37,14 @@ def __init__( logger: Logger, process_before_response: bool, listener_error_handler: AsyncListenerErrorHandler, + listener_start_handler: AsyncListenerStartHandler, listener_completion_handler: AsyncListenerCompletionHandler, lazy_listener_runner: AsyncLazyListenerRunner, ): self.logger = logger self.process_before_response = process_before_response self.listener_error_handler = listener_error_handler + self.listener_start_handler = listener_start_handler self.listener_completion_handler = listener_completion_handler self.lazy_listener_runner = lazy_listener_runner @@ -55,6 +61,9 @@ async def run( if self.process_before_response: if not request.lazy_only: try: + await self.listener_start_handler.handle( + request=request, response=response + ) returned_value = await listener.run_ack_function( request=request, response=response ) @@ -113,6 +122,9 @@ async def run_ack_function_asynchronously( response: BoltResponse, ): try: + await self.listener_start_handler.handle( + request=request, response=response + ) await listener.run_ack_function( request=request, response=response ) diff --git a/slack_bolt/listener/listener_completion_handler.py b/slack_bolt/listener/listener_completion_handler.py index 18a062d32..2aad6a9aa 100644 --- a/slack_bolt/listener/listener_completion_handler.py +++ b/slack_bolt/listener/listener_completion_handler.py @@ -15,7 +15,7 @@ def handle( request: BoltRequest, response: Optional[BoltResponse], ) -> None: - """Handles an unhandled exception. + """Do something extra after the listener execution Args: request: The request. diff --git a/slack_bolt/listener/listener_start_handler.py b/slack_bolt/listener/listener_start_handler.py new file mode 100644 index 000000000..b70609747 --- /dev/null +++ b/slack_bolt/listener/listener_start_handler.py @@ -0,0 +1,61 @@ +import inspect +from abc import ABCMeta, abstractmethod +from logging import Logger +from typing import Callable, Dict, Any, Optional + +from slack_bolt.kwargs_injection import build_required_kwargs +from slack_bolt.request.request import BoltRequest +from slack_bolt.response.response import BoltResponse + + +class ListenerStartHandler(metaclass=ABCMeta): + @abstractmethod + def handle( + self, + request: BoltRequest, + response: Optional[BoltResponse], + ) -> None: + """Do something extra before the listener execution. + + This handler is useful if a developer needs to maintain/clean up + thread-local resources such as Django ORM database connections + before a listener execution starts. + + Args: + request: The request. + response: The response. + """ + raise NotImplementedError() + + +class CustomListenerStartHandler(ListenerStartHandler): + def __init__(self, logger: Logger, func: Callable[..., None]): + self.func = func + self.logger = logger + self.arg_names = inspect.getfullargspec(func).args + + def handle( + self, + request: BoltRequest, + response: Optional[BoltResponse], + ): + kwargs: Dict[str, Any] = build_required_kwargs( + required_arg_names=self.arg_names, + logger=self.logger, + request=request, + response=response, + next_keys_required=False, + ) + self.func(**kwargs) + + +class DefaultListenerStartHandler(ListenerStartHandler): + def __init__(self, logger: Logger): + self.logger = logger + + def handle( + self, + request: BoltRequest, + response: Optional[BoltResponse], + ): + pass diff --git a/slack_bolt/listener/thread_runner.py b/slack_bolt/listener/thread_runner.py index 941926722..b6a6b6e11 100644 --- a/slack_bolt/listener/thread_runner.py +++ b/slack_bolt/listener/thread_runner.py @@ -5,6 +5,7 @@ from slack_bolt.lazy_listener import LazyListenerRunner from slack_bolt.listener import Listener +from slack_bolt.listener.listener_start_handler import ListenerStartHandler from slack_bolt.listener.listener_completion_handler import ListenerCompletionHandler from slack_bolt.listener.listener_error_handler import ListenerErrorHandler from slack_bolt.logger.messages import ( @@ -21,6 +22,7 @@ class ThreadListenerRunner: logger: Logger process_before_response: bool listener_error_handler: ListenerErrorHandler + listener_start_handler: ListenerStartHandler listener_completion_handler: ListenerCompletionHandler listener_executor: Executor lazy_listener_runner: LazyListenerRunner @@ -30,6 +32,7 @@ def __init__( logger: Logger, process_before_response: bool, listener_error_handler: ListenerErrorHandler, + listener_start_handler: ListenerStartHandler, listener_completion_handler: ListenerCompletionHandler, listener_executor: Executor, lazy_listener_runner: LazyListenerRunner, @@ -37,6 +40,7 @@ def __init__( self.logger = logger self.process_before_response = process_before_response self.listener_error_handler = listener_error_handler + self.listener_start_handler = listener_start_handler self.listener_completion_handler = listener_completion_handler self.listener_executor = listener_executor self.lazy_listener_runner = lazy_listener_runner @@ -54,6 +58,10 @@ def run( # type: ignore if self.process_before_response: if not request.lazy_only: try: + self.listener_start_handler.handle( + request=request, + response=response, + ) returned_value = listener.run_ack_function( request=request, response=response ) @@ -109,6 +117,10 @@ def run( # type: ignore def run_ack_function_asynchronously(): nonlocal ack, request, response try: + self.listener_start_handler.handle( + request=request, + response=response, + ) listener.run_ack_function(request=request, response=response) except Exception as e: # The default response status code is 500 in this case. diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 3f785e181..0144027c3 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.9.4" +__version__ = "1.10.0a" From d5de9f72cd925311281d5f6feb76b9cb456bed38 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 4 Nov 2021 18:09:40 +0900 Subject: [PATCH 270/719] Upgrade black code formatter --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f2925072f..db728656d 100755 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ "pytest-cov>=3,<4", "Flask-Sockets>=0.2,<1", "Werkzeug<2", # TODO: support Flask 2.x - "black==21.9b0", + "black==21.10b0", ] async_test_dependencies = test_dependencies + [ From 77db11f2e44f1d054df0f60b748d220f1f8e7d4b Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 4 Nov 2021 18:29:51 +0900 Subject: [PATCH 271/719] Improve the CI build settings (#516) --- .github/workflows/codecov.yml | 34 +++++++++++++++++++ .github/workflows/pytype.yml | 23 +++++++++++++ .github/workflows/{ci-build.yml => tests.yml} | 22 ++---------- 3 files changed, 60 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/codecov.yml create mode 100644 .github/workflows/pytype.yml rename .github/workflows/{ci-build.yml => tests.yml} (74%) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 000000000..37b87fc4c --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,34 @@ +name: Run codecov + +on: + push: + branches: [ main ] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 10 + strategy: + matrix: + python-version: ['3.9'] + env: + # default: multiprocessing + # threading is more stable on GitHub Actions + BOLT_PYTHON_MOCK_SERVER_MODE: threading + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python setup.py install + pip install -U pip + pip install -e ".[async]" + pip install -e ".[adapter]" + pip install -e ".[testing]" + - name: Run all tests for codecov + run: | + pytest --cov=slack_bolt/ && bash <(curl -s https://codecov.io/bash) diff --git a/.github/workflows/pytype.yml b/.github/workflows/pytype.yml new file mode 100644 index 000000000..6acf4b2b5 --- /dev/null +++ b/.github/workflows/pytype.yml @@ -0,0 +1,23 @@ +name: Run pytype validation + +on: + push: + branches: [ main ] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 15 + strategy: + matrix: + python-version: ['3.8'] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Run pytype verification + run: | + ./scripts/run_pytype.sh diff --git a/.github/workflows/ci-build.yml b/.github/workflows/tests.yml similarity index 74% rename from .github/workflows/ci-build.yml rename to .github/workflows/tests.yml index e2f362e5f..c32fd1154 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/tests.yml @@ -1,16 +1,14 @@ -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: CI Build +name: Run all the unit tests on: push: branches: [ main ] pull_request: - branches: [ main ] jobs: build: - runs-on: ubuntu-20.04 - timeout-minutes: 15 + runs-on: ubuntu-latest + timeout-minutes: 10 strategy: matrix: python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] @@ -68,17 +66,3 @@ jobs: run: | pip install -e ".[async]" pytest tests/adapter_tests_async/ - - name: Run pytype verification (3.8 only) - run: | - python_version=`python -V` - if [ ${python_version:7:3} == "3.8" ]; then - ./scripts/run_pytype.sh - fi - - name: Run all tests for codecov (3.9 only) - run: | - python_version=`python -V` - if [ ${python_version:7:3} == "3.9" ]; then - pip install -e ".[async]" - pip install -e ".[testing]" - pytest --cov=slack_bolt/ && bash <(curl -s https://codecov.io/bash) - fi From e411385083f9daec5f62d23b62add800c21eb831 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 4 Nov 2021 18:31:53 +0900 Subject: [PATCH 272/719] version 1.10.0 --- .../slack_bolt/adapter/django/handler.html | 144 +++++++-- docs/api-docs/slack_bolt/app/app.html | 7 + docs/api-docs/slack_bolt/app/async_app.html | 9 + .../async_listener_completion_handler.html | 13 +- .../async_listener_start_handler.html | 275 +++++++++++++++++ .../slack_bolt/listener/asyncio_runner.html | 34 +- docs/api-docs/slack_bolt/listener/index.html | 10 + .../listener/listener_completion_handler.html | 8 +- .../listener/listener_start_handler.html | 291 ++++++++++++++++++ .../slack_bolt/listener/thread_runner.html | 38 ++- docs/api-docs/slack_bolt/version.html | 2 +- slack_bolt/version.py | 2 +- 12 files changed, 794 insertions(+), 39 deletions(-) create mode 100644 docs/api-docs/slack_bolt/listener/async_listener_start_handler.html create mode 100644 docs/api-docs/slack_bolt/listener/listener_start_handler.html diff --git a/docs/api-docs/slack_bolt/adapter/django/handler.html b/docs/api-docs/slack_bolt/adapter/django/handler.html index 24e8cdf4b..1b47e3e35 100644 --- a/docs/api-docs/slack_bolt/adapter/django/handler.html +++ b/docs/api-docs/slack_bolt/adapter/django/handler.html @@ -37,6 +37,10 @@

    Module slack_bolt.adapter.django.handler

    from slack_bolt.error import BoltError from slack_bolt.lazy_listener import ThreadLazyListenerRunner from slack_bolt.lazy_listener.internals import build_runnable_function +from slack_bolt.listener.listener_start_handler import ( + ListenerStartHandler, + DefaultListenerStartHandler, +) from slack_bolt.listener.listener_completion_handler import ( ListenerCompletionHandler, DefaultListenerCompletionHandler, @@ -82,18 +86,29 @@

    Module slack_bolt.adapter.django.handler

    return resp -from django.db import connections +from django.db import close_old_connections -def release_thread_local_connections(logger: Logger, execution_type: str): - connections.close_all() +def release_thread_local_connections(logger: Logger, execution_timing: str): + close_old_connections() if logger.level <= logging.DEBUG: current: Thread = current_thread() logger.debug( - f"Released thread-bound DB connections (thread name: {current.name}, execution type: {execution_type})" + "Released thread-bound old DB connections " + f"(thread name: {current.name}, execution timing: {execution_timing})" ) +class DjangoListenerStartHandler(ListenerStartHandler): + """Django sets DB connections as a thread-local variable per thread. + If the thread is not managed on the Django app side, the connections won't be released by Django. + This handler releases the connections every time a ThreadListenerRunner execution completes. + """ + + def handle(self, request: BoltRequest, response: Optional[BoltResponse]) -> None: + release_thread_local_connections(request.context.logger, "listener-start") + + class DjangoListenerCompletionHandler(ListenerCompletionHandler): """Django sets DB connections as a thread-local variable per thread. If the thread is not managed on the Django app side, the connections won't be released by Django. @@ -101,7 +116,7 @@

    Module slack_bolt.adapter.django.handler

    """ def handle(self, request: BoltRequest, response: Optional[BoltResponse]) -> None: - release_thread_local_connections(request.context.logger, "listener") + release_thread_local_connections(request.context.logger, "listener-completion") class DjangoThreadLazyListenerRunner(ThreadLazyListenerRunner): @@ -113,11 +128,14 @@

    Module slack_bolt.adapter.django.handler

    ) def wrapped_func(): + release_thread_local_connections( + request.context.logger, "before-lazy-listener" + ) try: func() finally: release_thread_local_connections( - request.context.logger, "lazy-listener" + request.context.logger, "lazy-listener-completion" ) self.executor.submit(wrapped_func) @@ -144,18 +162,39 @@

    Module slack_bolt.adapter.django.handler

    self.app.logger.debug("App.process_before_response is set to True") return + current_start_handler = listener_runner.listener_start_handler + if current_start_handler is not None and not isinstance( + current_start_handler, DefaultListenerStartHandler + ): + # As we run release_thread_local_connections() before listener executions, + # it's okay to skip calling the same connection clean-up method at the listener completion. + message = """As you've already set app.listener_runner.listener_start_handler to your own one, + Bolt skipped to set it to slack_sdk.adapter.django.DjangoListenerStartHandler. + + If you go with your own handler here, we highly recommend having the following lines of code + in your handle() method to clean up unmanaged stale/old database connections: + + from django.db import close_old_connections + close_old_connections() + """ + self.app.logger.info(message) + else: + # for proper management of thread-local Django DB connections + self.app.listener_runner.listener_start_handler = ( + DjangoListenerStartHandler() + ) + self.app.logger.debug("DjangoListenerStartHandler has been enabled") + current_completion_handler = listener_runner.listener_completion_handler if current_completion_handler is not None and not isinstance( current_completion_handler, DefaultListenerCompletionHandler ): + # As we run release_thread_local_connections() before listener executions, + # it's okay to skip calling the same connection clean-up method at the listener completion. message = """As you've already set app.listener_runner.listener_completion_handler to your own one, Bolt skipped to set it to slack_sdk.adapter.django.DjangoListenerCompletionHandler. - We strongly recommend having the following lines of code in your listener_completion_handler: - - from django.db import connections - connections.close_all() """ - self.app.logger.warning(message) + self.app.logger.info(message) return # for proper management of thread-local Django DB connections self.app.listener_runner.listener_completion_handler = ( @@ -188,7 +227,7 @@

    Module slack_bolt.adapter.django.handler

    Functions

    -def release_thread_local_connections(logger: logging.Logger, execution_type: str) +def release_thread_local_connections(logger: logging.Logger, execution_timing: str)
    @@ -196,12 +235,13 @@

    Functions

    Expand source code -
    def release_thread_local_connections(logger: Logger, execution_type: str):
    -    connections.close_all()
    +
    def release_thread_local_connections(logger: Logger, execution_timing: str):
    +    close_old_connections()
         if logger.level <= logging.DEBUG:
             current: Thread = current_thread()
             logger.debug(
    -            f"Released thread-bound DB connections (thread name: {current.name}, execution type: {execution_type})"
    +            "Released thread-bound old DB connections "
    +            f"(thread name: {current.name}, execution timing: {execution_timing})"
             )
    @@ -281,7 +321,7 @@

    Classes

    """ def handle(self, request: BoltRequest, response: Optional[BoltResponse]) -> None: - release_thread_local_connections(request.context.logger, "listener")
    + release_thread_local_connections(request.context.logger, "listener-completion")

    Ancestors

      @@ -296,6 +336,39 @@

      Inherited members

    +
    +class DjangoListenerStartHandler +
    +
    +

    Django sets DB connections as a thread-local variable per thread. +If the thread is not managed on the Django app side, the connections won't be released by Django. +This handler releases the connections every time a ThreadListenerRunner execution completes.

    +
    + +Expand source code + +
    class DjangoListenerStartHandler(ListenerStartHandler):
    +    """Django sets DB connections as a thread-local variable per thread.
    +    If the thread is not managed on the Django app side, the connections won't be released by Django.
    +    This handler releases the connections every time a ThreadListenerRunner execution completes.
    +    """
    +
    +    def handle(self, request: BoltRequest, response: Optional[BoltResponse]) -> None:
    +        release_thread_local_connections(request.context.logger, "listener-start")
    +
    +

    Ancestors

    + +

    Inherited members

    + +
    class DjangoThreadLazyListenerRunner (logger: logging.Logger, executor: concurrent.futures._base.Executor) @@ -315,11 +388,14 @@

    Inherited members

    ) def wrapped_func(): + release_thread_local_connections( + request.context.logger, "before-lazy-listener" + ) try: func() finally: release_thread_local_connections( - request.context.logger, "lazy-listener" + request.context.logger, "lazy-listener-completion" ) self.executor.submit(wrapped_func)
    @@ -377,18 +453,39 @@

    Inherited members

    self.app.logger.debug("App.process_before_response is set to True") return + current_start_handler = listener_runner.listener_start_handler + if current_start_handler is not None and not isinstance( + current_start_handler, DefaultListenerStartHandler + ): + # As we run release_thread_local_connections() before listener executions, + # it's okay to skip calling the same connection clean-up method at the listener completion. + message = """As you've already set app.listener_runner.listener_start_handler to your own one, + Bolt skipped to set it to slack_sdk.adapter.django.DjangoListenerStartHandler. + + If you go with your own handler here, we highly recommend having the following lines of code + in your handle() method to clean up unmanaged stale/old database connections: + + from django.db import close_old_connections + close_old_connections() + """ + self.app.logger.info(message) + else: + # for proper management of thread-local Django DB connections + self.app.listener_runner.listener_start_handler = ( + DjangoListenerStartHandler() + ) + self.app.logger.debug("DjangoListenerStartHandler has been enabled") + current_completion_handler = listener_runner.listener_completion_handler if current_completion_handler is not None and not isinstance( current_completion_handler, DefaultListenerCompletionHandler ): + # As we run release_thread_local_connections() before listener executions, + # it's okay to skip calling the same connection clean-up method at the listener completion. message = """As you've already set app.listener_runner.listener_completion_handler to your own one, Bolt skipped to set it to slack_sdk.adapter.django.DjangoListenerCompletionHandler. - We strongly recommend having the following lines of code in your listener_completion_handler: - - from django.db import connections - connections.close_all() """ - self.app.logger.warning(message) + self.app.logger.info(message) return # for proper management of thread-local Django DB connections self.app.listener_runner.listener_completion_handler = ( @@ -469,6 +566,9 @@

    Index

    DjangoListenerCompletionHandler

  • +

    DjangoListenerStartHandler

    +
  • +
  • DjangoThreadLazyListenerRunner

    • logger
    • diff --git a/docs/api-docs/slack_bolt/app/app.html b/docs/api-docs/slack_bolt/app/app.html index 70faf2c9d..35b39c817 100644 --- a/docs/api-docs/slack_bolt/app/app.html +++ b/docs/api-docs/slack_bolt/app/app.html @@ -51,6 +51,7 @@

      Module slack_bolt.app.app

      from slack_bolt.listener.builtins import TokenRevocationListeners from slack_bolt.listener.custom_listener import CustomListener from slack_bolt.listener.listener import Listener +from slack_bolt.listener.listener_start_handler import DefaultListenerStartHandler from slack_bolt.listener.listener_completion_handler import ( DefaultListenerCompletionHandler, ) @@ -345,6 +346,9 @@

      Module slack_bolt.app.app

      listener_error_handler=DefaultListenerErrorHandler( logger=self._framework_logger ), + listener_start_handler=DefaultListenerStartHandler( + logger=self._framework_logger + ), listener_completion_handler=DefaultListenerCompletionHandler( logger=self._framework_logger ), @@ -1807,6 +1811,9 @@

      Args

      listener_error_handler=DefaultListenerErrorHandler( logger=self._framework_logger ), + listener_start_handler=DefaultListenerStartHandler( + logger=self._framework_logger + ), listener_completion_handler=DefaultListenerCompletionHandler( logger=self._framework_logger ), diff --git a/docs/api-docs/slack_bolt/app/async_app.html b/docs/api-docs/slack_bolt/app/async_app.html index 0296dd263..2eb4079e2 100644 --- a/docs/api-docs/slack_bolt/app/async_app.html +++ b/docs/api-docs/slack_bolt/app/async_app.html @@ -36,6 +36,9 @@

      Module slack_bolt.app.async_app

      from slack_bolt.app.async_server import AsyncSlackAppServer from slack_bolt.listener.async_builtins import AsyncTokenRevocationListeners +from slack_bolt.listener.async_listener_start_handler import ( + AsyncDefaultListenerStartHandler, +) from slack_bolt.listener.async_listener_completion_handler import ( AsyncDefaultListenerCompletionHandler, ) @@ -365,6 +368,9 @@

      Module slack_bolt.app.async_app

      listener_error_handler=AsyncDefaultListenerErrorHandler( logger=self._framework_logger ), + listener_start_handler=AsyncDefaultListenerStartHandler( + logger=self._framework_logger + ), listener_completion_handler=AsyncDefaultListenerCompletionHandler( logger=self._framework_logger ), @@ -1753,6 +1759,9 @@

      Args

      listener_error_handler=AsyncDefaultListenerErrorHandler( logger=self._framework_logger ), + listener_start_handler=AsyncDefaultListenerStartHandler( + logger=self._framework_logger + ), listener_completion_handler=AsyncDefaultListenerCompletionHandler( logger=self._framework_logger ), diff --git a/docs/api-docs/slack_bolt/listener/async_listener_completion_handler.html b/docs/api-docs/slack_bolt/listener/async_listener_completion_handler.html index e123987db..0abf440e0 100644 --- a/docs/api-docs/slack_bolt/listener/async_listener_completion_handler.html +++ b/docs/api-docs/slack_bolt/listener/async_listener_completion_handler.html @@ -43,10 +43,9 @@

      Module slack_bolt.listener.async_listener_completion_han request: AsyncBoltRequest, response: Optional[BoltResponse], ) -> None: - """Handles an unhandled exception. + """Do something extra after the listener execution Args: - error: The raised exception. request: The request. response: The response. """ @@ -188,10 +187,9 @@

      Inherited members

      request: AsyncBoltRequest, response: Optional[BoltResponse], ) -> None: - """Handles an unhandled exception. + """Do something extra after the listener execution Args: - error: The raised exception. request: The request. response: The response. """ @@ -208,11 +206,9 @@

      Methods

      async def handle(self, request: AsyncBoltRequest, response: Optional[BoltResponse]) ‑> None

  • -

    Handles an unhandled exception.

    +

    Do something extra after the listener execution

    Args

    -
    error
    -
    The raised exception.
    request
    The request.
    response
    @@ -228,10 +224,9 @@

    Args

    request: AsyncBoltRequest, response: Optional[BoltResponse], ) -> None: - """Handles an unhandled exception. + """Do something extra after the listener execution Args: - error: The raised exception. request: The request. response: The response. """ diff --git a/docs/api-docs/slack_bolt/listener/async_listener_start_handler.html b/docs/api-docs/slack_bolt/listener/async_listener_start_handler.html new file mode 100644 index 000000000..5e324498c --- /dev/null +++ b/docs/api-docs/slack_bolt/listener/async_listener_start_handler.html @@ -0,0 +1,275 @@ + + + + + + +slack_bolt.listener.async_listener_start_handler API documentation + + + + + + + + + + + +
    +
    +
    +

    Module slack_bolt.listener.async_listener_start_handler

    +
    +
    +
    + +Expand source code + +
    import inspect
    +from abc import ABCMeta, abstractmethod
    +from logging import Logger
    +from typing import Callable, Dict, Any, Awaitable, Optional
    +
    +from slack_bolt.kwargs_injection.async_utils import build_async_required_kwargs
    +from slack_bolt.request.async_request import AsyncBoltRequest
    +from slack_bolt.response import BoltResponse
    +
    +
    +class AsyncListenerStartHandler(metaclass=ABCMeta):
    +    @abstractmethod
    +    async def handle(
    +        self,
    +        request: AsyncBoltRequest,
    +        response: Optional[BoltResponse],
    +    ) -> None:
    +        """Do something extra before the listener execution
    +
    +        Args:
    +            request: The request.
    +            response: The response.
    +        """
    +        raise NotImplementedError()
    +
    +
    +class AsyncCustomListenerStartHandler(AsyncListenerStartHandler):
    +    def __init__(self, logger: Logger, func: Callable[..., Awaitable[None]]):
    +        self.func = func
    +        self.logger = logger
    +        self.arg_names = inspect.getfullargspec(func).args
    +
    +    async def handle(
    +        self,
    +        request: AsyncBoltRequest,
    +        response: Optional[BoltResponse],
    +    ) -> None:
    +        kwargs: Dict[str, Any] = build_async_required_kwargs(
    +            required_arg_names=self.arg_names,
    +            logger=self.logger,
    +            request=request,
    +            response=response,
    +            next_keys_required=False,
    +        )
    +        await self.func(**kwargs)
    +
    +
    +class AsyncDefaultListenerStartHandler(AsyncListenerStartHandler):
    +    def __init__(self, logger: Logger):
    +        self.logger = logger
    +
    +    async def handle(
    +        self,
    +        request: AsyncBoltRequest,
    +        response: Optional[BoltResponse],
    +    ):
    +        pass
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Classes

    +
    +
    +class AsyncCustomListenerStartHandler +(logger: logging.Logger, func: Callable[..., Awaitable[None]]) +
    +
    +
    +
    + +Expand source code + +
    class AsyncCustomListenerStartHandler(AsyncListenerStartHandler):
    +    def __init__(self, logger: Logger, func: Callable[..., Awaitable[None]]):
    +        self.func = func
    +        self.logger = logger
    +        self.arg_names = inspect.getfullargspec(func).args
    +
    +    async def handle(
    +        self,
    +        request: AsyncBoltRequest,
    +        response: Optional[BoltResponse],
    +    ) -> None:
    +        kwargs: Dict[str, Any] = build_async_required_kwargs(
    +            required_arg_names=self.arg_names,
    +            logger=self.logger,
    +            request=request,
    +            response=response,
    +            next_keys_required=False,
    +        )
    +        await self.func(**kwargs)
    +
    +

    Ancestors

    + +

    Inherited members

    + +
    +
    +class AsyncDefaultListenerStartHandler +(logger: logging.Logger) +
    +
    +
    +
    + +Expand source code + +
    class AsyncDefaultListenerStartHandler(AsyncListenerStartHandler):
    +    def __init__(self, logger: Logger):
    +        self.logger = logger
    +
    +    async def handle(
    +        self,
    +        request: AsyncBoltRequest,
    +        response: Optional[BoltResponse],
    +    ):
    +        pass
    +
    +

    Ancestors

    + +

    Inherited members

    + +
    +
    +class AsyncListenerStartHandler +
    +
    +
    +
    + +Expand source code + +
    class AsyncListenerStartHandler(metaclass=ABCMeta):
    +    @abstractmethod
    +    async def handle(
    +        self,
    +        request: AsyncBoltRequest,
    +        response: Optional[BoltResponse],
    +    ) -> None:
    +        """Do something extra before the listener execution
    +
    +        Args:
    +            request: The request.
    +            response: The response.
    +        """
    +        raise NotImplementedError()
    +
    +

    Subclasses

    + +

    Methods

    +
    +
    +async def handle(self, request: AsyncBoltRequest, response: Optional[BoltResponse]) ‑> None +
    +
    +

    Do something extra before the listener execution

    +

    Args

    +
    +
    request
    +
    The request.
    +
    response
    +
    The response.
    +
    +
    + +Expand source code + +
    @abstractmethod
    +async def handle(
    +    self,
    +    request: AsyncBoltRequest,
    +    response: Optional[BoltResponse],
    +) -> None:
    +    """Do something extra before the listener execution
    +
    +    Args:
    +        request: The request.
    +        response: The response.
    +    """
    +    raise NotImplementedError()
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/asyncio_runner.html b/docs/api-docs/slack_bolt/listener/asyncio_runner.html index 55b1969fa..7dc21f332 100644 --- a/docs/api-docs/slack_bolt/listener/asyncio_runner.html +++ b/docs/api-docs/slack_bolt/listener/asyncio_runner.html @@ -35,6 +35,9 @@

    Module slack_bolt.listener.asyncio_runner

    from slack_bolt.context.ack.async_ack import AsyncAck from slack_bolt.lazy_listener.async_runner import AsyncLazyListenerRunner from slack_bolt.listener.async_listener import AsyncListener +from slack_bolt.listener.async_listener_start_handler import ( + AsyncListenerStartHandler, +) from slack_bolt.listener.async_listener_completion_handler import ( AsyncListenerCompletionHandler, ) @@ -53,6 +56,7 @@

    Module slack_bolt.listener.asyncio_runner

    logger: Logger process_before_response: bool listener_error_handler: AsyncListenerErrorHandler + listener_start_handler: AsyncListenerStartHandler listener_completion_handler: AsyncListenerCompletionHandler lazy_listener_runner: AsyncLazyListenerRunner @@ -61,12 +65,14 @@

    Module slack_bolt.listener.asyncio_runner

    logger: Logger, process_before_response: bool, listener_error_handler: AsyncListenerErrorHandler, + listener_start_handler: AsyncListenerStartHandler, listener_completion_handler: AsyncListenerCompletionHandler, lazy_listener_runner: AsyncLazyListenerRunner, ): self.logger = logger self.process_before_response = process_before_response self.listener_error_handler = listener_error_handler + self.listener_start_handler = listener_start_handler self.listener_completion_handler = listener_completion_handler self.lazy_listener_runner = lazy_listener_runner @@ -83,6 +89,9 @@

    Module slack_bolt.listener.asyncio_runner

    if self.process_before_response: if not request.lazy_only: try: + await self.listener_start_handler.handle( + request=request, response=response + ) returned_value = await listener.run_ack_function( request=request, response=response ) @@ -141,6 +150,9 @@

    Module slack_bolt.listener.asyncio_runner

    response: BoltResponse, ): try: + await self.listener_start_handler.handle( + request=request, response=response + ) await listener.run_ack_function( request=request, response=response ) @@ -238,7 +250,7 @@

    Classes

    class AsyncioListenerRunner -(logger: logging.Logger, process_before_response: bool, listener_error_handler: AsyncListenerErrorHandler, listener_completion_handler: AsyncListenerCompletionHandler, lazy_listener_runner: AsyncLazyListenerRunner) +(logger: logging.Logger, process_before_response: bool, listener_error_handler: AsyncListenerErrorHandler, listener_start_handler: AsyncListenerStartHandler, listener_completion_handler: AsyncListenerCompletionHandler, lazy_listener_runner: AsyncLazyListenerRunner)
    @@ -250,6 +262,7 @@

    Classes

    logger: Logger process_before_response: bool listener_error_handler: AsyncListenerErrorHandler + listener_start_handler: AsyncListenerStartHandler listener_completion_handler: AsyncListenerCompletionHandler lazy_listener_runner: AsyncLazyListenerRunner @@ -258,12 +271,14 @@

    Classes

    logger: Logger, process_before_response: bool, listener_error_handler: AsyncListenerErrorHandler, + listener_start_handler: AsyncListenerStartHandler, listener_completion_handler: AsyncListenerCompletionHandler, lazy_listener_runner: AsyncLazyListenerRunner, ): self.logger = logger self.process_before_response = process_before_response self.listener_error_handler = listener_error_handler + self.listener_start_handler = listener_start_handler self.listener_completion_handler = listener_completion_handler self.lazy_listener_runner = lazy_listener_runner @@ -280,6 +295,9 @@

    Classes

    if self.process_before_response: if not request.lazy_only: try: + await self.listener_start_handler.handle( + request=request, response=response + ) returned_value = await listener.run_ack_function( request=request, response=response ) @@ -338,6 +356,9 @@

    Classes

    response: BoltResponse, ): try: + await self.listener_start_handler.handle( + request=request, response=response + ) await listener.run_ack_function( request=request, response=response ) @@ -437,6 +458,10 @@

    Class variables

    +
    var listener_start_handlerAsyncListenerStartHandler
    +
    +
    +
    var logger : logging.Logger
    @@ -470,6 +495,9 @@

    Methods

    if self.process_before_response: if not request.lazy_only: try: + await self.listener_start_handler.handle( + request=request, response=response + ) returned_value = await listener.run_ack_function( request=request, response=response ) @@ -528,6 +556,9 @@

    Methods

    response: BoltResponse, ): try: + await self.listener_start_handler.handle( + request=request, response=response + ) await listener.run_ack_function( request=request, response=response ) @@ -613,6 +644,7 @@

    lazy_listener_runner
  • listener_completion_handler
  • listener_error_handler
  • +
  • listener_start_handler
  • logger
  • process_before_response
  • run
  • diff --git a/docs/api-docs/slack_bolt/listener/index.html b/docs/api-docs/slack_bolt/listener/index.html index f0deb9b00..3b9a557ff 100644 --- a/docs/api-docs/slack_bolt/listener/index.html +++ b/docs/api-docs/slack_bolt/listener/index.html @@ -65,6 +65,10 @@

    Sub-modules

    +
    slack_bolt.listener.async_listener_start_handler
    +
    +
    +
    slack_bolt.listener.asyncio_runner
    @@ -89,6 +93,10 @@

    Sub-modules

    +
    slack_bolt.listener.listener_start_handler
    +
    +
    +
    slack_bolt.listener.thread_runner
    @@ -119,12 +127,14 @@

    Index

  • slack_bolt.listener.async_listener
  • slack_bolt.listener.async_listener_completion_handler
  • slack_bolt.listener.async_listener_error_handler
  • +
  • slack_bolt.listener.async_listener_start_handler
  • slack_bolt.listener.asyncio_runner
  • slack_bolt.listener.builtins
  • slack_bolt.listener.custom_listener
  • slack_bolt.listener.listener
  • slack_bolt.listener.listener_completion_handler
  • slack_bolt.listener.listener_error_handler
  • +
  • slack_bolt.listener.listener_start_handler
  • slack_bolt.listener.thread_runner
  • diff --git a/docs/api-docs/slack_bolt/listener/listener_completion_handler.html b/docs/api-docs/slack_bolt/listener/listener_completion_handler.html index f5269d4e3..c24fd0f90 100644 --- a/docs/api-docs/slack_bolt/listener/listener_completion_handler.html +++ b/docs/api-docs/slack_bolt/listener/listener_completion_handler.html @@ -43,7 +43,7 @@

    Module slack_bolt.listener.listener_completion_handlerInherited members

    request: BoltRequest, response: Optional[BoltResponse], ) -> None: - """Handles an unhandled exception. + """Do something extra after the listener execution Args: request: The request. @@ -207,7 +207,7 @@

    Methods

    def handle(self, request: BoltRequest, response: Optional[BoltResponse]) ‑> None
    -

    Handles an unhandled exception.

    +

    Do something extra after the listener execution

    Args

    request
    @@ -225,7 +225,7 @@

    Args

    request: BoltRequest, response: Optional[BoltResponse], ) -> None: - """Handles an unhandled exception. + """Do something extra after the listener execution Args: request: The request. diff --git a/docs/api-docs/slack_bolt/listener/listener_start_handler.html b/docs/api-docs/slack_bolt/listener/listener_start_handler.html new file mode 100644 index 000000000..b2371ae67 --- /dev/null +++ b/docs/api-docs/slack_bolt/listener/listener_start_handler.html @@ -0,0 +1,291 @@ + + + + + + +slack_bolt.listener.listener_start_handler API documentation + + + + + + + + + + + +
    +
    +
    +

    Module slack_bolt.listener.listener_start_handler

    +
    +
    +
    + +Expand source code + +
    import inspect
    +from abc import ABCMeta, abstractmethod
    +from logging import Logger
    +from typing import Callable, Dict, Any, Optional
    +
    +from slack_bolt.kwargs_injection import build_required_kwargs
    +from slack_bolt.request.request import BoltRequest
    +from slack_bolt.response.response import BoltResponse
    +
    +
    +class ListenerStartHandler(metaclass=ABCMeta):
    +    @abstractmethod
    +    def handle(
    +        self,
    +        request: BoltRequest,
    +        response: Optional[BoltResponse],
    +    ) -> None:
    +        """Do something extra before the listener execution.
    +
    +        This handler is useful if a developer needs to maintain/clean up
    +        thread-local resources such as Django ORM database connections
    +        before a listener execution starts.
    +
    +        Args:
    +            request: The request.
    +            response: The response.
    +        """
    +        raise NotImplementedError()
    +
    +
    +class CustomListenerStartHandler(ListenerStartHandler):
    +    def __init__(self, logger: Logger, func: Callable[..., None]):
    +        self.func = func
    +        self.logger = logger
    +        self.arg_names = inspect.getfullargspec(func).args
    +
    +    def handle(
    +        self,
    +        request: BoltRequest,
    +        response: Optional[BoltResponse],
    +    ):
    +        kwargs: Dict[str, Any] = build_required_kwargs(
    +            required_arg_names=self.arg_names,
    +            logger=self.logger,
    +            request=request,
    +            response=response,
    +            next_keys_required=False,
    +        )
    +        self.func(**kwargs)
    +
    +
    +class DefaultListenerStartHandler(ListenerStartHandler):
    +    def __init__(self, logger: Logger):
    +        self.logger = logger
    +
    +    def handle(
    +        self,
    +        request: BoltRequest,
    +        response: Optional[BoltResponse],
    +    ):
    +        pass
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Classes

    +
    +
    +class CustomListenerStartHandler +(logger: logging.Logger, func: Callable[..., None]) +
    +
    +
    +
    + +Expand source code + +
    class CustomListenerStartHandler(ListenerStartHandler):
    +    def __init__(self, logger: Logger, func: Callable[..., None]):
    +        self.func = func
    +        self.logger = logger
    +        self.arg_names = inspect.getfullargspec(func).args
    +
    +    def handle(
    +        self,
    +        request: BoltRequest,
    +        response: Optional[BoltResponse],
    +    ):
    +        kwargs: Dict[str, Any] = build_required_kwargs(
    +            required_arg_names=self.arg_names,
    +            logger=self.logger,
    +            request=request,
    +            response=response,
    +            next_keys_required=False,
    +        )
    +        self.func(**kwargs)
    +
    +

    Ancestors

    + +

    Inherited members

    + +
    +
    +class DefaultListenerStartHandler +(logger: logging.Logger) +
    +
    +
    +
    + +Expand source code + +
    class DefaultListenerStartHandler(ListenerStartHandler):
    +    def __init__(self, logger: Logger):
    +        self.logger = logger
    +
    +    def handle(
    +        self,
    +        request: BoltRequest,
    +        response: Optional[BoltResponse],
    +    ):
    +        pass
    +
    +

    Ancestors

    + +

    Inherited members

    + +
    +
    +class ListenerStartHandler +
    +
    +
    +
    + +Expand source code + +
    class ListenerStartHandler(metaclass=ABCMeta):
    +    @abstractmethod
    +    def handle(
    +        self,
    +        request: BoltRequest,
    +        response: Optional[BoltResponse],
    +    ) -> None:
    +        """Do something extra before the listener execution.
    +
    +        This handler is useful if a developer needs to maintain/clean up
    +        thread-local resources such as Django ORM database connections
    +        before a listener execution starts.
    +
    +        Args:
    +            request: The request.
    +            response: The response.
    +        """
    +        raise NotImplementedError()
    +
    +

    Subclasses

    + +

    Methods

    +
    +
    +def handle(self, request: BoltRequest, response: Optional[BoltResponse]) ‑> None +
    +
    +

    Do something extra before the listener execution.

    +

    This handler is useful if a developer needs to maintain/clean up +thread-local resources such as Django ORM database connections +before a listener execution starts.

    +

    Args

    +
    +
    request
    +
    The request.
    +
    response
    +
    The response.
    +
    +
    + +Expand source code + +
    @abstractmethod
    +def handle(
    +    self,
    +    request: BoltRequest,
    +    response: Optional[BoltResponse],
    +) -> None:
    +    """Do something extra before the listener execution.
    +
    +    This handler is useful if a developer needs to maintain/clean up
    +    thread-local resources such as Django ORM database connections
    +    before a listener execution starts.
    +
    +    Args:
    +        request: The request.
    +        response: The response.
    +    """
    +    raise NotImplementedError()
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/listener/thread_runner.html b/docs/api-docs/slack_bolt/listener/thread_runner.html index 0105a89f7..43c7da783 100644 --- a/docs/api-docs/slack_bolt/listener/thread_runner.html +++ b/docs/api-docs/slack_bolt/listener/thread_runner.html @@ -33,6 +33,7 @@

    Module slack_bolt.listener.thread_runner

    from slack_bolt.lazy_listener import LazyListenerRunner from slack_bolt.listener import Listener +from slack_bolt.listener.listener_start_handler import ListenerStartHandler from slack_bolt.listener.listener_completion_handler import ListenerCompletionHandler from slack_bolt.listener.listener_error_handler import ListenerErrorHandler from slack_bolt.logger.messages import ( @@ -49,6 +50,7 @@

    Module slack_bolt.listener.thread_runner

    logger: Logger process_before_response: bool listener_error_handler: ListenerErrorHandler + listener_start_handler: ListenerStartHandler listener_completion_handler: ListenerCompletionHandler listener_executor: Executor lazy_listener_runner: LazyListenerRunner @@ -58,6 +60,7 @@

    Module slack_bolt.listener.thread_runner

    logger: Logger, process_before_response: bool, listener_error_handler: ListenerErrorHandler, + listener_start_handler: ListenerStartHandler, listener_completion_handler: ListenerCompletionHandler, listener_executor: Executor, lazy_listener_runner: LazyListenerRunner, @@ -65,6 +68,7 @@

    Module slack_bolt.listener.thread_runner

    self.logger = logger self.process_before_response = process_before_response self.listener_error_handler = listener_error_handler + self.listener_start_handler = listener_start_handler self.listener_completion_handler = listener_completion_handler self.listener_executor = listener_executor self.lazy_listener_runner = lazy_listener_runner @@ -82,6 +86,10 @@

    Module slack_bolt.listener.thread_runner

    if self.process_before_response: if not request.lazy_only: try: + self.listener_start_handler.handle( + request=request, + response=response, + ) returned_value = listener.run_ack_function( request=request, response=response ) @@ -137,6 +145,10 @@

    Module slack_bolt.listener.thread_runner

    def run_ack_function_asynchronously(): nonlocal ack, request, response try: + self.listener_start_handler.handle( + request=request, + response=response, + ) listener.run_ack_function(request=request, response=response) except Exception as e: # The default response status code is 500 in this case. @@ -235,7 +247,7 @@

    Classes

    class ThreadListenerRunner -(logger: logging.Logger, process_before_response: bool, listener_error_handler: ListenerErrorHandler, listener_completion_handler: ListenerCompletionHandler, listener_executor: concurrent.futures._base.Executor, lazy_listener_runner: LazyListenerRunner) +(logger: logging.Logger, process_before_response: bool, listener_error_handler: ListenerErrorHandler, listener_start_handler: ListenerStartHandler, listener_completion_handler: ListenerCompletionHandler, listener_executor: concurrent.futures._base.Executor, lazy_listener_runner: LazyListenerRunner)
    @@ -247,6 +259,7 @@

    Classes

    logger: Logger process_before_response: bool listener_error_handler: ListenerErrorHandler + listener_start_handler: ListenerStartHandler listener_completion_handler: ListenerCompletionHandler listener_executor: Executor lazy_listener_runner: LazyListenerRunner @@ -256,6 +269,7 @@

    Classes

    logger: Logger, process_before_response: bool, listener_error_handler: ListenerErrorHandler, + listener_start_handler: ListenerStartHandler, listener_completion_handler: ListenerCompletionHandler, listener_executor: Executor, lazy_listener_runner: LazyListenerRunner, @@ -263,6 +277,7 @@

    Classes

    self.logger = logger self.process_before_response = process_before_response self.listener_error_handler = listener_error_handler + self.listener_start_handler = listener_start_handler self.listener_completion_handler = listener_completion_handler self.listener_executor = listener_executor self.lazy_listener_runner = lazy_listener_runner @@ -280,6 +295,10 @@

    Classes

    if self.process_before_response: if not request.lazy_only: try: + self.listener_start_handler.handle( + request=request, + response=response, + ) returned_value = listener.run_ack_function( request=request, response=response ) @@ -335,6 +354,10 @@

    Classes

    def run_ack_function_asynchronously(): nonlocal ack, request, response try: + self.listener_start_handler.handle( + request=request, + response=response, + ) listener.run_ack_function(request=request, response=response) except Exception as e: # The default response status code is 500 in this case. @@ -439,6 +462,10 @@

    Class variables

    +
    var listener_start_handlerListenerStartHandler
    +
    +
    +
    var logger : logging.Logger
    @@ -472,6 +499,10 @@

    Methods

    if self.process_before_response: if not request.lazy_only: try: + self.listener_start_handler.handle( + request=request, + response=response, + ) returned_value = listener.run_ack_function( request=request, response=response ) @@ -527,6 +558,10 @@

    Methods

    def run_ack_function_asynchronously(): nonlocal ack, request, response try: + self.listener_start_handler.handle( + request=request, + response=response, + ) listener.run_ack_function(request=request, response=response) except Exception as e: # The default response status code is 500 in this case. @@ -616,6 +651,7 @@

    listener_completion_handler
  • listener_error_handler
  • listener_executor
  • +
  • listener_start_handler
  • logger
  • process_before_response
  • run
  • diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index dfb472789..816a33b11 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.9.4"
    +__version__ = "1.10.0"

    diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 0144027c3..0872b5816 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.10.0a" +__version__ = "1.10.0" From c4d60dccfddc1c491f04e881cc07d2e6403ad6e7 Mon Sep 17 00:00:00 2001 From: TORIFUKUKaiou Date: Mon, 8 Nov 2021 06:06:07 +0900 Subject: [PATCH 273/719] Signing Secret can be gotten from the Basic Information page (#518) (#519) --- docs/_tutorials/ja_getting_started_http.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_tutorials/ja_getting_started_http.md b/docs/_tutorials/ja_getting_started_http.md index 8d90c8921..13088add4 100644 --- a/docs/_tutorials/ja_getting_started_http.md +++ b/docs/_tutorials/ja_getting_started_http.md @@ -85,7 +85,7 @@ which python3 Bolt for Python のパッケージを新しいプロジェクトにインストールする前に、アプリの設定時に作成された **ボットトークン** と **署名シークレット** を保存しましょう。 -1. **OAuth & Permissions ページの署名シークレットをコピー**して、新しい環境変数に保存します。以下のコマンド例は Linux と macOS で利用できます。[Windows でもこれに似たコマンドが利用できます](https://superuser.com/questions/212150/how-to-set-env-variable-in-windows-cmd-line/212153#212153)。 +1. **Basic Information ページの署名シークレットをコピー**して、新しい環境変数に保存します。以下のコマンド例は Linux と macOS で利用できます。[Windows でもこれに似たコマンドが利用できます](https://superuser.com/questions/212150/how-to-set-env-variable-in-windows-cmd-line/212153#212153)。 ```shell export SLACK_SIGNING_SECRET= ``` From 1b5f4a15a679e47e4d343bd93eab6c62ea09ae47 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 12 Nov 2021 13:18:58 +0900 Subject: [PATCH 274/719] Fix a missing import in AWS Lambda code example --- examples/aws_lambda/lazy_aws_lambda.py | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/aws_lambda/lazy_aws_lambda.py b/examples/aws_lambda/lazy_aws_lambda.py index 82ef3ae98..dcc47498f 100644 --- a/examples/aws_lambda/lazy_aws_lambda.py +++ b/examples/aws_lambda/lazy_aws_lambda.py @@ -1,4 +1,5 @@ import logging +import time from slack_bolt import App from slack_bolt.adapter.aws_lambda import SlackRequestHandler From 068749aa06d77b6b1e575c0bf58da5980238219e Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 15 Nov 2021 18:29:32 +0900 Subject: [PATCH 275/719] Improve the Django app example to be more robust (#523) --- examples/django/oauth_app/slack_datastores.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/django/oauth_app/slack_datastores.py b/examples/django/oauth_app/slack_datastores.py index a18bb4899..5e226e8ad 100644 --- a/examples/django/oauth_app/slack_datastores.py +++ b/examples/django/oauth_app/slack_datastores.py @@ -33,9 +33,13 @@ def save(self, installation: Installation): i = installation.to_dict() if is_naive(i["installed_at"]): i["installed_at"] = make_aware(i["installed_at"]) - if "bot_token_expires_at" in i and is_naive(i["bot_token_expires_at"]): + if i.get("bot_token_expires_at") is not None and is_naive( + i["bot_token_expires_at"] + ): i["bot_token_expires_at"] = make_aware(i["bot_token_expires_at"]) - if "user_token_expires_at" in i and is_naive(i["user_token_expires_at"]): + if i.get("user_token_expires_at") is not None and is_naive( + i["user_token_expires_at"] + ): i["user_token_expires_at"] = make_aware(i["user_token_expires_at"]) i["client_id"] = self.client_id row_to_update = ( @@ -58,7 +62,7 @@ def save_bot(self, bot: Bot): b = bot.to_dict() if is_naive(b["installed_at"]): b["installed_at"] = make_aware(b["installed_at"]) - if "bot_token_expires_at" in b is not None and is_naive( + if b.get("bot_token_expires_at") is not None and is_naive( b["bot_token_expires_at"] ): b["bot_token_expires_at"] = make_aware(b["bot_token_expires_at"]) From 68ac4fe8c2d99ac3d765719ee3d0349cdd9f318d Mon Sep 17 00:00:00 2001 From: Sarah Jiang Date: Mon, 15 Nov 2021 20:59:11 -0800 Subject: [PATCH 276/719] Update lazy lambda docs (#524) * Clarify lazy listener description * Update acknowledging requests --- docs/_advanced/lazy_listener.md | 12 ++++++------ ...owledging_events.md => acknowledging_requests.md} | 7 ++++--- 2 files changed, 10 insertions(+), 9 deletions(-) rename docs/_basic/{acknowledging_events.md => acknowledging_requests.md} (52%) diff --git a/docs/_advanced/lazy_listener.md b/docs/_advanced/lazy_listener.md index 15f81a216..a7058085b 100644 --- a/docs/_advanced/lazy_listener.md +++ b/docs/_advanced/lazy_listener.md @@ -6,15 +6,15 @@ order: 10 ---
    -⚠️ Lazy listener functions are a beta feature to make it easier to deploy Bolt for Python apps to FaaS environments. As the feature is developed, Bolt for Python's API is subject to change. +Lazy Listeners are a feature which make it easier to deploy Slack apps to FaaS (Function-as-a-Service) environments. Please note that this feature is only available in Bolt for Python, and we are not planning to add the same to other Bolt frameworks. -Typically you'd call `ack()` as the first step of your listener functions. Calling `ack()` tells Slack that you've received the request and are handling it in within reasonable amount of time (3 seconds). +Typically when handling actions, commands, shortcuts, options and view submissions, you must acknowledge the request from Slack by calling `ack()` within 3 seconds. Calling `ack()` results in sending an HTTP 200 OK response to Slack, letting Slack know that you're handling the response. We normally encourage you to do this as the very first step in your handler function. -However, apps running on FaaS or similar runtimes that don't allow you to run threads or processes after returning an HTTP response cannot follow this pattern. Instead, you should set the `process_before_response` flag to `True`. This allows you to create a listener that calls `ack()` and handles the request safely, though you still need to complete everything within 3 seconds. For events, while a listener doesn't need `ack()` method call as you normally would, the listener needs to complete within 3 seconds, too. +However, when running your app on FaaS or similar runtimes which **do not allow you to run threads or processes after returning an HTTP response**, we cannot follow the typical pattern of acknowledgement first, processing later. To work with these runtimes, set the `process_before_response` flag to `True`. When this flag is true, the Bolt framework holds off sending an HTTP response until all the things in a listener function are done. You need to complete your processing within 3 seconds or you will run into errors with Slack timeouts. Note that in the case of events, while the listener doesn't need to explicitly call the `ack()` method, it still needs to complete its function within 3 seconds as well. -Lazy listeners can be a solution for this issue. Rather than acting as a decorator, lazy listeners take two keyword args: -* `ack: Callable`: Responsible for calling `ack()` -* `lazy: List[Callable]`: Responsible for handling any time-consuming processes related to the request. The lazy function does not have access to `ack()`. +To allow you to still run more time-consuming processes as part of your handler, we've added a lazy listener function mechanism. Rather than acting as a decorator, a lazy listener accepts two keyword args: +* `ack: Callable`: Responsible for calling `ack()` within 3 seconds +* `lazy: List[Callable]`: Responsible for handling time-consuming processes related to the request. The lazy function does not have access to `ack()`.
    ```python diff --git a/docs/_basic/acknowledging_events.md b/docs/_basic/acknowledging_requests.md similarity index 52% rename from docs/_basic/acknowledging_events.md rename to docs/_basic/acknowledging_requests.md index 67c767f21..2f3f6c466 100644 --- a/docs/_basic/acknowledging_events.md +++ b/docs/_basic/acknowledging_requests.md @@ -7,12 +7,13 @@ order: 7
    -Actions, commands, and options requests must **always** be acknowledged using the `ack()` function. This lets Slack know that the request was received and updates the Slack user interface accordingly. +Actions, commands, shortcuts, options requests, and view submissions must **always** be acknowledged using the `ack()` function. This lets Slack know that the request was received so that it may update the Slack user interface accordingly. -Depending on the type of request, your acknowledgement may be different. For example, when acknowledging a menu selection associated with an external data source, you would call `ack()` with a list of relevant [options](https://api.slack.com/reference/block-kit/composition-objects#option). +Depending on the type of request, your acknowledgement may be different. For example, when acknowledging a menu selection associated with an external data source, you would call `ack()` with a list of relevant [options](https://api.slack.com/reference/block-kit/composition-objects#option). When acknowledging a view submission, you may supply a `response_action` as part of your acknowledge to update the view. Please see the relevant sections of the docs for more detail on options for `ack()` these different requests. -We recommend calling `ack()` right away before sending a new message or fetching information from your database since you only have 3 seconds to respond. +We recommend calling `ack()` right away before initiating any time-consuming processes such as fetching information from your database or sending a new message, since you only have 3 seconds to respond before Slack registers a timeout error. +💡 When working in a FaaS / serverless environment, our guidelines for when to `ack()` are different. See the section on **Lazy listeners (FaaS)** for more detail on this.
    From 8cb660c77c6637808394eff541cf0da9c6f6d6b5 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 26 Nov 2021 12:07:41 +0900 Subject: [PATCH 277/719] Update code in docs to be more consistent --- docs/_advanced/adapters.md | 2 +- docs/_advanced/ja_adapters.md | 2 +- docs/_basic/authenticating_oauth.md | 2 +- docs/_basic/ja_authenticating_oauth.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/_advanced/adapters.md b/docs/_advanced/adapters.md index 5797d41e0..c811fadef 100644 --- a/docs/_advanced/adapters.md +++ b/docs/_advanced/adapters.md @@ -18,7 +18,7 @@ The full list adapters, as well as configuration and sample usage, can be found ```python from slack_bolt import App app = App( - signing_secret=os.environ.get("SIGNING_SECRET"), + signing_secret=os.environ.get("SLACK_SIGNING_SECRET"), token=os.environ.get("SLACK_BOT_TOKEN") ) diff --git a/docs/_advanced/ja_adapters.md b/docs/_advanced/ja_adapters.md index 54aa42eb7..cdd840288 100644 --- a/docs/_advanced/ja_adapters.md +++ b/docs/_advanced/ja_adapters.md @@ -18,7 +18,7 @@ order: 0 ```python from slack_bolt import App app = App( - signing_secret=os.environ.get("SIGNING_SECRET"), + signing_secret=os.environ.get("SLACK_SIGNING_SECRET"), token=os.environ.get("SLACK_BOT_TOKEN") ) diff --git a/docs/_basic/authenticating_oauth.md b/docs/_basic/authenticating_oauth.md index fa1db0873..67a0fe79e 100644 --- a/docs/_basic/authenticating_oauth.md +++ b/docs/_basic/authenticating_oauth.md @@ -35,7 +35,7 @@ oauth_settings = OAuthSettings( ) app = App( - signing_secret=os.environ["SIGNING_SECRET"], + signing_secret=os.environ["SLACK_SIGNING_SECRET"], oauth_settings=oauth_settings ) ``` diff --git a/docs/_basic/ja_authenticating_oauth.md b/docs/_basic/ja_authenticating_oauth.md index a10c87399..4ce955570 100644 --- a/docs/_basic/ja_authenticating_oauth.md +++ b/docs/_basic/ja_authenticating_oauth.md @@ -35,7 +35,7 @@ oauth_settings = OAuthSettings( ) app = App( - signing_secret=os.environ["SIGNING_SECRET"], + signing_secret=os.environ["SLACK_SIGNING_SECRET"], oauth_settings=oauth_settings ) ``` From a6bdd3f343313bb0745a7f84dbd4bf674f5ca55e Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 26 Nov 2021 12:33:29 +0900 Subject: [PATCH 278/719] Improve the OAuth code examples --- docs/_basic/authenticating_oauth.md | 8 ++++---- docs/_basic/ja_authenticating_oauth.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/_basic/authenticating_oauth.md b/docs/_basic/authenticating_oauth.md index 67a0fe79e..ab42beefc 100644 --- a/docs/_basic/authenticating_oauth.md +++ b/docs/_basic/authenticating_oauth.md @@ -30,8 +30,8 @@ oauth_settings = OAuthSettings( client_id=os.environ["SLACK_CLIENT_ID"], client_secret=os.environ["SLACK_CLIENT_SECRET"], scopes=["channels:read", "groups:read", "chat:write"], - installation_store=FileInstallationStore(base_dir="./data"), - state_store=FileOAuthStateStore(expiration_seconds=600, base_dir="./data") + installation_store=FileInstallationStore(base_dir="./data/installations"), + state_store=FileOAuthStateStore(expiration_seconds=600, base_dir="./data/states") ) app = App( @@ -85,7 +85,7 @@ from slack_sdk.oauth.state_store import FileOAuthStateStore app = App( signing_secret=os.environ.get("SLACK_SIGNING_SECRET"), - installation_store=FileInstallationStore(base_dir="./data"), + installation_store=FileInstallationStore(base_dir="./data/installations"), oauth_settings=OAuthSettings( client_id=os.environ.get("SLACK_CLIENT_ID"), client_secret=os.environ.get("SLACK_CLIENT_SECRET"), @@ -94,7 +94,7 @@ app = App( redirect_uri=None, install_path="/slack/install", redirect_uri_path="/slack/oauth_redirect", - state_store=FileOAuthStateStore(expiration_seconds=600, base_dir="./data"), + state_store=FileOAuthStateStore(expiration_seconds=600, base_dir="./data/states"), callback_options=callback_options, ), ) diff --git a/docs/_basic/ja_authenticating_oauth.md b/docs/_basic/ja_authenticating_oauth.md index 4ce955570..2aca09500 100644 --- a/docs/_basic/ja_authenticating_oauth.md +++ b/docs/_basic/ja_authenticating_oauth.md @@ -30,8 +30,8 @@ oauth_settings = OAuthSettings( client_id=os.environ["SLACK_CLIENT_ID"], client_secret=os.environ["SLACK_CLIENT_SECRET"], scopes=["channels:read", "groups:read", "chat:write"], - installation_store=FileInstallationStore(base_dir="./data"), - state_store=FileOAuthStateStore(expiration_seconds=600, base_dir="./data") + installation_store=FileInstallationStore(base_dir="./data/installations"), + state_store=FileOAuthStateStore(expiration_seconds=600, base_dir="./data/states") ) app = App( @@ -85,7 +85,7 @@ from slack_sdk.oauth.state_store import FileOAuthStateStore app = App( signing_secret=os.environ.get("SLACK_SIGNING_SECRET"), - installation_store=FileInstallationStore(base_dir="./data"), + installation_store=FileInstallationStore(base_dir="./data/installations"), oauth_settings=OAuthSettings( client_id=os.environ.get("SLACK_CLIENT_ID"), client_secret=os.environ.get("SLACK_CLIENT_SECRET"), @@ -94,7 +94,7 @@ app = App( redirect_uri=None, install_path="/slack/install", redirect_uri_path="/slack/oauth_redirect", - state_store=FileOAuthStateStore(expiration_seconds=600, base_dir="./data"), + state_store=FileOAuthStateStore(expiration_seconds=600, base_dir="./data/states"), callback_options=callback_options, ), ) From 0b8db0bfbc452c392c55b76de02abcfa1e314b69 Mon Sep 17 00:00:00 2001 From: Sarah Jiang Date: Mon, 29 Nov 2021 13:29:33 -0800 Subject: [PATCH 279/719] Add github acgtion (#528) --- .github/workflows/triage-issues.yml | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/triage-issues.yml diff --git a/.github/workflows/triage-issues.yml b/.github/workflows/triage-issues.yml new file mode 100644 index 000000000..8619c6e32 --- /dev/null +++ b/.github/workflows/triage-issues.yml @@ -0,0 +1,33 @@ +# This workflow uses the following github action to automate +# management of stale issues and prs in this repo: +# https://github.com/marketplace/actions/close-stale-issues + +name: Close stale issues and PRs + +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * 0' + +permissions: + issues: write + pull-requests: write + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v4.0.0 + with: + days-before-issue-stale: 30 + days-before-issue-close: 10 + days-before-pr-stale: -1 + days-before-pr-close: -1 + stale-issue-label: auto-triage-stale + stale-issue-message: 👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. + close-issue-message: As this issue has been inactive for more than one month, we will be closing it. Thank you to all the participants! If you would like to raise a related issue, please create a new issue which includes your specific details and references this issue number. + exempt-issue-labels: auto-triage-skip + exempt-all-milestones: true + remove-stale-when-updated: true + enable-statistics: true + operations-per-run: 60 \ No newline at end of file From f81ee5210f1060e85704879b27d3d0b3d74ed0e6 Mon Sep 17 00:00:00 2001 From: Sarah Jiang Date: Tue, 7 Dec 2021 03:40:43 -0800 Subject: [PATCH 280/719] Update (#536) --- .github/workflows/triage-issues.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/triage-issues.yml b/.github/workflows/triage-issues.yml index 8619c6e32..cf6864ab3 100644 --- a/.github/workflows/triage-issues.yml +++ b/.github/workflows/triage-issues.yml @@ -7,7 +7,7 @@ name: Close stale issues and PRs on: workflow_dispatch: schedule: - - cron: '0 0 * * 0' + - cron: '0 0 * * 1' permissions: issues: write @@ -24,7 +24,7 @@ jobs: days-before-pr-stale: -1 days-before-pr-close: -1 stale-issue-label: auto-triage-stale - stale-issue-message: 👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. + stale-issue-message: 👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized. close-issue-message: As this issue has been inactive for more than one month, we will be closing it. Thank you to all the participants! If you would like to raise a related issue, please create a new issue which includes your specific details and references this issue number. exempt-issue-labels: auto-triage-skip exempt-all-milestones: true From c741819d4f4cc7c807c979f0748ebef775c02a56 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 7 Dec 2021 21:06:08 +0900 Subject: [PATCH 281/719] Set websocket-client version range due to the package regression --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index db728656d..a3be4e443 100755 --- a/setup.py +++ b/setup.py @@ -85,7 +85,9 @@ "uvicorn<1", "gunicorn>=20,<21", # Socket Mode 3rd party implementation - "websocket_client>=1,<2", + # TODO: 1.2.2 has a regression (https://github.com/websocket-client/websocket-client/issues/769) + # ERROR on_error invoked (error: AttributeError, message: 'Dispatcher' object has no attribute 'read') + "websocket_client>=1,<1.2.2", ], # pip install -e ".[testing_without_asyncio]" "testing_without_asyncio": test_dependencies, From 1f044cbc2b26b32252202a7210455ea00d0c3688 Mon Sep 17 00:00:00 2001 From: Jason Wong Date: Tue, 7 Dec 2021 21:19:43 +0900 Subject: [PATCH 282/719] Fixes #534, updates link to view submisions (#535) Co-authored-by: Kazuhiro Sera --- docs/_basic/ja_listening_modals.md | 2 +- docs/_basic/listening_modals.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_basic/ja_listening_modals.md b/docs/_basic/ja_listening_modals.md index fb469eea1..360bfbbab 100644 --- a/docs/_basic/ja_listening_modals.md +++ b/docs/_basic/ja_listening_modals.md @@ -25,7 +25,7 @@ def handle_submission(ack, body): ``` この例と同様に、モーダルでの送信リクエストに対して、エラーを表示するためのオプションもあります。 -モーダルの送信について詳しくは、API ドキュメントを参照してください。 +モーダルの送信について詳しくは、API ドキュメントを参照してください。
    diff --git a/docs/_basic/listening_modals.md b/docs/_basic/listening_modals.md index a0146c453..0342b0b3e 100644 --- a/docs/_basic/listening_modals.md +++ b/docs/_basic/listening_modals.md @@ -24,7 +24,7 @@ def handle_submission(ack, body): ack(response_action="update", view=build_new_view(body)) ``` Similarly, there are options for [displaying errors](https://api.slack.com/surfaces/modals/using#displaying_errors) in response to view submissions. -Read more about view submissions in our API documentation. +Read more about view submissions in our API documentation. From 92c3380c1c19501b746ddbc3c30b05b4e6b074e1 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 8 Dec 2021 00:22:57 +0900 Subject: [PATCH 283/719] Update the respond utility guide (#538) Co-authored-by: Sarah Jiang --- docs/.gitignore | 1 + docs/_basic/ja_responding_actions.md | 2 +- docs/_basic/responding_actions.md | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/.gitignore b/docs/.gitignore index c48a717ef..ee9abd8bf 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -5,3 +5,4 @@ Gemfile.lock .vscode/ .bundle/ vendor/ +.ruby-version diff --git a/docs/_basic/ja_responding_actions.md b/docs/_basic/ja_responding_actions.md index c1cb5f357..dd974182c 100644 --- a/docs/_basic/ja_responding_actions.md +++ b/docs/_basic/ja_responding_actions.md @@ -31,7 +31,7 @@ def approve_request(ack, say):
    -`respond()` は `response_url` を使って送信するときに便利なメソッドで、これらと同じような動作をします。投稿するメッセージのペイロードには JSON オブジェクトを渡すことができ、メッセージはやり取りの発生元に反映されます。オプションのプロパティとして `response_type`(値は `in_channel` または `ephemeral`)、`replace_original`、`delete_original` などを指定できます。 +`respond()` は `response_url` を使って送信するときに便利なメソッドで、これらと同じような動作をします。投稿するメッセージのペイロードには、全ての[メッセージペイロードのプロパティ](https://api.slack.com/reference/messaging/payload)とオプションのプロパティとして `response_type`(値は `"in_channel"` または `"ephemeral"`)、`replace_original`、`delete_original`、`unfurl_links`、`unfurl_media` などを指定できます。こうすることによってアプリから送信されるメッセージは、やり取りの発生元に反映されます。
    diff --git a/docs/_basic/responding_actions.md b/docs/_basic/responding_actions.md index 3c04d230c..30219a098 100644 --- a/docs/_basic/responding_actions.md +++ b/docs/_basic/responding_actions.md @@ -32,7 +32,7 @@ def approve_request(ack, say):
    -Since `respond()` is a utility for calling the `response_url`, it behaves in the same way. You can pass a JSON object with a new message payload that will be published back to the source of the original interaction with optional properties like `response_type` (which has a value of `in_channel` or `ephemeral`), `replace_original`, and `delete_original`. +Since `respond()` is a utility for calling the `response_url`, it behaves in the same way. You can pass [all the message payload properties](https://api.slack.com/reference/messaging/payload) as keyword arguments along with optional properties like `response_type` (which has a value of `"in_channel"` or `"ephemeral"`), `replace_original`, `delete_original`, `unfurl_links`, and `unfurl_media`. With that, your app can send a new message payload that will be published back to the source of the original interaction.
    From e8556c1d55ceac7a75c736bcc124f28de2edcb47 Mon Sep 17 00:00:00 2001 From: Jason Wong Date: Mon, 13 Dec 2021 09:04:59 +0900 Subject: [PATCH 284/719] Fix #525 Japanese translation for #524 (lazy listeners doc updates) (#541) Co-authored-by: Kazuhiro Sera --- docs/_advanced/ja_lazy_listener.md | 10 ++++++---- docs/_basic/acknowledging_requests.md | 4 ++-- ...wledging_events.md => ja_acknowledging_requests.md} | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) rename docs/_basic/{ja_acknowledging_events.md => ja_acknowledging_requests.md} (55%) diff --git a/docs/_advanced/ja_lazy_listener.md b/docs/_advanced/ja_lazy_listener.md index eb9c15008..b472e0930 100644 --- a/docs/_advanced/ja_lazy_listener.md +++ b/docs/_advanced/ja_lazy_listener.md @@ -6,13 +6,15 @@ order: 10 ---
    -⚠️ Lazy リスナー関数は、FaaS 環境への Bolt for Python アプリのデプロイを容易にする、ベータ版の機能です。開発中の機能であるため、Bolt for Python の API は変更される可能性があります。 +Lazy リスナー関数は、FaaS 環境への Slack アプリのデプロイを容易にする機能です。この機能は Bolt for Python でのみ利用可能で、他の Bolt フレームワークでこの機能に対応することは予定していません。 -通常、リスナー関数では最初の手順として `ack()` を呼び出します。`ack()` を呼び出すことで、アプリがリクエストを受け取り、適切な時間内(3 秒間)に処理する予定であることが Slack に伝えられます。 +通常、アクション(action)、コマンド(command)、ショートカット(shortcut)、オプション(options)、およびモーダルからのデータ送信(view_submission)をハンドルするとき、 `ack()` を呼び出し、Slack からのリクエストを 3 秒以内に確認する必要があります。`ack()` を呼び出すと Slack に HTTP ステータスが 200 OK の応答が返されます。こうすることで、アプリがリクエストの応答を処理中であることを Slack に伝えられます。通常であれば、この確認処理を処理関数の最初のステップとして行うことを推奨しています。 -しかし、FaaS 環境や類似のランタイムで実行されるアプリでは、HTTP レスポンスを返したあとにスレッドやプロセスの実行を続けることができないため、同じパターンに従うことはできません。代わりに、`process_before_response` フラグを `True` に設定します。この設定により、`ack()` の呼び出しとリクエストの処理を安全に行うリスナーを作成することができます。しかし、3 秒以内にすべての処理を完了させる必要があることは変わりません。Events APIに応答するリスナーでは`ack()` メソッドの呼び出しを必要としませんが、この設定では処理を 3 秒以内に完了させる必要があります。 +しかし、FaaS 環境や類似のランタイムで実行されるアプリでは、 **HTTP レスポンスを返したあとにスレッドやプロセスの実行を続けることができない** ため、確認の応答を送信した後で時間のかかる処理をするという通常のパターンに従うことができません。こうした環境で動作させるためには、 `process_before_response` フラグを `True` に設定します。このフラグが `True` に設定されている場合、Bolt はリスナー関数での処理が完了するまで HTTP レスポンスの送信を遅延させます。そのため 3 秒以内にリスナーのすべての処理が完了しなかった場合は Slack 上でタイムアウトのエラー表示となってしまいます。また、Events API に応答するリスナーでは明示的な `ack()` メソッドの呼び出しを必要としませんが、この設定を有効にしている場合、リスナーの処理を 3 秒以内に完了させる必要があることにも注意してください。 -Lazy リスナーは、この問題を解決するためのソリューションです。Lazy リスナーは、デコレーターとして動作するものではなく、次の 2 つのキーワード引数を指定することにより動作するものです。 * `ack:Callable` : `ack()` の呼び出しを行います。 * `lazy:List[Callable]` : リクエストに関係する、時間のかかるプロセスの処理を担当します。Lazy 関数からは `ack()` にアクセスできません。 +処理関数の中で時間のかかる処理を実行できるようにするために、私たちは Lazy リスナーという関数を実行する仕組みを導入しました。Lazy リスナーは、デコレーターとして動作させるのではなく、以下の 2 つのキーワード引数を受け取ります。 +* `ack: Callable`: 3 秒以内での `ack()` メソッドの呼び出しを担当します。 +* `lazy: List[Callable]` : リクエストに関する時間のかかる処理のハンドリングを担当します。Lazy 関数からは `ack()` にアクセスすることはできません。
    ```python diff --git a/docs/_basic/acknowledging_requests.md b/docs/_basic/acknowledging_requests.md index 2f3f6c466..41aeef193 100644 --- a/docs/_basic/acknowledging_requests.md +++ b/docs/_basic/acknowledging_requests.md @@ -9,11 +9,11 @@ order: 7 Actions, commands, shortcuts, options requests, and view submissions must **always** be acknowledged using the `ack()` function. This lets Slack know that the request was received so that it may update the Slack user interface accordingly. -Depending on the type of request, your acknowledgement may be different. For example, when acknowledging a menu selection associated with an external data source, you would call `ack()` with a list of relevant [options](https://api.slack.com/reference/block-kit/composition-objects#option). When acknowledging a view submission, you may supply a `response_action` as part of your acknowledge to update the view. Please see the relevant sections of the docs for more detail on options for `ack()` these different requests. +Depending on the type of request, your acknowledgement may be different. For example, when acknowledging a menu selection associated with an external data source, you would call `ack()` with a list of relevant [options](https://api.slack.com/reference/block-kit/composition-objects#option). When acknowledging a view submission, you may supply a `response_action` as part of your acknowledgement to [update the view](#update-views-on-submission). We recommend calling `ack()` right away before initiating any time-consuming processes such as fetching information from your database or sending a new message, since you only have 3 seconds to respond before Slack registers a timeout error. -💡 When working in a FaaS / serverless environment, our guidelines for when to `ack()` are different. See the section on **Lazy listeners (FaaS)** for more detail on this. +💡 When working in a FaaS / serverless environment, our guidelines for when to `ack()` are different. See the section on [Lazy listeners (FaaS)](#lazy-listeners) for more detail on this.
    diff --git a/docs/_basic/ja_acknowledging_events.md b/docs/_basic/ja_acknowledging_requests.md similarity index 55% rename from docs/_basic/ja_acknowledging_events.md rename to docs/_basic/ja_acknowledging_requests.md index 8967308cc..24ab1f979 100644 --- a/docs/_basic/ja_acknowledging_events.md +++ b/docs/_basic/ja_acknowledging_requests.md @@ -7,12 +7,13 @@ order: 7
    -アクション(action)、コマンド(command)、およびオプション(options)の各リクエストは、**必ず** `ack()` 関数を使って確認を行う必要があります。これによってリクエストが受信されたことが Slack に認識され、Slack のユーザーインターフェイスが適切に更新されます。 +アクション(action)、コマンド(command)、ショートカット(shortcut)、オプション(options)、およびモーダルからのデータ送信(view_submission)の各リクエストは、**必ず** `ack()` 関数を使って確認を行う必要があります。これによってリクエストが受信されたことが Slack に認識され、Slack のユーザーインターフェイスが適切に更新されます。 -リクエストの種類によっては、確認で通知方法が異なる場合があります。例えば、外部データソースを使用する選択メニューのオプションのリクエストに対する確認では、適切な[オプション](https://api.slack.com/reference/block-kit/composition-objects#option)のリストとともに `ack()` を呼び出します。 +リクエストの種類によっては、確認で通知方法が異なる場合があります。例えば、外部データソースを使用する選択メニューのオプションのリクエストに対する確認では、適切な[オプション](https://api.slack.com/reference/block-kit/composition-objects#option)のリストとともに `ack()` を呼び出します。モーダルからのデータ送信に対する確認では、 `response_action` を渡すことで[モーダルの更新](#update-views-on-submission)などを行えます。 -確認までの猶予は 3 秒しかないため、新しいメッセージの送信や、データベースからの情報の取得は、`ack()` を呼び出した後で行うことをおすすめします。 +確認までの猶予は 3 秒しかないため、新しいメッセージの送信やデータベースからの情報の取得といった時間のかかる処理は、`ack()` を呼び出した後で行うことをおすすめします。 + FaaS / serverless 環境を使う場合、 `ack()` するタイミングが異なります。 これに関する詳細は [Lazy listeners (FaaS)](#lazy-listeners) を参照してください。
    From d5289c9990b755cea487c92a0bb95d74d9b03dcc Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 14 Dec 2021 12:57:10 +0900 Subject: [PATCH 285/719] Fix url_verification error with the Flask adapter (#543) --- examples/app_authorize.py | 2 +- examples/async_app.py | 2 +- slack_bolt/adapter/flask/handler.py | 3 +++ tests/adapter_tests/flask/test_flask.py | 34 +++++++++++++++++++++++++ 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/examples/app_authorize.py b/examples/app_authorize.py index 527e2325a..843ecd6f6 100644 --- a/examples/app_authorize.py +++ b/examples/app_authorize.py @@ -39,4 +39,4 @@ def event_test(body, say, logger): # pip install slack_bolt # export SLACK_SIGNING_SECRET=*** # export MY_TOKEN=xoxb-*** -# python app.py +# python app_authorize.py diff --git a/examples/async_app.py b/examples/async_app.py index dd5172964..a699dbb29 100644 --- a/examples/async_app.py +++ b/examples/async_app.py @@ -32,4 +32,4 @@ async def command(ack, body): # pip install slack_bolt # export SLACK_SIGNING_SECRET=*** # export SLACK_BOT_TOKEN=xoxb-*** -# python app.py +# python async_app.py diff --git a/slack_bolt/adapter/flask/handler.py b/slack_bolt/adapter/flask/handler.py index fb7d44ce1..b111c5f85 100644 --- a/slack_bolt/adapter/flask/handler.py +++ b/slack_bolt/adapter/flask/handler.py @@ -17,6 +17,9 @@ def to_bolt_request(req: Request) -> BoltRequest: def to_flask_response(bolt_resp: BoltResponse) -> Response: resp: Response = make_response(bolt_resp.body, bolt_resp.status) for k, values in bolt_resp.headers.items(): + if k.lower() == "content-type" and resp.headers.get("content-type") is not None: + # Remove the one set by Flask + resp.headers.pop("content-type") for v in values: resp.headers.add_header(k, v) return resp diff --git a/tests/adapter_tests/flask/test_flask.py b/tests/adapter_tests/flask/test_flask.py index b8c198e68..034a8b580 100644 --- a/tests/adapter_tests/flask/test_flask.py +++ b/tests/adapter_tests/flask/test_flask.py @@ -99,6 +99,7 @@ def endpoint(): headers=self.build_headers(timestamp, body), ) assert rv.status_code == 200 + assert rv.headers.get("content-type") == "text/plain;charset=utf-8" assert_auth_test_count(self, 1) def test_shortcuts(self): @@ -142,6 +143,7 @@ def endpoint(): headers=self.build_headers(timestamp, body), ) assert rv.status_code == 200 + assert rv.headers.get("content-type") == "text/plain;charset=utf-8" assert_auth_test_count(self, 1) def test_commands(self): @@ -185,6 +187,7 @@ def endpoint(): headers=self.build_headers(timestamp, body), ) assert rv.status_code == 200 + assert rv.headers.get("content-type") == "text/plain;charset=utf-8" assert_auth_test_count(self, 1) def test_oauth(self): @@ -205,4 +208,35 @@ def endpoint(): with flask_app.test_client() as client: rv = client.get("/slack/install") + assert rv.headers.get("content-type") == "text/html; charset=utf-8" assert rv.status_code == 200 + + def test_url_verification(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + input = { + "token": "Jhj5dZrVaK7ZwHHjRyZWjbDl", + "challenge": "3eZbrw1aBm2rZgRNFdxV2595E9CY3gmdALWMmHkvFXO7tYXAYM8P", + "type": "url_verification", + } + + timestamp, body = str(int(time())), f"payload={quote(json.dumps(input))}" + + flask_app = Flask(__name__) + + @flask_app.route("/slack/events", methods=["POST"]) + def endpoint(): + return SlackRequestHandler(app).handle(request) + + with flask_app.test_client() as client: + rv = client.post( + "/slack/events", + data=body, + headers=self.build_headers(timestamp, body), + ) + assert rv.status_code == 200 + assert rv.headers.get("content-type") == "application/json;charset=utf-8" + assert_auth_test_count(self, 1) From bc094f01b7d84bb9a61f082eb03e678062ebaa05 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 14 Dec 2021 12:58:33 +0900 Subject: [PATCH 286/719] Fix #542 Add additional context values for FastAPI apps (#544) --- examples/fastapi/async_app_custom_props.py | 41 +++++++++++++++ slack_bolt/adapter/starlette/async_handler.py | 26 +++++++--- slack_bolt/adapter/starlette/handler.py | 28 ++++++++--- tests/adapter_tests/starlette/test_fastapi.py | 50 ++++++++++++++++++- .../adapter_tests_async/test_async_fastapi.py | 50 ++++++++++++++++++- 5 files changed, 181 insertions(+), 14 deletions(-) create mode 100644 examples/fastapi/async_app_custom_props.py diff --git a/examples/fastapi/async_app_custom_props.py b/examples/fastapi/async_app_custom_props.py new file mode 100644 index 000000000..497e47aa2 --- /dev/null +++ b/examples/fastapi/async_app_custom_props.py @@ -0,0 +1,41 @@ +import logging + +logging.basicConfig(level=logging.DEBUG) + +from slack_bolt.async_app import AsyncApp +from slack_bolt.adapter.fastapi.async_handler import AsyncSlackRequestHandler + +app = AsyncApp() +app_handler = AsyncSlackRequestHandler(app) + + +@app.event("app_mention") +async def handle_app_mentions(context, say, logger): + logger.info(context) + assert context.get("foo") == "FOO" + await say("What's up?") + + +@app.event("message") +async def handle_message(): + pass + + +from fastapi import FastAPI, Request, Depends + +api = FastAPI() + + +def get_foo(): + yield "FOO" + + +@api.post("/slack/events") +async def endpoint(req: Request, foo: str = Depends(get_foo)): + return await app_handler.handle(req, {"foo": foo}) + + +# pip install -r requirements.txt +# export SLACK_SIGNING_SECRET=*** +# export SLACK_BOT_TOKEN=xoxb-*** +# uvicorn async_app_custom_props:api --reload --port 3000 --log-level warning diff --git a/slack_bolt/adapter/starlette/async_handler.py b/slack_bolt/adapter/starlette/async_handler.py index bc38176bf..5fb13ade3 100644 --- a/slack_bolt/adapter/starlette/async_handler.py +++ b/slack_bolt/adapter/starlette/async_handler.py @@ -1,3 +1,5 @@ +from typing import Dict, Any, Optional + from starlette.requests import Request from starlette.responses import Response @@ -6,12 +8,20 @@ from slack_bolt.oauth.async_oauth_flow import AsyncOAuthFlow -def to_async_bolt_request(req: Request, body: bytes) -> AsyncBoltRequest: - return AsyncBoltRequest( +def to_async_bolt_request( + req: Request, + body: bytes, + addition_context_properties: Optional[Dict[str, Any]] = None, +) -> AsyncBoltRequest: + request = AsyncBoltRequest( body=body.decode("utf-8"), query=req.query_params, headers=req.headers, ) + if addition_context_properties is not None: + for k, v in addition_context_properties.items(): + request.context[k] = v + return request def to_starlette_response(bolt_resp: BoltResponse) -> Response: @@ -39,23 +49,27 @@ class AsyncSlackRequestHandler: def __init__(self, app: AsyncApp): # type: ignore self.app = app - async def handle(self, req: Request) -> Response: + async def handle( + self, req: Request, addition_context_properties: Optional[Dict[str, Any]] = None + ) -> Response: body = await req.body() if req.method == "GET": if self.app.oauth_flow is not None: oauth_flow: AsyncOAuthFlow = self.app.oauth_flow if req.url.path == oauth_flow.install_path: bolt_resp = await oauth_flow.handle_installation( - to_async_bolt_request(req, body) + to_async_bolt_request(req, body, addition_context_properties) ) return to_starlette_response(bolt_resp) elif req.url.path == oauth_flow.redirect_uri_path: bolt_resp = await oauth_flow.handle_callback( - to_async_bolt_request(req, body) + to_async_bolt_request(req, body, addition_context_properties) ) return to_starlette_response(bolt_resp) elif req.method == "POST": - bolt_resp = await self.app.async_dispatch(to_async_bolt_request(req, body)) + bolt_resp = await self.app.async_dispatch( + to_async_bolt_request(req, body, addition_context_properties) + ) return to_starlette_response(bolt_resp) return Response( diff --git a/slack_bolt/adapter/starlette/handler.py b/slack_bolt/adapter/starlette/handler.py index c8cea10d4..d1c9a381e 100644 --- a/slack_bolt/adapter/starlette/handler.py +++ b/slack_bolt/adapter/starlette/handler.py @@ -1,3 +1,5 @@ +from typing import Dict, Any, Optional + from starlette.requests import Request from starlette.responses import Response @@ -5,12 +7,20 @@ from slack_bolt.oauth import OAuthFlow -def to_bolt_request(req: Request, body: bytes) -> BoltRequest: - return BoltRequest( +def to_bolt_request( + req: Request, + body: bytes, + addition_context_properties: Optional[Dict[str, Any]] = None, +) -> BoltRequest: + request = BoltRequest( body=body.decode("utf-8"), query=req.query_params, headers=req.headers, ) + if addition_context_properties is not None: + for k, v in addition_context_properties.items(): + request.context[k] = v + return request def to_starlette_response(bolt_resp: BoltResponse) -> Response: @@ -38,21 +48,27 @@ class SlackRequestHandler: def __init__(self, app: App): # type: ignore self.app = app - async def handle(self, req: Request) -> Response: + async def handle( + self, req: Request, addition_context_properties: Optional[Dict[str, Any]] = None + ) -> Response: body = await req.body() if req.method == "GET": if self.app.oauth_flow is not None: oauth_flow: OAuthFlow = self.app.oauth_flow if req.url.path == oauth_flow.install_path: bolt_resp = oauth_flow.handle_installation( - to_bolt_request(req, body) + to_bolt_request(req, body, addition_context_properties) ) return to_starlette_response(bolt_resp) elif req.url.path == oauth_flow.redirect_uri_path: - bolt_resp = oauth_flow.handle_callback(to_bolt_request(req, body)) + bolt_resp = oauth_flow.handle_callback( + to_bolt_request(req, body, addition_context_properties) + ) return to_starlette_response(bolt_resp) elif req.method == "POST": - bolt_resp = self.app.dispatch(to_bolt_request(req, body)) + bolt_resp = self.app.dispatch( + to_bolt_request(req, body, addition_context_properties) + ) return to_starlette_response(bolt_resp) return Response( diff --git a/tests/adapter_tests/starlette/test_fastapi.py b/tests/adapter_tests/starlette/test_fastapi.py index 4b09c618a..20da33a76 100644 --- a/tests/adapter_tests/starlette/test_fastapi.py +++ b/tests/adapter_tests/starlette/test_fastapi.py @@ -2,7 +2,7 @@ from time import time from urllib.parse import quote -from fastapi import FastAPI +from fastapi import FastAPI, Depends from slack_sdk.signature import SignatureVerifier from slack_sdk.web import WebClient from starlette.requests import Request @@ -214,3 +214,51 @@ async def endpoint(req: Request): assert response.status_code == 200 assert response.headers.get("content-type") == "text/html; charset=utf-8" assert "https://slack.com/oauth/v2/authorize?state=" in response.text + + def test_custom_props(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + def shortcut_handler(ack, context): + assert context.get("foo") == "FOO" + ack() + + app.shortcut("test-shortcut")(shortcut_handler) + + input = { + "type": "shortcut", + "token": "verification_token", + "action_ts": "111.111", + "team": { + "id": "T111", + "domain": "workspace-domain", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": {"id": "W111", "username": "primary-owner", "team_id": "T111"}, + "callback_id": "test-shortcut", + "trigger_id": "111.111.xxxxxx", + } + + timestamp, body = str(int(time())), f"payload={quote(json.dumps(input))}" + + api = FastAPI() + app_handler = SlackRequestHandler(app) + + def get_foo(): + yield "FOO" + + @api.post("/slack/events") + async def endpoint(req: Request, foo: str = Depends(get_foo)): + return await app_handler.handle(req, {"foo": foo}) + + client = TestClient(api) + response = client.post( + "/slack/events", + data=body, + headers=self.build_headers(timestamp, body), + ) + assert response.status_code == 200 + assert_auth_test_count(self, 1) diff --git a/tests/adapter_tests_async/test_async_fastapi.py b/tests/adapter_tests_async/test_async_fastapi.py index 41e1f4923..5850114d6 100644 --- a/tests/adapter_tests_async/test_async_fastapi.py +++ b/tests/adapter_tests_async/test_async_fastapi.py @@ -2,7 +2,7 @@ from time import time from urllib.parse import quote -from fastapi import FastAPI +from fastapi import FastAPI, Depends from slack_sdk.signature import SignatureVerifier from slack_sdk.web.async_client import AsyncWebClient from starlette.requests import Request @@ -215,3 +215,51 @@ async def endpoint(req: Request): assert response.headers.get("content-type") == "text/html; charset=utf-8" assert response.headers.get("content-length") == "597" assert "https://slack.com/oauth/v2/authorize?state=" in response.text + + def test_custom_props(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + async def shortcut_handler(ack, context): + assert context.get("foo") == "FOO" + await ack() + + app.shortcut("test-shortcut")(shortcut_handler) + + input = { + "type": "shortcut", + "token": "verification_token", + "action_ts": "111.111", + "team": { + "id": "T111", + "domain": "workspace-domain", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": {"id": "W111", "username": "primary-owner", "team_id": "T111"}, + "callback_id": "test-shortcut", + "trigger_id": "111.111.xxxxxx", + } + + timestamp, body = str(int(time())), f"payload={quote(json.dumps(input))}" + + api = FastAPI() + app_handler = AsyncSlackRequestHandler(app) + + def get_foo(): + yield "FOO" + + @api.post("/slack/events") + async def endpoint(req: Request, foo: str = Depends(get_foo)): + return await app_handler.handle(req, {"foo": foo}) + + client = TestClient(api) + response = client.post( + "/slack/events", + data=body, + headers=self.build_headers(timestamp, body), + ) + assert response.status_code == 200 + assert_auth_test_count(self, 1) From dc09c4ca3109e7df4b6013df60441454557c84e3 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 14 Dec 2021 12:59:35 +0900 Subject: [PATCH 287/719] Fix #545 Enable to use lazy listeners even when having any custom context data (#546) --- slack_bolt/context/async_context.py | 18 +++++++ slack_bolt/context/base_context.py | 21 ++++++++ slack_bolt/context/context.py | 19 +++++++ slack_bolt/listener/asyncio_runner.py | 2 +- slack_bolt/listener/thread_runner.py | 2 +- slack_bolt/request/async_request.py | 9 ++++ slack_bolt/request/request.py | 9 ++++ tests/scenario_tests/test_lazy.py | 70 +++++++++++++++++++++++++ tests/scenario_tests_async/test_lazy.py | 70 +++++++++++++++++++++++++ 9 files changed, 218 insertions(+), 2 deletions(-) diff --git a/slack_bolt/context/async_context.py b/slack_bolt/context/async_context.py index 0a02c299c..46eb6c69d 100644 --- a/slack_bolt/context/async_context.py +++ b/slack_bolt/context/async_context.py @@ -6,11 +6,29 @@ from slack_bolt.context.base_context import BaseContext from slack_bolt.context.respond.async_respond import AsyncRespond from slack_bolt.context.say.async_say import AsyncSay +from slack_bolt.util.utils import create_copy class AsyncBoltContext(BaseContext): """Context object associated with a request from Slack.""" + def to_copyable(self) -> "AsyncBoltContext": + new_dict = {} + for prop_name, prop_value in self.items(): + if prop_name in self.standard_property_names: + # all the standard properties are copiable + new_dict[prop_name] = prop_value + else: + try: + copied_value = create_copy(prop_value) + new_dict[prop_name] = copied_value + except TypeError as te: + self.logger.debug( + f"Skipped settings '{prop_name}' to a copied request for lazy listeners " + f"as it's not possible to make a deep copy (error: {te})" + ) + return AsyncBoltContext(new_dict) + @property def client(self) -> Optional[AsyncWebClient]: """The `AsyncWebClient` instance available for this request. diff --git a/slack_bolt/context/base_context.py b/slack_bolt/context/base_context.py index 307aa02b9..266df9e5c 100644 --- a/slack_bolt/context/base_context.py +++ b/slack_bolt/context/base_context.py @@ -7,6 +7,27 @@ class BaseContext(dict): """Context object associated with a request from Slack.""" + standard_property_names = [ + "logger", + "token", + "enterprise_id", + "is_enterprise_install", + "team_id", + "user_id", + "channel_id", + "response_url", + "matches", + "authorize_result", + "bot_token", + "bot_id", + "bot_user_id", + "user_token", + "client", + "ack", + "say", + "respond", + ] + @property def logger(self) -> Logger: """The properly configured logger that is available for middleware/listeners.""" diff --git a/slack_bolt/context/context.py b/slack_bolt/context/context.py index b47405324..a92ac05bb 100644 --- a/slack_bolt/context/context.py +++ b/slack_bolt/context/context.py @@ -7,11 +7,30 @@ from slack_bolt.context.base_context import BaseContext from slack_bolt.context.respond import Respond from slack_bolt.context.say import Say +from slack_bolt.util.utils import create_copy class BoltContext(BaseContext): """Context object associated with a request from Slack.""" + def to_copyable(self) -> "BoltContext": + new_dict = {} + for prop_name, prop_value in self.items(): + if prop_name in self.standard_property_names: + # all the standard properties are copiable + new_dict[prop_name] = prop_value + else: + try: + copied_value = create_copy(prop_value) + new_dict[prop_name] = copied_value + except TypeError as te: + self.logger.warning( + f"Skipped setting '{prop_name}' to a copied request for lazy listeners " + "due to a deep-copy creation error. Consider passing the value not as part of context object " + f"(error: {te})" + ) + return BoltContext(new_dict) + @property def client(self) -> Optional[WebClient]: """The `WebClient` instance available for this request. diff --git a/slack_bolt/listener/asyncio_runner.py b/slack_bolt/listener/asyncio_runner.py index ecd66568b..6edbbaac3 100644 --- a/slack_bolt/listener/asyncio_runner.py +++ b/slack_bolt/listener/asyncio_runner.py @@ -198,7 +198,7 @@ def _start_lazy_function( def _build_lazy_request( request: AsyncBoltRequest, lazy_func_name: str ) -> AsyncBoltRequest: - copied_request = create_copy(request) + copied_request = create_copy(request.to_copyable()) copied_request.method = "NONE" copied_request.lazy_only = True copied_request.lazy_function_name = lazy_func_name diff --git a/slack_bolt/listener/thread_runner.py b/slack_bolt/listener/thread_runner.py index b6a6b6e11..05f9fb76a 100644 --- a/slack_bolt/listener/thread_runner.py +++ b/slack_bolt/listener/thread_runner.py @@ -195,7 +195,7 @@ def _start_lazy_function( @staticmethod def _build_lazy_request(request: BoltRequest, lazy_func_name: str) -> BoltRequest: - copied_request = create_copy(request) + copied_request = create_copy(request.to_copyable()) copied_request.method = "NONE" copied_request.lazy_only = True copied_request.lazy_function_name = lazy_func_name diff --git a/slack_bolt/request/async_request.py b/slack_bolt/request/async_request.py index ad671ccc2..e590bc93b 100644 --- a/slack_bolt/request/async_request.py +++ b/slack_bolt/request/async_request.py @@ -75,3 +75,12 @@ def __init__( "x-slack-bolt-lazy-function-name", [None] )[0] self.mode = mode + + def to_copyable(self) -> "AsyncBoltRequest": + return AsyncBoltRequest( + body=self.raw_body, + query=self.query, + headers=self.headers, + context=self.context.to_copyable(), + mode=self.mode, + ) diff --git a/slack_bolt/request/request.py b/slack_bolt/request/request.py index d91e78ba6..4810d2018 100644 --- a/slack_bolt/request/request.py +++ b/slack_bolt/request/request.py @@ -72,3 +72,12 @@ def __init__( "x-slack-bolt-lazy-function-name", [None] )[0] self.mode = mode + + def to_copyable(self) -> "BoltRequest": + return BoltRequest( + body=self.raw_body, + query=self.query, + headers=self.headers, + context=self.context.to_copyable(), + mode=self.mode, + ) diff --git a/tests/scenario_tests/test_lazy.py b/tests/scenario_tests/test_lazy.py index 6a2c89607..263835b59 100644 --- a/tests/scenario_tests/test_lazy.py +++ b/tests/scenario_tests/test_lazy.py @@ -138,3 +138,73 @@ def async2(say): assert response.status == 200 time.sleep(1) # wait a bit assert self.mock_received_requests["/chat.postMessage"] == 2 + + def test_issue_545_context_copy_failure(self): + def just_ack(ack): + ack() + + class LazyClass: + def __call__(self, context, say): + assert context.get("foo") == "FOO" + assert context.get("ssl_context") is None + time.sleep(0.3) + say(text="lazy function 1") + + def async2(context, say): + assert context.get("foo") == "FOO" + assert context.get("ssl_context") is None + time.sleep(0.5) + say(text="lazy function 2") + + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + @app.middleware + def set_ssl_context(context, next_): + from ssl import SSLContext + + context["foo"] = "FOO" + # This causes an error when starting lazy listener executions + context["ssl_context"] = SSLContext() + next_() + + # 2021-12-13 11:14:29 ERROR Failed to run a middleware middleware (error: cannot pickle 'SSLContext' object) + # Traceback (most recent call last): + # File "/path/to/bolt-python/slack_bolt/app/app.py", line 545, in dispatch + # ] = self._listener_runner.run( + # File "/path/to/bolt-python/slack_bolt/listener/thread_runner.py", line 166, in run + # self._start_lazy_function(lazy_func, request) + # File "/path/to/bolt-python/slack_bolt/listener/thread_runner.py", line 193, in _start_lazy_function + # copied_request = self._build_lazy_request(request, func_name) + # File "/path/to/bolt-python/slack_bolt/listener/thread_runner.py", line 198, in _build_lazy_request + # copied_request = create_copy(request) + # File "/path/to/bolt-python/slack_bolt/util/utils.py", line 48, in create_copy + # return copy.deepcopy(original) + # File "/path/to/python/lib/python3.9/copy.py", line 172, in deepcopy + # y = _reconstruct(x, memo, *rv) + # File "/path/to/python/lib/python3.9/copy.py", line 270, in _reconstruct + # state = deepcopy(state, memo) + # File "/path/to/python/lib/python3.9/copy.py", line 146, in deepcopy + # y = copier(x, memo) + # File "/path/to/python/lib/python3.9/copy.py", line 230, in _deepcopy_dict + # y[deepcopy(key, memo)] = deepcopy(value, memo) + # File "/path/to/python/lib/python3.9/copy.py", line 172, in deepcopy + # y = _reconstruct(x, memo, *rv) + # File "/path/to/python/lib/python3.9/copy.py", line 296, in _reconstruct + # value = deepcopy(value, memo) + # File "/path/to/python/lib/python3.9/copy.py", line 161, in deepcopy + # rv = reductor(4) + # TypeError: cannot pickle 'SSLContext' object + + app.action("a")( + ack=just_ack, + lazy=[LazyClass(), async2], + ) + + request = self.build_valid_request() + response = app.dispatch(request) + assert response.status == 200 + time.sleep(1) # wait a bit + assert self.mock_received_requests["/chat.postMessage"] == 2 diff --git a/tests/scenario_tests_async/test_lazy.py b/tests/scenario_tests_async/test_lazy.py index f8fe438bc..e69056fe9 100644 --- a/tests/scenario_tests_async/test_lazy.py +++ b/tests/scenario_tests_async/test_lazy.py @@ -117,3 +117,73 @@ async def async2(say): assert response.status == 200 await asyncio.sleep(1) # wait a bit assert self.mock_received_requests["/chat.postMessage"] == 2 + + @pytest.mark.asyncio + async def test_issue_545_context_copy_failure(self): + async def just_ack(ack): + await ack() + + async def async1(context, say): + assert context.get("foo") == "FOO" + assert context.get("ssl_context") is None + await asyncio.sleep(0.3) + await say(text="lazy function 1") + + async def async2(context, say): + assert context.get("foo") == "FOO" + assert context.get("ssl_context") is None + await asyncio.sleep(0.5) + await say(text="lazy function 2") + + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + @app.middleware + async def set_ssl_context(context, next_): + from ssl import SSLContext + + context["foo"] = "FOO" + # This causes an error when starting lazy listener executions + context["ssl_context"] = SSLContext() + await next_() + + # 2021-12-13 11:52:46 ERROR Failed to run a middleware function (error: cannot pickle 'SSLContext' object) + # Traceback (most recent call last): + # File "/path/to/bolt-python/slack_bolt/app/async_app.py", line 585, in async_dispatch + # ] = await self._async_listener_runner.run( + # File "/path/to/bolt-python/slack_bolt/listener/asyncio_runner.py", line 167, in run + # self._start_lazy_function(lazy_func, request) + # File "/path/to/bolt-python/slack_bolt/listener/asyncio_runner.py", line 194, in _start_lazy_function + # copied_request = self._build_lazy_request(request, func_name) + # File "/path/to/bolt-python/slack_bolt/listener/asyncio_runner.py", line 201, in _build_lazy_request + # copied_request = create_copy(request) + # File "/path/to/bolt-python/slack_bolt/util/utils.py", line 48, in create_copy + # return copy.deepcopy(original) + # File "/path/to/python/lib/python3.9/copy.py", line 172, in deepcopy + # y = _reconstruct(x, memo, *rv) + # File "/path/to/python/lib/python3.9/copy.py", line 270, in _reconstruct + # state = deepcopy(state, memo) + # File "/path/to/python/lib/python3.9/copy.py", line 146, in deepcopy + # y = copier(x, memo) + # File "/path/to/python/lib/python3.9/copy.py", line 230, in _deepcopy_dict + # y[deepcopy(key, memo)] = deepcopy(value, memo) + # File "/path/to/python/lib/python3.9/copy.py", line 172, in deepcopy + # y = _reconstruct(x, memo, *rv) + # File "/path/to/python/lib/python3.9/copy.py", line 296, in _reconstruct + # value = deepcopy(value, memo) + # File "/path/to/python/lib/python3.9/copy.py", line 161, in deepcopy + # rv = reductor(4) + # TypeError: cannot pickle 'SSLContext' object + + app.action("a")( + ack=just_ack, + lazy=[async1, async2], + ) + + request = self.build_valid_request() + response = await app.async_dispatch(request) + assert response.status == 200 + await asyncio.sleep(1) # wait a bit + assert self.mock_received_requests["/chat.postMessage"] == 2 From 68e792e393ca599628965f3f7b384aad15d5c41c Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 14 Dec 2021 13:51:03 +0900 Subject: [PATCH 288/719] Upgrade pytype, black versions (#547) --- scripts/run_pytype.sh | 2 +- setup.py | 2 +- slack_bolt/adapter/falcon/resource.py | 2 +- slack_bolt/adapter/sanic/async_handler.py | 2 +- slack_bolt/adapter/tornado/handler.py | 2 +- slack_bolt/context/base_context.py | 3 +++ 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/run_pytype.sh b/scripts/run_pytype.sh index 4b305f1b6..3523791e0 100755 --- a/scripts/run_pytype.sh +++ b/scripts/run_pytype.sh @@ -5,5 +5,5 @@ script_dir=$(dirname $0) cd ${script_dir}/.. && \ pip install -e ".[async]" && \ pip install -e ".[adapter]" && \ - pip install "pytype==2021.10.25" && \ + pip install "pytype==2021.12.8" && \ pytype slack_bolt/ diff --git a/setup.py b/setup.py index a3be4e443..8f58c3d0f 100755 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ "pytest-cov>=3,<4", "Flask-Sockets>=0.2,<1", "Werkzeug<2", # TODO: support Flask 2.x - "black==21.10b0", + "black==21.12b0", ] async_test_dependencies = test_dependencies + [ diff --git a/slack_bolt/adapter/falcon/resource.py b/slack_bolt/adapter/falcon/resource.py index dec1663a3..fb6fd24bf 100644 --- a/slack_bolt/adapter/falcon/resource.py +++ b/slack_bolt/adapter/falcon/resource.py @@ -1,4 +1,4 @@ -from datetime import datetime +from datetime import datetime # type: ignore from http import HTTPStatus from falcon import Request, Response diff --git a/slack_bolt/adapter/sanic/async_handler.py b/slack_bolt/adapter/sanic/async_handler.py index 1555709b8..f1c3f807a 100644 --- a/slack_bolt/adapter/sanic/async_handler.py +++ b/slack_bolt/adapter/sanic/async_handler.py @@ -1,4 +1,4 @@ -from datetime import datetime +from datetime import datetime # type: ignore from sanic.request import Request from sanic.response import HTTPResponse diff --git a/slack_bolt/adapter/tornado/handler.py b/slack_bolt/adapter/tornado/handler.py index 47e06ba9d..7eab94dbf 100644 --- a/slack_bolt/adapter/tornado/handler.py +++ b/slack_bolt/adapter/tornado/handler.py @@ -1,4 +1,4 @@ -from datetime import datetime +from datetime import datetime # type: ignore from tornado.httputil import HTTPServerRequest from tornado.web import RequestHandler diff --git a/slack_bolt/context/base_context.py b/slack_bolt/context/base_context.py index 266df9e5c..f6c67bb60 100644 --- a/slack_bolt/context/base_context.py +++ b/slack_bolt/context/base_context.py @@ -1,3 +1,6 @@ +# pytype: skip-file +# Note: Since 2021.12.8, the pytype code analyzer does not properly work for this file + from logging import Logger from typing import Optional, Tuple From 6df6bba62ba26ac0917472efc3a30240d98eeda6 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 14 Dec 2021 13:52:15 +0900 Subject: [PATCH 289/719] version 1.11.0 --- .../slack_bolt/adapter/falcon/resource.html | 2 +- .../slack_bolt/adapter/flask/handler.html | 6 ++ .../adapter/sanic/async_handler.html | 2 +- .../adapter/starlette/async_handler.html | 70 ++++++++++++----- .../slack_bolt/adapter/starlette/handler.html | 76 ++++++++++++++----- .../slack_bolt/adapter/tornado/handler.html | 2 +- .../slack_bolt/context/async_context.html | 66 ++++++++++++++++ .../slack_bolt/context/base_context.html | 55 +++++++++++++- docs/api-docs/slack_bolt/context/context.html | 69 +++++++++++++++++ .../slack_bolt/listener/asyncio_runner.html | 4 +- .../slack_bolt/listener/thread_runner.html | 4 +- .../slack_bolt/request/async_request.html | 45 ++++++++++- docs/api-docs/slack_bolt/request/request.html | 45 ++++++++++- docs/api-docs/slack_bolt/version.html | 2 +- slack_bolt/version.py | 2 +- 15 files changed, 396 insertions(+), 54 deletions(-) diff --git a/docs/api-docs/slack_bolt/adapter/falcon/resource.html b/docs/api-docs/slack_bolt/adapter/falcon/resource.html index ae29f18b2..7a59a9c63 100644 --- a/docs/api-docs/slack_bolt/adapter/falcon/resource.html +++ b/docs/api-docs/slack_bolt/adapter/falcon/resource.html @@ -26,7 +26,7 @@

    Module slack_bolt.adapter.falcon.resource

    Expand source code -
    from datetime import datetime
    +
    from datetime import datetime  # type: ignore
     from http import HTTPStatus
     
     from falcon import Request, Response
    diff --git a/docs/api-docs/slack_bolt/adapter/flask/handler.html b/docs/api-docs/slack_bolt/adapter/flask/handler.html
    index 247dbba15..e69438873 100644
    --- a/docs/api-docs/slack_bolt/adapter/flask/handler.html
    +++ b/docs/api-docs/slack_bolt/adapter/flask/handler.html
    @@ -45,6 +45,9 @@ 

    Module slack_bolt.adapter.flask.handler

    def to_flask_response(bolt_resp: BoltResponse) -> Response: resp: Response = make_response(bolt_resp.body, bolt_resp.status) for k, values in bolt_resp.headers.items(): + if k.lower() == "content-type" and resp.headers.get("content-type") is not None: + # Remove the one set by Flask + resp.headers.pop("content-type") for v in values: resp.headers.add_header(k, v) return resp @@ -107,6 +110,9 @@

    Functions

    def to_flask_response(bolt_resp: BoltResponse) -> Response:
         resp: Response = make_response(bolt_resp.body, bolt_resp.status)
         for k, values in bolt_resp.headers.items():
    +        if k.lower() == "content-type" and resp.headers.get("content-type") is not None:
    +            # Remove the one set by Flask
    +            resp.headers.pop("content-type")
             for v in values:
                 resp.headers.add_header(k, v)
         return resp
    diff --git a/docs/api-docs/slack_bolt/adapter/sanic/async_handler.html b/docs/api-docs/slack_bolt/adapter/sanic/async_handler.html index 1577a05f6..ff0c7d1c3 100644 --- a/docs/api-docs/slack_bolt/adapter/sanic/async_handler.html +++ b/docs/api-docs/slack_bolt/adapter/sanic/async_handler.html @@ -26,7 +26,7 @@

    Module slack_bolt.adapter.sanic.async_handler

    Expand source code -
    from datetime import datetime
    +
    from datetime import datetime  # type: ignore
     
     from sanic.request import Request
     from sanic.response import HTTPResponse
    diff --git a/docs/api-docs/slack_bolt/adapter/starlette/async_handler.html b/docs/api-docs/slack_bolt/adapter/starlette/async_handler.html
    index 5f1ecf75a..82c371af7 100644
    --- a/docs/api-docs/slack_bolt/adapter/starlette/async_handler.html
    +++ b/docs/api-docs/slack_bolt/adapter/starlette/async_handler.html
    @@ -26,7 +26,9 @@ 

    Module slack_bolt.adapter.starlette.async_handler Expand source code -
    from starlette.requests import Request
    +
    from typing import Dict, Any, Optional
    +
    +from starlette.requests import Request
     from starlette.responses import Response
     
     from slack_bolt import BoltResponse
    @@ -34,12 +36,20 @@ 

    Module slack_bolt.adapter.starlette.async_handler from slack_bolt.oauth.async_oauth_flow import AsyncOAuthFlow -def to_async_bolt_request(req: Request, body: bytes) -> AsyncBoltRequest: - return AsyncBoltRequest( +def to_async_bolt_request( + req: Request, + body: bytes, + addition_context_properties: Optional[Dict[str, Any]] = None, +) -> AsyncBoltRequest: + request = AsyncBoltRequest( body=body.decode("utf-8"), query=req.query_params, headers=req.headers, ) + if addition_context_properties is not None: + for k, v in addition_context_properties.items(): + request.context[k] = v + return request def to_starlette_response(bolt_resp: BoltResponse) -> Response: @@ -67,23 +77,27 @@

    Module slack_bolt.adapter.starlette.async_handler def __init__(self, app: AsyncApp): # type: ignore self.app = app - async def handle(self, req: Request) -> Response: + async def handle( + self, req: Request, addition_context_properties: Optional[Dict[str, Any]] = None + ) -> Response: body = await req.body() if req.method == "GET": if self.app.oauth_flow is not None: oauth_flow: AsyncOAuthFlow = self.app.oauth_flow if req.url.path == oauth_flow.install_path: bolt_resp = await oauth_flow.handle_installation( - to_async_bolt_request(req, body) + to_async_bolt_request(req, body, addition_context_properties) ) return to_starlette_response(bolt_resp) elif req.url.path == oauth_flow.redirect_uri_path: bolt_resp = await oauth_flow.handle_callback( - to_async_bolt_request(req, body) + to_async_bolt_request(req, body, addition_context_properties) ) return to_starlette_response(bolt_resp) elif req.method == "POST": - bolt_resp = await self.app.async_dispatch(to_async_bolt_request(req, body)) + bolt_resp = await self.app.async_dispatch( + to_async_bolt_request(req, body, addition_context_properties) + ) return to_starlette_response(bolt_resp) return Response( @@ -100,7 +114,7 @@

    Module slack_bolt.adapter.starlette.async_handler

    Functions

    -def to_async_bolt_request(req: starlette.requests.Request, body: bytes) ‑> AsyncBoltRequest +def to_async_bolt_request(req: starlette.requests.Request, body: bytes, addition_context_properties: Optional[Dict[str, Any]] = None) ‑> AsyncBoltRequest
    @@ -108,12 +122,20 @@

    Functions

    Expand source code -
    def to_async_bolt_request(req: Request, body: bytes) -> AsyncBoltRequest:
    -    return AsyncBoltRequest(
    +
    def to_async_bolt_request(
    +    req: Request,
    +    body: bytes,
    +    addition_context_properties: Optional[Dict[str, Any]] = None,
    +) -> AsyncBoltRequest:
    +    request = AsyncBoltRequest(
             body=body.decode("utf-8"),
             query=req.query_params,
             headers=req.headers,
    -    )
    + ) + if addition_context_properties is not None: + for k, v in addition_context_properties.items(): + request.context[k] = v + return request
    @@ -165,23 +187,27 @@

    Classes

    def __init__(self, app: AsyncApp): # type: ignore self.app = app - async def handle(self, req: Request) -> Response: + async def handle( + self, req: Request, addition_context_properties: Optional[Dict[str, Any]] = None + ) -> Response: body = await req.body() if req.method == "GET": if self.app.oauth_flow is not None: oauth_flow: AsyncOAuthFlow = self.app.oauth_flow if req.url.path == oauth_flow.install_path: bolt_resp = await oauth_flow.handle_installation( - to_async_bolt_request(req, body) + to_async_bolt_request(req, body, addition_context_properties) ) return to_starlette_response(bolt_resp) elif req.url.path == oauth_flow.redirect_uri_path: bolt_resp = await oauth_flow.handle_callback( - to_async_bolt_request(req, body) + to_async_bolt_request(req, body, addition_context_properties) ) return to_starlette_response(bolt_resp) elif req.method == "POST": - bolt_resp = await self.app.async_dispatch(to_async_bolt_request(req, body)) + bolt_resp = await self.app.async_dispatch( + to_async_bolt_request(req, body, addition_context_properties) + ) return to_starlette_response(bolt_resp) return Response( @@ -192,7 +218,7 @@

    Classes

    Methods

    -async def handle(self, req: starlette.requests.Request) ‑> starlette.responses.Response +async def handle(self, req: starlette.requests.Request, addition_context_properties: Optional[Dict[str, Any]] = None) ‑> starlette.responses.Response
    @@ -200,23 +226,27 @@

    Methods

    Expand source code -
    async def handle(self, req: Request) -> Response:
    +
    async def handle(
    +    self, req: Request, addition_context_properties: Optional[Dict[str, Any]] = None
    +) -> Response:
         body = await req.body()
         if req.method == "GET":
             if self.app.oauth_flow is not None:
                 oauth_flow: AsyncOAuthFlow = self.app.oauth_flow
                 if req.url.path == oauth_flow.install_path:
                     bolt_resp = await oauth_flow.handle_installation(
    -                    to_async_bolt_request(req, body)
    +                    to_async_bolt_request(req, body, addition_context_properties)
                     )
                     return to_starlette_response(bolt_resp)
                 elif req.url.path == oauth_flow.redirect_uri_path:
                     bolt_resp = await oauth_flow.handle_callback(
    -                    to_async_bolt_request(req, body)
    +                    to_async_bolt_request(req, body, addition_context_properties)
                     )
                     return to_starlette_response(bolt_resp)
         elif req.method == "POST":
    -        bolt_resp = await self.app.async_dispatch(to_async_bolt_request(req, body))
    +        bolt_resp = await self.app.async_dispatch(
    +            to_async_bolt_request(req, body, addition_context_properties)
    +        )
             return to_starlette_response(bolt_resp)
     
         return Response(
    diff --git a/docs/api-docs/slack_bolt/adapter/starlette/handler.html b/docs/api-docs/slack_bolt/adapter/starlette/handler.html
    index cb77cba85..d605b274a 100644
    --- a/docs/api-docs/slack_bolt/adapter/starlette/handler.html
    +++ b/docs/api-docs/slack_bolt/adapter/starlette/handler.html
    @@ -26,19 +26,29 @@ 

    Module slack_bolt.adapter.starlette.handler

    Expand source code -
    from starlette.requests import Request
    +
    from typing import Dict, Any, Optional
    +
    +from starlette.requests import Request
     from starlette.responses import Response
     
     from slack_bolt import BoltRequest, App, BoltResponse
     from slack_bolt.oauth import OAuthFlow
     
     
    -def to_bolt_request(req: Request, body: bytes) -> BoltRequest:
    -    return BoltRequest(
    +def to_bolt_request(
    +    req: Request,
    +    body: bytes,
    +    addition_context_properties: Optional[Dict[str, Any]] = None,
    +) -> BoltRequest:
    +    request = BoltRequest(
             body=body.decode("utf-8"),
             query=req.query_params,
             headers=req.headers,
         )
    +    if addition_context_properties is not None:
    +        for k, v in addition_context_properties.items():
    +            request.context[k] = v
    +    return request
     
     
     def to_starlette_response(bolt_resp: BoltResponse) -> Response:
    @@ -66,21 +76,27 @@ 

    Module slack_bolt.adapter.starlette.handler

    def __init__(self, app: App): # type: ignore self.app = app - async def handle(self, req: Request) -> Response: + async def handle( + self, req: Request, addition_context_properties: Optional[Dict[str, Any]] = None + ) -> Response: body = await req.body() if req.method == "GET": if self.app.oauth_flow is not None: oauth_flow: OAuthFlow = self.app.oauth_flow if req.url.path == oauth_flow.install_path: bolt_resp = oauth_flow.handle_installation( - to_bolt_request(req, body) + to_bolt_request(req, body, addition_context_properties) ) return to_starlette_response(bolt_resp) elif req.url.path == oauth_flow.redirect_uri_path: - bolt_resp = oauth_flow.handle_callback(to_bolt_request(req, body)) + bolt_resp = oauth_flow.handle_callback( + to_bolt_request(req, body, addition_context_properties) + ) return to_starlette_response(bolt_resp) elif req.method == "POST": - bolt_resp = self.app.dispatch(to_bolt_request(req, body)) + bolt_resp = self.app.dispatch( + to_bolt_request(req, body, addition_context_properties) + ) return to_starlette_response(bolt_resp) return Response( @@ -97,7 +113,7 @@

    Module slack_bolt.adapter.starlette.handler

    Functions

    -def to_bolt_request(req: starlette.requests.Request, body: bytes) ‑> BoltRequest +def to_bolt_request(req: starlette.requests.Request, body: bytes, addition_context_properties: Optional[Dict[str, Any]] = None) ‑> BoltRequest
    @@ -105,12 +121,20 @@

    Functions

    Expand source code -
    def to_bolt_request(req: Request, body: bytes) -> BoltRequest:
    -    return BoltRequest(
    +
    def to_bolt_request(
    +    req: Request,
    +    body: bytes,
    +    addition_context_properties: Optional[Dict[str, Any]] = None,
    +) -> BoltRequest:
    +    request = BoltRequest(
             body=body.decode("utf-8"),
             query=req.query_params,
             headers=req.headers,
    -    )
    + ) + if addition_context_properties is not None: + for k, v in addition_context_properties.items(): + request.context[k] = v + return request
    @@ -162,21 +186,27 @@

    Classes

    def __init__(self, app: App): # type: ignore self.app = app - async def handle(self, req: Request) -> Response: + async def handle( + self, req: Request, addition_context_properties: Optional[Dict[str, Any]] = None + ) -> Response: body = await req.body() if req.method == "GET": if self.app.oauth_flow is not None: oauth_flow: OAuthFlow = self.app.oauth_flow if req.url.path == oauth_flow.install_path: bolt_resp = oauth_flow.handle_installation( - to_bolt_request(req, body) + to_bolt_request(req, body, addition_context_properties) ) return to_starlette_response(bolt_resp) elif req.url.path == oauth_flow.redirect_uri_path: - bolt_resp = oauth_flow.handle_callback(to_bolt_request(req, body)) + bolt_resp = oauth_flow.handle_callback( + to_bolt_request(req, body, addition_context_properties) + ) return to_starlette_response(bolt_resp) elif req.method == "POST": - bolt_resp = self.app.dispatch(to_bolt_request(req, body)) + bolt_resp = self.app.dispatch( + to_bolt_request(req, body, addition_context_properties) + ) return to_starlette_response(bolt_resp) return Response( @@ -187,7 +217,7 @@

    Classes

    Methods

    -async def handle(self, req: starlette.requests.Request) ‑> starlette.responses.Response +async def handle(self, req: starlette.requests.Request, addition_context_properties: Optional[Dict[str, Any]] = None) ‑> starlette.responses.Response
    @@ -195,21 +225,27 @@

    Methods

    Expand source code -
    async def handle(self, req: Request) -> Response:
    +
    async def handle(
    +    self, req: Request, addition_context_properties: Optional[Dict[str, Any]] = None
    +) -> Response:
         body = await req.body()
         if req.method == "GET":
             if self.app.oauth_flow is not None:
                 oauth_flow: OAuthFlow = self.app.oauth_flow
                 if req.url.path == oauth_flow.install_path:
                     bolt_resp = oauth_flow.handle_installation(
    -                    to_bolt_request(req, body)
    +                    to_bolt_request(req, body, addition_context_properties)
                     )
                     return to_starlette_response(bolt_resp)
                 elif req.url.path == oauth_flow.redirect_uri_path:
    -                bolt_resp = oauth_flow.handle_callback(to_bolt_request(req, body))
    +                bolt_resp = oauth_flow.handle_callback(
    +                    to_bolt_request(req, body, addition_context_properties)
    +                )
                     return to_starlette_response(bolt_resp)
         elif req.method == "POST":
    -        bolt_resp = self.app.dispatch(to_bolt_request(req, body))
    +        bolt_resp = self.app.dispatch(
    +            to_bolt_request(req, body, addition_context_properties)
    +        )
             return to_starlette_response(bolt_resp)
     
         return Response(
    diff --git a/docs/api-docs/slack_bolt/adapter/tornado/handler.html b/docs/api-docs/slack_bolt/adapter/tornado/handler.html
    index 3c1ca74b2..c41a9f48e 100644
    --- a/docs/api-docs/slack_bolt/adapter/tornado/handler.html
    +++ b/docs/api-docs/slack_bolt/adapter/tornado/handler.html
    @@ -26,7 +26,7 @@ 

    Module slack_bolt.adapter.tornado.handler

    Expand source code -
    from datetime import datetime
    +
    from datetime import datetime  # type: ignore
     
     from tornado.httputil import HTTPServerRequest
     from tornado.web import RequestHandler
    diff --git a/docs/api-docs/slack_bolt/context/async_context.html b/docs/api-docs/slack_bolt/context/async_context.html
    index a417e91b5..f20c1d0f5 100644
    --- a/docs/api-docs/slack_bolt/context/async_context.html
    +++ b/docs/api-docs/slack_bolt/context/async_context.html
    @@ -34,11 +34,29 @@ 

    Module slack_bolt.context.async_context

    from slack_bolt.context.base_context import BaseContext from slack_bolt.context.respond.async_respond import AsyncRespond from slack_bolt.context.say.async_say import AsyncSay +from slack_bolt.util.utils import create_copy class AsyncBoltContext(BaseContext): """Context object associated with a request from Slack.""" + def to_copyable(self) -> "AsyncBoltContext": + new_dict = {} + for prop_name, prop_value in self.items(): + if prop_name in self.standard_property_names: + # all the standard properties are copiable + new_dict[prop_name] = prop_value + else: + try: + copied_value = create_copy(prop_value) + new_dict[prop_name] = copied_value + except TypeError as te: + self.logger.debug( + f"Skipped settings '{prop_name}' to a copied request for lazy listeners " + f"as it's not possible to make a deep copy (error: {te})" + ) + return AsyncBoltContext(new_dict) + @property def client(self) -> Optional[AsyncWebClient]: """The `AsyncWebClient` instance available for this request. @@ -152,6 +170,23 @@

    Classes

    class AsyncBoltContext(BaseContext):
         """Context object associated with a request from Slack."""
     
    +    def to_copyable(self) -> "AsyncBoltContext":
    +        new_dict = {}
    +        for prop_name, prop_value in self.items():
    +            if prop_name in self.standard_property_names:
    +                # all the standard properties are copiable
    +                new_dict[prop_name] = prop_value
    +            else:
    +                try:
    +                    copied_value = create_copy(prop_value)
    +                    new_dict[prop_name] = copied_value
    +                except TypeError as te:
    +                    self.logger.debug(
    +                        f"Skipped settings '{prop_name}' to a copied request for lazy listeners "
    +                        f"as it's not possible to make a deep copy (error: {te})"
    +                    )
    +        return AsyncBoltContext(new_dict)
    +
         @property
         def client(self) -> Optional[AsyncWebClient]:
             """The `AsyncWebClient` instance available for this request.
    @@ -426,6 +461,36 @@ 

    Returns

    +

    Methods

    +
    +
    +def to_copyable(self) ‑> AsyncBoltContext +
    +
    +
    +
    + +Expand source code + +
    def to_copyable(self) -> "AsyncBoltContext":
    +    new_dict = {}
    +    for prop_name, prop_value in self.items():
    +        if prop_name in self.standard_property_names:
    +            # all the standard properties are copiable
    +            new_dict[prop_name] = prop_value
    +        else:
    +            try:
    +                copied_value = create_copy(prop_value)
    +                new_dict[prop_name] = copied_value
    +            except TypeError as te:
    +                self.logger.debug(
    +                    f"Skipped settings '{prop_name}' to a copied request for lazy listeners "
    +                    f"as it's not possible to make a deep copy (error: {te})"
    +                )
    +    return AsyncBoltContext(new_dict)
    +
    +
    +

    Inherited members

    diff --git a/docs/api-docs/slack_bolt/context/base_context.html b/docs/api-docs/slack_bolt/context/base_context.html index d694b9e20..fcf7bbb85 100644 --- a/docs/api-docs/slack_bolt/context/base_context.html +++ b/docs/api-docs/slack_bolt/context/base_context.html @@ -26,7 +26,10 @@

    Module slack_bolt.context.base_context

    Expand source code -
    from logging import Logger
    +
    # pytype: skip-file
    +# Note: Since 2021.12.8, the pytype code analyzer does not properly work for this file
    +
    +from logging import Logger
     from typing import Optional, Tuple
     
     from slack_bolt.authorization import AuthorizeResult
    @@ -35,6 +38,27 @@ 

    Module slack_bolt.context.base_context

    class BaseContext(dict): """Context object associated with a request from Slack.""" + standard_property_names = [ + "logger", + "token", + "enterprise_id", + "is_enterprise_install", + "team_id", + "user_id", + "channel_id", + "response_url", + "matches", + "authorize_result", + "bot_token", + "bot_id", + "bot_user_id", + "user_token", + "client", + "ack", + "say", + "respond", + ] + @property def logger(self) -> Logger: """The properly configured logger that is available for middleware/listeners.""" @@ -143,6 +167,27 @@

    Classes

    class BaseContext(dict):
         """Context object associated with a request from Slack."""
     
    +    standard_property_names = [
    +        "logger",
    +        "token",
    +        "enterprise_id",
    +        "is_enterprise_install",
    +        "team_id",
    +        "user_id",
    +        "channel_id",
    +        "response_url",
    +        "matches",
    +        "authorize_result",
    +        "bot_token",
    +        "bot_id",
    +        "bot_user_id",
    +        "user_token",
    +        "client",
    +        "ack",
    +        "say",
    +        "respond",
    +    ]
    +
         @property
         def logger(self) -> Logger:
             """The properly configured logger that is available for middleware/listeners."""
    @@ -237,6 +282,13 @@ 

    Subclasses

  • AsyncBoltContext
  • BoltContext
  • +

    Class variables

    +
    +
    var standard_property_names
    +
    +
    +
    +

    Instance variables

    var authorize_result : Optional[AuthorizeResult]
    @@ -479,6 +531,7 @@

    matches
  • response_url
  • set_authorize_result
  • +
  • standard_property_names
  • team_id
  • token
  • user_id
  • diff --git a/docs/api-docs/slack_bolt/context/context.html b/docs/api-docs/slack_bolt/context/context.html index 9cbda05ba..af4ad5f26 100644 --- a/docs/api-docs/slack_bolt/context/context.html +++ b/docs/api-docs/slack_bolt/context/context.html @@ -35,11 +35,30 @@

    Module slack_bolt.context.context

    from slack_bolt.context.base_context import BaseContext from slack_bolt.context.respond import Respond from slack_bolt.context.say import Say +from slack_bolt.util.utils import create_copy class BoltContext(BaseContext): """Context object associated with a request from Slack.""" + def to_copyable(self) -> "BoltContext": + new_dict = {} + for prop_name, prop_value in self.items(): + if prop_name in self.standard_property_names: + # all the standard properties are copiable + new_dict[prop_name] = prop_value + else: + try: + copied_value = create_copy(prop_value) + new_dict[prop_name] = copied_value + except TypeError as te: + self.logger.warning( + f"Skipped setting '{prop_name}' to a copied request for lazy listeners " + "due to a deep-copy creation error. Consider passing the value not as part of context object " + f"(error: {te})" + ) + return BoltContext(new_dict) + @property def client(self) -> Optional[WebClient]: """The `WebClient` instance available for this request. @@ -153,6 +172,24 @@

    Classes

    class BoltContext(BaseContext):
         """Context object associated with a request from Slack."""
     
    +    def to_copyable(self) -> "BoltContext":
    +        new_dict = {}
    +        for prop_name, prop_value in self.items():
    +            if prop_name in self.standard_property_names:
    +                # all the standard properties are copiable
    +                new_dict[prop_name] = prop_value
    +            else:
    +                try:
    +                    copied_value = create_copy(prop_value)
    +                    new_dict[prop_name] = copied_value
    +                except TypeError as te:
    +                    self.logger.warning(
    +                        f"Skipped setting '{prop_name}' to a copied request for lazy listeners "
    +                        "due to a deep-copy creation error. Consider passing the value not as part of context object "
    +                        f"(error: {te})"
    +                    )
    +        return BoltContext(new_dict)
    +
         @property
         def client(self) -> Optional[WebClient]:
             """The `WebClient` instance available for this request.
    @@ -427,6 +464,37 @@ 

    Returns

    +

    Methods

    +
    +
    +def to_copyable(self) ‑> BoltContext +
    +
    +
    +
    + +Expand source code + +
    def to_copyable(self) -> "BoltContext":
    +    new_dict = {}
    +    for prop_name, prop_value in self.items():
    +        if prop_name in self.standard_property_names:
    +            # all the standard properties are copiable
    +            new_dict[prop_name] = prop_value
    +        else:
    +            try:
    +                copied_value = create_copy(prop_value)
    +                new_dict[prop_name] = copied_value
    +            except TypeError as te:
    +                self.logger.warning(
    +                    f"Skipped setting '{prop_name}' to a copied request for lazy listeners "
    +                    "due to a deep-copy creation error. Consider passing the value not as part of context object "
    +                    f"(error: {te})"
    +                )
    +    return BoltContext(new_dict)
    +
    +
    +

    Inherited members

    diff --git a/docs/api-docs/slack_bolt/listener/asyncio_runner.html b/docs/api-docs/slack_bolt/listener/asyncio_runner.html index 7dc21f332..8f0a822aa 100644 --- a/docs/api-docs/slack_bolt/listener/asyncio_runner.html +++ b/docs/api-docs/slack_bolt/listener/asyncio_runner.html @@ -226,7 +226,7 @@

    Module slack_bolt.listener.asyncio_runner

    def _build_lazy_request( request: AsyncBoltRequest, lazy_func_name: str ) -> AsyncBoltRequest: - copied_request = create_copy(request) + copied_request = create_copy(request.to_copyable()) copied_request.method = "NONE" copied_request.lazy_only = True copied_request.lazy_function_name = lazy_func_name @@ -432,7 +432,7 @@

    Classes

    def _build_lazy_request( request: AsyncBoltRequest, lazy_func_name: str ) -> AsyncBoltRequest: - copied_request = create_copy(request) + copied_request = create_copy(request.to_copyable()) copied_request.method = "NONE" copied_request.lazy_only = True copied_request.lazy_function_name = lazy_func_name diff --git a/docs/api-docs/slack_bolt/listener/thread_runner.html b/docs/api-docs/slack_bolt/listener/thread_runner.html index 43c7da783..ce6a74e17 100644 --- a/docs/api-docs/slack_bolt/listener/thread_runner.html +++ b/docs/api-docs/slack_bolt/listener/thread_runner.html @@ -223,7 +223,7 @@

    Module slack_bolt.listener.thread_runner

    @staticmethod def _build_lazy_request(request: BoltRequest, lazy_func_name: str) -> BoltRequest: - copied_request = create_copy(request) + copied_request = create_copy(request.to_copyable()) copied_request.method = "NONE" copied_request.lazy_only = True copied_request.lazy_function_name = lazy_func_name @@ -432,7 +432,7 @@

    Classes

    @staticmethod def _build_lazy_request(request: BoltRequest, lazy_func_name: str) -> BoltRequest: - copied_request = create_copy(request) + copied_request = create_copy(request.to_copyable()) copied_request.method = "NONE" copied_request.lazy_only = True copied_request.lazy_function_name = lazy_func_name diff --git a/docs/api-docs/slack_bolt/request/async_request.html b/docs/api-docs/slack_bolt/request/async_request.html index 2106594cd..f415d8243 100644 --- a/docs/api-docs/slack_bolt/request/async_request.html +++ b/docs/api-docs/slack_bolt/request/async_request.html @@ -102,7 +102,16 @@

    Module slack_bolt.request.async_request

    self.lazy_function_name = self.headers.get( "x-slack-bolt-lazy-function-name", [None] )[0] - self.mode = mode
    + self.mode = mode + + def to_copyable(self) -> "AsyncBoltRequest": + return AsyncBoltRequest( + body=self.raw_body, + query=self.query, + headers=self.headers, + context=self.context.to_copyable(), + mode=self.mode, + )

    @@ -199,7 +208,16 @@

    Args

    self.lazy_function_name = self.headers.get( "x-slack-bolt-lazy-function-name", [None] )[0] - self.mode = mode
    + self.mode = mode + + def to_copyable(self) -> "AsyncBoltRequest": + return AsyncBoltRequest( + body=self.raw_body, + query=self.query, + headers=self.headers, + context=self.context.to_copyable(), + mode=self.mode, + )

    Class variables

    @@ -240,6 +258,28 @@

    Class variables

    +

    Methods

    +
    +
    +def to_copyable(self) ‑> AsyncBoltRequest +
    +
    +
    +
    + +Expand source code + +
    def to_copyable(self) -> "AsyncBoltRequest":
    +    return AsyncBoltRequest(
    +        body=self.raw_body,
    +        query=self.query,
    +        headers=self.headers,
    +        context=self.context.to_copyable(),
    +        mode=self.mode,
    +    )
    +
    +
    +

    @@ -269,6 +309,7 @@

    mode
  • query
  • raw_body
  • +
  • to_copyable
  • diff --git a/docs/api-docs/slack_bolt/request/request.html b/docs/api-docs/slack_bolt/request/request.html index deec3891a..f8fec2d0d 100644 --- a/docs/api-docs/slack_bolt/request/request.html +++ b/docs/api-docs/slack_bolt/request/request.html @@ -99,7 +99,16 @@

    Module slack_bolt.request.request

    self.lazy_function_name = self.headers.get( "x-slack-bolt-lazy-function-name", [None] )[0] - self.mode = mode
    + self.mode = mode + + def to_copyable(self) -> "BoltRequest": + return BoltRequest( + body=self.raw_body, + query=self.query, + headers=self.headers, + context=self.context.to_copyable(), + mode=self.mode, + )
    @@ -193,7 +202,16 @@

    Args

    self.lazy_function_name = self.headers.get( "x-slack-bolt-lazy-function-name", [None] )[0] - self.mode = mode + self.mode = mode + + def to_copyable(self) -> "BoltRequest": + return BoltRequest( + body=self.raw_body, + query=self.query, + headers=self.headers, + context=self.context.to_copyable(), + mode=self.mode, + )

    Class variables

    @@ -234,6 +252,28 @@

    Class variables

    +

    Methods

    +
    +
    +def to_copyable(self) ‑> BoltRequest +
    +
    +
    +
    + +Expand source code + +
    def to_copyable(self) -> "BoltRequest":
    +    return BoltRequest(
    +        body=self.raw_body,
    +        query=self.query,
    +        headers=self.headers,
    +        context=self.context.to_copyable(),
    +        mode=self.mode,
    +    )
    +
    +
    +
    @@ -263,6 +303,7 @@

    mode
  • query
  • raw_body
  • +
  • to_copyable
  • diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index 816a33b11..860e5fc2e 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.10.0"
    +__version__ = "1.11.0"
    diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 0872b5816..63a520b24 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.10.0" +__version__ = "1.11.0" From f3f47180e752d0e22a8bc745e30c9ae1fc706dbf Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 24 Dec 2021 10:40:56 +0900 Subject: [PATCH 290/719] Update tests due to Sanic's breaking change --- tests/adapter_tests_async/test_async_sanic.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/adapter_tests_async/test_async_sanic.py b/tests/adapter_tests_async/test_async_sanic.py index 0dda90ca0..d79b5de7a 100644 --- a/tests/adapter_tests_async/test_async_sanic.py +++ b/tests/adapter_tests_async/test_async_sanic.py @@ -219,9 +219,7 @@ async def test_oauth(self): async def endpoint(req: Request): return await app_handler.handle(req) - _, response = await api.asgi_client.get( - url="/slack/install", allow_redirects=False - ) + _, response = await api.asgi_client.get(url="/slack/install") assert response.status_code == 200 assert response.headers.get("content-type") == "text/html; charset=utf-8" From d7af0bc552cea79f95f54ad091d9f5fbc71cb54e Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 24 Dec 2021 11:29:08 +0900 Subject: [PATCH 291/719] Fix #552 Unable to use request body with lazy listener when socket mode is enabled (#555) --- slack_bolt/request/async_request.py | 3 +- slack_bolt/request/request.py | 3 +- .../socket_mode/test_lazy_listeners.py | 79 +++++++++++++++++ .../socket_mode/test_async_lazy_listeners.py | 84 +++++++++++++++++++ 4 files changed, 167 insertions(+), 2 deletions(-) create mode 100644 tests/adapter_tests/socket_mode/test_lazy_listeners.py create mode 100644 tests/adapter_tests_async/socket_mode/test_async_lazy_listeners.py diff --git a/slack_bolt/request/async_request.py b/slack_bolt/request/async_request.py index e590bc93b..93aa24520 100644 --- a/slack_bolt/request/async_request.py +++ b/slack_bolt/request/async_request.py @@ -77,8 +77,9 @@ def __init__( self.mode = mode def to_copyable(self) -> "AsyncBoltRequest": + body: Union[str, dict] = self.raw_body if self.mode == "http" else self.body return AsyncBoltRequest( - body=self.raw_body, + body=body, query=self.query, headers=self.headers, context=self.context.to_copyable(), diff --git a/slack_bolt/request/request.py b/slack_bolt/request/request.py index 4810d2018..f1674b20d 100644 --- a/slack_bolt/request/request.py +++ b/slack_bolt/request/request.py @@ -74,8 +74,9 @@ def __init__( self.mode = mode def to_copyable(self) -> "BoltRequest": + body: Union[str, dict] = self.raw_body if self.mode == "http" else self.body return BoltRequest( - body=self.raw_body, + body=body, query=self.query, headers=self.headers, context=self.context.to_copyable(), diff --git a/tests/adapter_tests/socket_mode/test_lazy_listeners.py b/tests/adapter_tests/socket_mode/test_lazy_listeners.py new file mode 100644 index 000000000..441dda3f5 --- /dev/null +++ b/tests/adapter_tests/socket_mode/test_lazy_listeners.py @@ -0,0 +1,79 @@ +import logging +import time + +from slack_sdk import WebClient + +from slack_bolt import App +from slack_bolt.adapter.socket_mode import SocketModeHandler +from .mock_socket_mode_server import ( + start_socket_mode_server, + stop_socket_mode_server, +) +from .mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from ...utils import remove_os_env_temporarily, restore_os_env + + +class TestSocketModeLazyListeners: + logger = logging.getLogger(__name__) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + self.web_client = WebClient( + token="xoxb-api_test", + base_url="http://localhost:8888", + ) + start_socket_mode_server(self, 3011) + time.sleep(2) # wait for the server + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + stop_socket_mode_server(self) + + def test_lazy_listener_calls(self): + + app = App(client=self.web_client) + + result = {"lazy_called": False} + + @app.shortcut("do-something") + def handle_shortcuts(ack): + ack() + + @app.event("message") + def handle_message_events(body, logger): + logger.info(body) + + def lazy_func(body): + assert body.get("command") == "/hello-socket-mode" + result["lazy_called"] = True + + app.command("/hello-socket-mode")( + ack=lambda ack: ack(), + lazy=[lazy_func], + ) + + handler = SocketModeHandler( + app_token="xapp-A111-222-xyz", + app=app, + trace_enabled=True, + ) + try: + handler.client.wss_uri = "ws://127.0.0.1:3011/link" + handler.connect() + assert handler.client.is_connected() is True + time.sleep(2) # wait for the message receiver + handler.client.send_message("foo") + + spent_time = 0 + while spent_time < 5 and result["lazy_called"] is False: + spent_time += 0.5 + time.sleep(0.5) + assert result["lazy_called"] is True + + finally: + handler.client.close() diff --git a/tests/adapter_tests_async/socket_mode/test_async_lazy_listeners.py b/tests/adapter_tests_async/socket_mode/test_async_lazy_listeners.py new file mode 100644 index 000000000..28d24c399 --- /dev/null +++ b/tests/adapter_tests_async/socket_mode/test_async_lazy_listeners.py @@ -0,0 +1,84 @@ +import asyncio + +import pytest +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.adapter.socket_mode.aiohttp import AsyncSocketModeHandler +from slack_bolt.app.async_app import AsyncApp +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env +from ...adapter_tests.socket_mode.mock_socket_mode_server import ( + start_socket_mode_server, + stop_socket_mode_server_async, +) + + +class TestSocketModeAiohttp: + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + @pytest.mark.asyncio + async def test_lazy_listeners(self): + start_socket_mode_server(self, 3021) + await asyncio.sleep(1) # wait for the server + + app = AsyncApp(client=self.web_client) + + result = {"lazy_called": False} + + @app.shortcut("do-something") + async def shortcut_handler(ack): + await ack() + + @app.event("message") + async def handle_message_events(body, logger): + logger.info(body) + + async def just_ack(ack): + await ack() + + async def lazy_func(body): + assert body.get("command") == "/hello-socket-mode" + result["lazy_called"] = True + + app.command("/hello-socket-mode")(ack=just_ack, lazy=[lazy_func]) + + handler = AsyncSocketModeHandler( + app_token="xapp-A111-222-xyz", + app=app, + ) + try: + handler.client.wss_uri = "ws://localhost:3021/link" + + await handler.connect_async() + await asyncio.sleep(2) # wait for the message receiver + await handler.client.send_message("foo") + + spent_time = 0 + while spent_time < 5 and result["lazy_called"] is False: + spent_time += 0.5 + await asyncio.sleep(0.5) + assert result["lazy_called"] is True + + finally: + await handler.client.close() + await stop_socket_mode_server_async(self) From 0b980ecfd1422dec7596232c9988d129d2d95032 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 24 Dec 2021 11:40:08 +0900 Subject: [PATCH 292/719] Upgrade pytype to 2021.12.15 --- scripts/run_pytype.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run_pytype.sh b/scripts/run_pytype.sh index 3523791e0..43f43d225 100755 --- a/scripts/run_pytype.sh +++ b/scripts/run_pytype.sh @@ -5,5 +5,5 @@ script_dir=$(dirname $0) cd ${script_dir}/.. && \ pip install -e ".[async]" && \ pip install -e ".[adapter]" && \ - pip install "pytype==2021.12.8" && \ + pip install "pytype==2021.12.15" && \ pytype slack_bolt/ From 8cf608783024b6561717598ae4db1155bd2b2f6f Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 24 Dec 2021 11:45:16 +0900 Subject: [PATCH 293/719] version 1.11.1 --- docs/api-docs/slack_bolt/request/async_request.html | 9 ++++++--- docs/api-docs/slack_bolt/request/request.html | 9 ++++++--- docs/api-docs/slack_bolt/version.html | 2 +- slack_bolt/version.py | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/docs/api-docs/slack_bolt/request/async_request.html b/docs/api-docs/slack_bolt/request/async_request.html index f415d8243..914f44d24 100644 --- a/docs/api-docs/slack_bolt/request/async_request.html +++ b/docs/api-docs/slack_bolt/request/async_request.html @@ -105,8 +105,9 @@

    Module slack_bolt.request.async_request

    self.mode = mode def to_copyable(self) -> "AsyncBoltRequest": + body: Union[str, dict] = self.raw_body if self.mode == "http" else self.body return AsyncBoltRequest( - body=self.raw_body, + body=body, query=self.query, headers=self.headers, context=self.context.to_copyable(), @@ -211,8 +212,9 @@

    Args

    self.mode = mode def to_copyable(self) -> "AsyncBoltRequest": + body: Union[str, dict] = self.raw_body if self.mode == "http" else self.body return AsyncBoltRequest( - body=self.raw_body, + body=body, query=self.query, headers=self.headers, context=self.context.to_copyable(), @@ -270,8 +272,9 @@

    Methods

    Expand source code
    def to_copyable(self) -> "AsyncBoltRequest":
    +    body: Union[str, dict] = self.raw_body if self.mode == "http" else self.body
         return AsyncBoltRequest(
    -        body=self.raw_body,
    +        body=body,
             query=self.query,
             headers=self.headers,
             context=self.context.to_copyable(),
    diff --git a/docs/api-docs/slack_bolt/request/request.html b/docs/api-docs/slack_bolt/request/request.html
    index f8fec2d0d..bec3bdea9 100644
    --- a/docs/api-docs/slack_bolt/request/request.html
    +++ b/docs/api-docs/slack_bolt/request/request.html
    @@ -102,8 +102,9 @@ 

    Module slack_bolt.request.request

    self.mode = mode def to_copyable(self) -> "BoltRequest": + body: Union[str, dict] = self.raw_body if self.mode == "http" else self.body return BoltRequest( - body=self.raw_body, + body=body, query=self.query, headers=self.headers, context=self.context.to_copyable(), @@ -205,8 +206,9 @@

    Args

    self.mode = mode def to_copyable(self) -> "BoltRequest": + body: Union[str, dict] = self.raw_body if self.mode == "http" else self.body return BoltRequest( - body=self.raw_body, + body=body, query=self.query, headers=self.headers, context=self.context.to_copyable(), @@ -264,8 +266,9 @@

    Methods

    Expand source code
    def to_copyable(self) -> "BoltRequest":
    +    body: Union[str, dict] = self.raw_body if self.mode == "http" else self.body
         return BoltRequest(
    -        body=self.raw_body,
    +        body=body,
             query=self.query,
             headers=self.headers,
             context=self.context.to_copyable(),
    diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html
    index 860e5fc2e..b2166e22a 100644
    --- a/docs/api-docs/slack_bolt/version.html
    +++ b/docs/api-docs/slack_bolt/version.html
    @@ -28,7 +28,7 @@ 

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.11.0"
    +__version__ = "1.11.1"
    diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 63a520b24..df976cb3e 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.11.0" +__version__ = "1.11.1" From 0ee6bb7e382798707d2baa595a958c24fcde2f7d Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 18 Jan 2022 07:34:13 +0900 Subject: [PATCH 294/719] Fix #561 matchers can be called even when app.message keyword does not match (#577) * Fix #561 matchers can be called even when app.message keyword does not match * Fix a bug --- slack_bolt/app/app.py | 4 +- slack_bolt/app/async_app.py | 4 +- slack_bolt/listener_matcher/builtins.py | 94 +++++++++++++++------- tests/scenario_tests/test_message.py | 18 +++++ tests/scenario_tests_async/test_message.py | 23 +++++- 5 files changed, 107 insertions(+), 36 deletions(-) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index e3eea413f..7f6627026 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -810,7 +810,9 @@ def __call__(*args, **kwargs): "thread_broadcast", ), } - primary_matcher = builtin_matchers.event(constraints=constraints) + primary_matcher = builtin_matchers.message_event( + keyword=keyword, constraints=constraints + ) middleware.insert(0, MessageListenerMatches(keyword)) return self._register_listener( list(functions), primary_matcher, matchers, middleware, True diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index e44d1d59d..a479e0d90 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -860,8 +860,8 @@ def __call__(*args, **kwargs): "thread_broadcast", ), } - primary_matcher = builtin_matchers.event( - constraints=constraints, asyncio=True + primary_matcher = builtin_matchers.message_event( + constraints=constraints, keyword=keyword, asyncio=True ) middleware.insert(0, AsyncMessageListenerMatches(keyword)) return self._register_listener( diff --git a/slack_bolt/listener_matcher/builtins.py b/slack_bolt/listener_matcher/builtins.py index cffcf95c1..1b46183a6 100644 --- a/slack_bolt/listener_matcher/builtins.py +++ b/slack_bolt/listener_matcher/builtins.py @@ -1,5 +1,6 @@ # pytype: skip-file import inspect +import re import sys from slack_bolt.error import BoltError @@ -95,37 +96,10 @@ def func(body: Dict[str, Any]) -> bool: def func(body: Dict[str, Any]) -> bool: if is_event(body): - event = body["event"] - if not _matches(constraints["type"], event["type"]): - return False - if "subtype" in constraints: - expected_subtype: Union[ - str, Sequence[Optional[Union[str, Pattern]]] - ] = constraints["subtype"] - if expected_subtype is None: - # "subtype" in constraints is intentionally None for this pattern - return "subtype" not in event - elif isinstance(expected_subtype, (str, Pattern)): - return "subtype" in event and _matches( - expected_subtype, event["subtype"] - ) - elif isinstance(expected_subtype, Sequence): - subtypes: Sequence[ - Optional[Union[str, Pattern]] - ] = expected_subtype - for expected in subtypes: - actual: Optional[str] = event.get("subtype") - if expected is None: - if actual is None: - return True - elif actual is not None and _matches(expected, actual): - return True - return False - else: - return "subtype" in event and _matches( - expected_subtype, event["subtype"] - ) - return True + return _check_event_subtype( + event_payload=body["event"], + constraints=constraints, + ) return False return build_listener_matcher(func, asyncio) @@ -135,6 +109,64 @@ def func(body: Dict[str, Any]) -> bool: ) +def message_event( + constraints: Dict[str, Union[str, Sequence[Optional[Union[str, Pattern]]]]], + keyword: Union[str, Pattern], + asyncio: bool = False, +) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: + if "type" in constraints and keyword is not None: + _verify_message_event_type(constraints["type"]) + + def func(body: Dict[str, Any]) -> bool: + if is_event(body): + is_valid_subtype = _check_event_subtype( + event_payload=body["event"], + constraints=constraints, + ) + if is_valid_subtype is True: + # Check keyword matching + text = body.get("event", {}).get("text", "") + match_result = re.findall(keyword, text) + if match_result is not None and match_result != []: + return True + return False + + return build_listener_matcher(func, asyncio) + + raise BoltError(f"event ({constraints}: {type(constraints)}) must be dict") + + +def _check_event_subtype(event_payload: dict, constraints: dict) -> bool: + if not _matches(constraints["type"], event_payload["type"]): + return False + if "subtype" in constraints: + expected_subtype: Union[ + str, Sequence[Optional[Union[str, Pattern]]] + ] = constraints["subtype"] + if expected_subtype is None: + # "subtype" in constraints is intentionally None for this pattern + return "subtype" not in event_payload + elif isinstance(expected_subtype, (str, Pattern)): + return "subtype" in event_payload and _matches( + expected_subtype, event_payload["subtype"] + ) + elif isinstance(expected_subtype, Sequence): + subtypes: Sequence[Optional[Union[str, Pattern]]] = expected_subtype + for expected in subtypes: + actual: Optional[str] = event_payload.get("subtype") + if expected is None: + if actual is None: + return True + elif actual is not None and _matches(expected, actual): + return True + return False + else: + return "subtype" in event_payload and _matches( + expected_subtype, event_payload["subtype"] + ) + return True + + def _verify_message_event_type(event_type: str) -> None: if isinstance(event_type, str) and event_type.startswith("message."): raise ValueError(error_message_event_type(event_type)) diff --git a/tests/scenario_tests/test_message.py b/tests/scenario_tests/test_message.py index a7f7c0be0..e3fca87e7 100644 --- a/tests/scenario_tests/test_message.py +++ b/tests/scenario_tests/test_message.py @@ -205,6 +205,24 @@ def second(): assert called["first"] == False assert called["second"] == True + def test_issue_561_matchers(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + def just_fail(): + raise "This matcher should not be called!" + + @app.message("xxx", matchers=[just_fail]) + def just_ack(): + raise "This listener should not be called!" + + request = self.build_request() + response = app.dispatch(request) + assert response.status == 404 + assert_auth_test_count(self, 1) + message_body = { "token": "verification_token", diff --git a/tests/scenario_tests_async/test_message.py b/tests/scenario_tests_async/test_message.py index 43600363e..a7bcd1ab7 100644 --- a/tests/scenario_tests_async/test_message.py +++ b/tests/scenario_tests_async/test_message.py @@ -219,8 +219,27 @@ async def second(): assert response.status == 200 await asyncio.sleep(0.3) - assert called["first"] == False - assert called["second"] == True + assert called["first"] is False + assert called["second"] is True + + @pytest.mark.asyncio + async def test_issue_561_matchers(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + async def just_fail(): + raise "This matcher should not be called!" + + @app.message("xxx", matchers=[just_fail]) + async def just_ack(): + raise "This listener should not be called!" + + request = self.build_request() + response = await app.async_dispatch(request) + assert response.status == 404 + await assert_auth_test_count_async(self, 1) message_body = { From 5ecf7e368c139c6a97ddf508131b35b1482bcc80 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 18 Jan 2022 08:04:13 +0900 Subject: [PATCH 295/719] Improve the built-in authorize for better support of user-scope only installations (#576) --- slack_bolt/app/app.py | 1 + slack_bolt/app/async_app.py | 1 + slack_bolt/authorization/async_authorize.py | 109 +++++++++----- slack_bolt/authorization/authorize.py | 123 ++++++++++----- tests/mock_web_api_server.py | 114 ++++++++++---- .../authorization/test_authorize.py | 140 +++++++++++++++++ .../authorization/test_async_authorize.py | 142 ++++++++++++++++++ 7 files changed, 529 insertions(+), 101 deletions(-) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 7f6627026..2679dca01 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -231,6 +231,7 @@ def message_hello(message, say): client_secret=settings.client_secret if settings is not None else None, logger=self._framework_logger, bot_only=installation_store_bot_only, + client=self._client, # for proxy use cases etc. ) self._oauth_flow: Optional[OAuthFlow] = None diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index a479e0d90..b80b650c8 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -239,6 +239,7 @@ async def message_hello(message, say): # async function client_secret=settings.client_secret if settings is not None else None, logger=self._framework_logger, bot_only=installation_store_bot_only, + client=self._async_client, # for proxy use cases etc. ) self._async_oauth_flow: Optional[AsyncOAuthFlow] = None diff --git a/slack_bolt/authorization/async_authorize.py b/slack_bolt/authorization/async_authorize.py index 09aa9c179..6d37924c5 100644 --- a/slack_bolt/authorization/async_authorize.py +++ b/slack_bolt/authorization/async_authorize.py @@ -8,6 +8,7 @@ AsyncInstallationStore, ) from slack_sdk.oauth.token_rotation.async_rotator import AsyncTokenRotator +from slack_sdk.web.async_client import AsyncWebClient from slack_bolt.authorization.async_authorize_args import AsyncAuthorizeArgs from slack_bolt.authorization import AuthorizeResult @@ -124,6 +125,7 @@ def __init__( # use only InstallationStore#find_bot(enterprise_id, team_id) bot_only: bool = False, cache_enabled: bool = False, + client: Optional[AsyncWebClient] = None, ): self.logger = logger self.installation_store = installation_store @@ -136,6 +138,7 @@ def __init__( self.token_rotator = AsyncTokenRotator( client_id=client_id, client_secret=client_secret, + client=client, ) else: self.token_rotator = None @@ -168,23 +171,35 @@ async def __call__( try: # Note that this is the latest information for the org/workspace. # The installer may not be the user associated with this incoming request. - installation: Optional[ + latest_installation: Optional[ Installation ] = await self.installation_store.async_find_installation( enterprise_id=enterprise_id, team_id=team_id, is_enterprise_install=context.is_enterprise_install, ) - - if installation is not None: - if installation.user_id != user_id: + # If the user_token in the latest_installation is not for the user associated with this request, + # we'll fetch a different installation for the user below + # The example use cases are: + # - The app's installation requires both bot and user tokens + # - The app has two installation paths 1) bot installation 2) individual user authorization + this_user_installation: Optional[Installation] = None + + if latest_installation is not None: + # Save the latest bot token + bot_token = latest_installation.bot_token # this still can be None + user_token = ( + latest_installation.user_token + ) # this still can be None + + if latest_installation.user_id != user_id: # First off, remove the user token as the installer is a different user - installation.user_token = None - installation.user_scopes = [] + latest_installation.user_token = None + latest_installation.user_scopes = [] # try to fetch the request user's installation # to reflect the user's access token if exists - user_installation = ( + this_user_installation = ( await self.installation_store.async_find_installation( enterprise_id=enterprise_id, team_id=team_id, @@ -192,41 +207,42 @@ async def __call__( is_enterprise_install=context.is_enterprise_install, ) ) - if user_installation is not None: - # Overwrite the installation with the one for this user - installation = user_installation - - bot_token, user_token = ( - installation.bot_token, - installation.user_token, - ) - - if ( - installation.user_refresh_token is not None - or installation.bot_refresh_token is not None - ): - if self.token_rotator is None: - raise BoltError(self._config_error_message) - refreshed = await self.token_rotator.perform_token_rotation( - installation=installation, - minutes_before_expiration=self.token_rotation_expiration_minutes, - ) - if refreshed is not None: - await self.installation_store.async_save(refreshed) - bot_token, user_token = ( - refreshed.bot_token, - refreshed.user_token, + if this_user_installation is not None: + user_token = this_user_installation.user_token + if latest_installation.bot_token is None: + # If latest_installation has a bot token, we never overwrite the value + bot_token = this_user_installation.bot_token + + # If token rotation is enabled, running rotation may be needed here + refreshed = await self._rotate_and_save_tokens_if_necessary( + this_user_installation ) + if refreshed is not None: + user_token = refreshed.user_token + if latest_installation.bot_token is None: + # If latest_installation has a bot token, we never overwrite the value + bot_token = refreshed.bot_token + + # If token rotation is enabled, running rotation may be needed here + refreshed = await self._rotate_and_save_tokens_if_necessary( + latest_installation + ) + if refreshed is not None: + bot_token = refreshed.bot_token + if this_user_installation is None: + # Only when we don't have `this_user_installation` here, + # the `user_token` is for the user associated with this request + user_token = refreshed.user_token except NotImplementedError as _: self.find_installation_available = False if ( - # If you intentionally use only find_bot / delete_bot, + # If you intentionally use only `find_bot` / `delete_bot`, self.bot_only - # If find_installation method is not available, + # If the `find_installation` method is not available, or not self.find_installation_available - # If find_installation did not return data and find_bot method is available, + # If the `find_installation` method did not return data and find_bot method is available, or ( self.find_bot_available is True and bot_token is None @@ -294,3 +310,28 @@ def _debug_log_for_not_found( "No installation data found " f"for enterprise_id: {enterprise_id} team_id: {team_id}" ) + + async def _rotate_and_save_tokens_if_necessary( + self, installation: Optional[Installation] + ) -> Optional[Installation]: + if installation is None or ( + installation.user_refresh_token is None + and installation.bot_refresh_token is None + ): + # No need to rotate tokens + return None + + if self.token_rotator is None: + # Token rotation is required but this Bolt app is not properly configured + raise BoltError(self._config_error_message) + + refreshed: Optional[ + Installation + ] = await self.token_rotator.perform_token_rotation( + installation=installation, + minutes_before_expiration=self.token_rotation_expiration_minutes, + ) + if refreshed is not None: + # Save the refreshed data in database for following requests + await self.installation_store.async_save(refreshed) + return refreshed diff --git a/slack_bolt/authorization/authorize.py b/slack_bolt/authorization/authorize.py index aaa4d2ed4..5cd9a0193 100644 --- a/slack_bolt/authorization/authorize.py +++ b/slack_bolt/authorization/authorize.py @@ -4,9 +4,10 @@ from slack_sdk.errors import SlackApiError from slack_sdk.oauth import InstallationStore -from slack_sdk.oauth.installation_store import Bot +from slack_sdk.oauth.installation_store.models.bot import Bot from slack_sdk.oauth.installation_store.models.installation import Installation from slack_sdk.oauth.token_rotation.rotator import TokenRotator +from slack_sdk.web import WebClient from slack_bolt.authorization.authorize_args import AuthorizeArgs from slack_bolt.authorization.authorize_result import AuthorizeResult @@ -33,8 +34,8 @@ def __call__( class CallableAuthorize(Authorize): - """When you pass the authorize argument in AsyncApp constructor, - This authorize implementation will be used. + """When you pass the `authorize` argument in AsyncApp constructor, + This `authorize` implementation will be used. """ def __init__( @@ -102,9 +103,9 @@ def __call__( class InstallationStoreAuthorize(Authorize): - """If you use the OAuth flow settings, this authorize implementation will be used. + """If you use the OAuth flow settings, this `authorize` implementation will be used. As long as your own InstallationStore (or the built-in ones) works as you expect, - you can expect that the authorize layer should work for you without any customization. + you can expect that the `authorize` layer should work for you without any customization. """ authorize_result_cache: Dict[str, AuthorizeResult] @@ -129,6 +130,7 @@ def __init__( # use only InstallationStore#find_bot(enterprise_id, team_id) bot_only: bool = False, cache_enabled: bool = False, + client: Optional[WebClient] = None, ): self.logger = logger self.installation_store = installation_store @@ -143,6 +145,7 @@ def __init__( self.token_rotator = TokenRotator( client_id=client_id, client_secret=client_secret, + client=client, ) else: self.token_rotator = None @@ -168,61 +171,78 @@ def __call__( try: # Note that this is the latest information for the org/workspace. # The installer may not be the user associated with this incoming request. - installation: Optional[ + latest_installation: Optional[ Installation ] = self.installation_store.find_installation( enterprise_id=enterprise_id, team_id=team_id, is_enterprise_install=context.is_enterprise_install, ) - if installation is not None: - if installation.user_id != user_id: + # If the user_token in the latest_installation is not for the user associated with this request, + # we'll fetch a different installation for the user below. + # The example use cases are: + # - The app's installation requires both bot and user tokens + # - The app has two installation paths 1) bot installation 2) individual user authorization + this_user_installation: Optional[Installation] = None + + if latest_installation is not None: + # Save the latest bot token + bot_token = latest_installation.bot_token # this still can be None + user_token = ( + latest_installation.user_token + ) # this still can be None + + if latest_installation.user_id != user_id: # First off, remove the user token as the installer is a different user - installation.user_token = None - installation.user_scopes = [] + latest_installation.user_token = None + latest_installation.user_scopes = [] # try to fetch the request user's installation # to reflect the user's access token if exists - user_installation = self.installation_store.find_installation( - enterprise_id=enterprise_id, - team_id=team_id, - user_id=user_id, - is_enterprise_install=context.is_enterprise_install, + this_user_installation = ( + self.installation_store.find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + user_id=user_id, + is_enterprise_install=context.is_enterprise_install, + ) ) - if user_installation is not None: - # Overwrite the installation with the one for this user - installation = user_installation + if this_user_installation is not None: + user_token = this_user_installation.user_token + if latest_installation.bot_token is None: + # If latest_installation has a bot token, we never overwrite the value + bot_token = this_user_installation.bot_token - bot_token, user_token = ( - installation.bot_token, - installation.user_token, - ) - if ( - installation.user_refresh_token is not None - or installation.bot_refresh_token is not None - ): - if self.token_rotator is None: - raise BoltError(self._config_error_message) - refreshed = self.token_rotator.perform_token_rotation( - installation=installation, - minutes_before_expiration=self.token_rotation_expiration_minutes, - ) - if refreshed is not None: - self.installation_store.save(refreshed) - bot_token, user_token = ( - refreshed.bot_token, - refreshed.user_token, + # If token rotation is enabled, running rotation may be needed here + refreshed = self._rotate_and_save_tokens_if_necessary( + this_user_installation ) + if refreshed is not None: + user_token = refreshed.user_token + if latest_installation.bot_token is None: + # If latest_installation has a bot token, we never overwrite the value + bot_token = refreshed.bot_token + + # If token rotation is enabled, running rotation may be needed here + refreshed = self._rotate_and_save_tokens_if_necessary( + latest_installation + ) + if refreshed is not None: + bot_token = refreshed.bot_token + if this_user_installation is None: + # Only when we don't have `this_user_installation` here, + # the `user_token` is for the user associated with this request + user_token = refreshed.user_token except NotImplementedError as _: self.find_installation_available = False if ( - # If you intentionally use only find_bot / delete_bot, + # If you intentionally use only `find_bot` / `delete_bot`, self.bot_only - # If find_installation method is not available, + # If the `find_installation` method is not available, or not self.find_installation_available - # If find_installation did not return data and find_bot method is available, + # If the `find_installation` method did not return data and find_bot method is available, or ( self.find_bot_available is True and bot_token is None @@ -290,3 +310,26 @@ def _debug_log_for_not_found( "No installation data found " f"for enterprise_id: {enterprise_id} team_id: {team_id}" ) + + def _rotate_and_save_tokens_if_necessary( + self, installation: Optional[Installation] + ) -> Optional[Installation]: + if installation is None or ( + installation.user_refresh_token is None + and installation.bot_refresh_token is None + ): + # No need to rotate tokens + return None + + if self.token_rotator is None: + # Token rotation is required but this Bolt app is not properly configured + raise BoltError(self._config_error_message) + + refreshed: Optional[Installation] = self.token_rotator.perform_token_rotation( + installation=installation, + minutes_before_expiration=self.token_rotation_expiration_minutes, + ) + if refreshed is not None: + # Save the refreshed data in database for following requests + self.installation_store.save(refreshed) + return refreshed diff --git a/tests/mock_web_api_server.py b/tests/mock_web_api_server.py index 2c3204912..6c905f8b5 100644 --- a/tests/mock_web_api_server.py +++ b/tests/mock_web_api_server.py @@ -6,7 +6,7 @@ import time from http import HTTPStatus from http.server import HTTPServer, SimpleHTTPRequestHandler -from typing import Type +from typing import Type, Optional from unittest import TestCase from urllib.parse import urlparse, parse_qs, ParseResult @@ -65,7 +65,46 @@ def set_common_headers(self): "token_type": "user" } } - """ +""" + oauth_v2_access_bot_refresh_response = """ + { + "ok": true, + "app_id": "A0KRD7HC3", + "access_token": "xoxb-valid-refreshed", + "expires_in": 43200, + "refresh_token": "xoxe-1-valid-bot-refreshed", + "token_type": "bot", + "scope": "chat:write,commands", + "bot_user_id": "U0KRQLJ9H", + "team": { + "name": "Slack Softball Team", + "id": "T9TK3CUKW" + }, + "enterprise": { + "name": "slack-sports", + "id": "E12345678" + } + } +""" + oauth_v2_access_user_refresh_response = """ + { + "ok": true, + "app_id": "A0KRD7HC3", + "access_token": "xoxp-valid-refreshed", + "expires_in": 43200, + "refresh_token": "xoxe-1-valid-user-refreshed", + "token_type": "user", + "scope": "search:read", + "team": { + "name": "Slack Softball Team", + "id": "T9TK3CUKW" + }, + "enterprise": { + "name": "slack-sports", + "id": "E12345678" + } + } + """ bot_auth_test_response = """ { "ok": true, @@ -108,10 +147,31 @@ def _handle(self): body = {"ok": True} if path == "/oauth.v2.access": - self.send_response(200) - self.set_common_headers() - self.wfile.write(self.oauth_v2_access_response.encode("utf-8")) - return + if self.headers.get("authorization") is not None: + request_body = self._parse_request_body( + parsed_path=parsed_path, + content_len=int(self.headers.get("Content-Length") or 0), + ) + self.logger.info(f"request body: {request_body}") + + if request_body.get("grant_type") == "refresh_token": + if "bot-valid" in request_body.get("refresh_token"): + self.send_response(200) + self.set_common_headers() + body = self.oauth_v2_access_bot_refresh_response + self.wfile.write(body.encode("utf-8")) + return + if "user-valid" in request_body.get("refresh_token"): + self.send_response(200) + self.set_common_headers() + body = self.oauth_v2_access_user_refresh_response + self.wfile.write(body.encode("utf-8")) + return + if request_body.get("code") is not None: + self.send_response(200) + self.set_common_headers() + self.wfile.write(self.oauth_v2_access_response.encode("utf-8")) + return if self.is_valid_user_token(): if path == "/auth.test": @@ -127,27 +187,10 @@ def _handle(self): self.wfile.write(self.bot_auth_test_response.encode("utf-8")) return - len_header = self.headers.get("Content-Length") or 0 - content_len = int(len_header) - post_body = self.rfile.read(content_len) - request_body = None - if post_body: - try: - post_body = post_body.decode("utf-8") - if post_body.startswith("{"): - request_body = json.loads(post_body) - else: - request_body = { - k: v[0] for k, v in parse_qs(post_body).items() - } - except UnicodeDecodeError: - pass - else: - if parsed_path and parsed_path.query: - request_body = { - k: v[0] for k, v in parse_qs(parsed_path.query).items() - } - + request_body = self._parse_request_body( + parsed_path=parsed_path, + content_len=int(self.headers.get("Content-Length") or 0), + ) self.logger.info(f"request: {path} {request_body}") header = self.headers["authorization"] @@ -175,6 +218,23 @@ def do_GET(self): def do_POST(self): self._handle() + def _parse_request_body(self, parsed_path: str, content_len: int) -> Optional[dict]: + post_body = self.rfile.read(content_len) + request_body = None + if post_body: + try: + post_body = post_body.decode("utf-8") + if post_body.startswith("{"): + request_body = json.loads(post_body) + else: + request_body = {k: v[0] for k, v in parse_qs(post_body).items()} + except UnicodeDecodeError: + pass + else: + if parsed_path and parsed_path.query: + request_body = {k: v[0] for k, v in parse_qs(parsed_path.query).items()} + return request_body + # # multiprocessing diff --git a/tests/slack_bolt/authorization/test_authorize.py b/tests/slack_bolt/authorization/test_authorize.py index eb5c02087..c4d64a91d 100644 --- a/tests/slack_bolt/authorization/test_authorize.py +++ b/tests/slack_bolt/authorization/test_authorize.py @@ -10,6 +10,7 @@ from slack_bolt import BoltContext from slack_bolt.authorization.authorize import InstallationStoreAuthorize, Authorize +from slack_bolt.error import BoltError from tests.mock_web_api_server import ( cleanup_mock_web_api_server, setup_mock_web_api_server, @@ -195,6 +196,55 @@ def test_installation_store_cached(self): assert result.user_token == "xoxp-valid" assert_auth_test_count(self, 1) # cached + def test_fetch_different_user_token(self): + installation_store = ValidUserTokenInstallationStore() + authorize = InstallationStoreAuthorize( + logger=installation_store.logger, installation_store=installation_store + ) + context = BoltContext() + context["client"] = WebClient(base_url=self.mock_api_server_base_url) + result = authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W222" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.bot_token == "xoxb-valid" + assert result.user_token == "xoxp-valid" + assert_auth_test_count(self, 1) + + def test_fetch_different_user_token_with_rotation(self): + context = BoltContext() + mock_client = WebClient(base_url=self.mock_api_server_base_url) + context["client"] = mock_client + + installation_store = ValidUserTokenRotationInstallationStore() + invalid_authorize = InstallationStoreAuthorize( + logger=installation_store.logger, installation_store=installation_store + ) + with pytest.raises(BoltError): + invalid_authorize( + context=context, + enterprise_id="E111", + team_id="T0G9PQBBK", + user_id="W222", + ) + + authorize = InstallationStoreAuthorize( + client_id="111.222", + client_secret="secret", + client=mock_client, + logger=installation_store.logger, + installation_store=installation_store, + ) + result = authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W222" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.bot_token == "xoxb-valid-refreshed" + assert result.user_token == "xoxp-valid-refreshed" + assert_auth_test_count(self, 1) + class LegacyMemoryInstallationStore(InstallationStore): @property @@ -257,3 +307,93 @@ def find_installation( is_enterprise_install: Optional[bool] = False, ) -> Optional[Installation]: raise ValueError + + +class ValidUserTokenInstallationStore(InstallationStore): + @property + def logger(self) -> Logger: + return logging.getLogger(__name__) + + def save(self, installation: Installation): + pass + + def find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + if user_id is None: + return Installation( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + user_id="W11111", + user_token="xoxp-different-installer", + user_scopes=["search:read"], + installed_at=datetime.datetime.now().timestamp(), + ) + elif user_id == "W222": + return Installation( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + user_id="W222", + user_token="xoxp-valid", + user_scopes=["search:read"], + installed_at=datetime.datetime.now().timestamp(), + ) + + +class ValidUserTokenRotationInstallationStore(InstallationStore): + @property + def logger(self) -> Logger: + return logging.getLogger(__name__) + + def save(self, installation: Installation): + pass + + def find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + if user_id is None: + return Installation( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid", + bot_refresh_token="xoxe-bot-valid", + bot_token_expires_in=-10, + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + user_id="W11111", + user_token="xoxp-different-installer", + user_refresh_token="xoxe-1-user-valid", + user_token_expires_in=-10, + user_scopes=["search:read"], + installed_at=datetime.datetime.now().timestamp(), + ) + elif user_id == "W222": + return Installation( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + user_id="W222", + user_token="xoxp-valid", + user_refresh_token="xoxe-1-user-valid", + user_token_expires_in=-10, + user_scopes=["search:read"], + installed_at=datetime.datetime.now().timestamp(), + ) diff --git a/tests/slack_bolt_async/authorization/test_async_authorize.py b/tests/slack_bolt_async/authorization/test_async_authorize.py index a19190ae5..495d70302 100644 --- a/tests/slack_bolt_async/authorization/test_async_authorize.py +++ b/tests/slack_bolt_async/authorization/test_async_authorize.py @@ -16,6 +16,7 @@ AsyncAuthorize, ) from slack_bolt.context.async_context import AsyncBoltContext +from slack_bolt.error import BoltError from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, @@ -220,6 +221,57 @@ async def test_installation_store_cached(self): assert result.user_token == "xoxp-valid" await assert_auth_test_count_async(self, 1) # cached + @pytest.mark.asyncio + async def test_fetch_different_user_token(self): + installation_store = ValidUserTokenInstallationStore() + authorize = AsyncInstallationStoreAuthorize( + logger=installation_store.logger, installation_store=installation_store + ) + context = AsyncBoltContext() + context["client"] = AsyncWebClient(base_url=self.mock_api_server_base_url) + result = await authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W222" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.bot_token == "xoxb-valid" + assert result.user_token == "xoxp-valid" + await assert_auth_test_count_async(self, 1) + + @pytest.mark.asyncio + async def test_fetch_different_user_token_with_rotation(self): + context = AsyncBoltContext() + mock_client = AsyncWebClient(base_url=self.mock_api_server_base_url) + context["client"] = mock_client + + installation_store = ValidUserTokenRotationInstallationStore() + invalid_authorize = AsyncInstallationStoreAuthorize( + logger=installation_store.logger, installation_store=installation_store + ) + with pytest.raises(BoltError): + await invalid_authorize( + context=context, + enterprise_id="E111", + team_id="T0G9PQBBK", + user_id="W222", + ) + + authorize = AsyncInstallationStoreAuthorize( + client_id="111.222", + client_secret="secret", + client=mock_client, + logger=installation_store.logger, + installation_store=installation_store, + ) + result = await authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W222" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.bot_token == "xoxb-valid-refreshed" + assert result.user_token == "xoxp-valid-refreshed" + await assert_auth_test_count_async(self, 1) + class LegacyMemoryInstallationStore(AsyncInstallationStore): @property @@ -282,3 +334,93 @@ async def async_find_installation( is_enterprise_install: Optional[bool] = False, ) -> Optional[Installation]: raise ValueError + + +class ValidUserTokenInstallationStore(AsyncInstallationStore): + @property + def logger(self) -> Logger: + return logging.getLogger(__name__) + + async def async_save(self, installation: Installation): + pass + + async def async_find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + if user_id is None: + return Installation( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + user_id="W11111", + user_token="xoxp-different-installer", + user_scopes=["search:read"], + installed_at=datetime.datetime.now().timestamp(), + ) + elif user_id == "W222": + return Installation( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + user_id="W222", + user_token="xoxp-valid", + user_scopes=["search:read"], + installed_at=datetime.datetime.now().timestamp(), + ) + + +class ValidUserTokenRotationInstallationStore(AsyncInstallationStore): + @property + def logger(self) -> Logger: + return logging.getLogger(__name__) + + async def async_save(self, installation: Installation): + pass + + async def async_find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + if user_id is None: + return Installation( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid", + bot_refresh_token="xoxe-bot-valid", + bot_token_expires_in=-10, + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + user_id="W11111", + user_token="xoxp-different-installer", + user_refresh_token="xoxe-1-user-valid", + user_token_expires_in=-10, + user_scopes=["search:read"], + installed_at=datetime.datetime.now().timestamp(), + ) + elif user_id == "W222": + return Installation( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + user_id="W222", + user_token="xoxp-valid", + user_refresh_token="xoxe-1-user-valid", + user_token_expires_in=-10, + user_scopes=["search:read"], + installed_at=datetime.datetime.now().timestamp(), + ) From ce85fa0c1d45c649978c7c6710d177fe01f756e2 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 18 Jan 2022 08:07:15 +0900 Subject: [PATCH 296/719] version 1.11.2 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index df976cb3e..692c2d5b1 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.11.1" +__version__ = "1.11.2" From cb3891bb0be1405d851d61efa73dd6fd66915eba Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 18 Jan 2022 08:13:11 +0900 Subject: [PATCH 297/719] Update the API docs --- docs/api-docs/slack_bolt/app/app.html | 14 +- docs/api-docs/slack_bolt/app/async_app.html | 14 +- .../authorization/async_authorize.html | 223 ++++++++++----- .../slack_bolt/authorization/authorize.html | 261 ++++++++++++------ .../slack_bolt/listener_matcher/builtins.html | 166 ++++++----- docs/api-docs/slack_bolt/version.html | 2 +- 6 files changed, 449 insertions(+), 231 deletions(-) diff --git a/docs/api-docs/slack_bolt/app/app.html b/docs/api-docs/slack_bolt/app/app.html index 35b39c817..1d80827e2 100644 --- a/docs/api-docs/slack_bolt/app/app.html +++ b/docs/api-docs/slack_bolt/app/app.html @@ -259,6 +259,7 @@

    Module slack_bolt.app.app

    client_secret=settings.client_secret if settings is not None else None, logger=self._framework_logger, bot_only=installation_store_bot_only, + client=self._client, # for proxy use cases etc. ) self._oauth_flow: Optional[OAuthFlow] = None @@ -838,7 +839,9 @@

    Module slack_bolt.app.app

    "thread_broadcast", ), } - primary_matcher = builtin_matchers.event(constraints=constraints) + primary_matcher = builtin_matchers.message_event( + keyword=keyword, constraints=constraints + ) middleware.insert(0, MessageListenerMatches(keyword)) return self._register_listener( list(functions), primary_matcher, matchers, middleware, True @@ -1724,6 +1727,7 @@

    Args

    client_secret=settings.client_secret if settings is not None else None, logger=self._framework_logger, bot_only=installation_store_bot_only, + client=self._client, # for proxy use cases etc. ) self._oauth_flow: Optional[OAuthFlow] = None @@ -2303,7 +2307,9 @@

    Args

    "thread_broadcast", ), } - primary_matcher = builtin_matchers.event(constraints=constraints) + primary_matcher = builtin_matchers.message_event( + keyword=keyword, constraints=constraints + ) middleware.insert(0, MessageListenerMatches(keyword)) return self._register_listener( list(functions), primary_matcher, matchers, middleware, True @@ -3656,7 +3662,9 @@

    Args

    "thread_broadcast", ), } - primary_matcher = builtin_matchers.event(constraints=constraints) + primary_matcher = builtin_matchers.message_event( + keyword=keyword, constraints=constraints + ) middleware.insert(0, MessageListenerMatches(keyword)) return self._register_listener( list(functions), primary_matcher, matchers, middleware, True diff --git a/docs/api-docs/slack_bolt/app/async_app.html b/docs/api-docs/slack_bolt/app/async_app.html index 2eb4079e2..f9c3059ca 100644 --- a/docs/api-docs/slack_bolt/app/async_app.html +++ b/docs/api-docs/slack_bolt/app/async_app.html @@ -267,6 +267,7 @@

    Module slack_bolt.app.async_app

    client_secret=settings.client_secret if settings is not None else None, logger=self._framework_logger, bot_only=installation_store_bot_only, + client=self._async_client, # for proxy use cases etc. ) self._async_oauth_flow: Optional[AsyncOAuthFlow] = None @@ -888,8 +889,8 @@

    Module slack_bolt.app.async_app

    "thread_broadcast", ), } - primary_matcher = builtin_matchers.event( - constraints=constraints, asyncio=True + primary_matcher = builtin_matchers.message_event( + constraints=constraints, keyword=keyword, asyncio=True ) middleware.insert(0, AsyncMessageListenerMatches(keyword)) return self._register_listener( @@ -1658,6 +1659,7 @@

    Args

    client_secret=settings.client_secret if settings is not None else None, logger=self._framework_logger, bot_only=installation_store_bot_only, + client=self._async_client, # for proxy use cases etc. ) self._async_oauth_flow: Optional[AsyncOAuthFlow] = None @@ -2279,8 +2281,8 @@

    Args

    "thread_broadcast", ), } - primary_matcher = builtin_matchers.event( - constraints=constraints, asyncio=True + primary_matcher = builtin_matchers.message_event( + constraints=constraints, keyword=keyword, asyncio=True ) middleware.insert(0, AsyncMessageListenerMatches(keyword)) return self._register_listener( @@ -3659,8 +3661,8 @@

    Args

    "thread_broadcast", ), } - primary_matcher = builtin_matchers.event( - constraints=constraints, asyncio=True + primary_matcher = builtin_matchers.message_event( + constraints=constraints, keyword=keyword, asyncio=True ) middleware.insert(0, AsyncMessageListenerMatches(keyword)) return self._register_listener( diff --git a/docs/api-docs/slack_bolt/authorization/async_authorize.html b/docs/api-docs/slack_bolt/authorization/async_authorize.html index e919b6161..29af799ee 100644 --- a/docs/api-docs/slack_bolt/authorization/async_authorize.html +++ b/docs/api-docs/slack_bolt/authorization/async_authorize.html @@ -36,6 +36,7 @@

    Module slack_bolt.authorization.async_authorizeModule slack_bolt.authorization.async_authorizeModule slack_bolt.authorization.async_authorizeModule slack_bolt.authorization.async_authorizeModule slack_bolt.authorization.async_authorizeModule slack_bolt.authorization.async_authorize + ) + + async def _rotate_and_save_tokens_if_necessary( + self, installation: Optional[Installation] + ) -> Optional[Installation]: + if installation is None or ( + installation.user_refresh_token is None + and installation.bot_refresh_token is None + ): + # No need to rotate tokens + return None + + if self.token_rotator is None: + # Token rotation is required but this Bolt app is not properly configured + raise BoltError(self._config_error_message) + + refreshed: Optional[ + Installation + ] = await self.token_rotator.perform_token_rotation( + installation=installation, + minutes_before_expiration=self.token_rotation_expiration_minutes, + ) + if refreshed is not None: + # Save the refreshed data in database for following requests + await self.installation_store.async_save(refreshed) + return refreshed

    @@ -449,7 +490,7 @@

    Ancestors

    class AsyncInstallationStoreAuthorize -(*, logger: logging.Logger, installation_store: slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore, client_id: Optional[str] = None, client_secret: Optional[str] = None, token_rotation_expiration_minutes: Optional[int] = None, bot_only: bool = False, cache_enabled: bool = False) +(*, logger: logging.Logger, installation_store: slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore, client_id: Optional[str] = None, client_secret: Optional[str] = None, token_rotation_expiration_minutes: Optional[int] = None, bot_only: bool = False, cache_enabled: bool = False, client: Optional[slack_sdk.web.async_client.AsyncWebClient] = None)

    If you use the OAuth flow settings, this authorize implementation will be used. @@ -484,6 +525,7 @@

    Ancestors

    # use only InstallationStore#find_bot(enterprise_id, team_id) bot_only: bool = False, cache_enabled: bool = False, + client: Optional[AsyncWebClient] = None, ): self.logger = logger self.installation_store = installation_store @@ -496,6 +538,7 @@

    Ancestors

    self.token_rotator = AsyncTokenRotator( client_id=client_id, client_secret=client_secret, + client=client, ) else: self.token_rotator = None @@ -528,23 +571,35 @@

    Ancestors

    try: # Note that this is the latest information for the org/workspace. # The installer may not be the user associated with this incoming request. - installation: Optional[ + latest_installation: Optional[ Installation ] = await self.installation_store.async_find_installation( enterprise_id=enterprise_id, team_id=team_id, is_enterprise_install=context.is_enterprise_install, ) - - if installation is not None: - if installation.user_id != user_id: + # If the user_token in the latest_installation is not for the user associated with this request, + # we'll fetch a different installation for the user below + # The example use cases are: + # - The app's installation requires both bot and user tokens + # - The app has two installation paths 1) bot installation 2) individual user authorization + this_user_installation: Optional[Installation] = None + + if latest_installation is not None: + # Save the latest bot token + bot_token = latest_installation.bot_token # this still can be None + user_token = ( + latest_installation.user_token + ) # this still can be None + + if latest_installation.user_id != user_id: # First off, remove the user token as the installer is a different user - installation.user_token = None - installation.user_scopes = [] + latest_installation.user_token = None + latest_installation.user_scopes = [] # try to fetch the request user's installation # to reflect the user's access token if exists - user_installation = ( + this_user_installation = ( await self.installation_store.async_find_installation( enterprise_id=enterprise_id, team_id=team_id, @@ -552,41 +607,42 @@

    Ancestors

    is_enterprise_install=context.is_enterprise_install, ) ) - if user_installation is not None: - # Overwrite the installation with the one for this user - installation = user_installation - - bot_token, user_token = ( - installation.bot_token, - installation.user_token, - ) - - if ( - installation.user_refresh_token is not None - or installation.bot_refresh_token is not None - ): - if self.token_rotator is None: - raise BoltError(self._config_error_message) - refreshed = await self.token_rotator.perform_token_rotation( - installation=installation, - minutes_before_expiration=self.token_rotation_expiration_minutes, - ) - if refreshed is not None: - await self.installation_store.async_save(refreshed) - bot_token, user_token = ( - refreshed.bot_token, - refreshed.user_token, + if this_user_installation is not None: + user_token = this_user_installation.user_token + if latest_installation.bot_token is None: + # If latest_installation has a bot token, we never overwrite the value + bot_token = this_user_installation.bot_token + + # If token rotation is enabled, running rotation may be needed here + refreshed = await self._rotate_and_save_tokens_if_necessary( + this_user_installation ) + if refreshed is not None: + user_token = refreshed.user_token + if latest_installation.bot_token is None: + # If latest_installation has a bot token, we never overwrite the value + bot_token = refreshed.bot_token + + # If token rotation is enabled, running rotation may be needed here + refreshed = await self._rotate_and_save_tokens_if_necessary( + latest_installation + ) + if refreshed is not None: + bot_token = refreshed.bot_token + if this_user_installation is None: + # Only when we don't have `this_user_installation` here, + # the `user_token` is for the user associated with this request + user_token = refreshed.user_token except NotImplementedError as _: self.find_installation_available = False if ( - # If you intentionally use only find_bot / delete_bot, + # If you intentionally use only `find_bot` / `delete_bot`, self.bot_only - # If find_installation method is not available, + # If the `find_installation` method is not available, or not self.find_installation_available - # If find_installation did not return data and find_bot method is available, + # If the `find_installation` method did not return data and find_bot method is available, or ( self.find_bot_available is True and bot_token is None @@ -653,7 +709,32 @@

    Ancestors

    self.logger.debug( "No installation data found " f"for enterprise_id: {enterprise_id} team_id: {team_id}" - ) + ) + + async def _rotate_and_save_tokens_if_necessary( + self, installation: Optional[Installation] + ) -> Optional[Installation]: + if installation is None or ( + installation.user_refresh_token is None + and installation.bot_refresh_token is None + ): + # No need to rotate tokens + return None + + if self.token_rotator is None: + # Token rotation is required but this Bolt app is not properly configured + raise BoltError(self._config_error_message) + + refreshed: Optional[ + Installation + ] = await self.token_rotator.perform_token_rotation( + installation=installation, + minutes_before_expiration=self.token_rotation_expiration_minutes, + ) + if refreshed is not None: + # Save the refreshed data in database for following requests + await self.installation_store.async_save(refreshed) + return refreshed

    Ancestors

      diff --git a/docs/api-docs/slack_bolt/authorization/authorize.html b/docs/api-docs/slack_bolt/authorization/authorize.html index 197913bce..c666154a3 100644 --- a/docs/api-docs/slack_bolt/authorization/authorize.html +++ b/docs/api-docs/slack_bolt/authorization/authorize.html @@ -32,9 +32,10 @@

      Module slack_bolt.authorization.authorize

      from slack_sdk.errors import SlackApiError from slack_sdk.oauth import InstallationStore -from slack_sdk.oauth.installation_store import Bot +from slack_sdk.oauth.installation_store.models.bot import Bot from slack_sdk.oauth.installation_store.models.installation import Installation from slack_sdk.oauth.token_rotation.rotator import TokenRotator +from slack_sdk.web import WebClient from slack_bolt.authorization.authorize_args import AuthorizeArgs from slack_bolt.authorization.authorize_result import AuthorizeResult @@ -61,8 +62,8 @@

      Module slack_bolt.authorization.authorize

      class CallableAuthorize(Authorize): - """When you pass the authorize argument in AsyncApp constructor, - This authorize implementation will be used. + """When you pass the `authorize` argument in AsyncApp constructor, + This `authorize` implementation will be used. """ def __init__( @@ -130,9 +131,9 @@

      Module slack_bolt.authorization.authorize

      class InstallationStoreAuthorize(Authorize): - """If you use the OAuth flow settings, this authorize implementation will be used. + """If you use the OAuth flow settings, this `authorize` implementation will be used. As long as your own InstallationStore (or the built-in ones) works as you expect, - you can expect that the authorize layer should work for you without any customization. + you can expect that the `authorize` layer should work for you without any customization. """ authorize_result_cache: Dict[str, AuthorizeResult] @@ -157,6 +158,7 @@

      Module slack_bolt.authorization.authorize

      # use only InstallationStore#find_bot(enterprise_id, team_id) bot_only: bool = False, cache_enabled: bool = False, + client: Optional[WebClient] = None, ): self.logger = logger self.installation_store = installation_store @@ -171,6 +173,7 @@

      Module slack_bolt.authorization.authorize

      self.token_rotator = TokenRotator( client_id=client_id, client_secret=client_secret, + client=client, ) else: self.token_rotator = None @@ -196,61 +199,78 @@

      Module slack_bolt.authorization.authorize

      try: # Note that this is the latest information for the org/workspace. # The installer may not be the user associated with this incoming request. - installation: Optional[ + latest_installation: Optional[ Installation ] = self.installation_store.find_installation( enterprise_id=enterprise_id, team_id=team_id, is_enterprise_install=context.is_enterprise_install, ) - if installation is not None: - if installation.user_id != user_id: + # If the user_token in the latest_installation is not for the user associated with this request, + # we'll fetch a different installation for the user below. + # The example use cases are: + # - The app's installation requires both bot and user tokens + # - The app has two installation paths 1) bot installation 2) individual user authorization + this_user_installation: Optional[Installation] = None + + if latest_installation is not None: + # Save the latest bot token + bot_token = latest_installation.bot_token # this still can be None + user_token = ( + latest_installation.user_token + ) # this still can be None + + if latest_installation.user_id != user_id: # First off, remove the user token as the installer is a different user - installation.user_token = None - installation.user_scopes = [] + latest_installation.user_token = None + latest_installation.user_scopes = [] # try to fetch the request user's installation # to reflect the user's access token if exists - user_installation = self.installation_store.find_installation( - enterprise_id=enterprise_id, - team_id=team_id, - user_id=user_id, - is_enterprise_install=context.is_enterprise_install, - ) - if user_installation is not None: - # Overwrite the installation with the one for this user - installation = user_installation - - bot_token, user_token = ( - installation.bot_token, - installation.user_token, - ) - if ( - installation.user_refresh_token is not None - or installation.bot_refresh_token is not None - ): - if self.token_rotator is None: - raise BoltError(self._config_error_message) - refreshed = self.token_rotator.perform_token_rotation( - installation=installation, - minutes_before_expiration=self.token_rotation_expiration_minutes, + this_user_installation = ( + self.installation_store.find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + user_id=user_id, + is_enterprise_install=context.is_enterprise_install, + ) ) - if refreshed is not None: - self.installation_store.save(refreshed) - bot_token, user_token = ( - refreshed.bot_token, - refreshed.user_token, + if this_user_installation is not None: + user_token = this_user_installation.user_token + if latest_installation.bot_token is None: + # If latest_installation has a bot token, we never overwrite the value + bot_token = this_user_installation.bot_token + + # If token rotation is enabled, running rotation may be needed here + refreshed = self._rotate_and_save_tokens_if_necessary( + this_user_installation ) + if refreshed is not None: + user_token = refreshed.user_token + if latest_installation.bot_token is None: + # If latest_installation has a bot token, we never overwrite the value + bot_token = refreshed.bot_token + + # If token rotation is enabled, running rotation may be needed here + refreshed = self._rotate_and_save_tokens_if_necessary( + latest_installation + ) + if refreshed is not None: + bot_token = refreshed.bot_token + if this_user_installation is None: + # Only when we don't have `this_user_installation` here, + # the `user_token` is for the user associated with this request + user_token = refreshed.user_token except NotImplementedError as _: self.find_installation_available = False if ( - # If you intentionally use only find_bot / delete_bot, + # If you intentionally use only `find_bot` / `delete_bot`, self.bot_only - # If find_installation method is not available, + # If the `find_installation` method is not available, or not self.find_installation_available - # If find_installation did not return data and find_bot method is available, + # If the `find_installation` method did not return data and find_bot method is available, or ( self.find_bot_available is True and bot_token is None @@ -317,7 +337,30 @@

      Module slack_bolt.authorization.authorize

      self.logger.debug( "No installation data found " f"for enterprise_id: {enterprise_id} team_id: {team_id}" - ) + ) + + def _rotate_and_save_tokens_if_necessary( + self, installation: Optional[Installation] + ) -> Optional[Installation]: + if installation is None or ( + installation.user_refresh_token is None + and installation.bot_refresh_token is None + ): + # No need to rotate tokens + return None + + if self.token_rotator is None: + # Token rotation is required but this Bolt app is not properly configured + raise BoltError(self._config_error_message) + + refreshed: Optional[Installation] = self.token_rotator.perform_token_rotation( + installation=installation, + minutes_before_expiration=self.token_rotation_expiration_minutes, + ) + if refreshed is not None: + # Save the refreshed data in database for following requests + self.installation_store.save(refreshed) + return refreshed
    @@ -367,15 +410,15 @@

    Subclasses

    (*, logger: logging.Logger, func: Callable[..., AuthorizeResult])
    -

    When you pass the authorize argument in AsyncApp constructor, -This authorize implementation will be used.

    +

    When you pass the authorize argument in AsyncApp constructor, +This authorize implementation will be used.

    Expand source code
    class CallableAuthorize(Authorize):
    -    """When you pass the authorize argument in AsyncApp constructor,
    -    This authorize implementation will be used.
    +    """When you pass the `authorize` argument in AsyncApp constructor,
    +    This `authorize` implementation will be used.
         """
     
         def __init__(
    @@ -448,20 +491,20 @@ 

    Ancestors

    class InstallationStoreAuthorize -(*, logger: logging.Logger, installation_store: slack_sdk.oauth.installation_store.installation_store.InstallationStore, client_id: Optional[str] = None, client_secret: Optional[str] = None, token_rotation_expiration_minutes: Optional[int] = None, bot_only: bool = False, cache_enabled: bool = False) +(*, logger: logging.Logger, installation_store: slack_sdk.oauth.installation_store.installation_store.InstallationStore, client_id: Optional[str] = None, client_secret: Optional[str] = None, token_rotation_expiration_minutes: Optional[int] = None, bot_only: bool = False, cache_enabled: bool = False, client: Optional[slack_sdk.web.client.WebClient] = None)
    -

    If you use the OAuth flow settings, this authorize implementation will be used. +

    If you use the OAuth flow settings, this authorize implementation will be used. As long as your own InstallationStore (or the built-in ones) works as you expect, -you can expect that the authorize layer should work for you without any customization.

    +you can expect that the authorize layer should work for you without any customization.

    Expand source code
    class InstallationStoreAuthorize(Authorize):
    -    """If you use the OAuth flow settings, this authorize implementation will be used.
    +    """If you use the OAuth flow settings, this `authorize` implementation will be used.
         As long as your own InstallationStore (or the built-in ones) works as you expect,
    -    you can expect that the authorize layer should work for you without any customization.
    +    you can expect that the `authorize` layer should work for you without any customization.
         """
     
         authorize_result_cache: Dict[str, AuthorizeResult]
    @@ -486,6 +529,7 @@ 

    Ancestors

    # use only InstallationStore#find_bot(enterprise_id, team_id) bot_only: bool = False, cache_enabled: bool = False, + client: Optional[WebClient] = None, ): self.logger = logger self.installation_store = installation_store @@ -500,6 +544,7 @@

    Ancestors

    self.token_rotator = TokenRotator( client_id=client_id, client_secret=client_secret, + client=client, ) else: self.token_rotator = None @@ -525,61 +570,78 @@

    Ancestors

    try: # Note that this is the latest information for the org/workspace. # The installer may not be the user associated with this incoming request. - installation: Optional[ + latest_installation: Optional[ Installation ] = self.installation_store.find_installation( enterprise_id=enterprise_id, team_id=team_id, is_enterprise_install=context.is_enterprise_install, ) - if installation is not None: - if installation.user_id != user_id: + # If the user_token in the latest_installation is not for the user associated with this request, + # we'll fetch a different installation for the user below. + # The example use cases are: + # - The app's installation requires both bot and user tokens + # - The app has two installation paths 1) bot installation 2) individual user authorization + this_user_installation: Optional[Installation] = None + + if latest_installation is not None: + # Save the latest bot token + bot_token = latest_installation.bot_token # this still can be None + user_token = ( + latest_installation.user_token + ) # this still can be None + + if latest_installation.user_id != user_id: # First off, remove the user token as the installer is a different user - installation.user_token = None - installation.user_scopes = [] + latest_installation.user_token = None + latest_installation.user_scopes = [] # try to fetch the request user's installation # to reflect the user's access token if exists - user_installation = self.installation_store.find_installation( - enterprise_id=enterprise_id, - team_id=team_id, - user_id=user_id, - is_enterprise_install=context.is_enterprise_install, - ) - if user_installation is not None: - # Overwrite the installation with the one for this user - installation = user_installation - - bot_token, user_token = ( - installation.bot_token, - installation.user_token, - ) - if ( - installation.user_refresh_token is not None - or installation.bot_refresh_token is not None - ): - if self.token_rotator is None: - raise BoltError(self._config_error_message) - refreshed = self.token_rotator.perform_token_rotation( - installation=installation, - minutes_before_expiration=self.token_rotation_expiration_minutes, + this_user_installation = ( + self.installation_store.find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + user_id=user_id, + is_enterprise_install=context.is_enterprise_install, + ) ) - if refreshed is not None: - self.installation_store.save(refreshed) - bot_token, user_token = ( - refreshed.bot_token, - refreshed.user_token, + if this_user_installation is not None: + user_token = this_user_installation.user_token + if latest_installation.bot_token is None: + # If latest_installation has a bot token, we never overwrite the value + bot_token = this_user_installation.bot_token + + # If token rotation is enabled, running rotation may be needed here + refreshed = self._rotate_and_save_tokens_if_necessary( + this_user_installation ) + if refreshed is not None: + user_token = refreshed.user_token + if latest_installation.bot_token is None: + # If latest_installation has a bot token, we never overwrite the value + bot_token = refreshed.bot_token + + # If token rotation is enabled, running rotation may be needed here + refreshed = self._rotate_and_save_tokens_if_necessary( + latest_installation + ) + if refreshed is not None: + bot_token = refreshed.bot_token + if this_user_installation is None: + # Only when we don't have `this_user_installation` here, + # the `user_token` is for the user associated with this request + user_token = refreshed.user_token except NotImplementedError as _: self.find_installation_available = False if ( - # If you intentionally use only find_bot / delete_bot, + # If you intentionally use only `find_bot` / `delete_bot`, self.bot_only - # If find_installation method is not available, + # If the `find_installation` method is not available, or not self.find_installation_available - # If find_installation did not return data and find_bot method is available, + # If the `find_installation` method did not return data and find_bot method is available, or ( self.find_bot_available is True and bot_token is None @@ -646,7 +708,30 @@

    Ancestors

    self.logger.debug( "No installation data found " f"for enterprise_id: {enterprise_id} team_id: {team_id}" - )
    + ) + + def _rotate_and_save_tokens_if_necessary( + self, installation: Optional[Installation] + ) -> Optional[Installation]: + if installation is None or ( + installation.user_refresh_token is None + and installation.bot_refresh_token is None + ): + # No need to rotate tokens + return None + + if self.token_rotator is None: + # Token rotation is required but this Bolt app is not properly configured + raise BoltError(self._config_error_message) + + refreshed: Optional[Installation] = self.token_rotator.perform_token_rotation( + installation=installation, + minutes_before_expiration=self.token_rotation_expiration_minutes, + ) + if refreshed is not None: + # Save the refreshed data in database for following requests + self.installation_store.save(refreshed) + return refreshed

    Ancestors

      diff --git a/docs/api-docs/slack_bolt/listener_matcher/builtins.html b/docs/api-docs/slack_bolt/listener_matcher/builtins.html index 238285f36..f03e45470 100644 --- a/docs/api-docs/slack_bolt/listener_matcher/builtins.html +++ b/docs/api-docs/slack_bolt/listener_matcher/builtins.html @@ -28,6 +28,7 @@

      Module slack_bolt.listener_matcher.builtins

      # pytype: skip-file
       import inspect
      +import re
       import sys
       
       from slack_bolt.error import BoltError
      @@ -123,37 +124,10 @@ 

      Module slack_bolt.listener_matcher.builtins

      def func(body: Dict[str, Any]) -> bool: if is_event(body): - event = body["event"] - if not _matches(constraints["type"], event["type"]): - return False - if "subtype" in constraints: - expected_subtype: Union[ - str, Sequence[Optional[Union[str, Pattern]]] - ] = constraints["subtype"] - if expected_subtype is None: - # "subtype" in constraints is intentionally None for this pattern - return "subtype" not in event - elif isinstance(expected_subtype, (str, Pattern)): - return "subtype" in event and _matches( - expected_subtype, event["subtype"] - ) - elif isinstance(expected_subtype, Sequence): - subtypes: Sequence[ - Optional[Union[str, Pattern]] - ] = expected_subtype - for expected in subtypes: - actual: Optional[str] = event.get("subtype") - if expected is None: - if actual is None: - return True - elif actual is not None and _matches(expected, actual): - return True - return False - else: - return "subtype" in event and _matches( - expected_subtype, event["subtype"] - ) - return True + return _check_event_subtype( + event_payload=body["event"], + constraints=constraints, + ) return False return build_listener_matcher(func, asyncio) @@ -163,6 +137,64 @@

      Module slack_bolt.listener_matcher.builtins

      ) +def message_event( + constraints: Dict[str, Union[str, Sequence[Optional[Union[str, Pattern]]]]], + keyword: Union[str, Pattern], + asyncio: bool = False, +) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: + if "type" in constraints and keyword is not None: + _verify_message_event_type(constraints["type"]) + + def func(body: Dict[str, Any]) -> bool: + if is_event(body): + is_valid_subtype = _check_event_subtype( + event_payload=body["event"], + constraints=constraints, + ) + if is_valid_subtype is True: + # Check keyword matching + text = body.get("event", {}).get("text", "") + match_result = re.findall(keyword, text) + if match_result is not None and match_result != []: + return True + return False + + return build_listener_matcher(func, asyncio) + + raise BoltError(f"event ({constraints}: {type(constraints)}) must be dict") + + +def _check_event_subtype(event_payload: dict, constraints: dict) -> bool: + if not _matches(constraints["type"], event_payload["type"]): + return False + if "subtype" in constraints: + expected_subtype: Union[ + str, Sequence[Optional[Union[str, Pattern]]] + ] = constraints["subtype"] + if expected_subtype is None: + # "subtype" in constraints is intentionally None for this pattern + return "subtype" not in event_payload + elif isinstance(expected_subtype, (str, Pattern)): + return "subtype" in event_payload and _matches( + expected_subtype, event_payload["subtype"] + ) + elif isinstance(expected_subtype, Sequence): + subtypes: Sequence[Optional[Union[str, Pattern]]] = expected_subtype + for expected in subtypes: + actual: Optional[str] = event_payload.get("subtype") + if expected is None: + if actual is None: + return True + elif actual is not None and _matches(expected, actual): + return True + return False + else: + return "subtype" in event_payload and _matches( + expected_subtype, event_payload["subtype"] + ) + return True + + def _verify_message_event_type(event_type: str) -> None: if isinstance(event_type, str) and event_type.startswith("message."): raise ValueError(error_message_event_type(event_type)) @@ -770,37 +802,10 @@

      Functions

      def func(body: Dict[str, Any]) -> bool: if is_event(body): - event = body["event"] - if not _matches(constraints["type"], event["type"]): - return False - if "subtype" in constraints: - expected_subtype: Union[ - str, Sequence[Optional[Union[str, Pattern]]] - ] = constraints["subtype"] - if expected_subtype is None: - # "subtype" in constraints is intentionally None for this pattern - return "subtype" not in event - elif isinstance(expected_subtype, (str, Pattern)): - return "subtype" in event and _matches( - expected_subtype, event["subtype"] - ) - elif isinstance(expected_subtype, Sequence): - subtypes: Sequence[ - Optional[Union[str, Pattern]] - ] = expected_subtype - for expected in subtypes: - actual: Optional[str] = event.get("subtype") - if expected is None: - if actual is None: - return True - elif actual is not None and _matches(expected, actual): - return True - return False - else: - return "subtype" in event and _matches( - expected_subtype, event["subtype"] - ) - return True + return _check_event_subtype( + event_payload=body["event"], + constraints=constraints, + ) return False return build_listener_matcher(func, asyncio) @@ -829,6 +834,42 @@

      Functions

      return build_listener_matcher(func, asyncio)
    +
    +def message_event(constraints: Dict[str, Union[str, Sequence[Union[str, re.Pattern, ForwardRef(None)]]]], keyword: Union[str, re.Pattern], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +
    +
    +
    +
    + +Expand source code + +
    def message_event(
    +    constraints: Dict[str, Union[str, Sequence[Optional[Union[str, Pattern]]]]],
    +    keyword: Union[str, Pattern],
    +    asyncio: bool = False,
    +) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
    +    if "type" in constraints and keyword is not None:
    +        _verify_message_event_type(constraints["type"])
    +
    +        def func(body: Dict[str, Any]) -> bool:
    +            if is_event(body):
    +                is_valid_subtype = _check_event_subtype(
    +                    event_payload=body["event"],
    +                    constraints=constraints,
    +                )
    +                if is_valid_subtype is True:
    +                    # Check keyword matching
    +                    text = body.get("event", {}).get("text", "")
    +                    match_result = re.findall(keyword, text)
    +                    if match_result is not None and match_result != []:
    +                        return True
    +            return False
    +
    +        return build_listener_matcher(func, asyncio)
    +
    +    raise BoltError(f"event ({constraints}: {type(constraints)}) must be dict")
    +
    +
    def message_shortcut(callback_id: Union[str, re.Pattern], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -1120,6 +1161,7 @@

    Index

  • dialog_suggestion
  • event
  • global_shortcut
  • +
  • message_event
  • message_shortcut
  • options
  • shortcut
  • diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index b2166e22a..36854a0a5 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.11.1"
    +__version__ = "1.11.2"
    From 8c0532dbbbd0c1f3035fa22c5c08903ee02b8826 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 25 Jan 2022 22:22:18 +0900 Subject: [PATCH 298/719] Add org-wide installation test patterns (#578) --- slack_bolt/request/internals.py | 4 + tests/slack_bolt/request/test_request.py | 221 +++++++++++++++++++++++ 2 files changed, 225 insertions(+) diff --git a/slack_bolt/request/internals.py b/slack_bolt/request/internals.py index 2fd0c430e..b520cb821 100644 --- a/slack_bolt/request/internals.py +++ b/slack_bolt/request/internals.py @@ -78,6 +78,8 @@ def extract_enterprise_id(payload: Dict[str, Any]) -> Optional[str]: def extract_team_id(payload: Dict[str, Any]) -> Optional[str]: if payload.get("team") is not None: + # With org-wide installations, payload.team in interactivity payloads can be None + # You need to extract either payload.user.team_id or payload.view.team_id as below team = payload.get("team") if isinstance(team, str): return team @@ -93,6 +95,8 @@ def extract_team_id(payload: Dict[str, Any]) -> Optional[str]: return extract_team_id(payload["event"]) if payload.get("user") is not None: return payload.get("user")["team_id"] + if payload.get("view") is not None: + return payload.get("view")["team_id"] return None diff --git a/tests/slack_bolt/request/test_request.py b/tests/slack_bolt/request/test_request.py index b6a81ecca..70ce98e3c 100644 --- a/tests/slack_bolt/request/test_request.py +++ b/tests/slack_bolt/request/test_request.py @@ -1,3 +1,5 @@ +from urllib.parse import quote + from slack_bolt.request.request import BoltRequest @@ -21,3 +23,222 @@ def test_all_none_inputs_socket_mode(self): assert req is not None assert req.raw_body == "" assert req.body == {} + + def test_org_wide_installations_block_actions(self): + payload = """ +{ + "type": "block_actions", + "user": { + "id": "W111", + "username": "primary-owner", + "name": "primary-owner", + "team_id": "T_expected" + }, + "api_app_id": "A111", + "token": "fixed-value", + "container": { + "type": "message", + "message_ts": "1643113871.000700", + "channel_id": "C111", + "is_ephemeral": true + }, + "trigger_id": "111.222.xxx", + "team": null, + "enterprise": { + "id": "E111", + "name": "Sandbox Org" + }, + "is_enterprise_install": true, + "channel": { + "id": "C111", + "name": "random" + }, + "state": { + "values": {} + }, + "response_url": "https://hooks.slack.com/actions/E111/111/xxx", + "actions": [ + { + "action_id": "a", + "block_id": "b", + "text": { + "type": "plain_text", + "text": "Button" + }, + "value": "click_me_123", + "type": "button", + "action_ts": "1643113877.645417" + } + ] +} +""" + req = BoltRequest(body=f"payload={quote(payload)}") + assert req is not None + assert req.context.team_id == "T_expected" + assert req.context.user_id == "W111" + + def test_org_wide_installations_view_submission(self): + payload = """ +{ + "type": "view_submission", + "team": null, + "user": { + "id": "W111", + "username": "primary-owner", + "name": "primary-owner", + "team_id": "T_expected" + }, + "api_app_id": "A111", + "token": "fixed-value", + "trigger_id": "1111.222.xxx", + "view": { + "id": "V111", + "team_id": "T_expected", + "type": "modal", + "blocks": [ + { + "type": "input", + "block_id": "+5B", + "label": { + "type": "plain_text", + "text": "Label", + "emoji": true + }, + "optional": false, + "dispatch_action": false, + "element": { + "type": "plain_text_input", + "dispatch_action_config": { + "trigger_actions_on": [ + "on_enter_pressed" + ] + }, + "action_id": "MMKH" + } + } + ], + "private_metadata": "", + "callback_id": "view-id", + "state": { + "values": { + "+5B": { + "MMKH": { + "type": "plain_text_input", + "value": "test" + } + } + } + }, + "hash": "111.xxx", + "title": { + "type": "plain_text", + "text": "My App" + }, + "clear_on_close": false, + "notify_on_close": false, + "close": { + "type": "plain_text", + "text": "Cancel" + }, + "submit": { + "type": "plain_text", + "text": "Submit", + "emoji": true + }, + "previous_view_id": null, + "root_view_id": "V111", + "app_id": "A111", + "external_id": "", + "app_installed_team_id": "E111", + "bot_id": "B111" + }, + "response_urls": [], + "is_enterprise_install": true, + "enterprise": { + "id": "E111", + "name": "Sandbox Org" + } +} +""" + req = BoltRequest(body=f"payload={quote(payload)}") + assert req is not None + assert req.context.team_id == "T_expected" + assert req.context.user_id == "W111" + + def test_org_wide_installations_view_closed(self): + payload = """ +{ + "type": "view_closed", + "team": null, + "user": { + "id": "W111", + "username": "primary-owner", + "name": "primary-owner", + "team_id": "T_expected" + }, + "api_app_id": "A111", + "token": "fixed-value", + "view": { + "id": "V111", + "team_id": "T_expected", + "type": "modal", + "blocks": [ + { + "type": "input", + "block_id": "M2r2p", + "label": { + "type": "plain_text", + "text": "Label" + }, + "optional": false, + "dispatch_action": false, + "element": { + "type": "plain_text_input", + "dispatch_action_config": { + "trigger_actions_on": [ + "on_enter_pressed" + ] + }, + "action_id": "xB+" + } + } + ], + "private_metadata": "", + "callback_id": "view-id", + "state": { + "values": {} + }, + "hash": "1643113987.gRY6ROtt", + "title": { + "type": "plain_text", + "text": "My App" + }, + "clear_on_close": false, + "notify_on_close": true, + "close": { + "type": "plain_text", + "text": "Cancel" + }, + "submit": { + "type": "plain_text", + "text": "Submit" + }, + "previous_view_id": null, + "root_view_id": "V111", + "app_id": "A111", + "external_id": "", + "app_installed_team_id": "E111", + "bot_id": "B0302M47727" + }, + "is_cleared": false, + "is_enterprise_install": true, + "enterprise": { + "id": "E111", + "name": "Sandbox Org" + } +} +""" + req = BoltRequest(body=f"payload={quote(payload)}") + assert req is not None + assert req.context.team_id == "T_expected" + assert req.context.user_id == "W111" From dc4837837bfd10d10470d4e043f2fc5d55447b50 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 29 Jan 2022 06:20:34 +0900 Subject: [PATCH 299/719] Fix #468 Replying with 0 results for a multi-select external option display previous successful results (#580) --- slack_bolt/context/ack/internals.py | 4 +- tests/scenario_tests/test_block_suggestion.py | 40 ++++++++++++++++++ .../test_block_suggestion.py | 42 +++++++++++++++++++ 3 files changed, 84 insertions(+), 2 deletions(-) diff --git a/slack_bolt/context/ack/internals.py b/slack_bolt/context/ack/internals.py index 1985e26ca..965033b77 100644 --- a/slack_bolt/context/ack/internals.py +++ b/slack_bolt/context/ack/internals.py @@ -42,10 +42,10 @@ def _set_response( elif blocks and len(blocks) > 0: body.update({"text": text, "blocks": convert_to_dict_list(blocks)}) self.response = BoltResponse(status=200, body=body) - elif options and len(options) > 0: + elif options is not None: body = {"options": convert_to_dict_list(options)} self.response = BoltResponse(status=200, body=body) - elif option_groups and len(option_groups) > 0: + elif option_groups is not None: body = {"option_groups": convert_to_dict_list(option_groups)} self.response = BoltResponse(status=200, body=body) elif response_action: diff --git a/tests/scenario_tests/test_block_suggestion.py b/tests/scenario_tests/test_block_suggestion.py index 9c3a4fb3f..01e831b93 100644 --- a/tests/scenario_tests/test_block_suggestion.py +++ b/tests/scenario_tests/test_block_suggestion.py @@ -180,6 +180,34 @@ def test_failure_multi(self): assert response.status == 404 assert_auth_test_count(self, 1) + def test_empty_options(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + app.options("mes_a")(show_empty_options) + + request = self.build_valid_multi_request() + response = app.dispatch(request) + assert response.status == 200 + assert response.body == """{"options": []}""" + assert response.headers["content-type"][0] == "application/json;charset=utf-8" + assert_auth_test_count(self, 1) + + def test_empty_option_groups(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + app.options("mes_a")(show_empty_option_groups) + + request = self.build_valid_multi_request() + response = app.dispatch(request) + assert response.status == 200 + assert response.body == """{"option_groups": []}""" + assert response.headers["content-type"][0] == "application/json;charset=utf-8" + assert_auth_test_count(self, 1) + body = { "type": "block_suggestion", @@ -296,3 +324,15 @@ def show_multi_options(ack, body, payload, options): assert body == options assert payload == options ack(multi_response) + + +def show_empty_options(ack, body, payload, options): + assert body == options + assert payload == options + ack(options=[]) + + +def show_empty_option_groups(ack, body, payload, options): + assert body == options + assert payload == options + ack(option_groups=[]) diff --git a/tests/scenario_tests_async/test_block_suggestion.py b/tests/scenario_tests_async/test_block_suggestion.py index dc67391e0..17dceb066 100644 --- a/tests/scenario_tests_async/test_block_suggestion.py +++ b/tests/scenario_tests_async/test_block_suggestion.py @@ -195,6 +195,36 @@ async def test_failure_multi(self): assert response.status == 404 await assert_auth_test_count_async(self, 1) + @pytest.mark.asyncio + async def test_empty_options(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + app.options("mes_a")(show_empty_options) + + request = self.build_valid_multi_request() + response = await app.async_dispatch(request) + assert response.status == 200 + assert response.body == """{"options": []}""" + assert response.headers["content-type"][0] == "application/json;charset=utf-8" + await assert_auth_test_count_async(self, 1) + + @pytest.mark.asyncio + async def test_empty_option_groups(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + app.options("mes_a")(show_empty_option_groups) + + request = self.build_valid_multi_request() + response = await app.async_dispatch(request) + assert response.status == 200 + assert response.body == """{"option_groups": []}""" + assert response.headers["content-type"][0] == "application/json;charset=utf-8" + await assert_auth_test_count_async(self, 1) + body = { "type": "block_suggestion", @@ -311,3 +341,15 @@ async def show_multi_options(ack, body, payload, options): assert body == options assert payload == options await ack(multi_response) + + +async def show_empty_options(ack, body, payload, options): + assert body == options + assert payload == options + await ack(options=[]) + + +async def show_empty_option_groups(ack, body, payload, options): + assert body == options + assert payload == options + await ack(option_groups=[]) From d6dbe64ca25579e2d1f6aa31eb29f34ed64d60ba Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 29 Jan 2022 06:46:50 +0900 Subject: [PATCH 300/719] Upgrade pytype version to the latest (#581) --- scripts/run_pytype.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run_pytype.sh b/scripts/run_pytype.sh index 43f43d225..debbc1f68 100755 --- a/scripts/run_pytype.sh +++ b/scripts/run_pytype.sh @@ -5,5 +5,5 @@ script_dir=$(dirname $0) cd ${script_dir}/.. && \ pip install -e ".[async]" && \ pip install -e ".[adapter]" && \ - pip install "pytype==2021.12.15" && \ + pip install "pytype==2022.1.13" && \ pytype slack_bolt/ From b4dab2c7a0ad6ef47713b9e71da33cbea8392ea6 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 29 Jan 2022 06:48:39 +0900 Subject: [PATCH 301/719] version 1.11.3 --- docs/api-docs/slack_bolt/context/ack/internals.html | 4 ++-- docs/api-docs/slack_bolt/request/internals.html | 8 ++++++++ docs/api-docs/slack_bolt/version.html | 2 +- slack_bolt/version.py | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/api-docs/slack_bolt/context/ack/internals.html b/docs/api-docs/slack_bolt/context/ack/internals.html index 535fc4228..56ca58bb2 100644 --- a/docs/api-docs/slack_bolt/context/ack/internals.html +++ b/docs/api-docs/slack_bolt/context/ack/internals.html @@ -70,10 +70,10 @@

    Module slack_bolt.context.ack.internals

    elif blocks and len(blocks) > 0: body.update({"text": text, "blocks": convert_to_dict_list(blocks)}) self.response = BoltResponse(status=200, body=body) - elif options and len(options) > 0: + elif options is not None: body = {"options": convert_to_dict_list(options)} self.response = BoltResponse(status=200, body=body) - elif option_groups and len(option_groups) > 0: + elif option_groups is not None: body = {"option_groups": convert_to_dict_list(option_groups)} self.response = BoltResponse(status=200, body=body) elif response_action: diff --git a/docs/api-docs/slack_bolt/request/internals.html b/docs/api-docs/slack_bolt/request/internals.html index 2df2c8794..9a61d42f7 100644 --- a/docs/api-docs/slack_bolt/request/internals.html +++ b/docs/api-docs/slack_bolt/request/internals.html @@ -106,6 +106,8 @@

    Module slack_bolt.request.internals

    def extract_team_id(payload: Dict[str, Any]) -> Optional[str]: if payload.get("team") is not None: + # With org-wide installations, payload.team in interactivity payloads can be None + # You need to extract either payload.user.team_id or payload.view.team_id as below team = payload.get("team") if isinstance(team, str): return team @@ -121,6 +123,8 @@

    Module slack_bolt.request.internals

    return extract_team_id(payload["event"]) if payload.get("user") is not None: return payload.get("user")["team_id"] + if payload.get("view") is not None: + return payload.get("view")["team_id"] return None @@ -420,6 +424,8 @@

    Functions

    def extract_team_id(payload: Dict[str, Any]) -> Optional[str]:
         if payload.get("team") is not None:
    +        # With org-wide installations, payload.team in interactivity payloads can be None
    +        # You need to extract either payload.user.team_id or payload.view.team_id as below
             team = payload.get("team")
             if isinstance(team, str):
                 return team
    @@ -435,6 +441,8 @@ 

    Functions

    return extract_team_id(payload["event"]) if payload.get("user") is not None: return payload.get("user")["team_id"] + if payload.get("view") is not None: + return payload.get("view")["team_id"] return None
    diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index 36854a0a5..8cc0587df 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.11.2"
    +__version__ = "1.11.3"
    diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 692c2d5b1..61ceb7244 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.11.2" +__version__ = "1.11.3" From 7fa4e88796a79403e3630c701fb774511f21cf6c Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 1 Feb 2022 15:32:36 +0900 Subject: [PATCH 302/719] Fix #584 Wrong user_token assigned to new user (affected versions: v1.11.2, v1.11.3) (#586) --- slack_bolt/authorization/async_authorize.py | 3 ++ slack_bolt/authorization/authorize.py | 3 ++ tests/mock_web_api_server.py | 28 +++++----- .../authorization/test_authorize.py | 49 ++++++++++++++++++ .../authorization/test_async_authorize.py | 51 +++++++++++++++++++ 5 files changed, 121 insertions(+), 13 deletions(-) diff --git a/slack_bolt/authorization/async_authorize.py b/slack_bolt/authorization/async_authorize.py index 6d37924c5..00b5458e2 100644 --- a/slack_bolt/authorization/async_authorize.py +++ b/slack_bolt/authorization/async_authorize.py @@ -194,7 +194,10 @@ async def __call__( if latest_installation.user_id != user_id: # First off, remove the user token as the installer is a different user + user_token = None latest_installation.user_token = None + latest_installation.user_refresh_token = None + latest_installation.user_token_expires_at = None latest_installation.user_scopes = [] # try to fetch the request user's installation diff --git a/slack_bolt/authorization/authorize.py b/slack_bolt/authorization/authorize.py index 5cd9a0193..c701d5efa 100644 --- a/slack_bolt/authorization/authorize.py +++ b/slack_bolt/authorization/authorize.py @@ -194,7 +194,10 @@ def __call__( if latest_installation.user_id != user_id: # First off, remove the user token as the installer is a different user + user_token = None latest_installation.user_token = None + latest_installation.user_refresh_token = None + latest_installation.user_token_expires_at = None latest_installation.user_scopes = [] # try to fetch the request user's installation diff --git a/tests/mock_web_api_server.py b/tests/mock_web_api_server.py index 6c905f8b5..486b5581f 100644 --- a/tests/mock_web_api_server.py +++ b/tests/mock_web_api_server.py @@ -155,19 +155,21 @@ def _handle(self): self.logger.info(f"request body: {request_body}") if request_body.get("grant_type") == "refresh_token": - if "bot-valid" in request_body.get("refresh_token"): - self.send_response(200) - self.set_common_headers() - body = self.oauth_v2_access_bot_refresh_response - self.wfile.write(body.encode("utf-8")) - return - if "user-valid" in request_body.get("refresh_token"): - self.send_response(200) - self.set_common_headers() - body = self.oauth_v2_access_user_refresh_response - self.wfile.write(body.encode("utf-8")) - return - if request_body.get("code") is not None: + refresh_token = request_body.get("refresh_token") + if refresh_token is not None: + if "bot-valid" in refresh_token: + self.send_response(200) + self.set_common_headers() + body = self.oauth_v2_access_bot_refresh_response + self.wfile.write(body.encode("utf-8")) + return + if "user-valid" in refresh_token: + self.send_response(200) + self.set_common_headers() + body = self.oauth_v2_access_user_refresh_response + self.wfile.write(body.encode("utf-8")) + return + elif request_body.get("code") is not None: self.send_response(200) self.set_common_headers() self.wfile.write(self.oauth_v2_access_response.encode("utf-8")) diff --git a/tests/slack_bolt/authorization/test_authorize.py b/tests/slack_bolt/authorization/test_authorize.py index c4d64a91d..456af6ae9 100644 --- a/tests/slack_bolt/authorization/test_authorize.py +++ b/tests/slack_bolt/authorization/test_authorize.py @@ -245,6 +245,55 @@ def test_fetch_different_user_token_with_rotation(self): assert result.user_token == "xoxp-valid-refreshed" assert_auth_test_count(self, 1) + def test_remove_latest_user_token_if_it_is_not_relevant(self): + installation_store = ValidUserTokenInstallationStore() + authorize = InstallationStoreAuthorize( + logger=installation_store.logger, installation_store=installation_store + ) + context = BoltContext() + context["client"] = WebClient(base_url=self.mock_api_server_base_url) + result = authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W333" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.bot_token == "xoxb-valid" + assert result.user_token is None + assert_auth_test_count(self, 1) + + def test_rotate_only_bot_token(self): + context = BoltContext() + mock_client = WebClient(base_url=self.mock_api_server_base_url) + context["client"] = mock_client + + installation_store = ValidUserTokenRotationInstallationStore() + invalid_authorize = InstallationStoreAuthorize( + logger=installation_store.logger, installation_store=installation_store + ) + with pytest.raises(BoltError): + invalid_authorize( + context=context, + enterprise_id="E111", + team_id="T0G9PQBBK", + user_id="W333", + ) + + authorize = InstallationStoreAuthorize( + client_id="111.222", + client_secret="secret", + client=mock_client, + logger=installation_store.logger, + installation_store=installation_store, + ) + result = authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W333" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.bot_token == "xoxb-valid-refreshed" + assert result.user_token is None + assert_auth_test_count(self, 1) + class LegacyMemoryInstallationStore(InstallationStore): @property diff --git a/tests/slack_bolt_async/authorization/test_async_authorize.py b/tests/slack_bolt_async/authorization/test_async_authorize.py index 495d70302..ccc75df5c 100644 --- a/tests/slack_bolt_async/authorization/test_async_authorize.py +++ b/tests/slack_bolt_async/authorization/test_async_authorize.py @@ -272,6 +272,57 @@ async def test_fetch_different_user_token_with_rotation(self): assert result.user_token == "xoxp-valid-refreshed" await assert_auth_test_count_async(self, 1) + @pytest.mark.asyncio + async def test_remove_latest_user_token_if_it_is_not_relevant(self): + installation_store = ValidUserTokenInstallationStore() + authorize = AsyncInstallationStoreAuthorize( + logger=installation_store.logger, installation_store=installation_store + ) + context = AsyncBoltContext() + context["client"] = AsyncWebClient(base_url=self.mock_api_server_base_url) + result = await authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W333" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.bot_token == "xoxb-valid" + assert result.user_token is None + await assert_auth_test_count_async(self, 1) + + @pytest.mark.asyncio + async def test_rotate_only_bot_token(self): + context = AsyncBoltContext() + mock_client = AsyncWebClient(base_url=self.mock_api_server_base_url) + context["client"] = mock_client + + installation_store = ValidUserTokenRotationInstallationStore() + invalid_authorize = AsyncInstallationStoreAuthorize( + logger=installation_store.logger, installation_store=installation_store + ) + with pytest.raises(BoltError): + await invalid_authorize( + context=context, + enterprise_id="E111", + team_id="T0G9PQBBK", + user_id="W333", + ) + + authorize = AsyncInstallationStoreAuthorize( + client_id="111.222", + client_secret="secret", + client=mock_client, + logger=installation_store.logger, + installation_store=installation_store, + ) + result = await authorize( + context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W333" + ) + assert result.bot_id == "BZYBOTHED" + assert result.bot_user_id == "W23456789" + assert result.bot_token == "xoxb-valid-refreshed" + assert result.user_token is None + await assert_auth_test_count_async(self, 1) + class LegacyMemoryInstallationStore(AsyncInstallationStore): @property From 47801c8dbdfeae377d8f7f4a883708df7c127e88 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 1 Feb 2022 15:44:30 +0900 Subject: [PATCH 303/719] version 1.11.4 --- docs/api-docs/slack_bolt/authorization/async_authorize.html | 6 ++++++ docs/api-docs/slack_bolt/authorization/authorize.html | 6 ++++++ docs/api-docs/slack_bolt/version.html | 2 +- slack_bolt/version.py | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/api-docs/slack_bolt/authorization/async_authorize.html b/docs/api-docs/slack_bolt/authorization/async_authorize.html index 29af799ee..4621b7b74 100644 --- a/docs/api-docs/slack_bolt/authorization/async_authorize.html +++ b/docs/api-docs/slack_bolt/authorization/async_authorize.html @@ -222,7 +222,10 @@

    Module slack_bolt.authorization.async_authorizeAncestors

    if latest_installation.user_id != user_id: # First off, remove the user token as the installer is a different user + user_token = None latest_installation.user_token = None + latest_installation.user_refresh_token = None + latest_installation.user_token_expires_at = None latest_installation.user_scopes = [] # try to fetch the request user's installation diff --git a/docs/api-docs/slack_bolt/authorization/authorize.html b/docs/api-docs/slack_bolt/authorization/authorize.html index c666154a3..ed28b0913 100644 --- a/docs/api-docs/slack_bolt/authorization/authorize.html +++ b/docs/api-docs/slack_bolt/authorization/authorize.html @@ -222,7 +222,10 @@

    Module slack_bolt.authorization.authorize

    if latest_installation.user_id != user_id: # First off, remove the user token as the installer is a different user + user_token = None latest_installation.user_token = None + latest_installation.user_refresh_token = None + latest_installation.user_token_expires_at = None latest_installation.user_scopes = [] # try to fetch the request user's installation @@ -593,7 +596,10 @@

    Ancestors

    if latest_installation.user_id != user_id: # First off, remove the user token as the installer is a different user + user_token = None latest_installation.user_token = None + latest_installation.user_refresh_token = None + latest_installation.user_token_expires_at = None latest_installation.user_scopes = [] # try to fetch the request user's installation diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index 8cc0587df..be0df1171 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.11.3"
    +__version__ = "1.11.4"
    diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 61ceb7244..e428a0023 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.11.3" +__version__ = "1.11.4" From 1d139698eb88dda1aad40e67eac11bf38c5d02fd Mon Sep 17 00:00:00 2001 From: Alissa Renz Date: Tue, 1 Feb 2022 15:46:02 -0800 Subject: [PATCH 304/719] Update ngrok link (#587) --- docs/_tutorials/getting_started_http.md | 2 +- docs/_tutorials/ja_getting_started_http.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_tutorials/getting_started_http.md b/docs/_tutorials/getting_started_http.md index 3882f6d9c..795a1e891 100644 --- a/docs/_tutorials/getting_started_http.md +++ b/docs/_tutorials/getting_started_http.md @@ -137,7 +137,7 @@ Let's enable events for your app: 2. Add your Request URL. Slack will send HTTP POST requests corresponding to events to this [Request URL](https://api.slack.com/apis/connections/events-api#the-events-api__subscribing-to-event-types__events-api-request-urls) endpoint. Bolt uses the `/slack/events` path to listen to all incoming requests (whether shortcuts, events, or interactivity payloads). When configuring your Request URL within your app configuration, you'll append `/slack/events`, e.g. `https:///slack/events`. 💡 As long as your Bolt app is still running, your URL should become verified. -> 💡 For local development, you can use a proxy service like ngrok to create a public URL and tunnel requests to your development environment. We've written a separate tutorial about [using ngrok with Slack for local development](https://api.slack.com/tutorials/tunneling-with-ngrok) that should help you get everything set up. And when you get to hosting your app, we've collected some of the most common hosting providers Slack developers use to host their apps [on our API site](https://api.slack.com/docs/hosting). +> 💡 For local development, you can use a proxy service like ngrok to create a public URL and tunnel requests to your development environment. Refer to [ngrok's getting started guide](https://ngrok.com/docs#getting-started-expose) on how to create this tunnel. And when you get to hosting your app, we've collected some of the most common hosting providers Slack developers use to host their apps [on our API site](https://api.slack.com/docs/hosting). Finally, it's time to tell Slack what events we'd like to listen for. diff --git a/docs/_tutorials/ja_getting_started_http.md b/docs/_tutorials/ja_getting_started_http.md index 13088add4..cf8bb35fb 100644 --- a/docs/_tutorials/ja_getting_started_http.md +++ b/docs/_tutorials/ja_getting_started_http.md @@ -142,7 +142,7 @@ Slack ワークスペースで発生するイベント(メッセージが投 1. [アプリ管理ページ](https://api.slack.com/apps)でアプリをクリックします。次に、左サイドバーの「**Event Subscriptions**」をクリックします。「**Enable Events**」というラベルのスイッチをオンに切り替えます。 2. リクエストURLを追加します。Slackはイベントに対応するHTTP POSTリクエストをこの [Request URL](https://api.slack.com/apis/connections/events-api#the-events-api__subscribing-to-event-types__events-api-request-urls) のエンドポイントに送信します。Bolt は `/slack/events` のエンドポイントで、全ての受信リクエストをリッスンします。これらのリクエストにはショートカット、イベント、インタラクションペイロードが含まれます。アプリの設定でエンドポイントを指定するときは、すべての Request URL の末尾に「/slack/events」を追加してください。例えば、 `https:///slack/events` のようになります。Bolt アプリが起動した状態のままなら、URL の検証が成功するはずです。 -> 💡 ローカルでの開発時には、ngrok のような開発用プロキシサービスを利用することができます。開発用プロキシを利用すると、リクエストを開発環境にトンネルするパブリック URL を作成できます。[Slack のローカル開発で ngrok を使用する方法](https://api.slack.com/tutorials/tunneling-with-ngrok)については、別のチュートリアルを用意していますので参考にしてください。また、アプリのホスティングが必要になった場合には、[API サイトに](https://api.slack.com/docs/hosting) Slack開発者達がアプリのホスティングよく利用するホスティングプロバイダーを集めています。 +> 💡 ローカル開発では、[ngrok](https://ngrok.com/)のようなプロキシサービスを使って公開 URL を作成し、リクエストを開発環境にトンネリングすることができます。このトンネリングの方法については、[ngrok のガイド](https://ngrok.com/docs#getting-started-expose)を参照してください。また、アプリのホスティングが必要になった場合には、[API サイトに](https://api.slack.com/docs/hosting) Slack開発者達がアプリのホスティングよく利用するホスティングプロバイダーを集めています。 それでは、Slackにどのイベントをリッスンするかを教えてあげましょう。 From 78b64878b692039e39530888a012bf738ca74058 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 5 Feb 2022 08:25:15 +0900 Subject: [PATCH 305/719] Upgrade test dependencies & fix Falcon warning (#588) * Upgrade test dependencies & fix Falcon warning * Organize dependencies in setup.py --- .github/maintainers_guide.md | 1 + .github/workflows/codecov.yml | 1 + .github/workflows/tests.yml | 7 +++- scripts/install_all_and_run_tests.sh | 14 ++++++- scripts/run_pytype.sh | 2 +- scripts/run_tests.sh | 1 + setup.py | 40 +++++++++++-------- slack_bolt/adapter/falcon/resource.py | 8 +++- .../django/test_django_settings.py | 3 ++ tests/adapter_tests/falcon/test_falcon.py | 17 ++++++-- 10 files changed, 67 insertions(+), 27 deletions(-) diff --git a/.github/maintainers_guide.md b/.github/maintainers_guide.md index 550480f74..03b643aaf 100644 --- a/.github/maintainers_guide.md +++ b/.github/maintainers_guide.md @@ -89,6 +89,7 @@ If you make changes to `slack_bolt/adapter/*`, please verify if it surely works ```bash # Install all optional dependencies $ pip install -e ".[adapter]" +$ pip install -e ".[adapter_testing]" # Set required env variables $ export SLACK_SIGNING_SECRET=*** diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 37b87fc4c..340b3d22d 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -29,6 +29,7 @@ jobs: pip install -e ".[async]" pip install -e ".[adapter]" pip install -e ".[testing]" + pip install -e ".[adapter_testing]" - name: Run all tests for codecov run: | pytest --cov=slack_bolt/ && bash <(curl -s https://codecov.io/bash) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c32fd1154..8be5e12ed 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,6 +34,7 @@ jobs: - name: Run tests for Socket Mode adapters run: | pip install -e ".[adapter]" + pip install -e ".[adapter_testing]" pytest tests/adapter_tests/socket_mode/ - name: Run tests for HTTP Mode adapters (AWS) run: | @@ -47,9 +48,13 @@ jobs: - name: Run tests for HTTP Mode adapters (Django) run: | pytest tests/adapter_tests/django/ - - name: Run tests for HTTP Mode adapters (Falcon) + - name: Run tests for HTTP Mode adapters (Falcon 3.x) run: | pytest tests/adapter_tests/falcon/ + - name: Run tests for HTTP Mode adapters (Falcon 2.x) + run: | + pip install "falcon<3" + pytest tests/adapter_tests/falcon/ - name: Run tests for HTTP Mode adapters (Flask) run: | pytest tests/adapter_tests/flask/ diff --git a/scripts/install_all_and_run_tests.sh b/scripts/install_all_and_run_tests.sh index facbde4aa..cda15a058 100755 --- a/scripts/install_all_and_run_tests.sh +++ b/scripts/install_all_and_run_tests.sh @@ -15,13 +15,23 @@ pip install -e . if [[ $test_target != "" ]] then - pip install -e ".[testing]" && \ + # To fix: Using legacy 'setup.py install' for greenlet, since package 'wheel' is not installed. + pip install -U wheel && \ + pip install -e ".[testing]" && \ pip install -e ".[adapter]" && \ + pip install -e ".[adapter_testing]" && \ + # To avoid errors due to the old versions of click forced by Chalice + pip install -U pip click && \ black slack_bolt/ tests/ && \ pytest $1 else - pip install -e ".[testing]" && \ + # To fix: Using legacy 'setup.py install' for greenlet, since package 'wheel' is not installed. + pip install -U wheel && \ + pip install -e ".[testing]" && \ pip install -e ".[adapter]" && \ + pip install -e ".[adapter_testing]" && \ + # To avoid errors due to the old versions of click forced by Chalice + pip install -U pip click && \ black slack_bolt/ tests/ && \ pytest && \ pip install -U pytype && \ diff --git a/scripts/run_pytype.sh b/scripts/run_pytype.sh index debbc1f68..9c24cca46 100755 --- a/scripts/run_pytype.sh +++ b/scripts/run_pytype.sh @@ -5,5 +5,5 @@ script_dir=$(dirname $0) cd ${script_dir}/.. && \ pip install -e ".[async]" && \ pip install -e ".[adapter]" && \ - pip install "pytype==2022.1.13" && \ + pip install "pytype==2022.1.31" && \ pytype slack_bolt/ diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index 9931f8236..c380e7684 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -20,6 +20,7 @@ else black slack_bolt/ tests/ \ && pytest -vv \ && pip install -e ".[adapter]" \ + && pip install -e ".[adapter_testing]" \ && pip install -U pip setuptools wheel \ && pip install -U pytype \ && pytype slack_bolt/ diff --git a/setup.py b/setup.py index 8f58c3d0f..8980d7661 100755 --- a/setup.py +++ b/setup.py @@ -15,9 +15,19 @@ test_dependencies = [ "pytest>=6.2.5,<7", "pytest-cov>=3,<4", - "Flask-Sockets>=0.2,<1", - "Werkzeug<2", # TODO: support Flask 2.x - "black==21.12b0", + "Flask-Sockets>=0.2,<1", # TODO: This module is not yet Flask 2.x compatible + "Werkzeug>=1,<2", # TODO: Flask-Sockets is not yet compatible with Flask 2.x + "black==22.1.0", +] + +adapter_test_dependencies = [ + "moto>=3,<4", # For AWS tests + "docker>=5,<6", # Used by moto + "boddle>=0.2,<0.3", # For Bottle app tests + "Flask>=1,<2", # TODO: Flask-Sockets is not yet compatible with Flask 2.x + "Werkzeug>=1,<2", # TODO: Flask-Sockets is not yet compatible with Flask 2.x + "sanic-testing>=0.7" if sys.version_info.minor > 6 else "", + "requests>=2,<3", # For Starlette's TestClient ] async_test_dependencies = test_dependencies + [ @@ -63,36 +73,32 @@ "adapter": [ # used only under src/slack_bolt/adapter "boto3<=2", - # TODO: Upgrade to v2 - "moto<2", # For AWS tests "bottle>=0.12,<1", - "boddle>=0.2,<0.3", # For Bottle app tests - "chalice>=1.26.1,<2", + "chalice>=1.26.5,<2", "click>=7,<8", # for chalice "CherryPy>=18,<19", - "Django>=3,<4", - "falcon>=2,<3", + "Django>=3,<5", + "falcon>=2,<4", "fastapi>=0.70.0,<1", - "Flask>=1,<2", - "Werkzeug<2", # TODO: support Flask 2.x - "pyramid>=1,<2", + "Flask>=1,<3", + "Werkzeug>=2,<3", + "pyramid>=1,<3", "sanic>=21,<22" if sys.version_info.minor > 6 else "sanic>=20,<21", - "sanic-testing>=0.7" if sys.version_info.minor > 6 else "", "starlette>=0.14,<1", - "requests>=2,<3", # For starlette's TestClient "tornado>=6,<7", # server "uvicorn<1", "gunicorn>=20,<21", # Socket Mode 3rd party implementation - # TODO: 1.2.2 has a regression (https://github.com/websocket-client/websocket-client/issues/769) - # ERROR on_error invoked (error: AttributeError, message: 'Dispatcher' object has no attribute 'read') - "websocket_client>=1,<1.2.2", + # Note: 1.2.2 has a regression (https://github.com/websocket-client/websocket-client/issues/769) + "websocket_client>=1.2.3,<2", ], # pip install -e ".[testing_without_asyncio]" "testing_without_asyncio": test_dependencies, # pip install -e ".[testing]" "testing": async_test_dependencies, + # pip install -e ".[adapter_testing]" + "adapter_testing": adapter_test_dependencies, }, classifiers=[ "Programming Language :: Python :: 3.6", diff --git a/slack_bolt/adapter/falcon/resource.py b/slack_bolt/adapter/falcon/resource.py index fb6fd24bf..e14ea71ce 100644 --- a/slack_bolt/adapter/falcon/resource.py +++ b/slack_bolt/adapter/falcon/resource.py @@ -1,7 +1,7 @@ from datetime import datetime # type: ignore from http import HTTPStatus -from falcon import Request, Response +from falcon import Request, Response, version as falcon_version from slack_bolt import BoltResponse from slack_bolt.app import App @@ -50,7 +50,11 @@ def _to_bolt_request(self, req: Request) -> BoltRequest: ) def _write_response(self, bolt_resp: BoltResponse, resp: Response): - resp.body = bolt_resp.body + if falcon_version.__version__.startswith("2."): + resp.body = bolt_resp.body + else: + resp.text = bolt_resp.body + status = HTTPStatus(bolt_resp.status) resp.status = str(f"{status.value} {status.phrase}") resp.set_headers(bolt_resp.first_headers_without_set_cookie()) diff --git a/tests/adapter_tests/django/test_django_settings.py b/tests/adapter_tests/django/test_django_settings.py index 8811343fe..95eecbdd5 100644 --- a/tests/adapter_tests/django/test_django_settings.py +++ b/tests/adapter_tests/django/test_django_settings.py @@ -5,3 +5,6 @@ "NAME": "logs/db.sqlite3", } } +# Django 4 warning: The default value of USE_TZ will change from False to True in Django 5.0. +# Set USE_TZ to False in your project settings if you want to keep the current default behavior. +USE_TZ = False diff --git a/tests/adapter_tests/falcon/test_falcon.py b/tests/adapter_tests/falcon/test_falcon.py index 2cd9cdd59..143b8bb08 100644 --- a/tests/adapter_tests/falcon/test_falcon.py +++ b/tests/adapter_tests/falcon/test_falcon.py @@ -3,6 +3,8 @@ from urllib.parse import quote import falcon + + from falcon import testing from slack_sdk.signature import SignatureVerifier from slack_sdk.web import WebClient @@ -18,6 +20,13 @@ from tests.utils import remove_os_env_temporarily, restore_os_env +def new_falcon_app(): + if falcon.version.__version__.startswith("2."): + return falcon.API() + else: + return falcon.App() + + class TestFalcon: signing_secret = "secret" valid_token = "xoxb-valid" @@ -87,7 +96,7 @@ def event_handler(): } timestamp, body = str(int(time())), json.dumps(input) - api = falcon.API() + api = new_falcon_app() resource = SlackAppResource(app) api.add_route("/slack/events", resource) @@ -128,7 +137,7 @@ def shortcut_handler(ack): timestamp, body = str(int(time())), f"payload={quote(json.dumps(input))}" - api = falcon.API() + api = new_falcon_app() resource = SlackAppResource(app) api.add_route("/slack/events", resource) @@ -169,7 +178,7 @@ def command_handler(ack): ) timestamp, body = str(int(time())), input - api = falcon.API() + api = new_falcon_app() resource = SlackAppResource(app) api.add_route("/slack/events", resource) @@ -192,7 +201,7 @@ def test_oauth(self): scopes=["chat:write", "commands"], ), ) - api = falcon.API() + api = new_falcon_app() resource = SlackAppResource(app) api.add_route("/slack/install", resource) From c0e98b0150a91df4ae9f85431c9ed2639dbb94ab Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 26 Feb 2022 07:48:07 +0900 Subject: [PATCH 306/719] Fix build failures due to itsdangerous package release --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 8980d7661..e2a1611d5 100755 --- a/setup.py +++ b/setup.py @@ -17,6 +17,7 @@ "pytest-cov>=3,<4", "Flask-Sockets>=0.2,<1", # TODO: This module is not yet Flask 2.x compatible "Werkzeug>=1,<2", # TODO: Flask-Sockets is not yet compatible with Flask 2.x + "itsdangerous==2.0.1", # TODO: Flask-Sockets is not yet compatible with Flask 2.x "black==22.1.0", ] From 52b1512e4d89229a313517fe6243df67dff42d5a Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 26 Feb 2022 08:03:52 +0900 Subject: [PATCH 307/719] Fix #601 Allow for host option for AsyncSlackAppServer start method (#602) --- slack_bolt/app/async_app.py | 18 +++++++++++++----- slack_bolt/app/async_server.py | 10 ++++++++-- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index b80b650c8..92ce70beb 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -446,14 +446,18 @@ def process_before_response(self) -> bool: from .async_server import AsyncSlackAppServer def server( - self, port: int = 3000, path: str = "/slack/events" + self, + port: int = 3000, + path: str = "/slack/events", + host: Optional[str] = None, ) -> AsyncSlackAppServer: """Configure a web server using AIOHTTP. Refer to https://docs.aiohttp.org/ for more details about AIOHTTP. Args: port: The port to listen on (Default: 3000) - path:The path to handle request from Slack (Default: `/slack/events`) + path: The path to handle request from Slack (Default: `/slack/events`) + host: The hostname to serve the web endpoints. (Default: 0.0.0.0) """ if ( self._server is None @@ -464,6 +468,7 @@ def server( port=port, path=path, app=self, + host=host, ) return self._server @@ -488,15 +493,18 @@ def app_factory(): """ return self.server(path=path).web_app - def start(self, port: int = 3000, path: str = "/slack/events") -> None: + def start( + self, port: int = 3000, path: str = "/slack/events", host: Optional[str] = None + ) -> None: """Start a web server using AIOHTTP. Refer to https://docs.aiohttp.org/ for more details about AIOHTTP. Args: port: The port to listen on (Default: 3000) - path:The path to handle request from Slack (Default: `/slack/events`) + path: The path to handle request from Slack (Default: `/slack/events`) + host: The hostname to serve the web endpoints. (Default: 0.0.0.0) """ - self.server(port=port, path=path).start() + self.server(port=port, path=path, host=host).start() # ------------------------- # main dispatcher diff --git a/slack_bolt/app/async_server.py b/slack_bolt/app/async_server.py index e5176fab2..b1e1bca44 100644 --- a/slack_bolt/app/async_server.py +++ b/slack_bolt/app/async_server.py @@ -1,4 +1,5 @@ import logging +from typing import Optional from aiohttp import web @@ -10,6 +11,7 @@ class AsyncSlackAppServer: port: int path: str + host: str bolt_app: "AsyncApp" # type:ignore web_app: web.Application @@ -18,6 +20,7 @@ def __init__( # type:ignore port: int, path: str, app: "AsyncApp", # type:ignore + host: Optional[str] = None, ): """Standalone AIOHTTP Web Server. Refer to https://docs.aiohttp.org/en/stable/web.html for details of AIOHTTP. @@ -26,9 +29,11 @@ def __init__( # type:ignore port: The port to listen on path: The path to receive incoming requests from Slack app: The `AsyncApp` instance that is used for processing requests + host: The hostname to serve the web endpoints. (Default: 0.0.0.0) """ self.port = port self.path = path + self.host = host if host is not None else "0.0.0.0" self.bolt_app: "AsyncApp" = app # type: ignore self.web_app = web.Application() self._bolt_oauth_flow = self.bolt_app.oauth_flow @@ -72,11 +77,12 @@ async def handle_post_requests(self, request: web.Request) -> web.Response: bolt_resp: BoltResponse = await self.bolt_app.async_dispatch(bolt_req) return await to_aiohttp_response(bolt_resp) - def start(self) -> None: + def start(self, host: Optional[str] = None) -> None: """Starts a new web server process.""" if self.bolt_app.logger.level > logging.INFO: print(get_boot_message()) else: self.bolt_app.logger.info(get_boot_message()) - web.run_app(self.web_app, host="0.0.0.0", port=self.port) + _host = host if host is not None else self.host + web.run_app(self.web_app, host=_host, port=self.port) From d3230344c20f182a2c7fee36c375bdcdfa6afa61 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 26 Feb 2022 08:19:11 +0900 Subject: [PATCH 308/719] Upgrade pytype version --- scripts/run_pytype.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run_pytype.sh b/scripts/run_pytype.sh index 9c24cca46..273ce37f4 100755 --- a/scripts/run_pytype.sh +++ b/scripts/run_pytype.sh @@ -5,5 +5,5 @@ script_dir=$(dirname $0) cd ${script_dir}/.. && \ pip install -e ".[async]" && \ pip install -e ".[adapter]" && \ - pip install "pytype==2022.1.31" && \ + pip install "pytype==2022.2.23" && \ pytype slack_bolt/ From a3858eadb2322c11dd4ca83d11c593a4638b02e9 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 26 Feb 2022 08:20:12 +0900 Subject: [PATCH 309/719] version 1.11.5 --- .../slack_bolt/adapter/falcon/resource.html | 14 +++- docs/api-docs/slack_bolt/app/async_app.html | 72 +++++++++++++------ .../api-docs/slack_bolt/app/async_server.html | 35 ++++++--- docs/api-docs/slack_bolt/version.html | 2 +- slack_bolt/version.py | 2 +- 5 files changed, 91 insertions(+), 34 deletions(-) diff --git a/docs/api-docs/slack_bolt/adapter/falcon/resource.html b/docs/api-docs/slack_bolt/adapter/falcon/resource.html index 7a59a9c63..47e8ea262 100644 --- a/docs/api-docs/slack_bolt/adapter/falcon/resource.html +++ b/docs/api-docs/slack_bolt/adapter/falcon/resource.html @@ -29,7 +29,7 @@

    Module slack_bolt.adapter.falcon.resource

    from datetime import datetime  # type: ignore
     from http import HTTPStatus
     
    -from falcon import Request, Response
    +from falcon import Request, Response, version as falcon_version
     
     from slack_bolt import BoltResponse
     from slack_bolt.app import App
    @@ -78,7 +78,11 @@ 

    Module slack_bolt.adapter.falcon.resource

    ) def _write_response(self, bolt_resp: BoltResponse, resp: Response): - resp.body = bolt_resp.body + if falcon_version.__version__.startswith("2."): + resp.body = bolt_resp.body + else: + resp.text = bolt_resp.body + status = HTTPStatus(bolt_resp.status) resp.status = str(f"{status.value} {status.phrase}") resp.set_headers(bolt_resp.first_headers_without_set_cookie()) @@ -166,7 +170,11 @@

    Classes

    ) def _write_response(self, bolt_resp: BoltResponse, resp: Response): - resp.body = bolt_resp.body + if falcon_version.__version__.startswith("2."): + resp.body = bolt_resp.body + else: + resp.text = bolt_resp.body + status = HTTPStatus(bolt_resp.status) resp.status = str(f"{status.value} {status.phrase}") resp.set_headers(bolt_resp.first_headers_without_set_cookie()) diff --git a/docs/api-docs/slack_bolt/app/async_app.html b/docs/api-docs/slack_bolt/app/async_app.html index f9c3059ca..52fe24ac6 100644 --- a/docs/api-docs/slack_bolt/app/async_app.html +++ b/docs/api-docs/slack_bolt/app/async_app.html @@ -474,14 +474,18 @@

    Module slack_bolt.app.async_app

    from .async_server import AsyncSlackAppServer def server( - self, port: int = 3000, path: str = "/slack/events" + self, + port: int = 3000, + path: str = "/slack/events", + host: Optional[str] = None, ) -> AsyncSlackAppServer: """Configure a web server using AIOHTTP. Refer to https://docs.aiohttp.org/ for more details about AIOHTTP. Args: port: The port to listen on (Default: 3000) - path:The path to handle request from Slack (Default: `/slack/events`) + path: The path to handle request from Slack (Default: `/slack/events`) + host: The hostname to serve the web endpoints. (Default: 0.0.0.0) """ if ( self._server is None @@ -492,6 +496,7 @@

    Module slack_bolt.app.async_app

    port=port, path=path, app=self, + host=host, ) return self._server @@ -516,15 +521,18 @@

    Module slack_bolt.app.async_app

    """ return self.server(path=path).web_app - def start(self, port: int = 3000, path: str = "/slack/events") -> None: + def start( + self, port: int = 3000, path: str = "/slack/events", host: Optional[str] = None + ) -> None: """Start a web server using AIOHTTP. Refer to https://docs.aiohttp.org/ for more details about AIOHTTP. Args: port: The port to listen on (Default: 3000) - path:The path to handle request from Slack (Default: `/slack/events`) + path: The path to handle request from Slack (Default: `/slack/events`) + host: The hostname to serve the web endpoints. (Default: 0.0.0.0) """ - self.server(port=port, path=path).start() + self.server(port=port, path=path, host=host).start() # ------------------------- # main dispatcher @@ -1866,14 +1874,18 @@

    Args

    from .async_server import AsyncSlackAppServer def server( - self, port: int = 3000, path: str = "/slack/events" + self, + port: int = 3000, + path: str = "/slack/events", + host: Optional[str] = None, ) -> AsyncSlackAppServer: """Configure a web server using AIOHTTP. Refer to https://docs.aiohttp.org/ for more details about AIOHTTP. Args: port: The port to listen on (Default: 3000) - path:The path to handle request from Slack (Default: `/slack/events`) + path: The path to handle request from Slack (Default: `/slack/events`) + host: The hostname to serve the web endpoints. (Default: 0.0.0.0) """ if ( self._server is None @@ -1884,6 +1896,7 @@

    Args

    port=port, path=path, app=self, + host=host, ) return self._server @@ -1908,15 +1921,18 @@

    Args

    """ return self.server(path=path).web_app - def start(self, port: int = 3000, path: str = "/slack/events") -> None: + def start( + self, port: int = 3000, path: str = "/slack/events", host: Optional[str] = None + ) -> None: """Start a web server using AIOHTTP. Refer to https://docs.aiohttp.org/ for more details about AIOHTTP. Args: port: The port to listen on (Default: 3000) - path:The path to handle request from Slack (Default: `/slack/events`) + path: The path to handle request from Slack (Default: `/slack/events`) + host: The hostname to serve the web endpoints. (Default: 0.0.0.0) """ - self.server(port=port, path=path).start() + self.server(port=port, path=path, host=host).start() # ------------------------- # main dispatcher @@ -3856,7 +3872,7 @@

    Args

    -def server(self, port: int = 3000, path: str = '/slack/events') ‑> AsyncSlackAppServer +def server(self, port: int = 3000, path: str = '/slack/events', host: Optional[str] = None) ‑> AsyncSlackAppServer

    Configure a web server using AIOHTTP. @@ -3865,21 +3881,28 @@

    Args

    port
    The port to listen on (Default: 3000)
    -
    -

    path:The path to handle request from Slack (Default: /slack/events)

    +
    path
    +
    The path to handle request from Slack (Default: /slack/events)
    +
    host
    +
    The hostname to serve the web endpoints. (Default: 0.0.0.0)
    +
    Expand source code
    def server(
    -    self, port: int = 3000, path: str = "/slack/events"
    +    self,
    +    port: int = 3000,
    +    path: str = "/slack/events",
    +    host: Optional[str] = None,
     ) -> AsyncSlackAppServer:
         """Configure a web server using AIOHTTP.
         Refer to https://docs.aiohttp.org/ for more details about AIOHTTP.
     
         Args:
             port: The port to listen on (Default: 3000)
    -        path:The path to handle request from Slack (Default: `/slack/events`)
    +        path: The path to handle request from Slack (Default: `/slack/events`)
    +        host: The hostname to serve the web endpoints. (Default: 0.0.0.0)
         """
         if (
             self._server is None
    @@ -3890,6 +3913,7 @@ 

    Args

    port=port, path=path, app=self, + host=host, ) return self._server
    @@ -3981,7 +4005,7 @@

    Args

    -def start(self, port: int = 3000, path: str = '/slack/events') ‑> None +def start(self, port: int = 3000, path: str = '/slack/events', host: Optional[str] = None) ‑> None

    Start a web server using AIOHTTP. @@ -3990,21 +4014,27 @@

    Args

    port
    The port to listen on (Default: 3000)
    -
    -

    path:The path to handle request from Slack (Default: /slack/events)

    +
    path
    +
    The path to handle request from Slack (Default: /slack/events)
    +
    host
    +
    The hostname to serve the web endpoints. (Default: 0.0.0.0)
    +
    Expand source code -
    def start(self, port: int = 3000, path: str = "/slack/events") -> None:
    +
    def start(
    +    self, port: int = 3000, path: str = "/slack/events", host: Optional[str] = None
    +) -> None:
         """Start a web server using AIOHTTP.
         Refer to https://docs.aiohttp.org/ for more details about AIOHTTP.
     
         Args:
             port: The port to listen on (Default: 3000)
    -        path:The path to handle request from Slack (Default: `/slack/events`)
    +        path: The path to handle request from Slack (Default: `/slack/events`)
    +        host: The hostname to serve the web endpoints. (Default: 0.0.0.0)
         """
    -    self.server(port=port, path=path).start()
    + self.server(port=port, path=path, host=host).start()
    diff --git a/docs/api-docs/slack_bolt/app/async_server.html b/docs/api-docs/slack_bolt/app/async_server.html index 24961f59a..428cab781 100644 --- a/docs/api-docs/slack_bolt/app/async_server.html +++ b/docs/api-docs/slack_bolt/app/async_server.html @@ -27,6 +27,7 @@

    Module slack_bolt.app.async_server

    Expand source code
    import logging
    +from typing import Optional
     
     from aiohttp import web
     
    @@ -38,6 +39,7 @@ 

    Module slack_bolt.app.async_server

    class AsyncSlackAppServer: port: int path: str + host: str bolt_app: "AsyncApp" # type:ignore web_app: web.Application @@ -46,6 +48,7 @@

    Module slack_bolt.app.async_server

    port: int, path: str, app: "AsyncApp", # type:ignore + host: Optional[str] = None, ): """Standalone AIOHTTP Web Server. Refer to https://docs.aiohttp.org/en/stable/web.html for details of AIOHTTP. @@ -54,9 +57,11 @@

    Module slack_bolt.app.async_server

    port: The port to listen on path: The path to receive incoming requests from Slack app: The `AsyncApp` instance that is used for processing requests + host: The hostname to serve the web endpoints. (Default: 0.0.0.0) """ self.port = port self.path = path + self.host = host if host is not None else "0.0.0.0" self.bolt_app: "AsyncApp" = app # type: ignore self.web_app = web.Application() self._bolt_oauth_flow = self.bolt_app.oauth_flow @@ -100,14 +105,15 @@

    Module slack_bolt.app.async_server

    bolt_resp: BoltResponse = await self.bolt_app.async_dispatch(bolt_req) return await to_aiohttp_response(bolt_resp) - def start(self) -> None: + def start(self, host: Optional[str] = None) -> None: """Starts a new web server process.""" if self.bolt_app.logger.level > logging.INFO: print(get_boot_message()) else: self.bolt_app.logger.info(get_boot_message()) - web.run_app(self.web_app, host="0.0.0.0", port=self.port)
    + _host = host if host is not None else self.host + web.run_app(self.web_app, host=_host, port=self.port)
    @@ -121,7 +127,7 @@

    Classes

    class AsyncSlackAppServer -(port: int, path: str, app: AsyncApp) +(port: int, path: str, app: AsyncApp, host: Optional[str] = None)

    Standalone AIOHTTP Web Server. @@ -134,6 +140,8 @@

    Args

    The path to receive incoming requests from Slack
    app
    The AsyncApp instance that is used for processing requests
    +
    host
    +
    The hostname to serve the web endpoints. (Default: 0.0.0.0)
    @@ -142,6 +150,7 @@

    Args

    class AsyncSlackAppServer:
         port: int
         path: str
    +    host: str
         bolt_app: "AsyncApp"  # type:ignore
         web_app: web.Application
     
    @@ -150,6 +159,7 @@ 

    Args

    port: int, path: str, app: "AsyncApp", # type:ignore + host: Optional[str] = None, ): """Standalone AIOHTTP Web Server. Refer to https://docs.aiohttp.org/en/stable/web.html for details of AIOHTTP. @@ -158,9 +168,11 @@

    Args

    port: The port to listen on path: The path to receive incoming requests from Slack app: The `AsyncApp` instance that is used for processing requests + host: The hostname to serve the web endpoints. (Default: 0.0.0.0) """ self.port = port self.path = path + self.host = host if host is not None else "0.0.0.0" self.bolt_app: "AsyncApp" = app # type: ignore self.web_app = web.Application() self._bolt_oauth_flow = self.bolt_app.oauth_flow @@ -204,14 +216,15 @@

    Args

    bolt_resp: BoltResponse = await self.bolt_app.async_dispatch(bolt_req) return await to_aiohttp_response(bolt_resp) - def start(self) -> None: + def start(self, host: Optional[str] = None) -> None: """Starts a new web server process.""" if self.bolt_app.logger.level > logging.INFO: print(get_boot_message()) else: self.bolt_app.logger.info(get_boot_message()) - web.run_app(self.web_app, host="0.0.0.0", port=self.port)
    + _host = host if host is not None else self.host + web.run_app(self.web_app, host=_host, port=self.port)

    Class variables

    @@ -219,6 +232,10 @@

    Class variables

    +
    var host : str
    +
    +
    +
    var path : str
    @@ -279,7 +296,7 @@

    Methods

    -def start(self) ‑> None +def start(self, host: Optional[str] = None) ‑> None

    Starts a new web server process.

    @@ -287,14 +304,15 @@

    Methods

    Expand source code -
    def start(self) -> None:
    +
    def start(self, host: Optional[str] = None) -> None:
         """Starts a new web server process."""
         if self.bolt_app.logger.level > logging.INFO:
             print(get_boot_message())
         else:
             self.bolt_app.logger.info(get_boot_message())
     
    -    web.run_app(self.web_app, host="0.0.0.0", port=self.port)
    + _host = host if host is not None else self.host + web.run_app(self.web_app, host=_host, port=self.port)
    @@ -321,6 +339,7 @@

    bolt_app
  • handle_get_requests
  • handle_post_requests
  • +
  • host
  • path
  • port
  • start
  • diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index be0df1171..dd6dbfd4c 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.11.4"
    +__version__ = "1.11.5"
    diff --git a/slack_bolt/version.py b/slack_bolt/version.py index e428a0023..6ed6690f9 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.11.4" +__version__ = "1.11.5" From 3508337d91809fdb709499a2391ca4c84263dbae Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 3 Mar 2022 06:54:05 +0900 Subject: [PATCH 310/719] Fix #604 Respect the proxy_url in respond (#608) --- slack_bolt/context/async_context.py | 6 +- slack_bolt/context/context.py | 6 +- slack_bolt/context/respond/async_respond.py | 21 +++++- slack_bolt/context/respond/respond.py | 21 +++++- tests/scenario_tests/test_app.py | 55 +++++++++++++- tests/scenario_tests_async/test_app.py | 84 +++++++++++++++++++++ 6 files changed, 184 insertions(+), 9 deletions(-) diff --git a/slack_bolt/context/async_context.py b/slack_bolt/context/async_context.py index 46eb6c69d..81105c6df 100644 --- a/slack_bolt/context/async_context.py +++ b/slack_bolt/context/async_context.py @@ -116,5 +116,9 @@ async def handle_button_clicks(ack, respond): Callable `respond()` function """ if "respond" not in self: - self["respond"] = AsyncRespond(response_url=self.response_url) + self["respond"] = AsyncRespond( + response_url=self.response_url, + proxy=self.client.proxy, + ssl=self.client.ssl, + ) return self["respond"] diff --git a/slack_bolt/context/context.py b/slack_bolt/context/context.py index a92ac05bb..570a7080e 100644 --- a/slack_bolt/context/context.py +++ b/slack_bolt/context/context.py @@ -118,5 +118,9 @@ def handle_button_clicks(ack, respond): Callable `respond()` function """ if "respond" not in self: - self["respond"] = Respond(response_url=self.response_url) + self["respond"] = Respond( + response_url=self.response_url, + proxy=self.client.proxy, + ssl=self.client.ssl, + ) return self["respond"] diff --git a/slack_bolt/context/respond/async_respond.py b/slack_bolt/context/respond/async_respond.py index 60e4fe473..a589ef792 100644 --- a/slack_bolt/context/respond/async_respond.py +++ b/slack_bolt/context/respond/async_respond.py @@ -1,4 +1,5 @@ from typing import Optional, Union, Sequence +from ssl import SSLContext from slack_sdk.models.attachments import Attachment from slack_sdk.models.blocks import Block @@ -9,9 +10,19 @@ class AsyncRespond: response_url: Optional[str] + proxy: Optional[str] + ssl: Optional[SSLContext] - def __init__(self, *, response_url: Optional[str]): - self.response_url: Optional[str] = response_url + def __init__( + self, + *, + response_url: Optional[str], + proxy: Optional[str] = None, + ssl: Optional[SSLContext] = None, + ): + self.response_url = response_url + self.proxy = proxy + self.ssl = ssl async def __call__( self, @@ -25,7 +36,11 @@ async def __call__( unfurl_media: Optional[bool] = None, ) -> WebhookResponse: if self.response_url is not None: - client = AsyncWebhookClient(self.response_url) + client = AsyncWebhookClient( + url=self.response_url, + proxy=self.proxy, + ssl=self.ssl, + ) text_or_whole_response: Union[str, dict] = text if isinstance(text_or_whole_response, str): message = _build_message( diff --git a/slack_bolt/context/respond/respond.py b/slack_bolt/context/respond/respond.py index 21de92263..6cef9c36f 100644 --- a/slack_bolt/context/respond/respond.py +++ b/slack_bolt/context/respond/respond.py @@ -1,4 +1,5 @@ from typing import Optional, Union, Sequence +from ssl import SSLContext from slack_sdk.models.attachments import Attachment from slack_sdk.models.blocks import Block @@ -9,9 +10,19 @@ class Respond: response_url: Optional[str] + proxy: Optional[str] + ssl: Optional[SSLContext] - def __init__(self, *, response_url: Optional[str]): - self.response_url: Optional[str] = response_url + def __init__( + self, + *, + response_url: Optional[str], + proxy: Optional[str] = None, + ssl: Optional[SSLContext] = None, + ): + self.response_url = response_url + self.proxy = proxy + self.ssl = ssl def __call__( self, @@ -25,7 +36,11 @@ def __call__( unfurl_media: Optional[bool] = None, ) -> WebhookResponse: if self.response_url is not None: - client = WebhookClient(self.response_url) + client = WebhookClient( + url=self.response_url, + proxy=self.proxy, + ssl=self.ssl, + ) text_or_whole_response: Union[str, dict] = text if isinstance(text_or_whole_response, str): text = text_or_whole_response diff --git a/tests/scenario_tests/test_app.py b/tests/scenario_tests/test_app.py index 936ad68ec..86e89c9e9 100644 --- a/tests/scenario_tests/test_app.py +++ b/tests/scenario_tests/test_app.py @@ -1,11 +1,12 @@ from concurrent.futures import Executor +from ssl import SSLContext import pytest from slack_sdk import WebClient from slack_sdk.oauth.installation_store import FileInstallationStore from slack_sdk.oauth.state_store import FileOAuthStateStore -from slack_bolt import App, Say, BoltRequest +from slack_bolt import App, Say, BoltRequest, BoltContext from slack_bolt.authorization import AuthorizeResult from slack_bolt.error import BoltError from slack_bolt.oauth import OAuthFlow @@ -240,3 +241,55 @@ def test_none_body_no_middleware(self): response = app.dispatch(req) assert response.status == 404 assert response.body == '{"error": "unhandled request"}' + + def test_proxy_ssl_for_respond(self): + ssl = SSLContext() + web_client = WebClient( + token=self.valid_token, + base_url=self.mock_api_server_base_url, + proxy="http://proxy-host:9000/", + ssl=ssl, + ) + app = App( + signing_secret="valid", + client=web_client, + authorize=lambda: AuthorizeResult( + enterprise_id="E111", + team_id="T111", + ), + ) + + event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "team": "T111", + "channel": "C111", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, + } + + result = {"called": False} + + @app.event("app_mention") + def handle(context: BoltContext, respond): + assert context.respond.proxy == "http://proxy-host:9000/" + assert context.respond.ssl == ssl + assert respond.proxy == "http://proxy-host:9000/" + assert respond.ssl == ssl + result["called"] = True + + req = BoltRequest(body=event_body, headers={}, mode="socket_mode") + response = app.dispatch(req) + assert response.status == 200 + assert result["called"] is True diff --git a/tests/scenario_tests_async/test_app.py b/tests/scenario_tests_async/test_app.py index 1640087bc..7486027fe 100644 --- a/tests/scenario_tests_async/test_app.py +++ b/tests/scenario_tests_async/test_app.py @@ -1,17 +1,43 @@ +import asyncio +from ssl import SSLContext + import pytest from slack_sdk import WebClient from slack_sdk.oauth.installation_store import FileInstallationStore from slack_sdk.oauth.state_store import FileOAuthStateStore +from slack_sdk.web.async_client import AsyncWebClient from slack_bolt.async_app import AsyncApp from slack_bolt.authorization import AuthorizeResult +from slack_bolt.context.async_context import AsyncBoltContext from slack_bolt.error import BoltError from slack_bolt.oauth.async_oauth_flow import AsyncOAuthFlow from slack_bolt.oauth.async_oauth_settings import AsyncOAuthSettings +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncApp: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + def setup_method(self): self.old_os_env = remove_os_env_temporarily() @@ -163,3 +189,61 @@ def test_installation_store_conflicts(self): installation_store=store1, ) assert app.installation_store is store1 + + @pytest.mark.asyncio + async def test_proxy_ssl_for_respond(self): + ssl = SSLContext() + web_client = AsyncWebClient( + token=self.valid_token, + base_url=self.mock_api_server_base_url, + proxy="http://proxy-host:9000/", + ssl=ssl, + ) + + async def my_authorize(): + return AuthorizeResult( + enterprise_id="E111", + team_id="T111", + ) + + app = AsyncApp( + signing_secret="valid", + client=web_client, + authorize=my_authorize, + ) + + event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "team": "T111", + "channel": "C111", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, + } + + result = {"called": False} + + @app.event("app_mention") + async def handle(context: AsyncBoltContext, respond): + assert context.respond.proxy == "http://proxy-host:9000/" + assert context.respond.ssl == ssl + assert respond.proxy == "http://proxy-host:9000/" + assert respond.ssl == ssl + result["called"] = True + + req = AsyncBoltRequest(body=event_body, headers={}, mode="socket_mode") + response = await app.async_dispatch(req) + assert response.status == 200 + await asyncio.sleep(0.5) # wait a bit after auto ack() + assert result["called"] is True From 8c883c667bab47a103e88eb8840b8bc429883f2f Mon Sep 17 00:00:00 2001 From: Fil Maj Date: Wed, 2 Mar 2022 16:54:49 -0500 Subject: [PATCH 311/719] Docs on handling options listeners with a filtering example (#609) Co-authored-by: Kazuhiro Sera --- docs/_basic/ja_listening_responding_options.md | 17 +++++++++++------ docs/_basic/listening_responding_options.md | 8 ++++++-- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/docs/_basic/ja_listening_responding_options.md b/docs/_basic/ja_listening_responding_options.md index e7951eeb3..03f4a1e5b 100644 --- a/docs/_basic/ja_listening_responding_options.md +++ b/docs/_basic/ja_listening_responding_options.md @@ -14,6 +14,8 @@ order: 14 オプションのリクエストに応答するときは、有効なオプションを含む `options` または `option_groups` のリストとともに `ack()` を呼び出す必要があります。API サイトにある[外部データを使用する選択メニューに応答するサンプル例](https://api.slack.com/reference/messaging/block-elements#external-select)と、[ダイアログでの応答例](https://api.slack.com/dialogs#dynamic_select_elements_external)を参考にしてください。 +さらに、ユーザーが入力したキーワードに基づいたオプションを返すようフィルタリングロジックを適用することもできます。 これは `payload` という引数の ` value` の値に基づいて、それぞれのパターンで異なるオプションの一覧を返すように実装することができます。 Bolt for Python のすべてのリスナーやミドルウェアでは、[多くの有用な引数](https://slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html)にアクセスすることができますので、チェックしてみてください。 +
    @@ -21,17 +23,20 @@ order: 14 ```python # 外部データを使用する選択メニューオプションに応答するサンプル例 @app.options("external_action") -def show_options(ack): +def show_options(ack, payload): options = [ { - "text": {"type": "plain_text", "text":"Option 1"}, - "value":"1-1", + "text": {"type": "plain_text", "text": "Option 1"}, + "value": "1-1", }, { - "text": {"type": "plain_text", "text":"Option 2"}, - "value":"1-2", + "text": {"type": "plain_text", "text": "Option 2"}, + "value": "1-2", }, ] + keyword = payload.get("value") + if keyword is not None and len(keyword) > 0: + options = [o for o in options if keyword in o["text"]["text"]] ack(options=options) ``` -
    \ No newline at end of file + diff --git a/docs/_basic/listening_responding_options.md b/docs/_basic/listening_responding_options.md index a50a3f06c..07b9fd12f 100644 --- a/docs/_basic/listening_responding_options.md +++ b/docs/_basic/listening_responding_options.md @@ -13,6 +13,7 @@ While it's recommended to use `action_id` for `external_select` menus, dialogs d To respond to options requests, you'll need to call `ack()` with a valid `options` or `option_groups` list. Both [external select response examples](https://api.slack.com/reference/messaging/block-elements#external-select) and [dialog response examples](https://api.slack.com/dialogs#dynamic_select_elements_external) can be found on our API site. +Additionally, you may want to apply filtering logic to the returned options based on user input. This can be accomplished by using the `payload` argument to your options listener and checking for the contents of the `value` property within it. Based on the `value` you can return different options. All listeners and middleware handlers in Bolt for Python have access to [many useful arguments](https://slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) - be sure to check them out!
    @@ -20,7 +21,7 @@ To respond to options requests, you'll need to call `ack()` with a valid `option ```python # Example of responding to an external_select options request @app.options("external_action") -def show_options(ack): +def show_options(ack, payload): options = [ { "text": {"type": "plain_text", "text": "Option 1"}, @@ -31,6 +32,9 @@ def show_options(ack): "value": "1-2", }, ] + keyword = payload.get("value") + if keyword is not None and len(keyword) > 0: + options = [o for o in options if keyword in o["text"]["text"]] ack(options=options) ``` -
    \ No newline at end of file + From 837c77325451af2e714df828dc6a34a5d9fe8638 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 3 Mar 2022 07:12:18 +0900 Subject: [PATCH 312/719] version 1.11.6 --- .../slack_bolt/context/async_context.html | 18 +++++-- docs/api-docs/slack_bolt/context/context.html | 18 +++++-- .../context/respond/async_respond.html | 53 ++++++++++++++++--- .../slack_bolt/context/respond/respond.html | 53 ++++++++++++++++--- docs/api-docs/slack_bolt/version.html | 2 +- slack_bolt/version.py | 2 +- 6 files changed, 124 insertions(+), 22 deletions(-) diff --git a/docs/api-docs/slack_bolt/context/async_context.html b/docs/api-docs/slack_bolt/context/async_context.html index f20c1d0f5..d38ac04f1 100644 --- a/docs/api-docs/slack_bolt/context/async_context.html +++ b/docs/api-docs/slack_bolt/context/async_context.html @@ -144,7 +144,11 @@

    Module slack_bolt.context.async_context

    Callable `respond()` function """ if "respond" not in self: - self["respond"] = AsyncRespond(response_url=self.response_url) + self["respond"] = AsyncRespond( + response_url=self.response_url, + proxy=self.client.proxy, + ssl=self.client.ssl, + ) return self["respond"]
    @@ -274,7 +278,11 @@

    Classes

    Callable `respond()` function """ if "respond" not in self: - self["respond"] = AsyncRespond(response_url=self.response_url) + self["respond"] = AsyncRespond( + response_url=self.response_url, + proxy=self.client.proxy, + ssl=self.client.ssl, + ) return self["respond"]

    Ancestors

    @@ -413,7 +421,11 @@

    Returns

    Callable `respond()` function """ if "respond" not in self: - self["respond"] = AsyncRespond(response_url=self.response_url) + self["respond"] = AsyncRespond( + response_url=self.response_url, + proxy=self.client.proxy, + ssl=self.client.ssl, + ) return self["respond"] diff --git a/docs/api-docs/slack_bolt/context/context.html b/docs/api-docs/slack_bolt/context/context.html index af4ad5f26..83ca9a177 100644 --- a/docs/api-docs/slack_bolt/context/context.html +++ b/docs/api-docs/slack_bolt/context/context.html @@ -146,7 +146,11 @@

    Module slack_bolt.context.context

    Callable `respond()` function """ if "respond" not in self: - self["respond"] = Respond(response_url=self.response_url) + self["respond"] = Respond( + response_url=self.response_url, + proxy=self.client.proxy, + ssl=self.client.ssl, + ) return self["respond"] @@ -277,7 +281,11 @@

    Classes

    Callable `respond()` function """ if "respond" not in self: - self["respond"] = Respond(response_url=self.response_url) + self["respond"] = Respond( + response_url=self.response_url, + proxy=self.client.proxy, + ssl=self.client.ssl, + ) return self["respond"]

    Ancestors

    @@ -416,7 +424,11 @@

    Returns

    Callable `respond()` function """ if "respond" not in self: - self["respond"] = Respond(response_url=self.response_url) + self["respond"] = Respond( + response_url=self.response_url, + proxy=self.client.proxy, + ssl=self.client.ssl, + ) return self["respond"] diff --git a/docs/api-docs/slack_bolt/context/respond/async_respond.html b/docs/api-docs/slack_bolt/context/respond/async_respond.html index 0ecb02cc5..55a118436 100644 --- a/docs/api-docs/slack_bolt/context/respond/async_respond.html +++ b/docs/api-docs/slack_bolt/context/respond/async_respond.html @@ -27,6 +27,7 @@

    Module slack_bolt.context.respond.async_respondExpand source code
    from typing import Optional, Union, Sequence
    +from ssl import SSLContext
     
     from slack_sdk.models.attachments import Attachment
     from slack_sdk.models.blocks import Block
    @@ -37,9 +38,19 @@ 

    Module slack_bolt.context.respond.async_respondModule slack_bolt.context.respond.async_respondClasses

    class AsyncRespond -(*, response_url: Optional[str]) +(*, response_url: Optional[str], proxy: Optional[str] = None, ssl: Optional[ssl.SSLContext] = None)
    @@ -98,9 +113,19 @@

    Classes

    class AsyncRespond:
         response_url: Optional[str]
    +    proxy: Optional[str]
    +    ssl: Optional[SSLContext]
     
    -    def __init__(self, *, response_url: Optional[str]):
    -        self.response_url: Optional[str] = response_url
    +    def __init__(
    +        self,
    +        *,
    +        response_url: Optional[str],
    +        proxy: Optional[str] = None,
    +        ssl: Optional[SSLContext] = None,
    +    ):
    +        self.response_url = response_url
    +        self.proxy = proxy
    +        self.ssl = ssl
     
         async def __call__(
             self,
    @@ -114,7 +139,11 @@ 

    Classes

    unfurl_media: Optional[bool] = None, ) -> WebhookResponse: if self.response_url is not None: - client = AsyncWebhookClient(self.response_url) + client = AsyncWebhookClient( + url=self.response_url, + proxy=self.proxy, + ssl=self.ssl, + ) text_or_whole_response: Union[str, dict] = text if isinstance(text_or_whole_response, str): message = _build_message( @@ -139,10 +168,18 @@

    Classes

    Class variables

    +
    var proxy : Optional[str]
    +
    +
    +
    var response_url : Optional[str]
    +
    var ssl : Optional[ssl.SSLContext]
    +
    +
    +
    @@ -164,7 +201,9 @@

    Index

  • AsyncRespond

  • diff --git a/docs/api-docs/slack_bolt/context/respond/respond.html b/docs/api-docs/slack_bolt/context/respond/respond.html index 9eaf73276..d3af708a2 100644 --- a/docs/api-docs/slack_bolt/context/respond/respond.html +++ b/docs/api-docs/slack_bolt/context/respond/respond.html @@ -27,6 +27,7 @@

    Module slack_bolt.context.respond.respond

    Expand source code
    from typing import Optional, Union, Sequence
    +from ssl import SSLContext
     
     from slack_sdk.models.attachments import Attachment
     from slack_sdk.models.blocks import Block
    @@ -37,9 +38,19 @@ 

    Module slack_bolt.context.respond.respond

    class Respond: response_url: Optional[str] + proxy: Optional[str] + ssl: Optional[SSLContext] - def __init__(self, *, response_url: Optional[str]): - self.response_url: Optional[str] = response_url + def __init__( + self, + *, + response_url: Optional[str], + proxy: Optional[str] = None, + ssl: Optional[SSLContext] = None, + ): + self.response_url = response_url + self.proxy = proxy + self.ssl = ssl def __call__( self, @@ -53,7 +64,11 @@

    Module slack_bolt.context.respond.respond

    unfurl_media: Optional[bool] = None, ) -> WebhookResponse: if self.response_url is not None: - client = WebhookClient(self.response_url) + client = WebhookClient( + url=self.response_url, + proxy=self.proxy, + ssl=self.ssl, + ) text_or_whole_response: Union[str, dict] = text if isinstance(text_or_whole_response, str): text = text_or_whole_response @@ -90,7 +105,7 @@

    Classes

    class Respond -(*, response_url: Optional[str]) +(*, response_url: Optional[str], proxy: Optional[str] = None, ssl: Optional[ssl.SSLContext] = None)
    @@ -100,9 +115,19 @@

    Classes

    class Respond:
         response_url: Optional[str]
    +    proxy: Optional[str]
    +    ssl: Optional[SSLContext]
     
    -    def __init__(self, *, response_url: Optional[str]):
    -        self.response_url: Optional[str] = response_url
    +    def __init__(
    +        self,
    +        *,
    +        response_url: Optional[str],
    +        proxy: Optional[str] = None,
    +        ssl: Optional[SSLContext] = None,
    +    ):
    +        self.response_url = response_url
    +        self.proxy = proxy
    +        self.ssl = ssl
     
         def __call__(
             self,
    @@ -116,7 +141,11 @@ 

    Classes

    unfurl_media: Optional[bool] = None, ) -> WebhookResponse: if self.response_url is not None: - client = WebhookClient(self.response_url) + client = WebhookClient( + url=self.response_url, + proxy=self.proxy, + ssl=self.ssl, + ) text_or_whole_response: Union[str, dict] = text if isinstance(text_or_whole_response, str): text = text_or_whole_response @@ -143,10 +172,18 @@

    Classes

    Class variables

    +
    var proxy : Optional[str]
    +
    +
    +
    var response_url : Optional[str]
    +
    var ssl : Optional[ssl.SSLContext]
    +
    +
    +
    @@ -168,7 +205,9 @@

    Index

  • Respond

  • diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index dd6dbfd4c..c24e4bed2 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.11.5"
    +__version__ = "1.11.6"
    diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 6ed6690f9..d96b2b137 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.11.5" +__version__ = "1.11.6" From 911e21d0040b891e6038aa50fe27e6579ea54b8e Mon Sep 17 00:00:00 2001 From: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com> Date: Tue, 15 Mar 2022 12:41:59 +0000 Subject: [PATCH 313/719] Add ASGI Falcon App support (#614) Co-authored-by: Kazuhiro Sera --- .github/workflows/tests.yml | 1 + examples/falcon/async_app.py | 100 +++++++++ examples/falcon/async_oauth_app.py | 102 +++++++++ examples/falcon/requirements.txt | 3 +- slack_bolt/adapter/falcon/__init__.py | 1 + slack_bolt/adapter/falcon/async_resource.py | 84 +++++++ .../adapter_tests_async/test_async_falcon.py | 209 ++++++++++++++++++ 7 files changed, 499 insertions(+), 1 deletion(-) create mode 100644 examples/falcon/async_app.py create mode 100644 examples/falcon/async_oauth_app.py create mode 100644 slack_bolt/adapter/falcon/async_resource.py create mode 100644 tests/adapter_tests_async/test_async_falcon.py diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8be5e12ed..85921dadb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -70,4 +70,5 @@ jobs: - name: Run tests for HTTP Mode adapters (asyncio-based libraries) run: | pip install -e ".[async]" + pip install "falcon>=3,<4" pytest tests/adapter_tests_async/ diff --git a/examples/falcon/async_app.py b/examples/falcon/async_app.py new file mode 100644 index 000000000..44989d4fa --- /dev/null +++ b/examples/falcon/async_app.py @@ -0,0 +1,100 @@ +import falcon +import logging +import re +from slack_bolt.async_app import AsyncApp, AsyncRespond, AsyncAck +from slack_bolt.adapter.falcon import AsyncSlackAppResource + +logging.basicConfig(level=logging.DEBUG) +app = AsyncApp() + + +# @app.command("/bolt-py-proto", [lambda body: body["team_id"] == "T03E94MJU"]) +async def test_command(logger: logging.Logger, body: dict, ack: AsyncAck, respond: AsyncRespond): + logger.info(body) + await ack("thanks!") + await respond( + blocks=[ + { + "type": "section", + "block_id": "b", + "text": { + "type": "mrkdwn", + "text": "You can add a button alongside text in your message. ", + }, + "accessory": { + "type": "button", + "action_id": "a", + "text": {"type": "plain_text", "text": "Button"}, + "value": "click_me_123", + }, + } + ] + ) + + +app.command(re.compile(r"/hello-bolt-.+"))(test_command) + + +@app.shortcut("test-shortcut") +async def test_shortcut(ack, client, logger, body): + logger.info(body) + await ack() + res = await client.views_open( + trigger_id=body["trigger_id"], + view={ + "type": "modal", + "callback_id": "view-id", + "title": { + "type": "plain_text", + "text": "My App", + }, + "submit": { + "type": "plain_text", + "text": "Submit", + }, + "close": { + "type": "plain_text", + "text": "Cancel", + }, + "blocks": [ + { + "type": "input", + "element": {"type": "plain_text_input"}, + "label": { + "type": "plain_text", + "text": "Label", + }, + } + ], + }, + ) + logger.info(res) + + +@app.view("view-id") +async def view_submission(ack, body, logger): + logger.info(body) + await ack() + + +@app.action("a") +async def button_click(logger, action, ack, respond): + logger.info(action) + await ack() + await respond("Here is my response") + + +@app.event("app_mention") +async def handle_app_mentions(body, say, logger): + logger.info(body) + await say("What's up?") + + +api = falcon.asgi.App() +resource = AsyncSlackAppResource(app) +api.add_route("/slack/events", resource) + +# pip install -r requirements.txt +# export SLACK_SIGNING_SECRET=*** +# export SLACK_BOT_TOKEN=xoxb-*** +# uvicorn --reload -h 0.0.0.0 -p 3000 async_app:api diff --git a/examples/falcon/async_oauth_app.py b/examples/falcon/async_oauth_app.py new file mode 100644 index 000000000..df4d96933 --- /dev/null +++ b/examples/falcon/async_oauth_app.py @@ -0,0 +1,102 @@ +import falcon +import logging +import re +from slack_bolt.async_app import AsyncApp, AsyncRespond, AsyncAck +from slack_bolt.adapter.falcon import AsyncSlackAppResource + +logging.basicConfig(level=logging.DEBUG) +app = AsyncApp() + + +# @app.command("/bolt-py-proto", [lambda body: body["team_id"] == "T03E94MJU"]) +async def test_command(logger: logging.Logger, body: dict, ack: AsyncAck, respond: AsyncRespond): + logger.info(body) + await ack("thanks!") + await respond( + blocks=[ + { + "type": "section", + "block_id": "b", + "text": { + "type": "mrkdwn", + "text": "You can add a button alongside text in your message. ", + }, + "accessory": { + "type": "button", + "action_id": "a", + "text": {"type": "plain_text", "text": "Button"}, + "value": "click_me_123", + }, + } + ] + ) + + +app.command(re.compile(r"/hello-bolt-.+"))(test_command) + + +@app.shortcut("test-shortcut") +async def test_shortcut(ack, client, logger, body): + logger.info(body) + await ack() + res = await client.views_open( + trigger_id=body["trigger_id"], + view={ + "type": "modal", + "callback_id": "view-id", + "title": { + "type": "plain_text", + "text": "My App", + }, + "submit": { + "type": "plain_text", + "text": "Submit", + }, + "close": { + "type": "plain_text", + "text": "Cancel", + }, + "blocks": [ + { + "type": "input", + "element": {"type": "plain_text_input"}, + "label": { + "type": "plain_text", + "text": "Label", + }, + } + ], + }, + ) + logger.info(res) + + +@app.view("view-id") +async def view_submission(ack, body, logger): + logger.info(body) + await ack() + + +@app.action("a") +async def button_click(logger, action, ack, respond): + logger.info(action) + await ack() + await respond("Here is my response") + + +@app.event("app_mention") +async def handle_app_mentions(body, say, logger): + logger.info(body) + await say("What's up?") + + +api = falcon.asgi.App() +resource = AsyncSlackAppResource(app) +api.add_route("/slack/events", resource) + +# pip install -r requirements.txt +# export SLACK_SIGNING_SECRET=*** +# export SLACK_BOT_TOKEN=xoxb-*** +# uvicorn --reload -h 0.0.0.0 -p 3000 async_oauth_app:api +api.add_route("/slack/install", resource) +api.add_route("/slack/oauth_redirect", resource) diff --git a/examples/falcon/requirements.txt b/examples/falcon/requirements.txt index 20b4e2937..d72e1e1d0 100644 --- a/examples/falcon/requirements.txt +++ b/examples/falcon/requirements.txt @@ -1,2 +1,3 @@ falcon>=2,<3 -gunicorn>=20,<21 \ No newline at end of file +gunicorn>=20,<21 +uvicorn diff --git a/slack_bolt/adapter/falcon/__init__.py b/slack_bolt/adapter/falcon/__init__.py index 01dcc736f..e1a06662c 100644 --- a/slack_bolt/adapter/falcon/__init__.py +++ b/slack_bolt/adapter/falcon/__init__.py @@ -1 +1,2 @@ +# Don't add async module imports here from .resource import SlackAppResource diff --git a/slack_bolt/adapter/falcon/async_resource.py b/slack_bolt/adapter/falcon/async_resource.py new file mode 100644 index 000000000..5009a222e --- /dev/null +++ b/slack_bolt/adapter/falcon/async_resource.py @@ -0,0 +1,84 @@ +from datetime import datetime # type: ignore +from http import HTTPStatus + +from falcon import version as falcon_version +from falcon.asgi import Request, Response +from slack_bolt import BoltResponse +from slack_bolt.async_app import AsyncApp +from slack_bolt.error import BoltError +from slack_bolt.oauth.async_oauth_flow import AsyncOAuthFlow +from slack_bolt.request.async_request import AsyncBoltRequest + + +class AsyncSlackAppResource: + """ + For use with ASGI Falcon Apps. + + from slack_bolt.async_app import AsyncApp + app = AsyncApp() + + import falcon + app = falcon.asgi.App() + app.add_route("/slack/events", AsyncSlackAppResource(app)) + """ + + def __init__(self, app: AsyncApp): # type: ignore + if falcon_version.__version__.startswith("2."): + raise BoltError("This ASGI compatible adapter requires Falcon version >= 3.0") + + self.app = app + + async def on_get(self, req: Request, resp: Response): + if self.app.oauth_flow is not None: + oauth_flow: AsyncOAuthFlow = self.app.oauth_flow + if req.path == oauth_flow.install_path: + bolt_resp = await oauth_flow.handle_installation( + await self._to_bolt_request(req) + ) + await self._write_response(bolt_resp, resp) + return + elif req.path == oauth_flow.redirect_uri_path: + bolt_resp = await oauth_flow.handle_callback( + await self._to_bolt_request(req) + ) + await self._write_response(bolt_resp, resp) + return + + resp.status = "404" + resp.body = "The page is not found..." + + async def on_post(self, req: Request, resp: Response): + bolt_req = await self._to_bolt_request(req) + bolt_resp = await self.app.async_dispatch(bolt_req) + await self._write_response(bolt_resp, resp) + + async def _to_bolt_request(self, req: Request) -> AsyncBoltRequest: + return AsyncBoltRequest( + body=(await req.stream.read(req.content_length or 0)).decode("utf-8"), + query=req.query_string, + headers={k.lower(): v for k, v in req.headers.items()}, + ) + + async def _write_response(self, bolt_resp: BoltResponse, resp: Response): + resp.text = bolt_resp.body + status = HTTPStatus(bolt_resp.status) + resp.status = str(f"{status.value} {status.phrase}") + resp.set_headers(bolt_resp.first_headers_without_set_cookie()) + for cookie in bolt_resp.cookies(): + for name, c in cookie.items(): + expire_value = c.get("expires") + expire = ( + datetime.strptime(expire_value, "%a, %d %b %Y %H:%M:%S %Z") + if expire_value + else None + ) + resp.set_cookie( + name=name, + value=c.value, + expires=expire, + max_age=c.get("max-age"), + domain=c.get("domain"), + path=c.get("path"), + secure=True, + http_only=True, + ) diff --git a/tests/adapter_tests_async/test_async_falcon.py b/tests/adapter_tests_async/test_async_falcon.py new file mode 100644 index 000000000..0acbfd792 --- /dev/null +++ b/tests/adapter_tests_async/test_async_falcon.py @@ -0,0 +1,209 @@ +import json +from time import time +from urllib.parse import quote + +import falcon +from falcon import testing + +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.adapter.falcon.async_resource import AsyncSlackAppResource +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.oauth.async_oauth_settings import AsyncOAuthSettings +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +def new_falcon_app(): + return falcon.asgi.App() + + +class TestAsyncFalcon: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + content_type = ( + "application/json" + if body.startswith("{") + else "application/x-www-form-urlencoded" + ) + return { + "content-type": content_type, + "x-slack-signature": self.generate_signature(body, timestamp), + "x-slack-request-timestamp": timestamp, + } + + def test_events(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + async def event_handler(): + pass + + app.event("app_mention")(event_handler) + + input = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "team": "T111", + "channel": "C111", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, + "authed_users": ["W111"], + } + timestamp, body = str(int(time())), json.dumps(input) + + api = new_falcon_app() + resource = AsyncSlackAppResource(app) + api.add_route("/slack/events", resource) + + client = testing.TestClient(api) + response = client.simulate_post( + "/slack/events", + body=body, + headers=self.build_headers(timestamp, body), + ) + assert response.status_code == 200 + assert_auth_test_count(self, 1) + + def test_shortcuts(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + async def shortcut_handler(ack): + await ack() + + app.shortcut("test-shortcut")(shortcut_handler) + + input = { + "type": "shortcut", + "token": "verification_token", + "action_ts": "111.111", + "team": { + "id": "T111", + "domain": "workspace-domain", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": {"id": "W111", "username": "primary-owner", "team_id": "T111"}, + "callback_id": "test-shortcut", + "trigger_id": "111.111.xxxxxx", + } + + timestamp, body = str(int(time())), f"payload={quote(json.dumps(input))}" + + api = new_falcon_app() + resource = AsyncSlackAppResource(app) + api.add_route("/slack/events", resource) + + client = testing.TestClient(api) + response = client.simulate_post( + "/slack/events", + body=body, + headers=self.build_headers(timestamp, body), + ) + assert response.status_code == 200 + assert_auth_test_count(self, 1) + + def test_commands(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + async def command_handler(ack): + await ack() + + app.command("/hello-world")(command_handler) + + input = ( + "token=verification_token" + "&team_id=T111" + "&team_domain=test-domain" + "&channel_id=C111" + "&channel_name=random" + "&user_id=W111" + "&user_name=primary-owner" + "&command=%2Fhello-world" + "&text=Hi" + "&enterprise_id=E111" + "&enterprise_name=Org+Name" + "&response_url=https%3A%2F%2Fhooks.slack.com%2Fcommands%2FT111%2F111%2Fxxxxx" + "&trigger_id=111.111.xxx" + ) + timestamp, body = str(int(time())), input + + api = new_falcon_app() + resource = AsyncSlackAppResource(app) + api.add_route("/slack/events", resource) + + client = testing.TestClient(api) + response = client.simulate_post( + "/slack/events", + body=body, + headers=self.build_headers(timestamp, body), + ) + assert response.status_code == 200 + assert_auth_test_count(self, 1) + + def test_oauth(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + oauth_settings=AsyncOAuthSettings( + client_id="111.111", + client_secret="xxx", + scopes=["chat:write", "commands"], + ), + ) + api = new_falcon_app() + resource = AsyncSlackAppResource(app) + api.add_route("/slack/install", resource) + + client = testing.TestClient(api) + response = client.simulate_get("/slack/install") + assert response.status_code == 200 + assert response.headers.get("content-type") == "text/html; charset=utf-8" + assert response.headers.get("content-length") == "597" + assert "https://slack.com/oauth/v2/authorize?state=" in response.text From 54114cad0ff0550d0e51c1492d8830ff87b48968 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 17 Mar 2022 14:34:12 +0900 Subject: [PATCH 314/719] version 1.12.0 --- .../adapter/falcon/async_resource.html | 296 ++++++++++++++++++ .../slack_bolt/adapter/falcon/index.html | 8 +- docs/api-docs/slack_bolt/version.html | 2 +- examples/falcon/async_app.py | 4 +- examples/falcon/async_oauth_app.py | 4 +- setup.py | 2 +- slack_bolt/adapter/falcon/async_resource.py | 4 +- slack_bolt/version.py | 2 +- 8 files changed, 315 insertions(+), 7 deletions(-) create mode 100644 docs/api-docs/slack_bolt/adapter/falcon/async_resource.html diff --git a/docs/api-docs/slack_bolt/adapter/falcon/async_resource.html b/docs/api-docs/slack_bolt/adapter/falcon/async_resource.html new file mode 100644 index 000000000..577d608da --- /dev/null +++ b/docs/api-docs/slack_bolt/adapter/falcon/async_resource.html @@ -0,0 +1,296 @@ + + + + + + +slack_bolt.adapter.falcon.async_resource API documentation + + + + + + + + + + + +
    +
    +
    +

    Module slack_bolt.adapter.falcon.async_resource

    +
    +
    +
    + +Expand source code + +
    from datetime import datetime  # type: ignore
    +from http import HTTPStatus
    +
    +from falcon import version as falcon_version
    +from falcon.asgi import Request, Response
    +from slack_bolt import BoltResponse
    +from slack_bolt.async_app import AsyncApp
    +from slack_bolt.error import BoltError
    +from slack_bolt.oauth.async_oauth_flow import AsyncOAuthFlow
    +from slack_bolt.request.async_request import AsyncBoltRequest
    +
    +
    +class AsyncSlackAppResource:
    +    """
    +    For use with ASGI Falcon Apps.
    +
    +    from slack_bolt.async_app import AsyncApp
    +    app = AsyncApp()
    +
    +    import falcon
    +    app = falcon.asgi.App()
    +    app.add_route("/slack/events", AsyncSlackAppResource(app))
    +    """
    +
    +    def __init__(self, app: AsyncApp):  # type: ignore
    +        if falcon_version.__version__.startswith("2."):
    +            raise BoltError(
    +                "This ASGI compatible adapter requires Falcon version >= 3.0"
    +            )
    +
    +        self.app = app
    +
    +    async def on_get(self, req: Request, resp: Response):
    +        if self.app.oauth_flow is not None:
    +            oauth_flow: AsyncOAuthFlow = self.app.oauth_flow
    +            if req.path == oauth_flow.install_path:
    +                bolt_resp = await oauth_flow.handle_installation(
    +                    await self._to_bolt_request(req)
    +                )
    +                await self._write_response(bolt_resp, resp)
    +                return
    +            elif req.path == oauth_flow.redirect_uri_path:
    +                bolt_resp = await oauth_flow.handle_callback(
    +                    await self._to_bolt_request(req)
    +                )
    +                await self._write_response(bolt_resp, resp)
    +                return
    +
    +        resp.status = "404"
    +        resp.body = "The page is not found..."
    +
    +    async def on_post(self, req: Request, resp: Response):
    +        bolt_req = await self._to_bolt_request(req)
    +        bolt_resp = await self.app.async_dispatch(bolt_req)
    +        await self._write_response(bolt_resp, resp)
    +
    +    async def _to_bolt_request(self, req: Request) -> AsyncBoltRequest:
    +        return AsyncBoltRequest(
    +            body=(await req.stream.read(req.content_length or 0)).decode("utf-8"),
    +            query=req.query_string,
    +            headers={k.lower(): v for k, v in req.headers.items()},
    +        )
    +
    +    async def _write_response(self, bolt_resp: BoltResponse, resp: Response):
    +        resp.text = bolt_resp.body
    +        status = HTTPStatus(bolt_resp.status)
    +        resp.status = str(f"{status.value} {status.phrase}")
    +        resp.set_headers(bolt_resp.first_headers_without_set_cookie())
    +        for cookie in bolt_resp.cookies():
    +            for name, c in cookie.items():
    +                expire_value = c.get("expires")
    +                expire = (
    +                    datetime.strptime(expire_value, "%a, %d %b %Y %H:%M:%S %Z")
    +                    if expire_value
    +                    else None
    +                )
    +                resp.set_cookie(
    +                    name=name,
    +                    value=c.value,
    +                    expires=expire,
    +                    max_age=c.get("max-age"),
    +                    domain=c.get("domain"),
    +                    path=c.get("path"),
    +                    secure=True,
    +                    http_only=True,
    +                )
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Classes

    +
    +
    +class AsyncSlackAppResource +(app: AsyncApp) +
    +
    +

    For use with ASGI Falcon Apps.

    +

    from slack_bolt.async_app import AsyncApp +app = AsyncApp()

    +

    import falcon +app = falcon.asgi.App() +app.add_route("/slack/events", AsyncSlackAppResource(app))

    +
    + +Expand source code + +
    class AsyncSlackAppResource:
    +    """
    +    For use with ASGI Falcon Apps.
    +
    +    from slack_bolt.async_app import AsyncApp
    +    app = AsyncApp()
    +
    +    import falcon
    +    app = falcon.asgi.App()
    +    app.add_route("/slack/events", AsyncSlackAppResource(app))
    +    """
    +
    +    def __init__(self, app: AsyncApp):  # type: ignore
    +        if falcon_version.__version__.startswith("2."):
    +            raise BoltError(
    +                "This ASGI compatible adapter requires Falcon version >= 3.0"
    +            )
    +
    +        self.app = app
    +
    +    async def on_get(self, req: Request, resp: Response):
    +        if self.app.oauth_flow is not None:
    +            oauth_flow: AsyncOAuthFlow = self.app.oauth_flow
    +            if req.path == oauth_flow.install_path:
    +                bolt_resp = await oauth_flow.handle_installation(
    +                    await self._to_bolt_request(req)
    +                )
    +                await self._write_response(bolt_resp, resp)
    +                return
    +            elif req.path == oauth_flow.redirect_uri_path:
    +                bolt_resp = await oauth_flow.handle_callback(
    +                    await self._to_bolt_request(req)
    +                )
    +                await self._write_response(bolt_resp, resp)
    +                return
    +
    +        resp.status = "404"
    +        resp.body = "The page is not found..."
    +
    +    async def on_post(self, req: Request, resp: Response):
    +        bolt_req = await self._to_bolt_request(req)
    +        bolt_resp = await self.app.async_dispatch(bolt_req)
    +        await self._write_response(bolt_resp, resp)
    +
    +    async def _to_bolt_request(self, req: Request) -> AsyncBoltRequest:
    +        return AsyncBoltRequest(
    +            body=(await req.stream.read(req.content_length or 0)).decode("utf-8"),
    +            query=req.query_string,
    +            headers={k.lower(): v for k, v in req.headers.items()},
    +        )
    +
    +    async def _write_response(self, bolt_resp: BoltResponse, resp: Response):
    +        resp.text = bolt_resp.body
    +        status = HTTPStatus(bolt_resp.status)
    +        resp.status = str(f"{status.value} {status.phrase}")
    +        resp.set_headers(bolt_resp.first_headers_without_set_cookie())
    +        for cookie in bolt_resp.cookies():
    +            for name, c in cookie.items():
    +                expire_value = c.get("expires")
    +                expire = (
    +                    datetime.strptime(expire_value, "%a, %d %b %Y %H:%M:%S %Z")
    +                    if expire_value
    +                    else None
    +                )
    +                resp.set_cookie(
    +                    name=name,
    +                    value=c.value,
    +                    expires=expire,
    +                    max_age=c.get("max-age"),
    +                    domain=c.get("domain"),
    +                    path=c.get("path"),
    +                    secure=True,
    +                    http_only=True,
    +                )
    +
    +

    Methods

    +
    +
    +async def on_get(self, req: falcon.asgi.request.Request, resp: falcon.asgi.response.Response) +
    +
    +
    +
    + +Expand source code + +
    async def on_get(self, req: Request, resp: Response):
    +    if self.app.oauth_flow is not None:
    +        oauth_flow: AsyncOAuthFlow = self.app.oauth_flow
    +        if req.path == oauth_flow.install_path:
    +            bolt_resp = await oauth_flow.handle_installation(
    +                await self._to_bolt_request(req)
    +            )
    +            await self._write_response(bolt_resp, resp)
    +            return
    +        elif req.path == oauth_flow.redirect_uri_path:
    +            bolt_resp = await oauth_flow.handle_callback(
    +                await self._to_bolt_request(req)
    +            )
    +            await self._write_response(bolt_resp, resp)
    +            return
    +
    +    resp.status = "404"
    +    resp.body = "The page is not found..."
    +
    +
    +
    +async def on_post(self, req: falcon.asgi.request.Request, resp: falcon.asgi.response.Response) +
    +
    +
    +
    + +Expand source code + +
    async def on_post(self, req: Request, resp: Response):
    +    bolt_req = await self._to_bolt_request(req)
    +    bolt_resp = await self.app.async_dispatch(bolt_req)
    +    await self._write_response(bolt_resp, resp)
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/falcon/index.html b/docs/api-docs/slack_bolt/adapter/falcon/index.html index 10e949002..85a95e9f3 100644 --- a/docs/api-docs/slack_bolt/adapter/falcon/index.html +++ b/docs/api-docs/slack_bolt/adapter/falcon/index.html @@ -26,12 +26,17 @@

    Module slack_bolt.adapter.falcon

    Expand source code -
    from .resource import SlackAppResource
    +
    # Don't add async module imports here
    +from .resource import SlackAppResource

    Sub-modules

    +
    slack_bolt.adapter.falcon.async_resource
    +
    +
    +
    slack_bolt.adapter.falcon.resource
    @@ -58,6 +63,7 @@

    Index

  • Sub-modules

  • diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index c24e4bed2..aeabb6323 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.11.6"
    +__version__ = "1.12.0"
    diff --git a/examples/falcon/async_app.py b/examples/falcon/async_app.py index 44989d4fa..e0fd11f51 100644 --- a/examples/falcon/async_app.py +++ b/examples/falcon/async_app.py @@ -9,7 +9,9 @@ # @app.command("/bolt-py-proto", [lambda body: body["team_id"] == "T03E94MJU"]) -async def test_command(logger: logging.Logger, body: dict, ack: AsyncAck, respond: AsyncRespond): +async def test_command( + logger: logging.Logger, body: dict, ack: AsyncAck, respond: AsyncRespond +): logger.info(body) await ack("thanks!") await respond( diff --git a/examples/falcon/async_oauth_app.py b/examples/falcon/async_oauth_app.py index df4d96933..f9be899b2 100644 --- a/examples/falcon/async_oauth_app.py +++ b/examples/falcon/async_oauth_app.py @@ -9,7 +9,9 @@ # @app.command("/bolt-py-proto", [lambda body: body["team_id"] == "T03E94MJU"]) -async def test_command(logger: logging.Logger, body: dict, ack: AsyncAck, respond: AsyncRespond): +async def test_command( + logger: logging.Logger, body: dict, ack: AsyncAck, respond: AsyncRespond +): logger.info(body) await ack("thanks!") await respond( diff --git a/setup.py b/setup.py index e2a1611d5..758953f86 100755 --- a/setup.py +++ b/setup.py @@ -56,7 +56,7 @@ ), include_package_data=True, # MANIFEST.in install_requires=[ - "slack_sdk>=3.9.0,<4", + "slack_sdk>=3.15.2,<4", ], setup_requires=["pytest-runner==5.2"], tests_require=async_test_dependencies, diff --git a/slack_bolt/adapter/falcon/async_resource.py b/slack_bolt/adapter/falcon/async_resource.py index 5009a222e..1c779c5c0 100644 --- a/slack_bolt/adapter/falcon/async_resource.py +++ b/slack_bolt/adapter/falcon/async_resource.py @@ -24,7 +24,9 @@ class AsyncSlackAppResource: def __init__(self, app: AsyncApp): # type: ignore if falcon_version.__version__.startswith("2."): - raise BoltError("This ASGI compatible adapter requires Falcon version >= 3.0") + raise BoltError( + "This ASGI compatible adapter requires Falcon version >= 3.0" + ) self.app = app diff --git a/slack_bolt/version.py b/slack_bolt/version.py index d96b2b137..aada8e7e5 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.11.6" +__version__ = "1.12.0" From 851376e0e9e01c75271d07de2d777c831c496984 Mon Sep 17 00:00:00 2001 From: Alexander Rashed <2796604+alexrashed@users.noreply.github.com> Date: Thu, 17 Mar 2022 11:01:22 +0100 Subject: [PATCH 315/719] fix type hint for event constraint to allow None subtypes (#616) * fix type hint for message constraint to allow None subtypes Signed-off-by: Alexander Rashed * revert changes to auto-generated docs Signed-off-by: Alexander Rashed --- docs/_basic/listening_events.md | 1 + slack_bolt/app/app.py | 4 +++- slack_bolt/app/async_app.py | 4 +++- slack_bolt/listener_matcher/builtins.py | 12 ++++++++---- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/_basic/listening_events.md b/docs/_basic/listening_events.md index e5df72952..fe65fd7cf 100644 --- a/docs/_basic/listening_events.md +++ b/docs/_basic/listening_events.md @@ -36,6 +36,7 @@ def ask_for_introduction(event, say): The `message()` listener is equivalent to `event("message")`. You can filter on subtypes of events by passing in the additional key `subtype`. Common message subtypes like `bot_message` and `message_replied` can be found [on the message event page](https://api.slack.com/events/message#message_subtypes). +You can explicitly filter for events without a subtype by explicitly setting `None`. diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 2679dca01..baaf85fca 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -724,7 +724,9 @@ def custom_error_handler(error, body, logger): def event( self, event: Union[ - str, Pattern, Dict[str, Union[str, Sequence[Optional[Union[str, Pattern]]]]] + str, + Pattern, + Dict[str, Optional[Union[str, Sequence[Optional[Union[str, Pattern]]]]]], ], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 92ce70beb..0a6939390 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -782,7 +782,9 @@ async def custom_error_handler(error, body, logger): def event( self, event: Union[ - str, Pattern, Dict[str, Union[str, Sequence[Optional[Union[str, Pattern]]]]] + str, + Pattern, + Dict[str, Optional[Union[str, Sequence[Optional[Union[str, Pattern]]]]]], ], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, diff --git a/slack_bolt/listener_matcher/builtins.py b/slack_bolt/listener_matcher/builtins.py index 1b46183a6..2bf582f67 100644 --- a/slack_bolt/listener_matcher/builtins.py +++ b/slack_bolt/listener_matcher/builtins.py @@ -78,7 +78,9 @@ async def async_fun(body: Dict[str, Any]) -> bool: def event( constraints: Union[ - str, Pattern, Dict[str, Union[str, Sequence[Optional[Union[str, Pattern]]]]] + str, + Pattern, + Dict[str, Optional[Union[str, Sequence[Optional[Union[str, Pattern]]]]]], ], asyncio: bool = False, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: @@ -110,7 +112,9 @@ def func(body: Dict[str, Any]) -> bool: def message_event( - constraints: Dict[str, Union[str, Sequence[Optional[Union[str, Pattern]]]]], + constraints: Dict[ + str, Optional[Union[str, Sequence[Optional[Union[str, Pattern]]]]] + ], keyword: Union[str, Pattern], asyncio: bool = False, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: @@ -140,8 +144,8 @@ def _check_event_subtype(event_payload: dict, constraints: dict) -> bool: if not _matches(constraints["type"], event_payload["type"]): return False if "subtype" in constraints: - expected_subtype: Union[ - str, Sequence[Optional[Union[str, Pattern]]] + expected_subtype: Optional[ + Union[str, Sequence[Optional[Union[str, Pattern]]]] ] = constraints["subtype"] if expected_subtype is None: # "subtype" in constraints is intentionally None for this pattern From 68eb2fe9cca9150bfce2f34c8fa2ad1c8aca4012 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 17 Mar 2022 19:06:59 +0900 Subject: [PATCH 316/719] Apply #616 doc change to its Japanese page --- docs/_basic/ja_listening_events.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_basic/ja_listening_events.md b/docs/_basic/ja_listening_events.md index b491af6fe..0954c2ce7 100644 --- a/docs/_basic/ja_listening_events.md +++ b/docs/_basic/ja_listening_events.md @@ -35,7 +35,7 @@ def ask_for_introduction(event, say):
    `message()` リスナーは `event("message")` と等価の機能を提供します。 -`subtype` という追加のキーを指定して、イベントのサブタイプでフィルタリングすることもできます。よく使われるサブタイプには、`bot_message` や `message_replied` があります。詳しくは[メッセージイベントページ](https://api.slack.com/events/message#message_subtypes)を参照してください。 +`subtype` という追加のキーを指定して、イベントのサブタイプでフィルタリングすることもできます。よく使われるサブタイプには、`bot_message` や `message_replied` があります。詳しくは[メッセージイベントページ](https://api.slack.com/events/message#message_subtypes)を参照してください。サブタイプなしのイベントだけにフルターするために明に `None` を指定することもできます。
    From eda5574774280e08b78bc696be9850238aad5cae Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 18 Mar 2022 20:22:59 +0900 Subject: [PATCH 317/719] Fix #617 Respect the configuration of logger parameter across App/AsyncApp loggers (#618) --- .github/workflows/pytype.yml | 4 +- pytest.ini | 1 + scripts/run_pytype.sh | 2 +- .../adapter/aws_lambda/chalice_handler.py | 4 +- slack_bolt/adapter/aws_lambda/handler.py | 2 +- slack_bolt/app/app.py | 124 +++++++++++---- slack_bolt/app/async_app.py | 123 +++++++++++---- slack_bolt/listener/async_listener.py | 3 +- slack_bolt/listener/custom_listener.py | 3 +- .../async_listener_matcher.py | 12 +- slack_bolt/listener_matcher/builtins.py | 75 ++++++--- .../custom_listener_matcher.py | 12 +- slack_bolt/logger/__init__.py | 49 ++++-- .../middleware/async_custom_middleware.py | 12 +- .../async_multi_teams_authorization.py | 8 +- .../async_single_team_authorization.py | 7 +- .../multi_teams_authorization.py | 5 +- .../single_team_authorization.py | 11 +- slack_bolt/middleware/custom_middleware.py | 8 +- .../ignoring_self_events.py | 6 +- .../request_verification.py | 8 +- slack_bolt/middleware/ssl_check/ssl_check.py | 9 +- .../async_url_verification.py | 7 +- .../url_verification/url_verification.py | 10 +- slack_bolt/workflows/step/async_step.py | 113 +++++++++++--- slack_bolt/workflows/step/step.py | 146 ++++++++++++++---- tests/scenario_tests/test_app.py | 101 +++++++++--- tests/scenario_tests/test_workflow_steps.py | 60 +++++++ ...test_workflow_steps_decorator_with_args.py | 104 +++++++++++++ tests/scenario_tests_async/test_app.py | 137 +++++++++++----- .../test_workflow_steps.py | 63 ++++++++ ...test_workflow_steps_decorator_with_args.py | 105 +++++++++++++ 32 files changed, 1093 insertions(+), 241 deletions(-) diff --git a/.github/workflows/pytype.yml b/.github/workflows/pytype.yml index 6acf4b2b5..f13674516 100644 --- a/.github/workflows/pytype.yml +++ b/.github/workflows/pytype.yml @@ -8,10 +8,10 @@ on: jobs: build: runs-on: ubuntu-latest - timeout-minutes: 15 + timeout-minutes: 20 strategy: matrix: - python-version: ['3.8'] + python-version: ['3.9'] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} diff --git a/pytest.ini b/pytest.ini index 48ce6a5fe..27f7ad257 100644 --- a/pytest.ini +++ b/pytest.ini @@ -6,3 +6,4 @@ log_date_format = %Y-%m-%d %H:%M:%S filterwarnings = ignore:"@coroutine" decorator is deprecated since Python 3.8, use "async def" instead:DeprecationWarning ignore:The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.:DeprecationWarning +asyncio_mode = auto \ No newline at end of file diff --git a/scripts/run_pytype.sh b/scripts/run_pytype.sh index 273ce37f4..267fb8efe 100755 --- a/scripts/run_pytype.sh +++ b/scripts/run_pytype.sh @@ -5,5 +5,5 @@ script_dir=$(dirname $0) cd ${script_dir}/.. && \ pip install -e ".[async]" && \ pip install -e ".[adapter]" && \ - pip install "pytype==2022.2.23" && \ + pip install "pytype==2022.3.8" && \ pytype slack_bolt/ diff --git a/slack_bolt/adapter/aws_lambda/chalice_handler.py b/slack_bolt/adapter/aws_lambda/chalice_handler.py index a1edd158c..cad222a72 100644 --- a/slack_bolt/adapter/aws_lambda/chalice_handler.py +++ b/slack_bolt/adapter/aws_lambda/chalice_handler.py @@ -21,7 +21,9 @@ class ChaliceSlackRequestHandler: def __init__(self, app: App, chalice: Chalice, lambda_client: Optional[BaseClient] = None): # type: ignore self.app = app self.chalice = chalice - self.logger = get_bolt_app_logger(app.name, ChaliceSlackRequestHandler) + self.logger = get_bolt_app_logger( + app.name, ChaliceSlackRequestHandler, app.logger + ) if getenv("AWS_CHALICE_CLI_MODE") == "true" and lambda_client is None: try: diff --git a/slack_bolt/adapter/aws_lambda/handler.py b/slack_bolt/adapter/aws_lambda/handler.py index 9037ac397..bb24742e6 100644 --- a/slack_bolt/adapter/aws_lambda/handler.py +++ b/slack_bolt/adapter/aws_lambda/handler.py @@ -14,7 +14,7 @@ class SlackRequestHandler: def __init__(self, app: App): # type: ignore self.app = app - self.logger = get_bolt_app_logger(app.name, SlackRequestHandler) + self.logger = get_bolt_app_logger(app.name, SlackRequestHandler, app.logger) self.app.listener_runner.lazy_listener_runner = LambdaLazyListenerRunner( self.logger ) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index baaf85fca..7ee3fb096 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -189,6 +189,11 @@ def message_hello(message, say): self._verification_token: Optional[str] = verification_token or os.environ.get( "SLACK_VERIFICATION_TOKEN", None ) + # If a logger is explicitly passed when initializing, the logger works as the base logger. + # The base logger's logging settings will be propagated to all the loggers created by bolt-python. + self._base_logger = logger + # The framework logger is supposed to be used for the internal logging. + # Also, it's accessible via `app.logger` as the app's singleton logger. self._framework_logger = logger or get_bolt_logger(App) self._raise_error_for_unhandled_request = raise_error_for_unhandled_request @@ -356,10 +361,15 @@ def _init_middleware_list( return if ssl_check_enabled is True: self._middleware_list.append( - SslCheck(verification_token=self._verification_token) + SslCheck( + verification_token=self._verification_token, + base_logger=self._base_logger, + ) ) if request_verification_enabled is True: - self._middleware_list.append(RequestVerification(self._signing_secret)) + self._middleware_list.append( + RequestVerification(self._signing_secret, base_logger=self._base_logger) + ) # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._oauth_flow is None: @@ -370,24 +380,33 @@ def _init_middleware_list( # This API call is for eagerly validating the token auth_test_result = self._client.auth_test(token=self._token) self._middleware_list.append( - SingleTeamAuthorization(auth_test_result=auth_test_result) + SingleTeamAuthorization( + auth_test_result=auth_test_result, + base_logger=self._base_logger, + ) ) except SlackApiError as err: raise BoltError(error_auth_test_failure(err.response)) elif self._authorize is not None: self._middleware_list.append( - MultiTeamsAuthorization(authorize=self._authorize) + MultiTeamsAuthorization( + authorize=self._authorize, base_logger=self._base_logger + ) ) else: raise BoltError(error_token_required()) else: self._middleware_list.append( - MultiTeamsAuthorization(authorize=self._authorize) + MultiTeamsAuthorization( + authorize=self._authorize, base_logger=self._base_logger + ) ) if ignoring_self_events_enabled is True: - self._middleware_list.append(IgnoringSelfEvents()) + self._middleware_list.append( + IgnoringSelfEvents(base_logger=self._base_logger) + ) if url_verification_enabled is True: - self._middleware_list.append(UrlVerification()) + self._middleware_list.append(UrlVerification(base_logger=self._base_logger)) self._init_middleware_list_done = True # ------------------------- @@ -616,7 +635,11 @@ def middleware_func(logger, body, next): self._middleware_list.append(middleware) elif isinstance(middleware_or_callable, Callable): self._middleware_list.append( - CustomMiddleware(app_name=self.name, func=middleware_or_callable) + CustomMiddleware( + app_name=self.name, + func=middleware_or_callable, + base_logger=self._base_logger, + ) ) return middleware_or_callable else: @@ -677,9 +700,10 @@ def step( edit=edit, save=save, execute=execute, + base_logger=self._base_logger, ) elif isinstance(step, WorkflowStepBuilder): - step = step.build() + step = step.build(base_logger=self._base_logger) elif not isinstance(step, WorkflowStep): raise BoltError(f"Invalid step object ({type(step)})") @@ -759,7 +783,9 @@ def ask_for_introduction(event, say): def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.event(event) + primary_matcher = builtin_matchers.event( + event, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware, True ) @@ -814,7 +840,7 @@ def __call__(*args, **kwargs): ), } primary_matcher = builtin_matchers.message_event( - keyword=keyword, constraints=constraints + keyword=keyword, constraints=constraints, base_logger=self._base_logger ) middleware.insert(0, MessageListenerMatches(keyword)) return self._register_listener( @@ -859,7 +885,9 @@ def repeat_text(ack, say, command): def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.command(command) + primary_matcher = builtin_matchers.command( + command, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -908,7 +936,9 @@ def open_modal(ack, body, client): def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.shortcut(constraints) + primary_matcher = builtin_matchers.shortcut( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -925,7 +955,9 @@ def global_shortcut( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.global_shortcut(callback_id) + primary_matcher = builtin_matchers.global_shortcut( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -942,7 +974,9 @@ def message_shortcut( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.message_shortcut(callback_id) + primary_matcher = builtin_matchers.message_shortcut( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -984,7 +1018,9 @@ def update_message(ack): def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.action(constraints) + primary_matcher = builtin_matchers.action( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1003,7 +1039,9 @@ def block_action( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.block_action(constraints) + primary_matcher = builtin_matchers.block_action( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1021,7 +1059,9 @@ def attachment_action( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.attachment_action(callback_id) + primary_matcher = builtin_matchers.attachment_action( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1039,7 +1079,9 @@ def dialog_submission( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_submission(callback_id) + primary_matcher = builtin_matchers.dialog_submission( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1057,7 +1099,9 @@ def dialog_cancellation( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_cancellation(callback_id) + primary_matcher = builtin_matchers.dialog_cancellation( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1110,7 +1154,9 @@ def handle_submission(ack, body, client, view): def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view(constraints) + primary_matcher = builtin_matchers.view( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1128,7 +1174,9 @@ def view_submission( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view_submission(constraints) + primary_matcher = builtin_matchers.view_submission( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1146,7 +1194,9 @@ def view_closed( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view_closed(constraints) + primary_matcher = builtin_matchers.view_closed( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1199,7 +1249,9 @@ def show_menu_options(ack): def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.options(constraints) + primary_matcher = builtin_matchers.options( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1216,7 +1268,9 @@ def block_suggestion( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.block_suggestion(action_id) + primary_matcher = builtin_matchers.block_suggestion( + action_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1234,7 +1288,9 @@ def dialog_suggestion( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_suggestion(callback_id) + primary_matcher = builtin_matchers.dialog_suggestion( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1265,7 +1321,9 @@ def enable_token_revocation_listeners(self) -> None: # ------------------------- def _init_context(self, req: BoltRequest): - req.context["logger"] = get_bolt_app_logger(self.name) + req.context["logger"] = get_bolt_app_logger( + app_name=self.name, base_logger=self._base_logger + ) req.context["token"] = self._token if self._token is not None: # This WebClient instance can be safely singleton @@ -1311,7 +1369,10 @@ def _register_listener( value_to_return = functions[0] listener_matchers = [ - CustomListenerMatcher(app_name=self.name, func=f) for f in (matchers or []) + CustomListenerMatcher( + app_name=self.name, func=f, base_logger=self._base_logger + ) + for f in (matchers or []) ] listener_matchers.insert(0, primary_matcher) listener_middleware = [] @@ -1319,7 +1380,11 @@ def _register_listener( if isinstance(m, Middleware): listener_middleware.append(m) elif isinstance(m, Callable): - listener_middleware.append(CustomMiddleware(app_name=self.name, func=m)) + listener_middleware.append( + CustomMiddleware( + app_name=self.name, func=m, base_logger=self._base_logger + ) + ) else: raise ValueError(error_unexpected_listener_middleware(type(m))) @@ -1331,6 +1396,7 @@ def _register_listener( matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, + base_logger=self._base_logger, ) ) return value_to_return diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 0a6939390..aafdfb4b0 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -194,6 +194,11 @@ async def message_hello(message, say): # async function self._verification_token: Optional[str] = verification_token or os.environ.get( "SLACK_VERIFICATION_TOKEN", None ) + # If a logger is explicitly passed when initializing, the logger works as the base logger. + # The base logger's logging settings will be propagated to all the loggers created by bolt-python. + self._base_logger = logger + # The framework logger is supposed to be used for the internal logging. + # Also, it's accessible via `app.logger` as the app's singleton logger. self._framework_logger = logger or get_bolt_logger(AsyncApp) self._raise_error_for_unhandled_request = raise_error_for_unhandled_request @@ -376,31 +381,46 @@ def _init_async_middleware_list( return if ssl_check_enabled is True: self._async_middleware_list.append( - AsyncSslCheck(verification_token=self._verification_token) + AsyncSslCheck( + verification_token=self._verification_token, + base_logger=self._base_logger, + ) ) if request_verification_enabled is True: self._async_middleware_list.append( - AsyncRequestVerification(self._signing_secret) + AsyncRequestVerification( + self._signing_secret, base_logger=self._base_logger + ) ) # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._async_oauth_flow is None: if self._token: - self._async_middleware_list.append(AsyncSingleTeamAuthorization()) + self._async_middleware_list.append( + AsyncSingleTeamAuthorization(base_logger=self._base_logger) + ) elif self._async_authorize is not None: self._async_middleware_list.append( - AsyncMultiTeamsAuthorization(authorize=self._async_authorize) + AsyncMultiTeamsAuthorization( + authorize=self._async_authorize, base_logger=self._base_logger + ) ) else: raise BoltError(error_token_required()) else: self._async_middleware_list.append( - AsyncMultiTeamsAuthorization(authorize=self._async_authorize) + AsyncMultiTeamsAuthorization( + authorize=self._async_authorize, base_logger=self._base_logger + ) ) if ignoring_self_events_enabled is True: - self._async_middleware_list.append(AsyncIgnoringSelfEvents()) + self._async_middleware_list.append( + AsyncIgnoringSelfEvents(base_logger=self._base_logger) + ) if url_verification_enabled is True: - self._async_middleware_list.append(AsyncUrlVerification()) + self._async_middleware_list.append( + AsyncUrlVerification(base_logger=self._base_logger) + ) self._init_middleware_list_done = True # ------------------------- @@ -662,7 +682,9 @@ async def middleware_func(logger, body, next): elif isinstance(middleware_or_callable, Callable): self._async_middleware_list.append( AsyncCustomMiddleware( - app_name=self.name, func=middleware_or_callable + app_name=self.name, + func=middleware_or_callable, + base_logger=self._base_logger, ) ) return middleware_or_callable @@ -730,9 +752,10 @@ def step( edit=edit, save=save, execute=execute, + base_logger=self._base_logger, ) elif isinstance(step, AsyncWorkflowStepBuilder): - step = step.build() + step = step.build(base_logger=self._base_logger) elif not isinstance(step, AsyncWorkflowStep): raise BoltError(f"Invalid step object ({type(step)})") @@ -817,7 +840,9 @@ async def ask_for_introduction(event, say): def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.event(event, True) + primary_matcher = builtin_matchers.event( + event, True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware, True ) @@ -872,7 +897,10 @@ def __call__(*args, **kwargs): ), } primary_matcher = builtin_matchers.message_event( - constraints=constraints, keyword=keyword, asyncio=True + constraints=constraints, + keyword=keyword, + asyncio=True, + base_logger=self._base_logger, ) middleware.insert(0, AsyncMessageListenerMatches(keyword)) return self._register_listener( @@ -917,7 +945,9 @@ async def repeat_text(ack, say, command): def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.command(command, True) + primary_matcher = builtin_matchers.command( + command, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -966,7 +996,9 @@ async def open_modal(ack, body, client): def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.shortcut(constraints, True) + primary_matcher = builtin_matchers.shortcut( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -983,7 +1015,9 @@ def global_shortcut( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.global_shortcut(callback_id, True) + primary_matcher = builtin_matchers.global_shortcut( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1000,7 +1034,9 @@ def message_shortcut( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.message_shortcut(callback_id, True) + primary_matcher = builtin_matchers.message_shortcut( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1042,7 +1078,9 @@ async def update_message(ack): def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.action(constraints, True) + primary_matcher = builtin_matchers.action( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1061,7 +1099,9 @@ def block_action( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.block_action(constraints, True) + primary_matcher = builtin_matchers.block_action( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1079,7 +1119,9 @@ def attachment_action( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.attachment_action(callback_id, True) + primary_matcher = builtin_matchers.attachment_action( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1097,7 +1139,9 @@ def dialog_submission( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_submission(callback_id, True) + primary_matcher = builtin_matchers.dialog_submission( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1115,7 +1159,9 @@ def dialog_cancellation( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_cancellation(callback_id, True) + primary_matcher = builtin_matchers.dialog_cancellation( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1168,7 +1214,9 @@ async def handle_submission(ack, body, client, view): def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view(constraints, True) + primary_matcher = builtin_matchers.view( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1186,7 +1234,9 @@ def view_submission( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view_submission(constraints, True) + primary_matcher = builtin_matchers.view_submission( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1204,7 +1254,9 @@ def view_closed( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view_closed(constraints, True) + primary_matcher = builtin_matchers.view_closed( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1257,7 +1309,9 @@ async def show_menu_options(ack): def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.options(constraints, True) + primary_matcher = builtin_matchers.options( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1274,7 +1328,9 @@ def block_suggestion( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.block_suggestion(action_id, True) + primary_matcher = builtin_matchers.block_suggestion( + action_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1292,7 +1348,9 @@ def dialog_suggestion( def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_suggestion(callback_id, True) + primary_matcher = builtin_matchers.dialog_suggestion( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1323,7 +1381,9 @@ def enable_token_revocation_listeners(self) -> None: # ------------------------- def _init_context(self, req: AsyncBoltRequest): - req.context["logger"] = get_bolt_app_logger(self.name) + req.context["logger"] = get_bolt_app_logger( + app_name=self.name, base_logger=self._base_logger + ) req.context["token"] = self._token if self._token is not None: # This AsyncWebClient instance can be safely singleton @@ -1376,7 +1436,9 @@ def _register_listener( raise BoltError(error_listener_function_must_be_coro_func(name)) listener_matchers = [ - AsyncCustomListenerMatcher(app_name=self.name, func=f) + AsyncCustomListenerMatcher( + app_name=self.name, func=f, base_logger=self._base_logger + ) for f in (matchers or []) ] listener_matchers.insert(0, primary_matcher) @@ -1386,7 +1448,9 @@ def _register_listener( listener_middleware.append(m) elif isinstance(m, Callable) and inspect.iscoroutinefunction(m): listener_middleware.append( - AsyncCustomMiddleware(app_name=self.name, func=m) + AsyncCustomMiddleware( + app_name=self.name, func=m, base_logger=self._base_logger + ) ) else: raise ValueError(error_unexpected_listener_middleware(type(m))) @@ -1399,6 +1463,7 @@ def _register_listener( matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, + base_logger=self._base_logger, ) ) diff --git a/slack_bolt/listener/async_listener.py b/slack_bolt/listener/async_listener.py index 9102ec160..249567c7e 100644 --- a/slack_bolt/listener/async_listener.py +++ b/slack_bolt/listener/async_listener.py @@ -101,6 +101,7 @@ def __init__( matchers: Sequence[AsyncListenerMatcher], middleware: Sequence[AsyncMiddleware], auto_acknowledgement: bool = False, + base_logger: Optional[Logger] = None, ): self.app_name = app_name self.ack_function = ack_function @@ -109,7 +110,7 @@ def __init__( self.middleware = middleware self.auto_acknowledgement = auto_acknowledgement self.arg_names = inspect.getfullargspec(ack_function).args - self.logger = get_bolt_app_logger(app_name, self.ack_function) + self.logger = get_bolt_app_logger(app_name, self.ack_function, base_logger) async def run_ack_function( self, diff --git a/slack_bolt/listener/custom_listener.py b/slack_bolt/listener/custom_listener.py index b38e80324..9822a4fa8 100644 --- a/slack_bolt/listener/custom_listener.py +++ b/slack_bolt/listener/custom_listener.py @@ -30,6 +30,7 @@ def __init__( matchers: Sequence[ListenerMatcher], middleware: Sequence[Middleware], # type: ignore auto_acknowledgement: bool = False, + base_logger: Optional[Logger] = None, ): self.app_name = app_name self.ack_function = ack_function @@ -38,7 +39,7 @@ def __init__( self.middleware = middleware self.auto_acknowledgement = auto_acknowledgement self.arg_names = inspect.getfullargspec(ack_function).args - self.logger = get_bolt_app_logger(app_name, self.ack_function) + self.logger = get_bolt_app_logger(app_name, self.ack_function, base_logger) def run_ack_function( self, diff --git a/slack_bolt/listener_matcher/async_listener_matcher.py b/slack_bolt/listener_matcher/async_listener_matcher.py index 7673081fc..19995b523 100644 --- a/slack_bolt/listener_matcher/async_listener_matcher.py +++ b/slack_bolt/listener_matcher/async_listener_matcher.py @@ -21,7 +21,7 @@ async def async_matches(self, req: AsyncBoltRequest, resp: BoltResponse) -> bool import inspect from logging import Logger -from typing import Callable, Awaitable, Sequence +from typing import Callable, Awaitable, Sequence, Optional from slack_bolt.kwargs_injection.async_utils import build_async_required_kwargs from slack_bolt.logger import get_bolt_app_logger @@ -35,11 +35,17 @@ class AsyncCustomListenerMatcher(AsyncListenerMatcher): arg_names: Sequence[str] logger: Logger - def __init__(self, *, app_name: str, func: Callable[..., Awaitable[bool]]): + def __init__( + self, + *, + app_name: str, + func: Callable[..., Awaitable[bool]], + base_logger: Optional[Logger] = None + ): self.app_name = app_name self.func = func self.arg_names = inspect.getfullargspec(func).args - self.logger = get_bolt_app_logger(self.app_name, self.func) + self.logger = get_bolt_app_logger(self.app_name, self.func, base_logger) async def async_matches(self, req: AsyncBoltRequest, resp: BoltResponse) -> bool: return await self.func( diff --git a/slack_bolt/listener_matcher/builtins.py b/slack_bolt/listener_matcher/builtins.py index 2bf582f67..043a497fa 100644 --- a/slack_bolt/listener_matcher/builtins.py +++ b/slack_bolt/listener_matcher/builtins.py @@ -2,6 +2,7 @@ import inspect import re import sys +from logging import Logger from slack_bolt.error import BoltError from slack_bolt.request.payload_utils import ( @@ -40,10 +41,15 @@ # a.k.a Union[ListenerMatcher, "AsyncListenerMatcher"] class BuiltinListenerMatcher(ListenerMatcher): - def __init__(self, *, func: Callable[..., Union[bool, Awaitable[bool]]]): + def __init__( + self, + *, + func: Callable[..., Union[bool, Awaitable[bool]]], + base_logger: Optional[Logger] = None, + ): self.func = func self.arg_names = inspect.getfullargspec(func).args - self.logger = get_bolt_logger(self.func) + self.logger = get_bolt_logger(self.func, base_logger) def matches(self, req: BoltRequest, resp: BoltResponse) -> bool: return self.func( @@ -60,6 +66,7 @@ def matches(self, req: BoltRequest, resp: BoltResponse) -> bool: def build_listener_matcher( func: Callable[..., bool], asyncio: bool, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: if asyncio: from .async_builtins import AsyncBuiltinListenerMatcher @@ -67,9 +74,9 @@ def build_listener_matcher( async def async_fun(body: Dict[str, Any]) -> bool: return func(body) - return AsyncBuiltinListenerMatcher(func=async_fun) + return AsyncBuiltinListenerMatcher(func=async_fun, base_logger=base_logger) else: - return BuiltinListenerMatcher(func=func) + return BuiltinListenerMatcher(func=func, base_logger=base_logger) # ------------- @@ -83,6 +90,7 @@ def event( Dict[str, Optional[Union[str, Sequence[Optional[Union[str, Pattern]]]]]], ], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: if isinstance(constraints, (str, Pattern)): event_type: Union[str, Pattern] = constraints @@ -91,7 +99,7 @@ def event( def func(body: Dict[str, Any]) -> bool: return is_event(body) and _matches(event_type, body["event"]["type"]) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) elif "type" in constraints: _verify_message_event_type(constraints["type"]) @@ -104,7 +112,7 @@ def func(body: Dict[str, Any]) -> bool: ) return False - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) raise BoltError( f"event ({constraints}: {type(constraints)}) must be any of str, Pattern, and dict" @@ -117,6 +125,7 @@ def message_event( ], keyword: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: if "type" in constraints and keyword is not None: _verify_message_event_type(constraints["type"]) @@ -135,7 +144,7 @@ def func(body: Dict[str, Any]) -> bool: return True return False - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) raise BoltError(f"event ({constraints}: {type(constraints)}) must be dict") @@ -181,6 +190,7 @@ def _verify_message_event_type(event_type: str) -> None: def workflow_step_execute( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return ( @@ -190,7 +200,7 @@ def func(body: Dict[str, Any]) -> bool: and _matches(callback_id, body["event"]["callback_id"]) ) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) # ------------- @@ -200,11 +210,12 @@ def func(body: Dict[str, Any]) -> bool: def command( command: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return is_slash_command(body) and _matches(command, body["command"]) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) # ------------- @@ -214,6 +225,7 @@ def func(body: Dict[str, Any]) -> bool: def shortcut( constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: if isinstance(constraints, (str, Pattern)): callback_id: Union[str, Pattern] = constraints @@ -221,7 +233,7 @@ def shortcut( def func(body: Dict[str, Any]) -> bool: return is_shortcut(body) and _matches(callback_id, body["callback_id"]) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) elif "type" in constraints and "callback_id" in constraints: if constraints["type"] == "shortcut": @@ -237,21 +249,23 @@ def func(body: Dict[str, Any]) -> bool: def global_shortcut( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return is_global_shortcut(body) and _matches(callback_id, body["callback_id"]) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) def message_shortcut( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return is_message_shortcut(body) and _matches(callback_id, body["callback_id"]) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) # ------------- @@ -261,6 +275,7 @@ def func(body: Dict[str, Any]) -> bool: def action( constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: if isinstance(constraints, (str, Pattern)): @@ -273,7 +288,7 @@ def func(body: Dict[str, Any]) -> bool: or _workflow_step_edit(constraints, body) ) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) elif "type" in constraints: action_type = constraints["type"] @@ -323,11 +338,12 @@ def _block_action( def block_action( constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return _block_action(constraints, body) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) def _attachment_action( @@ -340,11 +356,12 @@ def _attachment_action( def attachment_action( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return _attachment_action(callback_id, body) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) def _dialog_submission( @@ -357,11 +374,12 @@ def _dialog_submission( def dialog_submission( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return _dialog_submission(callback_id, body) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) def _dialog_cancellation( @@ -374,11 +392,12 @@ def _dialog_cancellation( def dialog_cancellation( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return _dialog_cancellation(callback_id, body) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) def _workflow_step_edit( @@ -391,11 +410,12 @@ def _workflow_step_edit( def workflow_step_edit( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return _workflow_step_edit(callback_id, body) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) # ------------------------- @@ -405,6 +425,7 @@ def func(body: Dict[str, Any]) -> bool: def view( constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: if isinstance(constraints, (str, Pattern)): return view_submission(constraints, asyncio) @@ -422,37 +443,40 @@ def view( def view_submission( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return is_view_submission(body) and _matches( callback_id, body["view"]["callback_id"] ) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) def view_closed( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return is_view_closed(body) and _matches( callback_id, body["view"]["callback_id"] ) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) def workflow_step_save( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return is_workflow_step_save(body) and _matches( callback_id, body["view"]["callback_id"] ) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) # ------------- @@ -462,6 +486,7 @@ def func(body: Dict[str, Any]) -> bool: def options( constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: if isinstance(constraints, (str, Pattern)): @@ -470,7 +495,7 @@ def func(body: Dict[str, Any]) -> bool: constraints, body ) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) if "action_id" in constraints: return block_suggestion(constraints["action_id"], asyncio) @@ -492,11 +517,12 @@ def _block_suggestion( def block_suggestion( action_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return _block_suggestion(action_id, body) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) def _dialog_suggestion( @@ -509,11 +535,12 @@ def _dialog_suggestion( def dialog_suggestion( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return _dialog_suggestion(callback_id, body) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) # ------------------------- diff --git a/slack_bolt/listener_matcher/custom_listener_matcher.py b/slack_bolt/listener_matcher/custom_listener_matcher.py index 4e07006d4..dff1c1e7b 100644 --- a/slack_bolt/listener_matcher/custom_listener_matcher.py +++ b/slack_bolt/listener_matcher/custom_listener_matcher.py @@ -1,6 +1,6 @@ import inspect from logging import Logger -from typing import Callable, Sequence +from typing import Callable, Sequence, Optional from slack_bolt.kwargs_injection import build_required_kwargs from slack_bolt.logger import get_bolt_app_logger @@ -15,11 +15,17 @@ class CustomListenerMatcher(ListenerMatcher): arg_names: Sequence[str] logger: Logger - def __init__(self, *, app_name: str, func: Callable[..., bool]): + def __init__( + self, + *, + app_name: str, + func: Callable[..., bool], + base_logger: Optional[Logger] = None + ): self.app_name = app_name self.func = func self.arg_names = inspect.getfullargspec(func).args - self.logger = get_bolt_app_logger(self.app_name, self.func) + self.logger = get_bolt_app_logger(self.app_name, self.func, base_logger) def matches(self, req: BoltRequest, resp: BoltResponse) -> bool: return self.func( diff --git a/slack_bolt/logger/__init__.py b/slack_bolt/logger/__init__.py index 25f076a9a..77e26a983 100644 --- a/slack_bolt/logger/__init__.py +++ b/slack_bolt/logger/__init__.py @@ -2,24 +2,45 @@ import logging from logging import Logger -from typing import Any +from typing import Any, Optional -def get_bolt_logger(cls: Any) -> Logger: +def get_bolt_logger(cls: Any, base_logger: Optional[Logger] = None) -> Logger: logger = logging.getLogger(f"slack_bolt.{cls.__name__}") - logger.disabled = logging.root.disabled - logger.level = logging.root.level + if base_logger is not None: + _configure_from_base_logger(logger, base_logger) + else: + _configure_from_root(logger) return logger -def get_bolt_app_logger(app_name: str, cls: object = None) -> Logger: - if cls and hasattr(cls, "__name__"): - logger = logging.getLogger(f"{app_name}:{cls.__name__}") - logger.disabled = logging.root.disabled - logger.level = logging.root.level - return logger +def get_bolt_app_logger( + app_name: str, cls: object = None, base_logger: Optional[Logger] = None +) -> Logger: + logger: Logger = ( + logging.getLogger(f"{app_name}:{cls.__name__}") + if cls and hasattr(cls, "__name__") + else logging.getLogger(app_name) + ) + + if base_logger is not None: + _configure_from_base_logger(logger, base_logger) else: - logger = logging.getLogger(app_name) - logger.disabled = logging.root.disabled - logger.level = logging.root.level - return logger + _configure_from_root(logger) + return logger + + +def _configure_from_base_logger(new_logger: Logger, base_logger: Logger): + new_logger.disabled = base_logger.disabled + new_logger.level = base_logger.level + if len(new_logger.handlers) == 0: + for h in base_logger.handlers: + new_logger.addHandler(h) + if len(new_logger.filters) == 0: + for f in base_logger.filters: + new_logger.addFilter(f) + + +def _configure_from_root(new_logger: Logger): + new_logger.disabled = logging.root.disabled + new_logger.level = logging.root.level diff --git a/slack_bolt/middleware/async_custom_middleware.py b/slack_bolt/middleware/async_custom_middleware.py index d967f188e..a46219917 100644 --- a/slack_bolt/middleware/async_custom_middleware.py +++ b/slack_bolt/middleware/async_custom_middleware.py @@ -1,6 +1,6 @@ import inspect from logging import Logger -from typing import Callable, Awaitable, Any, Sequence +from typing import Callable, Awaitable, Any, Sequence, Optional from slack_bolt.kwargs_injection.async_utils import build_async_required_kwargs from slack_bolt.logger import get_bolt_app_logger @@ -16,7 +16,13 @@ class AsyncCustomMiddleware(AsyncMiddleware): arg_names: Sequence[str] logger: Logger - def __init__(self, *, app_name: str, func: Callable[..., Awaitable[Any]]): + def __init__( + self, + *, + app_name: str, + func: Callable[..., Awaitable[Any]], + base_logger: Optional[Logger] = None, + ): self.app_name = app_name if inspect.iscoroutinefunction(func): self.func = func @@ -24,7 +30,7 @@ def __init__(self, *, app_name: str, func: Callable[..., Awaitable[Any]]): raise ValueError("Async middleware function must be an async function") self.arg_names = inspect.getfullargspec(func).args - self.logger = get_bolt_app_logger(self.app_name, self.func) + self.logger = get_bolt_app_logger(self.app_name, self.func, base_logger) async def async_process( self, diff --git a/slack_bolt/middleware/authorization/async_multi_teams_authorization.py b/slack_bolt/middleware/authorization/async_multi_teams_authorization.py index 85c56cc33..1a62b5b5a 100644 --- a/slack_bolt/middleware/authorization/async_multi_teams_authorization.py +++ b/slack_bolt/middleware/authorization/async_multi_teams_authorization.py @@ -1,3 +1,4 @@ +from logging import Logger from typing import Callable, Optional, Awaitable from slack_sdk.errors import SlackApiError @@ -14,14 +15,17 @@ class AsyncMultiTeamsAuthorization(AsyncAuthorization): authorize: AsyncAuthorize - def __init__(self, authorize: AsyncAuthorize): + def __init__(self, authorize: AsyncAuthorize, base_logger: Optional[Logger] = None): """Multi-workspace authorization. Args: authorize: The function to authorize incoming requests from Slack. + base_logger: The base logger """ self.authorize = authorize - self.logger = get_bolt_logger(AsyncMultiTeamsAuthorization) + self.logger = get_bolt_logger( + AsyncMultiTeamsAuthorization, base_logger=base_logger + ) async def async_process( self, diff --git a/slack_bolt/middleware/authorization/async_single_team_authorization.py b/slack_bolt/middleware/authorization/async_single_team_authorization.py index 0c9ff9cd9..72f4992cc 100644 --- a/slack_bolt/middleware/authorization/async_single_team_authorization.py +++ b/slack_bolt/middleware/authorization/async_single_team_authorization.py @@ -1,3 +1,4 @@ +from logging import Logger from typing import Callable, Awaitable, Optional from slack_bolt.logger import get_bolt_logger @@ -12,10 +13,12 @@ class AsyncSingleTeamAuthorization(AsyncAuthorization): - def __init__(self): + def __init__(self, base_logger: Optional[Logger] = None): """Single-workspace authorization.""" self.auth_test_result: Optional[AsyncSlackResponse] = None - self.logger = get_bolt_logger(AsyncSingleTeamAuthorization) + self.logger = get_bolt_logger( + AsyncSingleTeamAuthorization, base_logger=base_logger + ) async def async_process( self, diff --git a/slack_bolt/middleware/authorization/multi_teams_authorization.py b/slack_bolt/middleware/authorization/multi_teams_authorization.py index 7aeacf259..dd7c9ad3e 100644 --- a/slack_bolt/middleware/authorization/multi_teams_authorization.py +++ b/slack_bolt/middleware/authorization/multi_teams_authorization.py @@ -1,3 +1,4 @@ +from logging import Logger from typing import Callable, Optional from slack_sdk.errors import SlackApiError @@ -22,14 +23,16 @@ def __init__( self, *, authorize: Authorize, + base_logger: Optional[Logger] = None, ): """Multi-workspace authorization. Args: authorize: The function to authorize incoming requests from Slack. + base_logger: The base logger """ self.authorize = authorize - self.logger = get_bolt_logger(MultiTeamsAuthorization) + self.logger = get_bolt_logger(MultiTeamsAuthorization, base_logger=base_logger) def process( self, diff --git a/slack_bolt/middleware/authorization/single_team_authorization.py b/slack_bolt/middleware/authorization/single_team_authorization.py index 084f21141..b567b4299 100644 --- a/slack_bolt/middleware/authorization/single_team_authorization.py +++ b/slack_bolt/middleware/authorization/single_team_authorization.py @@ -1,3 +1,4 @@ +from logging import Logger from typing import Callable, Optional from slack_bolt.logger import get_bolt_logger @@ -16,14 +17,20 @@ class SingleTeamAuthorization(Authorization): - def __init__(self, *, auth_test_result: Optional[SlackResponse] = None): + def __init__( + self, + *, + auth_test_result: Optional[SlackResponse] = None, + base_logger: Optional[Logger] = None, + ): """Single-workspace authorization. Args: auth_test_result: The initial `auth.test` API call result. + base_logger: The base logger """ self.auth_test_result = auth_test_result - self.logger = get_bolt_logger(SingleTeamAuthorization) + self.logger = get_bolt_logger(SingleTeamAuthorization, base_logger=base_logger) def process( self, diff --git a/slack_bolt/middleware/custom_middleware.py b/slack_bolt/middleware/custom_middleware.py index 6b52b5897..3b7699cfd 100644 --- a/slack_bolt/middleware/custom_middleware.py +++ b/slack_bolt/middleware/custom_middleware.py @@ -1,6 +1,6 @@ import inspect from logging import Logger -from typing import Callable, Any, Sequence +from typing import Callable, Any, Sequence, Optional from slack_bolt.kwargs_injection import build_required_kwargs from slack_bolt.logger import get_bolt_app_logger @@ -16,11 +16,13 @@ class CustomMiddleware(Middleware): arg_names: Sequence[str] logger: Logger - def __init__(self, *, app_name: str, func: Callable): + def __init__( + self, *, app_name: str, func: Callable, base_logger: Optional[Logger] = None + ): self.app_name = app_name self.func = func self.arg_names = inspect.getfullargspec(func).args - self.logger = get_bolt_app_logger(self.app_name, self.func) + self.logger = get_bolt_app_logger(self.app_name, self.func, base_logger) def process( self, diff --git a/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.py b/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.py index 06642b301..bd825330d 100644 --- a/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.py +++ b/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.py @@ -1,5 +1,5 @@ import logging -from typing import Callable, Dict, Any +from typing import Callable, Dict, Any, Optional from slack_bolt.authorization import AuthorizeResult from slack_bolt.logger import get_bolt_logger @@ -9,9 +9,9 @@ class IgnoringSelfEvents(Middleware): - def __init__(self): + def __init__(self, base_logger: Optional[logging.Logger] = None): """Ignores the events generated by this bot user itself.""" - self.logger = get_bolt_logger(IgnoringSelfEvents) + self.logger = get_bolt_logger(IgnoringSelfEvents, base_logger=base_logger) def process( self, diff --git a/slack_bolt/middleware/request_verification/request_verification.py b/slack_bolt/middleware/request_verification/request_verification.py index ebbf803e3..072901521 100644 --- a/slack_bolt/middleware/request_verification/request_verification.py +++ b/slack_bolt/middleware/request_verification/request_verification.py @@ -1,4 +1,5 @@ -from typing import Callable, Dict, Any +from logging import Logger +from typing import Callable, Dict, Any, Optional from slack_sdk.signature import SignatureVerifier @@ -9,7 +10,7 @@ class RequestVerification(Middleware): # type: ignore - def __init__(self, signing_secret: str): + def __init__(self, signing_secret: str, base_logger: Optional[Logger] = None): """Verifies an incoming request by checking the validity of `x-slack-signature`, `x-slack-request-timestamp`, and its body data. @@ -17,9 +18,10 @@ def __init__(self, signing_secret: str): Args: signing_secret: The signing secret + base_logger: The base logger """ self.verifier = SignatureVerifier(signing_secret=signing_secret) - self.logger = get_bolt_logger(RequestVerification) + self.logger = get_bolt_logger(RequestVerification, base_logger=base_logger) def process( self, diff --git a/slack_bolt/middleware/ssl_check/ssl_check.py b/slack_bolt/middleware/ssl_check/ssl_check.py index e02ec7881..d8c92c72d 100644 --- a/slack_bolt/middleware/ssl_check/ssl_check.py +++ b/slack_bolt/middleware/ssl_check/ssl_check.py @@ -11,16 +11,21 @@ class SslCheck(Middleware): # type: ignore verification_token: Optional[str] logger: Logger - def __init__(self, verification_token: Optional[str] = None): + def __init__( + self, + verification_token: Optional[str] = None, + base_logger: Optional[Logger] = None, + ): """Handles `ssl_check` requests. Refer to https://api.slack.com/interactivity/slash-commands for details. Args: verification_token: The verification token to check (optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation) + base_logger: The base logger """ self.verification_token = verification_token - self.logger = get_bolt_logger(SslCheck) + self.logger = get_bolt_logger(SslCheck, base_logger=base_logger) def process( self, diff --git a/slack_bolt/middleware/url_verification/async_url_verification.py b/slack_bolt/middleware/url_verification/async_url_verification.py index 91b4f2b63..2371bc3a4 100644 --- a/slack_bolt/middleware/url_verification/async_url_verification.py +++ b/slack_bolt/middleware/url_verification/async_url_verification.py @@ -1,4 +1,5 @@ -from typing import Callable, Awaitable +from logging import Logger +from typing import Callable, Awaitable, Optional from slack_bolt.logger import get_bolt_logger from .url_verification import UrlVerification @@ -8,8 +9,8 @@ class AsyncUrlVerification(UrlVerification, AsyncMiddleware): - def __init__(self): - self.logger = get_bolt_logger(AsyncUrlVerification) + def __init__(self, base_logger: Optional[Logger] = None): + self.logger = get_bolt_logger(AsyncUrlVerification, base_logger=base_logger) async def async_process( self, diff --git a/slack_bolt/middleware/url_verification/url_verification.py b/slack_bolt/middleware/url_verification/url_verification.py index 591838e31..a8afc1baa 100644 --- a/slack_bolt/middleware/url_verification/url_verification.py +++ b/slack_bolt/middleware/url_verification/url_verification.py @@ -1,4 +1,5 @@ -from typing import Callable +from logging import Logger +from typing import Callable, Optional from slack_bolt.logger import get_bolt_logger from slack_bolt.middleware.middleware import Middleware @@ -7,12 +8,15 @@ class UrlVerification(Middleware): # type: ignore - def __init__(self): + def __init__(self, base_logger: Optional[Logger] = None): """Handles url_verification requests. Refer to https://api.slack.com/events/url_verification for details. + + Args: + base_logger: The base logger """ - self.logger = get_bolt_logger(UrlVerification) + self.logger = get_bolt_logger(UrlVerification, base_logger=base_logger) def process( self, diff --git a/slack_bolt/workflows/step/async_step.py b/slack_bolt/workflows/step/async_step.py index b445962d0..113c6c346 100644 --- a/slack_bolt/workflows/step/async_step.py +++ b/slack_bolt/workflows/step/async_step.py @@ -1,4 +1,5 @@ from functools import wraps +from logging import Logger from typing import Callable, Union, Optional, Awaitable, Sequence, List, Pattern from slack_sdk.web.async_client import AsyncWebClient @@ -31,6 +32,7 @@ class AsyncWorkflowStepBuilder: """ callback_id: Union[str, Pattern] + _base_logger: Optional[Logger] _edit: Optional[AsyncListener] _save: Optional[AsyncListener] _execute: Optional[AsyncListener] @@ -39,6 +41,7 @@ def __init__( self, callback_id: Union[str, Pattern], app_name: Optional[str] = None, + base_logger: Optional[Logger] = None, ): """This builder is supposed to be used as decorator. @@ -61,9 +64,11 @@ async def execute_my_step(step, complete, fail): Args: callback_id: The callback_id for the workflow app_name: The application name mainly for logging + base_logger: The base logger """ self.callback_id = callback_id self.app_name = app_name or __name__ + self._base_logger = base_logger self._edit = None self._save = None self._execute = None @@ -217,7 +222,7 @@ async def _wrapper(*args, **kwargs): return _inner - def build(self) -> "AsyncWorkflowStep": + def build(self, base_logger: Optional[Logger] = None) -> "AsyncWorkflowStep": """Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. @@ -237,6 +242,7 @@ def build(self) -> "AsyncWorkflowStep": save=self._save, execute=self._execute, app_name=self.app_name, + base_logger=base_logger, ) # --------------------------------------- @@ -257,6 +263,7 @@ def _to_listener( name=name, matchers=self.to_listener_matchers(self.app_name, matchers), middleware=self.to_listener_middleware(self.app_name, middleware), + base_logger=self._base_logger, ) @staticmethod @@ -319,16 +326,39 @@ def __init__( Callable[..., Awaitable[BoltResponse]], AsyncListener, Sequence[Callable] ], app_name: Optional[str] = None, + base_logger: Optional[Logger] = None, ): self.callback_id = callback_id app_name = app_name or __name__ - self.edit = self.build_listener(callback_id, app_name, edit, "edit") - self.save = self.build_listener(callback_id, app_name, save, "save") - self.execute = self.build_listener(callback_id, app_name, execute, "execute") + self.edit = self.build_listener( + callback_id=callback_id, + app_name=app_name, + listener_or_functions=edit, + name="edit", + base_logger=base_logger, + ) + self.save = self.build_listener( + callback_id=callback_id, + app_name=app_name, + listener_or_functions=save, + name="save", + base_logger=base_logger, + ) + self.execute = self.build_listener( + callback_id=callback_id, + app_name=app_name, + listener_or_functions=execute, + name="execute", + base_logger=base_logger, + ) @classmethod - def builder(cls, callback_id: Union[str, Pattern]) -> AsyncWorkflowStepBuilder: - return AsyncWorkflowStepBuilder(callback_id) + def builder( + cls, + callback_id: Union[str, Pattern], + base_logger: Optional[Logger] = None, + ) -> AsyncWorkflowStepBuilder: + return AsyncWorkflowStepBuilder(callback_id, base_logger=base_logger) @classmethod def build_listener( @@ -339,6 +369,7 @@ def build_listener( name: str, matchers: Optional[List[AsyncListenerMatcher]] = None, middleware: Optional[List[AsyncMiddleware]] = None, + base_logger: Optional[Logger] = None, ): if listener_or_functions is None: raise BoltError(f"{name} listener is required (callback_id: {callback_id})") @@ -350,9 +381,13 @@ def build_listener( return listener_or_functions elif isinstance(listener_or_functions, list): matchers = matchers if matchers else [] - matchers.insert(0, cls._build_primary_matcher(name, callback_id)) + matchers.insert( + 0, cls._build_primary_matcher(name, callback_id, base_logger) + ) middleware = middleware if middleware else [] - middleware.insert(0, cls._build_single_middleware(name, callback_id)) + middleware.insert( + 0, cls._build_single_middleware(name, callback_id, base_logger) + ) functions = listener_or_functions ack_function = functions.pop(0) return AsyncCustomListener( @@ -362,6 +397,7 @@ def build_listener( ack_function=ack_function, lazy_functions=functions, auto_acknowledgement=name == "execute", + base_logger=base_logger, ) else: raise BoltError( @@ -370,25 +406,39 @@ def build_listener( @classmethod def _build_primary_matcher( - cls, name: str, callback_id: str + cls, + name: str, + callback_id: str, + base_logger: Optional[Logger] = None, ) -> AsyncListenerMatcher: if name == "edit": - return workflow_step_edit(callback_id, asyncio=True) + return workflow_step_edit( + callback_id, asyncio=True, base_logger=base_logger + ) elif name == "save": - return workflow_step_save(callback_id, asyncio=True) + return workflow_step_save( + callback_id, asyncio=True, base_logger=base_logger + ) elif name == "execute": - return workflow_step_execute(callback_id, asyncio=True) + return workflow_step_execute( + callback_id, asyncio=True, base_logger=base_logger + ) else: raise ValueError(f"Invalid name {name}") @classmethod - def _build_single_middleware(cls, name: str, callback_id: str) -> AsyncMiddleware: + def _build_single_middleware( + cls, + name: str, + callback_id: str, + base_logger: Optional[Logger] = None, + ) -> AsyncMiddleware: if name == "edit": - return _build_edit_listener_middleware(callback_id) + return _build_edit_listener_middleware(callback_id, base_logger) elif name == "save": - return _build_save_listener_middleware() + return _build_save_listener_middleware(base_logger) elif name == "execute": - return _build_execute_listener_middleware() + return _build_execute_listener_middleware(base_logger) else: raise ValueError(f"Invalid name {name}") @@ -398,7 +448,10 @@ def _build_single_middleware(cls, name: str, callback_id: str) -> AsyncMiddlewar ####################### -def _build_edit_listener_middleware(callback_id: str) -> AsyncMiddleware: +def _build_edit_listener_middleware( + callback_id: str, + base_logger: Optional[Logger] = None, +) -> AsyncMiddleware: async def edit_listener_middleware( context: AsyncBoltContext, client: AsyncWebClient, @@ -412,7 +465,11 @@ async def edit_listener_middleware( ) return await next() - return AsyncCustomMiddleware(app_name=__name__, func=edit_listener_middleware) + return AsyncCustomMiddleware( + app_name=__name__, + func=edit_listener_middleware, + base_logger=base_logger, + ) ####################### @@ -420,7 +477,9 @@ async def edit_listener_middleware( ####################### -def _build_save_listener_middleware() -> AsyncMiddleware: +def _build_save_listener_middleware( + base_logger: Optional[Logger] = None, +) -> AsyncMiddleware: async def save_listener_middleware( context: AsyncBoltContext, client: AsyncWebClient, @@ -433,7 +492,11 @@ async def save_listener_middleware( ) return await next() - return AsyncCustomMiddleware(app_name=__name__, func=save_listener_middleware) + return AsyncCustomMiddleware( + app_name=__name__, + func=save_listener_middleware, + base_logger=base_logger, + ) ####################### @@ -441,7 +504,9 @@ async def save_listener_middleware( ####################### -def _build_execute_listener_middleware() -> AsyncMiddleware: +def _build_execute_listener_middleware( + base_logger: Optional[Logger] = None, +) -> AsyncMiddleware: async def execute_listener_middleware( context: AsyncBoltContext, client: AsyncWebClient, @@ -458,4 +523,8 @@ async def execute_listener_middleware( ) return await next() - return AsyncCustomMiddleware(app_name=__name__, func=execute_listener_middleware) + return AsyncCustomMiddleware( + app_name=__name__, + func=execute_listener_middleware, + base_logger=base_logger, + ) diff --git a/slack_bolt/workflows/step/step.py b/slack_bolt/workflows/step/step.py index 692ee5d1e..dd17289fe 100644 --- a/slack_bolt/workflows/step/step.py +++ b/slack_bolt/workflows/step/step.py @@ -1,4 +1,5 @@ from functools import wraps +from logging import Logger from typing import Callable, Union, Optional, Sequence, Pattern, List from slack_bolt.context.context import BoltContext @@ -26,6 +27,7 @@ class WorkflowStepBuilder: """ callback_id: Union[str, Pattern] + _base_logger: Optional[Logger] _edit: Optional[Listener] _save: Optional[Listener] _execute: Optional[Listener] @@ -34,6 +36,7 @@ def __init__( self, callback_id: Union[str, Pattern], app_name: Optional[str] = None, + base_logger: Optional[Logger] = None, ): """This builder is supposed to be used as decorator. @@ -56,9 +59,11 @@ def execute_my_step(step, complete, fail): Args: callback_id: The callback_id for the workflow app_name: The application name mainly for logging + base_logger: The base logger """ self.callback_id = callback_id self.app_name = app_name or __name__ + self._base_logger = base_logger self._edit = None self._save = None self._execute = None @@ -207,7 +212,7 @@ def _wrapper(*args, **kwargs): return _inner - def build(self) -> "WorkflowStep": + def build(self, base_logger: Optional[Logger] = None) -> "WorkflowStep": """Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. @@ -227,6 +232,7 @@ def build(self) -> "WorkflowStep": save=self._save, execute=self._execute, app_name=self.app_name, + base_logger=base_logger, ) # --------------------------------------- @@ -243,14 +249,20 @@ def _to_listener( app_name=self.app_name, listener_or_functions=listener_or_functions, name=name, - matchers=self.to_listener_matchers(self.app_name, matchers), - middleware=self.to_listener_middleware(self.app_name, middleware), + matchers=self.to_listener_matchers( + self.app_name, matchers, self._base_logger + ), + middleware=self.to_listener_middleware( + self.app_name, middleware, self._base_logger + ), + base_logger=self._base_logger, ) @staticmethod def to_listener_matchers( app_name: str, matchers: Optional[List[Union[Callable[..., bool], ListenerMatcher]]], + base_logger: Optional[Logger] = None, ) -> List[ListenerMatcher]: _matchers = [] if matchers is not None: @@ -258,14 +270,22 @@ def to_listener_matchers( if isinstance(m, ListenerMatcher): _matchers.append(m) elif isinstance(m, Callable): - _matchers.append(CustomListenerMatcher(app_name=app_name, func=m)) + _matchers.append( + CustomListenerMatcher( + app_name=app_name, + func=m, + base_logger=base_logger, + ) + ) else: raise ValueError(f"Invalid matcher: {type(m)}") return _matchers # type: ignore @staticmethod def to_listener_middleware( - app_name: str, middleware: Optional[List[Union[Callable, Middleware]]] + app_name: str, + middleware: Optional[List[Union[Callable, Middleware]]], + base_logger: Optional[Logger] = None, ) -> List[Middleware]: _middleware = [] if middleware is not None: @@ -273,7 +293,13 @@ def to_listener_middleware( if isinstance(m, Middleware): _middleware.append(m) elif isinstance(m, Callable): - _middleware.append(CustomMiddleware(app_name=app_name, func=m)) + _middleware.append( + CustomMiddleware( + app_name=app_name, + func=m, + base_logger=base_logger, + ) + ) else: raise ValueError(f"Invalid middleware: {type(m)}") return _middleware # type: ignore @@ -303,16 +329,40 @@ def __init__( Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable] ], app_name: Optional[str] = None, + base_logger: Optional[Logger] = None, ): self.callback_id = callback_id app_name = app_name or __name__ - self.edit = self.build_listener(callback_id, app_name, edit, "edit") - self.save = self.build_listener(callback_id, app_name, save, "save") - self.execute = self.build_listener(callback_id, app_name, execute, "execute") + self.edit = self.build_listener( + callback_id=callback_id, + app_name=app_name, + listener_or_functions=edit, + name="edit", + base_logger=base_logger, + ) + self.save = self.build_listener( + callback_id=callback_id, + app_name=app_name, + listener_or_functions=save, + name="save", + base_logger=base_logger, + ) + self.execute = self.build_listener( + callback_id=callback_id, + app_name=app_name, + listener_or_functions=execute, + name="execute", + base_logger=base_logger, + ) @classmethod - def builder(cls, callback_id: Union[str, Pattern]) -> WorkflowStepBuilder: - return WorkflowStepBuilder(callback_id) + def builder( + cls, callback_id: Union[str, Pattern], base_logger: Optional[Logger] = None + ) -> WorkflowStepBuilder: + return WorkflowStepBuilder( + callback_id, + base_logger=base_logger, + ) @classmethod def build_listener( @@ -323,6 +373,7 @@ def build_listener( name: str, matchers: Optional[List[ListenerMatcher]] = None, middleware: Optional[List[Middleware]] = None, + base_logger: Optional[Logger] = None, ) -> Listener: if listener_or_functions is None: raise BoltError(f"{name} listener is required (callback_id: {callback_id})") @@ -334,9 +385,23 @@ def build_listener( return listener_or_functions elif isinstance(listener_or_functions, list): matchers = matchers if matchers else [] - matchers.insert(0, cls._build_primary_matcher(name, callback_id)) + matchers.insert( + 0, + cls._build_primary_matcher( + name, + callback_id, + base_logger=base_logger, + ), + ) middleware = middleware if middleware else [] - middleware.insert(0, cls._build_single_middleware(name, callback_id)) + middleware.insert( + 0, + cls._build_single_middleware( + name, + callback_id, + base_logger=base_logger, + ), + ) functions = listener_or_functions ack_function = functions.pop(0) return CustomListener( @@ -346,6 +411,7 @@ def build_listener( ack_function=ack_function, lazy_functions=functions, auto_acknowledgement=name == "execute", + base_logger=base_logger, ) else: raise BoltError( @@ -353,24 +419,34 @@ def build_listener( ) @classmethod - def _build_primary_matcher(cls, name, callback_id) -> ListenerMatcher: + def _build_primary_matcher( + cls, + name: str, + callback_id: Union[str, Pattern], + base_logger: Optional[Logger] = None, + ) -> ListenerMatcher: if name == "edit": - return workflow_step_edit(callback_id) + return workflow_step_edit(callback_id, base_logger=base_logger) elif name == "save": - return workflow_step_save(callback_id) + return workflow_step_save(callback_id, base_logger=base_logger) elif name == "execute": - return workflow_step_execute(callback_id) + return workflow_step_execute(callback_id, base_logger=base_logger) else: raise ValueError(f"Invalid name {name}") @classmethod - def _build_single_middleware(cls, name, callback_id) -> Middleware: + def _build_single_middleware( + cls, + name: str, + callback_id: Union[str, Pattern], + base_logger: Optional[Logger] = None, + ) -> Middleware: if name == "edit": - return _build_edit_listener_middleware(callback_id) + return _build_edit_listener_middleware(callback_id, base_logger=base_logger) elif name == "save": - return _build_save_listener_middleware() + return _build_save_listener_middleware(base_logger=base_logger) elif name == "execute": - return _build_execute_listener_middleware() + return _build_execute_listener_middleware(base_logger=base_logger) else: raise ValueError(f"Invalid name {name}") @@ -380,7 +456,9 @@ def _build_single_middleware(cls, name, callback_id) -> Middleware: ####################### -def _build_edit_listener_middleware(callback_id: str) -> Middleware: +def _build_edit_listener_middleware( + callback_id: str, base_logger: Optional[Logger] = None +) -> Middleware: def edit_listener_middleware( context: BoltContext, client: WebClient, @@ -394,7 +472,11 @@ def edit_listener_middleware( ) return next() - return CustomMiddleware(app_name=__name__, func=edit_listener_middleware) + return CustomMiddleware( + app_name=__name__, + func=edit_listener_middleware, + base_logger=base_logger, + ) ####################### @@ -402,7 +484,7 @@ def edit_listener_middleware( ####################### -def _build_save_listener_middleware() -> Middleware: +def _build_save_listener_middleware(base_logger: Optional[Logger] = None) -> Middleware: def save_listener_middleware( context: BoltContext, client: WebClient, @@ -415,7 +497,11 @@ def save_listener_middleware( ) return next() - return CustomMiddleware(app_name=__name__, func=save_listener_middleware) + return CustomMiddleware( + app_name=__name__, + func=save_listener_middleware, + base_logger=base_logger, + ) ####################### @@ -423,7 +509,9 @@ def save_listener_middleware( ####################### -def _build_execute_listener_middleware() -> Middleware: +def _build_execute_listener_middleware( + base_logger: Optional[Logger] = None, +) -> Middleware: def execute_listener_middleware( context: BoltContext, client: WebClient, @@ -440,4 +528,8 @@ def execute_listener_middleware( ) return next() - return CustomMiddleware(app_name=__name__, func=execute_listener_middleware) + return CustomMiddleware( + app_name=__name__, + func=execute_listener_middleware, + base_logger=base_logger, + ) diff --git a/tests/scenario_tests/test_app.py b/tests/scenario_tests/test_app.py index 86e89c9e9..61d86659c 100644 --- a/tests/scenario_tests/test_app.py +++ b/tests/scenario_tests/test_app.py @@ -1,3 +1,5 @@ +import logging +import time from concurrent.futures import Executor from ssl import SSLContext @@ -259,26 +261,6 @@ def test_proxy_ssl_for_respond(self): ), ) - event_body = { - "token": "verification_token", - "team_id": "T111", - "enterprise_id": "E111", - "api_app_id": "A111", - "event": { - "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", - "type": "app_mention", - "text": "<@W111> Hi there!", - "user": "W222", - "ts": "1595926230.009600", - "team": "T111", - "channel": "C111", - "event_ts": "1595926230.009600", - }, - "type": "event_callback", - "event_id": "Ev111", - "event_time": 1595926230, - } - result = {"called": False} @app.event("app_mention") @@ -289,7 +271,84 @@ def handle(context: BoltContext, respond): assert respond.ssl == ssl result["called"] = True - req = BoltRequest(body=event_body, headers={}, mode="socket_mode") + req = BoltRequest(body=app_mention_event_body, headers={}, mode="socket_mode") response = app.dispatch(req) assert response.status == 200 assert result["called"] is True + + def test_argument_logger_propagation(self): + custom_logger = logging.getLogger(f"{__name__}-{time.time()}-logger-test") + custom_logger.setLevel(logging.INFO) + added_handler = logging.NullHandler() + custom_logger.addHandler(added_handler) + added_filter = logging.Filter() + custom_logger.addFilter(added_filter) + + app = App( + signing_secret="valid", + client=WebClient( + token=self.valid_token, + base_url=self.mock_api_server_base_url, + ), + authorize=lambda: AuthorizeResult( + enterprise_id="E111", + team_id="T111", + ), + logger=custom_logger, + ) + result = {"called": False} + + def _verify_logger(logger: logging.Logger): + assert logger.level == custom_logger.level + assert len(logger.handlers) == len(custom_logger.handlers) + assert logger.handlers[-1] == custom_logger.handlers[-1] + assert len(logger.filters) == len(custom_logger.filters) + assert logger.filters[-1] == custom_logger.filters[-1] + + @app.use + def global_middleware(logger, next): + _verify_logger(logger) + next() + + def listener_middleware(logger, next): + _verify_logger(logger) + next() + + def listener_matcher(logger): + _verify_logger(logger) + return True + + @app.event( + "app_mention", + middleware=[listener_middleware], + matchers=[listener_matcher], + ) + def handle(logger: logging.Logger): + _verify_logger(logger) + result["called"] = True + + req = BoltRequest(body=app_mention_event_body, headers={}, mode="socket_mode") + response = app.dispatch(req) + assert response.status == 200 + assert result["called"] is True + + +app_mention_event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "team": "T111", + "channel": "C111", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, +} diff --git a/tests/scenario_tests/test_workflow_steps.py b/tests/scenario_tests/test_workflow_steps.py index 38cc803c3..95fc0379f 100644 --- a/tests/scenario_tests/test_workflow_steps.py +++ b/tests/scenario_tests/test_workflow_steps.py @@ -1,4 +1,5 @@ import json +import logging import time as time_module from time import time from urllib.parse import quote @@ -168,6 +169,65 @@ def test_execute_process_before_response(self): response = app.dispatch(request) assert response.status == 404 + def test_custom_logger_propagation(self): + custom_logger = logging.getLogger(f"{__name__}-{time()}-logger-test") + custom_logger.setLevel(logging.INFO) + added_handler = logging.NullHandler() + custom_logger.addHandler(added_handler) + added_filter = logging.Filter() + custom_logger.addFilter(added_filter) + + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + logger=custom_logger, + ) + + def verify_logger_is_properly_passed(ack: Ack, logger: logging.Logger): + assert logger.level == custom_logger.level + assert len(logger.handlers) == len(custom_logger.handlers) + assert logger.handlers[-1] == custom_logger.handlers[-1] + assert len(logger.filters) == len(custom_logger.filters) + assert logger.filters[-1] == custom_logger.filters[-1] + ack() + + app.step( + callback_id="copy_review", + edit=verify_logger_is_properly_passed, + save=verify_logger_is_properly_passed, + execute=verify_logger_is_properly_passed, + ) + + timestamp, body = str(int(time())), f"payload={quote(json.dumps(edit_payload))}" + headers = { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request: BoltRequest = BoltRequest(body=body, headers=headers) + response = app.dispatch(request) + assert response.status == 200 + + timestamp, body = str(int(time())), f"payload={quote(json.dumps(save_payload))}" + headers = { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request: BoltRequest = BoltRequest(body=body, headers=headers) + response = app.dispatch(request) + assert response.status == 200 + + timestamp, body = str(int(time())), json.dumps(execute_payload) + headers = { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request: BoltRequest = BoltRequest(body=body, headers=headers) + response = app.dispatch(request) + assert response.status == 200 + edit_payload = { "type": "workflow_step_edit", diff --git a/tests/scenario_tests/test_workflow_steps_decorator_with_args.py b/tests/scenario_tests/test_workflow_steps_decorator_with_args.py index 32f334c14..2d4ea5907 100644 --- a/tests/scenario_tests/test_workflow_steps_decorator_with_args.py +++ b/tests/scenario_tests/test_workflow_steps_decorator_with_args.py @@ -1,4 +1,5 @@ import json +import logging import time as time_module from time import time from urllib.parse import quote @@ -97,6 +98,44 @@ def test_execute(self): response = self.app.dispatch(request) assert response.status == 404 + def test_logger_propagation(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + logger=custom_logger, + ) + app.step(logger_test_step) + + timestamp, body = str(int(time())), f"payload={quote(json.dumps(edit_payload))}" + headers = { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request: BoltRequest = BoltRequest(body=body, headers=headers) + response = app.dispatch(request) + assert response.status == 200 + + timestamp, body = str(int(time())), f"payload={quote(json.dumps(save_payload))}" + headers = { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request: BoltRequest = BoltRequest(body=body, headers=headers) + response = app.dispatch(request) + assert response.status == 200 + + timestamp, body = str(int(time())), json.dumps(execute_payload) + headers = { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request: BoltRequest = BoltRequest(body=body, headers=headers) + response = app.dispatch(request) + assert response.status == 200 + edit_payload = { "type": "workflow_step_edit", @@ -273,6 +312,10 @@ def test_execute(self): } +# +# The normal pattern tests +# + # https://api.slack.com/tutorials/workflow-builder-steps @@ -427,3 +470,64 @@ def execute(step: dict, client: WebClient, complete: Complete, fail: Fail): ) except Exception as err: fail(error={"message": f"Something wrong! {err}"}) + + +# +# Logger propagation tests +# + +custom_logger = logging.getLogger(f"{__name__}-{time()}-logger-test") +custom_logger.setLevel(logging.INFO) +added_handler = logging.NullHandler() +custom_logger.addHandler(added_handler) +added_filter = logging.Filter() +custom_logger.addFilter(added_filter) + +logger_test_step = WorkflowStep.builder( + "copy_review", + base_logger=custom_logger, # to pass this logger to middleware / middleware matchers +) + + +def _verify_logger(logger: logging.Logger): + assert logger.level == custom_logger.level + assert len(logger.handlers) == len(custom_logger.handlers) + assert logger.handlers[-1] == custom_logger.handlers[-1] + assert len(logger.filters) == len(custom_logger.filters) + assert logger.filters[-1] == custom_logger.filters[-1] + + +def logger_middleware(next, logger): + _verify_logger(logger) + next() + + +def logger_matcher(logger): + _verify_logger(logger) + return True + + +@logger_test_step.edit( + middleware=[logger_middleware], + matchers=[logger_matcher], +) +def edit_for_logger_test(ack: Ack, logger: logging.Logger): + _verify_logger(logger) + ack() + + +@logger_test_step.save( + middleware=[logger_middleware], + matchers=[logger_matcher], +) +def save_for_logger_test(ack: Ack, logger: logging.Logger): + _verify_logger(logger) + ack() + + +@logger_test_step.execute( + middleware=[logger_middleware], + matchers=[logger_matcher], +) +def execute_for_logger_test(logger: logging.Logger): + _verify_logger(logger) diff --git a/tests/scenario_tests_async/test_app.py b/tests/scenario_tests_async/test_app.py index 7486027fe..3a756d533 100644 --- a/tests/scenario_tests_async/test_app.py +++ b/tests/scenario_tests_async/test_app.py @@ -1,4 +1,5 @@ import asyncio +import logging from ssl import SSLContext import pytest @@ -193,45 +194,17 @@ def test_installation_store_conflicts(self): @pytest.mark.asyncio async def test_proxy_ssl_for_respond(self): ssl = SSLContext() - web_client = AsyncWebClient( - token=self.valid_token, - base_url=self.mock_api_server_base_url, - proxy="http://proxy-host:9000/", - ssl=ssl, - ) - - async def my_authorize(): - return AuthorizeResult( - enterprise_id="E111", - team_id="T111", - ) - app = AsyncApp( signing_secret="valid", - client=web_client, + client=AsyncWebClient( + token=self.valid_token, + base_url=self.mock_api_server_base_url, + proxy="http://proxy-host:9000/", + ssl=ssl, + ), authorize=my_authorize, ) - event_body = { - "token": "verification_token", - "team_id": "T111", - "enterprise_id": "E111", - "api_app_id": "A111", - "event": { - "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", - "type": "app_mention", - "text": "<@W111> Hi there!", - "user": "W222", - "ts": "1595926230.009600", - "team": "T111", - "channel": "C111", - "event_ts": "1595926230.009600", - }, - "type": "event_callback", - "event_id": "Ev111", - "event_time": 1595926230, - } - result = {"called": False} @app.event("app_mention") @@ -242,8 +215,102 @@ async def handle(context: AsyncBoltContext, respond): assert respond.ssl == ssl result["called"] = True - req = AsyncBoltRequest(body=event_body, headers={}, mode="socket_mode") + req = AsyncBoltRequest( + body=app_mention_event_body, headers={}, mode="socket_mode" + ) response = await app.async_dispatch(req) assert response.status == 200 await asyncio.sleep(0.5) # wait a bit after auto ack() assert result["called"] is True + + @pytest.mark.asyncio + async def test_argument_logger_propagation(self): + import time + + custom_logger = logging.getLogger(f"{__name__}-{time.time()}-async-logger-test") + custom_logger.setLevel(logging.INFO) + added_handler = logging.NullHandler() + custom_logger.addHandler(added_handler) + added_filter = logging.Filter() + custom_logger.addFilter(added_filter) + + app = AsyncApp( + signing_secret="valid", + client=AsyncWebClient( + token=self.valid_token, + base_url=self.mock_api_server_base_url, + ), + authorize=my_authorize, + logger=custom_logger, + ) + + result = {"called": False} + + def _verify_logger(logger: logging.Logger): + assert logger.level == custom_logger.level + assert len(logger.handlers) == len(custom_logger.handlers) + # TODO: this assertion fails only with codecov + # assert logger.handlers[-1] == custom_logger.handlers[-1] + assert logger.handlers[-1].name == custom_logger.handlers[-1].name + assert len(logger.filters) == len(custom_logger.filters) + # TODO: this assertion fails only with codecov + # assert logger.filters[-1] == custom_logger.filters[-1] + assert logger.filters[-1].name == custom_logger.filters[-1].name + + @app.use + async def global_middleware(logger, next): + _verify_logger(logger) + await next() + + async def listener_middleware(logger, next): + _verify_logger(logger) + await next() + + async def listener_matcher(logger): + _verify_logger(logger) + return True + + @app.event( + "app_mention", + middleware=[listener_middleware], + matchers=[listener_matcher], + ) + async def handle(logger: logging.Logger): + _verify_logger(logger) + result["called"] = True + + req = AsyncBoltRequest( + body=app_mention_event_body, headers={}, mode="socket_mode" + ) + response = await app.async_dispatch(req) + assert response.status == 200 + await asyncio.sleep(0.5) # wait a bit after auto ack() + assert result["called"] is True + + +async def my_authorize(): + return AuthorizeResult( + enterprise_id="E111", + team_id="T111", + ) + + +app_mention_event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "team": "T111", + "channel": "C111", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, +} diff --git a/tests/scenario_tests_async/test_workflow_steps.py b/tests/scenario_tests_async/test_workflow_steps.py index cf88d46b4..ca3390ac3 100644 --- a/tests/scenario_tests_async/test_workflow_steps.py +++ b/tests/scenario_tests_async/test_workflow_steps.py @@ -1,5 +1,6 @@ import asyncio import json +import logging from time import time from urllib.parse import quote @@ -188,6 +189,68 @@ async def test_execute_process_before_response(self): response = await app.async_dispatch(request) assert response.status == 404 + @pytest.mark.asyncio + async def test_custom_logger_propagation(self): + custom_logger = logging.getLogger(f"{__name__}-{time()}-async-logger-test") + custom_logger.setLevel(logging.INFO) + added_handler = logging.NullHandler() + custom_logger.addHandler(added_handler) + added_filter = logging.Filter() + custom_logger.addFilter(added_filter) + + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + logger=custom_logger, + ) + + async def verify_logger_is_properly_passed( + ack: AsyncAck, logger: logging.Logger + ): + assert logger.level == custom_logger.level + assert len(logger.handlers) == len(custom_logger.handlers) + assert logger.handlers[-1] == custom_logger.handlers[-1] + assert len(logger.filters) == len(custom_logger.filters) + assert logger.filters[-1] == custom_logger.filters[-1] + await ack() + + app.step( + callback_id="copy_review", + edit=verify_logger_is_properly_passed, + save=verify_logger_is_properly_passed, + execute=verify_logger_is_properly_passed, + ) + + timestamp, body = str(int(time())), f"payload={quote(json.dumps(edit_payload))}" + headers = { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request: AsyncBoltRequest = AsyncBoltRequest(body=body, headers=headers) + response = await app.async_dispatch(request) + assert response.status == 200 + + timestamp, body = str(int(time())), f"payload={quote(json.dumps(save_payload))}" + headers = { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request: AsyncBoltRequest = AsyncBoltRequest(body=body, headers=headers) + response = await app.async_dispatch(request) + assert response.status == 200 + + timestamp, body = str(int(time())), json.dumps(execute_payload) + headers = { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request: AsyncBoltRequest = AsyncBoltRequest(body=body, headers=headers) + response = await app.async_dispatch(request) + assert response.status == 200 + edit_payload = { "type": "workflow_step_edit", diff --git a/tests/scenario_tests_async/test_workflow_steps_decorator_with_args.py b/tests/scenario_tests_async/test_workflow_steps_decorator_with_args.py index 1db6c8b2d..759b8de8c 100644 --- a/tests/scenario_tests_async/test_workflow_steps_decorator_with_args.py +++ b/tests/scenario_tests_async/test_workflow_steps_decorator_with_args.py @@ -1,5 +1,6 @@ import asyncio import json +import logging from time import time from urllib.parse import quote @@ -118,6 +119,46 @@ async def test_execute(self): response = await self.app.async_dispatch(request) assert response.status == 404 + @pytest.mark.asyncio + async def test_logger_propagation(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + logger=custom_logger, + ) + app.step(logger_test_step) + + timestamp, body = str(int(time())), f"payload={quote(json.dumps(edit_payload))}" + headers = { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request = AsyncBoltRequest(body=body, headers=headers) + response = await self.app.async_dispatch(request) + assert response.status == 200 + + timestamp, body = str(int(time())), f"payload={quote(json.dumps(save_payload))}" + headers = { + "content-type": ["application/x-www-form-urlencoded"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request = AsyncBoltRequest(body=body, headers=headers) + response = await self.app.async_dispatch(request) + assert response.status == 200 + + timestamp, body = str(int(time())), json.dumps(execute_payload) + headers = { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + request = AsyncBoltRequest(body=body, headers=headers) + response = await self.app.async_dispatch(request) + assert response.status == 200 + await asyncio.sleep(0.5) # wait for the completion + edit_payload = { "type": "workflow_step_edit", @@ -293,6 +334,9 @@ async def test_execute(self): "event_time": 1601541373, } +# +# The normal pattern tests +# # https://api.slack.com/tutorials/workflow-builder-steps @@ -449,3 +493,64 @@ async def execute( ) except Exception as err: await fail(error={"message": f"Something wrong! {err}"}) + + +# +# Logger propagation tests +# + +custom_logger = logging.getLogger(f"{__name__}-{time()}-async-logger-test") +custom_logger.setLevel(logging.INFO) +added_handler = logging.NullHandler() +custom_logger.addHandler(added_handler) +added_filter = logging.Filter() +custom_logger.addFilter(added_filter) + +logger_test_step = AsyncWorkflowStep.builder( + "copy_review", + base_logger=custom_logger, # to pass this logger to middleware / middleware matchers +) + + +def _verify_logger(logger: logging.Logger): + assert logger.level == custom_logger.level + assert len(logger.handlers) == len(custom_logger.handlers) + assert logger.handlers[-1] == custom_logger.handlers[-1] + assert len(logger.filters) == len(custom_logger.filters) + assert logger.filters[-1] == custom_logger.filters[-1] + + +async def logger_middleware(next, logger): + _verify_logger(logger) + await next() + + +async def logger_matcher(logger): + _verify_logger(logger) + return True + + +@logger_test_step.edit( + middleware=[logger_middleware], + matchers=[logger_matcher], +) +async def edit_for_logger_test(ack: AsyncAck, logger: logging.Logger): + _verify_logger(logger) + await ack() + + +@logger_test_step.save( + middleware=[logger_middleware], + matchers=[logger_matcher], +) +async def save_for_logger_test(ack: AsyncAck, logger: logging.Logger): + _verify_logger(logger) + await ack() + + +@logger_test_step.execute( + middleware=[logger_middleware], + matchers=[logger_matcher], +) +async def execute_for_logger_test(logger: logging.Logger): + _verify_logger(logger) From 89883bdf2c9fc98a141f111232c81bfda8f08f45 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 18 Mar 2022 21:40:02 +0900 Subject: [PATCH 318/719] version 1.13.0 --- .../adapter/aws_lambda/chalice_handler.html | 8 +- .../adapter/aws_lambda/handler.html | 4 +- docs/api-docs/slack_bolt/app/app.html | 337 +++++++++++++----- docs/api-docs/slack_bolt/app/async_app.html | 336 ++++++++++++----- .../slack_bolt/listener/async_listener.html | 13 +- .../slack_bolt/listener/custom_listener.html | 8 +- .../listener_matcher/async_builtins.html | 2 +- .../async_listener_matcher.html | 36 +- .../slack_bolt/listener_matcher/builtins.html | 213 +++++++---- .../custom_listener_matcher.html | 24 +- docs/api-docs/slack_bolt/logger/index.html | 84 +++-- .../middleware/async_custom_middleware.html | 24 +- .../async_multi_teams_authorization.html | 21 +- .../async_single_team_authorization.html | 16 +- .../multi_teams_authorization.html | 15 +- .../single_team_authorization.html | 27 +- .../middleware/custom_middleware.html | 16 +- .../async_ignoring_self_events.html | 1 + .../ignoring_self_events.html | 11 +- .../async_request_verification.html | 4 +- .../request_verification.html | 17 +- .../middleware/ssl_check/async_ssl_check.html | 4 +- .../middleware/ssl_check/ssl_check.html | 22 +- .../async_url_verification.html | 19 +- .../url_verification/url_verification.html | 25 +- docs/api-docs/slack_bolt/version.html | 2 +- .../slack_bolt/workflows/step/async_step.html | 227 +++++++++--- .../slack_bolt/workflows/step/step.html | 332 +++++++++++++---- slack_bolt/version.py | 2 +- 29 files changed, 1379 insertions(+), 471 deletions(-) diff --git a/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html b/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html index 53132d9a8..74c7de367 100644 --- a/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html +++ b/docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html @@ -49,7 +49,9 @@

    Module slack_bolt.adapter.aws_lambda.chalice_handlerClasses

    def __init__(self, app: App, chalice: Chalice, lambda_client: Optional[BaseClient] = None): # type: ignore self.app = app self.chalice = chalice - self.logger = get_bolt_app_logger(app.name, ChaliceSlackRequestHandler) + self.logger = get_bolt_app_logger( + app.name, ChaliceSlackRequestHandler, app.logger + ) if getenv("AWS_CHALICE_CLI_MODE") == "true" and lambda_client is None: try: diff --git a/docs/api-docs/slack_bolt/adapter/aws_lambda/handler.html b/docs/api-docs/slack_bolt/adapter/aws_lambda/handler.html index ec31815d9..144301b9f 100644 --- a/docs/api-docs/slack_bolt/adapter/aws_lambda/handler.html +++ b/docs/api-docs/slack_bolt/adapter/aws_lambda/handler.html @@ -42,7 +42,7 @@

    Module slack_bolt.adapter.aws_lambda.handler

    class SlackRequestHandler: def __init__(self, app: App): # type: ignore self.app = app - self.logger = get_bolt_app_logger(app.name, SlackRequestHandler) + self.logger = get_bolt_app_logger(app.name, SlackRequestHandler, app.logger) self.app.listener_runner.lazy_listener_runner = LambdaLazyListenerRunner( self.logger ) @@ -228,7 +228,7 @@

    Classes

    class SlackRequestHandler:
         def __init__(self, app: App):  # type: ignore
             self.app = app
    -        self.logger = get_bolt_app_logger(app.name, SlackRequestHandler)
    +        self.logger = get_bolt_app_logger(app.name, SlackRequestHandler, app.logger)
             self.app.listener_runner.lazy_listener_runner = LambdaLazyListenerRunner(
                 self.logger
             )
    diff --git a/docs/api-docs/slack_bolt/app/app.html b/docs/api-docs/slack_bolt/app/app.html
    index 1d80827e2..e49fe3d59 100644
    --- a/docs/api-docs/slack_bolt/app/app.html
    +++ b/docs/api-docs/slack_bolt/app/app.html
    @@ -217,6 +217,11 @@ 

    Module slack_bolt.app.app

    self._verification_token: Optional[str] = verification_token or os.environ.get( "SLACK_VERIFICATION_TOKEN", None ) + # If a logger is explicitly passed when initializing, the logger works as the base logger. + # The base logger's logging settings will be propagated to all the loggers created by bolt-python. + self._base_logger = logger + # The framework logger is supposed to be used for the internal logging. + # Also, it's accessible via `app.logger` as the app's singleton logger. self._framework_logger = logger or get_bolt_logger(App) self._raise_error_for_unhandled_request = raise_error_for_unhandled_request @@ -384,10 +389,15 @@

    Module slack_bolt.app.app

    return if ssl_check_enabled is True: self._middleware_list.append( - SslCheck(verification_token=self._verification_token) + SslCheck( + verification_token=self._verification_token, + base_logger=self._base_logger, + ) ) if request_verification_enabled is True: - self._middleware_list.append(RequestVerification(self._signing_secret)) + self._middleware_list.append( + RequestVerification(self._signing_secret, base_logger=self._base_logger) + ) # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._oauth_flow is None: @@ -398,24 +408,33 @@

    Module slack_bolt.app.app

    # This API call is for eagerly validating the token auth_test_result = self._client.auth_test(token=self._token) self._middleware_list.append( - SingleTeamAuthorization(auth_test_result=auth_test_result) + SingleTeamAuthorization( + auth_test_result=auth_test_result, + base_logger=self._base_logger, + ) ) except SlackApiError as err: raise BoltError(error_auth_test_failure(err.response)) elif self._authorize is not None: self._middleware_list.append( - MultiTeamsAuthorization(authorize=self._authorize) + MultiTeamsAuthorization( + authorize=self._authorize, base_logger=self._base_logger + ) ) else: raise BoltError(error_token_required()) else: self._middleware_list.append( - MultiTeamsAuthorization(authorize=self._authorize) + MultiTeamsAuthorization( + authorize=self._authorize, base_logger=self._base_logger + ) ) if ignoring_self_events_enabled is True: - self._middleware_list.append(IgnoringSelfEvents()) + self._middleware_list.append( + IgnoringSelfEvents(base_logger=self._base_logger) + ) if url_verification_enabled is True: - self._middleware_list.append(UrlVerification()) + self._middleware_list.append(UrlVerification(base_logger=self._base_logger)) self._init_middleware_list_done = True # ------------------------- @@ -644,7 +663,11 @@

    Module slack_bolt.app.app

    self._middleware_list.append(middleware) elif isinstance(middleware_or_callable, Callable): self._middleware_list.append( - CustomMiddleware(app_name=self.name, func=middleware_or_callable) + CustomMiddleware( + app_name=self.name, + func=middleware_or_callable, + base_logger=self._base_logger, + ) ) return middleware_or_callable else: @@ -705,9 +728,10 @@

    Module slack_bolt.app.app

    edit=edit, save=save, execute=execute, + base_logger=self._base_logger, ) elif isinstance(step, WorkflowStepBuilder): - step = step.build() + step = step.build(base_logger=self._base_logger) elif not isinstance(step, WorkflowStep): raise BoltError(f"Invalid step object ({type(step)})") @@ -752,7 +776,9 @@

    Module slack_bolt.app.app

    def event( self, event: Union[ - str, Pattern, Dict[str, Union[str, Sequence[Optional[Union[str, Pattern]]]]] + str, + Pattern, + Dict[str, Optional[Union[str, Sequence[Optional[Union[str, Pattern]]]]]], ], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, @@ -785,7 +811,9 @@

    Module slack_bolt.app.app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.event(event) + primary_matcher = builtin_matchers.event( + event, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware, True ) @@ -840,7 +868,7 @@

    Module slack_bolt.app.app

    ), } primary_matcher = builtin_matchers.message_event( - keyword=keyword, constraints=constraints + keyword=keyword, constraints=constraints, base_logger=self._base_logger ) middleware.insert(0, MessageListenerMatches(keyword)) return self._register_listener( @@ -885,7 +913,9 @@

    Module slack_bolt.app.app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.command(command) + primary_matcher = builtin_matchers.command( + command, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -934,7 +964,9 @@

    Module slack_bolt.app.app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.shortcut(constraints) + primary_matcher = builtin_matchers.shortcut( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -951,7 +983,9 @@

    Module slack_bolt.app.app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.global_shortcut(callback_id) + primary_matcher = builtin_matchers.global_shortcut( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -968,7 +1002,9 @@

    Module slack_bolt.app.app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.message_shortcut(callback_id) + primary_matcher = builtin_matchers.message_shortcut( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1010,7 +1046,9 @@

    Module slack_bolt.app.app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.action(constraints) + primary_matcher = builtin_matchers.action( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1029,7 +1067,9 @@

    Module slack_bolt.app.app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.block_action(constraints) + primary_matcher = builtin_matchers.block_action( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1047,7 +1087,9 @@

    Module slack_bolt.app.app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.attachment_action(callback_id) + primary_matcher = builtin_matchers.attachment_action( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1065,7 +1107,9 @@

    Module slack_bolt.app.app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_submission(callback_id) + primary_matcher = builtin_matchers.dialog_submission( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1083,7 +1127,9 @@

    Module slack_bolt.app.app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_cancellation(callback_id) + primary_matcher = builtin_matchers.dialog_cancellation( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1136,7 +1182,9 @@

    Module slack_bolt.app.app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view(constraints) + primary_matcher = builtin_matchers.view( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1154,7 +1202,9 @@

    Module slack_bolt.app.app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view_submission(constraints) + primary_matcher = builtin_matchers.view_submission( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1172,7 +1222,9 @@

    Module slack_bolt.app.app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view_closed(constraints) + primary_matcher = builtin_matchers.view_closed( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1225,7 +1277,9 @@

    Module slack_bolt.app.app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.options(constraints) + primary_matcher = builtin_matchers.options( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1242,7 +1296,9 @@

    Module slack_bolt.app.app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.block_suggestion(action_id) + primary_matcher = builtin_matchers.block_suggestion( + action_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1260,7 +1316,9 @@

    Module slack_bolt.app.app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_suggestion(callback_id) + primary_matcher = builtin_matchers.dialog_suggestion( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1291,7 +1349,9 @@

    Module slack_bolt.app.app

    # ------------------------- def _init_context(self, req: BoltRequest): - req.context["logger"] = get_bolt_app_logger(self.name) + req.context["logger"] = get_bolt_app_logger( + app_name=self.name, base_logger=self._base_logger + ) req.context["token"] = self._token if self._token is not None: # This WebClient instance can be safely singleton @@ -1337,7 +1397,10 @@

    Module slack_bolt.app.app

    value_to_return = functions[0] listener_matchers = [ - CustomListenerMatcher(app_name=self.name, func=f) for f in (matchers or []) + CustomListenerMatcher( + app_name=self.name, func=f, base_logger=self._base_logger + ) + for f in (matchers or []) ] listener_matchers.insert(0, primary_matcher) listener_middleware = [] @@ -1345,7 +1408,11 @@

    Module slack_bolt.app.app

    if isinstance(m, Middleware): listener_middleware.append(m) elif isinstance(m, Callable): - listener_middleware.append(CustomMiddleware(app_name=self.name, func=m)) + listener_middleware.append( + CustomMiddleware( + app_name=self.name, func=m, base_logger=self._base_logger + ) + ) else: raise ValueError(error_unexpected_listener_middleware(type(m))) @@ -1357,6 +1424,7 @@

    Module slack_bolt.app.app

    matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, + base_logger=self._base_logger, ) ) return value_to_return @@ -1685,6 +1753,11 @@

    Args

    self._verification_token: Optional[str] = verification_token or os.environ.get( "SLACK_VERIFICATION_TOKEN", None ) + # If a logger is explicitly passed when initializing, the logger works as the base logger. + # The base logger's logging settings will be propagated to all the loggers created by bolt-python. + self._base_logger = logger + # The framework logger is supposed to be used for the internal logging. + # Also, it's accessible via `app.logger` as the app's singleton logger. self._framework_logger = logger or get_bolt_logger(App) self._raise_error_for_unhandled_request = raise_error_for_unhandled_request @@ -1852,10 +1925,15 @@

    Args

    return if ssl_check_enabled is True: self._middleware_list.append( - SslCheck(verification_token=self._verification_token) + SslCheck( + verification_token=self._verification_token, + base_logger=self._base_logger, + ) ) if request_verification_enabled is True: - self._middleware_list.append(RequestVerification(self._signing_secret)) + self._middleware_list.append( + RequestVerification(self._signing_secret, base_logger=self._base_logger) + ) # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._oauth_flow is None: @@ -1866,24 +1944,33 @@

    Args

    # This API call is for eagerly validating the token auth_test_result = self._client.auth_test(token=self._token) self._middleware_list.append( - SingleTeamAuthorization(auth_test_result=auth_test_result) + SingleTeamAuthorization( + auth_test_result=auth_test_result, + base_logger=self._base_logger, + ) ) except SlackApiError as err: raise BoltError(error_auth_test_failure(err.response)) elif self._authorize is not None: self._middleware_list.append( - MultiTeamsAuthorization(authorize=self._authorize) + MultiTeamsAuthorization( + authorize=self._authorize, base_logger=self._base_logger + ) ) else: raise BoltError(error_token_required()) else: self._middleware_list.append( - MultiTeamsAuthorization(authorize=self._authorize) + MultiTeamsAuthorization( + authorize=self._authorize, base_logger=self._base_logger + ) ) if ignoring_self_events_enabled is True: - self._middleware_list.append(IgnoringSelfEvents()) + self._middleware_list.append( + IgnoringSelfEvents(base_logger=self._base_logger) + ) if url_verification_enabled is True: - self._middleware_list.append(UrlVerification()) + self._middleware_list.append(UrlVerification(base_logger=self._base_logger)) self._init_middleware_list_done = True # ------------------------- @@ -2112,7 +2199,11 @@

    Args

    self._middleware_list.append(middleware) elif isinstance(middleware_or_callable, Callable): self._middleware_list.append( - CustomMiddleware(app_name=self.name, func=middleware_or_callable) + CustomMiddleware( + app_name=self.name, + func=middleware_or_callable, + base_logger=self._base_logger, + ) ) return middleware_or_callable else: @@ -2173,9 +2264,10 @@

    Args

    edit=edit, save=save, execute=execute, + base_logger=self._base_logger, ) elif isinstance(step, WorkflowStepBuilder): - step = step.build() + step = step.build(base_logger=self._base_logger) elif not isinstance(step, WorkflowStep): raise BoltError(f"Invalid step object ({type(step)})") @@ -2220,7 +2312,9 @@

    Args

    def event( self, event: Union[ - str, Pattern, Dict[str, Union[str, Sequence[Optional[Union[str, Pattern]]]]] + str, + Pattern, + Dict[str, Optional[Union[str, Sequence[Optional[Union[str, Pattern]]]]]], ], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, @@ -2253,7 +2347,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.event(event) + primary_matcher = builtin_matchers.event( + event, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware, True ) @@ -2308,7 +2404,7 @@

    Args

    ), } primary_matcher = builtin_matchers.message_event( - keyword=keyword, constraints=constraints + keyword=keyword, constraints=constraints, base_logger=self._base_logger ) middleware.insert(0, MessageListenerMatches(keyword)) return self._register_listener( @@ -2353,7 +2449,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.command(command) + primary_matcher = builtin_matchers.command( + command, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2402,7 +2500,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.shortcut(constraints) + primary_matcher = builtin_matchers.shortcut( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2419,7 +2519,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.global_shortcut(callback_id) + primary_matcher = builtin_matchers.global_shortcut( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2436,7 +2538,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.message_shortcut(callback_id) + primary_matcher = builtin_matchers.message_shortcut( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2478,7 +2582,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.action(constraints) + primary_matcher = builtin_matchers.action( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2497,7 +2603,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.block_action(constraints) + primary_matcher = builtin_matchers.block_action( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2515,7 +2623,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.attachment_action(callback_id) + primary_matcher = builtin_matchers.attachment_action( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2533,7 +2643,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_submission(callback_id) + primary_matcher = builtin_matchers.dialog_submission( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2551,7 +2663,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_cancellation(callback_id) + primary_matcher = builtin_matchers.dialog_cancellation( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2604,7 +2718,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view(constraints) + primary_matcher = builtin_matchers.view( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2622,7 +2738,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view_submission(constraints) + primary_matcher = builtin_matchers.view_submission( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2640,7 +2758,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view_closed(constraints) + primary_matcher = builtin_matchers.view_closed( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2693,7 +2813,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.options(constraints) + primary_matcher = builtin_matchers.options( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2710,7 +2832,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.block_suggestion(action_id) + primary_matcher = builtin_matchers.block_suggestion( + action_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2728,7 +2852,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_suggestion(callback_id) + primary_matcher = builtin_matchers.dialog_suggestion( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2759,7 +2885,9 @@

    Args

    # ------------------------- def _init_context(self, req: BoltRequest): - req.context["logger"] = get_bolt_app_logger(self.name) + req.context["logger"] = get_bolt_app_logger( + app_name=self.name, base_logger=self._base_logger + ) req.context["token"] = self._token if self._token is not None: # This WebClient instance can be safely singleton @@ -2805,7 +2933,10 @@

    Args

    value_to_return = functions[0] listener_matchers = [ - CustomListenerMatcher(app_name=self.name, func=f) for f in (matchers or []) + CustomListenerMatcher( + app_name=self.name, func=f, base_logger=self._base_logger + ) + for f in (matchers or []) ] listener_matchers.insert(0, primary_matcher) listener_middleware = [] @@ -2813,7 +2944,11 @@

    Args

    if isinstance(m, Middleware): listener_middleware.append(m) elif isinstance(m, Callable): - listener_middleware.append(CustomMiddleware(app_name=self.name, func=m)) + listener_middleware.append( + CustomMiddleware( + app_name=self.name, func=m, base_logger=self._base_logger + ) + ) else: raise ValueError(error_unexpected_listener_middleware(type(m))) @@ -2825,6 +2960,7 @@

    Args

    matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, + base_logger=self._base_logger, ) ) return value_to_return
    @@ -2990,7 +3126,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.action(constraints) + primary_matcher = builtin_matchers.action( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3019,7 +3157,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.attachment_action(callback_id) + primary_matcher = builtin_matchers.attachment_action( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3049,7 +3189,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.block_action(constraints) + primary_matcher = builtin_matchers.block_action( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3076,7 +3218,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.block_suggestion(action_id) + primary_matcher = builtin_matchers.block_suggestion( + action_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3150,7 +3294,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.command(command) + primary_matcher = builtin_matchers.command( + command, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3213,7 +3359,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_cancellation(callback_id) + primary_matcher = builtin_matchers.dialog_cancellation( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3242,7 +3390,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_submission(callback_id) + primary_matcher = builtin_matchers.dialog_submission( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3271,7 +3421,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_suggestion(callback_id) + primary_matcher = builtin_matchers.dialog_suggestion( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3479,7 +3631,7 @@

    Args

    -def event(self, event: Union[str, Pattern, Dict[str, Union[str, Sequence[Union[str, Pattern, ForwardRef(None)]]]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]] +def event(self, event: Union[str, Pattern, Dict[str, Union[str, Sequence[Union[str, Pattern, ForwardRef(None)]], ForwardRef(None)]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]

    Registers a new event listener. This method can be used as either a decorator or a method.

    @@ -3515,7 +3667,9 @@

    Args

    def event(
         self,
         event: Union[
    -        str, Pattern, Dict[str, Union[str, Sequence[Optional[Union[str, Pattern]]]]]
    +        str,
    +        Pattern,
    +        Dict[str, Optional[Union[str, Sequence[Optional[Union[str, Pattern]]]]]],
         ],
         matchers: Optional[Sequence[Callable[..., bool]]] = None,
         middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    @@ -3548,7 +3702,9 @@ 

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.event(event) + primary_matcher = builtin_matchers.event( + event, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware, True ) @@ -3575,7 +3731,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.global_shortcut(callback_id) + primary_matcher = builtin_matchers.global_shortcut( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3663,7 +3821,7 @@

    Args

    ), } primary_matcher = builtin_matchers.message_event( - keyword=keyword, constraints=constraints + keyword=keyword, constraints=constraints, base_logger=self._base_logger ) middleware.insert(0, MessageListenerMatches(keyword)) return self._register_listener( @@ -3692,7 +3850,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.message_shortcut(callback_id) + primary_matcher = builtin_matchers.message_shortcut( + callback_id, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3753,7 +3913,11 @@

    Args

    self._middleware_list.append(middleware) elif isinstance(middleware_or_callable, Callable): self._middleware_list.append( - CustomMiddleware(app_name=self.name, func=middleware_or_callable) + CustomMiddleware( + app_name=self.name, + func=middleware_or_callable, + base_logger=self._base_logger, + ) ) return middleware_or_callable else: @@ -3849,7 +4013,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.options(constraints) + primary_matcher = builtin_matchers.options( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3935,7 +4101,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.shortcut(constraints) + primary_matcher = builtin_matchers.shortcut( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -4084,9 +4252,10 @@

    Args

    edit=edit, save=save, execute=execute, + base_logger=self._base_logger, ) elif isinstance(step, WorkflowStepBuilder): - step = step.build() + step = step.build(base_logger=self._base_logger) elif not isinstance(step, WorkflowStep): raise BoltError(f"Invalid step object ({type(step)})") @@ -4196,7 +4365,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view(constraints) + primary_matcher = builtin_matchers.view( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -4225,7 +4396,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view_closed(constraints) + primary_matcher = builtin_matchers.view_closed( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -4254,7 +4427,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view_submission(constraints) + primary_matcher = builtin_matchers.view_submission( + constraints, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) diff --git a/docs/api-docs/slack_bolt/app/async_app.html b/docs/api-docs/slack_bolt/app/async_app.html index 52fe24ac6..d22e917ec 100644 --- a/docs/api-docs/slack_bolt/app/async_app.html +++ b/docs/api-docs/slack_bolt/app/async_app.html @@ -222,6 +222,11 @@

    Module slack_bolt.app.async_app

    self._verification_token: Optional[str] = verification_token or os.environ.get( "SLACK_VERIFICATION_TOKEN", None ) + # If a logger is explicitly passed when initializing, the logger works as the base logger. + # The base logger's logging settings will be propagated to all the loggers created by bolt-python. + self._base_logger = logger + # The framework logger is supposed to be used for the internal logging. + # Also, it's accessible via `app.logger` as the app's singleton logger. self._framework_logger = logger or get_bolt_logger(AsyncApp) self._raise_error_for_unhandled_request = raise_error_for_unhandled_request @@ -404,31 +409,46 @@

    Module slack_bolt.app.async_app

    return if ssl_check_enabled is True: self._async_middleware_list.append( - AsyncSslCheck(verification_token=self._verification_token) + AsyncSslCheck( + verification_token=self._verification_token, + base_logger=self._base_logger, + ) ) if request_verification_enabled is True: self._async_middleware_list.append( - AsyncRequestVerification(self._signing_secret) + AsyncRequestVerification( + self._signing_secret, base_logger=self._base_logger + ) ) # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._async_oauth_flow is None: if self._token: - self._async_middleware_list.append(AsyncSingleTeamAuthorization()) + self._async_middleware_list.append( + AsyncSingleTeamAuthorization(base_logger=self._base_logger) + ) elif self._async_authorize is not None: self._async_middleware_list.append( - AsyncMultiTeamsAuthorization(authorize=self._async_authorize) + AsyncMultiTeamsAuthorization( + authorize=self._async_authorize, base_logger=self._base_logger + ) ) else: raise BoltError(error_token_required()) else: self._async_middleware_list.append( - AsyncMultiTeamsAuthorization(authorize=self._async_authorize) + AsyncMultiTeamsAuthorization( + authorize=self._async_authorize, base_logger=self._base_logger + ) ) if ignoring_self_events_enabled is True: - self._async_middleware_list.append(AsyncIgnoringSelfEvents()) + self._async_middleware_list.append( + AsyncIgnoringSelfEvents(base_logger=self._base_logger) + ) if url_verification_enabled is True: - self._async_middleware_list.append(AsyncUrlVerification()) + self._async_middleware_list.append( + AsyncUrlVerification(base_logger=self._base_logger) + ) self._init_middleware_list_done = True # ------------------------- @@ -690,7 +710,9 @@

    Module slack_bolt.app.async_app

    elif isinstance(middleware_or_callable, Callable): self._async_middleware_list.append( AsyncCustomMiddleware( - app_name=self.name, func=middleware_or_callable + app_name=self.name, + func=middleware_or_callable, + base_logger=self._base_logger, ) ) return middleware_or_callable @@ -758,9 +780,10 @@

    Module slack_bolt.app.async_app

    edit=edit, save=save, execute=execute, + base_logger=self._base_logger, ) elif isinstance(step, AsyncWorkflowStepBuilder): - step = step.build() + step = step.build(base_logger=self._base_logger) elif not isinstance(step, AsyncWorkflowStep): raise BoltError(f"Invalid step object ({type(step)})") @@ -810,7 +833,9 @@

    Module slack_bolt.app.async_app

    def event( self, event: Union[ - str, Pattern, Dict[str, Union[str, Sequence[Optional[Union[str, Pattern]]]]] + str, + Pattern, + Dict[str, Optional[Union[str, Sequence[Optional[Union[str, Pattern]]]]]], ], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, @@ -843,7 +868,9 @@

    Module slack_bolt.app.async_app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.event(event, True) + primary_matcher = builtin_matchers.event( + event, True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware, True ) @@ -898,7 +925,10 @@

    Module slack_bolt.app.async_app

    ), } primary_matcher = builtin_matchers.message_event( - constraints=constraints, keyword=keyword, asyncio=True + constraints=constraints, + keyword=keyword, + asyncio=True, + base_logger=self._base_logger, ) middleware.insert(0, AsyncMessageListenerMatches(keyword)) return self._register_listener( @@ -943,7 +973,9 @@

    Module slack_bolt.app.async_app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.command(command, True) + primary_matcher = builtin_matchers.command( + command, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -992,7 +1024,9 @@

    Module slack_bolt.app.async_app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.shortcut(constraints, True) + primary_matcher = builtin_matchers.shortcut( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1009,7 +1043,9 @@

    Module slack_bolt.app.async_app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.global_shortcut(callback_id, True) + primary_matcher = builtin_matchers.global_shortcut( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1026,7 +1062,9 @@

    Module slack_bolt.app.async_app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.message_shortcut(callback_id, True) + primary_matcher = builtin_matchers.message_shortcut( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1068,7 +1106,9 @@

    Module slack_bolt.app.async_app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.action(constraints, True) + primary_matcher = builtin_matchers.action( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1087,7 +1127,9 @@

    Module slack_bolt.app.async_app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.block_action(constraints, True) + primary_matcher = builtin_matchers.block_action( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1105,7 +1147,9 @@

    Module slack_bolt.app.async_app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.attachment_action(callback_id, True) + primary_matcher = builtin_matchers.attachment_action( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1123,7 +1167,9 @@

    Module slack_bolt.app.async_app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_submission(callback_id, True) + primary_matcher = builtin_matchers.dialog_submission( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1141,7 +1187,9 @@

    Module slack_bolt.app.async_app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_cancellation(callback_id, True) + primary_matcher = builtin_matchers.dialog_cancellation( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1194,7 +1242,9 @@

    Module slack_bolt.app.async_app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view(constraints, True) + primary_matcher = builtin_matchers.view( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1212,7 +1262,9 @@

    Module slack_bolt.app.async_app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view_submission(constraints, True) + primary_matcher = builtin_matchers.view_submission( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1230,7 +1282,9 @@

    Module slack_bolt.app.async_app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view_closed(constraints, True) + primary_matcher = builtin_matchers.view_closed( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1283,7 +1337,9 @@

    Module slack_bolt.app.async_app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.options(constraints, True) + primary_matcher = builtin_matchers.options( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1300,7 +1356,9 @@

    Module slack_bolt.app.async_app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.block_suggestion(action_id, True) + primary_matcher = builtin_matchers.block_suggestion( + action_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1318,7 +1376,9 @@

    Module slack_bolt.app.async_app

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_suggestion(callback_id, True) + primary_matcher = builtin_matchers.dialog_suggestion( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -1349,7 +1409,9 @@

    Module slack_bolt.app.async_app

    # ------------------------- def _init_context(self, req: AsyncBoltRequest): - req.context["logger"] = get_bolt_app_logger(self.name) + req.context["logger"] = get_bolt_app_logger( + app_name=self.name, base_logger=self._base_logger + ) req.context["token"] = self._token if self._token is not None: # This AsyncWebClient instance can be safely singleton @@ -1402,7 +1464,9 @@

    Module slack_bolt.app.async_app

    raise BoltError(error_listener_function_must_be_coro_func(name)) listener_matchers = [ - AsyncCustomListenerMatcher(app_name=self.name, func=f) + AsyncCustomListenerMatcher( + app_name=self.name, func=f, base_logger=self._base_logger + ) for f in (matchers or []) ] listener_matchers.insert(0, primary_matcher) @@ -1412,7 +1476,9 @@

    Module slack_bolt.app.async_app

    listener_middleware.append(m) elif isinstance(m, Callable) and inspect.iscoroutinefunction(m): listener_middleware.append( - AsyncCustomMiddleware(app_name=self.name, func=m) + AsyncCustomMiddleware( + app_name=self.name, func=m, base_logger=self._base_logger + ) ) else: raise ValueError(error_unexpected_listener_middleware(type(m))) @@ -1425,6 +1491,7 @@

    Module slack_bolt.app.async_app

    matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, + base_logger=self._base_logger, ) ) @@ -1622,6 +1689,11 @@

    Args

    self._verification_token: Optional[str] = verification_token or os.environ.get( "SLACK_VERIFICATION_TOKEN", None ) + # If a logger is explicitly passed when initializing, the logger works as the base logger. + # The base logger's logging settings will be propagated to all the loggers created by bolt-python. + self._base_logger = logger + # The framework logger is supposed to be used for the internal logging. + # Also, it's accessible via `app.logger` as the app's singleton logger. self._framework_logger = logger or get_bolt_logger(AsyncApp) self._raise_error_for_unhandled_request = raise_error_for_unhandled_request @@ -1804,31 +1876,46 @@

    Args

    return if ssl_check_enabled is True: self._async_middleware_list.append( - AsyncSslCheck(verification_token=self._verification_token) + AsyncSslCheck( + verification_token=self._verification_token, + base_logger=self._base_logger, + ) ) if request_verification_enabled is True: self._async_middleware_list.append( - AsyncRequestVerification(self._signing_secret) + AsyncRequestVerification( + self._signing_secret, base_logger=self._base_logger + ) ) # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._async_oauth_flow is None: if self._token: - self._async_middleware_list.append(AsyncSingleTeamAuthorization()) + self._async_middleware_list.append( + AsyncSingleTeamAuthorization(base_logger=self._base_logger) + ) elif self._async_authorize is not None: self._async_middleware_list.append( - AsyncMultiTeamsAuthorization(authorize=self._async_authorize) + AsyncMultiTeamsAuthorization( + authorize=self._async_authorize, base_logger=self._base_logger + ) ) else: raise BoltError(error_token_required()) else: self._async_middleware_list.append( - AsyncMultiTeamsAuthorization(authorize=self._async_authorize) + AsyncMultiTeamsAuthorization( + authorize=self._async_authorize, base_logger=self._base_logger + ) ) if ignoring_self_events_enabled is True: - self._async_middleware_list.append(AsyncIgnoringSelfEvents()) + self._async_middleware_list.append( + AsyncIgnoringSelfEvents(base_logger=self._base_logger) + ) if url_verification_enabled is True: - self._async_middleware_list.append(AsyncUrlVerification()) + self._async_middleware_list.append( + AsyncUrlVerification(base_logger=self._base_logger) + ) self._init_middleware_list_done = True # ------------------------- @@ -2090,7 +2177,9 @@

    Args

    elif isinstance(middleware_or_callable, Callable): self._async_middleware_list.append( AsyncCustomMiddleware( - app_name=self.name, func=middleware_or_callable + app_name=self.name, + func=middleware_or_callable, + base_logger=self._base_logger, ) ) return middleware_or_callable @@ -2158,9 +2247,10 @@

    Args

    edit=edit, save=save, execute=execute, + base_logger=self._base_logger, ) elif isinstance(step, AsyncWorkflowStepBuilder): - step = step.build() + step = step.build(base_logger=self._base_logger) elif not isinstance(step, AsyncWorkflowStep): raise BoltError(f"Invalid step object ({type(step)})") @@ -2210,7 +2300,9 @@

    Args

    def event( self, event: Union[ - str, Pattern, Dict[str, Union[str, Sequence[Optional[Union[str, Pattern]]]]] + str, + Pattern, + Dict[str, Optional[Union[str, Sequence[Optional[Union[str, Pattern]]]]]], ], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, @@ -2243,7 +2335,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.event(event, True) + primary_matcher = builtin_matchers.event( + event, True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware, True ) @@ -2298,7 +2392,10 @@

    Args

    ), } primary_matcher = builtin_matchers.message_event( - constraints=constraints, keyword=keyword, asyncio=True + constraints=constraints, + keyword=keyword, + asyncio=True, + base_logger=self._base_logger, ) middleware.insert(0, AsyncMessageListenerMatches(keyword)) return self._register_listener( @@ -2343,7 +2440,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.command(command, True) + primary_matcher = builtin_matchers.command( + command, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2392,7 +2491,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.shortcut(constraints, True) + primary_matcher = builtin_matchers.shortcut( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2409,7 +2510,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.global_shortcut(callback_id, True) + primary_matcher = builtin_matchers.global_shortcut( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2426,7 +2529,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.message_shortcut(callback_id, True) + primary_matcher = builtin_matchers.message_shortcut( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2468,7 +2573,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.action(constraints, True) + primary_matcher = builtin_matchers.action( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2487,7 +2594,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.block_action(constraints, True) + primary_matcher = builtin_matchers.block_action( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2505,7 +2614,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.attachment_action(callback_id, True) + primary_matcher = builtin_matchers.attachment_action( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2523,7 +2634,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_submission(callback_id, True) + primary_matcher = builtin_matchers.dialog_submission( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2541,7 +2654,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_cancellation(callback_id, True) + primary_matcher = builtin_matchers.dialog_cancellation( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2594,7 +2709,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view(constraints, True) + primary_matcher = builtin_matchers.view( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2612,7 +2729,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view_submission(constraints, True) + primary_matcher = builtin_matchers.view_submission( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2630,7 +2749,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view_closed(constraints, True) + primary_matcher = builtin_matchers.view_closed( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2683,7 +2804,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.options(constraints, True) + primary_matcher = builtin_matchers.options( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2700,7 +2823,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.block_suggestion(action_id, True) + primary_matcher = builtin_matchers.block_suggestion( + action_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2718,7 +2843,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_suggestion(callback_id, True) + primary_matcher = builtin_matchers.dialog_suggestion( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -2749,7 +2876,9 @@

    Args

    # ------------------------- def _init_context(self, req: AsyncBoltRequest): - req.context["logger"] = get_bolt_app_logger(self.name) + req.context["logger"] = get_bolt_app_logger( + app_name=self.name, base_logger=self._base_logger + ) req.context["token"] = self._token if self._token is not None: # This AsyncWebClient instance can be safely singleton @@ -2802,7 +2931,9 @@

    Args

    raise BoltError(error_listener_function_must_be_coro_func(name)) listener_matchers = [ - AsyncCustomListenerMatcher(app_name=self.name, func=f) + AsyncCustomListenerMatcher( + app_name=self.name, func=f, base_logger=self._base_logger + ) for f in (matchers or []) ] listener_matchers.insert(0, primary_matcher) @@ -2812,7 +2943,9 @@

    Args

    listener_middleware.append(m) elif isinstance(m, Callable) and inspect.iscoroutinefunction(m): listener_middleware.append( - AsyncCustomMiddleware(app_name=self.name, func=m) + AsyncCustomMiddleware( + app_name=self.name, func=m, base_logger=self._base_logger + ) ) else: raise ValueError(error_unexpected_listener_middleware(type(m))) @@ -2825,6 +2958,7 @@

    Args

    matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, + base_logger=self._base_logger, ) ) @@ -2998,7 +3132,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.action(constraints, True) + primary_matcher = builtin_matchers.action( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3158,7 +3294,9 @@

    Returns

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.attachment_action(callback_id, True) + primary_matcher = builtin_matchers.attachment_action( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3188,7 +3326,9 @@

    Returns

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.block_action(constraints, True) + primary_matcher = builtin_matchers.block_action( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3215,7 +3355,9 @@

    Returns

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.block_suggestion(action_id, True) + primary_matcher = builtin_matchers.block_suggestion( + action_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3289,7 +3431,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.command(command, True) + primary_matcher = builtin_matchers.command( + command, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3352,7 +3496,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_cancellation(callback_id, True) + primary_matcher = builtin_matchers.dialog_cancellation( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3381,7 +3527,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_submission(callback_id, True) + primary_matcher = builtin_matchers.dialog_submission( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3410,7 +3558,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.dialog_suggestion(callback_id, True) + primary_matcher = builtin_matchers.dialog_suggestion( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3494,7 +3644,7 @@

    Args

    -def event(self, event: Union[str, Pattern, Dict[str, Union[str, Sequence[Union[str, Pattern, ForwardRef(None)]]]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]] +def event(self, event: Union[str, Pattern, Dict[str, Union[str, Sequence[Union[str, Pattern, ForwardRef(None)]], ForwardRef(None)]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]

    Registers a new event listener. This method can be used as either a decorator or a method.

    @@ -3530,7 +3680,9 @@

    Args

    def event(
         self,
         event: Union[
    -        str, Pattern, Dict[str, Union[str, Sequence[Optional[Union[str, Pattern]]]]]
    +        str,
    +        Pattern,
    +        Dict[str, Optional[Union[str, Sequence[Optional[Union[str, Pattern]]]]]],
         ],
         matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
         middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    @@ -3563,7 +3715,9 @@ 

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.event(event, True) + primary_matcher = builtin_matchers.event( + event, True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware, True ) @@ -3590,7 +3744,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.global_shortcut(callback_id, True) + primary_matcher = builtin_matchers.global_shortcut( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3678,7 +3834,10 @@

    Args

    ), } primary_matcher = builtin_matchers.message_event( - constraints=constraints, keyword=keyword, asyncio=True + constraints=constraints, + keyword=keyword, + asyncio=True, + base_logger=self._base_logger, ) middleware.insert(0, AsyncMessageListenerMatches(keyword)) return self._register_listener( @@ -3707,7 +3866,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.message_shortcut(callback_id, True) + primary_matcher = builtin_matchers.message_shortcut( + callback_id, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3766,7 +3927,9 @@

    Args

    elif isinstance(middleware_or_callable, Callable): self._async_middleware_list.append( AsyncCustomMiddleware( - app_name=self.name, func=middleware_or_callable + app_name=self.name, + func=middleware_or_callable, + base_logger=self._base_logger, ) ) return middleware_or_callable @@ -3863,7 +4026,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.options(constraints, True) + primary_matcher = builtin_matchers.options( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -3996,7 +4161,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.shortcut(constraints, True) + primary_matcher = builtin_matchers.shortcut( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -4130,9 +4297,10 @@

    Args

    edit=edit, save=save, execute=execute, + base_logger=self._base_logger, ) elif isinstance(step, AsyncWorkflowStepBuilder): - step = step.build() + step = step.build(base_logger=self._base_logger) elif not isinstance(step, AsyncWorkflowStep): raise BoltError(f"Invalid step object ({type(step)})") @@ -4239,7 +4407,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view(constraints, True) + primary_matcher = builtin_matchers.view( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -4268,7 +4438,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view_closed(constraints, True) + primary_matcher = builtin_matchers.view_closed( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) @@ -4297,7 +4469,9 @@

    Args

    def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) - primary_matcher = builtin_matchers.view_submission(constraints, True) + primary_matcher = builtin_matchers.view_submission( + constraints, asyncio=True, base_logger=self._base_logger + ) return self._register_listener( list(functions), primary_matcher, matchers, middleware ) diff --git a/docs/api-docs/slack_bolt/listener/async_listener.html b/docs/api-docs/slack_bolt/listener/async_listener.html index b36ef4c5e..12af0c553 100644 --- a/docs/api-docs/slack_bolt/listener/async_listener.html +++ b/docs/api-docs/slack_bolt/listener/async_listener.html @@ -129,6 +129,7 @@

    Module slack_bolt.listener.async_listener

    matchers: Sequence[AsyncListenerMatcher], middleware: Sequence[AsyncMiddleware], auto_acknowledgement: bool = False, + base_logger: Optional[Logger] = None, ): self.app_name = app_name self.ack_function = ack_function @@ -137,7 +138,7 @@

    Module slack_bolt.listener.async_listener

    self.middleware = middleware self.auto_acknowledgement = auto_acknowledgement self.arg_names = inspect.getfullargspec(ack_function).args - self.logger = get_bolt_app_logger(app_name, self.ack_function) + self.logger = get_bolt_app_logger(app_name, self.ack_function, base_logger) async def run_ack_function( self, @@ -174,7 +175,7 @@

    Classes

    class AsyncCustomListener -(*, app_name: str, ack_function: Callable[..., Awaitable[Optional[BoltResponse]]], lazy_functions: Sequence[Callable[..., Awaitable[None]]], matchers: Sequence[AsyncListenerMatcher], middleware: Sequence[AsyncMiddleware], auto_acknowledgement: bool = False) +(*, app_name: str, ack_function: Callable[..., Awaitable[Optional[BoltResponse]]], lazy_functions: Sequence[Callable[..., Awaitable[None]]], matchers: Sequence[AsyncListenerMatcher], middleware: Sequence[AsyncMiddleware], auto_acknowledgement: bool = False, base_logger: Optional[logging.Logger] = None)
    @@ -201,6 +202,7 @@

    Classes

    matchers: Sequence[AsyncListenerMatcher], middleware: Sequence[AsyncMiddleware], auto_acknowledgement: bool = False, + base_logger: Optional[Logger] = None, ): self.app_name = app_name self.ack_function = ack_function @@ -209,7 +211,7 @@

    Classes

    self.middleware = middleware self.auto_acknowledgement = auto_acknowledgement self.arg_names = inspect.getfullargspec(ack_function).args - self.logger = get_bolt_app_logger(app_name, self.ack_function) + self.logger = get_bolt_app_logger(app_name, self.ack_function, base_logger) async def run_ack_function( self, @@ -307,7 +309,7 @@

    Returns

    class cls -(*, app_name: str, ack_function: Callable[..., Awaitable[Optional[BoltResponse]]], lazy_functions: Sequence[Callable[..., Awaitable[None]]], matchers: Sequence[AsyncListenerMatcher], middleware: Sequence[AsyncMiddleware], auto_acknowledgement: bool = False) +(*, app_name: str, ack_function: Callable[..., Awaitable[Optional[BoltResponse]]], lazy_functions: Sequence[Callable[..., Awaitable[None]]], matchers: Sequence[AsyncListenerMatcher], middleware: Sequence[AsyncMiddleware], auto_acknowledgement: bool = False, base_logger: Optional[logging.Logger] = None)
    @@ -334,6 +336,7 @@

    Returns

    matchers: Sequence[AsyncListenerMatcher], middleware: Sequence[AsyncMiddleware], auto_acknowledgement: bool = False, + base_logger: Optional[Logger] = None, ): self.app_name = app_name self.ack_function = ack_function @@ -342,7 +345,7 @@

    Returns

    self.middleware = middleware self.auto_acknowledgement = auto_acknowledgement self.arg_names = inspect.getfullargspec(ack_function).args - self.logger = get_bolt_app_logger(app_name, self.ack_function) + self.logger = get_bolt_app_logger(app_name, self.ack_function, base_logger) async def run_ack_function( self, diff --git a/docs/api-docs/slack_bolt/listener/custom_listener.html b/docs/api-docs/slack_bolt/listener/custom_listener.html index a0fc17138..b5189b432 100644 --- a/docs/api-docs/slack_bolt/listener/custom_listener.html +++ b/docs/api-docs/slack_bolt/listener/custom_listener.html @@ -58,6 +58,7 @@

    Module slack_bolt.listener.custom_listener

    matchers: Sequence[ListenerMatcher], middleware: Sequence[Middleware], # type: ignore auto_acknowledgement: bool = False, + base_logger: Optional[Logger] = None, ): self.app_name = app_name self.ack_function = ack_function @@ -66,7 +67,7 @@

    Module slack_bolt.listener.custom_listener

    self.middleware = middleware self.auto_acknowledgement = auto_acknowledgement self.arg_names = inspect.getfullargspec(ack_function).args - self.logger = get_bolt_app_logger(app_name, self.ack_function) + self.logger = get_bolt_app_logger(app_name, self.ack_function, base_logger) def run_ack_function( self, @@ -96,7 +97,7 @@

    Classes

    class CustomListener -(*, app_name: str, ack_function: Callable[..., Optional[BoltResponse]], lazy_functions: Sequence[Callable[..., None]], matchers: Sequence[ListenerMatcher], middleware: Sequence[Middleware], auto_acknowledgement: bool = False) +(*, app_name: str, ack_function: Callable[..., Optional[BoltResponse]], lazy_functions: Sequence[Callable[..., None]], matchers: Sequence[ListenerMatcher], middleware: Sequence[Middleware], auto_acknowledgement: bool = False, base_logger: Optional[logging.Logger] = None)
    @@ -123,6 +124,7 @@

    Classes

    matchers: Sequence[ListenerMatcher], middleware: Sequence[Middleware], # type: ignore auto_acknowledgement: bool = False, + base_logger: Optional[Logger] = None, ): self.app_name = app_name self.ack_function = ack_function @@ -131,7 +133,7 @@

    Classes

    self.middleware = middleware self.auto_acknowledgement = auto_acknowledgement self.arg_names = inspect.getfullargspec(ack_function).args - self.logger = get_bolt_app_logger(app_name, self.ack_function) + self.logger = get_bolt_app_logger(app_name, self.ack_function, base_logger) def run_ack_function( self, diff --git a/docs/api-docs/slack_bolt/listener_matcher/async_builtins.html b/docs/api-docs/slack_bolt/listener_matcher/async_builtins.html index 2e6d19576..2bf7a8a39 100644 --- a/docs/api-docs/slack_bolt/listener_matcher/async_builtins.html +++ b/docs/api-docs/slack_bolt/listener_matcher/async_builtins.html @@ -58,7 +58,7 @@

    Classes

    class AsyncBuiltinListenerMatcher -(*, func: Callable[..., Union[bool, Awaitable[bool]]]) +(*, func: Callable[..., Union[bool, Awaitable[bool]]], base_logger: Optional[logging.Logger] = None)
    diff --git a/docs/api-docs/slack_bolt/listener_matcher/async_listener_matcher.html b/docs/api-docs/slack_bolt/listener_matcher/async_listener_matcher.html index 3287a9b40..95a06c74d 100644 --- a/docs/api-docs/slack_bolt/listener_matcher/async_listener_matcher.html +++ b/docs/api-docs/slack_bolt/listener_matcher/async_listener_matcher.html @@ -49,7 +49,7 @@

    Module slack_bolt.listener_matcher.async_listener_matche import inspect from logging import Logger -from typing import Callable, Awaitable, Sequence +from typing import Callable, Awaitable, Sequence, Optional from slack_bolt.kwargs_injection.async_utils import build_async_required_kwargs from slack_bolt.logger import get_bolt_app_logger @@ -63,11 +63,17 @@

    Module slack_bolt.listener_matcher.async_listener_matche arg_names: Sequence[str] logger: Logger - def __init__(self, *, app_name: str, func: Callable[..., Awaitable[bool]]): + def __init__( + self, + *, + app_name: str, + func: Callable[..., Awaitable[bool]], + base_logger: Optional[Logger] = None + ): self.app_name = app_name self.func = func self.arg_names = inspect.getfullargspec(func).args - self.logger = get_bolt_app_logger(self.app_name, self.func) + self.logger = get_bolt_app_logger(self.app_name, self.func, base_logger) async def async_matches(self, req: AsyncBoltRequest, resp: BoltResponse) -> bool: return await self.func( @@ -99,7 +105,7 @@

    Classes

    class AsyncCustomListenerMatcher -(*, app_name: str, func: Callable[..., Awaitable[bool]]) +(*, app_name: str, func: Callable[..., Awaitable[bool]], base_logger: Optional[logging.Logger] = None)
    @@ -113,11 +119,17 @@

    Classes

    arg_names: Sequence[str] logger: Logger - def __init__(self, *, app_name: str, func: Callable[..., Awaitable[bool]]): + def __init__( + self, + *, + app_name: str, + func: Callable[..., Awaitable[bool]], + base_logger: Optional[Logger] = None + ): self.app_name = app_name self.func = func self.arg_names = inspect.getfullargspec(func).args - self.logger = get_bolt_app_logger(self.app_name, self.func) + self.logger = get_bolt_app_logger(self.app_name, self.func, base_logger) async def async_matches(self, req: AsyncBoltRequest, resp: BoltResponse) -> bool: return await self.func( @@ -189,7 +201,7 @@

    Returns

    class cls -(*, app_name: str, func: Callable[..., Awaitable[bool]]) +(*, app_name: str, func: Callable[..., Awaitable[bool]], base_logger: Optional[logging.Logger] = None)
    @@ -203,11 +215,17 @@

    Returns

    arg_names: Sequence[str] logger: Logger - def __init__(self, *, app_name: str, func: Callable[..., Awaitable[bool]]): + def __init__( + self, + *, + app_name: str, + func: Callable[..., Awaitable[bool]], + base_logger: Optional[Logger] = None + ): self.app_name = app_name self.func = func self.arg_names = inspect.getfullargspec(func).args - self.logger = get_bolt_app_logger(self.app_name, self.func) + self.logger = get_bolt_app_logger(self.app_name, self.func, base_logger) async def async_matches(self, req: AsyncBoltRequest, resp: BoltResponse) -> bool: return await self.func( diff --git a/docs/api-docs/slack_bolt/listener_matcher/builtins.html b/docs/api-docs/slack_bolt/listener_matcher/builtins.html index f03e45470..e55a7e489 100644 --- a/docs/api-docs/slack_bolt/listener_matcher/builtins.html +++ b/docs/api-docs/slack_bolt/listener_matcher/builtins.html @@ -30,6 +30,7 @@

    Module slack_bolt.listener_matcher.builtins

    import inspect import re import sys +from logging import Logger from slack_bolt.error import BoltError from slack_bolt.request.payload_utils import ( @@ -68,10 +69,15 @@

    Module slack_bolt.listener_matcher.builtins

    # a.k.a Union[ListenerMatcher, "AsyncListenerMatcher"] class BuiltinListenerMatcher(ListenerMatcher): - def __init__(self, *, func: Callable[..., Union[bool, Awaitable[bool]]]): + def __init__( + self, + *, + func: Callable[..., Union[bool, Awaitable[bool]]], + base_logger: Optional[Logger] = None, + ): self.func = func self.arg_names = inspect.getfullargspec(func).args - self.logger = get_bolt_logger(self.func) + self.logger = get_bolt_logger(self.func, base_logger) def matches(self, req: BoltRequest, resp: BoltResponse) -> bool: return self.func( @@ -88,6 +94,7 @@

    Module slack_bolt.listener_matcher.builtins

    def build_listener_matcher( func: Callable[..., bool], asyncio: bool, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: if asyncio: from .async_builtins import AsyncBuiltinListenerMatcher @@ -95,9 +102,9 @@

    Module slack_bolt.listener_matcher.builtins

    async def async_fun(body: Dict[str, Any]) -> bool: return func(body) - return AsyncBuiltinListenerMatcher(func=async_fun) + return AsyncBuiltinListenerMatcher(func=async_fun, base_logger=base_logger) else: - return BuiltinListenerMatcher(func=func) + return BuiltinListenerMatcher(func=func, base_logger=base_logger) # ------------- @@ -106,9 +113,12 @@

    Module slack_bolt.listener_matcher.builtins

    def event( constraints: Union[ - str, Pattern, Dict[str, Union[str, Sequence[Optional[Union[str, Pattern]]]]] + str, + Pattern, + Dict[str, Optional[Union[str, Sequence[Optional[Union[str, Pattern]]]]]], ], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: if isinstance(constraints, (str, Pattern)): event_type: Union[str, Pattern] = constraints @@ -117,7 +127,7 @@

    Module slack_bolt.listener_matcher.builtins

    def func(body: Dict[str, Any]) -> bool: return is_event(body) and _matches(event_type, body["event"]["type"]) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) elif "type" in constraints: _verify_message_event_type(constraints["type"]) @@ -130,7 +140,7 @@

    Module slack_bolt.listener_matcher.builtins

    ) return False - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) raise BoltError( f"event ({constraints}: {type(constraints)}) must be any of str, Pattern, and dict" @@ -138,9 +148,12 @@

    Module slack_bolt.listener_matcher.builtins

    def message_event( - constraints: Dict[str, Union[str, Sequence[Optional[Union[str, Pattern]]]]], + constraints: Dict[ + str, Optional[Union[str, Sequence[Optional[Union[str, Pattern]]]]] + ], keyword: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: if "type" in constraints and keyword is not None: _verify_message_event_type(constraints["type"]) @@ -159,7 +172,7 @@

    Module slack_bolt.listener_matcher.builtins

    return True return False - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) raise BoltError(f"event ({constraints}: {type(constraints)}) must be dict") @@ -168,8 +181,8 @@

    Module slack_bolt.listener_matcher.builtins

    if not _matches(constraints["type"], event_payload["type"]): return False if "subtype" in constraints: - expected_subtype: Union[ - str, Sequence[Optional[Union[str, Pattern]]] + expected_subtype: Optional[ + Union[str, Sequence[Optional[Union[str, Pattern]]]] ] = constraints["subtype"] if expected_subtype is None: # "subtype" in constraints is intentionally None for this pattern @@ -205,6 +218,7 @@

    Module slack_bolt.listener_matcher.builtins

    def workflow_step_execute( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return ( @@ -214,7 +228,7 @@

    Module slack_bolt.listener_matcher.builtins

    and _matches(callback_id, body["event"]["callback_id"]) ) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) # ------------- @@ -224,11 +238,12 @@

    Module slack_bolt.listener_matcher.builtins

    def command( command: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return is_slash_command(body) and _matches(command, body["command"]) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) # ------------- @@ -238,6 +253,7 @@

    Module slack_bolt.listener_matcher.builtins

    def shortcut( constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: if isinstance(constraints, (str, Pattern)): callback_id: Union[str, Pattern] = constraints @@ -245,7 +261,7 @@

    Module slack_bolt.listener_matcher.builtins

    def func(body: Dict[str, Any]) -> bool: return is_shortcut(body) and _matches(callback_id, body["callback_id"]) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) elif "type" in constraints and "callback_id" in constraints: if constraints["type"] == "shortcut": @@ -261,21 +277,23 @@

    Module slack_bolt.listener_matcher.builtins

    def global_shortcut( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return is_global_shortcut(body) and _matches(callback_id, body["callback_id"]) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) def message_shortcut( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return is_message_shortcut(body) and _matches(callback_id, body["callback_id"]) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) # ------------- @@ -285,6 +303,7 @@

    Module slack_bolt.listener_matcher.builtins

    def action( constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: if isinstance(constraints, (str, Pattern)): @@ -297,7 +316,7 @@

    Module slack_bolt.listener_matcher.builtins

    or _workflow_step_edit(constraints, body) ) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) elif "type" in constraints: action_type = constraints["type"] @@ -347,11 +366,12 @@

    Module slack_bolt.listener_matcher.builtins

    def block_action( constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return _block_action(constraints, body) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) def _attachment_action( @@ -364,11 +384,12 @@

    Module slack_bolt.listener_matcher.builtins

    def attachment_action( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return _attachment_action(callback_id, body) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) def _dialog_submission( @@ -381,11 +402,12 @@

    Module slack_bolt.listener_matcher.builtins

    def dialog_submission( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return _dialog_submission(callback_id, body) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) def _dialog_cancellation( @@ -398,11 +420,12 @@

    Module slack_bolt.listener_matcher.builtins

    def dialog_cancellation( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return _dialog_cancellation(callback_id, body) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) def _workflow_step_edit( @@ -415,11 +438,12 @@

    Module slack_bolt.listener_matcher.builtins

    def workflow_step_edit( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return _workflow_step_edit(callback_id, body) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) # ------------------------- @@ -429,6 +453,7 @@

    Module slack_bolt.listener_matcher.builtins

    def view( constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: if isinstance(constraints, (str, Pattern)): return view_submission(constraints, asyncio) @@ -446,37 +471,40 @@

    Module slack_bolt.listener_matcher.builtins

    def view_submission( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return is_view_submission(body) and _matches( callback_id, body["view"]["callback_id"] ) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) def view_closed( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return is_view_closed(body) and _matches( callback_id, body["view"]["callback_id"] ) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) def workflow_step_save( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return is_workflow_step_save(body) and _matches( callback_id, body["view"]["callback_id"] ) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) # ------------- @@ -486,6 +514,7 @@

    Module slack_bolt.listener_matcher.builtins

    def options( constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: if isinstance(constraints, (str, Pattern)): @@ -494,7 +523,7 @@

    Module slack_bolt.listener_matcher.builtins

    constraints, body ) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) if "action_id" in constraints: return block_suggestion(constraints["action_id"], asyncio) @@ -516,11 +545,12 @@

    Module slack_bolt.listener_matcher.builtins

    def block_suggestion( action_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return _block_suggestion(action_id, body) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) def _dialog_suggestion( @@ -533,11 +563,12 @@

    Module slack_bolt.listener_matcher.builtins

    def dialog_suggestion( callback_id: Union[str, Pattern], asyncio: bool = False, + base_logger: Optional[Logger] = None, ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]: def func(body: Dict[str, Any]) -> bool: return _dialog_suggestion(callback_id, body) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) # ------------------------- @@ -567,7 +598,7 @@

    Module slack_bolt.listener_matcher.builtins

    Functions

    -def action(constraints: Union[str, re.Pattern, Dict[str, Union[str, re.Pattern]]], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def action(constraints: Union[str, re.Pattern, Dict[str, Union[str, re.Pattern]]], asyncio: bool = False, base_logger: Optional[logging.Logger] = None) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -578,6 +609,7 @@

    Functions

    def action(
         constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
         asyncio: bool = False,
    +    base_logger: Optional[Logger] = None,
     ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
         if isinstance(constraints, (str, Pattern)):
     
    @@ -590,7 +622,7 @@ 

    Functions

    or _workflow_step_edit(constraints, body) ) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) elif "type" in constraints: action_type = constraints["type"] @@ -617,7 +649,7 @@

    Functions

    -def attachment_action(callback_id: Union[str, re.Pattern], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def attachment_action(callback_id: Union[str, re.Pattern], asyncio: bool = False, base_logger: Optional[logging.Logger] = None) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -628,15 +660,16 @@

    Functions

    def attachment_action(
         callback_id: Union[str, Pattern],
         asyncio: bool = False,
    +    base_logger: Optional[Logger] = None,
     ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
         def func(body: Dict[str, Any]) -> bool:
             return _attachment_action(callback_id, body)
     
    -    return build_listener_matcher(func, asyncio)
    + return build_listener_matcher(func, asyncio, base_logger)

    -def block_action(constraints: Union[str, re.Pattern, Dict[str, Union[str, re.Pattern]]], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def block_action(constraints: Union[str, re.Pattern, Dict[str, Union[str, re.Pattern]]], asyncio: bool = False, base_logger: Optional[logging.Logger] = None) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -647,15 +680,16 @@

    Functions

    def block_action(
         constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
         asyncio: bool = False,
    +    base_logger: Optional[Logger] = None,
     ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
         def func(body: Dict[str, Any]) -> bool:
             return _block_action(constraints, body)
     
    -    return build_listener_matcher(func, asyncio)
    + return build_listener_matcher(func, asyncio, base_logger)
    -def block_suggestion(action_id: Union[str, re.Pattern], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def block_suggestion(action_id: Union[str, re.Pattern], asyncio: bool = False, base_logger: Optional[logging.Logger] = None) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -666,15 +700,16 @@

    Functions

    def block_suggestion(
         action_id: Union[str, Pattern],
         asyncio: bool = False,
    +    base_logger: Optional[Logger] = None,
     ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
         def func(body: Dict[str, Any]) -> bool:
             return _block_suggestion(action_id, body)
     
    -    return build_listener_matcher(func, asyncio)
    + return build_listener_matcher(func, asyncio, base_logger)
    -def build_listener_matcher(func: Callable[..., bool], asyncio: bool) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def build_listener_matcher(func: Callable[..., bool], asyncio: bool, base_logger: Optional[logging.Logger] = None) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -685,6 +720,7 @@

    Functions

    def build_listener_matcher(
         func: Callable[..., bool],
         asyncio: bool,
    +    base_logger: Optional[Logger] = None,
     ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
         if asyncio:
             from .async_builtins import AsyncBuiltinListenerMatcher
    @@ -692,13 +728,13 @@ 

    Functions

    async def async_fun(body: Dict[str, Any]) -> bool: return func(body) - return AsyncBuiltinListenerMatcher(func=async_fun) + return AsyncBuiltinListenerMatcher(func=async_fun, base_logger=base_logger) else: - return BuiltinListenerMatcher(func=func)
    + return BuiltinListenerMatcher(func=func, base_logger=base_logger)
    -def command(command: Union[str, re.Pattern], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def command(command: Union[str, re.Pattern], asyncio: bool = False, base_logger: Optional[logging.Logger] = None) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -709,15 +745,16 @@

    Functions

    def command(
         command: Union[str, Pattern],
         asyncio: bool = False,
    +    base_logger: Optional[Logger] = None,
     ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
         def func(body: Dict[str, Any]) -> bool:
             return is_slash_command(body) and _matches(command, body["command"])
     
    -    return build_listener_matcher(func, asyncio)
    + return build_listener_matcher(func, asyncio, base_logger)
    -def dialog_cancellation(callback_id: Union[str, re.Pattern], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def dialog_cancellation(callback_id: Union[str, re.Pattern], asyncio: bool = False, base_logger: Optional[logging.Logger] = None) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -728,15 +765,16 @@

    Functions

    def dialog_cancellation(
         callback_id: Union[str, Pattern],
         asyncio: bool = False,
    +    base_logger: Optional[Logger] = None,
     ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
         def func(body: Dict[str, Any]) -> bool:
             return _dialog_cancellation(callback_id, body)
     
    -    return build_listener_matcher(func, asyncio)
    + return build_listener_matcher(func, asyncio, base_logger)
    -def dialog_submission(callback_id: Union[str, re.Pattern], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def dialog_submission(callback_id: Union[str, re.Pattern], asyncio: bool = False, base_logger: Optional[logging.Logger] = None) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -747,15 +785,16 @@

    Functions

    def dialog_submission(
         callback_id: Union[str, Pattern],
         asyncio: bool = False,
    +    base_logger: Optional[Logger] = None,
     ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
         def func(body: Dict[str, Any]) -> bool:
             return _dialog_submission(callback_id, body)
     
    -    return build_listener_matcher(func, asyncio)
    + return build_listener_matcher(func, asyncio, base_logger)
    -def dialog_suggestion(callback_id: Union[str, re.Pattern], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def dialog_suggestion(callback_id: Union[str, re.Pattern], asyncio: bool = False, base_logger: Optional[logging.Logger] = None) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -766,15 +805,16 @@

    Functions

    def dialog_suggestion(
         callback_id: Union[str, Pattern],
         asyncio: bool = False,
    +    base_logger: Optional[Logger] = None,
     ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
         def func(body: Dict[str, Any]) -> bool:
             return _dialog_suggestion(callback_id, body)
     
    -    return build_listener_matcher(func, asyncio)
    + return build_listener_matcher(func, asyncio, base_logger)
    -def event(constraints: Union[str, re.Pattern, Dict[str, Union[str, Sequence[Union[str, re.Pattern, ForwardRef(None)]]]]], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def event(constraints: Union[str, re.Pattern, Dict[str, Union[str, Sequence[Union[str, re.Pattern, ForwardRef(None)]], ForwardRef(None)]]], asyncio: bool = False, base_logger: Optional[logging.Logger] = None) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -784,9 +824,12 @@

    Functions

    def event(
         constraints: Union[
    -        str, Pattern, Dict[str, Union[str, Sequence[Optional[Union[str, Pattern]]]]]
    +        str,
    +        Pattern,
    +        Dict[str, Optional[Union[str, Sequence[Optional[Union[str, Pattern]]]]]],
         ],
         asyncio: bool = False,
    +    base_logger: Optional[Logger] = None,
     ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
         if isinstance(constraints, (str, Pattern)):
             event_type: Union[str, Pattern] = constraints
    @@ -795,7 +838,7 @@ 

    Functions

    def func(body: Dict[str, Any]) -> bool: return is_event(body) and _matches(event_type, body["event"]["type"]) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) elif "type" in constraints: _verify_message_event_type(constraints["type"]) @@ -808,7 +851,7 @@

    Functions

    ) return False - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) raise BoltError( f"event ({constraints}: {type(constraints)}) must be any of str, Pattern, and dict" @@ -816,7 +859,7 @@

    Functions

    -def global_shortcut(callback_id: Union[str, re.Pattern], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def global_shortcut(callback_id: Union[str, re.Pattern], asyncio: bool = False, base_logger: Optional[logging.Logger] = None) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -827,15 +870,16 @@

    Functions

    def global_shortcut(
         callback_id: Union[str, Pattern],
         asyncio: bool = False,
    +    base_logger: Optional[Logger] = None,
     ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
         def func(body: Dict[str, Any]) -> bool:
             return is_global_shortcut(body) and _matches(callback_id, body["callback_id"])
     
    -    return build_listener_matcher(func, asyncio)
    + return build_listener_matcher(func, asyncio, base_logger)
    -def message_event(constraints: Dict[str, Union[str, Sequence[Union[str, re.Pattern, ForwardRef(None)]]]], keyword: Union[str, re.Pattern], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def message_event(constraints: Dict[str, Union[str, Sequence[Union[str, re.Pattern, ForwardRef(None)]], ForwardRef(None)]], keyword: Union[str, re.Pattern], asyncio: bool = False, base_logger: Optional[logging.Logger] = None) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -844,9 +888,12 @@

    Functions

    Expand source code
    def message_event(
    -    constraints: Dict[str, Union[str, Sequence[Optional[Union[str, Pattern]]]]],
    +    constraints: Dict[
    +        str, Optional[Union[str, Sequence[Optional[Union[str, Pattern]]]]]
    +    ],
         keyword: Union[str, Pattern],
         asyncio: bool = False,
    +    base_logger: Optional[Logger] = None,
     ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
         if "type" in constraints and keyword is not None:
             _verify_message_event_type(constraints["type"])
    @@ -865,13 +912,13 @@ 

    Functions

    return True return False - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) raise BoltError(f"event ({constraints}: {type(constraints)}) must be dict")
    -def message_shortcut(callback_id: Union[str, re.Pattern], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def message_shortcut(callback_id: Union[str, re.Pattern], asyncio: bool = False, base_logger: Optional[logging.Logger] = None) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -882,15 +929,16 @@

    Functions

    def message_shortcut(
         callback_id: Union[str, Pattern],
         asyncio: bool = False,
    +    base_logger: Optional[Logger] = None,
     ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
         def func(body: Dict[str, Any]) -> bool:
             return is_message_shortcut(body) and _matches(callback_id, body["callback_id"])
     
    -    return build_listener_matcher(func, asyncio)
    + return build_listener_matcher(func, asyncio, base_logger)
    -def options(constraints: Union[str, re.Pattern, Dict[str, Union[str, re.Pattern]]], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def options(constraints: Union[str, re.Pattern, Dict[str, Union[str, re.Pattern]]], asyncio: bool = False, base_logger: Optional[logging.Logger] = None) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -901,6 +949,7 @@

    Functions

    def options(
         constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
         asyncio: bool = False,
    +    base_logger: Optional[Logger] = None,
     ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
         if isinstance(constraints, (str, Pattern)):
     
    @@ -909,7 +958,7 @@ 

    Functions

    constraints, body ) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) if "action_id" in constraints: return block_suggestion(constraints["action_id"], asyncio) @@ -922,7 +971,7 @@

    Functions

    -def shortcut(constraints: Union[str, re.Pattern, Dict[str, Union[str, re.Pattern]]], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def shortcut(constraints: Union[str, re.Pattern, Dict[str, Union[str, re.Pattern]]], asyncio: bool = False, base_logger: Optional[logging.Logger] = None) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -933,6 +982,7 @@

    Functions

    def shortcut(
         constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
         asyncio: bool = False,
    +    base_logger: Optional[Logger] = None,
     ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
         if isinstance(constraints, (str, Pattern)):
             callback_id: Union[str, Pattern] = constraints
    @@ -940,7 +990,7 @@ 

    Functions

    def func(body: Dict[str, Any]) -> bool: return is_shortcut(body) and _matches(callback_id, body["callback_id"]) - return build_listener_matcher(func, asyncio) + return build_listener_matcher(func, asyncio, base_logger) elif "type" in constraints and "callback_id" in constraints: if constraints["type"] == "shortcut": @@ -954,7 +1004,7 @@

    Functions

    -def view(constraints: Union[str, re.Pattern, Dict[str, Union[str, re.Pattern]]], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def view(constraints: Union[str, re.Pattern, Dict[str, Union[str, re.Pattern]]], asyncio: bool = False, base_logger: Optional[logging.Logger] = None) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -965,6 +1015,7 @@

    Functions

    def view(
         constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
         asyncio: bool = False,
    +    base_logger: Optional[Logger] = None,
     ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
         if isinstance(constraints, (str, Pattern)):
             return view_submission(constraints, asyncio)
    @@ -980,7 +1031,7 @@ 

    Functions

    -def view_closed(callback_id: Union[str, re.Pattern], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def view_closed(callback_id: Union[str, re.Pattern], asyncio: bool = False, base_logger: Optional[logging.Logger] = None) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -991,17 +1042,18 @@

    Functions

    def view_closed(
         callback_id: Union[str, Pattern],
         asyncio: bool = False,
    +    base_logger: Optional[Logger] = None,
     ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
         def func(body: Dict[str, Any]) -> bool:
             return is_view_closed(body) and _matches(
                 callback_id, body["view"]["callback_id"]
             )
     
    -    return build_listener_matcher(func, asyncio)
    + return build_listener_matcher(func, asyncio, base_logger)
    -def view_submission(callback_id: Union[str, re.Pattern], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def view_submission(callback_id: Union[str, re.Pattern], asyncio: bool = False, base_logger: Optional[logging.Logger] = None) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -1012,17 +1064,18 @@

    Functions

    def view_submission(
         callback_id: Union[str, Pattern],
         asyncio: bool = False,
    +    base_logger: Optional[Logger] = None,
     ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
         def func(body: Dict[str, Any]) -> bool:
             return is_view_submission(body) and _matches(
                 callback_id, body["view"]["callback_id"]
             )
     
    -    return build_listener_matcher(func, asyncio)
    + return build_listener_matcher(func, asyncio, base_logger)
    -def workflow_step_edit(callback_id: Union[str, re.Pattern], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def workflow_step_edit(callback_id: Union[str, re.Pattern], asyncio: bool = False, base_logger: Optional[logging.Logger] = None) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -1033,15 +1086,16 @@

    Functions

    def workflow_step_edit(
         callback_id: Union[str, Pattern],
         asyncio: bool = False,
    +    base_logger: Optional[Logger] = None,
     ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
         def func(body: Dict[str, Any]) -> bool:
             return _workflow_step_edit(callback_id, body)
     
    -    return build_listener_matcher(func, asyncio)
    + return build_listener_matcher(func, asyncio, base_logger)
    -def workflow_step_execute(callback_id: Union[str, re.Pattern], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def workflow_step_execute(callback_id: Union[str, re.Pattern], asyncio: bool = False, base_logger: Optional[logging.Logger] = None) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -1052,6 +1106,7 @@

    Functions

    def workflow_step_execute(
         callback_id: Union[str, Pattern],
         asyncio: bool = False,
    +    base_logger: Optional[Logger] = None,
     ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
         def func(body: Dict[str, Any]) -> bool:
             return (
    @@ -1061,11 +1116,11 @@ 

    Functions

    and _matches(callback_id, body["event"]["callback_id"]) ) - return build_listener_matcher(func, asyncio)
    + return build_listener_matcher(func, asyncio, base_logger)
    -def workflow_step_save(callback_id: Union[str, re.Pattern], asyncio: bool = False) ‑> Union[ListenerMatcher, AsyncListenerMatcher] +def workflow_step_save(callback_id: Union[str, re.Pattern], asyncio: bool = False, base_logger: Optional[logging.Logger] = None) ‑> Union[ListenerMatcher, AsyncListenerMatcher]
    @@ -1076,13 +1131,14 @@

    Functions

    def workflow_step_save(
         callback_id: Union[str, Pattern],
         asyncio: bool = False,
    +    base_logger: Optional[Logger] = None,
     ) -> Union[ListenerMatcher, "AsyncListenerMatcher"]:
         def func(body: Dict[str, Any]) -> bool:
             return is_workflow_step_save(body) and _matches(
                 callback_id, body["view"]["callback_id"]
             )
     
    -    return build_listener_matcher(func, asyncio)
    + return build_listener_matcher(func, asyncio, base_logger)
    @@ -1092,7 +1148,7 @@

    Classes

    class BuiltinListenerMatcher -(*, func: Callable[..., Union[bool, Awaitable[bool]]]) +(*, func: Callable[..., Union[bool, Awaitable[bool]]], base_logger: Optional[logging.Logger] = None)
    @@ -1101,10 +1157,15 @@

    Classes

    Expand source code
    class BuiltinListenerMatcher(ListenerMatcher):
    -    def __init__(self, *, func: Callable[..., Union[bool, Awaitable[bool]]]):
    +    def __init__(
    +        self,
    +        *,
    +        func: Callable[..., Union[bool, Awaitable[bool]]],
    +        base_logger: Optional[Logger] = None,
    +    ):
             self.func = func
             self.arg_names = inspect.getfullargspec(func).args
    -        self.logger = get_bolt_logger(self.func)
    +        self.logger = get_bolt_logger(self.func, base_logger)
     
         def matches(self, req: BoltRequest, resp: BoltResponse) -> bool:
             return self.func(
    diff --git a/docs/api-docs/slack_bolt/listener_matcher/custom_listener_matcher.html b/docs/api-docs/slack_bolt/listener_matcher/custom_listener_matcher.html
    index e9c8b0d5f..817c4ec64 100644
    --- a/docs/api-docs/slack_bolt/listener_matcher/custom_listener_matcher.html
    +++ b/docs/api-docs/slack_bolt/listener_matcher/custom_listener_matcher.html
    @@ -28,7 +28,7 @@ 

    Module slack_bolt.listener_matcher.custom_listener_match
    import inspect
     from logging import Logger
    -from typing import Callable, Sequence
    +from typing import Callable, Sequence, Optional
     
     from slack_bolt.kwargs_injection import build_required_kwargs
     from slack_bolt.logger import get_bolt_app_logger
    @@ -43,11 +43,17 @@ 

    Module slack_bolt.listener_matcher.custom_listener_match arg_names: Sequence[str] logger: Logger - def __init__(self, *, app_name: str, func: Callable[..., bool]): + def __init__( + self, + *, + app_name: str, + func: Callable[..., bool], + base_logger: Optional[Logger] = None + ): self.app_name = app_name self.func = func self.arg_names = inspect.getfullargspec(func).args - self.logger = get_bolt_app_logger(self.app_name, self.func) + self.logger = get_bolt_app_logger(self.app_name, self.func, base_logger) def matches(self, req: BoltRequest, resp: BoltResponse) -> bool: return self.func( @@ -72,7 +78,7 @@

    Classes

    class CustomListenerMatcher -(*, app_name: str, func: Callable[..., bool]) +(*, app_name: str, func: Callable[..., bool], base_logger: Optional[logging.Logger] = None)
    @@ -86,11 +92,17 @@

    Classes

    arg_names: Sequence[str] logger: Logger - def __init__(self, *, app_name: str, func: Callable[..., bool]): + def __init__( + self, + *, + app_name: str, + func: Callable[..., bool], + base_logger: Optional[Logger] = None + ): self.app_name = app_name self.func = func self.arg_names = inspect.getfullargspec(func).args - self.logger = get_bolt_app_logger(self.app_name, self.func) + self.logger = get_bolt_app_logger(self.app_name, self.func, base_logger) def matches(self, req: BoltRequest, resp: BoltResponse) -> bool: return self.func( diff --git a/docs/api-docs/slack_bolt/logger/index.html b/docs/api-docs/slack_bolt/logger/index.html index 42ad13c85..911a0a32a 100644 --- a/docs/api-docs/slack_bolt/logger/index.html +++ b/docs/api-docs/slack_bolt/logger/index.html @@ -31,27 +31,48 @@

    Module slack_bolt.logger

    import logging from logging import Logger -from typing import Any +from typing import Any, Optional -def get_bolt_logger(cls: Any) -> Logger: +def get_bolt_logger(cls: Any, base_logger: Optional[Logger] = None) -> Logger: logger = logging.getLogger(f"slack_bolt.{cls.__name__}") - logger.disabled = logging.root.disabled - logger.level = logging.root.level + if base_logger is not None: + _configure_from_base_logger(logger, base_logger) + else: + _configure_from_root(logger) return logger -def get_bolt_app_logger(app_name: str, cls: object = None) -> Logger: - if cls and hasattr(cls, "__name__"): - logger = logging.getLogger(f"{app_name}:{cls.__name__}") - logger.disabled = logging.root.disabled - logger.level = logging.root.level - return logger +def get_bolt_app_logger( + app_name: str, cls: object = None, base_logger: Optional[Logger] = None +) -> Logger: + logger: Logger = ( + logging.getLogger(f"{app_name}:{cls.__name__}") + if cls and hasattr(cls, "__name__") + else logging.getLogger(app_name) + ) + + if base_logger is not None: + _configure_from_base_logger(logger, base_logger) else: - logger = logging.getLogger(app_name) - logger.disabled = logging.root.disabled - logger.level = logging.root.level - return logger

    + _configure_from_root(logger) + return logger + + +def _configure_from_base_logger(new_logger: Logger, base_logger: Logger): + new_logger.disabled = base_logger.disabled + new_logger.level = base_logger.level + if len(new_logger.handlers) == 0: + for h in base_logger.handlers: + new_logger.addHandler(h) + if len(new_logger.filters) == 0: + for f in base_logger.filters: + new_logger.addFilter(f) + + +def _configure_from_root(new_logger: Logger): + new_logger.disabled = logging.root.disabled + new_logger.level = logging.root.level

    @@ -69,7 +90,7 @@

    Sub-modules

    Functions

    -def get_bolt_app_logger(app_name: str, cls: object = None) ‑> logging.Logger +def get_bolt_app_logger(app_name: str, cls: object = None, base_logger: Optional[logging.Logger] = None) ‑> logging.Logger
    @@ -77,21 +98,24 @@

    Functions

    Expand source code -
    def get_bolt_app_logger(app_name: str, cls: object = None) -> Logger:
    -    if cls and hasattr(cls, "__name__"):
    -        logger = logging.getLogger(f"{app_name}:{cls.__name__}")
    -        logger.disabled = logging.root.disabled
    -        logger.level = logging.root.level
    -        return logger
    +
    def get_bolt_app_logger(
    +    app_name: str, cls: object = None, base_logger: Optional[Logger] = None
    +) -> Logger:
    +    logger: Logger = (
    +        logging.getLogger(f"{app_name}:{cls.__name__}")
    +        if cls and hasattr(cls, "__name__")
    +        else logging.getLogger(app_name)
    +    )
    +
    +    if base_logger is not None:
    +        _configure_from_base_logger(logger, base_logger)
         else:
    -        logger = logging.getLogger(app_name)
    -        logger.disabled = logging.root.disabled
    -        logger.level = logging.root.level
    -        return logger
    + _configure_from_root(logger) + return logger
    -def get_bolt_logger(cls: Any) ‑> logging.Logger +def get_bolt_logger(cls: Any, base_logger: Optional[logging.Logger] = None) ‑> logging.Logger
    @@ -99,10 +123,12 @@

    Functions

    Expand source code -
    def get_bolt_logger(cls: Any) -> Logger:
    +
    def get_bolt_logger(cls: Any, base_logger: Optional[Logger] = None) -> Logger:
         logger = logging.getLogger(f"slack_bolt.{cls.__name__}")
    -    logger.disabled = logging.root.disabled
    -    logger.level = logging.root.level
    +    if base_logger is not None:
    +        _configure_from_base_logger(logger, base_logger)
    +    else:
    +        _configure_from_root(logger)
         return logger
    diff --git a/docs/api-docs/slack_bolt/middleware/async_custom_middleware.html b/docs/api-docs/slack_bolt/middleware/async_custom_middleware.html index f4f454203..6f8247528 100644 --- a/docs/api-docs/slack_bolt/middleware/async_custom_middleware.html +++ b/docs/api-docs/slack_bolt/middleware/async_custom_middleware.html @@ -28,7 +28,7 @@

    Module slack_bolt.middleware.async_custom_middleware
    import inspect
     from logging import Logger
    -from typing import Callable, Awaitable, Any, Sequence
    +from typing import Callable, Awaitable, Any, Sequence, Optional
     
     from slack_bolt.kwargs_injection.async_utils import build_async_required_kwargs
     from slack_bolt.logger import get_bolt_app_logger
    @@ -44,7 +44,13 @@ 

    Module slack_bolt.middleware.async_custom_middlewareModule slack_bolt.middleware.async_custom_middlewareClasses

    class AsyncCustomMiddleware -(*, app_name: str, func: Callable[..., Awaitable[Any]]) +(*, app_name: str, func: Callable[..., Awaitable[Any]], base_logger: Optional[logging.Logger] = None)

    A middleware can process request data before other middleware and listener functions.

    @@ -105,7 +111,13 @@

    Classes

    arg_names: Sequence[str] logger: Logger - def __init__(self, *, app_name: str, func: Callable[..., Awaitable[Any]]): + def __init__( + self, + *, + app_name: str, + func: Callable[..., Awaitable[Any]], + base_logger: Optional[Logger] = None, + ): self.app_name = app_name if inspect.iscoroutinefunction(func): self.func = func @@ -113,7 +125,7 @@

    Classes

    raise ValueError("Async middleware function must be an async function") self.arg_names = inspect.getfullargspec(func).args - self.logger = get_bolt_app_logger(self.app_name, self.func) + self.logger = get_bolt_app_logger(self.app_name, self.func, base_logger) async def async_process( self, diff --git a/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html b/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html index 5c6528140..f388ec84a 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html @@ -26,7 +26,8 @@

    Module slack_bolt.middleware.authorization.async_multi_t Expand source code -
    from typing import Callable, Optional, Awaitable
    +
    from logging import Logger
    +from typing import Callable, Optional, Awaitable
     
     from slack_sdk.errors import SlackApiError
     from slack_bolt.logger import get_bolt_logger
    @@ -42,14 +43,17 @@ 

    Module slack_bolt.middleware.authorization.async_multi_t class AsyncMultiTeamsAuthorization(AsyncAuthorization): authorize: AsyncAuthorize - def __init__(self, authorize: AsyncAuthorize): + def __init__(self, authorize: AsyncAuthorize, base_logger: Optional[Logger] = None): """Multi-workspace authorization. Args: authorize: The function to authorize incoming requests from Slack. + base_logger: The base logger """ self.authorize = authorize - self.logger = get_bolt_logger(AsyncMultiTeamsAuthorization) + self.logger = get_bolt_logger( + AsyncMultiTeamsAuthorization, base_logger=base_logger + ) async def async_process( self, @@ -115,7 +119,7 @@

    Classes

    class AsyncMultiTeamsAuthorization -(authorize: AsyncAuthorize) +(authorize: AsyncAuthorize, base_logger: Optional[logging.Logger] = None)

    A middleware can process request data before other middleware and listener functions.

    @@ -124,6 +128,8 @@

    Args

    authorize
    The function to authorize incoming requests from Slack.
    +
    base_logger
    +
    The base logger
    @@ -132,14 +138,17 @@

    Args

    class AsyncMultiTeamsAuthorization(AsyncAuthorization):
         authorize: AsyncAuthorize
     
    -    def __init__(self, authorize: AsyncAuthorize):
    +    def __init__(self, authorize: AsyncAuthorize, base_logger: Optional[Logger] = None):
             """Multi-workspace authorization.
     
             Args:
                 authorize: The function to authorize incoming requests from Slack.
    +            base_logger: The base logger
             """
             self.authorize = authorize
    -        self.logger = get_bolt_logger(AsyncMultiTeamsAuthorization)
    +        self.logger = get_bolt_logger(
    +            AsyncMultiTeamsAuthorization, base_logger=base_logger
    +        )
     
         async def async_process(
             self,
    diff --git a/docs/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html b/docs/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html
    index 65fac44b0..89702d936 100644
    --- a/docs/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html
    +++ b/docs/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html
    @@ -26,7 +26,8 @@ 

    Module slack_bolt.middleware.authorization.async_single_ Expand source code -
    from typing import Callable, Awaitable, Optional
    +
    from logging import Logger
    +from typing import Callable, Awaitable, Optional
     
     from slack_bolt.logger import get_bolt_logger
     from slack_bolt.middleware.authorization.async_authorization import AsyncAuthorization
    @@ -40,10 +41,12 @@ 

    Module slack_bolt.middleware.authorization.async_single_ class AsyncSingleTeamAuthorization(AsyncAuthorization): - def __init__(self): + def __init__(self, base_logger: Optional[Logger] = None): """Single-workspace authorization.""" self.auth_test_result: Optional[AsyncSlackResponse] = None - self.logger = get_bolt_logger(AsyncSingleTeamAuthorization) + self.logger = get_bolt_logger( + AsyncSingleTeamAuthorization, base_logger=base_logger + ) async def async_process( self, @@ -101,6 +104,7 @@

    Classes

    class AsyncSingleTeamAuthorization +(base_logger: Optional[logging.Logger] = None)

    A middleware can process request data before other middleware and listener functions.

    @@ -110,10 +114,12 @@

    Classes

    Expand source code

    class AsyncSingleTeamAuthorization(AsyncAuthorization):
    -    def __init__(self):
    +    def __init__(self, base_logger: Optional[Logger] = None):
             """Single-workspace authorization."""
             self.auth_test_result: Optional[AsyncSlackResponse] = None
    -        self.logger = get_bolt_logger(AsyncSingleTeamAuthorization)
    +        self.logger = get_bolt_logger(
    +            AsyncSingleTeamAuthorization, base_logger=base_logger
    +        )
     
         async def async_process(
             self,
    diff --git a/docs/api-docs/slack_bolt/middleware/authorization/multi_teams_authorization.html b/docs/api-docs/slack_bolt/middleware/authorization/multi_teams_authorization.html
    index 31d6c1621..9e390013e 100644
    --- a/docs/api-docs/slack_bolt/middleware/authorization/multi_teams_authorization.html
    +++ b/docs/api-docs/slack_bolt/middleware/authorization/multi_teams_authorization.html
    @@ -26,7 +26,8 @@ 

    Module slack_bolt.middleware.authorization.multi_teams_a Expand source code -
    from typing import Callable, Optional
    +
    from logging import Logger
    +from typing import Callable, Optional
     
     from slack_sdk.errors import SlackApiError
     
    @@ -50,14 +51,16 @@ 

    Module slack_bolt.middleware.authorization.multi_teams_a self, *, authorize: Authorize, + base_logger: Optional[Logger] = None, ): """Multi-workspace authorization. Args: authorize: The function to authorize incoming requests from Slack. + base_logger: The base logger """ self.authorize = authorize - self.logger = get_bolt_logger(MultiTeamsAuthorization) + self.logger = get_bolt_logger(MultiTeamsAuthorization, base_logger=base_logger) def process( self, @@ -120,7 +123,7 @@

    Classes

    class MultiTeamsAuthorization -(*, authorize: Authorize) +(*, authorize: Authorize, base_logger: Optional[logging.Logger] = None)

    A middleware can process request data before other middleware and listener functions.

    @@ -129,6 +132,8 @@

    Args

    authorize
    The function to authorize incoming requests from Slack.
    +
    base_logger
    +
    The base logger
    @@ -141,14 +146,16 @@

    Args

    self, *, authorize: Authorize, + base_logger: Optional[Logger] = None, ): """Multi-workspace authorization. Args: authorize: The function to authorize incoming requests from Slack. + base_logger: The base logger """ self.authorize = authorize - self.logger = get_bolt_logger(MultiTeamsAuthorization) + self.logger = get_bolt_logger(MultiTeamsAuthorization, base_logger=base_logger) def process( self, diff --git a/docs/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html b/docs/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html index c59b62d7d..3d48d602e 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html @@ -26,7 +26,8 @@

    Module slack_bolt.middleware.authorization.single_team_a Expand source code -
    from typing import Callable, Optional
    +
    from logging import Logger
    +from typing import Callable, Optional
     
     from slack_bolt.logger import get_bolt_logger
     from .authorization import Authorization
    @@ -44,14 +45,20 @@ 

    Module slack_bolt.middleware.authorization.single_team_a class SingleTeamAuthorization(Authorization): - def __init__(self, *, auth_test_result: Optional[SlackResponse] = None): + def __init__( + self, + *, + auth_test_result: Optional[SlackResponse] = None, + base_logger: Optional[Logger] = None, + ): """Single-workspace authorization. Args: auth_test_result: The initial `auth.test` API call result. + base_logger: The base logger """ self.auth_test_result = auth_test_result - self.logger = get_bolt_logger(SingleTeamAuthorization) + self.logger = get_bolt_logger(SingleTeamAuthorization, base_logger=base_logger) def process( self, @@ -109,7 +116,7 @@

    Classes

    class SingleTeamAuthorization -(*, auth_test_result: Optional[slack_sdk.web.slack_response.SlackResponse] = None) +(*, auth_test_result: Optional[slack_sdk.web.slack_response.SlackResponse] = None, base_logger: Optional[logging.Logger] = None)

    A middleware can process request data before other middleware and listener functions.

    @@ -118,20 +125,28 @@

    Args

    auth_test_result
    The initial auth.test API call result.
    +
    base_logger
    +
    The base logger
    Expand source code
    class SingleTeamAuthorization(Authorization):
    -    def __init__(self, *, auth_test_result: Optional[SlackResponse] = None):
    +    def __init__(
    +        self,
    +        *,
    +        auth_test_result: Optional[SlackResponse] = None,
    +        base_logger: Optional[Logger] = None,
    +    ):
             """Single-workspace authorization.
     
             Args:
                 auth_test_result: The initial `auth.test` API call result.
    +            base_logger: The base logger
             """
             self.auth_test_result = auth_test_result
    -        self.logger = get_bolt_logger(SingleTeamAuthorization)
    +        self.logger = get_bolt_logger(SingleTeamAuthorization, base_logger=base_logger)
     
         def process(
             self,
    diff --git a/docs/api-docs/slack_bolt/middleware/custom_middleware.html b/docs/api-docs/slack_bolt/middleware/custom_middleware.html
    index 901f1b928..750e704c2 100644
    --- a/docs/api-docs/slack_bolt/middleware/custom_middleware.html
    +++ b/docs/api-docs/slack_bolt/middleware/custom_middleware.html
    @@ -28,7 +28,7 @@ 

    Module slack_bolt.middleware.custom_middleware
    import inspect
     from logging import Logger
    -from typing import Callable, Any, Sequence
    +from typing import Callable, Any, Sequence, Optional
     
     from slack_bolt.kwargs_injection import build_required_kwargs
     from slack_bolt.logger import get_bolt_app_logger
    @@ -44,11 +44,13 @@ 

    Module slack_bolt.middleware.custom_middlewareClasses

    class CustomMiddleware -(*, app_name: str, func: Callable) +(*, app_name: str, func: Callable, base_logger: Optional[logging.Logger] = None)

    A middleware can process request data before other middleware and listener functions.

    @@ -101,11 +103,13 @@

    Classes

    arg_names: Sequence[str] logger: Logger - def __init__(self, *, app_name: str, func: Callable): + def __init__( + self, *, app_name: str, func: Callable, base_logger: Optional[Logger] = None + ): self.app_name = app_name self.func = func self.arg_names = inspect.getfullargspec(func).args - self.logger = get_bolt_app_logger(self.app_name, self.func) + self.logger = get_bolt_app_logger(self.app_name, self.func, base_logger) def process( self, diff --git a/docs/api-docs/slack_bolt/middleware/ignoring_self_events/async_ignoring_self_events.html b/docs/api-docs/slack_bolt/middleware/ignoring_self_events/async_ignoring_self_events.html index b04e95361..f6e03efc5 100644 --- a/docs/api-docs/slack_bolt/middleware/ignoring_self_events/async_ignoring_self_events.html +++ b/docs/api-docs/slack_bolt/middleware/ignoring_self_events/async_ignoring_self_events.html @@ -61,6 +61,7 @@

    Classes

    class AsyncIgnoringSelfEvents +(base_logger: Optional[logging.Logger] = None)

    A middleware can process request data before other middleware and listener functions.

    diff --git a/docs/api-docs/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.html b/docs/api-docs/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.html index e7abb14fc..da31d3542 100644 --- a/docs/api-docs/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.html +++ b/docs/api-docs/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.html @@ -27,7 +27,7 @@

    Module slack_bolt.middleware.ignoring_self_events.ignori Expand source code

    import logging
    -from typing import Callable, Dict, Any
    +from typing import Callable, Dict, Any, Optional
     
     from slack_bolt.authorization import AuthorizeResult
     from slack_bolt.logger import get_bolt_logger
    @@ -37,9 +37,9 @@ 

    Module slack_bolt.middleware.ignoring_self_events.ignori class IgnoringSelfEvents(Middleware): - def __init__(self): + def __init__(self, base_logger: Optional[logging.Logger] = None): """Ignores the events generated by this bot user itself.""" - self.logger = get_bolt_logger(IgnoringSelfEvents) + self.logger = get_bolt_logger(IgnoringSelfEvents, base_logger=base_logger) def process( self, @@ -91,6 +91,7 @@

    Classes

    class IgnoringSelfEvents +(base_logger: Optional[logging.Logger] = None)

    A middleware can process request data before other middleware and listener functions.

    @@ -100,9 +101,9 @@

    Classes

    Expand source code
    class IgnoringSelfEvents(Middleware):
    -    def __init__(self):
    +    def __init__(self, base_logger: Optional[logging.Logger] = None):
             """Ignores the events generated by this bot user itself."""
    -        self.logger = get_bolt_logger(IgnoringSelfEvents)
    +        self.logger = get_bolt_logger(IgnoringSelfEvents, base_logger=base_logger)
     
         def process(
             self,
    diff --git a/docs/api-docs/slack_bolt/middleware/request_verification/async_request_verification.html b/docs/api-docs/slack_bolt/middleware/request_verification/async_request_verification.html
    index 853eaee48..9d532ffff 100644
    --- a/docs/api-docs/slack_bolt/middleware/request_verification/async_request_verification.html
    +++ b/docs/api-docs/slack_bolt/middleware/request_verification/async_request_verification.html
    @@ -75,7 +75,7 @@ 

    Classes

    class AsyncRequestVerification -(signing_secret: str) +(signing_secret: str, base_logger: Optional[logging.Logger] = None)

    Verifies an incoming request by checking the validity of @@ -88,6 +88,8 @@

    Args

    signing_secret
    The signing secret
    +
    base_logger
    +
    The base logger
    diff --git a/docs/api-docs/slack_bolt/middleware/request_verification/request_verification.html b/docs/api-docs/slack_bolt/middleware/request_verification/request_verification.html index 81e8e9952..65e62356a 100644 --- a/docs/api-docs/slack_bolt/middleware/request_verification/request_verification.html +++ b/docs/api-docs/slack_bolt/middleware/request_verification/request_verification.html @@ -26,7 +26,8 @@

    Module slack_bolt.middleware.request_verification.reques Expand source code -
    from typing import Callable, Dict, Any
    +
    from logging import Logger
    +from typing import Callable, Dict, Any, Optional
     
     from slack_sdk.signature import SignatureVerifier
     
    @@ -37,7 +38,7 @@ 

    Module slack_bolt.middleware.request_verification.reques class RequestVerification(Middleware): # type: ignore - def __init__(self, signing_secret: str): + def __init__(self, signing_secret: str, base_logger: Optional[Logger] = None): """Verifies an incoming request by checking the validity of `x-slack-signature`, `x-slack-request-timestamp`, and its body data. @@ -45,9 +46,10 @@

    Module slack_bolt.middleware.request_verification.reques Args: signing_secret: The signing secret + base_logger: The base logger """ self.verifier = SignatureVerifier(signing_secret=signing_secret) - self.logger = get_bolt_logger(RequestVerification) + self.logger = get_bolt_logger(RequestVerification, base_logger=base_logger) def process( self, @@ -101,7 +103,7 @@

    Classes

    class RequestVerification -(signing_secret: str) +(signing_secret: str, base_logger: Optional[logging.Logger] = None)

    A middleware can process request data before other middleware and listener functions.

    @@ -112,13 +114,15 @@

    Args

    signing_secret
    The signing secret
    +
    base_logger
    +
    The base logger
    Expand source code
    class RequestVerification(Middleware):  # type: ignore
    -    def __init__(self, signing_secret: str):
    +    def __init__(self, signing_secret: str, base_logger: Optional[Logger] = None):
             """Verifies an incoming request by checking the validity of
             `x-slack-signature`, `x-slack-request-timestamp`, and its body data.
     
    @@ -126,9 +130,10 @@ 

    Args

    Args: signing_secret: The signing secret + base_logger: The base logger """ self.verifier = SignatureVerifier(signing_secret=signing_secret) - self.logger = get_bolt_logger(RequestVerification) + self.logger = get_bolt_logger(RequestVerification, base_logger=base_logger) def process( self, diff --git a/docs/api-docs/slack_bolt/middleware/ssl_check/async_ssl_check.html b/docs/api-docs/slack_bolt/middleware/ssl_check/async_ssl_check.html index 76e2501a0..6624b8e10 100644 --- a/docs/api-docs/slack_bolt/middleware/ssl_check/async_ssl_check.html +++ b/docs/api-docs/slack_bolt/middleware/ssl_check/async_ssl_check.html @@ -64,7 +64,7 @@

    Classes

    class AsyncSslCheck -(verification_token: Optional[str] = None) +(verification_token: Optional[str] = None, base_logger: Optional[logging.Logger] = None)

    A middleware can process request data before other middleware and listener functions.

    @@ -75,6 +75,8 @@

    Args

    verification_token
    The verification token to check (optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation)
    +
    base_logger
    +
    The base logger

    diff --git a/docs/api-docs/slack_bolt/middleware/ssl_check/ssl_check.html b/docs/api-docs/slack_bolt/middleware/ssl_check/ssl_check.html index 76dcd8647..20fd600ed 100644 --- a/docs/api-docs/slack_bolt/middleware/ssl_check/ssl_check.html +++ b/docs/api-docs/slack_bolt/middleware/ssl_check/ssl_check.html @@ -39,16 +39,21 @@

    Module slack_bolt.middleware.ssl_check.ssl_check< verification_token: Optional[str] logger: Logger - def __init__(self, verification_token: Optional[str] = None): + def __init__( + self, + verification_token: Optional[str] = None, + base_logger: Optional[Logger] = None, + ): """Handles `ssl_check` requests. Refer to https://api.slack.com/interactivity/slash-commands for details. Args: verification_token: The verification token to check (optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation) + base_logger: The base logger """ self.verification_token = verification_token - self.logger = get_bolt_logger(SslCheck) + self.logger = get_bolt_logger(SslCheck, base_logger=base_logger) def process( self, @@ -96,7 +101,7 @@

    Classes

    class SslCheck -(verification_token: Optional[str] = None) +(verification_token: Optional[str] = None, base_logger: Optional[logging.Logger] = None)

    A middleware can process request data before other middleware and listener functions.

    @@ -107,6 +112,8 @@

    Args

    verification_token
    The verification token to check (optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation)
    +
    base_logger
    +
    The base logger
    @@ -116,16 +123,21 @@

    Args

    verification_token: Optional[str] logger: Logger - def __init__(self, verification_token: Optional[str] = None): + def __init__( + self, + verification_token: Optional[str] = None, + base_logger: Optional[Logger] = None, + ): """Handles `ssl_check` requests. Refer to https://api.slack.com/interactivity/slash-commands for details. Args: verification_token: The verification token to check (optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation) + base_logger: The base logger """ self.verification_token = verification_token - self.logger = get_bolt_logger(SslCheck) + self.logger = get_bolt_logger(SslCheck, base_logger=base_logger) def process( self, diff --git a/docs/api-docs/slack_bolt/middleware/url_verification/async_url_verification.html b/docs/api-docs/slack_bolt/middleware/url_verification/async_url_verification.html index 8a862b3c8..98c4cc403 100644 --- a/docs/api-docs/slack_bolt/middleware/url_verification/async_url_verification.html +++ b/docs/api-docs/slack_bolt/middleware/url_verification/async_url_verification.html @@ -26,7 +26,8 @@

    Module slack_bolt.middleware.url_verification.async_url_ Expand source code -
    from typing import Callable, Awaitable
    +
    from logging import Logger
    +from typing import Callable, Awaitable, Optional
     
     from slack_bolt.logger import get_bolt_logger
     from .url_verification import UrlVerification
    @@ -36,8 +37,8 @@ 

    Module slack_bolt.middleware.url_verification.async_url_ class AsyncUrlVerification(UrlVerification, AsyncMiddleware): - def __init__(self): - self.logger = get_bolt_logger(AsyncUrlVerification) + def __init__(self, base_logger: Optional[Logger] = None): + self.logger = get_bolt_logger(AsyncUrlVerification, base_logger=base_logger) async def async_process( self, @@ -63,18 +64,24 @@

    Classes

    class AsyncUrlVerification +(base_logger: Optional[logging.Logger] = None)

    A middleware can process request data before other middleware and listener functions.

    Handles url_verification requests.

    -

    Refer to https://api.slack.com/events/url_verification for details.

    +

    Refer to https://api.slack.com/events/url_verification for details.

    +

    Args

    +
    +
    base_logger
    +
    The base logger
    +
    Expand source code
    class AsyncUrlVerification(UrlVerification, AsyncMiddleware):
    -    def __init__(self):
    -        self.logger = get_bolt_logger(AsyncUrlVerification)
    +    def __init__(self, base_logger: Optional[Logger] = None):
    +        self.logger = get_bolt_logger(AsyncUrlVerification, base_logger=base_logger)
     
         async def async_process(
             self,
    diff --git a/docs/api-docs/slack_bolt/middleware/url_verification/url_verification.html b/docs/api-docs/slack_bolt/middleware/url_verification/url_verification.html
    index e1f45172d..be99bb396 100644
    --- a/docs/api-docs/slack_bolt/middleware/url_verification/url_verification.html
    +++ b/docs/api-docs/slack_bolt/middleware/url_verification/url_verification.html
    @@ -26,7 +26,8 @@ 

    Module slack_bolt.middleware.url_verification.url_verifi Expand source code -
    from typing import Callable
    +
    from logging import Logger
    +from typing import Callable, Optional
     
     from slack_bolt.logger import get_bolt_logger
     from slack_bolt.middleware.middleware import Middleware
    @@ -35,12 +36,15 @@ 

    Module slack_bolt.middleware.url_verification.url_verifi class UrlVerification(Middleware): # type: ignore - def __init__(self): + def __init__(self, base_logger: Optional[Logger] = None): """Handles url_verification requests. Refer to https://api.slack.com/events/url_verification for details. + + Args: + base_logger: The base logger """ - self.logger = get_bolt_logger(UrlVerification) + self.logger = get_bolt_logger(UrlVerification, base_logger=base_logger) def process( self, @@ -79,22 +83,31 @@

    Classes

    class UrlVerification +(base_logger: Optional[logging.Logger] = None)

    A middleware can process request data before other middleware and listener functions.

    Handles url_verification requests.

    -

    Refer to https://api.slack.com/events/url_verification for details.

    +

    Refer to https://api.slack.com/events/url_verification for details.

    +

    Args

    +
    +
    base_logger
    +
    The base logger
    +
    Expand source code
    class UrlVerification(Middleware):  # type: ignore
    -    def __init__(self):
    +    def __init__(self, base_logger: Optional[Logger] = None):
             """Handles url_verification requests.
     
             Refer to https://api.slack.com/events/url_verification for details.
    +
    +        Args:
    +            base_logger: The base logger
             """
    -        self.logger = get_bolt_logger(UrlVerification)
    +        self.logger = get_bolt_logger(UrlVerification, base_logger=base_logger)
     
         def process(
             self,
    diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html
    index aeabb6323..dc5919bc8 100644
    --- a/docs/api-docs/slack_bolt/version.html
    +++ b/docs/api-docs/slack_bolt/version.html
    @@ -28,7 +28,7 @@ 

    Module slack_bolt.version

    Expand source code

    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.12.0"
    +__version__ = "1.13.0"

    diff --git a/docs/api-docs/slack_bolt/workflows/step/async_step.html b/docs/api-docs/slack_bolt/workflows/step/async_step.html index c0a8c39d6..1a560fb77 100644 --- a/docs/api-docs/slack_bolt/workflows/step/async_step.html +++ b/docs/api-docs/slack_bolt/workflows/step/async_step.html @@ -27,6 +27,7 @@

    Module slack_bolt.workflows.step.async_step

    Expand source code
    from functools import wraps
    +from logging import Logger
     from typing import Callable, Union, Optional, Awaitable, Sequence, List, Pattern
     
     from slack_sdk.web.async_client import AsyncWebClient
    @@ -59,6 +60,7 @@ 

    Module slack_bolt.workflows.step.async_step

    """ callback_id: Union[str, Pattern] + _base_logger: Optional[Logger] _edit: Optional[AsyncListener] _save: Optional[AsyncListener] _execute: Optional[AsyncListener] @@ -67,6 +69,7 @@

    Module slack_bolt.workflows.step.async_step

    self, callback_id: Union[str, Pattern], app_name: Optional[str] = None, + base_logger: Optional[Logger] = None, ): """This builder is supposed to be used as decorator. @@ -89,9 +92,11 @@

    Module slack_bolt.workflows.step.async_step

    Args: callback_id: The callback_id for the workflow app_name: The application name mainly for logging + base_logger: The base logger """ self.callback_id = callback_id self.app_name = app_name or __name__ + self._base_logger = base_logger self._edit = None self._save = None self._execute = None @@ -245,7 +250,7 @@

    Module slack_bolt.workflows.step.async_step

    return _inner - def build(self) -> "AsyncWorkflowStep": + def build(self, base_logger: Optional[Logger] = None) -> "AsyncWorkflowStep": """Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. @@ -265,6 +270,7 @@

    Module slack_bolt.workflows.step.async_step

    save=self._save, execute=self._execute, app_name=self.app_name, + base_logger=base_logger, ) # --------------------------------------- @@ -285,6 +291,7 @@

    Module slack_bolt.workflows.step.async_step

    name=name, matchers=self.to_listener_matchers(self.app_name, matchers), middleware=self.to_listener_middleware(self.app_name, middleware), + base_logger=self._base_logger, ) @staticmethod @@ -347,16 +354,39 @@

    Module slack_bolt.workflows.step.async_step

    Callable[..., Awaitable[BoltResponse]], AsyncListener, Sequence[Callable] ], app_name: Optional[str] = None, + base_logger: Optional[Logger] = None, ): self.callback_id = callback_id app_name = app_name or __name__ - self.edit = self.build_listener(callback_id, app_name, edit, "edit") - self.save = self.build_listener(callback_id, app_name, save, "save") - self.execute = self.build_listener(callback_id, app_name, execute, "execute") + self.edit = self.build_listener( + callback_id=callback_id, + app_name=app_name, + listener_or_functions=edit, + name="edit", + base_logger=base_logger, + ) + self.save = self.build_listener( + callback_id=callback_id, + app_name=app_name, + listener_or_functions=save, + name="save", + base_logger=base_logger, + ) + self.execute = self.build_listener( + callback_id=callback_id, + app_name=app_name, + listener_or_functions=execute, + name="execute", + base_logger=base_logger, + ) @classmethod - def builder(cls, callback_id: Union[str, Pattern]) -> AsyncWorkflowStepBuilder: - return AsyncWorkflowStepBuilder(callback_id) + def builder( + cls, + callback_id: Union[str, Pattern], + base_logger: Optional[Logger] = None, + ) -> AsyncWorkflowStepBuilder: + return AsyncWorkflowStepBuilder(callback_id, base_logger=base_logger) @classmethod def build_listener( @@ -367,6 +397,7 @@

    Module slack_bolt.workflows.step.async_step

    name: str, matchers: Optional[List[AsyncListenerMatcher]] = None, middleware: Optional[List[AsyncMiddleware]] = None, + base_logger: Optional[Logger] = None, ): if listener_or_functions is None: raise BoltError(f"{name} listener is required (callback_id: {callback_id})") @@ -378,9 +409,13 @@

    Module slack_bolt.workflows.step.async_step

    return listener_or_functions elif isinstance(listener_or_functions, list): matchers = matchers if matchers else [] - matchers.insert(0, cls._build_primary_matcher(name, callback_id)) + matchers.insert( + 0, cls._build_primary_matcher(name, callback_id, base_logger) + ) middleware = middleware if middleware else [] - middleware.insert(0, cls._build_single_middleware(name, callback_id)) + middleware.insert( + 0, cls._build_single_middleware(name, callback_id, base_logger) + ) functions = listener_or_functions ack_function = functions.pop(0) return AsyncCustomListener( @@ -390,6 +425,7 @@

    Module slack_bolt.workflows.step.async_step

    ack_function=ack_function, lazy_functions=functions, auto_acknowledgement=name == "execute", + base_logger=base_logger, ) else: raise BoltError( @@ -398,25 +434,39 @@

    Module slack_bolt.workflows.step.async_step

    @classmethod def _build_primary_matcher( - cls, name: str, callback_id: str + cls, + name: str, + callback_id: str, + base_logger: Optional[Logger] = None, ) -> AsyncListenerMatcher: if name == "edit": - return workflow_step_edit(callback_id, asyncio=True) + return workflow_step_edit( + callback_id, asyncio=True, base_logger=base_logger + ) elif name == "save": - return workflow_step_save(callback_id, asyncio=True) + return workflow_step_save( + callback_id, asyncio=True, base_logger=base_logger + ) elif name == "execute": - return workflow_step_execute(callback_id, asyncio=True) + return workflow_step_execute( + callback_id, asyncio=True, base_logger=base_logger + ) else: raise ValueError(f"Invalid name {name}") @classmethod - def _build_single_middleware(cls, name: str, callback_id: str) -> AsyncMiddleware: + def _build_single_middleware( + cls, + name: str, + callback_id: str, + base_logger: Optional[Logger] = None, + ) -> AsyncMiddleware: if name == "edit": - return _build_edit_listener_middleware(callback_id) + return _build_edit_listener_middleware(callback_id, base_logger) elif name == "save": - return _build_save_listener_middleware() + return _build_save_listener_middleware(base_logger) elif name == "execute": - return _build_execute_listener_middleware() + return _build_execute_listener_middleware(base_logger) else: raise ValueError(f"Invalid name {name}") @@ -426,7 +476,10 @@

    Module slack_bolt.workflows.step.async_step

    ####################### -def _build_edit_listener_middleware(callback_id: str) -> AsyncMiddleware: +def _build_edit_listener_middleware( + callback_id: str, + base_logger: Optional[Logger] = None, +) -> AsyncMiddleware: async def edit_listener_middleware( context: AsyncBoltContext, client: AsyncWebClient, @@ -440,7 +493,11 @@

    Module slack_bolt.workflows.step.async_step

    ) return await next() - return AsyncCustomMiddleware(app_name=__name__, func=edit_listener_middleware) + return AsyncCustomMiddleware( + app_name=__name__, + func=edit_listener_middleware, + base_logger=base_logger, + ) ####################### @@ -448,7 +505,9 @@

    Module slack_bolt.workflows.step.async_step

    ####################### -def _build_save_listener_middleware() -> AsyncMiddleware: +def _build_save_listener_middleware( + base_logger: Optional[Logger] = None, +) -> AsyncMiddleware: async def save_listener_middleware( context: AsyncBoltContext, client: AsyncWebClient, @@ -461,7 +520,11 @@

    Module slack_bolt.workflows.step.async_step

    ) return await next() - return AsyncCustomMiddleware(app_name=__name__, func=save_listener_middleware) + return AsyncCustomMiddleware( + app_name=__name__, + func=save_listener_middleware, + base_logger=base_logger, + ) ####################### @@ -469,7 +532,9 @@

    Module slack_bolt.workflows.step.async_step

    ####################### -def _build_execute_listener_middleware() -> AsyncMiddleware: +def _build_execute_listener_middleware( + base_logger: Optional[Logger] = None, +) -> AsyncMiddleware: async def execute_listener_middleware( context: AsyncBoltContext, client: AsyncWebClient, @@ -486,7 +551,11 @@

    Module slack_bolt.workflows.step.async_step

    ) return await next() - return AsyncCustomMiddleware(app_name=__name__, func=execute_listener_middleware)
    + return AsyncCustomMiddleware( + app_name=__name__, + func=execute_listener_middleware, + base_logger=base_logger, + )
    @@ -500,7 +569,7 @@

    Classes

    class AsyncWorkflowStep -(*, callback_id: Union[str, Pattern], edit: Union[Callable[..., Awaitable[BoltResponse]], AsyncListener, Sequence[Callable]], save: Union[Callable[..., Awaitable[BoltResponse]], AsyncListener, Sequence[Callable]], execute: Union[Callable[..., Awaitable[BoltResponse]], AsyncListener, Sequence[Callable]], app_name: Optional[str] = None) +(*, callback_id: Union[str, Pattern], edit: Union[Callable[..., Awaitable[BoltResponse]], AsyncListener, Sequence[Callable]], save: Union[Callable[..., Awaitable[BoltResponse]], AsyncListener, Sequence[Callable]], execute: Union[Callable[..., Awaitable[BoltResponse]], AsyncListener, Sequence[Callable]], app_name: Optional[str] = None, base_logger: Optional[logging.Logger] = None)
    @@ -532,16 +601,39 @@

    Classes

    Callable[..., Awaitable[BoltResponse]], AsyncListener, Sequence[Callable] ], app_name: Optional[str] = None, + base_logger: Optional[Logger] = None, ): self.callback_id = callback_id app_name = app_name or __name__ - self.edit = self.build_listener(callback_id, app_name, edit, "edit") - self.save = self.build_listener(callback_id, app_name, save, "save") - self.execute = self.build_listener(callback_id, app_name, execute, "execute") + self.edit = self.build_listener( + callback_id=callback_id, + app_name=app_name, + listener_or_functions=edit, + name="edit", + base_logger=base_logger, + ) + self.save = self.build_listener( + callback_id=callback_id, + app_name=app_name, + listener_or_functions=save, + name="save", + base_logger=base_logger, + ) + self.execute = self.build_listener( + callback_id=callback_id, + app_name=app_name, + listener_or_functions=execute, + name="execute", + base_logger=base_logger, + ) @classmethod - def builder(cls, callback_id: Union[str, Pattern]) -> AsyncWorkflowStepBuilder: - return AsyncWorkflowStepBuilder(callback_id) + def builder( + cls, + callback_id: Union[str, Pattern], + base_logger: Optional[Logger] = None, + ) -> AsyncWorkflowStepBuilder: + return AsyncWorkflowStepBuilder(callback_id, base_logger=base_logger) @classmethod def build_listener( @@ -552,6 +644,7 @@

    Classes

    name: str, matchers: Optional[List[AsyncListenerMatcher]] = None, middleware: Optional[List[AsyncMiddleware]] = None, + base_logger: Optional[Logger] = None, ): if listener_or_functions is None: raise BoltError(f"{name} listener is required (callback_id: {callback_id})") @@ -563,9 +656,13 @@

    Classes

    return listener_or_functions elif isinstance(listener_or_functions, list): matchers = matchers if matchers else [] - matchers.insert(0, cls._build_primary_matcher(name, callback_id)) + matchers.insert( + 0, cls._build_primary_matcher(name, callback_id, base_logger) + ) middleware = middleware if middleware else [] - middleware.insert(0, cls._build_single_middleware(name, callback_id)) + middleware.insert( + 0, cls._build_single_middleware(name, callback_id, base_logger) + ) functions = listener_or_functions ack_function = functions.pop(0) return AsyncCustomListener( @@ -575,6 +672,7 @@

    Classes

    ack_function=ack_function, lazy_functions=functions, auto_acknowledgement=name == "execute", + base_logger=base_logger, ) else: raise BoltError( @@ -583,25 +681,39 @@

    Classes

    @classmethod def _build_primary_matcher( - cls, name: str, callback_id: str + cls, + name: str, + callback_id: str, + base_logger: Optional[Logger] = None, ) -> AsyncListenerMatcher: if name == "edit": - return workflow_step_edit(callback_id, asyncio=True) + return workflow_step_edit( + callback_id, asyncio=True, base_logger=base_logger + ) elif name == "save": - return workflow_step_save(callback_id, asyncio=True) + return workflow_step_save( + callback_id, asyncio=True, base_logger=base_logger + ) elif name == "execute": - return workflow_step_execute(callback_id, asyncio=True) + return workflow_step_execute( + callback_id, asyncio=True, base_logger=base_logger + ) else: raise ValueError(f"Invalid name {name}") @classmethod - def _build_single_middleware(cls, name: str, callback_id: str) -> AsyncMiddleware: + def _build_single_middleware( + cls, + name: str, + callback_id: str, + base_logger: Optional[Logger] = None, + ) -> AsyncMiddleware: if name == "edit": - return _build_edit_listener_middleware(callback_id) + return _build_edit_listener_middleware(callback_id, base_logger) elif name == "save": - return _build_save_listener_middleware() + return _build_save_listener_middleware(base_logger) elif name == "execute": - return _build_execute_listener_middleware() + return _build_execute_listener_middleware(base_logger) else: raise ValueError(f"Invalid name {name}")
    @@ -627,7 +739,7 @@

    Class variables

    Static methods

    -def build_listener(callback_id: Union[str, Pattern], app_name: str, listener_or_functions: Union[AsyncListener, Callable, List[Callable]], name: str, matchers: Optional[List[AsyncListenerMatcher]] = None, middleware: Optional[List[AsyncMiddleware]] = None) +def build_listener(callback_id: Union[str, Pattern], app_name: str, listener_or_functions: Union[AsyncListener, Callable, List[Callable]], name: str, matchers: Optional[List[AsyncListenerMatcher]] = None, middleware: Optional[List[AsyncMiddleware]] = None, base_logger: Optional[logging.Logger] = None)
    @@ -644,6 +756,7 @@

    Static methods

    name: str, matchers: Optional[List[AsyncListenerMatcher]] = None, middleware: Optional[List[AsyncMiddleware]] = None, + base_logger: Optional[Logger] = None, ): if listener_or_functions is None: raise BoltError(f"{name} listener is required (callback_id: {callback_id})") @@ -655,9 +768,13 @@

    Static methods

    return listener_or_functions elif isinstance(listener_or_functions, list): matchers = matchers if matchers else [] - matchers.insert(0, cls._build_primary_matcher(name, callback_id)) + matchers.insert( + 0, cls._build_primary_matcher(name, callback_id, base_logger) + ) middleware = middleware if middleware else [] - middleware.insert(0, cls._build_single_middleware(name, callback_id)) + middleware.insert( + 0, cls._build_single_middleware(name, callback_id, base_logger) + ) functions = listener_or_functions ack_function = functions.pop(0) return AsyncCustomListener( @@ -667,6 +784,7 @@

    Static methods

    ack_function=ack_function, lazy_functions=functions, auto_acknowledgement=name == "execute", + base_logger=base_logger, ) else: raise BoltError( @@ -675,7 +793,7 @@

    Static methods

    -def builder(callback_id: Union[str, Pattern]) ‑> AsyncWorkflowStepBuilder +def builder(callback_id: Union[str, Pattern], base_logger: Optional[logging.Logger] = None) ‑> AsyncWorkflowStepBuilder
    @@ -684,15 +802,19 @@

    Static methods

    Expand source code
    @classmethod
    -def builder(cls, callback_id: Union[str, Pattern]) -> AsyncWorkflowStepBuilder:
    -    return AsyncWorkflowStepBuilder(callback_id)
    +def builder( + cls, + callback_id: Union[str, Pattern], + base_logger: Optional[Logger] = None, +) -> AsyncWorkflowStepBuilder: + return AsyncWorkflowStepBuilder(callback_id, base_logger=base_logger)
    class AsyncWorkflowStepBuilder -(callback_id: Union[str, Pattern], app_name: Optional[str] = None) +(callback_id: Union[str, Pattern], app_name: Optional[str] = None, base_logger: Optional[logging.Logger] = None)

    Steps from Apps @@ -719,6 +841,8 @@

    Args

    The callback_id for the workflow
    app_name
    The application name mainly for logging
    +
    base_logger
    +
    The base logger
    @@ -730,6 +854,7 @@

    Args

    """ callback_id: Union[str, Pattern] + _base_logger: Optional[Logger] _edit: Optional[AsyncListener] _save: Optional[AsyncListener] _execute: Optional[AsyncListener] @@ -738,6 +863,7 @@

    Args

    self, callback_id: Union[str, Pattern], app_name: Optional[str] = None, + base_logger: Optional[Logger] = None, ): """This builder is supposed to be used as decorator. @@ -760,9 +886,11 @@

    Args

    Args: callback_id: The callback_id for the workflow app_name: The application name mainly for logging + base_logger: The base logger """ self.callback_id = callback_id self.app_name = app_name or __name__ + self._base_logger = base_logger self._edit = None self._save = None self._execute = None @@ -916,7 +1044,7 @@

    Args

    return _inner - def build(self) -> "AsyncWorkflowStep": + def build(self, base_logger: Optional[Logger] = None) -> "AsyncWorkflowStep": """Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. @@ -936,6 +1064,7 @@

    Args

    save=self._save, execute=self._execute, app_name=self.app_name, + base_logger=base_logger, ) # --------------------------------------- @@ -956,6 +1085,7 @@

    Args

    name=name, matchers=self.to_listener_matchers(self.app_name, matchers), middleware=self.to_listener_middleware(self.app_name, middleware), + base_logger=self._base_logger, ) @staticmethod @@ -1061,7 +1191,7 @@

    Static methods

    Methods

    -def build(self) ‑> AsyncWorkflowStep +def build(self, base_logger: Optional[logging.Logger] = None) ‑> AsyncWorkflowStep

    Constructs a WorkflowStep object. This method may raise an exception @@ -1072,7 +1202,7 @@

    Returns

    Expand source code -
    def build(self) -> "AsyncWorkflowStep":
    +
    def build(self, base_logger: Optional[Logger] = None) -> "AsyncWorkflowStep":
         """Constructs a WorkflowStep object. This method may raise an exception
         if the builder doesn't have enough configurations to build the object.
     
    @@ -1092,6 +1222,7 @@ 

    Returns

    save=self._save, execute=self._execute, app_name=self.app_name, + base_logger=base_logger, )
    diff --git a/docs/api-docs/slack_bolt/workflows/step/step.html b/docs/api-docs/slack_bolt/workflows/step/step.html index d65f4f9d1..f64c784d3 100644 --- a/docs/api-docs/slack_bolt/workflows/step/step.html +++ b/docs/api-docs/slack_bolt/workflows/step/step.html @@ -27,6 +27,7 @@

    Module slack_bolt.workflows.step.step

    Expand source code
    from functools import wraps
    +from logging import Logger
     from typing import Callable, Union, Optional, Sequence, Pattern, List
     
     from slack_bolt.context.context import BoltContext
    @@ -54,6 +55,7 @@ 

    Module slack_bolt.workflows.step.step

    """ callback_id: Union[str, Pattern] + _base_logger: Optional[Logger] _edit: Optional[Listener] _save: Optional[Listener] _execute: Optional[Listener] @@ -62,6 +64,7 @@

    Module slack_bolt.workflows.step.step

    self, callback_id: Union[str, Pattern], app_name: Optional[str] = None, + base_logger: Optional[Logger] = None, ): """This builder is supposed to be used as decorator. @@ -84,9 +87,11 @@

    Module slack_bolt.workflows.step.step

    Args: callback_id: The callback_id for the workflow app_name: The application name mainly for logging + base_logger: The base logger """ self.callback_id = callback_id self.app_name = app_name or __name__ + self._base_logger = base_logger self._edit = None self._save = None self._execute = None @@ -235,7 +240,7 @@

    Module slack_bolt.workflows.step.step

    return _inner - def build(self) -> "WorkflowStep": + def build(self, base_logger: Optional[Logger] = None) -> "WorkflowStep": """Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. @@ -255,6 +260,7 @@

    Module slack_bolt.workflows.step.step

    save=self._save, execute=self._execute, app_name=self.app_name, + base_logger=base_logger, ) # --------------------------------------- @@ -271,14 +277,20 @@

    Module slack_bolt.workflows.step.step

    app_name=self.app_name, listener_or_functions=listener_or_functions, name=name, - matchers=self.to_listener_matchers(self.app_name, matchers), - middleware=self.to_listener_middleware(self.app_name, middleware), + matchers=self.to_listener_matchers( + self.app_name, matchers, self._base_logger + ), + middleware=self.to_listener_middleware( + self.app_name, middleware, self._base_logger + ), + base_logger=self._base_logger, ) @staticmethod def to_listener_matchers( app_name: str, matchers: Optional[List[Union[Callable[..., bool], ListenerMatcher]]], + base_logger: Optional[Logger] = None, ) -> List[ListenerMatcher]: _matchers = [] if matchers is not None: @@ -286,14 +298,22 @@

    Module slack_bolt.workflows.step.step

    if isinstance(m, ListenerMatcher): _matchers.append(m) elif isinstance(m, Callable): - _matchers.append(CustomListenerMatcher(app_name=app_name, func=m)) + _matchers.append( + CustomListenerMatcher( + app_name=app_name, + func=m, + base_logger=base_logger, + ) + ) else: raise ValueError(f"Invalid matcher: {type(m)}") return _matchers # type: ignore @staticmethod def to_listener_middleware( - app_name: str, middleware: Optional[List[Union[Callable, Middleware]]] + app_name: str, + middleware: Optional[List[Union[Callable, Middleware]]], + base_logger: Optional[Logger] = None, ) -> List[Middleware]: _middleware = [] if middleware is not None: @@ -301,7 +321,13 @@

    Module slack_bolt.workflows.step.step

    if isinstance(m, Middleware): _middleware.append(m) elif isinstance(m, Callable): - _middleware.append(CustomMiddleware(app_name=app_name, func=m)) + _middleware.append( + CustomMiddleware( + app_name=app_name, + func=m, + base_logger=base_logger, + ) + ) else: raise ValueError(f"Invalid middleware: {type(m)}") return _middleware # type: ignore @@ -331,16 +357,40 @@

    Module slack_bolt.workflows.step.step

    Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable] ], app_name: Optional[str] = None, + base_logger: Optional[Logger] = None, ): self.callback_id = callback_id app_name = app_name or __name__ - self.edit = self.build_listener(callback_id, app_name, edit, "edit") - self.save = self.build_listener(callback_id, app_name, save, "save") - self.execute = self.build_listener(callback_id, app_name, execute, "execute") + self.edit = self.build_listener( + callback_id=callback_id, + app_name=app_name, + listener_or_functions=edit, + name="edit", + base_logger=base_logger, + ) + self.save = self.build_listener( + callback_id=callback_id, + app_name=app_name, + listener_or_functions=save, + name="save", + base_logger=base_logger, + ) + self.execute = self.build_listener( + callback_id=callback_id, + app_name=app_name, + listener_or_functions=execute, + name="execute", + base_logger=base_logger, + ) @classmethod - def builder(cls, callback_id: Union[str, Pattern]) -> WorkflowStepBuilder: - return WorkflowStepBuilder(callback_id) + def builder( + cls, callback_id: Union[str, Pattern], base_logger: Optional[Logger] = None + ) -> WorkflowStepBuilder: + return WorkflowStepBuilder( + callback_id, + base_logger=base_logger, + ) @classmethod def build_listener( @@ -351,6 +401,7 @@

    Module slack_bolt.workflows.step.step

    name: str, matchers: Optional[List[ListenerMatcher]] = None, middleware: Optional[List[Middleware]] = None, + base_logger: Optional[Logger] = None, ) -> Listener: if listener_or_functions is None: raise BoltError(f"{name} listener is required (callback_id: {callback_id})") @@ -362,9 +413,23 @@

    Module slack_bolt.workflows.step.step

    return listener_or_functions elif isinstance(listener_or_functions, list): matchers = matchers if matchers else [] - matchers.insert(0, cls._build_primary_matcher(name, callback_id)) + matchers.insert( + 0, + cls._build_primary_matcher( + name, + callback_id, + base_logger=base_logger, + ), + ) middleware = middleware if middleware else [] - middleware.insert(0, cls._build_single_middleware(name, callback_id)) + middleware.insert( + 0, + cls._build_single_middleware( + name, + callback_id, + base_logger=base_logger, + ), + ) functions = listener_or_functions ack_function = functions.pop(0) return CustomListener( @@ -374,6 +439,7 @@

    Module slack_bolt.workflows.step.step

    ack_function=ack_function, lazy_functions=functions, auto_acknowledgement=name == "execute", + base_logger=base_logger, ) else: raise BoltError( @@ -381,24 +447,34 @@

    Module slack_bolt.workflows.step.step

    ) @classmethod - def _build_primary_matcher(cls, name, callback_id) -> ListenerMatcher: + def _build_primary_matcher( + cls, + name: str, + callback_id: Union[str, Pattern], + base_logger: Optional[Logger] = None, + ) -> ListenerMatcher: if name == "edit": - return workflow_step_edit(callback_id) + return workflow_step_edit(callback_id, base_logger=base_logger) elif name == "save": - return workflow_step_save(callback_id) + return workflow_step_save(callback_id, base_logger=base_logger) elif name == "execute": - return workflow_step_execute(callback_id) + return workflow_step_execute(callback_id, base_logger=base_logger) else: raise ValueError(f"Invalid name {name}") @classmethod - def _build_single_middleware(cls, name, callback_id) -> Middleware: + def _build_single_middleware( + cls, + name: str, + callback_id: Union[str, Pattern], + base_logger: Optional[Logger] = None, + ) -> Middleware: if name == "edit": - return _build_edit_listener_middleware(callback_id) + return _build_edit_listener_middleware(callback_id, base_logger=base_logger) elif name == "save": - return _build_save_listener_middleware() + return _build_save_listener_middleware(base_logger=base_logger) elif name == "execute": - return _build_execute_listener_middleware() + return _build_execute_listener_middleware(base_logger=base_logger) else: raise ValueError(f"Invalid name {name}") @@ -408,7 +484,9 @@

    Module slack_bolt.workflows.step.step

    ####################### -def _build_edit_listener_middleware(callback_id: str) -> Middleware: +def _build_edit_listener_middleware( + callback_id: str, base_logger: Optional[Logger] = None +) -> Middleware: def edit_listener_middleware( context: BoltContext, client: WebClient, @@ -422,7 +500,11 @@

    Module slack_bolt.workflows.step.step

    ) return next() - return CustomMiddleware(app_name=__name__, func=edit_listener_middleware) + return CustomMiddleware( + app_name=__name__, + func=edit_listener_middleware, + base_logger=base_logger, + ) ####################### @@ -430,7 +512,7 @@

    Module slack_bolt.workflows.step.step

    ####################### -def _build_save_listener_middleware() -> Middleware: +def _build_save_listener_middleware(base_logger: Optional[Logger] = None) -> Middleware: def save_listener_middleware( context: BoltContext, client: WebClient, @@ -443,7 +525,11 @@

    Module slack_bolt.workflows.step.step

    ) return next() - return CustomMiddleware(app_name=__name__, func=save_listener_middleware) + return CustomMiddleware( + app_name=__name__, + func=save_listener_middleware, + base_logger=base_logger, + ) ####################### @@ -451,7 +537,9 @@

    Module slack_bolt.workflows.step.step

    ####################### -def _build_execute_listener_middleware() -> Middleware: +def _build_execute_listener_middleware( + base_logger: Optional[Logger] = None, +) -> Middleware: def execute_listener_middleware( context: BoltContext, client: WebClient, @@ -468,7 +556,11 @@

    Module slack_bolt.workflows.step.step

    ) return next() - return CustomMiddleware(app_name=__name__, func=execute_listener_middleware)
    + return CustomMiddleware( + app_name=__name__, + func=execute_listener_middleware, + base_logger=base_logger, + )
    @@ -482,7 +574,7 @@

    Classes

    class WorkflowStep -(*, callback_id: Union[str, Pattern], edit: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]], save: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]], execute: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]], app_name: Optional[str] = None) +(*, callback_id: Union[str, Pattern], edit: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]], save: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]], execute: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]], app_name: Optional[str] = None, base_logger: Optional[logging.Logger] = None)
    @@ -514,16 +606,40 @@

    Classes

    Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable] ], app_name: Optional[str] = None, + base_logger: Optional[Logger] = None, ): self.callback_id = callback_id app_name = app_name or __name__ - self.edit = self.build_listener(callback_id, app_name, edit, "edit") - self.save = self.build_listener(callback_id, app_name, save, "save") - self.execute = self.build_listener(callback_id, app_name, execute, "execute") + self.edit = self.build_listener( + callback_id=callback_id, + app_name=app_name, + listener_or_functions=edit, + name="edit", + base_logger=base_logger, + ) + self.save = self.build_listener( + callback_id=callback_id, + app_name=app_name, + listener_or_functions=save, + name="save", + base_logger=base_logger, + ) + self.execute = self.build_listener( + callback_id=callback_id, + app_name=app_name, + listener_or_functions=execute, + name="execute", + base_logger=base_logger, + ) @classmethod - def builder(cls, callback_id: Union[str, Pattern]) -> WorkflowStepBuilder: - return WorkflowStepBuilder(callback_id) + def builder( + cls, callback_id: Union[str, Pattern], base_logger: Optional[Logger] = None + ) -> WorkflowStepBuilder: + return WorkflowStepBuilder( + callback_id, + base_logger=base_logger, + ) @classmethod def build_listener( @@ -534,6 +650,7 @@

    Classes

    name: str, matchers: Optional[List[ListenerMatcher]] = None, middleware: Optional[List[Middleware]] = None, + base_logger: Optional[Logger] = None, ) -> Listener: if listener_or_functions is None: raise BoltError(f"{name} listener is required (callback_id: {callback_id})") @@ -545,9 +662,23 @@

    Classes

    return listener_or_functions elif isinstance(listener_or_functions, list): matchers = matchers if matchers else [] - matchers.insert(0, cls._build_primary_matcher(name, callback_id)) + matchers.insert( + 0, + cls._build_primary_matcher( + name, + callback_id, + base_logger=base_logger, + ), + ) middleware = middleware if middleware else [] - middleware.insert(0, cls._build_single_middleware(name, callback_id)) + middleware.insert( + 0, + cls._build_single_middleware( + name, + callback_id, + base_logger=base_logger, + ), + ) functions = listener_or_functions ack_function = functions.pop(0) return CustomListener( @@ -557,6 +688,7 @@

    Classes

    ack_function=ack_function, lazy_functions=functions, auto_acknowledgement=name == "execute", + base_logger=base_logger, ) else: raise BoltError( @@ -564,24 +696,34 @@

    Classes

    ) @classmethod - def _build_primary_matcher(cls, name, callback_id) -> ListenerMatcher: + def _build_primary_matcher( + cls, + name: str, + callback_id: Union[str, Pattern], + base_logger: Optional[Logger] = None, + ) -> ListenerMatcher: if name == "edit": - return workflow_step_edit(callback_id) + return workflow_step_edit(callback_id, base_logger=base_logger) elif name == "save": - return workflow_step_save(callback_id) + return workflow_step_save(callback_id, base_logger=base_logger) elif name == "execute": - return workflow_step_execute(callback_id) + return workflow_step_execute(callback_id, base_logger=base_logger) else: raise ValueError(f"Invalid name {name}") @classmethod - def _build_single_middleware(cls, name, callback_id) -> Middleware: + def _build_single_middleware( + cls, + name: str, + callback_id: Union[str, Pattern], + base_logger: Optional[Logger] = None, + ) -> Middleware: if name == "edit": - return _build_edit_listener_middleware(callback_id) + return _build_edit_listener_middleware(callback_id, base_logger=base_logger) elif name == "save": - return _build_save_listener_middleware() + return _build_save_listener_middleware(base_logger=base_logger) elif name == "execute": - return _build_execute_listener_middleware() + return _build_execute_listener_middleware(base_logger=base_logger) else: raise ValueError(f"Invalid name {name}") @@ -607,7 +749,7 @@

    Class variables

    Static methods

    -def build_listener(callback_id: Union[str, Pattern], app_name: str, listener_or_functions: Union[Listener, Callable, List[Callable]], name: str, matchers: Optional[List[ListenerMatcher]] = None, middleware: Optional[List[Middleware]] = None) ‑> Listener +def build_listener(callback_id: Union[str, Pattern], app_name: str, listener_or_functions: Union[Listener, Callable, List[Callable]], name: str, matchers: Optional[List[ListenerMatcher]] = None, middleware: Optional[List[Middleware]] = None, base_logger: Optional[logging.Logger] = None) ‑> Listener
    @@ -624,6 +766,7 @@

    Static methods

    name: str, matchers: Optional[List[ListenerMatcher]] = None, middleware: Optional[List[Middleware]] = None, + base_logger: Optional[Logger] = None, ) -> Listener: if listener_or_functions is None: raise BoltError(f"{name} listener is required (callback_id: {callback_id})") @@ -635,9 +778,23 @@

    Static methods

    return listener_or_functions elif isinstance(listener_or_functions, list): matchers = matchers if matchers else [] - matchers.insert(0, cls._build_primary_matcher(name, callback_id)) + matchers.insert( + 0, + cls._build_primary_matcher( + name, + callback_id, + base_logger=base_logger, + ), + ) middleware = middleware if middleware else [] - middleware.insert(0, cls._build_single_middleware(name, callback_id)) + middleware.insert( + 0, + cls._build_single_middleware( + name, + callback_id, + base_logger=base_logger, + ), + ) functions = listener_or_functions ack_function = functions.pop(0) return CustomListener( @@ -647,6 +804,7 @@

    Static methods

    ack_function=ack_function, lazy_functions=functions, auto_acknowledgement=name == "execute", + base_logger=base_logger, ) else: raise BoltError( @@ -655,7 +813,7 @@

    Static methods

    -def builder(callback_id: Union[str, Pattern]) ‑> WorkflowStepBuilder +def builder(callback_id: Union[str, Pattern], base_logger: Optional[logging.Logger] = None) ‑> WorkflowStepBuilder
    @@ -664,15 +822,20 @@

    Static methods

    Expand source code
    @classmethod
    -def builder(cls, callback_id: Union[str, Pattern]) -> WorkflowStepBuilder:
    -    return WorkflowStepBuilder(callback_id)
    +def builder( + cls, callback_id: Union[str, Pattern], base_logger: Optional[Logger] = None +) -> WorkflowStepBuilder: + return WorkflowStepBuilder( + callback_id, + base_logger=base_logger, + )
    class WorkflowStepBuilder -(callback_id: Union[str, Pattern], app_name: Optional[str] = None) +(callback_id: Union[str, Pattern], app_name: Optional[str] = None, base_logger: Optional[logging.Logger] = None)

    Steps from Apps @@ -699,6 +862,8 @@

    Args

    The callback_id for the workflow
    app_name
    The application name mainly for logging
    +
    base_logger
    +
    The base logger
    @@ -710,6 +875,7 @@

    Args

    """ callback_id: Union[str, Pattern] + _base_logger: Optional[Logger] _edit: Optional[Listener] _save: Optional[Listener] _execute: Optional[Listener] @@ -718,6 +884,7 @@

    Args

    self, callback_id: Union[str, Pattern], app_name: Optional[str] = None, + base_logger: Optional[Logger] = None, ): """This builder is supposed to be used as decorator. @@ -740,9 +907,11 @@

    Args

    Args: callback_id: The callback_id for the workflow app_name: The application name mainly for logging + base_logger: The base logger """ self.callback_id = callback_id self.app_name = app_name or __name__ + self._base_logger = base_logger self._edit = None self._save = None self._execute = None @@ -891,7 +1060,7 @@

    Args

    return _inner - def build(self) -> "WorkflowStep": + def build(self, base_logger: Optional[Logger] = None) -> "WorkflowStep": """Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. @@ -911,6 +1080,7 @@

    Args

    save=self._save, execute=self._execute, app_name=self.app_name, + base_logger=base_logger, ) # --------------------------------------- @@ -927,14 +1097,20 @@

    Args

    app_name=self.app_name, listener_or_functions=listener_or_functions, name=name, - matchers=self.to_listener_matchers(self.app_name, matchers), - middleware=self.to_listener_middleware(self.app_name, middleware), + matchers=self.to_listener_matchers( + self.app_name, matchers, self._base_logger + ), + middleware=self.to_listener_middleware( + self.app_name, middleware, self._base_logger + ), + base_logger=self._base_logger, ) @staticmethod def to_listener_matchers( app_name: str, matchers: Optional[List[Union[Callable[..., bool], ListenerMatcher]]], + base_logger: Optional[Logger] = None, ) -> List[ListenerMatcher]: _matchers = [] if matchers is not None: @@ -942,14 +1118,22 @@

    Args

    if isinstance(m, ListenerMatcher): _matchers.append(m) elif isinstance(m, Callable): - _matchers.append(CustomListenerMatcher(app_name=app_name, func=m)) + _matchers.append( + CustomListenerMatcher( + app_name=app_name, + func=m, + base_logger=base_logger, + ) + ) else: raise ValueError(f"Invalid matcher: {type(m)}") return _matchers # type: ignore @staticmethod def to_listener_middleware( - app_name: str, middleware: Optional[List[Union[Callable, Middleware]]] + app_name: str, + middleware: Optional[List[Union[Callable, Middleware]]], + base_logger: Optional[Logger] = None, ) -> List[Middleware]: _middleware = [] if middleware is not None: @@ -957,7 +1141,13 @@

    Args

    if isinstance(m, Middleware): _middleware.append(m) elif isinstance(m, Callable): - _middleware.append(CustomMiddleware(app_name=app_name, func=m)) + _middleware.append( + CustomMiddleware( + app_name=app_name, + func=m, + base_logger=base_logger, + ) + ) else: raise ValueError(f"Invalid middleware: {type(m)}") return _middleware # type: ignore @@ -972,7 +1162,7 @@

    Class variables

    Static methods

    -def to_listener_matchers(app_name: str, matchers: Optional[List[Union[Callable[..., bool], ListenerMatcher]]]) ‑> List[ListenerMatcher] +def to_listener_matchers(app_name: str, matchers: Optional[List[Union[Callable[..., bool], ListenerMatcher]]], base_logger: Optional[logging.Logger] = None) ‑> List[ListenerMatcher]
    @@ -984,6 +1174,7 @@

    Static methods

    def to_listener_matchers( app_name: str, matchers: Optional[List[Union[Callable[..., bool], ListenerMatcher]]], + base_logger: Optional[Logger] = None, ) -> List[ListenerMatcher]: _matchers = [] if matchers is not None: @@ -991,14 +1182,20 @@

    Static methods

    if isinstance(m, ListenerMatcher): _matchers.append(m) elif isinstance(m, Callable): - _matchers.append(CustomListenerMatcher(app_name=app_name, func=m)) + _matchers.append( + CustomListenerMatcher( + app_name=app_name, + func=m, + base_logger=base_logger, + ) + ) else: raise ValueError(f"Invalid matcher: {type(m)}") return _matchers # type: ignore
    -def to_listener_middleware(app_name: str, middleware: Optional[List[Union[Callable, Middleware]]]) ‑> List[Middleware] +def to_listener_middleware(app_name: str, middleware: Optional[List[Union[Callable, Middleware]]], base_logger: Optional[logging.Logger] = None) ‑> List[Middleware]
    @@ -1008,7 +1205,9 @@

    Static methods

    @staticmethod
     def to_listener_middleware(
    -    app_name: str, middleware: Optional[List[Union[Callable, Middleware]]]
    +    app_name: str,
    +    middleware: Optional[List[Union[Callable, Middleware]]],
    +    base_logger: Optional[Logger] = None,
     ) -> List[Middleware]:
         _middleware = []
         if middleware is not None:
    @@ -1016,7 +1215,13 @@ 

    Static methods

    if isinstance(m, Middleware): _middleware.append(m) elif isinstance(m, Callable): - _middleware.append(CustomMiddleware(app_name=app_name, func=m)) + _middleware.append( + CustomMiddleware( + app_name=app_name, + func=m, + base_logger=base_logger, + ) + ) else: raise ValueError(f"Invalid middleware: {type(m)}") return _middleware # type: ignore
    @@ -1026,7 +1231,7 @@

    Static methods

    Methods

    -def build(self) ‑> WorkflowStep +def build(self, base_logger: Optional[logging.Logger] = None) ‑> WorkflowStep

    Constructs a WorkflowStep object. This method may raise an exception @@ -1037,7 +1242,7 @@

    Returns

    Expand source code -
    def build(self) -> "WorkflowStep":
    +
    def build(self, base_logger: Optional[Logger] = None) -> "WorkflowStep":
         """Constructs a WorkflowStep object. This method may raise an exception
         if the builder doesn't have enough configurations to build the object.
     
    @@ -1057,6 +1262,7 @@ 

    Returns

    save=self._save, execute=self._execute, app_name=self.app_name, + base_logger=base_logger, )
    diff --git a/slack_bolt/version.py b/slack_bolt/version.py index aada8e7e5..d48ad3d3a 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.12.0" +__version__ = "1.13.0" From e47cba85b85365490497d581b73f4e815b7b70f4 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 19 Mar 2022 19:09:16 +0900 Subject: [PATCH 319/719] Add more unit tests --- tests/slack_bolt/listener/__init__.py | 0 .../test_listener_completion_handler.py | 27 ++++++++++++ .../listener/test_listener_start_handler.py | 27 ++++++++++++ tests/slack_bolt/workflows/__init__.py | 0 tests/slack_bolt/workflows/step/__init__.py | 0 tests/slack_bolt/workflows/step/test_step.py | 42 +++++++++++++++++++ tests/slack_bolt_async/listener/__init__.py | 0 .../test_async_listener_completion_handler.py | 29 +++++++++++++ .../test_async_listener_start_handler.py | 29 +++++++++++++ tests/slack_bolt_async/workflows/__init__.py | 0 .../workflows/step/__init__.py | 0 .../workflows/step/test_async_step.py | 42 +++++++++++++++++++ 12 files changed, 196 insertions(+) create mode 100644 tests/slack_bolt/listener/__init__.py create mode 100644 tests/slack_bolt/listener/test_listener_completion_handler.py create mode 100644 tests/slack_bolt/listener/test_listener_start_handler.py create mode 100644 tests/slack_bolt/workflows/__init__.py create mode 100644 tests/slack_bolt/workflows/step/__init__.py create mode 100644 tests/slack_bolt/workflows/step/test_step.py create mode 100644 tests/slack_bolt_async/listener/__init__.py create mode 100644 tests/slack_bolt_async/listener/test_async_listener_completion_handler.py create mode 100644 tests/slack_bolt_async/listener/test_async_listener_start_handler.py create mode 100644 tests/slack_bolt_async/workflows/__init__.py create mode 100644 tests/slack_bolt_async/workflows/step/__init__.py create mode 100644 tests/slack_bolt_async/workflows/step/test_async_step.py diff --git a/tests/slack_bolt/listener/__init__.py b/tests/slack_bolt/listener/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/slack_bolt/listener/test_listener_completion_handler.py b/tests/slack_bolt/listener/test_listener_completion_handler.py new file mode 100644 index 000000000..b55a6eb27 --- /dev/null +++ b/tests/slack_bolt/listener/test_listener_completion_handler.py @@ -0,0 +1,27 @@ +import logging + +from slack_bolt import BoltRequest +from slack_bolt.listener.listener_completion_handler import ( + CustomListenerCompletionHandler, +) + + +class TestListenerCompletionHandler: + def test_handler(self): + result = {"called": False} + + def f(): + result["called"] = True + + handler = CustomListenerCompletionHandler( + logger=logging.getLogger(__name__), + func=f, + ) + request = BoltRequest( + body="{}", + query={}, + headers={"content-type": ["application/json"]}, + context={}, + ) + handler.handle(request, None) + assert result["called"] is True diff --git a/tests/slack_bolt/listener/test_listener_start_handler.py b/tests/slack_bolt/listener/test_listener_start_handler.py new file mode 100644 index 000000000..73a4d9c10 --- /dev/null +++ b/tests/slack_bolt/listener/test_listener_start_handler.py @@ -0,0 +1,27 @@ +import logging + +from slack_bolt import BoltRequest +from slack_bolt.listener.listener_start_handler import ( + CustomListenerStartHandler, +) + + +class TestListenerStartHandler: + def test_handler(self): + result = {"called": False} + + def f(): + result["called"] = True + + handler = CustomListenerStartHandler( + logger=logging.getLogger(__name__), + func=f, + ) + request = BoltRequest( + body="{}", + query={}, + headers={"content-type": ["application/json"]}, + context={}, + ) + handler.handle(request, None) + assert result["called"] is True diff --git a/tests/slack_bolt/workflows/__init__.py b/tests/slack_bolt/workflows/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/slack_bolt/workflows/step/__init__.py b/tests/slack_bolt/workflows/step/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/slack_bolt/workflows/step/test_step.py b/tests/slack_bolt/workflows/step/test_step.py new file mode 100644 index 000000000..ebde40ee5 --- /dev/null +++ b/tests/slack_bolt/workflows/step/test_step.py @@ -0,0 +1,42 @@ +import pytest + +from slack_bolt import Ack +from slack_bolt.error import BoltError +from slack_bolt.workflows.step import WorkflowStep + + +class TestStep: + def test_build(self): + step = WorkflowStep.builder("foo") + step.edit(just_ack) + step.save(just_ack) + step.execute(just_ack) + assert step.build() is not None + + def test_build_errors(self): + with pytest.raises(BoltError): + step = WorkflowStep.builder("foo") + step.edit(None) + step.save(just_ack) + step.execute(just_ack) + step.build() + with pytest.raises(BoltError): + step = WorkflowStep.builder("foo") + step.edit(just_ack) + step.save(None) + step.execute(just_ack) + step.build() + with pytest.raises(BoltError): + step = WorkflowStep.builder("foo") + step.edit(just_ack) + step.save(just_ack) + step.execute(None) + step.build() + + +def just_ack(ack: Ack): + ack() + + +def execute(): + pass diff --git a/tests/slack_bolt_async/listener/__init__.py b/tests/slack_bolt_async/listener/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/slack_bolt_async/listener/test_async_listener_completion_handler.py b/tests/slack_bolt_async/listener/test_async_listener_completion_handler.py new file mode 100644 index 000000000..c03789329 --- /dev/null +++ b/tests/slack_bolt_async/listener/test_async_listener_completion_handler.py @@ -0,0 +1,29 @@ +import logging +import pytest + +from slack_bolt.request.async_request import AsyncBoltRequest +from slack_bolt.listener.async_listener_completion_handler import ( + AsyncCustomListenerCompletionHandler, +) + + +class TestAsyncListenerCompletionHandler: + @pytest.mark.asyncio + async def test_handler(self): + result = {"called": False} + + async def f(): + result["called"] = True + + handler = AsyncCustomListenerCompletionHandler( + logger=logging.getLogger(__name__), + func=f, + ) + request = AsyncBoltRequest( + body="{}", + query={}, + headers={"content-type": ["application/json"]}, + context={}, + ) + await handler.handle(request, None) + assert result["called"] is True diff --git a/tests/slack_bolt_async/listener/test_async_listener_start_handler.py b/tests/slack_bolt_async/listener/test_async_listener_start_handler.py new file mode 100644 index 000000000..0a69a671d --- /dev/null +++ b/tests/slack_bolt_async/listener/test_async_listener_start_handler.py @@ -0,0 +1,29 @@ +import logging +import pytest + +from slack_bolt.request.async_request import AsyncBoltRequest +from slack_bolt.listener.async_listener_start_handler import ( + AsyncCustomListenerStartHandler, +) + + +class TestAsyncListenerStartHandler: + @pytest.mark.asyncio + async def test_handler(self): + result = {"called": False} + + async def f(): + result["called"] = True + + handler = AsyncCustomListenerStartHandler( + logger=logging.getLogger(__name__), + func=f, + ) + request = AsyncBoltRequest( + body="{}", + query={}, + headers={"content-type": ["application/json"]}, + context={}, + ) + await handler.handle(request, None) + assert result["called"] is True diff --git a/tests/slack_bolt_async/workflows/__init__.py b/tests/slack_bolt_async/workflows/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/slack_bolt_async/workflows/step/__init__.py b/tests/slack_bolt_async/workflows/step/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/slack_bolt_async/workflows/step/test_async_step.py b/tests/slack_bolt_async/workflows/step/test_async_step.py new file mode 100644 index 000000000..550dd3c46 --- /dev/null +++ b/tests/slack_bolt_async/workflows/step/test_async_step.py @@ -0,0 +1,42 @@ +import pytest + +from slack_bolt import Ack +from slack_bolt.error import BoltError +from slack_bolt.workflows.step.async_step import AsyncWorkflowStep + + +class TestStep: + def test_build(self): + step = AsyncWorkflowStep.builder("foo") + step.edit(just_ack) + step.save(just_ack) + step.execute(just_ack) + assert step.build() is not None + + def test_build_errors(self): + with pytest.raises(BoltError): + step = AsyncWorkflowStep.builder("foo") + step.edit(None) + step.save(just_ack) + step.execute(just_ack) + step.build() + with pytest.raises(BoltError): + step = AsyncWorkflowStep.builder("foo") + step.edit(just_ack) + step.save(None) + step.execute(just_ack) + step.build() + with pytest.raises(BoltError): + step = AsyncWorkflowStep.builder("foo") + step.edit(just_ack) + step.save(just_ack) + step.execute(None) + step.build() + + +def just_ack(ack: Ack): + ack() + + +def execute(): + pass From 8bdc43aafe9d498a25c57aafd933e18d1e024588 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sun, 20 Mar 2022 08:46:50 +0900 Subject: [PATCH 320/719] Update tests and test settings --- setup.py | 2 +- tests/slack_bolt/workflows/step/test_step.py | 3 --- tests/slack_bolt_async/workflows/step/test_async_step.py | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 758953f86..811f907cf 100755 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ ] async_test_dependencies = test_dependencies + [ - "pytest-asyncio<1", # for async + "pytest-asyncio>=0.18.2,<1", # for async "aiohttp>=3,<4", # for async ] diff --git a/tests/slack_bolt/workflows/step/test_step.py b/tests/slack_bolt/workflows/step/test_step.py index ebde40ee5..107154439 100644 --- a/tests/slack_bolt/workflows/step/test_step.py +++ b/tests/slack_bolt/workflows/step/test_step.py @@ -16,21 +16,18 @@ def test_build(self): def test_build_errors(self): with pytest.raises(BoltError): step = WorkflowStep.builder("foo") - step.edit(None) step.save(just_ack) step.execute(just_ack) step.build() with pytest.raises(BoltError): step = WorkflowStep.builder("foo") step.edit(just_ack) - step.save(None) step.execute(just_ack) step.build() with pytest.raises(BoltError): step = WorkflowStep.builder("foo") step.edit(just_ack) step.save(just_ack) - step.execute(None) step.build() diff --git a/tests/slack_bolt_async/workflows/step/test_async_step.py b/tests/slack_bolt_async/workflows/step/test_async_step.py index 550dd3c46..f377d8906 100644 --- a/tests/slack_bolt_async/workflows/step/test_async_step.py +++ b/tests/slack_bolt_async/workflows/step/test_async_step.py @@ -16,21 +16,18 @@ def test_build(self): def test_build_errors(self): with pytest.raises(BoltError): step = AsyncWorkflowStep.builder("foo") - step.edit(None) step.save(just_ack) step.execute(just_ack) step.build() with pytest.raises(BoltError): step = AsyncWorkflowStep.builder("foo") step.edit(just_ack) - step.save(None) step.execute(just_ack) step.build() with pytest.raises(BoltError): step = AsyncWorkflowStep.builder("foo") step.edit(just_ack) step.save(just_ack) - step.execute(None) step.build() From 6c868f3b2c87e4768e4ce7a888096a39c408ac48 Mon Sep 17 00:00:00 2001 From: Sarah Jiang Date: Mon, 21 Mar 2022 17:21:33 -0700 Subject: [PATCH 321/719] Improve oauth lambda deploy instructs (#621) Co-authored-by: Kazuhiro Sera --- examples/aws_lambda/README.md | 202 ++++++++++++++++++++-------------- 1 file changed, 118 insertions(+), 84 deletions(-) diff --git a/examples/aws_lambda/README.md b/examples/aws_lambda/README.md index 15b3f3bc3..6b486d028 100644 --- a/examples/aws_lambda/README.md +++ b/examples/aws_lambda/README.md @@ -85,87 +85,121 @@ Instructions on how to set up and deploy each example are provided below. ## OAuth Lambda Listener Example Bolt App -1. You need an AWS account and your AWS credentials set up on your machine. -2. Make sure you have an AWS IAM Role defined with the needed permissions for - your Lambda function powering your Slack app: - - Head to the AWS IAM section of AWS Console - - Click Roles from the menu - - Click the Create Role button - - Under "Select type of trusted entity", choose "AWS service" - - Under "Choose a use case", select "Common use cases: Lambda" - - Click "Next: Permissions" - - Under "Attach permission policies", enter "lambda" in the Filter input - - Check the "AWSLambdaBasicExecutionRole" and "AWSLambdaExecute" policies - - Under "Attach permission policies", enter "s3" in the Filter input - - Check the "AWSS3FullAccess" policy - - Click "Next: tags" - - Click "Next: review" - - Enter `bolt_python_s3_storage` as the Role name. You can change this - if you want, but then make sure to update the role name in - `aws_lambda_oauth_config.yaml` - - Optionally enter a description for the role, such as "Bolt Python with S3 - access role" -3. Ensure you have created an app on api.slack.com/apps as per the [Getting - Started Guide](https://slack.dev/bolt-python/tutorial/getting-started). - You do not need to ensure you have installed it to a workspace, as the OAuth - flow will provide your app the ability to be installed by anyone. -4. You will need to create two S3 buckets: one to store installation credentials - (when a new Slack workspace installs your app) and one to store state - variables during the OAuth flow. You will need the names of these buckets in - the next step. -5. You need many environment variables exported! Specifically the following from - api.slack.com/apps: - - `SLACK_SIGNING_SECRET`: Signing Secret from Basic Information page - - `SLACK_CLIENT_ID`: Client ID from Basic Information page - - `SLACK_CLIENT_SECRET`: Client Secret from Basic Information page - - `SLACK_SCOPES="app_mentions:read,chat:write"`: Which scopes this application - needs - - `SLACK_INSTALLATION_S3_BUCKET_NAME`: The name of one of the S3 buckets you - created - - `SLACK_STATE_S3_BUCKET_NAME`: The name of the other S3 bucket you created -6. Let's deploy the Lambda! Run `./deploy_oauth.sh`. By default it deploys to the - us-east-1 region in AWS - you can change this at the top of `aws_lambda_oauth_config.yaml` if you wish. -7. Load up AWS Lambda inside the AWS Console - make sure you are in the correct - region that you deployed your app to. You should see a `bolt_py_oauth_function` - Lambda there. -8. While your Lambda exists, it is not accessible to the internet, so Slack - cannot send events happening in your Slack workspace to your Lambda. Let's - fix that by adding an AWS API Gateway in front of your Lambda so that your - Lambda can accept HTTP requests: - - Click on your `bolt_py_oauth_function` Lambda - - In the Function Overview, on the left side, click "+ Add Trigger" - - Select API Gateway from the trigger list - - Make sure "Create an API" is selected in the dropdown, and choose "HTTP API" - as the API Type - - Under Security, select "Open" - - Click "Add" -9. Congrats! Your Slack app is now accessible to the public. On the left side of - your `bolt_py_oauth_function` Function Overview you should see a purple API Gateway - icon. Click it. -10. Click Details to expand the details section. -11. Copy the API Endpoint - this is the URL your Lambda function is accessible - at publicly. -12. We will now inform Slack that this example app can accept Slash Commands. - - Back on api.slack.com/apps, select your app and choose Slash Commands from the left menu. - - Click Create New Command - - By default, the `aws_lambda_oauth.py` function has logic for a - `/hello-bolt-python-lambda` command. Enter `/hello-bolt-python-lambda` as - the Command. - - Under Request URL, paste in the previously-copied API Endpoint from API - Gateway. - - Click Save -13. We also need to register the API Endpoint as the OAuth redirect URL: - - Load up the "OAuth & Permissions" page on api.slack.com/apps - - Scroll down to Redirect URLs - - Copy the API endpoint in - but remove the path portion. The Redirect URL - needs to only _partially_ match where we will send users. -14. You can now install the app to any workspace! -15. Test it out! Once installed to a Slack workspace, try typing - `/hello-bolt-python-lambda hello`. -16. If you have issues, here are some debugging options: - - Check the Monitor tab under your Lambda. Did the Lambda get invoked? Did it - respond with an error? Investigate the graphs to see how your Lambda is - behaving. - - From this same Monitor tab, you can also click "View Logs in CloudWatch" to - see the execution logs for your Lambda. This can be helpful to see what - errors are being raised. +### Setup your AWS Account + Credentials +You need an AWS account and your AWS credentials set up on your machine. + +Once you’ve done that you should have access to AWS Console, which is what we’ll use for the rest of this tutorial. + +### Create S3 Buckets to store Installations and State + +1. Start by creating two S3 buckets: + 1. One to store installation credentials for each Slack workspace that installs your app. + 2. One to store state variables during the OAuth flow. +2. Head over to **Amazon S3** in the AWS Console +3. Give your bucket a name, region, and set access controls. If you’re doing this for the first time, it’s easiest to keep the defaults and edit them later as necessary. We'll be using the names: + 1. slack-installations-s3 + 2. slack-state-store-s3 +4. After your buckets are created, in each bucket’s page head over to “Properties” and save the Amazon Resource Name (ARN). It should look something like `arn:aws:s3:::slack-installations-s3`. + +### Create a Policy to Enable Actions on S3 Buckets +Now let's create a policy that will allow the holder of the policy to take actions in your S3 buckets. + +1. Head over to Identity and Access Management (IAM) in the AWS Console via Search Bar +2. Head to **Access Management > Policies** and select “Create Policy” +3. Click the JSON tab and copy this in: +```json +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "s3:Get*", + "s3:Put*", + "s3:Delete*", + "s3-object-lambda:*" + ], + "Resource": [ + "/*", // don't forget the `/*` + "/*" + ] + } + ] +} +``` +4. Edit “Resource” to include the ARNs of the two buckets you created in the earlier step. These need to exactly match the ARNS you copied earlier and end with a `/*` +5. Hit "Next:Tags" and "Next:Review" +6. Review policy + 1. Name your policy something memorable enough that you won’t have forgotten it 5 minutes from now when we’ll need to look it up from a list. (e.g. AmazonS3-FullAccess-SlackBuckets) + 2. Review the summary, and hit "Create Policy". Once the policy is created you should be redirected to the Policies page and see your new policy show up as Customer managed policy. + +### Setup an AWS IAM Role with Policies for Executing Your Lambda +Let’s create a user role that will use the custom policy we created as well as other policies to let us execute our lambda, write output logs to CloudWatch. + +1. Head to the **Identity and Access Management (IAM)** section of AWS Console +2. Select **Access Management > Roles** from the menu +3. Click "Create Role" +4. Step 1 - Select trusted entity + 1. Under "Select type of trusted entity", choose "AWS service" + 2. Under "Choose a use case", select "Common use cases: Lambda" + 3. Click "Next: Permissions” +5. Step 2 - Add permissions + 1. Add the following policies to the role we’re creating that will allow the user with the role permission to execute Lambda, make changes to their S3 Buckets, log output to CloudWatch + 1. `AWSLambdaExecute` + 2. `AWSLambdaBasicExecutionRole` + 3. `` +6. Step 3 - Name, review, create + 1. Enter `bolt_python_s3_storage` as your role name. To use a different name, make sure to update the role name in `aws_lambda_oauth_config.yaml` + 2. Optionally enter a description for the role, such as "Bolt Python with S3 access role” + 3. "Create Role" + +### Create Slack App and Load your Lambda to AWS +Ensure you have created an app on [api.slack.com/apps](https://api.slack.com/apps) as per the [Getting Started Guide](https://slack.dev/bolt-python/tutorial/getting-started). You do not need to ensure you have installed it to a workspace, as the OAuth flow will provide your app the ability to be installed by anyone. + +1. Remember those S3 buckets we made? You will need the names of these buckets again in the next step. +2. You need many environment variables exported! Specifically the following from api.slack.com/apps + +```bash +SLACK_SIGNING_SECRET= # Signing Secret from Basic Information page +SLACK_CLIENT_ID= # Client ID from Basic Information page +SLACK_CLIENT_SECRET # Client Secret from Basic Information page +SLACK_SCOPES= "app_mentions:read,chat:write" +SLACK_INSTALLATION_S3_BUCKET_NAME: # The name of installations bucket +SLACK_STATE_S3_BUCKET_NAME: # The name of the state store bucket +export +``` +6. Let's deploy the Lambda! Run `./deploy_oauth.sh`. By default it deploys to the us-east-1 region in AWS - you can customize this in `aws_lambda_oauth_config.yaml`. +7. Load up AWS Lambda inside the AWS Console - make sure you are in the correct region that you deployed your app to. You should see a `bolt_py_oauth_function` Lambda there. + +### Set up AWS API Gateway +Your Lambda exists, but it is not accessible to the internet, so Slack cannot yet send events happening in your Slack workspace to your Lambda. Let's fix that by adding an AWS API Gateway in front of your Lambda so that your Lambda can accept HTTP requests + +1. Click on your `bolt_py_oauth_function` Lambda +2. In the **Function Overview**, on the left side, click "+ Add Trigger" +3. Select "API Gateway" from the trigger list +4. Make sure "Create an API" is selected in the dropdown, and choose "HTTP API" as the API Type +5. Under Security, select "Open" +6. Click "Add" + +Phew, congrats! Your Slack app is now accessible to the public. On the left side of your bolt_py_oauth_function Function Overview you should see a purple API Gateway icon. Click it. + +1. Click "Details" +2. Copy the API Endpoint - this is the URL your Lambda function is accessible at publicly. +3. We will now inform Slack that this example app can accept Slash Commands. +4. Back on [api.slack.com/apps](https://api.slack.com/apps), select your app and choose "Slash Commands" from the left menu. +5. Click "Create New Command" + 1. By default, the `aws_lambda_oauth.py` function has logic for a /hello-bolt-python-lambda command. Enter `/hello-bolt-python-lambda` as the Command. + * Under **Request URL**, paste in the previously-copied API Endpoint from API Gateway. + * Click "Save" +6. We also need to register the API Endpoint as the OAuth redirect URL: + 1. Load up the **OAuth & Permissions** page on[api.slack.com/apps](https://api.slack.com/apps) + 2. Scroll down to "Redirect URLs" + 3. Copy the API endpoint in - but remove the path portion. The Redirect URL needs to only partially match where we will send users. + +You can now install the app to any workspace! + +### Test it out! +1. Once installed to a Slack workspace, try typing `/hello-bolt-python-lambda` hello. +2. If you have issues, here are some debugging options: + 1. _View lambda activity_: Head to the Monitor tab under your Lambda. Did the Lambda get invoked? Did it respond with an error? Investigate the graphs to see how your Lambda is behaving. + 2. _Check out the logs_: From this same Monitor tab, you can also click "View Logs in CloudWatch" to see the execution logs for your Lambda. This can be helpful to see what errors are being raised. From cc194b7e782b5a69a76fd443affaa6be65f030f1 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 23 Mar 2022 14:58:26 +0900 Subject: [PATCH 322/719] Fix #622 by adding Socket Mode healthcheck endpoint examples (#623) --- examples/socket_mode_async_healthcheck.py | 56 +++++++++++++++++++++++ examples/socket_mode_healthcheck.py | 50 ++++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 examples/socket_mode_async_healthcheck.py create mode 100644 examples/socket_mode_healthcheck.py diff --git a/examples/socket_mode_async_healthcheck.py b/examples/socket_mode_async_healthcheck.py new file mode 100644 index 000000000..26de6b786 --- /dev/null +++ b/examples/socket_mode_async_healthcheck.py @@ -0,0 +1,56 @@ +import logging +import os +from typing import Optional + +from slack_sdk.socket_mode.aiohttp import SocketModeClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.adapter.socket_mode.async_handler import AsyncSocketModeHandler + +logging.basicConfig(level=logging.DEBUG) + +# +# Socket Mode Bolt app +# + +# Install the Slack app and get xoxb- token in advance +app = AsyncApp(token=os.environ["SLACK_BOT_TOKEN"]) +socket_mode_client: Optional[SocketModeClient] = None + + +@app.event("app_mention") +async def event_test(event, say): + await say(f"Hi there, <@{event['user']}>!") + + +# +# Web app for hosting the healthcheck endpoint for k8s etc. +# + +from aiohttp import web + + +async def healthcheck(_req: web.Request): + if socket_mode_client is not None and socket_mode_client.is_connected(): + return web.Response(status=200, text="OK") + return web.Response(status=503, text="The Socket Mode client is inactive") + + +web_app = app.web_app() +web_app.add_routes([web.get("/health", healthcheck)]) + + +# +# Start the app +# + +if __name__ == "__main__": + + async def start_socket_mode(_web_app: web.Application): + handler = AsyncSocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]) + await handler.connect_async() + global socket_mode_client + socket_mode_client = handler.client + + app.web_app().on_startup.append(start_socket_mode) + app.start(8080) diff --git a/examples/socket_mode_healthcheck.py b/examples/socket_mode_healthcheck.py new file mode 100644 index 000000000..b76e14b87 --- /dev/null +++ b/examples/socket_mode_healthcheck.py @@ -0,0 +1,50 @@ +import logging +import os +from slack_bolt import App +from slack_bolt.adapter.socket_mode import SocketModeHandler + +logging.basicConfig(level=logging.DEBUG) + +# +# Socket Mode Bolt app +# + +# Install the Slack app and get xoxb- token in advance +app = App(token=os.environ["SLACK_BOT_TOKEN"]) +socket_mode_handler = SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]) + + +@app.event("app_mention") +def event_test(event, say): + say(f"Hi there, <@{event['user']}>!") + + +# +# Web app for hosting the healthcheck endpoint for k8s etc. +# + +# pip install Flask +from flask import Flask, make_response + +flask_app = Flask(__name__) + + +@flask_app.route("/health", methods=["GET"]) +def slack_events(): + if ( + socket_mode_handler.client is not None + and socket_mode_handler.client.is_connected() + ): + return make_response("OK", 200) + return make_response("The Socket Mode client is inactive", 503) + + +# +# Start the app +# +# export SLACK_APP_TOKEN=xapp-*** +# export SLACK_BOT_TOKEN=xoxb-*** + +if __name__ == "__main__": + socket_mode_handler.connect() # does not block the current thread + flask_app.run(port=8080) From 5a42d8c9c2b83793becb18cee1cbb59e7b9e1845 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 24 Mar 2022 11:41:55 +0900 Subject: [PATCH 323/719] Improve AIOHTTP example code --- examples/socket_mode_async_healthcheck.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/socket_mode_async_healthcheck.py b/examples/socket_mode_async_healthcheck.py index 26de6b786..2f183a462 100644 --- a/examples/socket_mode_async_healthcheck.py +++ b/examples/socket_mode_async_healthcheck.py @@ -52,5 +52,9 @@ async def start_socket_mode(_web_app: web.Application): global socket_mode_client socket_mode_client = handler.client - app.web_app().on_startup.append(start_socket_mode) - app.start(8080) + async def shutdown_socket_mode(_web_app: web.Application): + await socket_mode_client.close() + + web_app.on_startup.append(start_socket_mode) + web_app.on_shutdown.append(shutdown_socket_mode) + web.run_app(app=web_app, port=8080) From 1b10a83fddfb24584fd16b75f893d0292e0b4970 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 4 Apr 2022 07:10:10 +0900 Subject: [PATCH 324/719] Fix build errors due to click, jinja2 breaking changes --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 811f907cf..c8f95dec8 100755 --- a/setup.py +++ b/setup.py @@ -18,7 +18,9 @@ "Flask-Sockets>=0.2,<1", # TODO: This module is not yet Flask 2.x compatible "Werkzeug>=1,<2", # TODO: Flask-Sockets is not yet compatible with Flask 2.x "itsdangerous==2.0.1", # TODO: Flask-Sockets is not yet compatible with Flask 2.x - "black==22.1.0", + "Jinja2==3.0.3", # https://github.com/pallets/flask/issues/4494 + "black==22.3.0", + "click<=8.0.4", # black is affected by https://github.com/pallets/click/issues/2225 ] adapter_test_dependencies = [ From 02c35203d17f3c30a42bb4ed8a765cab3e1ab8ec Mon Sep 17 00:00:00 2001 From: Fil Maj Date: Wed, 13 Apr 2022 17:16:04 -0400 Subject: [PATCH 325/719] Update AWS example documentation with correct AWS Lambda roles required to run. Fixes #632. (#633) --- examples/aws_lambda/README.md | 25 +++++++++++++------------ examples/aws_lambda/aws_lambda_oauth.py | 2 ++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/examples/aws_lambda/README.md b/examples/aws_lambda/README.md index 6b486d028..e78a25571 100644 --- a/examples/aws_lambda/README.md +++ b/examples/aws_lambda/README.md @@ -24,7 +24,7 @@ Instructions on how to set up and deploy each example are provided below. - Under "Choose a use case", select "Common use cases: Lambda" - Click "Next: Permissions" - Under "Attach permission policies", enter "lambda" in the Filter input - - Check the "AWSLambdaBasicExecutionRole" and "AWSLambdaExecute" policies + - Check the "AWSLambdaBasicExecutionRole", "AWSLambdaExecute" and "AWSLambdaRole" policies - Click "Next: tags" - Click "Next: review" - Enter `bolt_python_lambda_invocation` as the Role name. You can change this @@ -86,17 +86,17 @@ Instructions on how to set up and deploy each example are provided below. ## OAuth Lambda Listener Example Bolt App ### Setup your AWS Account + Credentials -You need an AWS account and your AWS credentials set up on your machine. +You need an AWS account and your AWS credentials set up on your machine. Once you’ve done that you should have access to AWS Console, which is what we’ll use for the rest of this tutorial. ### Create S3 Buckets to store Installations and State -1. Start by creating two S3 buckets: +1. Start by creating two S3 buckets: 1. One to store installation credentials for each Slack workspace that installs your app. 2. One to store state variables during the OAuth flow. 2. Head over to **Amazon S3** in the AWS Console -3. Give your bucket a name, region, and set access controls. If you’re doing this for the first time, it’s easiest to keep the defaults and edit them later as necessary. We'll be using the names: +3. Give your bucket a name, region, and set access controls. If you’re doing this for the first time, it’s easiest to keep the defaults and edit them later as necessary. We'll be using the names: 1. slack-installations-s3 2. slack-state-store-s3 4. After your buckets are created, in each bucket’s page head over to “Properties” and save the Amazon Resource Name (ARN). It should look something like `arn:aws:s3:::slack-installations-s3`. @@ -121,7 +121,7 @@ Now let's create a policy that will allow the holder of the policy to take actio ], "Resource": [ "/*", // don't forget the `/*` - "/*" + "/*" ] } ] @@ -130,8 +130,8 @@ Now let's create a policy that will allow the holder of the policy to take actio 4. Edit “Resource” to include the ARNs of the two buckets you created in the earlier step. These need to exactly match the ARNS you copied earlier and end with a `/*` 5. Hit "Next:Tags" and "Next:Review" 6. Review policy - 1. Name your policy something memorable enough that you won’t have forgotten it 5 minutes from now when we’ll need to look it up from a list. (e.g. AmazonS3-FullAccess-SlackBuckets) - 2. Review the summary, and hit "Create Policy". Once the policy is created you should be redirected to the Policies page and see your new policy show up as Customer managed policy. + 1. Name your policy something memorable enough that you won’t have forgotten it 5 minutes from now when we’ll need to look it up from a list. (e.g. AmazonS3-FullAccess-SlackBuckets) + 2. Review the summary, and hit "Create Policy". Once the policy is created you should be redirected to the Policies page and see your new policy show up as Customer managed policy. ### Setup an AWS IAM Role with Policies for Executing Your Lambda Let’s create a user role that will use the custom policy we created as well as other policies to let us execute our lambda, write output logs to CloudWatch. @@ -142,12 +142,13 @@ Let’s create a user role that will use the custom policy we created as well as 4. Step 1 - Select trusted entity 1. Under "Select type of trusted entity", choose "AWS service" 2. Under "Choose a use case", select "Common use cases: Lambda" - 3. Click "Next: Permissions” + 3. Click "Next: Permissions" 5. Step 2 - Add permissions 1. Add the following policies to the role we’re creating that will allow the user with the role permission to execute Lambda, make changes to their S3 Buckets, log output to CloudWatch 1. `AWSLambdaExecute` 2. `AWSLambdaBasicExecutionRole` - 3. `` + 3. `AWSLambdaRole` + 4. `` 6. Step 3 - Name, review, create 1. Enter `bolt_python_s3_storage` as your role name. To use a different name, make sure to update the role name in `aws_lambda_oauth_config.yaml` 2. Optionally enter a description for the role, such as "Bolt Python with S3 access role” @@ -166,12 +167,12 @@ SLACK_CLIENT_SECRET # Client Secret from Basic Information page SLACK_SCOPES= "app_mentions:read,chat:write" SLACK_INSTALLATION_S3_BUCKET_NAME: # The name of installations bucket SLACK_STATE_S3_BUCKET_NAME: # The name of the state store bucket -export +export ``` 6. Let's deploy the Lambda! Run `./deploy_oauth.sh`. By default it deploys to the us-east-1 region in AWS - you can customize this in `aws_lambda_oauth_config.yaml`. 7. Load up AWS Lambda inside the AWS Console - make sure you are in the correct region that you deployed your app to. You should see a `bolt_py_oauth_function` Lambda there. -### Set up AWS API Gateway +### Set up AWS API Gateway Your Lambda exists, but it is not accessible to the internet, so Slack cannot yet send events happening in your Slack workspace to your Lambda. Let's fix that by adding an AWS API Gateway in front of your Lambda so that your Lambda can accept HTTP requests 1. Click on your `bolt_py_oauth_function` Lambda @@ -198,7 +199,7 @@ Phew, congrats! Your Slack app is now accessible to the public. On the left side You can now install the app to any workspace! -### Test it out! +### Test it out! 1. Once installed to a Slack workspace, try typing `/hello-bolt-python-lambda` hello. 2. If you have issues, here are some debugging options: 1. _View lambda activity_: Head to the Monitor tab under your Lambda. Did the Lambda get invoked? Did it respond with an error? Investigate the graphs to see how your Lambda is behaving. diff --git a/examples/aws_lambda/aws_lambda_oauth.py b/examples/aws_lambda/aws_lambda_oauth.py index f30609a1c..06b2572a6 100644 --- a/examples/aws_lambda/aws_lambda_oauth.py +++ b/examples/aws_lambda/aws_lambda_oauth.py @@ -42,6 +42,8 @@ def handler(event, context): # AWS IAM Role: bolt_python_s3_storage # - AmazonS3FullAccess # - AWSLambdaBasicExecutionRole +# - AWSLambdaExecute +# - AWSLambdaRole # rm -rf latest_slack_bolt && cp -pr ../../src latest_slack_bolt # pip install python-lambda From 0184e21201c7cfdbb4ed413e5afa5d68750a773f Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 22 Apr 2022 22:53:33 +0900 Subject: [PATCH 326/719] Upgrade pytype version to the latest (#636) --- scripts/run_pytype.sh | 2 +- slack_bolt/app/app.py | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/run_pytype.sh b/scripts/run_pytype.sh index 267fb8efe..780bf87fc 100755 --- a/scripts/run_pytype.sh +++ b/scripts/run_pytype.sh @@ -5,5 +5,5 @@ script_dir=$(dirname $0) cd ${script_dir}/.. && \ pip install -e ".[async]" && \ pip install -e ".[adapter]" && \ - pip install "pytype==2022.3.8" && \ + pip install "pytype==2022.4.15" && \ pytype slack_bolt/ diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 7ee3fb096..c94cbfebe 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -1453,13 +1453,19 @@ def do_GET(self): request_path, _, query = self.path.partition("?") if request_path == _bolt_oauth_flow.install_path: bolt_req = BoltRequest( - body="", query=query, headers=self.headers + body="", + query=query, + # email.message.Message's mapping interface is dict compatible + headers=self.headers, # type:ignore ) bolt_resp = _bolt_oauth_flow.handle_installation(bolt_req) self._send_bolt_response(bolt_resp) elif request_path == _bolt_oauth_flow.redirect_uri_path: bolt_req = BoltRequest( - body="", query=query, headers=self.headers + body="", + query=query, + # email.message.Message's mapping interface is dict compatible + headers=self.headers, # type:ignore ) bolt_resp = _bolt_oauth_flow.handle_callback(bolt_req) self._send_bolt_response(bolt_resp) @@ -1477,7 +1483,10 @@ def do_POST(self): len_header = self.headers.get("Content-Length") or 0 request_body = self.rfile.read(int(len_header)).decode("utf-8") bolt_req = BoltRequest( - body=request_body, query=query, headers=self.headers + body=request_body, + query=query, + # email.message.Message's mapping interface is dict compatible + headers=self.headers, # type:ignore ) bolt_resp: BoltResponse = _bolt_app.dispatch(bolt_req) self._send_bolt_response(bolt_resp) @@ -1503,7 +1512,7 @@ def _send_response( for k, vs in headers.items(): for v in vs: self.send_header(k, v) - self.send_header("Content-Length", len(body_bytes)) + self.send_header("Content-Length", str(len(body_bytes))) self.end_headers() self.wfile.write(body_bytes) From 8df95d5c0e18228dd58904e36a64d83ad7d6a627 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 23 Apr 2022 20:12:56 +0900 Subject: [PATCH 327/719] Remove a test suite that is no longer relevant --- tests/scenario_tests/test_app.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/scenario_tests/test_app.py b/tests/scenario_tests/test_app.py index 61d86659c..e7c105ea3 100644 --- a/tests/scenario_tests/test_app.py +++ b/tests/scenario_tests/test_app.py @@ -47,12 +47,6 @@ def handle_app_mention(body, say: Say, payload, event): # basic tests # -------------------------- - def test_signing_secret_absence(self): - with pytest.raises(BoltError): - App(signing_secret=None, token="xoxb-xxx") - with pytest.raises(BoltError): - App(signing_secret="", token="xoxb-xxx") - def simple_listener(self, ack): ack() From 319d000b96618bf3285e79f5ebd267c50b5c8615 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 25 Apr 2022 09:23:03 -0700 Subject: [PATCH 328/719] Enable Flake8 in the CI builds (#638) Co-authored-by: Fil Maj --- .flake8 | 3 +++ .github/workflows/flake8.yml | 23 +++++++++++++++++++ examples/django/myslackapp/urls.py | 2 +- examples/django/simple_app/models.py | 2 +- examples/getting_started/app.py | 1 + examples/google_cloud_functions/main.py | 1 + .../workflow_steps/async_steps_from_apps.py | 6 ++--- .../async_steps_from_apps_decorator.py | 2 +- .../async_steps_from_apps_primitive.py | 2 +- examples/workflow_steps/steps_from_apps.py | 2 +- .../steps_from_apps_decorator.py | 2 +- .../steps_from_apps_primitive.py | 2 +- scripts/run_flake8.sh | 7 ++++++ slack_bolt/__init__.py | 4 ++-- slack_bolt/adapter/aws_lambda/__init__.py | 2 +- slack_bolt/adapter/bottle/__init__.py | 2 +- slack_bolt/adapter/cherrypy/__init__.py | 2 +- slack_bolt/adapter/django/__init__.py | 2 +- slack_bolt/adapter/django/handler.py | 4 ++-- slack_bolt/adapter/falcon/__init__.py | 2 +- slack_bolt/adapter/flask/__init__.py | 2 +- slack_bolt/adapter/pyramid/__init__.py | 2 +- slack_bolt/adapter/sanic/__init__.py | 2 +- slack_bolt/adapter/socket_mode/__init__.py | 4 ++-- slack_bolt/adapter/starlette/__init__.py | 2 +- slack_bolt/adapter/tornado/__init__.py | 2 +- slack_bolt/app/__init__.py | 2 +- slack_bolt/async_app.py | 2 +- slack_bolt/authorization/__init__.py | 2 +- slack_bolt/context/__init__.py | 2 +- slack_bolt/context/ack/__init__.py | 2 +- slack_bolt/context/ack/internals.py | 2 +- slack_bolt/context/respond/__init__.py | 2 +- slack_bolt/context/say/__init__.py | 2 +- slack_bolt/kwargs_injection/__init__.py | 4 ++-- slack_bolt/kwargs_injection/utils.py | 2 +- slack_bolt/lazy_listener/async_runner.py | 2 +- slack_bolt/listener/builtins.py | 2 -- slack_bolt/listener_matcher/builtins.py | 3 +-- slack_bolt/logger/messages.py | 5 +++- slack_bolt/middleware/__init__.py | 17 ++++++++------ slack_bolt/middleware/async_builtins.py | 16 ++++++------- .../middleware/authorization/__init__.py | 6 ++--- slack_bolt/middleware/ssl_check/ssl_check.py | 2 +- slack_bolt/oauth/internals.py | 2 +- slack_bolt/request/__init__.py | 2 +- slack_bolt/response/__init__.py | 2 +- slack_bolt/workflows/step/__init__.py | 12 +++++----- slack_bolt/workflows/step/async_step.py | 6 ++--- slack_bolt/workflows/step/step.py | 6 ++--- 50 files changed, 115 insertions(+), 77 deletions(-) create mode 100644 .flake8 create mode 100644 .github/workflows/flake8.yml create mode 100755 scripts/run_flake8.sh diff --git a/.flake8 b/.flake8 new file mode 100644 index 000000000..9960c210e --- /dev/null +++ b/.flake8 @@ -0,0 +1,3 @@ +[flake8] +max-line-length = 125 +ignore = F841,F821,W503,E402 diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml new file mode 100644 index 000000000..74a0d86b8 --- /dev/null +++ b/.github/workflows/flake8.yml @@ -0,0 +1,23 @@ +name: Run flake8 validation + +on: + push: + branches: [ main ] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + matrix: + python-version: ['3.9'] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Run flake8 verification + run: | + ./scripts/run_flake8.sh diff --git a/examples/django/myslackapp/urls.py b/examples/django/myslackapp/urls.py index 754cee871..f3d5c7268 100644 --- a/examples/django/myslackapp/urls.py +++ b/examples/django/myslackapp/urls.py @@ -13,7 +13,7 @@ 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ -from django.contrib import admin +from django.contrib import admin # noqa: F401 from django.urls import path # Set this flag to False if you want to enable oauth_app instead diff --git a/examples/django/simple_app/models.py b/examples/django/simple_app/models.py index 71a836239..82c4e7854 100644 --- a/examples/django/simple_app/models.py +++ b/examples/django/simple_app/models.py @@ -1,3 +1,3 @@ -from django.db import models +from django.db import models # noqa: F401 # Create your models here. diff --git a/examples/getting_started/app.py b/examples/getting_started/app.py index 96944a594..22cdf5f31 100644 --- a/examples/getting_started/app.py +++ b/examples/getting_started/app.py @@ -7,6 +7,7 @@ signing_secret=os.environ.get("SLACK_SIGNING_SECRET"), ) + # Listens to incoming messages that contain "hello" # To learn available listener method arguments, # visit https://slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html diff --git a/examples/google_cloud_functions/main.py b/examples/google_cloud_functions/main.py index 633efb67b..c9f911a90 100644 --- a/examples/google_cloud_functions/main.py +++ b/examples/google_cloud_functions/main.py @@ -26,6 +26,7 @@ def event_test(body, say, logger): handler = SlackRequestHandler(app) + # Cloud Function def hello_bolt_app(request): """HTTP Cloud Function. diff --git a/examples/workflow_steps/async_steps_from_apps.py b/examples/workflow_steps/async_steps_from_apps.py index 06307be7d..e8831a113 100644 --- a/examples/workflow_steps/async_steps_from_apps.py +++ b/examples/workflow_steps/async_steps_from_apps.py @@ -28,7 +28,7 @@ async def edit(ack: AsyncAck, step: dict, configure: AsyncConfigure): "block_id": "intro-section", "text": { "type": "plain_text", - "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", + "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", # noqa: E501 }, }, { @@ -155,8 +155,8 @@ async def execute( "blocks": blocks, }, ) - except: - await fail(error={"message": "Something wrong!"}) + except Exception as e: + await fail(error={"message": f"Something wrong! (error: {e})"}) app.step( diff --git a/examples/workflow_steps/async_steps_from_apps_decorator.py b/examples/workflow_steps/async_steps_from_apps_decorator.py index 7c88a39a0..64e45a881 100644 --- a/examples/workflow_steps/async_steps_from_apps_decorator.py +++ b/examples/workflow_steps/async_steps_from_apps_decorator.py @@ -33,7 +33,7 @@ async def edit(ack: AsyncAck, step: dict, configure: AsyncConfigure): "block_id": "intro-section", "text": { "type": "plain_text", - "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", + "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", # noqa: E501 }, }, { diff --git a/examples/workflow_steps/async_steps_from_apps_primitive.py b/examples/workflow_steps/async_steps_from_apps_primitive.py index a343d0005..8d585be5a 100644 --- a/examples/workflow_steps/async_steps_from_apps_primitive.py +++ b/examples/workflow_steps/async_steps_from_apps_primitive.py @@ -27,7 +27,7 @@ async def edit(body: dict, ack: AsyncAck, client: AsyncWebClient): "block_id": "intro-section", "text": { "type": "plain_text", - "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", + "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", # noqa: E501 }, }, { diff --git a/examples/workflow_steps/steps_from_apps.py b/examples/workflow_steps/steps_from_apps.py index 147aa5d05..43e47c38d 100644 --- a/examples/workflow_steps/steps_from_apps.py +++ b/examples/workflow_steps/steps_from_apps.py @@ -31,7 +31,7 @@ def edit(ack: Ack, step, configure: Configure): "block_id": "intro-section", "text": { "type": "plain_text", - "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", + "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", # noqa: E501 }, }, { diff --git a/examples/workflow_steps/steps_from_apps_decorator.py b/examples/workflow_steps/steps_from_apps_decorator.py index 6ccccd975..0a8802731 100644 --- a/examples/workflow_steps/steps_from_apps_decorator.py +++ b/examples/workflow_steps/steps_from_apps_decorator.py @@ -35,7 +35,7 @@ def edit(ack: Ack, step, configure: Configure): "block_id": "intro-section", "text": { "type": "plain_text", - "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", + "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", # noqa: E501 }, }, { diff --git a/examples/workflow_steps/steps_from_apps_primitive.py b/examples/workflow_steps/steps_from_apps_primitive.py index 96ad0c97b..175bcde98 100644 --- a/examples/workflow_steps/steps_from_apps_primitive.py +++ b/examples/workflow_steps/steps_from_apps_primitive.py @@ -29,7 +29,7 @@ def edit(body: dict, ack: Ack, client: WebClient): "block_id": "intro-section", "text": { "type": "plain_text", - "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", + "text": "Create a task in one of the listed projects. The link to the task and other details will be available as variable data in later steps.", # noqa: E501 }, }, { diff --git a/scripts/run_flake8.sh b/scripts/run_flake8.sh new file mode 100755 index 000000000..d9ec07ff6 --- /dev/null +++ b/scripts/run_flake8.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# ./scripts/run_flake8.sh + +script_dir=$(dirname $0) +cd ${script_dir}/.. && \ + pip install "flake8==4.0.1" && \ + flake8 slack_bolt/ && flake8 examples/ diff --git a/slack_bolt/__init__.py b/slack_bolt/__init__.py index 20563758d..4050d83a9 100644 --- a/slack_bolt/__init__.py +++ b/slack_bolt/__init__.py @@ -1,10 +1,10 @@ """ -A Python framework to build Slack apps in a flash with the latest platform features. Read the [getting started guide](https://slack.dev/bolt-python/tutorial/getting-started) and look at our [code examples](https://github.com/slackapi/bolt-python/tree/main/examples) to learn how to build apps using Bolt. +A Python framework to build Slack apps in a flash with the latest platform features.Read the [getting started guide](https://slack.dev/bolt-python/tutorial/getting-started) and look at our [code examples](https://github.com/slackapi/bolt-python/tree/main/examples) to learn how to build apps using Bolt. * Website: https://slack.dev/bolt-python/ * GitHub repository: https://github.com/slackapi/bolt-python * The class representing a Bolt app: `slack_bolt.app.app` -""" +""" # noqa: E501 # Don't add async module imports here from .app import App # noqa from .context import BoltContext # noqa diff --git a/slack_bolt/adapter/aws_lambda/__init__.py b/slack_bolt/adapter/aws_lambda/__init__.py index f08c97a5f..df8fd9d79 100644 --- a/slack_bolt/adapter/aws_lambda/__init__.py +++ b/slack_bolt/adapter/aws_lambda/__init__.py @@ -1 +1 @@ -from .handler import SlackRequestHandler +from .handler import SlackRequestHandler # noqa: F401 diff --git a/slack_bolt/adapter/bottle/__init__.py b/slack_bolt/adapter/bottle/__init__.py index f08c97a5f..df8fd9d79 100644 --- a/slack_bolt/adapter/bottle/__init__.py +++ b/slack_bolt/adapter/bottle/__init__.py @@ -1 +1 @@ -from .handler import SlackRequestHandler +from .handler import SlackRequestHandler # noqa: F401 diff --git a/slack_bolt/adapter/cherrypy/__init__.py b/slack_bolt/adapter/cherrypy/__init__.py index f08c97a5f..df8fd9d79 100644 --- a/slack_bolt/adapter/cherrypy/__init__.py +++ b/slack_bolt/adapter/cherrypy/__init__.py @@ -1 +1 @@ -from .handler import SlackRequestHandler +from .handler import SlackRequestHandler # noqa: F401 diff --git a/slack_bolt/adapter/django/__init__.py b/slack_bolt/adapter/django/__init__.py index f08c97a5f..df8fd9d79 100644 --- a/slack_bolt/adapter/django/__init__.py +++ b/slack_bolt/adapter/django/__init__.py @@ -1 +1 @@ -from .handler import SlackRequestHandler +from .handler import SlackRequestHandler # noqa: F401 diff --git a/slack_bolt/adapter/django/handler.py b/slack_bolt/adapter/django/handler.py index 7d86adfbe..5a4ffe71e 100644 --- a/slack_bolt/adapter/django/handler.py +++ b/slack_bolt/adapter/django/handler.py @@ -142,8 +142,8 @@ def __init__(self, app: App): # type: ignore # it's okay to skip calling the same connection clean-up method at the listener completion. message = """As you've already set app.listener_runner.listener_start_handler to your own one, Bolt skipped to set it to slack_sdk.adapter.django.DjangoListenerStartHandler. - - If you go with your own handler here, we highly recommend having the following lines of code + + If you go with your own handler here, we highly recommend having the following lines of code in your handle() method to clean up unmanaged stale/old database connections: from django.db import close_old_connections diff --git a/slack_bolt/adapter/falcon/__init__.py b/slack_bolt/adapter/falcon/__init__.py index e1a06662c..e54d2f1fc 100644 --- a/slack_bolt/adapter/falcon/__init__.py +++ b/slack_bolt/adapter/falcon/__init__.py @@ -1,2 +1,2 @@ # Don't add async module imports here -from .resource import SlackAppResource +from .resource import SlackAppResource # noqa: F401 diff --git a/slack_bolt/adapter/flask/__init__.py b/slack_bolt/adapter/flask/__init__.py index f08c97a5f..df8fd9d79 100644 --- a/slack_bolt/adapter/flask/__init__.py +++ b/slack_bolt/adapter/flask/__init__.py @@ -1 +1 @@ -from .handler import SlackRequestHandler +from .handler import SlackRequestHandler # noqa: F401 diff --git a/slack_bolt/adapter/pyramid/__init__.py b/slack_bolt/adapter/pyramid/__init__.py index f08c97a5f..df8fd9d79 100644 --- a/slack_bolt/adapter/pyramid/__init__.py +++ b/slack_bolt/adapter/pyramid/__init__.py @@ -1 +1 @@ -from .handler import SlackRequestHandler +from .handler import SlackRequestHandler # noqa: F401 diff --git a/slack_bolt/adapter/sanic/__init__.py b/slack_bolt/adapter/sanic/__init__.py index cf7d5ec69..02ee77873 100644 --- a/slack_bolt/adapter/sanic/__init__.py +++ b/slack_bolt/adapter/sanic/__init__.py @@ -1 +1 @@ -from .async_handler import AsyncSlackRequestHandler +from .async_handler import AsyncSlackRequestHandler # noqa: F401 diff --git a/slack_bolt/adapter/socket_mode/__init__.py b/slack_bolt/adapter/socket_mode/__init__.py index fbb17b0f7..0a00e1c11 100644 --- a/slack_bolt/adapter/socket_mode/__init__.py +++ b/slack_bolt/adapter/socket_mode/__init__.py @@ -4,7 +4,7 @@ * `slack_bolt.adapter.socket_mode.websocket_client` * `slack_bolt.adapter.socket_mode.aiohttp` * `slack_bolt.adapter.socket_mode.websockets` -""" +""" # noqa: E501 # Don't add async module imports here -from .builtin import SocketModeHandler # noqa +from .builtin import SocketModeHandler # noqa: F401 diff --git a/slack_bolt/adapter/starlette/__init__.py b/slack_bolt/adapter/starlette/__init__.py index 118f4bab1..848662494 100644 --- a/slack_bolt/adapter/starlette/__init__.py +++ b/slack_bolt/adapter/starlette/__init__.py @@ -1,2 +1,2 @@ # Don't add async module imports here -from .handler import SlackRequestHandler +from .handler import SlackRequestHandler # noqa: F401 diff --git a/slack_bolt/adapter/tornado/__init__.py b/slack_bolt/adapter/tornado/__init__.py index dfda87bf3..fa4896201 100644 --- a/slack_bolt/adapter/tornado/__init__.py +++ b/slack_bolt/adapter/tornado/__init__.py @@ -1 +1 @@ -from .handler import SlackEventsHandler, SlackOAuthHandler +from .handler import SlackEventsHandler, SlackOAuthHandler # noqa: F401 diff --git a/slack_bolt/app/__init__.py b/slack_bolt/app/__init__.py index de3ea4c23..b99c2c430 100644 --- a/slack_bolt/app/__init__.py +++ b/slack_bolt/app/__init__.py @@ -6,4 +6,4 @@ """ # Don't add async module imports here -from .app import App # type: ignore +from .app import App # noqa: F401 type: ignore diff --git a/slack_bolt/async_app.py b/slack_bolt/async_app.py index 5b17d8251..ed924f13b 100644 --- a/slack_bolt/async_app.py +++ b/slack_bolt/async_app.py @@ -43,7 +43,7 @@ async def command(ack, body, respond): Apps can be run the same way as the synchronous example above. If you'd prefer another async Web framework (e.g., Sanic, FastAPI, Starlette), take a look at [the built-in adapters](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter) and their corresponding [examples](https://github.com/slackapi/bolt-python/tree/main/examples). Refer to `slack_bolt.app.async_app` for more details. -""" +""" # noqa: E501 from .app.async_app import AsyncApp # noqa from .context.ack.async_ack import AsyncAck # noqa from .context.async_context import AsyncBoltContext # noqa diff --git a/slack_bolt/authorization/__init__.py b/slack_bolt/authorization/__init__.py index 2e7e988f3..9ea3c8da5 100644 --- a/slack_bolt/authorization/__init__.py +++ b/slack_bolt/authorization/__init__.py @@ -3,4 +3,4 @@ Refer to https://slack.dev/bolt-python/concepts#authorization for details. """ -from .authorize_result import AuthorizeResult +from .authorize_result import AuthorizeResult # noqa diff --git a/slack_bolt/context/__init__.py b/slack_bolt/context/__init__.py index fabbfae98..951e00828 100644 --- a/slack_bolt/context/__init__.py +++ b/slack_bolt/context/__init__.py @@ -6,4 +6,4 @@ """ # Don't add async module imports here -from .context import BoltContext +from .context import BoltContext # noqa: F401 diff --git a/slack_bolt/context/ack/__init__.py b/slack_bolt/context/ack/__init__.py index 2f150ce24..8e5767113 100644 --- a/slack_bolt/context/ack/__init__.py +++ b/slack_bolt/context/ack/__init__.py @@ -1,2 +1,2 @@ # Don't add async module imports here -from .ack import Ack +from .ack import Ack # noqa: F401 diff --git a/slack_bolt/context/ack/internals.py b/slack_bolt/context/ack/internals.py index 965033b77..1a9ca92e8 100644 --- a/slack_bolt/context/ack/internals.py +++ b/slack_bolt/context/ack/internals.py @@ -61,7 +61,7 @@ def _set_response( ) else: raise ValueError( - f"errors field is required for response_action: errors" + "errors field is required for response_action: errors" ) else: body = {"response_action": response_action} diff --git a/slack_bolt/context/respond/__init__.py b/slack_bolt/context/respond/__init__.py index 2b240ebab..135f87277 100644 --- a/slack_bolt/context/respond/__init__.py +++ b/slack_bolt/context/respond/__init__.py @@ -1,2 +1,2 @@ # Don't add async module imports here -from .respond import Respond +from .respond import Respond # noqa: F401 diff --git a/slack_bolt/context/say/__init__.py b/slack_bolt/context/say/__init__.py index 828ad8877..82dad6a7f 100644 --- a/slack_bolt/context/say/__init__.py +++ b/slack_bolt/context/say/__init__.py @@ -1,2 +1,2 @@ # Don't add async module imports here -from .say import Say +from .say import Say # noqa: F401 diff --git a/slack_bolt/kwargs_injection/__init__.py b/slack_bolt/kwargs_injection/__init__.py index 8d8d1e6ac..56e1fa53e 100644 --- a/slack_bolt/kwargs_injection/__init__.py +++ b/slack_bolt/kwargs_injection/__init__.py @@ -5,5 +5,5 @@ """ # Don't add async module imports here -from .args import Args -from .utils import build_required_kwargs +from .args import Args # noqa: F401 +from .utils import build_required_kwargs # noqa: F401 diff --git a/slack_bolt/kwargs_injection/utils.py b/slack_bolt/kwargs_injection/utils.py index f0ad186a4..617e4de03 100644 --- a/slack_bolt/kwargs_injection/utils.py +++ b/slack_bolt/kwargs_injection/utils.py @@ -1,7 +1,7 @@ # pytype: skip-file import inspect import logging -from typing import Callable, Dict, Optional, Any, Sequence, List +from typing import Callable, Dict, Optional, Any, Sequence from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse diff --git a/slack_bolt/lazy_listener/async_runner.py b/slack_bolt/lazy_listener/async_runner.py index b98eb5492..a42098e06 100644 --- a/slack_bolt/lazy_listener/async_runner.py +++ b/slack_bolt/lazy_listener/async_runner.py @@ -1,6 +1,6 @@ from abc import abstractmethod, ABCMeta from logging import Logger -from typing import Callable, Awaitable, Any, Coroutine +from typing import Callable, Awaitable from slack_bolt.lazy_listener.async_internals import to_runnable_function from slack_bolt.request.async_request import AsyncBoltRequest diff --git a/slack_bolt/listener/builtins.py b/slack_bolt/listener/builtins.py index 66784d182..ee5891f27 100644 --- a/slack_bolt/listener/builtins.py +++ b/slack_bolt/listener/builtins.py @@ -1,5 +1,3 @@ -from slack_sdk.oauth import InstallationStore - from slack_bolt.context.context import BoltContext from slack_sdk.oauth.installation_store.installation_store import InstallationStore diff --git a/slack_bolt/listener_matcher/builtins.py b/slack_bolt/listener_matcher/builtins.py index 043a497fa..ecac0012a 100644 --- a/slack_bolt/listener_matcher/builtins.py +++ b/slack_bolt/listener_matcher/builtins.py @@ -29,8 +29,7 @@ from re import _pattern_type as Pattern else: from re import Pattern -from typing import Callable, Awaitable, Any, Sequence, Optional, Union -from typing import Union, Optional, Dict +from typing import Callable, Awaitable, Any, Sequence, Optional, Union, Dict from slack_bolt.kwargs_injection import build_required_kwargs from slack_bolt.request import BoltRequest diff --git a/slack_bolt/logger/messages.py b/slack_bolt/logger/messages.py index 4920991b8..b9e94b52b 100644 --- a/slack_bolt/logger/messages.py +++ b/slack_bolt/logger/messages.py @@ -348,4 +348,7 @@ def debug_return_listener_middleware_response( listener_name: str, status: int, body: str, starting_time: float ) -> str: millis = int((time.time() - starting_time) * 1000) - return f"Responding with listener middleware's response - listener: {listener_name}, status: {status}, body: {body} ({millis} millis)" + return ( + "Responding with listener middleware's response - " + f"listener: {listener_name}, status: {status}, body: {body} ({millis} millis)" + ) diff --git a/slack_bolt/middleware/__init__.py b/slack_bolt/middleware/__init__.py index 752c1259f..a21747e92 100644 --- a/slack_bolt/middleware/__init__.py +++ b/slack_bolt/middleware/__init__.py @@ -6,13 +6,16 @@ """ # Don't add async module imports here -from .authorization import SingleTeamAuthorization, MultiTeamsAuthorization -from .custom_middleware import CustomMiddleware -from .ignoring_self_events import IgnoringSelfEvents -from .middleware import Middleware -from .request_verification import RequestVerification -from .ssl_check import SslCheck -from .url_verification import UrlVerification +from .authorization import ( + SingleTeamAuthorization, + MultiTeamsAuthorization, +) # noqa: F401 +from .custom_middleware import CustomMiddleware # noqa: F401 +from .ignoring_self_events import IgnoringSelfEvents # noqa: F401 +from .middleware import Middleware # noqa: F401 +from .request_verification import RequestVerification # noqa: F401 +from .ssl_check import SslCheck # noqa: F401 +from .url_verification import UrlVerification # noqa: F401 builtin_middleware_classes = [ SslCheck, diff --git a/slack_bolt/middleware/async_builtins.py b/slack_bolt/middleware/async_builtins.py index 09b5338e0..46cef9003 100644 --- a/slack_bolt/middleware/async_builtins.py +++ b/slack_bolt/middleware/async_builtins.py @@ -1,11 +1,11 @@ -from .ignoring_self_events.async_ignoring_self_events import ( +from .ignoring_self_events.async_ignoring_self_events import ( # noqa: F401 AsyncIgnoringSelfEvents, -) # noqa -from .request_verification.async_request_verification import ( +) +from .request_verification.async_request_verification import ( # noqa: F401 AsyncRequestVerification, -) # noqa -from .ssl_check.async_ssl_check import AsyncSslCheck # noqa -from .url_verification.async_url_verification import AsyncUrlVerification # noqa -from .message_listener_matches.async_message_listener_matches import ( +) +from .ssl_check.async_ssl_check import AsyncSslCheck # noqa: F401 +from .url_verification.async_url_verification import AsyncUrlVerification # noqa: F401 +from .message_listener_matches.async_message_listener_matches import ( # noqa: F401 AsyncMessageListenerMatches, -) # noqa +) diff --git a/slack_bolt/middleware/authorization/__init__.py b/slack_bolt/middleware/authorization/__init__.py index 832947b45..fd5b10263 100644 --- a/slack_bolt/middleware/authorization/__init__.py +++ b/slack_bolt/middleware/authorization/__init__.py @@ -1,4 +1,4 @@ # Don't add async module imports here -from .authorization import Authorization -from .multi_teams_authorization import MultiTeamsAuthorization -from .single_team_authorization import SingleTeamAuthorization +from .authorization import Authorization # noqa: F401 +from .multi_teams_authorization import MultiTeamsAuthorization # noqa: F401 +from .single_team_authorization import SingleTeamAuthorization # noqa: F401 diff --git a/slack_bolt/middleware/ssl_check/ssl_check.py b/slack_bolt/middleware/ssl_check/ssl_check.py index d8c92c72d..5e61773cd 100644 --- a/slack_bolt/middleware/ssl_check/ssl_check.py +++ b/slack_bolt/middleware/ssl_check/ssl_check.py @@ -23,7 +23,7 @@ def __init__( verification_token: The verification token to check (optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation) base_logger: The base logger - """ + """ # noqa: E501 self.verification_token = verification_token self.logger = get_bolt_logger(SslCheck, base_logger=base_logger) diff --git a/slack_bolt/oauth/internals.py b/slack_bolt/oauth/internals.py index 9fedc6e8f..1929f791a 100644 --- a/slack_bolt/oauth/internals.py +++ b/slack_bolt/oauth/internals.py @@ -91,7 +91,7 @@ def _build_default_install_page_html(url: str) -> str:

    -""" +""" # noqa: E501 # key: client_id, value: InstallationStore diff --git a/slack_bolt/request/__init__.py b/slack_bolt/request/__init__.py index e8dff275e..402d70cde 100644 --- a/slack_bolt/request/__init__.py +++ b/slack_bolt/request/__init__.py @@ -4,4 +4,4 @@ This interface encapsulates the difference between the two. """ # Don't add async module imports here -from .request import BoltRequest +from .request import BoltRequest # noqa: F401 diff --git a/slack_bolt/response/__init__.py b/slack_bolt/response/__init__.py index a159c701e..2dfd1d695 100644 --- a/slack_bolt/response/__init__.py +++ b/slack_bolt/response/__init__.py @@ -6,4 +6,4 @@ Refer to https://api.slack.com/apis/connections for the two types of connections. """ -from .response import BoltResponse +from .response import BoltResponse # noqa: F401 diff --git a/slack_bolt/workflows/step/__init__.py b/slack_bolt/workflows/step/__init__.py index 8bd0a067a..9418a2e4c 100644 --- a/slack_bolt/workflows/step/__init__.py +++ b/slack_bolt/workflows/step/__init__.py @@ -1,6 +1,6 @@ -from .step import WorkflowStep -from .step_middleware import WorkflowStepMiddleware -from .utilities.complete import Complete -from .utilities.configure import Configure -from .utilities.update import Update -from .utilities.fail import Fail +from .step import WorkflowStep # noqa: F401 +from .step_middleware import WorkflowStepMiddleware # noqa: F401 +from .utilities.complete import Complete # noqa: F401 +from .utilities.configure import Configure # noqa: F401 +from .utilities.update import Update # noqa: F401 +from .utilities.fail import Fail # noqa: F401 diff --git a/slack_bolt/workflows/step/async_step.py b/slack_bolt/workflows/step/async_step.py index 113c6c346..c8de638ca 100644 --- a/slack_bolt/workflows/step/async_step.py +++ b/slack_bolt/workflows/step/async_step.py @@ -230,11 +230,11 @@ def build(self, base_logger: Optional[Logger] = None) -> "AsyncWorkflowStep": An `AsyncWorkflowStep` object """ if self._edit is None: - raise BoltError(f"edit listener is not registered") + raise BoltError("edit listener is not registered") if self._save is None: - raise BoltError(f"save listener is not registered") + raise BoltError("save listener is not registered") if self._execute is None: - raise BoltError(f"execute listener is not registered") + raise BoltError("execute listener is not registered") return AsyncWorkflowStep( callback_id=self.callback_id, diff --git a/slack_bolt/workflows/step/step.py b/slack_bolt/workflows/step/step.py index dd17289fe..6c944af66 100644 --- a/slack_bolt/workflows/step/step.py +++ b/slack_bolt/workflows/step/step.py @@ -220,11 +220,11 @@ def build(self, base_logger: Optional[Logger] = None) -> "WorkflowStep": WorkflowStep object """ if self._edit is None: - raise BoltError(f"edit listener is not registered") + raise BoltError("edit listener is not registered") if self._save is None: - raise BoltError(f"save listener is not registered") + raise BoltError("save listener is not registered") if self._execute is None: - raise BoltError(f"execute listener is not registered") + raise BoltError("execute listener is not registered") return WorkflowStep( callback_id=self.callback_id, From 27a01c1e69b327944a2853d86261990bfe49606f Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 30 Apr 2022 07:32:53 +0900 Subject: [PATCH 329/719] Fix #639 is_enterprise_install does not exist in context object (#640) * Fix #639 is_enterprise_install does not exist in context object * Remove unused imports --- slack_bolt/request/async_internals.py | 2 + slack_bolt/request/internals.py | 4 ++ tests/scenario_tests/test_events.py | 49 ++++++++++++++++++++++- tests/scenario_tests_async/test_events.py | 49 +++++++++++++++++++++++ 4 files changed, 103 insertions(+), 1 deletion(-) diff --git a/slack_bolt/request/async_internals.py b/slack_bolt/request/async_internals.py index 3b0eca3bf..b32ccb20e 100644 --- a/slack_bolt/request/async_internals.py +++ b/slack_bolt/request/async_internals.py @@ -3,6 +3,7 @@ from slack_bolt.context.async_context import AsyncBoltContext from slack_bolt.request.internals import ( extract_enterprise_id, + extract_is_enterprise_install, extract_team_id, extract_user_id, extract_channel_id, @@ -14,6 +15,7 @@ def build_async_context( context: AsyncBoltContext, body: Dict[str, Any], ) -> AsyncBoltContext: + context["is_enterprise_install"] = extract_is_enterprise_install(body) enterprise_id = extract_enterprise_id(body) if enterprise_id: context["enterprise_id"] = enterprise_id diff --git a/slack_bolt/request/internals.py b/slack_bolt/request/internals.py index b520cb821..31c2bc0f0 100644 --- a/slack_bolt/request/internals.py +++ b/slack_bolt/request/internals.py @@ -47,6 +47,10 @@ def parse_body(body: str, content_type: Optional[str]) -> Dict[str, Any]: def extract_is_enterprise_install(payload: Dict[str, Any]) -> Optional[bool]: + if payload.get("authorizations") is not None and len(payload["authorizations"]) > 0: + # To make Events API handling functioning also for shared channels, + # we should use .authorizations[0].is_enterprise_install over .is_enterprise_install + return extract_is_enterprise_install(payload["authorizations"][0]) if "is_enterprise_install" in payload: is_enterprise_install = payload.get("is_enterprise_install") return is_enterprise_install is not None and ( diff --git a/tests/scenario_tests/test_events.py b/tests/scenario_tests/test_events.py index 49c1f409c..21dd48cd8 100644 --- a/tests/scenario_tests/test_events.py +++ b/tests/scenario_tests/test_events.py @@ -6,7 +6,7 @@ from slack_sdk.signature import SignatureVerifier from slack_sdk.web import WebClient -from slack_bolt import App, BoltRequest, Say +from slack_bolt import App, BoltRequest, Say, BoltContext from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, @@ -541,3 +541,50 @@ def handle(): app.event({"type": "message.channels"})(handle) with pytest.raises(ValueError): app.event({"type": re.compile("message\\..*")})(handle) + + def test_context_generation(self): + body = { + "token": "verification-token", + "enterprise_id": "E222", # intentionally inconsistent for testing + "team_id": "T222", # intentionally inconsistent for testing + "api_app_id": "A111", + "event": { + "type": "member_left_channel", + "user": "W111", + "channel": "C111", + "channel_type": "C", + "team": "T111", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1610493715, + "authorizations": [ + { + "enterprise_id": "E333", + "user_id": "W222", + "is_bot": True, + "is_enterprise_install": True, + } + ], + "is_ext_shared_channel": False, + "event_context": "1-message-T111-G111", + } + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + process_before_response=True, + ) + + @app.event("member_left_channel") + def handle(context: BoltContext): + assert context.enterprise_id == "E333" + assert context.team_id is None + assert context.is_enterprise_install is True + assert context.user_id == "W111" + + timestamp, json_body = str(int(time())), json.dumps(body) + request: BoltRequest = BoltRequest( + body=json_body, headers=self.build_headers(timestamp, json_body) + ) + response = app.dispatch(request) + assert response.status == 200 diff --git a/tests/scenario_tests_async/test_events.py b/tests/scenario_tests_async/test_events.py index 5e5af42e2..d3e0f1f9d 100644 --- a/tests/scenario_tests_async/test_events.py +++ b/tests/scenario_tests_async/test_events.py @@ -9,6 +9,7 @@ from slack_sdk.web.async_client import AsyncWebClient from slack_bolt.app.async_app import AsyncApp +from slack_bolt.context.async_context import AsyncBoltContext from slack_bolt.context.say.async_say import AsyncSay from slack_bolt.request.async_request import AsyncBoltRequest from tests.mock_web_api_server import ( @@ -552,6 +553,54 @@ async def handle(): with pytest.raises(ValueError): app.event({"type": re.compile("message\\..*")})(handle) + @pytest.mark.asyncio + async def test_context_generation(self): + body = { + "token": "verification-token", + "enterprise_id": "E222", # intentionally inconsistent for testing + "team_id": "T222", # intentionally inconsistent for testing + "api_app_id": "A111", + "event": { + "type": "member_left_channel", + "user": "W111", + "channel": "C111", + "channel_type": "C", + "team": "T111", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1610493715, + "authorizations": [ + { + "enterprise_id": "E333", + "user_id": "W222", + "is_bot": True, + "is_enterprise_install": True, + } + ], + "is_ext_shared_channel": False, + "event_context": "1-message-T111-G111", + } + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + process_before_response=True, + ) + + @app.event("member_left_channel") + async def handle(context: AsyncBoltContext): + assert context.enterprise_id == "E333" + assert context.team_id is None + assert context.is_enterprise_install is True + assert context.user_id == "W111" + + timestamp, json_body = str(int(time())), json.dumps(body) + request: AsyncBoltRequest = AsyncBoltRequest( + body=json_body, headers=self.build_headers(timestamp, json_body) + ) + response = await app.async_dispatch(request) + assert response.status == 200 + app_mention_body = { "token": "verification_token", From a2189c3032b5b6aa2907972ae8725039b7abdcc3 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 29 Apr 2022 15:34:53 -0700 Subject: [PATCH 330/719] version 1.13.1 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index d48ad3d3a..a5295f2c9 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.13.0" +__version__ = "1.13.1" From 3e1d1cae963d33caea6768bea2f5612b8f91c4c5 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 29 Apr 2022 15:39:54 -0700 Subject: [PATCH 331/719] Update API docs --- .../slack_bolt/adapter/aws_lambda/index.html | 2 +- .../slack_bolt/adapter/bottle/index.html | 2 +- .../slack_bolt/adapter/cherrypy/index.html | 2 +- .../slack_bolt/adapter/django/handler.html | 8 ++--- .../slack_bolt/adapter/django/index.html | 2 +- .../slack_bolt/adapter/falcon/index.html | 2 +- .../slack_bolt/adapter/flask/index.html | 2 +- .../slack_bolt/adapter/pyramid/index.html | 2 +- .../slack_bolt/adapter/sanic/index.html | 2 +- .../slack_bolt/adapter/socket_mode/index.html | 4 +-- .../slack_bolt/adapter/starlette/index.html | 2 +- .../slack_bolt/adapter/tornado/index.html | 2 +- docs/api-docs/slack_bolt/app/app.html | 34 ++++++++++++++----- docs/api-docs/slack_bolt/app/index.html | 2 +- docs/api-docs/slack_bolt/async_app.html | 2 +- .../slack_bolt/authorization/index.html | 2 +- .../slack_bolt/context/ack/index.html | 2 +- .../slack_bolt/context/ack/internals.html | 2 +- docs/api-docs/slack_bolt/context/index.html | 2 +- .../slack_bolt/context/respond/index.html | 2 +- .../slack_bolt/context/say/index.html | 2 +- docs/api-docs/slack_bolt/index.html | 8 ++--- .../slack_bolt/kwargs_injection/index.html | 4 +-- .../slack_bolt/kwargs_injection/utils.html | 2 +- .../lazy_listener/async_runner.html | 2 +- .../slack_bolt/listener/builtins.html | 4 +-- .../slack_bolt/listener_matcher/builtins.html | 3 +- docs/api-docs/slack_bolt/logger/messages.html | 10 ++++-- .../slack_bolt/middleware/async_builtins.html | 16 ++++----- .../middleware/authorization/index.html | 6 ++-- .../api-docs/slack_bolt/middleware/index.html | 17 ++++++---- .../middleware/ssl_check/ssl_check.html | 4 +-- docs/api-docs/slack_bolt/oauth/internals.html | 2 +- .../slack_bolt/request/async_internals.html | 3 ++ docs/api-docs/slack_bolt/request/index.html | 2 +- .../slack_bolt/request/internals.html | 8 +++++ docs/api-docs/slack_bolt/response/index.html | 2 +- docs/api-docs/slack_bolt/version.html | 2 +- .../slack_bolt/workflows/step/async_step.html | 18 +++++----- .../slack_bolt/workflows/step/index.html | 12 +++---- .../slack_bolt/workflows/step/step.html | 18 +++++----- 41 files changed, 130 insertions(+), 95 deletions(-) diff --git a/docs/api-docs/slack_bolt/adapter/aws_lambda/index.html b/docs/api-docs/slack_bolt/adapter/aws_lambda/index.html index c82448803..5cc172ec4 100644 --- a/docs/api-docs/slack_bolt/adapter/aws_lambda/index.html +++ b/docs/api-docs/slack_bolt/adapter/aws_lambda/index.html @@ -26,7 +26,7 @@

    Module slack_bolt.adapter.aws_lambda

    Expand source code -
    from .handler import SlackRequestHandler
    +
    from .handler import SlackRequestHandler  # noqa: F401
    diff --git a/docs/api-docs/slack_bolt/adapter/bottle/index.html b/docs/api-docs/slack_bolt/adapter/bottle/index.html index 924b14de2..8701e3cb7 100644 --- a/docs/api-docs/slack_bolt/adapter/bottle/index.html +++ b/docs/api-docs/slack_bolt/adapter/bottle/index.html @@ -26,7 +26,7 @@

    Module slack_bolt.adapter.bottle

    Expand source code -
    from .handler import SlackRequestHandler
    +
    from .handler import SlackRequestHandler  # noqa: F401
    diff --git a/docs/api-docs/slack_bolt/adapter/cherrypy/index.html b/docs/api-docs/slack_bolt/adapter/cherrypy/index.html index e1df7c0b1..7b4df5764 100644 --- a/docs/api-docs/slack_bolt/adapter/cherrypy/index.html +++ b/docs/api-docs/slack_bolt/adapter/cherrypy/index.html @@ -26,7 +26,7 @@

    Module slack_bolt.adapter.cherrypy

    Expand source code -
    from .handler import SlackRequestHandler
    +
    from .handler import SlackRequestHandler  # noqa: F401
    diff --git a/docs/api-docs/slack_bolt/adapter/django/handler.html b/docs/api-docs/slack_bolt/adapter/django/handler.html index 1b47e3e35..3c1e537b6 100644 --- a/docs/api-docs/slack_bolt/adapter/django/handler.html +++ b/docs/api-docs/slack_bolt/adapter/django/handler.html @@ -170,8 +170,8 @@

    Module slack_bolt.adapter.django.handler

    # it's okay to skip calling the same connection clean-up method at the listener completion. message = """As you've already set app.listener_runner.listener_start_handler to your own one, Bolt skipped to set it to slack_sdk.adapter.django.DjangoListenerStartHandler. - - If you go with your own handler here, we highly recommend having the following lines of code + + If you go with your own handler here, we highly recommend having the following lines of code in your handle() method to clean up unmanaged stale/old database connections: from django.db import close_old_connections @@ -461,8 +461,8 @@

    Inherited members

    # it's okay to skip calling the same connection clean-up method at the listener completion. message = """As you've already set app.listener_runner.listener_start_handler to your own one, Bolt skipped to set it to slack_sdk.adapter.django.DjangoListenerStartHandler. - - If you go with your own handler here, we highly recommend having the following lines of code + + If you go with your own handler here, we highly recommend having the following lines of code in your handle() method to clean up unmanaged stale/old database connections: from django.db import close_old_connections diff --git a/docs/api-docs/slack_bolt/adapter/django/index.html b/docs/api-docs/slack_bolt/adapter/django/index.html index 9c41c9e8e..80b06b944 100644 --- a/docs/api-docs/slack_bolt/adapter/django/index.html +++ b/docs/api-docs/slack_bolt/adapter/django/index.html @@ -26,7 +26,7 @@

    Module slack_bolt.adapter.django

    Expand source code -
    from .handler import SlackRequestHandler
    +
    from .handler import SlackRequestHandler  # noqa: F401
    diff --git a/docs/api-docs/slack_bolt/adapter/falcon/index.html b/docs/api-docs/slack_bolt/adapter/falcon/index.html index 85a95e9f3..a61724235 100644 --- a/docs/api-docs/slack_bolt/adapter/falcon/index.html +++ b/docs/api-docs/slack_bolt/adapter/falcon/index.html @@ -27,7 +27,7 @@

    Module slack_bolt.adapter.falcon

    Expand source code
    # Don't add async module imports here
    -from .resource import SlackAppResource
    +from .resource import SlackAppResource # noqa: F401
    diff --git a/docs/api-docs/slack_bolt/adapter/flask/index.html b/docs/api-docs/slack_bolt/adapter/flask/index.html index a8d8efd5d..80baea429 100644 --- a/docs/api-docs/slack_bolt/adapter/flask/index.html +++ b/docs/api-docs/slack_bolt/adapter/flask/index.html @@ -26,7 +26,7 @@

    Module slack_bolt.adapter.flask

    Expand source code -
    from .handler import SlackRequestHandler
    +
    from .handler import SlackRequestHandler  # noqa: F401
    diff --git a/docs/api-docs/slack_bolt/adapter/pyramid/index.html b/docs/api-docs/slack_bolt/adapter/pyramid/index.html index dbf5a8668..c9cd6120c 100644 --- a/docs/api-docs/slack_bolt/adapter/pyramid/index.html +++ b/docs/api-docs/slack_bolt/adapter/pyramid/index.html @@ -26,7 +26,7 @@

    Module slack_bolt.adapter.pyramid

    Expand source code -
    from .handler import SlackRequestHandler
    +
    from .handler import SlackRequestHandler  # noqa: F401
    diff --git a/docs/api-docs/slack_bolt/adapter/sanic/index.html b/docs/api-docs/slack_bolt/adapter/sanic/index.html index 71cb0ad94..c1b61a875 100644 --- a/docs/api-docs/slack_bolt/adapter/sanic/index.html +++ b/docs/api-docs/slack_bolt/adapter/sanic/index.html @@ -26,7 +26,7 @@

    Module slack_bolt.adapter.sanic

    Expand source code -
    from .async_handler import AsyncSlackRequestHandler
    +
    from .async_handler import AsyncSlackRequestHandler  # noqa: F401
    diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/index.html b/docs/api-docs/slack_bolt/adapter/socket_mode/index.html index 642bb5206..3666de4b4 100644 --- a/docs/api-docs/slack_bolt/adapter/socket_mode/index.html +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/index.html @@ -39,10 +39,10 @@

    Module slack_bolt.adapter.socket_mode

    * `slack_bolt.adapter.socket_mode.websocket_client` * `slack_bolt.adapter.socket_mode.aiohttp` * `slack_bolt.adapter.socket_mode.websockets` -""" +""" # noqa: E501 # Don't add async module imports here -from .builtin import SocketModeHandler # noqa +from .builtin import SocketModeHandler # noqa: F401
    diff --git a/docs/api-docs/slack_bolt/adapter/starlette/index.html b/docs/api-docs/slack_bolt/adapter/starlette/index.html index bc4b3689f..b3c1dbecd 100644 --- a/docs/api-docs/slack_bolt/adapter/starlette/index.html +++ b/docs/api-docs/slack_bolt/adapter/starlette/index.html @@ -27,7 +27,7 @@

    Module slack_bolt.adapter.starlette

    Expand source code
    # Don't add async module imports here
    -from .handler import SlackRequestHandler
    +from .handler import SlackRequestHandler # noqa: F401
    diff --git a/docs/api-docs/slack_bolt/adapter/tornado/index.html b/docs/api-docs/slack_bolt/adapter/tornado/index.html index 4e1719a18..037b2751f 100644 --- a/docs/api-docs/slack_bolt/adapter/tornado/index.html +++ b/docs/api-docs/slack_bolt/adapter/tornado/index.html @@ -26,7 +26,7 @@

    Module slack_bolt.adapter.tornado

    Expand source code -
    from .handler import SlackEventsHandler, SlackOAuthHandler
    +
    from .handler import SlackEventsHandler, SlackOAuthHandler  # noqa: F401
    diff --git a/docs/api-docs/slack_bolt/app/app.html b/docs/api-docs/slack_bolt/app/app.html index e49fe3d59..b7eac7755 100644 --- a/docs/api-docs/slack_bolt/app/app.html +++ b/docs/api-docs/slack_bolt/app/app.html @@ -1481,13 +1481,19 @@

    Module slack_bolt.app.app

    request_path, _, query = self.path.partition("?") if request_path == _bolt_oauth_flow.install_path: bolt_req = BoltRequest( - body="", query=query, headers=self.headers + body="", + query=query, + # email.message.Message's mapping interface is dict compatible + headers=self.headers, # type:ignore ) bolt_resp = _bolt_oauth_flow.handle_installation(bolt_req) self._send_bolt_response(bolt_resp) elif request_path == _bolt_oauth_flow.redirect_uri_path: bolt_req = BoltRequest( - body="", query=query, headers=self.headers + body="", + query=query, + # email.message.Message's mapping interface is dict compatible + headers=self.headers, # type:ignore ) bolt_resp = _bolt_oauth_flow.handle_callback(bolt_req) self._send_bolt_response(bolt_resp) @@ -1505,7 +1511,10 @@

    Module slack_bolt.app.app

    len_header = self.headers.get("Content-Length") or 0 request_body = self.rfile.read(int(len_header)).decode("utf-8") bolt_req = BoltRequest( - body=request_body, query=query, headers=self.headers + body=request_body, + query=query, + # email.message.Message's mapping interface is dict compatible + headers=self.headers, # type:ignore ) bolt_resp: BoltResponse = _bolt_app.dispatch(bolt_req) self._send_bolt_response(bolt_resp) @@ -1531,7 +1540,7 @@

    Module slack_bolt.app.app

    for k, vs in headers.items(): for v in vs: self.send_header(k, v) - self.send_header("Content-Length", len(body_bytes)) + self.send_header("Content-Length", str(len(body_bytes))) self.end_headers() self.wfile.write(body_bytes) @@ -4516,13 +4525,19 @@

    Args

    request_path, _, query = self.path.partition("?") if request_path == _bolt_oauth_flow.install_path: bolt_req = BoltRequest( - body="", query=query, headers=self.headers + body="", + query=query, + # email.message.Message's mapping interface is dict compatible + headers=self.headers, # type:ignore ) bolt_resp = _bolt_oauth_flow.handle_installation(bolt_req) self._send_bolt_response(bolt_resp) elif request_path == _bolt_oauth_flow.redirect_uri_path: bolt_req = BoltRequest( - body="", query=query, headers=self.headers + body="", + query=query, + # email.message.Message's mapping interface is dict compatible + headers=self.headers, # type:ignore ) bolt_resp = _bolt_oauth_flow.handle_callback(bolt_req) self._send_bolt_response(bolt_resp) @@ -4540,7 +4555,10 @@

    Args

    len_header = self.headers.get("Content-Length") or 0 request_body = self.rfile.read(int(len_header)).decode("utf-8") bolt_req = BoltRequest( - body=request_body, query=query, headers=self.headers + body=request_body, + query=query, + # email.message.Message's mapping interface is dict compatible + headers=self.headers, # type:ignore ) bolt_resp: BoltResponse = _bolt_app.dispatch(bolt_req) self._send_bolt_response(bolt_resp) @@ -4566,7 +4584,7 @@

    Args

    for k, vs in headers.items(): for v in vs: self.send_header(k, v) - self.send_header("Content-Length", len(body_bytes)) + self.send_header("Content-Length", str(len(body_bytes))) self.end_headers() self.wfile.write(body_bytes) diff --git a/docs/api-docs/slack_bolt/app/index.html b/docs/api-docs/slack_bolt/app/index.html index 7951c6ce9..e54edaa72 100644 --- a/docs/api-docs/slack_bolt/app/index.html +++ b/docs/api-docs/slack_bolt/app/index.html @@ -38,7 +38,7 @@

    Module slack_bolt.app

    """ # Don't add async module imports here -from .app import App # type: ignore +from .app import App # noqa: F401 type: ignore
    diff --git a/docs/api-docs/slack_bolt/async_app.html b/docs/api-docs/slack_bolt/async_app.html index 6eb811be1..b31814f92 100644 --- a/docs/api-docs/slack_bolt/async_app.html +++ b/docs/api-docs/slack_bolt/async_app.html @@ -108,7 +108,7 @@

    Creating an async app

    Apps can be run the same way as the synchronous example above. If you'd prefer another async Web framework (e.g., Sanic, FastAPI, Starlette), take a look at [the built-in adapters](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter) and their corresponding [examples](https://github.com/slackapi/bolt-python/tree/main/examples). Refer to `slack_bolt.app.async_app` for more details. -""" +""" # noqa: E501 from .app.async_app import AsyncApp # noqa from .context.ack.async_ack import AsyncAck # noqa from .context.async_context import AsyncBoltContext # noqa diff --git a/docs/api-docs/slack_bolt/authorization/index.html b/docs/api-docs/slack_bolt/authorization/index.html index d9f943a1e..6352b61c5 100644 --- a/docs/api-docs/slack_bolt/authorization/index.html +++ b/docs/api-docs/slack_bolt/authorization/index.html @@ -35,7 +35,7 @@

    Module slack_bolt.authorization

    Refer to https://slack.dev/bolt-python/concepts#authorization for details. """ -from .authorize_result import AuthorizeResult +from .authorize_result import AuthorizeResult # noqa
    diff --git a/docs/api-docs/slack_bolt/context/ack/index.html b/docs/api-docs/slack_bolt/context/ack/index.html index 514717149..2d49a6cb2 100644 --- a/docs/api-docs/slack_bolt/context/ack/index.html +++ b/docs/api-docs/slack_bolt/context/ack/index.html @@ -27,7 +27,7 @@

    Module slack_bolt.context.ack

    Expand source code
    # Don't add async module imports here
    -from .ack import Ack
    +from .ack import Ack # noqa: F401
    diff --git a/docs/api-docs/slack_bolt/context/ack/internals.html b/docs/api-docs/slack_bolt/context/ack/internals.html index 56ca58bb2..cede24c62 100644 --- a/docs/api-docs/slack_bolt/context/ack/internals.html +++ b/docs/api-docs/slack_bolt/context/ack/internals.html @@ -89,7 +89,7 @@

    Module slack_bolt.context.ack.internals

    ) else: raise ValueError( - f"errors field is required for response_action: errors" + "errors field is required for response_action: errors" ) else: body = {"response_action": response_action} diff --git a/docs/api-docs/slack_bolt/context/index.html b/docs/api-docs/slack_bolt/context/index.html index 25952a7a2..1e2bea874 100644 --- a/docs/api-docs/slack_bolt/context/index.html +++ b/docs/api-docs/slack_bolt/context/index.html @@ -39,7 +39,7 @@

    Module slack_bolt.context

    """ # Don't add async module imports here -from .context import BoltContext +from .context import BoltContext # noqa: F401
    diff --git a/docs/api-docs/slack_bolt/context/respond/index.html b/docs/api-docs/slack_bolt/context/respond/index.html index 24f1fdc1d..135e7242e 100644 --- a/docs/api-docs/slack_bolt/context/respond/index.html +++ b/docs/api-docs/slack_bolt/context/respond/index.html @@ -27,7 +27,7 @@

    Module slack_bolt.context.respond

    Expand source code
    # Don't add async module imports here
    -from .respond import Respond
    +from .respond import Respond # noqa: F401
    diff --git a/docs/api-docs/slack_bolt/context/say/index.html b/docs/api-docs/slack_bolt/context/say/index.html index 7f6fc657b..9b3ef82c5 100644 --- a/docs/api-docs/slack_bolt/context/say/index.html +++ b/docs/api-docs/slack_bolt/context/say/index.html @@ -27,7 +27,7 @@

    Module slack_bolt.context.say

    Expand source code
    # Don't add async module imports here
    -from .say import Say
    +from .say import Say # noqa: F401
    diff --git a/docs/api-docs/slack_bolt/index.html b/docs/api-docs/slack_bolt/index.html index 86e6b3646..ebaeecaae 100644 --- a/docs/api-docs/slack_bolt/index.html +++ b/docs/api-docs/slack_bolt/index.html @@ -5,7 +5,7 @@ slack_bolt API documentation - + @@ -22,7 +22,7 @@

    Package slack_bolt

    -

    A Python framework to build Slack apps in a flash with the latest platform features. Read the getting started guide and look at our code examples to learn how to build apps using Bolt.

    +

    A Python framework to build Slack apps in a flash with the latest platform features.Read the getting started guide and look at our code examples to learn how to build apps using Bolt.

    • Website: https://slack.dev/bolt-python/
    • GitHub repository: https://github.com/slackapi/bolt-python
    • @@ -33,12 +33,12 @@

      Package slack_bolt

      Expand source code
      """
      -A Python framework to build Slack apps in a flash with the latest platform features. Read the [getting started guide](https://slack.dev/bolt-python/tutorial/getting-started) and look at our [code examples](https://github.com/slackapi/bolt-python/tree/main/examples) to learn how to build apps using Bolt.
      +A Python framework to build Slack apps in a flash with the latest platform features.Read the [getting started guide](https://slack.dev/bolt-python/tutorial/getting-started) and look at our [code examples](https://github.com/slackapi/bolt-python/tree/main/examples) to learn how to build apps using Bolt.
       
       * Website: https://slack.dev/bolt-python/
       * GitHub repository: https://github.com/slackapi/bolt-python
       * The class representing a Bolt app: `slack_bolt.app.app`
      -"""
      +"""  # noqa: E501
       # Don't add async module imports here
       from .app import App  # noqa
       from .context import BoltContext  # noqa
      diff --git a/docs/api-docs/slack_bolt/kwargs_injection/index.html b/docs/api-docs/slack_bolt/kwargs_injection/index.html
      index d22d1e46c..0e0a1ac19 100644
      --- a/docs/api-docs/slack_bolt/kwargs_injection/index.html
      +++ b/docs/api-docs/slack_bolt/kwargs_injection/index.html
      @@ -36,8 +36,8 @@ 

      Module slack_bolt.kwargs_injection

      """ # Don't add async module imports here -from .args import Args -from .utils import build_required_kwargs
      +from .args import Args # noqa: F401 +from .utils import build_required_kwargs # noqa: F401
    diff --git a/docs/api-docs/slack_bolt/kwargs_injection/utils.html b/docs/api-docs/slack_bolt/kwargs_injection/utils.html index 4b47237d3..3f84a30f3 100644 --- a/docs/api-docs/slack_bolt/kwargs_injection/utils.html +++ b/docs/api-docs/slack_bolt/kwargs_injection/utils.html @@ -29,7 +29,7 @@

    Module slack_bolt.kwargs_injection.utils

    # pytype: skip-file
     import inspect
     import logging
    -from typing import Callable, Dict, Optional, Any, Sequence, List
    +from typing import Callable, Dict, Optional, Any, Sequence
     
     from slack_bolt.request import BoltRequest
     from slack_bolt.response import BoltResponse
    diff --git a/docs/api-docs/slack_bolt/lazy_listener/async_runner.html b/docs/api-docs/slack_bolt/lazy_listener/async_runner.html
    index 8585b1c87..b8e56947d 100644
    --- a/docs/api-docs/slack_bolt/lazy_listener/async_runner.html
    +++ b/docs/api-docs/slack_bolt/lazy_listener/async_runner.html
    @@ -28,7 +28,7 @@ 

    Module slack_bolt.lazy_listener.async_runner

    from abc import abstractmethod, ABCMeta
     from logging import Logger
    -from typing import Callable, Awaitable, Any, Coroutine
    +from typing import Callable, Awaitable
     
     from slack_bolt.lazy_listener.async_internals import to_runnable_function
     from slack_bolt.request.async_request import AsyncBoltRequest
    diff --git a/docs/api-docs/slack_bolt/listener/builtins.html b/docs/api-docs/slack_bolt/listener/builtins.html
    index 205e85c58..0b892bbf9 100644
    --- a/docs/api-docs/slack_bolt/listener/builtins.html
    +++ b/docs/api-docs/slack_bolt/listener/builtins.html
    @@ -26,9 +26,7 @@ 

    Module slack_bolt.listener.builtins

    Expand source code -
    from slack_sdk.oauth import InstallationStore
    -
    -from slack_bolt.context.context import BoltContext
    +
    from slack_bolt.context.context import BoltContext
     from slack_sdk.oauth.installation_store.installation_store import InstallationStore
     
     
    diff --git a/docs/api-docs/slack_bolt/listener_matcher/builtins.html b/docs/api-docs/slack_bolt/listener_matcher/builtins.html
    index e55a7e489..53cac5ebe 100644
    --- a/docs/api-docs/slack_bolt/listener_matcher/builtins.html
    +++ b/docs/api-docs/slack_bolt/listener_matcher/builtins.html
    @@ -57,8 +57,7 @@ 

    Module slack_bolt.listener_matcher.builtins

    from re import _pattern_type as Pattern else: from re import Pattern -from typing import Callable, Awaitable, Any, Sequence, Optional, Union -from typing import Union, Optional, Dict +from typing import Callable, Awaitable, Any, Sequence, Optional, Union, Dict from slack_bolt.kwargs_injection import build_required_kwargs from slack_bolt.request import BoltRequest diff --git a/docs/api-docs/slack_bolt/logger/messages.html b/docs/api-docs/slack_bolt/logger/messages.html index a29a8e9d0..565d3cf9b 100644 --- a/docs/api-docs/slack_bolt/logger/messages.html +++ b/docs/api-docs/slack_bolt/logger/messages.html @@ -376,7 +376,10 @@

    Module slack_bolt.logger.messages

    listener_name: str, status: int, body: str, starting_time: float ) -> str: millis = int((time.time() - starting_time) * 1000) - return f"Responding with listener middleware's response - listener: {listener_name}, status: {status}, body: {body} ({millis} millis)"
    + return ( + "Responding with listener middleware's response - " + f"listener: {listener_name}, status: {status}, body: {body} ({millis} millis)" + )
    @@ -438,7 +441,10 @@

    Functions

    listener_name: str, status: int, body: str, starting_time: float ) -> str: millis = int((time.time() - starting_time) * 1000) - return f"Responding with listener middleware's response - listener: {listener_name}, status: {status}, body: {body} ({millis} millis)"
    + return ( + "Responding with listener middleware's response - " + f"listener: {listener_name}, status: {status}, body: {body} ({millis} millis)" + )
    diff --git a/docs/api-docs/slack_bolt/middleware/async_builtins.html b/docs/api-docs/slack_bolt/middleware/async_builtins.html index 987ff15fc..0f5f35bdd 100644 --- a/docs/api-docs/slack_bolt/middleware/async_builtins.html +++ b/docs/api-docs/slack_bolt/middleware/async_builtins.html @@ -26,17 +26,17 @@

    Module slack_bolt.middleware.async_builtins

    Expand source code -
    from .ignoring_self_events.async_ignoring_self_events import (
    +
    from .ignoring_self_events.async_ignoring_self_events import (  # noqa: F401
         AsyncIgnoringSelfEvents,
    -)  # noqa
    -from .request_verification.async_request_verification import (
    +)
    +from .request_verification.async_request_verification import (  # noqa: F401
         AsyncRequestVerification,
    -)  # noqa
    -from .ssl_check.async_ssl_check import AsyncSslCheck  # noqa
    -from .url_verification.async_url_verification import AsyncUrlVerification  # noqa
    -from .message_listener_matches.async_message_listener_matches import (
    +)
    +from .ssl_check.async_ssl_check import AsyncSslCheck  # noqa: F401
    +from .url_verification.async_url_verification import AsyncUrlVerification  # noqa: F401
    +from .message_listener_matches.async_message_listener_matches import (  # noqa: F401
         AsyncMessageListenerMatches,
    -)  # noqa
    +)
    diff --git a/docs/api-docs/slack_bolt/middleware/authorization/index.html b/docs/api-docs/slack_bolt/middleware/authorization/index.html index 30c22c10b..1884327b1 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/index.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/index.html @@ -27,9 +27,9 @@

    Module slack_bolt.middleware.authorization

    Expand source code
    # Don't add async module imports here
    -from .authorization import Authorization
    -from .multi_teams_authorization import MultiTeamsAuthorization
    -from .single_team_authorization import SingleTeamAuthorization
    +from .authorization import Authorization # noqa: F401 +from .multi_teams_authorization import MultiTeamsAuthorization # noqa: F401 +from .single_team_authorization import SingleTeamAuthorization # noqa: F401
    diff --git a/docs/api-docs/slack_bolt/middleware/index.html b/docs/api-docs/slack_bolt/middleware/index.html index d134d6366..b4c80965e 100644 --- a/docs/api-docs/slack_bolt/middleware/index.html +++ b/docs/api-docs/slack_bolt/middleware/index.html @@ -39,13 +39,16 @@

    Module slack_bolt.middleware

    """ # Don't add async module imports here -from .authorization import SingleTeamAuthorization, MultiTeamsAuthorization -from .custom_middleware import CustomMiddleware -from .ignoring_self_events import IgnoringSelfEvents -from .middleware import Middleware -from .request_verification import RequestVerification -from .ssl_check import SslCheck -from .url_verification import UrlVerification +from .authorization import ( + SingleTeamAuthorization, + MultiTeamsAuthorization, +) # noqa: F401 +from .custom_middleware import CustomMiddleware # noqa: F401 +from .ignoring_self_events import IgnoringSelfEvents # noqa: F401 +from .middleware import Middleware # noqa: F401 +from .request_verification import RequestVerification # noqa: F401 +from .ssl_check import SslCheck # noqa: F401 +from .url_verification import UrlVerification # noqa: F401 builtin_middleware_classes = [ SslCheck, diff --git a/docs/api-docs/slack_bolt/middleware/ssl_check/ssl_check.html b/docs/api-docs/slack_bolt/middleware/ssl_check/ssl_check.html index 20fd600ed..550b05fd2 100644 --- a/docs/api-docs/slack_bolt/middleware/ssl_check/ssl_check.html +++ b/docs/api-docs/slack_bolt/middleware/ssl_check/ssl_check.html @@ -51,7 +51,7 @@

    Module slack_bolt.middleware.ssl_check.ssl_check< verification_token: The verification token to check (optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation) base_logger: The base logger - """ + """ # noqa: E501 self.verification_token = verification_token self.logger = get_bolt_logger(SslCheck, base_logger=base_logger) @@ -135,7 +135,7 @@

    Args

    verification_token: The verification token to check (optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation) base_logger: The base logger - """ + """ # noqa: E501 self.verification_token = verification_token self.logger = get_bolt_logger(SslCheck, base_logger=base_logger) diff --git a/docs/api-docs/slack_bolt/oauth/internals.html b/docs/api-docs/slack_bolt/oauth/internals.html index 23db0f934..030eed68f 100644 --- a/docs/api-docs/slack_bolt/oauth/internals.html +++ b/docs/api-docs/slack_bolt/oauth/internals.html @@ -119,7 +119,7 @@

    Module slack_bolt.oauth.internals

    <p><a href="{url}"><img alt=""Add to Slack"" height="40" width="139" src="https://platform.slack-edge.com/img/add_to_slack.png" srcset="https://platform.slack-edge.com/img/add_to_slack.png 1x, https://platform.slack-edge.com/img/add_to_slack@2x.png 2x" /></a></p> </body> </html> -""" +""" # noqa: E501 # key: client_id, value: InstallationStore diff --git a/docs/api-docs/slack_bolt/request/async_internals.html b/docs/api-docs/slack_bolt/request/async_internals.html index 516d8209b..0505fb696 100644 --- a/docs/api-docs/slack_bolt/request/async_internals.html +++ b/docs/api-docs/slack_bolt/request/async_internals.html @@ -31,6 +31,7 @@

    Module slack_bolt.request.async_internals

    from slack_bolt.context.async_context import AsyncBoltContext from slack_bolt.request.internals import ( extract_enterprise_id, + extract_is_enterprise_install, extract_team_id, extract_user_id, extract_channel_id, @@ -42,6 +43,7 @@

    Module slack_bolt.request.async_internals

    context: AsyncBoltContext, body: Dict[str, Any], ) -> AsyncBoltContext: + context["is_enterprise_install"] = extract_is_enterprise_install(body) enterprise_id = extract_enterprise_id(body) if enterprise_id: context["enterprise_id"] = enterprise_id @@ -87,6 +89,7 @@

    Functions

    context: AsyncBoltContext, body: Dict[str, Any], ) -> AsyncBoltContext: + context["is_enterprise_install"] = extract_is_enterprise_install(body) enterprise_id = extract_enterprise_id(body) if enterprise_id: context["enterprise_id"] = enterprise_id diff --git a/docs/api-docs/slack_bolt/request/index.html b/docs/api-docs/slack_bolt/request/index.html index 20cee996a..f9f32e0de 100644 --- a/docs/api-docs/slack_bolt/request/index.html +++ b/docs/api-docs/slack_bolt/request/index.html @@ -35,7 +35,7 @@

    Module slack_bolt.request

    This interface encapsulates the difference between the two. """ # Don't add async module imports here -from .request import BoltRequest +from .request import BoltRequest # noqa: F401
    diff --git a/docs/api-docs/slack_bolt/request/internals.html b/docs/api-docs/slack_bolt/request/internals.html index 9a61d42f7..9bb091717 100644 --- a/docs/api-docs/slack_bolt/request/internals.html +++ b/docs/api-docs/slack_bolt/request/internals.html @@ -75,6 +75,10 @@

    Module slack_bolt.request.internals

    def extract_is_enterprise_install(payload: Dict[str, Any]) -> Optional[bool]: + if payload.get("authorizations") is not None and len(payload["authorizations"]) > 0: + # To make Events API handling functioning also for shared channels, + # we should use .authorizations[0].is_enterprise_install over .is_enterprise_install + return extract_is_enterprise_install(payload["authorizations"][0]) if "is_enterprise_install" in payload: is_enterprise_install = payload.get("is_enterprise_install") return is_enterprise_install is not None and ( @@ -405,6 +409,10 @@

    Functions

    Expand source code
    def extract_is_enterprise_install(payload: Dict[str, Any]) -> Optional[bool]:
    +    if payload.get("authorizations") is not None and len(payload["authorizations"]) > 0:
    +        # To make Events API handling functioning also for shared channels,
    +        # we should use .authorizations[0].is_enterprise_install over .is_enterprise_install
    +        return extract_is_enterprise_install(payload["authorizations"][0])
         if "is_enterprise_install" in payload:
             is_enterprise_install = payload.get("is_enterprise_install")
             return is_enterprise_install is not None and (
    diff --git a/docs/api-docs/slack_bolt/response/index.html b/docs/api-docs/slack_bolt/response/index.html
    index 93ad52e73..d1d1cc747 100644
    --- a/docs/api-docs/slack_bolt/response/index.html
    +++ b/docs/api-docs/slack_bolt/response/index.html
    @@ -38,7 +38,7 @@ 

    Module slack_bolt.response

    Refer to https://api.slack.com/apis/connections for the two types of connections. """ -from .response import BoltResponse
    +from .response import BoltResponse # noqa: F401
    diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index dc5919bc8..1ae0d24f4 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.13.0"
    +__version__ = "1.13.1"
    diff --git a/docs/api-docs/slack_bolt/workflows/step/async_step.html b/docs/api-docs/slack_bolt/workflows/step/async_step.html index 1a560fb77..35c412f67 100644 --- a/docs/api-docs/slack_bolt/workflows/step/async_step.html +++ b/docs/api-docs/slack_bolt/workflows/step/async_step.html @@ -258,11 +258,11 @@

    Module slack_bolt.workflows.step.async_step

    An `AsyncWorkflowStep` object """ if self._edit is None: - raise BoltError(f"edit listener is not registered") + raise BoltError("edit listener is not registered") if self._save is None: - raise BoltError(f"save listener is not registered") + raise BoltError("save listener is not registered") if self._execute is None: - raise BoltError(f"execute listener is not registered") + raise BoltError("execute listener is not registered") return AsyncWorkflowStep( callback_id=self.callback_id, @@ -1052,11 +1052,11 @@

    Args

    An `AsyncWorkflowStep` object """ if self._edit is None: - raise BoltError(f"edit listener is not registered") + raise BoltError("edit listener is not registered") if self._save is None: - raise BoltError(f"save listener is not registered") + raise BoltError("save listener is not registered") if self._execute is None: - raise BoltError(f"execute listener is not registered") + raise BoltError("execute listener is not registered") return AsyncWorkflowStep( callback_id=self.callback_id, @@ -1210,11 +1210,11 @@

    Returns

    An `AsyncWorkflowStep` object """ if self._edit is None: - raise BoltError(f"edit listener is not registered") + raise BoltError("edit listener is not registered") if self._save is None: - raise BoltError(f"save listener is not registered") + raise BoltError("save listener is not registered") if self._execute is None: - raise BoltError(f"execute listener is not registered") + raise BoltError("execute listener is not registered") return AsyncWorkflowStep( callback_id=self.callback_id, diff --git a/docs/api-docs/slack_bolt/workflows/step/index.html b/docs/api-docs/slack_bolt/workflows/step/index.html index 3f4057cb1..afa34e048 100644 --- a/docs/api-docs/slack_bolt/workflows/step/index.html +++ b/docs/api-docs/slack_bolt/workflows/step/index.html @@ -26,12 +26,12 @@

    Module slack_bolt.workflows.step

    Expand source code -
    from .step import WorkflowStep
    -from .step_middleware import WorkflowStepMiddleware
    -from .utilities.complete import Complete
    -from .utilities.configure import Configure
    -from .utilities.update import Update
    -from .utilities.fail import Fail
    +
    from .step import WorkflowStep  # noqa: F401
    +from .step_middleware import WorkflowStepMiddleware  # noqa: F401
    +from .utilities.complete import Complete  # noqa: F401
    +from .utilities.configure import Configure  # noqa: F401
    +from .utilities.update import Update  # noqa: F401
    +from .utilities.fail import Fail  # noqa: F401
    diff --git a/docs/api-docs/slack_bolt/workflows/step/step.html b/docs/api-docs/slack_bolt/workflows/step/step.html index f64c784d3..cc2cab62d 100644 --- a/docs/api-docs/slack_bolt/workflows/step/step.html +++ b/docs/api-docs/slack_bolt/workflows/step/step.html @@ -248,11 +248,11 @@

    Module slack_bolt.workflows.step.step

    WorkflowStep object """ if self._edit is None: - raise BoltError(f"edit listener is not registered") + raise BoltError("edit listener is not registered") if self._save is None: - raise BoltError(f"save listener is not registered") + raise BoltError("save listener is not registered") if self._execute is None: - raise BoltError(f"execute listener is not registered") + raise BoltError("execute listener is not registered") return WorkflowStep( callback_id=self.callback_id, @@ -1068,11 +1068,11 @@

    Args

    WorkflowStep object """ if self._edit is None: - raise BoltError(f"edit listener is not registered") + raise BoltError("edit listener is not registered") if self._save is None: - raise BoltError(f"save listener is not registered") + raise BoltError("save listener is not registered") if self._execute is None: - raise BoltError(f"execute listener is not registered") + raise BoltError("execute listener is not registered") return WorkflowStep( callback_id=self.callback_id, @@ -1250,11 +1250,11 @@

    Returns

    WorkflowStep object """ if self._edit is None: - raise BoltError(f"edit listener is not registered") + raise BoltError("edit listener is not registered") if self._save is None: - raise BoltError(f"save listener is not registered") + raise BoltError("save listener is not registered") if self._execute is None: - raise BoltError(f"execute listener is not registered") + raise BoltError("execute listener is not registered") return WorkflowStep( callback_id=self.callback_id, From 20bfec888fa0fa55b7dfdfa6fce9e266d5a1adb3 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 2 May 2022 09:08:42 +0900 Subject: [PATCH 332/719] Upgrade pytype to 2022.4.26 --- scripts/run_pytype.sh | 2 +- slack_bolt/app/__init__.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/run_pytype.sh b/scripts/run_pytype.sh index 780bf87fc..c0290e261 100755 --- a/scripts/run_pytype.sh +++ b/scripts/run_pytype.sh @@ -5,5 +5,5 @@ script_dir=$(dirname $0) cd ${script_dir}/.. && \ pip install -e ".[async]" && \ pip install -e ".[adapter]" && \ - pip install "pytype==2022.4.15" && \ + pip install "pytype==2022.4.26" && \ pytype slack_bolt/ diff --git a/slack_bolt/app/__init__.py b/slack_bolt/app/__init__.py index b99c2c430..5838f6dec 100644 --- a/slack_bolt/app/__init__.py +++ b/slack_bolt/app/__init__.py @@ -1,3 +1,4 @@ +# flake8: noqa """Application interface in Bolt. For most use cases, we recommend using `slack_bolt.app.app`. @@ -6,4 +7,4 @@ """ # Don't add async module imports here -from .app import App # noqa: F401 type: ignore +from .app import App # type: ignore From 97e5b158151cbd2ac2c0337002492ac3096eebde Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 12 May 2022 07:35:16 +0900 Subject: [PATCH 333/719] Fix #644 app.message listener does not handle events when a file is attached (#645) --- slack_bolt/app/app.py | 3 + slack_bolt/app/async_app.py | 3 + .../scenario_tests/test_message_file_share.py | 173 +++++++++++++++++ .../test_message_file_share.py | 179 ++++++++++++++++++ 4 files changed, 358 insertions(+) create mode 100644 tests/scenario_tests/test_message_file_share.py create mode 100644 tests/scenario_tests_async/test_message_file_share.py diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index c94cbfebe..fcf82935b 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -837,6 +837,9 @@ def __call__(*args, **kwargs): # If an end-user posts a message with "Also send to #channel" checked, # the message event comes with this subtype. "thread_broadcast", + # If an end-user posts a message with attached files, + # the message event comes with this subtype. + "file_share", ), } primary_matcher = builtin_matchers.message_event( diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index aafdfb4b0..2df9bf120 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -894,6 +894,9 @@ def __call__(*args, **kwargs): # If an end-user posts a message with "Also send to #channel" checked, # the message event comes with this subtype. "thread_broadcast", + # If an end-user posts a message with attached files, + # the message event comes with this subtype. + "file_share", ), } primary_matcher = builtin_matchers.message_event( diff --git a/tests/scenario_tests/test_message_file_share.py b/tests/scenario_tests/test_message_file_share.py new file mode 100644 index 000000000..8921b37c9 --- /dev/null +++ b/tests/scenario_tests/test_message_file_share.py @@ -0,0 +1,173 @@ +import json +import time + +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web import WebClient + +from slack_bolt.app import App +from slack_bolt.request import BoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestMessageFileShare: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def build_request(self, payload: dict) -> BoltRequest: + timestamp, body = str(int(time.time())), json.dumps(payload) + return BoltRequest(body=body, headers=self.build_headers(timestamp, body)) + + def test_message_handler(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + result = {"call_count": 0} + + @app.message("Hi there!") + def handle_messages(event, logger): + logger.info(event) + result["call_count"] = result["call_count"] + 1 + + request = self.build_request(event_payload) + response = app.dispatch(request) + assert response.status == 200 + + request = self.build_request(event_payload) + response = app.dispatch(request) + assert response.status == 200 + + assert_auth_test_count(self, 1) + time.sleep(1) # wait a bit after auto ack() + assert result["call_count"] == 2 + + +event_payload = { + "token": "xxx", + "team_id": "T111", + "api_app_id": "A111", + "event": { + "type": "message", + "text": "Hi there!", + "files": [ + { + "id": "F111", + "created": 1652227642, + "timestamp": 1652227642, + "name": "file.png", + "title": "file.png", + "mimetype": "image/png", + "filetype": "png", + "pretty_type": "PNG", + "user": "U111", + "editable": False, + "size": 92582, + "mode": "hosted", + "is_external": False, + "external_type": "", + "is_public": True, + "public_url_shared": False, + "display_as_bot": False, + "username": "", + "url_private": "https://files.slack.com/files-pri/T111-F111/file.png", + "url_private_download": "https://files.slack.com/files-pri/T111-F111/download/file.png", + "media_display_type": "unknown", + "thumb_64": "https://files.slack.com/files-tmb/T111-F111-f820f29515/file_64.png", + "thumb_80": "https://files.slack.com/files-tmb/T111-F111-f820f29515/file_80.png", + "thumb_360": "https://files.slack.com/files-tmb/T111-F111-f820f29515/file_360.png", + "thumb_360_w": 360, + "thumb_360_h": 115, + "thumb_480": "https://files.slack.com/files-tmb/T111-F111-f820f29515/file_480.png", + "thumb_480_w": 480, + "thumb_480_h": 153, + "thumb_160": "https://files.slack.com/files-tmb/T111-F111-f820f29515/file_160.png", + "thumb_720": "https://files.slack.com/files-tmb/T111-F111-f820f29515/file_720.png", + "thumb_720_w": 720, + "thumb_720_h": 230, + "thumb_800": "https://files.slack.com/files-tmb/T111-F111-f820f29515/file_800.png", + "thumb_800_w": 800, + "thumb_800_h": 255, + "thumb_960": "https://files.slack.com/files-tmb/T111-F111-f820f29515/file_960.png", + "thumb_960_w": 960, + "thumb_960_h": 306, + "thumb_1024": "https://files.slack.com/files-tmb/T111-F111-f820f29515/file_1024.png", + "thumb_1024_w": 1024, + "thumb_1024_h": 327, + "original_w": 1134, + "original_h": 362, + "thumb_tiny": "AwAPADCkCAOcUEj0zTaKAHZHpT9oxwR+VRVMBQA0r3yPypu0f3v0p5yBTCcmmI//2Q==", + "permalink": "https://xxx.slack.com/files/U111/F111/file.png", + "permalink_public": "https://slack-files.com/T111-F111-faecabecf7", + "has_rich_preview": False, + } + ], + "upload": False, + "user": "U111", + "display_as_bot": False, + "ts": "1652227646.593159", + "blocks": [ + { + "type": "rich_text", + "block_id": "ba4", + "elements": [ + { + "type": "rich_text_section", + "elements": [{"type": "text", "text": "Hi there!"}], + } + ], + } + ], + "client_msg_id": "ca088267-717f-41a8-9db8-c98ae14ad6a0", + "channel": "C111", + "subtype": "file_share", + "event_ts": "1652227646.593159", + "channel_type": "channel", + }, + "type": "event_callback", + "event_id": "Ev03EGJQAVMM", + "event_time": 1652227646, + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T111", + "user_id": "U222", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": False, + "event_context": "4-xxx", +} diff --git a/tests/scenario_tests_async/test_message_file_share.py b/tests/scenario_tests_async/test_message_file_share.py new file mode 100644 index 000000000..4130c6fb7 --- /dev/null +++ b/tests/scenario_tests_async/test_message_file_share.py @@ -0,0 +1,179 @@ +import asyncio +import json +from time import time + +import pytest +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count_async, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestAsyncMessageFileShare: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def build_request(self, payload: dict) -> AsyncBoltRequest: + timestamp, body = str(int(time())), json.dumps(payload) + return AsyncBoltRequest(body=body, headers=self.build_headers(timestamp, body)) + + @pytest.mark.asyncio + async def test_string_keyword(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + result = {"call_count": 0} + + @app.message("Hi there!") + async def handle_messages(event, logger): + logger.info(event) + result["call_count"] = result["call_count"] + 1 + + request = self.build_request(event_payload) + response = await app.async_dispatch(request) + assert response.status == 200 + + request = self.build_request(event_payload) + response = await app.async_dispatch(request) + assert response.status == 200 + + await assert_auth_test_count_async(self, 1) + await asyncio.sleep(1) # wait a bit after auto ack() + assert result["call_count"] == 2 + + +event_payload = { + "token": "xxx", + "team_id": "T111", + "api_app_id": "A111", + "event": { + "type": "message", + "text": "Hi there!", + "files": [ + { + "id": "F111", + "created": 1652227642, + "timestamp": 1652227642, + "name": "file.png", + "title": "file.png", + "mimetype": "image/png", + "filetype": "png", + "pretty_type": "PNG", + "user": "U111", + "editable": False, + "size": 92582, + "mode": "hosted", + "is_external": False, + "external_type": "", + "is_public": True, + "public_url_shared": False, + "display_as_bot": False, + "username": "", + "url_private": "https://files.slack.com/files-pri/T111-F111/file.png", + "url_private_download": "https://files.slack.com/files-pri/T111-F111/download/file.png", + "media_display_type": "unknown", + "thumb_64": "https://files.slack.com/files-tmb/T111-F111-f820f29515/file_64.png", + "thumb_80": "https://files.slack.com/files-tmb/T111-F111-f820f29515/file_80.png", + "thumb_360": "https://files.slack.com/files-tmb/T111-F111-f820f29515/file_360.png", + "thumb_360_w": 360, + "thumb_360_h": 115, + "thumb_480": "https://files.slack.com/files-tmb/T111-F111-f820f29515/file_480.png", + "thumb_480_w": 480, + "thumb_480_h": 153, + "thumb_160": "https://files.slack.com/files-tmb/T111-F111-f820f29515/file_160.png", + "thumb_720": "https://files.slack.com/files-tmb/T111-F111-f820f29515/file_720.png", + "thumb_720_w": 720, + "thumb_720_h": 230, + "thumb_800": "https://files.slack.com/files-tmb/T111-F111-f820f29515/file_800.png", + "thumb_800_w": 800, + "thumb_800_h": 255, + "thumb_960": "https://files.slack.com/files-tmb/T111-F111-f820f29515/file_960.png", + "thumb_960_w": 960, + "thumb_960_h": 306, + "thumb_1024": "https://files.slack.com/files-tmb/T111-F111-f820f29515/file_1024.png", + "thumb_1024_w": 1024, + "thumb_1024_h": 327, + "original_w": 1134, + "original_h": 362, + "thumb_tiny": "AwAPADCkCAOcUEj0zTaKAHZHpT9oxwR+VRVMBQA0r3yPypu0f3v0p5yBTCcmmI//2Q==", + "permalink": "https://xxx.slack.com/files/U111/F111/file.png", + "permalink_public": "https://slack-files.com/T111-F111-faecabecf7", + "has_rich_preview": False, + } + ], + "upload": False, + "user": "U111", + "display_as_bot": False, + "ts": "1652227646.593159", + "blocks": [ + { + "type": "rich_text", + "block_id": "ba4", + "elements": [ + { + "type": "rich_text_section", + "elements": [{"type": "text", "text": "Hi there!"}], + } + ], + } + ], + "client_msg_id": "ca088267-717f-41a8-9db8-c98ae14ad6a0", + "channel": "C111", + "subtype": "file_share", + "event_ts": "1652227646.593159", + "channel_type": "channel", + }, + "type": "event_callback", + "event_id": "Ev03EGJQAVMM", + "event_time": 1652227646, + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T111", + "user_id": "U222", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": False, + "event_context": "4-xxx", +} From 8b10a02acc954626ee5fbab99da4f4fdd9b48562 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 12 May 2022 07:53:30 +0900 Subject: [PATCH 334/719] version 1.13.2 --- docs/api-docs/slack_bolt/app/app.html | 9 +++++++++ docs/api-docs/slack_bolt/app/async_app.html | 9 +++++++++ docs/api-docs/slack_bolt/app/index.html | 5 +++-- docs/api-docs/slack_bolt/version.html | 2 +- slack_bolt/version.py | 2 +- 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/docs/api-docs/slack_bolt/app/app.html b/docs/api-docs/slack_bolt/app/app.html index b7eac7755..4df4d89ec 100644 --- a/docs/api-docs/slack_bolt/app/app.html +++ b/docs/api-docs/slack_bolt/app/app.html @@ -865,6 +865,9 @@

    Module slack_bolt.app.app

    # If an end-user posts a message with "Also send to #channel" checked, # the message event comes with this subtype. "thread_broadcast", + # If an end-user posts a message with attached files, + # the message event comes with this subtype. + "file_share", ), } primary_matcher = builtin_matchers.message_event( @@ -2410,6 +2413,9 @@

    Args

    # If an end-user posts a message with "Also send to #channel" checked, # the message event comes with this subtype. "thread_broadcast", + # If an end-user posts a message with attached files, + # the message event comes with this subtype. + "file_share", ), } primary_matcher = builtin_matchers.message_event( @@ -3827,6 +3833,9 @@

    Args

    # If an end-user posts a message with "Also send to #channel" checked, # the message event comes with this subtype. "thread_broadcast", + # If an end-user posts a message with attached files, + # the message event comes with this subtype. + "file_share", ), } primary_matcher = builtin_matchers.message_event( diff --git a/docs/api-docs/slack_bolt/app/async_app.html b/docs/api-docs/slack_bolt/app/async_app.html index d22e917ec..894ee048c 100644 --- a/docs/api-docs/slack_bolt/app/async_app.html +++ b/docs/api-docs/slack_bolt/app/async_app.html @@ -922,6 +922,9 @@

    Module slack_bolt.app.async_app

    # If an end-user posts a message with "Also send to #channel" checked, # the message event comes with this subtype. "thread_broadcast", + # If an end-user posts a message with attached files, + # the message event comes with this subtype. + "file_share", ), } primary_matcher = builtin_matchers.message_event( @@ -2389,6 +2392,9 @@

    Args

    # If an end-user posts a message with "Also send to #channel" checked, # the message event comes with this subtype. "thread_broadcast", + # If an end-user posts a message with attached files, + # the message event comes with this subtype. + "file_share", ), } primary_matcher = builtin_matchers.message_event( @@ -3831,6 +3837,9 @@

    Args

    # If an end-user posts a message with "Also send to #channel" checked, # the message event comes with this subtype. "thread_broadcast", + # If an end-user posts a message with attached files, + # the message event comes with this subtype. + "file_share", ), } primary_matcher = builtin_matchers.message_event( diff --git a/docs/api-docs/slack_bolt/app/index.html b/docs/api-docs/slack_bolt/app/index.html index e54edaa72..2ad72f98a 100644 --- a/docs/api-docs/slack_bolt/app/index.html +++ b/docs/api-docs/slack_bolt/app/index.html @@ -30,7 +30,8 @@

    Module slack_bolt.app

    Expand source code -
    """Application interface in Bolt.
    +
    # flake8: noqa
    +"""Application interface in Bolt.
     
     For most use cases, we recommend using `slack_bolt.app.app`.
     If you already have knowledge about asyncio and prefer the programming model,
    @@ -38,7 +39,7 @@ 

    Module slack_bolt.app

    """ # Don't add async module imports here -from .app import App # noqa: F401 type: ignore
    +from .app import App # type: ignore
    diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index 1ae0d24f4..b085300c3 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.13.1"
    +__version__ = "1.13.2"
    diff --git a/slack_bolt/version.py b/slack_bolt/version.py index a5295f2c9..d0ccd73c6 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.13.1" +__version__ = "1.13.2" From b637c298dfb1132ffd545a46d18bfad061eb18e6 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 16 May 2022 08:42:19 +0900 Subject: [PATCH 335/719] Remove noqa comments and add __all__ to __init__.py files (#647) --- scripts/run_pytype.sh | 2 +- slack_bolt/__init__.py | 33 +++++++++++++------ slack_bolt/adapter/aiohttp/__init__.py | 6 ++++ slack_bolt/adapter/aws_lambda/__init__.py | 6 +++- slack_bolt/adapter/bottle/__init__.py | 6 +++- slack_bolt/adapter/cherrypy/__init__.py | 6 +++- slack_bolt/adapter/django/__init__.py | 6 +++- slack_bolt/adapter/falcon/__init__.py | 6 +++- slack_bolt/adapter/fastapi/__init__.py | 6 +++- slack_bolt/adapter/fastapi/async_handler.py | 6 +++- slack_bolt/adapter/flask/__init__.py | 6 +++- slack_bolt/adapter/pyramid/__init__.py | 6 +++- slack_bolt/adapter/sanic/__init__.py | 6 +++- slack_bolt/adapter/socket_mode/__init__.py | 6 +++- .../adapter/socket_mode/async_handler.py | 6 +++- slack_bolt/adapter/starlette/__init__.py | 6 +++- slack_bolt/adapter/tornado/__init__.py | 7 +++- slack_bolt/app/__init__.py | 4 +++ slack_bolt/app/async_app.py | 2 +- slack_bolt/async_app.py | 27 ++++++++++----- slack_bolt/authorization/__init__.py | 6 +++- slack_bolt/context/__init__.py | 6 +++- slack_bolt/context/ack/__init__.py | 6 +++- slack_bolt/context/respond/__init__.py | 6 +++- slack_bolt/context/say/__init__.py | 6 +++- slack_bolt/kwargs_injection/__init__.py | 9 +++-- slack_bolt/lazy_listener/__init__.py | 9 +++-- slack_bolt/listener/__init__.py | 6 ++++ slack_bolt/listener_matcher/__init__.py | 6 ++++ slack_bolt/logger/__init__.py | 6 ++++ slack_bolt/middleware/__init__.py | 26 +++++++++++---- slack_bolt/middleware/async_builtins.py | 18 +++++++--- .../middleware/authorization/__init__.py | 12 +++++-- .../ignoring_self_events/__init__.py | 6 +++- .../message_listener_matches/__init__.py | 6 +++- .../request_verification/__init__.py | 6 +++- slack_bolt/middleware/ssl_check/__init__.py | 6 +++- .../middleware/url_verification/__init__.py | 6 +++- slack_bolt/oauth/__init__.py | 6 +++- slack_bolt/request/__init__.py | 6 +++- slack_bolt/response/__init__.py | 6 +++- slack_bolt/workflows/step/__init__.py | 21 ++++++++---- .../workflows/step/async_step_middleware.py | 2 +- 43 files changed, 279 insertions(+), 73 deletions(-) diff --git a/scripts/run_pytype.sh b/scripts/run_pytype.sh index c0290e261..8f3825228 100755 --- a/scripts/run_pytype.sh +++ b/scripts/run_pytype.sh @@ -5,5 +5,5 @@ script_dir=$(dirname $0) cd ${script_dir}/.. && \ pip install -e ".[async]" && \ pip install -e ".[adapter]" && \ - pip install "pytype==2022.4.26" && \ + pip install "pytype==2022.5.10" && \ pytype slack_bolt/ diff --git a/slack_bolt/__init__.py b/slack_bolt/__init__.py index 4050d83a9..b1065ca93 100644 --- a/slack_bolt/__init__.py +++ b/slack_bolt/__init__.py @@ -6,13 +6,26 @@ * The class representing a Bolt app: `slack_bolt.app.app` """ # noqa: E501 # Don't add async module imports here -from .app import App # noqa -from .context import BoltContext # noqa -from .context.ack import Ack # noqa -from .context.respond import Respond # noqa -from .context.say import Say # noqa -from .kwargs_injection import Args # noqa -from .listener import Listener # noqa -from .listener_matcher import CustomListenerMatcher # noqa -from .request import BoltRequest # noqa -from .response import BoltResponse # noqa +from .app import App +from .context import BoltContext +from .context.ack import Ack +from .context.respond import Respond +from .context.say import Say +from .kwargs_injection import Args +from .listener import Listener +from .listener_matcher import CustomListenerMatcher +from .request import BoltRequest +from .response import BoltResponse + +__all__ = [ + "App", + "BoltContext", + "Ack", + "Respond", + "Say", + "Args", + "Listener", + "CustomListenerMatcher", + "BoltRequest", + "BoltResponse", +] diff --git a/slack_bolt/adapter/aiohttp/__init__.py b/slack_bolt/adapter/aiohttp/__init__.py index 02d6a1673..b3a12d49b 100644 --- a/slack_bolt/adapter/aiohttp/__init__.py +++ b/slack_bolt/adapter/aiohttp/__init__.py @@ -39,3 +39,9 @@ async def to_aiohttp_response(bolt_resp: BoltResponse) -> web.Response: httponly=True, ) return resp + + +__all__ = [ + "to_bolt_request", + "to_aiohttp_response", +] diff --git a/slack_bolt/adapter/aws_lambda/__init__.py b/slack_bolt/adapter/aws_lambda/__init__.py index df8fd9d79..83f4882db 100644 --- a/slack_bolt/adapter/aws_lambda/__init__.py +++ b/slack_bolt/adapter/aws_lambda/__init__.py @@ -1 +1,5 @@ -from .handler import SlackRequestHandler # noqa: F401 +from .handler import SlackRequestHandler + +__all__ = [ + "SlackRequestHandler", +] diff --git a/slack_bolt/adapter/bottle/__init__.py b/slack_bolt/adapter/bottle/__init__.py index df8fd9d79..83f4882db 100644 --- a/slack_bolt/adapter/bottle/__init__.py +++ b/slack_bolt/adapter/bottle/__init__.py @@ -1 +1,5 @@ -from .handler import SlackRequestHandler # noqa: F401 +from .handler import SlackRequestHandler + +__all__ = [ + "SlackRequestHandler", +] diff --git a/slack_bolt/adapter/cherrypy/__init__.py b/slack_bolt/adapter/cherrypy/__init__.py index df8fd9d79..83f4882db 100644 --- a/slack_bolt/adapter/cherrypy/__init__.py +++ b/slack_bolt/adapter/cherrypy/__init__.py @@ -1 +1,5 @@ -from .handler import SlackRequestHandler # noqa: F401 +from .handler import SlackRequestHandler + +__all__ = [ + "SlackRequestHandler", +] diff --git a/slack_bolt/adapter/django/__init__.py b/slack_bolt/adapter/django/__init__.py index df8fd9d79..83f4882db 100644 --- a/slack_bolt/adapter/django/__init__.py +++ b/slack_bolt/adapter/django/__init__.py @@ -1 +1,5 @@ -from .handler import SlackRequestHandler # noqa: F401 +from .handler import SlackRequestHandler + +__all__ = [ + "SlackRequestHandler", +] diff --git a/slack_bolt/adapter/falcon/__init__.py b/slack_bolt/adapter/falcon/__init__.py index e54d2f1fc..4efa37a4b 100644 --- a/slack_bolt/adapter/falcon/__init__.py +++ b/slack_bolt/adapter/falcon/__init__.py @@ -1,2 +1,6 @@ # Don't add async module imports here -from .resource import SlackAppResource # noqa: F401 +from .resource import SlackAppResource + +__all__ = [ + "SlackAppResource", +] diff --git a/slack_bolt/adapter/fastapi/__init__.py b/slack_bolt/adapter/fastapi/__init__.py index 9ef794b02..224fd5fa2 100644 --- a/slack_bolt/adapter/fastapi/__init__.py +++ b/slack_bolt/adapter/fastapi/__init__.py @@ -1,2 +1,6 @@ # Don't add async module imports here -from ..starlette.handler import SlackRequestHandler # noqa +from ..starlette.handler import SlackRequestHandler + +__all__ = [ + "SlackRequestHandler", +] diff --git a/slack_bolt/adapter/fastapi/async_handler.py b/slack_bolt/adapter/fastapi/async_handler.py index 718f81874..f2c149c6d 100644 --- a/slack_bolt/adapter/fastapi/async_handler.py +++ b/slack_bolt/adapter/fastapi/async_handler.py @@ -1 +1,5 @@ -from ..starlette.async_handler import AsyncSlackRequestHandler # noqa +from ..starlette.async_handler import AsyncSlackRequestHandler + +__all__ = [ + "AsyncSlackRequestHandler", +] diff --git a/slack_bolt/adapter/flask/__init__.py b/slack_bolt/adapter/flask/__init__.py index df8fd9d79..83f4882db 100644 --- a/slack_bolt/adapter/flask/__init__.py +++ b/slack_bolt/adapter/flask/__init__.py @@ -1 +1,5 @@ -from .handler import SlackRequestHandler # noqa: F401 +from .handler import SlackRequestHandler + +__all__ = [ + "SlackRequestHandler", +] diff --git a/slack_bolt/adapter/pyramid/__init__.py b/slack_bolt/adapter/pyramid/__init__.py index df8fd9d79..83f4882db 100644 --- a/slack_bolt/adapter/pyramid/__init__.py +++ b/slack_bolt/adapter/pyramid/__init__.py @@ -1 +1,5 @@ -from .handler import SlackRequestHandler # noqa: F401 +from .handler import SlackRequestHandler + +__all__ = [ + "SlackRequestHandler", +] diff --git a/slack_bolt/adapter/sanic/__init__.py b/slack_bolt/adapter/sanic/__init__.py index 02ee77873..3805e26ed 100644 --- a/slack_bolt/adapter/sanic/__init__.py +++ b/slack_bolt/adapter/sanic/__init__.py @@ -1 +1,5 @@ -from .async_handler import AsyncSlackRequestHandler # noqa: F401 +from .async_handler import AsyncSlackRequestHandler + +__all__ = [ + "AsyncSlackRequestHandler", +] diff --git a/slack_bolt/adapter/socket_mode/__init__.py b/slack_bolt/adapter/socket_mode/__init__.py index 0a00e1c11..681f5b2a8 100644 --- a/slack_bolt/adapter/socket_mode/__init__.py +++ b/slack_bolt/adapter/socket_mode/__init__.py @@ -7,4 +7,8 @@ """ # noqa: E501 # Don't add async module imports here -from .builtin import SocketModeHandler # noqa: F401 +from .builtin import SocketModeHandler + +__all__ = [ + "SocketModeHandler", +] diff --git a/slack_bolt/adapter/socket_mode/async_handler.py b/slack_bolt/adapter/socket_mode/async_handler.py index 9c6e21ff0..0044b0e9c 100644 --- a/slack_bolt/adapter/socket_mode/async_handler.py +++ b/slack_bolt/adapter/socket_mode/async_handler.py @@ -1,2 +1,6 @@ """Default implementation is the aiohttp-based one.""" -from .aiohttp import AsyncSocketModeHandler # noqa +from .aiohttp import AsyncSocketModeHandler + +__all__ = [ + "AsyncSocketModeHandler", +] diff --git a/slack_bolt/adapter/starlette/__init__.py b/slack_bolt/adapter/starlette/__init__.py index 848662494..ed44db04c 100644 --- a/slack_bolt/adapter/starlette/__init__.py +++ b/slack_bolt/adapter/starlette/__init__.py @@ -1,2 +1,6 @@ # Don't add async module imports here -from .handler import SlackRequestHandler # noqa: F401 +from .handler import SlackRequestHandler + +__all__ = [ + "SlackRequestHandler", +] diff --git a/slack_bolt/adapter/tornado/__init__.py b/slack_bolt/adapter/tornado/__init__.py index fa4896201..8ef57f2aa 100644 --- a/slack_bolt/adapter/tornado/__init__.py +++ b/slack_bolt/adapter/tornado/__init__.py @@ -1 +1,6 @@ -from .handler import SlackEventsHandler, SlackOAuthHandler # noqa: F401 +from .handler import SlackEventsHandler, SlackOAuthHandler + +__all__ = [ + "SlackEventsHandler", + "SlackOAuthHandler", +] diff --git a/slack_bolt/app/__init__.py b/slack_bolt/app/__init__.py index 5838f6dec..3b1d9daef 100644 --- a/slack_bolt/app/__init__.py +++ b/slack_bolt/app/__init__.py @@ -8,3 +8,7 @@ # Don't add async module imports here from .app import App # type: ignore + +__all__ = [ + "App", +] diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 2df9bf120..41463b54d 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -14,7 +14,7 @@ from slack_bolt.listener.async_listener_completion_handler import ( AsyncDefaultListenerCompletionHandler, ) -from slack_bolt.listener.asyncio_runner import AsyncioListenerRunner +from slack_bolt.listener.asyncio_runner import AsyncioListenerRunner # type: ignore from slack_bolt.middleware.async_middleware_error_handler import ( AsyncCustomMiddlewareErrorHandler, AsyncDefaultMiddlewareErrorHandler, diff --git a/slack_bolt/async_app.py b/slack_bolt/async_app.py index ed924f13b..9fdb5a794 100644 --- a/slack_bolt/async_app.py +++ b/slack_bolt/async_app.py @@ -44,11 +44,22 @@ async def command(ack, body, respond): Refer to `slack_bolt.app.async_app` for more details. """ # noqa: E501 -from .app.async_app import AsyncApp # noqa -from .context.ack.async_ack import AsyncAck # noqa -from .context.async_context import AsyncBoltContext # noqa -from .context.respond.async_respond import AsyncRespond # noqa -from .context.say.async_say import AsyncSay # noqa -from .listener.async_listener import AsyncListener # noqa -from .listener_matcher.async_listener_matcher import AsyncCustomListenerMatcher # noqa -from .request.async_request import AsyncBoltRequest # noqa +from .app.async_app import AsyncApp +from .context.ack.async_ack import AsyncAck +from .context.async_context import AsyncBoltContext +from .context.respond.async_respond import AsyncRespond +from .context.say.async_say import AsyncSay +from .listener.async_listener import AsyncListener +from .listener_matcher.async_listener_matcher import AsyncCustomListenerMatcher +from .request.async_request import AsyncBoltRequest + +__all__ = [ + "AsyncApp", + "AsyncAck", + "AsyncBoltContext", + "AsyncRespond", + "AsyncSay", + "AsyncListener", + "AsyncCustomListenerMatcher", + "AsyncBoltRequest", +] diff --git a/slack_bolt/authorization/__init__.py b/slack_bolt/authorization/__init__.py index 9ea3c8da5..efd9262a8 100644 --- a/slack_bolt/authorization/__init__.py +++ b/slack_bolt/authorization/__init__.py @@ -3,4 +3,8 @@ Refer to https://slack.dev/bolt-python/concepts#authorization for details. """ -from .authorize_result import AuthorizeResult # noqa +from .authorize_result import AuthorizeResult + +__all__ = [ + "AuthorizeResult", +] diff --git a/slack_bolt/context/__init__.py b/slack_bolt/context/__init__.py index 951e00828..fb3337c7a 100644 --- a/slack_bolt/context/__init__.py +++ b/slack_bolt/context/__init__.py @@ -6,4 +6,8 @@ """ # Don't add async module imports here -from .context import BoltContext # noqa: F401 +from .context import BoltContext + +__all__ = [ + "BoltContext", +] diff --git a/slack_bolt/context/ack/__init__.py b/slack_bolt/context/ack/__init__.py index 8e5767113..dfbb4736f 100644 --- a/slack_bolt/context/ack/__init__.py +++ b/slack_bolt/context/ack/__init__.py @@ -1,2 +1,6 @@ # Don't add async module imports here -from .ack import Ack # noqa: F401 +from .ack import Ack + +__all__ = [ + "Ack", +] diff --git a/slack_bolt/context/respond/__init__.py b/slack_bolt/context/respond/__init__.py index 135f87277..72670819f 100644 --- a/slack_bolt/context/respond/__init__.py +++ b/slack_bolt/context/respond/__init__.py @@ -1,2 +1,6 @@ # Don't add async module imports here -from .respond import Respond # noqa: F401 +from .respond import Respond + +__all__ = [ + "Respond", +] diff --git a/slack_bolt/context/say/__init__.py b/slack_bolt/context/say/__init__.py index 82dad6a7f..84ecd5be4 100644 --- a/slack_bolt/context/say/__init__.py +++ b/slack_bolt/context/say/__init__.py @@ -1,2 +1,6 @@ # Don't add async module imports here -from .say import Say # noqa: F401 +from .say import Say + +__all__ = [ + "Say", +] diff --git a/slack_bolt/kwargs_injection/__init__.py b/slack_bolt/kwargs_injection/__init__.py index 56e1fa53e..1fa97cc1b 100644 --- a/slack_bolt/kwargs_injection/__init__.py +++ b/slack_bolt/kwargs_injection/__init__.py @@ -5,5 +5,10 @@ """ # Don't add async module imports here -from .args import Args # noqa: F401 -from .utils import build_required_kwargs # noqa: F401 +from .args import Args +from .utils import build_required_kwargs + +__all__ = [ + "Args", + "build_required_kwargs", +] diff --git a/slack_bolt/lazy_listener/__init__.py b/slack_bolt/lazy_listener/__init__.py index 5c88ffa02..0a8e7c0b4 100644 --- a/slack_bolt/lazy_listener/__init__.py +++ b/slack_bolt/lazy_listener/__init__.py @@ -22,5 +22,10 @@ def run_long_process(respond, body): Refer to https://slack.dev/bolt-python/concepts#lazy-listeners for more details. """ # Don't add async module imports here -from .runner import LazyListenerRunner # noqa -from .thread_runner import ThreadLazyListenerRunner # noqa +from .runner import LazyListenerRunner +from .thread_runner import ThreadLazyListenerRunner + +__all__ = [ + "LazyListenerRunner", + "ThreadLazyListenerRunner", +] diff --git a/slack_bolt/listener/__init__.py b/slack_bolt/listener/__init__.py index b18276a54..a12a2b821 100644 --- a/slack_bolt/listener/__init__.py +++ b/slack_bolt/listener/__init__.py @@ -12,3 +12,9 @@ ] for cls in builtin_listener_classes: Listener.register(cls) + +__all__ = [ + "CustomListener", + "Listener", + "builtin_listener_classes", +] diff --git a/slack_bolt/listener_matcher/__init__.py b/slack_bolt/listener_matcher/__init__.py index 08432a1b0..352c35c48 100644 --- a/slack_bolt/listener_matcher/__init__.py +++ b/slack_bolt/listener_matcher/__init__.py @@ -11,3 +11,9 @@ ] for cls in builtin_listener_matcher_classes: ListenerMatcher.register(cls) + +__all__ = [ + "CustomListenerMatcher", + "ListenerMatcher", + "builtin_listener_matcher_classes", +] diff --git a/slack_bolt/logger/__init__.py b/slack_bolt/logger/__init__.py index 77e26a983..a096d8abc 100644 --- a/slack_bolt/logger/__init__.py +++ b/slack_bolt/logger/__init__.py @@ -44,3 +44,9 @@ def _configure_from_base_logger(new_logger: Logger, base_logger: Logger): def _configure_from_root(new_logger: Logger): new_logger.disabled = logging.root.disabled new_logger.level = logging.root.level + + +__all__ = [ + "get_bolt_logger", + "get_bolt_app_logger", +] diff --git a/slack_bolt/middleware/__init__.py b/slack_bolt/middleware/__init__.py index a21747e92..ef42a6a31 100644 --- a/slack_bolt/middleware/__init__.py +++ b/slack_bolt/middleware/__init__.py @@ -9,13 +9,13 @@ from .authorization import ( SingleTeamAuthorization, MultiTeamsAuthorization, -) # noqa: F401 -from .custom_middleware import CustomMiddleware # noqa: F401 -from .ignoring_self_events import IgnoringSelfEvents # noqa: F401 -from .middleware import Middleware # noqa: F401 -from .request_verification import RequestVerification # noqa: F401 -from .ssl_check import SslCheck # noqa: F401 -from .url_verification import UrlVerification # noqa: F401 +) +from .custom_middleware import CustomMiddleware +from .ignoring_self_events import IgnoringSelfEvents +from .middleware import Middleware +from .request_verification import RequestVerification +from .ssl_check import SslCheck +from .url_verification import UrlVerification builtin_middleware_classes = [ SslCheck, @@ -27,3 +27,15 @@ ] for cls in builtin_middleware_classes: Middleware.register(cls) + +__all__ = [ + "SingleTeamAuthorization", + "MultiTeamsAuthorization", + "CustomMiddleware", + "IgnoringSelfEvents", + "Middleware", + "RequestVerification", + "SslCheck", + "UrlVerification", + "builtin_middleware_classes", +] diff --git a/slack_bolt/middleware/async_builtins.py b/slack_bolt/middleware/async_builtins.py index 46cef9003..2b279cc27 100644 --- a/slack_bolt/middleware/async_builtins.py +++ b/slack_bolt/middleware/async_builtins.py @@ -1,11 +1,19 @@ -from .ignoring_self_events.async_ignoring_self_events import ( # noqa: F401 +from .ignoring_self_events.async_ignoring_self_events import ( AsyncIgnoringSelfEvents, ) -from .request_verification.async_request_verification import ( # noqa: F401 +from .request_verification.async_request_verification import ( AsyncRequestVerification, ) -from .ssl_check.async_ssl_check import AsyncSslCheck # noqa: F401 -from .url_verification.async_url_verification import AsyncUrlVerification # noqa: F401 -from .message_listener_matches.async_message_listener_matches import ( # noqa: F401 +from .ssl_check.async_ssl_check import AsyncSslCheck +from .url_verification.async_url_verification import AsyncUrlVerification +from .message_listener_matches.async_message_listener_matches import ( AsyncMessageListenerMatches, ) + +__all__ = [ + "AsyncIgnoringSelfEvents", + "AsyncRequestVerification", + "AsyncSslCheck", + "AsyncUrlVerification", + "AsyncMessageListenerMatches", +] diff --git a/slack_bolt/middleware/authorization/__init__.py b/slack_bolt/middleware/authorization/__init__.py index fd5b10263..714868274 100644 --- a/slack_bolt/middleware/authorization/__init__.py +++ b/slack_bolt/middleware/authorization/__init__.py @@ -1,4 +1,10 @@ # Don't add async module imports here -from .authorization import Authorization # noqa: F401 -from .multi_teams_authorization import MultiTeamsAuthorization # noqa: F401 -from .single_team_authorization import SingleTeamAuthorization # noqa: F401 +from .authorization import Authorization +from .multi_teams_authorization import MultiTeamsAuthorization +from .single_team_authorization import SingleTeamAuthorization + +__all__ = [ + "Authorization", + "MultiTeamsAuthorization", + "SingleTeamAuthorization", +] diff --git a/slack_bolt/middleware/ignoring_self_events/__init__.py b/slack_bolt/middleware/ignoring_self_events/__init__.py index b679760bb..1212e6468 100644 --- a/slack_bolt/middleware/ignoring_self_events/__init__.py +++ b/slack_bolt/middleware/ignoring_self_events/__init__.py @@ -1 +1,5 @@ -from .ignoring_self_events import IgnoringSelfEvents # noqa +from .ignoring_self_events import IgnoringSelfEvents + +__all__ = [ + "IgnoringSelfEvents", +] diff --git a/slack_bolt/middleware/message_listener_matches/__init__.py b/slack_bolt/middleware/message_listener_matches/__init__.py index d6825675e..090d5679e 100644 --- a/slack_bolt/middleware/message_listener_matches/__init__.py +++ b/slack_bolt/middleware/message_listener_matches/__init__.py @@ -1 +1,5 @@ -from .message_listener_matches import MessageListenerMatches # noqa +from .message_listener_matches import MessageListenerMatches + +__all__ = [ + "MessageListenerMatches", +] diff --git a/slack_bolt/middleware/request_verification/__init__.py b/slack_bolt/middleware/request_verification/__init__.py index f2e70fda7..a8c564886 100644 --- a/slack_bolt/middleware/request_verification/__init__.py +++ b/slack_bolt/middleware/request_verification/__init__.py @@ -1 +1,5 @@ -from .request_verification import RequestVerification # noqa +from .request_verification import RequestVerification + +__all__ = [ + "RequestVerification", +] diff --git a/slack_bolt/middleware/ssl_check/__init__.py b/slack_bolt/middleware/ssl_check/__init__.py index 3b2a137d7..33a3708d5 100644 --- a/slack_bolt/middleware/ssl_check/__init__.py +++ b/slack_bolt/middleware/ssl_check/__init__.py @@ -1 +1,5 @@ -from .ssl_check import SslCheck # noqa +from .ssl_check import SslCheck + +__all__ = [ + "SslCheck", +] diff --git a/slack_bolt/middleware/url_verification/__init__.py b/slack_bolt/middleware/url_verification/__init__.py index 73c2e2952..4fc29dfce 100644 --- a/slack_bolt/middleware/url_verification/__init__.py +++ b/slack_bolt/middleware/url_verification/__init__.py @@ -1 +1,5 @@ -from .url_verification import UrlVerification # noqa +from .url_verification import UrlVerification + +__all__ = [ + "UrlVerification", +] diff --git a/slack_bolt/oauth/__init__.py b/slack_bolt/oauth/__init__.py index d07b12785..c4f806698 100644 --- a/slack_bolt/oauth/__init__.py +++ b/slack_bolt/oauth/__init__.py @@ -4,4 +4,8 @@ """ # Don't add async module imports here -from .oauth_flow import OAuthFlow # noqa +from .oauth_flow import OAuthFlow + +__all__ = [ + "OAuthFlow", +] diff --git a/slack_bolt/request/__init__.py b/slack_bolt/request/__init__.py index 402d70cde..0a0620611 100644 --- a/slack_bolt/request/__init__.py +++ b/slack_bolt/request/__init__.py @@ -4,4 +4,8 @@ This interface encapsulates the difference between the two. """ # Don't add async module imports here -from .request import BoltRequest # noqa: F401 +from .request import BoltRequest + +__all__ = [ + "BoltRequest", +] diff --git a/slack_bolt/response/__init__.py b/slack_bolt/response/__init__.py index 2dfd1d695..373acccf2 100644 --- a/slack_bolt/response/__init__.py +++ b/slack_bolt/response/__init__.py @@ -6,4 +6,8 @@ Refer to https://api.slack.com/apis/connections for the two types of connections. """ -from .response import BoltResponse # noqa: F401 +from .response import BoltResponse + +__all__ = [ + "BoltResponse", +] diff --git a/slack_bolt/workflows/step/__init__.py b/slack_bolt/workflows/step/__init__.py index 9418a2e4c..d7402cb40 100644 --- a/slack_bolt/workflows/step/__init__.py +++ b/slack_bolt/workflows/step/__init__.py @@ -1,6 +1,15 @@ -from .step import WorkflowStep # noqa: F401 -from .step_middleware import WorkflowStepMiddleware # noqa: F401 -from .utilities.complete import Complete # noqa: F401 -from .utilities.configure import Configure # noqa: F401 -from .utilities.update import Update # noqa: F401 -from .utilities.fail import Fail # noqa: F401 +from .step import WorkflowStep +from .step_middleware import WorkflowStepMiddleware +from .utilities.complete import Complete +from .utilities.configure import Configure +from .utilities.update import Update +from .utilities.fail import Fail + +__all__ = [ + "WorkflowStep", + "WorkflowStepMiddleware", + "Complete", + "Configure", + "Update", + "Fail", +] diff --git a/slack_bolt/workflows/step/async_step_middleware.py b/slack_bolt/workflows/step/async_step_middleware.py index 150729764..1f70602d3 100644 --- a/slack_bolt/workflows/step/async_step_middleware.py +++ b/slack_bolt/workflows/step/async_step_middleware.py @@ -1,7 +1,7 @@ from typing import Callable, Optional, Awaitable from slack_bolt.listener.async_listener import AsyncListener -from slack_bolt.listener.asyncio_runner import AsyncioListenerRunner +from slack_bolt.listener.asyncio_runner import AsyncioListenerRunner # type: ignore from slack_bolt.middleware.async_middleware import AsyncMiddleware from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse From 4fef42db215360b4e90ace9f83e7375090c93ddd Mon Sep 17 00:00:00 2001 From: Heston Hoffman Date: Sun, 15 May 2022 22:19:28 -0700 Subject: [PATCH 336/719] Clarify "Setting up events" section (#648) This adds a few extra directions to help users find the **Subscribe to bot events" section. --- docs/_tutorials/getting_started.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_tutorials/getting_started.md b/docs/_tutorials/getting_started.md index 105ae5a9e..99f45166e 100644 --- a/docs/_tutorials/getting_started.md +++ b/docs/_tutorials/getting_started.md @@ -144,7 +144,7 @@ It's time to tell Slack what events we'd like to listen for. When an event occurs, Slack will send your app some information about the event, like the user that triggered it and the channel it occurred in. Your app will process the details and can respond accordingly. -Scroll down to **Subscribe to Bot Events**. There are four events related to messages: +Navigate to **Event Subscriptions** on the left sidebar and toggle to enable. Under **Subscribe to Bot Events**, you can add events for your bot to respond to. There are four events related to messages: - [`message.channels`](https://api.slack.com/events/message.channels) listens for messages in public channels that your app is added to - [`message.groups`](https://api.slack.com/events/message.groups) listens for messages in 🔒 private channels that your app is added to - [`message.im`](https://api.slack.com/events/message.im) listens for messages in your app's DMs with users @@ -299,4 +299,4 @@ Now that you have a basic app up and running, you can start exploring how to mak * Bolt allows you to [call Web API methods](/bolt-python/concepts#web-api) with the client attached to your app. There are [over 220 methods](https://api.slack.com/methods) on our API site. -* Learn more about the different token types [on our API site](https://api.slack.com/docs/token-types). Your app may need different tokens depending on the actions you want it to perform. For apps that do not use Socket Mode, typically only the bot (`xoxb`) token and Signing Secret are required. For example of this, see our parallel guide [Getting Started with HTTP](/bolt-python/tutorial/getting-started-http). \ No newline at end of file +* Learn more about the different token types [on our API site](https://api.slack.com/docs/token-types). Your app may need different tokens depending on the actions you want it to perform. For apps that do not use Socket Mode, typically only the bot (`xoxb`) token and Signing Secret are required. For example of this, see our parallel guide [Getting Started with HTTP](/bolt-python/tutorial/getting-started-http). From 5d3ee55b738b8d8113979e99916e67e52aa2d6c0 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 16 May 2022 14:22:37 +0900 Subject: [PATCH 337/719] Apply #648 changes to other pages too --- docs/_tutorials/getting_started_http.md | 2 +- docs/_tutorials/ja_getting_started.md | 2 +- docs/_tutorials/ja_getting_started_http.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/_tutorials/getting_started_http.md b/docs/_tutorials/getting_started_http.md index 795a1e891..a9de0e1df 100644 --- a/docs/_tutorials/getting_started_http.md +++ b/docs/_tutorials/getting_started_http.md @@ -143,7 +143,7 @@ Finally, it's time to tell Slack what events we'd like to listen for. When an event occurs, Slack will send your app some information about the event, like the user that triggered it and the channel it occurred in. Your app will process the details and can respond accordingly. -Scroll down to **Subscribe to Bot Events**. There are four events related to messages: +Navigate to **Event Subscriptions** on the left sidebar and toggle to enable. Under **Subscribe to Bot Events**, you can add events for your bot to respond to. There are four events related to messages: - [`message.channels`](https://api.slack.com/events/message.channels) listens for messages in public channels that your app is added to - [`message.groups`](https://api.slack.com/events/message.groups) listens for messages in 🔒 private channels that your app is added to - [`message.im`](https://api.slack.com/events/message.im) listens for messages in your app's DMs with users diff --git a/docs/_tutorials/ja_getting_started.md b/docs/_tutorials/ja_getting_started.md index 4aa564b11..ae34c3562 100644 --- a/docs/_tutorials/ja_getting_started.md +++ b/docs/_tutorials/ja_getting_started.md @@ -145,7 +145,7 @@ Slack ワークスペースで発生するイベント(メッセージが投 イベントが発生すると、そのイベントをトリガーしたユーザーやイベントが発生したチャンネルなど、イベントに関する情報が Slack からアプリに送信されます。アプリではこれらの情報を処理して、適切な応答を返します。 -**Subscribe to Bot Events** まで下にスクロールします。4つのメッセージに関するイベントがあります。 +左側のサイドバーから **Event Subscriptions** にアクセスして、機能を有効にしてください。 **Subscribe to Bot Events** 配下で、ボットが受け取れる イベントを追加することができます。4つのメッセージに関するイベントがあります。 - [`message.channels`](https://api.slack.com/events/message.channels) アプリが参加しているパブリックチャンネルのメッセージをリッスン - [`message.groups`](https://api.slack.com/events/message.groups) アプリが参加しているプライベートチャンネルのメッセージをリッスン - [`message.im`](https://api.slack.com/events/message.im) あなたのアプリとユーザーのダイレクトメッセージをリッスン diff --git a/docs/_tutorials/ja_getting_started_http.md b/docs/_tutorials/ja_getting_started_http.md index cf8bb35fb..fdd53bd94 100644 --- a/docs/_tutorials/ja_getting_started_http.md +++ b/docs/_tutorials/ja_getting_started_http.md @@ -148,7 +148,7 @@ Slack ワークスペースで発生するイベント(メッセージが投 イベントが発生すると、そのイベントをトリガーしたユーザーやイベントが発生したチャンネルなど、イベントに関する情報が Slack からアプリに送信されます。アプリではこれらの情報を処理して、適切な応答を返します。 -**Subscribe to Bot Events** まで下にスクロールします。4つのメッセージに関するイベントがあります。 +左側のサイドバーから **Event Subscriptions** にアクセスして、機能を有効にしてください。 **Subscribe to Bot Events** 配下で、ボットが受け取れる イベントを追加することができます。4つのメッセージに関するイベントがあります。 - [`message.channels`](https://api.slack.com/events/message.channels) アプリが参加しているパブリックチャンネルのメッセージをリッスン - [`message.groups`](https://api.slack.com/events/message.groups) アプリが参加しているプライベートチャンネルのメッセージをリッスン - [`message.im`](https://api.slack.com/events/message.im) あなたのアプリとユーザーのダイレクトメッセージをリッスン From 0a2cee6a19e486eef51a66cd0bdd110076ffd0bc Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 18 May 2022 09:14:17 +0900 Subject: [PATCH 338/719] Add Google Cloud Functions adapter (ref #646) (#649) --- .../.env.yaml.oauth-sample | 4 + examples/google_cloud_functions/.gitignore | 3 +- examples/google_cloud_functions/datastore.py | 252 ++++++++++++++++++ examples/google_cloud_functions/handler.py | 66 +++++ examples/google_cloud_functions/oauth_main.py | 101 +++++++ .../google_cloud_functions/requirements.txt | 3 +- .../{main.py => simple_main.py} | 31 ++- .../google_cloud_functions/__init__.py | 5 + .../adapter/google_cloud_functions/handler.py | 43 +++ .../google_cloud_functions/__init__.py | 0 .../test_google_cloud_functions.py | 242 +++++++++++++++++ 11 files changed, 742 insertions(+), 8 deletions(-) create mode 100644 examples/google_cloud_functions/.env.yaml.oauth-sample create mode 100644 examples/google_cloud_functions/datastore.py create mode 100644 examples/google_cloud_functions/handler.py create mode 100644 examples/google_cloud_functions/oauth_main.py rename examples/google_cloud_functions/{main.py => simple_main.py} (64%) create mode 100644 slack_bolt/adapter/google_cloud_functions/__init__.py create mode 100644 slack_bolt/adapter/google_cloud_functions/handler.py create mode 100644 tests/adapter_tests/google_cloud_functions/__init__.py create mode 100644 tests/adapter_tests/google_cloud_functions/test_google_cloud_functions.py diff --git a/examples/google_cloud_functions/.env.yaml.oauth-sample b/examples/google_cloud_functions/.env.yaml.oauth-sample new file mode 100644 index 000000000..75ff16f8b --- /dev/null +++ b/examples/google_cloud_functions/.env.yaml.oauth-sample @@ -0,0 +1,4 @@ +SLACK_CLIENT_ID: '1111.222' +SLACK_CLIENT_SECRET: 'xxx' +SLACK_SIGNING_SECRET: 'yyy' +SLACK_SCOPES: 'app_mentions:read,chat:write,commands' diff --git a/examples/google_cloud_functions/.gitignore b/examples/google_cloud_functions/.gitignore index 69748e961..312fe55e1 100644 --- a/examples/google_cloud_functions/.gitignore +++ b/examples/google_cloud_functions/.gitignore @@ -1 +1,2 @@ -.env.yaml \ No newline at end of file +.env.yaml +main.py diff --git a/examples/google_cloud_functions/datastore.py b/examples/google_cloud_functions/datastore.py new file mode 100644 index 000000000..dfdfbcbc8 --- /dev/null +++ b/examples/google_cloud_functions/datastore.py @@ -0,0 +1,252 @@ +# +# Please note that this is an example implementation. +# You can reuse this implementation for your app, +# but we don't have short-term plans to add this code to slack-sdk package. +# Please maintain the code on your own if you copy this file. +# +# Also, please refer to the following gist for more discussion and better implementation: +# https://gist.github.com/seratch/d81a445ef4467b16f047156bf859cda8 +# + +import logging +from logging import Logger +from typing import Optional +from uuid import uuid4 + +from google.cloud import datastore +from google.cloud.datastore import Client, Entity, Query +from slack_sdk.oauth import OAuthStateStore, InstallationStore +from slack_sdk.oauth.installation_store import Installation, Bot + + +class GoogleDatastoreInstallationStore(InstallationStore): + datastore_client: Client + + def __init__( + self, + *, + datastore_client: Client, + logger: Logger, + ): + self.datastore_client = datastore_client + self._logger = logger + + @property + def logger(self) -> Logger: + if self._logger is None: + self._logger = logging.getLogger(__name__) + return self._logger + + def installation_key( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str], + suffix: Optional[str] = None, + is_enterprise_install: Optional[bool] = None, + ): + enterprise_id = enterprise_id or "none" + team_id = "none" if is_enterprise_install else team_id or "none" + name = ( + f"{enterprise_id}-{team_id}-{user_id}" + if user_id + else f"{enterprise_id}-{team_id}" + ) + if suffix is not None: + name += "-" + suffix + return self.datastore_client.key("installations", name) + + def bot_key( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + suffix: Optional[str] = None, + is_enterprise_install: Optional[bool] = None, + ): + enterprise_id = enterprise_id or "none" + team_id = "none" if is_enterprise_install else team_id or "none" + name = f"{enterprise_id}-{team_id}" + if suffix is not None: + name += "-" + suffix + return self.datastore_client.key("bots", name) + + def save(self, i: Installation): + # the latest installation in the workspace + installation_entity: Entity = datastore.Entity( + key=self.installation_key( + enterprise_id=i.enterprise_id, + team_id=i.team_id, + user_id=None, # user_id is removed + is_enterprise_install=i.is_enterprise_install, + ) + ) + installation_entity.update(**i.to_dict()) + self.datastore_client.put(installation_entity) + + # the latest installation associated with a user + user_entity: Entity = datastore.Entity( + key=self.installation_key( + enterprise_id=i.enterprise_id, + team_id=i.team_id, + user_id=i.user_id, + is_enterprise_install=i.is_enterprise_install, + ) + ) + user_entity.update(**i.to_dict()) + self.datastore_client.put(user_entity) + # history data + user_entity.key = self.installation_key( + enterprise_id=i.enterprise_id, + team_id=i.team_id, + user_id=i.user_id, + is_enterprise_install=i.is_enterprise_install, + suffix=str(i.installed_at), + ) + self.datastore_client.put(user_entity) + + # the latest bot authorization in the workspace + bot = i.to_bot() + bot_entity: Entity = datastore.Entity( + key=self.bot_key( + enterprise_id=i.enterprise_id, + team_id=i.team_id, + is_enterprise_install=i.is_enterprise_install, + ) + ) + bot_entity.update(**bot.to_dict()) + self.datastore_client.put(bot_entity) + # history data + bot_entity.key = self.bot_key( + enterprise_id=i.enterprise_id, + team_id=i.team_id, + is_enterprise_install=i.is_enterprise_install, + suffix=str(i.installed_at), + ) + self.datastore_client.put(bot_entity) + + def find_bot( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Bot]: + entity: Entity = self.datastore_client.get( + self.bot_key( + enterprise_id=enterprise_id, + team_id=team_id, + is_enterprise_install=is_enterprise_install, + ) + ) + if entity is not None: + entity["installed_at"] = entity["installed_at"].timestamp() + return Bot(**entity) + return None + + def find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + entity: Entity = self.datastore_client.get( + self.installation_key( + enterprise_id=enterprise_id, + team_id=team_id, + user_id=user_id, + is_enterprise_install=is_enterprise_install, + ) + ) + if entity is not None: + entity["installed_at"] = entity["installed_at"].timestamp() + return Installation(**entity) + return None + + def delete_installation( + self, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str], + ) -> None: + installation_key = self.installation_key( + enterprise_id=enterprise_id, + team_id=team_id, + user_id=user_id, + ) + q: Query = self.datastore_client.query() + q.key_filter(installation_key, ">=") + for entity in q.fetch(): + if entity.key.name.startswith(installation_key.name): + self.datastore_client.delete(entity.key) + else: + break + + def delete_bot( + self, + enterprise_id: Optional[str], + team_id: Optional[str], + ) -> None: + bot_key = self.bot_key( + enterprise_id=enterprise_id, + team_id=team_id, + ) + q: Query = self.datastore_client.query() + q.key_filter(bot_key, ">=") + for entity in q.fetch(): + if entity.key.name.startswith(bot_key.name): + self.datastore_client.delete(entity.key) + else: + break + + def delete_all( + self, + enterprise_id: Optional[str], + team_id: Optional[str], + ): + self.delete_bot(enterprise_id=enterprise_id, team_id=team_id) + self.delete_installation( + enterprise_id=enterprise_id, team_id=team_id, user_id=None + ) + + +class GoogleDatastoreOAuthStateStore(OAuthStateStore): + logger: Logger + datastore_client: Client + collection_id: str + + def __init__( + self, + *, + datastore_client: Client, + logger: Logger, + ): + self.datastore_client = datastore_client + self._logger = logger + self.collection_id = "oauth_state_values" + + @property + def logger(self) -> Logger: + if self._logger is None: + self._logger = logging.getLogger(__name__) + return self._logger + + def consume(self, state: str) -> bool: + key = self.datastore_client.key(self.collection_id, state) + entity = self.datastore_client.get(key) + if entity is not None: + self.datastore_client.delete(key) + return True + return False + + def issue(self, *args, **kwargs) -> str: + state_value = str(uuid4()) + entity: Entity = datastore.Entity( + key=self.datastore_client.key(self.collection_id, state_value) + ) + entity.update(value=state_value) + self.datastore_client.put(entity) + return state_value diff --git a/examples/google_cloud_functions/handler.py b/examples/google_cloud_functions/handler.py new file mode 100644 index 000000000..df5b9a351 --- /dev/null +++ b/examples/google_cloud_functions/handler.py @@ -0,0 +1,66 @@ +# TODO: Once this once a new version newer than 1.13.2, delete this file + +from typing import Callable + +from flask import Request, Response, make_response + +from slack_bolt.app import App +from slack_bolt.error import BoltError +from slack_bolt.lazy_listener import LazyListenerRunner +from slack_bolt.oauth import OAuthFlow +from slack_bolt.request import BoltRequest +from slack_bolt.response import BoltResponse + + +def to_bolt_request(req: Request) -> BoltRequest: + return BoltRequest( # type: ignore + body=req.get_data(as_text=True), + query=req.query_string.decode("utf-8"), + headers=req.headers, # type: ignore + ) # type: ignore + + +def to_flask_response(bolt_resp: BoltResponse) -> Response: + resp: Response = make_response(bolt_resp.body, bolt_resp.status) + for k, values in bolt_resp.headers.items(): + if k.lower() == "content-type" and resp.headers.get("content-type") is not None: + # Remove the one set by Flask + resp.headers.pop("content-type") + for v in values: + resp.headers.add_header(k, v) + return resp + + +class NoopLazyListenerRunner(LazyListenerRunner): + def start(self, function: Callable[..., None], request: BoltRequest) -> None: + raise BoltError( + "The google_cloud_functions adapter does not support lazy listeners. " + "Please consider either having a queue to pass the request to a different function or " + "rewriting your code not to use lazy listeners." + ) + + +class SlackRequestHandler: + def __init__(self, app: App): # type: ignore + self.app = app + # Note that lazy listener is not supported + self.app.listener_runner.lazy_listener_runner = NoopLazyListenerRunner() + if self.app.oauth_flow is not None: + self.app.oauth_flow.settings.redirect_uri_page_renderer.install_path = "?" + + def handle(self, req: Request) -> Response: + if req.method == "GET": + if self.app.oauth_flow is not None: + oauth_flow: OAuthFlow = self.app.oauth_flow + bolt_req = to_bolt_request(req) + if "code" in req.args or "error" in req.args or "state" in req.args: + bolt_resp = oauth_flow.handle_callback(bolt_req) + return to_flask_response(bolt_resp) + else: + bolt_resp = oauth_flow.handle_installation(bolt_req) + return to_flask_response(bolt_resp) + elif req.method == "POST": + bolt_resp: BoltResponse = self.app.dispatch(to_bolt_request(req)) + return to_flask_response(bolt_resp) + + return make_response("Not Found", 404) diff --git a/examples/google_cloud_functions/oauth_main.py b/examples/google_cloud_functions/oauth_main.py new file mode 100644 index 000000000..f6355f779 --- /dev/null +++ b/examples/google_cloud_functions/oauth_main.py @@ -0,0 +1,101 @@ +# https://cloud.google.com/functions/docs/first-python + +import logging + +from slack_bolt.oauth.oauth_settings import OAuthSettings + +logging.basicConfig(level=logging.DEBUG) + +from slack_bolt import App +from datastore import GoogleDatastoreInstallationStore, GoogleDatastoreOAuthStateStore + +from google.cloud import datastore + +datastore_client = datastore.Client() +logger = logging.getLogger(__name__) + +# process_before_response must be True when running on FaaS +app = App( + process_before_response=True, + installation_store=GoogleDatastoreInstallationStore( + datastore_client=datastore_client, + logger=logger, + ), + oauth_settings=OAuthSettings( + state_store=GoogleDatastoreOAuthStateStore( + datastore_client=datastore_client, + logger=logger, + ), + ), +) + + +@app.command("/hello-bolt-python-gcp") +def hello_command(ack): + ack("Hi from Google Cloud Functions!") + + +@app.event("app_mention") +def event_test(body, say, logger): + logger.info(body) + say("Hi from Google Cloud Functions!") + + +# Flask adapter +# TODO: Once this once a new version newer than 1.13.2, delete handler and enable the slack_bolt.adapter import instead +# from slack_bolt.adapter.google_cloud_functions import SlackRequestHandler +from handler import SlackRequestHandler +from flask import Request + + +handler = SlackRequestHandler(app) + + +# Cloud Function +def hello_bolt_app(req: Request): + """HTTP Cloud Function. + Args: + req (flask.Request): The request object. + + Returns: + The response text, or any set of values that can be turned into a + Response object using `make_response` + . + """ + return handler.handle(req) + + +# For local development +# python main.py +if __name__ == "__main__": + from flask import Flask, request + + flask_app = Flask(__name__) + + @flask_app.route("/function", methods=["GET", "POST"]) + def handle_anything(): + return handler.handle(request) + + flask_app.run(port=3000) + + +# Step1: Create a new Slack App: https://api.slack.com/apps +# Bot Token Scopes: app_mentions:read,chat:write,commands + +# Step2: Set env variables +# cp .env.yaml.oauth-sample .env.yaml +# vi .env.yaml + +# Step3: Create a new Google Cloud project +# gcloud projects create YOUR_PROJECT_NAME +# gcloud config set project YOUR_PROJECT_NAME + +# Step4: Deploy a function in the project +# cp oauth_main.py main.py +# gcloud functions deploy hello_bolt_app --runtime python38 --trigger-http --allow-unauthenticated --env-vars-file .env.yaml +# gcloud functions describe hello_bolt_app + +# Step5: Set Request URL +# Set https://us-central1-YOUR_PROJECT_NAME.cloudfunctions.net/hello_bolt_app to the following: +# * slash command: /hello-bolt-python-gcp +# * Events Subscriptions & add `app_mention` event diff --git a/examples/google_cloud_functions/requirements.txt b/examples/google_cloud_functions/requirements.txt index d682b1606..7ebbe8ab2 100644 --- a/examples/google_cloud_functions/requirements.txt +++ b/examples/google_cloud_functions/requirements.txt @@ -1,2 +1,3 @@ Flask>1 -slack_bolt \ No newline at end of file +slack_bolt +google-cloud-datastore>=2.1.0,<3 \ No newline at end of file diff --git a/examples/google_cloud_functions/main.py b/examples/google_cloud_functions/simple_main.py similarity index 64% rename from examples/google_cloud_functions/main.py rename to examples/google_cloud_functions/simple_main.py index c9f911a90..bc8f593a3 100644 --- a/examples/google_cloud_functions/main.py +++ b/examples/google_cloud_functions/simple_main.py @@ -22,27 +22,45 @@ def event_test(body, say, logger): # Flask adapter -from slack_bolt.adapter.flask import SlackRequestHandler +# TODO: Once this once a new version newer than 1.13.2, delete handler and enable the slack_bolt.adapter import instead +# from slack_bolt.adapter.google_cloud_functions import SlackRequestHandler +from handler import SlackRequestHandler +from flask import Request + handler = SlackRequestHandler(app) # Cloud Function -def hello_bolt_app(request): +def hello_bolt_app(req: Request): """HTTP Cloud Function. Args: - request (flask.Request): The request object. + req (flask.Request): The request object. Returns: The response text, or any set of values that can be turned into a Response object using `make_response` . """ - return handler.handle(request) + return handler.handle(req) + + +# For local development +# python main.py +if __name__ == "__main__": + from flask import Flask, request + + flask_app = Flask(__name__) + + @flask_app.route("/function", methods=["GET", "POST"]) + def handle_anything(): + return handler.handle(request) + + flask_app.run(port=3000) # Step1: Create a new Slack App: https://api.slack.com/apps -# Bot Token Scopes: chat:write, commands, app_mentions:read +# Bot Token Scopes: app_mentions:read,chat:write,commands # Step2: Set env variables # cp .env.yaml.sample .env.yaml @@ -53,7 +71,8 @@ def hello_bolt_app(request): # gcloud config set project YOUR_PROJECT_NAME # Step4: Deploy a function in the project -# gcloud functions deploy hello_bolt_app --runtime python38 --trigger-http --allow-unauthenticated --env-vars-file .env.yaml +# cp simple_main.py main.py +# gcloud functions deploy hello_bolt_app --runtime python39 --trigger-http --allow-unauthenticated --env-vars-file .env.yaml # gcloud functions describe hello_bolt_app # Step5: Set Request URL diff --git a/slack_bolt/adapter/google_cloud_functions/__init__.py b/slack_bolt/adapter/google_cloud_functions/__init__.py new file mode 100644 index 000000000..83f4882db --- /dev/null +++ b/slack_bolt/adapter/google_cloud_functions/__init__.py @@ -0,0 +1,5 @@ +from .handler import SlackRequestHandler + +__all__ = [ + "SlackRequestHandler", +] diff --git a/slack_bolt/adapter/google_cloud_functions/handler.py b/slack_bolt/adapter/google_cloud_functions/handler.py new file mode 100644 index 000000000..46a9c0523 --- /dev/null +++ b/slack_bolt/adapter/google_cloud_functions/handler.py @@ -0,0 +1,43 @@ +from typing import Callable + +from flask import Request, Response, make_response + +from slack_bolt.adapter.flask.handler import to_bolt_request, to_flask_response +from slack_bolt.app import App +from slack_bolt.error import BoltError +from slack_bolt.lazy_listener import LazyListenerRunner +from slack_bolt.request import BoltRequest +from slack_bolt.response import BoltResponse + + +class NoopLazyListenerRunner(LazyListenerRunner): + def start(self, function: Callable[..., None], request: BoltRequest) -> None: + raise BoltError( + "The google_cloud_functions adapter does not support lazy listeners. " + "Please consider either having a queue to pass the request to a different function or " + "rewriting your code not to use lazy listeners." + ) + + +class SlackRequestHandler: + def __init__(self, app: App): # type: ignore + self.app = app + # Note that lazy listener is not supported + self.app.listener_runner.lazy_listener_runner = NoopLazyListenerRunner() + if self.app.oauth_flow is not None: + self.app.oauth_flow.settings.redirect_uri_page_renderer.install_path = "?" + + def handle(self, req: Request) -> Response: + if req.method == "GET" and self.app.oauth_flow is not None: + bolt_req = to_bolt_request(req) + if "code" in req.args or "error" in req.args or "state" in req.args: + bolt_resp = self.app.oauth_flow.handle_callback(bolt_req) + return to_flask_response(bolt_resp) + else: + bolt_resp = self.app.oauth_flow.handle_installation(bolt_req) + return to_flask_response(bolt_resp) + elif req.method == "POST": + bolt_resp: BoltResponse = self.app.dispatch(to_bolt_request(req)) + return to_flask_response(bolt_resp) + + return make_response("Not Found", 404) diff --git a/tests/adapter_tests/google_cloud_functions/__init__.py b/tests/adapter_tests/google_cloud_functions/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/adapter_tests/google_cloud_functions/test_google_cloud_functions.py b/tests/adapter_tests/google_cloud_functions/test_google_cloud_functions.py new file mode 100644 index 000000000..18420bdfe --- /dev/null +++ b/tests/adapter_tests/google_cloud_functions/test_google_cloud_functions.py @@ -0,0 +1,242 @@ +import json +from time import time +from urllib.parse import quote + +from flask import Flask, request +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web import WebClient + +from slack_bolt.adapter.google_cloud_functions import SlackRequestHandler +from slack_bolt.app import App +from slack_bolt.oauth.oauth_settings import OAuthSettings +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestGoogleCloudFunctions: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + content_type = ( + "application/json" + if body.startswith("{") + else "application/x-www-form-urlencoded" + ) + return { + "content-type": [content_type], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def test_events(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + def event_handler(): + pass + + app.event("app_mention")(event_handler) + + input = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "team": "T111", + "channel": "C111", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, + "authed_users": ["W111"], + } + timestamp, body = str(int(time())), json.dumps(input) + + flask_app = Flask(__name__) + + @flask_app.route("/function", methods=["POST"]) + def endpoint(): + return SlackRequestHandler(app).handle(request) + + with flask_app.test_client() as client: + rv = client.post( + "/function", + data=body, + headers=self.build_headers(timestamp, body), + ) + assert rv.status_code == 200 + assert rv.headers.get("content-type") == "text/plain;charset=utf-8" + assert_auth_test_count(self, 1) + + def test_shortcuts(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + def shortcut_handler(ack): + ack() + + app.shortcut("test-shortcut")(shortcut_handler) + + input = { + "type": "shortcut", + "token": "verification_token", + "action_ts": "111.111", + "team": { + "id": "T111", + "domain": "workspace-domain", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": {"id": "W111", "username": "primary-owner", "team_id": "T111"}, + "callback_id": "test-shortcut", + "trigger_id": "111.111.xxxxxx", + } + + timestamp, body = str(int(time())), f"payload={quote(json.dumps(input))}" + + flask_app = Flask(__name__) + + @flask_app.route("/function", methods=["POST"]) + def endpoint(): + return SlackRequestHandler(app).handle(request) + + with flask_app.test_client() as client: + rv = client.post( + "/function", + data=body, + headers=self.build_headers(timestamp, body), + ) + assert rv.status_code == 200 + assert rv.headers.get("content-type") == "text/plain;charset=utf-8" + assert_auth_test_count(self, 1) + + def test_commands(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + def command_handler(ack): + ack() + + app.command("/hello-world")(command_handler) + + input = ( + "token=verification_token" + "&team_id=T111" + "&team_domain=test-domain" + "&channel_id=C111" + "&channel_name=random" + "&user_id=W111" + "&user_name=primary-owner" + "&command=%2Fhello-world" + "&text=Hi" + "&enterprise_id=E111" + "&enterprise_name=Org+Name" + "&response_url=https%3A%2F%2Fhooks.slack.com%2Fcommands%2FT111%2F111%2Fxxxxx" + "&trigger_id=111.111.xxx" + ) + timestamp, body = str(int(time())), input + + flask_app = Flask(__name__) + + @flask_app.route("/function", methods=["POST"]) + def endpoint(): + return SlackRequestHandler(app).handle(request) + + with flask_app.test_client() as client: + rv = client.post( + "/function", + data=body, + headers=self.build_headers(timestamp, body), + ) + assert rv.status_code == 200 + assert rv.headers.get("content-type") == "text/plain;charset=utf-8" + assert_auth_test_count(self, 1) + + def test_oauth(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + oauth_settings=OAuthSettings( + client_id="111.111", + client_secret="xxx", + scopes=["chat:write", "commands"], + ), + ) + flask_app = Flask(__name__) + + @flask_app.route("/function", methods=["GET"]) + def endpoint(): + return SlackRequestHandler(app).handle(request) + + with flask_app.test_client() as client: + rv = client.get("/function") + assert rv.headers.get("content-type") == "text/html; charset=utf-8" + assert rv.status_code == 200 + + def test_url_verification(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + input = { + "token": "Jhj5dZrVaK7ZwHHjRyZWjbDl", + "challenge": "3eZbrw1aBm2rZgRNFdxV2595E9CY3gmdALWMmHkvFXO7tYXAYM8P", + "type": "url_verification", + } + + timestamp, body = str(int(time())), f"payload={quote(json.dumps(input))}" + + flask_app = Flask(__name__) + + @flask_app.route("/function", methods=["POST"]) + def endpoint(): + return SlackRequestHandler(app).handle(request) + + with flask_app.test_client() as client: + rv = client.post( + "/function", + data=body, + headers=self.build_headers(timestamp, body), + ) + assert rv.status_code == 200 + assert rv.headers.get("content-type") == "application/json;charset=utf-8" + assert_auth_test_count(self, 1) From 647701e1773d8d848280588bb544a5b1a9e75931 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 18 May 2022 09:22:26 +0900 Subject: [PATCH 339/719] version 1.14.0 --- .../slack_bolt/adapter/aiohttp/index.html | 8 +- .../slack_bolt/adapter/aws_lambda/index.html | 171 +- .../slack_bolt/adapter/bottle/index.html | 87 +- .../slack_bolt/adapter/cherrypy/index.html | 91 +- .../slack_bolt/adapter/django/index.html | 136 +- .../slack_bolt/adapter/falcon/index.html | 146 +- .../adapter/fastapi/async_handler.html | 103 +- .../slack_bolt/adapter/fastapi/index.html | 103 +- .../slack_bolt/adapter/flask/index.html | 79 +- .../google_cloud_functions/handler.html | 220 + .../adapter/google_cloud_functions/index.html | 150 + docs/api-docs/slack_bolt/adapter/index.html | 5 + .../slack_bolt/adapter/pyramid/index.html | 81 +- .../slack_bolt/adapter/sanic/index.html | 95 +- .../adapter/socket_mode/async_handler.html | 93 +- .../slack_bolt/adapter/socket_mode/index.html | 153 +- .../slack_bolt/adapter/starlette/index.html | 103 +- .../slack_bolt/adapter/tornado/index.html | 168 +- docs/api-docs/slack_bolt/app/app.html | 2 +- docs/api-docs/slack_bolt/app/async_app.html | 2 +- docs/api-docs/slack_bolt/app/index.html | 2953 ++++++++++- docs/api-docs/slack_bolt/async_app.html | 4196 ++++++++++++++- .../slack_bolt/authorization/index.html | 202 +- .../slack_bolt/context/ack/index.html | 73 +- docs/api-docs/slack_bolt/context/index.html | 389 +- .../slack_bolt/context/respond/index.html | 104 +- .../slack_bolt/context/say/index.html | 91 +- docs/api-docs/slack_bolt/index.html | 4486 ++++++++++++++++- .../slack_bolt/kwargs_injection/index.html | 371 +- .../slack_bolt/lazy_listener/index.html | 195 +- .../slack_bolt/lazy_listener/runner.html | 1 + docs/api-docs/slack_bolt/listener/index.html | 351 +- .../slack_bolt/listener_matcher/index.html | 165 +- docs/api-docs/slack_bolt/logger/index.html | 8 +- .../slack_bolt/middleware/async_builtins.html | 343 +- .../middleware/authorization/index.html | 262 +- .../ignoring_self_events/index.html | 98 +- .../api-docs/slack_bolt/middleware/index.html | 862 +++- .../message_listener_matches/index.html | 70 +- .../request_verification/index.html | 108 +- .../middleware/ssl_check/index.html | 123 +- .../middleware/url_verification/index.html | 87 +- docs/api-docs/slack_bolt/oauth/index.html | 838 ++- docs/api-docs/slack_bolt/request/index.html | 185 +- docs/api-docs/slack_bolt/response/index.html | 157 +- docs/api-docs/slack_bolt/version.html | 2 +- .../workflows/step/async_step_middleware.html | 2 +- .../slack_bolt/workflows/step/index.html | 701 ++- slack_bolt/version.py | 2 +- 49 files changed, 19294 insertions(+), 127 deletions(-) create mode 100644 docs/api-docs/slack_bolt/adapter/google_cloud_functions/handler.html create mode 100644 docs/api-docs/slack_bolt/adapter/google_cloud_functions/index.html diff --git a/docs/api-docs/slack_bolt/adapter/aiohttp/index.html b/docs/api-docs/slack_bolt/adapter/aiohttp/index.html index a565a067d..693657840 100644 --- a/docs/api-docs/slack_bolt/adapter/aiohttp/index.html +++ b/docs/api-docs/slack_bolt/adapter/aiohttp/index.html @@ -66,7 +66,13 @@

    Module slack_bolt.adapter.aiohttp

    secure=True, httponly=True, ) - return resp + return resp + + +__all__ = [ + "to_bolt_request", + "to_aiohttp_response", +]
    diff --git a/docs/api-docs/slack_bolt/adapter/aws_lambda/index.html b/docs/api-docs/slack_bolt/adapter/aws_lambda/index.html index 5cc172ec4..3d293b0db 100644 --- a/docs/api-docs/slack_bolt/adapter/aws_lambda/index.html +++ b/docs/api-docs/slack_bolt/adapter/aws_lambda/index.html @@ -26,7 +26,11 @@

    Module slack_bolt.adapter.aws_lambda

    Expand source code -
    from .handler import SlackRequestHandler  # noqa: F401
    +
    from .handler import SlackRequestHandler
    +
    +__all__ = [
    +    "SlackRequestHandler",
    +]
    @@ -67,6 +71,160 @@

    Sub-modules

    +

    Classes

    +
    +
    +class SlackRequestHandler +(app: App) +
    +
    +
    +
    + +Expand source code + +
    class SlackRequestHandler:
    +    def __init__(self, app: App):  # type: ignore
    +        self.app = app
    +        self.logger = get_bolt_app_logger(app.name, SlackRequestHandler, app.logger)
    +        self.app.listener_runner.lazy_listener_runner = LambdaLazyListenerRunner(
    +            self.logger
    +        )
    +        if self.app.oauth_flow is not None:
    +            self.app.oauth_flow.settings.redirect_uri_page_renderer.install_path = "?"
    +
    +    @classmethod
    +    def clear_all_log_handlers(cls):
    +        # https://stackoverflow.com/questions/37703609/using-python-logging-with-aws-lambda
    +        root = logging.getLogger()
    +        if root.handlers:
    +            for handler in root.handlers:
    +                root.removeHandler(handler)
    +
    +    def handle(self, event, context):
    +        self.logger.debug(f"Incoming event: {event}, context: {context}")
    +
    +        method = event.get("requestContext", {}).get("http", {}).get("method")
    +        if method is None:
    +            method = event.get("requestContext", {}).get("httpMethod")
    +
    +        if method is None:
    +            return not_found()
    +        if method == "GET":
    +            if self.app.oauth_flow is not None:
    +                oauth_flow: OAuthFlow = self.app.oauth_flow
    +                bolt_req: BoltRequest = to_bolt_request(event)
    +                query = bolt_req.query
    +                is_callback = query is not None and (
    +                    (
    +                        _first_value(query, "code") is not None
    +                        and _first_value(query, "state") is not None
    +                    )
    +                    or _first_value(query, "error") is not None
    +                )
    +                if is_callback:
    +                    bolt_resp = oauth_flow.handle_callback(bolt_req)
    +                    return to_aws_response(bolt_resp)
    +                else:
    +                    bolt_resp = oauth_flow.handle_installation(bolt_req)
    +                    return to_aws_response(bolt_resp)
    +        elif method == "POST":
    +            bolt_req = to_bolt_request(event)
    +            # https://docs.aws.amazon.com/lambda/latest/dg/python-context.html
    +            aws_lambda_function_name = context.function_name
    +            bolt_req.context["aws_lambda_function_name"] = aws_lambda_function_name
    +            bolt_req.context["lambda_request"] = event
    +            bolt_resp = self.app.dispatch(bolt_req)
    +            aws_response = to_aws_response(bolt_resp)
    +            return aws_response
    +        elif method == "NONE":
    +            bolt_req = to_bolt_request(event)
    +            bolt_resp = self.app.dispatch(bolt_req)
    +            aws_response = to_aws_response(bolt_resp)
    +            return aws_response
    +
    +        return not_found()
    +
    +

    Static methods

    +
    +
    +def clear_all_log_handlers() +
    +
    +
    +
    + +Expand source code + +
    @classmethod
    +def clear_all_log_handlers(cls):
    +    # https://stackoverflow.com/questions/37703609/using-python-logging-with-aws-lambda
    +    root = logging.getLogger()
    +    if root.handlers:
    +        for handler in root.handlers:
    +            root.removeHandler(handler)
    +
    +
    +
    +

    Methods

    +
    +
    +def handle(self, event, context) +
    +
    +
    +
    + +Expand source code + +
    def handle(self, event, context):
    +    self.logger.debug(f"Incoming event: {event}, context: {context}")
    +
    +    method = event.get("requestContext", {}).get("http", {}).get("method")
    +    if method is None:
    +        method = event.get("requestContext", {}).get("httpMethod")
    +
    +    if method is None:
    +        return not_found()
    +    if method == "GET":
    +        if self.app.oauth_flow is not None:
    +            oauth_flow: OAuthFlow = self.app.oauth_flow
    +            bolt_req: BoltRequest = to_bolt_request(event)
    +            query = bolt_req.query
    +            is_callback = query is not None and (
    +                (
    +                    _first_value(query, "code") is not None
    +                    and _first_value(query, "state") is not None
    +                )
    +                or _first_value(query, "error") is not None
    +            )
    +            if is_callback:
    +                bolt_resp = oauth_flow.handle_callback(bolt_req)
    +                return to_aws_response(bolt_resp)
    +            else:
    +                bolt_resp = oauth_flow.handle_installation(bolt_req)
    +                return to_aws_response(bolt_resp)
    +    elif method == "POST":
    +        bolt_req = to_bolt_request(event)
    +        # https://docs.aws.amazon.com/lambda/latest/dg/python-context.html
    +        aws_lambda_function_name = context.function_name
    +        bolt_req.context["aws_lambda_function_name"] = aws_lambda_function_name
    +        bolt_req.context["lambda_request"] = event
    +        bolt_resp = self.app.dispatch(bolt_req)
    +        aws_response = to_aws_response(bolt_resp)
    +        return aws_response
    +    elif method == "NONE":
    +        bolt_req = to_bolt_request(event)
    +        bolt_resp = self.app.dispatch(bolt_req)
    +        aws_response = to_aws_response(bolt_resp)
    +        return aws_response
    +
    +    return not_found()
    +
    +
    +
    +
    +
    diff --git a/docs/api-docs/slack_bolt/adapter/bottle/index.html b/docs/api-docs/slack_bolt/adapter/bottle/index.html index 8701e3cb7..c6d7707fe 100644 --- a/docs/api-docs/slack_bolt/adapter/bottle/index.html +++ b/docs/api-docs/slack_bolt/adapter/bottle/index.html @@ -26,7 +26,11 @@

    Module slack_bolt.adapter.bottle

    Expand source code -
    from .handler import SlackRequestHandler  # noqa: F401
    +
    from .handler import SlackRequestHandler
    +
    +__all__ = [
    +    "SlackRequestHandler",
    +]
    @@ -43,6 +47,77 @@

    Sub-modules

    +

    Classes

    +
    +
    +class SlackRequestHandler +(app: App) +
    +
    +
    +
    + +Expand source code + +
    class SlackRequestHandler:
    +    def __init__(self, app: App):  # type: ignore
    +        self.app = app
    +
    +    def handle(self, req: Request, resp: Response) -> str:
    +        if req.method == "GET":
    +            if self.app.oauth_flow is not None:
    +                oauth_flow: OAuthFlow = self.app.oauth_flow
    +                if req.path == oauth_flow.install_path:
    +                    bolt_resp = oauth_flow.handle_installation(to_bolt_request(req))
    +                    set_response(bolt_resp, resp)
    +                    return bolt_resp.body or ""
    +                elif req.path == oauth_flow.redirect_uri_path:
    +                    bolt_resp = oauth_flow.handle_callback(to_bolt_request(req))
    +                    set_response(bolt_resp, resp)
    +                    return bolt_resp.body or ""
    +        elif req.method == "POST":
    +            bolt_resp: BoltResponse = self.app.dispatch(to_bolt_request(req))
    +            set_response(bolt_resp, resp)
    +            return bolt_resp.body or ""
    +
    +        resp.status = 404
    +        return "Not Found"
    +
    +

    Methods

    +
    +
    +def handle(self, req: bottle.BaseRequest, resp: bottle.BaseResponse) ‑> str +
    +
    +
    +
    + +Expand source code + +
    def handle(self, req: Request, resp: Response) -> str:
    +    if req.method == "GET":
    +        if self.app.oauth_flow is not None:
    +            oauth_flow: OAuthFlow = self.app.oauth_flow
    +            if req.path == oauth_flow.install_path:
    +                bolt_resp = oauth_flow.handle_installation(to_bolt_request(req))
    +                set_response(bolt_resp, resp)
    +                return bolt_resp.body or ""
    +            elif req.path == oauth_flow.redirect_uri_path:
    +                bolt_resp = oauth_flow.handle_callback(to_bolt_request(req))
    +                set_response(bolt_resp, resp)
    +                return bolt_resp.body or ""
    +    elif req.method == "POST":
    +        bolt_resp: BoltResponse = self.app.dispatch(to_bolt_request(req))
    +        set_response(bolt_resp, resp)
    +        return bolt_resp.body or ""
    +
    +    resp.status = 404
    +    return "Not Found"
    +
    +
    +
    +
    +
    diff --git a/docs/api-docs/slack_bolt/adapter/cherrypy/index.html b/docs/api-docs/slack_bolt/adapter/cherrypy/index.html index 7b4df5764..396d15eec 100644 --- a/docs/api-docs/slack_bolt/adapter/cherrypy/index.html +++ b/docs/api-docs/slack_bolt/adapter/cherrypy/index.html @@ -26,7 +26,11 @@

    Module slack_bolt.adapter.cherrypy

    Expand source code -
    from .handler import SlackRequestHandler  # noqa: F401
    +
    from .handler import SlackRequestHandler
    +
    +__all__ = [
    +    "SlackRequestHandler",
    +]
    @@ -43,6 +47,81 @@

    Sub-modules

    +

    Classes

    +
    +
    +class SlackRequestHandler +(app: App) +
    +
    +
    +
    + +Expand source code + +
    class SlackRequestHandler:
    +    def __init__(self, app: App):  # type: ignore
    +        self.app = app
    +
    +    def handle(self) -> bytes:
    +        req = cherrypy.request
    +        if req.method == "GET":
    +            if self.app.oauth_flow is not None:
    +                oauth_flow: OAuthFlow = self.app.oauth_flow
    +                request_path = req.wsgi_environ["REQUEST_URI"].split("?")[0]
    +                if request_path == oauth_flow.install_path:
    +                    bolt_resp = oauth_flow.handle_installation(build_bolt_request())
    +                    set_response_status_and_headers(bolt_resp)
    +                    return (bolt_resp.body or "").encode("utf-8")
    +                elif request_path == oauth_flow.redirect_uri_path:
    +                    bolt_resp = oauth_flow.handle_callback(build_bolt_request())
    +                    set_response_status_and_headers(bolt_resp)
    +                    return (bolt_resp.body or "").encode("utf-8")
    +        elif req.method == "POST":
    +            bolt_resp: BoltResponse = self.app.dispatch(build_bolt_request())
    +            set_response_status_and_headers(bolt_resp)
    +            return (bolt_resp.body or "").encode("utf-8")
    +
    +        cherrypy.response.status = 404
    +        return "Not Found".encode("utf-8")
    +
    +

    Methods

    +
    +
    +def handle(self) ‑> bytes +
    +
    +
    +
    + +Expand source code + +
    def handle(self) -> bytes:
    +    req = cherrypy.request
    +    if req.method == "GET":
    +        if self.app.oauth_flow is not None:
    +            oauth_flow: OAuthFlow = self.app.oauth_flow
    +            request_path = req.wsgi_environ["REQUEST_URI"].split("?")[0]
    +            if request_path == oauth_flow.install_path:
    +                bolt_resp = oauth_flow.handle_installation(build_bolt_request())
    +                set_response_status_and_headers(bolt_resp)
    +                return (bolt_resp.body or "").encode("utf-8")
    +            elif request_path == oauth_flow.redirect_uri_path:
    +                bolt_resp = oauth_flow.handle_callback(build_bolt_request())
    +                set_response_status_and_headers(bolt_resp)
    +                return (bolt_resp.body or "").encode("utf-8")
    +    elif req.method == "POST":
    +        bolt_resp: BoltResponse = self.app.dispatch(build_bolt_request())
    +        set_response_status_and_headers(bolt_resp)
    +        return (bolt_resp.body or "").encode("utf-8")
    +
    +    cherrypy.response.status = 404
    +    return "Not Found".encode("utf-8")
    +
    +
    +
    +
    +
    diff --git a/docs/api-docs/slack_bolt/adapter/django/index.html b/docs/api-docs/slack_bolt/adapter/django/index.html index 80b06b944..6154ab619 100644 --- a/docs/api-docs/slack_bolt/adapter/django/index.html +++ b/docs/api-docs/slack_bolt/adapter/django/index.html @@ -26,7 +26,11 @@

    Module slack_bolt.adapter.django

    Expand source code -
    from .handler import SlackRequestHandler  # noqa: F401
    +
    from .handler import SlackRequestHandler
    +
    +__all__ = [
    +    "SlackRequestHandler",
    +]
    @@ -43,6 +47,126 @@

    Sub-modules

    +

    Classes

    +
    +
    +class SlackRequestHandler +(app: App) +
    +
    +
    +
    + +Expand source code + +
    class SlackRequestHandler:
    +    def __init__(self, app: App):  # type: ignore
    +        self.app = app
    +        listener_runner = self.app.listener_runner
    +        # This runner closes all thread-local connections in the thread when an execution completes
    +        self.app.listener_runner.lazy_listener_runner = DjangoThreadLazyListenerRunner(
    +            logger=listener_runner.logger,
    +            executor=listener_runner.listener_executor,
    +        )
    +
    +        if not isinstance(listener_runner, ThreadListenerRunner):
    +            raise BoltError(
    +                "Custom listener_runners are not compatible with this Django adapter."
    +            )
    +
    +        if app.process_before_response is True:
    +            # As long as the app access Django models in the same thread,
    +            # Django cleans the connections up for you.
    +            self.app.logger.debug("App.process_before_response is set to True")
    +            return
    +
    +        current_start_handler = listener_runner.listener_start_handler
    +        if current_start_handler is not None and not isinstance(
    +            current_start_handler, DefaultListenerStartHandler
    +        ):
    +            # As we run release_thread_local_connections() before listener executions,
    +            # it's okay to skip calling the same connection clean-up method at the listener completion.
    +            message = """As you've already set app.listener_runner.listener_start_handler to your own one,
    +            Bolt skipped to set it to slack_sdk.adapter.django.DjangoListenerStartHandler.
    +
    +            If you go with your own handler here, we highly recommend having the following lines of code
    +            in your handle() method to clean up unmanaged stale/old database connections:
    +
    +            from django.db import close_old_connections
    +            close_old_connections()
    +            """
    +            self.app.logger.info(message)
    +        else:
    +            # for proper management of thread-local Django DB connections
    +            self.app.listener_runner.listener_start_handler = (
    +                DjangoListenerStartHandler()
    +            )
    +            self.app.logger.debug("DjangoListenerStartHandler has been enabled")
    +
    +        current_completion_handler = listener_runner.listener_completion_handler
    +        if current_completion_handler is not None and not isinstance(
    +            current_completion_handler, DefaultListenerCompletionHandler
    +        ):
    +            # As we run release_thread_local_connections() before listener executions,
    +            # it's okay to skip calling the same connection clean-up method at the listener completion.
    +            message = """As you've already set app.listener_runner.listener_completion_handler to your own one,
    +            Bolt skipped to set it to slack_sdk.adapter.django.DjangoListenerCompletionHandler.
    +            """
    +            self.app.logger.info(message)
    +            return
    +        # for proper management of thread-local Django DB connections
    +        self.app.listener_runner.listener_completion_handler = (
    +            DjangoListenerCompletionHandler()
    +        )
    +        self.app.logger.debug("DjangoListenerCompletionHandler has been enabled")
    +
    +    def handle(self, req: HttpRequest) -> HttpResponse:
    +        if req.method == "GET":
    +            if self.app.oauth_flow is not None:
    +                oauth_flow: OAuthFlow = self.app.oauth_flow
    +                if req.path == oauth_flow.install_path:
    +                    bolt_resp = oauth_flow.handle_installation(to_bolt_request(req))
    +                    return to_django_response(bolt_resp)
    +                elif req.path == oauth_flow.redirect_uri_path:
    +                    bolt_resp = oauth_flow.handle_callback(to_bolt_request(req))
    +                    return to_django_response(bolt_resp)
    +        elif req.method == "POST":
    +            bolt_resp: BoltResponse = self.app.dispatch(to_bolt_request(req))
    +            return to_django_response(bolt_resp)
    +
    +        return HttpResponse(status=404, content=b"Not Found")
    +
    +

    Methods

    +
    +
    +def handle(self, req: django.http.request.HttpRequest) ‑> django.http.response.HttpResponse +
    +
    +
    +
    + +Expand source code + +
    def handle(self, req: HttpRequest) -> HttpResponse:
    +    if req.method == "GET":
    +        if self.app.oauth_flow is not None:
    +            oauth_flow: OAuthFlow = self.app.oauth_flow
    +            if req.path == oauth_flow.install_path:
    +                bolt_resp = oauth_flow.handle_installation(to_bolt_request(req))
    +                return to_django_response(bolt_resp)
    +            elif req.path == oauth_flow.redirect_uri_path:
    +                bolt_resp = oauth_flow.handle_callback(to_bolt_request(req))
    +                return to_django_response(bolt_resp)
    +    elif req.method == "POST":
    +        bolt_resp: BoltResponse = self.app.dispatch(to_bolt_request(req))
    +        return to_django_response(bolt_resp)
    +
    +    return HttpResponse(status=404, content=b"Not Found")
    +
    +
    +
    +
    +
    diff --git a/docs/api-docs/slack_bolt/adapter/falcon/index.html b/docs/api-docs/slack_bolt/adapter/falcon/index.html index a61724235..792d51a81 100644 --- a/docs/api-docs/slack_bolt/adapter/falcon/index.html +++ b/docs/api-docs/slack_bolt/adapter/falcon/index.html @@ -27,7 +27,11 @@

    Module slack_bolt.adapter.falcon

    Expand source code
    # Don't add async module imports here
    -from .resource import SlackAppResource  # noqa: F401
    +from .resource import SlackAppResource + +__all__ = [ + "SlackAppResource", +]
    @@ -48,6 +52,135 @@

    Sub-modules

    +

    Classes

    +
    +
    +class SlackAppResource +(app: App) +
    +
    +

    from slack_bolt import App +app = App()

    +

    import falcon +api = application = falcon.API() +api.add_route("/slack/events", SlackAppResource(app))

    +
    + +Expand source code + +
    class SlackAppResource:
    +    """
    +    from slack_bolt import App
    +    app = App()
    +
    +    import falcon
    +    api = application = falcon.API()
    +    api.add_route("/slack/events", SlackAppResource(app))
    +    """
    +
    +    def __init__(self, app: App):  # type: ignore
    +        self.app = app
    +
    +    def on_get(self, req: Request, resp: Response):
    +        if self.app.oauth_flow is not None:
    +            oauth_flow: OAuthFlow = self.app.oauth_flow
    +            if req.path == oauth_flow.install_path:
    +                bolt_resp = oauth_flow.handle_installation(self._to_bolt_request(req))
    +                self._write_response(bolt_resp, resp)
    +                return
    +            elif req.path == oauth_flow.redirect_uri_path:
    +                bolt_resp = oauth_flow.handle_callback(self._to_bolt_request(req))
    +                self._write_response(bolt_resp, resp)
    +                return
    +
    +        resp.status = "404"
    +        resp.body = "The page is not found..."
    +
    +    def on_post(self, req: Request, resp: Response):
    +        bolt_req = self._to_bolt_request(req)
    +        bolt_resp = self.app.dispatch(bolt_req)
    +        self._write_response(bolt_resp, resp)
    +
    +    def _to_bolt_request(self, req: Request) -> BoltRequest:
    +        return BoltRequest(
    +            body=req.stream.read(req.content_length or 0).decode("utf-8"),
    +            query=req.query_string,
    +            headers={k.lower(): v for k, v in req.headers.items()},
    +        )
    +
    +    def _write_response(self, bolt_resp: BoltResponse, resp: Response):
    +        if falcon_version.__version__.startswith("2."):
    +            resp.body = bolt_resp.body
    +        else:
    +            resp.text = bolt_resp.body
    +
    +        status = HTTPStatus(bolt_resp.status)
    +        resp.status = str(f"{status.value} {status.phrase}")
    +        resp.set_headers(bolt_resp.first_headers_without_set_cookie())
    +        for cookie in bolt_resp.cookies():
    +            for name, c in cookie.items():
    +                expire_value = c.get("expires")
    +                expire = (
    +                    datetime.strptime(expire_value, "%a, %d %b %Y %H:%M:%S %Z")
    +                    if expire_value
    +                    else None
    +                )
    +                resp.set_cookie(
    +                    name=name,
    +                    value=c.value,
    +                    expires=expire,
    +                    max_age=c.get("max-age"),
    +                    domain=c.get("domain"),
    +                    path=c.get("path"),
    +                    secure=True,
    +                    http_only=True,
    +                )
    +
    +

    Methods

    +
    +
    +def on_get(self, req: falcon.request.Request, resp: falcon.response.Response) +
    +
    +
    +
    + +Expand source code + +
    def on_get(self, req: Request, resp: Response):
    +    if self.app.oauth_flow is not None:
    +        oauth_flow: OAuthFlow = self.app.oauth_flow
    +        if req.path == oauth_flow.install_path:
    +            bolt_resp = oauth_flow.handle_installation(self._to_bolt_request(req))
    +            self._write_response(bolt_resp, resp)
    +            return
    +        elif req.path == oauth_flow.redirect_uri_path:
    +            bolt_resp = oauth_flow.handle_callback(self._to_bolt_request(req))
    +            self._write_response(bolt_resp, resp)
    +            return
    +
    +    resp.status = "404"
    +    resp.body = "The page is not found..."
    +
    +
    +
    +def on_post(self, req: falcon.request.Request, resp: falcon.response.Response) +
    +
    +
    +
    + +Expand source code + +
    def on_post(self, req: Request, resp: Response):
    +    bolt_req = self._to_bolt_request(req)
    +    bolt_resp = self.app.dispatch(bolt_req)
    +    self._write_response(bolt_resp, resp)
    +
    +
    +
    +
    +
    diff --git a/docs/api-docs/slack_bolt/adapter/fastapi/async_handler.html b/docs/api-docs/slack_bolt/adapter/fastapi/async_handler.html index d43ab4b33..cb4c2fdf7 100644 --- a/docs/api-docs/slack_bolt/adapter/fastapi/async_handler.html +++ b/docs/api-docs/slack_bolt/adapter/fastapi/async_handler.html @@ -26,7 +26,11 @@

    Module slack_bolt.adapter.fastapi.async_handler Expand source code -
    from ..starlette.async_handler import AsyncSlackRequestHandler  # noqa
    +
    from ..starlette.async_handler import AsyncSlackRequestHandler
    +
    +__all__ = [
    +    "AsyncSlackRequestHandler",
    +]

    @@ -36,6 +40,93 @@

    Module slack_bolt.adapter.fastapi.async_handler

    +

    Classes

    +
    +
    +class AsyncSlackRequestHandler +(app: AsyncApp) +
    +
    +
    +
    + +Expand source code + +
    class AsyncSlackRequestHandler:
    +    def __init__(self, app: AsyncApp):  # type: ignore
    +        self.app = app
    +
    +    async def handle(
    +        self, req: Request, addition_context_properties: Optional[Dict[str, Any]] = None
    +    ) -> Response:
    +        body = await req.body()
    +        if req.method == "GET":
    +            if self.app.oauth_flow is not None:
    +                oauth_flow: AsyncOAuthFlow = self.app.oauth_flow
    +                if req.url.path == oauth_flow.install_path:
    +                    bolt_resp = await oauth_flow.handle_installation(
    +                        to_async_bolt_request(req, body, addition_context_properties)
    +                    )
    +                    return to_starlette_response(bolt_resp)
    +                elif req.url.path == oauth_flow.redirect_uri_path:
    +                    bolt_resp = await oauth_flow.handle_callback(
    +                        to_async_bolt_request(req, body, addition_context_properties)
    +                    )
    +                    return to_starlette_response(bolt_resp)
    +        elif req.method == "POST":
    +            bolt_resp = await self.app.async_dispatch(
    +                to_async_bolt_request(req, body, addition_context_properties)
    +            )
    +            return to_starlette_response(bolt_resp)
    +
    +        return Response(
    +            status_code=404,
    +            content="Not found",
    +        )
    +
    +

    Methods

    +
    +
    +async def handle(self, req: starlette.requests.Request, addition_context_properties: Optional[Dict[str, Any]] = None) ‑> starlette.responses.Response +
    +
    +
    +
    + +Expand source code + +
    async def handle(
    +    self, req: Request, addition_context_properties: Optional[Dict[str, Any]] = None
    +) -> Response:
    +    body = await req.body()
    +    if req.method == "GET":
    +        if self.app.oauth_flow is not None:
    +            oauth_flow: AsyncOAuthFlow = self.app.oauth_flow
    +            if req.url.path == oauth_flow.install_path:
    +                bolt_resp = await oauth_flow.handle_installation(
    +                    to_async_bolt_request(req, body, addition_context_properties)
    +                )
    +                return to_starlette_response(bolt_resp)
    +            elif req.url.path == oauth_flow.redirect_uri_path:
    +                bolt_resp = await oauth_flow.handle_callback(
    +                    to_async_bolt_request(req, body, addition_context_properties)
    +                )
    +                return to_starlette_response(bolt_resp)
    +    elif req.method == "POST":
    +        bolt_resp = await self.app.async_dispatch(
    +            to_async_bolt_request(req, body, addition_context_properties)
    +        )
    +        return to_starlette_response(bolt_resp)
    +
    +    return Response(
    +        status_code=404,
    +        content="Not found",
    +    )
    +
    +
    +
    +
    +
    diff --git a/docs/api-docs/slack_bolt/adapter/fastapi/index.html b/docs/api-docs/slack_bolt/adapter/fastapi/index.html index ba5c9e031..ffc0d66b9 100644 --- a/docs/api-docs/slack_bolt/adapter/fastapi/index.html +++ b/docs/api-docs/slack_bolt/adapter/fastapi/index.html @@ -27,7 +27,11 @@

    Module slack_bolt.adapter.fastapi

    Expand source code
    # Don't add async module imports here
    -from ..starlette.handler import SlackRequestHandler  # noqa
    +from ..starlette.handler import SlackRequestHandler + +__all__ = [ + "SlackRequestHandler", +]
    @@ -44,6 +48,93 @@

    Sub-modules

    +

    Classes

    +
    +
    +class SlackRequestHandler +(app: App) +
    +
    +
    +
    + +Expand source code + +
    class SlackRequestHandler:
    +    def __init__(self, app: App):  # type: ignore
    +        self.app = app
    +
    +    async def handle(
    +        self, req: Request, addition_context_properties: Optional[Dict[str, Any]] = None
    +    ) -> Response:
    +        body = await req.body()
    +        if req.method == "GET":
    +            if self.app.oauth_flow is not None:
    +                oauth_flow: OAuthFlow = self.app.oauth_flow
    +                if req.url.path == oauth_flow.install_path:
    +                    bolt_resp = oauth_flow.handle_installation(
    +                        to_bolt_request(req, body, addition_context_properties)
    +                    )
    +                    return to_starlette_response(bolt_resp)
    +                elif req.url.path == oauth_flow.redirect_uri_path:
    +                    bolt_resp = oauth_flow.handle_callback(
    +                        to_bolt_request(req, body, addition_context_properties)
    +                    )
    +                    return to_starlette_response(bolt_resp)
    +        elif req.method == "POST":
    +            bolt_resp = self.app.dispatch(
    +                to_bolt_request(req, body, addition_context_properties)
    +            )
    +            return to_starlette_response(bolt_resp)
    +
    +        return Response(
    +            status_code=404,
    +            content="Not found",
    +        )
    +
    +

    Methods

    +
    +
    +async def handle(self, req: starlette.requests.Request, addition_context_properties: Optional[Dict[str, Any]] = None) ‑> starlette.responses.Response +
    +
    +
    +
    + +Expand source code + +
    async def handle(
    +    self, req: Request, addition_context_properties: Optional[Dict[str, Any]] = None
    +) -> Response:
    +    body = await req.body()
    +    if req.method == "GET":
    +        if self.app.oauth_flow is not None:
    +            oauth_flow: OAuthFlow = self.app.oauth_flow
    +            if req.url.path == oauth_flow.install_path:
    +                bolt_resp = oauth_flow.handle_installation(
    +                    to_bolt_request(req, body, addition_context_properties)
    +                )
    +                return to_starlette_response(bolt_resp)
    +            elif req.url.path == oauth_flow.redirect_uri_path:
    +                bolt_resp = oauth_flow.handle_callback(
    +                    to_bolt_request(req, body, addition_context_properties)
    +                )
    +                return to_starlette_response(bolt_resp)
    +    elif req.method == "POST":
    +        bolt_resp = self.app.dispatch(
    +            to_bolt_request(req, body, addition_context_properties)
    +        )
    +        return to_starlette_response(bolt_resp)
    +
    +    return Response(
    +        status_code=404,
    +        content="Not found",
    +    )
    +
    +
    +
    +
    +
    diff --git a/docs/api-docs/slack_bolt/adapter/flask/index.html b/docs/api-docs/slack_bolt/adapter/flask/index.html index 80baea429..02c5dd6b8 100644 --- a/docs/api-docs/slack_bolt/adapter/flask/index.html +++ b/docs/api-docs/slack_bolt/adapter/flask/index.html @@ -26,7 +26,11 @@

    Module slack_bolt.adapter.flask

    Expand source code -
    from .handler import SlackRequestHandler  # noqa: F401
    +
    from .handler import SlackRequestHandler
    +
    +__all__ = [
    +    "SlackRequestHandler",
    +]
    @@ -43,6 +47,69 @@

    Sub-modules

    +

    Classes

    +
    +
    +class SlackRequestHandler +(app: App) +
    +
    +
    +
    + +Expand source code + +
    class SlackRequestHandler:
    +    def __init__(self, app: App):  # type: ignore
    +        self.app = app
    +
    +    def handle(self, req: Request) -> Response:
    +        if req.method == "GET":
    +            if self.app.oauth_flow is not None:
    +                oauth_flow: OAuthFlow = self.app.oauth_flow
    +                if req.path == oauth_flow.install_path:
    +                    bolt_resp = oauth_flow.handle_installation(to_bolt_request(req))
    +                    return to_flask_response(bolt_resp)
    +                elif req.path == oauth_flow.redirect_uri_path:
    +                    bolt_resp = oauth_flow.handle_callback(to_bolt_request(req))
    +                    return to_flask_response(bolt_resp)
    +        elif req.method == "POST":
    +            bolt_resp: BoltResponse = self.app.dispatch(to_bolt_request(req))
    +            return to_flask_response(bolt_resp)
    +
    +        return make_response("Not Found", 404)
    +
    +

    Methods

    +
    +
    +def handle(self, req: flask.wrappers.Request) ‑> flask.wrappers.Response +
    +
    +
    +
    + +Expand source code + +
    def handle(self, req: Request) -> Response:
    +    if req.method == "GET":
    +        if self.app.oauth_flow is not None:
    +            oauth_flow: OAuthFlow = self.app.oauth_flow
    +            if req.path == oauth_flow.install_path:
    +                bolt_resp = oauth_flow.handle_installation(to_bolt_request(req))
    +                return to_flask_response(bolt_resp)
    +            elif req.path == oauth_flow.redirect_uri_path:
    +                bolt_resp = oauth_flow.handle_callback(to_bolt_request(req))
    +                return to_flask_response(bolt_resp)
    +    elif req.method == "POST":
    +        bolt_resp: BoltResponse = self.app.dispatch(to_bolt_request(req))
    +        return to_flask_response(bolt_resp)
    +
    +    return make_response("Not Found", 404)
    +
    +
    +
    +
    +
    diff --git a/docs/api-docs/slack_bolt/adapter/google_cloud_functions/handler.html b/docs/api-docs/slack_bolt/adapter/google_cloud_functions/handler.html new file mode 100644 index 000000000..652bc59e3 --- /dev/null +++ b/docs/api-docs/slack_bolt/adapter/google_cloud_functions/handler.html @@ -0,0 +1,220 @@ + + + + + + +slack_bolt.adapter.google_cloud_functions.handler API documentation + + + + + + + + + + + +
    +
    +
    +

    Module slack_bolt.adapter.google_cloud_functions.handler

    +
    +
    +
    + +Expand source code + +
    from typing import Callable
    +
    +from flask import Request, Response, make_response
    +
    +from slack_bolt.adapter.flask.handler import to_bolt_request, to_flask_response
    +from slack_bolt.app import App
    +from slack_bolt.error import BoltError
    +from slack_bolt.lazy_listener import LazyListenerRunner
    +from slack_bolt.request import BoltRequest
    +from slack_bolt.response import BoltResponse
    +
    +
    +class NoopLazyListenerRunner(LazyListenerRunner):
    +    def start(self, function: Callable[..., None], request: BoltRequest) -> None:
    +        raise BoltError(
    +            "The google_cloud_functions adapter does not support lazy listeners. "
    +            "Please consider either having a queue to pass the request to a different function or "
    +            "rewriting your code not to use lazy listeners."
    +        )
    +
    +
    +class SlackRequestHandler:
    +    def __init__(self, app: App):  # type: ignore
    +        self.app = app
    +        # Note that lazy listener is not supported
    +        self.app.listener_runner.lazy_listener_runner = NoopLazyListenerRunner()
    +        if self.app.oauth_flow is not None:
    +            self.app.oauth_flow.settings.redirect_uri_page_renderer.install_path = "?"
    +
    +    def handle(self, req: Request) -> Response:
    +        if req.method == "GET" and self.app.oauth_flow is not None:
    +            bolt_req = to_bolt_request(req)
    +            if "code" in req.args or "error" in req.args or "state" in req.args:
    +                bolt_resp = self.app.oauth_flow.handle_callback(bolt_req)
    +                return to_flask_response(bolt_resp)
    +            else:
    +                bolt_resp = self.app.oauth_flow.handle_installation(bolt_req)
    +                return to_flask_response(bolt_resp)
    +        elif req.method == "POST":
    +            bolt_resp: BoltResponse = self.app.dispatch(to_bolt_request(req))
    +            return to_flask_response(bolt_resp)
    +
    +        return make_response("Not Found", 404)
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Classes

    +
    +
    +class NoopLazyListenerRunner +
    +
    +
    +
    + +Expand source code + +
    class NoopLazyListenerRunner(LazyListenerRunner):
    +    def start(self, function: Callable[..., None], request: BoltRequest) -> None:
    +        raise BoltError(
    +            "The google_cloud_functions adapter does not support lazy listeners. "
    +            "Please consider either having a queue to pass the request to a different function or "
    +            "rewriting your code not to use lazy listeners."
    +        )
    +
    +

    Ancestors

    + +

    Class variables

    +
    +
    var logger : logging.Logger
    +
    +
    +
    +
    +

    Inherited members

    + +
    +
    +class SlackRequestHandler +(app: App) +
    +
    +
    +
    + +Expand source code + +
    class SlackRequestHandler:
    +    def __init__(self, app: App):  # type: ignore
    +        self.app = app
    +        # Note that lazy listener is not supported
    +        self.app.listener_runner.lazy_listener_runner = NoopLazyListenerRunner()
    +        if self.app.oauth_flow is not None:
    +            self.app.oauth_flow.settings.redirect_uri_page_renderer.install_path = "?"
    +
    +    def handle(self, req: Request) -> Response:
    +        if req.method == "GET" and self.app.oauth_flow is not None:
    +            bolt_req = to_bolt_request(req)
    +            if "code" in req.args or "error" in req.args or "state" in req.args:
    +                bolt_resp = self.app.oauth_flow.handle_callback(bolt_req)
    +                return to_flask_response(bolt_resp)
    +            else:
    +                bolt_resp = self.app.oauth_flow.handle_installation(bolt_req)
    +                return to_flask_response(bolt_resp)
    +        elif req.method == "POST":
    +            bolt_resp: BoltResponse = self.app.dispatch(to_bolt_request(req))
    +            return to_flask_response(bolt_resp)
    +
    +        return make_response("Not Found", 404)
    +
    +

    Methods

    +
    +
    +def handle(self, req: flask.wrappers.Request) ‑> flask.wrappers.Response +
    +
    +
    +
    + +Expand source code + +
    def handle(self, req: Request) -> Response:
    +    if req.method == "GET" and self.app.oauth_flow is not None:
    +        bolt_req = to_bolt_request(req)
    +        if "code" in req.args or "error" in req.args or "state" in req.args:
    +            bolt_resp = self.app.oauth_flow.handle_callback(bolt_req)
    +            return to_flask_response(bolt_resp)
    +        else:
    +            bolt_resp = self.app.oauth_flow.handle_installation(bolt_req)
    +            return to_flask_response(bolt_resp)
    +    elif req.method == "POST":
    +        bolt_resp: BoltResponse = self.app.dispatch(to_bolt_request(req))
    +        return to_flask_response(bolt_resp)
    +
    +    return make_response("Not Found", 404)
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/google_cloud_functions/index.html b/docs/api-docs/slack_bolt/adapter/google_cloud_functions/index.html new file mode 100644 index 000000000..46726a39a --- /dev/null +++ b/docs/api-docs/slack_bolt/adapter/google_cloud_functions/index.html @@ -0,0 +1,150 @@ + + + + + + +slack_bolt.adapter.google_cloud_functions API documentation + + + + + + + + + + + +
    +
    +
    +

    Module slack_bolt.adapter.google_cloud_functions

    +
    +
    +
    + +Expand source code + +
    from .handler import SlackRequestHandler
    +
    +__all__ = [
    +    "SlackRequestHandler",
    +]
    +
    +
    +
    +

    Sub-modules

    +
    +
    slack_bolt.adapter.google_cloud_functions.handler
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Classes

    +
    +
    +class SlackRequestHandler +(app: App) +
    +
    +
    +
    + +Expand source code + +
    class SlackRequestHandler:
    +    def __init__(self, app: App):  # type: ignore
    +        self.app = app
    +        # Note that lazy listener is not supported
    +        self.app.listener_runner.lazy_listener_runner = NoopLazyListenerRunner()
    +        if self.app.oauth_flow is not None:
    +            self.app.oauth_flow.settings.redirect_uri_page_renderer.install_path = "?"
    +
    +    def handle(self, req: Request) -> Response:
    +        if req.method == "GET" and self.app.oauth_flow is not None:
    +            bolt_req = to_bolt_request(req)
    +            if "code" in req.args or "error" in req.args or "state" in req.args:
    +                bolt_resp = self.app.oauth_flow.handle_callback(bolt_req)
    +                return to_flask_response(bolt_resp)
    +            else:
    +                bolt_resp = self.app.oauth_flow.handle_installation(bolt_req)
    +                return to_flask_response(bolt_resp)
    +        elif req.method == "POST":
    +            bolt_resp: BoltResponse = self.app.dispatch(to_bolt_request(req))
    +            return to_flask_response(bolt_resp)
    +
    +        return make_response("Not Found", 404)
    +
    +

    Methods

    +
    +
    +def handle(self, req: flask.wrappers.Request) ‑> flask.wrappers.Response +
    +
    +
    +
    + +Expand source code + +
    def handle(self, req: Request) -> Response:
    +    if req.method == "GET" and self.app.oauth_flow is not None:
    +        bolt_req = to_bolt_request(req)
    +        if "code" in req.args or "error" in req.args or "state" in req.args:
    +            bolt_resp = self.app.oauth_flow.handle_callback(bolt_req)
    +            return to_flask_response(bolt_resp)
    +        else:
    +            bolt_resp = self.app.oauth_flow.handle_installation(bolt_req)
    +            return to_flask_response(bolt_resp)
    +    elif req.method == "POST":
    +        bolt_resp: BoltResponse = self.app.dispatch(to_bolt_request(req))
    +        return to_flask_response(bolt_resp)
    +
    +    return make_response("Not Found", 404)
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/index.html b/docs/api-docs/slack_bolt/adapter/index.html index c05016afd..9cfe9bc51 100644 --- a/docs/api-docs/slack_bolt/adapter/index.html +++ b/docs/api-docs/slack_bolt/adapter/index.html @@ -66,6 +66,10 @@

    Sub-modules

    +
    slack_bolt.adapter.google_cloud_functions
    +
    +
    +
    slack_bolt.adapter.pyramid
    @@ -116,6 +120,7 @@

    Index

  • slack_bolt.adapter.falcon
  • slack_bolt.adapter.fastapi
  • slack_bolt.adapter.flask
  • +
  • slack_bolt.adapter.google_cloud_functions
  • slack_bolt.adapter.pyramid
  • slack_bolt.adapter.sanic
  • slack_bolt.adapter.socket_mode
  • diff --git a/docs/api-docs/slack_bolt/adapter/pyramid/index.html b/docs/api-docs/slack_bolt/adapter/pyramid/index.html index c9cd6120c..368a48f9c 100644 --- a/docs/api-docs/slack_bolt/adapter/pyramid/index.html +++ b/docs/api-docs/slack_bolt/adapter/pyramid/index.html @@ -26,7 +26,11 @@

    Module slack_bolt.adapter.pyramid

    Expand source code -
    from .handler import SlackRequestHandler  # noqa: F401
    +
    from .handler import SlackRequestHandler
    +
    +__all__ = [
    +    "SlackRequestHandler",
    +]
    @@ -43,6 +47,71 @@

    Sub-modules

    +

    Classes

    +
    +
    +class SlackRequestHandler +(app: App) +
    +
    +
    +
    + +Expand source code + +
    class SlackRequestHandler:
    +    def __init__(self, app: App):  # type: ignore
    +        self.app = app
    +
    +    def handle(self, request: Request) -> Response:
    +        if request.method == "GET":
    +            if self.app.oauth_flow is not None:
    +                oauth_flow: OAuthFlow = self.app.oauth_flow
    +                if request.path == oauth_flow.install_path:
    +                    bolt_resp = oauth_flow.handle_installation(to_bolt_request(request))
    +                    return to_pyramid_response(bolt_resp)
    +                elif request.path == oauth_flow.redirect_uri_path:
    +                    bolt_resp = oauth_flow.handle_callback(to_bolt_request(request))
    +                    return to_pyramid_response(bolt_resp)
    +        elif request.method == "POST":
    +            bolt_req = to_bolt_request(request)
    +            bolt_resp = self.app.dispatch(bolt_req)
    +            return to_pyramid_response(bolt_resp)
    +
    +        return Response(status=404, body="Not found")
    +
    +

    Methods

    +
    +
    +def handle(self, request: pyramid.request.Request) ‑> pyramid.response.Response +
    +
    +
    +
    + +Expand source code + +
    def handle(self, request: Request) -> Response:
    +    if request.method == "GET":
    +        if self.app.oauth_flow is not None:
    +            oauth_flow: OAuthFlow = self.app.oauth_flow
    +            if request.path == oauth_flow.install_path:
    +                bolt_resp = oauth_flow.handle_installation(to_bolt_request(request))
    +                return to_pyramid_response(bolt_resp)
    +            elif request.path == oauth_flow.redirect_uri_path:
    +                bolt_resp = oauth_flow.handle_callback(to_bolt_request(request))
    +                return to_pyramid_response(bolt_resp)
    +    elif request.method == "POST":
    +        bolt_req = to_bolt_request(request)
    +        bolt_resp = self.app.dispatch(bolt_req)
    +        return to_pyramid_response(bolt_resp)
    +
    +    return Response(status=404, body="Not found")
    +
    +
    +
    +
    +
    diff --git a/docs/api-docs/slack_bolt/adapter/sanic/index.html b/docs/api-docs/slack_bolt/adapter/sanic/index.html index c1b61a875..985a605b8 100644 --- a/docs/api-docs/slack_bolt/adapter/sanic/index.html +++ b/docs/api-docs/slack_bolt/adapter/sanic/index.html @@ -26,7 +26,11 @@

    Module slack_bolt.adapter.sanic

    Expand source code -
    from .async_handler import AsyncSlackRequestHandler  # noqa: F401
    +
    from .async_handler import AsyncSlackRequestHandler
    +
    +__all__ = [
    +    "AsyncSlackRequestHandler",
    +]
    @@ -43,6 +47,85 @@

    Sub-modules

    +

    Classes

    +
    +
    +class AsyncSlackRequestHandler +(app: AsyncApp) +
    +
    +
    +
    + +Expand source code + +
    class AsyncSlackRequestHandler:
    +    def __init__(self, app: AsyncApp):  # type: ignore
    +        self.app = app
    +
    +    async def handle(self, req: Request) -> HTTPResponse:
    +        if req.method == "GET":
    +            if self.app.oauth_flow is not None:
    +                oauth_flow: AsyncOAuthFlow = self.app.oauth_flow
    +                if req.path == oauth_flow.install_path:
    +                    bolt_resp = await oauth_flow.handle_installation(
    +                        to_async_bolt_request(req)
    +                    )
    +                    return to_sanic_response(bolt_resp)
    +                elif req.path == oauth_flow.redirect_uri_path:
    +                    bolt_resp = await oauth_flow.handle_callback(
    +                        to_async_bolt_request(req)
    +                    )
    +                    return to_sanic_response(bolt_resp)
    +
    +        elif req.method == "POST":
    +            bolt_resp = await self.app.async_dispatch(to_async_bolt_request(req))
    +            return to_sanic_response(bolt_resp)
    +
    +        return HTTPResponse(
    +            status=404,
    +            body="Not found",
    +        )
    +
    +

    Methods

    +
    +
    +async def handle(self, req: sanic.request.Request) ‑> sanic.response.HTTPResponse +
    +
    +
    +
    + +Expand source code + +
    async def handle(self, req: Request) -> HTTPResponse:
    +    if req.method == "GET":
    +        if self.app.oauth_flow is not None:
    +            oauth_flow: AsyncOAuthFlow = self.app.oauth_flow
    +            if req.path == oauth_flow.install_path:
    +                bolt_resp = await oauth_flow.handle_installation(
    +                    to_async_bolt_request(req)
    +                )
    +                return to_sanic_response(bolt_resp)
    +            elif req.path == oauth_flow.redirect_uri_path:
    +                bolt_resp = await oauth_flow.handle_callback(
    +                    to_async_bolt_request(req)
    +                )
    +                return to_sanic_response(bolt_resp)
    +
    +    elif req.method == "POST":
    +        bolt_resp = await self.app.async_dispatch(to_async_bolt_request(req))
    +        return to_sanic_response(bolt_resp)
    +
    +    return HTTPResponse(
    +        status=404,
    +        body="Not found",
    +    )
    +
    +
    +
    +
    +
    diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/async_handler.html b/docs/api-docs/slack_bolt/adapter/socket_mode/async_handler.html index 239bd0fbe..a67e8cc42 100644 --- a/docs/api-docs/slack_bolt/adapter/socket_mode/async_handler.html +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/async_handler.html @@ -28,7 +28,11 @@

    Module slack_bolt.adapter.socket_mode.async_handlerExpand source code
    """Default implementation is the aiohttp-based one."""
    -from .aiohttp import AsyncSocketModeHandler  # noqa
    +from .aiohttp import AsyncSocketModeHandler + +__all__ = [ + "AsyncSocketModeHandler", +]

    @@ -38,6 +42,81 @@

    Module slack_bolt.adapter.socket_mode.async_handler

    +

    Classes

    +
    +
    +class AsyncSocketModeHandler +(app: AsyncApp, app_token: Optional[str] = None, logger: Optional[logging.Logger] = None, web_client: Optional[slack_sdk.web.async_client.AsyncWebClient] = None, proxy: Optional[str] = None, ping_interval: float = 10) +
    +
    +
    +
    + +Expand source code + +
    class AsyncSocketModeHandler(AsyncBaseSocketModeHandler):
    +    app: AsyncApp  # type: ignore
    +    app_token: str
    +    client: SocketModeClient
    +
    +    def __init__(  # type: ignore
    +        self,
    +        app: AsyncApp,  # type: ignore
    +        app_token: Optional[str] = None,
    +        logger: Optional[Logger] = None,
    +        web_client: Optional[AsyncWebClient] = None,
    +        proxy: Optional[str] = None,
    +        ping_interval: float = 10,
    +    ):
    +        self.app = app
    +        self.app_token = app_token or os.environ["SLACK_APP_TOKEN"]
    +        self.client = SocketModeClient(
    +            app_token=self.app_token,
    +            logger=logger if logger is not None else app.logger,
    +            web_client=web_client if web_client is not None else app.client,
    +            proxy=proxy,
    +            ping_interval=ping_interval,
    +        )
    +        self.client.socket_mode_request_listeners.append(self.handle)
    +
    +    async def handle(self, client: SocketModeClient, req: SocketModeRequest) -> None:
    +        start = time()
    +        bolt_resp: BoltResponse = await run_async_bolt_app(self.app, req)
    +        await send_async_response(client, req, bolt_resp, start)
    +
    +

    Ancestors

    + +

    Class variables

    +
    +
    var appAsyncApp
    +
    +
    +
    +
    var app_token : str
    +
    +
    +
    +
    var client : slack_sdk.socket_mode.aiohttp.SocketModeClient
    +
    +
    +
    +
    +

    Inherited members

    + +
    +
    diff --git a/docs/api-docs/slack_bolt/adapter/socket_mode/index.html b/docs/api-docs/slack_bolt/adapter/socket_mode/index.html index 3666de4b4..ba71be2ef 100644 --- a/docs/api-docs/slack_bolt/adapter/socket_mode/index.html +++ b/docs/api-docs/slack_bolt/adapter/socket_mode/index.html @@ -42,7 +42,11 @@

    Module slack_bolt.adapter.socket_mode

    """ # noqa: E501 # Don't add async module imports here -from .builtin import SocketModeHandler # noqa: F401
    +from .builtin import SocketModeHandler + +__all__ = [ + "SocketModeHandler", +]
    @@ -93,6 +97,141 @@

    Sub-modules

    +

    Classes

    +
    +
    +class SocketModeHandler +(app: App, app_token: Optional[str] = None, logger: Optional[logging.Logger] = None, web_client: Optional[slack_sdk.web.client.WebClient] = None, proxy: Optional[str] = None, proxy_headers: Optional[Dict[str, str]] = None, auto_reconnect_enabled: bool = True, trace_enabled: bool = False, all_message_trace_enabled: bool = False, ping_pong_trace_enabled: bool = False, ping_interval: float = 10, receive_buffer_size: int = 1024, concurrency: int = 10) +
    +
    +

    Socket Mode adapter for Bolt apps

    +

    Args

    +
    +
    app
    +
    The Bolt app
    +
    app_token
    +
    App-level token starting with xapp-
    +
    logger
    +
    Custom logger
    +
    web_client
    +
    custom slack_sdk.web.WebClient instance
    +
    proxy
    +
    HTTP proxy URL
    +
    proxy_headers
    +
    Additional request header for proxy connections
    +
    auto_reconnect_enabled
    +
    True if the auto-reconnect logic works
    +
    trace_enabled
    +
    True if trace-level logging is enabled
    +
    all_message_trace_enabled
    +
    True if trace-logging for all received WebSocket messages is enabled
    +
    ping_pong_trace_enabled
    +
    True if trace-logging for all ping-pong communications
    +
    ping_interval
    +
    The ping-pong internal (seconds)
    +
    receive_buffer_size
    +
    The data length for a single socket recv operation
    +
    concurrency
    +
    The size of the underlying thread pool
    +
    +
    + +Expand source code + +
    class SocketModeHandler(BaseSocketModeHandler):
    +    app: App  # type: ignore
    +    app_token: str
    +    client: SocketModeClient
    +
    +    def __init__(  # type: ignore
    +        self,
    +        app: App,  # type: ignore
    +        app_token: Optional[str] = None,
    +        logger: Optional[Logger] = None,
    +        web_client: Optional[WebClient] = None,
    +        proxy: Optional[str] = None,
    +        proxy_headers: Optional[Dict[str, str]] = None,
    +        auto_reconnect_enabled: bool = True,
    +        trace_enabled: bool = False,
    +        all_message_trace_enabled: bool = False,
    +        ping_pong_trace_enabled: bool = False,
    +        ping_interval: float = 10,
    +        receive_buffer_size: int = 1024,
    +        concurrency: int = 10,
    +    ):
    +        """Socket Mode adapter for Bolt apps
    +
    +        Args:
    +            app: The Bolt app
    +            app_token: App-level token starting with `xapp-`
    +            logger: Custom logger
    +            web_client: custom `slack_sdk.web.WebClient` instance
    +            proxy: HTTP proxy URL
    +            proxy_headers: Additional request header for proxy connections
    +            auto_reconnect_enabled: True if the auto-reconnect logic works
    +            trace_enabled: True if trace-level logging is enabled
    +            all_message_trace_enabled: True if trace-logging for all received WebSocket messages is enabled
    +            ping_pong_trace_enabled: True if trace-logging for all ping-pong communications
    +            ping_interval: The ping-pong internal (seconds)
    +            receive_buffer_size: The data length for a single socket recv operation
    +            concurrency: The size of the underlying thread pool
    +        """
    +        self.app = app
    +        self.app_token = app_token or os.environ["SLACK_APP_TOKEN"]
    +        self.client = SocketModeClient(
    +            app_token=self.app_token,
    +            logger=logger if logger is not None else app.logger,
    +            web_client=web_client if web_client is not None else app.client,
    +            proxy=proxy if proxy is not None else app.client.proxy,
    +            proxy_headers=proxy_headers,
    +            auto_reconnect_enabled=auto_reconnect_enabled,
    +            trace_enabled=trace_enabled,
    +            all_message_trace_enabled=all_message_trace_enabled,
    +            ping_pong_trace_enabled=ping_pong_trace_enabled,
    +            ping_interval=ping_interval,
    +            receive_buffer_size=receive_buffer_size,
    +            concurrency=concurrency,
    +        )
    +        self.client.socket_mode_request_listeners.append(self.handle)
    +
    +    def handle(self, client: SocketModeClient, req: SocketModeRequest) -> None:
    +        start = time()
    +        bolt_resp: BoltResponse = run_bolt_app(self.app, req)
    +        send_response(client, req, bolt_resp, start)
    +
    +

    Ancestors

    + +

    Class variables

    +
    +
    var appApp
    +
    +
    +
    +
    var app_token : str
    +
    +
    +
    +
    var client : slack_sdk.socket_mode.builtin.client.SocketModeClient
    +
    +
    +
    +
    +

    Inherited members

    + +
    +
    diff --git a/docs/api-docs/slack_bolt/adapter/starlette/index.html b/docs/api-docs/slack_bolt/adapter/starlette/index.html index b3c1dbecd..35673fa37 100644 --- a/docs/api-docs/slack_bolt/adapter/starlette/index.html +++ b/docs/api-docs/slack_bolt/adapter/starlette/index.html @@ -27,7 +27,11 @@

    Module slack_bolt.adapter.starlette

    Expand source code
    # Don't add async module imports here
    -from .handler import SlackRequestHandler  # noqa: F401
    +from .handler import SlackRequestHandler + +__all__ = [ + "SlackRequestHandler", +]
    @@ -48,6 +52,93 @@

    Sub-modules

    +

    Classes

    +
    +
    +class SlackRequestHandler +(app: App) +
    +
    +
    +
    + +Expand source code + +
    class SlackRequestHandler:
    +    def __init__(self, app: App):  # type: ignore
    +        self.app = app
    +
    +    async def handle(
    +        self, req: Request, addition_context_properties: Optional[Dict[str, Any]] = None
    +    ) -> Response:
    +        body = await req.body()
    +        if req.method == "GET":
    +            if self.app.oauth_flow is not None:
    +                oauth_flow: OAuthFlow = self.app.oauth_flow
    +                if req.url.path == oauth_flow.install_path:
    +                    bolt_resp = oauth_flow.handle_installation(
    +                        to_bolt_request(req, body, addition_context_properties)
    +                    )
    +                    return to_starlette_response(bolt_resp)
    +                elif req.url.path == oauth_flow.redirect_uri_path:
    +                    bolt_resp = oauth_flow.handle_callback(
    +                        to_bolt_request(req, body, addition_context_properties)
    +                    )
    +                    return to_starlette_response(bolt_resp)
    +        elif req.method == "POST":
    +            bolt_resp = self.app.dispatch(
    +                to_bolt_request(req, body, addition_context_properties)
    +            )
    +            return to_starlette_response(bolt_resp)
    +
    +        return Response(
    +            status_code=404,
    +            content="Not found",
    +        )
    +
    +

    Methods

    +
    +
    +async def handle(self, req: starlette.requests.Request, addition_context_properties: Optional[Dict[str, Any]] = None) ‑> starlette.responses.Response +
    +
    +
    +
    + +Expand source code + +
    async def handle(
    +    self, req: Request, addition_context_properties: Optional[Dict[str, Any]] = None
    +) -> Response:
    +    body = await req.body()
    +    if req.method == "GET":
    +        if self.app.oauth_flow is not None:
    +            oauth_flow: OAuthFlow = self.app.oauth_flow
    +            if req.url.path == oauth_flow.install_path:
    +                bolt_resp = oauth_flow.handle_installation(
    +                    to_bolt_request(req, body, addition_context_properties)
    +                )
    +                return to_starlette_response(bolt_resp)
    +            elif req.url.path == oauth_flow.redirect_uri_path:
    +                bolt_resp = oauth_flow.handle_callback(
    +                    to_bolt_request(req, body, addition_context_properties)
    +                )
    +                return to_starlette_response(bolt_resp)
    +    elif req.method == "POST":
    +        bolt_resp = self.app.dispatch(
    +            to_bolt_request(req, body, addition_context_properties)
    +        )
    +        return to_starlette_response(bolt_resp)
    +
    +    return Response(
    +        status_code=404,
    +        content="Not found",
    +    )
    +
    +
    +
    +
    +
    diff --git a/docs/api-docs/slack_bolt/adapter/tornado/index.html b/docs/api-docs/slack_bolt/adapter/tornado/index.html index 037b2751f..95ed67cc6 100644 --- a/docs/api-docs/slack_bolt/adapter/tornado/index.html +++ b/docs/api-docs/slack_bolt/adapter/tornado/index.html @@ -26,7 +26,12 @@

    Module slack_bolt.adapter.tornado

    Expand source code -
    from .handler import SlackEventsHandler, SlackOAuthHandler  # noqa: F401
    +
    from .handler import SlackEventsHandler, SlackOAuthHandler
    +
    +__all__ = [
    +    "SlackEventsHandler",
    +    "SlackOAuthHandler",
    +]
    @@ -43,6 +48,149 @@

    Sub-modules

    +

    Classes

    +
    +
    +class SlackEventsHandler +(application: Application, request: tornado.httputil.HTTPServerRequest, **kwargs: Any) +
    +
    +

    Base class for HTTP request handlers.

    +

    Subclasses must define at least one of the methods defined in the +"Entry points" section below.

    +

    Applications should not construct RequestHandler objects +directly and subclasses should not override __init__ (override +~RequestHandler.initialize instead).

    +
    + +Expand source code + +
    class SlackEventsHandler(RequestHandler):
    +    def initialize(self, app: App):  # type: ignore
    +        self.app = app
    +
    +    def post(self):
    +        bolt_resp: BoltResponse = self.app.dispatch(to_bolt_request(self.request))
    +        set_response(self, bolt_resp)
    +        return
    +
    +

    Ancestors

    +
      +
    • tornado.web.RequestHandler
    • +
    +

    Methods

    +
    +
    +def initialize(self, app: App) +
    +
    +
    +
    + +Expand source code + +
    def initialize(self, app: App):  # type: ignore
    +    self.app = app
    +
    +
    +
    +def post(self) +
    +
    +
    +
    + +Expand source code + +
    def post(self):
    +    bolt_resp: BoltResponse = self.app.dispatch(to_bolt_request(self.request))
    +    set_response(self, bolt_resp)
    +    return
    +
    +
    +
    +
    +
    +class SlackOAuthHandler +(application: Application, request: tornado.httputil.HTTPServerRequest, **kwargs: Any) +
    +
    +

    Base class for HTTP request handlers.

    +

    Subclasses must define at least one of the methods defined in the +"Entry points" section below.

    +

    Applications should not construct RequestHandler objects +directly and subclasses should not override __init__ (override +~RequestHandler.initialize instead).

    +
    + +Expand source code + +
    class SlackOAuthHandler(RequestHandler):
    +    def initialize(self, app: App):  # type: ignore
    +        self.app = app
    +
    +    def get(self):
    +        if self.app.oauth_flow is not None:  # type: ignore
    +            oauth_flow: OAuthFlow = self.app.oauth_flow  # type: ignore
    +            if self.request.path == oauth_flow.install_path:
    +                bolt_resp = oauth_flow.handle_installation(
    +                    to_bolt_request(self.request)
    +                )
    +                set_response(self, bolt_resp)
    +                return
    +            elif self.request.path == oauth_flow.redirect_uri_path:
    +                bolt_resp = oauth_flow.handle_callback(to_bolt_request(self.request))
    +                set_response(self, bolt_resp)
    +                return
    +        self.set_status(404)
    +
    +

    Ancestors

    +
      +
    • tornado.web.RequestHandler
    • +
    +

    Methods

    +
    +
    +def get(self) +
    +
    +
    +
    + +Expand source code + +
    def get(self):
    +    if self.app.oauth_flow is not None:  # type: ignore
    +        oauth_flow: OAuthFlow = self.app.oauth_flow  # type: ignore
    +        if self.request.path == oauth_flow.install_path:
    +            bolt_resp = oauth_flow.handle_installation(
    +                to_bolt_request(self.request)
    +            )
    +            set_response(self, bolt_resp)
    +            return
    +        elif self.request.path == oauth_flow.redirect_uri_path:
    +            bolt_resp = oauth_flow.handle_callback(to_bolt_request(self.request))
    +            set_response(self, bolt_resp)
    +            return
    +    self.set_status(404)
    +
    +
    +
    +def initialize(self, app: App) +
    +
    +
    +
    + +Expand source code + +
    def initialize(self, app: App):  # type: ignore
    +    self.app = app
    +
    +
    +
    +
    +
    diff --git a/docs/api-docs/slack_bolt/app/app.html b/docs/api-docs/slack_bolt/app/app.html index 4df4d89ec..d6fc78148 100644 --- a/docs/api-docs/slack_bolt/app/app.html +++ b/docs/api-docs/slack_bolt/app/app.html @@ -1648,7 +1648,7 @@

    Args

    oauth_settings
    The settings related to Slack app installation flow (OAuth flow)
    oauth_flow
    -
    Instantiated slack_bolt.oauth.OAuthFlow. This is always prioritized over oauth_settings.
    +
    Instantiated OAuthFlow. This is always prioritized over oauth_settings.
    verification_token
    Deprecated verification mechanism. This can used only for ssl_check requests.
    listener_executor
    diff --git a/docs/api-docs/slack_bolt/app/async_app.html b/docs/api-docs/slack_bolt/app/async_app.html index 894ee048c..ff6aa28e8 100644 --- a/docs/api-docs/slack_bolt/app/async_app.html +++ b/docs/api-docs/slack_bolt/app/async_app.html @@ -42,7 +42,7 @@

    Module slack_bolt.app.async_app

    from slack_bolt.listener.async_listener_completion_handler import ( AsyncDefaultListenerCompletionHandler, ) -from slack_bolt.listener.asyncio_runner import AsyncioListenerRunner +from slack_bolt.listener.asyncio_runner import AsyncioListenerRunner # type: ignore from slack_bolt.middleware.async_middleware_error_handler import ( AsyncCustomMiddlewareErrorHandler, AsyncDefaultMiddlewareErrorHandler, diff --git a/docs/api-docs/slack_bolt/app/index.html b/docs/api-docs/slack_bolt/app/index.html index 2ad72f98a..b0924b7e7 100644 --- a/docs/api-docs/slack_bolt/app/index.html +++ b/docs/api-docs/slack_bolt/app/index.html @@ -39,7 +39,11 @@

    Module slack_bolt.app

    """ # Don't add async module imports here -from .app import App # type: ignore +from .app import App # type: ignore + +__all__ = [ + "App", +]
    @@ -49,21 +53,2910 @@

    Sub-modules

    -
    slack_bolt.app.async_app
    +
    slack_bolt.app.async_app
    +
    +
    +
    +
    slack_bolt.app.async_server
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +

    Classes

    +
    +
    +class App +(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, token_verification_enabled: bool = True, client: Optional[slack_sdk.web.client.WebClient] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, verification_token: Optional[str] = None, listener_executor: Optional[concurrent.futures._base.Executor] = None) +
    +
    +

    Bolt App that provides functionalities to register middleware/listeners.

    +
    import os
    +from slack_bolt import App
    +
    +# Initializes your app with your bot token and signing secret
    +app = App(
    +    token=os.environ.get("SLACK_BOT_TOKEN"),
    +    signing_secret=os.environ.get("SLACK_SIGNING_SECRET")
    +)
    +
    +# Listens to incoming messages that contain "hello"
    +@app.message("hello")
    +def message_hello(message, say):
    +    # say() sends a message to the channel where the event was triggered
    +    say(f"Hey there <@{message['user']}>!")
    +
    +# Start your app
    +if __name__ == "__main__":
    +    app.start(port=int(os.environ.get("PORT", 3000)))
    +
    +

    Refer to https://slack.dev/bolt-python/tutorial/getting-started for details.

    +

    If you would like to build an OAuth app for enabling the app to run with multiple workspaces, +refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app.

    +

    Args

    +
    +
    logger
    +
    The custom logger that can be used in this app.
    +
    name
    +
    The application name that will be used in logging. If absent, the source file name will be used.
    +
    process_before_response
    +
    True if this app runs on Function as a Service. (Default: False)
    +
    raise_error_for_unhandled_request
    +
    True if you want to raise exceptions for unhandled requests +and use @app.error listeners instead of +the built-in handler, which pints warning logs and returns 404 to Slack (Default: False)
    +
    signing_secret
    +
    The Signing Secret value used for verifying requests from Slack.
    +
    token
    +
    The bot/user access token required only for single-workspace app.
    +
    token_verification_enabled
    +
    Verifies the validity of the given token if True.
    +
    client
    +
    The singleton slack_sdk.WebClient instance for this app.
    +
    authorize
    +
    The function to authorize an incoming request from Slack +by checking if there is a team/user in the installation data.
    +
    installation_store
    +
    The module offering save/find operations of installation data
    +
    installation_store_bot_only
    +
    Use InstallationStore#find_bot() if True (Default: False)
    +
    request_verification_enabled
    +
    False if you would like to disable the built-in middleware (Default: True). +RequestVerification is a built-in middleware that verifies the signature in HTTP Mode requests. +Make sure if it's safe enough when you turn a built-in middleware off. +We strongly recommend using RequestVerification for better security. +If you have a proxy that verifies request signature in front of the Bolt app, +it's totally fine to disable RequestVerification to avoid duplication of work. +Don't turn it off just for easiness of development.
    +
    ignoring_self_events_enabled
    +
    False if you would like to disable the built-in middleware (Default: True). +IgnoringSelfEvents is a built-in middleware that enables Bolt apps to easily skip the events +generated by this app's bot user (this is useful for avoiding code error causing an infinite loop).
    +
    url_verification_enabled
    +
    False if you would like to disable the built-in middleware (Default: True). +UrlVerification is a built-in middleware that handles url_verification requests +that verify the endpoint for Events API in HTTP Mode requests.
    +
    ssl_check_enabled
    +
    bool = False if you would like to disable the built-in middleware (Default: True). +SslCheck is a built-in middleware that handles ssl_check requests from Slack.
    +
    oauth_settings
    +
    The settings related to Slack app installation flow (OAuth flow)
    +
    oauth_flow
    +
    Instantiated OAuthFlow. This is always prioritized over oauth_settings.
    +
    verification_token
    +
    Deprecated verification mechanism. This can used only for ssl_check requests.
    +
    listener_executor
    +
    Custom executor to run background tasks. If absent, the default ThreadPoolExecutor will +be used.
    +
    +
    + +Expand source code + +
    class App:
    +    def __init__(
    +        self,
    +        *,
    +        logger: Optional[logging.Logger] = None,
    +        # Used in logger
    +        name: Optional[str] = None,
    +        # Set True when you run this app on a FaaS platform
    +        process_before_response: bool = False,
    +        # Set True if you want to handle an unhandled request as an exception
    +        raise_error_for_unhandled_request: bool = False,
    +        # Basic Information > Credentials > Signing Secret
    +        signing_secret: Optional[str] = None,
    +        # for single-workspace apps
    +        token: Optional[str] = None,
    +        token_verification_enabled: bool = True,
    +        client: Optional[WebClient] = None,
    +        # for multi-workspace apps
    +        authorize: Optional[Callable[..., AuthorizeResult]] = None,
    +        installation_store: Optional[InstallationStore] = None,
    +        # for either only bot scope usage or v1.0.x compatibility
    +        installation_store_bot_only: Optional[bool] = None,
    +        # for customizing the built-in middleware
    +        request_verification_enabled: bool = True,
    +        ignoring_self_events_enabled: bool = True,
    +        ssl_check_enabled: bool = True,
    +        url_verification_enabled: bool = True,
    +        # for the OAuth flow
    +        oauth_settings: Optional[OAuthSettings] = None,
    +        oauth_flow: Optional[OAuthFlow] = None,
    +        # No need to set (the value is used only in response to ssl_check requests)
    +        verification_token: Optional[str] = None,
    +        # Set this one only when you want to customize the executor
    +        listener_executor: Optional[Executor] = None,
    +    ):
    +        """Bolt App that provides functionalities to register middleware/listeners.
    +
    +            import os
    +            from slack_bolt import App
    +
    +            # Initializes your app with your bot token and signing secret
    +            app = App(
    +                token=os.environ.get("SLACK_BOT_TOKEN"),
    +                signing_secret=os.environ.get("SLACK_SIGNING_SECRET")
    +            )
    +
    +            # Listens to incoming messages that contain "hello"
    +            @app.message("hello")
    +            def message_hello(message, say):
    +                # say() sends a message to the channel where the event was triggered
    +                say(f"Hey there <@{message['user']}>!")
    +
    +            # Start your app
    +            if __name__ == "__main__":
    +                app.start(port=int(os.environ.get("PORT", 3000)))
    +
    +        Refer to https://slack.dev/bolt-python/tutorial/getting-started for details.
    +
    +        If you would like to build an OAuth app for enabling the app to run with multiple workspaces,
    +        refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app.
    +
    +        Args:
    +            logger: The custom logger that can be used in this app.
    +            name: The application name that will be used in logging. If absent, the source file name will be used.
    +            process_before_response: True if this app runs on Function as a Service. (Default: False)
    +            raise_error_for_unhandled_request: True if you want to raise exceptions for unhandled requests
    +                and use @app.error listeners instead of
    +                the built-in handler, which pints warning logs and returns 404 to Slack (Default: False)
    +            signing_secret: The Signing Secret value used for verifying requests from Slack.
    +            token: The bot/user access token required only for single-workspace app.
    +            token_verification_enabled: Verifies the validity of the given token if True.
    +            client: The singleton `slack_sdk.WebClient` instance for this app.
    +            authorize: The function to authorize an incoming request from Slack
    +                by checking if there is a team/user in the installation data.
    +            installation_store: The module offering save/find operations of installation data
    +            installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False)
    +            request_verification_enabled: False if you would like to disable the built-in middleware (Default: True).
    +                `RequestVerification` is a built-in middleware that verifies the signature in HTTP Mode requests.
    +                Make sure if it's safe enough when you turn a built-in middleware off.
    +                We strongly recommend using RequestVerification for better security.
    +                If you have a proxy that verifies request signature in front of the Bolt app,
    +                it's totally fine to disable RequestVerification to avoid duplication of work.
    +                Don't turn it off just for easiness of development.
    +            ignoring_self_events_enabled: False if you would like to disable the built-in middleware (Default: True).
    +                `IgnoringSelfEvents` is a built-in middleware that enables Bolt apps to easily skip the events
    +                generated by this app's bot user (this is useful for avoiding code error causing an infinite loop).
    +            url_verification_enabled: False if you would like to disable the built-in middleware (Default: True).
    +                `UrlVerification` is a built-in middleware that handles url_verification requests
    +                that verify the endpoint for Events API in HTTP Mode requests.
    +            ssl_check_enabled: bool = False if you would like to disable the built-in middleware (Default: True).
    +                `SslCheck` is a built-in middleware that handles ssl_check requests from Slack.
    +            oauth_settings: The settings related to Slack app installation flow (OAuth flow)
    +            oauth_flow: Instantiated `slack_bolt.oauth.OAuthFlow`. This is always prioritized over oauth_settings.
    +            verification_token: Deprecated verification mechanism. This can used only for ssl_check requests.
    +            listener_executor: Custom executor to run background tasks. If absent, the default `ThreadPoolExecutor` will
    +                be used.
    +        """
    +        signing_secret = signing_secret or os.environ.get("SLACK_SIGNING_SECRET", "")
    +        token = token or os.environ.get("SLACK_BOT_TOKEN")
    +
    +        self._name: str = name or inspect.stack()[1].filename.split(os.path.sep)[-1]
    +        self._signing_secret: str = signing_secret
    +
    +        self._verification_token: Optional[str] = verification_token or os.environ.get(
    +            "SLACK_VERIFICATION_TOKEN", None
    +        )
    +        # If a logger is explicitly passed when initializing, the logger works as the base logger.
    +        # The base logger's logging settings will be propagated to all the loggers created by bolt-python.
    +        self._base_logger = logger
    +        # The framework logger is supposed to be used for the internal logging.
    +        # Also, it's accessible via `app.logger` as the app's singleton logger.
    +        self._framework_logger = logger or get_bolt_logger(App)
    +        self._raise_error_for_unhandled_request = raise_error_for_unhandled_request
    +
    +        self._token: Optional[str] = token
    +
    +        if client is not None:
    +            if not isinstance(client, WebClient):
    +                raise BoltError(error_client_invalid_type())
    +            self._client = client
    +            self._token = client.token
    +            if token is not None:
    +                self._framework_logger.warning(
    +                    warning_client_prioritized_and_token_skipped()
    +                )
    +        else:
    +            self._client = create_web_client(
    +                # NOTE: the token here can be None
    +                token=token,
    +                logger=self._framework_logger,
    +            )
    +
    +        # --------------------------------------
    +        # Authorize & OAuthFlow initialization
    +        # --------------------------------------
    +
    +        self._authorize: Optional[Authorize] = None
    +        if authorize is not None:
    +            if oauth_settings is not None or oauth_flow is not None:
    +                raise BoltError(error_authorize_conflicts())
    +            self._authorize = CallableAuthorize(
    +                logger=self._framework_logger, func=authorize
    +            )
    +
    +        self._installation_store: Optional[InstallationStore] = installation_store
    +        if self._installation_store is not None and self._authorize is None:
    +            settings = oauth_flow.settings if oauth_flow is not None else oauth_settings
    +            self._authorize = InstallationStoreAuthorize(
    +                installation_store=self._installation_store,
    +                client_id=settings.client_id if settings is not None else None,
    +                client_secret=settings.client_secret if settings is not None else None,
    +                logger=self._framework_logger,
    +                bot_only=installation_store_bot_only,
    +                client=self._client,  # for proxy use cases etc.
    +            )
    +
    +        self._oauth_flow: Optional[OAuthFlow] = None
    +
    +        if (
    +            oauth_settings is None
    +            and os.environ.get("SLACK_CLIENT_ID") is not None
    +            and os.environ.get("SLACK_CLIENT_SECRET") is not None
    +        ):
    +            # initialize with the default settings
    +            oauth_settings = OAuthSettings()
    +
    +            if oauth_flow is None and installation_store is None:
    +                # show info-level log for avoiding confusions
    +                self._framework_logger.info(info_default_oauth_settings_loaded())
    +
    +        if oauth_flow is not None:
    +            self._oauth_flow = oauth_flow
    +            installation_store = select_consistent_installation_store(
    +                client_id=self._oauth_flow.client_id,
    +                app_store=self._installation_store,
    +                oauth_flow_store=self._oauth_flow.settings.installation_store,
    +                logger=self._framework_logger,
    +            )
    +            self._installation_store = installation_store
    +            self._oauth_flow.settings.installation_store = installation_store
    +
    +            if self._oauth_flow._client is None:
    +                self._oauth_flow._client = self._client
    +            if self._authorize is None:
    +                self._authorize = self._oauth_flow.settings.authorize
    +        elif oauth_settings is not None:
    +            installation_store = select_consistent_installation_store(
    +                client_id=oauth_settings.client_id,
    +                app_store=self._installation_store,
    +                oauth_flow_store=oauth_settings.installation_store,
    +                logger=self._framework_logger,
    +            )
    +            self._installation_store = installation_store
    +            oauth_settings.installation_store = installation_store
    +            self._oauth_flow = OAuthFlow(
    +                client=self.client, logger=self.logger, settings=oauth_settings
    +            )
    +            if self._authorize is None:
    +                self._authorize = self._oauth_flow.settings.authorize
    +            self._authorize.token_rotation_expiration_minutes = (
    +                oauth_settings.token_rotation_expiration_minutes
    +            )
    +
    +        if (
    +            self._installation_store is not None or self._authorize is not None
    +        ) and self._token is not None:
    +            self._token = None
    +            self._framework_logger.warning(warning_token_skipped())
    +
    +        # after setting bot_only here, __init__ cannot replace authorize function
    +        if installation_store_bot_only is not None and self._oauth_flow is not None:
    +            app_bot_only = installation_store_bot_only or False
    +            oauth_flow_bot_only = self._oauth_flow.settings.installation_store_bot_only
    +            if app_bot_only != oauth_flow_bot_only:
    +                self.logger.warning(warning_bot_only_conflicts())
    +                self._oauth_flow.settings.installation_store_bot_only = app_bot_only
    +                self._authorize.bot_only = app_bot_only
    +
    +        self._tokens_revocation_listeners: Optional[TokenRevocationListeners] = None
    +        if self._installation_store is not None:
    +            self._tokens_revocation_listeners = TokenRevocationListeners(
    +                self._installation_store
    +            )
    +
    +        # --------------------------------------
    +        # Middleware Initialization
    +        # --------------------------------------
    +
    +        self._middleware_list: List[Middleware] = []
    +        self._listeners: List[Listener] = []
    +
    +        if listener_executor is None:
    +            listener_executor = ThreadPoolExecutor(max_workers=5)
    +
    +        self._process_before_response = process_before_response
    +        self._listener_runner = ThreadListenerRunner(
    +            logger=self._framework_logger,
    +            process_before_response=process_before_response,
    +            listener_error_handler=DefaultListenerErrorHandler(
    +                logger=self._framework_logger
    +            ),
    +            listener_start_handler=DefaultListenerStartHandler(
    +                logger=self._framework_logger
    +            ),
    +            listener_completion_handler=DefaultListenerCompletionHandler(
    +                logger=self._framework_logger
    +            ),
    +            listener_executor=listener_executor,
    +            lazy_listener_runner=ThreadLazyListenerRunner(
    +                logger=self._framework_logger,
    +                executor=listener_executor,
    +            ),
    +        )
    +        self._middleware_error_handler = DefaultMiddlewareErrorHandler(
    +            logger=self._framework_logger,
    +        )
    +
    +        self._init_middleware_list_done = False
    +        self._init_middleware_list(
    +            token_verification_enabled=token_verification_enabled,
    +            request_verification_enabled=request_verification_enabled,
    +            ignoring_self_events_enabled=ignoring_self_events_enabled,
    +            ssl_check_enabled=ssl_check_enabled,
    +            url_verification_enabled=url_verification_enabled,
    +        )
    +
    +    def _init_middleware_list(
    +        self,
    +        token_verification_enabled: bool = True,
    +        request_verification_enabled: bool = True,
    +        ignoring_self_events_enabled: bool = True,
    +        ssl_check_enabled: bool = True,
    +        url_verification_enabled: bool = True,
    +    ):
    +        if self._init_middleware_list_done:
    +            return
    +        if ssl_check_enabled is True:
    +            self._middleware_list.append(
    +                SslCheck(
    +                    verification_token=self._verification_token,
    +                    base_logger=self._base_logger,
    +                )
    +            )
    +        if request_verification_enabled is True:
    +            self._middleware_list.append(
    +                RequestVerification(self._signing_secret, base_logger=self._base_logger)
    +            )
    +
    +        # As authorize is required for making a Bolt app function, we don't offer the flag to disable this
    +        if self._oauth_flow is None:
    +            if self._token is not None:
    +                try:
    +                    auth_test_result = None
    +                    if token_verification_enabled:
    +                        # This API call is for eagerly validating the token
    +                        auth_test_result = self._client.auth_test(token=self._token)
    +                    self._middleware_list.append(
    +                        SingleTeamAuthorization(
    +                            auth_test_result=auth_test_result,
    +                            base_logger=self._base_logger,
    +                        )
    +                    )
    +                except SlackApiError as err:
    +                    raise BoltError(error_auth_test_failure(err.response))
    +            elif self._authorize is not None:
    +                self._middleware_list.append(
    +                    MultiTeamsAuthorization(
    +                        authorize=self._authorize, base_logger=self._base_logger
    +                    )
    +                )
    +            else:
    +                raise BoltError(error_token_required())
    +        else:
    +            self._middleware_list.append(
    +                MultiTeamsAuthorization(
    +                    authorize=self._authorize, base_logger=self._base_logger
    +                )
    +            )
    +        if ignoring_self_events_enabled is True:
    +            self._middleware_list.append(
    +                IgnoringSelfEvents(base_logger=self._base_logger)
    +            )
    +        if url_verification_enabled is True:
    +            self._middleware_list.append(UrlVerification(base_logger=self._base_logger))
    +        self._init_middleware_list_done = True
    +
    +    # -------------------------
    +    # accessors
    +
    +    @property
    +    def name(self) -> str:
    +        """The name of this app (default: the filename)"""
    +        return self._name
    +
    +    @property
    +    def oauth_flow(self) -> Optional[OAuthFlow]:
    +        """Configured `OAuthFlow` object if exists."""
    +        return self._oauth_flow
    +
    +    @property
    +    def logger(self) -> logging.Logger:
    +        """The logger this app uses."""
    +        return self._framework_logger
    +
    +    @property
    +    def client(self) -> WebClient:
    +        """The singleton `slack_sdk.WebClient` instance in this app."""
    +        return self._client
    +
    +    @property
    +    def installation_store(self) -> Optional[InstallationStore]:
    +        """The `slack_sdk.oauth.InstallationStore` that can be used in the `authorize` middleware."""
    +        return self._installation_store
    +
    +    @property
    +    def listener_runner(self) -> ThreadListenerRunner:
    +        """The thread executor for asynchronously running listeners."""
    +        return self._listener_runner
    +
    +    @property
    +    def process_before_response(self) -> bool:
    +        return self._process_before_response or False
    +
    +    # -------------------------
    +    # standalone server
    +
    +    def start(
    +        self,
    +        port: int = 3000,
    +        path: str = "/slack/events",
    +        http_server_logger_enabled: bool = True,
    +    ) -> None:
    +        """Starts a web server for local development.
    +
    +            # With the default settings, `http://localhost:3000/slack/events`
    +            # is available for handling incoming requests from Slack
    +            app.start()
    +
    +        This method internally starts a Web server process built with the `http.server` module.
    +        For production, consider using a production-ready WSGI server such as Gunicorn.
    +
    +        Args:
    +            port: The port to listen on (Default: 3000)
    +            path: The path to handle request from Slack (Default: `/slack/events`)
    +            http_server_logger_enabled: The flag to enable http.server logging if True (Default: True)
    +        """
    +        self._development_server = SlackAppDevelopmentServer(
    +            port=port,
    +            path=path,
    +            app=self,
    +            oauth_flow=self.oauth_flow,
    +            http_server_logger_enabled=http_server_logger_enabled,
    +        )
    +        self._development_server.start()
    +
    +    # -------------------------
    +    # main dispatcher
    +
    +    def dispatch(self, req: BoltRequest) -> BoltResponse:
    +        """Applies all middleware and dispatches an incoming request from Slack to the right code path.
    +
    +        Args:
    +            req: An incoming request from Slack
    +
    +        Returns:
    +            The response generated by this Bolt app
    +        """
    +        starting_time = time.time()
    +        self._init_context(req)
    +
    +        resp: Optional[BoltResponse] = BoltResponse(status=200, body="")
    +        middleware_state = {"next_called": False}
    +
    +        def middleware_next():
    +            middleware_state["next_called"] = True
    +
    +        try:
    +            for middleware in self._middleware_list:
    +                middleware_state["next_called"] = False
    +                if self._framework_logger.level <= logging.DEBUG:
    +                    self._framework_logger.debug(
    +                        debug_applying_middleware(middleware.name)
    +                    )
    +                resp = middleware.process(req=req, resp=resp, next=middleware_next)
    +                if not middleware_state["next_called"]:
    +                    if resp is None:
    +                        # next() method was not called without providing the response to return to Slack
    +                        # This should not be an intentional handling in usual use cases.
    +                        resp = BoltResponse(
    +                            status=404, body={"error": "no next() calls in middleware"}
    +                        )
    +                        if self._raise_error_for_unhandled_request is True:
    +                            self._listener_runner.listener_error_handler.handle(
    +                                error=BoltUnhandledRequestError(
    +                                    request=req,
    +                                    current_response=resp,
    +                                    last_global_middleware_name=middleware.name,
    +                                ),
    +                                request=req,
    +                                response=resp,
    +                            )
    +                            return resp
    +                        self._framework_logger.warning(
    +                            warning_unhandled_by_global_middleware(middleware.name, req)
    +                        )
    +                        return resp
    +                    return resp
    +
    +            for listener in self._listeners:
    +                listener_name = get_name_for_callable(listener.ack_function)
    +                self._framework_logger.debug(debug_checking_listener(listener_name))
    +                if listener.matches(req=req, resp=resp):
    +                    # run all the middleware attached to this listener first
    +                    middleware_resp, next_was_not_called = listener.run_middleware(
    +                        req=req, resp=resp
    +                    )
    +                    if next_was_not_called:
    +                        if middleware_resp is not None:
    +                            if self._framework_logger.level <= logging.DEBUG:
    +                                debug_message = (
    +                                    debug_return_listener_middleware_response(
    +                                        listener_name,
    +                                        middleware_resp.status,
    +                                        middleware_resp.body,
    +                                        starting_time,
    +                                    )
    +                                )
    +                                self._framework_logger.debug(debug_message)
    +                            return middleware_resp
    +                        # The last listener middleware didn't call next() method.
    +                        # This means the listener is not for this incoming request.
    +                        continue
    +
    +                    if middleware_resp is not None:
    +                        resp = middleware_resp
    +
    +                    self._framework_logger.debug(debug_running_listener(listener_name))
    +                    listener_response: Optional[
    +                        BoltResponse
    +                    ] = self._listener_runner.run(
    +                        request=req,
    +                        response=resp,
    +                        listener_name=listener_name,
    +                        listener=listener,
    +                    )
    +                    if listener_response is not None:
    +                        return listener_response
    +
    +            if resp is None:
    +                resp = BoltResponse(status=404, body={"error": "unhandled request"})
    +            if self._raise_error_for_unhandled_request is True:
    +                self._listener_runner.listener_error_handler.handle(
    +                    error=BoltUnhandledRequestError(
    +                        request=req,
    +                        current_response=resp,
    +                    ),
    +                    request=req,
    +                    response=resp,
    +                )
    +                return resp
    +            return self._handle_unmatched_requests(req, resp)
    +        except Exception as error:
    +            resp = BoltResponse(status=500, body="")
    +            self._middleware_error_handler.handle(
    +                error=error,
    +                request=req,
    +                response=resp,
    +            )
    +            return resp
    +
    +    def _handle_unmatched_requests(
    +        self, req: BoltRequest, resp: BoltResponse
    +    ) -> BoltResponse:
    +        self._framework_logger.warning(warning_unhandled_request(req))
    +        return resp
    +
    +    # -------------------------
    +    # middleware
    +
    +    def use(self, *args) -> Optional[Callable]:
    +        """Registers a new global middleware to this app. This method can be used as either a decorator or a method.
    +
    +        Refer to `App#middleware()` method's docstring for details."""
    +        return self.middleware(*args)
    +
    +    def middleware(self, *args) -> Optional[Callable]:
    +        """Registers a new middleware to this app.
    +        This method can be used as either a decorator or a method.
    +
    +            # Use this method as a decorator
    +            @app.middleware
    +            def middleware_func(logger, body, next):
    +                logger.info(f"request body: {body}")
    +                next()
    +
    +            # Pass a function to this method
    +            app.middleware(middleware_func)
    +
    +        Refer to https://slack.dev/bolt-python/concepts#global-middleware for details.
    +
    +        To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document.
    +
    +        Args:
    +            *args: A function that works as a global middleware.
    +        """
    +        if len(args) > 0:
    +            middleware_or_callable = args[0]
    +            if isinstance(middleware_or_callable, Middleware):
    +                middleware: Middleware = middleware_or_callable
    +                self._middleware_list.append(middleware)
    +            elif isinstance(middleware_or_callable, Callable):
    +                self._middleware_list.append(
    +                    CustomMiddleware(
    +                        app_name=self.name,
    +                        func=middleware_or_callable,
    +                        base_logger=self._base_logger,
    +                    )
    +                )
    +                return middleware_or_callable
    +            else:
    +                raise BoltError(
    +                    f"Unexpected type for a middleware ({type(middleware_or_callable)})"
    +                )
    +        return None
    +
    +    # -------------------------
    +    # Workflows: Steps from Apps
    +
    +    def step(
    +        self,
    +        callback_id: Union[str, Pattern, WorkflowStep, WorkflowStepBuilder],
    +        edit: Optional[
    +            Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]]
    +        ] = None,
    +        save: Optional[
    +            Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]]
    +        ] = None,
    +        execute: Optional[
    +            Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]]
    +        ] = None,
    +    ):
    +        """Registers a new Workflow Step listener.
    +        Unlike others, this method doesn't behave as a decorator.
    +        If you want to register a workflow step by a decorator, use `WorkflowStepBuilder`'s methods.
    +
    +            # Create a new WorkflowStep instance
    +            from slack_bolt.workflows.step import WorkflowStep
    +            ws = WorkflowStep(
    +                callback_id="add_task",
    +                edit=edit,
    +                save=save,
    +                execute=execute,
    +            )
    +            # Pass Step to set up listeners
    +            app.step(ws)
    +
    +        Refer to https://api.slack.com/workflows/steps for details of Steps from Apps.
    +
    +        To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document.
    +
    +        For further information about WorkflowStep specific function arguments
    +        such as `configure`, `update`, `complete`, and `fail`,
    +        refer to `slack_bolt.workflows.step.utilities` API documents.
    +
    +        Args:
    +            callback_id: The Callback ID for this workflow step
    +            edit: The function for displaying a modal in the Workflow Builder
    +            save: The function for handling configuration in the Workflow Builder
    +            execute: The function for handling the step execution
    +        """
    +        step = callback_id
    +        if isinstance(callback_id, (str, Pattern)):
    +            step = WorkflowStep(
    +                callback_id=callback_id,
    +                edit=edit,
    +                save=save,
    +                execute=execute,
    +                base_logger=self._base_logger,
    +            )
    +        elif isinstance(step, WorkflowStepBuilder):
    +            step = step.build(base_logger=self._base_logger)
    +        elif not isinstance(step, WorkflowStep):
    +            raise BoltError(f"Invalid step object ({type(step)})")
    +
    +        self.use(WorkflowStepMiddleware(step, self.listener_runner))
    +
    +    # -------------------------
    +    # global error handler
    +
    +    def error(
    +        self, func: Callable[..., Optional[BoltResponse]]
    +    ) -> Callable[..., Optional[BoltResponse]]:
    +        """Updates the global error handler. This method can be used as either a decorator or a method.
    +
    +            # Use this method as a decorator
    +            @app.error
    +            def custom_error_handler(error, body, logger):
    +                logger.exception(f"Error: {error}")
    +                logger.info(f"Request body: {body}")
    +
    +            # Pass a function to this method
    +            app.error(custom_error_handler)
    +
    +        To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document.
    +
    +        Args:
    +            func: The function that is supposed to be executed
    +                when getting an unhandled error in Bolt app.
    +        """
    +        self._listener_runner.listener_error_handler = CustomListenerErrorHandler(
    +            logger=self._framework_logger,
    +            func=func,
    +        )
    +        self._middleware_error_handler = CustomMiddlewareErrorHandler(
    +            logger=self._framework_logger,
    +            func=func,
    +        )
    +        return func
    +
    +    # -------------------------
    +    # events
    +
    +    def event(
    +        self,
    +        event: Union[
    +            str,
    +            Pattern,
    +            Dict[str, Optional[Union[str, Sequence[Optional[Union[str, Pattern]]]]]],
    +        ],
    +        matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +        """Registers a new event listener. This method can be used as either a decorator or a method.
    +
    +            # Use this method as a decorator
    +            @app.event("team_join")
    +            def ask_for_introduction(event, say):
    +                welcome_channel_id = "C12345"
    +                user_id = event["user"]
    +                text = f"Welcome to the team, <@{user_id}>! :tada: You can introduce yourself in this channel."
    +                say(text=text, channel=welcome_channel_id)
    +
    +            # Pass a function to this method
    +            app.event("team_join")(ask_for_introduction)
    +
    +        Refer to https://api.slack.com/apis/connections/events-api for details of Events API.
    +
    +        To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document.
    +
    +        Args:
    +            event: The conditions that match a request payload.
    +                If you pass a dict for this, you can have type, subtype in the constraint.
    +            matchers: A list of listener matcher functions.
    +                Only when all the matchers return True, the listener function can be invoked.
    +            middleware: A list of lister middleware functions.
    +                Only when all the middleware call `next()` method, the listener function can be invoked.
    +        """
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.event(
    +                event, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware, True
    +            )
    +
    +        return __call__
    +
    +    def message(
    +        self,
    +        keyword: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +        """Registers a new message event listener. This method can be used as either a decorator or a method.
    +        Check the `App#event` method's docstring for details.
    +
    +            # Use this method as a decorator
    +            @app.message(":wave:")
    +            def say_hello(message, say):
    +                user = message['user']
    +                say(f"Hi there, <@{user}>!")
    +
    +            # Pass a function to this method
    +            app.message(":wave:")(say_hello)
    +
    +        Refer to https://api.slack.com/events/message for details of `message` events.
    +
    +        To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document.
    +
    +        Args:
    +            keyword: The keyword to match
    +            matchers: A list of listener matcher functions.
    +                Only when all the matchers return True, the listener function can be invoked.
    +            middleware: A list of lister middleware functions.
    +                Only when all the middleware call `next()` method, the listener function can be invoked.
    +        """
    +        matchers = list(matchers) if matchers else []
    +        middleware = list(middleware) if middleware else []
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            constraints = {
    +                "type": "message",
    +                "subtype": (
    +                    # In most cases, new message events come with no subtype.
    +                    None,
    +                    # As of Jan 2021, most bot messages no longer have the subtype bot_message.
    +                    # By contrast, messages posted using classic app's bot token still have the subtype.
    +                    "bot_message",
    +                    # If an end-user posts a message with "Also send to #channel" checked,
    +                    # the message event comes with this subtype.
    +                    "thread_broadcast",
    +                    # If an end-user posts a message with attached files,
    +                    # the message event comes with this subtype.
    +                    "file_share",
    +                ),
    +            }
    +            primary_matcher = builtin_matchers.message_event(
    +                keyword=keyword, constraints=constraints, base_logger=self._base_logger
    +            )
    +            middleware.insert(0, MessageListenerMatches(keyword))
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware, True
    +            )
    +
    +        return __call__
    +
    +    # -------------------------
    +    # slash commands
    +
    +    def command(
    +        self,
    +        command: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +        """Registers a new slash command listener.
    +        This method can be used as either a decorator or a method.
    +
    +            # Use this method as a decorator
    +            @app.command("/echo")
    +            def repeat_text(ack, say, command):
    +                # Acknowledge command request
    +                ack()
    +                say(f"{command['text']}")
    +
    +            # Pass a function to this method
    +            app.command("/echo")(repeat_text)
    +
    +        Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands.
    +
    +        To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document.
    +
    +        Args:
    +            command: The conditions that match a request payload
    +            matchers: A list of listener matcher functions.
    +                Only when all the matchers return True, the listener function can be invoked.
    +            middleware: A list of lister middleware functions.
    +                Only when all the middleware call `next()` method, the listener function can be invoked.
    +        """
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.command(
    +                command, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    # -------------------------
    +    # shortcut
    +
    +    def shortcut(
    +        self,
    +        constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
    +        matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +        """Registers a new shortcut listener.
    +        This method can be used as either a decorator or a method.
    +
    +            # Use this method as a decorator
    +            @app.shortcut("open_modal")
    +            def open_modal(ack, body, client):
    +                # Acknowledge the command request
    +                ack()
    +                # Call views_open with the built-in client
    +                client.views_open(
    +                    # Pass a valid trigger_id within 3 seconds of receiving it
    +                    trigger_id=body["trigger_id"],
    +                    # View payload
    +                    view={ ... }
    +                )
    +
    +            # Pass a function to this method
    +            app.shortcut("open_modal")(open_modal)
    +
    +        Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts.
    +
    +        To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document.
    +
    +        Args:
    +            constraints: The conditions that match a request payload.
    +            matchers: A list of listener matcher functions.
    +                Only when all the matchers return True, the listener function can be invoked.
    +            middleware: A list of lister middleware functions.
    +                Only when all the middleware call `next()` method, the listener function can be invoked.
    +        """
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.shortcut(
    +                constraints, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    def global_shortcut(
    +        self,
    +        callback_id: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +        """Registers a new global shortcut listener."""
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.global_shortcut(
    +                callback_id, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    def message_shortcut(
    +        self,
    +        callback_id: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +        """Registers a new message shortcut listener."""
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.message_shortcut(
    +                callback_id, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    # -------------------------
    +    # action
    +
    +    def action(
    +        self,
    +        constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
    +        matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +        """Registers a new action listener. This method can be used as either a decorator or a method.
    +
    +            # Use this method as a decorator
    +            @app.action("approve_button")
    +            def update_message(ack):
    +                ack()
    +
    +            # Pass a function to this method
    +            app.action("approve_button")(update_message)
    +
    +        * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`.
    +        * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`.
    +        * Refer to https://api.slack.com/dialogs for actions in dialogs.
    +
    +        To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document.
    +
    +        Args:
    +            constraints: The conditions that match a request payload
    +            matchers: A list of listener matcher functions.
    +                Only when all the matchers return True, the listener function can be invoked.
    +            middleware: A list of lister middleware functions.
    +                Only when all the middleware call `next()` method, the listener function can be invoked.
    +        """
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.action(
    +                constraints, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    def block_action(
    +        self,
    +        constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
    +        matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +        """Registers a new `block_actions` action listener.
    +        Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details.
    +        """
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.block_action(
    +                constraints, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    def attachment_action(
    +        self,
    +        callback_id: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +        """Registers a new `interactive_message` action listener.
    +        Refer to https://api.slack.com/legacy/message-buttons for details."""
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.attachment_action(
    +                callback_id, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    def dialog_submission(
    +        self,
    +        callback_id: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +        """Registers a new `dialog_submission` listener.
    +        Refer to https://api.slack.com/dialogs for details."""
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.dialog_submission(
    +                callback_id, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    def dialog_cancellation(
    +        self,
    +        callback_id: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +        """Registers a new `dialog_cancellation` listener.
    +        Refer to https://api.slack.com/dialogs for details."""
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.dialog_cancellation(
    +                callback_id, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    # -------------------------
    +    # view
    +
    +    def view(
    +        self,
    +        constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
    +        matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +        """Registers a new `view_submission`/`view_closed` event listener.
    +        This method can be used as either a decorator or a method.
    +
    +            # Use this method as a decorator
    +            @app.view("view_1")
    +            def handle_submission(ack, body, client, view):
    +                # Assume there's an input block with `block_c` as the block_id and `dreamy_input`
    +                hopes_and_dreams = view["state"]["values"]["block_c"]["dreamy_input"]
    +                user = body["user"]["id"]
    +                # Validate the inputs
    +                errors = {}
    +                if hopes_and_dreams is not None and len(hopes_and_dreams) <= 5:
    +                    errors["block_c"] = "The value must be longer than 5 characters"
    +                if len(errors) > 0:
    +                    ack(response_action="errors", errors=errors)
    +                    return
    +                # Acknowledge the view_submission event and close the modal
    +                ack()
    +                # Do whatever you want with the input data - here we're saving it to a DB
    +
    +            # Pass a function to this method
    +            app.view("view_1")(handle_submission)
    +
    +        Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads.
    +
    +        To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document.
    +
    +        Args:
    +            constraints: The conditions that match a request payload
    +            matchers: A list of listener matcher functions.
    +                Only when all the matchers return True, the listener function can be invoked.
    +            middleware: A list of lister middleware functions.
    +                Only when all the middleware call `next()` method, the listener function can be invoked.
    +        """
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.view(
    +                constraints, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    def view_submission(
    +        self,
    +        constraints: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +        """Registers a new `view_submission` listener.
    +        Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details."""
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.view_submission(
    +                constraints, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    def view_closed(
    +        self,
    +        constraints: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +        """Registers a new `view_closed` listener.
    +        Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details."""
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.view_closed(
    +                constraints, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    # -------------------------
    +    # options
    +
    +    def options(
    +        self,
    +        constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
    +        matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +        """Registers a new options listener.
    +        This method can be used as either a decorator or a method.
    +
    +            # Use this method as a decorator
    +            @app.options("menu_selection")
    +            def show_menu_options(ack):
    +                options = [
    +                    {
    +                        "text": {"type": "plain_text", "text": "Option 1"},
    +                        "value": "1-1",
    +                    },
    +                    {
    +                        "text": {"type": "plain_text", "text": "Option 2"},
    +                        "value": "1-2",
    +                    },
    +                ]
    +                ack(options=options)
    +
    +            # Pass a function to this method
    +            app.options("menu_selection")(show_menu_options)
    +
    +        Refer to the following documents for details:
    +
    +        * https://api.slack.com/reference/block-kit/block-elements#external_select
    +        * https://api.slack.com/reference/block-kit/block-elements#external_multi_select
    +
    +        To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document.
    +
    +        Args:
    +            matchers: A list of listener matcher functions.
    +                Only when all the matchers return True, the listener function can be invoked.
    +            middleware: A list of lister middleware functions.
    +                Only when all the middleware call `next()` method, the listener function can be invoked.
    +        """
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.options(
    +                constraints, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    def block_suggestion(
    +        self,
    +        action_id: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +        """Registers a new `block_suggestion` listener."""
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.block_suggestion(
    +                action_id, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    def dialog_suggestion(
    +        self,
    +        callback_id: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +        """Registers a new `dialog_suggestion` listener.
    +        Refer to https://api.slack.com/dialogs for details."""
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.dialog_suggestion(
    +                callback_id, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    # -------------------------
    +    # built-in listener functions
    +
    +    def default_tokens_revoked_event_listener(
    +        self,
    +    ) -> Callable[..., Optional[BoltResponse]]:
    +        if self._tokens_revocation_listeners is None:
    +            raise BoltError(error_installation_store_required_for_builtin_listeners())
    +        return self._tokens_revocation_listeners.handle_tokens_revoked_events
    +
    +    def default_app_uninstalled_event_listener(
    +        self,
    +    ) -> Callable[..., Optional[BoltResponse]]:
    +        if self._tokens_revocation_listeners is None:
    +            raise BoltError(error_installation_store_required_for_builtin_listeners())
    +        return self._tokens_revocation_listeners.handle_app_uninstalled_events
    +
    +    def enable_token_revocation_listeners(self) -> None:
    +        self.event("tokens_revoked")(self.default_tokens_revoked_event_listener())
    +        self.event("app_uninstalled")(self.default_app_uninstalled_event_listener())
    +
    +    # -------------------------
    +
    +    def _init_context(self, req: BoltRequest):
    +        req.context["logger"] = get_bolt_app_logger(
    +            app_name=self.name, base_logger=self._base_logger
    +        )
    +        req.context["token"] = self._token
    +        if self._token is not None:
    +            # This WebClient instance can be safely singleton
    +            req.context["client"] = self._client
    +        else:
    +            # Set a new dedicated instance for this request
    +            client_per_request: WebClient = WebClient(
    +                token=None,  # the token will be set later
    +                base_url=self._client.base_url,
    +                timeout=self._client.timeout,
    +                ssl=self._client.ssl,
    +                proxy=self._client.proxy,
    +                headers=self._client.headers,
    +                team_id=req.context.team_id,
    +            )
    +            req.context["client"] = client_per_request
    +
    +    @staticmethod
    +    def _to_listener_functions(
    +        kwargs: dict,
    +    ) -> Optional[Sequence[Callable[..., Optional[BoltResponse]]]]:
    +        if kwargs:
    +            functions = [kwargs["ack"]]
    +            for sub in kwargs["lazy"]:
    +                functions.append(sub)
    +            return functions
    +        return None
    +
    +    def _register_listener(
    +        self,
    +        functions: Sequence[Callable[..., Optional[BoltResponse]]],
    +        primary_matcher: ListenerMatcher,
    +        matchers: Optional[Sequence[Callable[..., bool]]],
    +        middleware: Optional[Sequence[Union[Callable, Middleware]]],
    +        auto_acknowledgement: bool = False,
    +    ) -> Optional[Callable[..., Optional[BoltResponse]]]:
    +        value_to_return = None
    +        if not isinstance(functions, list):
    +            functions = list(functions)
    +        if len(functions) == 1:
    +            # In the case where the function is registered using decorator,
    +            # the registration should return the original function.
    +            value_to_return = functions[0]
    +
    +        listener_matchers = [
    +            CustomListenerMatcher(
    +                app_name=self.name, func=f, base_logger=self._base_logger
    +            )
    +            for f in (matchers or [])
    +        ]
    +        listener_matchers.insert(0, primary_matcher)
    +        listener_middleware = []
    +        for m in middleware or []:
    +            if isinstance(m, Middleware):
    +                listener_middleware.append(m)
    +            elif isinstance(m, Callable):
    +                listener_middleware.append(
    +                    CustomMiddleware(
    +                        app_name=self.name, func=m, base_logger=self._base_logger
    +                    )
    +                )
    +            else:
    +                raise ValueError(error_unexpected_listener_middleware(type(m)))
    +
    +        self._listeners.append(
    +            CustomListener(
    +                app_name=self.name,
    +                ack_function=functions.pop(0),
    +                lazy_functions=functions,
    +                matchers=listener_matchers,
    +                middleware=listener_middleware,
    +                auto_acknowledgement=auto_acknowledgement,
    +                base_logger=self._base_logger,
    +            )
    +        )
    +        return value_to_return
    +
    +

    Instance variables

    +
    +
    var client : slack_sdk.web.client.WebClient
    +
    +

    The singleton slack_sdk.WebClient instance in this app.

    +
    + +Expand source code + +
    @property
    +def client(self) -> WebClient:
    +    """The singleton `slack_sdk.WebClient` instance in this app."""
    +    return self._client
    +
    +
    +
    var installation_store : Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore]
    +
    +

    The slack_sdk.oauth.InstallationStore that can be used in the authorize middleware.

    +
    + +Expand source code + +
    @property
    +def installation_store(self) -> Optional[InstallationStore]:
    +    """The `slack_sdk.oauth.InstallationStore` that can be used in the `authorize` middleware."""
    +    return self._installation_store
    +
    +
    +
    var listener_runnerThreadListenerRunner
    +
    +

    The thread executor for asynchronously running listeners.

    +
    + +Expand source code + +
    @property
    +def listener_runner(self) -> ThreadListenerRunner:
    +    """The thread executor for asynchronously running listeners."""
    +    return self._listener_runner
    +
    +
    +
    var logger : logging.Logger
    +
    +

    The logger this app uses.

    +
    + +Expand source code + +
    @property
    +def logger(self) -> logging.Logger:
    +    """The logger this app uses."""
    +    return self._framework_logger
    +
    +
    +
    var name : str
    +
    +

    The name of this app (default: the filename)

    +
    + +Expand source code + +
    @property
    +def name(self) -> str:
    +    """The name of this app (default: the filename)"""
    +    return self._name
    +
    +
    +
    var oauth_flow : Optional[OAuthFlow]
    +
    +

    Configured OAuthFlow object if exists.

    +
    + +Expand source code + +
    @property
    +def oauth_flow(self) -> Optional[OAuthFlow]:
    +    """Configured `OAuthFlow` object if exists."""
    +    return self._oauth_flow
    +
    +
    +
    var process_before_response : bool
    +
    +
    +
    + +Expand source code + +
    @property
    +def process_before_response(self) -> bool:
    +    return self._process_before_response or False
    +
    +
    +
    +

    Methods

    +
    +
    +def action(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]] +
    +
    +

    Registers a new action listener. This method can be used as either a decorator or a method.

    +
    # Use this method as a decorator
    +@app.action("approve_button")
    +def update_message(ack):
    +    ack()
    +
    +# Pass a function to this method
    +app.action("approve_button")(update_message)
    +
    + +

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    +

    Args

    +
    +
    constraints
    +
    The conditions that match a request payload
    +
    matchers
    +
    A list of listener matcher functions. +Only when all the matchers return True, the listener function can be invoked.
    +
    middleware
    +
    A list of lister middleware functions. +Only when all the middleware call next() method, the listener function can be invoked.
    +
    +
    + +Expand source code + +
    def action(
    +    self,
    +    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
    +    matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +    """Registers a new action listener. This method can be used as either a decorator or a method.
    +
    +        # Use this method as a decorator
    +        @app.action("approve_button")
    +        def update_message(ack):
    +            ack()
    +
    +        # Pass a function to this method
    +        app.action("approve_button")(update_message)
    +
    +    * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`.
    +    * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`.
    +    * Refer to https://api.slack.com/dialogs for actions in dialogs.
    +
    +    To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document.
    +
    +    Args:
    +        constraints: The conditions that match a request payload
    +        matchers: A list of listener matcher functions.
    +            Only when all the matchers return True, the listener function can be invoked.
    +        middleware: A list of lister middleware functions.
    +            Only when all the middleware call `next()` method, the listener function can be invoked.
    +    """
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.action(
    +            constraints, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def attachment_action(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]] +
    +
    +

    Registers a new interactive_message action listener. +Refer to https://api.slack.com/legacy/message-buttons for details.

    +
    + +Expand source code + +
    def attachment_action(
    +    self,
    +    callback_id: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +    """Registers a new `interactive_message` action listener.
    +    Refer to https://api.slack.com/legacy/message-buttons for details."""
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.attachment_action(
    +            callback_id, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def block_action(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]] +
    +
    +

    Registers a new block_actions action listener. +Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details.

    +
    + +Expand source code + +
    def block_action(
    +    self,
    +    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
    +    matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +    """Registers a new `block_actions` action listener.
    +    Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details.
    +    """
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.block_action(
    +            constraints, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def block_suggestion(self, action_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]] +
    +
    +

    Registers a new block_suggestion listener.

    +
    + +Expand source code + +
    def block_suggestion(
    +    self,
    +    action_id: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +    """Registers a new `block_suggestion` listener."""
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.block_suggestion(
    +            action_id, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def command(self, command: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]] +
    +
    +

    Registers a new slash command listener. +This method can be used as either a decorator or a method.

    +
    # Use this method as a decorator
    +@app.command("/echo")
    +def repeat_text(ack, say, command):
    +    # Acknowledge command request
    +    ack()
    +    say(f"{command['text']}")
    +
    +# Pass a function to this method
    +app.command("/echo")(repeat_text)
    +
    +

    Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands.

    +

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    +

    Args

    +
    +
    command
    +
    The conditions that match a request payload
    +
    matchers
    +
    A list of listener matcher functions. +Only when all the matchers return True, the listener function can be invoked.
    +
    middleware
    +
    A list of lister middleware functions. +Only when all the middleware call next() method, the listener function can be invoked.
    +
    +
    + +Expand source code + +
    def command(
    +    self,
    +    command: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +    """Registers a new slash command listener.
    +    This method can be used as either a decorator or a method.
    +
    +        # Use this method as a decorator
    +        @app.command("/echo")
    +        def repeat_text(ack, say, command):
    +            # Acknowledge command request
    +            ack()
    +            say(f"{command['text']}")
    +
    +        # Pass a function to this method
    +        app.command("/echo")(repeat_text)
    +
    +    Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands.
    +
    +    To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document.
    +
    +    Args:
    +        command: The conditions that match a request payload
    +        matchers: A list of listener matcher functions.
    +            Only when all the matchers return True, the listener function can be invoked.
    +        middleware: A list of lister middleware functions.
    +            Only when all the middleware call `next()` method, the listener function can be invoked.
    +    """
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.command(
    +            command, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def default_app_uninstalled_event_listener(self) ‑> Callable[..., Optional[BoltResponse]] +
    +
    +
    +
    + +Expand source code + +
    def default_app_uninstalled_event_listener(
    +    self,
    +) -> Callable[..., Optional[BoltResponse]]:
    +    if self._tokens_revocation_listeners is None:
    +        raise BoltError(error_installation_store_required_for_builtin_listeners())
    +    return self._tokens_revocation_listeners.handle_app_uninstalled_events
    +
    +
    +
    +def default_tokens_revoked_event_listener(self) ‑> Callable[..., Optional[BoltResponse]] +
    +
    + +Expand source code + +
    def default_tokens_revoked_event_listener(
    +    self,
    +) -> Callable[..., Optional[BoltResponse]]:
    +    if self._tokens_revocation_listeners is None:
    +        raise BoltError(error_installation_store_required_for_builtin_listeners())
    +    return self._tokens_revocation_listeners.handle_tokens_revoked_events
    +
    -
    slack_bolt.app.async_server
    +
    +def dialog_cancellation(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]] +
    +
    +

    Registers a new dialog_cancellation listener. +Refer to https://api.slack.com/dialogs for details.

    +
    + +Expand source code + +
    def dialog_cancellation(
    +    self,
    +    callback_id: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +    """Registers a new `dialog_cancellation` listener.
    +    Refer to https://api.slack.com/dialogs for details."""
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.dialog_cancellation(
    +            callback_id, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def dialog_submission(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]] +
    +
    +

    Registers a new dialog_submission listener. +Refer to https://api.slack.com/dialogs for details.

    +
    + +Expand source code + +
    def dialog_submission(
    +    self,
    +    callback_id: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +    """Registers a new `dialog_submission` listener.
    +    Refer to https://api.slack.com/dialogs for details."""
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.dialog_submission(
    +            callback_id, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def dialog_suggestion(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]] +
    +
    +

    Registers a new dialog_suggestion listener. +Refer to https://api.slack.com/dialogs for details.

    +
    + +Expand source code + +
    def dialog_suggestion(
    +    self,
    +    callback_id: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +    """Registers a new `dialog_suggestion` listener.
    +    Refer to https://api.slack.com/dialogs for details."""
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.dialog_suggestion(
    +            callback_id, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def dispatch(self, req: BoltRequest) ‑> BoltResponse +
    +
    +

    Applies all middleware and dispatches an incoming request from Slack to the right code path.

    +

    Args

    +
    +
    req
    +
    An incoming request from Slack
    +
    +

    Returns

    +

    The response generated by this Bolt app

    +
    + +Expand source code + +
    def dispatch(self, req: BoltRequest) -> BoltResponse:
    +    """Applies all middleware and dispatches an incoming request from Slack to the right code path.
    +
    +    Args:
    +        req: An incoming request from Slack
    +
    +    Returns:
    +        The response generated by this Bolt app
    +    """
    +    starting_time = time.time()
    +    self._init_context(req)
    +
    +    resp: Optional[BoltResponse] = BoltResponse(status=200, body="")
    +    middleware_state = {"next_called": False}
    +
    +    def middleware_next():
    +        middleware_state["next_called"] = True
    +
    +    try:
    +        for middleware in self._middleware_list:
    +            middleware_state["next_called"] = False
    +            if self._framework_logger.level <= logging.DEBUG:
    +                self._framework_logger.debug(
    +                    debug_applying_middleware(middleware.name)
    +                )
    +            resp = middleware.process(req=req, resp=resp, next=middleware_next)
    +            if not middleware_state["next_called"]:
    +                if resp is None:
    +                    # next() method was not called without providing the response to return to Slack
    +                    # This should not be an intentional handling in usual use cases.
    +                    resp = BoltResponse(
    +                        status=404, body={"error": "no next() calls in middleware"}
    +                    )
    +                    if self._raise_error_for_unhandled_request is True:
    +                        self._listener_runner.listener_error_handler.handle(
    +                            error=BoltUnhandledRequestError(
    +                                request=req,
    +                                current_response=resp,
    +                                last_global_middleware_name=middleware.name,
    +                            ),
    +                            request=req,
    +                            response=resp,
    +                        )
    +                        return resp
    +                    self._framework_logger.warning(
    +                        warning_unhandled_by_global_middleware(middleware.name, req)
    +                    )
    +                    return resp
    +                return resp
    +
    +        for listener in self._listeners:
    +            listener_name = get_name_for_callable(listener.ack_function)
    +            self._framework_logger.debug(debug_checking_listener(listener_name))
    +            if listener.matches(req=req, resp=resp):
    +                # run all the middleware attached to this listener first
    +                middleware_resp, next_was_not_called = listener.run_middleware(
    +                    req=req, resp=resp
    +                )
    +                if next_was_not_called:
    +                    if middleware_resp is not None:
    +                        if self._framework_logger.level <= logging.DEBUG:
    +                            debug_message = (
    +                                debug_return_listener_middleware_response(
    +                                    listener_name,
    +                                    middleware_resp.status,
    +                                    middleware_resp.body,
    +                                    starting_time,
    +                                )
    +                            )
    +                            self._framework_logger.debug(debug_message)
    +                        return middleware_resp
    +                    # The last listener middleware didn't call next() method.
    +                    # This means the listener is not for this incoming request.
    +                    continue
    +
    +                if middleware_resp is not None:
    +                    resp = middleware_resp
    +
    +                self._framework_logger.debug(debug_running_listener(listener_name))
    +                listener_response: Optional[
    +                    BoltResponse
    +                ] = self._listener_runner.run(
    +                    request=req,
    +                    response=resp,
    +                    listener_name=listener_name,
    +                    listener=listener,
    +                )
    +                if listener_response is not None:
    +                    return listener_response
    +
    +        if resp is None:
    +            resp = BoltResponse(status=404, body={"error": "unhandled request"})
    +        if self._raise_error_for_unhandled_request is True:
    +            self._listener_runner.listener_error_handler.handle(
    +                error=BoltUnhandledRequestError(
    +                    request=req,
    +                    current_response=resp,
    +                ),
    +                request=req,
    +                response=resp,
    +            )
    +            return resp
    +        return self._handle_unmatched_requests(req, resp)
    +    except Exception as error:
    +        resp = BoltResponse(status=500, body="")
    +        self._middleware_error_handler.handle(
    +            error=error,
    +            request=req,
    +            response=resp,
    +        )
    +        return resp
    +
    +
    +
    +def enable_token_revocation_listeners(self) ‑> None +
    +
    + +Expand source code + +
    def enable_token_revocation_listeners(self) -> None:
    +    self.event("tokens_revoked")(self.default_tokens_revoked_event_listener())
    +    self.event("app_uninstalled")(self.default_app_uninstalled_event_listener())
    +
    +
    +
    +def error(self, func: Callable[..., Optional[BoltResponse]]) ‑> Callable[..., Optional[BoltResponse]] +
    +
    +

    Updates the global error handler. This method can be used as either a decorator or a method.

    +
    # Use this method as a decorator
    +@app.error
    +def custom_error_handler(error, body, logger):
    +    logger.exception(f"Error: {error}")
    +    logger.info(f"Request body: {body}")
    +
    +# Pass a function to this method
    +app.error(custom_error_handler)
    +
    +

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    +

    Args

    +
    +
    func
    +
    The function that is supposed to be executed +when getting an unhandled error in Bolt app.
    +
    +
    + +Expand source code + +
    def error(
    +    self, func: Callable[..., Optional[BoltResponse]]
    +) -> Callable[..., Optional[BoltResponse]]:
    +    """Updates the global error handler. This method can be used as either a decorator or a method.
    +
    +        # Use this method as a decorator
    +        @app.error
    +        def custom_error_handler(error, body, logger):
    +            logger.exception(f"Error: {error}")
    +            logger.info(f"Request body: {body}")
    +
    +        # Pass a function to this method
    +        app.error(custom_error_handler)
    +
    +    To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document.
    +
    +    Args:
    +        func: The function that is supposed to be executed
    +            when getting an unhandled error in Bolt app.
    +    """
    +    self._listener_runner.listener_error_handler = CustomListenerErrorHandler(
    +        logger=self._framework_logger,
    +        func=func,
    +    )
    +    self._middleware_error_handler = CustomMiddlewareErrorHandler(
    +        logger=self._framework_logger,
    +        func=func,
    +    )
    +    return func
    +
    +
    +
    +def event(self, event: Union[str, Pattern, Dict[str, Union[str, Sequence[Union[str, Pattern, ForwardRef(None)]], ForwardRef(None)]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]] +
    +
    +

    Registers a new event listener. This method can be used as either a decorator or a method.

    +
    # Use this method as a decorator
    +@app.event("team_join")
    +def ask_for_introduction(event, say):
    +    welcome_channel_id = "C12345"
    +    user_id = event["user"]
    +    text = f"Welcome to the team, <@{user_id}>! :tada: You can introduce yourself in this channel."
    +    say(text=text, channel=welcome_channel_id)
    +
    +# Pass a function to this method
    +app.event("team_join")(ask_for_introduction)
    +
    +

    Refer to https://api.slack.com/apis/connections/events-api for details of Events API.

    +

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    +

    Args

    +
    +
    event
    +
    The conditions that match a request payload. +If you pass a dict for this, you can have type, subtype in the constraint.
    +
    matchers
    +
    A list of listener matcher functions. +Only when all the matchers return True, the listener function can be invoked.
    +
    middleware
    +
    A list of lister middleware functions. +Only when all the middleware call next() method, the listener function can be invoked.
    +
    +
    + +Expand source code + +
    def event(
    +    self,
    +    event: Union[
    +        str,
    +        Pattern,
    +        Dict[str, Optional[Union[str, Sequence[Optional[Union[str, Pattern]]]]]],
    +    ],
    +    matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +    """Registers a new event listener. This method can be used as either a decorator or a method.
    +
    +        # Use this method as a decorator
    +        @app.event("team_join")
    +        def ask_for_introduction(event, say):
    +            welcome_channel_id = "C12345"
    +            user_id = event["user"]
    +            text = f"Welcome to the team, <@{user_id}>! :tada: You can introduce yourself in this channel."
    +            say(text=text, channel=welcome_channel_id)
    +
    +        # Pass a function to this method
    +        app.event("team_join")(ask_for_introduction)
    +
    +    Refer to https://api.slack.com/apis/connections/events-api for details of Events API.
    +
    +    To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document.
    +
    +    Args:
    +        event: The conditions that match a request payload.
    +            If you pass a dict for this, you can have type, subtype in the constraint.
    +        matchers: A list of listener matcher functions.
    +            Only when all the matchers return True, the listener function can be invoked.
    +        middleware: A list of lister middleware functions.
    +            Only when all the middleware call `next()` method, the listener function can be invoked.
    +    """
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.event(
    +            event, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware, True
    +        )
    +
    +    return __call__
    +
    +
    +
    +def global_shortcut(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]] +
    +
    +

    Registers a new global shortcut listener.

    +
    + +Expand source code + +
    def global_shortcut(
    +    self,
    +    callback_id: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +    """Registers a new global shortcut listener."""
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.global_shortcut(
    +            callback_id, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def message(self, keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]] +
    +
    +

    Registers a new message event listener. This method can be used as either a decorator or a method. +Check the App#event method's docstring for details.

    +
    # Use this method as a decorator
    +@app.message(":wave:")
    +def say_hello(message, say):
    +    user = message['user']
    +    say(f"Hi there, <@{user}>!")
    +
    +# Pass a function to this method
    +app.message(":wave:")(say_hello)
    +
    +

    Refer to https://api.slack.com/events/message for details of message events.

    +

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    +

    Args

    +
    +
    keyword
    +
    The keyword to match
    +
    matchers
    +
    A list of listener matcher functions. +Only when all the matchers return True, the listener function can be invoked.
    +
    middleware
    +
    A list of lister middleware functions. +Only when all the middleware call next() method, the listener function can be invoked.
    +
    +
    + +Expand source code + +
    def message(
    +    self,
    +    keyword: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +    """Registers a new message event listener. This method can be used as either a decorator or a method.
    +    Check the `App#event` method's docstring for details.
    +
    +        # Use this method as a decorator
    +        @app.message(":wave:")
    +        def say_hello(message, say):
    +            user = message['user']
    +            say(f"Hi there, <@{user}>!")
    +
    +        # Pass a function to this method
    +        app.message(":wave:")(say_hello)
    +
    +    Refer to https://api.slack.com/events/message for details of `message` events.
    +
    +    To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document.
    +
    +    Args:
    +        keyword: The keyword to match
    +        matchers: A list of listener matcher functions.
    +            Only when all the matchers return True, the listener function can be invoked.
    +        middleware: A list of lister middleware functions.
    +            Only when all the middleware call `next()` method, the listener function can be invoked.
    +    """
    +    matchers = list(matchers) if matchers else []
    +    middleware = list(middleware) if middleware else []
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        constraints = {
    +            "type": "message",
    +            "subtype": (
    +                # In most cases, new message events come with no subtype.
    +                None,
    +                # As of Jan 2021, most bot messages no longer have the subtype bot_message.
    +                # By contrast, messages posted using classic app's bot token still have the subtype.
    +                "bot_message",
    +                # If an end-user posts a message with "Also send to #channel" checked,
    +                # the message event comes with this subtype.
    +                "thread_broadcast",
    +                # If an end-user posts a message with attached files,
    +                # the message event comes with this subtype.
    +                "file_share",
    +            ),
    +        }
    +        primary_matcher = builtin_matchers.message_event(
    +            keyword=keyword, constraints=constraints, base_logger=self._base_logger
    +        )
    +        middleware.insert(0, MessageListenerMatches(keyword))
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware, True
    +        )
    +
    +    return __call__
    +
    +
    +
    +def message_shortcut(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]] +
    +
    +

    Registers a new message shortcut listener.

    +
    + +Expand source code + +
    def message_shortcut(
    +    self,
    +    callback_id: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +    """Registers a new message shortcut listener."""
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.message_shortcut(
    +            callback_id, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def middleware(self, *args) ‑> Optional[Callable] +
    +
    +

    Registers a new middleware to this app. +This method can be used as either a decorator or a method.

    +
    # Use this method as a decorator
    +@app.middleware
    +def middleware_func(logger, body, next):
    +    logger.info(f"request body: {body}")
    +    next()
    +
    +# Pass a function to this method
    +app.middleware(middleware_func)
    +
    +

    Refer to https://slack.dev/bolt-python/concepts#global-middleware for details.

    +

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    +

    Args

    +
    +
    *args
    +
    A function that works as a global middleware.
    +
    +
    + +Expand source code + +
    def middleware(self, *args) -> Optional[Callable]:
    +    """Registers a new middleware to this app.
    +    This method can be used as either a decorator or a method.
    +
    +        # Use this method as a decorator
    +        @app.middleware
    +        def middleware_func(logger, body, next):
    +            logger.info(f"request body: {body}")
    +            next()
    +
    +        # Pass a function to this method
    +        app.middleware(middleware_func)
    +
    +    Refer to https://slack.dev/bolt-python/concepts#global-middleware for details.
    +
    +    To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document.
    +
    +    Args:
    +        *args: A function that works as a global middleware.
    +    """
    +    if len(args) > 0:
    +        middleware_or_callable = args[0]
    +        if isinstance(middleware_or_callable, Middleware):
    +            middleware: Middleware = middleware_or_callable
    +            self._middleware_list.append(middleware)
    +        elif isinstance(middleware_or_callable, Callable):
    +            self._middleware_list.append(
    +                CustomMiddleware(
    +                    app_name=self.name,
    +                    func=middleware_or_callable,
    +                    base_logger=self._base_logger,
    +                )
    +            )
    +            return middleware_or_callable
    +        else:
    +            raise BoltError(
    +                f"Unexpected type for a middleware ({type(middleware_or_callable)})"
    +            )
    +    return None
    +
    +
    +
    +def options(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]] +
    +
    +

    Registers a new options listener. +This method can be used as either a decorator or a method.

    +
    # Use this method as a decorator
    +@app.options("menu_selection")
    +def show_menu_options(ack):
    +    options = [
    +        {
    +            "text": {"type": "plain_text", "text": "Option 1"},
    +            "value": "1-1",
    +        },
    +        {
    +            "text": {"type": "plain_text", "text": "Option 2"},
    +            "value": "1-2",
    +        },
    +    ]
    +    ack(options=options)
    +
    +# Pass a function to this method
    +app.options("menu_selection")(show_menu_options)
    +
    +

    Refer to the following documents for details:

    + +

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    +

    Args

    +
    +
    matchers
    +
    A list of listener matcher functions. +Only when all the matchers return True, the listener function can be invoked.
    +
    middleware
    +
    A list of lister middleware functions. +Only when all the middleware call next() method, the listener function can be invoked.
    +
    +
    + +Expand source code + +
    def options(
    +    self,
    +    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
    +    matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +    """Registers a new options listener.
    +    This method can be used as either a decorator or a method.
    +
    +        # Use this method as a decorator
    +        @app.options("menu_selection")
    +        def show_menu_options(ack):
    +            options = [
    +                {
    +                    "text": {"type": "plain_text", "text": "Option 1"},
    +                    "value": "1-1",
    +                },
    +                {
    +                    "text": {"type": "plain_text", "text": "Option 2"},
    +                    "value": "1-2",
    +                },
    +            ]
    +            ack(options=options)
    +
    +        # Pass a function to this method
    +        app.options("menu_selection")(show_menu_options)
    +
    +    Refer to the following documents for details:
    +
    +    * https://api.slack.com/reference/block-kit/block-elements#external_select
    +    * https://api.slack.com/reference/block-kit/block-elements#external_multi_select
    +
    +    To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document.
    +
    +    Args:
    +        matchers: A list of listener matcher functions.
    +            Only when all the matchers return True, the listener function can be invoked.
    +        middleware: A list of lister middleware functions.
    +            Only when all the middleware call `next()` method, the listener function can be invoked.
    +    """
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.options(
    +            constraints, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def shortcut(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]] +
    +
    +

    Registers a new shortcut listener. +This method can be used as either a decorator or a method.

    +
    # Use this method as a decorator
    +@app.shortcut("open_modal")
    +def open_modal(ack, body, client):
    +    # Acknowledge the command request
    +    ack()
    +    # Call views_open with the built-in client
    +    client.views_open(
    +        # Pass a valid trigger_id within 3 seconds of receiving it
    +        trigger_id=body["trigger_id"],
    +        # View payload
    +        view={ ... }
    +    )
    +
    +# Pass a function to this method
    +app.shortcut("open_modal")(open_modal)
    +
    +

    Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts.

    +

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    +

    Args

    +
    +
    constraints
    +
    The conditions that match a request payload.
    +
    matchers
    +
    A list of listener matcher functions. +Only when all the matchers return True, the listener function can be invoked.
    +
    middleware
    +
    A list of lister middleware functions. +Only when all the middleware call next() method, the listener function can be invoked.
    +
    +
    + +Expand source code + +
    def shortcut(
    +    self,
    +    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
    +    matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +    """Registers a new shortcut listener.
    +    This method can be used as either a decorator or a method.
    +
    +        # Use this method as a decorator
    +        @app.shortcut("open_modal")
    +        def open_modal(ack, body, client):
    +            # Acknowledge the command request
    +            ack()
    +            # Call views_open with the built-in client
    +            client.views_open(
    +                # Pass a valid trigger_id within 3 seconds of receiving it
    +                trigger_id=body["trigger_id"],
    +                # View payload
    +                view={ ... }
    +            )
    +
    +        # Pass a function to this method
    +        app.shortcut("open_modal")(open_modal)
    +
    +    Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts.
    +
    +    To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document.
    +
    +    Args:
    +        constraints: The conditions that match a request payload.
    +        matchers: A list of listener matcher functions.
    +            Only when all the matchers return True, the listener function can be invoked.
    +        middleware: A list of lister middleware functions.
    +            Only when all the middleware call `next()` method, the listener function can be invoked.
    +    """
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.shortcut(
    +            constraints, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def start(self, port: int = 3000, path: str = '/slack/events', http_server_logger_enabled: bool = True) ‑> None +
    +
    +

    Starts a web server for local development.

    +
    # With the default settings, `http://localhost:3000/slack/events`
    +# is available for handling incoming requests from Slack
    +app.start()
    +
    +

    This method internally starts a Web server process built with the http.server module. +For production, consider using a production-ready WSGI server such as Gunicorn.

    +

    Args

    +
    +
    port
    +
    The port to listen on (Default: 3000)
    +
    path
    +
    The path to handle request from Slack (Default: /slack/events)
    +
    http_server_logger_enabled
    +
    The flag to enable http.server logging if True (Default: True)
    +
    +
    + +Expand source code + +
    def start(
    +    self,
    +    port: int = 3000,
    +    path: str = "/slack/events",
    +    http_server_logger_enabled: bool = True,
    +) -> None:
    +    """Starts a web server for local development.
    +
    +        # With the default settings, `http://localhost:3000/slack/events`
    +        # is available for handling incoming requests from Slack
    +        app.start()
    +
    +    This method internally starts a Web server process built with the `http.server` module.
    +    For production, consider using a production-ready WSGI server such as Gunicorn.
    +
    +    Args:
    +        port: The port to listen on (Default: 3000)
    +        path: The path to handle request from Slack (Default: `/slack/events`)
    +        http_server_logger_enabled: The flag to enable http.server logging if True (Default: True)
    +    """
    +    self._development_server = SlackAppDevelopmentServer(
    +        port=port,
    +        path=path,
    +        app=self,
    +        oauth_flow=self.oauth_flow,
    +        http_server_logger_enabled=http_server_logger_enabled,
    +    )
    +    self._development_server.start()
    +
    +
    +
    +def step(self, callback_id: Union[str, Pattern, WorkflowStepWorkflowStepBuilder], edit: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable], ForwardRef(None)] = None, save: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable], ForwardRef(None)] = None, execute: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable], ForwardRef(None)] = None) +
    +
    +

    Registers a new Workflow Step listener. +Unlike others, this method doesn't behave as a decorator. +If you want to register a workflow step by a decorator, use WorkflowStepBuilder's methods.

    +
    # Create a new WorkflowStep instance
    +from slack_bolt.workflows.step import WorkflowStep
    +ws = WorkflowStep(
    +    callback_id="add_task",
    +    edit=edit,
    +    save=save,
    +    execute=execute,
    +)
    +# Pass Step to set up listeners
    +app.step(ws)
    +
    +

    Refer to https://api.slack.com/workflows/steps for details of Steps from Apps.

    +

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    +

    For further information about WorkflowStep specific function arguments +such as configure, update, complete, and fail, +refer to slack_bolt.workflows.step.utilities API documents.

    +

    Args

    +
    +
    callback_id
    +
    The Callback ID for this workflow step
    +
    edit
    +
    The function for displaying a modal in the Workflow Builder
    +
    save
    +
    The function for handling configuration in the Workflow Builder
    +
    execute
    +
    The function for handling the step execution
    +
    +
    + +Expand source code + +
    def step(
    +    self,
    +    callback_id: Union[str, Pattern, WorkflowStep, WorkflowStepBuilder],
    +    edit: Optional[
    +        Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]]
    +    ] = None,
    +    save: Optional[
    +        Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]]
    +    ] = None,
    +    execute: Optional[
    +        Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]]
    +    ] = None,
    +):
    +    """Registers a new Workflow Step listener.
    +    Unlike others, this method doesn't behave as a decorator.
    +    If you want to register a workflow step by a decorator, use `WorkflowStepBuilder`'s methods.
    +
    +        # Create a new WorkflowStep instance
    +        from slack_bolt.workflows.step import WorkflowStep
    +        ws = WorkflowStep(
    +            callback_id="add_task",
    +            edit=edit,
    +            save=save,
    +            execute=execute,
    +        )
    +        # Pass Step to set up listeners
    +        app.step(ws)
    +
    +    Refer to https://api.slack.com/workflows/steps for details of Steps from Apps.
    +
    +    To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document.
    +
    +    For further information about WorkflowStep specific function arguments
    +    such as `configure`, `update`, `complete`, and `fail`,
    +    refer to `slack_bolt.workflows.step.utilities` API documents.
    +
    +    Args:
    +        callback_id: The Callback ID for this workflow step
    +        edit: The function for displaying a modal in the Workflow Builder
    +        save: The function for handling configuration in the Workflow Builder
    +        execute: The function for handling the step execution
    +    """
    +    step = callback_id
    +    if isinstance(callback_id, (str, Pattern)):
    +        step = WorkflowStep(
    +            callback_id=callback_id,
    +            edit=edit,
    +            save=save,
    +            execute=execute,
    +            base_logger=self._base_logger,
    +        )
    +    elif isinstance(step, WorkflowStepBuilder):
    +        step = step.build(base_logger=self._base_logger)
    +    elif not isinstance(step, WorkflowStep):
    +        raise BoltError(f"Invalid step object ({type(step)})")
    +
    +    self.use(WorkflowStepMiddleware(step, self.listener_runner))
    +
    +
    +
    +def use(self, *args) ‑> Optional[Callable] +
    +
    +

    Registers a new global middleware to this app. This method can be used as either a decorator or a method.

    +

    Refer to App#middleware() method's docstring for details.

    +
    + +Expand source code + +
    def use(self, *args) -> Optional[Callable]:
    +    """Registers a new global middleware to this app. This method can be used as either a decorator or a method.
    +
    +    Refer to `App#middleware()` method's docstring for details."""
    +    return self.middleware(*args)
    +
    +
    +
    +def view(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]] +
    +
    +

    Registers a new view_submission/view_closed event listener. +This method can be used as either a decorator or a method.

    +
    # Use this method as a decorator
    +@app.view("view_1")
    +def handle_submission(ack, body, client, view):
    +    # Assume there's an input block with <code>block\_c</code> as the block_id and <code>dreamy\_input</code>
    +    hopes_and_dreams = view["state"]["values"]["block_c"]["dreamy_input"]
    +    user = body["user"]["id"]
    +    # Validate the inputs
    +    errors = {}
    +    if hopes_and_dreams is not None and len(hopes_and_dreams) <= 5:
    +        errors["block_c"] = "The value must be longer than 5 characters"
    +    if len(errors) > 0:
    +        ack(response_action="errors", errors=errors)
    +        return
    +    # Acknowledge the view_submission event and close the modal
    +    ack()
    +    # Do whatever you want with the input data - here we're saving it to a DB
    +
    +# Pass a function to this method
    +app.view("view_1")(handle_submission)
    +
    +

    Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads.

    +

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    +

    Args

    +
    +
    constraints
    +
    The conditions that match a request payload
    +
    matchers
    +
    A list of listener matcher functions. +Only when all the matchers return True, the listener function can be invoked.
    +
    middleware
    +
    A list of lister middleware functions. +Only when all the middleware call next() method, the listener function can be invoked.
    +
    +
    + +Expand source code + +
    def view(
    +    self,
    +    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
    +    matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +    """Registers a new `view_submission`/`view_closed` event listener.
    +    This method can be used as either a decorator or a method.
    +
    +        # Use this method as a decorator
    +        @app.view("view_1")
    +        def handle_submission(ack, body, client, view):
    +            # Assume there's an input block with `block_c` as the block_id and `dreamy_input`
    +            hopes_and_dreams = view["state"]["values"]["block_c"]["dreamy_input"]
    +            user = body["user"]["id"]
    +            # Validate the inputs
    +            errors = {}
    +            if hopes_and_dreams is not None and len(hopes_and_dreams) <= 5:
    +                errors["block_c"] = "The value must be longer than 5 characters"
    +            if len(errors) > 0:
    +                ack(response_action="errors", errors=errors)
    +                return
    +            # Acknowledge the view_submission event and close the modal
    +            ack()
    +            # Do whatever you want with the input data - here we're saving it to a DB
    +
    +        # Pass a function to this method
    +        app.view("view_1")(handle_submission)
    +
    +    Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads.
    +
    +    To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document.
    +
    +    Args:
    +        constraints: The conditions that match a request payload
    +        matchers: A list of listener matcher functions.
    +            Only when all the matchers return True, the listener function can be invoked.
    +        middleware: A list of lister middleware functions.
    +            Only when all the middleware call `next()` method, the listener function can be invoked.
    +    """
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.view(
    +            constraints, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def view_closed(self, constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]] +
    +
    +

    Registers a new view_closed listener. +Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.

    +
    + +Expand source code + +
    def view_closed(
    +    self,
    +    constraints: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +    """Registers a new `view_closed` listener.
    +    Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details."""
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.view_closed(
    +            constraints, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def view_submission(self, constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]] +
    +
    +

    Registers a new view_submission listener. +Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.

    +
    + +Expand source code + +
    def view_submission(
    +    self,
    +    constraints: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., bool]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    +    """Registers a new `view_submission` listener.
    +    Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details."""
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.view_submission(
    +            constraints, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    -
    -
    -
    -
    -
    -
    diff --git a/docs/api-docs/slack_bolt/async_app.html b/docs/api-docs/slack_bolt/async_app.html index b31814f92..22ac929f6 100644 --- a/docs/api-docs/slack_bolt/async_app.html +++ b/docs/api-docs/slack_bolt/async_app.html @@ -24,7 +24,7 @@

    Module slack_bolt.async_app

    Module for creating asyncio based apps

    Creating an async app

    -

    If you'd prefer to build your app with asyncio, you can import the AIOHTTP library and call the AsyncApp constructor. Within async apps, you can use the async/await pattern.

    +

    If you'd prefer to build your app with asyncio, you can import the AIOHTTP library and call the AsyncApp constructor. Within async apps, you can use the async/await pattern.

    # Python 3.6+ required
     python -m venv .venv
     source .venv/bin/activate
    @@ -109,23 +109,4072 @@ 

    Creating an async app

    Refer to `slack_bolt.app.async_app` for more details. """ # noqa: E501 -from .app.async_app import AsyncApp # noqa -from .context.ack.async_ack import AsyncAck # noqa -from .context.async_context import AsyncBoltContext # noqa -from .context.respond.async_respond import AsyncRespond # noqa -from .context.say.async_say import AsyncSay # noqa -from .listener.async_listener import AsyncListener # noqa -from .listener_matcher.async_listener_matcher import AsyncCustomListenerMatcher # noqa -from .request.async_request import AsyncBoltRequest # noqa
    +from .app.async_app import AsyncApp +from .context.ack.async_ack import AsyncAck +from .context.async_context import AsyncBoltContext +from .context.respond.async_respond import AsyncRespond +from .context.say.async_say import AsyncSay +from .listener.async_listener import AsyncListener +from .listener_matcher.async_listener_matcher import AsyncCustomListenerMatcher +from .request.async_request import AsyncBoltRequest + +__all__ = [ + "AsyncApp", + "AsyncAck", + "AsyncBoltContext", + "AsyncRespond", + "AsyncSay", + "AsyncListener", + "AsyncCustomListenerMatcher", + "AsyncBoltRequest", +] + +
    +
    +
    +
    +
    +
    +
    +
    +

    Classes

    +
    +
    +class AsyncAck +
    +
    +
    +
    + +Expand source code + +
    class AsyncAck:
    +    response: Optional[BoltResponse]
    +
    +    def __init__(self):
    +        self.response: Optional[BoltResponse] = None
    +
    +    async def __call__(
    +        self,
    +        text: Union[str, dict] = "",  # text: str or whole_response: dict
    +        blocks: Optional[Sequence[Union[dict, Block]]] = None,
    +        attachments: Optional[Sequence[Union[dict, Attachment]]] = None,
    +        unfurl_links: Optional[bool] = None,
    +        unfurl_media: Optional[bool] = None,
    +        response_type: Optional[str] = None,  # in_channel / ephemeral
    +        # block_suggestion / dialog_suggestion
    +        options: Optional[Sequence[Union[dict, Option]]] = None,
    +        option_groups: Optional[Sequence[Union[dict, OptionGroup]]] = None,
    +        # view_submission
    +        response_action: Optional[str] = None,  # errors / update / push / clear
    +        errors: Optional[Dict[str, str]] = None,
    +        view: Optional[Union[dict, View]] = None,
    +    ) -> BoltResponse:
    +        return _set_response(
    +            self,
    +            text_or_whole_response=text,
    +            blocks=blocks,
    +            attachments=attachments,
    +            unfurl_links=unfurl_links,
    +            unfurl_media=unfurl_media,
    +            response_type=response_type,
    +            options=options,
    +            option_groups=option_groups,
    +            response_action=response_action,
    +            errors=errors,
    +            view=view,
    +        )
    +
    +

    Class variables

    +
    +
    var response : Optional[BoltResponse]
    +
    +
    +
    +
    +
    +
    +class AsyncApp +(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, client: Optional[slack_sdk.web.async_client.AsyncWebClient] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[AsyncOAuthSettings] = None, oauth_flow: Optional[AsyncOAuthFlow] = None, verification_token: Optional[str] = None) +
    +
    +

    Bolt App that provides functionalities to register middleware/listeners.

    +
    import os
    +from slack_bolt.async_app import AsyncApp
    +
    +# Initializes your app with your bot token and signing secret
    +app = AsyncApp(
    +    token=os.environ.get("SLACK_BOT_TOKEN"),
    +    signing_secret=os.environ.get("SLACK_SIGNING_SECRET")
    +)
    +
    +# Listens to incoming messages that contain "hello"
    +@app.message("hello")
    +async def message_hello(message, say):  # async function
    +    # say() sends a message to the channel where the event was triggered
    +    await say(f"Hey there <@{message['user']}>!")
    +
    +# Start your app
    +if __name__ == "__main__":
    +    app.start(port=int(os.environ.get("PORT", 3000)))
    +
    +

    Refer to https://slack.dev/bolt-python/concepts#async for details.

    +

    If you would like to build an OAuth app for enabling the app to run with multiple workspaces, +refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app.

    +

    Args

    +
    +
    logger
    +
    The custom logger that can be used in this app.
    +
    name
    +
    The application name that will be used in logging. If absent, the source file name will be used.
    +
    process_before_response
    +
    True if this app runs on Function as a Service. (Default: False)
    +
    raise_error_for_unhandled_request
    +
    True if you want to raise exceptions for unhandled requests +and use @app.error listeners instead of +the built-in handler, which pints warning logs and returns 404 to Slack (Default: False)
    +
    signing_secret
    +
    The Signing Secret value used for verifying requests from Slack.
    +
    token
    +
    The bot/user access token required only for single-workspace app.
    +
    client
    +
    The singleton slack_sdk.web.async_client.AsyncWebClient instance for this app.
    +
    authorize
    +
    The function to authorize an incoming request from Slack +by checking if there is a team/user in the installation data.
    +
    installation_store
    +
    The module offering save/find operations of installation data
    +
    installation_store_bot_only
    +
    Use AsyncInstallationStore#async_find_bot() if True (Default: False)
    +
    request_verification_enabled
    +
    False if you would like to disable the built-in middleware (Default: True). +AsyncRequestVerification is a built-in middleware that verifies the signature in HTTP Mode requests. +Make sure if it's safe enough when you turn a built-in middleware off. +We strongly recommend using RequestVerification for better security. +If you have a proxy that verifies request signature in front of the Bolt app, +it's totally fine to disable RequestVerification to avoid duplication of work. +Don't turn it off just for easiness of development.
    +
    ignoring_self_events_enabled
    +
    False if you would like to disable the built-in middleware (Default: True). +AsyncIgnoringSelfEvents is a built-in middleware that enables Bolt apps to easily skip the events +generated by this app's bot user (this is useful for avoiding code error causing an infinite loop).
    +
    url_verification_enabled
    +
    False if you would like to disable the built-in middleware (Default: True). +AsyncUrlVerification is a built-in middleware that handles url_verification requests +that verify the endpoint for Events API in HTTP Mode requests.
    +
    ssl_check_enabled
    +
    bool = False if you would like to disable the built-in middleware (Default: True). +AsyncSslCheck is a built-in middleware that handles ssl_check requests from Slack.
    +
    oauth_settings
    +
    The settings related to Slack app installation flow (OAuth flow)
    +
    oauth_flow
    +
    Instantiated slack_bolt.oauth.AsyncOAuthFlow. This is always prioritized over oauth_settings.
    +
    verification_token
    +
    Deprecated verification mechanism. This can used only for ssl_check requests.
    +
    +
    + +Expand source code + +
    class AsyncApp:
    +    def __init__(
    +        self,
    +        *,
    +        logger: Optional[logging.Logger] = None,
    +        # Used in logger
    +        name: Optional[str] = None,
    +        # Set True when you run this app on a FaaS platform
    +        process_before_response: bool = False,
    +        # Set True if you want to handle an unhandled request as an exception
    +        raise_error_for_unhandled_request: bool = False,
    +        # Basic Information > Credentials > Signing Secret
    +        signing_secret: Optional[str] = None,
    +        # for single-workspace apps
    +        token: Optional[str] = None,
    +        client: Optional[AsyncWebClient] = None,
    +        # for multi-workspace apps
    +        authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None,
    +        installation_store: Optional[AsyncInstallationStore] = None,
    +        # for either only bot scope usage or v1.0.x compatibility
    +        installation_store_bot_only: Optional[bool] = None,
    +        # for customizing the built-in middleware
    +        request_verification_enabled: bool = True,
    +        ignoring_self_events_enabled: bool = True,
    +        ssl_check_enabled: bool = True,
    +        url_verification_enabled: bool = True,
    +        # for the OAuth flow
    +        oauth_settings: Optional[AsyncOAuthSettings] = None,
    +        oauth_flow: Optional[AsyncOAuthFlow] = None,
    +        # No need to set (the value is used only in response to ssl_check requests)
    +        verification_token: Optional[str] = None,
    +    ):
    +        """Bolt App that provides functionalities to register middleware/listeners.
    +
    +            import os
    +            from slack_bolt.async_app import AsyncApp
    +
    +            # Initializes your app with your bot token and signing secret
    +            app = AsyncApp(
    +                token=os.environ.get("SLACK_BOT_TOKEN"),
    +                signing_secret=os.environ.get("SLACK_SIGNING_SECRET")
    +            )
    +
    +            # Listens to incoming messages that contain "hello"
    +            @app.message("hello")
    +            async def message_hello(message, say):  # async function
    +                # say() sends a message to the channel where the event was triggered
    +                await say(f"Hey there <@{message['user']}>!")
    +
    +            # Start your app
    +            if __name__ == "__main__":
    +                app.start(port=int(os.environ.get("PORT", 3000)))
    +
    +        Refer to https://slack.dev/bolt-python/concepts#async for details.
    +
    +        If you would like to build an OAuth app for enabling the app to run with multiple workspaces,
    +        refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app.
    +
    +        Args:
    +            logger: The custom logger that can be used in this app.
    +            name: The application name that will be used in logging. If absent, the source file name will be used.
    +            process_before_response: True if this app runs on Function as a Service. (Default: False)
    +            raise_error_for_unhandled_request: True if you want to raise exceptions for unhandled requests
    +                and use @app.error listeners instead of
    +                the built-in handler, which pints warning logs and returns 404 to Slack (Default: False)
    +            signing_secret: The Signing Secret value used for verifying requests from Slack.
    +            token: The bot/user access token required only for single-workspace app.
    +            client: The singleton `slack_sdk.web.async_client.AsyncWebClient` instance for this app.
    +            authorize: The function to authorize an incoming request from Slack
    +                by checking if there is a team/user in the installation data.
    +            installation_store: The module offering save/find operations of installation data
    +            installation_store_bot_only: Use `AsyncInstallationStore#async_find_bot()` if True (Default: False)
    +            request_verification_enabled: False if you would like to disable the built-in middleware (Default: True).
    +                `AsyncRequestVerification` is a built-in middleware that verifies the signature in HTTP Mode requests.
    +                Make sure if it's safe enough when you turn a built-in middleware off.
    +                We strongly recommend using RequestVerification for better security.
    +                If you have a proxy that verifies request signature in front of the Bolt app,
    +                it's totally fine to disable RequestVerification to avoid duplication of work.
    +                Don't turn it off just for easiness of development.
    +            ignoring_self_events_enabled: False if you would like to disable the built-in middleware (Default: True).
    +                `AsyncIgnoringSelfEvents` is a built-in middleware that enables Bolt apps to easily skip the events
    +                generated by this app's bot user (this is useful for avoiding code error causing an infinite loop).
    +            url_verification_enabled: False if you would like to disable the built-in middleware (Default: True).
    +                `AsyncUrlVerification` is a built-in middleware that handles url_verification requests
    +                that verify the endpoint for Events API in HTTP Mode requests.
    +            ssl_check_enabled: bool = False if you would like to disable the built-in middleware (Default: True).
    +                `AsyncSslCheck` is a built-in middleware that handles ssl_check requests from Slack.
    +            oauth_settings: The settings related to Slack app installation flow (OAuth flow)
    +            oauth_flow: Instantiated `slack_bolt.oauth.AsyncOAuthFlow`. This is always prioritized over oauth_settings.
    +            verification_token: Deprecated verification mechanism. This can used only for ssl_check requests.
    +        """
    +        signing_secret = signing_secret or os.environ.get("SLACK_SIGNING_SECRET", "")
    +        token = token or os.environ.get("SLACK_BOT_TOKEN")
    +
    +        self._name: str = name or inspect.stack()[1].filename.split(os.path.sep)[-1]
    +        self._signing_secret: str = signing_secret
    +        self._verification_token: Optional[str] = verification_token or os.environ.get(
    +            "SLACK_VERIFICATION_TOKEN", None
    +        )
    +        # If a logger is explicitly passed when initializing, the logger works as the base logger.
    +        # The base logger's logging settings will be propagated to all the loggers created by bolt-python.
    +        self._base_logger = logger
    +        # The framework logger is supposed to be used for the internal logging.
    +        # Also, it's accessible via `app.logger` as the app's singleton logger.
    +        self._framework_logger = logger or get_bolt_logger(AsyncApp)
    +        self._raise_error_for_unhandled_request = raise_error_for_unhandled_request
    +
    +        self._token: Optional[str] = token
    +
    +        if client is not None:
    +            if not isinstance(client, AsyncWebClient):
    +                raise BoltError(error_client_invalid_type_async())
    +            self._async_client = client
    +            self._token = client.token
    +            if token is not None:
    +                self._framework_logger.warning(
    +                    warning_client_prioritized_and_token_skipped()
    +                )
    +        else:
    +            self._async_client = create_async_web_client(
    +                # NOTE: the token here can be None
    +                token=token,
    +                logger=self._framework_logger,
    +            )
    +
    +        # --------------------------------------
    +        # Authorize & OAuthFlow initialization
    +        # --------------------------------------
    +
    +        self._async_authorize: Optional[AsyncAuthorize] = None
    +        if authorize is not None:
    +            if oauth_settings is not None or oauth_flow is not None:
    +                raise BoltError(error_authorize_conflicts())
    +
    +            self._async_authorize = AsyncCallableAuthorize(
    +                logger=self._framework_logger, func=authorize
    +            )
    +
    +        self._async_installation_store: Optional[
    +            AsyncInstallationStore
    +        ] = installation_store
    +        if self._async_installation_store is not None and self._async_authorize is None:
    +            settings = oauth_flow.settings if oauth_flow is not None else oauth_settings
    +            self._async_authorize = AsyncInstallationStoreAuthorize(
    +                installation_store=self._async_installation_store,
    +                client_id=settings.client_id if settings is not None else None,
    +                client_secret=settings.client_secret if settings is not None else None,
    +                logger=self._framework_logger,
    +                bot_only=installation_store_bot_only,
    +                client=self._async_client,  # for proxy use cases etc.
    +            )
    +
    +        self._async_oauth_flow: Optional[AsyncOAuthFlow] = None
    +
    +        if (
    +            oauth_settings is None
    +            and os.environ.get("SLACK_CLIENT_ID") is not None
    +            and os.environ.get("SLACK_CLIENT_SECRET") is not None
    +        ):
    +            # initialize with the default settings
    +            oauth_settings = AsyncOAuthSettings()
    +
    +            if oauth_flow is None and installation_store is None:
    +                # show info-level log for avoiding confusions
    +                self._framework_logger.info(info_default_oauth_settings_loaded())
    +
    +        if oauth_flow:
    +            if not isinstance(oauth_flow, AsyncOAuthFlow):
    +                raise BoltError(error_oauth_flow_invalid_type_async())
    +
    +            self._async_oauth_flow = oauth_flow
    +            installation_store = select_consistent_installation_store(
    +                client_id=self._async_oauth_flow.client_id,
    +                app_store=self._async_installation_store,
    +                oauth_flow_store=self._async_oauth_flow.settings.installation_store,
    +                logger=self._framework_logger,
    +            )
    +            self._async_installation_store = installation_store
    +            self._async_oauth_flow.settings.installation_store = installation_store
    +
    +            if self._async_oauth_flow._async_client is None:
    +                self._async_oauth_flow._async_client = self._async_client
    +            if self._async_authorize is None:
    +                self._async_authorize = self._async_oauth_flow.settings.authorize
    +        elif oauth_settings is not None:
    +            if not isinstance(oauth_settings, AsyncOAuthSettings):
    +                raise BoltError(error_oauth_settings_invalid_type_async())
    +
    +            installation_store = select_consistent_installation_store(
    +                client_id=oauth_settings.client_id,
    +                app_store=self._async_installation_store,
    +                oauth_flow_store=oauth_settings.installation_store,
    +                logger=self._framework_logger,
    +            )
    +            self._async_installation_store = installation_store
    +            oauth_settings.installation_store = installation_store
    +
    +            self._async_oauth_flow = AsyncOAuthFlow(
    +                client=self._async_client, logger=self.logger, settings=oauth_settings
    +            )
    +            if self._async_authorize is None:
    +                self._async_authorize = self._async_oauth_flow.settings.authorize
    +            self._async_authorize.token_rotation_expiration_minutes = (
    +                oauth_settings.token_rotation_expiration_minutes
    +            )
    +
    +        if (
    +            self._async_installation_store is not None
    +            or self._async_authorize is not None
    +        ) and self._token is not None:
    +            self._token = None
    +            self._framework_logger.warning(warning_token_skipped())
    +
    +        # after setting bot_only here, __init__ cannot replace authorize function
    +        if (
    +            installation_store_bot_only is not None
    +            and self._async_oauth_flow is not None
    +        ):
    +            app_bot_only = installation_store_bot_only or False
    +            oauth_flow_bot_only = (
    +                self._async_oauth_flow.settings.installation_store_bot_only
    +            )
    +            if app_bot_only != oauth_flow_bot_only:
    +                self.logger.warning(warning_bot_only_conflicts())
    +                self._async_oauth_flow.settings.installation_store_bot_only = (
    +                    app_bot_only
    +                )
    +                self._async_authorize.bot_only = app_bot_only
    +
    +        self._async_tokens_revocation_listeners: Optional[
    +            AsyncTokenRevocationListeners
    +        ] = None
    +        if self._async_installation_store is not None:
    +            self._async_tokens_revocation_listeners = AsyncTokenRevocationListeners(
    +                self._async_installation_store
    +            )
    +
    +        # --------------------------------------
    +        # Middleware Initialization
    +        # --------------------------------------
    +
    +        self._async_middleware_list: List[AsyncMiddleware] = []
    +        self._async_listeners: List[AsyncListener] = []
    +
    +        self._process_before_response = process_before_response
    +        self._async_listener_runner = AsyncioListenerRunner(
    +            logger=self._framework_logger,
    +            process_before_response=process_before_response,
    +            listener_error_handler=AsyncDefaultListenerErrorHandler(
    +                logger=self._framework_logger
    +            ),
    +            listener_start_handler=AsyncDefaultListenerStartHandler(
    +                logger=self._framework_logger
    +            ),
    +            listener_completion_handler=AsyncDefaultListenerCompletionHandler(
    +                logger=self._framework_logger
    +            ),
    +            lazy_listener_runner=AsyncioLazyListenerRunner(
    +                logger=self._framework_logger,
    +            ),
    +        )
    +        self._async_middleware_error_handler = AsyncDefaultMiddlewareErrorHandler(
    +            logger=self._framework_logger,
    +        )
    +
    +        self._init_middleware_list_done = False
    +        self._init_async_middleware_list(
    +            request_verification_enabled=request_verification_enabled,
    +            ignoring_self_events_enabled=ignoring_self_events_enabled,
    +            ssl_check_enabled=ssl_check_enabled,
    +            url_verification_enabled=url_verification_enabled,
    +        )
    +
    +        self._server: Optional[AsyncSlackAppServer] = None
    +
    +    def _init_async_middleware_list(
    +        self,
    +        request_verification_enabled: bool = True,
    +        ignoring_self_events_enabled: bool = True,
    +        ssl_check_enabled: bool = True,
    +        url_verification_enabled: bool = True,
    +    ):
    +        if self._init_middleware_list_done:
    +            return
    +        if ssl_check_enabled is True:
    +            self._async_middleware_list.append(
    +                AsyncSslCheck(
    +                    verification_token=self._verification_token,
    +                    base_logger=self._base_logger,
    +                )
    +            )
    +        if request_verification_enabled is True:
    +            self._async_middleware_list.append(
    +                AsyncRequestVerification(
    +                    self._signing_secret, base_logger=self._base_logger
    +                )
    +            )
    +        # As authorize is required for making a Bolt app function, we don't offer the flag to disable this
    +        if self._async_oauth_flow is None:
    +            if self._token:
    +                self._async_middleware_list.append(
    +                    AsyncSingleTeamAuthorization(base_logger=self._base_logger)
    +                )
    +            elif self._async_authorize is not None:
    +                self._async_middleware_list.append(
    +                    AsyncMultiTeamsAuthorization(
    +                        authorize=self._async_authorize, base_logger=self._base_logger
    +                    )
    +                )
    +            else:
    +                raise BoltError(error_token_required())
    +        else:
    +            self._async_middleware_list.append(
    +                AsyncMultiTeamsAuthorization(
    +                    authorize=self._async_authorize, base_logger=self._base_logger
    +                )
    +            )
    +
    +        if ignoring_self_events_enabled is True:
    +            self._async_middleware_list.append(
    +                AsyncIgnoringSelfEvents(base_logger=self._base_logger)
    +            )
    +        if url_verification_enabled is True:
    +            self._async_middleware_list.append(
    +                AsyncUrlVerification(base_logger=self._base_logger)
    +            )
    +        self._init_middleware_list_done = True
    +
    +    # -------------------------
    +    # accessors
    +
    +    @property
    +    def name(self) -> str:
    +        """The name of this app (default: the filename)"""
    +        return self._name
    +
    +    @property
    +    def oauth_flow(self) -> Optional[AsyncOAuthFlow]:
    +        """Configured `OAuthFlow` object if exists."""
    +        return self._async_oauth_flow
    +
    +    @property
    +    def client(self) -> AsyncWebClient:
    +        """The singleton `slack_sdk.web.async_client.AsyncWebClient` instance in this app."""
    +        return self._async_client
    +
    +    @property
    +    def logger(self) -> logging.Logger:
    +        """The logger this app uses."""
    +        return self._framework_logger
    +
    +    @property
    +    def installation_store(self) -> Optional[AsyncInstallationStore]:
    +        """The `slack_sdk.oauth.AsyncInstallationStore` that can be used in the `authorize` middleware."""
    +        return self._async_installation_store
    +
    +    @property
    +    def listener_runner(self) -> AsyncioListenerRunner:
    +        """The asyncio-based executor for asynchronously running listeners."""
    +        return self._async_listener_runner
    +
    +    @property
    +    def process_before_response(self) -> bool:
    +        return self._process_before_response or False
    +
    +    # -------------------------
    +    # standalone server
    +
    +    from .async_server import AsyncSlackAppServer
    +
    +    def server(
    +        self,
    +        port: int = 3000,
    +        path: str = "/slack/events",
    +        host: Optional[str] = None,
    +    ) -> AsyncSlackAppServer:
    +        """Configure a web server using AIOHTTP.
    +        Refer to https://docs.aiohttp.org/ for more details about AIOHTTP.
    +
    +        Args:
    +            port: The port to listen on (Default: 3000)
    +            path: The path to handle request from Slack (Default: `/slack/events`)
    +            host: The hostname to serve the web endpoints. (Default: 0.0.0.0)
    +        """
    +        if (
    +            self._server is None
    +            or self._server.port != port
    +            or self._server.path != path
    +        ):
    +            self._server = AsyncSlackAppServer(
    +                port=port,
    +                path=path,
    +                app=self,
    +                host=host,
    +            )
    +        return self._server
    +
    +    def web_app(self, path: str = "/slack/events") -> web.Application:
    +        """Returns a `web.Application` instance for aiohttp-devtools users.
    +
    +            from slack_bolt.async_app import AsyncApp
    +            app = AsyncApp()
    +
    +            @app.event("app_mention")
    +            async def event_test(body, say, logger):
    +                logger.info(body)
    +                await say("What's up?")
    +
    +            def app_factory():
    +                return app.web_app()
    +
    +            # adev runserver --port 3000 --app-factory app_factory async_app.py
    +
    +        Args:
    +            path: The path to receive incoming requests from Slack
    +        """
    +        return self.server(path=path).web_app
    +
    +    def start(
    +        self, port: int = 3000, path: str = "/slack/events", host: Optional[str] = None
    +    ) -> None:
    +        """Start a web server using AIOHTTP.
    +        Refer to https://docs.aiohttp.org/ for more details about AIOHTTP.
    +
    +        Args:
    +            port: The port to listen on (Default: 3000)
    +            path: The path to handle request from Slack (Default: `/slack/events`)
    +            host: The hostname to serve the web endpoints. (Default: 0.0.0.0)
    +        """
    +        self.server(port=port, path=path, host=host).start()
    +
    +    # -------------------------
    +    # main dispatcher
    +
    +    async def async_dispatch(self, req: AsyncBoltRequest) -> BoltResponse:
    +        """Applies all middleware and dispatches an incoming request from Slack to the right code path.
    +
    +        Args:
    +            req: An incoming request from Slack.
    +
    +        Returns:
    +            The response generated by this Bolt app.
    +        """
    +        starting_time = time.time()
    +        self._init_context(req)
    +
    +        resp: Optional[BoltResponse] = BoltResponse(status=200, body="")
    +        middleware_state = {"next_called": False}
    +
    +        async def async_middleware_next():
    +            middleware_state["next_called"] = True
    +
    +        try:
    +            for middleware in self._async_middleware_list:
    +                middleware_state["next_called"] = False
    +                if self._framework_logger.level <= logging.DEBUG:
    +                    self._framework_logger.debug(f"Applying {middleware.name}")
    +                resp = await middleware.async_process(
    +                    req=req, resp=resp, next=async_middleware_next
    +                )
    +                if not middleware_state["next_called"]:
    +                    if resp is None:
    +                        # next() method was not called without providing the response to return to Slack
    +                        # This should not be an intentional handling in usual use cases.
    +                        resp = BoltResponse(
    +                            status=404, body={"error": "no next() calls in middleware"}
    +                        )
    +                        if self._raise_error_for_unhandled_request is True:
    +                            await self._async_listener_runner.listener_error_handler.handle(
    +                                error=BoltUnhandledRequestError(
    +                                    request=req,
    +                                    current_response=resp,
    +                                    last_global_middleware_name=middleware.name,
    +                                ),
    +                                request=req,
    +                                response=resp,
    +                            )
    +                            return resp
    +                        self._framework_logger.warning(
    +                            warning_unhandled_by_global_middleware(middleware.name, req)
    +                        )
    +                        return resp
    +                    return resp
    +
    +            for listener in self._async_listeners:
    +                listener_name = get_name_for_callable(listener.ack_function)
    +                self._framework_logger.debug(debug_checking_listener(listener_name))
    +                if await listener.async_matches(req=req, resp=resp):
    +                    # run all the middleware attached to this listener first
    +                    (
    +                        middleware_resp,
    +                        next_was_not_called,
    +                    ) = await listener.run_async_middleware(req=req, resp=resp)
    +                    if next_was_not_called:
    +                        if middleware_resp is not None:
    +                            if self._framework_logger.level <= logging.DEBUG:
    +                                debug_message = (
    +                                    debug_return_listener_middleware_response(
    +                                        listener_name,
    +                                        middleware_resp.status,
    +                                        middleware_resp.body,
    +                                        starting_time,
    +                                    )
    +                                )
    +                                self._framework_logger.debug(debug_message)
    +                            return middleware_resp
    +                        # The last listener middleware didn't call next() method.
    +                        # This means the listener is not for this incoming request.
    +                        continue
    +
    +                    if middleware_resp is not None:
    +                        resp = middleware_resp
    +
    +                    self._framework_logger.debug(debug_running_listener(listener_name))
    +                    listener_response: Optional[
    +                        BoltResponse
    +                    ] = await self._async_listener_runner.run(
    +                        request=req,
    +                        response=resp,
    +                        listener_name=listener_name,
    +                        listener=listener,
    +                    )
    +                    if listener_response is not None:
    +                        return listener_response
    +
    +            if resp is None:
    +                resp = BoltResponse(status=404, body={"error": "unhandled request"})
    +            if self._raise_error_for_unhandled_request is True:
    +                await self._async_listener_runner.listener_error_handler.handle(
    +                    error=BoltUnhandledRequestError(
    +                        request=req,
    +                        current_response=resp,
    +                    ),
    +                    request=req,
    +                    response=resp,
    +                )
    +                return resp
    +            return self._handle_unmatched_requests(req, resp)
    +
    +        except Exception as error:
    +            resp = BoltResponse(status=500, body="")
    +            await self._async_middleware_error_handler.handle(
    +                error=error,
    +                request=req,
    +                response=resp,
    +            )
    +            return resp
    +
    +    def _handle_unmatched_requests(
    +        self, req: AsyncBoltRequest, resp: BoltResponse
    +    ) -> BoltResponse:
    +        self._framework_logger.warning(warning_unhandled_request(req))
    +        return resp
    +
    +    # -------------------------
    +    # middleware
    +
    +    def use(self, *args) -> Optional[Callable]:
    +        """Refer to `AsyncApp#middleware()` method's docstring for details."""
    +        return self.middleware(*args)
    +
    +    def middleware(self, *args) -> Optional[Callable]:
    +        """Registers a new middleware to this app.
    +        This method can be used as either a decorator or a method.
    +
    +            # Use this method as a decorator
    +            @app.middleware
    +            async def middleware_func(logger, body, next):
    +                logger.info(f"request body: {body}")
    +                await next()
    +
    +            # Pass a function to this method
    +            app.middleware(middleware_func)
    +
    +        To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document.
    +
    +        Args:
    +            *args: A function that works as a global middleware.
    +        """
    +        if len(args) > 0:
    +            middleware_or_callable = args[0]
    +            if isinstance(middleware_or_callable, AsyncMiddleware):
    +                middleware: AsyncMiddleware = middleware_or_callable
    +                self._async_middleware_list.append(middleware)
    +            elif isinstance(middleware_or_callable, Callable):
    +                self._async_middleware_list.append(
    +                    AsyncCustomMiddleware(
    +                        app_name=self.name,
    +                        func=middleware_or_callable,
    +                        base_logger=self._base_logger,
    +                    )
    +                )
    +                return middleware_or_callable
    +            else:
    +                raise BoltError(
    +                    f"Unexpected type for a middleware ({type(middleware_or_callable)})"
    +                )
    +        return None
    +
    +    # -------------------------
    +    # Workflows: Steps from Apps
    +
    +    def step(
    +        self,
    +        callback_id: Union[str, Pattern, AsyncWorkflowStep, AsyncWorkflowStepBuilder],
    +        edit: Optional[
    +            Union[
    +                Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable]
    +            ]
    +        ] = None,
    +        save: Optional[
    +            Union[
    +                Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable]
    +            ]
    +        ] = None,
    +        execute: Optional[
    +            Union[
    +                Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable]
    +            ]
    +        ] = None,
    +    ):
    +        """
    +        Registers a new Workflow Step listener.
    +        Unlike others, this method doesn't behave as a decorator.
    +        If you want to register a workflow step by a decorator, use `AsyncWorkflowStepBuilder`'s methods.
    +
    +            # Create a new WorkflowStep instance
    +            from slack_bolt.workflows.async_step import AsyncWorkflowStep
    +            ws = AsyncWorkflowStep(
    +                callback_id="add_task",
    +                edit=edit,
    +                save=save,
    +                execute=execute,
    +            )
    +            # Pass Step to set up listeners
    +            app.step(ws)
    +
    +        Refer to https://api.slack.com/workflows/steps for details of Steps from Apps.
    +
    +        To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document.
    +        For further information about AsyncWorkflowStep specific function arguments
    +        such as `configure`, `update`, `complete`, and `fail`,
    +        refer to the `async` prefixed ones in `slack_bolt.workflows.step.utilities` API documents.
    +
    +        Args:
    +            callback_id: The Callback ID for this workflow step
    +            edit: The function for displaying a modal in the Workflow Builder
    +            save: The function for handling configuration in the Workflow Builder
    +            execute: The function for handling the step execution
    +        """
    +        step = callback_id
    +        if isinstance(callback_id, (str, Pattern)):
    +            step = AsyncWorkflowStep(
    +                callback_id=callback_id,
    +                edit=edit,
    +                save=save,
    +                execute=execute,
    +                base_logger=self._base_logger,
    +            )
    +        elif isinstance(step, AsyncWorkflowStepBuilder):
    +            step = step.build(base_logger=self._base_logger)
    +        elif not isinstance(step, AsyncWorkflowStep):
    +            raise BoltError(f"Invalid step object ({type(step)})")
    +
    +        self.use(AsyncWorkflowStepMiddleware(step, self._async_listener_runner))
    +
    +    # -------------------------
    +    # global error handler
    +
    +    def error(
    +        self, func: Callable[..., Awaitable[Optional[BoltResponse]]]
    +    ) -> Callable[..., Awaitable[Optional[BoltResponse]]]:
    +        """Updates the global error handler. This method can be used as either a decorator or a method.
    +
    +            # Use this method as a decorator
    +            @app.error
    +            async def custom_error_handler(error, body, logger):
    +                logger.exception(f"Error: {error}")
    +                logger.info(f"Request body: {body}")
    +
    +            # Pass a function to this method
    +            app.error(custom_error_handler)
    +
    +        To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document.
    +
    +        Args:
    +            func: The function that is supposed to be executed
    +                when getting an unhandled error in Bolt app.
    +        """
    +        if not inspect.iscoroutinefunction(func):
    +            name = get_name_for_callable(func)
    +            raise BoltError(error_listener_function_must_be_coro_func(name))
    +        self._async_listener_runner.listener_error_handler = (
    +            AsyncCustomListenerErrorHandler(
    +                logger=self._framework_logger,
    +                func=func,
    +            )
    +        )
    +        self._async_middleware_error_handler = AsyncCustomMiddlewareErrorHandler(
    +            logger=self._framework_logger,
    +            func=func,
    +        )
    +        return func
    +
    +    # -------------------------
    +    # events
    +
    +    def event(
    +        self,
    +        event: Union[
    +            str,
    +            Pattern,
    +            Dict[str, Optional[Union[str, Sequence[Optional[Union[str, Pattern]]]]]],
    +        ],
    +        matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +        """Registers a new event listener. This method can be used as either a decorator or a method.
    +
    +            # Use this method as a decorator
    +            @app.event("team_join")
    +            async def ask_for_introduction(event, say):
    +                welcome_channel_id = "C12345"
    +                user_id = event["user"]
    +                text = f"Welcome to the team, <@{user_id}>! :tada: You can introduce yourself in this channel."
    +                await say(text=text, channel=welcome_channel_id)
    +
    +            # Pass a function to this method
    +            app.event("team_join")(ask_for_introduction)
    +
    +        Refer to https://api.slack.com/apis/connections/events-api for details of Events API.
    +
    +        To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document.
    +
    +        Args:
    +            event: The conditions that match a request payload.
    +                If you pass a dict for this, you can have type, subtype in the constraint.
    +            matchers: A list of listener matcher functions.
    +                Only when all the matchers return True, the listener function can be invoked.
    +            middleware: A list of lister middleware functions.
    +                Only when all the middleware call `next()` method, the listener function can be invoked.
    +        """
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.event(
    +                event, True, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware, True
    +            )
    +
    +        return __call__
    +
    +    def message(
    +        self,
    +        keyword: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +        """Registers a new message event listener. This method can be used as either a decorator or a method.
    +        Check the `App#event` method's docstring for details.
    +
    +            # Use this method as a decorator
    +            @app.message(":wave:")
    +            async def say_hello(message, say):
    +                user = message['user']
    +                await say(f"Hi there, <@{user}>!")
    +
    +            # Pass a function to this method
    +            app.message(":wave:")(say_hello)
    +
    +        Refer to https://api.slack.com/events/message for details of `message` events.
    +
    +        To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document.
    +
    +        Args:
    +            keyword: The keyword to match
    +            matchers: A list of listener matcher functions.
    +                Only when all the matchers return True, the listener function can be invoked.
    +            middleware: A list of lister middleware functions.
    +                Only when all the middleware call `next()` method, the listener function can be invoked.
    +        """
    +        matchers = list(matchers) if matchers else []
    +        middleware = list(middleware) if middleware else []
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            constraints = {
    +                "type": "message",
    +                "subtype": (
    +                    # In most cases, new message events come with no subtype.
    +                    None,
    +                    # As of Jan 2021, most bot messages no longer have the subtype bot_message.
    +                    # By contrast, messages posted using classic app's bot token still have the subtype.
    +                    "bot_message",
    +                    # If an end-user posts a message with "Also send to #channel" checked,
    +                    # the message event comes with this subtype.
    +                    "thread_broadcast",
    +                    # If an end-user posts a message with attached files,
    +                    # the message event comes with this subtype.
    +                    "file_share",
    +                ),
    +            }
    +            primary_matcher = builtin_matchers.message_event(
    +                constraints=constraints,
    +                keyword=keyword,
    +                asyncio=True,
    +                base_logger=self._base_logger,
    +            )
    +            middleware.insert(0, AsyncMessageListenerMatches(keyword))
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware, True
    +            )
    +
    +        return __call__
    +
    +    # -------------------------
    +    # slash commands
    +
    +    def command(
    +        self,
    +        command: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +        """Registers a new slash command listener.
    +        This method can be used as either a decorator or a method.
    +
    +            # Use this method as a decorator
    +            @app.command("/echo")
    +            async def repeat_text(ack, say, command):
    +                # Acknowledge command request
    +                await ack()
    +                await say(f"{command['text']}")
    +
    +            # Pass a function to this method
    +            app.command("/echo")(repeat_text)
    +
    +        Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands.
    +
    +        To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document.
    +
    +        Args:
    +            command: The conditions that match a request payload
    +            matchers: A list of listener matcher functions.
    +                Only when all the matchers return True, the listener function can be invoked.
    +            middleware: A list of lister middleware functions.
    +                Only when all the middleware call `next()` method, the listener function can be invoked.
    +        """
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.command(
    +                command, asyncio=True, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    # -------------------------
    +    # shortcut
    +
    +    def shortcut(
    +        self,
    +        constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
    +        matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +        """Registers a new shortcut listener.
    +        This method can be used as either a decorator or a method.
    +
    +            # Use this method as a decorator
    +            @app.shortcut("open_modal")
    +            async def open_modal(ack, body, client):
    +                # Acknowledge the command request
    +                await ack()
    +                # Call views_open with the built-in client
    +                await client.views_open(
    +                    # Pass a valid trigger_id within 3 seconds of receiving it
    +                    trigger_id=body["trigger_id"],
    +                    # View payload
    +                    view={ ... }
    +                )
    +
    +            # Pass a function to this method
    +            app.shortcut("open_modal")(open_modal)
    +
    +        Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts.
    +
    +        To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document.
    +
    +        Args:
    +            constraints: The conditions that match a request payload.
    +            matchers: A list of listener matcher functions.
    +                Only when all the matchers return True, the listener function can be invoked.
    +            middleware: A list of lister middleware functions.
    +                Only when all the middleware call `next()` method, the listener function can be invoked.
    +        """
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.shortcut(
    +                constraints, asyncio=True, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    def global_shortcut(
    +        self,
    +        callback_id: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +        """Registers a new global shortcut listener."""
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.global_shortcut(
    +                callback_id, asyncio=True, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    def message_shortcut(
    +        self,
    +        callback_id: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +        """Registers a new message shortcut listener."""
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.message_shortcut(
    +                callback_id, asyncio=True, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    # -------------------------
    +    # action
    +
    +    def action(
    +        self,
    +        constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
    +        matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +        """Registers a new action listener. This method can be used as either a decorator or a method.
    +
    +            # Use this method as a decorator
    +            @app.action("approve_button")
    +            async def update_message(ack):
    +                await ack()
    +
    +            # Pass a function to this method
    +            app.action("approve_button")(update_message)
    +
    +        * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`.
    +        * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`.
    +        * Refer to https://api.slack.com/dialogs for actions in dialogs.
    +
    +        To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document.
    +
    +        Args:
    +            constraints: The conditions that match a request payload
    +            matchers: A list of listener matcher functions.
    +                Only when all the matchers return True, the listener function can be invoked.
    +            middleware: A list of lister middleware functions.
    +                Only when all the middleware call `next()` method, the listener function can be invoked.
    +        """
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.action(
    +                constraints, asyncio=True, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    def block_action(
    +        self,
    +        constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
    +        matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +        """Registers a new `block_actions` action listener.
    +        Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details.
    +        """
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.block_action(
    +                constraints, asyncio=True, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    def attachment_action(
    +        self,
    +        callback_id: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +        """Registers a new `interactive_message` action listener.
    +        Refer to https://api.slack.com/legacy/message-buttons for details."""
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.attachment_action(
    +                callback_id, asyncio=True, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    def dialog_submission(
    +        self,
    +        callback_id: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +        """Registers a new `dialog_submission` listener.
    +        Refer to https://api.slack.com/dialogs for details."""
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.dialog_submission(
    +                callback_id, asyncio=True, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    def dialog_cancellation(
    +        self,
    +        callback_id: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +        """Registers a new `dialog_submission` listener.
    +        Refer to https://api.slack.com/dialogs for details."""
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.dialog_cancellation(
    +                callback_id, asyncio=True, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    # -------------------------
    +    # view
    +
    +    def view(
    +        self,
    +        constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
    +        matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +        """Registers a new `view_submission`/`view_closed` event listener.
    +        This method can be used as either a decorator or a method.
    +
    +            # Use this method as a decorator
    +            @app.view("view_1")
    +            async def handle_submission(ack, body, client, view):
    +                # Assume there's an input block with `block_c` as the block_id and `dreamy_input`
    +                hopes_and_dreams = view["state"]["values"]["block_c"]["dreamy_input"]
    +                user = body["user"]["id"]
    +                # Validate the inputs
    +                errors = {}
    +                if hopes_and_dreams is not None and len(hopes_and_dreams) <= 5:
    +                    errors["block_c"] = "The value must be longer than 5 characters"
    +                if len(errors) > 0:
    +                    await ack(response_action="errors", errors=errors)
    +                    return
    +                # Acknowledge the view_submission event and close the modal
    +                await ack()
    +                # Do whatever you want with the input data - here we're saving it to a DB
    +
    +            # Pass a function to this method
    +            app.view("view_1")(handle_submission)
    +
    +        Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads.
    +
    +        To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document.
    +
    +        Args:
    +            constraints: The conditions that match a request payload
    +            matchers: A list of listener matcher functions.
    +                Only when all the matchers return True, the listener function can be invoked.
    +            middleware: A list of lister middleware functions.
    +                Only when all the middleware call `next()` method, the listener function can be invoked.
    +        """
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.view(
    +                constraints, asyncio=True, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    def view_submission(
    +        self,
    +        constraints: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +        """Registers a new `view_submission` listener.
    +        Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details."""
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.view_submission(
    +                constraints, asyncio=True, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    def view_closed(
    +        self,
    +        constraints: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +        """Registers a new `view_closed` listener.
    +        Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details."""
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.view_closed(
    +                constraints, asyncio=True, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    # -------------------------
    +    # options
    +
    +    def options(
    +        self,
    +        constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
    +        matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +        """Registers a new options listener.
    +        This method can be used as either a decorator or a method.
    +
    +            # Use this method as a decorator
    +            @app.options("menu_selection")
    +            async def show_menu_options(ack):
    +                options = [
    +                    {
    +                        "text": {"type": "plain_text", "text": "Option 1"},
    +                        "value": "1-1",
    +                    },
    +                    {
    +                        "text": {"type": "plain_text", "text": "Option 2"},
    +                        "value": "1-2",
    +                    },
    +                ]
    +                await ack(options=options)
    +
    +            # Pass a function to this method
    +            app.options("menu_selection")(show_menu_options)
    +
    +        Refer to the following documents for details:
    +
    +        * https://api.slack.com/reference/block-kit/block-elements#external_select
    +        * https://api.slack.com/reference/block-kit/block-elements#external_multi_select
    +
    +        To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document.
    +
    +        Args:
    +            matchers: A list of listener matcher functions.
    +                Only when all the matchers return True, the listener function can be invoked.
    +            middleware: A list of lister middleware functions.
    +                Only when all the middleware call `next()` method, the listener function can be invoked.
    +        """
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.options(
    +                constraints, asyncio=True, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    def block_suggestion(
    +        self,
    +        action_id: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +        """Registers a new `block_suggestion` listener."""
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.block_suggestion(
    +                action_id, asyncio=True, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    def dialog_suggestion(
    +        self,
    +        callback_id: Union[str, Pattern],
    +        matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +        middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +    ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +        """Registers a new `dialog_suggestion` listener.
    +        Refer to https://api.slack.com/dialogs for details."""
    +
    +        def __call__(*args, **kwargs):
    +            functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +            primary_matcher = builtin_matchers.dialog_suggestion(
    +                callback_id, asyncio=True, base_logger=self._base_logger
    +            )
    +            return self._register_listener(
    +                list(functions), primary_matcher, matchers, middleware
    +            )
    +
    +        return __call__
    +
    +    # -------------------------
    +    # built-in listener functions
    +
    +    def default_tokens_revoked_event_listener(
    +        self,
    +    ) -> Callable[..., Awaitable[Optional[BoltResponse]]]:
    +        if self._async_tokens_revocation_listeners is None:
    +            raise BoltError(error_installation_store_required_for_builtin_listeners())
    +        return self._async_tokens_revocation_listeners.handle_tokens_revoked_events
    +
    +    def default_app_uninstalled_event_listener(
    +        self,
    +    ) -> Callable[..., Awaitable[Optional[BoltResponse]]]:
    +        if self._async_tokens_revocation_listeners is None:
    +            raise BoltError(error_installation_store_required_for_builtin_listeners())
    +        return self._async_tokens_revocation_listeners.handle_app_uninstalled_events
    +
    +    def enable_token_revocation_listeners(self) -> None:
    +        self.event("tokens_revoked")(self.default_tokens_revoked_event_listener())
    +        self.event("app_uninstalled")(self.default_app_uninstalled_event_listener())
    +
    +    # -------------------------
    +
    +    def _init_context(self, req: AsyncBoltRequest):
    +        req.context["logger"] = get_bolt_app_logger(
    +            app_name=self.name, base_logger=self._base_logger
    +        )
    +        req.context["token"] = self._token
    +        if self._token is not None:
    +            # This AsyncWebClient instance can be safely singleton
    +            req.context["client"] = self._async_client
    +        else:
    +            # Set a new dedicated instance for this request
    +            client_per_request: AsyncWebClient = AsyncWebClient(
    +                token=None,  # the token will be set later
    +                base_url=self._async_client.base_url,
    +                timeout=self._async_client.timeout,
    +                ssl=self._async_client.ssl,
    +                proxy=self._async_client.proxy,
    +                session=self._async_client.session,
    +                trust_env_in_session=self._async_client.trust_env_in_session,
    +                headers=self._async_client.headers,
    +                team_id=req.context.team_id,
    +            )
    +            req.context["client"] = client_per_request
    +
    +    @staticmethod
    +    def _to_listener_functions(
    +        kwargs: dict,
    +    ) -> Optional[Sequence[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +        if kwargs:
    +            functions = [kwargs["ack"]]
    +            for sub in kwargs["lazy"]:
    +                functions.append(sub)
    +            return functions
    +        return None
    +
    +    def _register_listener(
    +        self,
    +        functions: Sequence[Callable[..., Awaitable[Optional[BoltResponse]]]],
    +        primary_matcher: AsyncListenerMatcher,
    +        matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]],
    +        middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]],
    +        auto_acknowledgement: bool = False,
    +    ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]:
    +        value_to_return = None
    +        if not isinstance(functions, list):
    +            functions = list(functions)
    +        if len(functions) == 1:
    +            # In the case where the function is registered using decorator,
    +            # the registration should return the original function.
    +            value_to_return = functions[0]
    +
    +        for func in functions:
    +            if not inspect.iscoroutinefunction(func):
    +                name = get_name_for_callable(func)
    +                raise BoltError(error_listener_function_must_be_coro_func(name))
    +
    +        listener_matchers = [
    +            AsyncCustomListenerMatcher(
    +                app_name=self.name, func=f, base_logger=self._base_logger
    +            )
    +            for f in (matchers or [])
    +        ]
    +        listener_matchers.insert(0, primary_matcher)
    +        listener_middleware = []
    +        for m in middleware or []:
    +            if isinstance(m, AsyncMiddleware):
    +                listener_middleware.append(m)
    +            elif isinstance(m, Callable) and inspect.iscoroutinefunction(m):
    +                listener_middleware.append(
    +                    AsyncCustomMiddleware(
    +                        app_name=self.name, func=m, base_logger=self._base_logger
    +                    )
    +                )
    +            else:
    +                raise ValueError(error_unexpected_listener_middleware(type(m)))
    +
    +        self._async_listeners.append(
    +            AsyncCustomListener(
    +                app_name=self.name,
    +                ack_function=functions.pop(0),
    +                lazy_functions=functions,
    +                matchers=listener_matchers,
    +                middleware=listener_middleware,
    +                auto_acknowledgement=auto_acknowledgement,
    +                base_logger=self._base_logger,
    +            )
    +        )
    +
    +        return value_to_return
    +
    +

    Class variables

    +
    +
    var AsyncSlackAppServer
    +
    +
    +
    +
    +

    Instance variables

    +
    +
    var client : slack_sdk.web.async_client.AsyncWebClient
    +
    +

    The singleton slack_sdk.web.async_client.AsyncWebClient instance in this app.

    +
    + +Expand source code + +
    @property
    +def client(self) -> AsyncWebClient:
    +    """The singleton `slack_sdk.web.async_client.AsyncWebClient` instance in this app."""
    +    return self._async_client
    +
    +
    +
    var installation_store : Optional[slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore]
    +
    +

    The slack_sdk.oauth.AsyncInstallationStore that can be used in the authorize middleware.

    +
    + +Expand source code + +
    @property
    +def installation_store(self) -> Optional[AsyncInstallationStore]:
    +    """The `slack_sdk.oauth.AsyncInstallationStore` that can be used in the `authorize` middleware."""
    +    return self._async_installation_store
    +
    +
    +
    var listener_runnerAsyncioListenerRunner
    +
    +

    The asyncio-based executor for asynchronously running listeners.

    +
    + +Expand source code + +
    @property
    +def listener_runner(self) -> AsyncioListenerRunner:
    +    """The asyncio-based executor for asynchronously running listeners."""
    +    return self._async_listener_runner
    +
    +
    +
    var logger : logging.Logger
    +
    +

    The logger this app uses.

    +
    + +Expand source code + +
    @property
    +def logger(self) -> logging.Logger:
    +    """The logger this app uses."""
    +    return self._framework_logger
    +
    +
    +
    var name : str
    +
    +

    The name of this app (default: the filename)

    +
    + +Expand source code + +
    @property
    +def name(self) -> str:
    +    """The name of this app (default: the filename)"""
    +    return self._name
    +
    +
    +
    var oauth_flow : Optional[AsyncOAuthFlow]
    +
    +

    Configured OAuthFlow object if exists.

    +
    + +Expand source code + +
    @property
    +def oauth_flow(self) -> Optional[AsyncOAuthFlow]:
    +    """Configured `OAuthFlow` object if exists."""
    +    return self._async_oauth_flow
    +
    +
    +
    var process_before_response : bool
    +
    +
    +
    + +Expand source code + +
    @property
    +def process_before_response(self) -> bool:
    +    return self._process_before_response or False
    +
    +
    +
    +

    Methods

    +
    +
    +def action(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]] +
    +
    +

    Registers a new action listener. This method can be used as either a decorator or a method.

    +
    # Use this method as a decorator
    +@app.action("approve_button")
    +async def update_message(ack):
    +    await ack()
    +
    +# Pass a function to this method
    +app.action("approve_button")(update_message)
    +
    + +

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    +

    Args

    +
    +
    constraints
    +
    The conditions that match a request payload
    +
    matchers
    +
    A list of listener matcher functions. +Only when all the matchers return True, the listener function can be invoked.
    +
    middleware
    +
    A list of lister middleware functions. +Only when all the middleware call next() method, the listener function can be invoked.
    +
    +
    + +Expand source code + +
    def action(
    +    self,
    +    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
    +    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +    """Registers a new action listener. This method can be used as either a decorator or a method.
    +
    +        # Use this method as a decorator
    +        @app.action("approve_button")
    +        async def update_message(ack):
    +            await ack()
    +
    +        # Pass a function to this method
    +        app.action("approve_button")(update_message)
    +
    +    * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`.
    +    * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`.
    +    * Refer to https://api.slack.com/dialogs for actions in dialogs.
    +
    +    To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document.
    +
    +    Args:
    +        constraints: The conditions that match a request payload
    +        matchers: A list of listener matcher functions.
    +            Only when all the matchers return True, the listener function can be invoked.
    +        middleware: A list of lister middleware functions.
    +            Only when all the middleware call `next()` method, the listener function can be invoked.
    +    """
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.action(
    +            constraints, asyncio=True, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +async def async_dispatch(self, req: AsyncBoltRequest) ‑> BoltResponse +
    +
    +

    Applies all middleware and dispatches an incoming request from Slack to the right code path.

    +

    Args

    +
    +
    req
    +
    An incoming request from Slack.
    +
    +

    Returns

    +

    The response generated by this Bolt app.

    +
    + +Expand source code + +
    async def async_dispatch(self, req: AsyncBoltRequest) -> BoltResponse:
    +    """Applies all middleware and dispatches an incoming request from Slack to the right code path.
    +
    +    Args:
    +        req: An incoming request from Slack.
    +
    +    Returns:
    +        The response generated by this Bolt app.
    +    """
    +    starting_time = time.time()
    +    self._init_context(req)
    +
    +    resp: Optional[BoltResponse] = BoltResponse(status=200, body="")
    +    middleware_state = {"next_called": False}
    +
    +    async def async_middleware_next():
    +        middleware_state["next_called"] = True
    +
    +    try:
    +        for middleware in self._async_middleware_list:
    +            middleware_state["next_called"] = False
    +            if self._framework_logger.level <= logging.DEBUG:
    +                self._framework_logger.debug(f"Applying {middleware.name}")
    +            resp = await middleware.async_process(
    +                req=req, resp=resp, next=async_middleware_next
    +            )
    +            if not middleware_state["next_called"]:
    +                if resp is None:
    +                    # next() method was not called without providing the response to return to Slack
    +                    # This should not be an intentional handling in usual use cases.
    +                    resp = BoltResponse(
    +                        status=404, body={"error": "no next() calls in middleware"}
    +                    )
    +                    if self._raise_error_for_unhandled_request is True:
    +                        await self._async_listener_runner.listener_error_handler.handle(
    +                            error=BoltUnhandledRequestError(
    +                                request=req,
    +                                current_response=resp,
    +                                last_global_middleware_name=middleware.name,
    +                            ),
    +                            request=req,
    +                            response=resp,
    +                        )
    +                        return resp
    +                    self._framework_logger.warning(
    +                        warning_unhandled_by_global_middleware(middleware.name, req)
    +                    )
    +                    return resp
    +                return resp
    +
    +        for listener in self._async_listeners:
    +            listener_name = get_name_for_callable(listener.ack_function)
    +            self._framework_logger.debug(debug_checking_listener(listener_name))
    +            if await listener.async_matches(req=req, resp=resp):
    +                # run all the middleware attached to this listener first
    +                (
    +                    middleware_resp,
    +                    next_was_not_called,
    +                ) = await listener.run_async_middleware(req=req, resp=resp)
    +                if next_was_not_called:
    +                    if middleware_resp is not None:
    +                        if self._framework_logger.level <= logging.DEBUG:
    +                            debug_message = (
    +                                debug_return_listener_middleware_response(
    +                                    listener_name,
    +                                    middleware_resp.status,
    +                                    middleware_resp.body,
    +                                    starting_time,
    +                                )
    +                            )
    +                            self._framework_logger.debug(debug_message)
    +                        return middleware_resp
    +                    # The last listener middleware didn't call next() method.
    +                    # This means the listener is not for this incoming request.
    +                    continue
    +
    +                if middleware_resp is not None:
    +                    resp = middleware_resp
    +
    +                self._framework_logger.debug(debug_running_listener(listener_name))
    +                listener_response: Optional[
    +                    BoltResponse
    +                ] = await self._async_listener_runner.run(
    +                    request=req,
    +                    response=resp,
    +                    listener_name=listener_name,
    +                    listener=listener,
    +                )
    +                if listener_response is not None:
    +                    return listener_response
    +
    +        if resp is None:
    +            resp = BoltResponse(status=404, body={"error": "unhandled request"})
    +        if self._raise_error_for_unhandled_request is True:
    +            await self._async_listener_runner.listener_error_handler.handle(
    +                error=BoltUnhandledRequestError(
    +                    request=req,
    +                    current_response=resp,
    +                ),
    +                request=req,
    +                response=resp,
    +            )
    +            return resp
    +        return self._handle_unmatched_requests(req, resp)
    +
    +    except Exception as error:
    +        resp = BoltResponse(status=500, body="")
    +        await self._async_middleware_error_handler.handle(
    +            error=error,
    +            request=req,
    +            response=resp,
    +        )
    +        return resp
    +
    +
    +
    +def attachment_action(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]] +
    +
    +

    Registers a new interactive_message action listener. +Refer to https://api.slack.com/legacy/message-buttons for details.

    +
    + +Expand source code + +
    def attachment_action(
    +    self,
    +    callback_id: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +    """Registers a new `interactive_message` action listener.
    +    Refer to https://api.slack.com/legacy/message-buttons for details."""
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.attachment_action(
    +            callback_id, asyncio=True, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def block_action(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]] +
    +
    +

    Registers a new block_actions action listener. +Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details.

    +
    + +Expand source code + +
    def block_action(
    +    self,
    +    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
    +    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +    """Registers a new `block_actions` action listener.
    +    Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details.
    +    """
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.block_action(
    +            constraints, asyncio=True, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def block_suggestion(self, action_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]] +
    +
    +

    Registers a new block_suggestion listener.

    +
    + +Expand source code + +
    def block_suggestion(
    +    self,
    +    action_id: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +    """Registers a new `block_suggestion` listener."""
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.block_suggestion(
    +            action_id, asyncio=True, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def command(self, command: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]] +
    +
    +

    Registers a new slash command listener. +This method can be used as either a decorator or a method.

    +
    # Use this method as a decorator
    +@app.command("/echo")
    +async def repeat_text(ack, say, command):
    +    # Acknowledge command request
    +    await ack()
    +    await say(f"{command['text']}")
    +
    +# Pass a function to this method
    +app.command("/echo")(repeat_text)
    +
    +

    Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands.

    +

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    +

    Args

    +
    +
    command
    +
    The conditions that match a request payload
    +
    matchers
    +
    A list of listener matcher functions. +Only when all the matchers return True, the listener function can be invoked.
    +
    middleware
    +
    A list of lister middleware functions. +Only when all the middleware call next() method, the listener function can be invoked.
    +
    +
    + +Expand source code + +
    def command(
    +    self,
    +    command: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +    """Registers a new slash command listener.
    +    This method can be used as either a decorator or a method.
    +
    +        # Use this method as a decorator
    +        @app.command("/echo")
    +        async def repeat_text(ack, say, command):
    +            # Acknowledge command request
    +            await ack()
    +            await say(f"{command['text']}")
    +
    +        # Pass a function to this method
    +        app.command("/echo")(repeat_text)
    +
    +    Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands.
    +
    +    To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document.
    +
    +    Args:
    +        command: The conditions that match a request payload
    +        matchers: A list of listener matcher functions.
    +            Only when all the matchers return True, the listener function can be invoked.
    +        middleware: A list of lister middleware functions.
    +            Only when all the middleware call `next()` method, the listener function can be invoked.
    +    """
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.command(
    +            command, asyncio=True, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def default_app_uninstalled_event_listener(self) ‑> Callable[..., Awaitable[Optional[BoltResponse]]] +
    +
    +
    +
    + +Expand source code + +
    def default_app_uninstalled_event_listener(
    +    self,
    +) -> Callable[..., Awaitable[Optional[BoltResponse]]]:
    +    if self._async_tokens_revocation_listeners is None:
    +        raise BoltError(error_installation_store_required_for_builtin_listeners())
    +    return self._async_tokens_revocation_listeners.handle_app_uninstalled_events
    +
    +
    +
    +def default_tokens_revoked_event_listener(self) ‑> Callable[..., Awaitable[Optional[BoltResponse]]] +
    +
    +
    +
    + +Expand source code + +
    def default_tokens_revoked_event_listener(
    +    self,
    +) -> Callable[..., Awaitable[Optional[BoltResponse]]]:
    +    if self._async_tokens_revocation_listeners is None:
    +        raise BoltError(error_installation_store_required_for_builtin_listeners())
    +    return self._async_tokens_revocation_listeners.handle_tokens_revoked_events
    +
    +
    +
    +def dialog_cancellation(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]] +
    +
    +

    Registers a new dialog_submission listener. +Refer to https://api.slack.com/dialogs for details.

    +
    + +Expand source code + +
    def dialog_cancellation(
    +    self,
    +    callback_id: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +    """Registers a new `dialog_submission` listener.
    +    Refer to https://api.slack.com/dialogs for details."""
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.dialog_cancellation(
    +            callback_id, asyncio=True, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def dialog_submission(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]] +
    +
    +

    Registers a new dialog_submission listener. +Refer to https://api.slack.com/dialogs for details.

    +
    + +Expand source code + +
    def dialog_submission(
    +    self,
    +    callback_id: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +    """Registers a new `dialog_submission` listener.
    +    Refer to https://api.slack.com/dialogs for details."""
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.dialog_submission(
    +            callback_id, asyncio=True, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def dialog_suggestion(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]] +
    +
    +

    Registers a new dialog_suggestion listener. +Refer to https://api.slack.com/dialogs for details.

    +
    + +Expand source code + +
    def dialog_suggestion(
    +    self,
    +    callback_id: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +    """Registers a new `dialog_suggestion` listener.
    +    Refer to https://api.slack.com/dialogs for details."""
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.dialog_suggestion(
    +            callback_id, asyncio=True, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def enable_token_revocation_listeners(self) ‑> None +
    +
    +
    +
    + +Expand source code + +
    def enable_token_revocation_listeners(self) -> None:
    +    self.event("tokens_revoked")(self.default_tokens_revoked_event_listener())
    +    self.event("app_uninstalled")(self.default_app_uninstalled_event_listener())
    +
    +
    +
    +def error(self, func: Callable[..., Awaitable[Optional[BoltResponse]]]) ‑> Callable[..., Awaitable[Optional[BoltResponse]]] +
    +
    +

    Updates the global error handler. This method can be used as either a decorator or a method.

    +
    # Use this method as a decorator
    +@app.error
    +async def custom_error_handler(error, body, logger):
    +    logger.exception(f"Error: {error}")
    +    logger.info(f"Request body: {body}")
    +
    +# Pass a function to this method
    +app.error(custom_error_handler)
    +
    +

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    +

    Args

    +
    +
    func
    +
    The function that is supposed to be executed +when getting an unhandled error in Bolt app.
    +
    +
    + +Expand source code + +
    def error(
    +    self, func: Callable[..., Awaitable[Optional[BoltResponse]]]
    +) -> Callable[..., Awaitable[Optional[BoltResponse]]]:
    +    """Updates the global error handler. This method can be used as either a decorator or a method.
    +
    +        # Use this method as a decorator
    +        @app.error
    +        async def custom_error_handler(error, body, logger):
    +            logger.exception(f"Error: {error}")
    +            logger.info(f"Request body: {body}")
    +
    +        # Pass a function to this method
    +        app.error(custom_error_handler)
    +
    +    To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document.
    +
    +    Args:
    +        func: The function that is supposed to be executed
    +            when getting an unhandled error in Bolt app.
    +    """
    +    if not inspect.iscoroutinefunction(func):
    +        name = get_name_for_callable(func)
    +        raise BoltError(error_listener_function_must_be_coro_func(name))
    +    self._async_listener_runner.listener_error_handler = (
    +        AsyncCustomListenerErrorHandler(
    +            logger=self._framework_logger,
    +            func=func,
    +        )
    +    )
    +    self._async_middleware_error_handler = AsyncCustomMiddlewareErrorHandler(
    +        logger=self._framework_logger,
    +        func=func,
    +    )
    +    return func
    +
    +
    +
    +def event(self, event: Union[str, Pattern, Dict[str, Union[str, Sequence[Union[str, Pattern, ForwardRef(None)]], ForwardRef(None)]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]] +
    +
    +

    Registers a new event listener. This method can be used as either a decorator or a method.

    +
    # Use this method as a decorator
    +@app.event("team_join")
    +async def ask_for_introduction(event, say):
    +    welcome_channel_id = "C12345"
    +    user_id = event["user"]
    +    text = f"Welcome to the team, <@{user_id}>! :tada: You can introduce yourself in this channel."
    +    await say(text=text, channel=welcome_channel_id)
    +
    +# Pass a function to this method
    +app.event("team_join")(ask_for_introduction)
    +
    +

    Refer to https://api.slack.com/apis/connections/events-api for details of Events API.

    +

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    +

    Args

    +
    +
    event
    +
    The conditions that match a request payload. +If you pass a dict for this, you can have type, subtype in the constraint.
    +
    matchers
    +
    A list of listener matcher functions. +Only when all the matchers return True, the listener function can be invoked.
    +
    middleware
    +
    A list of lister middleware functions. +Only when all the middleware call next() method, the listener function can be invoked.
    +
    +
    + +Expand source code + +
    def event(
    +    self,
    +    event: Union[
    +        str,
    +        Pattern,
    +        Dict[str, Optional[Union[str, Sequence[Optional[Union[str, Pattern]]]]]],
    +    ],
    +    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +    """Registers a new event listener. This method can be used as either a decorator or a method.
    +
    +        # Use this method as a decorator
    +        @app.event("team_join")
    +        async def ask_for_introduction(event, say):
    +            welcome_channel_id = "C12345"
    +            user_id = event["user"]
    +            text = f"Welcome to the team, <@{user_id}>! :tada: You can introduce yourself in this channel."
    +            await say(text=text, channel=welcome_channel_id)
    +
    +        # Pass a function to this method
    +        app.event("team_join")(ask_for_introduction)
    +
    +    Refer to https://api.slack.com/apis/connections/events-api for details of Events API.
    +
    +    To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document.
    +
    +    Args:
    +        event: The conditions that match a request payload.
    +            If you pass a dict for this, you can have type, subtype in the constraint.
    +        matchers: A list of listener matcher functions.
    +            Only when all the matchers return True, the listener function can be invoked.
    +        middleware: A list of lister middleware functions.
    +            Only when all the middleware call `next()` method, the listener function can be invoked.
    +    """
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.event(
    +            event, True, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware, True
    +        )
    +
    +    return __call__
    +
    +
    +
    +def global_shortcut(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]] +
    +
    +

    Registers a new global shortcut listener.

    +
    + +Expand source code + +
    def global_shortcut(
    +    self,
    +    callback_id: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +    """Registers a new global shortcut listener."""
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.global_shortcut(
    +            callback_id, asyncio=True, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def message(self, keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]] +
    +
    +

    Registers a new message event listener. This method can be used as either a decorator or a method. +Check the App#event method's docstring for details.

    +
    # Use this method as a decorator
    +@app.message(":wave:")
    +async def say_hello(message, say):
    +    user = message['user']
    +    await say(f"Hi there, <@{user}>!")
    +
    +# Pass a function to this method
    +app.message(":wave:")(say_hello)
    +
    +

    Refer to https://api.slack.com/events/message for details of message events.

    +

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    +

    Args

    +
    +
    keyword
    +
    The keyword to match
    +
    matchers
    +
    A list of listener matcher functions. +Only when all the matchers return True, the listener function can be invoked.
    +
    middleware
    +
    A list of lister middleware functions. +Only when all the middleware call next() method, the listener function can be invoked.
    +
    +
    + +Expand source code + +
    def message(
    +    self,
    +    keyword: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +    """Registers a new message event listener. This method can be used as either a decorator or a method.
    +    Check the `App#event` method's docstring for details.
    +
    +        # Use this method as a decorator
    +        @app.message(":wave:")
    +        async def say_hello(message, say):
    +            user = message['user']
    +            await say(f"Hi there, <@{user}>!")
    +
    +        # Pass a function to this method
    +        app.message(":wave:")(say_hello)
    +
    +    Refer to https://api.slack.com/events/message for details of `message` events.
    +
    +    To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document.
    +
    +    Args:
    +        keyword: The keyword to match
    +        matchers: A list of listener matcher functions.
    +            Only when all the matchers return True, the listener function can be invoked.
    +        middleware: A list of lister middleware functions.
    +            Only when all the middleware call `next()` method, the listener function can be invoked.
    +    """
    +    matchers = list(matchers) if matchers else []
    +    middleware = list(middleware) if middleware else []
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        constraints = {
    +            "type": "message",
    +            "subtype": (
    +                # In most cases, new message events come with no subtype.
    +                None,
    +                # As of Jan 2021, most bot messages no longer have the subtype bot_message.
    +                # By contrast, messages posted using classic app's bot token still have the subtype.
    +                "bot_message",
    +                # If an end-user posts a message with "Also send to #channel" checked,
    +                # the message event comes with this subtype.
    +                "thread_broadcast",
    +                # If an end-user posts a message with attached files,
    +                # the message event comes with this subtype.
    +                "file_share",
    +            ),
    +        }
    +        primary_matcher = builtin_matchers.message_event(
    +            constraints=constraints,
    +            keyword=keyword,
    +            asyncio=True,
    +            base_logger=self._base_logger,
    +        )
    +        middleware.insert(0, AsyncMessageListenerMatches(keyword))
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware, True
    +        )
    +
    +    return __call__
    +
    +
    +
    +def message_shortcut(self, callback_id: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]] +
    +
    +

    Registers a new message shortcut listener.

    +
    + +Expand source code + +
    def message_shortcut(
    +    self,
    +    callback_id: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +    """Registers a new message shortcut listener."""
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.message_shortcut(
    +            callback_id, asyncio=True, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def middleware(self, *args) ‑> Optional[Callable] +
    +
    +

    Registers a new middleware to this app. +This method can be used as either a decorator or a method.

    +
    # Use this method as a decorator
    +@app.middleware
    +async def middleware_func(logger, body, next):
    +    logger.info(f"request body: {body}")
    +    await next()
    +
    +# Pass a function to this method
    +app.middleware(middleware_func)
    +
    +

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    +

    Args

    +
    +
    *args
    +
    A function that works as a global middleware.
    +
    +
    + +Expand source code + +
    def middleware(self, *args) -> Optional[Callable]:
    +    """Registers a new middleware to this app.
    +    This method can be used as either a decorator or a method.
    +
    +        # Use this method as a decorator
    +        @app.middleware
    +        async def middleware_func(logger, body, next):
    +            logger.info(f"request body: {body}")
    +            await next()
    +
    +        # Pass a function to this method
    +        app.middleware(middleware_func)
    +
    +    To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document.
    +
    +    Args:
    +        *args: A function that works as a global middleware.
    +    """
    +    if len(args) > 0:
    +        middleware_or_callable = args[0]
    +        if isinstance(middleware_or_callable, AsyncMiddleware):
    +            middleware: AsyncMiddleware = middleware_or_callable
    +            self._async_middleware_list.append(middleware)
    +        elif isinstance(middleware_or_callable, Callable):
    +            self._async_middleware_list.append(
    +                AsyncCustomMiddleware(
    +                    app_name=self.name,
    +                    func=middleware_or_callable,
    +                    base_logger=self._base_logger,
    +                )
    +            )
    +            return middleware_or_callable
    +        else:
    +            raise BoltError(
    +                f"Unexpected type for a middleware ({type(middleware_or_callable)})"
    +            )
    +    return None
    +
    +
    +
    +def options(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]] +
    +
    +

    Registers a new options listener. +This method can be used as either a decorator or a method.

    +
    # Use this method as a decorator
    +@app.options("menu_selection")
    +async def show_menu_options(ack):
    +    options = [
    +        {
    +            "text": {"type": "plain_text", "text": "Option 1"},
    +            "value": "1-1",
    +        },
    +        {
    +            "text": {"type": "plain_text", "text": "Option 2"},
    +            "value": "1-2",
    +        },
    +    ]
    +    await ack(options=options)
    +
    +# Pass a function to this method
    +app.options("menu_selection")(show_menu_options)
    +
    +

    Refer to the following documents for details:

    + +

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    +

    Args

    +
    +
    matchers
    +
    A list of listener matcher functions. +Only when all the matchers return True, the listener function can be invoked.
    +
    middleware
    +
    A list of lister middleware functions. +Only when all the middleware call next() method, the listener function can be invoked.
    +
    +
    + +Expand source code + +
    def options(
    +    self,
    +    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
    +    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +    """Registers a new options listener.
    +    This method can be used as either a decorator or a method.
    +
    +        # Use this method as a decorator
    +        @app.options("menu_selection")
    +        async def show_menu_options(ack):
    +            options = [
    +                {
    +                    "text": {"type": "plain_text", "text": "Option 1"},
    +                    "value": "1-1",
    +                },
    +                {
    +                    "text": {"type": "plain_text", "text": "Option 2"},
    +                    "value": "1-2",
    +                },
    +            ]
    +            await ack(options=options)
    +
    +        # Pass a function to this method
    +        app.options("menu_selection")(show_menu_options)
    +
    +    Refer to the following documents for details:
    +
    +    * https://api.slack.com/reference/block-kit/block-elements#external_select
    +    * https://api.slack.com/reference/block-kit/block-elements#external_multi_select
    +
    +    To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document.
    +
    +    Args:
    +        matchers: A list of listener matcher functions.
    +            Only when all the matchers return True, the listener function can be invoked.
    +        middleware: A list of lister middleware functions.
    +            Only when all the middleware call `next()` method, the listener function can be invoked.
    +    """
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.options(
    +            constraints, asyncio=True, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def server(self, port: int = 3000, path: str = '/slack/events', host: Optional[str] = None) ‑> AsyncSlackAppServer +
    +
    +

    Configure a web server using AIOHTTP. +Refer to https://docs.aiohttp.org/ for more details about AIOHTTP.

    +

    Args

    +
    +
    port
    +
    The port to listen on (Default: 3000)
    +
    path
    +
    The path to handle request from Slack (Default: /slack/events)
    +
    host
    +
    The hostname to serve the web endpoints. (Default: 0.0.0.0)
    +
    +
    + +Expand source code + +
    def server(
    +    self,
    +    port: int = 3000,
    +    path: str = "/slack/events",
    +    host: Optional[str] = None,
    +) -> AsyncSlackAppServer:
    +    """Configure a web server using AIOHTTP.
    +    Refer to https://docs.aiohttp.org/ for more details about AIOHTTP.
    +
    +    Args:
    +        port: The port to listen on (Default: 3000)
    +        path: The path to handle request from Slack (Default: `/slack/events`)
    +        host: The hostname to serve the web endpoints. (Default: 0.0.0.0)
    +    """
    +    if (
    +        self._server is None
    +        or self._server.port != port
    +        or self._server.path != path
    +    ):
    +        self._server = AsyncSlackAppServer(
    +            port=port,
    +            path=path,
    +            app=self,
    +            host=host,
    +        )
    +    return self._server
    +
    +
    +
    +def shortcut(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]] +
    +
    +

    Registers a new shortcut listener. +This method can be used as either a decorator or a method.

    +
    # Use this method as a decorator
    +@app.shortcut("open_modal")
    +async def open_modal(ack, body, client):
    +    # Acknowledge the command request
    +    await ack()
    +    # Call views_open with the built-in client
    +    await client.views_open(
    +        # Pass a valid trigger_id within 3 seconds of receiving it
    +        trigger_id=body["trigger_id"],
    +        # View payload
    +        view={ ... }
    +    )
    +
    +# Pass a function to this method
    +app.shortcut("open_modal")(open_modal)
    +
    +

    Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts.

    +

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    +

    Args

    +
    +
    constraints
    +
    The conditions that match a request payload.
    +
    matchers
    +
    A list of listener matcher functions. +Only when all the matchers return True, the listener function can be invoked.
    +
    middleware
    +
    A list of lister middleware functions. +Only when all the middleware call next() method, the listener function can be invoked.
    +
    +
    + +Expand source code + +
    def shortcut(
    +    self,
    +    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
    +    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +    """Registers a new shortcut listener.
    +    This method can be used as either a decorator or a method.
    +
    +        # Use this method as a decorator
    +        @app.shortcut("open_modal")
    +        async def open_modal(ack, body, client):
    +            # Acknowledge the command request
    +            await ack()
    +            # Call views_open with the built-in client
    +            await client.views_open(
    +                # Pass a valid trigger_id within 3 seconds of receiving it
    +                trigger_id=body["trigger_id"],
    +                # View payload
    +                view={ ... }
    +            )
    +
    +        # Pass a function to this method
    +        app.shortcut("open_modal")(open_modal)
    +
    +    Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts.
    +
    +    To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document.
    +
    +    Args:
    +        constraints: The conditions that match a request payload.
    +        matchers: A list of listener matcher functions.
    +            Only when all the matchers return True, the listener function can be invoked.
    +        middleware: A list of lister middleware functions.
    +            Only when all the middleware call `next()` method, the listener function can be invoked.
    +    """
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.shortcut(
    +            constraints, asyncio=True, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    -
    -
    -
    -
    -
    -
    -
    -
    + +
    +def start(self, port: int = 3000, path: str = '/slack/events', host: Optional[str] = None) ‑> None +
    +
    +

    Start a web server using AIOHTTP. +Refer to https://docs.aiohttp.org/ for more details about AIOHTTP.

    +

    Args

    +
    +
    port
    +
    The port to listen on (Default: 3000)
    +
    path
    +
    The path to handle request from Slack (Default: /slack/events)
    +
    host
    +
    The hostname to serve the web endpoints. (Default: 0.0.0.0)
    +
    +
    + +Expand source code + +
    def start(
    +    self, port: int = 3000, path: str = "/slack/events", host: Optional[str] = None
    +) -> None:
    +    """Start a web server using AIOHTTP.
    +    Refer to https://docs.aiohttp.org/ for more details about AIOHTTP.
    +
    +    Args:
    +        port: The port to listen on (Default: 3000)
    +        path: The path to handle request from Slack (Default: `/slack/events`)
    +        host: The hostname to serve the web endpoints. (Default: 0.0.0.0)
    +    """
    +    self.server(port=port, path=path, host=host).start()
    +
    +
    +
    +def step(self, callback_id: Union[str, Pattern, AsyncWorkflowStepAsyncWorkflowStepBuilder], edit: Union[Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable], ForwardRef(None)] = None, save: Union[Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable], ForwardRef(None)] = None, execute: Union[Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable], ForwardRef(None)] = None) +
    +
    +

    Registers a new Workflow Step listener. +Unlike others, this method doesn't behave as a decorator. +If you want to register a workflow step by a decorator, use AsyncWorkflowStepBuilder's methods.

    +
    # Create a new WorkflowStep instance
    +from slack_bolt.workflows.async_step import AsyncWorkflowStep
    +ws = AsyncWorkflowStep(
    +    callback_id="add_task",
    +    edit=edit,
    +    save=save,
    +    execute=execute,
    +)
    +# Pass Step to set up listeners
    +app.step(ws)
    +
    +

    Refer to https://api.slack.com/workflows/steps for details of Steps from Apps.

    +

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document. +For further information about AsyncWorkflowStep specific function arguments +such as configure, update, complete, and fail, +refer to the async prefixed ones in slack_bolt.workflows.step.utilities API documents.

    +

    Args

    +
    +
    callback_id
    +
    The Callback ID for this workflow step
    +
    edit
    +
    The function for displaying a modal in the Workflow Builder
    +
    save
    +
    The function for handling configuration in the Workflow Builder
    +
    execute
    +
    The function for handling the step execution
    +
    +
    + +Expand source code + +
    def step(
    +    self,
    +    callback_id: Union[str, Pattern, AsyncWorkflowStep, AsyncWorkflowStepBuilder],
    +    edit: Optional[
    +        Union[
    +            Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable]
    +        ]
    +    ] = None,
    +    save: Optional[
    +        Union[
    +            Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable]
    +        ]
    +    ] = None,
    +    execute: Optional[
    +        Union[
    +            Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable]
    +        ]
    +    ] = None,
    +):
    +    """
    +    Registers a new Workflow Step listener.
    +    Unlike others, this method doesn't behave as a decorator.
    +    If you want to register a workflow step by a decorator, use `AsyncWorkflowStepBuilder`'s methods.
    +
    +        # Create a new WorkflowStep instance
    +        from slack_bolt.workflows.async_step import AsyncWorkflowStep
    +        ws = AsyncWorkflowStep(
    +            callback_id="add_task",
    +            edit=edit,
    +            save=save,
    +            execute=execute,
    +        )
    +        # Pass Step to set up listeners
    +        app.step(ws)
    +
    +    Refer to https://api.slack.com/workflows/steps for details of Steps from Apps.
    +
    +    To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document.
    +    For further information about AsyncWorkflowStep specific function arguments
    +    such as `configure`, `update`, `complete`, and `fail`,
    +    refer to the `async` prefixed ones in `slack_bolt.workflows.step.utilities` API documents.
    +
    +    Args:
    +        callback_id: The Callback ID for this workflow step
    +        edit: The function for displaying a modal in the Workflow Builder
    +        save: The function for handling configuration in the Workflow Builder
    +        execute: The function for handling the step execution
    +    """
    +    step = callback_id
    +    if isinstance(callback_id, (str, Pattern)):
    +        step = AsyncWorkflowStep(
    +            callback_id=callback_id,
    +            edit=edit,
    +            save=save,
    +            execute=execute,
    +            base_logger=self._base_logger,
    +        )
    +    elif isinstance(step, AsyncWorkflowStepBuilder):
    +        step = step.build(base_logger=self._base_logger)
    +    elif not isinstance(step, AsyncWorkflowStep):
    +        raise BoltError(f"Invalid step object ({type(step)})")
    +
    +    self.use(AsyncWorkflowStepMiddleware(step, self._async_listener_runner))
    +
    +
    +
    +def use(self, *args) ‑> Optional[Callable] +
    +
    +

    Refer to AsyncApp#middleware() method's docstring for details.

    +
    + +Expand source code + +
    def use(self, *args) -> Optional[Callable]:
    +    """Refer to `AsyncApp#middleware()` method's docstring for details."""
    +    return self.middleware(*args)
    +
    +
    +
    +def view(self, constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]] +
    +
    +

    Registers a new view_submission/view_closed event listener. +This method can be used as either a decorator or a method.

    +
    # Use this method as a decorator
    +@app.view("view_1")
    +async def handle_submission(ack, body, client, view):
    +    # Assume there's an input block with <code>block\_c</code> as the block_id and <code>dreamy\_input</code>
    +    hopes_and_dreams = view["state"]["values"]["block_c"]["dreamy_input"]
    +    user = body["user"]["id"]
    +    # Validate the inputs
    +    errors = {}
    +    if hopes_and_dreams is not None and len(hopes_and_dreams) <= 5:
    +        errors["block_c"] = "The value must be longer than 5 characters"
    +    if len(errors) > 0:
    +        await ack(response_action="errors", errors=errors)
    +        return
    +    # Acknowledge the view_submission event and close the modal
    +    await ack()
    +    # Do whatever you want with the input data - here we're saving it to a DB
    +
    +# Pass a function to this method
    +app.view("view_1")(handle_submission)
    +
    +

    Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads.

    +

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    +

    Args

    +
    +
    constraints
    +
    The conditions that match a request payload
    +
    matchers
    +
    A list of listener matcher functions. +Only when all the matchers return True, the listener function can be invoked.
    +
    middleware
    +
    A list of lister middleware functions. +Only when all the middleware call next() method, the listener function can be invoked.
    +
    +
    + +Expand source code + +
    def view(
    +    self,
    +    constraints: Union[str, Pattern, Dict[str, Union[str, Pattern]]],
    +    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +    """Registers a new `view_submission`/`view_closed` event listener.
    +    This method can be used as either a decorator or a method.
    +
    +        # Use this method as a decorator
    +        @app.view("view_1")
    +        async def handle_submission(ack, body, client, view):
    +            # Assume there's an input block with `block_c` as the block_id and `dreamy_input`
    +            hopes_and_dreams = view["state"]["values"]["block_c"]["dreamy_input"]
    +            user = body["user"]["id"]
    +            # Validate the inputs
    +            errors = {}
    +            if hopes_and_dreams is not None and len(hopes_and_dreams) <= 5:
    +                errors["block_c"] = "The value must be longer than 5 characters"
    +            if len(errors) > 0:
    +                await ack(response_action="errors", errors=errors)
    +                return
    +            # Acknowledge the view_submission event and close the modal
    +            await ack()
    +            # Do whatever you want with the input data - here we're saving it to a DB
    +
    +        # Pass a function to this method
    +        app.view("view_1")(handle_submission)
    +
    +    Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads.
    +
    +    To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document.
    +
    +    Args:
    +        constraints: The conditions that match a request payload
    +        matchers: A list of listener matcher functions.
    +            Only when all the matchers return True, the listener function can be invoked.
    +        middleware: A list of lister middleware functions.
    +            Only when all the middleware call `next()` method, the listener function can be invoked.
    +    """
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.view(
    +            constraints, asyncio=True, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def view_closed(self, constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]] +
    +
    +

    Registers a new view_closed listener. +Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.

    +
    + +Expand source code + +
    def view_closed(
    +    self,
    +    constraints: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +    """Registers a new `view_closed` listener.
    +    Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details."""
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.view_closed(
    +            constraints, asyncio=True, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def view_submission(self, constraints: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]] +
    +
    +

    Registers a new view_submission listener. +Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.

    +
    + +Expand source code + +
    def view_submission(
    +    self,
    +    constraints: Union[str, Pattern],
    +    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
    +    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
    +) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    +    """Registers a new `view_submission` listener.
    +    Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details."""
    +
    +    def __call__(*args, **kwargs):
    +        functions = self._to_listener_functions(kwargs) if kwargs else list(args)
    +        primary_matcher = builtin_matchers.view_submission(
    +            constraints, asyncio=True, base_logger=self._base_logger
    +        )
    +        return self._register_listener(
    +            list(functions), primary_matcher, matchers, middleware
    +        )
    +
    +    return __call__
    +
    +
    +
    +def web_app(self, path: str = '/slack/events') ‑> aiohttp.web_app.Application +
    +
    +

    Returns a web.Application instance for aiohttp-devtools users.

    +
    from slack_bolt.async_app import AsyncApp
    +app = AsyncApp()
    +
    +@app.event("app_mention")
    +async def event_test(body, say, logger):
    +    logger.info(body)
    +    await say("What's up?")
    +
    +def app_factory():
    +    return app.web_app()
    +
    +# adev runserver --port 3000 --app-factory app_factory async_app.py
    +
    +

    Args

    +
    +
    path
    +
    The path to receive incoming requests from Slack
    +
    +
    + +Expand source code + +
    def web_app(self, path: str = "/slack/events") -> web.Application:
    +    """Returns a `web.Application` instance for aiohttp-devtools users.
    +
    +        from slack_bolt.async_app import AsyncApp
    +        app = AsyncApp()
    +
    +        @app.event("app_mention")
    +        async def event_test(body, say, logger):
    +            logger.info(body)
    +            await say("What's up?")
    +
    +        def app_factory():
    +            return app.web_app()
    +
    +        # adev runserver --port 3000 --app-factory app_factory async_app.py
    +
    +    Args:
    +        path: The path to receive incoming requests from Slack
    +    """
    +    return self.server(path=path).web_app
    +
    +
    + + +
    +class AsyncBoltContext +(*args, **kwargs) +
    +
    +

    Context object associated with a request from Slack.

    +
    + +Expand source code + +
    class AsyncBoltContext(BaseContext):
    +    """Context object associated with a request from Slack."""
    +
    +    def to_copyable(self) -> "AsyncBoltContext":
    +        new_dict = {}
    +        for prop_name, prop_value in self.items():
    +            if prop_name in self.standard_property_names:
    +                # all the standard properties are copiable
    +                new_dict[prop_name] = prop_value
    +            else:
    +                try:
    +                    copied_value = create_copy(prop_value)
    +                    new_dict[prop_name] = copied_value
    +                except TypeError as te:
    +                    self.logger.debug(
    +                        f"Skipped settings '{prop_name}' to a copied request for lazy listeners "
    +                        f"as it's not possible to make a deep copy (error: {te})"
    +                    )
    +        return AsyncBoltContext(new_dict)
    +
    +    @property
    +    def client(self) -> Optional[AsyncWebClient]:
    +        """The `AsyncWebClient` instance available for this request.
    +
    +            @app.event("app_mention")
    +            async def handle_events(context):
    +                await context.client.chat_postMessage(
    +                    channel=context.channel_id,
    +                    text="Thanks!",
    +                )
    +
    +            # You can access "client" this way too.
    +            @app.event("app_mention")
    +            async def handle_events(client, context):
    +                await client.chat_postMessage(
    +                    channel=context.channel_id,
    +                    text="Thanks!",
    +                )
    +
    +        Returns:
    +            `AsyncWebClient` instance
    +        """
    +        if "client" not in self:
    +            self["client"] = AsyncWebClient(token=None)
    +        return self["client"]
    +
    +    @property
    +    def ack(self) -> AsyncAck:
    +        """`ack()` function for this request.
    +
    +            @app.action("button")
    +            async def handle_button_clicks(context):
    +                await context.ack()
    +
    +            # You can access "ack" this way too.
    +            @app.action("button")
    +            async def handle_button_clicks(ack):
    +                await ack()
    +
    +        Returns:
    +            Callable `ack()` function
    +        """
    +        if "ack" not in self:
    +            self["ack"] = AsyncAck()
    +        return self["ack"]
    +
    +    @property
    +    def say(self) -> AsyncSay:
    +        """`say()` function for this request.
    +
    +            @app.action("button")
    +            async def handle_button_clicks(context):
    +                await context.ack()
    +                await context.say("Hi!")
    +
    +            # You can access "ack" this way too.
    +            @app.action("button")
    +            async def handle_button_clicks(ack, say):
    +                await ack()
    +                await say("Hi!")
    +
    +        Returns:
    +            Callable `say()` function
    +        """
    +        if "say" not in self:
    +            self["say"] = AsyncSay(client=self.client, channel=self.channel_id)
    +        return self["say"]
    +
    +    @property
    +    def respond(self) -> Optional[AsyncRespond]:
    +        """`respond()` function for this request.
    +
    +            @app.action("button")
    +            async def handle_button_clicks(context):
    +                await context.ack()
    +                await context.respond("Hi!")
    +
    +            # You can access "ack" this way too.
    +            @app.action("button")
    +            async def handle_button_clicks(ack, respond):
    +                await ack()
    +                await respond("Hi!")
    +
    +        Returns:
    +            Callable `respond()` function
    +        """
    +        if "respond" not in self:
    +            self["respond"] = AsyncRespond(
    +                response_url=self.response_url,
    +                proxy=self.client.proxy,
    +                ssl=self.client.ssl,
    +            )
    +        return self["respond"]
    +
    +

    Ancestors

    + +

    Instance variables

    +
    +
    var ackAsyncAck
    +
    +

    ack() function for this request.

    +
    @app.action("button")
    +async def handle_button_clicks(context):
    +    await context.ack()
    +
    +# You can access "ack" this way too.
    +@app.action("button")
    +async def handle_button_clicks(ack):
    +    await ack()
    +
    +

    Returns

    +

    Callable ack() function

    +
    + +Expand source code + +
    @property
    +def ack(self) -> AsyncAck:
    +    """`ack()` function for this request.
    +
    +        @app.action("button")
    +        async def handle_button_clicks(context):
    +            await context.ack()
    +
    +        # You can access "ack" this way too.
    +        @app.action("button")
    +        async def handle_button_clicks(ack):
    +            await ack()
    +
    +    Returns:
    +        Callable `ack()` function
    +    """
    +    if "ack" not in self:
    +        self["ack"] = AsyncAck()
    +    return self["ack"]
    +
    +
    +
    var client : Optional[slack_sdk.web.async_client.AsyncWebClient]
    +
    +

    The AsyncWebClient instance available for this request.

    +
    @app.event("app_mention")
    +async def handle_events(context):
    +    await context.client.chat_postMessage(
    +        channel=context.channel_id,
    +        text="Thanks!",
    +    )
    +
    +# You can access "client" this way too.
    +@app.event("app_mention")
    +async def handle_events(client, context):
    +    await client.chat_postMessage(
    +        channel=context.channel_id,
    +        text="Thanks!",
    +    )
    +
    +

    Returns

    +

    AsyncWebClient instance

    +
    + +Expand source code + +
    @property
    +def client(self) -> Optional[AsyncWebClient]:
    +    """The `AsyncWebClient` instance available for this request.
    +
    +        @app.event("app_mention")
    +        async def handle_events(context):
    +            await context.client.chat_postMessage(
    +                channel=context.channel_id,
    +                text="Thanks!",
    +            )
    +
    +        # You can access "client" this way too.
    +        @app.event("app_mention")
    +        async def handle_events(client, context):
    +            await client.chat_postMessage(
    +                channel=context.channel_id,
    +                text="Thanks!",
    +            )
    +
    +    Returns:
    +        `AsyncWebClient` instance
    +    """
    +    if "client" not in self:
    +        self["client"] = AsyncWebClient(token=None)
    +    return self["client"]
    +
    +
    +
    var respond : Optional[AsyncRespond]
    +
    +

    respond() function for this request.

    +
    @app.action("button")
    +async def handle_button_clicks(context):
    +    await context.ack()
    +    await context.respond("Hi!")
    +
    +# You can access "ack" this way too.
    +@app.action("button")
    +async def handle_button_clicks(ack, respond):
    +    await ack()
    +    await respond("Hi!")
    +
    +

    Returns

    +

    Callable respond() function

    +
    + +Expand source code + +
    @property
    +def respond(self) -> Optional[AsyncRespond]:
    +    """`respond()` function for this request.
    +
    +        @app.action("button")
    +        async def handle_button_clicks(context):
    +            await context.ack()
    +            await context.respond("Hi!")
    +
    +        # You can access "ack" this way too.
    +        @app.action("button")
    +        async def handle_button_clicks(ack, respond):
    +            await ack()
    +            await respond("Hi!")
    +
    +    Returns:
    +        Callable `respond()` function
    +    """
    +    if "respond" not in self:
    +        self["respond"] = AsyncRespond(
    +            response_url=self.response_url,
    +            proxy=self.client.proxy,
    +            ssl=self.client.ssl,
    +        )
    +    return self["respond"]
    +
    +
    +
    var sayAsyncSay
    +
    +

    say() function for this request.

    +
    @app.action("button")
    +async def handle_button_clicks(context):
    +    await context.ack()
    +    await context.say("Hi!")
    +
    +# You can access "ack" this way too.
    +@app.action("button")
    +async def handle_button_clicks(ack, say):
    +    await ack()
    +    await say("Hi!")
    +
    +

    Returns

    +

    Callable say() function

    +
    + +Expand source code + +
    @property
    +def say(self) -> AsyncSay:
    +    """`say()` function for this request.
    +
    +        @app.action("button")
    +        async def handle_button_clicks(context):
    +            await context.ack()
    +            await context.say("Hi!")
    +
    +        # You can access "ack" this way too.
    +        @app.action("button")
    +        async def handle_button_clicks(ack, say):
    +            await ack()
    +            await say("Hi!")
    +
    +    Returns:
    +        Callable `say()` function
    +    """
    +    if "say" not in self:
    +        self["say"] = AsyncSay(client=self.client, channel=self.channel_id)
    +    return self["say"]
    +
    +
    +
    +

    Methods

    +
    +
    +def to_copyable(self) ‑> AsyncBoltContext +
    +
    +
    +
    + +Expand source code + +
    def to_copyable(self) -> "AsyncBoltContext":
    +    new_dict = {}
    +    for prop_name, prop_value in self.items():
    +        if prop_name in self.standard_property_names:
    +            # all the standard properties are copiable
    +            new_dict[prop_name] = prop_value
    +        else:
    +            try:
    +                copied_value = create_copy(prop_value)
    +                new_dict[prop_name] = copied_value
    +            except TypeError as te:
    +                self.logger.debug(
    +                    f"Skipped settings '{prop_name}' to a copied request for lazy listeners "
    +                    f"as it's not possible to make a deep copy (error: {te})"
    +                )
    +    return AsyncBoltContext(new_dict)
    +
    +
    +
    +

    Inherited members

    + +
    +
    +class AsyncBoltRequest +(*, body: Union[str, dict], query: Union[str, Dict[str, str], Dict[str, Sequence[str]], ForwardRef(None)] = None, headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, context: Optional[Dict[str, str]] = None, mode: str = 'http') +
    +
    +

    Request to a Bolt app.

    +

    Args

    +
    +
    body
    +
    The raw request body (only plain text is supported for "http" mode)
    +
    query
    +
    The query string data in any data format.
    +
    headers
    +
    The request headers.
    +
    context
    +
    The context in this request.
    +
    mode
    +
    The mode used for this request. (either "http" or "socket_mode")
    +
    +
    + +Expand source code + +
    class AsyncBoltRequest:
    +    raw_body: str
    +    body: Dict[str, Any]
    +    query: Dict[str, Sequence[str]]
    +    headers: Dict[str, Sequence[str]]
    +    content_type: Optional[str]
    +    context: AsyncBoltContext
    +    lazy_only: bool
    +    lazy_function_name: Optional[str]
    +    mode: str  # either "http" or "socket_mode"
    +
    +    def __init__(
    +        self,
    +        *,
    +        body: Union[str, dict],
    +        query: Optional[Union[str, Dict[str, str], Dict[str, Sequence[str]]]] = None,
    +        headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None,
    +        context: Optional[Dict[str, str]] = None,
    +        mode: str = "http",  # either "http" or "socket_mode"
    +    ):
    +        """Request to a Bolt app.
    +
    +        Args:
    +            body: The raw request body (only plain text is supported for "http" mode)
    +            query: The query string data in any data format.
    +            headers: The request headers.
    +            context: The context in this request.
    +            mode: The mode used for this request. (either "http" or "socket_mode")
    +        """
    +
    +        if mode == "http":
    +            # HTTP Mode
    +            if body is not None and not isinstance(body, str):
    +                raise BoltError(error_message_raw_body_required_in_http_mode())
    +            self.raw_body = body if body is not None else ""
    +        else:
    +            # Socket Mode
    +            if body is not None and isinstance(body, str):
    +                self.raw_body = body
    +            else:
    +                # We don't convert the dict value to str
    +                # as doing so does not guarantee to keep the original structure/format.
    +                self.raw_body = ""
    +
    +        self.query = parse_query(query)
    +        self.headers = build_normalized_headers(headers)
    +        self.content_type = extract_content_type(self.headers)
    +
    +        if isinstance(body, str):
    +            self.body = parse_body(self.raw_body, self.content_type)
    +        elif isinstance(body, dict):
    +            self.body = body
    +        else:
    +            self.body = {}
    +
    +        self.context = build_async_context(
    +            AsyncBoltContext(context if context else {}), self.body
    +        )
    +        self.lazy_only = bool(self.headers.get("x-slack-bolt-lazy-only", [False])[0])
    +        self.lazy_function_name = self.headers.get(
    +            "x-slack-bolt-lazy-function-name", [None]
    +        )[0]
    +        self.mode = mode
    +
    +    def to_copyable(self) -> "AsyncBoltRequest":
    +        body: Union[str, dict] = self.raw_body if self.mode == "http" else self.body
    +        return AsyncBoltRequest(
    +            body=body,
    +            query=self.query,
    +            headers=self.headers,
    +            context=self.context.to_copyable(),
    +            mode=self.mode,
    +        )
    +
    +

    Class variables

    +
    +
    var body : Dict[str, Any]
    +
    +
    +
    +
    var content_type : Optional[str]
    +
    +
    +
    +
    var contextAsyncBoltContext
    +
    +
    +
    +
    var headers : Dict[str, Sequence[str]]
    +
    +
    +
    +
    var lazy_function_name : Optional[str]
    +
    +
    +
    +
    var lazy_only : bool
    +
    +
    +
    +
    var mode : str
    +
    +
    +
    +
    var query : Dict[str, Sequence[str]]
    +
    +
    +
    +
    var raw_body : str
    +
    +
    +
    +
    +

    Methods

    +
    +
    +def to_copyable(self) ‑> AsyncBoltRequest +
    +
    +
    +
    + +Expand source code + +
    def to_copyable(self) -> "AsyncBoltRequest":
    +    body: Union[str, dict] = self.raw_body if self.mode == "http" else self.body
    +    return AsyncBoltRequest(
    +        body=body,
    +        query=self.query,
    +        headers=self.headers,
    +        context=self.context.to_copyable(),
    +        mode=self.mode,
    +    )
    +
    +
    +
    +
    +
    +class AsyncCustomListenerMatcher +(*, app_name: str, func: Callable[..., Awaitable[bool]], base_logger: Optional[logging.Logger] = None) +
    +
    +
    +
    + +Expand source code + +
    class AsyncCustomListenerMatcher(AsyncListenerMatcher):
    +    app_name: str
    +    func: Callable[..., Awaitable[bool]]
    +    arg_names: Sequence[str]
    +    logger: Logger
    +
    +    def __init__(
    +        self,
    +        *,
    +        app_name: str,
    +        func: Callable[..., Awaitable[bool]],
    +        base_logger: Optional[Logger] = None
    +    ):
    +        self.app_name = app_name
    +        self.func = func
    +        self.arg_names = inspect.getfullargspec(func).args
    +        self.logger = get_bolt_app_logger(self.app_name, self.func, base_logger)
    +
    +    async def async_matches(self, req: AsyncBoltRequest, resp: BoltResponse) -> bool:
    +        return await self.func(
    +            **build_async_required_kwargs(
    +                logger=self.logger,
    +                required_arg_names=self.arg_names,
    +                request=req,
    +                response=resp,
    +                this_func=self.func,
    +            )
    +        )
    +
    +

    Ancestors

    + +

    Class variables

    +
    +
    var app_name : str
    +
    +
    +
    +
    var arg_names : Sequence[str]
    +
    +
    +
    +
    var func : Callable[..., Awaitable[bool]]
    +
    +
    +
    +
    var logger : logging.Logger
    +
    +
    +
    +
    +

    Inherited members

    + +
    +
    +class AsyncListener +
    +
    +
    +
    + +Expand source code + +
    class AsyncListener(metaclass=ABCMeta):
    +    matchers: Sequence[AsyncListenerMatcher]
    +    middleware: Sequence[AsyncMiddleware]
    +    ack_function: Callable[..., Awaitable[BoltResponse]]
    +    lazy_functions: Sequence[Callable[..., Awaitable[None]]]
    +    auto_acknowledgement: bool
    +
    +    async def async_matches(
    +        self,
    +        *,
    +        req: AsyncBoltRequest,
    +        resp: BoltResponse,
    +    ) -> bool:
    +        is_matched: bool = False
    +        for matcher in self.matchers:
    +            is_matched = await matcher.async_matches(req, resp)
    +            if not is_matched:
    +                return is_matched
    +        return is_matched
    +
    +    async def run_async_middleware(
    +        self,
    +        *,
    +        req: AsyncBoltRequest,
    +        resp: BoltResponse,
    +    ) -> Tuple[Optional[BoltResponse], bool]:
    +        """Runs an async middleware.
    +
    +        Args:
    +            req: The incoming request
    +            resp: The current response
    +
    +        Returns:
    +            A tuple of the processed response and a flag indicating termination
    +        """
    +        for m in self.middleware:
    +            middleware_state = {"next_called": False}
    +
    +            async def _next():
    +                middleware_state["next_called"] = True
    +
    +            resp = await m.async_process(req=req, resp=resp, next=_next)
    +            if not middleware_state["next_called"]:
    +                # next() was not called in this middleware
    +                return (resp, True)
    +        return (resp, False)
    +
    +    @abstractmethod
    +    async def run_ack_function(
    +        self, *, request: AsyncBoltRequest, response: BoltResponse
    +    ) -> BoltResponse:
    +        """Runs all the registered middleware and then run the listener function.
    +
    +        Args:
    +            request: The incoming request
    +            response: The current response
    +
    +        Returns:
    +            The processed response
    +        """
    +        raise NotImplementedError()
    +
    +

    Subclasses

    + +

    Class variables

    +
    +
    var ack_function : Callable[..., Awaitable[BoltResponse]]
    +
    +
    +
    +
    var auto_acknowledgement : bool
    +
    +
    +
    +
    var lazy_functions : Sequence[Callable[..., Awaitable[None]]]
    +
    +
    +
    +
    var matchers : Sequence[AsyncListenerMatcher]
    +
    +
    +
    +
    var middleware : Sequence[AsyncMiddleware]
    +
    +
    +
    +
    +

    Methods

    +
    +
    +async def async_matches(self, *, req: AsyncBoltRequest, resp: BoltResponse) ‑> bool +
    +
    +
    +
    + +Expand source code + +
    async def async_matches(
    +    self,
    +    *,
    +    req: AsyncBoltRequest,
    +    resp: BoltResponse,
    +) -> bool:
    +    is_matched: bool = False
    +    for matcher in self.matchers:
    +        is_matched = await matcher.async_matches(req, resp)
    +        if not is_matched:
    +            return is_matched
    +    return is_matched
    +
    +
    +
    +async def run_ack_function(self, *, request: AsyncBoltRequest, response: BoltResponse) ‑> BoltResponse +
    +
    +

    Runs all the registered middleware and then run the listener function.

    +

    Args

    +
    +
    request
    +
    The incoming request
    +
    response
    +
    The current response
    +
    +

    Returns

    +

    The processed response

    +
    + +Expand source code + +
    @abstractmethod
    +async def run_ack_function(
    +    self, *, request: AsyncBoltRequest, response: BoltResponse
    +) -> BoltResponse:
    +    """Runs all the registered middleware and then run the listener function.
    +
    +    Args:
    +        request: The incoming request
    +        response: The current response
    +
    +    Returns:
    +        The processed response
    +    """
    +    raise NotImplementedError()
    +
    +
    +
    +async def run_async_middleware(self, *, req: AsyncBoltRequest, resp: BoltResponse) ‑> Tuple[Optional[BoltResponse], bool] +
    +
    +

    Runs an async middleware.

    +

    Args

    +
    +
    req
    +
    The incoming request
    +
    resp
    +
    The current response
    +
    +

    Returns

    +

    A tuple of the processed response and a flag indicating termination

    +
    + +Expand source code + +
    async def run_async_middleware(
    +    self,
    +    *,
    +    req: AsyncBoltRequest,
    +    resp: BoltResponse,
    +) -> Tuple[Optional[BoltResponse], bool]:
    +    """Runs an async middleware.
    +
    +    Args:
    +        req: The incoming request
    +        resp: The current response
    +
    +    Returns:
    +        A tuple of the processed response and a flag indicating termination
    +    """
    +    for m in self.middleware:
    +        middleware_state = {"next_called": False}
    +
    +        async def _next():
    +            middleware_state["next_called"] = True
    +
    +        resp = await m.async_process(req=req, resp=resp, next=_next)
    +        if not middleware_state["next_called"]:
    +            # next() was not called in this middleware
    +            return (resp, True)
    +    return (resp, False)
    +
    +
    +
    +
    +
    +class AsyncRespond +(*, response_url: Optional[str], proxy: Optional[str] = None, ssl: Optional[ssl.SSLContext] = None) +
    +
    +
    +
    + +Expand source code + +
    class AsyncRespond:
    +    response_url: Optional[str]
    +    proxy: Optional[str]
    +    ssl: Optional[SSLContext]
    +
    +    def __init__(
    +        self,
    +        *,
    +        response_url: Optional[str],
    +        proxy: Optional[str] = None,
    +        ssl: Optional[SSLContext] = None,
    +    ):
    +        self.response_url = response_url
    +        self.proxy = proxy
    +        self.ssl = ssl
    +
    +    async def __call__(
    +        self,
    +        text: Union[str, dict] = "",
    +        blocks: Optional[Sequence[Union[dict, Block]]] = None,
    +        attachments: Optional[Sequence[Union[dict, Attachment]]] = None,
    +        response_type: Optional[str] = None,
    +        replace_original: Optional[bool] = None,
    +        delete_original: Optional[bool] = None,
    +        unfurl_links: Optional[bool] = None,
    +        unfurl_media: Optional[bool] = None,
    +    ) -> WebhookResponse:
    +        if self.response_url is not None:
    +            client = AsyncWebhookClient(
    +                url=self.response_url,
    +                proxy=self.proxy,
    +                ssl=self.ssl,
    +            )
    +            text_or_whole_response: Union[str, dict] = text
    +            if isinstance(text_or_whole_response, str):
    +                message = _build_message(
    +                    text=text,
    +                    blocks=blocks,
    +                    attachments=attachments,
    +                    response_type=response_type,
    +                    replace_original=replace_original,
    +                    delete_original=delete_original,
    +                    unfurl_links=unfurl_links,
    +                    unfurl_media=unfurl_media,
    +                )
    +                return await client.send_dict(message)
    +            elif isinstance(text_or_whole_response, dict):
    +                whole_response: dict = text_or_whole_response
    +                message = _build_message(**whole_response)
    +                return await client.send_dict(message)
    +            else:
    +                raise ValueError(f"The arg is unexpected type ({type(text)})")
    +        else:
    +            raise ValueError("respond is unsupported here as there is no response_url")
    +
    +

    Class variables

    +
    +
    var proxy : Optional[str]
    +
    +
    +
    +
    var response_url : Optional[str]
    +
    +
    +
    +
    var ssl : Optional[ssl.SSLContext]
    +
    +
    +
    +
    +
    +
    +class AsyncSay +(client: Optional[slack_sdk.web.async_client.AsyncWebClient], channel: Optional[str]) +
    +
    +
    +
    + +Expand source code + +
    class AsyncSay:
    +    client: Optional[AsyncWebClient]
    +    channel: Optional[str]
    +
    +    def __init__(
    +        self,
    +        client: Optional[AsyncWebClient],
    +        channel: Optional[str],
    +    ):
    +        self.client = client
    +        self.channel = channel
    +
    +    async def __call__(
    +        self,
    +        text: Union[str, dict] = "",
    +        blocks: Optional[Sequence[Union[Dict, Block]]] = None,
    +        attachments: Optional[Sequence[Union[Dict, Attachment]]] = None,
    +        channel: Optional[str] = None,
    +        thread_ts: Optional[str] = None,
    +        unfurl_links: Optional[bool] = None,
    +        unfurl_media: Optional[bool] = None,
    +        **kwargs,
    +    ) -> AsyncSlackResponse:
    +        if _can_say(self, channel):
    +            text_or_whole_response: Union[str, dict] = text
    +            if isinstance(text_or_whole_response, str):
    +                text = text_or_whole_response
    +                return await self.client.chat_postMessage(
    +                    channel=channel or self.channel,
    +                    text=text,
    +                    blocks=blocks,
    +                    attachments=attachments,
    +                    thread_ts=thread_ts,
    +                    unfurl_links=unfurl_links,
    +                    unfurl_media=unfurl_media,
    +                    **kwargs,
    +                )
    +            elif isinstance(text_or_whole_response, dict):
    +                message: dict = text_or_whole_response
    +                if "channel" not in message:
    +                    message["channel"] = channel or self.channel
    +                return await self.client.chat_postMessage(**message)
    +            else:
    +                raise ValueError(
    +                    f"The arg is unexpected type ({type(text_or_whole_response)})"
    +                )
    +        else:
    +            raise ValueError("say without channel_id here is unsupported")
    +
    +

    Class variables

    +
    +
    var channel : Optional[str]
    +
    +
    +
    +
    var client : Optional[slack_sdk.web.async_client.AsyncWebClient]
    +
    +
    +
    +
    +
    +
    diff --git a/docs/api-docs/slack_bolt/authorization/index.html b/docs/api-docs/slack_bolt/authorization/index.html index 6352b61c5..df47f7e82 100644 --- a/docs/api-docs/slack_bolt/authorization/index.html +++ b/docs/api-docs/slack_bolt/authorization/index.html @@ -35,7 +35,11 @@

    Module slack_bolt.authorization

    Refer to https://slack.dev/bolt-python/concepts#authorization for details. """ -from .authorize_result import AuthorizeResult # noqa
    +from .authorize_result import AuthorizeResult + +__all__ = [ + "AuthorizeResult", +]
    @@ -68,6 +72,185 @@

    Sub-modules

    +

    Classes

    +
    +
    +class AuthorizeResult +(*, enterprise_id: Optional[str], team_id: Optional[str], bot_user_id: Optional[str] = None, bot_id: Optional[str] = None, bot_token: Optional[str] = None, user_id: Optional[str] = None, user_token: Optional[str] = None) +
    +
    +

    Authorize function call result

    +

    Args

    +
    +
    enterprise_id
    +
    Organization ID (Enterprise Grid) starting with E
    +
    team_id
    +
    Workspace ID starting with T
    +
    bot_user_id
    +
    Bot user's User ID starting with either U or W
    +
    bot_id
    +
    Bot ID starting with B
    +
    bot_token
    +
    Bot user access token starting with xoxb-
    +
    user_id
    +
    The request user ID
    +
    user_token
    +
    User access token starting with xoxp-
    +
    +
    + +Expand source code + +
    class AuthorizeResult(dict):
    +    """Authorize function call result"""
    +
    +    enterprise_id: Optional[str]
    +    team_id: Optional[str]
    +    bot_id: Optional[str]
    +    bot_user_id: Optional[str]
    +    bot_token: Optional[str]
    +    user_id: Optional[str]
    +    user_token: Optional[str]
    +
    +    def __init__(
    +        self,
    +        *,
    +        enterprise_id: Optional[str],
    +        team_id: Optional[str],
    +        # bot
    +        bot_user_id: Optional[str] = None,
    +        bot_id: Optional[str] = None,
    +        bot_token: Optional[str] = None,
    +        # user
    +        user_id: Optional[str] = None,
    +        user_token: Optional[str] = None,
    +    ):
    +        """
    +        Args:
    +            enterprise_id: Organization ID (Enterprise Grid) starting with `E`
    +            team_id: Workspace ID starting with `T`
    +            bot_user_id: Bot user's User ID starting with either `U` or `W`
    +            bot_id: Bot ID starting with `B`
    +            bot_token: Bot user access token starting with `xoxb-`
    +            user_id: The request user ID
    +            user_token: User access token starting with `xoxp-`
    +        """
    +        self["enterprise_id"] = self.enterprise_id = enterprise_id
    +        self["team_id"] = self.team_id = team_id
    +        # bot
    +        self["bot_user_id"] = self.bot_user_id = bot_user_id
    +        self["bot_id"] = self.bot_id = bot_id
    +        self["bot_token"] = self.bot_token = bot_token
    +        # user
    +        self["user_id"] = self.user_id = user_id
    +        self["user_token"] = self.user_token = user_token
    +
    +    @classmethod
    +    def from_auth_test_response(
    +        cls,
    +        *,
    +        bot_token: Optional[str] = None,
    +        user_token: Optional[str] = None,
    +        auth_test_response: SlackResponse,
    +    ) -> "AuthorizeResult":
    +        bot_user_id: Optional[str] = (  # type:ignore
    +            auth_test_response.get("user_id")
    +            if auth_test_response.get("bot_id") is not None
    +            else None
    +        )
    +        user_id: Optional[str] = (  # type:ignore
    +            auth_test_response.get("user_id")
    +            if auth_test_response.get("bot_id") is None
    +            else None
    +        )
    +        return AuthorizeResult(
    +            enterprise_id=auth_test_response.get("enterprise_id"),
    +            team_id=auth_test_response.get("team_id"),
    +            bot_id=auth_test_response.get("bot_id"),
    +            bot_user_id=bot_user_id,
    +            user_id=user_id,
    +            bot_token=bot_token,
    +            user_token=user_token,
    +        )
    +
    +

    Ancestors

    +
      +
    • builtins.dict
    • +
    +

    Class variables

    +
    +
    var bot_id : Optional[str]
    +
    +
    +
    +
    var bot_token : Optional[str]
    +
    +
    +
    +
    var bot_user_id : Optional[str]
    +
    +
    +
    +
    var enterprise_id : Optional[str]
    +
    +
    +
    +
    var team_id : Optional[str]
    +
    +
    +
    +
    var user_id : Optional[str]
    +
    +
    +
    +
    var user_token : Optional[str]
    +
    +
    +
    +
    +

    Static methods

    +
    +
    +def from_auth_test_response(*, bot_token: Optional[str] = None, user_token: Optional[str] = None, auth_test_response: slack_sdk.web.slack_response.SlackResponse) ‑> AuthorizeResult +
    +
    +
    +
    + +Expand source code + +
    @classmethod
    +def from_auth_test_response(
    +    cls,
    +    *,
    +    bot_token: Optional[str] = None,
    +    user_token: Optional[str] = None,
    +    auth_test_response: SlackResponse,
    +) -> "AuthorizeResult":
    +    bot_user_id: Optional[str] = (  # type:ignore
    +        auth_test_response.get("user_id")
    +        if auth_test_response.get("bot_id") is not None
    +        else None
    +    )
    +    user_id: Optional[str] = (  # type:ignore
    +        auth_test_response.get("user_id")
    +        if auth_test_response.get("bot_id") is None
    +        else None
    +    )
    +    return AuthorizeResult(
    +        enterprise_id=auth_test_response.get("enterprise_id"),
    +        team_id=auth_test_response.get("team_id"),
    +        bot_id=auth_test_response.get("bot_id"),
    +        bot_user_id=bot_user_id,
    +        user_id=user_id,
    +        bot_token=bot_token,
    +        user_token=user_token,
    +    )
    +
    +
    +
    +
    +
    diff --git a/docs/api-docs/slack_bolt/context/ack/index.html b/docs/api-docs/slack_bolt/context/ack/index.html index 2d49a6cb2..a75ce98f3 100644 --- a/docs/api-docs/slack_bolt/context/ack/index.html +++ b/docs/api-docs/slack_bolt/context/ack/index.html @@ -27,7 +27,11 @@

    Module slack_bolt.context.ack

    Expand source code
    # Don't add async module imports here
    -from .ack import Ack  # noqa: F401
    +from .ack import Ack + +__all__ = [ + "Ack", +]
    @@ -52,6 +56,63 @@

    Sub-modules

    +

    Classes

    +
    +
    +class Ack +
    +
    +
    +
    + +Expand source code + +
    class Ack:
    +    response: Optional[BoltResponse]
    +
    +    def __init__(self):
    +        self.response: Optional[BoltResponse] = None
    +
    +    def __call__(
    +        self,
    +        text: Union[str, dict] = "",  # text: str or whole_response: dict
    +        blocks: Optional[Sequence[Union[dict, Block]]] = None,
    +        attachments: Optional[Sequence[Union[dict, Attachment]]] = None,
    +        unfurl_links: Optional[bool] = None,
    +        unfurl_media: Optional[bool] = None,
    +        response_type: Optional[str] = None,  # in_channel / ephemeral
    +        # block_suggestion / dialog_suggestion
    +        options: Optional[Sequence[Union[dict, Option]]] = None,
    +        option_groups: Optional[Sequence[Union[dict, OptionGroup]]] = None,
    +        # view_submission
    +        response_action: Optional[str] = None,  # errors / update / push / clear
    +        errors: Optional[Dict[str, str]] = None,
    +        view: Optional[Union[dict, View]] = None,
    +    ) -> BoltResponse:
    +        return _set_response(
    +            self,
    +            text_or_whole_response=text,
    +            blocks=blocks,
    +            attachments=attachments,
    +            unfurl_links=unfurl_links,
    +            unfurl_media=unfurl_media,
    +            response_type=response_type,
    +            options=options,
    +            option_groups=option_groups,
    +            response_action=response_action,
    +            errors=errors,
    +            view=view,
    +        )
    +
    +

    Class variables

    +
    +
    var response : Optional[BoltResponse]
    +
    +
    +
    +
    +
    +
    diff --git a/docs/api-docs/slack_bolt/context/index.html b/docs/api-docs/slack_bolt/context/index.html index 1e2bea874..0ef2c7268 100644 --- a/docs/api-docs/slack_bolt/context/index.html +++ b/docs/api-docs/slack_bolt/context/index.html @@ -39,7 +39,11 @@

    Module slack_bolt.context

    """ # Don't add async module imports here -from .context import BoltContext # noqa: F401 +from .context import BoltContext + +__all__ = [ + "BoltContext", +]
    @@ -76,6 +80,375 @@

    Sub-modules

    +

    Classes

    +
    +
    +class BoltContext +(*args, **kwargs) +
    +
    +

    Context object associated with a request from Slack.

    +
    + +Expand source code + +
    class BoltContext(BaseContext):
    +    """Context object associated with a request from Slack."""
    +
    +    def to_copyable(self) -> "BoltContext":
    +        new_dict = {}
    +        for prop_name, prop_value in self.items():
    +            if prop_name in self.standard_property_names:
    +                # all the standard properties are copiable
    +                new_dict[prop_name] = prop_value
    +            else:
    +                try:
    +                    copied_value = create_copy(prop_value)
    +                    new_dict[prop_name] = copied_value
    +                except TypeError as te:
    +                    self.logger.warning(
    +                        f"Skipped setting '{prop_name}' to a copied request for lazy listeners "
    +                        "due to a deep-copy creation error. Consider passing the value not as part of context object "
    +                        f"(error: {te})"
    +                    )
    +        return BoltContext(new_dict)
    +
    +    @property
    +    def client(self) -> Optional[WebClient]:
    +        """The `WebClient` instance available for this request.
    +
    +            @app.event("app_mention")
    +            def handle_events(context):
    +                context.client.chat_postMessage(
    +                    channel=context.channel_id,
    +                    text="Thanks!",
    +                )
    +
    +            # You can access "client" this way too.
    +            @app.event("app_mention")
    +            def handle_events(client, context):
    +                client.chat_postMessage(
    +                    channel=context.channel_id,
    +                    text="Thanks!",
    +                )
    +
    +        Returns:
    +            `WebClient` instance
    +        """
    +        if "client" not in self:
    +            self["client"] = WebClient(token=None)
    +        return self["client"]
    +
    +    @property
    +    def ack(self) -> Ack:
    +        """`ack()` function for this request.
    +
    +            @app.action("button")
    +            def handle_button_clicks(context):
    +                context.ack()
    +
    +            # You can access "ack" this way too.
    +            @app.action("button")
    +            def handle_button_clicks(ack):
    +                ack()
    +
    +        Returns:
    +            Callable `ack()` function
    +        """
    +        if "ack" not in self:
    +            self["ack"] = Ack()
    +        return self["ack"]
    +
    +    @property
    +    def say(self) -> Say:
    +        """`say()` function for this request.
    +
    +            @app.action("button")
    +            def handle_button_clicks(context):
    +                context.ack()
    +                context.say("Hi!")
    +
    +            # You can access "ack" this way too.
    +            @app.action("button")
    +            def handle_button_clicks(ack, say):
    +                ack()
    +                say("Hi!")
    +
    +        Returns:
    +            Callable `say()` function
    +        """
    +        if "say" not in self:
    +            self["say"] = Say(client=self.client, channel=self.channel_id)
    +        return self["say"]
    +
    +    @property
    +    def respond(self) -> Optional[Respond]:
    +        """`respond()` function for this request.
    +
    +            @app.action("button")
    +            def handle_button_clicks(context):
    +                context.ack()
    +                context.respond("Hi!")
    +
    +            # You can access "ack" this way too.
    +            @app.action("button")
    +            def handle_button_clicks(ack, respond):
    +                ack()
    +                respond("Hi!")
    +
    +        Returns:
    +            Callable `respond()` function
    +        """
    +        if "respond" not in self:
    +            self["respond"] = Respond(
    +                response_url=self.response_url,
    +                proxy=self.client.proxy,
    +                ssl=self.client.ssl,
    +            )
    +        return self["respond"]
    +
    +

    Ancestors

    + +

    Instance variables

    +
    +
    var ackAck
    +
    +

    slack_bolt.context.ack function for this request.

    +
    @app.action("button")
    +def handle_button_clicks(context):
    +    context.ack()
    +
    +# You can access "ack" this way too.
    +@app.action("button")
    +def handle_button_clicks(ack):
    +    ack()
    +
    +

    Returns

    +

    Callable slack_bolt.context.ack function

    +
    + +Expand source code + +
    @property
    +def ack(self) -> Ack:
    +    """`ack()` function for this request.
    +
    +        @app.action("button")
    +        def handle_button_clicks(context):
    +            context.ack()
    +
    +        # You can access "ack" this way too.
    +        @app.action("button")
    +        def handle_button_clicks(ack):
    +            ack()
    +
    +    Returns:
    +        Callable `ack()` function
    +    """
    +    if "ack" not in self:
    +        self["ack"] = Ack()
    +    return self["ack"]
    +
    +
    +
    var client : Optional[slack_sdk.web.client.WebClient]
    +
    +

    The WebClient instance available for this request.

    +
    @app.event("app_mention")
    +def handle_events(context):
    +    context.client.chat_postMessage(
    +        channel=context.channel_id,
    +        text="Thanks!",
    +    )
    +
    +# You can access "client" this way too.
    +@app.event("app_mention")
    +def handle_events(client, context):
    +    client.chat_postMessage(
    +        channel=context.channel_id,
    +        text="Thanks!",
    +    )
    +
    +

    Returns

    +

    WebClient instance

    +
    + +Expand source code + +
    @property
    +def client(self) -> Optional[WebClient]:
    +    """The `WebClient` instance available for this request.
    +
    +        @app.event("app_mention")
    +        def handle_events(context):
    +            context.client.chat_postMessage(
    +                channel=context.channel_id,
    +                text="Thanks!",
    +            )
    +
    +        # You can access "client" this way too.
    +        @app.event("app_mention")
    +        def handle_events(client, context):
    +            client.chat_postMessage(
    +                channel=context.channel_id,
    +                text="Thanks!",
    +            )
    +
    +    Returns:
    +        `WebClient` instance
    +    """
    +    if "client" not in self:
    +        self["client"] = WebClient(token=None)
    +    return self["client"]
    +
    +
    +
    var respond : Optional[Respond]
    +
    +

    slack_bolt.context.respond function for this request.

    +
    @app.action("button")
    +def handle_button_clicks(context):
    +    context.ack()
    +    context.respond("Hi!")
    +
    +# You can access "ack" this way too.
    +@app.action("button")
    +def handle_button_clicks(ack, respond):
    +    ack()
    +    respond("Hi!")
    +
    +

    Returns

    +

    Callable slack_bolt.context.respond function

    +
    + +Expand source code + +
    @property
    +def respond(self) -> Optional[Respond]:
    +    """`respond()` function for this request.
    +
    +        @app.action("button")
    +        def handle_button_clicks(context):
    +            context.ack()
    +            context.respond("Hi!")
    +
    +        # You can access "ack" this way too.
    +        @app.action("button")
    +        def handle_button_clicks(ack, respond):
    +            ack()
    +            respond("Hi!")
    +
    +    Returns:
    +        Callable `respond()` function
    +    """
    +    if "respond" not in self:
    +        self["respond"] = Respond(
    +            response_url=self.response_url,
    +            proxy=self.client.proxy,
    +            ssl=self.client.ssl,
    +        )
    +    return self["respond"]
    +
    +
    +
    var saySay
    +
    +

    slack_bolt.context.say function for this request.

    +
    @app.action("button")
    +def handle_button_clicks(context):
    +    context.ack()
    +    context.say("Hi!")
    +
    +# You can access "ack" this way too.
    +@app.action("button")
    +def handle_button_clicks(ack, say):
    +    ack()
    +    say("Hi!")
    +
    +

    Returns

    +

    Callable slack_bolt.context.say function

    +
    + +Expand source code + +
    @property
    +def say(self) -> Say:
    +    """`say()` function for this request.
    +
    +        @app.action("button")
    +        def handle_button_clicks(context):
    +            context.ack()
    +            context.say("Hi!")
    +
    +        # You can access "ack" this way too.
    +        @app.action("button")
    +        def handle_button_clicks(ack, say):
    +            ack()
    +            say("Hi!")
    +
    +    Returns:
    +        Callable `say()` function
    +    """
    +    if "say" not in self:
    +        self["say"] = Say(client=self.client, channel=self.channel_id)
    +    return self["say"]
    +
    +
    +
    +

    Methods

    +
    +
    +def to_copyable(self) ‑> BoltContext +
    +
    +
    +
    + +Expand source code + +
    def to_copyable(self) -> "BoltContext":
    +    new_dict = {}
    +    for prop_name, prop_value in self.items():
    +        if prop_name in self.standard_property_names:
    +            # all the standard properties are copiable
    +            new_dict[prop_name] = prop_value
    +        else:
    +            try:
    +                copied_value = create_copy(prop_value)
    +                new_dict[prop_name] = copied_value
    +            except TypeError as te:
    +                self.logger.warning(
    +                    f"Skipped setting '{prop_name}' to a copied request for lazy listeners "
    +                    "due to a deep-copy creation error. Consider passing the value not as part of context object "
    +                    f"(error: {te})"
    +                )
    +    return BoltContext(new_dict)
    +
    +
    +
    +

    Inherited members

    + +
    +
    diff --git a/docs/api-docs/slack_bolt/context/respond/index.html b/docs/api-docs/slack_bolt/context/respond/index.html index 135e7242e..b38402ceb 100644 --- a/docs/api-docs/slack_bolt/context/respond/index.html +++ b/docs/api-docs/slack_bolt/context/respond/index.html @@ -27,7 +27,11 @@

    Module slack_bolt.context.respond

    Expand source code
    # Don't add async module imports here
    -from .respond import Respond  # noqa: F401
    +from .respond import Respond + +__all__ = [ + "Respond", +]
    @@ -52,6 +56,92 @@

    Sub-modules

    +

    Classes

    +
    +
    +class Respond +(*, response_url: Optional[str], proxy: Optional[str] = None, ssl: Optional[ssl.SSLContext] = None) +
    +
    +
    +
    + +Expand source code + +
    class Respond:
    +    response_url: Optional[str]
    +    proxy: Optional[str]
    +    ssl: Optional[SSLContext]
    +
    +    def __init__(
    +        self,
    +        *,
    +        response_url: Optional[str],
    +        proxy: Optional[str] = None,
    +        ssl: Optional[SSLContext] = None,
    +    ):
    +        self.response_url = response_url
    +        self.proxy = proxy
    +        self.ssl = ssl
    +
    +    def __call__(
    +        self,
    +        text: Union[str, dict] = "",
    +        blocks: Optional[Sequence[Union[dict, Block]]] = None,
    +        attachments: Optional[Sequence[Union[dict, Attachment]]] = None,
    +        response_type: Optional[str] = None,
    +        replace_original: Optional[bool] = None,
    +        delete_original: Optional[bool] = None,
    +        unfurl_links: Optional[bool] = None,
    +        unfurl_media: Optional[bool] = None,
    +    ) -> WebhookResponse:
    +        if self.response_url is not None:
    +            client = WebhookClient(
    +                url=self.response_url,
    +                proxy=self.proxy,
    +                ssl=self.ssl,
    +            )
    +            text_or_whole_response: Union[str, dict] = text
    +            if isinstance(text_or_whole_response, str):
    +                text = text_or_whole_response
    +                message = _build_message(
    +                    text=text,
    +                    blocks=blocks,
    +                    attachments=attachments,
    +                    response_type=response_type,
    +                    replace_original=replace_original,
    +                    delete_original=delete_original,
    +                    unfurl_links=unfurl_links,
    +                    unfurl_media=unfurl_media,
    +                )
    +                return client.send_dict(message)
    +            elif isinstance(text_or_whole_response, dict):
    +                message = _build_message(**text_or_whole_response)
    +                return client.send_dict(message)
    +            else:
    +                raise ValueError(
    +                    f"The arg is unexpected type ({type(text_or_whole_response)})"
    +                )
    +        else:
    +            raise ValueError("respond is unsupported here as there is no response_url")
    +
    +

    Class variables

    +
    +
    var proxy : Optional[str]
    +
    +
    +
    +
    var response_url : Optional[str]
    +
    +
    +
    +
    var ssl : Optional[ssl.SSLContext]
    +
    +
    +
    +
    +
    +
    diff --git a/docs/api-docs/slack_bolt/context/say/index.html b/docs/api-docs/slack_bolt/context/say/index.html index 9b3ef82c5..7dee26747 100644 --- a/docs/api-docs/slack_bolt/context/say/index.html +++ b/docs/api-docs/slack_bolt/context/say/index.html @@ -27,7 +27,11 @@

    Module slack_bolt.context.say

    Expand source code
    # Don't add async module imports here
    -from .say import Say  # noqa: F401
    +from .say import Say + +__all__ = [ + "Say", +]
    @@ -52,6 +56,80 @@

    Sub-modules

    +

    Classes

    +
    +
    +class Say +(client: Optional[slack_sdk.web.client.WebClient], channel: Optional[str]) +
    +
    +
    +
    + +Expand source code + +
    class Say:
    +    client: Optional[WebClient]
    +    channel: Optional[str]
    +
    +    def __init__(
    +        self,
    +        client: Optional[WebClient],
    +        channel: Optional[str],
    +    ):
    +        self.client = client
    +        self.channel = channel
    +
    +    def __call__(
    +        self,
    +        text: Union[str, dict] = "",
    +        blocks: Optional[Sequence[Union[Dict, Block]]] = None,
    +        attachments: Optional[Sequence[Union[Dict, Attachment]]] = None,
    +        channel: Optional[str] = None,
    +        thread_ts: Optional[str] = None,
    +        unfurl_links: Optional[bool] = None,
    +        unfurl_media: Optional[bool] = None,
    +        **kwargs,
    +    ) -> SlackResponse:
    +        if _can_say(self, channel):
    +            text_or_whole_response: Union[str, dict] = text
    +            if isinstance(text_or_whole_response, str):
    +                text = text_or_whole_response
    +                return self.client.chat_postMessage(
    +                    channel=channel or self.channel,
    +                    text=text,
    +                    blocks=blocks,
    +                    attachments=attachments,
    +                    thread_ts=thread_ts,
    +                    unfurl_links=unfurl_links,
    +                    unfurl_media=unfurl_media,
    +                    **kwargs,
    +                )
    +            elif isinstance(text_or_whole_response, dict):
    +                message: dict = text_or_whole_response
    +                if "channel" not in message:
    +                    message["channel"] = channel or self.channel
    +                return self.client.chat_postMessage(**message)
    +            else:
    +                raise ValueError(
    +                    f"The arg is unexpected type ({type(text_or_whole_response)})"
    +                )
    +        else:
    +            raise ValueError("say without channel_id here is unsupported")
    +
    +

    Class variables

    +
    +
    var channel : Optional[str]
    +
    +
    +
    +
    var client : Optional[slack_sdk.web.client.WebClient]
    +
    +
    +
    +
    +
    +
    diff --git a/docs/api-docs/slack_bolt/index.html b/docs/api-docs/slack_bolt/index.html index ebaeecaae..2605518a6 100644 --- a/docs/api-docs/slack_bolt/index.html +++ b/docs/api-docs/slack_bolt/index.html @@ -40,16 +40,29 @@

    Package slack_bolt

    * The class representing a Bolt app: `slack_bolt.app.app` """ # noqa: E501 # Don't add async module imports here -from .app import App # noqa -from .context import BoltContext # noqa -from .context.ack import Ack # noqa -from .context.respond import Respond # noqa -from .context.say import Say # noqa -from .kwargs_injection import Args # noqa -from .listener import Listener # noqa -from .listener_matcher import CustomListenerMatcher # noqa -from .request import BoltRequest # noqa -from .response import BoltResponse # noqa +from .app import App +from .context import BoltContext +from .context.ack import Ack +from .context.respond import Respond +from .context.say import Say +from .kwargs_injection import Args +from .listener import Listener +from .listener_matcher import CustomListenerMatcher +from .request import BoltRequest +from .response import BoltResponse + +__all__ = [ + "App", + "BoltContext", + "Ack", + "Respond", + "Say", + "Args", + "Listener", + "CustomListenerMatcher", + "BoltRequest", + "BoltResponse", +]
    @@ -139,34 +152,4431 @@

    Sub-modules

    -
    - -
    + +

    trigger_id=body["trigger_id"], view={ ... } ) + +

    Alternatively, you can include a parameter named args and it will be injected with an instance of this class.

    +
    @app.action("link_button")
    +async def handle_buttons(args):
    +    args.logger.info(f"request body: {args.body}")
    +    await args.ack()
    +    if args.context.channel_id is not None:
    +        await args.respond("Hi!")
    +    await args.client.views_open(
    +        trigger_id=args.body["trigger_id"],
    +        view={ ... }
    +    )
     
    @@ -194,6 +219,19 @@

    Classes

    view={ ... } ) + Alternatively, you can include a parameter named `args` and it will be injected with an instance of this class. + + @app.action("link_button") + async def handle_buttons(args): + args.logger.info(f"request body: {args.body}") + await args.ack() + if args.context.channel_id is not None: + await args.respond("Hi!") + await args.client.views_open( + trigger_id=args.body["trigger_id"], + view={ ... } + ) + """ logger: Logger diff --git a/docs/api-docs/slack_bolt/kwargs_injection/async_utils.html b/docs/api-docs/slack_bolt/kwargs_injection/async_utils.html index 6a2c530ff..defdd3f5a 100644 --- a/docs/api-docs/slack_bolt/kwargs_injection/async_utils.html +++ b/docs/api-docs/slack_bolt/kwargs_injection/async_utils.html @@ -111,7 +111,7 @@

    Module slack_bolt.kwargs_injection.async_utilsModule slack_bolt.kwargs_injection.async_utils @@ -214,7 +214,7 @@

    Functions

    first_arg_name = required_arg_names[0] if first_arg_name in {"self", "cls"}: required_arg_names.pop(0) - elif first_arg_name not in all_available_args.keys(): + elif first_arg_name not in all_available_args.keys() and first_arg_name != "args": if this_func is None: logger.warning(warning_skip_uncommon_arg_name(first_arg_name)) required_arg_names.pop(0) @@ -231,7 +231,7 @@

    Functions

    else: logger.warning(f"Unknown Request object type detected ({type(request)})") - if name not in found_arg_names: + elif name not in found_arg_names: logger.warning(f"{name} is not a valid argument") kwargs[name] = None return kwargs diff --git a/docs/api-docs/slack_bolt/kwargs_injection/index.html b/docs/api-docs/slack_bolt/kwargs_injection/index.html index cb9c81689..223d1f153 100644 --- a/docs/api-docs/slack_bolt/kwargs_injection/index.html +++ b/docs/api-docs/slack_bolt/kwargs_injection/index.html @@ -144,7 +144,7 @@

    Functions

    first_arg_name = required_arg_names[0] if first_arg_name in {"self", "cls"}: required_arg_names.pop(0) - elif first_arg_name not in all_available_args.keys(): + elif first_arg_name not in all_available_args.keys() and first_arg_name != "args": if this_func is None: logger.warning(warning_skip_uncommon_arg_name(first_arg_name)) required_arg_names.pop(0) @@ -161,7 +161,7 @@

    Functions

    else: logger.warning(f"Unknown Request object type detected ({type(request)})") - if name not in found_arg_names: + elif name not in found_arg_names: logger.warning(f"{name} is not a valid argument") kwargs[name] = None return kwargs @@ -189,6 +189,18 @@

    Classes

    trigger_id=body["trigger_id"], view={ ... } ) + +

    Alternatively, you can include a parameter named slack_bolt.kwargs_injection.args and it will be injected with an instance of this class.

    +
    @app.action("link_button")
    +def handle_buttons(args):
    +    args.logger.info(f"request body: {args.body}")
    +    args.ack()
    +    if args.context.channel_id is not None:
    +        args.respond("Hi!")
    +    args.client.views_open(
    +        trigger_id=args.body["trigger_id"],
    +        view={ ... }
    +    )
     
    @@ -209,6 +221,19 @@

    Classes

    view={ ... } ) + Alternatively, you can include a parameter named `args` and it will be injected with an instance of this class. + + @app.action("link_button") + def handle_buttons(args): + args.logger.info(f"request body: {args.body}") + args.ack() + if args.context.channel_id is not None: + args.respond("Hi!") + args.client.views_open( + trigger_id=args.body["trigger_id"], + view={ ... } + ) + """ client: WebClient diff --git a/docs/api-docs/slack_bolt/kwargs_injection/utils.html b/docs/api-docs/slack_bolt/kwargs_injection/utils.html index b1f87d01e..6fee6e4fc 100644 --- a/docs/api-docs/slack_bolt/kwargs_injection/utils.html +++ b/docs/api-docs/slack_bolt/kwargs_injection/utils.html @@ -111,7 +111,7 @@

    Module slack_bolt.kwargs_injection.utils

    first_arg_name = required_arg_names[0] if first_arg_name in {"self", "cls"}: required_arg_names.pop(0) - elif first_arg_name not in all_available_args.keys(): + elif first_arg_name not in all_available_args.keys() and first_arg_name != "args": if this_func is None: logger.warning(warning_skip_uncommon_arg_name(first_arg_name)) required_arg_names.pop(0) @@ -128,7 +128,7 @@

    Module slack_bolt.kwargs_injection.utils

    else: logger.warning(f"Unknown Request object type detected ({type(request)})") - if name not in found_arg_names: + elif name not in found_arg_names: logger.warning(f"{name} is not a valid argument") kwargs[name] = None return kwargs @@ -214,7 +214,7 @@

    Functions

    first_arg_name = required_arg_names[0] if first_arg_name in {"self", "cls"}: required_arg_names.pop(0) - elif first_arg_name not in all_available_args.keys(): + elif first_arg_name not in all_available_args.keys() and first_arg_name != "args": if this_func is None: logger.warning(warning_skip_uncommon_arg_name(first_arg_name)) required_arg_names.pop(0) @@ -231,7 +231,7 @@

    Functions

    else: logger.warning(f"Unknown Request object type detected ({type(request)})") - if name not in found_arg_names: + elif name not in found_arg_names: logger.warning(f"{name} is not a valid argument") kwargs[name] = None return kwargs diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index 3c7de3a13..61fa013d0 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.16.2"
    +__version__ = "1.16.3"
    diff --git a/slack_bolt/version.py b/slack_bolt/version.py index e37cf15a5..7d855cdd8 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.16.2" +__version__ = "1.16.3" From ade7bc4951b54a28ed5e4569c6d60c86a1c8ce50 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 10 Mar 2023 20:40:38 +0900 Subject: [PATCH 416/719] Enable developers to pass fully implemented authorize along with installation_store (#851) * Enable developers to pass fully implemented authorize along with installation_store * Fix the CI build error with Python 3.6 due to Chalice 1.28 --- setup.py | 3 +- slack_bolt/app/app.py | 13 +- slack_bolt/app/async_app.py | 14 +- .../test_app_custom_authorize.py | 254 +++++++++++++++++ .../test_app_custom_authorize.py | 266 ++++++++++++++++++ 5 files changed, 542 insertions(+), 8 deletions(-) create mode 100644 tests/scenario_tests/test_app_custom_authorize.py create mode 100644 tests/scenario_tests_async/test_app_custom_authorize.py diff --git a/setup.py b/setup.py index ef7556d1e..e91bd8e2b 100755 --- a/setup.py +++ b/setup.py @@ -77,7 +77,8 @@ # used only under src/slack_bolt/adapter "boto3<=2", "bottle>=0.12,<1", - "chalice>=1.27.3,<2", + # TODO: chalice 1.28 dropped Python 3.6 support + "chalice<=1.27.3", "CherryPy>=18,<19", "Django>=3,<5", "falcon>=3.1.1,<4" if sys.version_info.minor >= 11 else "falcon>=2,<4", diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 6e5293244..1a923e35e 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -217,9 +217,16 @@ def message_hello(message, say): self._authorize: Optional[Authorize] = None if authorize is not None: - if oauth_settings is not None or oauth_flow is not None: - raise BoltError(error_authorize_conflicts()) - self._authorize = CallableAuthorize(logger=self._framework_logger, func=authorize) + if isinstance(authorize, Authorize): + # As long as an advanced developer understands what they're doing, + # bolt-python should not prevent customizing authorize middleware + self._authorize = authorize + else: + if oauth_settings is not None or oauth_flow is not None: + # If the given authorize is a simple function, + # it does not work along with installation_store. + raise BoltError(error_authorize_conflicts()) + self._authorize = CallableAuthorize(logger=self._framework_logger, func=authorize) self._installation_store: Optional[InstallationStore] = installation_store if self._installation_store is not None and self._authorize is None: diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 39e8a659c..5b5c52338 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -222,10 +222,16 @@ async def message_hello(message, say): # async function self._async_authorize: Optional[AsyncAuthorize] = None if authorize is not None: - if oauth_settings is not None or oauth_flow is not None: - raise BoltError(error_authorize_conflicts()) - - self._async_authorize = AsyncCallableAuthorize(logger=self._framework_logger, func=authorize) + if isinstance(authorize, AsyncAuthorize): + # As long as an advanced developer understands what they're doing, + # bolt-python should not prevent customizing authorize middleware + self._async_authorize = authorize + else: + if oauth_settings is not None or oauth_flow is not None: + # If the given authorize is a simple function, + # it does not work along with installation_store. + raise BoltError(error_authorize_conflicts()) + self._async_authorize = AsyncCallableAuthorize(logger=self._framework_logger, func=authorize) self._async_installation_store: Optional[AsyncInstallationStore] = installation_store if self._async_installation_store is not None and self._async_authorize is None: diff --git a/tests/scenario_tests/test_app_custom_authorize.py b/tests/scenario_tests/test_app_custom_authorize.py new file mode 100644 index 000000000..e6293d695 --- /dev/null +++ b/tests/scenario_tests/test_app_custom_authorize.py @@ -0,0 +1,254 @@ +import datetime +import json +import logging +from time import time, sleep +from typing import Optional + +import pytest +from slack_sdk import WebClient +from slack_sdk.errors import SlackApiError +from slack_sdk.oauth import InstallationStore +from slack_sdk.oauth.installation_store import Installation, Bot +from slack_sdk.signature import SignatureVerifier + +from slack_bolt import App, BoltRequest, Say, BoltContext +from slack_bolt.authorization import AuthorizeResult +from slack_bolt.authorization.authorize import Authorize +from slack_bolt.error import BoltError +from slack_bolt.oauth.oauth_settings import OAuthSettings +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class MemoryInstallationStore(InstallationStore): + @property + def logger(self) -> logging.Logger: + return logging.getLogger(__name__) + + def save(self, installation: Installation): + pass + + def find_bot( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Bot]: + return Bot( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + installed_at=datetime.datetime.now().timestamp(), + ) + + def find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + return Installation( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid-2", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + user_id="W11111", + user_token="xoxp-valid", + user_scopes=["search:read"], + installed_at=datetime.datetime.now().timestamp(), + ) + + +class CustomAuthorize(Authorize): + def __init__(self, installation_store: InstallationStore): + self.installation_store = installation_store + + def __call__( + self, + *, + context: BoltContext, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str], + ) -> Optional[AuthorizeResult]: + bot_token: Optional[str] = None + user_token: Optional[str] = None + latest_installation: Optional[Installation] = self.installation_store.find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + is_enterprise_install=context.is_enterprise_install, + ) + this_user_installation: Optional[Installation] = None + if latest_installation is not None: + bot_token = latest_installation.bot_token # this still can be None + user_token = latest_installation.user_token # this still can be None + if latest_installation.user_id != user_id: + # First off, remove the user token as the installer is a different user + user_token = None + latest_installation.user_token = None + latest_installation.user_refresh_token = None + latest_installation.user_token_expires_at = None + latest_installation.user_scopes = [] + + # try to fetch the request user's installation + # to reflect the user's access token if exists + this_user_installation = self.installation_store.find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + user_id=user_id, + is_enterprise_install=context.is_enterprise_install, + ) + if this_user_installation is not None: + user_token = this_user_installation.user_token + if latest_installation.bot_token is None: + # If latest_installation has a bot token, we never overwrite the value + bot_token = this_user_installation.bot_token + token: Optional[str] = bot_token or user_token + if token is None: + return None + try: + auth_test_api_response = context.client.auth_test(token=token) + authorize_result = AuthorizeResult.from_auth_test_response( + auth_test_response=auth_test_api_response, + bot_token=bot_token, + user_token=user_token, + ) + return authorize_result + except SlackApiError: + return None + + +class TestApp: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + app_mention_request_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "team": "T111", + "channel": "C111", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, + "authed_users": ["W111"], + } + + @staticmethod + def handle_app_mention(body, say: Say, payload, event): + assert body["event"] == payload + assert payload == event + say("What's up?") + + def build_app_mention_request(self): + timestamp, body = str(int(time())), json.dumps(self.app_mention_request_body) + return BoltRequest(body=body, headers=self.build_headers(timestamp, body)) + + def test_installation_store_only(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + oauth_settings=OAuthSettings( + client_id="111.222", + client_secret="secret", + scopes=["commands"], + installation_store=MemoryInstallationStore(), + ), + ) + + app.event("app_mention")(self.handle_app_mention) + response = app.dispatch(self.build_app_mention_request()) + assert response.status == 200 + assert_auth_test_count(self, 1) + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + def test_installation_store_and_authorize(self): + installation_store = MemoryInstallationStore() + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + oauth_settings=OAuthSettings( + client_id="111.222", + client_secret="secret", + scopes=["commands"], + installation_store=installation_store, + ), + authorize=CustomAuthorize(installation_store), + ) + + app.event("app_mention")(self.handle_app_mention) + response = app.dispatch(self.build_app_mention_request()) + assert response.status == 200 + assert_auth_test_count(self, 1) + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + def test_installation_store_and_func_authorize(self): + installation_store = MemoryInstallationStore() + + def authorize(): + pass + + with pytest.raises(BoltError): + App( + client=self.web_client, + signing_secret=self.signing_secret, + oauth_settings=OAuthSettings( + client_id="111.222", + client_secret="secret", + scopes=["commands"], + installation_store=installation_store, + ), + authorize=authorize, + ) diff --git a/tests/scenario_tests_async/test_app_custom_authorize.py b/tests/scenario_tests_async/test_app_custom_authorize.py new file mode 100644 index 000000000..43fab3f6c --- /dev/null +++ b/tests/scenario_tests_async/test_app_custom_authorize.py @@ -0,0 +1,266 @@ +import asyncio +import datetime +import json +import logging +from time import time +from typing import Optional + +import pytest +from slack_sdk.errors import SlackApiError +from slack_sdk.oauth.installation_store import Installation, Bot +from slack_sdk.oauth.installation_store.async_installation_store import ( + AsyncInstallationStore, +) +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.authorization import AuthorizeResult +from slack_bolt.authorization.async_authorize import AsyncAuthorize +from slack_bolt.context.async_context import AsyncBoltContext +from slack_bolt.error import BoltError +from slack_bolt.oauth.async_oauth_settings import AsyncOAuthSettings +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count_async, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestAppCustomAuthorize: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def build_valid_app_mention_request(self) -> AsyncBoltRequest: + timestamp, body = str(int(time())), json.dumps(app_mention_body) + return AsyncBoltRequest(body=body, headers=self.build_headers(timestamp, body)) + + @pytest.mark.asyncio + async def test_installation_store_only(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + oauth_settings=AsyncOAuthSettings( + client_id="111.222", + client_secret="secret", + installation_store=MemoryInstallationStore(), + ), + ) + app.event("app_mention")(whats_up) + + request = self.build_valid_app_mention_request() + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_auth_test_count_async(self, 1) + await asyncio.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + @pytest.mark.asyncio + async def test_installation_store_and_authorize(self): + installation_store = MemoryInstallationStore() + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + authorize=CustomAuthorize(installation_store), + oauth_settings=AsyncOAuthSettings( + client_id="111.222", + client_secret="secret", + installation_store=installation_store, + ), + ) + app.event("app_mention")(whats_up) + + request = self.build_valid_app_mention_request() + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_auth_test_count_async(self, 1) + await asyncio.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + @pytest.mark.asyncio + async def test_installation_store_and_func_authorize(self): + installation_store = MemoryInstallationStore() + + async def authorize(): + pass + + with pytest.raises(BoltError): + AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + authorize=authorize, + oauth_settings=AsyncOAuthSettings( + client_id="111.222", + client_secret="secret", + installation_store=installation_store, + ), + ) + + +app_mention_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "team": "T111", + "channel": "C111", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, + "authed_users": ["W111"], +} + + +async def whats_up(body, say, payload, event): + assert body["event"] == payload + assert payload == event + await say("What's up?") + + +class MemoryInstallationStore(AsyncInstallationStore): + @property + def logger(self) -> logging.Logger: + return logging.getLogger(__name__) + + async def async_save(self, installation: Installation): + pass + + async def async_find_bot( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Bot]: + return Bot( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + installed_at=datetime.datetime.now().timestamp(), + ) + + async def async_find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + return Installation( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid-2", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + user_id="W11111", + user_token="xoxp-valid", + user_scopes=["search:read"], + installed_at=datetime.datetime.now().timestamp(), + ) + + +class CustomAuthorize(AsyncAuthorize): + def __init__(self, installation_store: AsyncInstallationStore): + self.installation_store = installation_store + + async def __call__( + self, + *, + context: AsyncBoltContext, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str], + ) -> Optional[AuthorizeResult]: + bot_token: Optional[str] = None + user_token: Optional[str] = None + latest_installation: Optional[Installation] = await self.installation_store.async_find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + is_enterprise_install=context.is_enterprise_install, + ) + this_user_installation: Optional[Installation] = None + if latest_installation is not None: + bot_token = latest_installation.bot_token # this still can be None + user_token = latest_installation.user_token # this still can be None + if latest_installation.user_id != user_id: + # First off, remove the user token as the installer is a different user + user_token = None + latest_installation.user_token = None + latest_installation.user_refresh_token = None + latest_installation.user_token_expires_at = None + latest_installation.user_scopes = [] + + # try to fetch the request user's installation + # to reflect the user's access token if exists + this_user_installation = await self.installation_store.async_find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + user_id=user_id, + is_enterprise_install=context.is_enterprise_install, + ) + if this_user_installation is not None: + user_token = this_user_installation.user_token + if latest_installation.bot_token is None: + # If latest_installation has a bot token, we never overwrite the value + bot_token = this_user_installation.bot_token + token: Optional[str] = bot_token or user_token + if token is None: + return None + try: + auth_test_api_response = await context.client.auth_test(token=token) + authorize_result = AuthorizeResult.from_auth_test_response( + auth_test_response=auth_test_api_response, + bot_token=bot_token, + user_token=user_token, + ) + return authorize_result + except SlackApiError: + return None From 36ab652183fe5bab38a5ede918f6fd2b2fd43bbc Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 10 Mar 2023 20:43:37 +0900 Subject: [PATCH 417/719] Enable developers to define app.message listener without args to capture all messages (#848) --- slack_bolt/app/app.py | 2 +- slack_bolt/app/async_app.py | 2 +- tests/scenario_tests/test_message.py | 34 ++++++++++++++++++++ tests/scenario_tests_async/test_message.py | 36 ++++++++++++++++++++++ 4 files changed, 72 insertions(+), 2 deletions(-) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 1a923e35e..4d27ddfec 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -743,7 +743,7 @@ def __call__(*args, **kwargs): def message( self, - keyword: Union[str, Pattern], + keyword: Union[str, Pattern] = "", matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 5b5c52338..ae224e341 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -773,7 +773,7 @@ def __call__(*args, **kwargs): def message( self, - keyword: Union[str, Pattern], + keyword: Union[str, Pattern] = "", matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: diff --git a/tests/scenario_tests/test_message.py b/tests/scenario_tests/test_message.py index 33ae0d945..8aa073809 100644 --- a/tests/scenario_tests/test_message.py +++ b/tests/scenario_tests/test_message.py @@ -74,6 +74,40 @@ def test_string_keyword(self): time.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 + def test_all_message_matching_1(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + @app.message("") + def handle_all_new_messages(say): + say("Thanks!") + + request = self.build_request2() + response = app.dispatch(request) + assert response.status == 200 + assert_auth_test_count(self, 1) + time.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + def test_all_message_matching_2(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + @app.message() + def handle_all_new_messages(say): + say("Thanks!") + + request = self.build_request2() + response = app.dispatch(request) + assert response.status == 200 + assert_auth_test_count(self, 1) + time.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + def test_string_keyword_capturing(self): app = App( client=self.web_client, diff --git a/tests/scenario_tests_async/test_message.py b/tests/scenario_tests_async/test_message.py index 5d98ff014..c11c3e8c8 100644 --- a/tests/scenario_tests_async/test_message.py +++ b/tests/scenario_tests_async/test_message.py @@ -81,6 +81,42 @@ async def test_string_keyword(self): await asyncio.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 + @pytest.mark.asyncio + async def test_all_message_matching_1(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + @app.message("") + async def handle_all_new_messages(say): + await say("Thanks!") + + request = self.build_request2() + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_auth_test_count_async(self, 1) + await asyncio.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + @pytest.mark.asyncio + async def test_all_message_matching_2(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + @app.message() + async def handle_all_new_messages(say): + await say("Thanks!") + + request = self.build_request2() + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_auth_test_count_async(self, 1) + await asyncio.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + @pytest.mark.asyncio async def test_string_keyword_capturing(self): app = AsyncApp( From c6f3e9a1126f250055ff642380131315e457f8c8 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 10 Mar 2023 21:08:41 +0900 Subject: [PATCH 418/719] Fix #850 by upgrading slack-sdk version to the latest (#852) --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e91bd8e2b..ba1c1d367 100755 --- a/setup.py +++ b/setup.py @@ -58,7 +58,7 @@ ), include_package_data=True, # MANIFEST.in install_requires=[ - "slack_sdk>=3.18.5,<4", + "slack_sdk>=3.20.2,<4", ], setup_requires=["pytest-runner==5.2"], tests_require=async_test_dependencies, From 99e77eb5946184890b6fc6f7d97c1ef11188c673 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 10 Mar 2023 23:41:10 +0900 Subject: [PATCH 419/719] Add team param support to the /slack/install endpoint (#853) --- slack_bolt/oauth/async_oauth_flow.py | 6 +++++- slack_bolt/oauth/oauth_flow.py | 6 +++++- tests/slack_bolt/oauth/test_oauth_flow.py | 20 +++++++++++++++++++ .../oauth/test_async_oauth_flow.py | 20 +++++++++++++++++++ 4 files changed, 50 insertions(+), 2 deletions(-) diff --git a/slack_bolt/oauth/async_oauth_flow.py b/slack_bolt/oauth/async_oauth_flow.py index 57ae284e1..f35d394e1 100644 --- a/slack_bolt/oauth/async_oauth_flow.py +++ b/slack_bolt/oauth/async_oauth_flow.py @@ -194,7 +194,11 @@ async def issue_new_state(self, request: AsyncBoltRequest) -> str: return await self.settings.state_store.async_issue() async def build_authorize_url(self, state: str, request: AsyncBoltRequest) -> str: - return self.settings.authorize_url_generator.generate(state) + team_ids: Optional[Sequence[str]] = request.query.get("team") + return self.settings.authorize_url_generator.generate( + state=state, + team=team_ids[0] if team_ids is not None else None, + ) async def build_install_page_html(self, url: str, request: AsyncBoltRequest) -> str: return _build_default_install_page_html(url) diff --git a/slack_bolt/oauth/oauth_flow.py b/slack_bolt/oauth/oauth_flow.py index 91be30b6f..6e00cc1c7 100644 --- a/slack_bolt/oauth/oauth_flow.py +++ b/slack_bolt/oauth/oauth_flow.py @@ -192,7 +192,11 @@ def issue_new_state(self, request: BoltRequest) -> str: return self.settings.state_store.issue() def build_authorize_url(self, state: str, request: BoltRequest) -> str: - return self.settings.authorize_url_generator.generate(state) + team_ids: Optional[Sequence[str]] = request.query.get("team") + return self.settings.authorize_url_generator.generate( + state=state, + team=team_ids[0] if team_ids is not None else None, + ) def build_install_page_html(self, url: str, request: BoltRequest) -> str: return _build_default_install_page_html(url) diff --git a/tests/slack_bolt/oauth/test_oauth_flow.py b/tests/slack_bolt/oauth/test_oauth_flow.py index b6e557d91..77258685d 100644 --- a/tests/slack_bolt/oauth/test_oauth_flow.py +++ b/tests/slack_bolt/oauth/test_oauth_flow.py @@ -83,6 +83,26 @@ def test_handle_installation_no_rendering(self): assert "https://slack.com/oauth/v2/authorize?state=" in location_header assert resp.headers.get("set-cookie") is not None + def test_handle_installation_team_param(self): + oauth_flow = OAuthFlow( + settings=OAuthSettings( + client_id="111.222", + client_secret="xxx", + scopes=["chat:write", "commands"], + user_scopes=["search:read"], + installation_store=FileInstallationStore(), + install_page_rendering_enabled=False, # disabled + state_store=FileOAuthStateStore(expiration_seconds=120), + ) + ) + req = BoltRequest(body="", query={"team": "T12345"}) + resp = oauth_flow.handle_installation(req) + assert resp.status == 302 + location_header = resp.headers.get("location")[0] + assert "https://slack.com/oauth/v2/authorize?state=" in location_header + assert "&team=T12345" in location_header + assert resp.headers.get("set-cookie") is not None + def test_handle_installation_no_state_validation(self): oauth_flow = OAuthFlow( settings=OAuthSettings( diff --git a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py index 2f8fb83ec..43ee7b3da 100644 --- a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py +++ b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py @@ -130,6 +130,26 @@ async def test_handle_installation_no_rendering(self): assert "https://slack.com/oauth/v2/authorize?state=" in location_header assert resp.headers.get("set-cookie") is not None + @pytest.mark.asyncio + async def test_handle_installation_team_param(self): + oauth_flow = AsyncOAuthFlow( + settings=AsyncOAuthSettings( + client_id="111.222", + client_secret="xxx", + scopes=["chat:write", "commands"], + installation_store=FileInstallationStore(), + install_page_rendering_enabled=False, # disabled + state_store=FileOAuthStateStore(expiration_seconds=120), + ) + ) + req = AsyncBoltRequest(body="", query={"team": "T12345"}) + resp = await oauth_flow.handle_installation(req) + assert resp.status == 302 + location_header = resp.headers.get("location")[0] + assert "https://slack.com/oauth/v2/authorize?state=" in location_header + assert "&team=T12345" in location_header + assert resp.headers.get("set-cookie") is not None + @pytest.mark.asyncio async def test_handle_installation_no_state_validation(self): oauth_flow = AsyncOAuthFlow( From 20d250f252f28bd9b9af4790dcbdbe40e89473af Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sat, 11 Mar 2023 00:01:30 +0900 Subject: [PATCH 420/719] version 1.16.4 --- docs/api-docs/slack_bolt/app/app.html | 34 ++++++++++++------ docs/api-docs/slack_bolt/app/async_app.html | 36 ++++++++++++------- docs/api-docs/slack_bolt/app/index.html | 19 ++++++---- docs/api-docs/slack_bolt/async_app.html | 20 +++++++---- docs/api-docs/slack_bolt/index.html | 19 ++++++---- .../slack_bolt/oauth/async_oauth_flow.html | 18 ++++++++-- docs/api-docs/slack_bolt/oauth/index.html | 12 +++++-- .../api-docs/slack_bolt/oauth/oauth_flow.html | 18 ++++++++-- docs/api-docs/slack_bolt/version.html | 2 +- slack_bolt/version.py | 2 +- 10 files changed, 129 insertions(+), 51 deletions(-) diff --git a/docs/api-docs/slack_bolt/app/app.html b/docs/api-docs/slack_bolt/app/app.html index c1d42dc8e..1963d09b4 100644 --- a/docs/api-docs/slack_bolt/app/app.html +++ b/docs/api-docs/slack_bolt/app/app.html @@ -245,9 +245,16 @@

    Module slack_bolt.app.app

    self._authorize: Optional[Authorize] = None if authorize is not None: - if oauth_settings is not None or oauth_flow is not None: - raise BoltError(error_authorize_conflicts()) - self._authorize = CallableAuthorize(logger=self._framework_logger, func=authorize) + if isinstance(authorize, Authorize): + # As long as an advanced developer understands what they're doing, + # bolt-python should not prevent customizing authorize middleware + self._authorize = authorize + else: + if oauth_settings is not None or oauth_flow is not None: + # If the given authorize is a simple function, + # it does not work along with installation_store. + raise BoltError(error_authorize_conflicts()) + self._authorize = CallableAuthorize(logger=self._framework_logger, func=authorize) self._installation_store: Optional[InstallationStore] = installation_store if self._installation_store is not None and self._authorize is None: @@ -764,7 +771,7 @@

    Module slack_bolt.app.app

    def message( self, - keyword: Union[str, Pattern], + keyword: Union[str, Pattern] = "", matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: @@ -1669,9 +1676,16 @@

    Args

    self._authorize: Optional[Authorize] = None if authorize is not None: - if oauth_settings is not None or oauth_flow is not None: - raise BoltError(error_authorize_conflicts()) - self._authorize = CallableAuthorize(logger=self._framework_logger, func=authorize) + if isinstance(authorize, Authorize): + # As long as an advanced developer understands what they're doing, + # bolt-python should not prevent customizing authorize middleware + self._authorize = authorize + else: + if oauth_settings is not None or oauth_flow is not None: + # If the given authorize is a simple function, + # it does not work along with installation_store. + raise BoltError(error_authorize_conflicts()) + self._authorize = CallableAuthorize(logger=self._framework_logger, func=authorize) self._installation_store: Optional[InstallationStore] = installation_store if self._installation_store is not None and self._authorize is None: @@ -2188,7 +2202,7 @@

    Args

    def message( self, - keyword: Union[str, Pattern], + keyword: Union[str, Pattern] = "", matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: @@ -3455,7 +3469,7 @@

    Args

    -def message(self, keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]] +def message(self, keyword: Union[str, Pattern] = '', matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]

    Registers a new message event listener. This method can be used as either a decorator or a method. @@ -3488,7 +3502,7 @@

    Args

    def message(
         self,
    -    keyword: Union[str, Pattern],
    +    keyword: Union[str, Pattern] = "",
         matchers: Optional[Sequence[Callable[..., bool]]] = None,
         middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
     ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    diff --git a/docs/api-docs/slack_bolt/app/async_app.html b/docs/api-docs/slack_bolt/app/async_app.html
    index 24a277331..0fdf7f437 100644
    --- a/docs/api-docs/slack_bolt/app/async_app.html
    +++ b/docs/api-docs/slack_bolt/app/async_app.html
    @@ -250,10 +250,16 @@ 

    Module slack_bolt.app.async_app

    self._async_authorize: Optional[AsyncAuthorize] = None if authorize is not None: - if oauth_settings is not None or oauth_flow is not None: - raise BoltError(error_authorize_conflicts()) - - self._async_authorize = AsyncCallableAuthorize(logger=self._framework_logger, func=authorize) + if isinstance(authorize, AsyncAuthorize): + # As long as an advanced developer understands what they're doing, + # bolt-python should not prevent customizing authorize middleware + self._async_authorize = authorize + else: + if oauth_settings is not None or oauth_flow is not None: + # If the given authorize is a simple function, + # it does not work along with installation_store. + raise BoltError(error_authorize_conflicts()) + self._async_authorize = AsyncCallableAuthorize(logger=self._framework_logger, func=authorize) self._async_installation_store: Optional[AsyncInstallationStore] = installation_store if self._async_installation_store is not None and self._async_authorize is None: @@ -795,7 +801,7 @@

    Module slack_bolt.app.async_app

    def message( self, - keyword: Union[str, Pattern], + keyword: Union[str, Pattern] = "", matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: @@ -1572,10 +1578,16 @@

    Args

    self._async_authorize: Optional[AsyncAuthorize] = None if authorize is not None: - if oauth_settings is not None or oauth_flow is not None: - raise BoltError(error_authorize_conflicts()) - - self._async_authorize = AsyncCallableAuthorize(logger=self._framework_logger, func=authorize) + if isinstance(authorize, AsyncAuthorize): + # As long as an advanced developer understands what they're doing, + # bolt-python should not prevent customizing authorize middleware + self._async_authorize = authorize + else: + if oauth_settings is not None or oauth_flow is not None: + # If the given authorize is a simple function, + # it does not work along with installation_store. + raise BoltError(error_authorize_conflicts()) + self._async_authorize = AsyncCallableAuthorize(logger=self._framework_logger, func=authorize) self._async_installation_store: Optional[AsyncInstallationStore] = installation_store if self._async_installation_store is not None and self._async_authorize is None: @@ -2117,7 +2129,7 @@

    Args

    def message( self, - keyword: Union[str, Pattern], + keyword: Union[str, Pattern] = "", matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: @@ -3413,7 +3425,7 @@

    Args

    -def message(self, keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]] +def message(self, keyword: Union[str, Pattern] = '', matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]

    Registers a new message event listener. This method can be used as either a decorator or a method. @@ -3446,7 +3458,7 @@

    Args

    def message(
         self,
    -    keyword: Union[str, Pattern],
    +    keyword: Union[str, Pattern] = "",
         matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
         middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
     ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    diff --git a/docs/api-docs/slack_bolt/app/index.html b/docs/api-docs/slack_bolt/app/index.html
    index cd86807b5..d9332bacd 100644
    --- a/docs/api-docs/slack_bolt/app/index.html
    +++ b/docs/api-docs/slack_bolt/app/index.html
    @@ -292,9 +292,16 @@ 

    Args

    self._authorize: Optional[Authorize] = None if authorize is not None: - if oauth_settings is not None or oauth_flow is not None: - raise BoltError(error_authorize_conflicts()) - self._authorize = CallableAuthorize(logger=self._framework_logger, func=authorize) + if isinstance(authorize, Authorize): + # As long as an advanced developer understands what they're doing, + # bolt-python should not prevent customizing authorize middleware + self._authorize = authorize + else: + if oauth_settings is not None or oauth_flow is not None: + # If the given authorize is a simple function, + # it does not work along with installation_store. + raise BoltError(error_authorize_conflicts()) + self._authorize = CallableAuthorize(logger=self._framework_logger, func=authorize) self._installation_store: Optional[InstallationStore] = installation_store if self._installation_store is not None and self._authorize is None: @@ -811,7 +818,7 @@

    Args

    def message( self, - keyword: Union[str, Pattern], + keyword: Union[str, Pattern] = "", matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: @@ -2078,7 +2085,7 @@

    Args

    -def message(self, keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]] +def message(self, keyword: Union[str, Pattern] = '', matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]

    Registers a new message event listener. This method can be used as either a decorator or a method. @@ -2111,7 +2118,7 @@

    Args

    def message(
         self,
    -    keyword: Union[str, Pattern],
    +    keyword: Union[str, Pattern] = "",
         matchers: Optional[Sequence[Callable[..., bool]]] = None,
         middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
     ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    diff --git a/docs/api-docs/slack_bolt/async_app.html b/docs/api-docs/slack_bolt/async_app.html
    index 34e435430..725f5929d 100644
    --- a/docs/api-docs/slack_bolt/async_app.html
    +++ b/docs/api-docs/slack_bolt/async_app.html
    @@ -403,10 +403,16 @@ 

    Args

    self._async_authorize: Optional[AsyncAuthorize] = None if authorize is not None: - if oauth_settings is not None or oauth_flow is not None: - raise BoltError(error_authorize_conflicts()) - - self._async_authorize = AsyncCallableAuthorize(logger=self._framework_logger, func=authorize) + if isinstance(authorize, AsyncAuthorize): + # As long as an advanced developer understands what they're doing, + # bolt-python should not prevent customizing authorize middleware + self._async_authorize = authorize + else: + if oauth_settings is not None or oauth_flow is not None: + # If the given authorize is a simple function, + # it does not work along with installation_store. + raise BoltError(error_authorize_conflicts()) + self._async_authorize = AsyncCallableAuthorize(logger=self._framework_logger, func=authorize) self._async_installation_store: Optional[AsyncInstallationStore] = installation_store if self._async_installation_store is not None and self._async_authorize is None: @@ -948,7 +954,7 @@

    Args

    def message( self, - keyword: Union[str, Pattern], + keyword: Union[str, Pattern] = "", matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: @@ -2244,7 +2250,7 @@

    Args

    -def message(self, keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]] +def message(self, keyword: Union[str, Pattern] = '', matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]

    Registers a new message event listener. This method can be used as either a decorator or a method. @@ -2277,7 +2283,7 @@

    Args

    def message(
         self,
    -    keyword: Union[str, Pattern],
    +    keyword: Union[str, Pattern] = "",
         matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
         middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
     ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
    diff --git a/docs/api-docs/slack_bolt/index.html b/docs/api-docs/slack_bolt/index.html
    index ad313457a..b980a5f93 100644
    --- a/docs/api-docs/slack_bolt/index.html
    +++ b/docs/api-docs/slack_bolt/index.html
    @@ -430,9 +430,16 @@ 

    Args

    self._authorize: Optional[Authorize] = None if authorize is not None: - if oauth_settings is not None or oauth_flow is not None: - raise BoltError(error_authorize_conflicts()) - self._authorize = CallableAuthorize(logger=self._framework_logger, func=authorize) + if isinstance(authorize, Authorize): + # As long as an advanced developer understands what they're doing, + # bolt-python should not prevent customizing authorize middleware + self._authorize = authorize + else: + if oauth_settings is not None or oauth_flow is not None: + # If the given authorize is a simple function, + # it does not work along with installation_store. + raise BoltError(error_authorize_conflicts()) + self._authorize = CallableAuthorize(logger=self._framework_logger, func=authorize) self._installation_store: Optional[InstallationStore] = installation_store if self._installation_store is not None and self._authorize is None: @@ -949,7 +956,7 @@

    Args

    def message( self, - keyword: Union[str, Pattern], + keyword: Union[str, Pattern] = "", matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: @@ -2216,7 +2223,7 @@

    Args

    -def message(self, keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]] +def message(self, keyword: Union[str, Pattern] = '', matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]

    Registers a new message event listener. This method can be used as either a decorator or a method. @@ -2249,7 +2256,7 @@

    Args

    def message(
         self,
    -    keyword: Union[str, Pattern],
    +    keyword: Union[str, Pattern] = "",
         matchers: Optional[Sequence[Callable[..., bool]]] = None,
         middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
     ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
    diff --git a/docs/api-docs/slack_bolt/oauth/async_oauth_flow.html b/docs/api-docs/slack_bolt/oauth/async_oauth_flow.html
    index 198eab734..95e51ffab 100644
    --- a/docs/api-docs/slack_bolt/oauth/async_oauth_flow.html
    +++ b/docs/api-docs/slack_bolt/oauth/async_oauth_flow.html
    @@ -222,7 +222,11 @@ 

    Module slack_bolt.oauth.async_oauth_flow

    return await self.settings.state_store.async_issue() async def build_authorize_url(self, state: str, request: AsyncBoltRequest) -> str: - return self.settings.authorize_url_generator.generate(state) + team_ids: Optional[Sequence[str]] = request.query.get("team") + return self.settings.authorize_url_generator.generate( + state=state, + team=team_ids[0] if team_ids is not None else None, + ) async def build_install_page_html(self, url: str, request: AsyncBoltRequest) -> str: return _build_default_install_page_html(url) @@ -587,7 +591,11 @@

    Args

    return await self.settings.state_store.async_issue() async def build_authorize_url(self, state: str, request: AsyncBoltRequest) -> str: - return self.settings.authorize_url_generator.generate(state) + team_ids: Optional[Sequence[str]] = request.query.get("team") + return self.settings.authorize_url_generator.generate( + state=state, + team=team_ids[0] if team_ids is not None else None, + ) async def build_install_page_html(self, url: str, request: AsyncBoltRequest) -> str: return _build_default_install_page_html(url) @@ -923,7 +931,11 @@

    Methods

    Expand source code
    async def build_authorize_url(self, state: str, request: AsyncBoltRequest) -> str:
    -    return self.settings.authorize_url_generator.generate(state)
    + team_ids: Optional[Sequence[str]] = request.query.get("team") + return self.settings.authorize_url_generator.generate( + state=state, + team=team_ids[0] if team_ids is not None else None, + )
    diff --git a/docs/api-docs/slack_bolt/oauth/index.html b/docs/api-docs/slack_bolt/oauth/index.html index 193eff286..a3e8f07c7 100644 --- a/docs/api-docs/slack_bolt/oauth/index.html +++ b/docs/api-docs/slack_bolt/oauth/index.html @@ -271,7 +271,11 @@

    Args

    return self.settings.state_store.issue() def build_authorize_url(self, state: str, request: BoltRequest) -> str: - return self.settings.authorize_url_generator.generate(state) + team_ids: Optional[Sequence[str]] = request.query.get("team") + return self.settings.authorize_url_generator.generate( + state=state, + team=team_ids[0] if team_ids is not None else None, + ) def build_install_page_html(self, url: str, request: BoltRequest) -> str: return _build_default_install_page_html(url) @@ -613,7 +617,11 @@

    Methods

    Expand source code
    def build_authorize_url(self, state: str, request: BoltRequest) -> str:
    -    return self.settings.authorize_url_generator.generate(state)
    + team_ids: Optional[Sequence[str]] = request.query.get("team") + return self.settings.authorize_url_generator.generate( + state=state, + team=team_ids[0] if team_ids is not None else None, + )
    diff --git a/docs/api-docs/slack_bolt/oauth/oauth_flow.html b/docs/api-docs/slack_bolt/oauth/oauth_flow.html index 094196a5a..42d823607 100644 --- a/docs/api-docs/slack_bolt/oauth/oauth_flow.html +++ b/docs/api-docs/slack_bolt/oauth/oauth_flow.html @@ -220,7 +220,11 @@

    Module slack_bolt.oauth.oauth_flow

    return self.settings.state_store.issue() def build_authorize_url(self, state: str, request: BoltRequest) -> str: - return self.settings.authorize_url_generator.generate(state) + team_ids: Optional[Sequence[str]] = request.query.get("team") + return self.settings.authorize_url_generator.generate( + state=state, + team=team_ids[0] if team_ids is not None else None, + ) def build_install_page_html(self, url: str, request: BoltRequest) -> str: return _build_default_install_page_html(url) @@ -584,7 +588,11 @@

    Args

    return self.settings.state_store.issue() def build_authorize_url(self, state: str, request: BoltRequest) -> str: - return self.settings.authorize_url_generator.generate(state) + team_ids: Optional[Sequence[str]] = request.query.get("team") + return self.settings.authorize_url_generator.generate( + state=state, + team=team_ids[0] if team_ids is not None else None, + ) def build_install_page_html(self, url: str, request: BoltRequest) -> str: return _build_default_install_page_html(url) @@ -926,7 +934,11 @@

    Methods

    Expand source code
    def build_authorize_url(self, state: str, request: BoltRequest) -> str:
    -    return self.settings.authorize_url_generator.generate(state)
    + team_ids: Optional[Sequence[str]] = request.query.get("team") + return self.settings.authorize_url_generator.generate( + state=state, + team=team_ids[0] if team_ids is not None else None, + )
    diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index 61fa013d0..e287e2ea6 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.16.3"
    +__version__ = "1.16.4"
    diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 7d855cdd8..1c0f78ef4 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.16.3" +__version__ = "1.16.4" From 2837e114814d062a810d2790aa13aa7d0a91e126 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 13 Mar 2023 13:13:20 +0900 Subject: [PATCH 421/719] Enhance AuthorizeResult to have bot/user_scopes & resolve user_id for user token (#855) Enhance AuthorizeResult to have bot/user_scopes when they're available (optional) Also, this commit fixes the bug where authorize_result.user_id is not resolved when both bot and user tokens exist. --- slack_bolt/authorization/async_authorize.py | 48 +++-- slack_bolt/authorization/authorize.py | 48 +++-- slack_bolt/authorization/authorize_result.py | 23 ++- .../test_app_installation_store.py | 155 ++++++++++++++++ .../test_app_installation_store.py | 167 ++++++++++++++++++ 5 files changed, 410 insertions(+), 31 deletions(-) create mode 100644 tests/scenario_tests/test_app_installation_store.py create mode 100644 tests/scenario_tests_async/test_app_installation_store.py diff --git a/slack_bolt/authorization/async_authorize.py b/slack_bolt/authorization/async_authorize.py index 75fb5093e..b6825c7ab 100644 --- a/slack_bolt/authorization/async_authorize.py +++ b/slack_bolt/authorization/async_authorize.py @@ -1,5 +1,5 @@ from logging import Logger -from typing import Optional, Callable, Awaitable, Dict, Any +from typing import Optional, Callable, Awaitable, Dict, Any, List from slack_sdk.errors import SlackApiError from slack_sdk.oauth.installation_store import Bot, Installation @@ -156,6 +156,10 @@ async def __call__( bot_token: Optional[str] = None user_token: Optional[str] = None + bot_scopes: Optional[List[str]] = None + user_scopes: Optional[List[str]] = None + latest_bot_installation: Optional[Installation] = None + this_user_installation: Optional[Installation] = None if not self.bot_only and self.find_installation_available: # Since v1.1, this is the default way. @@ -163,7 +167,7 @@ async def __call__( try: # Note that this is the latest information for the org/workspace. # The installer may not be the user associated with this incoming request. - latest_installation: Optional[Installation] = await self.installation_store.async_find_installation( + latest_bot_installation = await self.installation_store.async_find_installation( enterprise_id=enterprise_id, team_id=team_id, is_enterprise_install=context.is_enterprise_install, @@ -173,20 +177,20 @@ async def __call__( # The example use cases are: # - The app's installation requires both bot and user tokens # - The app has two installation paths 1) bot installation 2) individual user authorization - this_user_installation: Optional[Installation] = None - - if latest_installation is not None: + if latest_bot_installation is not None: # Save the latest bot token - bot_token = latest_installation.bot_token # this still can be None - user_token = latest_installation.user_token # this still can be None + bot_token = latest_bot_installation.bot_token # this still can be None + user_token = latest_bot_installation.user_token # this still can be None + bot_scopes = latest_bot_installation.bot_scopes # this still can be None + user_scopes = latest_bot_installation.user_scopes # this still can be None - if latest_installation.user_id != user_id: + if latest_bot_installation.user_id != user_id: # First off, remove the user token as the installer is a different user user_token = None - latest_installation.user_token = None - latest_installation.user_refresh_token = None - latest_installation.user_token_expires_at = None - latest_installation.user_scopes = [] + latest_bot_installation.user_token = None + latest_bot_installation.user_refresh_token = None + latest_bot_installation.user_token_expires_at = None + latest_bot_installation.user_scopes = [] # try to fetch the request user's installation # to reflect the user's access token if exists @@ -198,26 +202,32 @@ async def __call__( ) if this_user_installation is not None: user_token = this_user_installation.user_token - if latest_installation.bot_token is None: + user_scopes = this_user_installation.user_scopes + if latest_bot_installation.bot_token is None: # If latest_installation has a bot token, we never overwrite the value bot_token = this_user_installation.bot_token + bot_scopes = this_user_installation.bot_scopes # If token rotation is enabled, running rotation may be needed here refreshed = await self._rotate_and_save_tokens_if_necessary(this_user_installation) if refreshed is not None: user_token = refreshed.user_token - if latest_installation.bot_token is None: + user_scopes = refreshed.user_scopes + if latest_bot_installation.bot_token is None: # If latest_installation has a bot token, we never overwrite the value bot_token = refreshed.bot_token + bot_scopes = refreshed.bot_scopes # If token rotation is enabled, running rotation may be needed here - refreshed = await self._rotate_and_save_tokens_if_necessary(latest_installation) + refreshed = await self._rotate_and_save_tokens_if_necessary(latest_bot_installation) if refreshed is not None: bot_token = refreshed.bot_token + bot_scopes = refreshed.bot_scopes if this_user_installation is None: # Only when we don't have `this_user_installation` here, # the `user_token` is for the user associated with this request user_token = refreshed.user_token + user_scopes = refreshed.user_scopes except NotImplementedError as _: self.find_installation_available = False @@ -238,6 +248,7 @@ async def __call__( ) if bot is not None: bot_token = bot.bot_token + bot_scopes = bot.bot_scopes if bot.bot_refresh_token is not None: # Token rotation if self.token_rotator is None: @@ -249,6 +260,7 @@ async def __call__( if refreshed is not None: await self.installation_store.async_save_bot(refreshed) bot_token = refreshed.bot_token + bot_scopes = refreshed.bot_scopes except NotImplementedError as _: self.find_bot_available = False @@ -267,10 +279,16 @@ async def __call__( try: auth_test_api_response = await context.client.auth_test(token=token) + user_auth_test_response = None + if user_token is not None and token != user_token: + user_auth_test_response = await context.client.auth_test(token=user_token) authorize_result = AuthorizeResult.from_auth_test_response( auth_test_response=auth_test_api_response, + user_auth_test_response=user_auth_test_response, bot_token=bot_token, user_token=user_token, + bot_scopes=bot_scopes, + user_scopes=user_scopes, ) if self.cache_enabled: self.authorize_result_cache[token] = authorize_result diff --git a/slack_bolt/authorization/authorize.py b/slack_bolt/authorization/authorize.py index a382f7097..4f113c9cc 100644 --- a/slack_bolt/authorization/authorize.py +++ b/slack_bolt/authorization/authorize.py @@ -1,5 +1,5 @@ from logging import Logger -from typing import Optional, Callable, Dict, Any +from typing import Optional, Callable, Dict, Any, List from slack_sdk.errors import SlackApiError from slack_sdk.oauth import InstallationStore @@ -156,6 +156,10 @@ def __call__( bot_token: Optional[str] = None user_token: Optional[str] = None + bot_scopes: Optional[List[str]] = None + user_scopes: Optional[List[str]] = None + latest_bot_installation: Optional[Installation] = None + this_user_installation: Optional[Installation] = None if not self.bot_only and self.find_installation_available: # Since v1.1, this is the default way. @@ -163,7 +167,7 @@ def __call__( try: # Note that this is the latest information for the org/workspace. # The installer may not be the user associated with this incoming request. - latest_installation: Optional[Installation] = self.installation_store.find_installation( + latest_bot_installation = self.installation_store.find_installation( enterprise_id=enterprise_id, team_id=team_id, is_enterprise_install=context.is_enterprise_install, @@ -173,20 +177,20 @@ def __call__( # The example use cases are: # - The app's installation requires both bot and user tokens # - The app has two installation paths 1) bot installation 2) individual user authorization - this_user_installation: Optional[Installation] = None - - if latest_installation is not None: + if latest_bot_installation is not None: # Save the latest bot token - bot_token = latest_installation.bot_token # this still can be None - user_token = latest_installation.user_token # this still can be None + bot_token = latest_bot_installation.bot_token # this still can be None + user_token = latest_bot_installation.user_token # this still can be None + bot_scopes = latest_bot_installation.bot_scopes # this still can be None + user_scopes = latest_bot_installation.user_scopes # this still can be None - if latest_installation.user_id != user_id: + if latest_bot_installation.user_id != user_id: # First off, remove the user token as the installer is a different user user_token = None - latest_installation.user_token = None - latest_installation.user_refresh_token = None - latest_installation.user_token_expires_at = None - latest_installation.user_scopes = [] + latest_bot_installation.user_token = None + latest_bot_installation.user_refresh_token = None + latest_bot_installation.user_token_expires_at = None + latest_bot_installation.user_scopes = [] # try to fetch the request user's installation # to reflect the user's access token if exists @@ -198,26 +202,32 @@ def __call__( ) if this_user_installation is not None: user_token = this_user_installation.user_token - if latest_installation.bot_token is None: + user_scopes = this_user_installation.user_scopes + if latest_bot_installation.bot_token is None: # If latest_installation has a bot token, we never overwrite the value bot_token = this_user_installation.bot_token + bot_scopes = this_user_installation.bot_scopes # If token rotation is enabled, running rotation may be needed here refreshed = self._rotate_and_save_tokens_if_necessary(this_user_installation) if refreshed is not None: user_token = refreshed.user_token - if latest_installation.bot_token is None: + user_scopes = refreshed.user_scopes + if latest_bot_installation.bot_token is None: # If latest_installation has a bot token, we never overwrite the value bot_token = refreshed.bot_token + bot_scopes = refreshed.bot_scopes # If token rotation is enabled, running rotation may be needed here - refreshed = self._rotate_and_save_tokens_if_necessary(latest_installation) + refreshed = self._rotate_and_save_tokens_if_necessary(latest_bot_installation) if refreshed is not None: bot_token = refreshed.bot_token + bot_scopes = refreshed.bot_scopes if this_user_installation is None: # Only when we don't have `this_user_installation` here, # the `user_token` is for the user associated with this request user_token = refreshed.user_token + user_scopes = refreshed.user_scopes except NotImplementedError as _: self.find_installation_available = False @@ -238,6 +248,7 @@ def __call__( ) if bot is not None: bot_token = bot.bot_token + bot_scopes = bot.bot_scopes if bot.bot_refresh_token is not None: # Token rotation if self.token_rotator is None: @@ -249,6 +260,7 @@ def __call__( if refreshed is not None: self.installation_store.save_bot(refreshed) bot_token = refreshed.bot_token + bot_scopes = refreshed.bot_scopes except NotImplementedError as _: self.find_bot_available = False @@ -267,10 +279,16 @@ def __call__( try: auth_test_api_response = context.client.auth_test(token=token) + user_auth_test_response = None + if user_token is not None and token != user_token: + user_auth_test_response = context.client.auth_test(token=user_token) authorize_result = AuthorizeResult.from_auth_test_response( auth_test_response=auth_test_api_response, + user_auth_test_response=user_auth_test_response, bot_token=bot_token, user_token=user_token, + bot_scopes=bot_scopes, + user_scopes=user_scopes, ) if self.cache_enabled: self.authorize_result_cache[token] = authorize_result diff --git a/slack_bolt/authorization/authorize_result.py b/slack_bolt/authorization/authorize_result.py index c27be6dc8..032375519 100644 --- a/slack_bolt/authorization/authorize_result.py +++ b/slack_bolt/authorization/authorize_result.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Optional, List, Union from slack_sdk.web import SlackResponse @@ -11,8 +11,10 @@ class AuthorizeResult(dict): bot_id: Optional[str] bot_user_id: Optional[str] bot_token: Optional[str] + bot_scopes: Optional[List[str]] # since v1.17 user_id: Optional[str] user_token: Optional[str] + user_scopes: Optional[List[str]] # since v1.17 def __init__( self, @@ -23,9 +25,11 @@ def __init__( bot_user_id: Optional[str] = None, bot_id: Optional[str] = None, bot_token: Optional[str] = None, + bot_scopes: Optional[Union[List[str], str]] = None, # user user_id: Optional[str] = None, user_token: Optional[str] = None, + user_scopes: Optional[Union[List[str], str]] = None, ): """ Args: @@ -34,8 +38,10 @@ def __init__( bot_user_id: Bot user's User ID starting with either `U` or `W` bot_id: Bot ID starting with `B` bot_token: Bot user access token starting with `xoxb-` + bot_scopes: The scopes associated with the bot token user_id: The request user ID user_token: User access token starting with `xoxp-` + user_scopes: The scopes associated wth the user token """ self["enterprise_id"] = self.enterprise_id = enterprise_id self["team_id"] = self.team_id = team_id @@ -43,9 +49,15 @@ def __init__( self["bot_user_id"] = self.bot_user_id = bot_user_id self["bot_id"] = self.bot_id = bot_id self["bot_token"] = self.bot_token = bot_token + if bot_scopes is not None and isinstance(bot_scopes, str): + bot_scopes = [scope.strip() for scope in bot_scopes.split(",")] + self["bot_scopes"] = self.bot_scopes = bot_scopes # type: ignore # user self["user_id"] = self.user_id = user_id self["user_token"] = self.user_token = user_token + if user_scopes is not None and isinstance(user_scopes, str): + user_scopes = [scope.strip() for scope in user_scopes.split(",")] + self["user_scopes"] = self.user_scopes = user_scopes # type: ignore @classmethod def from_auth_test_response( @@ -53,7 +65,10 @@ def from_auth_test_response( *, bot_token: Optional[str] = None, user_token: Optional[str] = None, + bot_scopes: Optional[Union[List[str], str]] = None, + user_scopes: Optional[Union[List[str], str]] = None, auth_test_response: SlackResponse, + user_auth_test_response: Optional[SlackResponse] = None, ) -> "AuthorizeResult": bot_user_id: Optional[str] = ( # type:ignore auth_test_response.get("user_id") if auth_test_response.get("bot_id") is not None else None @@ -61,12 +76,18 @@ def from_auth_test_response( user_id: Optional[str] = ( # type:ignore auth_test_response.get("user_id") if auth_test_response.get("bot_id") is None else None ) + # Since v1.28, user_id can be set when user_token w/ its auth.test response exists + if user_id is None and user_auth_test_response is not None: + user_id: Optional[str] = user_auth_test_response.get("user_id") # type:ignore + return AuthorizeResult( enterprise_id=auth_test_response.get("enterprise_id"), team_id=auth_test_response.get("team_id"), bot_id=auth_test_response.get("bot_id"), bot_user_id=bot_user_id, + bot_scopes=bot_scopes, user_id=user_id, bot_token=bot_token, user_token=user_token, + user_scopes=user_scopes, ) diff --git a/tests/scenario_tests/test_app_installation_store.py b/tests/scenario_tests/test_app_installation_store.py new file mode 100644 index 000000000..b3b4390e3 --- /dev/null +++ b/tests/scenario_tests/test_app_installation_store.py @@ -0,0 +1,155 @@ +import datetime +import json +import logging +from time import time, sleep +from typing import Optional + +from slack_sdk import WebClient +from slack_sdk.oauth import InstallationStore +from slack_sdk.oauth.installation_store import Installation, Bot +from slack_sdk.signature import SignatureVerifier + +from slack_bolt import App, BoltRequest, Say, BoltContext +from slack_bolt.oauth.oauth_settings import OAuthSettings +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class MemoryInstallationStore(InstallationStore): + @property + def logger(self) -> logging.Logger: + return logging.getLogger(__name__) + + def save(self, installation: Installation): + pass + + def find_bot( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Bot]: + return Bot( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + installed_at=datetime.datetime.now().timestamp(), + ) + + def find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + return Installation( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid-2", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + user_id="W11111", + user_token="xoxp-valid", + user_scopes=["search:read"], + installed_at=datetime.datetime.now().timestamp(), + ) + + +class TestApp: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def build_app_mention_request(self): + timestamp, body = str(int(time())), json.dumps( + { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "team": "T111", + "channel": "C111", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, + "authed_users": ["W111"], + } + ) + return BoltRequest(body=body, headers=self.build_headers(timestamp, body)) + + def test_authorize_result(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + oauth_settings=OAuthSettings( + client_id="111.222", + client_secret="secret", + scopes=["commands"], + user_scopes=["search:read"], + installation_store=MemoryInstallationStore(), + ), + ) + + @app.event("app_mention") + def handle_app_mention(context: BoltContext, say: Say): + assert context.authorize_result.bot_id == "BZYBOTHED" + assert context.authorize_result.bot_user_id == "W23456789" + assert context.authorize_result.bot_token == "xoxb-valid-2" + assert context.authorize_result.bot_scopes == ["commands", "chat:write"] + assert context.authorize_result.user_id == "W99999" + assert context.authorize_result.user_token == "xoxp-valid" + assert context.authorize_result.user_scopes == ["search:read"] + say("What's up?") + + response = app.dispatch(self.build_app_mention_request()) + assert response.status == 200 + assert_auth_test_count(self, 1) + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 diff --git a/tests/scenario_tests_async/test_app_installation_store.py b/tests/scenario_tests_async/test_app_installation_store.py new file mode 100644 index 000000000..17bf92255 --- /dev/null +++ b/tests/scenario_tests_async/test_app_installation_store.py @@ -0,0 +1,167 @@ +import asyncio +import datetime +import json +import logging +from time import time +from typing import Optional + +import pytest +from slack_sdk.oauth.installation_store import Installation, Bot +from slack_sdk.oauth.installation_store.async_installation_store import ( + AsyncInstallationStore, +) +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.context.async_context import AsyncBoltContext +from slack_bolt.context.say.async_say import AsyncSay +from slack_bolt.oauth.async_oauth_settings import AsyncOAuthSettings +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count_async, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestApp: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def build_valid_app_mention_request(self) -> AsyncBoltRequest: + timestamp, body = str(int(time())), json.dumps(app_mention_body) + return AsyncBoltRequest(body=body, headers=self.build_headers(timestamp, body)) + + @pytest.mark.asyncio + async def test_authorize_result(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + oauth_settings=AsyncOAuthSettings( + client_id="111.222", + client_secret="secret", + installation_store=MemoryInstallationStore(), + ), + ) + + @app.event("app_mention") + async def handle_app_mention(context: AsyncBoltContext, say: AsyncSay): + assert context.authorize_result.bot_id == "BZYBOTHED" + assert context.authorize_result.bot_user_id == "W23456789" + assert context.authorize_result.bot_token == "xoxb-valid-2" + assert context.authorize_result.bot_scopes == ["commands", "chat:write"] + assert context.authorize_result.user_id == "W99999" + assert context.authorize_result.user_token == "xoxp-valid" + assert context.authorize_result.user_scopes == ["search:read"] + await say("What's up?") + + request = self.build_valid_app_mention_request() + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_auth_test_count_async(self, 1) + await asyncio.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + +app_mention_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "team": "T111", + "channel": "C111", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, + "authed_users": ["W111"], +} + + +class MemoryInstallationStore(AsyncInstallationStore): + @property + def logger(self) -> logging.Logger: + return logging.getLogger(__name__) + + async def async_save(self, installation: Installation): + pass + + async def async_find_bot( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Bot]: + return Bot( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + installed_at=datetime.datetime.now().timestamp(), + ) + + async def async_find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + return Installation( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid-2", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + user_id="W11111", + user_token="xoxp-valid", + user_scopes=["search:read"], + installed_at=datetime.datetime.now().timestamp(), + ) From b48c9fa5d8a7e82117ad0016dae17b6b80722210 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 13 Mar 2023 18:56:12 +0900 Subject: [PATCH 422/719] Fix tests --- tests/scenario_tests_async/test_web_client_customization.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/scenario_tests_async/test_web_client_customization.py b/tests/scenario_tests_async/test_web_client_customization.py index 8cd6d840e..6f810b471 100644 --- a/tests/scenario_tests_async/test_web_client_customization.py +++ b/tests/scenario_tests_async/test_web_client_customization.py @@ -69,8 +69,8 @@ async def test_web_client_customization(self): return self.web_client.retry_handlers = [ - AsyncConnectionErrorRetryHandler, - AsyncRateLimitErrorRetryHandler, + AsyncConnectionErrorRetryHandler(), + AsyncRateLimitErrorRetryHandler(), ] app = AsyncApp( client=self.web_client, From 65d1435a2256f3a23cab1f856d2571927b05f752 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 13 Mar 2023 20:17:43 +0900 Subject: [PATCH 423/719] Introduce actor enterprise/team/user_id for Slack Connect events (#854) --- .../aws_lambda/lambda_s3_oauth_flow.py | 1 + slack_bolt/app/app.py | 9 +- slack_bolt/app/async_app.py | 7 +- slack_bolt/authorization/async_authorize.py | 60 +- slack_bolt/authorization/authorize.py | 57 +- slack_bolt/context/base_context.py | 27 + .../async_multi_teams_authorization.py | 34 +- .../multi_teams_authorization.py | 28 +- slack_bolt/oauth/async_oauth_settings.py | 9 + slack_bolt/oauth/oauth_settings.py | 9 + slack_bolt/request/async_internals.py | 13 + slack_bolt/request/internals.py | 79 ++ .../test_app_actor_user_token.py | 178 ++++ .../test_app_actor_user_token.py | 189 ++++ tests/slack_bolt/request/test_internals.py | 857 ++++++++++++++++++ 15 files changed, 1526 insertions(+), 31 deletions(-) create mode 100644 tests/scenario_tests/test_app_actor_user_token.py create mode 100644 tests/scenario_tests_async/test_app_actor_user_token.py diff --git a/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py b/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py index 4d6fae1dc..deacac7f5 100644 --- a/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py +++ b/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.py @@ -59,6 +59,7 @@ def __init__( client_secret=settings.client_secret, installation_store=settings.installation_store, bot_only=settings.installation_store_bot_only, + user_token_resolution=(settings.user_token_resolution if settings is not None else "authed_user"), ) OAuthFlow.__init__(self, client=client, logger=logger, settings=settings) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 4d27ddfec..9d8d09149 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -238,6 +238,7 @@ def message_hello(message, say): logger=self._framework_logger, bot_only=installation_store_bot_only, client=self._client, # for proxy use cases etc. + user_token_resolution=(settings.user_token_resolution if settings is not None else "authed_user"), ) self._oauth_flow: Optional[OAuthFlow] = None @@ -379,7 +380,13 @@ def _init_middleware_list( else: raise BoltError(error_token_required()) else: - self._middleware_list.append(MultiTeamsAuthorization(authorize=self._authorize, base_logger=self._base_logger)) + self._middleware_list.append( + MultiTeamsAuthorization( + authorize=self._authorize, + base_logger=self._base_logger, + user_token_resolution=self._oauth_flow.settings.user_token_resolution, + ) + ) if ignoring_self_events_enabled is True: self._middleware_list.append(IgnoringSelfEvents(base_logger=self._base_logger)) if url_verification_enabled is True: diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index ae224e341..1070e4363 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -243,6 +243,7 @@ async def message_hello(message, say): # async function logger=self._framework_logger, bot_only=installation_store_bot_only, client=self._async_client, # for proxy use cases etc. + user_token_resolution=(settings.user_token_resolution if settings is not None else "authed_user"), ) self._async_oauth_flow: Optional[AsyncOAuthFlow] = None @@ -374,7 +375,11 @@ def _init_async_middleware_list( raise BoltError(error_token_required()) else: self._async_middleware_list.append( - AsyncMultiTeamsAuthorization(authorize=self._async_authorize, base_logger=self._base_logger) + AsyncMultiTeamsAuthorization( + authorize=self._async_authorize, + base_logger=self._base_logger, + user_token_resolution=self._async_oauth_flow.settings.user_token_resolution, + ) ) if ignoring_self_events_enabled is True: diff --git a/slack_bolt/authorization/async_authorize.py b/slack_bolt/authorization/async_authorize.py index b6825c7ab..18189adc8 100644 --- a/slack_bolt/authorization/async_authorize.py +++ b/slack_bolt/authorization/async_authorize.py @@ -30,6 +30,10 @@ async def __call__( enterprise_id: Optional[str], team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], + # actor_* can be used only when user_token_resolution: "actor" is set + actor_enterprise_id: Optional[str] = None, + actor_team_id: Optional[str] = None, + actor_user_id: Optional[str] = None, ) -> Optional[AuthorizeResult]: raise NotImplementedError() @@ -51,6 +55,10 @@ async def __call__( enterprise_id: Optional[str], team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], + # actor_* can be used only when user_token_resolution: "actor" is set + actor_enterprise_id: Optional[str] = None, + actor_team_id: Optional[str] = None, + actor_user_id: Optional[str] = None, ) -> Optional[AuthorizeResult]: try: all_available_args = { @@ -66,6 +74,9 @@ async def __call__( "enterprise_id": enterprise_id, "team_id": team_id, "user_id": user_id, + "actor_enterprise_id": actor_enterprise_id, + "actor_team_id": actor_team_id, + "actor_user_id": actor_user_id, } for k, v in context.items(): if k not in all_available_args: @@ -103,6 +114,8 @@ class AsyncInstallationStoreAuthorize(AsyncAuthorize): """ authorize_result_cache: Dict[str, AuthorizeResult] + bot_only: bool + user_token_resolution: str find_installation_available: Optional[bool] find_bot_available: Optional[bool] token_rotator: Optional[AsyncTokenRotator] @@ -122,10 +135,13 @@ def __init__( bot_only: bool = False, cache_enabled: bool = False, client: Optional[AsyncWebClient] = None, + # Since v1.27, user token resolution can be actor ID based when the mode is enabled + user_token_resolution: str = "authed_user", ): self.logger = logger self.installation_store = installation_store self.bot_only = bot_only + self.user_token_resolution = user_token_resolution self.cache_enabled = cache_enabled self.authorize_result_cache = {} self.find_installation_available = None @@ -147,6 +163,10 @@ async def __call__( enterprise_id: Optional[str], team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], + # actor_* can be used only when user_token_resolution: "actor" is set + actor_enterprise_id: Optional[str] = None, + actor_team_id: Optional[str] = None, + actor_user_id: Optional[str] = None, ) -> Optional[AuthorizeResult]: if self.find_installation_available is None: @@ -194,16 +214,34 @@ async def __call__( # try to fetch the request user's installation # to reflect the user's access token if exists - this_user_installation = await self.installation_store.async_find_installation( - enterprise_id=enterprise_id, - team_id=team_id, - user_id=user_id, - is_enterprise_install=context.is_enterprise_install, - ) + # try to fetch the request user's installation + # to reflect the user's access token if exists + if self.user_token_resolution == "actor": + if actor_enterprise_id is not None or actor_team_id is not None: + # Note that actor_team_id can be absent for app_mention events + this_user_installation = await self.installation_store.async_find_installation( + enterprise_id=actor_enterprise_id, + team_id=actor_team_id, + user_id=actor_user_id, + is_enterprise_install=None, + ) + else: + this_user_installation = await self.installation_store.async_find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + user_id=user_id, + is_enterprise_install=context.is_enterprise_install, + ) if this_user_installation is not None: user_token = this_user_installation.user_token user_scopes = this_user_installation.user_scopes - if latest_bot_installation.bot_token is None: + if ( + latest_bot_installation.bot_token is None + # enterprise_id/team_id can be different for Slack Connect channel events + # when enabling user_token_resolution: "actor" + and latest_bot_installation.enterprise_id == this_user_installation.enterprise_id + and latest_bot_installation.team_id == this_user_installation.team_id + ): # If latest_installation has a bot token, we never overwrite the value bot_token = this_user_installation.bot_token bot_scopes = this_user_installation.bot_scopes @@ -213,7 +251,13 @@ async def __call__( if refreshed is not None: user_token = refreshed.user_token user_scopes = refreshed.user_scopes - if latest_bot_installation.bot_token is None: + if ( + latest_bot_installation.bot_token is None + # enterprise_id/team_id can be different for Slack Connect channel events + # when enabling user_token_resolution: "actor" + and latest_bot_installation.enterprise_id == this_user_installation.enterprise_id + and latest_bot_installation.team_id == this_user_installation.team_id + ): # If latest_installation has a bot token, we never overwrite the value bot_token = refreshed.bot_token bot_scopes = refreshed.bot_scopes diff --git a/slack_bolt/authorization/authorize.py b/slack_bolt/authorization/authorize.py index 4f113c9cc..05b306165 100644 --- a/slack_bolt/authorization/authorize.py +++ b/slack_bolt/authorization/authorize.py @@ -29,6 +29,10 @@ def __call__( enterprise_id: Optional[str], team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], + # actor_* can be used only when user_token_resolution: "actor" is set + actor_enterprise_id: Optional[str] = None, + actor_team_id: Optional[str] = None, + actor_user_id: Optional[str] = None, ) -> Optional[AuthorizeResult]: raise NotImplementedError() @@ -55,6 +59,10 @@ def __call__( enterprise_id: Optional[str], team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], + # actor_* can be used only when user_token_resolution: "actor" is set + actor_enterprise_id: Optional[str] = None, + actor_team_id: Optional[str] = None, + actor_user_id: Optional[str] = None, ) -> Optional[AuthorizeResult]: try: all_available_args = { @@ -70,6 +78,9 @@ def __call__( "enterprise_id": enterprise_id, "team_id": team_id, "user_id": user_id, + "actor_enterprise_id": actor_enterprise_id, + "actor_team_id": actor_team_id, + "actor_user_id": actor_user_id, } for k, v in context.items(): if k not in all_available_args: @@ -108,6 +119,7 @@ class InstallationStoreAuthorize(Authorize): authorize_result_cache: Dict[str, AuthorizeResult] bot_only: bool + user_token_resolution: str find_installation_available: bool find_bot_available: bool token_rotator: Optional[TokenRotator] @@ -127,10 +139,13 @@ def __init__( bot_only: bool = False, cache_enabled: bool = False, client: Optional[WebClient] = None, + # Since v1.27, user token resolution can be actor ID based when the mode is enabled + user_token_resolution: str = "authed_user", ): self.logger = logger self.installation_store = installation_store self.bot_only = bot_only + self.user_token_resolution = user_token_resolution self.cache_enabled = cache_enabled self.authorize_result_cache = {} self.find_installation_available = hasattr(installation_store, "find_installation") @@ -152,6 +167,10 @@ def __call__( enterprise_id: Optional[str], team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], + # actor_* can be used only when user_token_resolution: "actor" is set + actor_enterprise_id: Optional[str] = None, + actor_team_id: Optional[str] = None, + actor_user_id: Optional[str] = None, ) -> Optional[AuthorizeResult]: bot_token: Optional[str] = None @@ -194,16 +213,32 @@ def __call__( # try to fetch the request user's installation # to reflect the user's access token if exists - this_user_installation = self.installation_store.find_installation( - enterprise_id=enterprise_id, - team_id=team_id, - user_id=user_id, - is_enterprise_install=context.is_enterprise_install, - ) + if self.user_token_resolution == "actor": + if actor_enterprise_id is not None or actor_team_id is not None: + # Note that actor_team_id can be absent for app_mention events + this_user_installation = self.installation_store.find_installation( + enterprise_id=actor_enterprise_id, + team_id=actor_team_id, + user_id=actor_user_id, + is_enterprise_install=None, + ) + else: + this_user_installation = self.installation_store.find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + user_id=user_id, + is_enterprise_install=context.is_enterprise_install, + ) if this_user_installation is not None: user_token = this_user_installation.user_token user_scopes = this_user_installation.user_scopes - if latest_bot_installation.bot_token is None: + if ( + latest_bot_installation.bot_token is None + # enterprise_id/team_id can be different for Slack Connect channel events + # when enabling user_token_resolution: "actor" + and latest_bot_installation.enterprise_id == this_user_installation.enterprise_id + and latest_bot_installation.team_id == this_user_installation.team_id + ): # If latest_installation has a bot token, we never overwrite the value bot_token = this_user_installation.bot_token bot_scopes = this_user_installation.bot_scopes @@ -213,7 +248,13 @@ def __call__( if refreshed is not None: user_token = refreshed.user_token user_scopes = refreshed.user_scopes - if latest_bot_installation.bot_token is None: + if ( + latest_bot_installation.bot_token is None + # enterprise_id/team_id can be different for Slack Connect channel events + # when enabling user_token_resolution: "actor" + and latest_bot_installation.enterprise_id == this_user_installation.enterprise_id + and latest_bot_installation.team_id == this_user_installation.team_id + ): # If latest_installation has a bot token, we never overwrite the value bot_token = refreshed.bot_token bot_scopes = refreshed.bot_scopes diff --git a/slack_bolt/context/base_context.py b/slack_bolt/context/base_context.py index f6c67bb60..bcbdae3c2 100644 --- a/slack_bolt/context/base_context.py +++ b/slack_bolt/context/base_context.py @@ -17,6 +17,9 @@ class BaseContext(dict): "is_enterprise_install", "team_id", "user_id", + "actor_enterprise_id", + "actor_team_id", + "actor_user_id", "channel_id", "response_url", "matches", @@ -61,6 +64,30 @@ def user_id(self) -> Optional[str]: """The user ID associated ith this request.""" return self.get("user_id") + @property + def actor_enterprise_id(self) -> Optional[str]: + """The action's actor's Enterprise Grid organization ID. + Note that this property is especially useful for handling events in Slack Connect channels. + That being said, it's not guaranteed to have a valid ID for all events due to server-side inconsistency. + """ + return self.get("actor_enterprise_id") + + @property + def actor_team_id(self) -> Optional[str]: + """The action's actor's workspace ID. + Note that this property is especially useful for handling events in Slack Connect channels. + That being said, it's not guaranteed to have a valid ID for all events due to server-side inconsistency. + """ + return self.get("actor_team_id") + + @property + def actor_user_id(self) -> Optional[str]: + """The action's actor's user ID. + Note that this property is especially useful for handling events in Slack Connect channels. + That being said, it's not guaranteed to have a valid ID for all events due to server-side inconsistency. + """ + return self.get("actor_user_id") + @property def channel_id(self) -> Optional[str]: """The conversation ID associated with this request.""" diff --git a/slack_bolt/middleware/authorization/async_multi_teams_authorization.py b/slack_bolt/middleware/authorization/async_multi_teams_authorization.py index 4f977c642..ffc47dc29 100644 --- a/slack_bolt/middleware/authorization/async_multi_teams_authorization.py +++ b/slack_bolt/middleware/authorization/async_multi_teams_authorization.py @@ -14,16 +14,24 @@ class AsyncMultiTeamsAuthorization(AsyncAuthorization): authorize: AsyncAuthorize + user_token_resolution: str - def __init__(self, authorize: AsyncAuthorize, base_logger: Optional[Logger] = None): + def __init__( + self, + authorize: AsyncAuthorize, + base_logger: Optional[Logger] = None, + user_token_resolution: str = "authed_user", + ): """Multi-workspace authorization. Args: authorize: The function to authorize incoming requests from Slack. base_logger: The base logger + user_token_resolution: "authed_user" or "actor" """ self.authorize = authorize self.logger = get_bolt_logger(AsyncMultiTeamsAuthorization, base_logger=base_logger) + self.user_token_resolution = user_token_resolution async def async_process( self, @@ -49,12 +57,24 @@ async def async_process( return await next() try: - auth_result: Optional[AuthorizeResult] = await self.authorize( - context=req.context, - enterprise_id=req.context.enterprise_id, - team_id=req.context.team_id, - user_id=req.context.user_id, - ) + auth_result: Optional[AuthorizeResult] = None + if self.user_token_resolution == "actor": + auth_result = await self.authorize( + context=req.context, + enterprise_id=req.context.enterprise_id, + team_id=req.context.team_id, + user_id=req.context.user_id, + actor_enterprise_id=req.context.actor_enterprise_id, + actor_team_id=req.context.actor_team_id, + actor_user_id=req.context.actor_user_id, + ) + else: + auth_result = await self.authorize( + context=req.context, + enterprise_id=req.context.enterprise_id, + team_id=req.context.team_id, + user_id=req.context.user_id, + ) if auth_result: req.context.set_authorize_result(auth_result) token = auth_result.bot_token or auth_result.user_token diff --git a/slack_bolt/middleware/authorization/multi_teams_authorization.py b/slack_bolt/middleware/authorization/multi_teams_authorization.py index dd7c9ad3e..3ce3a54ec 100644 --- a/slack_bolt/middleware/authorization/multi_teams_authorization.py +++ b/slack_bolt/middleware/authorization/multi_teams_authorization.py @@ -18,21 +18,25 @@ class MultiTeamsAuthorization(Authorization): authorize: Authorize + user_token_resolution: str def __init__( self, *, authorize: Authorize, base_logger: Optional[Logger] = None, + user_token_resolution: str = "authed_user", ): """Multi-workspace authorization. Args: authorize: The function to authorize incoming requests from Slack. base_logger: The base logger + user_token_resolution: "authed_user" or "actor" """ self.authorize = authorize self.logger = get_bolt_logger(MultiTeamsAuthorization, base_logger=base_logger) + self.user_token_resolution = user_token_resolution def process( self, @@ -55,12 +59,24 @@ def process( return next() try: - auth_result: Optional[AuthorizeResult] = self.authorize( - context=req.context, - enterprise_id=req.context.enterprise_id, - team_id=req.context.team_id, - user_id=req.context.user_id, - ) + auth_result: Optional[AuthorizeResult] = None + if self.user_token_resolution == "actor": + auth_result = self.authorize( + context=req.context, + enterprise_id=req.context.enterprise_id, + team_id=req.context.team_id, + user_id=req.context.user_id, + actor_enterprise_id=req.context.actor_enterprise_id, + actor_team_id=req.context.actor_team_id, + actor_user_id=req.context.actor_user_id, + ) + else: + auth_result = self.authorize( + context=req.context, + enterprise_id=req.context.enterprise_id, + team_id=req.context.team_id, + user_id=req.context.user_id, + ) if auth_result is not None: req.context.set_authorize_result(auth_result) token = auth_result.bot_token or auth_result.user_token diff --git a/slack_bolt/oauth/async_oauth_settings.py b/slack_bolt/oauth/async_oauth_settings.py index 080abd6be..c90fc97e1 100644 --- a/slack_bolt/oauth/async_oauth_settings.py +++ b/slack_bolt/oauth/async_oauth_settings.py @@ -42,6 +42,7 @@ class AsyncOAuthSettings: installation_store: AsyncInstallationStore installation_store_bot_only: bool token_rotation_expiration_minutes: int + user_token_resolution: str authorize: AsyncAuthorize # state parameter related configurations state_validation_enabled: bool @@ -76,6 +77,7 @@ def __init__( installation_store: Optional[AsyncInstallationStore] = None, installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, + user_token_resolution: str = "authed_user", # state parameter related configurations state_validation_enabled: bool = True, state_store: Optional[AsyncOAuthStateStore] = None, @@ -102,6 +104,11 @@ def __init__( installation_store: Specify the instance of `InstallationStore` (Default: `FileInstallationStore`) installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) token_rotation_expiration_minutes: Minutes before refreshing tokens (Default: 2 hours) + user_token_resolution: The option to pick up a user token per request (Default: authed_user) + The available values are "authed_user" and "actor". When you want to resolve the user token per request + using the event's actor IDs, you can set "actor" instead. With this option, bolt-python tries to resolve + a user token for context.actor_enterprise/team/user_id. This can be useful for events in Slack Connect + channels. Note that actor IDs can be absent in some scenarios. state_validation_enabled: Set False if your OAuth flow omits the state parameter validation (Default: True) state_store: Specify the instance of `InstallationStore` (Default: `FileOAuthStateStore`) state_cookie_name: The cookie name that is set for installers' browser. (Default: "slack-app-oauth-state") @@ -143,6 +150,7 @@ def __init__( self.authorization_url = authorization_url or "https://slack.com/oauth/v2/authorize" # Installation Management self.installation_store = installation_store or get_or_create_default_installation_store(client_id) + self.user_token_resolution = user_token_resolution or "authed_user" self.installation_store_bot_only = installation_store_bot_only self.token_rotation_expiration_minutes = token_rotation_expiration_minutes self.authorize = AsyncInstallationStoreAuthorize( @@ -152,6 +160,7 @@ def __init__( token_rotation_expiration_minutes=self.token_rotation_expiration_minutes, installation_store=self.installation_store, bot_only=self.installation_store_bot_only, + user_token_resolution=user_token_resolution, ) # state parameter related configurations self.state_validation_enabled = state_validation_enabled diff --git a/slack_bolt/oauth/oauth_settings.py b/slack_bolt/oauth/oauth_settings.py index d56856414..a3c2b49c5 100644 --- a/slack_bolt/oauth/oauth_settings.py +++ b/slack_bolt/oauth/oauth_settings.py @@ -38,6 +38,7 @@ class OAuthSettings: installation_store_bot_only: bool token_rotation_expiration_minutes: int authorize: Authorize + user_token_resolution: str # default: "authed_user" # state parameter related configurations state_validation_enabled: bool state_store: OAuthStateStore @@ -71,6 +72,7 @@ def __init__( installation_store: Optional[InstallationStore] = None, installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, + user_token_resolution: str = "authed_user", # state parameter related configurations state_validation_enabled: bool = True, state_store: Optional[OAuthStateStore] = None, @@ -97,6 +99,11 @@ def __init__( installation_store: Specify the instance of `InstallationStore` (Default: `FileInstallationStore`) installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) token_rotation_expiration_minutes: Minutes before refreshing tokens (Default: 2 hours) + user_token_resolution: The option to pick up a user token per request (Default: authed_user) + The available values are "authed_user" and "actor". When you want to resolve the user token per request + using the event's actor IDs, you can set "actor" instead. With this option, bolt-python tries to resolve + a user token for context.actor_enterprise/team/user_id. This can be useful for events in Slack Connect + channels. Note that actor IDs can be absent in some scenarios. state_validation_enabled: Set False if your OAuth flow omits the state parameter validation (Default: True) state_store: Specify the instance of `InstallationStore` (Default: `FileOAuthStateStore`) state_cookie_name: The cookie name that is set for installers' browser. (Default: "slack-app-oauth-state") @@ -136,6 +143,7 @@ def __init__( self.authorization_url = authorization_url or "https://slack.com/oauth/v2/authorize" # Installation Management self.installation_store = installation_store or get_or_create_default_installation_store(client_id) + self.user_token_resolution = user_token_resolution or "authed_user" self.installation_store_bot_only = installation_store_bot_only self.token_rotation_expiration_minutes = token_rotation_expiration_minutes self.authorize = InstallationStoreAuthorize( @@ -145,6 +153,7 @@ def __init__( token_rotation_expiration_minutes=self.token_rotation_expiration_minutes, installation_store=self.installation_store, bot_only=self.installation_store_bot_only, + user_token_resolution=user_token_resolution, ) # state parameter related configurations self.state_validation_enabled = state_validation_enabled diff --git a/slack_bolt/request/async_internals.py b/slack_bolt/request/async_internals.py index b32ccb20e..1d662c1d5 100644 --- a/slack_bolt/request/async_internals.py +++ b/slack_bolt/request/async_internals.py @@ -8,6 +8,9 @@ extract_user_id, extract_channel_id, debug_multiple_response_urls_detected, + extract_actor_enterprise_id, + extract_actor_team_id, + extract_actor_user_id, ) @@ -25,6 +28,16 @@ def build_async_context( user_id = extract_user_id(body) if user_id: context["user_id"] = user_id + # Actor IDs are useful for Events API on a Slack Connect channel + actor_enterprise_id = extract_actor_enterprise_id(body) + if actor_enterprise_id: + context["actor_enterprise_id"] = actor_enterprise_id + actor_team_id = extract_actor_team_id(body) + if actor_team_id: + context["actor_team_id"] = actor_team_id + actor_user_id = extract_actor_user_id(body) + if actor_user_id: + context["actor_user_id"] = actor_user_id channel_id = extract_channel_id(body) if channel_id: context["channel_id"] = channel_id diff --git a/slack_bolt/request/internals.py b/slack_bolt/request/internals.py index 729976ff9..1a3d3e428 100644 --- a/slack_bolt/request/internals.py +++ b/slack_bolt/request/internals.py @@ -72,6 +72,20 @@ def extract_enterprise_id(payload: Dict[str, Any]) -> Optional[str]: return None +def extract_actor_enterprise_id(payload: Dict[str, Any]) -> Optional[str]: + if payload.get("is_ext_shared_channel") is True: + if payload.get("type") == "event_callback": + # For safety, we don't set actor IDs for the events like "file_shared", + # which do not provide any team ID in $.event data. In the case, the IDs cannot be correct. + event_team_id = payload.get("event", {}).get("user_team") or payload.get("event", {}).get("team") + if event_team_id is not None and str(event_team_id).startswith("E"): + return event_team_id + if event_team_id == payload.get("team_id"): + return payload.get("enterprise_id") + return None + return extract_enterprise_id(payload) + + def extract_team_id(payload: Dict[str, Any]) -> Optional[str]: if payload.get("view", {}).get("app_installed_team_id") is not None: # view_submission payloads can have `view.app_installed_team_id` when a modal view that was opened @@ -102,6 +116,48 @@ def extract_team_id(payload: Dict[str, Any]) -> Optional[str]: return None +def extract_actor_team_id(payload: Dict[str, Any]) -> Optional[str]: + if payload.get("is_ext_shared_channel") is True: + if payload.get("type") == "event_callback": + event_type = payload.get("event", {}).get("type") + if event_type == "app_mention": + # The $.event.user_team can be an enterprise_id in app_mention events. + # In the scenario, there is no way to retrieve actor_team_id as of March 2023 + user_team = payload.get("event", {}).get("user_team") + if user_team is None: + # working with an app installed in this user's org/workspace side + return payload.get("event", {}).get("team") + if str(user_team).startswith("T"): + # interacting from a connected non-grid workspace + return user_team + # Interacting from a connected grid workspace; in this case, team_id cannot be resolved as of March 2023 + return None + # For safety, we don't set actor IDs for the events like "file_shared", + # which do not provide any team ID in $.event data. In the case, the IDs cannot be correct. + event_user_team = payload.get("event", {}).get("user_team") + if event_user_team is not None: + if str(event_user_team).startswith("T"): + return event_user_team + elif str(event_user_team).startswith("E"): + if event_user_team == payload.get("enterprise_id"): + return payload.get("team_id") + elif event_user_team == payload.get("context_enterprise_id"): + return payload.get("context_team_id") + + event_team = payload.get("event", {}).get("team") + if event_team is not None: + if str(event_team).startswith("T"): + return event_team + elif str(event_team).startswith("E"): + if event_team == payload.get("enterprise_id"): + return payload.get("team_id") + elif event_team == payload.get("context_enterprise_id"): + return payload.get("context_team_id") + return None + + return extract_team_id(payload) + + def extract_user_id(payload: Dict[str, Any]) -> Optional[str]: user = payload.get("user") if user is not None: @@ -122,6 +178,19 @@ def extract_user_id(payload: Dict[str, Any]) -> Optional[str]: return None +def extract_actor_user_id(payload: Dict[str, Any]) -> Optional[str]: + if payload.get("is_ext_shared_channel") is True: + if payload.get("type") == "event_callback": + event = payload.get("event") + if event is None: + return None + if extract_actor_enterprise_id(payload) is None and extract_actor_team_id(payload) is None: + # When both enterprise_id and team_id are not identified, we skip returning user_id too for safety + return None + return event.get("user") or event.get("user_id") + return extract_user_id(payload) + + def extract_channel_id(payload: Dict[str, Any]) -> Optional[str]: channel = payload.get("channel") if channel is not None: @@ -150,6 +219,16 @@ def build_context(context: BoltContext, body: Dict[str, Any]) -> BoltContext: user_id = extract_user_id(body) if user_id: context["user_id"] = user_id + # Actor IDs are useful for Events API on a Slack Connect channel + actor_enterprise_id = extract_actor_enterprise_id(body) + if actor_enterprise_id: + context["actor_enterprise_id"] = actor_enterprise_id + actor_team_id = extract_actor_team_id(body) + if actor_team_id: + context["actor_team_id"] = actor_team_id + actor_user_id = extract_actor_user_id(body) + if actor_user_id: + context["actor_user_id"] = actor_user_id channel_id = extract_channel_id(body) if channel_id: context["channel_id"] = channel_id diff --git a/tests/scenario_tests/test_app_actor_user_token.py b/tests/scenario_tests/test_app_actor_user_token.py new file mode 100644 index 000000000..4fd1b4751 --- /dev/null +++ b/tests/scenario_tests/test_app_actor_user_token.py @@ -0,0 +1,178 @@ +import datetime +import json +import logging +from time import time, sleep +from typing import Optional + +from slack_sdk import WebClient +from slack_sdk.oauth import InstallationStore +from slack_sdk.oauth.installation_store import Installation, Bot +from slack_sdk.signature import SignatureVerifier + +from slack_bolt import App, BoltRequest, Say, BoltContext +from slack_bolt.oauth.oauth_settings import OAuthSettings +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class MemoryInstallationStore(InstallationStore): + @property + def logger(self) -> logging.Logger: + return logging.getLogger(__name__) + + def save(self, installation: Installation): + pass + + def find_bot( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Bot]: + return Bot( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + installed_at=datetime.datetime.now().timestamp(), + ) + + def find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + if team_id == "T0G9PQBBK": + return Installation( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid-2", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + user_id="W11111", + installed_at=datetime.datetime.now().timestamp(), + ) + if team_id == "T014GJXU940" and enterprise_id == "E013Y3SHLAY": + return Installation( + app_id="A111", + enterprise_id="E013Y3SHLAY", + team_id="T014GJXU940", + user_id="W11111", + user_token="xoxp-valid-actor-based", + user_scopes=["search:read", "chat:write"], + installed_at=datetime.datetime.now().timestamp(), + ) + return None + + +class TestApp: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def build_request(self): + timestamp, body = str(int(time())), json.dumps( + { + "team_id": "T014GJXU940", + "enterprise_id": "E013Y3SHLAY", + "context_team_id": "T014GJXU940", + "context_enterprise_id": "E013Y3SHLAY", + "api_app_id": "A04TEM7H4S0", + "event": { + "type": "message", + "files": [], + "upload": False, + "user": "W013QGS7BPF", + "display_as_bot": False, + "team": "T014GJXU940", + "channel": "C04T3ACM40K", + "subtype": "file_share", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T0G9PQBBK", + "user_id": "W23456789", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": True, + } + ) + return BoltRequest(body=body, headers=self.build_headers(timestamp, body)) + + def test_authorize_result(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + oauth_settings=OAuthSettings( + client_id="111.222", + client_secret="secret", + scopes=["commands", "chat:write"], + user_scopes=["search:read", "chat:write"], + installation_store=MemoryInstallationStore(), + user_token_resolution="actor", + ), + ) + + @app.event("message") + def handle_events(context: BoltContext, say: Say): + assert context.actor_enterprise_id == "E013Y3SHLAY" + assert context.actor_team_id == "T014GJXU940" + assert context.actor_user_id == "W013QGS7BPF" + + assert context.authorize_result.bot_id == "BZYBOTHED" + assert context.authorize_result.bot_user_id == "W23456789" + assert context.authorize_result.bot_token == "xoxb-valid-2" + assert context.authorize_result.bot_scopes == ["commands", "chat:write"] + assert context.authorize_result.user_id == "W99999" + assert context.authorize_result.user_token == "xoxp-valid-actor-based" + assert context.authorize_result.user_scopes == ["search:read", "chat:write"] + say("What's up?") + + response = app.dispatch(self.build_request()) + assert response.status == 200 + assert_auth_test_count(self, 1) + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 diff --git a/tests/scenario_tests_async/test_app_actor_user_token.py b/tests/scenario_tests_async/test_app_actor_user_token.py new file mode 100644 index 000000000..c9c395297 --- /dev/null +++ b/tests/scenario_tests_async/test_app_actor_user_token.py @@ -0,0 +1,189 @@ +import asyncio +import datetime +import json +import logging +from time import time +from typing import Optional + +import pytest +from slack_sdk.oauth.installation_store import Installation, Bot +from slack_sdk.oauth.installation_store.async_installation_store import ( + AsyncInstallationStore, +) +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.context.async_context import AsyncBoltContext +from slack_bolt.context.say.async_say import AsyncSay +from slack_bolt.oauth.async_oauth_settings import AsyncOAuthSettings +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, + assert_auth_test_count_async, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestApp: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + @pytest.fixture + def event_loop(self): + old_os_env = remove_os_env_temporarily() + try: + setup_mock_web_api_server(self) + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + finally: + restore_os_env(old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_headers(self, timestamp: str, body: str): + return { + "content-type": ["application/json"], + "x-slack-signature": [self.generate_signature(body, timestamp)], + "x-slack-request-timestamp": [timestamp], + } + + def build_request(self) -> AsyncBoltRequest: + timestamp, body = str(int(time())), json.dumps( + { + "team_id": "T014GJXU940", + "enterprise_id": "E013Y3SHLAY", + "context_team_id": "T014GJXU940", + "context_enterprise_id": "E013Y3SHLAY", + "api_app_id": "A04TEM7H4S0", + "event": { + "type": "message", + "files": [], + "upload": False, + "user": "W013QGS7BPF", + "display_as_bot": False, + "team": "T014GJXU940", + "channel": "C04T3ACM40K", + "subtype": "file_share", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T0G9PQBBK", + "user_id": "W23456789", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": True, + } + ) + return AsyncBoltRequest(body=body, headers=self.build_headers(timestamp, body)) + + @pytest.mark.asyncio + async def test_authorize_result(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + oauth_settings=AsyncOAuthSettings( + client_id="111.222", + client_secret="secret", + installation_store=MemoryInstallationStore(), + user_token_resolution="actor", + ), + ) + + @app.event("message") + async def handle_events(context: AsyncBoltContext, say: AsyncSay): + assert context.actor_enterprise_id == "E013Y3SHLAY" + assert context.actor_team_id == "T014GJXU940" + assert context.actor_user_id == "W013QGS7BPF" + + assert context.authorize_result.bot_id == "BZYBOTHED" + assert context.authorize_result.bot_user_id == "W23456789" + assert context.authorize_result.bot_token == "xoxb-valid-2" + assert context.authorize_result.bot_scopes == ["commands", "chat:write"] + assert context.authorize_result.user_id == "W99999" + assert context.authorize_result.user_token == "xoxp-valid-actor-based" + assert context.authorize_result.user_scopes == ["search:read", "chat:write"] + await say("What's up?") + + request = self.build_request() + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_auth_test_count_async(self, 1) + await asyncio.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + + +class MemoryInstallationStore(AsyncInstallationStore): + @property + def logger(self) -> logging.Logger: + return logging.getLogger(__name__) + + async def async_save(self, installation: Installation): + pass + + async def async_find_bot( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Bot]: + return Bot( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + installed_at=datetime.datetime.now().timestamp(), + ) + + async def async_find_installation( + self, + *, + enterprise_id: Optional[str], + team_id: Optional[str], + user_id: Optional[str] = None, + is_enterprise_install: Optional[bool] = False, + ) -> Optional[Installation]: + if team_id == "T0G9PQBBK": + return Installation( + app_id="A111", + enterprise_id="E111", + team_id="T0G9PQBBK", + bot_token="xoxb-valid-2", + bot_id="B", + bot_user_id="W", + bot_scopes=["commands", "chat:write"], + user_id="W11111", + installed_at=datetime.datetime.now().timestamp(), + ) + if team_id == "T014GJXU940" and enterprise_id == "E013Y3SHLAY": + return Installation( + app_id="A111", + enterprise_id="E013Y3SHLAY", + team_id="T014GJXU940", + user_id="W11111", + user_token="xoxp-valid-actor-based", + user_scopes=["search:read", "chat:write"], + installed_at=datetime.datetime.now().timestamp(), + ) + return None diff --git a/tests/slack_bolt/request/test_internals.py b/tests/slack_bolt/request/test_internals.py index 5138f0ba5..6975a307d 100644 --- a/tests/slack_bolt/request/test_internals.py +++ b/tests/slack_bolt/request/test_internals.py @@ -7,6 +7,9 @@ extract_enterprise_id, parse_query, extract_is_enterprise_install, + extract_actor_enterprise_id, + extract_actor_team_id, + extract_actor_user_id, ) @@ -79,6 +82,173 @@ def teardown_method(self): }, ] + slack_connect_authorizations = [ + { + "enterprise_id": "INSTALLED_ENTERPRISE_ID", + "team_id": "INSTALLED_TEAM_ID", + "user_id": "INSTALLED_BOT_USER_ID", + "is_bot": True, + "is_enterprise_install": False, + } + ] + slack_connect_events_api_no_actor_team_requests = [ + { + "team_id": "INSTALLED_TEAM_ID", + "api_app_id": "A111", + "event": { + "type": "app_mention", + "text": "<@INSTALLED_BOT_USER_ID> hey", + "user": "USER_ID_ACTOR", + "ts": "1678451405.023359", + "team": "INSTALLED_TEAM_ID", + "user_team": "ENTERPRISE_ID_ACTOR", + "source_team": "ENTERPRISE_ID_ACTOR", + "user_profile": {"team": "ENTERPRISE_ID_ACTOR"}, + "channel": "C111", + "event_ts": "1678451405.023359", + }, + "type": "event_callback", + "authorizations": slack_connect_authorizations, + "is_ext_shared_channel": True, + }, + ] + slack_connect_events_api_no_actor_enterprise_team_requests = [ + { + "team_id": "INSTALLED_TEAM_ID", + "context_team_id": "INSTALLED_TEAM_ID", + "context_enterprise_id": "INSTALLED_ENTERPRISE_ID", + "api_app_id": "A111", + "event": { + "type": "reaction_added", + "user": "USER_ID_ACTOR", + "reaction": "eyes", + "item": {"type": "message", "channel": "C111", "ts": "1678453386.979699"}, + "event_ts": "1678456876.000900", + }, + "type": "event_callback", + "authorizations": slack_connect_authorizations, + "is_ext_shared_channel": True, + }, + { + "enterprise_id": "INSTALLED_ENTERPRISE_ID", + "team_id": "INSTALLED_TEAM_ID", + "api_app_id": "A111", + "event": { + "file_id": "F111", + "user_id": "USER_ID_ACTOR", + "file": {"id": "F111"}, + "channel_id": "C111", + "type": "file_shared", + "event_ts": "1678454981.170300", + }, + "type": "event_callback", + "authorizations": slack_connect_authorizations, + "is_ext_shared_channel": True, + }, + { + "team_id": "INSTALLED_TEAM_ID", + "context_team_id": "INSTALLED_TEAM_ID", + "context_enterprise_id": "INSTALLED_ENTERPRISE_ID", + "api_app_id": "A111", + "event": { + "type": "reaction_added", + "user": "USER_ID_ACTOR", + "reaction": "rocket", + "item": {"type": "message", "channel": "C111", "ts": "1678454602.316259"}, + "event_ts": "1678454724.000600", + }, + "type": "event_callback", + "authorizations": slack_connect_authorizations, + "is_ext_shared_channel": True, + }, + { + "team_id": "TEAM_ID_ACTOR", + "enterprise_id": "ENTERPRISE_ID_ACTOR", + "context_team_id": "INSTALLED_TEAM_ID", + "context_enterprise_id": "INSTALLED_ENTERPRISE_ID", + "api_app_id": "A111", + "event": { + "type": "message_metadata_posted", + "app_id": "A222", + "bot_id": "B222", + "user_id": "USER_ID_ACTOR", # Although this is always a bot's user ID, we can call it an actor + "team_id": "INSTALLED_TEAM_ID", + "channel_id": "C111", + "metadata": {"event_type": "task_created", "event_payload": {"id": "11223", "title": "Redesign Homepage"}}, + "message_ts": "1678458906.527119", + "event_ts": "1678458906.527119", + }, + "type": "event_callback", + "authorizations": slack_connect_authorizations, + "is_ext_shared_channel": True, + }, + ] + slack_connect_events_api_requests = [ + { + "team_id": "TEAM_ID_ACTOR", + "enterprise_id": "ENTERPRISE_ID_ACTOR", + "context_team_id": "INSTALLED_TEAM_ID", + "context_enterprise_id": "INSTALLED_ENTERPRISE_ID", + "api_app_id": "A111", + "event": { + "type": "message", + "text": "<@INSTALLED_BOT_USER_ID> Hey!", + "user": "USER_ID_ACTOR", + "ts": "1678455198.838499", + "team": "TEAM_ID_ACTOR", + "channel": "C111", + "event_ts": "1678455198.838499", + "channel_type": "channel", + }, + "type": "event_callback", + "authorizations": slack_connect_authorizations, + "is_ext_shared_channel": True, + }, + { + "team_id": "TEAM_ID_ACTOR", + "enterprise_id": "ENTERPRISE_ID_ACTOR", + "context_team_id": "INSTALLED_TEAM_ID", + "context_enterprise_id": "INSTALLED_ENTERPRISE_ID", + "api_app_id": "A111", + "event": { + "type": "message", + "text": "Hey!", + "user": "USER_ID_ACTOR", + "ts": "1678454365.204709", + "team": "TEAM_ID_ACTOR", + "channel": "C111", + "event_ts": "1678454365.204709", + "channel_type": "channel", + }, + "type": "event_callback", + "authorizations": slack_connect_authorizations, + "is_ext_shared_channel": True, + }, + { + "team_id": "TEAM_ID_ACTOR", + "enterprise_id": "ENTERPRISE_ID_ACTOR", + "context_team_id": "INSTALLED_TEAM_ID", + "context_enterprise_id": "INSTALLED_ENTERPRISE_ID", + "api_app_id": "A111", + "event": { + "type": "message", + "subtype": "channel_name", + "ts": "1678454602.316259", + "user": "USER_ID_ACTOR", + "text": "renamed", + "old_name": "old", + "name": "new", + "team": "TEAM_ID_ACTOR", + "channel": "C111", + "event_ts": "1678454602.316259", + "channel_type": "channel", + }, + "type": "event_callback", + "authorizations": slack_connect_authorizations, + "is_ext_shared_channel": True, + }, + ] + def test_channel_id_extraction(self): for req in self.requests: channel_id = extract_channel_id(req) @@ -126,6 +296,48 @@ def test_is_enterprise_install_extraction(self): assert extract_is_enterprise_install({"is_enterprise_install": "true"}) is True assert extract_is_enterprise_install({"is_enterprise_install": "false"}) is False + def test_actor_enterprise_id(self): + for req in self.requests: + enterprise_id = extract_actor_enterprise_id(req) + assert enterprise_id == "E111" + for req in self.slack_connect_events_api_requests: + enterprise_id = extract_actor_enterprise_id(req) + assert enterprise_id == "ENTERPRISE_ID_ACTOR" + for req in self.slack_connect_events_api_no_actor_team_requests: + enterprise_id = extract_actor_enterprise_id(req) + assert enterprise_id == "ENTERPRISE_ID_ACTOR" + for req in self.slack_connect_events_api_no_actor_enterprise_team_requests: + enterprise_id = extract_actor_enterprise_id(req) + assert enterprise_id is None + + def test_actor_team_id(self): + for req in self.requests: + team_id = extract_actor_team_id(req) + assert team_id == "T111" + for req in self.slack_connect_events_api_requests: + team_id = extract_actor_team_id(req) + assert team_id == "TEAM_ID_ACTOR" + for req in self.slack_connect_events_api_no_actor_team_requests: + team_id = extract_actor_team_id(req) + assert team_id is None + for req in self.slack_connect_events_api_no_actor_enterprise_team_requests: + team_id = extract_actor_team_id(req) + assert team_id is None + + def test_actor_user_id(self): + for req in self.requests: + user_id = extract_actor_user_id(req) + assert user_id == "U111" + for req in self.slack_connect_events_api_requests: + user_id = extract_actor_user_id(req) + assert user_id == "USER_ID_ACTOR" + for req in self.slack_connect_events_api_no_actor_team_requests: + user_id = extract_actor_user_id(req) + assert user_id == "USER_ID_ACTOR" + for req in self.slack_connect_events_api_no_actor_enterprise_team_requests: + user_id = extract_actor_user_id(req) + assert user_id is None + def test_parse_query(self): expected = {"foo": ["bar"], "baz": ["123"]} @@ -140,3 +352,648 @@ def test_parse_query(self): with pytest.raises(ValueError): parse_query({"foo": {"bar": "ZZZ"}, "baz": {"123": "111"}}) + + slack_connect_from_non_grid_test_patterns = [ + ( + { + "team_id": "T03E94MJU", + "context_team_id": "T014GJXU940", + "context_enterprise_id": "E013Y3SHLAY", + "api_app_id": "A04TEM7H4S0", + "event": { + "type": "message", + "user": "U03E94MK0", + "team": "T03E94MJU", + "channel": "C04T3ACM40K", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T03E94MJU", + "user_id": "U04T5KKKLUE", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": True, + }, + # context.enterprise_id/team_id/user_id, + (None, "T03E94MJU", "U03E94MK0"), + # context.actor_enterprise_id/team_id/user_id, + (None, "T03E94MJU", "U03E94MK0"), + ), + ( + { + "team_id": "T03E94MJU", + "context_team_id": "T014GJXU940", + "context_enterprise_id": "E013Y3SHLAY", + "api_app_id": "A04TEM7H4S0", + "event": { + "type": "message", + "user": "U03E94MK0", + "team": "T03E94MJU", + "channel": "C04T3ACM40K", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T03E94MJU", + "user_id": "U04T5KKKLUE", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": True, + }, + (None, "T03E94MJU", "U03E94MK0"), + (None, "T03E94MJU", "U03E94MK0"), + ), + ( + { + "team_id": "T03E94MJU", + "api_app_id": "A04TEM7H4S0", + "event": { + "type": "app_mention", + "text": "<@U04T5KKKLUE>", + "user": "U03E94MK0", + "team": "T03E94MJU", + "channel": "C04T3ACM40K", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T03E94MJU", + "user_id": "U04T5KKKLUE", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": True, + }, + (None, "T03E94MJU", "U03E94MK0"), + (None, "T03E94MJU", "U03E94MK0"), + ), + ( + { + "team_id": "T03E94MJU", + "context_team_id": "T014GJXU940", + "context_enterprise_id": "E013Y3SHLAY", + "api_app_id": "A04TEM7H4S0", + "event": { + "type": "message", + "user": "U03E94MK0", + "team": "T03E94MJU", + "channel": "C04T3ACM40K", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T03E94MJU", + "user_id": "U04T5KKKLUE", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": True, + }, + (None, "T03E94MJU", "U03E94MK0"), + (None, "T03E94MJU", "U03E94MK0"), + ), + ( + { + "team_id": "T014GJXU940", + "enterprise_id": "E013Y3SHLAY", + "api_app_id": "A04TEM7H4S0", + "event": { + "type": "app_mention", + "user": "U03E94MK0", + "team": "T014GJXU940", + "user_team": "T03E94MJU", + "source_team": "T03E94MJU", + "user_profile": {"team": "T03E94MJU"}, + "channel": "C04T3ACM40K", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T03E94MJU", + "user_id": "U04T5KKKLUE", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": True, + }, + (None, "T03E94MJU", "U03E94MK0"), + (None, "T03E94MJU", "U03E94MK0"), + ), + ( + { + "team_id": "T03E94MJU", + "context_team_id": "T014GJXU940", + "context_enterprise_id": "E013Y3SHLAY", + "api_app_id": "A04TEM7H4S0", + "event": { + "type": "message", + "subtype": "channel_join", + "user": "UL5CBM924", + "team": "T03E94MJU", + "inviter": "U03E94MK0", + "channel": "C04T3ACM40K", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T03E94MJU", + "user_id": "U04T5KKKLUE", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": True, + }, + (None, "T03E94MJU", "UL5CBM924"), + (None, "T03E94MJU", "UL5CBM924"), + ), + ( + { + "team_id": "T014GJXU940", + "enterprise_id": "E013Y3SHLAY", + "context_team_id": "T03E94MJU", + "context_enterprise_id": None, + "api_app_id": "A04TEM7H4S0", + "event": { + "type": "member_joined_channel", + "user": "UL5CBM924", + "channel": "C04T3ACM40K", + "team": "T03E94MJU", + "inviter": "U03E94MK0", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T03E94MJU", + "user_id": "U04T5KKKLUE", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": True, + }, + (None, "T03E94MJU", "UL5CBM924"), + (None, "T03E94MJU", "UL5CBM924"), + ), + ( + { + "team_id": "T014GJXU940", + "enterprise_id": "E013Y3SHLAY", + "context_team_id": "T03E94MJU", + "context_enterprise_id": None, + "api_app_id": "A04TEM7H4S0", + "event": { + "type": "member_left_channel", + "user": "UL5CBM924", + "channel": "C04T3ACM40K", + "team": "T03E94MJU", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T03E94MJU", + "user_id": "U04T5KKKLUE", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": True, + }, + (None, "T03E94MJU", "UL5CBM924"), + (None, "T03E94MJU", "UL5CBM924"), + ), + ( + { + "team_id": "T03E94MJU", + "context_team_id": "T014GJXU940", + "context_enterprise_id": "E013Y3SHLAY", + "api_app_id": "A04TEM7H4S0", + "event": { + "type": "message", + "subtype": "channel_leave", + "user": "UL5CBM924", + "team": "T03E94MJU", + "channel": "C04T3ACM40K", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T03E94MJU", + "user_id": "U04T5KKKLUE", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": True, + }, + (None, "T03E94MJU", "UL5CBM924"), + (None, "T03E94MJU", "UL5CBM924"), + ), + ( + { + "team_id": "T03E94MJU", + "context_team_id": "T014GJXU940", + "context_enterprise_id": "E013Y3SHLAY", + "api_app_id": "A04TEM7H4S0", + "event": { + "type": "message", + "files": [], + "upload": False, + "user": "U03E94MK0", + "display_as_bot": False, + "team": "T03E94MJU", + "channel": "C04T3ACM40K", + "subtype": "file_share", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T03E94MJU", + "user_id": "U04T5KKKLUE", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": True, + }, + (None, "T03E94MJU", "U03E94MK0"), + (None, "T03E94MJU", "U03E94MK0"), + ), + ( + { + "team_id": "T014GJXU940", + "enterprise_id": "E013Y3SHLAY", + "api_app_id": "A04TEM7H4S0", + "event": { + "file_id": "F04TL3HA3PC", + "user_id": "U03E94MK0", + "file": {"id": "F04TL3HA3PC"}, + "channel_id": "C04T3ACM40K", + "type": "file_shared", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T03E94MJU", + "user_id": "U04T5KKKLUE", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": True, + }, + (None, "T03E94MJU", "U03E94MK0"), + # Note that a complete set of actor IDs are not deterministic in this scenario + # So, we fall back to all None data for clarity + (None, None, None), + ), + ( + { + "team_id": "T03E94MJU", + "api_app_id": "A04TEM7H4S0", + "event": { + "file_id": "F04TL3HA3PC", + "user_id": "U03E94MK0", + "file": {"id": "F04TL3HA3PC"}, + "type": "file_public", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T03E94MJU", + "user_id": "U04T5KKKLUE", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": False, + }, + (None, "T03E94MJU", "U03E94MK0"), + (None, "T03E94MJU", "U03E94MK0"), + ), + ( + { + "team_id": "T014GJXU940", + "enterprise_id": "E013Y3SHLAY", + "context_team_id": "T014GJXU940", + "context_enterprise_id": "E013Y3SHLAY", + "api_app_id": "A04TEM7H4S0", + "event": { + "type": "message_metadata_posted", + "app_id": "A013TFN1T7C", + "bot_id": "B013ZM43W3E", + "user_id": "W013TN008CB", + "team_id": "T014GJXU940", + "channel_id": "C04T3ACM40K", + "metadata": { + "event_type": "task_created", + "event_payload": {"id": "11223", "title": "Redesign Homepage"}, + }, + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T03E94MJU", + "user_id": "U04T5KKKLUE", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": True, + }, + (None, "T03E94MJU", "W013TN008CB"), + # Note that a complete set of actor IDs are not deterministic in this scenario + # So, we fall back to all None data for clarity + (None, None, None), + ), + ( + { + "team_id": "T014GJXU940", + "enterprise_id": "E013Y3SHLAY", + "context_team_id": "T014GJXU940", + "context_enterprise_id": "E013Y3SHLAY", + "api_app_id": "A04TEM7H4S0", + "event": { + "bot_id": "B013ZM43W3E", + "type": "message", + "user": "W013TN008CB", + "metadata": { + "event_type": "task_created", + "event_payload": {"id": "11223", "title": "Redesign Homepage"}, + }, + "app_id": "A013TFN1T7C", + "team": "T014GJXU940", + "bot_profile": { + "id": "B013ZM43W3E", + "app_id": "A013TFN1T7C", + "team_id": "T014GJXU940", + }, + "channel": "C04T3ACM40K", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T03E94MJU", + "user_id": "U04T5KKKLUE", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": True, + }, + (None, "T03E94MJU", "W013TN008CB"), + ("E013Y3SHLAY", "T014GJXU940", "W013TN008CB"), + ), + ] + + slack_connect_from_grid_test_patterns = [ + ( + { + "team_id": "T03E94MJU", + "api_app_id": "A04TEM7H4S0", + "event": { + "type": "app_mention", + "user": "W013QGS7BPF", + "team": "T03E94MJU", + "user_team": "E013Y3SHLAY", + "source_team": "E013Y3SHLAY", + "user_profile": { + "team": "E013Y3SHLAY", + }, + "channel": "C04T3ACM40K", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T03E94MJU", + "user_id": "U04T5KKKLUE", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": True, + }, + # context.enterprise_id/team_id/user_id, + (None, "T03E94MJU", "W013QGS7BPF"), + # context.actor_enterprise_id/team_id/user_id, + ("E013Y3SHLAY", None, "W013QGS7BPF"), + ), + ( + { + "team_id": "T014GJXU940", + "enterprise_id": "E013Y3SHLAY", + "context_team_id": "T014GJXU940", + "context_enterprise_id": "E013Y3SHLAY", + "api_app_id": "A04TEM7H4S0", + "event": { + "type": "message", + "user": "W013QGS7BPF", + "team": "T014GJXU940", + "channel": "C04T3ACM40K", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T03E94MJU", + "user_id": "U04T5KKKLUE", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": True, + }, + (None, "T03E94MJU", "W013QGS7BPF"), + ("E013Y3SHLAY", "T014GJXU940", "W013QGS7BPF"), + ), + ( + { + "team_id": "T014GJXU940", + "enterprise_id": "E013Y3SHLAY", + "api_app_id": "A04TEM7H4S0", + "event": { + "file_id": "F04TDEYDCT0", + "user_id": "W013QGS7BPF", + "file": {"id": "F04TDEYDCT0"}, + "channel_id": "C04T3ACM40K", + "type": "file_shared", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T03E94MJU", + "user_id": "U04T5KKKLUE", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": True, + }, + (None, "T03E94MJU", "W013QGS7BPF"), + (None, None, None), + ), + ( + { + "team_id": "T014GJXU940", + "enterprise_id": "E013Y3SHLAY", + "context_team_id": "T014GJXU940", + "context_enterprise_id": "E013Y3SHLAY", + "api_app_id": "A04TEM7H4S0", + "event": { + "type": "message", + "files": [], + "upload": False, + "user": "W013QGS7BPF", + "display_as_bot": False, + "team": "T014GJXU940", + "channel": "C04T3ACM40K", + "subtype": "file_share", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T03E94MJU", + "user_id": "U04T5KKKLUE", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": True, + }, + (None, "T03E94MJU", "W013QGS7BPF"), + ("E013Y3SHLAY", "T014GJXU940", "W013QGS7BPF"), + ), + ( + { + "team_id": "T014GJXU940", + "enterprise_id": "E013Y3SHLAY", + "api_app_id": "A04TEM7H4S0", + "event": { + "file_id": "F04TDEYDCT0", + "user_id": "W013QGS7BPF", + "file": {"id": "F04TDEYDCT0"}, + "type": "file_public", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": "E013Y3SHLAY", + "team_id": "T014GJXU940", + "user_id": "U04TDAM3YUE", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": False, + }, + ("E013Y3SHLAY", "T014GJXU940", "W013QGS7BPF"), + ("E013Y3SHLAY", "T014GJXU940", "W013QGS7BPF"), + ), + ( + { + "team_id": "T014GJXU940", + "enterprise_id": "E013Y3SHLAY", + "context_team_id": "T014GJXU940", + "context_enterprise_id": "E013Y3SHLAY", + "api_app_id": "A04TEM7H4S0", + "event": { + "type": "member_joined_channel", + "user": "W013CV5UA87", + "channel": "C04T3ACM40K", + "team": "T014GJXU940", + "inviter": "W013QGS7BPF", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T03E94MJU", + "user_id": "U04T5KKKLUE", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": True, + }, + (None, "T03E94MJU", "W013CV5UA87"), + ("E013Y3SHLAY", "T014GJXU940", "W013CV5UA87"), + ), + ( + { + "team_id": "T014GJXU940", + "enterprise_id": "E013Y3SHLAY", + "context_team_id": "T014GJXU940", + "context_enterprise_id": "E013Y3SHLAY", + "api_app_id": "A04TEM7H4S0", + "event": { + "type": "member_left_channel", + "user": "W013CV5UA87", + "channel": "C04T3ACM40K", + "team": "E013Y3SHLAY", + }, + "type": "event_callback", + "authorizations": [ + { + "enterprise_id": None, + "team_id": "T03E94MJU", + "user_id": "U04T5KKKLUE", + "is_bot": True, + "is_enterprise_install": False, + } + ], + "is_ext_shared_channel": True, + }, + (None, "T03E94MJU", "W013CV5UA87"), + ("E013Y3SHLAY", "T014GJXU940", "W013CV5UA87"), + ), + ] + + def test_slack_connect_patterns(self): + for ( + request, + (enterprise_id, team_id, user_id), + (actor_enterprise_id, actor_team_id, actor_user_id), + ) in self.slack_connect_from_non_grid_test_patterns: + assert extract_enterprise_id(request) == enterprise_id + assert extract_team_id(request) == team_id + assert extract_user_id(request) == user_id + assert extract_actor_enterprise_id(request) == actor_enterprise_id + assert extract_actor_team_id(request) == actor_team_id + assert extract_actor_user_id(request) == actor_user_id + + for ( + request, + (enterprise_id, team_id, user_id), + (actor_enterprise_id, actor_team_id, actor_user_id), + ) in self.slack_connect_from_grid_test_patterns: + assert extract_enterprise_id(request) == enterprise_id + assert extract_team_id(request) == team_id + assert extract_user_id(request) == user_id + assert extract_actor_enterprise_id(request) == actor_enterprise_id + assert extract_actor_team_id(request) == actor_team_id + assert extract_actor_user_id(request) == actor_user_id From 01ff59eb0a3abe591517a6e71c917f5ba92aaff7 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 13 Mar 2023 20:41:06 +0900 Subject: [PATCH 424/719] Set valid Chalice version range (#856) --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index ba1c1d367..107c0e0e6 100755 --- a/setup.py +++ b/setup.py @@ -77,8 +77,7 @@ # used only under src/slack_bolt/adapter "boto3<=2", "bottle>=0.12,<1", - # TODO: chalice 1.28 dropped Python 3.6 support - "chalice<=1.27.3", + "chalice>=1.28,<2" if sys.version_info.minor > 6 else "chalice<=1.27.3", "CherryPy>=18,<19", "Django>=3,<5", "falcon>=3.1.1,<4" if sys.version_info.minor >= 11 else "falcon>=2,<4", From a301d3abf71381cb1a2adc7727d71ab690e3abbb Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 13 Mar 2023 20:45:15 +0900 Subject: [PATCH 425/719] version 1.17.0rc1 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 1c0f78ef4..931c572b1 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.16.4" +__version__ = "1.17.0rc1" From fbba6cd0095d86c9726994fc20866e0bf36461f9 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 14 Mar 2023 07:22:34 +0900 Subject: [PATCH 426/719] Fix a #855 bug where user_scopes exist even when user token is absent (#858) --- slack_bolt/authorization/async_authorize.py | 3 +- slack_bolt/authorization/authorize.py | 3 +- .../test_app_actor_user_token.py | 43 +++++++++++++++++-- .../test_app_actor_user_token.py | 43 +++++++++++++++++-- 4 files changed, 82 insertions(+), 10 deletions(-) diff --git a/slack_bolt/authorization/async_authorize.py b/slack_bolt/authorization/async_authorize.py index 18189adc8..76cfaf64c 100644 --- a/slack_bolt/authorization/async_authorize.py +++ b/slack_bolt/authorization/async_authorize.py @@ -207,10 +207,11 @@ async def __call__( if latest_bot_installation.user_id != user_id: # First off, remove the user token as the installer is a different user user_token = None + user_scopes = None latest_bot_installation.user_token = None latest_bot_installation.user_refresh_token = None latest_bot_installation.user_token_expires_at = None - latest_bot_installation.user_scopes = [] + latest_bot_installation.user_scopes = None # try to fetch the request user's installation # to reflect the user's access token if exists diff --git a/slack_bolt/authorization/authorize.py b/slack_bolt/authorization/authorize.py index 05b306165..170955810 100644 --- a/slack_bolt/authorization/authorize.py +++ b/slack_bolt/authorization/authorize.py @@ -206,10 +206,11 @@ def __call__( if latest_bot_installation.user_id != user_id: # First off, remove the user token as the installer is a different user user_token = None + user_scopes = None latest_bot_installation.user_token = None latest_bot_installation.user_refresh_token = None latest_bot_installation.user_token_expires_at = None - latest_bot_installation.user_scopes = [] + latest_bot_installation.user_scopes = None # try to fetch the request user's installation # to reflect the user's access token if exists diff --git a/tests/scenario_tests/test_app_actor_user_token.py b/tests/scenario_tests/test_app_actor_user_token.py index 4fd1b4751..5c05de43e 100644 --- a/tests/scenario_tests/test_app_actor_user_token.py +++ b/tests/scenario_tests/test_app_actor_user_token.py @@ -109,12 +109,12 @@ def build_headers(self, timestamp: str, body: str): "x-slack-request-timestamp": [timestamp], } - def build_request(self): + def build_request(self, team_id: str = "T014GJXU940"): timestamp, body = str(int(time())), json.dumps( { - "team_id": "T014GJXU940", + "team_id": team_id, "enterprise_id": "E013Y3SHLAY", - "context_team_id": "T014GJXU940", + "context_team_id": team_id, "context_enterprise_id": "E013Y3SHLAY", "api_app_id": "A04TEM7H4S0", "event": { @@ -123,7 +123,7 @@ def build_request(self): "upload": False, "user": "W013QGS7BPF", "display_as_bot": False, - "team": "T014GJXU940", + "team": team_id, "channel": "C04T3ACM40K", "subtype": "file_share", }, @@ -176,3 +176,38 @@ def handle_events(context: BoltContext, say: Say): assert_auth_test_count(self, 1) sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 + + def test_authorize_result_no_user_token(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + oauth_settings=OAuthSettings( + client_id="111.222", + client_secret="secret", + scopes=["commands", "chat:write"], + user_scopes=["search:read", "chat:write"], + installation_store=MemoryInstallationStore(), + user_token_resolution="actor", + ), + ) + + @app.event("message") + def handle_events(context: BoltContext, say: Say): + assert context.actor_enterprise_id == "E013Y3SHLAY" + assert context.actor_team_id == "T111111" + assert context.actor_user_id == "W013QGS7BPF" + + assert context.authorize_result.bot_id == "BZYBOTHED" + assert context.authorize_result.bot_user_id == "W23456789" + assert context.authorize_result.bot_token == "xoxb-valid-2" + assert context.authorize_result.bot_scopes == ["commands", "chat:write"] + assert context.authorize_result.user_id is None + assert context.authorize_result.user_token is None + assert context.authorize_result.user_scopes is None + say("What's up?") + + response = app.dispatch(self.build_request(team_id="T111111")) + assert response.status == 200 + assert_auth_test_count(self, 1) + sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 diff --git a/tests/scenario_tests_async/test_app_actor_user_token.py b/tests/scenario_tests_async/test_app_actor_user_token.py index c9c395297..f2a7ddd00 100644 --- a/tests/scenario_tests_async/test_app_actor_user_token.py +++ b/tests/scenario_tests_async/test_app_actor_user_token.py @@ -61,12 +61,12 @@ def build_headers(self, timestamp: str, body: str): "x-slack-request-timestamp": [timestamp], } - def build_request(self) -> AsyncBoltRequest: + def build_request(self, team_id: str = "T014GJXU940") -> AsyncBoltRequest: timestamp, body = str(int(time())), json.dumps( { - "team_id": "T014GJXU940", + "team_id": team_id, "enterprise_id": "E013Y3SHLAY", - "context_team_id": "T014GJXU940", + "context_team_id": team_id, "context_enterprise_id": "E013Y3SHLAY", "api_app_id": "A04TEM7H4S0", "event": { @@ -75,7 +75,7 @@ def build_request(self) -> AsyncBoltRequest: "upload": False, "user": "W013QGS7BPF", "display_as_bot": False, - "team": "T014GJXU940", + "team": team_id, "channel": "C04T3ACM40K", "subtype": "file_share", }, @@ -129,6 +129,41 @@ async def handle_events(context: AsyncBoltContext, say: AsyncSay): await asyncio.sleep(1) # wait a bit after auto ack() assert self.mock_received_requests["/chat.postMessage"] == 1 + @pytest.mark.asyncio + async def test_authorize_result_no_user_token(self): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + oauth_settings=AsyncOAuthSettings( + client_id="111.222", + client_secret="secret", + installation_store=MemoryInstallationStore(), + user_token_resolution="actor", + ), + ) + + @app.event("message") + async def handle_events(context: AsyncBoltContext, say: AsyncSay): + assert context.actor_enterprise_id == "E013Y3SHLAY" + assert context.actor_team_id == "T11111" + assert context.actor_user_id == "W013QGS7BPF" + + assert context.authorize_result.bot_id == "BZYBOTHED" + assert context.authorize_result.bot_user_id == "W23456789" + assert context.authorize_result.bot_token == "xoxb-valid-2" + assert context.authorize_result.bot_scopes == ["commands", "chat:write"] + assert context.authorize_result.user_id is None + assert context.authorize_result.user_token is None + assert context.authorize_result.user_scopes is None + await say("What's up?") + + request = self.build_request(team_id="T11111") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_auth_test_count_async(self, 1) + await asyncio.sleep(1) # wait a bit after auto ack() + assert self.mock_received_requests["/chat.postMessage"] == 1 + class MemoryInstallationStore(AsyncInstallationStore): @property From 84bb73d841c2cf0d672181dc56baf58c9c18a594 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 14 Mar 2023 07:23:22 +0900 Subject: [PATCH 427/719] version 1.17.0rc2 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 931c572b1..e0099f08d 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.17.0rc1" +__version__ = "1.17.0rc2" From 8334d17ddac15b6e41cc15a6cce533745c20ba7d Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 15 Mar 2023 17:40:04 +0900 Subject: [PATCH 428/719] Improve token rotation error handling and installation error text (#861) --- slack_bolt/authorization/async_authorize.py | 12 +++++++++++- slack_bolt/authorization/authorize.py | 12 +++++++++++- .../middleware/authorization/async_internals.py | 3 ++- .../authorization/async_multi_teams_authorization.py | 5 ++++- .../authorization/async_single_team_authorization.py | 5 ++++- slack_bolt/middleware/authorization/internals.py | 9 ++++++++- .../authorization/multi_teams_authorization.py | 4 ++++ .../authorization/single_team_authorization.py | 4 ++++ tests/scenario_tests/test_authorize.py | 2 +- tests/scenario_tests_async/test_authorize.py | 2 +- .../authorization/test_single_team_authorization.py | 3 ++- .../authorization/test_single_team_authorization.py | 3 ++- 12 files changed, 54 insertions(+), 10 deletions(-) diff --git a/slack_bolt/authorization/async_authorize.py b/slack_bolt/authorization/async_authorize.py index 76cfaf64c..18de1b27a 100644 --- a/slack_bolt/authorization/async_authorize.py +++ b/slack_bolt/authorization/async_authorize.py @@ -1,7 +1,7 @@ from logging import Logger from typing import Optional, Callable, Awaitable, Dict, Any, List -from slack_sdk.errors import SlackApiError +from slack_sdk.errors import SlackApiError, SlackTokenRotationError from slack_sdk.oauth.installation_store import Bot, Installation from slack_sdk.oauth.installation_store.async_installation_store import ( AsyncInstallationStore, @@ -274,6 +274,11 @@ async def __call__( user_token = refreshed.user_token user_scopes = refreshed.user_scopes + except SlackTokenRotationError as rotation_error: + # When token rotation fails, it is usually unrecoverable + # So, this built-in middleware gives up continuing with the following middleware and listeners + self.logger.error(f"Failed to rotate tokens due to {rotation_error}") + return None except NotImplementedError as _: self.find_installation_available = False @@ -307,6 +312,11 @@ async def __call__( bot_token = refreshed.bot_token bot_scopes = refreshed.bot_scopes + except SlackTokenRotationError as rotation_error: + # When token rotation fails, it is usually unrecoverable + # So, this built-in middleware gives up continuing with the following middleware and listeners + self.logger.error(f"Failed to rotate tokens due to {rotation_error}") + return None except NotImplementedError as _: self.find_bot_available = False except Exception as e: diff --git a/slack_bolt/authorization/authorize.py b/slack_bolt/authorization/authorize.py index 170955810..fde30dd26 100644 --- a/slack_bolt/authorization/authorize.py +++ b/slack_bolt/authorization/authorize.py @@ -1,7 +1,7 @@ from logging import Logger from typing import Optional, Callable, Dict, Any, List -from slack_sdk.errors import SlackApiError +from slack_sdk.errors import SlackApiError, SlackTokenRotationError from slack_sdk.oauth import InstallationStore from slack_sdk.oauth.installation_store.models.bot import Bot from slack_sdk.oauth.installation_store.models.installation import Installation @@ -271,6 +271,11 @@ def __call__( user_token = refreshed.user_token user_scopes = refreshed.user_scopes + except SlackTokenRotationError as rotation_error: + # When token rotation fails, it is usually unrecoverable + # So, this built-in middleware gives up continuing with the following middleware and listeners + self.logger.error(f"Failed to rotate tokens due to {rotation_error}") + return None except NotImplementedError as _: self.find_installation_available = False @@ -304,6 +309,11 @@ def __call__( bot_token = refreshed.bot_token bot_scopes = refreshed.bot_scopes + except SlackTokenRotationError as rotation_error: + # When token rotation fails, it is usually unrecoverable + # So, this built-in middleware gives up continuing with the following middleware and listeners + self.logger.error(f"Failed to rotate tokens due to {rotation_error}") + return None except NotImplementedError as _: self.find_bot_available = False except Exception as e: diff --git a/slack_bolt/middleware/authorization/async_internals.py b/slack_bolt/middleware/authorization/async_internals.py index 583dba90f..e465d50d2 100644 --- a/slack_bolt/middleware/authorization/async_internals.py +++ b/slack_bolt/middleware/authorization/async_internals.py @@ -1,3 +1,4 @@ +from slack_bolt.middleware.authorization.internals import _build_error_text from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse @@ -18,5 +19,5 @@ def _build_error_response() -> BoltResponse: # show an ephemeral message to the end-user return BoltResponse( status=200, - body=":x: Please install this app into the workspace :bow:", + body=_build_error_text(), ) diff --git a/slack_bolt/middleware/authorization/async_multi_teams_authorization.py b/slack_bolt/middleware/authorization/async_multi_teams_authorization.py index ffc47dc29..3a89f0f2b 100644 --- a/slack_bolt/middleware/authorization/async_multi_teams_authorization.py +++ b/slack_bolt/middleware/authorization/async_multi_teams_authorization.py @@ -7,7 +7,7 @@ from slack_bolt.response import BoltResponse from .async_authorization import AsyncAuthorization from .async_internals import _build_error_response, _is_no_auth_required -from .internals import _is_no_auth_test_call_required +from .internals import _is_no_auth_test_call_required, _build_error_text from ...authorization import AuthorizeResult from ...authorization.async_authorize import AsyncAuthorize @@ -91,6 +91,9 @@ async def async_process( "Although the app should be installed into this workspace, " "the AuthorizeResult (returned value from authorize) for it was not found." ) + if req.context.response_url is not None: + await req.context.respond(_build_error_text()) + return BoltResponse(status=200, body="") return _build_error_response() except SlackApiError as e: diff --git a/slack_bolt/middleware/authorization/async_single_team_authorization.py b/slack_bolt/middleware/authorization/async_single_team_authorization.py index f5c6a08ef..8d3555a0e 100644 --- a/slack_bolt/middleware/authorization/async_single_team_authorization.py +++ b/slack_bolt/middleware/authorization/async_single_team_authorization.py @@ -8,7 +8,7 @@ from slack_sdk.web.async_slack_response import AsyncSlackResponse from slack_sdk.errors import SlackApiError from .async_internals import _build_error_response, _is_no_auth_required -from .internals import _to_authorize_result, _is_no_auth_test_call_required +from .internals import _to_authorize_result, _is_no_auth_test_call_required, _build_error_text from ...authorization import AuthorizeResult @@ -57,6 +57,9 @@ async def async_process( else: # Just in case self.logger.error("auth.test API call result is unexpectedly None") + if req.context.response_url is not None: + await req.context.respond(_build_error_text()) + return BoltResponse(status=200, body="") return _build_error_response() except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") diff --git a/slack_bolt/middleware/authorization/internals.py b/slack_bolt/middleware/authorization/internals.py index 04d2fb512..af264854b 100644 --- a/slack_bolt/middleware/authorization/internals.py +++ b/slack_bolt/middleware/authorization/internals.py @@ -43,11 +43,18 @@ def _is_no_auth_test_call_required(req: Union[BoltRequest, "AsyncBoltRequest"]) return _is_no_auth_test_events(req) +def _build_error_text() -> str: + return ( + ":warning: We apologize, but for some unknown reason, your installation with this app is no longer available. " + "Please reinstall this app into your workspace :bow:" + ) + + def _build_error_response() -> BoltResponse: # show an ephemeral message to the end-user return BoltResponse( status=200, - body=":x: Please install this app into the workspace :bow:", + body=_build_error_text(), ) diff --git a/slack_bolt/middleware/authorization/multi_teams_authorization.py b/slack_bolt/middleware/authorization/multi_teams_authorization.py index 3ce3a54ec..5d464d5e4 100644 --- a/slack_bolt/middleware/authorization/multi_teams_authorization.py +++ b/slack_bolt/middleware/authorization/multi_teams_authorization.py @@ -11,6 +11,7 @@ _build_error_response, _is_no_auth_required, _is_no_auth_test_call_required, + _build_error_text, ) from ...authorization import AuthorizeResult from ...authorization.authorize import Authorize @@ -93,6 +94,9 @@ def process( "Although the app should be installed into this workspace, " "the AuthorizeResult (returned value from authorize) for it was not found." ) + if req.context.response_url is not None: + req.context.respond(_build_error_text()) + return BoltResponse(status=200, body="") return _build_error_response() except SlackApiError as e: diff --git a/slack_bolt/middleware/authorization/single_team_authorization.py b/slack_bolt/middleware/authorization/single_team_authorization.py index b567b4299..54cdff5c8 100644 --- a/slack_bolt/middleware/authorization/single_team_authorization.py +++ b/slack_bolt/middleware/authorization/single_team_authorization.py @@ -12,6 +12,7 @@ _is_no_auth_required, _to_authorize_result, _is_no_auth_test_call_required, + _build_error_text, ) from ...authorization import AuthorizeResult @@ -71,6 +72,9 @@ def process( else: # Just in case self.logger.error("auth.test API call result is unexpectedly None") + if req.context.response_url is not None: + req.context.respond(_build_error_text()) + return BoltResponse(status=200, body="") return _build_error_response() except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") diff --git a/tests/scenario_tests/test_authorize.py b/tests/scenario_tests/test_authorize.py index abc1f2269..603175f03 100644 --- a/tests/scenario_tests/test_authorize.py +++ b/tests/scenario_tests/test_authorize.py @@ -107,7 +107,7 @@ def test_failure(self): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 200 - assert response.body == ":x: Please install this app into the workspace :bow:" + assert response.body == "" assert self.mock_received_requests.get("/auth.test") == None def test_bot_context_attributes(self): diff --git a/tests/scenario_tests_async/test_authorize.py b/tests/scenario_tests_async/test_authorize.py index 82e270ed4..9e20ef152 100644 --- a/tests/scenario_tests_async/test_authorize.py +++ b/tests/scenario_tests_async/test_authorize.py @@ -115,7 +115,7 @@ async def test_failure(self): request = self.build_valid_request() response = await app.async_dispatch(request) assert response.status == 200 - assert response.body == ":x: Please install this app into the workspace :bow:" + assert response.body == "" assert self.mock_received_requests.get("/auth.test") == None @pytest.mark.asyncio diff --git a/tests/slack_bolt/middleware/authorization/test_single_team_authorization.py b/tests/slack_bolt/middleware/authorization/test_single_team_authorization.py index 01821312d..7b7c2d6a0 100644 --- a/tests/slack_bolt/middleware/authorization/test_single_team_authorization.py +++ b/tests/slack_bolt/middleware/authorization/test_single_team_authorization.py @@ -1,6 +1,7 @@ from slack_sdk import WebClient from slack_bolt.middleware import SingleTeamAuthorization +from slack_bolt.middleware.authorization.internals import _build_error_text from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse from tests.mock_web_api_server import ( @@ -42,4 +43,4 @@ def test_failure_pattern(self): resp = authorization.process(req=req, resp=resp, next=next) assert resp.status == 200 - assert resp.body == ":x: Please install this app into the workspace :bow:" + assert resp.body == _build_error_text() diff --git a/tests/slack_bolt_async/middleware/authorization/test_single_team_authorization.py b/tests/slack_bolt_async/middleware/authorization/test_single_team_authorization.py index 351841b13..fcb34db2f 100644 --- a/tests/slack_bolt_async/middleware/authorization/test_single_team_authorization.py +++ b/tests/slack_bolt_async/middleware/authorization/test_single_team_authorization.py @@ -6,6 +6,7 @@ from slack_bolt.middleware.authorization.async_single_team_authorization import ( AsyncSingleTeamAuthorization, ) +from slack_bolt.middleware.authorization.internals import _build_error_text from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse from tests.mock_web_api_server import ( @@ -56,4 +57,4 @@ async def test_failure_pattern(self): resp = await authorization.async_process(req=req, resp=resp, next=next) assert resp.status == 200 - assert resp.body == ":x: Please install this app into the workspace :bow:" + assert resp.body == _build_error_text() From 12aae7ff9ecf49c2f1d11a8dc81088e84f26960e Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 15 Mar 2023 17:40:39 +0900 Subject: [PATCH 429/719] version 1.17.0rc3 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index e0099f08d..67f984ffb 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.17.0rc2" +__version__ = "1.17.0rc3" From 48dd31e24b031900a4b478ae8cf1dd4acf629ccc Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 22 Mar 2023 07:22:39 +0900 Subject: [PATCH 430/719] Add before_authorize middleware (#869) --- slack_bolt/app/app.py | 16 +++++ slack_bolt/app/async_app.py | 19 +++++- tests/scenario_tests/test_authorize.py | 72 +++++++++++++++++--- tests/scenario_tests_async/test_authorize.py | 72 ++++++++++++++++++-- 4 files changed, 163 insertions(+), 16 deletions(-) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 9d8d09149..e79cac07c 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -101,6 +101,7 @@ def __init__( token_verification_enabled: bool = True, client: Optional[WebClient] = None, # for multi-workspace apps + before_authorize: Optional[Union[Middleware, Callable[..., Any]]] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[InstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility @@ -155,6 +156,7 @@ def message_hello(message, say): token: The bot/user access token required only for single-workspace app. token_verification_enabled: Verifies the validity of the given token if True. client: The singleton `slack_sdk.WebClient` instance for this app. + before_authorize: A global middleware that can be executed right before authorize function authorize: The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data. installation_store: The module offering save/find operations of installation data @@ -215,6 +217,17 @@ def message_hello(message, say): # Authorize & OAuthFlow initialization # -------------------------------------- + self._before_authorize: Optional[Middleware] = None + if before_authorize is not None: + if isinstance(before_authorize, Callable): + self._before_authorize = CustomMiddleware( + app_name=self._name, + func=before_authorize, + base_logger=self._framework_logger, + ) + elif isinstance(before_authorize, Middleware): + self._before_authorize = before_authorize + self._authorize: Optional[Authorize] = None if authorize is not None: if isinstance(authorize, Authorize): @@ -357,6 +370,9 @@ def _init_middleware_list( if request_verification_enabled is True: self._middleware_list.append(RequestVerification(self._signing_secret, base_logger=self._base_logger)) + if self._before_authorize is not None: + self._middleware_list.append(self._before_authorize) + # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._oauth_flow is None: if self._token is not None: diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 1070e4363..8e76bf4b6 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -2,7 +2,7 @@ import logging import os import time -from typing import Optional, List, Union, Callable, Pattern, Dict, Awaitable, Sequence +from typing import Optional, List, Union, Callable, Pattern, Dict, Awaitable, Sequence, Any from aiohttp import web @@ -112,6 +112,7 @@ def __init__( token: Optional[str] = None, client: Optional[AsyncWebClient] = None, # for multi-workspace apps + before_authorize: Optional[Union[AsyncMiddleware, Callable[..., Awaitable[Any]]]] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, installation_store: Optional[AsyncInstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility @@ -163,6 +164,7 @@ async def message_hello(message, say): # async function signing_secret: The Signing Secret value used for verifying requests from Slack. token: The bot/user access token required only for single-workspace app. client: The singleton `slack_sdk.web.async_client.AsyncWebClient` instance for this app. + before_authorize: A global middleware that can be executed right before authorize function authorize: The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data. installation_store: The module offering save/find operations of installation data @@ -220,6 +222,17 @@ async def message_hello(message, say): # async function # Authorize & OAuthFlow initialization # -------------------------------------- + self._async_before_authorize: Optional[AsyncMiddleware] = None + if before_authorize is not None: + if isinstance(before_authorize, Callable): + self._async_before_authorize = AsyncCustomMiddleware( + app_name=self._name, + func=before_authorize, + base_logger=self._framework_logger, + ) + elif isinstance(before_authorize, AsyncMiddleware): + self._async_before_authorize = before_authorize + self._async_authorize: Optional[AsyncAuthorize] = None if authorize is not None: if isinstance(authorize, AsyncAuthorize): @@ -363,6 +376,10 @@ def _init_async_middleware_list( ) if request_verification_enabled is True: self._async_middleware_list.append(AsyncRequestVerification(self._signing_secret, base_logger=self._base_logger)) + + if self._async_before_authorize is not None: + self._async_middleware_list.append(self._async_before_authorize) + # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._async_oauth_flow is None: if self._token: diff --git a/tests/scenario_tests/test_authorize.py b/tests/scenario_tests/test_authorize.py index 603175f03..bd730e329 100644 --- a/tests/scenario_tests/test_authorize.py +++ b/tests/scenario_tests/test_authorize.py @@ -5,9 +5,10 @@ from slack_sdk import WebClient from slack_sdk.signature import SignatureVerifier -from slack_bolt import BoltRequest +from slack_bolt import BoltRequest, BoltResponse from slack_bolt.app import App from slack_bolt.authorization import AuthorizeResult +from slack_bolt.request.payload_utils import is_event from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, @@ -78,8 +79,37 @@ def build_headers(self, timestamp: str, body: str): "x-slack-request-timestamp": [timestamp], } - def build_valid_request(self) -> BoltRequest: + def build_block_actions_request(self) -> BoltRequest: timestamp = str(int(time())) + return BoltRequest(body=block_actions_raw_body, headers=self.build_headers(timestamp, block_actions_raw_body)) + + def build_message_changed_event_request(self) -> BoltRequest: + timestamp = str(int(time())) + raw_body = json.dumps( + { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "message", + "subtype": "message_changed", + "channel": "C2147483705", + "ts": "1358878755.000001", + "message": { + "type": "message", + "user": "U2147483697", + "text": "Hello, world!", + "ts": "1355517523.000005", + "edited": {"user": "U2147483697", "ts": "1358878755.000001"}, + }, + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + ) return BoltRequest(body=raw_body, headers=self.build_headers(timestamp, raw_body)) def test_success(self): @@ -90,7 +120,7 @@ def test_success(self): ) app.action("a")(simple_listener) - request = self.build_valid_request() + request = self.build_block_actions_request() response = app.dispatch(request) assert response.status == 200 assert response.body == "" @@ -104,7 +134,7 @@ def test_failure(self): ) app.action("a")(simple_listener) - request = self.build_valid_request() + request = self.build_block_actions_request() response = app.dispatch(request) assert response.status == 200 assert response.body == "" @@ -118,7 +148,7 @@ def test_bot_context_attributes(self): ) app.action("a")(assert_bot_context_attributes) - request = self.build_valid_request() + request = self.build_block_actions_request() response = app.dispatch(request) assert response.status == 200 assert response.body == "" @@ -132,14 +162,40 @@ def test_user_context_attributes(self): ) app.action("a")(assert_user_context_attributes) - request = self.build_valid_request() + request = self.build_block_actions_request() response = app.dispatch(request) assert response.status == 200 assert response.body == "" assert_auth_test_count(self, 1) + def test_before_authorize(self): + def skip_message_changed_events(body: dict, payload: dict, next_): + if is_event(body) and payload.get("type") == "message" and payload.get("subtype") == "message_changed": + return BoltResponse(status=200, body="as expected") + next_() + + app = App( + client=self.web_client, + before_authorize=skip_message_changed_events, + authorize=user_authorize, + signing_secret=self.signing_secret, + ) + app.action("a")(assert_user_context_attributes) + + request = self.build_block_actions_request() + response = app.dispatch(request) + assert response.status == 200 + assert response.body == "" + assert_auth_test_count(self, 1) + + request = self.build_message_changed_event_request() + response = app.dispatch(request) + assert response.status == 200 + assert response.body == "as expected" + assert_auth_test_count(self, 1) # should be skipped + -body = { +block_actions_body = { "type": "block_actions", "user": { "id": "W99999", @@ -176,7 +232,7 @@ def test_user_context_attributes(self): ], } -raw_body = f"payload={quote(json.dumps(body))}" +block_actions_raw_body = f"payload={quote(json.dumps(block_actions_body))}" def simple_listener(ack, body, payload, action): diff --git a/tests/scenario_tests_async/test_authorize.py b/tests/scenario_tests_async/test_authorize.py index 9e20ef152..dec9ebc2c 100644 --- a/tests/scenario_tests_async/test_authorize.py +++ b/tests/scenario_tests_async/test_authorize.py @@ -7,9 +7,11 @@ from slack_sdk.signature import SignatureVerifier from slack_sdk.web.async_client import AsyncWebClient +from slack_bolt import BoltResponse from slack_bolt.app.async_app import AsyncApp from slack_bolt.authorization import AuthorizeResult from slack_bolt.request.async_request import AsyncBoltRequest +from slack_bolt.request.payload_utils import is_event from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, @@ -84,8 +86,37 @@ def build_headers(self, timestamp: str, body: str): "x-slack-request-timestamp": [timestamp], } - def build_valid_request(self) -> AsyncBoltRequest: + def build_block_actions_request(self) -> AsyncBoltRequest: timestamp = str(int(time())) + return AsyncBoltRequest(body=block_actions_raw_body, headers=self.build_headers(timestamp, block_actions_raw_body)) + + def build_message_changed_event_request(self) -> AsyncBoltRequest: + timestamp = str(int(time())) + raw_body = json.dumps( + { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "type": "message", + "subtype": "message_changed", + "channel": "C2147483705", + "ts": "1358878755.000001", + "message": { + "type": "message", + "user": "U2147483697", + "text": "Hello, world!", + "ts": "1355517523.000005", + "edited": {"user": "U2147483697", "ts": "1358878755.000001"}, + }, + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authed_users": ["W111"], + } + ) return AsyncBoltRequest(body=raw_body, headers=self.build_headers(timestamp, raw_body)) @pytest.mark.asyncio @@ -97,7 +128,7 @@ async def test_success(self): ) app.action("a")(simple_listener) - request = self.build_valid_request() + request = self.build_block_actions_request() response = await app.async_dispatch(request) assert response.status == 200 assert response.body == "" @@ -112,7 +143,7 @@ async def test_failure(self): ) app.block_action("a")(simple_listener) - request = self.build_valid_request() + request = self.build_block_actions_request() response = await app.async_dispatch(request) assert response.status == 200 assert response.body == "" @@ -127,7 +158,7 @@ async def test_bot_context_attributes(self): ) app.action("a")(assert_bot_context_attributes) - request = self.build_valid_request() + request = self.build_block_actions_request() response = await app.async_dispatch(request) assert response.status == 200 assert response.body == "" @@ -142,14 +173,41 @@ async def test_user_context_attributes(self): ) app.action("a")(assert_user_context_attributes) - request = self.build_valid_request() + request = self.build_block_actions_request() response = await app.async_dispatch(request) assert response.status == 200 assert response.body == "" await assert_auth_test_count_async(self, 1) + @pytest.mark.asyncio + async def test_user_context_attributes(self): + async def skip_message_changed_events(body: dict, payload: dict, next_): + if is_event(body) and payload.get("type") == "message" and payload.get("subtype") == "message_changed": + return BoltResponse(status=200, body="as expected") + await next_() + + app = AsyncApp( + client=self.web_client, + before_authorize=skip_message_changed_events, + authorize=user_authorize, + signing_secret=self.signing_secret, + ) + app.action("a")(assert_user_context_attributes) + + request = self.build_block_actions_request() + response = await app.async_dispatch(request) + assert response.status == 200 + assert response.body == "" + await assert_auth_test_count_async(self, 1) + + request = self.build_message_changed_event_request() + response = await app.async_dispatch(request) + assert response.status == 200 + assert response.body == "as expected" + await assert_auth_test_count_async(self, 1) # should be skipped + -body = { +block_actions_body = { "type": "block_actions", "user": { "id": "W99999", @@ -186,7 +244,7 @@ async def test_user_context_attributes(self): ], } -raw_body = f"payload={quote(json.dumps(body))}" +block_actions_raw_body = f"payload={quote(json.dumps(block_actions_body))}" async def simple_listener(ack, body, payload, action): From c15141e08efa64270cb587e641263743527ef88d Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 22 Mar 2023 07:32:37 +0900 Subject: [PATCH 431/719] version 1.17.0rc4 --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 67f984ffb..7376943ae 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.17.0rc3" +__version__ = "1.17.0rc4" From f52b7ff69b58ee465e8738ad0fbfc1703b15f37f Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 27 Mar 2023 11:46:15 +0900 Subject: [PATCH 432/719] version 1.17.0 --- .../aws_lambda/lambda_s3_oauth_flow.html | 2 + docs/api-docs/slack_bolt/app/app.html | 54 +++- docs/api-docs/slack_bolt/app/async_app.html | 54 +++- docs/api-docs/slack_bolt/app/index.html | 29 ++- docs/api-docs/slack_bolt/async_app.html | 31 ++- .../authorization/async_authorize.html | 242 ++++++++++++++---- .../slack_bolt/authorization/authorize.html | 231 +++++++++++++---- .../authorization/authorize_result.html | 71 ++++- .../slack_bolt/authorization/index.html | 48 +++- .../slack_bolt/context/async_context.html | 3 + .../slack_bolt/context/base_context.html | 111 ++++++++ docs/api-docs/slack_bolt/context/context.html | 3 + docs/api-docs/slack_bolt/context/index.html | 3 + docs/api-docs/slack_bolt/index.html | 32 ++- .../authorization/async_internals.html | 5 +- .../async_multi_teams_authorization.html | 85 ++++-- .../async_single_team_authorization.html | 8 +- .../middleware/authorization/index.html | 43 +++- .../middleware/authorization/internals.html | 9 +- .../multi_teams_authorization.html | 72 +++++- .../single_team_authorization.html | 7 + .../api-docs/slack_bolt/middleware/index.html | 43 +++- .../oauth/async_oauth_settings.html | 31 ++- .../slack_bolt/oauth/oauth_settings.html | 31 ++- .../slack_bolt/request/async_internals.html | 23 ++ .../slack_bolt/request/internals.html | 188 ++++++++++++++ docs/api-docs/slack_bolt/version.html | 2 +- slack_bolt/version.py | 2 +- 28 files changed, 1308 insertions(+), 155 deletions(-) diff --git a/docs/api-docs/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.html b/docs/api-docs/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.html index 6b08e10fd..f3fe5a2ef 100644 --- a/docs/api-docs/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.html +++ b/docs/api-docs/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.html @@ -87,6 +87,7 @@

    Module slack_bolt.adapter.aws_lambda.lambda_s3_oauth_flo client_secret=settings.client_secret, installation_store=settings.installation_store, bot_only=settings.installation_store_bot_only, + user_token_resolution=(settings.user_token_resolution if settings is not None else "authed_user"), ) OAuthFlow.__init__(self, client=client, logger=logger, settings=settings) @@ -176,6 +177,7 @@

    Args

    client_secret=settings.client_secret, installation_store=settings.installation_store, bot_only=settings.installation_store_bot_only, + user_token_resolution=(settings.user_token_resolution if settings is not None else "authed_user"), ) OAuthFlow.__init__(self, client=client, logger=logger, settings=settings) diff --git a/docs/api-docs/slack_bolt/app/app.html b/docs/api-docs/slack_bolt/app/app.html index 1963d09b4..9490358d6 100644 --- a/docs/api-docs/slack_bolt/app/app.html +++ b/docs/api-docs/slack_bolt/app/app.html @@ -129,6 +129,7 @@

    Module slack_bolt.app.app

    token_verification_enabled: bool = True, client: Optional[WebClient] = None, # for multi-workspace apps + before_authorize: Optional[Union[Middleware, Callable[..., Any]]] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[InstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility @@ -183,6 +184,7 @@

    Module slack_bolt.app.app

    token: The bot/user access token required only for single-workspace app. token_verification_enabled: Verifies the validity of the given token if True. client: The singleton `slack_sdk.WebClient` instance for this app. + before_authorize: A global middleware that can be executed right before authorize function authorize: The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data. installation_store: The module offering save/find operations of installation data @@ -243,6 +245,17 @@

    Module slack_bolt.app.app

    # Authorize & OAuthFlow initialization # -------------------------------------- + self._before_authorize: Optional[Middleware] = None + if before_authorize is not None: + if isinstance(before_authorize, Callable): + self._before_authorize = CustomMiddleware( + app_name=self._name, + func=before_authorize, + base_logger=self._framework_logger, + ) + elif isinstance(before_authorize, Middleware): + self._before_authorize = before_authorize + self._authorize: Optional[Authorize] = None if authorize is not None: if isinstance(authorize, Authorize): @@ -266,6 +279,7 @@

    Module slack_bolt.app.app

    logger=self._framework_logger, bot_only=installation_store_bot_only, client=self._client, # for proxy use cases etc. + user_token_resolution=(settings.user_token_resolution if settings is not None else "authed_user"), ) self._oauth_flow: Optional[OAuthFlow] = None @@ -384,6 +398,9 @@

    Module slack_bolt.app.app

    if request_verification_enabled is True: self._middleware_list.append(RequestVerification(self._signing_secret, base_logger=self._base_logger)) + if self._before_authorize is not None: + self._middleware_list.append(self._before_authorize) + # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._oauth_flow is None: if self._token is not None: @@ -407,7 +424,13 @@

    Module slack_bolt.app.app

    else: raise BoltError(error_token_required()) else: - self._middleware_list.append(MultiTeamsAuthorization(authorize=self._authorize, base_logger=self._base_logger)) + self._middleware_list.append( + MultiTeamsAuthorization( + authorize=self._authorize, + base_logger=self._base_logger, + user_token_resolution=self._oauth_flow.settings.user_token_resolution, + ) + ) if ignoring_self_events_enabled is True: self._middleware_list.append(IgnoringSelfEvents(base_logger=self._base_logger)) if url_verification_enabled is True: @@ -1456,7 +1479,7 @@

    Classes

    class App -(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, token_verification_enabled: bool = True, client: Optional[slack_sdk.web.client.WebClient] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, verification_token: Optional[str] = None, listener_executor: Optional[concurrent.futures._base.Executor] = None) +(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, token_verification_enabled: bool = True, client: Optional[slack_sdk.web.client.WebClient] = None, before_authorize: Union[Middleware, Callable[..., Any], ForwardRef(None)] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, verification_token: Optional[str] = None, listener_executor: Optional[concurrent.futures._base.Executor] = None)

    Bolt App that provides functionalities to register middleware/listeners.

    @@ -1502,6 +1525,8 @@

    Args

    Verifies the validity of the given token if True.
    client
    The singleton slack_sdk.WebClient instance for this app.
    +
    before_authorize
    +
    A global middleware that can be executed right before authorize function
    authorize
    The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data.
    @@ -1560,6 +1585,7 @@

    Args

    token_verification_enabled: bool = True, client: Optional[WebClient] = None, # for multi-workspace apps + before_authorize: Optional[Union[Middleware, Callable[..., Any]]] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[InstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility @@ -1614,6 +1640,7 @@

    Args

    token: The bot/user access token required only for single-workspace app. token_verification_enabled: Verifies the validity of the given token if True. client: The singleton `slack_sdk.WebClient` instance for this app. + before_authorize: A global middleware that can be executed right before authorize function authorize: The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data. installation_store: The module offering save/find operations of installation data @@ -1674,6 +1701,17 @@

    Args

    # Authorize & OAuthFlow initialization # -------------------------------------- + self._before_authorize: Optional[Middleware] = None + if before_authorize is not None: + if isinstance(before_authorize, Callable): + self._before_authorize = CustomMiddleware( + app_name=self._name, + func=before_authorize, + base_logger=self._framework_logger, + ) + elif isinstance(before_authorize, Middleware): + self._before_authorize = before_authorize + self._authorize: Optional[Authorize] = None if authorize is not None: if isinstance(authorize, Authorize): @@ -1697,6 +1735,7 @@

    Args

    logger=self._framework_logger, bot_only=installation_store_bot_only, client=self._client, # for proxy use cases etc. + user_token_resolution=(settings.user_token_resolution if settings is not None else "authed_user"), ) self._oauth_flow: Optional[OAuthFlow] = None @@ -1815,6 +1854,9 @@

    Args

    if request_verification_enabled is True: self._middleware_list.append(RequestVerification(self._signing_secret, base_logger=self._base_logger)) + if self._before_authorize is not None: + self._middleware_list.append(self._before_authorize) + # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._oauth_flow is None: if self._token is not None: @@ -1838,7 +1880,13 @@

    Args

    else: raise BoltError(error_token_required()) else: - self._middleware_list.append(MultiTeamsAuthorization(authorize=self._authorize, base_logger=self._base_logger)) + self._middleware_list.append( + MultiTeamsAuthorization( + authorize=self._authorize, + base_logger=self._base_logger, + user_token_resolution=self._oauth_flow.settings.user_token_resolution, + ) + ) if ignoring_self_events_enabled is True: self._middleware_list.append(IgnoringSelfEvents(base_logger=self._base_logger)) if url_verification_enabled is True: diff --git a/docs/api-docs/slack_bolt/app/async_app.html b/docs/api-docs/slack_bolt/app/async_app.html index 0fdf7f437..f373a32e6 100644 --- a/docs/api-docs/slack_bolt/app/async_app.html +++ b/docs/api-docs/slack_bolt/app/async_app.html @@ -30,7 +30,7 @@

    Module slack_bolt.app.async_app

    import logging import os import time -from typing import Optional, List, Union, Callable, Pattern, Dict, Awaitable, Sequence +from typing import Optional, List, Union, Callable, Pattern, Dict, Awaitable, Sequence, Any from aiohttp import web @@ -140,6 +140,7 @@

    Module slack_bolt.app.async_app

    token: Optional[str] = None, client: Optional[AsyncWebClient] = None, # for multi-workspace apps + before_authorize: Optional[Union[AsyncMiddleware, Callable[..., Awaitable[Any]]]] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, installation_store: Optional[AsyncInstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility @@ -191,6 +192,7 @@

    Module slack_bolt.app.async_app

    signing_secret: The Signing Secret value used for verifying requests from Slack. token: The bot/user access token required only for single-workspace app. client: The singleton `slack_sdk.web.async_client.AsyncWebClient` instance for this app. + before_authorize: A global middleware that can be executed right before authorize function authorize: The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data. installation_store: The module offering save/find operations of installation data @@ -248,6 +250,17 @@

    Module slack_bolt.app.async_app

    # Authorize & OAuthFlow initialization # -------------------------------------- + self._async_before_authorize: Optional[AsyncMiddleware] = None + if before_authorize is not None: + if isinstance(before_authorize, Callable): + self._async_before_authorize = AsyncCustomMiddleware( + app_name=self._name, + func=before_authorize, + base_logger=self._framework_logger, + ) + elif isinstance(before_authorize, AsyncMiddleware): + self._async_before_authorize = before_authorize + self._async_authorize: Optional[AsyncAuthorize] = None if authorize is not None: if isinstance(authorize, AsyncAuthorize): @@ -271,6 +284,7 @@

    Module slack_bolt.app.async_app

    logger=self._framework_logger, bot_only=installation_store_bot_only, client=self._async_client, # for proxy use cases etc. + user_token_resolution=(settings.user_token_resolution if settings is not None else "authed_user"), ) self._async_oauth_flow: Optional[AsyncOAuthFlow] = None @@ -390,6 +404,10 @@

    Module slack_bolt.app.async_app

    ) if request_verification_enabled is True: self._async_middleware_list.append(AsyncRequestVerification(self._signing_secret, base_logger=self._base_logger)) + + if self._async_before_authorize is not None: + self._async_middleware_list.append(self._async_before_authorize) + # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._async_oauth_flow is None: if self._token: @@ -402,7 +420,11 @@

    Module slack_bolt.app.async_app

    raise BoltError(error_token_required()) else: self._async_middleware_list.append( - AsyncMultiTeamsAuthorization(authorize=self._async_authorize, base_logger=self._base_logger) + AsyncMultiTeamsAuthorization( + authorize=self._async_authorize, + base_logger=self._base_logger, + user_token_resolution=self._async_oauth_flow.settings.user_token_resolution, + ) ) if ignoring_self_events_enabled is True: @@ -1370,7 +1392,7 @@

    Classes

    class AsyncApp -(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, client: Optional[slack_sdk.web.async_client.AsyncWebClient] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[AsyncOAuthSettings] = None, oauth_flow: Optional[AsyncOAuthFlow] = None, verification_token: Optional[str] = None) +(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, client: Optional[slack_sdk.web.async_client.AsyncWebClient] = None, before_authorize: Union[AsyncMiddleware, Callable[..., Awaitable[Any]], ForwardRef(None)] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[AsyncOAuthSettings] = None, oauth_flow: Optional[AsyncOAuthFlow] = None, verification_token: Optional[str] = None)

    Bolt App that provides functionalities to register middleware/listeners.

    @@ -1414,6 +1436,8 @@

    Args

    The bot/user access token required only for single-workspace app.
    client
    The singleton slack_sdk.web.async_client.AsyncWebClient instance for this app.
    +
    before_authorize
    +
    A global middleware that can be executed right before authorize function
    authorize
    The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data.
    @@ -1468,6 +1492,7 @@

    Args

    token: Optional[str] = None, client: Optional[AsyncWebClient] = None, # for multi-workspace apps + before_authorize: Optional[Union[AsyncMiddleware, Callable[..., Awaitable[Any]]]] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, installation_store: Optional[AsyncInstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility @@ -1519,6 +1544,7 @@

    Args

    signing_secret: The Signing Secret value used for verifying requests from Slack. token: The bot/user access token required only for single-workspace app. client: The singleton `slack_sdk.web.async_client.AsyncWebClient` instance for this app. + before_authorize: A global middleware that can be executed right before authorize function authorize: The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data. installation_store: The module offering save/find operations of installation data @@ -1576,6 +1602,17 @@

    Args

    # Authorize & OAuthFlow initialization # -------------------------------------- + self._async_before_authorize: Optional[AsyncMiddleware] = None + if before_authorize is not None: + if isinstance(before_authorize, Callable): + self._async_before_authorize = AsyncCustomMiddleware( + app_name=self._name, + func=before_authorize, + base_logger=self._framework_logger, + ) + elif isinstance(before_authorize, AsyncMiddleware): + self._async_before_authorize = before_authorize + self._async_authorize: Optional[AsyncAuthorize] = None if authorize is not None: if isinstance(authorize, AsyncAuthorize): @@ -1599,6 +1636,7 @@

    Args

    logger=self._framework_logger, bot_only=installation_store_bot_only, client=self._async_client, # for proxy use cases etc. + user_token_resolution=(settings.user_token_resolution if settings is not None else "authed_user"), ) self._async_oauth_flow: Optional[AsyncOAuthFlow] = None @@ -1718,6 +1756,10 @@

    Args

    ) if request_verification_enabled is True: self._async_middleware_list.append(AsyncRequestVerification(self._signing_secret, base_logger=self._base_logger)) + + if self._async_before_authorize is not None: + self._async_middleware_list.append(self._async_before_authorize) + # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._async_oauth_flow is None: if self._token: @@ -1730,7 +1772,11 @@

    Args

    raise BoltError(error_token_required()) else: self._async_middleware_list.append( - AsyncMultiTeamsAuthorization(authorize=self._async_authorize, base_logger=self._base_logger) + AsyncMultiTeamsAuthorization( + authorize=self._async_authorize, + base_logger=self._base_logger, + user_token_resolution=self._async_oauth_flow.settings.user_token_resolution, + ) ) if ignoring_self_events_enabled is True: diff --git a/docs/api-docs/slack_bolt/app/index.html b/docs/api-docs/slack_bolt/app/index.html index d9332bacd..4175c54ac 100644 --- a/docs/api-docs/slack_bolt/app/index.html +++ b/docs/api-docs/slack_bolt/app/index.html @@ -72,7 +72,7 @@

    Classes

    class App -(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, token_verification_enabled: bool = True, client: Optional[slack_sdk.web.client.WebClient] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, verification_token: Optional[str] = None, listener_executor: Optional[concurrent.futures._base.Executor] = None) +(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, token_verification_enabled: bool = True, client: Optional[slack_sdk.web.client.WebClient] = None, before_authorize: Union[Middleware, Callable[..., Any], ForwardRef(None)] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, verification_token: Optional[str] = None, listener_executor: Optional[concurrent.futures._base.Executor] = None)

    Bolt App that provides functionalities to register middleware/listeners.

    @@ -118,6 +118,8 @@

    Args

    Verifies the validity of the given token if True.
    client
    The singleton slack_sdk.WebClient instance for this app.
    +
    before_authorize
    +
    A global middleware that can be executed right before authorize function
    authorize
    The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data.
    @@ -176,6 +178,7 @@

    Args

    token_verification_enabled: bool = True, client: Optional[WebClient] = None, # for multi-workspace apps + before_authorize: Optional[Union[Middleware, Callable[..., Any]]] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[InstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility @@ -230,6 +233,7 @@

    Args

    token: The bot/user access token required only for single-workspace app. token_verification_enabled: Verifies the validity of the given token if True. client: The singleton `slack_sdk.WebClient` instance for this app. + before_authorize: A global middleware that can be executed right before authorize function authorize: The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data. installation_store: The module offering save/find operations of installation data @@ -290,6 +294,17 @@

    Args

    # Authorize & OAuthFlow initialization # -------------------------------------- + self._before_authorize: Optional[Middleware] = None + if before_authorize is not None: + if isinstance(before_authorize, Callable): + self._before_authorize = CustomMiddleware( + app_name=self._name, + func=before_authorize, + base_logger=self._framework_logger, + ) + elif isinstance(before_authorize, Middleware): + self._before_authorize = before_authorize + self._authorize: Optional[Authorize] = None if authorize is not None: if isinstance(authorize, Authorize): @@ -313,6 +328,7 @@

    Args

    logger=self._framework_logger, bot_only=installation_store_bot_only, client=self._client, # for proxy use cases etc. + user_token_resolution=(settings.user_token_resolution if settings is not None else "authed_user"), ) self._oauth_flow: Optional[OAuthFlow] = None @@ -431,6 +447,9 @@

    Args

    if request_verification_enabled is True: self._middleware_list.append(RequestVerification(self._signing_secret, base_logger=self._base_logger)) + if self._before_authorize is not None: + self._middleware_list.append(self._before_authorize) + # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._oauth_flow is None: if self._token is not None: @@ -454,7 +473,13 @@

    Args

    else: raise BoltError(error_token_required()) else: - self._middleware_list.append(MultiTeamsAuthorization(authorize=self._authorize, base_logger=self._base_logger)) + self._middleware_list.append( + MultiTeamsAuthorization( + authorize=self._authorize, + base_logger=self._base_logger, + user_token_resolution=self._oauth_flow.settings.user_token_resolution, + ) + ) if ignoring_self_events_enabled is True: self._middleware_list.append(IgnoringSelfEvents(base_logger=self._base_logger)) if url_verification_enabled is True: diff --git a/docs/api-docs/slack_bolt/async_app.html b/docs/api-docs/slack_bolt/async_app.html index 725f5929d..e6b693440 100644 --- a/docs/api-docs/slack_bolt/async_app.html +++ b/docs/api-docs/slack_bolt/async_app.html @@ -195,7 +195,7 @@

    Class variables

    class AsyncApp -(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, client: Optional[slack_sdk.web.async_client.AsyncWebClient] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[AsyncOAuthSettings] = None, oauth_flow: Optional[AsyncOAuthFlow] = None, verification_token: Optional[str] = None) +(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, client: Optional[slack_sdk.web.async_client.AsyncWebClient] = None, before_authorize: Union[AsyncMiddleware, Callable[..., Awaitable[Any]], ForwardRef(None)] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[AsyncOAuthSettings] = None, oauth_flow: Optional[AsyncOAuthFlow] = None, verification_token: Optional[str] = None)

    Bolt App that provides functionalities to register middleware/listeners.

    @@ -239,6 +239,8 @@

    Args

    The bot/user access token required only for single-workspace app.
    client
    The singleton slack_sdk.web.async_client.AsyncWebClient instance for this app.
    +
    before_authorize
    +
    A global middleware that can be executed right before authorize function
    authorize
    The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data.
    @@ -293,6 +295,7 @@

    Args

    token: Optional[str] = None, client: Optional[AsyncWebClient] = None, # for multi-workspace apps + before_authorize: Optional[Union[AsyncMiddleware, Callable[..., Awaitable[Any]]]] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, installation_store: Optional[AsyncInstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility @@ -344,6 +347,7 @@

    Args

    signing_secret: The Signing Secret value used for verifying requests from Slack. token: The bot/user access token required only for single-workspace app. client: The singleton `slack_sdk.web.async_client.AsyncWebClient` instance for this app. + before_authorize: A global middleware that can be executed right before authorize function authorize: The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data. installation_store: The module offering save/find operations of installation data @@ -401,6 +405,17 @@

    Args

    # Authorize & OAuthFlow initialization # -------------------------------------- + self._async_before_authorize: Optional[AsyncMiddleware] = None + if before_authorize is not None: + if isinstance(before_authorize, Callable): + self._async_before_authorize = AsyncCustomMiddleware( + app_name=self._name, + func=before_authorize, + base_logger=self._framework_logger, + ) + elif isinstance(before_authorize, AsyncMiddleware): + self._async_before_authorize = before_authorize + self._async_authorize: Optional[AsyncAuthorize] = None if authorize is not None: if isinstance(authorize, AsyncAuthorize): @@ -424,6 +439,7 @@

    Args

    logger=self._framework_logger, bot_only=installation_store_bot_only, client=self._async_client, # for proxy use cases etc. + user_token_resolution=(settings.user_token_resolution if settings is not None else "authed_user"), ) self._async_oauth_flow: Optional[AsyncOAuthFlow] = None @@ -543,6 +559,10 @@

    Args

    ) if request_verification_enabled is True: self._async_middleware_list.append(AsyncRequestVerification(self._signing_secret, base_logger=self._base_logger)) + + if self._async_before_authorize is not None: + self._async_middleware_list.append(self._async_before_authorize) + # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._async_oauth_flow is None: if self._token: @@ -555,7 +575,11 @@

    Args

    raise BoltError(error_token_required()) else: self._async_middleware_list.append( - AsyncMultiTeamsAuthorization(authorize=self._async_authorize, base_logger=self._base_logger) + AsyncMultiTeamsAuthorization( + authorize=self._async_authorize, + base_logger=self._base_logger, + user_token_resolution=self._async_oauth_flow.settings.user_token_resolution, + ) ) if ignoring_self_events_enabled is True: @@ -3328,6 +3352,9 @@

    Inherited members

    • BaseContext:
        +
      • actor_enterprise_id
      • +
      • actor_team_id
      • +
      • actor_user_id
      • authorize_result
      • bot_id
      • bot_token
      • diff --git a/docs/api-docs/slack_bolt/authorization/async_authorize.html b/docs/api-docs/slack_bolt/authorization/async_authorize.html index f74cb5f26..3b906d61f 100644 --- a/docs/api-docs/slack_bolt/authorization/async_authorize.html +++ b/docs/api-docs/slack_bolt/authorization/async_authorize.html @@ -27,9 +27,9 @@

        Module slack_bolt.authorization.async_authorizeExpand source code
        from logging import Logger
        -from typing import Optional, Callable, Awaitable, Dict, Any
        +from typing import Optional, Callable, Awaitable, Dict, Any, List
         
        -from slack_sdk.errors import SlackApiError
        +from slack_sdk.errors import SlackApiError, SlackTokenRotationError
         from slack_sdk.oauth.installation_store import Bot, Installation
         from slack_sdk.oauth.installation_store.async_installation_store import (
             AsyncInstallationStore,
        @@ -58,6 +58,10 @@ 

        Module slack_bolt.authorization.async_authorizeModule slack_bolt.authorization.async_authorizeModule slack_bolt.authorization.async_authorizeModule slack_bolt.authorization.async_authorizeModule slack_bolt.authorization.async_authorizeModule slack_bolt.authorization.async_authorizeModule slack_bolt.authorization.async_authorizeModule slack_bolt.authorization.async_authorizeModule slack_bolt.authorization.async_authorizeModule slack_bolt.authorization.async_authorizeModule slack_bolt.authorization.async_authorizeModule slack_bolt.authorization.async_authorizeClasses

        enterprise_id: Optional[str], team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], + # actor_* can be used only when user_token_resolution: "actor" is set + actor_enterprise_id: Optional[str] = None, + actor_team_id: Optional[str] = None, + actor_user_id: Optional[str] = None, ) -> Optional[AuthorizeResult]: raise NotImplementedError()
        @@ -404,6 +481,10 @@

        Subclasses

        enterprise_id: Optional[str], team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], + # actor_* can be used only when user_token_resolution: "actor" is set + actor_enterprise_id: Optional[str] = None, + actor_team_id: Optional[str] = None, + actor_user_id: Optional[str] = None, ) -> Optional[AuthorizeResult]: try: all_available_args = { @@ -419,6 +500,9 @@

        Subclasses

        "enterprise_id": enterprise_id, "team_id": team_id, "user_id": user_id, + "actor_enterprise_id": actor_enterprise_id, + "actor_team_id": actor_team_id, + "actor_user_id": actor_user_id, } for k, v in context.items(): if k not in all_available_args: @@ -455,7 +539,7 @@

        Ancestors

        class AsyncInstallationStoreAuthorize -(*, logger: logging.Logger, installation_store: slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore, client_id: Optional[str] = None, client_secret: Optional[str] = None, token_rotation_expiration_minutes: Optional[int] = None, bot_only: bool = False, cache_enabled: bool = False, client: Optional[slack_sdk.web.async_client.AsyncWebClient] = None) +(*, logger: logging.Logger, installation_store: slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore, client_id: Optional[str] = None, client_secret: Optional[str] = None, token_rotation_expiration_minutes: Optional[int] = None, bot_only: bool = False, cache_enabled: bool = False, client: Optional[slack_sdk.web.async_client.AsyncWebClient] = None, user_token_resolution: str = 'authed_user')

        If you use the OAuth flow settings, this authorize implementation will be used. @@ -472,6 +556,8 @@

        Ancestors

        """ authorize_result_cache: Dict[str, AuthorizeResult] + bot_only: bool + user_token_resolution: str find_installation_available: Optional[bool] find_bot_available: Optional[bool] token_rotator: Optional[AsyncTokenRotator] @@ -491,10 +577,13 @@

        Ancestors

        bot_only: bool = False, cache_enabled: bool = False, client: Optional[AsyncWebClient] = None, + # Since v1.27, user token resolution can be actor ID based when the mode is enabled + user_token_resolution: str = "authed_user", ): self.logger = logger self.installation_store = installation_store self.bot_only = bot_only + self.user_token_resolution = user_token_resolution self.cache_enabled = cache_enabled self.authorize_result_cache = {} self.find_installation_available = None @@ -516,6 +605,10 @@

        Ancestors

        enterprise_id: Optional[str], team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], + # actor_* can be used only when user_token_resolution: "actor" is set + actor_enterprise_id: Optional[str] = None, + actor_team_id: Optional[str] = None, + actor_user_id: Optional[str] = None, ) -> Optional[AuthorizeResult]: if self.find_installation_available is None: @@ -525,6 +618,10 @@

        Ancestors

        bot_token: Optional[str] = None user_token: Optional[str] = None + bot_scopes: Optional[List[str]] = None + user_scopes: Optional[List[str]] = None + latest_bot_installation: Optional[Installation] = None + this_user_installation: Optional[Installation] = None if not self.bot_only and self.find_installation_available: # Since v1.1, this is the default way. @@ -532,7 +629,7 @@

        Ancestors

        try: # Note that this is the latest information for the org/workspace. # The installer may not be the user associated with this incoming request. - latest_installation: Optional[Installation] = await self.installation_store.async_find_installation( + latest_bot_installation = await self.installation_store.async_find_installation( enterprise_id=enterprise_id, team_id=team_id, is_enterprise_install=context.is_enterprise_install, @@ -542,52 +639,88 @@

        Ancestors

        # The example use cases are: # - The app's installation requires both bot and user tokens # - The app has two installation paths 1) bot installation 2) individual user authorization - this_user_installation: Optional[Installation] = None - - if latest_installation is not None: + if latest_bot_installation is not None: # Save the latest bot token - bot_token = latest_installation.bot_token # this still can be None - user_token = latest_installation.user_token # this still can be None + bot_token = latest_bot_installation.bot_token # this still can be None + user_token = latest_bot_installation.user_token # this still can be None + bot_scopes = latest_bot_installation.bot_scopes # this still can be None + user_scopes = latest_bot_installation.user_scopes # this still can be None - if latest_installation.user_id != user_id: + if latest_bot_installation.user_id != user_id: # First off, remove the user token as the installer is a different user user_token = None - latest_installation.user_token = None - latest_installation.user_refresh_token = None - latest_installation.user_token_expires_at = None - latest_installation.user_scopes = [] + user_scopes = None + latest_bot_installation.user_token = None + latest_bot_installation.user_refresh_token = None + latest_bot_installation.user_token_expires_at = None + latest_bot_installation.user_scopes = None # try to fetch the request user's installation # to reflect the user's access token if exists - this_user_installation = await self.installation_store.async_find_installation( - enterprise_id=enterprise_id, - team_id=team_id, - user_id=user_id, - is_enterprise_install=context.is_enterprise_install, - ) + # try to fetch the request user's installation + # to reflect the user's access token if exists + if self.user_token_resolution == "actor": + if actor_enterprise_id is not None or actor_team_id is not None: + # Note that actor_team_id can be absent for app_mention events + this_user_installation = await self.installation_store.async_find_installation( + enterprise_id=actor_enterprise_id, + team_id=actor_team_id, + user_id=actor_user_id, + is_enterprise_install=None, + ) + else: + this_user_installation = await self.installation_store.async_find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + user_id=user_id, + is_enterprise_install=context.is_enterprise_install, + ) if this_user_installation is not None: user_token = this_user_installation.user_token - if latest_installation.bot_token is None: + user_scopes = this_user_installation.user_scopes + if ( + latest_bot_installation.bot_token is None + # enterprise_id/team_id can be different for Slack Connect channel events + # when enabling user_token_resolution: "actor" + and latest_bot_installation.enterprise_id == this_user_installation.enterprise_id + and latest_bot_installation.team_id == this_user_installation.team_id + ): # If latest_installation has a bot token, we never overwrite the value bot_token = this_user_installation.bot_token + bot_scopes = this_user_installation.bot_scopes # If token rotation is enabled, running rotation may be needed here refreshed = await self._rotate_and_save_tokens_if_necessary(this_user_installation) if refreshed is not None: user_token = refreshed.user_token - if latest_installation.bot_token is None: + user_scopes = refreshed.user_scopes + if ( + latest_bot_installation.bot_token is None + # enterprise_id/team_id can be different for Slack Connect channel events + # when enabling user_token_resolution: "actor" + and latest_bot_installation.enterprise_id == this_user_installation.enterprise_id + and latest_bot_installation.team_id == this_user_installation.team_id + ): # If latest_installation has a bot token, we never overwrite the value bot_token = refreshed.bot_token + bot_scopes = refreshed.bot_scopes # If token rotation is enabled, running rotation may be needed here - refreshed = await self._rotate_and_save_tokens_if_necessary(latest_installation) + refreshed = await self._rotate_and_save_tokens_if_necessary(latest_bot_installation) if refreshed is not None: bot_token = refreshed.bot_token + bot_scopes = refreshed.bot_scopes if this_user_installation is None: # Only when we don't have `this_user_installation` here, # the `user_token` is for the user associated with this request user_token = refreshed.user_token + user_scopes = refreshed.user_scopes + except SlackTokenRotationError as rotation_error: + # When token rotation fails, it is usually unrecoverable + # So, this built-in middleware gives up continuing with the following middleware and listeners + self.logger.error(f"Failed to rotate tokens due to {rotation_error}") + return None except NotImplementedError as _: self.find_installation_available = False @@ -607,6 +740,7 @@

        Ancestors

        ) if bot is not None: bot_token = bot.bot_token + bot_scopes = bot.bot_scopes if bot.bot_refresh_token is not None: # Token rotation if self.token_rotator is None: @@ -618,7 +752,13 @@

        Ancestors

        if refreshed is not None: await self.installation_store.async_save_bot(refreshed) bot_token = refreshed.bot_token + bot_scopes = refreshed.bot_scopes + except SlackTokenRotationError as rotation_error: + # When token rotation fails, it is usually unrecoverable + # So, this built-in middleware gives up continuing with the following middleware and listeners + self.logger.error(f"Failed to rotate tokens due to {rotation_error}") + return None except NotImplementedError as _: self.find_bot_available = False except Exception as e: @@ -636,10 +776,16 @@

        Ancestors

        try: auth_test_api_response = await context.client.auth_test(token=token) + user_auth_test_response = None + if user_token is not None and token != user_token: + user_auth_test_response = await context.client.auth_test(token=user_token) authorize_result = AuthorizeResult.from_auth_test_response( auth_test_response=auth_test_api_response, + user_auth_test_response=user_auth_test_response, bot_token=bot_token, user_token=user_token, + bot_scopes=bot_scopes, + user_scopes=user_scopes, ) if self.cache_enabled: self.authorize_result_cache[token] = authorize_result @@ -684,6 +830,10 @@

        Class variables

        +
        var bot_only : bool
        +
        +
        +
        var find_bot_available : Optional[bool]
        @@ -696,6 +846,10 @@

        Class variables

        +
        var user_token_resolution : str
        +
        +
        +
    @@ -724,9 +878,11 @@

    AsyncInstallationStoreAuthorize

    diff --git a/docs/api-docs/slack_bolt/authorization/authorize.html b/docs/api-docs/slack_bolt/authorization/authorize.html index 5e1015260..81e17746f 100644 --- a/docs/api-docs/slack_bolt/authorization/authorize.html +++ b/docs/api-docs/slack_bolt/authorization/authorize.html @@ -27,9 +27,9 @@

    Module slack_bolt.authorization.authorize

    Expand source code
    from logging import Logger
    -from typing import Optional, Callable, Dict, Any
    +from typing import Optional, Callable, Dict, Any, List
     
    -from slack_sdk.errors import SlackApiError
    +from slack_sdk.errors import SlackApiError, SlackTokenRotationError
     from slack_sdk.oauth import InstallationStore
     from slack_sdk.oauth.installation_store.models.bot import Bot
     from slack_sdk.oauth.installation_store.models.installation import Installation
    @@ -57,6 +57,10 @@ 

    Module slack_bolt.authorization.authorize

    enterprise_id: Optional[str], team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], + # actor_* can be used only when user_token_resolution: "actor" is set + actor_enterprise_id: Optional[str] = None, + actor_team_id: Optional[str] = None, + actor_user_id: Optional[str] = None, ) -> Optional[AuthorizeResult]: raise NotImplementedError() @@ -83,6 +87,10 @@

    Module slack_bolt.authorization.authorize

    enterprise_id: Optional[str], team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], + # actor_* can be used only when user_token_resolution: "actor" is set + actor_enterprise_id: Optional[str] = None, + actor_team_id: Optional[str] = None, + actor_user_id: Optional[str] = None, ) -> Optional[AuthorizeResult]: try: all_available_args = { @@ -98,6 +106,9 @@

    Module slack_bolt.authorization.authorize

    "enterprise_id": enterprise_id, "team_id": team_id, "user_id": user_id, + "actor_enterprise_id": actor_enterprise_id, + "actor_team_id": actor_team_id, + "actor_user_id": actor_user_id, } for k, v in context.items(): if k not in all_available_args: @@ -136,6 +147,7 @@

    Module slack_bolt.authorization.authorize

    authorize_result_cache: Dict[str, AuthorizeResult] bot_only: bool + user_token_resolution: str find_installation_available: bool find_bot_available: bool token_rotator: Optional[TokenRotator] @@ -155,10 +167,13 @@

    Module slack_bolt.authorization.authorize

    bot_only: bool = False, cache_enabled: bool = False, client: Optional[WebClient] = None, + # Since v1.27, user token resolution can be actor ID based when the mode is enabled + user_token_resolution: str = "authed_user", ): self.logger = logger self.installation_store = installation_store self.bot_only = bot_only + self.user_token_resolution = user_token_resolution self.cache_enabled = cache_enabled self.authorize_result_cache = {} self.find_installation_available = hasattr(installation_store, "find_installation") @@ -180,10 +195,18 @@

    Module slack_bolt.authorization.authorize

    enterprise_id: Optional[str], team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], + # actor_* can be used only when user_token_resolution: "actor" is set + actor_enterprise_id: Optional[str] = None, + actor_team_id: Optional[str] = None, + actor_user_id: Optional[str] = None, ) -> Optional[AuthorizeResult]: bot_token: Optional[str] = None user_token: Optional[str] = None + bot_scopes: Optional[List[str]] = None + user_scopes: Optional[List[str]] = None + latest_bot_installation: Optional[Installation] = None + this_user_installation: Optional[Installation] = None if not self.bot_only and self.find_installation_available: # Since v1.1, this is the default way. @@ -191,7 +214,7 @@

    Module slack_bolt.authorization.authorize

    try: # Note that this is the latest information for the org/workspace. # The installer may not be the user associated with this incoming request. - latest_installation: Optional[Installation] = self.installation_store.find_installation( + latest_bot_installation = self.installation_store.find_installation( enterprise_id=enterprise_id, team_id=team_id, is_enterprise_install=context.is_enterprise_install, @@ -201,52 +224,86 @@

    Module slack_bolt.authorization.authorize

    # The example use cases are: # - The app's installation requires both bot and user tokens # - The app has two installation paths 1) bot installation 2) individual user authorization - this_user_installation: Optional[Installation] = None - - if latest_installation is not None: + if latest_bot_installation is not None: # Save the latest bot token - bot_token = latest_installation.bot_token # this still can be None - user_token = latest_installation.user_token # this still can be None + bot_token = latest_bot_installation.bot_token # this still can be None + user_token = latest_bot_installation.user_token # this still can be None + bot_scopes = latest_bot_installation.bot_scopes # this still can be None + user_scopes = latest_bot_installation.user_scopes # this still can be None - if latest_installation.user_id != user_id: + if latest_bot_installation.user_id != user_id: # First off, remove the user token as the installer is a different user user_token = None - latest_installation.user_token = None - latest_installation.user_refresh_token = None - latest_installation.user_token_expires_at = None - latest_installation.user_scopes = [] + user_scopes = None + latest_bot_installation.user_token = None + latest_bot_installation.user_refresh_token = None + latest_bot_installation.user_token_expires_at = None + latest_bot_installation.user_scopes = None # try to fetch the request user's installation # to reflect the user's access token if exists - this_user_installation = self.installation_store.find_installation( - enterprise_id=enterprise_id, - team_id=team_id, - user_id=user_id, - is_enterprise_install=context.is_enterprise_install, - ) + if self.user_token_resolution == "actor": + if actor_enterprise_id is not None or actor_team_id is not None: + # Note that actor_team_id can be absent for app_mention events + this_user_installation = self.installation_store.find_installation( + enterprise_id=actor_enterprise_id, + team_id=actor_team_id, + user_id=actor_user_id, + is_enterprise_install=None, + ) + else: + this_user_installation = self.installation_store.find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + user_id=user_id, + is_enterprise_install=context.is_enterprise_install, + ) if this_user_installation is not None: user_token = this_user_installation.user_token - if latest_installation.bot_token is None: + user_scopes = this_user_installation.user_scopes + if ( + latest_bot_installation.bot_token is None + # enterprise_id/team_id can be different for Slack Connect channel events + # when enabling user_token_resolution: "actor" + and latest_bot_installation.enterprise_id == this_user_installation.enterprise_id + and latest_bot_installation.team_id == this_user_installation.team_id + ): # If latest_installation has a bot token, we never overwrite the value bot_token = this_user_installation.bot_token + bot_scopes = this_user_installation.bot_scopes # If token rotation is enabled, running rotation may be needed here refreshed = self._rotate_and_save_tokens_if_necessary(this_user_installation) if refreshed is not None: user_token = refreshed.user_token - if latest_installation.bot_token is None: + user_scopes = refreshed.user_scopes + if ( + latest_bot_installation.bot_token is None + # enterprise_id/team_id can be different for Slack Connect channel events + # when enabling user_token_resolution: "actor" + and latest_bot_installation.enterprise_id == this_user_installation.enterprise_id + and latest_bot_installation.team_id == this_user_installation.team_id + ): # If latest_installation has a bot token, we never overwrite the value bot_token = refreshed.bot_token + bot_scopes = refreshed.bot_scopes # If token rotation is enabled, running rotation may be needed here - refreshed = self._rotate_and_save_tokens_if_necessary(latest_installation) + refreshed = self._rotate_and_save_tokens_if_necessary(latest_bot_installation) if refreshed is not None: bot_token = refreshed.bot_token + bot_scopes = refreshed.bot_scopes if this_user_installation is None: # Only when we don't have `this_user_installation` here, # the `user_token` is for the user associated with this request user_token = refreshed.user_token + user_scopes = refreshed.user_scopes + except SlackTokenRotationError as rotation_error: + # When token rotation fails, it is usually unrecoverable + # So, this built-in middleware gives up continuing with the following middleware and listeners + self.logger.error(f"Failed to rotate tokens due to {rotation_error}") + return None except NotImplementedError as _: self.find_installation_available = False @@ -266,6 +323,7 @@

    Module slack_bolt.authorization.authorize

    ) if bot is not None: bot_token = bot.bot_token + bot_scopes = bot.bot_scopes if bot.bot_refresh_token is not None: # Token rotation if self.token_rotator is None: @@ -277,7 +335,13 @@

    Module slack_bolt.authorization.authorize

    if refreshed is not None: self.installation_store.save_bot(refreshed) bot_token = refreshed.bot_token + bot_scopes = refreshed.bot_scopes + except SlackTokenRotationError as rotation_error: + # When token rotation fails, it is usually unrecoverable + # So, this built-in middleware gives up continuing with the following middleware and listeners + self.logger.error(f"Failed to rotate tokens due to {rotation_error}") + return None except NotImplementedError as _: self.find_bot_available = False except Exception as e: @@ -295,10 +359,16 @@

    Module slack_bolt.authorization.authorize

    try: auth_test_api_response = context.client.auth_test(token=token) + user_auth_test_response = None + if user_token is not None and token != user_token: + user_auth_test_response = context.client.auth_test(token=user_token) authorize_result = AuthorizeResult.from_auth_test_response( auth_test_response=auth_test_api_response, + user_auth_test_response=user_auth_test_response, bot_token=bot_token, user_token=user_token, + bot_scopes=bot_scopes, + user_scopes=user_scopes, ) if self.cache_enabled: self.authorize_result_cache[token] = authorize_result @@ -367,6 +437,10 @@

    Classes

    enterprise_id: Optional[str], team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], + # actor_* can be used only when user_token_resolution: "actor" is set + actor_enterprise_id: Optional[str] = None, + actor_team_id: Optional[str] = None, + actor_user_id: Optional[str] = None, ) -> Optional[AuthorizeResult]: raise NotImplementedError()
    @@ -409,6 +483,10 @@

    Subclasses

    enterprise_id: Optional[str], team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], + # actor_* can be used only when user_token_resolution: "actor" is set + actor_enterprise_id: Optional[str] = None, + actor_team_id: Optional[str] = None, + actor_user_id: Optional[str] = None, ) -> Optional[AuthorizeResult]: try: all_available_args = { @@ -424,6 +502,9 @@

    Subclasses

    "enterprise_id": enterprise_id, "team_id": team_id, "user_id": user_id, + "actor_enterprise_id": actor_enterprise_id, + "actor_team_id": actor_team_id, + "actor_user_id": actor_user_id, } for k, v in context.items(): if k not in all_available_args: @@ -460,7 +541,7 @@

    Ancestors

    class InstallationStoreAuthorize -(*, logger: logging.Logger, installation_store: slack_sdk.oauth.installation_store.installation_store.InstallationStore, client_id: Optional[str] = None, client_secret: Optional[str] = None, token_rotation_expiration_minutes: Optional[int] = None, bot_only: bool = False, cache_enabled: bool = False, client: Optional[slack_sdk.web.client.WebClient] = None) +(*, logger: logging.Logger, installation_store: slack_sdk.oauth.installation_store.installation_store.InstallationStore, client_id: Optional[str] = None, client_secret: Optional[str] = None, token_rotation_expiration_minutes: Optional[int] = None, bot_only: bool = False, cache_enabled: bool = False, client: Optional[slack_sdk.web.client.WebClient] = None, user_token_resolution: str = 'authed_user')

    If you use the OAuth flow settings, this authorize implementation will be used. @@ -478,6 +559,7 @@

    Ancestors

    authorize_result_cache: Dict[str, AuthorizeResult] bot_only: bool + user_token_resolution: str find_installation_available: bool find_bot_available: bool token_rotator: Optional[TokenRotator] @@ -497,10 +579,13 @@

    Ancestors

    bot_only: bool = False, cache_enabled: bool = False, client: Optional[WebClient] = None, + # Since v1.27, user token resolution can be actor ID based when the mode is enabled + user_token_resolution: str = "authed_user", ): self.logger = logger self.installation_store = installation_store self.bot_only = bot_only + self.user_token_resolution = user_token_resolution self.cache_enabled = cache_enabled self.authorize_result_cache = {} self.find_installation_available = hasattr(installation_store, "find_installation") @@ -522,10 +607,18 @@

    Ancestors

    enterprise_id: Optional[str], team_id: Optional[str], # can be None for org-wide installed apps user_id: Optional[str], + # actor_* can be used only when user_token_resolution: "actor" is set + actor_enterprise_id: Optional[str] = None, + actor_team_id: Optional[str] = None, + actor_user_id: Optional[str] = None, ) -> Optional[AuthorizeResult]: bot_token: Optional[str] = None user_token: Optional[str] = None + bot_scopes: Optional[List[str]] = None + user_scopes: Optional[List[str]] = None + latest_bot_installation: Optional[Installation] = None + this_user_installation: Optional[Installation] = None if not self.bot_only and self.find_installation_available: # Since v1.1, this is the default way. @@ -533,7 +626,7 @@

    Ancestors

    try: # Note that this is the latest information for the org/workspace. # The installer may not be the user associated with this incoming request. - latest_installation: Optional[Installation] = self.installation_store.find_installation( + latest_bot_installation = self.installation_store.find_installation( enterprise_id=enterprise_id, team_id=team_id, is_enterprise_install=context.is_enterprise_install, @@ -543,52 +636,86 @@

    Ancestors

    # The example use cases are: # - The app's installation requires both bot and user tokens # - The app has two installation paths 1) bot installation 2) individual user authorization - this_user_installation: Optional[Installation] = None - - if latest_installation is not None: + if latest_bot_installation is not None: # Save the latest bot token - bot_token = latest_installation.bot_token # this still can be None - user_token = latest_installation.user_token # this still can be None + bot_token = latest_bot_installation.bot_token # this still can be None + user_token = latest_bot_installation.user_token # this still can be None + bot_scopes = latest_bot_installation.bot_scopes # this still can be None + user_scopes = latest_bot_installation.user_scopes # this still can be None - if latest_installation.user_id != user_id: + if latest_bot_installation.user_id != user_id: # First off, remove the user token as the installer is a different user user_token = None - latest_installation.user_token = None - latest_installation.user_refresh_token = None - latest_installation.user_token_expires_at = None - latest_installation.user_scopes = [] + user_scopes = None + latest_bot_installation.user_token = None + latest_bot_installation.user_refresh_token = None + latest_bot_installation.user_token_expires_at = None + latest_bot_installation.user_scopes = None # try to fetch the request user's installation # to reflect the user's access token if exists - this_user_installation = self.installation_store.find_installation( - enterprise_id=enterprise_id, - team_id=team_id, - user_id=user_id, - is_enterprise_install=context.is_enterprise_install, - ) + if self.user_token_resolution == "actor": + if actor_enterprise_id is not None or actor_team_id is not None: + # Note that actor_team_id can be absent for app_mention events + this_user_installation = self.installation_store.find_installation( + enterprise_id=actor_enterprise_id, + team_id=actor_team_id, + user_id=actor_user_id, + is_enterprise_install=None, + ) + else: + this_user_installation = self.installation_store.find_installation( + enterprise_id=enterprise_id, + team_id=team_id, + user_id=user_id, + is_enterprise_install=context.is_enterprise_install, + ) if this_user_installation is not None: user_token = this_user_installation.user_token - if latest_installation.bot_token is None: + user_scopes = this_user_installation.user_scopes + if ( + latest_bot_installation.bot_token is None + # enterprise_id/team_id can be different for Slack Connect channel events + # when enabling user_token_resolution: "actor" + and latest_bot_installation.enterprise_id == this_user_installation.enterprise_id + and latest_bot_installation.team_id == this_user_installation.team_id + ): # If latest_installation has a bot token, we never overwrite the value bot_token = this_user_installation.bot_token + bot_scopes = this_user_installation.bot_scopes # If token rotation is enabled, running rotation may be needed here refreshed = self._rotate_and_save_tokens_if_necessary(this_user_installation) if refreshed is not None: user_token = refreshed.user_token - if latest_installation.bot_token is None: + user_scopes = refreshed.user_scopes + if ( + latest_bot_installation.bot_token is None + # enterprise_id/team_id can be different for Slack Connect channel events + # when enabling user_token_resolution: "actor" + and latest_bot_installation.enterprise_id == this_user_installation.enterprise_id + and latest_bot_installation.team_id == this_user_installation.team_id + ): # If latest_installation has a bot token, we never overwrite the value bot_token = refreshed.bot_token + bot_scopes = refreshed.bot_scopes # If token rotation is enabled, running rotation may be needed here - refreshed = self._rotate_and_save_tokens_if_necessary(latest_installation) + refreshed = self._rotate_and_save_tokens_if_necessary(latest_bot_installation) if refreshed is not None: bot_token = refreshed.bot_token + bot_scopes = refreshed.bot_scopes if this_user_installation is None: # Only when we don't have `this_user_installation` here, # the `user_token` is for the user associated with this request user_token = refreshed.user_token + user_scopes = refreshed.user_scopes + except SlackTokenRotationError as rotation_error: + # When token rotation fails, it is usually unrecoverable + # So, this built-in middleware gives up continuing with the following middleware and listeners + self.logger.error(f"Failed to rotate tokens due to {rotation_error}") + return None except NotImplementedError as _: self.find_installation_available = False @@ -608,6 +735,7 @@

    Ancestors

    ) if bot is not None: bot_token = bot.bot_token + bot_scopes = bot.bot_scopes if bot.bot_refresh_token is not None: # Token rotation if self.token_rotator is None: @@ -619,7 +747,13 @@

    Ancestors

    if refreshed is not None: self.installation_store.save_bot(refreshed) bot_token = refreshed.bot_token + bot_scopes = refreshed.bot_scopes + except SlackTokenRotationError as rotation_error: + # When token rotation fails, it is usually unrecoverable + # So, this built-in middleware gives up continuing with the following middleware and listeners + self.logger.error(f"Failed to rotate tokens due to {rotation_error}") + return None except NotImplementedError as _: self.find_bot_available = False except Exception as e: @@ -637,10 +771,16 @@

    Ancestors

    try: auth_test_api_response = context.client.auth_test(token=token) + user_auth_test_response = None + if user_token is not None and token != user_token: + user_auth_test_response = context.client.auth_test(token=user_token) authorize_result = AuthorizeResult.from_auth_test_response( auth_test_response=auth_test_api_response, + user_auth_test_response=user_auth_test_response, bot_token=bot_token, user_token=user_token, + bot_scopes=bot_scopes, + user_scopes=user_scopes, ) if self.cache_enabled: self.authorize_result_cache[token] = authorize_result @@ -701,6 +841,10 @@

    Class variables

    +
    var user_token_resolution : str
    +
    +
    +
    @@ -733,6 +877,7 @@

    find_bot_available
  • find_installation_available
  • token_rotator
  • +
  • user_token_resolution
  • diff --git a/docs/api-docs/slack_bolt/authorization/authorize_result.html b/docs/api-docs/slack_bolt/authorization/authorize_result.html index 4f84e22ba..185aa8cec 100644 --- a/docs/api-docs/slack_bolt/authorization/authorize_result.html +++ b/docs/api-docs/slack_bolt/authorization/authorize_result.html @@ -26,7 +26,7 @@

    Module slack_bolt.authorization.authorize_result< Expand source code -
    from typing import Optional
    +
    from typing import Optional, List, Union
     
     from slack_sdk.web import SlackResponse
     
    @@ -39,8 +39,10 @@ 

    Module slack_bolt.authorization.authorize_result< bot_id: Optional[str] bot_user_id: Optional[str] bot_token: Optional[str] + bot_scopes: Optional[List[str]] # since v1.17 user_id: Optional[str] user_token: Optional[str] + user_scopes: Optional[List[str]] # since v1.17 def __init__( self, @@ -51,9 +53,11 @@

    Module slack_bolt.authorization.authorize_result< bot_user_id: Optional[str] = None, bot_id: Optional[str] = None, bot_token: Optional[str] = None, + bot_scopes: Optional[Union[List[str], str]] = None, # user user_id: Optional[str] = None, user_token: Optional[str] = None, + user_scopes: Optional[Union[List[str], str]] = None, ): """ Args: @@ -62,8 +66,10 @@

    Module slack_bolt.authorization.authorize_result< bot_user_id: Bot user's User ID starting with either `U` or `W` bot_id: Bot ID starting with `B` bot_token: Bot user access token starting with `xoxb-` + bot_scopes: The scopes associated with the bot token user_id: The request user ID user_token: User access token starting with `xoxp-` + user_scopes: The scopes associated wth the user token """ self["enterprise_id"] = self.enterprise_id = enterprise_id self["team_id"] = self.team_id = team_id @@ -71,9 +77,15 @@

    Module slack_bolt.authorization.authorize_result< self["bot_user_id"] = self.bot_user_id = bot_user_id self["bot_id"] = self.bot_id = bot_id self["bot_token"] = self.bot_token = bot_token + if bot_scopes is not None and isinstance(bot_scopes, str): + bot_scopes = [scope.strip() for scope in bot_scopes.split(",")] + self["bot_scopes"] = self.bot_scopes = bot_scopes # type: ignore # user self["user_id"] = self.user_id = user_id self["user_token"] = self.user_token = user_token + if user_scopes is not None and isinstance(user_scopes, str): + user_scopes = [scope.strip() for scope in user_scopes.split(",")] + self["user_scopes"] = self.user_scopes = user_scopes # type: ignore @classmethod def from_auth_test_response( @@ -81,7 +93,10 @@

    Module slack_bolt.authorization.authorize_result< *, bot_token: Optional[str] = None, user_token: Optional[str] = None, + bot_scopes: Optional[Union[List[str], str]] = None, + user_scopes: Optional[Union[List[str], str]] = None, auth_test_response: SlackResponse, + user_auth_test_response: Optional[SlackResponse] = None, ) -> "AuthorizeResult": bot_user_id: Optional[str] = ( # type:ignore auth_test_response.get("user_id") if auth_test_response.get("bot_id") is not None else None @@ -89,14 +104,20 @@

    Module slack_bolt.authorization.authorize_result< user_id: Optional[str] = ( # type:ignore auth_test_response.get("user_id") if auth_test_response.get("bot_id") is None else None ) + # Since v1.28, user_id can be set when user_token w/ its auth.test response exists + if user_id is None and user_auth_test_response is not None: + user_id: Optional[str] = user_auth_test_response.get("user_id") # type:ignore + return AuthorizeResult( enterprise_id=auth_test_response.get("enterprise_id"), team_id=auth_test_response.get("team_id"), bot_id=auth_test_response.get("bot_id"), bot_user_id=bot_user_id, + bot_scopes=bot_scopes, user_id=user_id, bot_token=bot_token, user_token=user_token, + user_scopes=user_scopes, )

    @@ -111,7 +132,7 @@

    Classes

    class AuthorizeResult -(*, enterprise_id: Optional[str], team_id: Optional[str], bot_user_id: Optional[str] = None, bot_id: Optional[str] = None, bot_token: Optional[str] = None, user_id: Optional[str] = None, user_token: Optional[str] = None) +(*, enterprise_id: Optional[str], team_id: Optional[str], bot_user_id: Optional[str] = None, bot_id: Optional[str] = None, bot_token: Optional[str] = None, bot_scopes: Union[List[str], str, ForwardRef(None)] = None, user_id: Optional[str] = None, user_token: Optional[str] = None, user_scopes: Union[List[str], str, ForwardRef(None)] = None)

    Authorize function call result

    @@ -127,10 +148,14 @@

    Args

    Bot ID starting with B
    bot_token
    Bot user access token starting with xoxb-
    +
    bot_scopes
    +
    The scopes associated with the bot token
    user_id
    The request user ID
    user_token
    User access token starting with xoxp-
    +
    user_scopes
    +
    The scopes associated wth the user token
    @@ -144,8 +169,10 @@

    Args

    bot_id: Optional[str] bot_user_id: Optional[str] bot_token: Optional[str] + bot_scopes: Optional[List[str]] # since v1.17 user_id: Optional[str] user_token: Optional[str] + user_scopes: Optional[List[str]] # since v1.17 def __init__( self, @@ -156,9 +183,11 @@

    Args

    bot_user_id: Optional[str] = None, bot_id: Optional[str] = None, bot_token: Optional[str] = None, + bot_scopes: Optional[Union[List[str], str]] = None, # user user_id: Optional[str] = None, user_token: Optional[str] = None, + user_scopes: Optional[Union[List[str], str]] = None, ): """ Args: @@ -167,8 +196,10 @@

    Args

    bot_user_id: Bot user's User ID starting with either `U` or `W` bot_id: Bot ID starting with `B` bot_token: Bot user access token starting with `xoxb-` + bot_scopes: The scopes associated with the bot token user_id: The request user ID user_token: User access token starting with `xoxp-` + user_scopes: The scopes associated wth the user token """ self["enterprise_id"] = self.enterprise_id = enterprise_id self["team_id"] = self.team_id = team_id @@ -176,9 +207,15 @@

    Args

    self["bot_user_id"] = self.bot_user_id = bot_user_id self["bot_id"] = self.bot_id = bot_id self["bot_token"] = self.bot_token = bot_token + if bot_scopes is not None and isinstance(bot_scopes, str): + bot_scopes = [scope.strip() for scope in bot_scopes.split(",")] + self["bot_scopes"] = self.bot_scopes = bot_scopes # type: ignore # user self["user_id"] = self.user_id = user_id self["user_token"] = self.user_token = user_token + if user_scopes is not None and isinstance(user_scopes, str): + user_scopes = [scope.strip() for scope in user_scopes.split(",")] + self["user_scopes"] = self.user_scopes = user_scopes # type: ignore @classmethod def from_auth_test_response( @@ -186,7 +223,10 @@

    Args

    *, bot_token: Optional[str] = None, user_token: Optional[str] = None, + bot_scopes: Optional[Union[List[str], str]] = None, + user_scopes: Optional[Union[List[str], str]] = None, auth_test_response: SlackResponse, + user_auth_test_response: Optional[SlackResponse] = None, ) -> "AuthorizeResult": bot_user_id: Optional[str] = ( # type:ignore auth_test_response.get("user_id") if auth_test_response.get("bot_id") is not None else None @@ -194,14 +234,20 @@

    Args

    user_id: Optional[str] = ( # type:ignore auth_test_response.get("user_id") if auth_test_response.get("bot_id") is None else None ) + # Since v1.28, user_id can be set when user_token w/ its auth.test response exists + if user_id is None and user_auth_test_response is not None: + user_id: Optional[str] = user_auth_test_response.get("user_id") # type:ignore + return AuthorizeResult( enterprise_id=auth_test_response.get("enterprise_id"), team_id=auth_test_response.get("team_id"), bot_id=auth_test_response.get("bot_id"), bot_user_id=bot_user_id, + bot_scopes=bot_scopes, user_id=user_id, bot_token=bot_token, user_token=user_token, + user_scopes=user_scopes, )

    Ancestors

    @@ -214,6 +260,10 @@

    Class variables

    +
    var bot_scopes : Optional[List[str]]
    +
    +
    +
    var bot_token : Optional[str]
    @@ -234,6 +284,10 @@

    Class variables

    +
    var user_scopes : Optional[List[str]]
    +
    +
    +
    var user_token : Optional[str]
    @@ -242,7 +296,7 @@

    Class variables

    Static methods

    -def from_auth_test_response(*, bot_token: Optional[str] = None, user_token: Optional[str] = None, auth_test_response: slack_sdk.web.slack_response.SlackResponse) ‑> AuthorizeResult +def from_auth_test_response(*, bot_token: Optional[str] = None, user_token: Optional[str] = None, bot_scopes: Union[List[str], str, ForwardRef(None)] = None, user_scopes: Union[List[str], str, ForwardRef(None)] = None, auth_test_response: slack_sdk.web.slack_response.SlackResponse, user_auth_test_response: Optional[slack_sdk.web.slack_response.SlackResponse] = None) ‑> AuthorizeResult
    @@ -256,7 +310,10 @@

    Static methods

    *, bot_token: Optional[str] = None, user_token: Optional[str] = None, + bot_scopes: Optional[Union[List[str], str]] = None, + user_scopes: Optional[Union[List[str], str]] = None, auth_test_response: SlackResponse, + user_auth_test_response: Optional[SlackResponse] = None, ) -> "AuthorizeResult": bot_user_id: Optional[str] = ( # type:ignore auth_test_response.get("user_id") if auth_test_response.get("bot_id") is not None else None @@ -264,14 +321,20 @@

    Static methods

    user_id: Optional[str] = ( # type:ignore auth_test_response.get("user_id") if auth_test_response.get("bot_id") is None else None ) + # Since v1.28, user_id can be set when user_token w/ its auth.test response exists + if user_id is None and user_auth_test_response is not None: + user_id: Optional[str] = user_auth_test_response.get("user_id") # type:ignore + return AuthorizeResult( enterprise_id=auth_test_response.get("enterprise_id"), team_id=auth_test_response.get("team_id"), bot_id=auth_test_response.get("bot_id"), bot_user_id=bot_user_id, + bot_scopes=bot_scopes, user_id=user_id, bot_token=bot_token, user_token=user_token, + user_scopes=user_scopes, )
    @@ -297,12 +360,14 @@

    Index

    AuthorizeResult

    diff --git a/docs/api-docs/slack_bolt/authorization/index.html b/docs/api-docs/slack_bolt/authorization/index.html index 4eb6a59bc..86a00bfda 100644 --- a/docs/api-docs/slack_bolt/authorization/index.html +++ b/docs/api-docs/slack_bolt/authorization/index.html @@ -76,7 +76,7 @@

    Classes

    class AuthorizeResult -(*, enterprise_id: Optional[str], team_id: Optional[str], bot_user_id: Optional[str] = None, bot_id: Optional[str] = None, bot_token: Optional[str] = None, user_id: Optional[str] = None, user_token: Optional[str] = None) +(*, enterprise_id: Optional[str], team_id: Optional[str], bot_user_id: Optional[str] = None, bot_id: Optional[str] = None, bot_token: Optional[str] = None, bot_scopes: Union[List[str], str, ForwardRef(None)] = None, user_id: Optional[str] = None, user_token: Optional[str] = None, user_scopes: Union[List[str], str, ForwardRef(None)] = None)

    Authorize function call result

    @@ -92,10 +92,14 @@

    Args

    Bot ID starting with B
    bot_token
    Bot user access token starting with xoxb-
    +
    bot_scopes
    +
    The scopes associated with the bot token
    user_id
    The request user ID
    user_token
    User access token starting with xoxp-
    +
    user_scopes
    +
    The scopes associated wth the user token
    @@ -109,8 +113,10 @@

    Args

    bot_id: Optional[str] bot_user_id: Optional[str] bot_token: Optional[str] + bot_scopes: Optional[List[str]] # since v1.17 user_id: Optional[str] user_token: Optional[str] + user_scopes: Optional[List[str]] # since v1.17 def __init__( self, @@ -121,9 +127,11 @@

    Args

    bot_user_id: Optional[str] = None, bot_id: Optional[str] = None, bot_token: Optional[str] = None, + bot_scopes: Optional[Union[List[str], str]] = None, # user user_id: Optional[str] = None, user_token: Optional[str] = None, + user_scopes: Optional[Union[List[str], str]] = None, ): """ Args: @@ -132,8 +140,10 @@

    Args

    bot_user_id: Bot user's User ID starting with either `U` or `W` bot_id: Bot ID starting with `B` bot_token: Bot user access token starting with `xoxb-` + bot_scopes: The scopes associated with the bot token user_id: The request user ID user_token: User access token starting with `xoxp-` + user_scopes: The scopes associated wth the user token """ self["enterprise_id"] = self.enterprise_id = enterprise_id self["team_id"] = self.team_id = team_id @@ -141,9 +151,15 @@

    Args

    self["bot_user_id"] = self.bot_user_id = bot_user_id self["bot_id"] = self.bot_id = bot_id self["bot_token"] = self.bot_token = bot_token + if bot_scopes is not None and isinstance(bot_scopes, str): + bot_scopes = [scope.strip() for scope in bot_scopes.split(",")] + self["bot_scopes"] = self.bot_scopes = bot_scopes # type: ignore # user self["user_id"] = self.user_id = user_id self["user_token"] = self.user_token = user_token + if user_scopes is not None and isinstance(user_scopes, str): + user_scopes = [scope.strip() for scope in user_scopes.split(",")] + self["user_scopes"] = self.user_scopes = user_scopes # type: ignore @classmethod def from_auth_test_response( @@ -151,7 +167,10 @@

    Args

    *, bot_token: Optional[str] = None, user_token: Optional[str] = None, + bot_scopes: Optional[Union[List[str], str]] = None, + user_scopes: Optional[Union[List[str], str]] = None, auth_test_response: SlackResponse, + user_auth_test_response: Optional[SlackResponse] = None, ) -> "AuthorizeResult": bot_user_id: Optional[str] = ( # type:ignore auth_test_response.get("user_id") if auth_test_response.get("bot_id") is not None else None @@ -159,14 +178,20 @@

    Args

    user_id: Optional[str] = ( # type:ignore auth_test_response.get("user_id") if auth_test_response.get("bot_id") is None else None ) + # Since v1.28, user_id can be set when user_token w/ its auth.test response exists + if user_id is None and user_auth_test_response is not None: + user_id: Optional[str] = user_auth_test_response.get("user_id") # type:ignore + return AuthorizeResult( enterprise_id=auth_test_response.get("enterprise_id"), team_id=auth_test_response.get("team_id"), bot_id=auth_test_response.get("bot_id"), bot_user_id=bot_user_id, + bot_scopes=bot_scopes, user_id=user_id, bot_token=bot_token, user_token=user_token, + user_scopes=user_scopes, )

    Ancestors

    @@ -179,6 +204,10 @@

    Class variables

    +
    var bot_scopes : Optional[List[str]]
    +
    +
    +
    var bot_token : Optional[str]
    @@ -199,6 +228,10 @@

    Class variables

    +
    var user_scopes : Optional[List[str]]
    +
    +
    +
    var user_token : Optional[str]
    @@ -207,7 +240,7 @@

    Class variables

    Static methods

    -def from_auth_test_response(*, bot_token: Optional[str] = None, user_token: Optional[str] = None, auth_test_response: slack_sdk.web.slack_response.SlackResponse) ‑> AuthorizeResult +def from_auth_test_response(*, bot_token: Optional[str] = None, user_token: Optional[str] = None, bot_scopes: Union[List[str], str, ForwardRef(None)] = None, user_scopes: Union[List[str], str, ForwardRef(None)] = None, auth_test_response: slack_sdk.web.slack_response.SlackResponse, user_auth_test_response: Optional[slack_sdk.web.slack_response.SlackResponse] = None) ‑> AuthorizeResult
    @@ -221,7 +254,10 @@

    Static methods

    *, bot_token: Optional[str] = None, user_token: Optional[str] = None, + bot_scopes: Optional[Union[List[str], str]] = None, + user_scopes: Optional[Union[List[str], str]] = None, auth_test_response: SlackResponse, + user_auth_test_response: Optional[SlackResponse] = None, ) -> "AuthorizeResult": bot_user_id: Optional[str] = ( # type:ignore auth_test_response.get("user_id") if auth_test_response.get("bot_id") is not None else None @@ -229,14 +265,20 @@

    Static methods

    user_id: Optional[str] = ( # type:ignore auth_test_response.get("user_id") if auth_test_response.get("bot_id") is None else None ) + # Since v1.28, user_id can be set when user_token w/ its auth.test response exists + if user_id is None and user_auth_test_response is not None: + user_id: Optional[str] = user_auth_test_response.get("user_id") # type:ignore + return AuthorizeResult( enterprise_id=auth_test_response.get("enterprise_id"), team_id=auth_test_response.get("team_id"), bot_id=auth_test_response.get("bot_id"), bot_user_id=bot_user_id, + bot_scopes=bot_scopes, user_id=user_id, bot_token=bot_token, user_token=user_token, + user_scopes=user_scopes, )
    @@ -271,12 +313,14 @@

    Index

    AuthorizeResult

    diff --git a/docs/api-docs/slack_bolt/context/async_context.html b/docs/api-docs/slack_bolt/context/async_context.html index d38ac04f1..0a74c4ff1 100644 --- a/docs/api-docs/slack_bolt/context/async_context.html +++ b/docs/api-docs/slack_bolt/context/async_context.html @@ -507,6 +507,9 @@

    Inherited members

    • BaseContext:
        +
      • actor_enterprise_id
      • +
      • actor_team_id
      • +
      • actor_user_id
      • authorize_result
      • bot_id
      • bot_token
      • diff --git a/docs/api-docs/slack_bolt/context/base_context.html b/docs/api-docs/slack_bolt/context/base_context.html index fcf7bbb85..833a9e564 100644 --- a/docs/api-docs/slack_bolt/context/base_context.html +++ b/docs/api-docs/slack_bolt/context/base_context.html @@ -45,6 +45,9 @@

        Module slack_bolt.context.base_context

        "is_enterprise_install", "team_id", "user_id", + "actor_enterprise_id", + "actor_team_id", + "actor_user_id", "channel_id", "response_url", "matches", @@ -89,6 +92,30 @@

        Module slack_bolt.context.base_context

        """The user ID associated ith this request.""" return self.get("user_id") + @property + def actor_enterprise_id(self) -> Optional[str]: + """The action's actor's Enterprise Grid organization ID. + Note that this property is especially useful for handling events in Slack Connect channels. + That being said, it's not guaranteed to have a valid ID for all events due to server-side inconsistency. + """ + return self.get("actor_enterprise_id") + + @property + def actor_team_id(self) -> Optional[str]: + """The action's actor's workspace ID. + Note that this property is especially useful for handling events in Slack Connect channels. + That being said, it's not guaranteed to have a valid ID for all events due to server-side inconsistency. + """ + return self.get("actor_team_id") + + @property + def actor_user_id(self) -> Optional[str]: + """The action's actor's user ID. + Note that this property is especially useful for handling events in Slack Connect channels. + That being said, it's not guaranteed to have a valid ID for all events due to server-side inconsistency. + """ + return self.get("actor_user_id") + @property def channel_id(self) -> Optional[str]: """The conversation ID associated with this request.""" @@ -174,6 +201,9 @@

        Classes

        "is_enterprise_install", "team_id", "user_id", + "actor_enterprise_id", + "actor_team_id", + "actor_user_id", "channel_id", "response_url", "matches", @@ -218,6 +248,30 @@

        Classes

        """The user ID associated ith this request.""" return self.get("user_id") + @property + def actor_enterprise_id(self) -> Optional[str]: + """The action's actor's Enterprise Grid organization ID. + Note that this property is especially useful for handling events in Slack Connect channels. + That being said, it's not guaranteed to have a valid ID for all events due to server-side inconsistency. + """ + return self.get("actor_enterprise_id") + + @property + def actor_team_id(self) -> Optional[str]: + """The action's actor's workspace ID. + Note that this property is especially useful for handling events in Slack Connect channels. + That being said, it's not guaranteed to have a valid ID for all events due to server-side inconsistency. + """ + return self.get("actor_team_id") + + @property + def actor_user_id(self) -> Optional[str]: + """The action's actor's user ID. + Note that this property is especially useful for handling events in Slack Connect channels. + That being said, it's not guaranteed to have a valid ID for all events due to server-side inconsistency. + """ + return self.get("actor_user_id") + @property def channel_id(self) -> Optional[str]: """The conversation ID associated with this request.""" @@ -291,6 +345,60 @@

        Class variables

    Instance variables

    +
    var actor_enterprise_id : Optional[str]
    +
    +

    The action's actor's Enterprise Grid organization ID. +Note that this property is especially useful for handling events in Slack Connect channels. +That being said, it's not guaranteed to have a valid ID for all events due to server-side inconsistency.

    +
    + +Expand source code + +
    @property
    +def actor_enterprise_id(self) -> Optional[str]:
    +    """The action's actor's Enterprise Grid organization ID.
    +    Note that this property is especially useful for handling events in Slack Connect channels.
    +    That being said, it's not guaranteed to have a valid ID for all events due to server-side inconsistency.
    +    """
    +    return self.get("actor_enterprise_id")
    +
    +
    +
    var actor_team_id : Optional[str]
    +
    +

    The action's actor's workspace ID. +Note that this property is especially useful for handling events in Slack Connect channels. +That being said, it's not guaranteed to have a valid ID for all events due to server-side inconsistency.

    +
    + +Expand source code + +
    @property
    +def actor_team_id(self) -> Optional[str]:
    +    """The action's actor's workspace ID.
    +    Note that this property is especially useful for handling events in Slack Connect channels.
    +    That being said, it's not guaranteed to have a valid ID for all events due to server-side inconsistency.
    +    """
    +    return self.get("actor_team_id")
    +
    +
    +
    var actor_user_id : Optional[str]
    +
    +

    The action's actor's user ID. +Note that this property is especially useful for handling events in Slack Connect channels. +That being said, it's not guaranteed to have a valid ID for all events due to server-side inconsistency.

    +
    + +Expand source code + +
    @property
    +def actor_user_id(self) -> Optional[str]:
    +    """The action's actor's user ID.
    +    Note that this property is especially useful for handling events in Slack Connect channels.
    +    That being said, it's not guaranteed to have a valid ID for all events due to server-side inconsistency.
    +    """
    +    return self.get("actor_user_id")
    +
    +
    var authorize_result : Optional[AuthorizeResult]

    The authorize result resolved for this request.

    @@ -520,6 +628,9 @@

    Index

  • BaseContext

  • class App -(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, token_verification_enabled: bool = True, client: Optional[slack_sdk.web.client.WebClient] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, verification_token: Optional[str] = None, listener_executor: Optional[concurrent.futures._base.Executor] = None) +(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, token_verification_enabled: bool = True, client: Optional[slack_sdk.web.client.WebClient] = None, before_authorize: Union[Middleware, Callable[..., Any], ForwardRef(None)] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, verification_token: Optional[str] = None, listener_executor: Optional[concurrent.futures._base.Executor] = None)

    Bolt App that provides functionalities to register middleware/listeners.

    @@ -256,6 +256,8 @@

    Args

    Verifies the validity of the given token if True.
    client
    The singleton slack_sdk.WebClient instance for this app.
    +
    before_authorize
    +
    A global middleware that can be executed right before authorize function
    authorize
    The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data.
    @@ -314,6 +316,7 @@

    Args

    token_verification_enabled: bool = True, client: Optional[WebClient] = None, # for multi-workspace apps + before_authorize: Optional[Union[Middleware, Callable[..., Any]]] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[InstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility @@ -368,6 +371,7 @@

    Args

    token: The bot/user access token required only for single-workspace app. token_verification_enabled: Verifies the validity of the given token if True. client: The singleton `slack_sdk.WebClient` instance for this app. + before_authorize: A global middleware that can be executed right before authorize function authorize: The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data. installation_store: The module offering save/find operations of installation data @@ -428,6 +432,17 @@

    Args

    # Authorize & OAuthFlow initialization # -------------------------------------- + self._before_authorize: Optional[Middleware] = None + if before_authorize is not None: + if isinstance(before_authorize, Callable): + self._before_authorize = CustomMiddleware( + app_name=self._name, + func=before_authorize, + base_logger=self._framework_logger, + ) + elif isinstance(before_authorize, Middleware): + self._before_authorize = before_authorize + self._authorize: Optional[Authorize] = None if authorize is not None: if isinstance(authorize, Authorize): @@ -451,6 +466,7 @@

    Args

    logger=self._framework_logger, bot_only=installation_store_bot_only, client=self._client, # for proxy use cases etc. + user_token_resolution=(settings.user_token_resolution if settings is not None else "authed_user"), ) self._oauth_flow: Optional[OAuthFlow] = None @@ -569,6 +585,9 @@

    Args

    if request_verification_enabled is True: self._middleware_list.append(RequestVerification(self._signing_secret, base_logger=self._base_logger)) + if self._before_authorize is not None: + self._middleware_list.append(self._before_authorize) + # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._oauth_flow is None: if self._token is not None: @@ -592,7 +611,13 @@

    Args

    else: raise BoltError(error_token_required()) else: - self._middleware_list.append(MultiTeamsAuthorization(authorize=self._authorize, base_logger=self._base_logger)) + self._middleware_list.append( + MultiTeamsAuthorization( + authorize=self._authorize, + base_logger=self._base_logger, + user_token_resolution=self._oauth_flow.settings.user_token_resolution, + ) + ) if ignoring_self_events_enabled is True: self._middleware_list.append(IgnoringSelfEvents(base_logger=self._base_logger)) if url_verification_enabled is True: @@ -3483,6 +3508,9 @@

    Inherited members

    • BaseContext:
        +
      • actor_enterprise_id
      • +
      • actor_team_id
      • +
      • actor_user_id
      • authorize_result
      • bot_id
      • bot_token
      • diff --git a/docs/api-docs/slack_bolt/middleware/authorization/async_internals.html b/docs/api-docs/slack_bolt/middleware/authorization/async_internals.html index 1fd04b969..f7a7a6da5 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/async_internals.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/async_internals.html @@ -26,7 +26,8 @@

        Module slack_bolt.middleware.authorization.async_interna Expand source code -
        from slack_bolt.request.async_request import AsyncBoltRequest
        +
        from slack_bolt.middleware.authorization.internals import _build_error_text
        +from slack_bolt.request.async_request import AsyncBoltRequest
         from slack_bolt.response import BoltResponse
         
         
        @@ -46,7 +47,7 @@ 

        Module slack_bolt.middleware.authorization.async_interna # show an ephemeral message to the end-user return BoltResponse( status=200, - body=":x: Please install this app into the workspace :bow:", + body=_build_error_text(), )

        diff --git a/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html b/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html index 5340725ad..5ffd5d51a 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html @@ -35,23 +35,31 @@

        Module slack_bolt.middleware.authorization.async_multi_t from slack_bolt.response import BoltResponse from .async_authorization import AsyncAuthorization from .async_internals import _build_error_response, _is_no_auth_required -from .internals import _is_no_auth_test_call_required +from .internals import _is_no_auth_test_call_required, _build_error_text from ...authorization import AuthorizeResult from ...authorization.async_authorize import AsyncAuthorize class AsyncMultiTeamsAuthorization(AsyncAuthorization): authorize: AsyncAuthorize + user_token_resolution: str - def __init__(self, authorize: AsyncAuthorize, base_logger: Optional[Logger] = None): + def __init__( + self, + authorize: AsyncAuthorize, + base_logger: Optional[Logger] = None, + user_token_resolution: str = "authed_user", + ): """Multi-workspace authorization. Args: authorize: The function to authorize incoming requests from Slack. base_logger: The base logger + user_token_resolution: "authed_user" or "actor" """ self.authorize = authorize self.logger = get_bolt_logger(AsyncMultiTeamsAuthorization, base_logger=base_logger) + self.user_token_resolution = user_token_resolution async def async_process( self, @@ -77,12 +85,24 @@

        Module slack_bolt.middleware.authorization.async_multi_t return await next() try: - auth_result: Optional[AuthorizeResult] = await self.authorize( - context=req.context, - enterprise_id=req.context.enterprise_id, - team_id=req.context.team_id, - user_id=req.context.user_id, - ) + auth_result: Optional[AuthorizeResult] = None + if self.user_token_resolution == "actor": + auth_result = await self.authorize( + context=req.context, + enterprise_id=req.context.enterprise_id, + team_id=req.context.team_id, + user_id=req.context.user_id, + actor_enterprise_id=req.context.actor_enterprise_id, + actor_team_id=req.context.actor_team_id, + actor_user_id=req.context.actor_user_id, + ) + else: + auth_result = await self.authorize( + context=req.context, + enterprise_id=req.context.enterprise_id, + team_id=req.context.team_id, + user_id=req.context.user_id, + ) if auth_result: req.context.set_authorize_result(auth_result) token = auth_result.bot_token or auth_result.user_token @@ -99,6 +119,9 @@

        Module slack_bolt.middleware.authorization.async_multi_t "Although the app should be installed into this workspace, " "the AuthorizeResult (returned value from authorize) for it was not found." ) + if req.context.response_url is not None: + await req.context.respond(_build_error_text()) + return BoltResponse(status=200, body="") return _build_error_response() except SlackApiError as e: @@ -117,7 +140,7 @@

        Classes

        class AsyncMultiTeamsAuthorization -(authorize: AsyncAuthorize, base_logger: Optional[logging.Logger] = None) +(authorize: AsyncAuthorize, base_logger: Optional[logging.Logger] = None, user_token_resolution: str = 'authed_user')

        A middleware can process request data before other middleware and listener functions.

        @@ -128,6 +151,8 @@

        Args

        The function to authorize incoming requests from Slack.
        base_logger
        The base logger
        +
        user_token_resolution
        +
        "authed_user" or "actor"
        @@ -135,16 +160,24 @@

        Args

        class AsyncMultiTeamsAuthorization(AsyncAuthorization):
             authorize: AsyncAuthorize
        +    user_token_resolution: str
         
        -    def __init__(self, authorize: AsyncAuthorize, base_logger: Optional[Logger] = None):
        +    def __init__(
        +        self,
        +        authorize: AsyncAuthorize,
        +        base_logger: Optional[Logger] = None,
        +        user_token_resolution: str = "authed_user",
        +    ):
                 """Multi-workspace authorization.
         
                 Args:
                     authorize: The function to authorize incoming requests from Slack.
                     base_logger: The base logger
        +            user_token_resolution: "authed_user" or "actor"
                 """
                 self.authorize = authorize
                 self.logger = get_bolt_logger(AsyncMultiTeamsAuthorization, base_logger=base_logger)
        +        self.user_token_resolution = user_token_resolution
         
             async def async_process(
                 self,
        @@ -170,12 +203,24 @@ 

        Args

        return await next() try: - auth_result: Optional[AuthorizeResult] = await self.authorize( - context=req.context, - enterprise_id=req.context.enterprise_id, - team_id=req.context.team_id, - user_id=req.context.user_id, - ) + auth_result: Optional[AuthorizeResult] = None + if self.user_token_resolution == "actor": + auth_result = await self.authorize( + context=req.context, + enterprise_id=req.context.enterprise_id, + team_id=req.context.team_id, + user_id=req.context.user_id, + actor_enterprise_id=req.context.actor_enterprise_id, + actor_team_id=req.context.actor_team_id, + actor_user_id=req.context.actor_user_id, + ) + else: + auth_result = await self.authorize( + context=req.context, + enterprise_id=req.context.enterprise_id, + team_id=req.context.team_id, + user_id=req.context.user_id, + ) if auth_result: req.context.set_authorize_result(auth_result) token = auth_result.bot_token or auth_result.user_token @@ -192,6 +237,9 @@

        Args

        "Although the app should be installed into this workspace, " "the AuthorizeResult (returned value from authorize) for it was not found." ) + if req.context.response_url is not None: + await req.context.respond(_build_error_text()) + return BoltResponse(status=200, body="") return _build_error_response() except SlackApiError as e: @@ -210,6 +258,10 @@

        Class variables

        +
        var user_token_resolution : str
        +
        +
        +

    Inherited members

    diff --git a/docs/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html b/docs/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html index 487c348d0..8f3bcff67 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html @@ -36,7 +36,7 @@

    Module slack_bolt.middleware.authorization.async_single_ from slack_sdk.web.async_slack_response import AsyncSlackResponse from slack_sdk.errors import SlackApiError from .async_internals import _build_error_response, _is_no_auth_required -from .internals import _to_authorize_result, _is_no_auth_test_call_required +from .internals import _to_authorize_result, _is_no_auth_test_call_required, _build_error_text from ...authorization import AuthorizeResult @@ -85,6 +85,9 @@

    Module slack_bolt.middleware.authorization.async_single_ else: # Just in case self.logger.error("auth.test API call result is unexpectedly None") + if req.context.response_url is not None: + await req.context.respond(_build_error_text()) + return BoltResponse(status=200, body="") return _build_error_response() except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") @@ -156,6 +159,9 @@

    Classes

    else: # Just in case self.logger.error("auth.test API call result is unexpectedly None") + if req.context.response_url is not None: + await req.context.respond(_build_error_text()) + return BoltResponse(status=200, body="") return _build_error_response() except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") diff --git a/docs/api-docs/slack_bolt/middleware/authorization/index.html b/docs/api-docs/slack_bolt/middleware/authorization/index.html index 5504cfe7d..3a1f6e064 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/index.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/index.html @@ -115,7 +115,7 @@

    Inherited members

    class MultiTeamsAuthorization -(*, authorize: Authorize, base_logger: Optional[logging.Logger] = None) +(*, authorize: Authorize, base_logger: Optional[logging.Logger] = None, user_token_resolution: str = 'authed_user')

    A middleware can process request data before other middleware and listener functions.

    @@ -126,6 +126,8 @@

    Args

    The function to authorize incoming requests from Slack.
    base_logger
    The base logger
    +
    user_token_resolution
    +
    "authed_user" or "actor"
    @@ -133,21 +135,25 @@

    Args

    class MultiTeamsAuthorization(Authorization):
         authorize: Authorize
    +    user_token_resolution: str
     
         def __init__(
             self,
             *,
             authorize: Authorize,
             base_logger: Optional[Logger] = None,
    +        user_token_resolution: str = "authed_user",
         ):
             """Multi-workspace authorization.
     
             Args:
                 authorize: The function to authorize incoming requests from Slack.
                 base_logger: The base logger
    +            user_token_resolution: "authed_user" or "actor"
             """
             self.authorize = authorize
             self.logger = get_bolt_logger(MultiTeamsAuthorization, base_logger=base_logger)
    +        self.user_token_resolution = user_token_resolution
     
         def process(
             self,
    @@ -170,12 +176,24 @@ 

    Args

    return next() try: - auth_result: Optional[AuthorizeResult] = self.authorize( - context=req.context, - enterprise_id=req.context.enterprise_id, - team_id=req.context.team_id, - user_id=req.context.user_id, - ) + auth_result: Optional[AuthorizeResult] = None + if self.user_token_resolution == "actor": + auth_result = self.authorize( + context=req.context, + enterprise_id=req.context.enterprise_id, + team_id=req.context.team_id, + user_id=req.context.user_id, + actor_enterprise_id=req.context.actor_enterprise_id, + actor_team_id=req.context.actor_team_id, + actor_user_id=req.context.actor_user_id, + ) + else: + auth_result = self.authorize( + context=req.context, + enterprise_id=req.context.enterprise_id, + team_id=req.context.team_id, + user_id=req.context.user_id, + ) if auth_result is not None: req.context.set_authorize_result(auth_result) token = auth_result.bot_token or auth_result.user_token @@ -192,6 +210,9 @@

    Args

    "Although the app should be installed into this workspace, " "the AuthorizeResult (returned value from authorize) for it was not found." ) + if req.context.response_url is not None: + req.context.respond(_build_error_text()) + return BoltResponse(status=200, body="") return _build_error_response() except SlackApiError as e: @@ -209,6 +230,10 @@

    Class variables

    +
    var user_token_resolution : str
    +
    +
    +

    Inherited members

      @@ -293,6 +318,9 @@

      Args

      else: # Just in case self.logger.error("auth.test API call result is unexpectedly None") + if req.context.response_url is not None: + req.context.respond(_build_error_text()) + return BoltResponse(status=200, body="") return _build_error_response() except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") @@ -348,6 +376,7 @@

      MultiTeamsAuthorization

    • diff --git a/docs/api-docs/slack_bolt/middleware/authorization/internals.html b/docs/api-docs/slack_bolt/middleware/authorization/internals.html index 75aff361a..4cee299f3 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/internals.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/internals.html @@ -71,11 +71,18 @@

      Module slack_bolt.middleware.authorization.internalsModule slack_bolt.middleware.authorization.multi_teams_a _build_error_response, _is_no_auth_required, _is_no_auth_test_call_required, + _build_error_text, ) from ...authorization import AuthorizeResult from ...authorization.authorize import Authorize @@ -46,21 +47,25 @@

      Module slack_bolt.middleware.authorization.multi_teams_a class MultiTeamsAuthorization(Authorization): authorize: Authorize + user_token_resolution: str def __init__( self, *, authorize: Authorize, base_logger: Optional[Logger] = None, + user_token_resolution: str = "authed_user", ): """Multi-workspace authorization. Args: authorize: The function to authorize incoming requests from Slack. base_logger: The base logger + user_token_resolution: "authed_user" or "actor" """ self.authorize = authorize self.logger = get_bolt_logger(MultiTeamsAuthorization, base_logger=base_logger) + self.user_token_resolution = user_token_resolution def process( self, @@ -83,12 +88,24 @@

      Module slack_bolt.middleware.authorization.multi_teams_a return next() try: - auth_result: Optional[AuthorizeResult] = self.authorize( - context=req.context, - enterprise_id=req.context.enterprise_id, - team_id=req.context.team_id, - user_id=req.context.user_id, - ) + auth_result: Optional[AuthorizeResult] = None + if self.user_token_resolution == "actor": + auth_result = self.authorize( + context=req.context, + enterprise_id=req.context.enterprise_id, + team_id=req.context.team_id, + user_id=req.context.user_id, + actor_enterprise_id=req.context.actor_enterprise_id, + actor_team_id=req.context.actor_team_id, + actor_user_id=req.context.actor_user_id, + ) + else: + auth_result = self.authorize( + context=req.context, + enterprise_id=req.context.enterprise_id, + team_id=req.context.team_id, + user_id=req.context.user_id, + ) if auth_result is not None: req.context.set_authorize_result(auth_result) token = auth_result.bot_token or auth_result.user_token @@ -105,6 +122,9 @@

      Module slack_bolt.middleware.authorization.multi_teams_a "Although the app should be installed into this workspace, " "the AuthorizeResult (returned value from authorize) for it was not found." ) + if req.context.response_url is not None: + req.context.respond(_build_error_text()) + return BoltResponse(status=200, body="") return _build_error_response() except SlackApiError as e: @@ -123,7 +143,7 @@

      Classes

      class MultiTeamsAuthorization -(*, authorize: Authorize, base_logger: Optional[logging.Logger] = None) +(*, authorize: Authorize, base_logger: Optional[logging.Logger] = None, user_token_resolution: str = 'authed_user')

      A middleware can process request data before other middleware and listener functions.

      @@ -134,6 +154,8 @@

      Args

      The function to authorize incoming requests from Slack.
      base_logger
      The base logger
      +
      user_token_resolution
      +
      "authed_user" or "actor"
      @@ -141,21 +163,25 @@

      Args

      class MultiTeamsAuthorization(Authorization):
           authorize: Authorize
      +    user_token_resolution: str
       
           def __init__(
               self,
               *,
               authorize: Authorize,
               base_logger: Optional[Logger] = None,
      +        user_token_resolution: str = "authed_user",
           ):
               """Multi-workspace authorization.
       
               Args:
                   authorize: The function to authorize incoming requests from Slack.
                   base_logger: The base logger
      +            user_token_resolution: "authed_user" or "actor"
               """
               self.authorize = authorize
               self.logger = get_bolt_logger(MultiTeamsAuthorization, base_logger=base_logger)
      +        self.user_token_resolution = user_token_resolution
       
           def process(
               self,
      @@ -178,12 +204,24 @@ 

      Args

      return next() try: - auth_result: Optional[AuthorizeResult] = self.authorize( - context=req.context, - enterprise_id=req.context.enterprise_id, - team_id=req.context.team_id, - user_id=req.context.user_id, - ) + auth_result: Optional[AuthorizeResult] = None + if self.user_token_resolution == "actor": + auth_result = self.authorize( + context=req.context, + enterprise_id=req.context.enterprise_id, + team_id=req.context.team_id, + user_id=req.context.user_id, + actor_enterprise_id=req.context.actor_enterprise_id, + actor_team_id=req.context.actor_team_id, + actor_user_id=req.context.actor_user_id, + ) + else: + auth_result = self.authorize( + context=req.context, + enterprise_id=req.context.enterprise_id, + team_id=req.context.team_id, + user_id=req.context.user_id, + ) if auth_result is not None: req.context.set_authorize_result(auth_result) token = auth_result.bot_token or auth_result.user_token @@ -200,6 +238,9 @@

      Args

      "Although the app should be installed into this workspace, " "the AuthorizeResult (returned value from authorize) for it was not found." ) + if req.context.response_url is not None: + req.context.respond(_build_error_text()) + return BoltResponse(status=200, body="") return _build_error_response() except SlackApiError as e: @@ -217,6 +258,10 @@

      Class variables

      +
      var user_token_resolution : str
      +
      +
      +

      Inherited members

      diff --git a/docs/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html b/docs/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html index 3d48d602e..9d023b2d6 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html @@ -40,6 +40,7 @@

      Module slack_bolt.middleware.authorization.single_team_a _is_no_auth_required, _to_authorize_result, _is_no_auth_test_call_required, + _build_error_text, ) from ...authorization import AuthorizeResult @@ -99,6 +100,9 @@

      Module slack_bolt.middleware.authorization.single_team_a else: # Just in case self.logger.error("auth.test API call result is unexpectedly None") + if req.context.response_url is not None: + req.context.respond(_build_error_text()) + return BoltResponse(status=200, body="") return _build_error_response() except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") @@ -187,6 +191,9 @@

      Args

      else: # Just in case self.logger.error("auth.test API call result is unexpectedly None") + if req.context.response_url is not None: + req.context.respond(_build_error_text()) + return BoltResponse(status=200, body="") return _build_error_response() except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") diff --git a/docs/api-docs/slack_bolt/middleware/index.html b/docs/api-docs/slack_bolt/middleware/index.html index dfd0ba795..ed61cf1ba 100644 --- a/docs/api-docs/slack_bolt/middleware/index.html +++ b/docs/api-docs/slack_bolt/middleware/index.html @@ -463,7 +463,7 @@

      Returns

    class MultiTeamsAuthorization -(*, authorize: Authorize, base_logger: Optional[logging.Logger] = None) +(*, authorize: Authorize, base_logger: Optional[logging.Logger] = None, user_token_resolution: str = 'authed_user')

    A middleware can process request data before other middleware and listener functions.

    @@ -474,6 +474,8 @@

    Args

    The function to authorize incoming requests from Slack.
    base_logger
    The base logger
    +
    user_token_resolution
    +
    "authed_user" or "actor"
    @@ -481,21 +483,25 @@

    Args

    class MultiTeamsAuthorization(Authorization):
         authorize: Authorize
    +    user_token_resolution: str
     
         def __init__(
             self,
             *,
             authorize: Authorize,
             base_logger: Optional[Logger] = None,
    +        user_token_resolution: str = "authed_user",
         ):
             """Multi-workspace authorization.
     
             Args:
                 authorize: The function to authorize incoming requests from Slack.
                 base_logger: The base logger
    +            user_token_resolution: "authed_user" or "actor"
             """
             self.authorize = authorize
             self.logger = get_bolt_logger(MultiTeamsAuthorization, base_logger=base_logger)
    +        self.user_token_resolution = user_token_resolution
     
         def process(
             self,
    @@ -518,12 +524,24 @@ 

    Args

    return next() try: - auth_result: Optional[AuthorizeResult] = self.authorize( - context=req.context, - enterprise_id=req.context.enterprise_id, - team_id=req.context.team_id, - user_id=req.context.user_id, - ) + auth_result: Optional[AuthorizeResult] = None + if self.user_token_resolution == "actor": + auth_result = self.authorize( + context=req.context, + enterprise_id=req.context.enterprise_id, + team_id=req.context.team_id, + user_id=req.context.user_id, + actor_enterprise_id=req.context.actor_enterprise_id, + actor_team_id=req.context.actor_team_id, + actor_user_id=req.context.actor_user_id, + ) + else: + auth_result = self.authorize( + context=req.context, + enterprise_id=req.context.enterprise_id, + team_id=req.context.team_id, + user_id=req.context.user_id, + ) if auth_result is not None: req.context.set_authorize_result(auth_result) token = auth_result.bot_token or auth_result.user_token @@ -540,6 +558,9 @@

    Args

    "Although the app should be installed into this workspace, " "the AuthorizeResult (returned value from authorize) for it was not found." ) + if req.context.response_url is not None: + req.context.respond(_build_error_text()) + return BoltResponse(status=200, body="") return _build_error_response() except SlackApiError as e: @@ -557,6 +578,10 @@

    Class variables

    +
    var user_token_resolution : str
    +
    +
    +

    Inherited members

      @@ -730,6 +755,9 @@

      Args

      else: # Just in case self.logger.error("auth.test API call result is unexpectedly None") + if req.context.response_url is not None: + req.context.respond(_build_error_text()) + return BoltResponse(status=200, body="") return _build_error_response() except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") @@ -983,6 +1011,7 @@

      MultiTeamsAuthorization

    • diff --git a/docs/api-docs/slack_bolt/oauth/async_oauth_settings.html b/docs/api-docs/slack_bolt/oauth/async_oauth_settings.html index 063f3918e..94f521fdd 100644 --- a/docs/api-docs/slack_bolt/oauth/async_oauth_settings.html +++ b/docs/api-docs/slack_bolt/oauth/async_oauth_settings.html @@ -70,6 +70,7 @@

      Module slack_bolt.oauth.async_oauth_settings

      installation_store: AsyncInstallationStore installation_store_bot_only: bool token_rotation_expiration_minutes: int + user_token_resolution: str authorize: AsyncAuthorize # state parameter related configurations state_validation_enabled: bool @@ -104,6 +105,7 @@

      Module slack_bolt.oauth.async_oauth_settings

      installation_store: Optional[AsyncInstallationStore] = None, installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, + user_token_resolution: str = "authed_user", # state parameter related configurations state_validation_enabled: bool = True, state_store: Optional[AsyncOAuthStateStore] = None, @@ -130,6 +132,11 @@

      Module slack_bolt.oauth.async_oauth_settings

      installation_store: Specify the instance of `InstallationStore` (Default: `FileInstallationStore`) installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) token_rotation_expiration_minutes: Minutes before refreshing tokens (Default: 2 hours) + user_token_resolution: The option to pick up a user token per request (Default: authed_user) + The available values are "authed_user" and "actor". When you want to resolve the user token per request + using the event's actor IDs, you can set "actor" instead. With this option, bolt-python tries to resolve + a user token for context.actor_enterprise/team/user_id. This can be useful for events in Slack Connect + channels. Note that actor IDs can be absent in some scenarios. state_validation_enabled: Set False if your OAuth flow omits the state parameter validation (Default: True) state_store: Specify the instance of `InstallationStore` (Default: `FileOAuthStateStore`) state_cookie_name: The cookie name that is set for installers' browser. (Default: "slack-app-oauth-state") @@ -171,6 +178,7 @@

      Module slack_bolt.oauth.async_oauth_settings

      self.authorization_url = authorization_url or "https://slack.com/oauth/v2/authorize" # Installation Management self.installation_store = installation_store or get_or_create_default_installation_store(client_id) + self.user_token_resolution = user_token_resolution or "authed_user" self.installation_store_bot_only = installation_store_bot_only self.token_rotation_expiration_minutes = token_rotation_expiration_minutes self.authorize = AsyncInstallationStoreAuthorize( @@ -180,6 +188,7 @@

      Module slack_bolt.oauth.async_oauth_settings

      token_rotation_expiration_minutes=self.token_rotation_expiration_minutes, installation_store=self.installation_store, bot_only=self.installation_store_bot_only, + user_token_resolution=user_token_resolution, ) # state parameter related configurations self.state_validation_enabled = state_validation_enabled @@ -220,7 +229,7 @@

      Classes

      class AsyncOAuthSettings -(*, client_id: Optional[str] = None, client_secret: Optional[str] = None, scopes: Union[str, Sequence[str], ForwardRef(None)] = None, user_scopes: Union[str, Sequence[str], ForwardRef(None)] = None, redirect_uri: Optional[str] = None, install_path: str = '/slack/install', install_page_rendering_enabled: bool = True, redirect_uri_path: str = '/slack/oauth_redirect', callback_options: Optional[AsyncCallbackOptions] = None, success_url: Optional[str] = None, failure_url: Optional[str] = None, authorization_url: Optional[str] = None, installation_store: Optional[slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore] = None, installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, state_validation_enabled: bool = True, state_store: Optional[slack_sdk.oauth.state_store.async_state_store.AsyncOAuthStateStore] = None, state_cookie_name: str = 'slack-app-oauth-state', state_expiration_seconds: int = 600, logger: logging.Logger = <Logger slack_bolt.oauth.async_oauth_settings (WARNING)>) +(*, client_id: Optional[str] = None, client_secret: Optional[str] = None, scopes: Union[str, Sequence[str], ForwardRef(None)] = None, user_scopes: Union[str, Sequence[str], ForwardRef(None)] = None, redirect_uri: Optional[str] = None, install_path: str = '/slack/install', install_page_rendering_enabled: bool = True, redirect_uri_path: str = '/slack/oauth_redirect', callback_options: Optional[AsyncCallbackOptions] = None, success_url: Optional[str] = None, failure_url: Optional[str] = None, authorization_url: Optional[str] = None, installation_store: Optional[slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore] = None, installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, user_token_resolution: str = 'authed_user', state_validation_enabled: bool = True, state_store: Optional[slack_sdk.oauth.state_store.async_state_store.AsyncOAuthStateStore] = None, state_cookie_name: str = 'slack-app-oauth-state', state_expiration_seconds: int = 600, logger: logging.Logger = <Logger slack_bolt.oauth.async_oauth_settings (WARNING)>)

      The settings for Slack App installation (OAuth flow).

      @@ -256,6 +265,12 @@

      Args

      Use InstallationStore#find_bot() if True (Default: False)
      token_rotation_expiration_minutes
      Minutes before refreshing tokens (Default: 2 hours)
      +
      user_token_resolution
      +
      The option to pick up a user token per request (Default: authed_user) +The available values are "authed_user" and "actor". When you want to resolve the user token per request +using the event's actor IDs, you can set "actor" instead. With this option, bolt-python tries to resolve +a user token for context.actor_enterprise/team/user_id. This can be useful for events in Slack Connect +channels. Note that actor IDs can be absent in some scenarios.
      state_validation_enabled
      Set False if your OAuth flow omits the state parameter validation (Default: True)
      state_store
      @@ -290,6 +305,7 @@

      Args

      installation_store: AsyncInstallationStore installation_store_bot_only: bool token_rotation_expiration_minutes: int + user_token_resolution: str authorize: AsyncAuthorize # state parameter related configurations state_validation_enabled: bool @@ -324,6 +340,7 @@

      Args

      installation_store: Optional[AsyncInstallationStore] = None, installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, + user_token_resolution: str = "authed_user", # state parameter related configurations state_validation_enabled: bool = True, state_store: Optional[AsyncOAuthStateStore] = None, @@ -350,6 +367,11 @@

      Args

      installation_store: Specify the instance of `InstallationStore` (Default: `FileInstallationStore`) installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) token_rotation_expiration_minutes: Minutes before refreshing tokens (Default: 2 hours) + user_token_resolution: The option to pick up a user token per request (Default: authed_user) + The available values are "authed_user" and "actor". When you want to resolve the user token per request + using the event's actor IDs, you can set "actor" instead. With this option, bolt-python tries to resolve + a user token for context.actor_enterprise/team/user_id. This can be useful for events in Slack Connect + channels. Note that actor IDs can be absent in some scenarios. state_validation_enabled: Set False if your OAuth flow omits the state parameter validation (Default: True) state_store: Specify the instance of `InstallationStore` (Default: `FileOAuthStateStore`) state_cookie_name: The cookie name that is set for installers' browser. (Default: "slack-app-oauth-state") @@ -391,6 +413,7 @@

      Args

      self.authorization_url = authorization_url or "https://slack.com/oauth/v2/authorize" # Installation Management self.installation_store = installation_store or get_or_create_default_installation_store(client_id) + self.user_token_resolution = user_token_resolution or "authed_user" self.installation_store_bot_only = installation_store_bot_only self.token_rotation_expiration_minutes = token_rotation_expiration_minutes self.authorize = AsyncInstallationStoreAuthorize( @@ -400,6 +423,7 @@

      Args

      token_rotation_expiration_minutes=self.token_rotation_expiration_minutes, installation_store=self.installation_store, bot_only=self.installation_store_bot_only, + user_token_resolution=user_token_resolution, ) # state parameter related configurations self.state_validation_enabled = state_validation_enabled @@ -526,6 +550,10 @@

      Class variables

      +
      var user_token_resolution : str
      +
      +
      +
      @@ -571,6 +599,7 @@

      success_url

    • token_rotation_expiration_minutes
    • user_scopes
    • +
    • user_token_resolution
    diff --git a/docs/api-docs/slack_bolt/oauth/oauth_settings.html b/docs/api-docs/slack_bolt/oauth/oauth_settings.html index 7235e1767..683cef706 100644 --- a/docs/api-docs/slack_bolt/oauth/oauth_settings.html +++ b/docs/api-docs/slack_bolt/oauth/oauth_settings.html @@ -66,6 +66,7 @@

    Module slack_bolt.oauth.oauth_settings

    installation_store_bot_only: bool token_rotation_expiration_minutes: int authorize: Authorize + user_token_resolution: str # default: "authed_user" # state parameter related configurations state_validation_enabled: bool state_store: OAuthStateStore @@ -99,6 +100,7 @@

    Module slack_bolt.oauth.oauth_settings

    installation_store: Optional[InstallationStore] = None, installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, + user_token_resolution: str = "authed_user", # state parameter related configurations state_validation_enabled: bool = True, state_store: Optional[OAuthStateStore] = None, @@ -125,6 +127,11 @@

    Module slack_bolt.oauth.oauth_settings

    installation_store: Specify the instance of `InstallationStore` (Default: `FileInstallationStore`) installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) token_rotation_expiration_minutes: Minutes before refreshing tokens (Default: 2 hours) + user_token_resolution: The option to pick up a user token per request (Default: authed_user) + The available values are "authed_user" and "actor". When you want to resolve the user token per request + using the event's actor IDs, you can set "actor" instead. With this option, bolt-python tries to resolve + a user token for context.actor_enterprise/team/user_id. This can be useful for events in Slack Connect + channels. Note that actor IDs can be absent in some scenarios. state_validation_enabled: Set False if your OAuth flow omits the state parameter validation (Default: True) state_store: Specify the instance of `InstallationStore` (Default: `FileOAuthStateStore`) state_cookie_name: The cookie name that is set for installers' browser. (Default: "slack-app-oauth-state") @@ -164,6 +171,7 @@

    Module slack_bolt.oauth.oauth_settings

    self.authorization_url = authorization_url or "https://slack.com/oauth/v2/authorize" # Installation Management self.installation_store = installation_store or get_or_create_default_installation_store(client_id) + self.user_token_resolution = user_token_resolution or "authed_user" self.installation_store_bot_only = installation_store_bot_only self.token_rotation_expiration_minutes = token_rotation_expiration_minutes self.authorize = InstallationStoreAuthorize( @@ -173,6 +181,7 @@

    Module slack_bolt.oauth.oauth_settings

    token_rotation_expiration_minutes=self.token_rotation_expiration_minutes, installation_store=self.installation_store, bot_only=self.installation_store_bot_only, + user_token_resolution=user_token_resolution, ) # state parameter related configurations self.state_validation_enabled = state_validation_enabled @@ -213,7 +222,7 @@

    Classes

    class OAuthSettings -(*, client_id: Optional[str] = None, client_secret: Optional[str] = None, scopes: Union[str, Sequence[str], ForwardRef(None)] = None, user_scopes: Union[str, Sequence[str], ForwardRef(None)] = None, redirect_uri: Optional[str] = None, install_path: str = '/slack/install', install_page_rendering_enabled: bool = True, redirect_uri_path: str = '/slack/oauth_redirect', callback_options: Optional[CallbackOptions] = None, success_url: Optional[str] = None, failure_url: Optional[str] = None, authorization_url: Optional[str] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, state_validation_enabled: bool = True, state_store: Optional[slack_sdk.oauth.state_store.state_store.OAuthStateStore] = None, state_cookie_name: str = 'slack-app-oauth-state', state_expiration_seconds: int = 600, logger: logging.Logger = <Logger slack_bolt.oauth.oauth_settings (WARNING)>) +(*, client_id: Optional[str] = None, client_secret: Optional[str] = None, scopes: Union[str, Sequence[str], ForwardRef(None)] = None, user_scopes: Union[str, Sequence[str], ForwardRef(None)] = None, redirect_uri: Optional[str] = None, install_path: str = '/slack/install', install_page_rendering_enabled: bool = True, redirect_uri_path: str = '/slack/oauth_redirect', callback_options: Optional[CallbackOptions] = None, success_url: Optional[str] = None, failure_url: Optional[str] = None, authorization_url: Optional[str] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, user_token_resolution: str = 'authed_user', state_validation_enabled: bool = True, state_store: Optional[slack_sdk.oauth.state_store.state_store.OAuthStateStore] = None, state_cookie_name: str = 'slack-app-oauth-state', state_expiration_seconds: int = 600, logger: logging.Logger = <Logger slack_bolt.oauth.oauth_settings (WARNING)>)

    The settings for Slack App installation (OAuth flow).

    @@ -249,6 +258,12 @@

    Args

    Use InstallationStore#find_bot() if True (Default: False)
    token_rotation_expiration_minutes
    Minutes before refreshing tokens (Default: 2 hours)
    +
    user_token_resolution
    +
    The option to pick up a user token per request (Default: authed_user) +The available values are "authed_user" and "actor". When you want to resolve the user token per request +using the event's actor IDs, you can set "actor" instead. With this option, bolt-python tries to resolve +a user token for context.actor_enterprise/team/user_id. This can be useful for events in Slack Connect +channels. Note that actor IDs can be absent in some scenarios.
    state_validation_enabled
    Set False if your OAuth flow omits the state parameter validation (Default: True)
    state_store
    @@ -284,6 +299,7 @@

    Args

    installation_store_bot_only: bool token_rotation_expiration_minutes: int authorize: Authorize + user_token_resolution: str # default: "authed_user" # state parameter related configurations state_validation_enabled: bool state_store: OAuthStateStore @@ -317,6 +333,7 @@

    Args

    installation_store: Optional[InstallationStore] = None, installation_store_bot_only: bool = False, token_rotation_expiration_minutes: int = 120, + user_token_resolution: str = "authed_user", # state parameter related configurations state_validation_enabled: bool = True, state_store: Optional[OAuthStateStore] = None, @@ -343,6 +360,11 @@

    Args

    installation_store: Specify the instance of `InstallationStore` (Default: `FileInstallationStore`) installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) token_rotation_expiration_minutes: Minutes before refreshing tokens (Default: 2 hours) + user_token_resolution: The option to pick up a user token per request (Default: authed_user) + The available values are "authed_user" and "actor". When you want to resolve the user token per request + using the event's actor IDs, you can set "actor" instead. With this option, bolt-python tries to resolve + a user token for context.actor_enterprise/team/user_id. This can be useful for events in Slack Connect + channels. Note that actor IDs can be absent in some scenarios. state_validation_enabled: Set False if your OAuth flow omits the state parameter validation (Default: True) state_store: Specify the instance of `InstallationStore` (Default: `FileOAuthStateStore`) state_cookie_name: The cookie name that is set for installers' browser. (Default: "slack-app-oauth-state") @@ -382,6 +404,7 @@

    Args

    self.authorization_url = authorization_url or "https://slack.com/oauth/v2/authorize" # Installation Management self.installation_store = installation_store or get_or_create_default_installation_store(client_id) + self.user_token_resolution = user_token_resolution or "authed_user" self.installation_store_bot_only = installation_store_bot_only self.token_rotation_expiration_minutes = token_rotation_expiration_minutes self.authorize = InstallationStoreAuthorize( @@ -391,6 +414,7 @@

    Args

    token_rotation_expiration_minutes=self.token_rotation_expiration_minutes, installation_store=self.installation_store, bot_only=self.installation_store_bot_only, + user_token_resolution=user_token_resolution, ) # state parameter related configurations self.state_validation_enabled = state_validation_enabled @@ -517,6 +541,10 @@

    Class variables

    +
    var user_token_resolution : str
    +
    +
    +
    @@ -562,6 +590,7 @@

    success_url
  • token_rotation_expiration_minutes
  • user_scopes
  • +
  • user_token_resolution
  • diff --git a/docs/api-docs/slack_bolt/request/async_internals.html b/docs/api-docs/slack_bolt/request/async_internals.html index 0505fb696..b36d03677 100644 --- a/docs/api-docs/slack_bolt/request/async_internals.html +++ b/docs/api-docs/slack_bolt/request/async_internals.html @@ -36,6 +36,9 @@

    Module slack_bolt.request.async_internals

    extract_user_id, extract_channel_id, debug_multiple_response_urls_detected, + extract_actor_enterprise_id, + extract_actor_team_id, + extract_actor_user_id, ) @@ -53,6 +56,16 @@

    Module slack_bolt.request.async_internals

    user_id = extract_user_id(body) if user_id: context["user_id"] = user_id + # Actor IDs are useful for Events API on a Slack Connect channel + actor_enterprise_id = extract_actor_enterprise_id(body) + if actor_enterprise_id: + context["actor_enterprise_id"] = actor_enterprise_id + actor_team_id = extract_actor_team_id(body) + if actor_team_id: + context["actor_team_id"] = actor_team_id + actor_user_id = extract_actor_user_id(body) + if actor_user_id: + context["actor_user_id"] = actor_user_id channel_id = extract_channel_id(body) if channel_id: context["channel_id"] = channel_id @@ -99,6 +112,16 @@

    Functions

    user_id = extract_user_id(body) if user_id: context["user_id"] = user_id + # Actor IDs are useful for Events API on a Slack Connect channel + actor_enterprise_id = extract_actor_enterprise_id(body) + if actor_enterprise_id: + context["actor_enterprise_id"] = actor_enterprise_id + actor_team_id = extract_actor_team_id(body) + if actor_team_id: + context["actor_team_id"] = actor_team_id + actor_user_id = extract_actor_user_id(body) + if actor_user_id: + context["actor_user_id"] = actor_user_id channel_id = extract_channel_id(body) if channel_id: context["channel_id"] = channel_id diff --git a/docs/api-docs/slack_bolt/request/internals.html b/docs/api-docs/slack_bolt/request/internals.html index b9ab47c15..462365822 100644 --- a/docs/api-docs/slack_bolt/request/internals.html +++ b/docs/api-docs/slack_bolt/request/internals.html @@ -100,6 +100,20 @@

    Module slack_bolt.request.internals

    return None +def extract_actor_enterprise_id(payload: Dict[str, Any]) -> Optional[str]: + if payload.get("is_ext_shared_channel") is True: + if payload.get("type") == "event_callback": + # For safety, we don't set actor IDs for the events like "file_shared", + # which do not provide any team ID in $.event data. In the case, the IDs cannot be correct. + event_team_id = payload.get("event", {}).get("user_team") or payload.get("event", {}).get("team") + if event_team_id is not None and str(event_team_id).startswith("E"): + return event_team_id + if event_team_id == payload.get("team_id"): + return payload.get("enterprise_id") + return None + return extract_enterprise_id(payload) + + def extract_team_id(payload: Dict[str, Any]) -> Optional[str]: if payload.get("view", {}).get("app_installed_team_id") is not None: # view_submission payloads can have `view.app_installed_team_id` when a modal view that was opened @@ -130,6 +144,48 @@

    Module slack_bolt.request.internals

    return None +def extract_actor_team_id(payload: Dict[str, Any]) -> Optional[str]: + if payload.get("is_ext_shared_channel") is True: + if payload.get("type") == "event_callback": + event_type = payload.get("event", {}).get("type") + if event_type == "app_mention": + # The $.event.user_team can be an enterprise_id in app_mention events. + # In the scenario, there is no way to retrieve actor_team_id as of March 2023 + user_team = payload.get("event", {}).get("user_team") + if user_team is None: + # working with an app installed in this user's org/workspace side + return payload.get("event", {}).get("team") + if str(user_team).startswith("T"): + # interacting from a connected non-grid workspace + return user_team + # Interacting from a connected grid workspace; in this case, team_id cannot be resolved as of March 2023 + return None + # For safety, we don't set actor IDs for the events like "file_shared", + # which do not provide any team ID in $.event data. In the case, the IDs cannot be correct. + event_user_team = payload.get("event", {}).get("user_team") + if event_user_team is not None: + if str(event_user_team).startswith("T"): + return event_user_team + elif str(event_user_team).startswith("E"): + if event_user_team == payload.get("enterprise_id"): + return payload.get("team_id") + elif event_user_team == payload.get("context_enterprise_id"): + return payload.get("context_team_id") + + event_team = payload.get("event", {}).get("team") + if event_team is not None: + if str(event_team).startswith("T"): + return event_team + elif str(event_team).startswith("E"): + if event_team == payload.get("enterprise_id"): + return payload.get("team_id") + elif event_team == payload.get("context_enterprise_id"): + return payload.get("context_team_id") + return None + + return extract_team_id(payload) + + def extract_user_id(payload: Dict[str, Any]) -> Optional[str]: user = payload.get("user") if user is not None: @@ -150,6 +206,19 @@

    Module slack_bolt.request.internals

    return None +def extract_actor_user_id(payload: Dict[str, Any]) -> Optional[str]: + if payload.get("is_ext_shared_channel") is True: + if payload.get("type") == "event_callback": + event = payload.get("event") + if event is None: + return None + if extract_actor_enterprise_id(payload) is None and extract_actor_team_id(payload) is None: + # When both enterprise_id and team_id are not identified, we skip returning user_id too for safety + return None + return event.get("user") or event.get("user_id") + return extract_user_id(payload) + + def extract_channel_id(payload: Dict[str, Any]) -> Optional[str]: channel = payload.get("channel") if channel is not None: @@ -178,6 +247,16 @@

    Module slack_bolt.request.internals

    user_id = extract_user_id(body) if user_id: context["user_id"] = user_id + # Actor IDs are useful for Events API on a Slack Connect channel + actor_enterprise_id = extract_actor_enterprise_id(body) + if actor_enterprise_id: + context["actor_enterprise_id"] = actor_enterprise_id + actor_team_id = extract_actor_team_id(body) + if actor_team_id: + context["actor_team_id"] = actor_team_id + actor_user_id = extract_actor_user_id(body) + if actor_user_id: + context["actor_user_id"] = actor_user_id channel_id = extract_channel_id(body) if channel_id: context["channel_id"] = channel_id @@ -254,6 +333,16 @@

    Functions

    user_id = extract_user_id(body) if user_id: context["user_id"] = user_id + # Actor IDs are useful for Events API on a Slack Connect channel + actor_enterprise_id = extract_actor_enterprise_id(body) + if actor_enterprise_id: + context["actor_enterprise_id"] = actor_enterprise_id + actor_team_id = extract_actor_team_id(body) + if actor_team_id: + context["actor_team_id"] = actor_team_id + actor_user_id = extract_actor_user_id(body) + if actor_user_id: + context["actor_user_id"] = actor_user_id channel_id = extract_channel_id(body) if channel_id: context["channel_id"] = channel_id @@ -323,6 +412,102 @@

    Functions

    return "`body` must be a raw string data when running in the HTTP server mode"
    +
    +def extract_actor_enterprise_id(payload: Dict[str, Any]) ‑> Optional[str] +
    +
    +
    +
    + +Expand source code + +
    def extract_actor_enterprise_id(payload: Dict[str, Any]) -> Optional[str]:
    +    if payload.get("is_ext_shared_channel") is True:
    +        if payload.get("type") == "event_callback":
    +            # For safety, we don't set actor IDs for the events like "file_shared",
    +            # which do not provide any team ID in $.event data. In the case, the IDs cannot be correct.
    +            event_team_id = payload.get("event", {}).get("user_team") or payload.get("event", {}).get("team")
    +            if event_team_id is not None and str(event_team_id).startswith("E"):
    +                return event_team_id
    +            if event_team_id == payload.get("team_id"):
    +                return payload.get("enterprise_id")
    +            return None
    +    return extract_enterprise_id(payload)
    +
    +
    +
    +def extract_actor_team_id(payload: Dict[str, Any]) ‑> Optional[str] +
    +
    +
    +
    + +Expand source code + +
    def extract_actor_team_id(payload: Dict[str, Any]) -> Optional[str]:
    +    if payload.get("is_ext_shared_channel") is True:
    +        if payload.get("type") == "event_callback":
    +            event_type = payload.get("event", {}).get("type")
    +            if event_type == "app_mention":
    +                # The $.event.user_team can be an enterprise_id in app_mention events.
    +                # In the scenario, there is no way to retrieve actor_team_id as of March 2023
    +                user_team = payload.get("event", {}).get("user_team")
    +                if user_team is None:
    +                    # working with an app installed in this user's org/workspace side
    +                    return payload.get("event", {}).get("team")
    +                if str(user_team).startswith("T"):
    +                    # interacting from a connected non-grid workspace
    +                    return user_team
    +                # Interacting from a connected grid workspace; in this case, team_id cannot be resolved as of March 2023
    +                return None
    +            # For safety, we don't set actor IDs for the events like "file_shared",
    +            # which do not provide any team ID in $.event data. In the case, the IDs cannot be correct.
    +            event_user_team = payload.get("event", {}).get("user_team")
    +            if event_user_team is not None:
    +                if str(event_user_team).startswith("T"):
    +                    return event_user_team
    +                elif str(event_user_team).startswith("E"):
    +                    if event_user_team == payload.get("enterprise_id"):
    +                        return payload.get("team_id")
    +                    elif event_user_team == payload.get("context_enterprise_id"):
    +                        return payload.get("context_team_id")
    +
    +            event_team = payload.get("event", {}).get("team")
    +            if event_team is not None:
    +                if str(event_team).startswith("T"):
    +                    return event_team
    +                elif str(event_team).startswith("E"):
    +                    if event_team == payload.get("enterprise_id"):
    +                        return payload.get("team_id")
    +                    elif event_team == payload.get("context_enterprise_id"):
    +                        return payload.get("context_team_id")
    +            return None
    +
    +    return extract_team_id(payload)
    +
    +
    +
    +def extract_actor_user_id(payload: Dict[str, Any]) ‑> Optional[str] +
    +
    +
    +
    + +Expand source code + +
    def extract_actor_user_id(payload: Dict[str, Any]) -> Optional[str]:
    +    if payload.get("is_ext_shared_channel") is True:
    +        if payload.get("type") == "event_callback":
    +            event = payload.get("event")
    +            if event is None:
    +                return None
    +            if extract_actor_enterprise_id(payload) is None and extract_actor_team_id(payload) is None:
    +                # When both enterprise_id and team_id are not identified, we skip returning user_id too for safety
    +                return None
    +            return event.get("user") or event.get("user_id")
    +    return extract_user_id(payload)
    +
    +
    def extract_channel_id(payload: Dict[str, Any]) ‑> Optional[str]
    @@ -558,6 +743,9 @@

    Index

  • build_normalized_headers
  • debug_multiple_response_urls_detected
  • error_message_raw_body_required_in_http_mode
  • +
  • extract_actor_enterprise_id
  • +
  • extract_actor_team_id
  • +
  • extract_actor_user_id
  • extract_channel_id
  • extract_content_type
  • extract_enterprise_id
  • diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index e287e2ea6..b6ea4a21f 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.16.4"
    +__version__ = "1.17.0"
    diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 7376943ae..6b81098d6 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.17.0rc4" +__version__ = "1.17.0" From eae0d4e47b4dd8234cd555c2ee0c0bb92a0ef6bd Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Wed, 5 Apr 2023 12:49:42 -0400 Subject: [PATCH 433/719] Remove legacy tag (#875) --- docs/.markdownlint.yml | 198 ++++++++++++++++++++++++++++++++++++ docs/_includes/sidebar.html | 5 +- docs/_layouts/default.html | 5 +- 3 files changed, 204 insertions(+), 4 deletions(-) create mode 100644 docs/.markdownlint.yml diff --git a/docs/.markdownlint.yml b/docs/.markdownlint.yml new file mode 100644 index 000000000..4780b8f6b --- /dev/null +++ b/docs/.markdownlint.yml @@ -0,0 +1,198 @@ +# Default state for all rules +default: true + +# Path to configuration file to extend +extends: null + +# MD001/heading-increment/header-increment - Heading levels should only increment by one level at a time +MD001: false + +# MD002/first-heading-h1/first-header-h1 - First heading should be a top-level heading +MD002: + # Heading level + level: 1 + +# MD003/heading-style/header-style - Heading style +MD003: + # Heading style + style: "consistent" + +# MD004/ul-style - Unordered list style +MD004: + # List style + style: "consistent" + +# MD005/list-indent - Inconsistent indentation for list items at the same level +MD005: true + +# MD006/ul-start-left - Consider starting bulleted lists at the beginning of the line +MD006: true + +# MD007/ul-indent - Unordered list indentation +MD007: false + +# MD009/no-trailing-spaces - Trailing spaces +MD009: + # Spaces for line break + br_spaces: 2 + # Allow spaces for empty lines in list items + list_item_empty_lines: false + # Include unnecessary breaks + strict: false + +# MD010/no-hard-tabs - Hard tabs +MD010: + # Include code blocks + code_blocks: true + # Fenced code languages to ignore + ignore_code_languages: [] + # Number of spaces for each hard tab + spaces_per_tab: 1 + +# MD011/no-reversed-links - Reversed link syntax +MD011: true + +# MD012/no-multiple-blanks - Multiple consecutive blank lines +MD012: + # Consecutive blank lines + maximum: 1 + +# MD013/line-length - Line length +MD013: false + +# MD014/commands-show-output - Dollar signs used before commands without showing output +MD014: true + +# MD018/no-missing-space-atx - No space after hash on atx style heading +MD018: true + +# MD019/no-multiple-space-atx - Multiple spaces after hash on atx style heading +MD019: true + +# MD020/no-missing-space-closed-atx - No space inside hashes on closed atx style heading +MD020: true + +# MD021/no-multiple-space-closed-atx - Multiple spaces inside hashes on closed atx style heading +MD021: true + +# MD022/blanks-around-headings/blanks-around-headers - Headings should be surrounded by blank lines +MD022: false + +# MD023/heading-start-left/header-start-left - Headings must start at the beginning of the line +MD023: true + +# MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content +MD024: false + +# MD025/single-title/single-h1 - Multiple top-level headings in the same document +MD025: false + +# MD026/no-trailing-punctuation - Trailing punctuation in heading +MD026: + # Punctuation characters + punctuation: ".,;:!。,;:!" + +# MD027/no-multiple-space-blockquote - Multiple spaces after blockquote symbol +MD027: true + +# MD028/no-blanks-blockquote - Blank line inside blockquote +MD028: true + +# MD029/ol-prefix - Ordered list item prefix +MD029: false + +# MD030/list-marker-space - Spaces after list markers +MD030: false + +# MD031/blanks-around-fences - Fenced code blocks should be surrounded by blank lines +MD031: + # Include list items + list_items: true + +# MD032/blanks-around-lists - Lists should be surrounded by blank lines +MD032: true + +# MD033/no-inline-html - Inline HTML +MD033: false + +# MD034/no-bare-urls - Bare URL used +MD034: true + +# MD035/hr-style - Horizontal rule style +MD035: + # Horizontal rule style + style: "consistent" + +# MD036/no-emphasis-as-heading/no-emphasis-as-header - Emphasis used instead of a heading +MD036: false + # Punctuation characters + # punctuation: ".,;:!?。,;:!?" + +# MD037/no-space-in-emphasis - Spaces inside emphasis markers +MD037: true + +# MD038/no-space-in-code - Spaces inside code span elements +MD038: true + +# MD039/no-space-in-links - Spaces inside link text +MD039: true + +# MD040/fenced-code-language - Fenced code blocks should have a language specified +MD040: false + +# MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading +MD041: + # Heading level + level: 1 + # RegExp for matching title in front matter + front_matter_title: "^\\s*title\\s*[:=]" + +# MD042/no-empty-links - No empty links +MD042: true + +# MD043/required-headings/required-headers - Required heading structure +MD043: false + +# MD044/proper-names - Proper names should have the correct capitalization +MD044: + # List of proper names + names: [] + # Include code blocks + code_blocks: true + # Include HTML elements + html_elements: true + +# MD045/no-alt-text - Images should have alternate text (alt text) +MD045: true + +# MD046/code-block-style - Code block style +MD046: + # Block style + style: "consistent" + +# MD047/single-trailing-newline - Files should end with a single newline character +MD047: true + +# MD048/code-fence-style - Code fence style +MD048: + # Code fence style + style: "consistent" + +# MD049/emphasis-style - Emphasis style should be consistent +MD049: + # Emphasis style should be consistent + style: "consistent" + +# MD050/strong-style - Strong style should be consistent +MD050: + # Strong style should be consistent + style: "consistent" + +# MD051/link-fragments - Link fragments should be valid +MD051: false + +# MD052/reference-links-images - Reference links and images should use a label that is defined +MD052: true + +# MD053/link-image-reference-definitions - Link and image reference definitions should be needed +MD053: true diff --git a/docs/_includes/sidebar.html b/docs/_includes/sidebar.html index 3a8d7f30a..5e9fa141d 100644 --- a/docs/_includes/sidebar.html +++ b/docs/_includes/sidebar.html @@ -80,7 +80,8 @@ - \ No newline at end of file + diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html index 913e47a61..3d9e34c8f 100644 --- a/docs/_layouts/default.html +++ b/docs/_layouts/default.html @@ -49,7 +49,8 @@

    {{ section.title }}

    workflow_steps %}

    - {{ section.title }} {{ site.t[page.lang].legacy }} + {{ section.title }} +

    {{ section.content | markdownify }}
    @@ -61,4 +62,4 @@

    {% include analytics.html %} - \ No newline at end of file + From 7b4b082b896ba222ed9b8d208be3d841f4727f75 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 13 Apr 2023 12:30:18 +0900 Subject: [PATCH 434/719] Improve the default OAuth page renderers not to embed any params without escaping them (#882) --- setup.py | 2 +- slack_bolt/oauth/internals.py | 12 ++++----- .../adapter_tests_async/test_async_falcon.py | 2 +- .../adapter_tests_async/test_async_fastapi.py | 2 +- tests/adapter_tests_async/test_async_sanic.py | 2 +- .../test_async_starlette.py | 2 +- tests/slack_bolt/oauth/test_internals.py | 25 ++++++++++++++++++- 7 files changed, 35 insertions(+), 12 deletions(-) diff --git a/setup.py b/setup.py index 107c0e0e6..470188554 100755 --- a/setup.py +++ b/setup.py @@ -58,7 +58,7 @@ ), include_package_data=True, # MANIFEST.in install_requires=[ - "slack_sdk>=3.20.2,<4", + "slack_sdk>=3.21.1,<4", ], setup_requires=["pytest-runner==5.2"], tests_require=async_test_dependencies, diff --git a/slack_bolt/oauth/internals.py b/slack_bolt/oauth/internals.py index 801b6e63d..efd9dc58b 100644 --- a/slack_bolt/oauth/internals.py +++ b/slack_bolt/oauth/internals.py @@ -1,3 +1,4 @@ +import html from logging import Logger from typing import Optional from typing import Union @@ -32,7 +33,7 @@ def _build_callback_success_response( # type: ignore debug_message = f"Handling an OAuth callback success (request: {request.query})" self._logger.debug(debug_message) - html = self._redirect_uri_page_renderer.render_success_page( + page_content = self._redirect_uri_page_renderer.render_success_page( app_id=installation.app_id, team_id=installation.team_id, is_enterprise_install=installation.is_enterprise_install, @@ -44,7 +45,7 @@ def _build_callback_success_response( # type: ignore "Content-Type": "text/html; charset=utf-8", "Set-Cookie": self._state_utils.build_set_cookie_for_deletion(), }, - body=html, + body=page_content, ) def _build_callback_failure_response( # type: ignore @@ -60,14 +61,13 @@ def _build_callback_failure_response( # type: ignore # Adding a bit more details to the error code to help installers understand what's happening. # This modification in the HTML page works only when developers use this built-in failure handler. detailed_error = build_detailed_error(reason) - html = self._redirect_uri_page_renderer.render_failure_page(detailed_error) return BoltResponse( status=status, headers={ "Content-Type": "text/html; charset=utf-8", "Set-Cookie": self._state_utils.build_set_cookie_for_deletion(), }, - body=html, + body=self._redirect_uri_page_renderer.render_failure_page(detailed_error), ) @@ -85,7 +85,7 @@ def _build_default_install_page_html(url: str) -> str:

    Slack App Installation

    -

    +

    """ # noqa: E501 @@ -142,4 +142,4 @@ def build_detailed_error(reason: str) -> str: elif reason == "storage_error": return f"{reason}: The app's server encountered an issue. Contact the app developer." else: - return f"{reason}: This error code is returned from Slack. Refer to the documents for details." + return f"{html.escape(reason)}: This error code is returned from Slack. Refer to the documents for details." diff --git a/tests/adapter_tests_async/test_async_falcon.py b/tests/adapter_tests_async/test_async_falcon.py index 559d83a31..ada39307a 100644 --- a/tests/adapter_tests_async/test_async_falcon.py +++ b/tests/adapter_tests_async/test_async_falcon.py @@ -201,5 +201,5 @@ def test_oauth(self): response = client.simulate_get("/slack/install") assert response.status_code == 200 assert response.headers.get("content-type") == "text/html; charset=utf-8" - assert response.headers.get("content-length") == "597" + assert response.headers.get("content-length") == "609" assert "https://slack.com/oauth/v2/authorize?state=" in response.text diff --git a/tests/adapter_tests_async/test_async_fastapi.py b/tests/adapter_tests_async/test_async_fastapi.py index 21fa77508..e3d92e1b9 100644 --- a/tests/adapter_tests_async/test_async_fastapi.py +++ b/tests/adapter_tests_async/test_async_fastapi.py @@ -209,7 +209,7 @@ async def endpoint(req: Request): response = client.get("/slack/install", allow_redirects=False) assert response.status_code == 200 assert response.headers.get("content-type") == "text/html; charset=utf-8" - assert response.headers.get("content-length") == "597" + assert response.headers.get("content-length") == "609" assert "https://slack.com/oauth/v2/authorize?state=" in response.text def test_custom_props(self): diff --git a/tests/adapter_tests_async/test_async_sanic.py b/tests/adapter_tests_async/test_async_sanic.py index 2100bac01..b4a75431f 100644 --- a/tests/adapter_tests_async/test_async_sanic.py +++ b/tests/adapter_tests_async/test_async_sanic.py @@ -221,6 +221,6 @@ async def endpoint(req: Request): # NOTE: Although sanic-testing 0.6 does not have this value, # Sanic apps properly generate the content-length header - # assert response.headers.get("content-length") == "597" + # assert response.headers.get("content-length") == "609" assert "https://slack.com/oauth/v2/authorize?state=" in response.text diff --git a/tests/adapter_tests_async/test_async_starlette.py b/tests/adapter_tests_async/test_async_starlette.py index 9227ba690..d233dd8bb 100644 --- a/tests/adapter_tests_async/test_async_starlette.py +++ b/tests/adapter_tests_async/test_async_starlette.py @@ -219,5 +219,5 @@ async def endpoint(req: Request): response = client.get("/slack/install", allow_redirects=False) assert response.status_code == 200 assert response.headers.get("content-type") == "text/html; charset=utf-8" - assert response.headers.get("content-length") == "597" + assert response.headers.get("content-length") == "609" assert "https://slack.com/oauth/v2/authorize?state=" in response.text diff --git a/tests/slack_bolt/oauth/test_internals.py b/tests/slack_bolt/oauth/test_internals.py index 6abdceb47..88a62e17d 100644 --- a/tests/slack_bolt/oauth/test_internals.py +++ b/tests/slack_bolt/oauth/test_internals.py @@ -1,4 +1,4 @@ -from slack_bolt.oauth.internals import build_detailed_error +from slack_bolt.oauth.internals import build_detailed_error, _build_default_install_page_html class TestOAuthInternals: @@ -23,3 +23,26 @@ def test_build_detailed_error_others(self): assert result.startswith( "access_denied: This error code is returned from Slack. Refer to the documents for details." ) + + def test_build_detailed_error_others_with_tags(self): + result = build_detailed_error("test") + assert result.startswith( + "<b>test</b>: This error code is returned from Slack. Refer to the documents for details." + ) + + def test_build_default_install_page_html(self): + test_patterns = [ + { + "input": "https://slack.com/oauth/v2/authorize?state=random&client_id=111.222&scope=commands", + "expected": "https://slack.com/oauth/v2/authorize?state=random&client_id=111.222&scope=commands", + }, + { + "input": "test", + "expected": "<b>test</b>", + }, + ] + for pattern in test_patterns: + url = pattern["input"] + result = _build_default_install_page_html(url) + assert url not in result + assert pattern["expected"] in result From f8c1b86a81690eb5b12cca40339102d23de1f7de Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 13 Apr 2023 12:43:26 +0900 Subject: [PATCH 435/719] version 1.17.1 --- docs/api-docs/slack_bolt/oauth/internals.html | 23 +++++++++---------- docs/api-docs/slack_bolt/version.html | 2 +- slack_bolt/version.py | 2 +- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/docs/api-docs/slack_bolt/oauth/internals.html b/docs/api-docs/slack_bolt/oauth/internals.html index 2a64ea8d4..5d0efb4b7 100644 --- a/docs/api-docs/slack_bolt/oauth/internals.html +++ b/docs/api-docs/slack_bolt/oauth/internals.html @@ -26,7 +26,8 @@

    Module slack_bolt.oauth.internals

    Expand source code -
    from logging import Logger
    +
    import html
    +from logging import Logger
     from typing import Optional
     from typing import Union
     
    @@ -60,7 +61,7 @@ 

    Module slack_bolt.oauth.internals

    debug_message = f"Handling an OAuth callback success (request: {request.query})" self._logger.debug(debug_message) - html = self._redirect_uri_page_renderer.render_success_page( + page_content = self._redirect_uri_page_renderer.render_success_page( app_id=installation.app_id, team_id=installation.team_id, is_enterprise_install=installation.is_enterprise_install, @@ -72,7 +73,7 @@

    Module slack_bolt.oauth.internals

    "Content-Type": "text/html; charset=utf-8", "Set-Cookie": self._state_utils.build_set_cookie_for_deletion(), }, - body=html, + body=page_content, ) def _build_callback_failure_response( # type: ignore @@ -88,14 +89,13 @@

    Module slack_bolt.oauth.internals

    # Adding a bit more details to the error code to help installers understand what's happening. # This modification in the HTML page works only when developers use this built-in failure handler. detailed_error = build_detailed_error(reason) - html = self._redirect_uri_page_renderer.render_failure_page(detailed_error) return BoltResponse( status=status, headers={ "Content-Type": "text/html; charset=utf-8", "Set-Cookie": self._state_utils.build_set_cookie_for_deletion(), }, - body=html, + body=self._redirect_uri_page_renderer.render_failure_page(detailed_error), ) @@ -113,7 +113,7 @@

    Module slack_bolt.oauth.internals

    </head> <body> <h2>Slack App Installation</h2> -<p><a href="{url}"><img alt=""Add to Slack"" height="40" width="139" src="https://platform.slack-edge.com/img/add_to_slack.png" srcset="https://platform.slack-edge.com/img/add_to_slack.png 1x, https://platform.slack-edge.com/img/add_to_slack@2x.png 2x" /></a></p> +<p><a href="{html.escape(url)}"><img alt=""Add to Slack"" height="40" width="139" src="https://platform.slack-edge.com/img/add_to_slack.png" srcset="https://platform.slack-edge.com/img/add_to_slack.png 1x, https://platform.slack-edge.com/img/add_to_slack@2x.png 2x" /></a></p> </body> </html> """ # noqa: E501 @@ -170,7 +170,7 @@

    Module slack_bolt.oauth.internals

    elif reason == "storage_error": return f"{reason}: The app's server encountered an issue. Contact the app developer." else: - return f"{reason}: This error code is returned from Slack. Refer to the documents for details."
    + return f"{html.escape(reason)}: This error code is returned from Slack. Refer to the documents for details."

    @@ -203,7 +203,7 @@

    Functions

    elif reason == "storage_error": return f"{reason}: The app's server encountered an issue. Contact the app developer." else: - return f"{reason}: This error code is returned from Slack. Refer to the documents for details."
    + return f"{html.escape(reason)}: This error code is returned from Slack. Refer to the documents for details."
    @@ -292,7 +292,7 @@

    Classes

    debug_message = f"Handling an OAuth callback success (request: {request.query})" self._logger.debug(debug_message) - html = self._redirect_uri_page_renderer.render_success_page( + page_content = self._redirect_uri_page_renderer.render_success_page( app_id=installation.app_id, team_id=installation.team_id, is_enterprise_install=installation.is_enterprise_install, @@ -304,7 +304,7 @@

    Classes

    "Content-Type": "text/html; charset=utf-8", "Set-Cookie": self._state_utils.build_set_cookie_for_deletion(), }, - body=html, + body=page_content, ) def _build_callback_failure_response( # type: ignore @@ -320,14 +320,13 @@

    Classes

    # Adding a bit more details to the error code to help installers understand what's happening. # This modification in the HTML page works only when developers use this built-in failure handler. detailed_error = build_detailed_error(reason) - html = self._redirect_uri_page_renderer.render_failure_page(detailed_error) return BoltResponse( status=status, headers={ "Content-Type": "text/html; charset=utf-8", "Set-Cookie": self._state_utils.build_set_cookie_for_deletion(), }, - body=html, + body=self._redirect_uri_page_renderer.render_failure_page(detailed_error), )
    diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index b6ea4a21f..a55652360 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.17.0"
    +__version__ = "1.17.1"
    diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 6b81098d6..02de47405 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.17.0" +__version__ = "1.17.1" From 7bf508f13b59bd2681d5087f3f581038cd5b7966 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 18 Apr 2023 15:10:38 +0900 Subject: [PATCH 436/719] Improve the default handler when raise_error_for_unhandled_request is true (#885) --- slack_bolt/app/app.py | 30 ++++++++++++++++----------- slack_bolt/app/async_app.py | 30 ++++++++++++++++----------- slack_bolt/error/__init__.py | 3 +++ tests/slack_bolt/error/__init__.py | 0 tests/slack_bolt/error/test_errors.py | 19 +++++++++++++++++ 5 files changed, 58 insertions(+), 24 deletions(-) create mode 100644 tests/slack_bolt/error/__init__.py create mode 100644 tests/slack_bolt/error/test_errors.py diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index e79cac07c..d01163636 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -511,15 +511,18 @@ def middleware_next(): # This should not be an intentional handling in usual use cases. resp = BoltResponse(status=404, body={"error": "no next() calls in middleware"}) if self._raise_error_for_unhandled_request is True: - self._listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, last_global_middleware_name=middleware.name, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + self._listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp self._framework_logger.warning(warning_unhandled_by_global_middleware(middleware.name, req)) return resp @@ -562,14 +565,17 @@ def middleware_next(): if resp is None: resp = BoltResponse(status=404, body={"error": "unhandled request"}) if self._raise_error_for_unhandled_request is True: - self._listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + self._listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp return self._handle_unmatched_requests(req, resp) except Exception as error: diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 8e76bf4b6..7dca75b34 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -535,15 +535,18 @@ async def async_middleware_next(): # This should not be an intentional handling in usual use cases. resp = BoltResponse(status=404, body={"error": "no next() calls in middleware"}) if self._raise_error_for_unhandled_request is True: - await self._async_listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, last_global_middleware_name=middleware.name, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + await self._async_listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp self._framework_logger.warning(warning_unhandled_by_global_middleware(middleware.name, req)) return resp @@ -589,14 +592,17 @@ async def async_middleware_next(): if resp is None: resp = BoltResponse(status=404, body={"error": "unhandled request"}) if self._raise_error_for_unhandled_request is True: - await self._async_listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + await self._async_listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp return self._handle_unmatched_requests(req, resp) diff --git a/slack_bolt/error/__init__.py b/slack_bolt/error/__init__.py index 0e03032b1..d881fb188 100644 --- a/slack_bolt/error/__init__.py +++ b/slack_bolt/error/__init__.py @@ -23,3 +23,6 @@ def __init__( # type: ignore self.body = request.body if request is not None else {} self.current_response = current_response self.last_global_middleware_name = last_global_middleware_name + + def __str__(self) -> str: + return "unhandled request error" diff --git a/tests/slack_bolt/error/__init__.py b/tests/slack_bolt/error/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/slack_bolt/error/test_errors.py b/tests/slack_bolt/error/test_errors.py new file mode 100644 index 000000000..42a143d7c --- /dev/null +++ b/tests/slack_bolt/error/test_errors.py @@ -0,0 +1,19 @@ +from slack_bolt import BoltRequest +from slack_bolt.error import BoltUnhandledRequestError + + +class TestErrors: + def setup_method(self): + pass + + def teardown_method(self): + pass + + def test_say(self): + request = BoltRequest(body="foo=bar") + exception = BoltUnhandledRequestError( + request=request, + current_response={}, + last_global_middleware_name="last_middleware", + ) + assert str(exception) == "unhandled request error" From 076efb5b0b6db849b074752cec0d406d3c747627 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 18 Apr 2023 15:22:31 +0900 Subject: [PATCH 437/719] version 1.17.2 --- docs/api-docs/slack_bolt/app/app.html | 90 ++++++++++++--------- docs/api-docs/slack_bolt/app/async_app.html | 90 ++++++++++++--------- docs/api-docs/slack_bolt/app/index.html | 60 ++++++++------ docs/api-docs/slack_bolt/async_app.html | 60 ++++++++------ docs/api-docs/slack_bolt/error/index.html | 10 ++- docs/api-docs/slack_bolt/index.html | 60 ++++++++------ docs/api-docs/slack_bolt/version.html | 2 +- setup.py | 2 +- slack_bolt/version.py | 2 +- 9 files changed, 227 insertions(+), 149 deletions(-) diff --git a/docs/api-docs/slack_bolt/app/app.html b/docs/api-docs/slack_bolt/app/app.html index 9490358d6..3e01431fc 100644 --- a/docs/api-docs/slack_bolt/app/app.html +++ b/docs/api-docs/slack_bolt/app/app.html @@ -539,15 +539,18 @@

    Module slack_bolt.app.app

    # This should not be an intentional handling in usual use cases. resp = BoltResponse(status=404, body={"error": "no next() calls in middleware"}) if self._raise_error_for_unhandled_request is True: - self._listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, last_global_middleware_name=middleware.name, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + self._listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp self._framework_logger.warning(warning_unhandled_by_global_middleware(middleware.name, req)) return resp @@ -590,14 +593,17 @@

    Module slack_bolt.app.app

    if resp is None: resp = BoltResponse(status=404, body={"error": "unhandled request"}) if self._raise_error_for_unhandled_request is True: - self._listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + self._listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp return self._handle_unmatched_requests(req, resp) except Exception as error: @@ -1995,15 +2001,18 @@

    Args

    # This should not be an intentional handling in usual use cases. resp = BoltResponse(status=404, body={"error": "no next() calls in middleware"}) if self._raise_error_for_unhandled_request is True: - self._listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, last_global_middleware_name=middleware.name, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + self._listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp self._framework_logger.warning(warning_unhandled_by_global_middleware(middleware.name, req)) return resp @@ -2046,14 +2055,17 @@

    Args

    if resp is None: resp = BoltResponse(status=404, body={"error": "unhandled request"}) if self._raise_error_for_unhandled_request is True: - self._listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + self._listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp return self._handle_unmatched_requests(req, resp) except Exception as error: @@ -3274,15 +3286,18 @@

    Returns

    # This should not be an intentional handling in usual use cases. resp = BoltResponse(status=404, body={"error": "no next() calls in middleware"}) if self._raise_error_for_unhandled_request is True: - self._listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, last_global_middleware_name=middleware.name, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + self._listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp self._framework_logger.warning(warning_unhandled_by_global_middleware(middleware.name, req)) return resp @@ -3325,14 +3340,17 @@

    Returns

    if resp is None: resp = BoltResponse(status=404, body={"error": "unhandled request"}) if self._raise_error_for_unhandled_request is True: - self._listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + self._listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp return self._handle_unmatched_requests(req, resp) except Exception as error: diff --git a/docs/api-docs/slack_bolt/app/async_app.html b/docs/api-docs/slack_bolt/app/async_app.html index f373a32e6..ecb30728e 100644 --- a/docs/api-docs/slack_bolt/app/async_app.html +++ b/docs/api-docs/slack_bolt/app/async_app.html @@ -563,15 +563,18 @@

    Module slack_bolt.app.async_app

    # This should not be an intentional handling in usual use cases. resp = BoltResponse(status=404, body={"error": "no next() calls in middleware"}) if self._raise_error_for_unhandled_request is True: - await self._async_listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, last_global_middleware_name=middleware.name, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + await self._async_listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp self._framework_logger.warning(warning_unhandled_by_global_middleware(middleware.name, req)) return resp @@ -617,14 +620,17 @@

    Module slack_bolt.app.async_app

    if resp is None: resp = BoltResponse(status=404, body={"error": "unhandled request"}) if self._raise_error_for_unhandled_request is True: - await self._async_listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + await self._async_listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp return self._handle_unmatched_requests(req, resp) @@ -1915,15 +1921,18 @@

    Args

    # This should not be an intentional handling in usual use cases. resp = BoltResponse(status=404, body={"error": "no next() calls in middleware"}) if self._raise_error_for_unhandled_request is True: - await self._async_listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, last_global_middleware_name=middleware.name, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + await self._async_listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp self._framework_logger.warning(warning_unhandled_by_global_middleware(middleware.name, req)) return resp @@ -1969,14 +1978,17 @@

    Args

    if resp is None: resp = BoltResponse(status=404, body={"error": "unhandled request"}) if self._raise_error_for_unhandled_request is True: - await self._async_listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + await self._async_listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp return self._handle_unmatched_requests(req, resp) @@ -2952,15 +2964,18 @@

    Returns

    # This should not be an intentional handling in usual use cases. resp = BoltResponse(status=404, body={"error": "no next() calls in middleware"}) if self._raise_error_for_unhandled_request is True: - await self._async_listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, last_global_middleware_name=middleware.name, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + await self._async_listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp self._framework_logger.warning(warning_unhandled_by_global_middleware(middleware.name, req)) return resp @@ -3006,14 +3021,17 @@

    Returns

    if resp is None: resp = BoltResponse(status=404, body={"error": "unhandled request"}) if self._raise_error_for_unhandled_request is True: - await self._async_listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + await self._async_listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp return self._handle_unmatched_requests(req, resp) diff --git a/docs/api-docs/slack_bolt/app/index.html b/docs/api-docs/slack_bolt/app/index.html index 4175c54ac..6604ab567 100644 --- a/docs/api-docs/slack_bolt/app/index.html +++ b/docs/api-docs/slack_bolt/app/index.html @@ -588,15 +588,18 @@

    Args

    # This should not be an intentional handling in usual use cases. resp = BoltResponse(status=404, body={"error": "no next() calls in middleware"}) if self._raise_error_for_unhandled_request is True: - self._listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, last_global_middleware_name=middleware.name, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + self._listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp self._framework_logger.warning(warning_unhandled_by_global_middleware(middleware.name, req)) return resp @@ -639,14 +642,17 @@

    Args

    if resp is None: resp = BoltResponse(status=404, body={"error": "unhandled request"}) if self._raise_error_for_unhandled_request is True: - self._listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + self._listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp return self._handle_unmatched_requests(req, resp) except Exception as error: @@ -1867,15 +1873,18 @@

    Returns

    # This should not be an intentional handling in usual use cases. resp = BoltResponse(status=404, body={"error": "no next() calls in middleware"}) if self._raise_error_for_unhandled_request is True: - self._listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, last_global_middleware_name=middleware.name, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + self._listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp self._framework_logger.warning(warning_unhandled_by_global_middleware(middleware.name, req)) return resp @@ -1918,14 +1927,17 @@

    Returns

    if resp is None: resp = BoltResponse(status=404, body={"error": "unhandled request"}) if self._raise_error_for_unhandled_request is True: - self._listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + self._listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp return self._handle_unmatched_requests(req, resp) except Exception as error: diff --git a/docs/api-docs/slack_bolt/async_app.html b/docs/api-docs/slack_bolt/async_app.html index e6b693440..902e18dfe 100644 --- a/docs/api-docs/slack_bolt/async_app.html +++ b/docs/api-docs/slack_bolt/async_app.html @@ -718,15 +718,18 @@

    Args

    # This should not be an intentional handling in usual use cases. resp = BoltResponse(status=404, body={"error": "no next() calls in middleware"}) if self._raise_error_for_unhandled_request is True: - await self._async_listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, last_global_middleware_name=middleware.name, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + await self._async_listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp self._framework_logger.warning(warning_unhandled_by_global_middleware(middleware.name, req)) return resp @@ -772,14 +775,17 @@

    Args

    if resp is None: resp = BoltResponse(status=404, body={"error": "unhandled request"}) if self._raise_error_for_unhandled_request is True: - await self._async_listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + await self._async_listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp return self._handle_unmatched_requests(req, resp) @@ -1755,15 +1761,18 @@

    Returns

    # This should not be an intentional handling in usual use cases. resp = BoltResponse(status=404, body={"error": "no next() calls in middleware"}) if self._raise_error_for_unhandled_request is True: - await self._async_listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, last_global_middleware_name=middleware.name, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + await self._async_listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp self._framework_logger.warning(warning_unhandled_by_global_middleware(middleware.name, req)) return resp @@ -1809,14 +1818,17 @@

    Returns

    if resp is None: resp = BoltResponse(status=404, body={"error": "unhandled request"}) if self._raise_error_for_unhandled_request is True: - await self._async_listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + await self._async_listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp return self._handle_unmatched_requests(req, resp) diff --git a/docs/api-docs/slack_bolt/error/index.html b/docs/api-docs/slack_bolt/error/index.html index 827fecc42..fcc4de3fe 100644 --- a/docs/api-docs/slack_bolt/error/index.html +++ b/docs/api-docs/slack_bolt/error/index.html @@ -51,7 +51,10 @@

    Module slack_bolt.error

    self.request = request self.body = request.body if request is not None else {} self.current_response = current_response - self.last_global_middleware_name = last_global_middleware_name + self.last_global_middleware_name = last_global_middleware_name + + def __str__(self) -> str: + return "unhandled request error"
    @@ -112,7 +115,10 @@

    Subclasses

    self.request = request self.body = request.body if request is not None else {} self.current_response = current_response - self.last_global_middleware_name = last_global_middleware_name + self.last_global_middleware_name = last_global_middleware_name + + def __str__(self) -> str: + return "unhandled request error"

    Ancestors

      diff --git a/docs/api-docs/slack_bolt/index.html b/docs/api-docs/slack_bolt/index.html index fa7283542..3e741d194 100644 --- a/docs/api-docs/slack_bolt/index.html +++ b/docs/api-docs/slack_bolt/index.html @@ -726,15 +726,18 @@

      Args

      # This should not be an intentional handling in usual use cases. resp = BoltResponse(status=404, body={"error": "no next() calls in middleware"}) if self._raise_error_for_unhandled_request is True: - self._listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, last_global_middleware_name=middleware.name, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + self._listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp self._framework_logger.warning(warning_unhandled_by_global_middleware(middleware.name, req)) return resp @@ -777,14 +780,17 @@

      Args

      if resp is None: resp = BoltResponse(status=404, body={"error": "unhandled request"}) if self._raise_error_for_unhandled_request is True: - self._listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + self._listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp return self._handle_unmatched_requests(req, resp) except Exception as error: @@ -2005,15 +2011,18 @@

      Returns

      # This should not be an intentional handling in usual use cases. resp = BoltResponse(status=404, body={"error": "no next() calls in middleware"}) if self._raise_error_for_unhandled_request is True: - self._listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, last_global_middleware_name=middleware.name, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + self._listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp self._framework_logger.warning(warning_unhandled_by_global_middleware(middleware.name, req)) return resp @@ -2056,14 +2065,17 @@

      Returns

      if resp is None: resp = BoltResponse(status=404, body={"error": "unhandled request"}) if self._raise_error_for_unhandled_request is True: - self._listener_runner.listener_error_handler.handle( - error=BoltUnhandledRequestError( + try: + raise BoltUnhandledRequestError( request=req, current_response=resp, - ), - request=req, - response=resp, - ) + ) + except BoltUnhandledRequestError as e: + self._listener_runner.listener_error_handler.handle( + error=e, + request=req, + response=resp, + ) return resp return self._handle_unmatched_requests(req, resp) except Exception as error: diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index a55652360..78c22351c 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

      Module slack_bolt.version

      Expand source code
      """Check the latest version at https://pypi.org/project/slack-bolt/"""
      -__version__ = "1.17.1"
      +__version__ = "1.17.2"
    diff --git a/setup.py b/setup.py index 470188554..e56410465 100755 --- a/setup.py +++ b/setup.py @@ -58,7 +58,7 @@ ), include_package_data=True, # MANIFEST.in install_requires=[ - "slack_sdk>=3.21.1,<4", + "slack_sdk>=3.21.2,<4", ], setup_requires=["pytest-runner==5.2"], tests_require=async_test_dependencies, diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 02de47405..5b4966f0c 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.17.1" +__version__ = "1.17.2" From fea0c9938463b5be2ff13c01d7b794d842b7da12 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 26 Apr 2023 15:05:46 +0900 Subject: [PATCH 438/719] Update codecov build settings --- .github/workflows/codecov.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index ec04d58b2..e5f8e0c9a 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -7,8 +7,9 @@ on: jobs: build: - runs-on: ubuntu-latest - timeout-minutes: 10 + # Avoiding -latest due to https://github.com/actions/setup-python/issues/162 + runs-on: ubuntu-20.04 + timeout-minutes: 15 strategy: matrix: python-version: ["3.11"] From a06fcb5820aa1579fa02bd09c8d6b502733295b5 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 26 Apr 2023 14:49:16 +0900 Subject: [PATCH 439/719] Add url, team, user to AuthorizeResult properties --- slack_bolt/authorization/authorize_result.py | 20 ++++- .../test_app_actor_user_token.py | 8 +- .../test_app_installation_store.py | 3 + .../test_app_actor_user_token.py | 3 + .../test_app_installation_store.py | 3 + .../authorization/test_authorize.py | 80 +++++++++++++++++++ .../authorization/test_async_authorize.py | 75 +++++++++++++++++ 7 files changed, 190 insertions(+), 2 deletions(-) diff --git a/slack_bolt/authorization/authorize_result.py b/slack_bolt/authorization/authorize_result.py index 032375519..505245d3f 100644 --- a/slack_bolt/authorization/authorize_result.py +++ b/slack_bolt/authorization/authorize_result.py @@ -8,11 +8,16 @@ class AuthorizeResult(dict): enterprise_id: Optional[str] team_id: Optional[str] + team: Optional[str] # since v1.18 + url: Optional[str] # since v1.18 + bot_id: Optional[str] bot_user_id: Optional[str] bot_token: Optional[str] bot_scopes: Optional[List[str]] # since v1.17 + user_id: Optional[str] + user: Optional[str] # since v1.18 user_token: Optional[str] user_scopes: Optional[List[str]] # since v1.17 @@ -21,6 +26,8 @@ def __init__( *, enterprise_id: Optional[str], team_id: Optional[str], + team: Optional[str] = None, + url: Optional[str] = None, # bot bot_user_id: Optional[str] = None, bot_id: Optional[str] = None, @@ -28,6 +35,7 @@ def __init__( bot_scopes: Optional[Union[List[str], str]] = None, # user user_id: Optional[str] = None, + user: Optional[str] = None, user_token: Optional[str] = None, user_scopes: Optional[Union[List[str], str]] = None, ): @@ -35,16 +43,21 @@ def __init__( Args: enterprise_id: Organization ID (Enterprise Grid) starting with `E` team_id: Workspace ID starting with `T` + team: Workspace name + url: Workspace slack.com URL bot_user_id: Bot user's User ID starting with either `U` or `W` bot_id: Bot ID starting with `B` bot_token: Bot user access token starting with `xoxb-` bot_scopes: The scopes associated with the bot token user_id: The request user ID + user: The request user's name user_token: User access token starting with `xoxp-` user_scopes: The scopes associated wth the user token """ self["enterprise_id"] = self.enterprise_id = enterprise_id self["team_id"] = self.team_id = team_id + self["team"] = self.team = team + self["url"] = self.url = url # bot self["bot_user_id"] = self.bot_user_id = bot_user_id self["bot_id"] = self.bot_id = bot_id @@ -54,6 +67,7 @@ def __init__( self["bot_scopes"] = self.bot_scopes = bot_scopes # type: ignore # user self["user_id"] = self.user_id = user_id + self["user"] = self.user = user self["user_token"] = self.user_token = user_token if user_scopes is not None and isinstance(user_scopes, str): user_scopes = [scope.strip() for scope in user_scopes.split(",")] @@ -76,17 +90,21 @@ def from_auth_test_response( user_id: Optional[str] = ( # type:ignore auth_test_response.get("user_id") if auth_test_response.get("bot_id") is None else None ) - # Since v1.28, user_id can be set when user_token w/ its auth.test response exists + user_name = auth_test_response.get("user") if user_id is None and user_auth_test_response is not None: user_id: Optional[str] = user_auth_test_response.get("user_id") # type:ignore + user_name: Optional[str] = user_auth_test_response.get("user") # type:ignore return AuthorizeResult( enterprise_id=auth_test_response.get("enterprise_id"), team_id=auth_test_response.get("team_id"), + team=auth_test_response.get("team"), + url=auth_test_response.get("url"), bot_id=auth_test_response.get("bot_id"), bot_user_id=bot_user_id, bot_scopes=bot_scopes, user_id=user_id, + user=user_name, bot_token=bot_token, user_token=user_token, user_scopes=user_scopes, diff --git a/tests/scenario_tests/test_app_actor_user_token.py b/tests/scenario_tests/test_app_actor_user_token.py index 5c05de43e..15941c79f 100644 --- a/tests/scenario_tests/test_app_actor_user_token.py +++ b/tests/scenario_tests/test_app_actor_user_token.py @@ -169,6 +169,9 @@ def handle_events(context: BoltContext, say: Say): assert context.authorize_result.user_id == "W99999" assert context.authorize_result.user_token == "xoxp-valid-actor-based" assert context.authorize_result.user_scopes == ["search:read", "chat:write"] + assert context.authorize_result.team_id == "T0G9PQBBK" + assert context.authorize_result.team == "Subarachnoid Workspace" + assert context.authorize_result.url == "https://subarachnoid.slack.com/" say("What's up?") response = app.dispatch(self.build_request()) @@ -196,14 +199,17 @@ def handle_events(context: BoltContext, say: Say): assert context.actor_enterprise_id == "E013Y3SHLAY" assert context.actor_team_id == "T111111" assert context.actor_user_id == "W013QGS7BPF" - assert context.authorize_result.bot_id == "BZYBOTHED" assert context.authorize_result.bot_user_id == "W23456789" assert context.authorize_result.bot_token == "xoxb-valid-2" assert context.authorize_result.bot_scopes == ["commands", "chat:write"] + assert context.authorize_result.user == "bot" assert context.authorize_result.user_id is None assert context.authorize_result.user_token is None assert context.authorize_result.user_scopes is None + assert context.authorize_result.team_id == "T0G9PQBBK" + assert context.authorize_result.team == "Subarachnoid Workspace" + assert context.authorize_result.url == "https://subarachnoid.slack.com/" say("What's up?") response = app.dispatch(self.build_request(team_id="T111111")) diff --git a/tests/scenario_tests/test_app_installation_store.py b/tests/scenario_tests/test_app_installation_store.py index b3b4390e3..1c0b5b07c 100644 --- a/tests/scenario_tests/test_app_installation_store.py +++ b/tests/scenario_tests/test_app_installation_store.py @@ -146,6 +146,9 @@ def handle_app_mention(context: BoltContext, say: Say): assert context.authorize_result.user_id == "W99999" assert context.authorize_result.user_token == "xoxp-valid" assert context.authorize_result.user_scopes == ["search:read"] + assert context.authorize_result.team_id == "T0G9PQBBK" + assert context.authorize_result.team == "Subarachnoid Workspace" + assert context.authorize_result.url == "https://subarachnoid.slack.com/" say("What's up?") response = app.dispatch(self.build_app_mention_request()) diff --git a/tests/scenario_tests_async/test_app_actor_user_token.py b/tests/scenario_tests_async/test_app_actor_user_token.py index f2a7ddd00..f0d3ea2e7 100644 --- a/tests/scenario_tests_async/test_app_actor_user_token.py +++ b/tests/scenario_tests_async/test_app_actor_user_token.py @@ -120,6 +120,9 @@ async def handle_events(context: AsyncBoltContext, say: AsyncSay): assert context.authorize_result.user_id == "W99999" assert context.authorize_result.user_token == "xoxp-valid-actor-based" assert context.authorize_result.user_scopes == ["search:read", "chat:write"] + assert context.authorize_result.team_id == "T0G9PQBBK" + assert context.authorize_result.team == "Subarachnoid Workspace" + assert context.authorize_result.url == "https://subarachnoid.slack.com/" await say("What's up?") request = self.build_request() diff --git a/tests/scenario_tests_async/test_app_installation_store.py b/tests/scenario_tests_async/test_app_installation_store.py index 17bf92255..75e0648de 100644 --- a/tests/scenario_tests_async/test_app_installation_store.py +++ b/tests/scenario_tests_async/test_app_installation_store.py @@ -86,6 +86,9 @@ async def handle_app_mention(context: AsyncBoltContext, say: AsyncSay): assert context.authorize_result.user_id == "W99999" assert context.authorize_result.user_token == "xoxp-valid" assert context.authorize_result.user_scopes == ["search:read"] + assert context.authorize_result.team_id == "T0G9PQBBK" + assert context.authorize_result.team == "Subarachnoid Workspace" + assert context.authorize_result.url == "https://subarachnoid.slack.com/" await say("What's up?") request = self.build_valid_app_mention_request() diff --git a/tests/slack_bolt/authorization/test_authorize.py b/tests/slack_bolt/authorization/test_authorize.py index 32fd43a96..d7c06b226 100644 --- a/tests/slack_bolt/authorization/test_authorize.py +++ b/tests/slack_bolt/authorization/test_authorize.py @@ -48,12 +48,22 @@ def test_installation_store_legacy(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None + assert result.user_id is None + assert result.user == "bot" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" assert_auth_test_count(self, 1) result = authorize(context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111") assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None + assert result.user_id is None + assert result.user == "bot" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" assert_auth_test_count(self, 2) def test_installation_store_cached_legacy(self): @@ -71,12 +81,22 @@ def test_installation_store_cached_legacy(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None + assert result.user_id is None + assert result.user == "bot" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" assert_auth_test_count(self, 1) result = authorize(context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111") assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None + assert result.user_id is None + assert result.user == "bot" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" assert_auth_test_count(self, 1) # cached def test_installation_store_bot_only(self): @@ -95,12 +115,22 @@ def test_installation_store_bot_only(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None + assert result.user_id is None + assert result.user == "bot" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" assert_auth_test_count(self, 1) result = authorize(context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111") assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None + assert result.user_id is None + assert result.user == "bot" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" assert_auth_test_count(self, 2) def test_installation_store_cached_bot_only(self): @@ -120,12 +150,22 @@ def test_installation_store_cached_bot_only(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None + assert result.user_id is None + assert result.user == "bot" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" assert_auth_test_count(self, 1) result = authorize(context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111") assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None + assert result.user_id is None + assert result.user == "bot" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" assert_auth_test_count(self, 1) # cached def test_installation_store(self): @@ -138,12 +178,22 @@ def test_installation_store(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token == "xoxp-valid" + assert result.user_id == "W99999" + assert result.user == "some-user" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" assert_auth_test_count(self, 1) result = authorize(context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111") assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token == "xoxp-valid" + assert result.user_id == "W99999" + assert result.user == "some-user" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" assert_auth_test_count(self, 2) def test_installation_store_cached(self): @@ -160,12 +210,22 @@ def test_installation_store_cached(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token == "xoxp-valid" + assert result.user_id == "W99999" + assert result.user == "some-user" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" assert_auth_test_count(self, 1) result = authorize(context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111") assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token == "xoxp-valid" + assert result.user_id == "W99999" + assert result.user == "some-user" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" assert_auth_test_count(self, 1) # cached def test_fetch_different_user_token(self): @@ -178,6 +238,11 @@ def test_fetch_different_user_token(self): assert result.bot_user_id == "W23456789" assert result.bot_token == "xoxb-valid" assert result.user_token == "xoxp-valid" + assert result.user_id == "W99999" + assert result.user == "some-user" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" assert_auth_test_count(self, 1) def test_fetch_different_user_token_with_rotation(self): @@ -209,6 +274,11 @@ def test_fetch_different_user_token_with_rotation(self): assert result.bot_user_id == "W23456789" assert result.bot_token == "xoxb-valid-refreshed" assert result.user_token == "xoxp-valid-refreshed" + assert result.user_id == "W99999" + assert result.user == "some-user" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" assert_auth_test_count(self, 1) def test_remove_latest_user_token_if_it_is_not_relevant(self): @@ -221,6 +291,11 @@ def test_remove_latest_user_token_if_it_is_not_relevant(self): assert result.bot_user_id == "W23456789" assert result.bot_token == "xoxb-valid" assert result.user_token is None + assert result.user_id is None + assert result.user == "bot" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" assert_auth_test_count(self, 1) def test_rotate_only_bot_token(self): @@ -252,6 +327,11 @@ def test_rotate_only_bot_token(self): assert result.bot_user_id == "W23456789" assert result.bot_token == "xoxb-valid-refreshed" assert result.user_token is None + assert result.user_id is None + assert result.user == "bot" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" assert_auth_test_count(self, 1) diff --git a/tests/slack_bolt_async/authorization/test_async_authorize.py b/tests/slack_bolt_async/authorization/test_async_authorize.py index 7f2c1c804..4ca41e14a 100644 --- a/tests/slack_bolt_async/authorization/test_async_authorize.py +++ b/tests/slack_bolt_async/authorization/test_async_authorize.py @@ -66,12 +66,22 @@ async def test_installation_store_legacy(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None + assert result.user_id is None + assert result.user == "bot" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" await assert_auth_test_count_async(self, 1) result = await authorize(context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111") assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None + assert result.user_id is None + assert result.user == "bot" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" await assert_auth_test_count_async(self, 2) @pytest.mark.asyncio @@ -90,12 +100,22 @@ async def test_installation_store_cached_legacy(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None + assert result.user_id is None + assert result.user == "bot" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" await assert_auth_test_count_async(self, 1) result = await authorize(context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111") assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None + assert result.user_id is None + assert result.user == "bot" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" await assert_auth_test_count_async(self, 1) # cached @pytest.mark.asyncio @@ -115,12 +135,22 @@ async def test_installation_store_bot_only(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None + assert result.user_id is None + assert result.user == "bot" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" await assert_auth_test_count_async(self, 1) result = await authorize(context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111") assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None + assert result.user_id is None + assert result.user == "bot" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" await assert_auth_test_count_async(self, 2) @pytest.mark.asyncio @@ -141,12 +171,22 @@ async def test_installation_store_cached_bot_only(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None + assert result.user_id is None + assert result.user == "bot" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" await assert_auth_test_count_async(self, 1) result = await authorize(context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111") assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token is None + assert result.user_id is None + assert result.user == "bot" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" await assert_auth_test_count_async(self, 1) # cached @pytest.mark.asyncio @@ -161,6 +201,11 @@ async def test_installation_store(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token == "xoxp-valid" + assert result.user_id == "W99999" + assert result.user == "some-user" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" await assert_auth_test_count_async(self, 1) result = await authorize(context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111") @@ -185,12 +230,22 @@ async def test_installation_store_cached(self): assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token == "xoxp-valid" + assert result.user_id == "W99999" + assert result.user == "some-user" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" await assert_auth_test_count_async(self, 1) result = await authorize(context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111") assert result.bot_id == "BZYBOTHED" assert result.bot_user_id == "W23456789" assert result.user_token == "xoxp-valid" + assert result.user_id == "W99999" + assert result.user == "some-user" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" await assert_auth_test_count_async(self, 1) # cached @pytest.mark.asyncio @@ -204,6 +259,11 @@ async def test_fetch_different_user_token(self): assert result.bot_user_id == "W23456789" assert result.bot_token == "xoxb-valid" assert result.user_token == "xoxp-valid" + assert result.user_id == "W99999" + assert result.user == "some-user" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio @@ -236,6 +296,11 @@ async def test_fetch_different_user_token_with_rotation(self): assert result.bot_user_id == "W23456789" assert result.bot_token == "xoxb-valid-refreshed" assert result.user_token == "xoxp-valid-refreshed" + assert result.user_id == "W99999" + assert result.user == "some-user" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio @@ -249,6 +314,11 @@ async def test_remove_latest_user_token_if_it_is_not_relevant(self): assert result.bot_user_id == "W23456789" assert result.bot_token == "xoxb-valid" assert result.user_token is None + assert result.user_id is None + assert result.user == "bot" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio @@ -281,6 +351,11 @@ async def test_rotate_only_bot_token(self): assert result.bot_user_id == "W23456789" assert result.bot_token == "xoxb-valid-refreshed" assert result.user_token is None + assert result.user_id is None + assert result.user == "bot" + assert result.team_id == "T0G9PQBBK" + assert result.team == "Subarachnoid Workspace" + assert result.url == "https://subarachnoid.slack.com/" await assert_auth_test_count_async(self, 1) From 99707489a91465eb675e5b5921ef3355bc16d9a3 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 26 Apr 2023 16:02:55 +0900 Subject: [PATCH 440/719] Disable Codecov job for now --- .github/workflows/codecov.yml | 85 ++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 42 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index e5f8e0c9a..e33303399 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -1,42 +1,43 @@ -name: Run codecov - -on: - push: - branches: [main] - pull_request: - -jobs: - build: - # Avoiding -latest due to https://github.com/actions/setup-python/issues/162 - runs-on: ubuntu-20.04 - timeout-minutes: 15 - strategy: - matrix: - python-version: ["3.11"] - env: - # default: multiprocessing - # threading is more stable on GitHub Actions - BOLT_PYTHON_MOCK_SERVER_MODE: threading - BOLT_PYTHON_CODECOV_RUNNING: "1" - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python setup.py install - pip install -U pip - pip install -e ".[async]" - pip install -e ".[adapter]" - pip install -e ".[testing]" - pip install -e ".[adapter_testing]" - - name: Run all tests for codecov - run: | - pytest --cov=./slack_bolt/ --cov-report=xml - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - fail_ci_if_error: true - verbose: true +# TODO: This CI job hangs as of April 2023 +#name: Run codecov +# +#on: +# push: +# branches: [main] +# pull_request: +# +#jobs: +# build: +# # Avoiding -latest due to https://github.com/actions/setup-python/issues/162 +# runs-on: ubuntu-20.04 +# timeout-minutes: 10 +# strategy: +# matrix: +# python-version: ["3.11"] +# env: +# # default: multiprocessing +# # threading is more stable on GitHub Actions +# BOLT_PYTHON_MOCK_SERVER_MODE: threading +# BOLT_PYTHON_CODECOV_RUNNING: "1" +# steps: +# - uses: actions/checkout@v3 +# - name: Set up Python ${{ matrix.python-version }} +# uses: actions/setup-python@v4 +# with: +# python-version: ${{ matrix.python-version }} +# - name: Install dependencies +# run: | +# python setup.py install +# pip install -U pip +# pip install -e ".[async]" +# pip install -e ".[adapter]" +# pip install -e ".[testing]" +# pip install -e ".[adapter_testing]" +# - name: Run all tests for codecov +# run: | +# pytest --cov=./slack_bolt/ --cov-report=xml +# - name: Upload coverage to Codecov +# uses: codecov/codecov-action@v3 +# with: +# fail_ci_if_error: true +# verbose: true From 515684e061eb095a2e1e88c64bc1b810ac85190a Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 26 Apr 2023 16:18:01 +0900 Subject: [PATCH 441/719] verison 1.18.0 --- .../authorization/authorize_result.html | 69 +++++++++++++++++-- .../slack_bolt/authorization/index.html | 49 ++++++++++++- docs/api-docs/slack_bolt/version.html | 2 +- slack_bolt/version.py | 2 +- 4 files changed, 113 insertions(+), 9 deletions(-) diff --git a/docs/api-docs/slack_bolt/authorization/authorize_result.html b/docs/api-docs/slack_bolt/authorization/authorize_result.html index 185aa8cec..8cef1d5c1 100644 --- a/docs/api-docs/slack_bolt/authorization/authorize_result.html +++ b/docs/api-docs/slack_bolt/authorization/authorize_result.html @@ -36,11 +36,16 @@

    Module slack_bolt.authorization.authorize_result< enterprise_id: Optional[str] team_id: Optional[str] + team: Optional[str] # since v1.18 + url: Optional[str] # since v1.18 + bot_id: Optional[str] bot_user_id: Optional[str] bot_token: Optional[str] bot_scopes: Optional[List[str]] # since v1.17 + user_id: Optional[str] + user: Optional[str] # since v1.18 user_token: Optional[str] user_scopes: Optional[List[str]] # since v1.17 @@ -49,6 +54,8 @@

    Module slack_bolt.authorization.authorize_result< *, enterprise_id: Optional[str], team_id: Optional[str], + team: Optional[str] = None, + url: Optional[str] = None, # bot bot_user_id: Optional[str] = None, bot_id: Optional[str] = None, @@ -56,6 +63,7 @@

    Module slack_bolt.authorization.authorize_result< bot_scopes: Optional[Union[List[str], str]] = None, # user user_id: Optional[str] = None, + user: Optional[str] = None, user_token: Optional[str] = None, user_scopes: Optional[Union[List[str], str]] = None, ): @@ -63,16 +71,21 @@

    Module slack_bolt.authorization.authorize_result< Args: enterprise_id: Organization ID (Enterprise Grid) starting with `E` team_id: Workspace ID starting with `T` + team: Workspace name + url: Workspace slack.com URL bot_user_id: Bot user's User ID starting with either `U` or `W` bot_id: Bot ID starting with `B` bot_token: Bot user access token starting with `xoxb-` bot_scopes: The scopes associated with the bot token user_id: The request user ID + user: The request user's name user_token: User access token starting with `xoxp-` user_scopes: The scopes associated wth the user token """ self["enterprise_id"] = self.enterprise_id = enterprise_id self["team_id"] = self.team_id = team_id + self["team"] = self.team = team + self["url"] = self.url = url # bot self["bot_user_id"] = self.bot_user_id = bot_user_id self["bot_id"] = self.bot_id = bot_id @@ -82,6 +95,7 @@

    Module slack_bolt.authorization.authorize_result< self["bot_scopes"] = self.bot_scopes = bot_scopes # type: ignore # user self["user_id"] = self.user_id = user_id + self["user"] = self.user = user self["user_token"] = self.user_token = user_token if user_scopes is not None and isinstance(user_scopes, str): user_scopes = [scope.strip() for scope in user_scopes.split(",")] @@ -104,17 +118,21 @@

    Module slack_bolt.authorization.authorize_result< user_id: Optional[str] = ( # type:ignore auth_test_response.get("user_id") if auth_test_response.get("bot_id") is None else None ) - # Since v1.28, user_id can be set when user_token w/ its auth.test response exists + user_name = auth_test_response.get("user") if user_id is None and user_auth_test_response is not None: user_id: Optional[str] = user_auth_test_response.get("user_id") # type:ignore + user_name: Optional[str] = user_auth_test_response.get("user") # type:ignore return AuthorizeResult( enterprise_id=auth_test_response.get("enterprise_id"), team_id=auth_test_response.get("team_id"), + team=auth_test_response.get("team"), + url=auth_test_response.get("url"), bot_id=auth_test_response.get("bot_id"), bot_user_id=bot_user_id, bot_scopes=bot_scopes, user_id=user_id, + user=user_name, bot_token=bot_token, user_token=user_token, user_scopes=user_scopes, @@ -132,7 +150,7 @@

    Classes

    class AuthorizeResult -(*, enterprise_id: Optional[str], team_id: Optional[str], bot_user_id: Optional[str] = None, bot_id: Optional[str] = None, bot_token: Optional[str] = None, bot_scopes: Union[List[str], str, ForwardRef(None)] = None, user_id: Optional[str] = None, user_token: Optional[str] = None, user_scopes: Union[List[str], str, ForwardRef(None)] = None) +(*, enterprise_id: Optional[str], team_id: Optional[str], team: Optional[str] = None, url: Optional[str] = None, bot_user_id: Optional[str] = None, bot_id: Optional[str] = None, bot_token: Optional[str] = None, bot_scopes: Union[List[str], str, ForwardRef(None)] = None, user_id: Optional[str] = None, user: Optional[str] = None, user_token: Optional[str] = None, user_scopes: Union[List[str], str, ForwardRef(None)] = None)

    Authorize function call result

    @@ -142,6 +160,10 @@

    Args

    Organization ID (Enterprise Grid) starting with E
    team_id
    Workspace ID starting with T
    +
    team
    +
    Workspace name
    +
    url
    +
    Workspace slack.com URL
    bot_user_id
    Bot user's User ID starting with either U or W
    bot_id
    @@ -152,6 +174,8 @@

    Args

    The scopes associated with the bot token
    user_id
    The request user ID
    +
    user
    +
    The request user's name
    user_token
    User access token starting with xoxp-
    user_scopes
    @@ -166,11 +190,16 @@

    Args

    enterprise_id: Optional[str] team_id: Optional[str] + team: Optional[str] # since v1.18 + url: Optional[str] # since v1.18 + bot_id: Optional[str] bot_user_id: Optional[str] bot_token: Optional[str] bot_scopes: Optional[List[str]] # since v1.17 + user_id: Optional[str] + user: Optional[str] # since v1.18 user_token: Optional[str] user_scopes: Optional[List[str]] # since v1.17 @@ -179,6 +208,8 @@

    Args

    *, enterprise_id: Optional[str], team_id: Optional[str], + team: Optional[str] = None, + url: Optional[str] = None, # bot bot_user_id: Optional[str] = None, bot_id: Optional[str] = None, @@ -186,6 +217,7 @@

    Args

    bot_scopes: Optional[Union[List[str], str]] = None, # user user_id: Optional[str] = None, + user: Optional[str] = None, user_token: Optional[str] = None, user_scopes: Optional[Union[List[str], str]] = None, ): @@ -193,16 +225,21 @@

    Args

    Args: enterprise_id: Organization ID (Enterprise Grid) starting with `E` team_id: Workspace ID starting with `T` + team: Workspace name + url: Workspace slack.com URL bot_user_id: Bot user's User ID starting with either `U` or `W` bot_id: Bot ID starting with `B` bot_token: Bot user access token starting with `xoxb-` bot_scopes: The scopes associated with the bot token user_id: The request user ID + user: The request user's name user_token: User access token starting with `xoxp-` user_scopes: The scopes associated wth the user token """ self["enterprise_id"] = self.enterprise_id = enterprise_id self["team_id"] = self.team_id = team_id + self["team"] = self.team = team + self["url"] = self.url = url # bot self["bot_user_id"] = self.bot_user_id = bot_user_id self["bot_id"] = self.bot_id = bot_id @@ -212,6 +249,7 @@

    Args

    self["bot_scopes"] = self.bot_scopes = bot_scopes # type: ignore # user self["user_id"] = self.user_id = user_id + self["user"] = self.user = user self["user_token"] = self.user_token = user_token if user_scopes is not None and isinstance(user_scopes, str): user_scopes = [scope.strip() for scope in user_scopes.split(",")] @@ -234,17 +272,21 @@

    Args

    user_id: Optional[str] = ( # type:ignore auth_test_response.get("user_id") if auth_test_response.get("bot_id") is None else None ) - # Since v1.28, user_id can be set when user_token w/ its auth.test response exists + user_name = auth_test_response.get("user") if user_id is None and user_auth_test_response is not None: user_id: Optional[str] = user_auth_test_response.get("user_id") # type:ignore + user_name: Optional[str] = user_auth_test_response.get("user") # type:ignore return AuthorizeResult( enterprise_id=auth_test_response.get("enterprise_id"), team_id=auth_test_response.get("team_id"), + team=auth_test_response.get("team"), + url=auth_test_response.get("url"), bot_id=auth_test_response.get("bot_id"), bot_user_id=bot_user_id, bot_scopes=bot_scopes, user_id=user_id, + user=user_name, bot_token=bot_token, user_token=user_token, user_scopes=user_scopes, @@ -276,10 +318,22 @@

    Class variables

    +
    var team : Optional[str]
    +
    +
    +
    var team_id : Optional[str]
    +
    var url : Optional[str]
    +
    +
    +
    +
    var user : Optional[str]
    +
    +
    +
    var user_id : Optional[str]
    @@ -321,17 +375,21 @@

    Static methods

    user_id: Optional[str] = ( # type:ignore auth_test_response.get("user_id") if auth_test_response.get("bot_id") is None else None ) - # Since v1.28, user_id can be set when user_token w/ its auth.test response exists + user_name = auth_test_response.get("user") if user_id is None and user_auth_test_response is not None: user_id: Optional[str] = user_auth_test_response.get("user_id") # type:ignore + user_name: Optional[str] = user_auth_test_response.get("user") # type:ignore return AuthorizeResult( enterprise_id=auth_test_response.get("enterprise_id"), team_id=auth_test_response.get("team_id"), + team=auth_test_response.get("team"), + url=auth_test_response.get("url"), bot_id=auth_test_response.get("bot_id"), bot_user_id=bot_user_id, bot_scopes=bot_scopes, user_id=user_id, + user=user_name, bot_token=bot_token, user_token=user_token, user_scopes=user_scopes, @@ -365,7 +423,10 @@

    bot_user_id
  • enterprise_id
  • from_auth_test_response
  • +
  • team
  • team_id
  • +
  • url
  • +
  • user
  • user_id
  • user_scopes
  • user_token
  • diff --git a/docs/api-docs/slack_bolt/authorization/index.html b/docs/api-docs/slack_bolt/authorization/index.html index 86a00bfda..8850b423c 100644 --- a/docs/api-docs/slack_bolt/authorization/index.html +++ b/docs/api-docs/slack_bolt/authorization/index.html @@ -76,7 +76,7 @@

    Classes

    class AuthorizeResult -(*, enterprise_id: Optional[str], team_id: Optional[str], bot_user_id: Optional[str] = None, bot_id: Optional[str] = None, bot_token: Optional[str] = None, bot_scopes: Union[List[str], str, ForwardRef(None)] = None, user_id: Optional[str] = None, user_token: Optional[str] = None, user_scopes: Union[List[str], str, ForwardRef(None)] = None) +(*, enterprise_id: Optional[str], team_id: Optional[str], team: Optional[str] = None, url: Optional[str] = None, bot_user_id: Optional[str] = None, bot_id: Optional[str] = None, bot_token: Optional[str] = None, bot_scopes: Union[List[str], str, ForwardRef(None)] = None, user_id: Optional[str] = None, user: Optional[str] = None, user_token: Optional[str] = None, user_scopes: Union[List[str], str, ForwardRef(None)] = None)

    Authorize function call result

    @@ -86,6 +86,10 @@

    Args

    Organization ID (Enterprise Grid) starting with E
    team_id
    Workspace ID starting with T
    +
    team
    +
    Workspace name
    +
    url
    +
    Workspace slack.com URL
    bot_user_id
    Bot user's User ID starting with either U or W
    bot_id
    @@ -96,6 +100,8 @@

    Args

    The scopes associated with the bot token
    user_id
    The request user ID
    +
    user
    +
    The request user's name
    user_token
    User access token starting with xoxp-
    user_scopes
    @@ -110,11 +116,16 @@

    Args

    enterprise_id: Optional[str] team_id: Optional[str] + team: Optional[str] # since v1.18 + url: Optional[str] # since v1.18 + bot_id: Optional[str] bot_user_id: Optional[str] bot_token: Optional[str] bot_scopes: Optional[List[str]] # since v1.17 + user_id: Optional[str] + user: Optional[str] # since v1.18 user_token: Optional[str] user_scopes: Optional[List[str]] # since v1.17 @@ -123,6 +134,8 @@

    Args

    *, enterprise_id: Optional[str], team_id: Optional[str], + team: Optional[str] = None, + url: Optional[str] = None, # bot bot_user_id: Optional[str] = None, bot_id: Optional[str] = None, @@ -130,6 +143,7 @@

    Args

    bot_scopes: Optional[Union[List[str], str]] = None, # user user_id: Optional[str] = None, + user: Optional[str] = None, user_token: Optional[str] = None, user_scopes: Optional[Union[List[str], str]] = None, ): @@ -137,16 +151,21 @@

    Args

    Args: enterprise_id: Organization ID (Enterprise Grid) starting with `E` team_id: Workspace ID starting with `T` + team: Workspace name + url: Workspace slack.com URL bot_user_id: Bot user's User ID starting with either `U` or `W` bot_id: Bot ID starting with `B` bot_token: Bot user access token starting with `xoxb-` bot_scopes: The scopes associated with the bot token user_id: The request user ID + user: The request user's name user_token: User access token starting with `xoxp-` user_scopes: The scopes associated wth the user token """ self["enterprise_id"] = self.enterprise_id = enterprise_id self["team_id"] = self.team_id = team_id + self["team"] = self.team = team + self["url"] = self.url = url # bot self["bot_user_id"] = self.bot_user_id = bot_user_id self["bot_id"] = self.bot_id = bot_id @@ -156,6 +175,7 @@

    Args

    self["bot_scopes"] = self.bot_scopes = bot_scopes # type: ignore # user self["user_id"] = self.user_id = user_id + self["user"] = self.user = user self["user_token"] = self.user_token = user_token if user_scopes is not None and isinstance(user_scopes, str): user_scopes = [scope.strip() for scope in user_scopes.split(",")] @@ -178,17 +198,21 @@

    Args

    user_id: Optional[str] = ( # type:ignore auth_test_response.get("user_id") if auth_test_response.get("bot_id") is None else None ) - # Since v1.28, user_id can be set when user_token w/ its auth.test response exists + user_name = auth_test_response.get("user") if user_id is None and user_auth_test_response is not None: user_id: Optional[str] = user_auth_test_response.get("user_id") # type:ignore + user_name: Optional[str] = user_auth_test_response.get("user") # type:ignore return AuthorizeResult( enterprise_id=auth_test_response.get("enterprise_id"), team_id=auth_test_response.get("team_id"), + team=auth_test_response.get("team"), + url=auth_test_response.get("url"), bot_id=auth_test_response.get("bot_id"), bot_user_id=bot_user_id, bot_scopes=bot_scopes, user_id=user_id, + user=user_name, bot_token=bot_token, user_token=user_token, user_scopes=user_scopes, @@ -220,10 +244,22 @@

    Class variables

    +
    var team : Optional[str]
    +
    +
    +
    var team_id : Optional[str]
    +
    var url : Optional[str]
    +
    +
    +
    +
    var user : Optional[str]
    +
    +
    +
    var user_id : Optional[str]
    @@ -265,17 +301,21 @@

    Static methods

    user_id: Optional[str] = ( # type:ignore auth_test_response.get("user_id") if auth_test_response.get("bot_id") is None else None ) - # Since v1.28, user_id can be set when user_token w/ its auth.test response exists + user_name = auth_test_response.get("user") if user_id is None and user_auth_test_response is not None: user_id: Optional[str] = user_auth_test_response.get("user_id") # type:ignore + user_name: Optional[str] = user_auth_test_response.get("user") # type:ignore return AuthorizeResult( enterprise_id=auth_test_response.get("enterprise_id"), team_id=auth_test_response.get("team_id"), + team=auth_test_response.get("team"), + url=auth_test_response.get("url"), bot_id=auth_test_response.get("bot_id"), bot_user_id=bot_user_id, bot_scopes=bot_scopes, user_id=user_id, + user=user_name, bot_token=bot_token, user_token=user_token, user_scopes=user_scopes, @@ -318,7 +358,10 @@

    bot_user_id
  • enterprise_id
  • from_auth_test_response
  • +
  • team
  • team_id
  • +
  • url
  • +
  • user
  • user_id
  • user_scopes
  • user_token
  • diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index 78c22351c..eccade944 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.17.2"
    +__version__ = "1.18.0"

    diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 5b4966f0c..dfa1bca7a 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.17.2" +__version__ = "1.18.0" From 9f0602fcef0becace9403841bb899b7f26111f1f Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 27 Apr 2023 07:18:38 +0900 Subject: [PATCH 442/719] Tweak CI settings --- .github/workflows/codecov.yml | 51 +++++++++++++++++------------------ 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index e33303399..9fa9e3953 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -1,30 +1,29 @@ # TODO: This CI job hangs as of April 2023 -#name: Run codecov -# -#on: -# push: -# branches: [main] -# pull_request: -# -#jobs: -# build: -# # Avoiding -latest due to https://github.com/actions/setup-python/issues/162 -# runs-on: ubuntu-20.04 -# timeout-minutes: 10 -# strategy: -# matrix: -# python-version: ["3.11"] -# env: -# # default: multiprocessing -# # threading is more stable on GitHub Actions -# BOLT_PYTHON_MOCK_SERVER_MODE: threading -# BOLT_PYTHON_CODECOV_RUNNING: "1" -# steps: -# - uses: actions/checkout@v3 -# - name: Set up Python ${{ matrix.python-version }} -# uses: actions/setup-python@v4 -# with: -# python-version: ${{ matrix.python-version }} +name: Run codecov + +on: + push: + branches: [main] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 10 + strategy: + matrix: + python-version: ["3.11"] + env: + # default: multiprocessing + # threading is more stable on GitHub Actions + BOLT_PYTHON_MOCK_SERVER_MODE: threading + BOLT_PYTHON_CODECOV_RUNNING: "1" + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} # - name: Install dependencies # run: | # python setup.py install From 4da09fb6128c84351d0fced2f187bb854f3abb91 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 1 May 2023 21:05:33 +0900 Subject: [PATCH 443/719] Add metadata to respond method --- slack_bolt/context/respond/async_respond.py | 4 +++- slack_bolt/context/respond/internals.py | 3 +++ slack_bolt/context/respond/respond.py | 4 +++- tests/slack_bolt/context/test_respond.py | 10 ++++++++++ tests/slack_bolt/context/test_respond_internals.py | 8 ++++++++ tests/slack_bolt_async/context/test_async_respond.py | 11 +++++++++++ 6 files changed, 38 insertions(+), 2 deletions(-) diff --git a/slack_bolt/context/respond/async_respond.py b/slack_bolt/context/respond/async_respond.py index 151525ee3..66dd19374 100644 --- a/slack_bolt/context/respond/async_respond.py +++ b/slack_bolt/context/respond/async_respond.py @@ -1,4 +1,4 @@ -from typing import Optional, Union, Sequence +from typing import Optional, Union, Sequence, Dict, Any from ssl import SSLContext from slack_sdk.models.attachments import Attachment @@ -35,6 +35,7 @@ async def __call__( unfurl_links: Optional[bool] = None, unfurl_media: Optional[bool] = None, thread_ts: Optional[str] = None, + metadata: Dict[str, Any] = None, ) -> WebhookResponse: if self.response_url is not None: client = AsyncWebhookClient( @@ -54,6 +55,7 @@ async def __call__( unfurl_links=unfurl_links, unfurl_media=unfurl_media, thread_ts=thread_ts, + metadata=metadata, ) return await client.send_dict(message) elif isinstance(text_or_whole_response, dict): diff --git a/slack_bolt/context/respond/internals.py b/slack_bolt/context/respond/internals.py index f32976924..caf328690 100644 --- a/slack_bolt/context/respond/internals.py +++ b/slack_bolt/context/respond/internals.py @@ -16,6 +16,7 @@ def _build_message( unfurl_links: Optional[bool] = None, unfurl_media: Optional[bool] = None, thread_ts: Optional[str] = None, + metadata: Dict[str, Any] = None, ) -> Dict[str, Any]: message = {"text": text} if blocks is not None and len(blocks) > 0: @@ -34,4 +35,6 @@ def _build_message( message["unfurl_media"] = unfurl_media if thread_ts is not None: message["thread_ts"] = thread_ts + if metadata is not None: + message["metadata"] = metadata return message diff --git a/slack_bolt/context/respond/respond.py b/slack_bolt/context/respond/respond.py index 59ef11870..ed77fd7f5 100644 --- a/slack_bolt/context/respond/respond.py +++ b/slack_bolt/context/respond/respond.py @@ -1,4 +1,4 @@ -from typing import Optional, Union, Sequence +from typing import Optional, Union, Sequence, Any, Dict from ssl import SSLContext from slack_sdk.models.attachments import Attachment @@ -35,6 +35,7 @@ def __call__( unfurl_links: Optional[bool] = None, unfurl_media: Optional[bool] = None, thread_ts: Optional[str] = None, + metadata: Dict[str, Any] = None, ) -> WebhookResponse: if self.response_url is not None: client = WebhookClient( @@ -55,6 +56,7 @@ def __call__( unfurl_links=unfurl_links, unfurl_media=unfurl_media, thread_ts=thread_ts, + metadata=metadata, ) return client.send_dict(message) elif isinstance(text_or_whole_response, dict): diff --git a/tests/slack_bolt/context/test_respond.py b/tests/slack_bolt/context/test_respond.py index f108664f3..88e98dec8 100644 --- a/tests/slack_bolt/context/test_respond.py +++ b/tests/slack_bolt/context/test_respond.py @@ -29,3 +29,13 @@ def test_unfurl_options(self): respond = Respond(response_url=response_url) response = respond(text="Hi there!", unfurl_media=True, unfurl_links=True) assert response.status_code == 200 + + def test_metadata(self): + response_url = "http://localhost:8888" + respond = Respond(response_url=response_url) + response = respond( + text="Hi there!", + response_type="in_channel", + metadata={"event_type": "foo", "event_payload": {"foo": "bar"}}, + ) + assert response.status_code == 200 diff --git a/tests/slack_bolt/context/test_respond_internals.py b/tests/slack_bolt/context/test_respond_internals.py index facb293da..7d497e205 100644 --- a/tests/slack_bolt/context/test_respond_internals.py +++ b/tests/slack_bolt/context/test_respond_internals.py @@ -49,3 +49,11 @@ def test_build_message_unfurl_options(self): assert message is not None assert message.get("unfurl_links") is True assert message.get("unfurl_media") is True + + def test_metadata(self): + message = _build_message( + text="Hi there!", response_type="in_channel", metadata={"event_type": "foo", "event_payload": {"foo": "bar"}} + ) + assert message is not None + assert message.get("metadata").get("event_type") == "foo" + assert message.get("metadata").get("event_payload") == {"foo": "bar"} diff --git a/tests/slack_bolt_async/context/test_async_respond.py b/tests/slack_bolt_async/context/test_async_respond.py index 18ae114e8..9332ecac4 100644 --- a/tests/slack_bolt_async/context/test_async_respond.py +++ b/tests/slack_bolt_async/context/test_async_respond.py @@ -38,3 +38,14 @@ async def test_respond_unfurl_options(self): respond = AsyncRespond(response_url=response_url) response = await respond(text="Hi there!", unfurl_media=True, unfurl_links=True) assert response.status_code == 200 + + @pytest.mark.asyncio + async def test_metadata(self): + response_url = "http://localhost:8888" + respond = AsyncRespond(response_url=response_url) + response = await respond( + text="Hi there!", + response_type="in_channel", + metadata={"event_type": "foo", "event_payload": {"foo": "bar"}}, + ) + assert response.status_code == 200 From c4161a927674908e54027a4109909e4b1fe1254e Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 1 May 2023 21:14:06 +0900 Subject: [PATCH 444/719] Fix --- slack_bolt/context/respond/internals.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/context/respond/internals.py b/slack_bolt/context/respond/internals.py index caf328690..463dd2f76 100644 --- a/slack_bolt/context/respond/internals.py +++ b/slack_bolt/context/respond/internals.py @@ -16,7 +16,7 @@ def _build_message( unfurl_links: Optional[bool] = None, unfurl_media: Optional[bool] = None, thread_ts: Optional[str] = None, - metadata: Dict[str, Any] = None, + metadata: Optional[Dict[str, Any]] = None, ) -> Dict[str, Any]: message = {"text": text} if blocks is not None and len(blocks) > 0: From 9814103168a28c9c4897a09868f9111959c0dea0 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 1 May 2023 21:14:55 +0900 Subject: [PATCH 445/719] Fix --- slack_bolt/context/respond/async_respond.py | 2 +- slack_bolt/context/respond/respond.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/slack_bolt/context/respond/async_respond.py b/slack_bolt/context/respond/async_respond.py index 66dd19374..f5939cba9 100644 --- a/slack_bolt/context/respond/async_respond.py +++ b/slack_bolt/context/respond/async_respond.py @@ -35,7 +35,7 @@ async def __call__( unfurl_links: Optional[bool] = None, unfurl_media: Optional[bool] = None, thread_ts: Optional[str] = None, - metadata: Dict[str, Any] = None, + metadata: Optional[Dict[str, Any]] = None, ) -> WebhookResponse: if self.response_url is not None: client = AsyncWebhookClient( diff --git a/slack_bolt/context/respond/respond.py b/slack_bolt/context/respond/respond.py index ed77fd7f5..0f16f6851 100644 --- a/slack_bolt/context/respond/respond.py +++ b/slack_bolt/context/respond/respond.py @@ -35,7 +35,7 @@ def __call__( unfurl_links: Optional[bool] = None, unfurl_media: Optional[bool] = None, thread_ts: Optional[str] = None, - metadata: Dict[str, Any] = None, + metadata: Optional[Dict[str, Any]] = None, ) -> WebhookResponse: if self.response_url is not None: client = WebhookClient( From 1350c111f5602d071bcc8b34e80e5c2ff901904f Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 25 May 2023 13:40:18 +0900 Subject: [PATCH 446/719] Add code comments for modal view handling ref: https://github.com/slackapi/python-slack-sdk/issues/1373#issuecomment-1562249340 --- docs/_basic/ja_listening_modals.md | 3 +++ docs/_basic/listening_modals.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/docs/_basic/ja_listening_modals.md b/docs/_basic/ja_listening_modals.md index d23ddcf89..12cdae37a 100644 --- a/docs/_basic/ja_listening_modals.md +++ b/docs/_basic/ja_listening_modals.md @@ -21,6 +21,9 @@ order: 12 # モーダル送信でのビューの更新 @app.view("view_1") def handle_submission(ack, body): + # build_new_view() method はモーダルビューを返します + # モーダルの構築には Block Kit Builder を試してみてください: + # https://app.slack.com/block-kit-builder/#%7B%22type%22:%22modal%22,%22callback_id%22:%22view_1%22,%22title%22:%7B%22type%22:%22plain_text%22,%22text%22:%22My%20App%22,%22emoji%22:true%7D,%22blocks%22:%5B%5D%7D ack(response_action="update", view=build_new_view(body)) ``` この例と同様に、モーダルでの送信リクエストに対して、エラーを表示するためのオプションもあります。 diff --git a/docs/_basic/listening_modals.md b/docs/_basic/listening_modals.md index 4080b260b..8d0916735 100644 --- a/docs/_basic/listening_modals.md +++ b/docs/_basic/listening_modals.md @@ -21,6 +21,9 @@ To update a view in response to a `view_submission` event, you may pass a `respo # Update the view on submission @app.view("view_1") def handle_submission(ack, body): + # The build_new_view() method returns a modal view + # To build a modal view, we recommend using Block Kit Builder: + # https://app.slack.com/block-kit-builder/#%7B%22type%22:%22modal%22,%22callback_id%22:%22view_1%22,%22title%22:%7B%22type%22:%22plain_text%22,%22text%22:%22My%20App%22,%22emoji%22:true%7D,%22blocks%22:%5B%5D%7D ack(response_action="update", view=build_new_view(body)) ``` Similarly, there are options for [displaying errors](https://api.slack.com/surfaces/modals/using#displaying_errors) in response to view submissions. From 426cecdfb17cd43461a976176017ae2372121837 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 12 Jun 2023 10:12:50 +0900 Subject: [PATCH 447/719] Correct docs --- docs/_basic/ja_listening_actions.md | 2 +- docs/_basic/listening_actions.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_basic/ja_listening_actions.md b/docs/_basic/ja_listening_actions.md index b468fdd42..da4c6fc11 100644 --- a/docs/_basic/ja_listening_actions.md +++ b/docs/_basic/ja_listening_actions.md @@ -32,7 +32,7 @@ def update_message(ack):
    -制約付きのオブジェクトを使用すると、`callback_id`、`block_id`、および `action_id` をそれぞれ、または任意に組み合わせてリッスンできます。オブジェクト内の制約は、`str` 型または `re.Pattern` 型で指定できます。 +制約付きのオブジェクトを使用すると、`block_id` と `action_id` をそれぞれ、または任意に組み合わせてリッスンできます。オブジェクト内の制約は、`str` 型または `re.Pattern` 型で指定できます。
    diff --git a/docs/_basic/listening_actions.md b/docs/_basic/listening_actions.md index 23312a8e3..bd5209b42 100644 --- a/docs/_basic/listening_actions.md +++ b/docs/_basic/listening_actions.md @@ -32,7 +32,7 @@ def update_message(ack):
    -You can use a constraints object to listen to `callback_id`s, `block_id`s, and `action_id`s (or any combination of them). Constraints in the object can be of type `str` or `re.Pattern`. +You can use a constraints object to listen to `block_id`s and `action_id`s (or any combination of them). Constraints in the object can be of type `str` or `re.Pattern`.
    From b24e4cbfbb082560eb5391b60b918ff9fed358cb Mon Sep 17 00:00:00 2001 From: Anton Butsyk Date: Thu, 15 Jun 2023 05:12:01 +0300 Subject: [PATCH 448/719] Add port parameter to web_app (#917) --- slack_bolt/app/async_app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 7dca75b34..c70fc2e54 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -470,7 +470,7 @@ def server( ) return self._server - def web_app(self, path: str = "/slack/events") -> web.Application: + def web_app(self, path: str = "/slack/events", port: int = 3000) -> web.Application: """Returns a `web.Application` instance for aiohttp-devtools users. from slack_bolt.async_app import AsyncApp @@ -488,8 +488,9 @@ def app_factory(): Args: path: The path to receive incoming requests from Slack + port: The port to listen on (Default: 3000) """ - return self.server(path=path).web_app + return self.server(path=path, port=port).web_app def start(self, port: int = 3000, path: str = "/slack/events", host: Optional[str] = None) -> None: """Start a web server using AIOHTTP. From 3e5f012767d37eaa01fb0ea55bd6ae364ecf320b Mon Sep 17 00:00:00 2001 From: Vignesh Iyer <39982819+vgnshiyer@users.noreply.github.com> Date: Wed, 14 Jun 2023 22:48:45 -0700 Subject: [PATCH 449/719] Fix #892 by improving test code (#918) --- .github/workflows/codecov.yml | 32 +++++++++---------- .../socket_mode/test_async_aiohttp.py | 4 +-- .../socket_mode/test_async_lazy_listeners.py | 4 +-- .../socket_mode/test_async_websockets.py | 4 +-- tests/adapter_tests_async/test_async_sanic.py | 4 +-- tests/scenario_tests_async/test_app.py | 4 +-- .../test_app_actor_user_token.py | 4 +-- .../scenario_tests_async/test_app_bot_only.py | 4 +-- .../test_app_custom_authorize.py | 4 +-- .../scenario_tests_async/test_app_dispatch.py | 4 +-- .../test_app_installation_store.py | 4 +-- .../test_app_using_methods_in_class.py | 4 +-- .../test_attachment_actions.py | 4 +-- tests/scenario_tests_async/test_authorize.py | 4 +-- .../test_block_actions.py | 4 +-- .../test_block_actions_respond.py | 4 +-- .../test_block_suggestion.py | 4 +-- tests/scenario_tests_async/test_dialogs.py | 4 +-- .../test_error_handler.py | 4 +-- tests/scenario_tests_async/test_events.py | 4 +-- .../test_events_ignore_self.py | 4 +-- .../test_events_org_apps.py | 4 +-- .../test_events_request_verification.py | 4 +-- .../test_events_shared_channels.py | 4 +-- .../test_events_socket_mode.py | 4 +-- .../test_events_token_revocations.py | 4 +-- .../test_events_url_verification.py | 4 +-- .../test_installation_store_authorize.py | 4 +-- tests/scenario_tests_async/test_lazy.py | 4 +-- .../test_listener_middleware.py | 4 +-- tests/scenario_tests_async/test_message.py | 4 +-- .../scenario_tests_async/test_message_bot.py | 4 +-- .../test_message_changed.py | 4 +-- .../test_message_deleted.py | 4 +-- .../test_message_file_share.py | 4 +-- .../test_message_thread_broadcast.py | 4 +-- tests/scenario_tests_async/test_middleware.py | 4 +-- tests/scenario_tests_async/test_shortcut.py | 4 +-- .../test_slash_command.py | 4 +-- tests/scenario_tests_async/test_ssl_check.py | 4 +-- .../scenario_tests_async/test_view_closed.py | 4 +-- .../test_view_submission.py | 4 +-- .../test_web_client_customization.py | 4 +-- .../test_workflow_steps.py | 4 +-- .../test_workflow_steps_decorator_simple.py | 4 +-- ...test_workflow_steps_decorator_with_args.py | 4 +-- .../authorization/test_async_authorize.py | 4 +-- .../context/test_async_respond.py | 3 +- .../context/test_async_say.py | 3 +- .../test_single_team_authorization.py | 4 +-- .../test_request_verification.py | 3 +- .../oauth/test_async_oauth_flow.py | 3 +- .../oauth/test_async_oauth_flow_sqlite3.py | 3 +- tests/utils.py | 11 ++++++- 54 files changed, 130 insertions(+), 116 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 9fa9e3953..6d1ab0e52 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -24,19 +24,19 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} -# - name: Install dependencies -# run: | -# python setup.py install -# pip install -U pip -# pip install -e ".[async]" -# pip install -e ".[adapter]" -# pip install -e ".[testing]" -# pip install -e ".[adapter_testing]" -# - name: Run all tests for codecov -# run: | -# pytest --cov=./slack_bolt/ --cov-report=xml -# - name: Upload coverage to Codecov -# uses: codecov/codecov-action@v3 -# with: -# fail_ci_if_error: true -# verbose: true + - name: Install dependencies + run: | + python setup.py install + pip install -U pip + pip install -e ".[async]" + pip install -e ".[adapter]" + pip install -e ".[testing]" + pip install -e ".[adapter_testing]" + - name: Run all tests for codecov + run: | + pytest --cov=./slack_bolt/ --cov-report=xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + fail_ci_if_error: true + verbose: true diff --git a/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py b/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py index 1877514e0..fa2e7dc6e 100644 --- a/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py +++ b/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py @@ -9,7 +9,7 @@ setup_mock_web_api_server, cleanup_mock_web_api_server, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop from ...adapter_tests.socket_mode.mock_socket_mode_server import ( start_socket_mode_server, stop_socket_mode_server_async, @@ -29,7 +29,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/adapter_tests_async/socket_mode/test_async_lazy_listeners.py b/tests/adapter_tests_async/socket_mode/test_async_lazy_listeners.py index 28d24c399..21fef7f02 100644 --- a/tests/adapter_tests_async/socket_mode/test_async_lazy_listeners.py +++ b/tests/adapter_tests_async/socket_mode/test_async_lazy_listeners.py @@ -9,7 +9,7 @@ setup_mock_web_api_server, cleanup_mock_web_api_server, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop from ...adapter_tests.socket_mode.mock_socket_mode_server import ( start_socket_mode_server, stop_socket_mode_server_async, @@ -29,7 +29,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/adapter_tests_async/socket_mode/test_async_websockets.py b/tests/adapter_tests_async/socket_mode/test_async_websockets.py index b8574e623..9e6db75ee 100644 --- a/tests/adapter_tests_async/socket_mode/test_async_websockets.py +++ b/tests/adapter_tests_async/socket_mode/test_async_websockets.py @@ -9,7 +9,7 @@ setup_mock_web_api_server, cleanup_mock_web_api_server, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop from ...adapter_tests.socket_mode.mock_socket_mode_server import ( start_socket_mode_server, stop_socket_mode_server_async, @@ -29,7 +29,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/adapter_tests_async/test_async_sanic.py b/tests/adapter_tests_async/test_async_sanic.py index b4a75431f..6a472704c 100644 --- a/tests/adapter_tests_async/test_async_sanic.py +++ b/tests/adapter_tests_async/test_async_sanic.py @@ -17,7 +17,7 @@ cleanup_mock_web_api_server, assert_auth_test_count, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestSanic: @@ -39,7 +39,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_app.py b/tests/scenario_tests_async/test_app.py index 3c6e6d064..c0cf0a7ab 100644 --- a/tests/scenario_tests_async/test_app.py +++ b/tests/scenario_tests_async/test_app.py @@ -19,7 +19,7 @@ setup_mock_web_api_server, cleanup_mock_web_api_server, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncApp: @@ -32,7 +32,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_app_actor_user_token.py b/tests/scenario_tests_async/test_app_actor_user_token.py index f0d3ea2e7..b01179200 100644 --- a/tests/scenario_tests_async/test_app_actor_user_token.py +++ b/tests/scenario_tests_async/test_app_actor_user_token.py @@ -23,7 +23,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestApp: @@ -41,7 +41,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_app_bot_only.py b/tests/scenario_tests_async/test_app_bot_only.py index e557a6588..74fb29e8a 100644 --- a/tests/scenario_tests_async/test_app_bot_only.py +++ b/tests/scenario_tests_async/test_app_bot_only.py @@ -22,7 +22,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAppBotOnly: @@ -40,7 +40,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_app_custom_authorize.py b/tests/scenario_tests_async/test_app_custom_authorize.py index 43fab3f6c..8db019150 100644 --- a/tests/scenario_tests_async/test_app_custom_authorize.py +++ b/tests/scenario_tests_async/test_app_custom_authorize.py @@ -26,7 +26,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAppCustomAuthorize: @@ -44,7 +44,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_app_dispatch.py b/tests/scenario_tests_async/test_app_dispatch.py index 34396a2d1..f81ef004d 100644 --- a/tests/scenario_tests_async/test_app_dispatch.py +++ b/tests/scenario_tests_async/test_app_dispatch.py @@ -9,7 +9,7 @@ setup_mock_web_api_server, cleanup_mock_web_api_server, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncAppDispatch: @@ -23,7 +23,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_app_installation_store.py b/tests/scenario_tests_async/test_app_installation_store.py index 75e0648de..7a56c81e9 100644 --- a/tests/scenario_tests_async/test_app_installation_store.py +++ b/tests/scenario_tests_async/test_app_installation_store.py @@ -23,7 +23,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestApp: @@ -41,7 +41,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_app_using_methods_in_class.py b/tests/scenario_tests_async/test_app_using_methods_in_class.py index d188884e7..ce9ffbf1e 100644 --- a/tests/scenario_tests_async/test_app_using_methods_in_class.py +++ b/tests/scenario_tests_async/test_app_using_methods_in_class.py @@ -18,7 +18,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAppUsingMethodsInClass: @@ -36,7 +36,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_attachment_actions.py b/tests/scenario_tests_async/test_attachment_actions.py index 628e546ab..405b8d8b5 100644 --- a/tests/scenario_tests_async/test_attachment_actions.py +++ b/tests/scenario_tests_async/test_attachment_actions.py @@ -14,7 +14,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncAttachmentActions: @@ -32,7 +32,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_authorize.py b/tests/scenario_tests_async/test_authorize.py index dec9ebc2c..40edaba8e 100644 --- a/tests/scenario_tests_async/test_authorize.py +++ b/tests/scenario_tests_async/test_authorize.py @@ -17,7 +17,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop valid_token = "xoxb-valid" valid_user_token = "xoxp-valid" @@ -66,7 +66,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_block_actions.py b/tests/scenario_tests_async/test_block_actions.py index bfd168f36..cdbb09c9c 100644 --- a/tests/scenario_tests_async/test_block_actions.py +++ b/tests/scenario_tests_async/test_block_actions.py @@ -15,7 +15,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncBlockActions: @@ -33,7 +33,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_block_actions_respond.py b/tests/scenario_tests_async/test_block_actions_respond.py index 87e670fe7..18aef7e10 100644 --- a/tests/scenario_tests_async/test_block_actions_respond.py +++ b/tests/scenario_tests_async/test_block_actions_respond.py @@ -10,7 +10,7 @@ setup_mock_web_api_server, cleanup_mock_web_api_server, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncBlockActionsRespond: @@ -27,7 +27,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_block_suggestion.py b/tests/scenario_tests_async/test_block_suggestion.py index 970ae0662..bead06ee8 100644 --- a/tests/scenario_tests_async/test_block_suggestion.py +++ b/tests/scenario_tests_async/test_block_suggestion.py @@ -15,7 +15,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncBlockSuggestion: @@ -33,7 +33,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_dialogs.py b/tests/scenario_tests_async/test_dialogs.py index 740b29546..e5c3a36ef 100644 --- a/tests/scenario_tests_async/test_dialogs.py +++ b/tests/scenario_tests_async/test_dialogs.py @@ -14,7 +14,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncAttachmentActions: @@ -32,7 +32,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_error_handler.py b/tests/scenario_tests_async/test_error_handler.py index 9f9b01c41..056e63d91 100644 --- a/tests/scenario_tests_async/test_error_handler.py +++ b/tests/scenario_tests_async/test_error_handler.py @@ -15,7 +15,7 @@ setup_mock_web_api_server, cleanup_mock_web_api_server, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncErrorHandler: @@ -33,7 +33,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_events.py b/tests/scenario_tests_async/test_events.py index 1aac39b26..8220db402 100644 --- a/tests/scenario_tests_async/test_events.py +++ b/tests/scenario_tests_async/test_events.py @@ -18,7 +18,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncEvents: @@ -36,7 +36,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_events_ignore_self.py b/tests/scenario_tests_async/test_events_ignore_self.py index b84589806..83011dfe1 100644 --- a/tests/scenario_tests_async/test_events_ignore_self.py +++ b/tests/scenario_tests_async/test_events_ignore_self.py @@ -10,7 +10,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncEventsIgnoreSelf: @@ -26,7 +26,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_events_org_apps.py b/tests/scenario_tests_async/test_events_org_apps.py index 586eed9ec..890abe053 100644 --- a/tests/scenario_tests_async/test_events_org_apps.py +++ b/tests/scenario_tests_async/test_events_org_apps.py @@ -18,7 +18,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop valid_token = "xoxb-valid" @@ -60,7 +60,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_events_request_verification.py b/tests/scenario_tests_async/test_events_request_verification.py index 2ed570f14..f05f09122 100644 --- a/tests/scenario_tests_async/test_events_request_verification.py +++ b/tests/scenario_tests_async/test_events_request_verification.py @@ -13,7 +13,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncEventsRequestVerification: @@ -28,7 +28,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_events_shared_channels.py b/tests/scenario_tests_async/test_events_shared_channels.py index 8dfb87a4c..4023034e2 100644 --- a/tests/scenario_tests_async/test_events_shared_channels.py +++ b/tests/scenario_tests_async/test_events_shared_channels.py @@ -16,7 +16,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop valid_token = "xoxb-valid" @@ -43,7 +43,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_events_socket_mode.py b/tests/scenario_tests_async/test_events_socket_mode.py index 5ddd8b10c..05a19106d 100644 --- a/tests/scenario_tests_async/test_events_socket_mode.py +++ b/tests/scenario_tests_async/test_events_socket_mode.py @@ -12,7 +12,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncEvents: @@ -28,7 +28,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_events_token_revocations.py b/tests/scenario_tests_async/test_events_token_revocations.py index 5f7bb80a9..a4ded33ee 100644 --- a/tests/scenario_tests_async/test_events_token_revocations.py +++ b/tests/scenario_tests_async/test_events_token_revocations.py @@ -18,7 +18,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop valid_token = "xoxb-valid" @@ -54,7 +54,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_events_url_verification.py b/tests/scenario_tests_async/test_events_url_verification.py index 0c62397e9..91c142c56 100644 --- a/tests/scenario_tests_async/test_events_url_verification.py +++ b/tests/scenario_tests_async/test_events_url_verification.py @@ -13,7 +13,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncEventsUrlVerification: @@ -28,7 +28,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_installation_store_authorize.py b/tests/scenario_tests_async/test_installation_store_authorize.py index 8c2249cc6..0b206910e 100644 --- a/tests/scenario_tests_async/test_installation_store_authorize.py +++ b/tests/scenario_tests_async/test_installation_store_authorize.py @@ -19,7 +19,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop valid_token = "xoxb-valid" valid_user_token = "xoxp-valid" @@ -69,7 +69,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_lazy.py b/tests/scenario_tests_async/test_lazy.py index 50ae02795..55c6041c4 100644 --- a/tests/scenario_tests_async/test_lazy.py +++ b/tests/scenario_tests_async/test_lazy.py @@ -13,7 +13,7 @@ setup_mock_web_api_server, cleanup_mock_web_api_server, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncLazy: @@ -31,7 +31,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_listener_middleware.py b/tests/scenario_tests_async/test_listener_middleware.py index bf3914468..29fc085b3 100644 --- a/tests/scenario_tests_async/test_listener_middleware.py +++ b/tests/scenario_tests_async/test_listener_middleware.py @@ -13,7 +13,7 @@ setup_mock_web_api_server, cleanup_mock_web_api_server, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncListenerMiddleware: @@ -31,7 +31,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_message.py b/tests/scenario_tests_async/test_message.py index c11c3e8c8..2c8e9bcec 100644 --- a/tests/scenario_tests_async/test_message.py +++ b/tests/scenario_tests_async/test_message.py @@ -15,7 +15,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncMessage: @@ -33,7 +33,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_message_bot.py b/tests/scenario_tests_async/test_message_bot.py index 0dfe8c07e..9aed50efb 100644 --- a/tests/scenario_tests_async/test_message_bot.py +++ b/tests/scenario_tests_async/test_message_bot.py @@ -13,7 +13,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncMessage: @@ -31,7 +31,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_message_changed.py b/tests/scenario_tests_async/test_message_changed.py index 58ba7f597..5be887ac6 100644 --- a/tests/scenario_tests_async/test_message_changed.py +++ b/tests/scenario_tests_async/test_message_changed.py @@ -12,7 +12,7 @@ setup_mock_web_api_server, cleanup_mock_web_api_server, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncMessageChanged: @@ -30,7 +30,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_message_deleted.py b/tests/scenario_tests_async/test_message_deleted.py index db444258c..9a80b26bd 100644 --- a/tests/scenario_tests_async/test_message_deleted.py +++ b/tests/scenario_tests_async/test_message_deleted.py @@ -12,7 +12,7 @@ setup_mock_web_api_server, cleanup_mock_web_api_server, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncMessageDeleted: @@ -30,7 +30,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_message_file_share.py b/tests/scenario_tests_async/test_message_file_share.py index 4130c6fb7..cfe162b5d 100644 --- a/tests/scenario_tests_async/test_message_file_share.py +++ b/tests/scenario_tests_async/test_message_file_share.py @@ -13,7 +13,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncMessageFileShare: @@ -31,7 +31,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_message_thread_broadcast.py b/tests/scenario_tests_async/test_message_thread_broadcast.py index 84ae3ea93..22245862b 100644 --- a/tests/scenario_tests_async/test_message_thread_broadcast.py +++ b/tests/scenario_tests_async/test_message_thread_broadcast.py @@ -13,7 +13,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncMessageThreadBroadcast: @@ -31,7 +31,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_middleware.py b/tests/scenario_tests_async/test_middleware.py index 10311087e..30e1fc6dd 100644 --- a/tests/scenario_tests_async/test_middleware.py +++ b/tests/scenario_tests_async/test_middleware.py @@ -13,7 +13,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop # Note that async middleware system does not support instance methods n a class. @@ -32,7 +32,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_shortcut.py b/tests/scenario_tests_async/test_shortcut.py index f4f1d6d87..7c1c3df07 100644 --- a/tests/scenario_tests_async/test_shortcut.py +++ b/tests/scenario_tests_async/test_shortcut.py @@ -14,7 +14,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncShortcut: @@ -32,7 +32,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_slash_command.py b/tests/scenario_tests_async/test_slash_command.py index 42e427db0..279cd4b06 100644 --- a/tests/scenario_tests_async/test_slash_command.py +++ b/tests/scenario_tests_async/test_slash_command.py @@ -13,7 +13,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncSlashCommand: @@ -31,7 +31,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_ssl_check.py b/tests/scenario_tests_async/test_ssl_check.py index 651255903..c70d5144d 100644 --- a/tests/scenario_tests_async/test_ssl_check.py +++ b/tests/scenario_tests_async/test_ssl_check.py @@ -11,7 +11,7 @@ setup_mock_web_api_server, cleanup_mock_web_api_server, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncSSLCheck: @@ -29,7 +29,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_view_closed.py b/tests/scenario_tests_async/test_view_closed.py index 53c164c53..5fe7ebc88 100644 --- a/tests/scenario_tests_async/test_view_closed.py +++ b/tests/scenario_tests_async/test_view_closed.py @@ -14,7 +14,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncViewClosed: @@ -32,7 +32,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_view_submission.py b/tests/scenario_tests_async/test_view_submission.py index 21ddd3220..e5423c8fd 100644 --- a/tests/scenario_tests_async/test_view_submission.py +++ b/tests/scenario_tests_async/test_view_submission.py @@ -14,7 +14,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop body = { @@ -204,7 +204,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_web_client_customization.py b/tests/scenario_tests_async/test_web_client_customization.py index 6f810b471..9dad00492 100644 --- a/tests/scenario_tests_async/test_web_client_customization.py +++ b/tests/scenario_tests_async/test_web_client_customization.py @@ -16,7 +16,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestWebClientCustomization: @@ -34,7 +34,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_workflow_steps.py b/tests/scenario_tests_async/test_workflow_steps.py index 2108fc519..4cc2a03fe 100644 --- a/tests/scenario_tests_async/test_workflow_steps.py +++ b/tests/scenario_tests_async/test_workflow_steps.py @@ -21,7 +21,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncWorkflowSteps: @@ -39,7 +39,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_workflow_steps_decorator_simple.py b/tests/scenario_tests_async/test_workflow_steps_decorator_simple.py index 40ef93dc4..88c5aefa6 100644 --- a/tests/scenario_tests_async/test_workflow_steps_decorator_simple.py +++ b/tests/scenario_tests_async/test_workflow_steps_decorator_simple.py @@ -20,7 +20,7 @@ setup_mock_web_api_server, cleanup_mock_web_api_server, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncWorkflowStepsDecorator: @@ -41,7 +41,7 @@ def event_loop(self): self.app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) self.app.step(copy_review_step) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/scenario_tests_async/test_workflow_steps_decorator_with_args.py b/tests/scenario_tests_async/test_workflow_steps_decorator_with_args.py index 37fc868f3..622c79602 100644 --- a/tests/scenario_tests_async/test_workflow_steps_decorator_with_args.py +++ b/tests/scenario_tests_async/test_workflow_steps_decorator_with_args.py @@ -21,7 +21,7 @@ setup_mock_web_api_server, cleanup_mock_web_api_server, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncWorkflowStepsDecorator: @@ -42,7 +42,7 @@ def event_loop(self): self.app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) self.app.step(copy_review_step) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/slack_bolt_async/authorization/test_async_authorize.py b/tests/slack_bolt_async/authorization/test_async_authorize.py index 4ca41e14a..ed57d2d24 100644 --- a/tests/slack_bolt_async/authorization/test_async_authorize.py +++ b/tests/slack_bolt_async/authorization/test_async_authorize.py @@ -22,7 +22,7 @@ cleanup_mock_web_api_server, assert_auth_test_count_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop class TestAsyncAuthorize: @@ -36,7 +36,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/slack_bolt_async/context/test_async_respond.py b/tests/slack_bolt_async/context/test_async_respond.py index 9332ecac4..7523c5235 100644 --- a/tests/slack_bolt_async/context/test_async_respond.py +++ b/tests/slack_bolt_async/context/test_async_respond.py @@ -2,6 +2,7 @@ import pytest +from tests.utils import get_event_loop from slack_bolt.context.respond.async_respond import AsyncRespond from tests.mock_web_api_server import ( setup_mock_web_api_server, @@ -13,7 +14,7 @@ class TestAsyncRespond: @pytest.fixture def event_loop(self): setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/slack_bolt_async/context/test_async_say.py b/tests/slack_bolt_async/context/test_async_say.py index d18a96a80..422db2f19 100644 --- a/tests/slack_bolt_async/context/test_async_say.py +++ b/tests/slack_bolt_async/context/test_async_say.py @@ -4,6 +4,7 @@ from slack_sdk.web.async_client import AsyncWebClient from slack_sdk.web.async_slack_response import AsyncSlackResponse +from tests.utils import get_event_loop from slack_bolt.context.say.async_say import AsyncSay from tests.mock_web_api_server import ( setup_mock_web_api_server, @@ -19,7 +20,7 @@ def event_loop(self): mock_api_server_base_url = "http://localhost:8888" self.web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/slack_bolt_async/middleware/authorization/test_single_team_authorization.py b/tests/slack_bolt_async/middleware/authorization/test_single_team_authorization.py index fcb34db2f..68112f2c0 100644 --- a/tests/slack_bolt_async/middleware/authorization/test_single_team_authorization.py +++ b/tests/slack_bolt_async/middleware/authorization/test_single_team_authorization.py @@ -13,7 +13,7 @@ setup_mock_web_api_server, cleanup_mock_web_api_server, ) -from tests.utils import remove_os_env_temporarily, restore_os_env +from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop async def next(): @@ -28,7 +28,7 @@ def event_loop(self): old_os_env = remove_os_env_temporarily() try: setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/slack_bolt_async/middleware/request_verification/test_request_verification.py b/tests/slack_bolt_async/middleware/request_verification/test_request_verification.py index 07f55337d..1c30cb091 100644 --- a/tests/slack_bolt_async/middleware/request_verification/test_request_verification.py +++ b/tests/slack_bolt_async/middleware/request_verification/test_request_verification.py @@ -2,6 +2,7 @@ from time import time import pytest +from tests.utils import get_event_loop from slack_sdk.signature import SignatureVerifier from slack_bolt.middleware.request_verification.async_request_verification import ( @@ -34,7 +35,7 @@ def build_headers(self, timestamp: str, body: str): @pytest.fixture def event_loop(self): - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() diff --git a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py index 43ee7b3da..0491b1747 100644 --- a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py +++ b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py @@ -4,6 +4,7 @@ from urllib.parse import quote import pytest +from tests.utils import get_event_loop from slack_sdk.oauth.installation_store import FileInstallationStore from slack_sdk.oauth.state_store import FileOAuthStateStore from slack_sdk.oauth.state_store.async_state_store import AsyncOAuthStateStore @@ -35,7 +36,7 @@ class TestAsyncOAuthFlow: @pytest.fixture def event_loop(self): setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py b/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py index c9190ff55..182fef764 100644 --- a/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py +++ b/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py @@ -3,6 +3,7 @@ import pytest from slack_sdk.web.async_client import AsyncWebClient +from tests.utils import get_event_loop from slack_bolt import BoltResponse from slack_bolt.oauth.async_callback_options import ( AsyncFailureArgs, @@ -23,7 +24,7 @@ class TestAsyncOAuthFlowSQLite3: @pytest.fixture def event_loop(self): setup_mock_web_api_server(self) - loop = asyncio.get_event_loop() + loop = get_event_loop() yield loop loop.close() cleanup_mock_web_api_server(self) diff --git a/tests/utils.py b/tests/utils.py index e6c75903d..d56ecf900 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,5 +1,5 @@ import os - +import asyncio def remove_os_env_temporarily() -> dict: old_env = os.environ.copy() @@ -27,3 +27,12 @@ def get_mock_server_mode() -> str: return "threading" else: return mode + +def get_event_loop(): + try: + return asyncio.get_event_loop() + except RuntimeError as ex: + if "There is no current event loop in thread" in str(ex): + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) + return loop From 17e37661c144b75522c8a7911238be01c2707804 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Thu, 6 Jul 2023 19:24:04 -0400 Subject: [PATCH 450/719] Remove beta documentation (#929) --- docs/_config.yml | 3 - docs/_future/concepts.md | 19 -- docs/_future/deploy_your_app.md | 16 -- docs/_future/getting_started_future.md | 145 -------------- .../_future/listening_responding_functions.md | 105 ---------- docs/_future/manifest.md | 181 ------------------ docs/_future/manifest_functions.md | 92 --------- docs/_future/manifest_workflows.md | 159 --------------- docs/_future/setup_existing_app.md | 122 ------------ docs/_includes/sidebar.html | 24 --- docs/_layouts/future.html | 47 ----- docs/assets/style.css | 35 +--- docs/scripts/future_search_hash.js | 17 -- 13 files changed, 1 insertion(+), 964 deletions(-) delete mode 100644 docs/_future/concepts.md delete mode 100644 docs/_future/deploy_your_app.md delete mode 100644 docs/_future/getting_started_future.md delete mode 100644 docs/_future/listening_responding_functions.md delete mode 100644 docs/_future/manifest.md delete mode 100644 docs/_future/manifest_functions.md delete mode 100644 docs/_future/manifest_workflows.md delete mode 100644 docs/_future/setup_existing_app.md delete mode 100644 docs/_layouts/future.html delete mode 100644 docs/scripts/future_search_hash.js diff --git a/docs/_config.yml b/docs/_config.yml index 1ed696b75..a8d7fa15c 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -18,9 +18,6 @@ collections: tutorials: output: true permalink: /tutorials/:slug - future: - output: true - permalink: /future/:slug defaults: - scope: diff --git a/docs/_future/concepts.md b/docs/_future/concepts.md deleted file mode 100644 index 74c83aed1..000000000 --- a/docs/_future/concepts.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: Slack developer beta -lang: en -slug: concepts -order: 0 -layout: future -permalink: /future/concepts ---- -# Slack developer beta concepts BETA - -
    - -This page contains all the concepts that are necessary to allow you to use the next-gen Slack features in Python. - -

    - -Our next-generation platform is currently in beta. Your feedback is most welcome - all feedback will help shape the future platform experience! -

    -
    diff --git a/docs/_future/deploy_your_app.md b/docs/_future/deploy_your_app.md deleted file mode 100644 index ed114a163..000000000 --- a/docs/_future/deploy_your_app.md +++ /dev/null @@ -1,16 +0,0 @@ ---- - -title: Deploy your app -lang: en -slug: deploy-your-app -order: 6 -layout: tutorial -permalink: /tutorial/deploy-your-app ---- -# Deploy your app BETA - -
    -Instructions for deploying your next-generation Bolt Python application to third-party infrastructure are coming soon! Stay tuned. - -

    Our next-generation platform is currently in beta. Your feedback is most welcome - all feedback will help shape the future platform experience!

    -
    diff --git a/docs/_future/getting_started_future.md b/docs/_future/getting_started_future.md deleted file mode 100644 index d33658314..000000000 --- a/docs/_future/getting_started_future.md +++ /dev/null @@ -1,145 +0,0 @@ ---- -title: Getting started -order: 1 -slug: getting-started-future -lang: en -layout: tutorial -permalink: /tutorial/getting-started-future ---- -## Getting started BETA - -
    -This guide will cover how to get started with your next-gen platform using Bolt for Python, by setting up the Slack CLI and installing the required dependencies. - -Find out about the next-generation platform on Slack's official introduction page. -
    - ---- - -### Limitations - -Bolt for Python supports app development using next-gen platform features like Functions, Workflows and tools such as the Slack CLI alongside all current generally available Slack Platform features. - -#### We do not yet support - -- Deployment to secure and managed Slack infrastructure. -- Datastores API Datastores functionality. - -> 💡 If you'd like to deploy your app with Slack infrastructure, consider building your next-generation application with the Deno Slack API. You can get started with that here. - ---- - -### Setting up {#setting-up} - -#### Slack CLI {#setting-up-cli} - -To build a next-generation app with Bolt for Python, you'll need to get the Slack CLI. - -Install the Slack CLI by following this Quickstart. Since we won't be using Deno to build our next-generation app, you can skip any instructions related to installing Deno or creating an app using a Deno template. Once you've logged into the CLI using `slack login` and verified your login using `slack auth list`, you can proceed with the instructions in this guide. - -#### Dependencies {#setting-up-dependencies} - -Once the CLI is set up, make sure your machine has the most recent version of Python installed. You can install Python through a package manager (such as Homebrew for macOS) or directly from the website. - ---- - -### Create a new app {#create-app} - -Before you start developing with Bolt, you'll want to create a Slack app. - -To create the app, you'll run the following command: - -```bash -slack create my-app -t slack-samples/bolt-python-starter-template -b future -``` - -This command creates an app through the CLI by cloning a specified template. In this case, the template is the Bolt for Python Starter Template on the `future` branch. This starter template includes a "Hello World" example that demonstrates how to use built-in and custom Functions, Triggers and Workflows. - -Once the app is successfully created, you should see a message like this: - -```text -✨ my-app successfully created - -🧭 Explore your project's README.md for documentation and code samples, and at any time run slack help to display a list of available commands - -🧑‍🚀 Follow the steps below to try out your new project - -1️⃣ Change into your project directory with: cd my-app - -2️⃣ Develop locally and see changes in real-time with: slack run - -3️⃣ When you're ready to deploy for production use: slack deploy - -🔔 If you leave the workspace, you won’t be able to manage any apps you’ve deployed to it. Apps you deploy will belong to the workspace even if you leave the workspace -``` - ---- - -### Set up your trigger {#setup-trigger} - -As mentioned, this app comes with pre-existing functionality - it uses Functions, Workflows and a Link Trigger that will allow users in Slack to initiate the functionality provided by the app. Let's run a command to initialize that Link Trigger via the CLI. - -First, make sure you're in the project directory in your command line: `cd my-app` - -Then, run the following command to create a Trigger: - -```bash -slack triggers create --trigger-def "triggers/sample-trigger.json" -``` - -The above command will create a Link Trigger for the selected workspace. Make sure to select the workspace you want. Once the trigger is successfully created, you should see an output like this: - -```bash -⚡ Trigger created - Trigger ID: [ID] - Trigger Type: shortcut - Trigger Name: Sample Trigger - URL: https://slack.com/shortcuts/[ID]/[Some ID] -``` - -The provided URL can be pasted into Slack; Slack will unfurl it into a button that users can interact with to initiate your app's functionality! Copy this URL and save it somewhere; you'll need it for later. - ---- - -### Run your app {#run-your-app} - -Now that your app and Trigger are successfully created, let's try running it! - -```bash -# install the required project dependencies -pip install -r requirements.txt - -# start a local development server -slack run -``` - -Executing `pip install -r requirements.txt` installs all the project requirements to your machine. - -Executing `slack run` starts a local development server, syncing changes to your workspace's development version of your app. - -You'll be prompted to select a workspace to install the app to—select the development instance of your workspace (you'll know it's the development version because the name has the string `(dev)` appended). - -> 💡 If you don't see the workspace you'd like to use in the list, you can `CTRL + C` out of the `slack run` command and run `slack auth login`. This will allow you to authenticate in your desired workspace to have it show up in the list for `slack run`. - -You'll see an output in your Terminal to indicate your app is running, similar to what you would see with any other Bolt for Python app. You can search for the `⚡️ Bolt app is running! ⚡️` message to make sure that your app has successfully started up. - -### Trigger your app's workflow {#trigger-workflow} - -With your app running, access your workspace and paste the URL from the Trigger you created in the [previous step](/bolt-python/tutorial/getting-started-future#setup-trigger) into a message in a public channel. - -> 💡 App Triggers are automatically saved as a channel bookmark under "Workflows" for easy access. - -Send the message and click the "Run" button that appears. A modal will appear prompting you to enter information to greet someone in your Slack workspace. Fill out the requested information. - -![Hello World modal](https://slack.dev/bolt-js/assets/hello-world-modal.png "Hello World modal") - -Then, submit the form. In the specified channel submitted in the form, you should receive a message from the app tagging the submitted user. The message will also contain a randomly generated greeting and the message you wrote in the form. - -The full app flow can be seen here: -![Hello World app](https://slack.dev/bolt-js/assets/hello-world-demo.gif "Hello World app") - ---- - -### Next steps {#next-steps} - -Now we have a working instance of a next-generation app in your workspace and you've seen it in action! You can explore on your own and dive into the code yourself here or continue your learning journey by diving into [App Manifests](/bolt-python/future/concepts#manifests) or looking into adding more [Functions](/bolt-python/future/concepts#functions), [Workflows](/bolt-python/future/concepts#manifest-workflows), and [Triggers](#setup-trigger) to your app! diff --git a/docs/_future/listening_responding_functions.md b/docs/_future/listening_responding_functions.md deleted file mode 100644 index b7c13c692..000000000 --- a/docs/_future/listening_responding_functions.md +++ /dev/null @@ -1,105 +0,0 @@ ---- -title: Listening & responding to functions -lang: en -slug: functions -order: 5 -layout: future ---- - -
    - -Your app can use the `function()` method to listen to incoming function requests. The method requires a function `callback_id` of type `str`. This `callback_id` must also be defined in your [Function](/bolt-python/future/concepts#manifest-functions) definition. Functions must eventually be completed with the `complete()` function to inform Slack that your app has processed the function request. `complete()` requires **one of two** keyword arguments: `outputs` or `error`. There are two ways to complete a Function with `complete()`: - -* `outputs` of type `dict` completes your function **successfully** and provides a dictionary containing the outputs of your function as defined in the app's manifest. -* `error` of type `str` completes your function **unsuccessfully** and provides a message containing information regarding why your function was not successful. - -
    - -
    -Refer to the module document to learn the available listener arguments. -```python -# The sample function simply outputs an input -@app.function("sample_function") -def sample_func(event: dict, complete: Complete): - try: - message = event["inputs"]["message"] - complete( - outputs={ - "updatedMsg": f":wave: You submitted the following message: \n\n>{message}" - } - ) - except Exception as e: - complete(error=f"Cannot submit the message: {e}") - raise e -``` -
    - -
    - -

    Function Interactivity

    -
    - -
    - -The `function()` method returns a `SlackFunction` decorator object. This object can be used by your app to set up interactive listeners such as [actions](/bolt-python/concepts#action-respond) and [views](/bolt-python/concepts#view_submissions). These listeners listen to events created during the handling of your `function` event. Additionally, they will only be called when a user interacts with a block element that has the following attributes: - -* It was created during the handling of a `function` event. -* The `action_id` matches the interactive listeners `action_id`. - -These listeners behave similarly to the ones assigned directly to your app. The notable difference is that `complete()` must be called once your function is completed. - -
    - -```python -# Your listener will be called when your function "sample_function" is triggered from a workflow -# When triggered a message containing a button with an action_id "approve_button" is posted -@app.function("sample_function") -def sample_func(event: dict, complete: Complete): - try: - client.chat_postMessage( - channel="a-channel-id", - text="A new button appears", - blocks=[ - { - "type": "actions", - "block_id": "approve-button", - "elements": [ - { - "type": "button", - "text": { - "type": "plain_text", - "text": "Click", - }, - "action_id": "sample_action", - "style": "primary", - }, - ], - }, - ], - ) - except Exception as e: - complete(error=f"Cannot post the message: {e}") - raise e - -# Your listener will be called when a block element -# - Created by your "sample_func" -# - With the action_id "sample_action" -# is triggered -@sample_func.action("sample_action") -def update_message(ack, body, client, complete): - try: - ack() - if "container" in body and "message_ts" in body["container"]: - client.reactions_add( - name="white_check_mark", - channel=body["channel"]["id"], - timestamp=body["container"]["message_ts"], - ) - complete() - except Exception as e: - logger.error(e) - complete(error=f"Cannot react to message: {e}") - raise e -``` - -
    diff --git a/docs/_future/manifest.md b/docs/_future/manifest.md deleted file mode 100644 index 26b77f28a..000000000 --- a/docs/_future/manifest.md +++ /dev/null @@ -1,181 +0,0 @@ ---- -title: Manifest -lang: en -slug: manifest -order: 2 -layout: future ---- - - -
    - -Your project should contain a `manifest.json` file that defines your app's manifest. This is where you'll configure your application name and scopes, declare the functions your app will use, and more. -Refer to the App Manifest and Manifest Property documentation to learn -about the available manifest configurations. - -Notably, the App Manifest informs Slack of the definitions for: - -* [Functions](/bolt-python/future/concepts#manifest-functions) -* [Workflows](/bolt-python/future/concepts#manifest-workflows) - -`manifest.json` is located at the top level of our example projects, along with a `triggers` folder containing -`*_trigger.json` files that define the triggers -for your app. - -
    -.
    -├── ...
    -├── manifest.json             # app manifest definition
    -├── triggers                  # folder with trigger files
    -│   ├── sample_trigger.json   # trigger definition
    -│   └── ...
    -└── ...
    -
    - -
    - -#### Linting, prediction & validation - -Syntax and formatting checks are required to efficiently edit your `manifest.json`. Multiple IDEs are able to support -this, namely: Visual Studio Code, Pycharm, Sublime Text (via LSP-json) and many more. - -To get **manifest prediction & validation** in your IDE, include the following line in your `manifest.json` file: - -```json -{ - "$schema": "https://raw.githubusercontent.com/slackapi/manifest-schema/main/manifest.schema.json", - ... -} -``` - -Using the Slack CLI you can validate your `manifest.json` against the Slack API with: - -```bash -slack manifest validate -``` - -
    - -
    -Refer to our template project to view a full version of manifest.json. -```json -{ - "$schema": "https://raw.githubusercontent.com/slackapi/manifest-schema/main/manifest.schema.json", - "_metadata": { - "major_version": 2, - }, - "display_information": { - "name": "Bolt Template App TEST" - }, - "features": { - "app_home": { - "home_tab_enabled": false, - }, - "bot_user": { - "display_name": "Bolt Template App TEST", - "always_online": false - } - }, - "oauth_config": { - "scopes": { - "bot": [ - "chat:write", - ] - } - }, - "settings": { - "socket_mode_enabled": true, - }, - "functions": {}, - "types": {}, - "workflows": {}, - "outgoing_domains": [] -} -``` -
    - -
    - - -

    Common Manifest Types

    -
    - -
    -
    - - - - - - - - - - - - - - - - - -
    parameters
    object
    propertiespropertiesdefines the properties
    requiredlist[string]defines the properties required by the function
    - - - - - - - - - - - - - - - - - -
    properties
    dictionary
    keystringdefines the property name
    valuepropertydefines the property
    - - - - - - - - - - - - - - - - - -
    property
    object
    typestringdefines the property type
    descriptionstringdefines the property description
    -
    - -```json -"$comment": "sample parameters object" -"*_parameters":{ - "properties": { - "property_0_name": { - "type": "string", - "description": "this is my first property" - }, - "property_1_name": { - "type": "integer", - "description": "this is my second property" - } - }, - "required": [ - "property_0_name" - ] -} -``` - -
    -
    diff --git a/docs/_future/manifest_functions.md b/docs/_future/manifest_functions.md deleted file mode 100644 index 7c1f7aa0b..000000000 --- a/docs/_future/manifest_functions.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -title: Manifest functions -order: 3 -slug: manifest-functions -lang: en -layout: future ---- - -
    -Your app can [invoke Functions](/bolt-python/future/concepts#functions) defined and created by you (Custom Functions). In order for this to work, Slack must know they exist. Define them in your [App Manifest](/bolt-python/concepts#manifest) also known as `manifest.json` in your project. The next time you `slack run` your app will inform Slack they exist. - - - - - - - - - - - - - - - - - -
    functions
    dictionary
    keystringdefines the function's callback_id
    valuefunctiondefines the function
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    function
    object
    titlestringdefines the title
    descriptionstringdefines the description
    input_parametersparametersdefines the inputs
    output_parametersparametersdefines the outputs
    - -
    - -
    -Refer to our template project to view a full version of manifest.json. -```json - "functions": { - "sample_function": { - "title": "Sample function", - "description": "A sample function", - "input_parameters": { - "properties": { - "message": { - "type": "string", - "description": "Message to be posted" - } - }, - "required": [ - "message" - ] - }, - "output_parameters": { - "properties": { - "updatedMsg": { - "type": "string", - "description": "Updated message to be posted" - } - }, - "required": [ - "updatedMsg" - ] - } - } - } -``` -
    diff --git a/docs/_future/manifest_workflows.md b/docs/_future/manifest_workflows.md deleted file mode 100644 index 76aa17db5..000000000 --- a/docs/_future/manifest_workflows.md +++ /dev/null @@ -1,159 +0,0 @@ ---- -title: Manifest workflows -order: 4 -slug: manifest-workflows -lang: en -layout: future ---- - -
    - -Your app can use Functions by referencing them in Workflows. Your Custom Functions and the Built-in Functions can be used as steps in Workflow definitions. - -Workflows are invoked by Triggers. You will need to set up a Trigger in order to use your defined workflows. Triggers, Workflows, and Functions work together in the following way: - -Trigger → Workflow → Workflow Step → Function - -Your App Manifest, found at `manifest.json`, is where you will define your workflows. - - - - - - - - - - - - - - - - - -
    workflows
    dictionary
    keystringdefines the workflow's id
    valueworkflowdefines the function
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    workflow
    object
    titlestringdefines the title
    descriptionstringdefines the description
    input_parametersparametersdefines the inputs
    stepslist[parameters]defines the steps
    - - - - - - - - - - - - - - - - - - - - - - -
    step
    object
    idstringdefines the order of the steps
    function_idstringidentifies the function to evoke
    inputsdict[string:string]defines the inputs to provide to the function
    - -
    - -
    -Refer to our template project to view a full version of manifest.json. -```json - "workflows": { - "sample_workflow": { - "title": "Sample workflow", - "description": "A sample workflow", - "input_parameters": { - "properties": { - "channel": { - "type": "slack#/types/channel_id" - } - }, - "required": [ - "channel" - ] - }, - "steps": [ - { - "id": "0", - "function_id": "#/functions/sample_function", - "inputs": { - "message": "{{inputs.channel}}" - } - }, - { - "id": "1", - "function_id": "slack#/functions/send_message", - "inputs": { - "channel_id": "{{inputs.channel}}", - "message": "{{steps.0.updatedMsg}}" - } - } - ] - } - } -``` -
    - -
    - - -

    Built-in functions

    -
    - -
    -Slack provides built-in functions that can be used by a Workflow to accomplish simple tasks. You can add these functions to your workflow steps in order to use them. - -- Send message -- Open a form -- Create channel - -Refer to the built-in functions document to learn about the available built-in functions. -
    - -```json - "$comment": "A step to post the user name to a channel" - "steps": [ - { - "id": "0", - "function_id": "slack#/functions/send_message", - "inputs": { - "channel_id": "{{inputs.channel}}", - "message": "{{inputs.user_name}}" - } - } - ] -``` - -
    diff --git a/docs/_future/setup_existing_app.md b/docs/_future/setup_existing_app.md deleted file mode 100644 index 2e93253bf..000000000 --- a/docs/_future/setup_existing_app.md +++ /dev/null @@ -1,122 +0,0 @@ ---- -title: Setup an existing app -order: 7 -slug: setup-existing-app -lang: en -layout: tutorial -permalink: /tutorial/setup-existing-app ---- - -## Setup an existing app BETA - -
    -If you would like to setup an existing Slack app written with the beta tools from the next-generation platform, this guide is for you! -
    - -To get started with a new Bolt for Python application take a look at this [Getting Started guide](/bolt-python/tutorial/getting-started-future) instead. - ---- - -### Prerequisites {#prerequisites} - -Before we get started, make sure you've followed the [Setting Up step](/bolt-python/tutorial/getting-started-future#setting-up) of the [Getting Started guide](/bolt-python/tutorial/getting-started-future) to install required dependencies. - ---- - -### Set up your app to work with the Slack CLI {#setup-with-cli} - -Update your project's version of Bolt (sometimes found in requirements.txt) to the latest `*.dev*` distribution and reinstall your dependencies: `pip install -r requirements.txt` - -```text -# with pip -pip install slack-bolt==*.dev* - -# in requirements.txt -slack-bolt==*.dev* -``` - -Then, add a `slack.json` file to your local project root containing the contents of our [template slack.json](https://github.com/slack-samples/bolt-python-starter-template/blob/future/slack.json). - ---- - -### Add your manifest {#manifest-in-code} - -Head to [your app's App Config Page](https://api.slack.com/apps) and navigate to Features > App Manifest. Download a copy of your app manifest in the JSON file format. - -Add this `manifest.json` to your project root. This represents your project's existing configuration. To get **manifest prediction & validation** in your IDE, include the following line in your `manifest.json` file: - -```json -{ - "$schema": "https://raw.githubusercontent.com/slackapi/manifest-schema/main/manifest.schema.json", - ... -} -``` - -To learn more about the `manifest.json` take a look at the [Manifest concept](/bolt-python/future/concepts#manifest). - ---- - -Now let's run the Slack CLI command `slack manifest` to generate your manifest. It should contain at least these settings: - -```bash -{ - "_metadata": { - "major_version": 2 - }, - "oauth_config": { - "token_management_enabled": true - }, - "settings": { - "interactivity": { - "is_enabled": true - } - }, - "org_deploy_enabled": true -} -``` - -You can also run this command to validate your App's configuration with the Slack API: - -```bash -slack manifest validate -``` - ---- - -### Run your app! {#tada} - -Run the Slack CLI command `slack run` to start your app in local development. - -The CLI will create and install a new development app for you with its own App ID, allowing you to keep your testing changes separate from your production App). - -Now you're ready to start adding [Functions](/bolt-python/future/concepts#functions) and [Workflows](/bolt-python/future/concepts#manifest-workflows) to your app! - ---- - -### Updating your app configuration {#update-app} - -You have probably made changes to your app’s manifest (adding a Function or a Workflow, for example). To sync your production app’s configuration with the changes you’ve made locally in your manifest: - -1. Authenticate the Slack CLI with your desired production workspace using `slack login`. -2. In your project, head over to `./slack/apps.json` and make sure an entry exists for your workspace with the current `app_id` and `team_id` of the workspace. - - ```bash - { - "apps": { - "": { - "name": "", - "app_id": "A041G4M3U00", - "team_id": "T038J6TH5PF" - } - }, - "default": "" - } - ``` - -3. Run `slack install` and select your app. Select your workspace from the list prompt to install. - ---- - -### Conclusion {#conclusion} - -Congratulations on migrating your app to the next-generation Slack Platform! 🎉 You can continue your journey by learning about [Manifests](/bolt-python/future/concepts#manifest) or looking into adding [Functions](/bolt-python/future/concepts#functions) and [Workflows](/bolt-python/future/concepts#manifest-workflows) to your app! diff --git a/docs/_includes/sidebar.html b/docs/_includes/sidebar.html index 5e9fa141d..970cf3869 100644 --- a/docs/_includes/sidebar.html +++ b/docs/_includes/sidebar.html @@ -41,30 +41,6 @@ {% endfor %} - -
    diff --git a/docs/api-docs/slack_bolt/context/respond/respond.html b/docs/api-docs/slack_bolt/context/respond/respond.html index 75d6b2bdf..8e6f551dd 100644 --- a/docs/api-docs/slack_bolt/context/respond/respond.html +++ b/docs/api-docs/slack_bolt/context/respond/respond.html @@ -26,7 +26,7 @@

    Module slack_bolt.context.respond.respond

    Expand source code -
    from typing import Optional, Union, Sequence
    +
    from typing import Optional, Union, Sequence, Any, Dict
     from ssl import SSLContext
     
     from slack_sdk.models.attachments import Attachment
    @@ -63,6 +63,7 @@ 

    Module slack_bolt.context.respond.respond

    unfurl_links: Optional[bool] = None, unfurl_media: Optional[bool] = None, thread_ts: Optional[str] = None, + metadata: Optional[Dict[str, Any]] = None, ) -> WebhookResponse: if self.response_url is not None: client = WebhookClient( @@ -83,6 +84,7 @@

    Module slack_bolt.context.respond.respond

    unfurl_links=unfurl_links, unfurl_media=unfurl_media, thread_ts=thread_ts, + metadata=metadata, ) return client.send_dict(message) elif isinstance(text_or_whole_response, dict): @@ -140,6 +142,7 @@

    Classes

    unfurl_links: Optional[bool] = None, unfurl_media: Optional[bool] = None, thread_ts: Optional[str] = None, + metadata: Optional[Dict[str, Any]] = None, ) -> WebhookResponse: if self.response_url is not None: client = WebhookClient( @@ -160,6 +163,7 @@

    Classes

    unfurl_links=unfurl_links, unfurl_media=unfurl_media, thread_ts=thread_ts, + metadata=metadata, ) return client.send_dict(message) elif isinstance(text_or_whole_response, dict): diff --git a/docs/api-docs/slack_bolt/index.html b/docs/api-docs/slack_bolt/index.html index 3e741d194..2578ab1f2 100644 --- a/docs/api-docs/slack_bolt/index.html +++ b/docs/api-docs/slack_bolt/index.html @@ -3543,7 +3543,7 @@

    Inherited members

    class BoltRequest -(*, body: Union[str, dict], query: Union[str, Dict[str, str], Dict[str, Sequence[str]], ForwardRef(None)] = None, headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, context: Optional[Dict[str, str]] = None, mode: str = 'http') +(*, body: Union[str, dict], query: Union[str, Dict[str, str], Dict[str, Sequence[str]], ForwardRef(None)] = None, headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, context: Optional[Dict[str, Any]] = None, mode: str = 'http')

    Request to a Bolt app.

    @@ -3581,7 +3581,7 @@

    Args

    body: Union[str, dict], query: Optional[Union[str, Dict[str, str], Dict[str, Sequence[str]]]] = None, headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, - context: Optional[Dict[str, str]] = None, + context: Optional[Dict[str, Any]] = None, mode: str = "http", # either "http" or "socket_mode" ): """Request to a Bolt app. @@ -4132,6 +4132,7 @@

    Returns

    unfurl_links: Optional[bool] = None, unfurl_media: Optional[bool] = None, thread_ts: Optional[str] = None, + metadata: Optional[Dict[str, Any]] = None, ) -> WebhookResponse: if self.response_url is not None: client = WebhookClient( @@ -4152,6 +4153,7 @@

    Returns

    unfurl_links=unfurl_links, unfurl_media=unfurl_media, thread_ts=thread_ts, + metadata=metadata, ) return client.send_dict(message) elif isinstance(text_or_whole_response, dict): diff --git a/docs/api-docs/slack_bolt/listener_matcher/builtins.html b/docs/api-docs/slack_bolt/listener_matcher/builtins.html index 40ff38194..b4d38bcdf 100644 --- a/docs/api-docs/slack_bolt/listener_matcher/builtins.html +++ b/docs/api-docs/slack_bolt/listener_matcher/builtins.html @@ -320,7 +320,7 @@

    Module slack_bolt.listener_matcher.builtins

    return workflow_step_edit(constraints["callback_id"], asyncio) raise BoltError(f"type: {action_type} is unsupported") - elif "action_id" in constraints: + elif "action_id" in constraints or "block_id" in constraints: # The default value is "block_actions" return block_action(constraints, asyncio) @@ -341,8 +341,11 @@

    Module slack_bolt.listener_matcher.builtins

    elif isinstance(constraints, dict): # block_id matching is optional block_id: Optional[Union[str, Pattern]] = constraints.get("block_id") + action_id: Optional[Union[str, Pattern]] = constraints.get("action_id") + if block_id is None and action_id is None: + return False block_id_matched = block_id is None or _matches(block_id, action.get("block_id")) - action_id_matched = _matches(constraints["action_id"], action["action_id"]) + action_id_matched = action_id is None or _matches(action_id, action.get("action_id")) return block_id_matched and action_id_matched @@ -608,7 +611,7 @@

    Functions

    return workflow_step_edit(constraints["callback_id"], asyncio) raise BoltError(f"type: {action_type} is unsupported") - elif "action_id" in constraints: + elif "action_id" in constraints or "block_id" in constraints: # The default value is "block_actions" return block_action(constraints, asyncio) diff --git a/docs/api-docs/slack_bolt/request/async_request.html b/docs/api-docs/slack_bolt/request/async_request.html index 3fc5d0f53..4d50490f2 100644 --- a/docs/api-docs/slack_bolt/request/async_request.html +++ b/docs/api-docs/slack_bolt/request/async_request.html @@ -57,7 +57,7 @@

    Module slack_bolt.request.async_request

    body: Union[str, dict], query: Optional[Union[str, Dict[str, str], Dict[str, Sequence[str]]]] = None, headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, - context: Optional[Dict[str, str]] = None, + context: Optional[Dict[str, Any]] = None, mode: str = "http", # either "http" or "socket_mode" ): """Request to a Bolt app. @@ -122,7 +122,7 @@

    Classes

    class AsyncBoltRequest -(*, body: Union[str, dict], query: Union[str, Dict[str, str], Dict[str, Sequence[str]], ForwardRef(None)] = None, headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, context: Optional[Dict[str, str]] = None, mode: str = 'http') +(*, body: Union[str, dict], query: Union[str, Dict[str, str], Dict[str, Sequence[str]], ForwardRef(None)] = None, headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, context: Optional[Dict[str, Any]] = None, mode: str = 'http')

    Request to a Bolt app.

    @@ -160,7 +160,7 @@

    Args

    body: Union[str, dict], query: Optional[Union[str, Dict[str, str], Dict[str, Sequence[str]]]] = None, headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, - context: Optional[Dict[str, str]] = None, + context: Optional[Dict[str, Any]] = None, mode: str = "http", # either "http" or "socket_mode" ): """Request to a Bolt app. diff --git a/docs/api-docs/slack_bolt/request/index.html b/docs/api-docs/slack_bolt/request/index.html index 8a13f1d2b..7b55dba26 100644 --- a/docs/api-docs/slack_bolt/request/index.html +++ b/docs/api-docs/slack_bolt/request/index.html @@ -76,7 +76,7 @@

    Classes

    class BoltRequest -(*, body: Union[str, dict], query: Union[str, Dict[str, str], Dict[str, Sequence[str]], ForwardRef(None)] = None, headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, context: Optional[Dict[str, str]] = None, mode: str = 'http') +(*, body: Union[str, dict], query: Union[str, Dict[str, str], Dict[str, Sequence[str]], ForwardRef(None)] = None, headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, context: Optional[Dict[str, Any]] = None, mode: str = 'http')

    Request to a Bolt app.

    @@ -114,7 +114,7 @@

    Args

    body: Union[str, dict], query: Optional[Union[str, Dict[str, str], Dict[str, Sequence[str]]]] = None, headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, - context: Optional[Dict[str, str]] = None, + context: Optional[Dict[str, Any]] = None, mode: str = "http", # either "http" or "socket_mode" ): """Request to a Bolt app. diff --git a/docs/api-docs/slack_bolt/request/request.html b/docs/api-docs/slack_bolt/request/request.html index eccb7c695..59a5a7acb 100644 --- a/docs/api-docs/slack_bolt/request/request.html +++ b/docs/api-docs/slack_bolt/request/request.html @@ -57,7 +57,7 @@

    Module slack_bolt.request.request

    body: Union[str, dict], query: Optional[Union[str, Dict[str, str], Dict[str, Sequence[str]]]] = None, headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, - context: Optional[Dict[str, str]] = None, + context: Optional[Dict[str, Any]] = None, mode: str = "http", # either "http" or "socket_mode" ): """Request to a Bolt app. @@ -121,7 +121,7 @@

    Classes

    class BoltRequest -(*, body: Union[str, dict], query: Union[str, Dict[str, str], Dict[str, Sequence[str]], ForwardRef(None)] = None, headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, context: Optional[Dict[str, str]] = None, mode: str = 'http') +(*, body: Union[str, dict], query: Union[str, Dict[str, str], Dict[str, Sequence[str]], ForwardRef(None)] = None, headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, context: Optional[Dict[str, Any]] = None, mode: str = 'http')

    Request to a Bolt app.

    @@ -159,7 +159,7 @@

    Args

    body: Union[str, dict], query: Optional[Union[str, Dict[str, str], Dict[str, Sequence[str]]]] = None, headers: Optional[Dict[str, Union[str, Sequence[str]]]] = None, - context: Optional[Dict[str, str]] = None, + context: Optional[Dict[str, Any]] = None, mode: str = "http", # either "http" or "socket_mode" ): """Request to a Bolt app. diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index eccade944..19a0d5d64 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

    Module slack_bolt.version

    Expand source code
    """Check the latest version at https://pypi.org/project/slack-bolt/"""
    -__version__ = "1.18.0"
    +__version__ = "1.18.1"
    diff --git a/setup.py b/setup.py index e56410465..474bd8da0 100755 --- a/setup.py +++ b/setup.py @@ -58,7 +58,7 @@ ), include_package_data=True, # MANIFEST.in install_requires=[ - "slack_sdk>=3.21.2,<4", + "slack_sdk>=3.25.0,<4", ], setup_requires=["pytest-runner==5.2"], tests_require=async_test_dependencies, @@ -109,6 +109,7 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", diff --git a/slack_bolt/version.py b/slack_bolt/version.py index dfa1bca7a..2dc804083 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.18.0" +__version__ = "1.18.1" From 9209e7bc5c7f44d8910657ba4134232a8b6a1935 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Tue, 21 Nov 2023 17:25:17 -0500 Subject: [PATCH 457/719] Improve socket mode tests (#991) --- .../socket_mode/mock_socket_mode_server.py | 19 +++++++++++++++++-- .../socket_mode/test_interactions_builtin.py | 1 - .../test_interactions_websocket_client.py | 1 - .../socket_mode/test_lazy_listeners.py | 1 - .../socket_mode/test_async_aiohttp.py | 1 - .../socket_mode/test_async_lazy_listeners.py | 1 - .../socket_mode/test_async_websockets.py | 1 - 7 files changed, 17 insertions(+), 8 deletions(-) diff --git a/tests/adapter_tests/socket_mode/mock_socket_mode_server.py b/tests/adapter_tests/socket_mode/mock_socket_mode_server.py index 13c139d63..577698188 100644 --- a/tests/adapter_tests/socket_mode/mock_socket_mode_server.py +++ b/tests/adapter_tests/socket_mode/mock_socket_mode_server.py @@ -1,9 +1,11 @@ +import json import logging import sys import threading import time +import requests from multiprocessing.context import Process -from typing import List, Optional +from typing import List from unittest import TestCase from tests.utils import get_mock_server_mode @@ -22,6 +24,11 @@ def start_thread_socket_mode_server(test: TestCase, port: int): def _start_thread_socket_mode_server(): logger = logging.getLogger(__name__) app: Flask = Flask(__name__) + + @app.route("/state") + def state(): + return json.dumps({"success": True}), 200, {"ContentType": "application/json"} + sockets: Sockets = Sockets(app) envelopes_to_consume: List[str] = list(socket_mode_envelopes) @@ -81,12 +88,20 @@ def start_socket_mode_server(test, port: int): test.sm_thread = threading.Thread(target=start_thread_socket_mode_server(test, port)) test.sm_thread.daemon = True test.sm_thread.start() - time.sleep(2) # wait for the server + wait_for_socket_mode_server(port, 2) # wait for the server else: test.sm_process = Process(target=start_process_socket_mode_server, kwargs={"port": port}) test.sm_process.start() +def wait_for_socket_mode_server(port: int, secs: int): + start_time = time.time() + while (time.time() - start_time) < secs: + response = requests.get(url=f"http://localhost:{port}/state") + if response.ok: + break + + def stop_socket_mode_server(test): if get_mock_server_mode() == "threading": print(test) diff --git a/tests/adapter_tests/socket_mode/test_interactions_builtin.py b/tests/adapter_tests/socket_mode/test_interactions_builtin.py index 4730ece81..99aac3171 100644 --- a/tests/adapter_tests/socket_mode/test_interactions_builtin.py +++ b/tests/adapter_tests/socket_mode/test_interactions_builtin.py @@ -27,7 +27,6 @@ def setup_method(self): base_url="http://localhost:8888", ) start_socket_mode_server(self, 3011) - time.sleep(2) # wait for the server def teardown_method(self): cleanup_mock_web_api_server(self) diff --git a/tests/adapter_tests/socket_mode/test_interactions_websocket_client.py b/tests/adapter_tests/socket_mode/test_interactions_websocket_client.py index 39d461570..ccaa89d3e 100644 --- a/tests/adapter_tests/socket_mode/test_interactions_websocket_client.py +++ b/tests/adapter_tests/socket_mode/test_interactions_websocket_client.py @@ -27,7 +27,6 @@ def setup_method(self): base_url="http://localhost:8888", ) start_socket_mode_server(self, 3012) - time.sleep(2) # wait for the server def teardown_method(self): cleanup_mock_web_api_server(self) diff --git a/tests/adapter_tests/socket_mode/test_lazy_listeners.py b/tests/adapter_tests/socket_mode/test_lazy_listeners.py index 441dda3f5..5acd288f4 100644 --- a/tests/adapter_tests/socket_mode/test_lazy_listeners.py +++ b/tests/adapter_tests/socket_mode/test_lazy_listeners.py @@ -27,7 +27,6 @@ def setup_method(self): base_url="http://localhost:8888", ) start_socket_mode_server(self, 3011) - time.sleep(2) # wait for the server def teardown_method(self): cleanup_mock_web_api_server(self) diff --git a/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py b/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py index fa2e7dc6e..6e8ce40de 100644 --- a/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py +++ b/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py @@ -39,7 +39,6 @@ def event_loop(self): @pytest.mark.asyncio async def test_events(self): start_socket_mode_server(self, 3021) - await asyncio.sleep(1) # wait for the server app = AsyncApp(client=self.web_client) diff --git a/tests/adapter_tests_async/socket_mode/test_async_lazy_listeners.py b/tests/adapter_tests_async/socket_mode/test_async_lazy_listeners.py index 21fef7f02..6709d588e 100644 --- a/tests/adapter_tests_async/socket_mode/test_async_lazy_listeners.py +++ b/tests/adapter_tests_async/socket_mode/test_async_lazy_listeners.py @@ -39,7 +39,6 @@ def event_loop(self): @pytest.mark.asyncio async def test_lazy_listeners(self): start_socket_mode_server(self, 3021) - await asyncio.sleep(1) # wait for the server app = AsyncApp(client=self.web_client) diff --git a/tests/adapter_tests_async/socket_mode/test_async_websockets.py b/tests/adapter_tests_async/socket_mode/test_async_websockets.py index 9e6db75ee..19167e635 100644 --- a/tests/adapter_tests_async/socket_mode/test_async_websockets.py +++ b/tests/adapter_tests_async/socket_mode/test_async_websockets.py @@ -39,7 +39,6 @@ def event_loop(self): @pytest.mark.asyncio async def test_events(self): start_socket_mode_server(self, 3022) - await asyncio.sleep(1) # wait for the server app = AsyncApp(client=self.web_client) From 90467fb94a3277b77f2a8174fbc4ecd6d6fff6e5 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Wed, 29 Nov 2023 14:06:22 -0500 Subject: [PATCH 458/719] Configuring with pyproject.toml (#996) * move configuration to pyproject.toml Co-authored-by: Kazuhiro Sera --- .github/maintainers_guide.md | 4 +- .github/workflows/codecov.yml | 10 +- .github/workflows/tests.yml | 10 +- pyproject.toml | 55 ++++++++++- pytest.ini | 9 -- requirements.txt | 1 + requirements/adapter.txt | 22 +++++ requirements/adapter_testing.txt | 8 ++ requirements/async.txt | 4 + requirements/testing.txt | 6 ++ requirements/testing_without_asyncio.txt | 9 ++ scripts/build_pypi_package.sh | 6 +- scripts/deploy_to_pypi_org.sh | 4 +- scripts/deploy_to_test_pypi_org.sh | 4 +- scripts/install_all_and_run_tests.sh | 24 ++--- scripts/run_pytype.sh | 5 +- scripts/run_tests.sh | 4 +- setup.cfg | 5 - setup.py | 118 ----------------------- 19 files changed, 139 insertions(+), 169 deletions(-) delete mode 100644 pytest.ini create mode 100644 requirements.txt create mode 100644 requirements/adapter.txt create mode 100644 requirements/adapter_testing.txt create mode 100644 requirements/async.txt create mode 100644 requirements/testing.txt create mode 100644 requirements/testing_without_asyncio.txt delete mode 100644 setup.cfg delete mode 100755 setup.py diff --git a/.github/maintainers_guide.md b/.github/maintainers_guide.md index 6d3ab7ff1..97c91372c 100644 --- a/.github/maintainers_guide.md +++ b/.github/maintainers_guide.md @@ -71,8 +71,8 @@ If you make changes to `slack_bolt/adapter/*`, please verify if it surely works ```bash # Install all optional dependencies -$ pip install -e ".[adapter]" -$ pip install -e ".[adapter_testing]" +$ pip install -r requirements/adapter.txt +$ pip install -r requirements/adapter_testing.txt # Set required env variables $ export SLACK_SIGNING_SECRET=*** diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 6d1ab0e52..4839962ef 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -26,12 +26,12 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python setup.py install pip install -U pip - pip install -e ".[async]" - pip install -e ".[adapter]" - pip install -e ".[testing]" - pip install -e ".[adapter_testing]" + pip install . + pip install -r requirements/async.txt + pip install -r requirements/adapter.txt + pip install -r requirements/testing.txt + pip install -r requirements/adapter_testing.txt - name: Run all tests for codecov run: | pytest --cov=./slack_bolt/ --cov-report=xml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 11a38d743..fcdc053b8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,17 +25,17 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python setup.py install pip install -U pip - pip install -e ".[testing_without_asyncio]" + pip install -r requirements.txt + pip install -r requirements/testing_without_asyncio.txt - name: Run tests without aiohttp run: | pytest tests/slack_bolt/ pytest tests/scenario_tests/ - name: Run tests for Socket Mode adapters run: | - pip install -e ".[adapter]" - pip install -e ".[adapter_testing]" + pip install -r requirements/adapter.txt + pip install -r requirements/adapter_testing.txt pytest tests/adapter_tests/socket_mode/ - name: Run tests for HTTP Mode adapters (AWS) run: | @@ -74,7 +74,7 @@ jobs: pytest tests/adapter_tests/tornado/ - name: Run tests for HTTP Mode adapters (asyncio-based libraries) run: | - pip install -e ".[async]" + pip install -r requirements/async.txt # Falcon supports Python 3.11 since its v3.1.1 pip install "falcon>=3.1.1,<4" pytest tests/adapter_tests_async/ diff --git a/pyproject.toml b/pyproject.toml index 0cda914cd..0292636ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,53 @@ -# black project prefers pyproject.toml -# that's why we have this file in addition to other setting files +[build-system] +requires = ["setuptools", "pytest-runner==5.2", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "slack_bolt" +dynamic = ["version", "readme", "dependencies"] +description = "The Bolt Framework for Python" +license = { text = "MIT" } +authors = [{ name = "Slack Technologies, LLC", email = "opensource@slack.com" }] +classifiers = [ + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: Implementation :: CPython", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] +requires-python = ">=3.6" + + +[project.urls] +homepage = "https://github.com/slackapi/bolt-python" + +[tool.setuptools.packages.find] +include = ["slack_bolt*"] + +[tool.setuptools.dynamic] +version = { attr = "slack_bolt.version.__version__" } +readme = { file = ["README.md"], content-type = "text/markdown" } +dependencies = { file = ["requirements.txt"] } + +[tool.distutils.bdist_wheel] +universal = true + [tool.black] -line-length = 125 \ No newline at end of file +line-length = 125 + +[tool.pytest.ini_options] +testpaths = ["tests"] +log_file = "logs/pytest.log" +log_file_level = "DEBUG" +log_format = "%(asctime)s %(levelname)s %(message)s" +log_date_format = "%Y-%m-%d %H:%M:%S" +filterwarnings = [ + "ignore:\"@coroutine\" decorator is deprecated since Python 3.8, use \"async def\" instead:DeprecationWarning", + "ignore:The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.:DeprecationWarning", +] +asyncio_mode = "auto" diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 27f7ad257..000000000 --- a/pytest.ini +++ /dev/null @@ -1,9 +0,0 @@ -[pytest] -log_file = logs/pytest.log -log_file_level = DEBUG -log_format = %(asctime)s %(levelname)s %(message)s -log_date_format = %Y-%m-%d %H:%M:%S -filterwarnings = - ignore:"@coroutine" decorator is deprecated since Python 3.8, use "async def" instead:DeprecationWarning - ignore:The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.:DeprecationWarning -asyncio_mode = auto \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..4d4e8fe15 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +slack_sdk>=3.25.0,<4 diff --git a/requirements/adapter.txt b/requirements/adapter.txt new file mode 100644 index 000000000..81bbd5f12 --- /dev/null +++ b/requirements/adapter.txt @@ -0,0 +1,22 @@ +# pip install -r requirements/adapter.txt +# NOTE: any of async ones requires pip install -r requirements/async.txt too +# used only under slack_bolt/adapter +boto3<=2 +bottle>=0.12,<1 +chalice<=1.27.3; python_version=="3.6" +chalice>=1.28,<2; python_version>"3.6" +CherryPy>=18,<19 +Django>=3,<5 +falcon>=2,<4; python_version<"3.11" +falcon>=3.1.1,<4; python_version>="3.11" +fastapi>=0.70.0,<1 +Flask>=1,<3 +Werkzeug>=2,<3 +pyramid>=1,<3 +sanic>=20,<21; python_version=="3.6" +sanic>=22,<23; python_version>"3.6" +starlette>=0.14,<1 +tornado>=6,<7 +uvicorn<1 # The oldest version can vary among Python runtime versions +gunicorn>=20,<21 +websocket_client>=1.2.3,<2 # Socket Mode 3rd party implementation diff --git a/requirements/adapter_testing.txt b/requirements/adapter_testing.txt new file mode 100644 index 000000000..f2978a463 --- /dev/null +++ b/requirements/adapter_testing.txt @@ -0,0 +1,8 @@ +# pip install -r requirements/adapter_testing.txt +moto>=3,<4 # For AWS tests +docker>=5,<6 # Used by moto +boddle>=0.2,<0.3 # For Bottle app tests +Flask>=1,<2 # TODO: Flask-Sockets is not yet compatible with Flask 2.x +Werkzeug>=1,<2 # TODO: Flask-Sockets is not yet compatible with Flask 2.x +sanic-testing>=0.7; python_version>"3.6" +requests>=2,<3 # For Starlette's TestClient diff --git a/requirements/async.txt b/requirements/async.txt new file mode 100644 index 000000000..221ec4ae9 --- /dev/null +++ b/requirements/async.txt @@ -0,0 +1,4 @@ +# pip install -r requirements/async.txt +aiohttp>=3,<4 +websockets>=8,<10; python_version=="3.6" +websockets>=10,<11; python_version>"3.6" diff --git a/requirements/testing.txt b/requirements/testing.txt new file mode 100644 index 000000000..6fbcc045d --- /dev/null +++ b/requirements/testing.txt @@ -0,0 +1,6 @@ +# pip install -r requirements/testing.txt +-r testing_without_asyncio.txt + +pytest-asyncio>=0.16.0; python_version=="3.6" +pytest-asyncio>=0.18.2,<1; python_version>"3.6" +aiohttp>=3,<4 diff --git a/requirements/testing_without_asyncio.txt b/requirements/testing_without_asyncio.txt new file mode 100644 index 000000000..0f971986c --- /dev/null +++ b/requirements/testing_without_asyncio.txt @@ -0,0 +1,9 @@ +# pip install -r requirements/testing_without_asyncio.txt +pytest>=6.2.5,<7 +pytest-cov>=3,<4 +Flask-Sockets>=0.2,<1 # TODO: This module is not yet Flask 2.x compatible +Werkzeug>=1,<2 # TODO: Flask-Sockets is not yet compatible with Flask 2.x +itsdangerous==2.0.1 # TODO: Flask-Sockets is not yet compatible with Flask 2.x +Jinja2==3.0.3 # https://github.com/pallets/flask/issues/4494 +black==22.8.0 # Until we drop Python 3.6 support, we have to stay with this version +click<=8.0.4 # black is affected by https://github.com/pallets/click/issues/2225 diff --git a/scripts/build_pypi_package.sh b/scripts/build_pypi_package.sh index 4fbf1b704..79c6db9f2 100755 --- a/scripts/build_pypi_package.sh +++ b/scripts/build_pypi_package.sh @@ -5,7 +5,7 @@ cd ${script_dir}/.. rm -rf ./slack_bolt.egg-info pip install -U pip && \ - pip install twine wheel && \ + pip install twine build && \ rm -rf dist/ build/ slack_bolt.egg-info/ && \ - python setup.py sdist bdist_wheel && \ - twine check dist/* \ No newline at end of file + python -m build --sdist --wheel && \ + twine check dist/* diff --git a/scripts/deploy_to_pypi_org.sh b/scripts/deploy_to_pypi_org.sh index 5ac4c9907..a3cf431fa 100755 --- a/scripts/deploy_to_pypi_org.sh +++ b/scripts/deploy_to_pypi_org.sh @@ -5,8 +5,8 @@ cd ${script_dir}/.. rm -rf ./slack_bolt.egg-info pip install -U pip && \ - pip install twine wheel && \ + pip install twine build && \ rm -rf dist/ build/ slack_bolt.egg-info/ && \ - python setup.py sdist bdist_wheel && \ + python -m build --sdist --wheel && \ twine check dist/* && \ twine upload dist/* diff --git a/scripts/deploy_to_test_pypi_org.sh b/scripts/deploy_to_test_pypi_org.sh index d6a105f77..b2cc65a12 100644 --- a/scripts/deploy_to_test_pypi_org.sh +++ b/scripts/deploy_to_test_pypi_org.sh @@ -5,8 +5,8 @@ cd ${script_dir}/.. rm -rf ./slack_bolt.egg-info pip install -U pip && \ - pip install twine wheel && \ + pip install twine build && \ rm -rf dist/ build/ slack_bolt.egg-info/ && \ - python setup.py sdist bdist_wheel && \ + python -m build --sdist --wheel && \ twine check dist/* && \ twine upload --repository testpypi dist/* \ No newline at end of file diff --git a/scripts/install_all_and_run_tests.sh b/scripts/install_all_and_run_tests.sh index cda15a058..c5da9647e 100755 --- a/scripts/install_all_and_run_tests.sh +++ b/scripts/install_all_and_run_tests.sh @@ -10,26 +10,28 @@ rm -rf ./slack_bolt.egg-info pip uninstall python-lambda test_target="$1" +python_version=`python --version | awk '{print $2}'` -pip install -e . +if [ ${python_version:0:3} == "3.6" ] +then + pip install -r requirements.txt +else + pip install -e . +fi if [[ $test_target != "" ]] then - # To fix: Using legacy 'setup.py install' for greenlet, since package 'wheel' is not installed. - pip install -U wheel && \ - pip install -e ".[testing]" && \ - pip install -e ".[adapter]" && \ - pip install -e ".[adapter_testing]" && \ + pip install -r requirements/testing.txt && \ + pip install -r requirements/adapter.txt && \ + pip install -r requirements/adapter_testing.txt && \ # To avoid errors due to the old versions of click forced by Chalice pip install -U pip click && \ black slack_bolt/ tests/ && \ pytest $1 else - # To fix: Using legacy 'setup.py install' for greenlet, since package 'wheel' is not installed. - pip install -U wheel && \ - pip install -e ".[testing]" && \ - pip install -e ".[adapter]" && \ - pip install -e ".[adapter_testing]" && \ + pip install -r requirements/testing.txt && \ + pip install -r requirements/adapter.txt && \ + pip install -r requirements/adapter_testing.txt && \ # To avoid errors due to the old versions of click forced by Chalice pip install -U pip click && \ black slack_bolt/ tests/ && \ diff --git a/scripts/run_pytype.sh b/scripts/run_pytype.sh index 3f6a91e31..4c06a8905 100755 --- a/scripts/run_pytype.sh +++ b/scripts/run_pytype.sh @@ -3,7 +3,8 @@ script_dir=$(dirname $0) cd ${script_dir}/.. && \ - pip install -e ".[async]" && \ - pip install -e ".[adapter]" && \ + pip install . + pip install -r requirements/async.txt && \ + pip install -r requirements/adapter.txt && \ pip install "pytype==2022.12.15" && \ pytype slack_bolt/ diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index c380e7684..2507a8e3b 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -19,8 +19,8 @@ else # pytype's behavior can be different in older Python versions black slack_bolt/ tests/ \ && pytest -vv \ - && pip install -e ".[adapter]" \ - && pip install -e ".[adapter_testing]" \ + && pip install -r requirements/adapter.txt \ + && pip install -r requirements/adapter_testing.txt \ && pip install -U pip setuptools wheel \ && pip install -U pytype \ && pytype slack_bolt/ diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 5841ac1a4..000000000 --- a/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[bdist_wheel] -universal = 1 - -[aliases] -test=pytest diff --git a/setup.py b/setup.py deleted file mode 100755 index 474bd8da0..000000000 --- a/setup.py +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -import setuptools - -here = os.path.abspath(os.path.dirname(__file__)) - -__version__ = None -exec(open(f"{here}/slack_bolt/version.py").read()) - -with open(f"{here}/README.md", "r") as fh: - long_description = fh.read() - -test_dependencies = [ - "pytest>=6.2.5,<7", - "pytest-cov>=3,<4", - "Flask-Sockets>=0.2,<1", # TODO: This module is not yet Flask 2.x compatible - "Werkzeug>=1,<2", # TODO: Flask-Sockets is not yet compatible with Flask 2.x - "itsdangerous==2.0.1", # TODO: Flask-Sockets is not yet compatible with Flask 2.x - "Jinja2==3.0.3", # https://github.com/pallets/flask/issues/4494 - "black==22.8.0", # Until we drop Python 3.6 support, we have to stay with this version - "click<=8.0.4", # black is affected by https://github.com/pallets/click/issues/2225 -] - -adapter_test_dependencies = [ - "moto>=3,<4", # For AWS tests - "docker>=5,<6", # Used by moto - "boddle>=0.2,<0.3", # For Bottle app tests - "Flask>=1,<2", # TODO: Flask-Sockets is not yet compatible with Flask 2.x - "Werkzeug>=1,<2", # TODO: Flask-Sockets is not yet compatible with Flask 2.x - "sanic-testing>=0.7" if sys.version_info.minor > 6 else "", - "requests>=2,<3", # For Starlette's TestClient -] - -async_test_dependencies = test_dependencies + [ - "pytest-asyncio>=0.18.2,<1", # for async - "aiohttp>=3,<4", # for async -] - -setuptools.setup( - name="slack_bolt", - version=__version__, - license="MIT", - author="Slack Technologies, LLC", - author_email="opensource@slack.com", - description="The Bolt Framework for Python", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/slackapi/bolt-python", - packages=setuptools.find_packages( - exclude=[ - "examples", - "integration_tests", - "tests", - "tests.*", - ] - ), - include_package_data=True, # MANIFEST.in - install_requires=[ - "slack_sdk>=3.25.0,<4", - ], - setup_requires=["pytest-runner==5.2"], - tests_require=async_test_dependencies, - test_suite="tests", - extras_require={ - # pip install -e ".[async]" - "async": [ - # async features heavily depends on aiohttp - "aiohttp>=3,<4", - # Socket Mode 3rd party implementation - "websockets>=10,<11" if sys.version_info.minor > 6 else "websockets>=8,<10", - ], - # pip install -e ".[adapter]" - # NOTE: any of async ones requires pip install -e ".[async]" too - "adapter": [ - # used only under src/slack_bolt/adapter - "boto3<=2", - "bottle>=0.12,<1", - "chalice>=1.28,<2" if sys.version_info.minor > 6 else "chalice<=1.27.3", - "CherryPy>=18,<19", - "Django>=3,<5", - "falcon>=3.1.1,<4" if sys.version_info.minor >= 11 else "falcon>=2,<4", - "fastapi>=0.70.0,<1", - "Flask>=1,<3", - "Werkzeug>=2,<3", - "pyramid>=1,<3", - "sanic>=22,<23" if sys.version_info.minor > 6 else "sanic>=20,<21", - "starlette>=0.14,<1", - "tornado>=6,<7", - # server - "uvicorn<1", # The oldest version can vary among Python runtime versions - "gunicorn>=20,<21", - # Socket Mode 3rd party implementation - # Note: 1.2.2 has a regression (https://github.com/websocket-client/websocket-client/issues/769) - "websocket_client>=1.2.3,<2", - ], - # pip install -e ".[testing_without_asyncio]" - "testing_without_asyncio": test_dependencies, - # pip install -e ".[testing]" - "testing": async_test_dependencies, - # pip install -e ".[adapter_testing]" - "adapter_testing": adapter_test_dependencies, - }, - classifiers=[ - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: Implementation :: CPython", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - ], - python_requires=">=3.6", -) From 5e63905ef3161dfe523a4415cc3d6aa807f31763 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Fri, 1 Dec 2023 18:17:05 -0500 Subject: [PATCH 459/719] Maintain metadata (#999) --- pyproject.toml | 5 ++--- setup.cfg | 5 +++++ 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml index 0292636ef..ebeeab478 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,10 +4,9 @@ build-backend = "setuptools.build_meta" [project] name = "slack_bolt" -dynamic = ["version", "readme", "dependencies"] +dynamic = ["version", "readme", "dependencies", "authors"] description = "The Bolt Framework for Python" license = { text = "MIT" } -authors = [{ name = "Slack Technologies, LLC", email = "opensource@slack.com" }] classifiers = [ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", @@ -24,7 +23,7 @@ requires-python = ">=3.6" [project.urls] -homepage = "https://github.com/slackapi/bolt-python" +Documentation = "https://slack.dev/bolt-python" [tool.setuptools.packages.find] include = ["slack_bolt*"] diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 000000000..3b05a6fa3 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,5 @@ +; Legacy package configuration, prefer pyproject.toml over setup.cfg +[metadata] +url=https://github.com/slackapi/bolt-python +author=Slack Technologies, LLC +author_email=opensource@slack.com From f150cfdab3bc5d503d7d59d89367b0c0e407bb2e Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Wed, 10 Jan 2024 17:17:46 -0500 Subject: [PATCH 460/719] remove unused multiprocessing test mode (#1011) * remove BOLT_PYTHON_MOCK_SERVER_MODE --------- Co-authored-by: Kazuhiro Sera --- .github/workflows/codecov.yml | 3 - .github/workflows/tests.yml | 4 - .../socket_mode/mock_socket_mode_server.py | 78 ++----------- .../socket_mode/mock_web_api_server.py | 107 +---------------- .../socket_mode/test_interactions_builtin.py | 1 - tests/mock_web_api_server.py | 109 +----------------- tests/utils.py | 15 --- 7 files changed, 21 insertions(+), 296 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 4839962ef..ea48ce6bc 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -14,9 +14,6 @@ jobs: matrix: python-version: ["3.11"] env: - # default: multiprocessing - # threading is more stable on GitHub Actions - BOLT_PYTHON_MOCK_SERVER_MODE: threading BOLT_PYTHON_CODECOV_RUNNING: "1" steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fcdc053b8..25d4ecc6a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,10 +13,6 @@ jobs: strategy: matrix: python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] - env: - # default: multiprocessing - # threading is more stable on GitHub Actions - BOLT_PYTHON_MOCK_SERVER_MODE: threading steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/tests/adapter_tests/socket_mode/mock_socket_mode_server.py b/tests/adapter_tests/socket_mode/mock_socket_mode_server.py index 577698188..5d64d0783 100644 --- a/tests/adapter_tests/socket_mode/mock_socket_mode_server.py +++ b/tests/adapter_tests/socket_mode/mock_socket_mode_server.py @@ -1,15 +1,11 @@ import json import logging -import sys import threading import time import requests -from multiprocessing.context import Process from typing import List from unittest import TestCase -from tests.utils import get_mock_server_mode - socket_mode_envelopes = [ """{"envelope_id":"57d6a792-4d35-4d0b-b6aa-3361493e1caf","payload":{"type":"shortcut","token":"xxx","action_ts":"1610198080.300836","team":{"id":"T111","domain":"seratch"},"user":{"id":"U111","username":"seratch","team_id":"T111"},"is_enterprise_install":false,"enterprise":null,"callback_id":"do-something","trigger_id":"111.222.xxx"},"type":"interactive","accepts_response_payload":false}""", """{"envelope_id":"1d3c79ab-0ffb-41f3-a080-d19e85f53649","payload":{"token":"xxx","team_id":"T111","team_domain":"xxx","channel_id":"C111","channel_name":"random","user_id":"U111","user_name":"seratch","command":"/hello-socket-mode","text":"","api_app_id":"A111","response_url":"https://hooks.slack.com/commands/T111/111/xxx","trigger_id":"111.222.xxx"},"type":"slash_commands","accepts_response_payload":true}""", @@ -56,42 +52,11 @@ def link(ws): return _start_thread_socket_mode_server -def start_process_socket_mode_server(port: int): - logger = logging.getLogger(__name__) - app: Flask = Flask(__name__) - sockets: Sockets = Sockets(app) - - envelopes_to_consume: List[str] = list(socket_mode_envelopes) - - @sockets.route("/link") - def link(ws): - while not ws.closed: - message = ws.read_message() - if message is not None: - if len(envelopes_to_consume) > 0: - e = envelopes_to_consume.pop(0) - logger.debug(f"Send an envelope: {e}") - ws.send(e) - - logger.debug(f"Server received a message: {message}") - ws.send(message) - - from gevent import pywsgi - from geventwebsocket.handler import WebSocketHandler - - server = pywsgi.WSGIServer(("", port), app, handler_class=WebSocketHandler) - server.serve_forever(stop_timeout=1) - - def start_socket_mode_server(test, port: int): - if get_mock_server_mode() == "threading": - test.sm_thread = threading.Thread(target=start_thread_socket_mode_server(test, port)) - test.sm_thread.daemon = True - test.sm_thread.start() - wait_for_socket_mode_server(port, 2) # wait for the server - else: - test.sm_process = Process(target=start_process_socket_mode_server, kwargs={"port": port}) - test.sm_process.start() + test.sm_thread = threading.Thread(target=start_thread_socket_mode_server(test, port)) + test.sm_thread.daemon = True + test.sm_thread.start() + wait_for_socket_mode_server(port, 4) # wait for the server def wait_for_socket_mode_server(port: int, secs: int): @@ -100,39 +65,14 @@ def wait_for_socket_mode_server(port: int, secs: int): response = requests.get(url=f"http://localhost:{port}/state") if response.ok: break + time.sleep(0.01) def stop_socket_mode_server(test): - if get_mock_server_mode() == "threading": - print(test) - test.server.stop() - test.server.close() - else: - # terminate the process - test.sm_process.terminate() - test.sm_process.join() - # Python 3.6 does not have these methods - if sys.version_info.major == 3 and sys.version_info.minor > 6: - # cleanup the process's resources - test.sm_process.kill() - test.sm_process.close() - - test.sm_process = None + test.server.stop() + test.server.close() async def stop_socket_mode_server_async(test: TestCase): - if get_mock_server_mode() == "threading": - test.server.stop() - test.server.close() - else: - # terminate the process - test.sm_process.terminate() - test.sm_process.join() - - # Python 3.6 does not have these methods - if sys.version_info.major == 3 and sys.version_info.minor > 6: - # cleanup the process's resources - test.sm_process.kill() - test.sm_process.close() - - test.sm_process = None + test.server.stop() + test.server.close() diff --git a/tests/adapter_tests/socket_mode/mock_web_api_server.py b/tests/adapter_tests/socket_mode/mock_web_api_server.py index 1b964c711..22136e633 100644 --- a/tests/adapter_tests/socket_mode/mock_web_api_server.py +++ b/tests/adapter_tests/socket_mode/mock_web_api_server.py @@ -1,18 +1,13 @@ import json import logging import re -import sys import threading import time from http import HTTPStatus from http.server import HTTPServer, SimpleHTTPRequestHandler -from multiprocessing.context import Process from typing import Type from unittest import TestCase from urllib.parse import urlparse, parse_qs -from urllib.request import Request, urlopen - -from tests.utils import get_mock_server_mode class MockHandler(SimpleHTTPRequestHandler): @@ -120,59 +115,6 @@ def do_POST(self): self._handle() -# -# multiprocessing -# - - -class MockServerProcessTarget: - def __init__(self, handler: Type[SimpleHTTPRequestHandler] = MockHandler): - self.handler = handler - - def run(self): - self.handler.received_requests = {} - self.server = HTTPServer(("localhost", 8888), self.handler) - try: - self.server.serve_forever(0.05) - finally: - self.server.server_close() - - def stop(self): - self.handler.received_requests = {} - self.server.shutdown() - self.join() - - -class MonitorThread(threading.Thread): - def __init__(self, test: TestCase, handler: Type[SimpleHTTPRequestHandler] = MockHandler): - threading.Thread.__init__(self, daemon=True) - self.handler = handler - self.test = test - self.test.mock_received_requests = None - self.is_running = True - - def run(self) -> None: - while self.is_running: - try: - req = Request(f"{self.test.server_url}/received_requests.json") - resp = urlopen(req, timeout=1) - self.test.mock_received_requests = json.loads(resp.read().decode("utf-8")) - except Exception as e: - # skip logging for the initial request - if self.test.mock_received_requests is not None: - logging.getLogger(__name__).exception(e) - time.sleep(0.01) - - def stop(self): - self.is_running = False - self.join() - - -# -# threading -# - - class MockServerThread(threading.Thread): def __init__(self, test: TestCase, handler: Type[SimpleHTTPRequestHandler] = MockHandler): threading.Thread.__init__(self) @@ -197,52 +139,15 @@ def stop(self): def setup_mock_web_api_server(test: TestCase): - if get_mock_server_mode() == "threading": - test.server_started = threading.Event() - test.thread = MockServerThread(test) - test.thread.start() - test.server_started.wait() - else: - # start a mock server as another process - target = MockServerProcessTarget() - test.server_url = "http://localhost:8888" - test.host, test.port = "localhost", 8888 - test.process = Process(target=target.run, daemon=True) - test.process.start() - time.sleep(0.1) - - # start a thread in the current process - # this thread fetches mock_received_requests from the remote process - test.monitor_thread = MonitorThread(test) - test.monitor_thread.start() - count = 0 - # wait until the first successful data retrieval - while test.mock_received_requests is None: - time.sleep(0.01) - count += 1 - if count >= 100: - raise Exception("The mock server is not yet running!") + test.server_started = threading.Event() + test.thread = MockServerThread(test) + test.thread.start() + test.server_started.wait() def cleanup_mock_web_api_server(test: TestCase): - if get_mock_server_mode() == "threading": - test.thread.stop() - test.thread = None - else: - # stop the thread to fetch mock_received_requests from the remote process - test.monitor_thread.stop() - - # terminate the process - test.process.terminate() - test.process.join() - - # Python 3.6 does not have these methods - if sys.version_info.major == 3 and sys.version_info.minor > 6: - # cleanup the process's resources - test.process.kill() - test.process.close() - - test.process = None + test.thread.stop() + test.thread = None def assert_auth_test_count(test: TestCase, expected_count: int): diff --git a/tests/adapter_tests/socket_mode/test_interactions_builtin.py b/tests/adapter_tests/socket_mode/test_interactions_builtin.py index 99aac3171..2ecd52554 100644 --- a/tests/adapter_tests/socket_mode/test_interactions_builtin.py +++ b/tests/adapter_tests/socket_mode/test_interactions_builtin.py @@ -34,7 +34,6 @@ def teardown_method(self): stop_socket_mode_server(self) def test_interactions(self): - app = App(client=self.web_client) result = {"shortcut": False, "command": False} diff --git a/tests/mock_web_api_server.py b/tests/mock_web_api_server.py index 403b993b2..24d310994 100644 --- a/tests/mock_web_api_server.py +++ b/tests/mock_web_api_server.py @@ -1,7 +1,6 @@ import asyncio import json import logging -import sys import threading import time from http import HTTPStatus @@ -10,11 +9,6 @@ from unittest import TestCase from urllib.parse import urlparse, parse_qs, ParseResult -from multiprocessing import Process -from urllib.request import urlopen, Request - -from tests.utils import get_mock_server_mode - class MockHandler(SimpleHTTPRequestHandler): protocol_version = "HTTP/1.1" @@ -234,59 +228,6 @@ def _parse_request_body(self, parsed_path: str, content_len: int) -> Optional[di return request_body -# -# multiprocessing -# - - -class MockServerProcessTarget: - def __init__(self, handler: Type[SimpleHTTPRequestHandler] = MockHandler): - self.handler = handler - - def run(self): - self.handler.received_requests = {} - self.server = HTTPServer(("localhost", 8888), self.handler) - try: - self.server.serve_forever(0.05) - finally: - self.server.server_close() - - def stop(self): - self.handler.received_requests = {} - self.server.shutdown() - self.join() - - -class MonitorThread(threading.Thread): - def __init__(self, test: TestCase, handler: Type[SimpleHTTPRequestHandler] = MockHandler): - threading.Thread.__init__(self, daemon=True) - self.handler = handler - self.test = test - self.test.mock_received_requests = None - self.is_running = True - - def run(self) -> None: - while self.is_running: - try: - req = Request(f"{self.test.server_url}/received_requests.json") - resp = urlopen(req, timeout=1) - self.test.mock_received_requests = json.loads(resp.read().decode("utf-8")) - except Exception as e: - # skip logging for the initial request - if self.test.mock_received_requests is not None: - logging.getLogger(__name__).exception(e) - time.sleep(0.01) - - def stop(self): - self.is_running = False - self.join() - - -# -# threading -# - - class MockServerThread(threading.Thread): def __init__(self, test: TestCase, handler: Type[SimpleHTTPRequestHandler] = MockHandler): threading.Thread.__init__(self) @@ -313,53 +254,15 @@ def stop(self): def setup_mock_web_api_server(test: TestCase): - if get_mock_server_mode() == "threading": - test.server_started = threading.Event() - test.thread = MockServerThread(test) - test.thread.start() - test.server_started.wait() - else: - # start a mock server as another process - target = MockServerProcessTarget() - test.server_url = "http://localhost:8888" - test.host, test.port = "localhost", 8888 - test.process = Process(target=target.run, daemon=True) - test.process.start() - - time.sleep(0.1) - - # start a thread in the current process - # this thread fetches mock_received_requests from the remote process - test.monitor_thread = MonitorThread(test) - test.monitor_thread.start() - count = 0 - # wait until the first successful data retrieval - while test.mock_received_requests is None: - time.sleep(0.01) - count += 1 - if count >= 100: - raise Exception("The mock server is not yet running!") + test.server_started = threading.Event() + test.thread = MockServerThread(test) + test.thread.start() + test.server_started.wait() def cleanup_mock_web_api_server(test: TestCase): - if get_mock_server_mode() == "threading": - test.thread.stop() - test.thread = None - else: - # stop the thread to fetch mock_received_requests from the remote process - test.monitor_thread.stop() - - # terminate the process - test.process.terminate() - test.process.join() - - # Python 3.6 does not have these methods - if sys.version_info.major == 3 and sys.version_info.minor > 6: - # cleanup the process's resources - test.process.kill() - test.process.close() - - test.process = None + test.thread.stop() + test.thread = None def assert_auth_test_count(test: TestCase, expected_count: int): diff --git a/tests/utils.py b/tests/utils.py index 733a7c4de..eb9759c5d 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -15,21 +15,6 @@ def restore_os_env(old_env: dict) -> None: os.environ.update(old_env) -def get_mock_server_mode() -> str: - """Returns a str representing the mode. - - :return: threading/multiprocessing - """ - mode = os.environ.get("BOLT_PYTHON_MOCK_SERVER_MODE") - if mode is None: - # We used to use "multiprocessing"" for macOS until Big Sur 11.1 - # Since 11.1, the "multiprocessing" mode started failing a lot... - # Therefore, we switched the default mode back to "threading". - return "threading" - else: - return mode - - def get_event_loop(): try: return asyncio.get_event_loop() From 4b086cf5fa1331244c4de859e17ff9a245b0fee5 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Tue, 16 Jan 2024 19:13:51 -0500 Subject: [PATCH 461/719] Replace Flask-Sockets with aiohttp for testing (#1012) --- .github/workflows/codecov.yml | 1 - .github/workflows/tests.yml | 13 +- requirements/adapter_testing.txt | 5 +- requirements/async.txt | 3 +- requirements/testing.txt | 6 +- requirements/testing_without_asyncio.txt | 6 +- .../socket_mode/mock_socket_mode_server.py | 125 +++++++++++------- .../socket_mode/test_async_aiohttp.py | 4 +- .../socket_mode/test_async_lazy_listeners.py | 4 +- .../socket_mode/test_async_websockets.py | 4 +- 10 files changed, 97 insertions(+), 74 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index ea48ce6bc..6265aff35 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -25,7 +25,6 @@ jobs: run: | pip install -U pip pip install . - pip install -r requirements/async.txt pip install -r requirements/adapter.txt pip install -r requirements/testing.txt pip install -r requirements/adapter_testing.txt diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 25d4ecc6a..35647154a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,7 +19,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies + - name: Install synchronous dependencies run: | pip install -U pip pip install -r requirements.txt @@ -28,11 +28,10 @@ jobs: run: | pytest tests/slack_bolt/ pytest tests/scenario_tests/ - - name: Run tests for Socket Mode adapters + - name: Install adapter dependencies run: | pip install -r requirements/adapter.txt pip install -r requirements/adapter_testing.txt - pytest tests/adapter_tests/socket_mode/ - name: Run tests for HTTP Mode adapters (AWS) run: | pytest tests/adapter_tests/aws/ @@ -68,9 +67,15 @@ jobs: - name: Run tests for HTTP Mode adapters (Tornado) run: | pytest tests/adapter_tests/tornado/ - - name: Run tests for HTTP Mode adapters (asyncio-based libraries) + - name: Install async dependencies run: | pip install -r requirements/async.txt + - name: Run tests for Socket Mode adapters + run: | + # Requires async test dependencies + pytest tests/adapter_tests/socket_mode/ + - name: Run tests for HTTP Mode adapters (asyncio-based libraries) + run: | # Falcon supports Python 3.11 since its v3.1.1 pip install "falcon>=3.1.1,<4" pytest tests/adapter_tests_async/ diff --git a/requirements/adapter_testing.txt b/requirements/adapter_testing.txt index f2978a463..27d4d9fa2 100644 --- a/requirements/adapter_testing.txt +++ b/requirements/adapter_testing.txt @@ -1,8 +1,5 @@ # pip install -r requirements/adapter_testing.txt -moto>=3,<4 # For AWS tests +moto>=3,<5 # For AWS tests docker>=5,<6 # Used by moto boddle>=0.2,<0.3 # For Bottle app tests -Flask>=1,<2 # TODO: Flask-Sockets is not yet compatible with Flask 2.x -Werkzeug>=1,<2 # TODO: Flask-Sockets is not yet compatible with Flask 2.x sanic-testing>=0.7; python_version>"3.6" -requests>=2,<3 # For Starlette's TestClient diff --git a/requirements/async.txt b/requirements/async.txt index 221ec4ae9..f27c3baf6 100644 --- a/requirements/async.txt +++ b/requirements/async.txt @@ -1,4 +1,3 @@ # pip install -r requirements/async.txt aiohttp>=3,<4 -websockets>=8,<10; python_version=="3.6" -websockets>=10,<11; python_version>"3.6" +websockets<11 diff --git a/requirements/testing.txt b/requirements/testing.txt index 6fbcc045d..7cd7d353a 100644 --- a/requirements/testing.txt +++ b/requirements/testing.txt @@ -1,6 +1,4 @@ # pip install -r requirements/testing.txt -r testing_without_asyncio.txt - -pytest-asyncio>=0.16.0; python_version=="3.6" -pytest-asyncio>=0.18.2,<1; python_version>"3.6" -aiohttp>=3,<4 +-r async.txt +pytest-asyncio<1; diff --git a/requirements/testing_without_asyncio.txt b/requirements/testing_without_asyncio.txt index 0f971986c..5421347a0 100644 --- a/requirements/testing_without_asyncio.txt +++ b/requirements/testing_without_asyncio.txt @@ -1,9 +1,5 @@ # pip install -r requirements/testing_without_asyncio.txt pytest>=6.2.5,<7 -pytest-cov>=3,<4 -Flask-Sockets>=0.2,<1 # TODO: This module is not yet Flask 2.x compatible -Werkzeug>=1,<2 # TODO: Flask-Sockets is not yet compatible with Flask 2.x -itsdangerous==2.0.1 # TODO: Flask-Sockets is not yet compatible with Flask 2.x -Jinja2==3.0.3 # https://github.com/pallets/flask/issues/4494 +pytest-cov>=3,<5 black==22.8.0 # Until we drop Python 3.6 support, we have to stay with this version click<=8.0.4 # black is affected by https://github.com/pallets/click/issues/2225 diff --git a/tests/adapter_tests/socket_mode/mock_socket_mode_server.py b/tests/adapter_tests/socket_mode/mock_socket_mode_server.py index 5d64d0783..997657368 100644 --- a/tests/adapter_tests/socket_mode/mock_socket_mode_server.py +++ b/tests/adapter_tests/socket_mode/mock_socket_mode_server.py @@ -1,10 +1,12 @@ -import json +import asyncio import logging import threading import time -import requests -from typing import List from unittest import TestCase +from urllib.error import URLError +from urllib.request import urlopen + +from aiohttp import WSMsgType, web socket_mode_envelopes = [ """{"envelope_id":"57d6a792-4d35-4d0b-b6aa-3361493e1caf","payload":{"type":"shortcut","token":"xxx","action_ts":"1610198080.300836","team":{"id":"T111","domain":"seratch"},"user":{"id":"U111","username":"seratch","team_id":"T111"},"is_enterprise_install":false,"enterprise":null,"callback_id":"do-something","trigger_id":"111.222.xxx"},"type":"interactive","accepts_response_payload":false}""", @@ -12,67 +14,94 @@ """{"envelope_id":"08cfc559-d933-402e-a5c1-79e135afaae4","payload":{"token":"xxx","team_id":"T111","api_app_id":"A111","event":{"client_msg_id":"c9b466b5-845c-49c6-a371-57ae44359bf1","type":"message","text":"<@W111>","user":"U111","ts":"1610197986.000300","team":"T111","blocks":[{"type":"rich_text","block_id":"1HBPc","elements":[{"type":"rich_text_section","elements":[{"type":"user","user_id":"U111"}]}]}],"channel":"C111","event_ts":"1610197986.000300","channel_type":"channel"},"type":"event_callback","event_id":"Ev111","event_time":1610197986,"authorizations":[{"enterprise_id":null,"team_id":"T111","user_id":"U111","is_bot":true,"is_enterprise_install":false}],"is_ext_shared_channel":false,"event_context":"1-message-T111-C111"},"type":"events_api","accepts_response_payload":false,"retry_attempt":1,"retry_reason":"timeout"}""", ] -from flask import Flask -from flask_sockets import Sockets - def start_thread_socket_mode_server(test: TestCase, port: int): - def _start_thread_socket_mode_server(): - logger = logging.getLogger(__name__) - app: Flask = Flask(__name__) + logger = logging.getLogger(__name__) + state = {} + + def reset_server_state(): + state.update( + envelopes_to_consume=list(socket_mode_envelopes), + ) + + test.reset_server_state = reset_server_state + + async def health(request: web.Request): + wr = web.Response() + await wr.prepare(request) + wr.set_status(200) + return wr + + async def link(request: web.Request): + ws = web.WebSocketResponse() + await ws.prepare(request) + + async for msg in ws: + if msg.type != WSMsgType.TEXT: + continue - @app.route("/state") - def state(): - return json.dumps({"success": True}), 200, {"ContentType": "application/json"} + if state["envelopes_to_consume"]: + e = state["envelopes_to_consume"].pop(0) + logger.debug(f"Send an envelope: {e}") + await ws.send_str(e) - sockets: Sockets = Sockets(app) + message = msg.data + logger.debug(f"Server received a message: {message}") - envelopes_to_consume: List[str] = list(socket_mode_envelopes) + await ws.send_str(message) - @sockets.route("/link") - def link(ws): - while not ws.closed: - message = ws.read_message() - if message is not None: - if len(envelopes_to_consume) > 0: - e = envelopes_to_consume.pop(0) - logger.debug(f"Send an envelope: {e}") - ws.send(e) + return ws - logger.debug(f"Server received a message: {message}") - ws.send(message) + app = web.Application() + app.add_routes( + [ + web.get("/link", link), + web.get("/health", health), + ] + ) + runner = web.AppRunner(app) - from gevent import pywsgi - from geventwebsocket.handler import WebSocketHandler + def run_server(): + reset_server_state() - server = pywsgi.WSGIServer(("", port), app, handler_class=WebSocketHandler) - test.server = server - server.serve_forever(stop_timeout=1) + test.loop = asyncio.new_event_loop() + asyncio.set_event_loop(test.loop) + test.loop.run_until_complete(runner.setup()) + site = web.TCPSite(runner, "127.0.0.1", port, reuse_port=True) + test.loop.run_until_complete(site.start()) - return _start_thread_socket_mode_server + # run until it's stopped from the main thread + test.loop.run_forever() + + test.loop.run_until_complete(runner.cleanup()) + test.loop.close() + + return run_server def start_socket_mode_server(test, port: int): test.sm_thread = threading.Thread(target=start_thread_socket_mode_server(test, port)) test.sm_thread.daemon = True test.sm_thread.start() - wait_for_socket_mode_server(port, 4) # wait for the server + wait_for_socket_mode_server(port, 4) -def wait_for_socket_mode_server(port: int, secs: int): +def wait_for_socket_mode_server(port: int, timeout: int): start_time = time.time() - while (time.time() - start_time) < secs: - response = requests.get(url=f"http://localhost:{port}/state") - if response.ok: - break - time.sleep(0.01) - - -def stop_socket_mode_server(test): - test.server.stop() - test.server.close() - - -async def stop_socket_mode_server_async(test: TestCase): - test.server.stop() - test.server.close() + while (time.time() - start_time) < timeout: + try: + urlopen(f"http://127.0.0.1:{port}/health") + return + except URLError: + time.sleep(0.01) + + +def stop_socket_mode_server(test: TestCase): + # An event loop runs in a thread and executes all callbacks and Tasks in + # its thread. While a Task is running in the event loop, no other Tasks + # can run in the same thread. When a Task executes an await expression, the + # running Task gets suspended, and the event loop executes the next Task. + # To schedule a callback from another OS thread, the loop.call_soon_threadsafe() method should be used. + # https://docs.python.org/3/library/asyncio-dev.html#asyncio-multithreading + test.loop.call_soon_threadsafe(test.loop.stop) + test.sm_thread.join(timeout=5) diff --git a/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py b/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py index 6e8ce40de..1720f7ec6 100644 --- a/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py +++ b/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py @@ -12,7 +12,7 @@ from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop from ...adapter_tests.socket_mode.mock_socket_mode_server import ( start_socket_mode_server, - stop_socket_mode_server_async, + stop_socket_mode_server, ) @@ -71,4 +71,4 @@ async def command_handler(ack): assert result["command"] is True finally: await handler.client.close() - await stop_socket_mode_server_async(self) + stop_socket_mode_server(self) diff --git a/tests/adapter_tests_async/socket_mode/test_async_lazy_listeners.py b/tests/adapter_tests_async/socket_mode/test_async_lazy_listeners.py index 6709d588e..11268c6a1 100644 --- a/tests/adapter_tests_async/socket_mode/test_async_lazy_listeners.py +++ b/tests/adapter_tests_async/socket_mode/test_async_lazy_listeners.py @@ -12,7 +12,7 @@ from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop from ...adapter_tests.socket_mode.mock_socket_mode_server import ( start_socket_mode_server, - stop_socket_mode_server_async, + stop_socket_mode_server, ) @@ -80,4 +80,4 @@ async def lazy_func(body): finally: await handler.client.close() - await stop_socket_mode_server_async(self) + stop_socket_mode_server(self) diff --git a/tests/adapter_tests_async/socket_mode/test_async_websockets.py b/tests/adapter_tests_async/socket_mode/test_async_websockets.py index 19167e635..db2680fc6 100644 --- a/tests/adapter_tests_async/socket_mode/test_async_websockets.py +++ b/tests/adapter_tests_async/socket_mode/test_async_websockets.py @@ -12,7 +12,7 @@ from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop from ...adapter_tests.socket_mode.mock_socket_mode_server import ( start_socket_mode_server, - stop_socket_mode_server_async, + stop_socket_mode_server, ) @@ -71,4 +71,4 @@ async def command_handler(ack): assert result["command"] is True finally: await handler.client.close() - await stop_socket_mode_server_async(self) + stop_socket_mode_server(self) From 69e033f4415fb192480df4b455bb9f25982f7737 Mon Sep 17 00:00:00 2001 From: Jun Ohtani Date: Mon, 29 Jan 2024 17:25:09 +0900 Subject: [PATCH 462/719] Fix type in ja_listening_events.md (#1022) --- docs/_basic/ja_listening_events.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_basic/ja_listening_events.md b/docs/_basic/ja_listening_events.md index 0954c2ce7..193b1b83f 100644 --- a/docs/_basic/ja_listening_events.md +++ b/docs/_basic/ja_listening_events.md @@ -35,7 +35,7 @@ def ask_for_introduction(event, say):
    `message()` リスナーは `event("message")` と等価の機能を提供します。 -`subtype` という追加のキーを指定して、イベントのサブタイプでフィルタリングすることもできます。よく使われるサブタイプには、`bot_message` や `message_replied` があります。詳しくは[メッセージイベントページ](https://api.slack.com/events/message#message_subtypes)を参照してください。サブタイプなしのイベントだけにフルターするために明に `None` を指定することもできます。 +`subtype` という追加のキーを指定して、イベントのサブタイプでフィルタリングすることもできます。よく使われるサブタイプには、`bot_message` や `message_replied` があります。詳しくは[メッセージイベントページ](https://api.slack.com/events/message#message_subtypes)を参照してください。サブタイプなしのイベントだけにフィルターするために明に `None` を指定することもできます。
    From 91f9ef1e7a9d9fab86129b23b8549ca71228175d Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Wed, 7 Feb 2024 11:19:28 -0500 Subject: [PATCH 463/719] feat: improve test speed (#1017) * Speed up the tests * make all tests pass * Update tests/mock_web_api_server.py Co-authored-by: Kazuhiro Sera * health endpoint not required * Update tests/mock_web_api_server.py Co-authored-by: Kazuhiro Sera * Move responses out of class * Improve naming * More time saving --------- Co-authored-by: Kazuhiro Sera --- tests/adapter_tests/aws/test_aws_chalice.py | 5 +- tests/adapter_tests/aws/test_aws_lambda.py | 3 +- tests/adapter_tests_async/test_async_asgi.py | 2 +- tests/mock_web_api_server.py | 259 +++++++++--------- tests/scenario_tests/test_app.py | 15 +- .../test_app_actor_user_token.py | 19 +- tests/scenario_tests/test_app_bot_only.py | 34 +-- .../test_app_custom_authorize.py | 19 +- .../test_app_installation_store.py | 16 +- .../test_app_using_methods_in_class.py | 12 +- tests/scenario_tests/test_authorize.py | 8 +- tests/scenario_tests/test_events.py | 30 +- .../scenario_tests/test_events_ignore_self.py | 20 +- tests/scenario_tests/test_events_org_apps.py | 20 +- .../test_events_request_verification.py | 9 +- .../test_events_shared_channels.py | 30 +- .../scenario_tests/test_events_socket_mode.py | 26 +- .../test_events_token_revocations.py | 14 +- .../test_events_url_verification.py | 12 +- tests/scenario_tests/test_lazy.py | 14 +- tests/scenario_tests/test_message.py | 26 +- tests/scenario_tests/test_message_bot.py | 8 +- .../scenario_tests/test_message_file_share.py | 8 +- .../test_message_thread_broadcast.py | 8 +- tests/scenario_tests/test_workflow_steps.py | 18 +- .../test_workflow_steps_decorator_simple.py | 20 +- ...test_workflow_steps_decorator_with_args.py | 20 +- .../authorization/test_authorize.py | 12 +- 28 files changed, 307 insertions(+), 380 deletions(-) diff --git a/tests/adapter_tests/aws/test_aws_chalice.py b/tests/adapter_tests/aws/test_aws_chalice.py index 58213d04c..4a5744333 100644 --- a/tests/adapter_tests/aws/test_aws_chalice.py +++ b/tests/adapter_tests/aws/test_aws_chalice.py @@ -21,6 +21,7 @@ from slack_bolt.app import App from slack_bolt.oauth.oauth_settings import OAuthSettings from tests.mock_web_api_server import ( + assert_received_request_count, setup_mock_web_api_server, cleanup_mock_web_api_server, assert_auth_test_count, @@ -263,7 +264,7 @@ def say_it(say): response: Response = slack_handler.handle(request) assert response.status_code == 200 assert_auth_test_count(self, 1) - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, "/chat.postMessage", 1) def test_lazy_listeners_cli(self): with mock.patch.dict(os.environ, {"AWS_CHALICE_CLI_MODE": "true"}): @@ -316,7 +317,7 @@ def events() -> Response: assert response.status_code == 200, f"Failed request: {response.body}" assert_auth_test_count(self, 1) - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, "/chat.postMessage", 1) @mock.patch( "slack_bolt.adapter.aws_lambda.chalice_lazy_listener_runner.boto3", diff --git a/tests/adapter_tests/aws/test_aws_lambda.py b/tests/adapter_tests/aws/test_aws_lambda.py index 3159f9731..3096dcaab 100644 --- a/tests/adapter_tests/aws/test_aws_lambda.py +++ b/tests/adapter_tests/aws/test_aws_lambda.py @@ -13,6 +13,7 @@ from slack_bolt.app import App from slack_bolt.oauth.oauth_settings import OAuthSettings from tests.mock_web_api_server import ( + assert_received_request_count, setup_mock_web_api_server, cleanup_mock_web_api_server, assert_auth_test_count, @@ -279,7 +280,7 @@ def say_it(say): response = SlackRequestHandler(app).handle(event, self.context) assert response["statusCode"] == 200 assert_auth_test_count(self, 1) - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, "/chat.postMessage", 1) @mock_lambda def test_oauth(self): diff --git a/tests/adapter_tests_async/test_async_asgi.py b/tests/adapter_tests_async/test_async_asgi.py index 1483d646f..d17cf069b 100644 --- a/tests/adapter_tests_async/test_async_asgi.py +++ b/tests/adapter_tests_async/test_async_asgi.py @@ -221,4 +221,4 @@ async def test_url_verification(self): assert response.status_code == 200 assert response.headers.get("content-type") == "application/json;charset=utf-8" - assert_auth_test_count(self, 1) + assert_auth_test_count(self, 0) diff --git a/tests/mock_web_api_server.py b/tests/mock_web_api_server.py index 24d310994..ce42ddb1f 100644 --- a/tests/mock_web_api_server.py +++ b/tests/mock_web_api_server.py @@ -1,6 +1,7 @@ import asyncio import json import logging +from queue import Queue import threading import time from http import HTTPStatus @@ -9,6 +10,84 @@ from unittest import TestCase from urllib.parse import urlparse, parse_qs, ParseResult +INVALID_AUTH = json.dumps( + { + "ok": False, + "error": "invalid_auth", + } +) + +OK_FALSE_RESPONSE = json.dumps( + { + "ok": False, + } +) + +OAUTH_V2_ACCESS_RESPONSE = json.dumps( + { + "ok": True, + "access_token": "xoxb-17653672481-19874698323-pdFZKVeTuE8sk7oOcBrzbqgy", + "token_type": "bot", + "scope": "chat:write,commands", + "bot_user_id": "U0KRQLJ9H", + "app_id": "A0KRD7HC3", + "team": {"name": "Slack Softball Team", "id": "T9TK3CUKW"}, + "enterprise": {"name": "slack-sports", "id": "E12345678"}, + "authed_user": {"id": "U1234", "scope": "chat:write", "access_token": "xoxp-1234", "token_type": "user"}, + } +) + +OAUTH_V2_ACCESS_BOT_REFRESH_RESPONSE = json.dumps( + { + "ok": True, + "app_id": "A0KRD7HC3", + "access_token": "xoxb-valid-refreshed", + "expires_in": 43200, + "refresh_token": "xoxe-1-valid-bot-refreshed", + "token_type": "bot", + "scope": "chat:write,commands", + "bot_user_id": "U0KRQLJ9H", + "team": {"name": "Slack Softball Team", "id": "T9TK3CUKW"}, + "enterprise": {"name": "slack-sports", "id": "E12345678"}, + } +) + +OAUTH_V2_ACCESS_USER_REFRESH_RESPONSE = json.dumps( + { + "ok": True, + "app_id": "A0KRD7HC3", + "access_token": "xoxp-valid-refreshed", + "expires_in": 43200, + "refresh_token": "xoxe-1-valid-user-refreshed", + "token_type": "user", + "scope": "search:read", + "team": {"name": "Slack Softball Team", "id": "T9TK3CUKW"}, + "enterprise": {"name": "slack-sports", "id": "E12345678"}, + } +) +BOT_AUTH_TEST_RESPONSE = json.dumps( + { + "ok": True, + "url": "https://subarachnoid.slack.com/", + "team": "Subarachnoid Workspace", + "user": "bot", + "team_id": "T0G9PQBBK", + "user_id": "W23456789", + "bot_id": "BZYBOTHED", + } +) + +USER_AUTH_TEST_RESPONSE = json.dumps( + { + "ok": True, + "url": "https://subarachnoid.slack.com/", + "team": "Subarachnoid Workspace", + "user": "some-user", + "team_id": "T0G9PQBBK", + "user_id": "W99999", + } +) + class MockHandler(SimpleHTTPRequestHandler): protocol_version = "HTTP/1.1" @@ -22,120 +101,24 @@ def is_valid_token(self): def is_valid_user_token(self): return "Authorization" in self.headers and str(self.headers["Authorization"]).startswith("Bearer xoxp-") - def set_common_headers(self): + def set_common_headers(self, content_length: int = 0): self.send_header("content-type", "application/json;charset=utf-8") - self.send_header("connection", "close") + self.send_header("content-length", str(content_length)) self.end_headers() - invalid_auth = { - "ok": False, - "error": "invalid_auth", - } - - oauth_v2_access_response = """ -{ - "ok": true, - "access_token": "xoxb-17653672481-19874698323-pdFZKVeTuE8sk7oOcBrzbqgy", - "token_type": "bot", - "scope": "chat:write,commands", - "bot_user_id": "U0KRQLJ9H", - "app_id": "A0KRD7HC3", - "team": { - "name": "Slack Softball Team", - "id": "T9TK3CUKW" - }, - "enterprise": { - "name": "slack-sports", - "id": "E12345678" - }, - "authed_user": { - "id": "U1234", - "scope": "chat:write", - "access_token": "xoxp-1234", - "token_type": "user" - } -} -""" - oauth_v2_access_bot_refresh_response = """ - { - "ok": true, - "app_id": "A0KRD7HC3", - "access_token": "xoxb-valid-refreshed", - "expires_in": 43200, - "refresh_token": "xoxe-1-valid-bot-refreshed", - "token_type": "bot", - "scope": "chat:write,commands", - "bot_user_id": "U0KRQLJ9H", - "team": { - "name": "Slack Softball Team", - "id": "T9TK3CUKW" - }, - "enterprise": { - "name": "slack-sports", - "id": "E12345678" - } - } -""" - oauth_v2_access_user_refresh_response = """ - { - "ok": true, - "app_id": "A0KRD7HC3", - "access_token": "xoxp-valid-refreshed", - "expires_in": 43200, - "refresh_token": "xoxe-1-valid-user-refreshed", - "token_type": "user", - "scope": "search:read", - "team": { - "name": "Slack Softball Team", - "id": "T9TK3CUKW" - }, - "enterprise": { - "name": "slack-sports", - "id": "E12345678" - } - } - """ - bot_auth_test_response = """ -{ - "ok": true, - "url": "https://subarachnoid.slack.com/", - "team": "Subarachnoid Workspace", - "user": "bot", - "team_id": "T0G9PQBBK", - "user_id": "W23456789", - "bot_id": "BZYBOTHED" -} -""" - - user_auth_test_response = """ -{ - "ok": true, - "url": "https://subarachnoid.slack.com/", - "team": "Subarachnoid Workspace", - "user": "some-user", - "team_id": "T0G9PQBBK", - "user_id": "W99999" -} -""" - def _handle(self): parsed_path: ParseResult = urlparse(self.path) path = parsed_path.path + self.server.queue.put(path) self.received_requests[path] = self.received_requests.get(path, 0) + 1 try: if path == "/webhook": self.send_response(200) - self.set_common_headers() + self.set_common_headers(len("OK")) self.wfile.write("OK".encode("utf-8")) return - if path == "/received_requests.json": - self.send_response(200) - self.set_common_headers() - self.wfile.write(json.dumps(self.received_requests).encode("utf-8")) - return - - body = {"ok": True} + body = """{"ok": true}""" if path == "/oauth.v2.access": if self.headers.get("authorization") is not None: request_body = self._parse_request_body( @@ -149,34 +132,32 @@ def _handle(self): if refresh_token is not None: if "bot-valid" in refresh_token: self.send_response(200) - self.set_common_headers() - body = self.oauth_v2_access_bot_refresh_response - self.wfile.write(body.encode("utf-8")) + self.set_common_headers(len(OAUTH_V2_ACCESS_BOT_REFRESH_RESPONSE)) + self.wfile.write(OAUTH_V2_ACCESS_BOT_REFRESH_RESPONSE.encode("utf-8")) return if "user-valid" in refresh_token: self.send_response(200) - self.set_common_headers() - body = self.oauth_v2_access_user_refresh_response - self.wfile.write(body.encode("utf-8")) + self.set_common_headers(len(OAUTH_V2_ACCESS_USER_REFRESH_RESPONSE)) + self.wfile.write(OAUTH_V2_ACCESS_USER_REFRESH_RESPONSE.encode("utf-8")) return elif request_body.get("code") is not None: self.send_response(200) - self.set_common_headers() - self.wfile.write(self.oauth_v2_access_response.encode("utf-8")) + self.set_common_headers(len(OAUTH_V2_ACCESS_RESPONSE)) + self.wfile.write(OAUTH_V2_ACCESS_RESPONSE.encode("utf-8")) return if self.is_valid_user_token(): if path == "/auth.test": self.send_response(200) - self.set_common_headers() - self.wfile.write(self.user_auth_test_response.encode("utf-8")) + self.set_common_headers(len(USER_AUTH_TEST_RESPONSE)) + self.wfile.write(USER_AUTH_TEST_RESPONSE.encode("utf-8")) return if self.is_valid_token(): if path == "/auth.test": self.send_response(200) - self.set_common_headers() - self.wfile.write(self.bot_auth_test_response.encode("utf-8")) + self.set_common_headers(len(BOT_AUTH_TEST_RESPONSE)) + self.wfile.write(BOT_AUTH_TEST_RESPONSE.encode("utf-8")) return request_body = self._parse_request_body( @@ -189,16 +170,15 @@ def _handle(self): pattern = str(header).split("xoxb-", 1)[1] if pattern.isnumeric(): self.send_response(int(pattern)) - self.set_common_headers() - self.wfile.write("""{"ok":false}""".encode("utf-8")) + self.set_common_headers(len(OK_FALSE_RESPONSE)) + self.wfile.write(OK_FALSE_RESPONSE.encode("utf-8")) return else: - body = self.invalid_auth + body = INVALID_AUTH self.send_response(HTTPStatus.OK) - self.set_common_headers() - self.wfile.write(json.dumps(body).encode("utf-8")) - self.wfile.close() + self.set_common_headers(len(body)) + self.wfile.write(body.encode("utf-8")) except Exception as e: self.logger.error(str(e), exc_info=True) @@ -229,13 +209,15 @@ def _parse_request_body(self, parsed_path: str, content_len: int) -> Optional[di class MockServerThread(threading.Thread): - def __init__(self, test: TestCase, handler: Type[SimpleHTTPRequestHandler] = MockHandler): + def __init__(self, queue: Queue, test: TestCase, handler: Type[SimpleHTTPRequestHandler] = MockHandler): threading.Thread.__init__(self) self.handler = handler self.test = test + self.queue = queue def run(self): self.server = HTTPServer(("localhost", 8888), self.handler) + self.server.queue = self.queue self.test.mock_received_requests = self.handler.received_requests self.test.server_url = "http://localhost:8888" self.test.host, self.test.port = self.server.socket.getsockname() @@ -249,13 +231,28 @@ def run(self): def stop(self): self.handler.received_requests = {} + with self.server.queue.mutex: + del self.server.queue self.server.shutdown() self.join() +class ReceivedRequests: + def __init__(self, queue: Queue): + self.queue = queue + self.received_requests = {} + + def get(self, key: str, default: Optional[int] = None) -> Optional[int]: + while not self.queue.empty(): + path = self.queue.get() + self.received_requests[path] = self.received_requests.get(path, 0) + 1 + return self.received_requests.get(key, default) + + def setup_mock_web_api_server(test: TestCase): test.server_started = threading.Event() - test.thread = MockServerThread(test) + test.received_requests = ReceivedRequests(Queue()) + test.thread = MockServerThread(test.received_requests.queue, test) test.thread.start() test.server_started.wait() @@ -265,24 +262,26 @@ def cleanup_mock_web_api_server(test: TestCase): test.thread = None -def assert_auth_test_count(test: TestCase, expected_count: int): - time.sleep(0.1) - retry_count = 0 +def assert_received_request_count(test: TestCase, path: str, min_count: int, timeout: float = 1): + start_time = time.time() error = None - while retry_count < 3: + while time.time() - start_time < timeout: try: - test.mock_received_requests.get("/auth.test", 0) == expected_count - break + assert test.received_requests.get(path, 0) == min_count + return except Exception as e: error = e - retry_count += 1 - # waiting for mock_received_requests updates - time.sleep(0.1) + # waiting for some requests to be received + time.sleep(0.05) if error is not None: raise error +def assert_auth_test_count(test: TestCase, expected_count: int): + assert_received_request_count(test, "/auth.test", expected_count, 0.5) + + async def assert_auth_test_count_async(test: TestCase, expected_count: int): await asyncio.sleep(0.1) retry_count = 0 diff --git a/tests/scenario_tests/test_app.py b/tests/scenario_tests/test_app.py index e7c105ea3..9bbad6d9a 100644 --- a/tests/scenario_tests/test_app.py +++ b/tests/scenario_tests/test_app.py @@ -8,15 +8,12 @@ from slack_sdk.oauth.installation_store import FileInstallationStore from slack_sdk.oauth.state_store import FileOAuthStateStore -from slack_bolt import App, Say, BoltRequest, BoltContext +from slack_bolt import App, BoltContext, BoltRequest, Say from slack_bolt.authorization import AuthorizeResult from slack_bolt.error import BoltError from slack_bolt.oauth import OAuthFlow from slack_bolt.oauth.oauth_settings import OAuthSettings -from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, -) +from tests.mock_web_api_server import cleanup_mock_web_api_server, setup_mock_web_api_server from tests.utils import remove_os_env_temporarily, restore_os_env @@ -77,7 +74,7 @@ class TestExecutor(Executor): def test_valid_single_auth(self): app = App(signing_secret="valid", client=self.web_client) - assert app != None + assert app is not None def test_token_absence(self): with pytest.raises(BoltError): @@ -97,7 +94,7 @@ def test_token_verification_enabled_False(self): token_verification_enabled=False, ) - assert self.mock_received_requests.get("/auth.test") is None + assert self.received_requests.get("/auth.test") is None # -------------------------- # multi teams auth @@ -108,7 +105,7 @@ def test_valid_multi_auth(self): signing_secret="valid", oauth_settings=OAuthSettings(client_id="111.222", client_secret="valid"), ) - assert app != None + assert app is not None def test_valid_multi_auth_oauth_flow(self): oauth_flow = OAuthFlow( @@ -120,7 +117,7 @@ def test_valid_multi_auth_oauth_flow(self): ) ) app = App(signing_secret="valid", oauth_flow=oauth_flow) - assert app != None + assert app is not None def test_valid_multi_auth_client_id_absence(self): with pytest.raises(BoltError): diff --git a/tests/scenario_tests/test_app_actor_user_token.py b/tests/scenario_tests/test_app_actor_user_token.py index 15941c79f..024c29e59 100644 --- a/tests/scenario_tests/test_app_actor_user_token.py +++ b/tests/scenario_tests/test_app_actor_user_token.py @@ -1,20 +1,21 @@ import datetime import json import logging -from time import time, sleep +from time import time from typing import Optional from slack_sdk import WebClient from slack_sdk.oauth import InstallationStore -from slack_sdk.oauth.installation_store import Installation, Bot +from slack_sdk.oauth.installation_store import Bot, Installation from slack_sdk.signature import SignatureVerifier -from slack_bolt import App, BoltRequest, Say, BoltContext +from slack_bolt import App, BoltContext, BoltRequest, Say from slack_bolt.oauth.oauth_settings import OAuthSettings from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, assert_auth_test_count, + assert_received_request_count, + cleanup_mock_web_api_server, + setup_mock_web_api_server, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -176,9 +177,8 @@ def handle_events(context: BoltContext, say: Say): response = app.dispatch(self.build_request()) assert response.status == 200 - assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_auth_test_count(self, 2) + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_authorize_result_no_user_token(self): app = App( @@ -215,5 +215,4 @@ def handle_events(context: BoltContext, say: Say): response = app.dispatch(self.build_request(team_id="T111111")) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) diff --git a/tests/scenario_tests/test_app_bot_only.py b/tests/scenario_tests/test_app_bot_only.py index c85590e39..9a4c932b9 100644 --- a/tests/scenario_tests/test_app_bot_only.py +++ b/tests/scenario_tests/test_app_bot_only.py @@ -1,12 +1,12 @@ import datetime import json import logging -from time import time, sleep +from time import time from typing import Optional from slack_sdk import WebClient from slack_sdk.oauth import InstallationStore -from slack_sdk.oauth.installation_store import Installation, Bot +from slack_sdk.oauth.installation_store import Bot, Installation from slack_sdk.oauth.state_store import FileOAuthStateStore from slack_sdk.signature import SignatureVerifier @@ -14,9 +14,10 @@ from slack_bolt.oauth import OAuthFlow from slack_bolt.oauth.oauth_settings import OAuthSettings from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, assert_auth_test_count, + assert_received_request_count, + cleanup_mock_web_api_server, + setup_mock_web_api_server, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -172,9 +173,8 @@ def test_installation_store_bot_only_default(self): app.event("app_mention")(self.handle_app_mention) response = app.dispatch(self.build_app_mention_request()) assert response.status == 200 - assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_auth_test_count(self, 2) + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_installation_store_bot_only_false(self): app = App( @@ -188,9 +188,8 @@ def test_installation_store_bot_only_false(self): app.event("app_mention")(self.handle_app_mention) response = app.dispatch(self.build_app_mention_request()) assert response.status == 200 - assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_auth_test_count(self, 2) + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_installation_store_bot_only(self): app = App( @@ -204,8 +203,7 @@ def test_installation_store_bot_only(self): response = app.dispatch(self.build_app_mention_request()) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_installation_store_bot_only_oauth_settings(self): app = App( @@ -218,8 +216,7 @@ def test_installation_store_bot_only_oauth_settings(self): response = app.dispatch(self.build_app_mention_request()) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_installation_store_bot_only_oauth_settings_conflicts(self): app = App( @@ -233,8 +230,7 @@ def test_installation_store_bot_only_oauth_settings_conflicts(self): response = app.dispatch(self.build_app_mention_request()) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_installation_store_bot_only_oauth_flow(self): app = App( @@ -247,8 +243,7 @@ def test_installation_store_bot_only_oauth_flow(self): response = app.dispatch(self.build_app_mention_request()) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_installation_store_bot_only_oauth_flow_conflicts(self): app = App( @@ -262,5 +257,4 @@ def test_installation_store_bot_only_oauth_flow_conflicts(self): response = app.dispatch(self.build_app_mention_request()) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) diff --git a/tests/scenario_tests/test_app_custom_authorize.py b/tests/scenario_tests/test_app_custom_authorize.py index e6293d695..02009162f 100644 --- a/tests/scenario_tests/test_app_custom_authorize.py +++ b/tests/scenario_tests/test_app_custom_authorize.py @@ -1,25 +1,26 @@ import datetime import json import logging -from time import time, sleep +from time import time from typing import Optional import pytest from slack_sdk import WebClient from slack_sdk.errors import SlackApiError from slack_sdk.oauth import InstallationStore -from slack_sdk.oauth.installation_store import Installation, Bot +from slack_sdk.oauth.installation_store import Bot, Installation from slack_sdk.signature import SignatureVerifier -from slack_bolt import App, BoltRequest, Say, BoltContext +from slack_bolt import App, BoltContext, BoltRequest, Say from slack_bolt.authorization import AuthorizeResult from slack_bolt.authorization.authorize import Authorize from slack_bolt.error import BoltError from slack_bolt.oauth.oauth_settings import OAuthSettings from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, assert_auth_test_count, + assert_received_request_count, + cleanup_mock_web_api_server, + setup_mock_web_api_server, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -209,9 +210,8 @@ def test_installation_store_only(self): app.event("app_mention")(self.handle_app_mention) response = app.dispatch(self.build_app_mention_request()) assert response.status == 200 - assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_auth_test_count(self, 2) + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_installation_store_and_authorize(self): installation_store = MemoryInstallationStore() @@ -231,8 +231,7 @@ def test_installation_store_and_authorize(self): response = app.dispatch(self.build_app_mention_request()) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_installation_store_and_func_authorize(self): installation_store = MemoryInstallationStore() diff --git a/tests/scenario_tests/test_app_installation_store.py b/tests/scenario_tests/test_app_installation_store.py index 1c0b5b07c..7434ee3e4 100644 --- a/tests/scenario_tests/test_app_installation_store.py +++ b/tests/scenario_tests/test_app_installation_store.py @@ -1,20 +1,21 @@ import datetime import json import logging -from time import time, sleep +from time import time from typing import Optional from slack_sdk import WebClient from slack_sdk.oauth import InstallationStore -from slack_sdk.oauth.installation_store import Installation, Bot +from slack_sdk.oauth.installation_store import Bot, Installation from slack_sdk.signature import SignatureVerifier -from slack_bolt import App, BoltRequest, Say, BoltContext +from slack_bolt import App, BoltContext, BoltRequest, Say from slack_bolt.oauth.oauth_settings import OAuthSettings from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, assert_auth_test_count, + assert_received_request_count, + cleanup_mock_web_api_server, + setup_mock_web_api_server, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -153,6 +154,5 @@ def handle_app_mention(context: BoltContext, say: Say): response = app.dispatch(self.build_app_mention_request()) assert response.status == 200 - assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_auth_test_count(self, 2) + assert_received_request_count(self, path="/chat.postMessage", min_count=1) diff --git a/tests/scenario_tests/test_app_using_methods_in_class.py b/tests/scenario_tests/test_app_using_methods_in_class.py index c16f19884..3124bec8b 100644 --- a/tests/scenario_tests/test_app_using_methods_in_class.py +++ b/tests/scenario_tests/test_app_using_methods_in_class.py @@ -1,16 +1,17 @@ import inspect import json -from time import time, sleep +from time import time from typing import Callable from slack_sdk.signature import SignatureVerifier from slack_sdk.web import WebClient -from slack_bolt import App, BoltRequest, Say, Ack, BoltContext +from slack_bolt import Ack, App, BoltContext, BoltRequest, Say from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, assert_auth_test_count, + assert_received_request_count, + cleanup_mock_web_api_server, + setup_mock_web_api_server, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -115,8 +116,7 @@ def run_app_and_verify(self, app: App): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(0.5) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_class_methods(self): app = App(client=self.web_client, signing_secret=self.signing_secret) diff --git a/tests/scenario_tests/test_authorize.py b/tests/scenario_tests/test_authorize.py index bd730e329..13c248693 100644 --- a/tests/scenario_tests/test_authorize.py +++ b/tests/scenario_tests/test_authorize.py @@ -9,11 +9,7 @@ from slack_bolt.app import App from slack_bolt.authorization import AuthorizeResult from slack_bolt.request.payload_utils import is_event -from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, - assert_auth_test_count, -) +from tests.mock_web_api_server import assert_auth_test_count, cleanup_mock_web_api_server, setup_mock_web_api_server from tests.utils import remove_os_env_temporarily, restore_os_env valid_token = "xoxb-valid" @@ -138,7 +134,7 @@ def test_failure(self): response = app.dispatch(request) assert response.status == 200 assert response.body == "" - assert self.mock_received_requests.get("/auth.test") == None + assert_auth_test_count(self, 0) def test_bot_context_attributes(self): app = App( diff --git a/tests/scenario_tests/test_events.py b/tests/scenario_tests/test_events.py index c6f2d6641..0cc6641fa 100644 --- a/tests/scenario_tests/test_events.py +++ b/tests/scenario_tests/test_events.py @@ -1,17 +1,18 @@ import json import re from functools import wraps -from time import time, sleep +from time import time import pytest from slack_sdk.signature import SignatureVerifier from slack_sdk.web import WebClient -from slack_bolt import App, BoltRequest, Say, BoltContext +from slack_bolt import App, BoltContext, BoltRequest, Say from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, assert_auth_test_count, + assert_received_request_count, + cleanup_mock_web_api_server, + setup_mock_web_api_server, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -87,8 +88,7 @@ def handle_app_mention(body, say, payload, event): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_middleware_skip(self): app = App(client=self.web_client, signing_secret=self.signing_secret) @@ -143,8 +143,7 @@ def handle_app_mention(body, say, payload, event): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_stable_auto_ack(self): app = App(client=self.web_client, signing_secret=self.signing_secret) @@ -221,8 +220,7 @@ def handle_member_left_channel(say): response = app.dispatch(request) assert response.status == 200 - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 2 + assert_received_request_count(self, path="/chat.postMessage", min_count=2) def test_member_join_left_events(self): app = App(client=self.web_client, signing_secret=self.signing_secret) @@ -283,9 +281,8 @@ def handle_app_mention(say): response = app.dispatch(request) assert response.status == 200 - sleep(1) # wait a bit after auto ack() # the listeners should not be executed - assert self.mock_received_requests["/chat.postMessage"] == 2 + assert_received_request_count(self, path="/chat.postMessage", min_count=2) def test_uninstallation_and_revokes(self): app = App(client=self.web_client, signing_secret=self.signing_secret) @@ -335,8 +332,7 @@ def handler2(say: Say): assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 2 + assert_received_request_count(self, path="/chat.postMessage", min_count=2) message_file_share_body = { "token": "verification-token", @@ -564,8 +560,7 @@ def handle_app_mention(body, say, payload, event): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_additional_decorators_2(self): app = App(client=self.web_client, signing_secret=self.signing_secret) @@ -583,8 +578,7 @@ def handle_app_mention(body, say, payload, event): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def my_decorator(f): diff --git a/tests/scenario_tests/test_events_ignore_self.py b/tests/scenario_tests/test_events_ignore_self.py index 12bcb987f..db7d07ea8 100644 --- a/tests/scenario_tests/test_events_ignore_self.py +++ b/tests/scenario_tests/test_events_ignore_self.py @@ -4,9 +4,10 @@ from slack_bolt import App, BoltRequest from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, assert_auth_test_count, + assert_received_request_count, + cleanup_mock_web_api_server, + setup_mock_web_api_server, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -38,9 +39,9 @@ def handle_app_mention(say): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() + sleep(0.5) # wait a bit after auto ack() # The listener should not be executed - assert self.mock_received_requests.get("/chat.postMessage") is None + assert self.received_requests.get("/chat.postMessage") is None def test_self_events_response_url(self): app = App(client=self.web_client) @@ -53,9 +54,9 @@ def handle_app_mention(say): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() + sleep(0.5) # wait a bit after auto ack() # The listener should not be executed - assert self.mock_received_requests.get("/chat.postMessage") is None + assert self.received_requests.get("/chat.postMessage") is None def test_not_self_events_response_url(self): app = App(client=self.web_client) @@ -68,8 +69,7 @@ def handle_app_mention(say): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests.get("/chat.postMessage") == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_self_events_disabled(self): app = App( @@ -85,9 +85,7 @@ def handle_app_mention(say): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - # The listener should be executed as the ignoring logic is disabled - assert self.mock_received_requests.get("/chat.postMessage") == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) event_body = { diff --git a/tests/scenario_tests/test_events_org_apps.py b/tests/scenario_tests/test_events_org_apps.py index a91c0e3c5..7eed113d5 100644 --- a/tests/scenario_tests/test_events_org_apps.py +++ b/tests/scenario_tests/test_events_org_apps.py @@ -1,5 +1,5 @@ import json -from time import time, sleep +from time import sleep, time from typing import Optional from slack_sdk.oauth import InstallationStore @@ -8,11 +8,7 @@ from slack_sdk.web import WebClient from slack_bolt import App, BoltRequest -from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, - assert_auth_test_count, -) +from tests.mock_web_api_server import assert_auth_test_count, cleanup_mock_web_api_server, setup_mock_web_api_server from tests.utils import remove_os_env_temporarily, restore_os_env valid_token = "xoxb-valid" @@ -25,7 +21,7 @@ def find_installation( enterprise_id: Optional[str], team_id: Optional[str], user_id: Optional[str] = None, - is_enterprise_install: Optional[bool] = False + is_enterprise_install: Optional[bool] = False, ) -> Optional[Installation]: assert enterprise_id == "E111" assert team_id is None @@ -107,7 +103,7 @@ def handle_app_mention(body): assert response.status == 200 # auth.test API call must be skipped assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() + sleep(0.5) # wait a bit after auto ack() assert result.called is True def test_team_access_revoked(self): @@ -143,8 +139,8 @@ def handle_app_mention(body): response = app.dispatch(request) assert response.status == 200 # auth.test API call must be skipped - assert self.mock_received_requests.get("/auth.test") is None - sleep(1) # wait a bit after auto ack() + assert_auth_test_count(self, 0) + sleep(0.5) # wait a bit after auto ack() assert result.called is True def test_app_home_opened(self): @@ -194,7 +190,7 @@ def handle_app_mention(body): assert response.status == 200 # auth.test API call must be skipped assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() + sleep(0.5) # wait a bit after auto ack() assert result.called is True def test_message(self): @@ -250,5 +246,5 @@ def handle_app_mention(body): assert response.status == 200 # auth.test API call must be skipped assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() + sleep(0.5) # wait a bit after auto ack() assert result.called is True diff --git a/tests/scenario_tests/test_events_request_verification.py b/tests/scenario_tests/test_events_request_verification.py index a8c53f23a..18e65eaec 100644 --- a/tests/scenario_tests/test_events_request_verification.py +++ b/tests/scenario_tests/test_events_request_verification.py @@ -1,11 +1,12 @@ import json -from time import sleep, time +from time import time from slack_sdk.web import WebClient from slack_sdk.signature import SignatureVerifier from slack_bolt import App, BoltRequest from tests.mock_web_api_server import ( + assert_received_request_count, setup_mock_web_api_server, cleanup_mock_web_api_server, assert_auth_test_count, @@ -57,8 +58,7 @@ def handle_app_mention(say): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests.get("/chat.postMessage") == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_disabled(self): app = App( @@ -78,8 +78,7 @@ def handle_app_mention(say): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests.get("/chat.postMessage") == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) event_body = { diff --git a/tests/scenario_tests/test_events_shared_channels.py b/tests/scenario_tests/test_events_shared_channels.py index 8e850d331..1a777230d 100644 --- a/tests/scenario_tests/test_events_shared_channels.py +++ b/tests/scenario_tests/test_events_shared_channels.py @@ -1,5 +1,5 @@ import json -from time import time, sleep +from time import sleep, time from slack_sdk.signature import SignatureVerifier from slack_sdk.web import WebClient @@ -7,9 +7,10 @@ from slack_bolt import App, BoltRequest, Say from slack_bolt.authorization import AuthorizeResult from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, assert_auth_test_count, + assert_received_request_count, + cleanup_mock_web_api_server, + setup_mock_web_api_server, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -108,8 +109,7 @@ def handle_app_mention(body, say: Say, payload, event): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_middleware_skip(self): app = App( @@ -180,8 +180,7 @@ def handle_app_mention(body, say, payload, event): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_stable_auto_ack(self): app = App( @@ -250,9 +249,9 @@ def handle_app_mention(say): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() + sleep(0.5) # wait a bit after auto ack() # The listener should not be executed - assert self.mock_received_requests.get("/chat.postMessage") is None + assert self.received_requests.get("/chat.postMessage") is None def test_self_member_join_left_events(self): app = App( @@ -332,9 +331,7 @@ def handle_member_left_channel(say): request: BoltRequest = BoltRequest(body=body, headers=self.build_headers(timestamp, body)) response = app.dispatch(request) assert response.status == 200 - - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 2 + assert_received_request_count(self, path="/chat.postMessage", min_count=2) def test_member_join_left_events(self): app = App( @@ -415,9 +412,7 @@ def handle_app_mention(say): response = app.dispatch(request) assert response.status == 200 - sleep(1) # wait a bit after auto ack() - # the listeners should not be executed - assert self.mock_received_requests["/chat.postMessage"] == 2 + assert_received_request_count(self, path="/chat.postMessage", min_count=2) def test_uninstallation_and_revokes(self): app = App( @@ -489,6 +484,5 @@ def handler2(say: Say): assert response.status == 200 # this should not be called when we have authorize - assert self.mock_received_requests.get("/auth.test") is None - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 2 + assert_auth_test_count(self, 0) + assert_received_request_count(self, path="/chat.postMessage", min_count=2) diff --git a/tests/scenario_tests/test_events_socket_mode.py b/tests/scenario_tests/test_events_socket_mode.py index 1b1ddda38..81c45b148 100644 --- a/tests/scenario_tests/test_events_socket_mode.py +++ b/tests/scenario_tests/test_events_socket_mode.py @@ -6,9 +6,10 @@ from slack_bolt import App, BoltRequest, Say from slack_bolt.error import BoltError from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, assert_auth_test_count, + assert_received_request_count, + cleanup_mock_web_api_server, + setup_mock_web_api_server, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -72,8 +73,7 @@ def handle_app_mention(body, say, payload, event): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_middleware_skip(self): app = App(client=self.web_client) @@ -126,8 +126,7 @@ def handle_app_mention(body, say, payload, event): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_stable_auto_ack(self): app = App(client=self.web_client) @@ -175,9 +174,9 @@ def handle_app_mention(say): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() + sleep(0.5) # wait a bit after auto ack() # The listener should not be executed - assert self.mock_received_requests.get("/chat.postMessage") is None + assert self.received_requests.get("/chat.postMessage") is None def test_self_member_join_left_events(self): app = App(client=self.web_client) @@ -235,9 +234,7 @@ def handle_member_left_channel(say): request: BoltRequest = BoltRequest(body=left_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 2 + assert_received_request_count(self, path="/chat.postMessage", min_count=2) def test_member_join_left_events(self): app = App(client=self.web_client) @@ -296,9 +293,7 @@ def handle_app_mention(say): response = app.dispatch(request) assert response.status == 200 - sleep(1) # wait a bit after auto ack() - # the listeners should not be executed - assert self.mock_received_requests["/chat.postMessage"] == 2 + assert_received_request_count(self, path="/chat.postMessage", min_count=2) def test_uninstallation_and_revokes(self): app = App(client=self.web_client) @@ -346,5 +341,4 @@ def handler2(say: Say): assert response.status == 200 assert_auth_test_count(self, 1) - sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 2 + assert_received_request_count(self, path="/chat.postMessage", min_count=2) diff --git a/tests/scenario_tests/test_events_token_revocations.py b/tests/scenario_tests/test_events_token_revocations.py index 3b3227ce7..30e2eff60 100644 --- a/tests/scenario_tests/test_events_token_revocations.py +++ b/tests/scenario_tests/test_events_token_revocations.py @@ -1,5 +1,5 @@ import json -from time import time, sleep +from time import sleep, time from typing import Optional import pytest as pytest @@ -10,11 +10,7 @@ from slack_bolt import App, BoltRequest from slack_bolt.error import BoltError -from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, - assert_auth_test_count, -) +from tests.mock_web_api_server import assert_auth_test_count, cleanup_mock_web_api_server, setup_mock_web_api_server from tests.utils import remove_os_env_temporarily, restore_os_env valid_token = "xoxb-valid" @@ -40,7 +36,7 @@ def find_installation( enterprise_id: Optional[str], team_id: Optional[str], user_id: Optional[str] = None, - is_enterprise_install: Optional[bool] = False + is_enterprise_install: Optional[bool] = False, ) -> Optional[Installation]: assert enterprise_id == "E111" assert team_id is None @@ -132,7 +128,7 @@ def test_tokens_revoked(self): # auth.test API call must be skipped assert_auth_test_count(self, 0) - sleep(1) # wait a bit after auto ack() + sleep(0.5) # wait a bit after auto ack() assert app.installation_store.delete_bot_called is True assert app.installation_store.delete_installation_called is True assert app.installation_store.delete_all_called is False @@ -165,7 +161,7 @@ def test_app_uninstalled(self): assert response.status == 200 # auth.test API call must be skipped assert_auth_test_count(self, 0) - sleep(1) # wait a bit after auto ack() + sleep(0.5) # wait a bit after auto ack() assert app.installation_store.delete_bot_called is True assert app.installation_store.delete_installation_called is True assert app.installation_store.delete_all_called is True diff --git a/tests/scenario_tests/test_events_url_verification.py b/tests/scenario_tests/test_events_url_verification.py index 33e3f2524..f09aab843 100644 --- a/tests/scenario_tests/test_events_url_verification.py +++ b/tests/scenario_tests/test_events_url_verification.py @@ -1,15 +1,11 @@ import json from time import time -from slack_sdk.web import WebClient from slack_sdk.signature import SignatureVerifier +from slack_sdk.web import WebClient from slack_bolt import App, BoltRequest -from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, - assert_auth_test_count, -) +from tests.mock_web_api_server import assert_auth_test_count, cleanup_mock_web_api_server, setup_mock_web_api_server from tests.utils import remove_os_env_temporarily, restore_os_env @@ -53,7 +49,7 @@ def test_default(self): response = app.dispatch(request) assert response.status == 200 assert response.body == """{"challenge": "3eZbrw1aBm2rZgRNFdxV2595E9CY3gmdALWMmHkvFXO7tYXAYM8P"}""" - assert_auth_test_count(self, 0) + assert_auth_test_count(self, 1) def test_disabled(self): app = App( @@ -67,7 +63,7 @@ def test_disabled(self): response = app.dispatch(request) assert response.status == 404 assert response.body == """{"error": "unhandled request"}""" - assert_auth_test_count(self, 0) + assert_auth_test_count(self, 1) event_body = { diff --git a/tests/scenario_tests/test_lazy.py b/tests/scenario_tests/test_lazy.py index 3b0956efc..d9e88b280 100644 --- a/tests/scenario_tests/test_lazy.py +++ b/tests/scenario_tests/test_lazy.py @@ -7,10 +7,7 @@ from slack_bolt import BoltRequest from slack_bolt.app import App -from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, -) +from tests.mock_web_api_server import assert_received_request_count, cleanup_mock_web_api_server, setup_mock_web_api_server from tests.utils import remove_os_env_temporarily, restore_os_env @@ -106,8 +103,7 @@ def async2(say): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 200 - time.sleep(1) # wait a bit - assert self.mock_received_requests["/chat.postMessage"] == 2 + assert_received_request_count(self, path="/chat.postMessage", min_count=2) def test_lazy_class(self): def just_ack(ack): @@ -134,8 +130,7 @@ def async2(say): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 200 - time.sleep(1) # wait a bit - assert self.mock_received_requests["/chat.postMessage"] == 2 + assert_received_request_count(self, path="/chat.postMessage", min_count=2) def test_issue_545_context_copy_failure(self): def just_ack(ack): @@ -204,5 +199,4 @@ def set_ssl_context(context, next_): request = self.build_valid_request() response = app.dispatch(request) assert response.status == 200 - time.sleep(1) # wait a bit - assert self.mock_received_requests["/chat.postMessage"] == 2 + assert_received_request_count(self, path="/chat.postMessage", min_count=2) diff --git a/tests/scenario_tests/test_message.py b/tests/scenario_tests/test_message.py index 8aa073809..892776620 100644 --- a/tests/scenario_tests/test_message.py +++ b/tests/scenario_tests/test_message.py @@ -9,9 +9,10 @@ from slack_bolt.app import App from slack_bolt.request import BoltRequest from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, assert_auth_test_count, + assert_received_request_count, + cleanup_mock_web_api_server, + setup_mock_web_api_server, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -71,8 +72,7 @@ def test_string_keyword(self): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - time.sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_all_message_matching_1(self): app = App( @@ -88,8 +88,7 @@ def handle_all_new_messages(say): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - time.sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_all_message_matching_2(self): app = App( @@ -105,8 +104,7 @@ def handle_all_new_messages(say): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - time.sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_string_keyword_capturing(self): app = App( @@ -119,8 +117,7 @@ def test_string_keyword_capturing(self): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - time.sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_string_keyword_capturing2(self): app = App( @@ -133,8 +130,7 @@ def test_string_keyword_capturing2(self): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - time.sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_string_keyword_capturing_multi_capture(self): app = App( @@ -147,8 +143,7 @@ def test_string_keyword_capturing_multi_capture(self): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - time.sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_string_keyword_unmatched(self): app = App( @@ -173,8 +168,7 @@ def test_regexp_keyword(self): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - time.sleep(1) # wait a bit after auto ack() - assert self.mock_received_requests["/chat.postMessage"] == 1 + assert_received_request_count(self, path="/chat.postMessage", min_count=1) def test_regexp_keyword_unmatched(self): app = App( diff --git a/tests/scenario_tests/test_message_bot.py b/tests/scenario_tests/test_message_bot.py index 94eae4440..bc756be7d 100644 --- a/tests/scenario_tests/test_message_bot.py +++ b/tests/scenario_tests/test_message_bot.py @@ -7,11 +7,7 @@ from slack_bolt.app import App from slack_bolt.request import BoltRequest -from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, - assert_auth_test_count, -) +from tests.mock_web_api_server import assert_auth_test_count, cleanup_mock_web_api_server, setup_mock_web_api_server from tests.utils import remove_os_env_temporarily, restore_os_env @@ -76,7 +72,7 @@ def handle_messages(event, logger): assert response.status == 200 assert_auth_test_count(self, 1) - time.sleep(1) # wait a bit after auto ack() + time.sleep(0.5) # wait a bit after auto ack() assert result["call_count"] == 3 diff --git a/tests/scenario_tests/test_message_file_share.py b/tests/scenario_tests/test_message_file_share.py index 8921b37c9..d014931e3 100644 --- a/tests/scenario_tests/test_message_file_share.py +++ b/tests/scenario_tests/test_message_file_share.py @@ -6,11 +6,7 @@ from slack_bolt.app import App from slack_bolt.request import BoltRequest -from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, - assert_auth_test_count, -) +from tests.mock_web_api_server import assert_auth_test_count, cleanup_mock_web_api_server, setup_mock_web_api_server from tests.utils import remove_os_env_temporarily, restore_os_env @@ -71,7 +67,7 @@ def handle_messages(event, logger): assert response.status == 200 assert_auth_test_count(self, 1) - time.sleep(1) # wait a bit after auto ack() + time.sleep(0.5) # wait a bit after auto ack() assert result["call_count"] == 2 diff --git a/tests/scenario_tests/test_message_thread_broadcast.py b/tests/scenario_tests/test_message_thread_broadcast.py index a69147782..8d2ed7aa2 100644 --- a/tests/scenario_tests/test_message_thread_broadcast.py +++ b/tests/scenario_tests/test_message_thread_broadcast.py @@ -6,11 +6,7 @@ from slack_bolt.app import App from slack_bolt.request import BoltRequest -from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, - assert_auth_test_count, -) +from tests.mock_web_api_server import assert_auth_test_count, cleanup_mock_web_api_server, setup_mock_web_api_server from tests.utils import remove_os_env_temporarily, restore_os_env @@ -71,7 +67,7 @@ def handle_messages(event, logger): assert response.status == 200 assert_auth_test_count(self, 1) - time.sleep(1) # wait a bit after auto ack() + time.sleep(0.5) # wait a bit after auto ack() assert result["call_count"] == 2 diff --git a/tests/scenario_tests/test_workflow_steps.py b/tests/scenario_tests/test_workflow_steps.py index 94efd952a..4c644f027 100644 --- a/tests/scenario_tests/test_workflow_steps.py +++ b/tests/scenario_tests/test_workflow_steps.py @@ -1,18 +1,18 @@ import json import logging -import time as time_module from time import time from urllib.parse import quote from slack_sdk.signature import SignatureVerifier -from slack_sdk.web import WebClient, SlackResponse +from slack_sdk.web import SlackResponse, WebClient -from slack_bolt import App, BoltRequest, Ack -from slack_bolt.workflows.step import Complete, Fail, Update, Configure +from slack_bolt import Ack, App, BoltRequest +from slack_bolt.workflows.step import Complete, Configure, Fail, Update from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, assert_auth_test_count, + assert_received_request_count, + cleanup_mock_web_api_server, + setup_mock_web_api_server, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -142,8 +142,7 @@ def test_execute(self): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - time_module.sleep(0.5) - assert self.mock_received_requests["/workflows.stepCompleted"] == 1 + assert_received_request_count(self, path="/workflows.stepCompleted", min_count=1, timeout=0.5) app = self.build_app("copy_review___") response = app.dispatch(request) @@ -162,8 +161,7 @@ def test_execute_process_before_response(self): response = app.dispatch(request) assert response.status == 200 assert_auth_test_count(self, 1) - time_module.sleep(0.5) - assert self.mock_received_requests["/workflows.stepCompleted"] == 1 + assert_received_request_count(self, path="/workflows.stepCompleted", min_count=1, timeout=0.5) app = self.build_process_before_response_app("copy_review___") response = app.dispatch(request) diff --git a/tests/scenario_tests/test_workflow_steps_decorator_simple.py b/tests/scenario_tests/test_workflow_steps_decorator_simple.py index 37f32738f..bd48b5c5a 100644 --- a/tests/scenario_tests/test_workflow_steps_decorator_simple.py +++ b/tests/scenario_tests/test_workflow_steps_decorator_simple.py @@ -1,16 +1,17 @@ import json -import time as time_module from time import time from urllib.parse import quote from slack_sdk.signature import SignatureVerifier -from slack_sdk.web import WebClient, SlackResponse +from slack_sdk.web import SlackResponse, WebClient -from slack_bolt import App, BoltRequest, Ack -from slack_bolt.workflows.step import Complete, Fail, Update, Configure, WorkflowStep +from slack_bolt import Ack, App, BoltRequest +from slack_bolt.workflows.step import Complete, Configure, Fail, Update, WorkflowStep from tests.mock_web_api_server import ( - setup_mock_web_api_server, + assert_auth_test_count, + assert_received_request_count, cleanup_mock_web_api_server, + setup_mock_web_api_server, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -48,7 +49,7 @@ def test_edit(self): request: BoltRequest = BoltRequest(body=body, headers=headers) response = self.app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) self.app = App(client=self.web_client, signing_secret=self.signing_secret) self.app.step(callback_id="copy_review___", edit=edit, save=save, execute=execute) @@ -65,7 +66,7 @@ def test_save(self): request: BoltRequest = BoltRequest(body=body, headers=headers) response = self.app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) self.app = App(client=self.web_client, signing_secret=self.signing_secret) self.app.step(callback_id="copy_review___", edit=edit, save=save, execute=execute) @@ -82,9 +83,8 @@ def test_execute(self): request: BoltRequest = BoltRequest(body=body, headers=headers) response = self.app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 - time_module.sleep(0.5) - assert self.mock_received_requests["/workflows.stepCompleted"] == 1 + assert_auth_test_count(self, 1) + assert_received_request_count(self, path="/workflows.stepCompleted", min_count=1, timeout=0.5) self.app = App(client=self.web_client, signing_secret=self.signing_secret) self.app.step(callback_id="copy_review___", edit=edit, save=save, execute=execute) diff --git a/tests/scenario_tests/test_workflow_steps_decorator_with_args.py b/tests/scenario_tests/test_workflow_steps_decorator_with_args.py index d07edd90e..4180dff59 100644 --- a/tests/scenario_tests/test_workflow_steps_decorator_with_args.py +++ b/tests/scenario_tests/test_workflow_steps_decorator_with_args.py @@ -1,17 +1,18 @@ import json import logging -import time as time_module from time import time from urllib.parse import quote from slack_sdk.signature import SignatureVerifier -from slack_sdk.web import WebClient, SlackResponse +from slack_sdk.web import SlackResponse, WebClient -from slack_bolt import App, BoltRequest, Ack -from slack_bolt.workflows.step import Complete, Fail, Update, Configure, WorkflowStep +from slack_bolt import Ack, App, BoltRequest +from slack_bolt.workflows.step import Complete, Configure, Fail, Update, WorkflowStep from tests.mock_web_api_server import ( - setup_mock_web_api_server, + assert_auth_test_count, + assert_received_request_count, cleanup_mock_web_api_server, + setup_mock_web_api_server, ) from tests.utils import remove_os_env_temporarily, restore_os_env @@ -49,7 +50,7 @@ def test_edit(self): request: BoltRequest = BoltRequest(body=body, headers=headers) response = self.app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) self.app = App(client=self.web_client, signing_secret=self.signing_secret) self.app.step(callback_id="copy_review___", edit=edit, save=save, execute=execute) @@ -66,7 +67,7 @@ def test_save(self): request: BoltRequest = BoltRequest(body=body, headers=headers) response = self.app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 + assert_auth_test_count(self, 1) self.app = App(client=self.web_client, signing_secret=self.signing_secret) self.app.step(callback_id="copy_review___", edit=edit, save=save, execute=execute) @@ -83,9 +84,8 @@ def test_execute(self): request: BoltRequest = BoltRequest(body=body, headers=headers) response = self.app.dispatch(request) assert response.status == 200 - assert self.mock_received_requests["/auth.test"] == 1 - time_module.sleep(0.5) - assert self.mock_received_requests["/workflows.stepCompleted"] == 1 + assert_auth_test_count(self, 1) + assert_received_request_count(self, path="/workflows.stepCompleted", min_count=1, timeout=0.5) self.app = App(client=self.web_client, signing_secret=self.signing_secret) self.app.step(callback_id="copy_review___", edit=edit, save=save, execute=execute) diff --git a/tests/slack_bolt/authorization/test_authorize.py b/tests/slack_bolt/authorization/test_authorize.py index d7c06b226..69d6fca6d 100644 --- a/tests/slack_bolt/authorization/test_authorize.py +++ b/tests/slack_bolt/authorization/test_authorize.py @@ -183,7 +183,7 @@ def test_installation_store(self): assert result.team_id == "T0G9PQBBK" assert result.team == "Subarachnoid Workspace" assert result.url == "https://subarachnoid.slack.com/" - assert_auth_test_count(self, 1) + assert_auth_test_count(self, 2) result = authorize(context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111") assert result.bot_id == "BZYBOTHED" @@ -194,7 +194,7 @@ def test_installation_store(self): assert result.team_id == "T0G9PQBBK" assert result.team == "Subarachnoid Workspace" assert result.url == "https://subarachnoid.slack.com/" - assert_auth_test_count(self, 2) + assert_auth_test_count(self, 4) def test_installation_store_cached(self): installation_store = MemoryInstallationStore() @@ -215,7 +215,7 @@ def test_installation_store_cached(self): assert result.team_id == "T0G9PQBBK" assert result.team == "Subarachnoid Workspace" assert result.url == "https://subarachnoid.slack.com/" - assert_auth_test_count(self, 1) + assert_auth_test_count(self, 2) result = authorize(context=context, enterprise_id="E111", team_id="T0G9PQBBK", user_id="W11111") assert result.bot_id == "BZYBOTHED" @@ -226,7 +226,7 @@ def test_installation_store_cached(self): assert result.team_id == "T0G9PQBBK" assert result.team == "Subarachnoid Workspace" assert result.url == "https://subarachnoid.slack.com/" - assert_auth_test_count(self, 1) # cached + assert_auth_test_count(self, 2) # cached def test_fetch_different_user_token(self): installation_store = ValidUserTokenInstallationStore() @@ -243,7 +243,7 @@ def test_fetch_different_user_token(self): assert result.team_id == "T0G9PQBBK" assert result.team == "Subarachnoid Workspace" assert result.url == "https://subarachnoid.slack.com/" - assert_auth_test_count(self, 1) + assert_auth_test_count(self, 2) def test_fetch_different_user_token_with_rotation(self): context = BoltContext() @@ -279,7 +279,7 @@ def test_fetch_different_user_token_with_rotation(self): assert result.team_id == "T0G9PQBBK" assert result.team == "Subarachnoid Workspace" assert result.url == "https://subarachnoid.slack.com/" - assert_auth_test_count(self, 1) + assert_auth_test_count(self, 2) def test_remove_latest_user_token_if_it_is_not_relevant(self): installation_store = ValidUserTokenInstallationStore() From b6de3b321a370023859b594be1105b6eba742c6a Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 26 Feb 2024 09:32:05 +0900 Subject: [PATCH 464/719] Fix #1030 error in exmaple code --- examples/sqlalchemy/async_oauth_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/sqlalchemy/async_oauth_app.py b/examples/sqlalchemy/async_oauth_app.py index a2c52f098..39f9417ce 100644 --- a/examples/sqlalchemy/async_oauth_app.py +++ b/examples/sqlalchemy/async_oauth_app.py @@ -68,7 +68,7 @@ async def async_find_bot( *, enterprise_id: Optional[str], team_id: Optional[str], - is_enterprise_install: Optional[bool], + is_enterprise_install: Optional[bool] = False, ) -> Optional[Bot]: c = self.bots.c query = ( From ce4a5e8be91759c85e1a7d62a6aefa49ff995452 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Tue, 5 Mar 2024 17:06:00 -0500 Subject: [PATCH 465/719] feat: use dependabot to maintain packages (#1037) --- .github/dependabot.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..6baed210a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 5 + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" From 68352c30354a5b2a0bfd8f3684ca35432109902a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 22:32:54 +0000 Subject: [PATCH 466/719] Bump actions/checkout from 3 to 4 (#1038) --- .github/workflows/codecov.yml | 2 +- .github/workflows/flake8.yml | 2 +- .github/workflows/pytype.yml | 2 +- .github/workflows/tests.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 6265aff35..1abe6a510 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -16,7 +16,7 @@ jobs: env: BOLT_PYTHON_CODECOV_RUNNING: "1" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index f0eb9c5e0..984973980 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -13,7 +13,7 @@ jobs: matrix: python-version: ["3.9"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: diff --git a/.github/workflows/pytype.yml b/.github/workflows/pytype.yml index 5aaa5029a..e8a75493b 100644 --- a/.github/workflows/pytype.yml +++ b/.github/workflows/pytype.yml @@ -13,7 +13,7 @@ jobs: matrix: python-version: ["3.9"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 35647154a..7607ad7c1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: matrix: python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: From 02428057287494bcb5f59a73a3d64f25e96bf379 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 22:46:31 +0000 Subject: [PATCH 467/719] Bump actions/setup-python from 4 to 5 (#1040) --- .github/workflows/codecov.yml | 2 +- .github/workflows/flake8.yml | 2 +- .github/workflows/pytype.yml | 2 +- .github/workflows/tests.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 1abe6a510..e7a1dd938 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index 984973980..bdc9036f0 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Run flake8 verification diff --git a/.github/workflows/pytype.yml b/.github/workflows/pytype.yml index e8a75493b..1ad3e8063 100644 --- a/.github/workflows/pytype.yml +++ b/.github/workflows/pytype.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Run pytype verification diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7607ad7c1..d3bc7b4a1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install synchronous dependencies From 7b186094df4fb5b3de15c0093616c0509e284cb1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 23:02:44 +0000 Subject: [PATCH 468/719] Update werkzeug requirement from <3,>=2 to >=2,<4 (#1041) --- requirements/adapter.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/adapter.txt b/requirements/adapter.txt index 81bbd5f12..8027e20c8 100644 --- a/requirements/adapter.txt +++ b/requirements/adapter.txt @@ -11,7 +11,7 @@ falcon>=2,<4; python_version<"3.11" falcon>=3.1.1,<4; python_version>="3.11" fastapi>=0.70.0,<1 Flask>=1,<3 -Werkzeug>=2,<3 +Werkzeug>=2,<4 pyramid>=1,<3 sanic>=20,<21; python_version=="3.6" sanic>=22,<23; python_version>"3.6" From c55e7820043688c7017218bc8e5b9f7796b06a90 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 23:32:15 +0000 Subject: [PATCH 469/719] Bump actions/stale from 4.0.0 to 9.0.0 (#1042) --- .github/workflows/triage-issues.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/triage-issues.yml b/.github/workflows/triage-issues.yml index cf6864ab3..741221516 100644 --- a/.github/workflows/triage-issues.yml +++ b/.github/workflows/triage-issues.yml @@ -17,7 +17,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v4.0.0 + - uses: actions/stale@v9.0.0 with: days-before-issue-stale: 30 days-before-issue-close: 10 From 488dee086c1c86918d5dd640a632c1a158300fea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 23:44:42 +0000 Subject: [PATCH 470/719] Update pytest requirement from <7,>=6.2.5 to >=6.2.5,<9 (#1043) --- requirements/testing_without_asyncio.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/testing_without_asyncio.txt b/requirements/testing_without_asyncio.txt index 5421347a0..ddc8ee0b3 100644 --- a/requirements/testing_without_asyncio.txt +++ b/requirements/testing_without_asyncio.txt @@ -1,5 +1,5 @@ # pip install -r requirements/testing_without_asyncio.txt -pytest>=6.2.5,<7 +pytest>=6.2.5,<9 pytest-cov>=3,<5 black==22.8.0 # Until we drop Python 3.6 support, we have to stay with this version click<=8.0.4 # black is affected by https://github.com/pallets/click/issues/2225 From f29450e79e9daf302321ce24c8f5f4ad8abc1c8a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 23:59:30 +0000 Subject: [PATCH 471/719] Update flask requirement from <3,>=1 to >=1,<4 (#1044) --- requirements/adapter.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/adapter.txt b/requirements/adapter.txt index 8027e20c8..996538b16 100644 --- a/requirements/adapter.txt +++ b/requirements/adapter.txt @@ -10,7 +10,7 @@ Django>=3,<5 falcon>=2,<4; python_version<"3.11" falcon>=3.1.1,<4; python_version>="3.11" fastapi>=0.70.0,<1 -Flask>=1,<3 +Flask>=1,<4 Werkzeug>=2,<4 pyramid>=1,<3 sanic>=20,<21; python_version=="3.6" From 996f29f0ee741444c5b2a151b2e1930005d91fc2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 00:12:57 +0000 Subject: [PATCH 472/719] Update gunicorn requirement from <21,>=20 to >=20,<22 (#1045) --- requirements/adapter.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/adapter.txt b/requirements/adapter.txt index 996538b16..0f65e38b3 100644 --- a/requirements/adapter.txt +++ b/requirements/adapter.txt @@ -18,5 +18,5 @@ sanic>=22,<23; python_version>"3.6" starlette>=0.14,<1 tornado>=6,<7 uvicorn<1 # The oldest version can vary among Python runtime versions -gunicorn>=20,<21 +gunicorn>=20,<22 websocket_client>=1.2.3,<2 # Socket Mode 3rd party implementation From b5e5439eaca05b10021d68964527b11e791d9ccd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 09:15:03 +0900 Subject: [PATCH 473/719] Update moto requirement from <5,>=3 to >=3,<6 (#1046) * Update moto requirement from <5,>=3 to >=3,<6 Updates the requirements on [moto](https://github.com/getmoto/moto) to permit the latest version. - [Release notes](https://github.com/getmoto/moto/releases) - [Changelog](https://github.com/getmoto/moto/blob/master/CHANGELOG.md) - [Commits](https://github.com/getmoto/moto/compare/3.0.0...5.0.2) --- updated-dependencies: - dependency-name: moto dependency-type: direct:production ... Signed-off-by: dependabot[bot] * Fix imports for moto This change allows the import to use the old and new version of the dependency --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: William Bergamin --- requirements/adapter_testing.txt | 2 +- tests/adapter_tests/aws/test_aws_lambda.py | 21 +++++++++++-------- .../aws/test_lambda_s3_oauth_flow.py | 9 +++++--- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/requirements/adapter_testing.txt b/requirements/adapter_testing.txt index 27d4d9fa2..f9c61d19b 100644 --- a/requirements/adapter_testing.txt +++ b/requirements/adapter_testing.txt @@ -1,5 +1,5 @@ # pip install -r requirements/adapter_testing.txt -moto>=3,<5 # For AWS tests +moto>=3,<6 # For AWS tests docker>=5,<6 # Used by moto boddle>=0.2,<0.3 # For Bottle app tests sanic-testing>=0.7; python_version>"3.6" diff --git a/tests/adapter_tests/aws/test_aws_lambda.py b/tests/adapter_tests/aws/test_aws_lambda.py index 3096dcaab..c2e888fb7 100644 --- a/tests/adapter_tests/aws/test_aws_lambda.py +++ b/tests/adapter_tests/aws/test_aws_lambda.py @@ -1,8 +1,6 @@ import json from time import time from urllib.parse import quote - -from moto import mock_lambda from slack_sdk.signature import SignatureVerifier from slack_sdk.web import WebClient from slack_sdk.oauth import OAuthStateStore @@ -20,6 +18,11 @@ ) from tests.utils import remove_os_env_temporarily, restore_os_env +try: + from moto import mock_aws +except ImportError: + from moto import mock_lambda as mock_aws + class LambdaContext: function_name: str @@ -72,7 +75,7 @@ def test_first_value(self): assert _first_value({"foo": []}, "foo") is None assert _first_value({}, "foo") is None - @mock_lambda + @mock_aws def test_clear_all_log_handlers(self): app = App( client=self.web_client, @@ -81,7 +84,7 @@ def test_clear_all_log_handlers(self): handler = SlackRequestHandler(app) handler.clear_all_log_handlers() - @mock_lambda + @mock_aws def test_events(self): app = App( client=self.web_client, @@ -136,7 +139,7 @@ def event_handler(): assert response["statusCode"] == 200 assert_auth_test_count(self, 1) - @mock_lambda + @mock_aws def test_shortcuts(self): app = App( client=self.web_client, @@ -186,7 +189,7 @@ def shortcut_handler(ack): assert response["statusCode"] == 200 assert_auth_test_count(self, 1) - @mock_lambda + @mock_aws def test_commands(self): app = App( client=self.web_client, @@ -236,7 +239,7 @@ def command_handler(ack): assert response["statusCode"] == 200 assert_auth_test_count(self, 1) - @mock_lambda + @mock_aws def test_lazy_listeners(self): app = App( client=self.web_client, @@ -282,7 +285,7 @@ def say_it(say): assert_auth_test_count(self, 1) assert_received_request_count(self, "/chat.postMessage", 1) - @mock_lambda + @mock_aws def test_oauth(self): app = App( client=self.web_client, @@ -318,7 +321,7 @@ def test_oauth(self): assert response["headers"]["content-type"] == "text/html; charset=utf-8" assert "https://slack.com/oauth/v2/authorize?state=" in response.get("body") - @mock_lambda + @mock_aws def test_oauth_redirect(self): class TestStateStore(OAuthStateStore): def consume(self, state: str) -> bool: diff --git a/tests/adapter_tests/aws/test_lambda_s3_oauth_flow.py b/tests/adapter_tests/aws/test_lambda_s3_oauth_flow.py index 0756bc06f..5f79b64ab 100644 --- a/tests/adapter_tests/aws/test_lambda_s3_oauth_flow.py +++ b/tests/adapter_tests/aws/test_lambda_s3_oauth_flow.py @@ -1,9 +1,12 @@ -from moto import mock_s3 - from slack_bolt.adapter.aws_lambda.lambda_s3_oauth_flow import LambdaS3OAuthFlow from slack_bolt.oauth.oauth_settings import OAuthSettings from tests.utils import remove_os_env_temporarily, restore_os_env +try: + from moto import mock_aws +except ImportError: + from moto import mock_s3 as mock_aws + class TestLambdaS3OAuthFlow: def setup_method(self): @@ -12,7 +15,7 @@ def setup_method(self): def teardown_method(self): restore_os_env(self.old_os_env) - @mock_s3 + @mock_aws def test_instantiation(self): oauth_flow = LambdaS3OAuthFlow( settings=OAuthSettings( From 9b30107547e4553db3eaef7613c68de00dd638a4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Mar 2024 19:39:56 +0000 Subject: [PATCH 474/719] Bump codecov/codecov-action from 3 to 4 (#1039) --- .github/workflows/codecov.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index e7a1dd938..0014169d2 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -1,4 +1,3 @@ -# TODO: This CI job hangs as of April 2023 name: Run codecov on: @@ -32,7 +31,9 @@ jobs: run: | pytest --cov=./slack_bolt/ --cov-report=xml - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: fail_ci_if_error: true verbose: true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 6d9583646a10d4e291b9094d3f89b8b90cd49573 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 08:22:13 +0900 Subject: [PATCH 475/719] Update django requirement from <5,>=3 to >=3,<6 (#1051) Updates the requirements on [django](https://github.com/django/django) to permit the latest version. - [Commits](https://github.com/django/django/compare/3.0...5.0.3) --- updated-dependencies: - dependency-name: django dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/adapter.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/adapter.txt b/requirements/adapter.txt index 0f65e38b3..c0efca4c6 100644 --- a/requirements/adapter.txt +++ b/requirements/adapter.txt @@ -6,7 +6,7 @@ bottle>=0.12,<1 chalice<=1.27.3; python_version=="3.6" chalice>=1.28,<2; python_version>"3.6" CherryPy>=18,<19 -Django>=3,<5 +Django>=3,<6 falcon>=2,<4; python_version<"3.11" falcon>=3.1.1,<4; python_version>="3.11" fastapi>=0.70.0,<1 From 87f7ac2b4a47c38d426682cba31fd245dc8c766d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 08:22:39 +0900 Subject: [PATCH 476/719] Update docker requirement from <6,>=5 to >=5,<8 (#1052) Updates the requirements on [docker](https://github.com/docker/docker-py) to permit the latest version. - [Release notes](https://github.com/docker/docker-py/releases) - [Commits](https://github.com/docker/docker-py/compare/5.0.0...7.0.0) --- updated-dependencies: - dependency-name: docker dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/adapter_testing.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/adapter_testing.txt b/requirements/adapter_testing.txt index f9c61d19b..3d829ee15 100644 --- a/requirements/adapter_testing.txt +++ b/requirements/adapter_testing.txt @@ -1,5 +1,5 @@ # pip install -r requirements/adapter_testing.txt moto>=3,<6 # For AWS tests -docker>=5,<6 # Used by moto +docker>=5,<8 # Used by moto boddle>=0.2,<0.3 # For Bottle app tests sanic-testing>=0.7; python_version>"3.6" From 2f94d43d9735f5e8f930fc8e9d5df83e5c4a6edc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 08:23:13 +0900 Subject: [PATCH 477/719] Update websockets requirement from <11 to <13 (#1054) Updates the requirements on [websockets](https://github.com/python-websockets/websockets) to permit the latest version. - [Release notes](https://github.com/python-websockets/websockets/releases) - [Commits](https://github.com/python-websockets/websockets/compare/1.0...12.0) --- updated-dependencies: - dependency-name: websockets dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/async.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/async.txt b/requirements/async.txt index f27c3baf6..dd105eb8b 100644 --- a/requirements/async.txt +++ b/requirements/async.txt @@ -1,3 +1,3 @@ # pip install -r requirements/async.txt aiohttp>=3,<4 -websockets<11 +websockets<13 From 12d2b5ea0ad91c3d863f7e746806636254af3444 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 08:39:20 +0900 Subject: [PATCH 478/719] Update sanic requirement from <23,>=22 to >=22,<24 (#1055) Updates the requirements on [sanic](https://github.com/sanic-org/sanic) to permit the latest version. - [Release notes](https://github.com/sanic-org/sanic/releases) - [Commits](https://github.com/sanic-org/sanic/compare/v22.3.0...v23.12.1) --- updated-dependencies: - dependency-name: sanic dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/adapter.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/adapter.txt b/requirements/adapter.txt index c0efca4c6..473735e36 100644 --- a/requirements/adapter.txt +++ b/requirements/adapter.txt @@ -14,7 +14,7 @@ Flask>=1,<4 Werkzeug>=2,<4 pyramid>=1,<3 sanic>=20,<21; python_version=="3.6" -sanic>=22,<23; python_version>"3.6" +sanic>=22,<24; python_version>"3.6" starlette>=0.14,<1 tornado>=6,<7 uvicorn<1 # The oldest version can vary among Python runtime versions From dfda23bbd3ac07b0aa8b586a9d7aae41db789744 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Tue, 12 Mar 2024 14:10:09 -0400 Subject: [PATCH 479/719] fix: dependabot schedule (#1056) * Update dependabot.yml * Update codecov.yml Tokenless has reached GitHub rate limit. Please upload using a token --- .github/dependabot.yml | 2 +- .github/workflows/codecov.yml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6baed210a..dc523d227 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,7 +6,7 @@ updates: - package-ecosystem: "pip" directory: "/" schedule: - interval: "weekly" + interval: "monthly" open-pull-requests-limit: 5 - package-ecosystem: "github-actions" directory: "/" diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 0014169d2..3520eb892 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -35,5 +35,4 @@ jobs: with: fail_ci_if_error: true verbose: true - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + token: ${{ secrets.CODECOV_TOKEN }} From 880c13323ac4956096e5396508a45ca0113d5aa6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 08:24:33 +0900 Subject: [PATCH 480/719] Update click requirement from <=8.0.4 to <=8.1.7 (#1057) * Update click requirement from <=8.0.4 to <=8.1.7 Updates the requirements on [click](https://github.com/pallets/click) to permit the latest version. - [Release notes](https://github.com/pallets/click/releases) - [Changelog](https://github.com/pallets/click/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/click/compare/0.1...8.1.7) --- updated-dependencies: - dependency-name: click dependency-type: direct:production ... Signed-off-by: dependabot[bot] * Update testing_without_asyncio.txt --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: William Bergamin --- requirements/testing_without_asyncio.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements/testing_without_asyncio.txt b/requirements/testing_without_asyncio.txt index ddc8ee0b3..8e410dbd9 100644 --- a/requirements/testing_without_asyncio.txt +++ b/requirements/testing_without_asyncio.txt @@ -2,4 +2,3 @@ pytest>=6.2.5,<9 pytest-cov>=3,<5 black==22.8.0 # Until we drop Python 3.6 support, we have to stay with this version -click<=8.0.4 # black is affected by https://github.com/pallets/click/issues/2225 From 8f8220d6b66da9014a6405f13916eac6a8afc8c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Apr 2024 07:41:32 +0900 Subject: [PATCH 481/719] Update pytest-cov requirement from <5,>=3 to >=3,<6 (#1067) Updates the requirements on [pytest-cov](https://github.com/pytest-dev/pytest-cov) to permit the latest version. - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v3.0.0...v5.0.0) --- updated-dependencies: - dependency-name: pytest-cov dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/testing_without_asyncio.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/testing_without_asyncio.txt b/requirements/testing_without_asyncio.txt index 8e410dbd9..ec941179b 100644 --- a/requirements/testing_without_asyncio.txt +++ b/requirements/testing_without_asyncio.txt @@ -1,4 +1,4 @@ # pip install -r requirements/testing_without_asyncio.txt pytest>=6.2.5,<9 -pytest-cov>=3,<5 +pytest-cov>=3,<6 black==22.8.0 # Until we drop Python 3.6 support, we have to stay with this version From 690eaa4543228215df07f8ba36529efdc8c01e3a Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 3 May 2024 10:13:46 +0900 Subject: [PATCH 482/719] Lock pytest version to 8.1 as workaround for tornado test issue --- requirements/testing_without_asyncio.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/testing_without_asyncio.txt b/requirements/testing_without_asyncio.txt index ec941179b..2b55125c7 100644 --- a/requirements/testing_without_asyncio.txt +++ b/requirements/testing_without_asyncio.txt @@ -1,4 +1,4 @@ # pip install -r requirements/testing_without_asyncio.txt -pytest>=6.2.5,<9 +pytest>=6.2.5,<8.2 # https://github.com/tornadoweb/tornado/issues/3375 pytest-cov>=3,<6 black==22.8.0 # Until we drop Python 3.6 support, we have to stay with this version From e5131c9b9ccd5be58926df254356c5ca3159c147 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 May 2024 10:25:39 +0900 Subject: [PATCH 483/719] Update gunicorn requirement from <22,>=20 to >=20,<23 (#1073) Updates the requirements on [gunicorn](https://github.com/benoitc/gunicorn) to permit the latest version. - [Release notes](https://github.com/benoitc/gunicorn/releases) - [Commits](https://github.com/benoitc/gunicorn/compare/20.0.0...22.0.0) --- updated-dependencies: - dependency-name: gunicorn dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kazuhiro Sera --- requirements/adapter.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/adapter.txt b/requirements/adapter.txt index 473735e36..d35a5f2cf 100644 --- a/requirements/adapter.txt +++ b/requirements/adapter.txt @@ -18,5 +18,5 @@ sanic>=22,<24; python_version>"3.6" starlette>=0.14,<1 tornado>=6,<7 uvicorn<1 # The oldest version can vary among Python runtime versions -gunicorn>=20,<22 +gunicorn>=20,<23 websocket_client>=1.2.3,<2 # Socket Mode 3rd party implementation From dbe2333046b582c087fd19d6812c8a523835f53c Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 9 May 2024 10:53:55 +0900 Subject: [PATCH 484/719] Fix #1074 Customize user-facing message sent when an installation is not managed by bolt-python app (#1077) --- scripts/install_all_and_run_tests.sh | 14 +++++++------- slack_bolt/app/app.py | 15 +++++++++++++-- slack_bolt/app/async_app.py | 19 +++++++++++++++++-- .../authorization/async_internals.py | 5 ++--- .../async_multi_teams_authorization.py | 15 ++++++++++----- .../async_single_team_authorization.py | 19 +++++++++++++------ .../middleware/authorization/internals.py | 6 +++--- .../multi_teams_authorization.py | 15 ++++++++++----- .../single_team_authorization.py | 14 +++++++++----- .../test_single_team_authorization.py | 15 +++++++++++++-- .../test_single_team_authorization.py | 16 ++++++++++++++-- 11 files changed, 111 insertions(+), 42 deletions(-) diff --git a/scripts/install_all_and_run_tests.sh b/scripts/install_all_and_run_tests.sh index c5da9647e..831acc80c 100755 --- a/scripts/install_all_and_run_tests.sh +++ b/scripts/install_all_and_run_tests.sh @@ -14,24 +14,24 @@ python_version=`python --version | awk '{print $2}'` if [ ${python_version:0:3} == "3.6" ] then - pip install -r requirements.txt + pip install -U -r requirements.txt else pip install -e . fi if [[ $test_target != "" ]] then - pip install -r requirements/testing.txt && \ - pip install -r requirements/adapter.txt && \ - pip install -r requirements/adapter_testing.txt && \ + pip install -U -r requirements/testing.txt && \ + pip install -U -r requirements/adapter.txt && \ + pip install -U -r requirements/adapter_testing.txt && \ # To avoid errors due to the old versions of click forced by Chalice pip install -U pip click && \ black slack_bolt/ tests/ && \ pytest $1 else - pip install -r requirements/testing.txt && \ - pip install -r requirements/adapter.txt && \ - pip install -r requirements/adapter_testing.txt && \ + pip install -U -r requirements/testing.txt && \ + pip install -U -r requirements/adapter.txt && \ + pip install -U -r requirements/adapter_testing.txt && \ # To avoid errors due to the old versions of click forced by Chalice pip install -U pip click && \ black slack_bolt/ tests/ && \ diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index d01163636..a2e4f3aca 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -103,6 +103,7 @@ def __init__( # for multi-workspace apps before_authorize: Optional[Union[Middleware, Callable[..., Any]]] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, + user_facing_authorize_error_message: Optional[str] = None, installation_store: Optional[InstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility installation_store_bot_only: Optional[bool] = None, @@ -159,6 +160,8 @@ def message_hello(message, say): before_authorize: A global middleware that can be executed right before authorize function authorize: The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data. + user_facing_authorize_error_message: The user-facing error message to display + when the app is installed but the installation is not managed by this app's installation store installation_store: The module offering save/find operations of installation data installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) request_verification_enabled: False if you would like to disable the built-in middleware (Default: True). @@ -178,7 +181,7 @@ def message_hello(message, say): `SslCheck` is a built-in middleware that handles ssl_check requests from Slack. oauth_settings: The settings related to Slack app installation flow (OAuth flow) oauth_flow: Instantiated `slack_bolt.oauth.OAuthFlow`. This is always prioritized over oauth_settings. - verification_token: Deprecated verification mechanism. This can used only for ssl_check requests. + verification_token: Deprecated verification mechanism. This can be used only for ssl_check requests. listener_executor: Custom executor to run background tasks. If absent, the default `ThreadPoolExecutor` will be used. """ @@ -348,6 +351,7 @@ def message_hello(message, say): ignoring_self_events_enabled=ignoring_self_events_enabled, ssl_check_enabled=ssl_check_enabled, url_verification_enabled=url_verification_enabled, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) def _init_middleware_list( @@ -357,6 +361,7 @@ def _init_middleware_list( ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, + user_facing_authorize_error_message: Optional[str] = None, ): if self._init_middleware_list_done: return @@ -385,13 +390,18 @@ def _init_middleware_list( SingleTeamAuthorization( auth_test_result=auth_test_result, base_logger=self._base_logger, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) ) except SlackApiError as err: raise BoltError(error_auth_test_failure(err.response)) elif self._authorize is not None: self._middleware_list.append( - MultiTeamsAuthorization(authorize=self._authorize, base_logger=self._base_logger) + MultiTeamsAuthorization( + authorize=self._authorize, + base_logger=self._base_logger, + user_facing_authorize_error_message=user_facing_authorize_error_message, + ) ) else: raise BoltError(error_token_required()) @@ -401,6 +411,7 @@ def _init_middleware_list( authorize=self._authorize, base_logger=self._base_logger, user_token_resolution=self._oauth_flow.settings.user_token_resolution, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) ) if ignoring_self_events_enabled is True: diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index c70fc2e54..6f3366a19 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -114,6 +114,7 @@ def __init__( # for multi-workspace apps before_authorize: Optional[Union[AsyncMiddleware, Callable[..., Awaitable[Any]]]] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, + user_facing_authorize_error_message: Optional[str] = None, installation_store: Optional[AsyncInstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility installation_store_bot_only: Optional[bool] = None, @@ -167,6 +168,8 @@ async def message_hello(message, say): # async function before_authorize: A global middleware that can be executed right before authorize function authorize: The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data. + user_facing_authorize_error_message: The user-facing error message to display + when the app is installed but the installation is not managed by this app's installation store installation_store: The module offering save/find operations of installation data installation_store_bot_only: Use `AsyncInstallationStore#async_find_bot()` if True (Default: False) request_verification_enabled: False if you would like to disable the built-in middleware (Default: True). @@ -354,6 +357,7 @@ async def message_hello(message, say): # async function ignoring_self_events_enabled=ignoring_self_events_enabled, ssl_check_enabled=ssl_check_enabled, url_verification_enabled=url_verification_enabled, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) self._server: Optional[AsyncSlackAppServer] = None @@ -364,6 +368,7 @@ def _init_async_middleware_list( ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, + user_facing_authorize_error_message: Optional[str] = None, ): if self._init_middleware_list_done: return @@ -383,10 +388,19 @@ def _init_async_middleware_list( # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._async_oauth_flow is None: if self._token: - self._async_middleware_list.append(AsyncSingleTeamAuthorization(base_logger=self._base_logger)) + self._async_middleware_list.append( + AsyncSingleTeamAuthorization( + base_logger=self._base_logger, + user_facing_authorize_error_message=user_facing_authorize_error_message, + ) + ) elif self._async_authorize is not None: self._async_middleware_list.append( - AsyncMultiTeamsAuthorization(authorize=self._async_authorize, base_logger=self._base_logger) + AsyncMultiTeamsAuthorization( + authorize=self._async_authorize, + base_logger=self._base_logger, + user_facing_authorize_error_message=user_facing_authorize_error_message, + ) ) else: raise BoltError(error_token_required()) @@ -396,6 +410,7 @@ def _init_async_middleware_list( authorize=self._async_authorize, base_logger=self._base_logger, user_token_resolution=self._async_oauth_flow.settings.user_token_resolution, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) ) diff --git a/slack_bolt/middleware/authorization/async_internals.py b/slack_bolt/middleware/authorization/async_internals.py index e465d50d2..b5d8264ca 100644 --- a/slack_bolt/middleware/authorization/async_internals.py +++ b/slack_bolt/middleware/authorization/async_internals.py @@ -1,4 +1,3 @@ -from slack_bolt.middleware.authorization.internals import _build_error_text from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse @@ -15,9 +14,9 @@ def _is_no_auth_required(req: AsyncBoltRequest) -> bool: return _is_url_verification(req) or _is_ssl_check(req) -def _build_error_response() -> BoltResponse: +def _build_user_facing_error_response(message: str) -> BoltResponse: # show an ephemeral message to the end-user return BoltResponse( status=200, - body=_build_error_text(), + body=message, ) diff --git a/slack_bolt/middleware/authorization/async_multi_teams_authorization.py b/slack_bolt/middleware/authorization/async_multi_teams_authorization.py index 3a89f0f2b..cbb38bc2f 100644 --- a/slack_bolt/middleware/authorization/async_multi_teams_authorization.py +++ b/slack_bolt/middleware/authorization/async_multi_teams_authorization.py @@ -6,8 +6,8 @@ from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse from .async_authorization import AsyncAuthorization -from .async_internals import _build_error_response, _is_no_auth_required -from .internals import _is_no_auth_test_call_required, _build_error_text +from .async_internals import _build_user_facing_error_response, _is_no_auth_required +from .internals import _is_no_auth_test_call_required, _build_user_facing_authorize_error_message from ...authorization import AuthorizeResult from ...authorization.async_authorize import AsyncAuthorize @@ -21,6 +21,7 @@ def __init__( authorize: AsyncAuthorize, base_logger: Optional[Logger] = None, user_token_resolution: str = "authed_user", + user_facing_authorize_error_message: Optional[str] = None, ): """Multi-workspace authorization. @@ -28,10 +29,14 @@ def __init__( authorize: The function to authorize incoming requests from Slack. base_logger: The base logger user_token_resolution: "authed_user" or "actor" + user_facing_authorize_error_message: The user-facing error message when installation is not found """ self.authorize = authorize self.logger = get_bolt_logger(AsyncMultiTeamsAuthorization, base_logger=base_logger) self.user_token_resolution = user_token_resolution + self.user_facing_authorize_error_message = ( + user_facing_authorize_error_message or _build_user_facing_authorize_error_message() + ) async def async_process( self, @@ -92,10 +97,10 @@ async def async_process( "the AuthorizeResult (returned value from authorize) for it was not found." ) if req.context.response_url is not None: - await req.context.respond(_build_error_text()) + await req.context.respond(self.user_facing_authorize_error_message) return BoltResponse(status=200, body="") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message) except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message) diff --git a/slack_bolt/middleware/authorization/async_single_team_authorization.py b/slack_bolt/middleware/authorization/async_single_team_authorization.py index 8d3555a0e..695e17144 100644 --- a/slack_bolt/middleware/authorization/async_single_team_authorization.py +++ b/slack_bolt/middleware/authorization/async_single_team_authorization.py @@ -7,16 +7,23 @@ from slack_bolt.response import BoltResponse from slack_sdk.web.async_slack_response import AsyncSlackResponse from slack_sdk.errors import SlackApiError -from .async_internals import _build_error_response, _is_no_auth_required -from .internals import _to_authorize_result, _is_no_auth_test_call_required, _build_error_text +from .async_internals import _build_user_facing_error_response, _is_no_auth_required +from .internals import _to_authorize_result, _is_no_auth_test_call_required, _build_user_facing_authorize_error_message from ...authorization import AuthorizeResult class AsyncSingleTeamAuthorization(AsyncAuthorization): - def __init__(self, base_logger: Optional[Logger] = None): + def __init__( + self, + base_logger: Optional[Logger] = None, + user_facing_authorize_error_message: Optional[str] = None, + ): """Single-workspace authorization.""" self.auth_test_result: Optional[AsyncSlackResponse] = None self.logger = get_bolt_logger(AsyncSingleTeamAuthorization, base_logger=base_logger) + self.user_facing_authorize_error_message = ( + user_facing_authorize_error_message or _build_user_facing_authorize_error_message() + ) async def async_process( self, @@ -58,9 +65,9 @@ async def async_process( # Just in case self.logger.error("auth.test API call result is unexpectedly None") if req.context.response_url is not None: - await req.context.respond(_build_error_text()) + await req.context.respond(self.user_facing_authorize_error_message) return BoltResponse(status=200, body="") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message) except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message) diff --git a/slack_bolt/middleware/authorization/internals.py b/slack_bolt/middleware/authorization/internals.py index af264854b..814101953 100644 --- a/slack_bolt/middleware/authorization/internals.py +++ b/slack_bolt/middleware/authorization/internals.py @@ -43,18 +43,18 @@ def _is_no_auth_test_call_required(req: Union[BoltRequest, "AsyncBoltRequest"]) return _is_no_auth_test_events(req) -def _build_error_text() -> str: +def _build_user_facing_authorize_error_message() -> str: return ( ":warning: We apologize, but for some unknown reason, your installation with this app is no longer available. " "Please reinstall this app into your workspace :bow:" ) -def _build_error_response() -> BoltResponse: +def _build_user_facing_error_response(message: str) -> BoltResponse: # show an ephemeral message to the end-user return BoltResponse( status=200, - body=_build_error_text(), + body=message, ) diff --git a/slack_bolt/middleware/authorization/multi_teams_authorization.py b/slack_bolt/middleware/authorization/multi_teams_authorization.py index 5d464d5e4..62972284b 100644 --- a/slack_bolt/middleware/authorization/multi_teams_authorization.py +++ b/slack_bolt/middleware/authorization/multi_teams_authorization.py @@ -8,10 +8,10 @@ from slack_bolt.response import BoltResponse from .authorization import Authorization from .internals import ( - _build_error_response, + _build_user_facing_error_response, _is_no_auth_required, _is_no_auth_test_call_required, - _build_error_text, + _build_user_facing_authorize_error_message, ) from ...authorization import AuthorizeResult from ...authorization.authorize import Authorize @@ -27,6 +27,7 @@ def __init__( authorize: Authorize, base_logger: Optional[Logger] = None, user_token_resolution: str = "authed_user", + user_facing_authorize_error_message: Optional[str] = None, ): """Multi-workspace authorization. @@ -34,10 +35,14 @@ def __init__( authorize: The function to authorize incoming requests from Slack. base_logger: The base logger user_token_resolution: "authed_user" or "actor" + user_facing_authorize_error_message: The user-facing error message when installation is not found """ self.authorize = authorize self.logger = get_bolt_logger(MultiTeamsAuthorization, base_logger=base_logger) self.user_token_resolution = user_token_resolution + self.user_facing_authorize_error_message = ( + user_facing_authorize_error_message or _build_user_facing_authorize_error_message() + ) def process( self, @@ -95,10 +100,10 @@ def process( "the AuthorizeResult (returned value from authorize) for it was not found." ) if req.context.response_url is not None: - req.context.respond(_build_error_text()) + req.context.respond(self.user_facing_authorize_error_message) return BoltResponse(status=200, body="") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message) except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message) diff --git a/slack_bolt/middleware/authorization/single_team_authorization.py b/slack_bolt/middleware/authorization/single_team_authorization.py index 54cdff5c8..6fe62ed6a 100644 --- a/slack_bolt/middleware/authorization/single_team_authorization.py +++ b/slack_bolt/middleware/authorization/single_team_authorization.py @@ -8,11 +8,11 @@ from slack_sdk.errors import SlackApiError from slack_sdk.web import SlackResponse from .internals import ( - _build_error_response, + _build_user_facing_error_response, _is_no_auth_required, _to_authorize_result, _is_no_auth_test_call_required, - _build_error_text, + _build_user_facing_authorize_error_message, ) from ...authorization import AuthorizeResult @@ -23,6 +23,7 @@ def __init__( *, auth_test_result: Optional[SlackResponse] = None, base_logger: Optional[Logger] = None, + user_facing_authorize_error_message: Optional[str] = None, ): """Single-workspace authorization. @@ -32,6 +33,9 @@ def __init__( """ self.auth_test_result = auth_test_result self.logger = get_bolt_logger(SingleTeamAuthorization, base_logger=base_logger) + self.user_facing_authorize_error_message = ( + user_facing_authorize_error_message or _build_user_facing_authorize_error_message() + ) def process( self, @@ -73,9 +77,9 @@ def process( # Just in case self.logger.error("auth.test API call result is unexpectedly None") if req.context.response_url is not None: - req.context.respond(_build_error_text()) + req.context.respond(self.user_facing_authorize_error_message) return BoltResponse(status=200, body="") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message) except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message) diff --git a/tests/slack_bolt/middleware/authorization/test_single_team_authorization.py b/tests/slack_bolt/middleware/authorization/test_single_team_authorization.py index 7b7c2d6a0..4cf5d9600 100644 --- a/tests/slack_bolt/middleware/authorization/test_single_team_authorization.py +++ b/tests/slack_bolt/middleware/authorization/test_single_team_authorization.py @@ -1,7 +1,7 @@ from slack_sdk import WebClient from slack_bolt.middleware import SingleTeamAuthorization -from slack_bolt.middleware.authorization.internals import _build_error_text +from slack_bolt.middleware.authorization.internals import _build_user_facing_authorize_error_message from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse from tests.mock_web_api_server import ( @@ -43,4 +43,15 @@ def test_failure_pattern(self): resp = authorization.process(req=req, resp=resp, next=next) assert resp.status == 200 - assert resp.body == _build_error_text() + assert resp.body == _build_user_facing_authorize_error_message() + + def test_failure_pattern_custom_message(self): + authorization = SingleTeamAuthorization(auth_test_result={}, user_facing_authorize_error_message="foo") + req = BoltRequest(body="payload={}", headers={}) + req.context["client"] = WebClient(base_url=self.mock_api_server_base_url, token="dummy") + resp = BoltResponse(status=404) + + resp = authorization.process(req=req, resp=resp, next=next) + + assert resp.status == 200 + assert resp.body == "foo" diff --git a/tests/slack_bolt_async/middleware/authorization/test_single_team_authorization.py b/tests/slack_bolt_async/middleware/authorization/test_single_team_authorization.py index 68112f2c0..ef1baded5 100644 --- a/tests/slack_bolt_async/middleware/authorization/test_single_team_authorization.py +++ b/tests/slack_bolt_async/middleware/authorization/test_single_team_authorization.py @@ -6,7 +6,7 @@ from slack_bolt.middleware.authorization.async_single_team_authorization import ( AsyncSingleTeamAuthorization, ) -from slack_bolt.middleware.authorization.internals import _build_error_text +from slack_bolt.middleware.authorization.internals import _build_user_facing_authorize_error_message from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse from tests.mock_web_api_server import ( @@ -57,4 +57,16 @@ async def test_failure_pattern(self): resp = await authorization.async_process(req=req, resp=resp, next=next) assert resp.status == 200 - assert resp.body == _build_error_text() + assert resp.body == _build_user_facing_authorize_error_message() + + @pytest.mark.asyncio + async def test_failure_pattern_custom_message(self): + authorization = AsyncSingleTeamAuthorization(user_facing_authorize_error_message="foo") + req = AsyncBoltRequest(body="payload={}", headers={}) + req.context["client"] = AsyncWebClient(base_url=self.mock_api_server_base_url, token="dummy") + resp = BoltResponse(status=404) + + resp = await authorization.async_process(req=req, resp=resp, next=next) + + assert resp.status == 200 + assert resp.body == "foo" From 549252c833502ed7916adf9e399405c757c16edf Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Tue, 28 May 2024 00:02:08 +0000 Subject: [PATCH 485/719] feat: add WSGI adapter (#1085) --- examples/wsgi/app.py | 19 ++ examples/wsgi/oauth_app.py | 23 +++ examples/wsgi/requirements.txt | 1 + slack_bolt/adapter/wsgi/__init__.py | 3 + slack_bolt/adapter/wsgi/handler.py | 85 ++++++++ slack_bolt/adapter/wsgi/http_request.py | 37 ++++ slack_bolt/adapter/wsgi/http_response.py | 33 +++ slack_bolt/adapter/wsgi/internals.py | 1 + tests/adapter_tests/wsgi/__init__.py | 0 tests/adapter_tests/wsgi/test_wsgi_http.py | 230 +++++++++++++++++++++ tests/mock_wsgi_server.py | 116 +++++++++++ 11 files changed, 548 insertions(+) create mode 100644 examples/wsgi/app.py create mode 100644 examples/wsgi/oauth_app.py create mode 100644 examples/wsgi/requirements.txt create mode 100644 slack_bolt/adapter/wsgi/__init__.py create mode 100644 slack_bolt/adapter/wsgi/handler.py create mode 100644 slack_bolt/adapter/wsgi/http_request.py create mode 100644 slack_bolt/adapter/wsgi/http_response.py create mode 100644 slack_bolt/adapter/wsgi/internals.py create mode 100644 tests/adapter_tests/wsgi/__init__.py create mode 100644 tests/adapter_tests/wsgi/test_wsgi_http.py create mode 100644 tests/mock_wsgi_server.py diff --git a/examples/wsgi/app.py b/examples/wsgi/app.py new file mode 100644 index 000000000..d994ffbf9 --- /dev/null +++ b/examples/wsgi/app.py @@ -0,0 +1,19 @@ +from slack_bolt import App +from slack_bolt.adapter.wsgi import SlackRequestHandler + +app = App() + + +@app.event("app_mention") +def handle_app_mentions(body, say, logger): + logger.info(body) + say("What's up?") + + +api = SlackRequestHandler(app) + +# pip install -r requirements.txt +# export SLACK_SIGNING_SECRET=*** +# export SLACK_BOT_TOKEN=xoxb-*** +# gunicorn app:api -b 0.0.0.0:3000 --log-level debug +# ngrok http 3000 diff --git a/examples/wsgi/oauth_app.py b/examples/wsgi/oauth_app.py new file mode 100644 index 000000000..bdb844fd4 --- /dev/null +++ b/examples/wsgi/oauth_app.py @@ -0,0 +1,23 @@ +from slack_bolt import App +from slack_bolt.adapter.wsgi import SlackRequestHandler + +app = App() + + +@app.event("app_mention") +def handle_app_mentions(body, say, logger): + logger.info(body) + say("What's up?") + + +api = SlackRequestHandler(app) + +# pip install -r requirements.txt + +# # -- OAuth flow -- # +# export SLACK_SIGNING_SECRET=*** +# export SLACK_CLIENT_ID=111.111 +# export SLACK_CLIENT_SECRET=*** +# export SLACK_SCOPES=app_mentions:read,channels:history,im:history,chat:write + +# gunicorn oauth_app:api -b 0.0.0.0:3000 --log-level debug diff --git a/examples/wsgi/requirements.txt b/examples/wsgi/requirements.txt new file mode 100644 index 000000000..5c3ac5752 --- /dev/null +++ b/examples/wsgi/requirements.txt @@ -0,0 +1 @@ +gunicorn<23 diff --git a/slack_bolt/adapter/wsgi/__init__.py b/slack_bolt/adapter/wsgi/__init__.py new file mode 100644 index 000000000..bf7cf78a4 --- /dev/null +++ b/slack_bolt/adapter/wsgi/__init__.py @@ -0,0 +1,3 @@ +from .handler import SlackRequestHandler + +__all__ = ["SlackRequestHandler"] diff --git a/slack_bolt/adapter/wsgi/handler.py b/slack_bolt/adapter/wsgi/handler.py new file mode 100644 index 000000000..55537e464 --- /dev/null +++ b/slack_bolt/adapter/wsgi/handler.py @@ -0,0 +1,85 @@ +from typing import Any, Callable, Dict, Iterable, List, Tuple + +from slack_bolt import App +from slack_bolt.adapter.wsgi.http_request import WsgiHttpRequest +from slack_bolt.adapter.wsgi.http_response import WsgiHttpResponse +from slack_bolt.oauth.oauth_flow import OAuthFlow +from slack_bolt.request import BoltRequest +from slack_bolt.response import BoltResponse + + +class SlackRequestHandler: + def __init__(self, app: App, path: str = "/slack/events"): + """Setup Bolt as a WSGI web framework, this will make your application compatible with WSGI web servers. + This can be used for production deployments. + + With the default settings, `http://localhost:3000/slack/events` + Run Bolt with [gunicorn](https://gunicorn.org/) + + # Python + app = App() + + api = SlackRequestHandler(app) + + # bash + export SLACK_SIGNING_SECRET=*** + + export SLACK_BOT_TOKEN=xoxb-*** + + gunicorn app:api -b 0.0.0.0:3000 --log-level debug + + Args: + app: Your bolt application + path: The path to handle request from Slack (Default: `/slack/events`) + """ + self.path = path + self.app = app + + def dispatch(self, request: WsgiHttpRequest) -> BoltResponse: + return self.app.dispatch( + BoltRequest(body=request.get_body(), query=request.query_string, headers=request.get_headers()) + ) + + def handle_installation(self, request: WsgiHttpRequest) -> BoltResponse: + oauth_flow: OAuthFlow = self.app.oauth_flow + return oauth_flow.handle_installation( + BoltRequest(body=request.get_body(), query=request.query_string, headers=request.get_headers()) + ) + + def handle_callback(self, request: WsgiHttpRequest) -> BoltResponse: + oauth_flow: OAuthFlow = self.app.oauth_flow + return oauth_flow.handle_callback( + BoltRequest(body=request.get_body(), query=request.query_string, headers=request.get_headers()) + ) + + def _get_http_response(self, request: WsgiHttpRequest) -> WsgiHttpResponse: + if request.method == "GET": + if self.app.oauth_flow is not None: + if request.path == self.app.oauth_flow.install_path: + bolt_response: BoltResponse = self.handle_installation(request) + return WsgiHttpResponse( + status=bolt_response.status, headers=bolt_response.headers, body=bolt_response.body + ) + if request.path == self.app.oauth_flow.redirect_uri_path: + bolt_response: BoltResponse = self.handle_callback(request) + return WsgiHttpResponse( + status=bolt_response.status, headers=bolt_response.headers, body=bolt_response.body + ) + if request.method == "POST" and request.path == self.path: + bolt_response: BoltResponse = self.dispatch(request) + return WsgiHttpResponse(status=bolt_response.status, headers=bolt_response.headers, body=bolt_response.body) + return WsgiHttpResponse(status=404, headers={"content-type": ["text/plain;charset=utf-8"]}, body="Not Found") + + def __call__( + self, + environ: Dict[str, Any], + start_response: Callable[[str, List[Tuple[str, str]]], None], + ) -> Iterable[bytes]: + request = WsgiHttpRequest(environ) + if "HTTP" in request.protocol: + response: WsgiHttpResponse = self._get_http_response( + request=request, + ) + start_response(response.status, response.get_headers()) + return response.get_body() + raise TypeError(f"Unsupported SERVER_PROTOCOL: {request.protocol}") diff --git a/slack_bolt/adapter/wsgi/http_request.py b/slack_bolt/adapter/wsgi/http_request.py new file mode 100644 index 000000000..e410f4cc0 --- /dev/null +++ b/slack_bolt/adapter/wsgi/http_request.py @@ -0,0 +1,37 @@ +from typing import Any, Dict + +from .internals import ENCODING + + +class WsgiHttpRequest: + """This Class uses the PEP 3333 standard to extract request information + from the WSGI web server running the application + + PEP 3333: https://peps.python.org/pep-3333/ + """ + + __slots__ = ("method", "path", "query_string", "protocol", "environ") + + def __init__(self, environ: Dict[str, Any]): + self.method: str = environ.get("REQUEST_METHOD", "GET") + self.path: str = environ.get("PATH_INFO", "") + self.query_string: str = environ.get("QUERY_STRING", "") + self.protocol: str = environ.get("SERVER_PROTOCOL", "") + self.environ = environ + + def get_headers(self) -> Dict[str, str]: + headers = {} + for key, value in self.environ.items(): + if key in {"CONTENT_LENGTH", "CONTENT_TYPE"}: + name = key.lower().replace("_", "-") + headers[name] = value + if key.startswith("HTTP_"): + name = key[len("HTTP_"):].lower().replace("_", "-") # fmt: skip + headers[name] = value + return headers + + def get_body(self) -> str: + if "wsgi.input" not in self.environ: + return "" + content_length = int(self.environ.get("CONTENT_LENGTH", 0)) + return self.environ["wsgi.input"].read(content_length).decode(ENCODING) diff --git a/slack_bolt/adapter/wsgi/http_response.py b/slack_bolt/adapter/wsgi/http_response.py new file mode 100644 index 000000000..1ad32e672 --- /dev/null +++ b/slack_bolt/adapter/wsgi/http_response.py @@ -0,0 +1,33 @@ +from http import HTTPStatus +from typing import Dict, Iterable, List, Sequence, Tuple + +from .internals import ENCODING + + +class WsgiHttpResponse: + """This Class uses the PEP 3333 standard to adapt bolt response information + for the WSGI web server running the application + + PEP 3333: https://peps.python.org/pep-3333/ + """ + + __slots__ = ("status", "_headers", "_body") + + def __init__(self, status: int, headers: Dict[str, Sequence[str]] = {}, body: str = ""): + _status = HTTPStatus(status) + self.status = f"{_status.value} {_status.phrase}" + self._headers = headers + self._body = bytes(body, ENCODING) + + def get_headers(self) -> List[Tuple[str, str]]: + headers: List[Tuple[str, str]] = [] + for key, value in self._headers.items(): + if key.lower() == "content-length": + continue + headers.append((key, value[0])) + + headers.append(("content-length", str(len(self._body)))) + return headers + + def get_body(self) -> Iterable[bytes]: + return [self._body] diff --git a/slack_bolt/adapter/wsgi/internals.py b/slack_bolt/adapter/wsgi/internals.py new file mode 100644 index 000000000..cda3e876a --- /dev/null +++ b/slack_bolt/adapter/wsgi/internals.py @@ -0,0 +1 @@ +ENCODING = "utf-8" # The content encoding for Slack requests/responses is always utf-8 diff --git a/tests/adapter_tests/wsgi/__init__.py b/tests/adapter_tests/wsgi/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/adapter_tests/wsgi/test_wsgi_http.py b/tests/adapter_tests/wsgi/test_wsgi_http.py new file mode 100644 index 000000000..63ac62627 --- /dev/null +++ b/tests/adapter_tests/wsgi/test_wsgi_http.py @@ -0,0 +1,230 @@ +import json +from time import time +from urllib.parse import quote + +from slack_sdk.signature import SignatureVerifier +from slack_sdk.web import WebClient + +from slack_bolt.adapter.wsgi import SlackRequestHandler +from slack_bolt.app import App +from slack_bolt.oauth.oauth_settings import OAuthSettings +from tests.mock_web_api_server import assert_auth_test_count, cleanup_mock_web_api_server, setup_mock_web_api_server +from tests.mock_wsgi_server import WsgiTestServer +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestWsgiHttp: + signing_secret = "secret" + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + signature_verifier = SignatureVerifier(signing_secret) + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def generate_signature(self, body: str, timestamp: str): + return self.signature_verifier.generate_signature( + body=body, + timestamp=timestamp, + ) + + def build_raw_headers(self, timestamp: str, body: str = ""): + content_type = "application/json" if body.startswith("{") else "application/x-www-form-urlencoded" + return { + "host": "123.123.123", + "user-agent": "some slack thing", + "content-length": str(len(body)), + "accept": "application/json,*/*", + "accept-encoding": "gzip,deflate", + "content-type": content_type, + "x-forwarded-for": "123.123.123", + "x-forwarded-proto": "https", + "x-slack-request-timestamp": timestamp, + "x-slack-signature": self.generate_signature(body, timestamp), + } + + def test_commands(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + def command_handler(ack): + ack() + + app.command("/hello-world")(command_handler) + + body = ( + "token=verification_token" + "&team_id=T111" + "&team_domain=test-domain" + "&channel_id=C111" + "&channel_name=random" + "&user_id=W111" + "&user_name=primary-owner" + "&command=%2Fhello-world" + "&text=Hi" + "&enterprise_id=E111" + "&enterprise_name=Org+Name" + "&response_url=https%3A%2F%2Fhooks.slack.com%2Fcommands%2FT111%2F111%2Fxxxxx" + "&trigger_id=111.111.xxx" + ) + + headers = self.build_raw_headers(str(int(time())), body) + + wsgi_server = WsgiTestServer(SlackRequestHandler(app)) + + response = wsgi_server.http(method="POST", headers=headers, body=body) + + assert response.status == "200 OK" + assert response.headers.get("content-type") == "text/plain;charset=utf-8" + assert_auth_test_count(self, 1) + + def test_events(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + def event_handler(): + pass + + app.event("app_mention")(event_handler) + + body = json.dumps( + { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "team": "T111", + "channel": "C111", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, + "authed_users": ["W111"], + } + ) + headers = self.build_raw_headers(str(int(time())), body) + + wsgi_server = WsgiTestServer(SlackRequestHandler(app)) + response = wsgi_server.http(method="POST", headers=headers, body=body) + + assert response.status == "200 OK" + assert response.headers.get("content-type") == "text/plain;charset=utf-8" + assert_auth_test_count(self, 1) + + def test_shortcuts(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + def shortcut_handler(ack): + ack() + + app.shortcut("test-shortcut")(shortcut_handler) + + body_data = { + "type": "shortcut", + "token": "verification_token", + "action_ts": "111.111", + "team": { + "id": "T111", + "domain": "workspace-domain", + "enterprise_id": "E111", + "enterprise_name": "Org Name", + }, + "user": {"id": "W111", "username": "primary-owner", "team_id": "T111"}, + "callback_id": "test-shortcut", + "trigger_id": "111.111.xxxxxx", + } + + body = f"payload={quote(json.dumps(body_data))}" + headers = self.build_raw_headers(str(int(time())), body) + + wsgi_server = WsgiTestServer(SlackRequestHandler(app)) + response = wsgi_server.http(method="POST", headers=headers, body=body) + + assert response.status == "200 OK" + assert response.headers.get("content-type") == "text/plain;charset=utf-8" + assert_auth_test_count(self, 1) + + def test_oauth(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + oauth_settings=OAuthSettings( + client_id="111.111", + client_secret="xxx", + scopes=["chat:write", "commands"], + ), + ) + + headers = self.build_raw_headers(str(int(time()))) + + wsgi_server = WsgiTestServer(SlackRequestHandler(app)) + response = wsgi_server.http(method="GET", headers=headers, path="/slack/install") + + assert response.status == "200 OK" + assert response.headers.get("content-type") == "text/html; charset=utf-8" + assert "https://slack.com/oauth/v2/authorize?state=" in response.body + + def test_url_verification(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + body_data = { + "token": "Jhj5dZrVaK7ZwHHjRyZWjbDl", + "challenge": "3eZbrw1aBm2rZgRNFdxV2595E9CY3gmdALWMmHkvFXO7tYXAYM8P", + "type": "url_verification", + } + + body = f"payload={quote(json.dumps(body_data))}" + headers = self.build_raw_headers(str(int(time())), body) + + wsgi_server = WsgiTestServer(SlackRequestHandler(app)) + response = wsgi_server.http( + method="POST", + headers=headers, + body=body, + ) + + assert response.status == "200 OK" + assert response.headers.get("content-type") == "application/json;charset=utf-8" + assert_auth_test_count(self, 1) + + def test_unsupported_method(self): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + + body = "" + headers = self.build_raw_headers(str(int(time())), "") + + wsgi_server = WsgiTestServer(SlackRequestHandler(app)) + response = wsgi_server.http(method="PUT", headers=headers, body=body) + + assert response.status == "404 Not Found" + assert response.headers.get("content-type") == "text/plain;charset=utf-8" + assert_auth_test_count(self, 1) diff --git a/tests/mock_wsgi_server.py b/tests/mock_wsgi_server.py new file mode 100644 index 000000000..a389a898e --- /dev/null +++ b/tests/mock_wsgi_server.py @@ -0,0 +1,116 @@ +from typing import Dict, Iterable, Optional, Tuple + +from slack_bolt.adapter.wsgi import SlackRequestHandler + +ENCODING = "utf-8" + + +class WsgiTestServerResponse: + def __init__(self): + self.status: Optional[str] = None + self._headers: Iterable[Tuple[str, str]] = [] + self._body: Iterable[bytes] = [] + + @property + def headers(self) -> Dict[str, str]: + return {header[0]: header[1] for header in self._headers} + + @property + def body(self, length: int = 0) -> str: + return "".join([chunk.decode(ENCODING) for chunk in self._body[length:]]) + + +class MockReadable: + def __init__(self, body: str): + self.body = body + self._body = bytes(body, ENCODING) + + def get_content_length(self) -> int: + return len(self._body) + + def read(self, size: int) -> bytes: + if size < 0: + raise ValueError("Size must be positive.") + if size == 0: + return b"" + # The body can only be read once + _body = self._body[:size] + self._body = b"" + return _body + + +class WsgiTestServer: + def __init__( + self, + wsgi_app: SlackRequestHandler, + root_path: str = "", + version: Tuple[int, int] = (1, 0), + multithread: bool = False, + multiprocess: bool = False, + run_once: bool = False, + input_terminated: bool = True, + server_software: bool = "mock/0.0.0", + url_scheme: str = "https", + remote_addr: str = "127.0.0.1", + remote_port: str = "63263", + ): + self.root_path = root_path + self.wsgi_app = wsgi_app + self.environ = { + "wsgi.version": version, + "wsgi.multithread": multithread, + "wsgi.multiprocess": multiprocess, + "wsgi.run_once": run_once, + "wsgi.input_terminated": input_terminated, + "SERVER_SOFTWARE": server_software, + "wsgi.url_scheme": url_scheme, + "REMOTE_ADDR": remote_addr, + "REMOTE_PORT": remote_port, + } + + def http( + self, + method: str, + headers: Dict[str, str], + body: Optional[str] = None, + path: str = "/slack/events", + query_string: str = "", + server_protocol: str = "HTTP/1.1", + server_name: str = "0.0.0.0", + server_port: str = "3000", + script_name: str = "", + ) -> WsgiTestServerResponse: + environ = dict( + self.environ, + **{ + "REQUEST_METHOD": method, + "PATH_INFO": f"{self.root_path}{path}", + "QUERY_STRING": query_string, + "RAW_URI": f"{self.root_path}{path}?{query_string}", + "SERVER_PROTOCOL": server_protocol, + "SERVER_NAME": server_name, + "SERVER_PORT": server_port, + "SCRIPT_NAME": script_name, + }, + ) + for key, value in headers.items(): + header_key = key.upper().replace("-", "_") + if header_key in {"CONTENT_LENGTH", "CONTENT_TYPE"}: + environ[header_key] = value + else: + environ[f"HTTP_{header_key}"] = value + + if body is not None: + environ["wsgi.input"] = MockReadable(body) + if "CONTENT_LENGTH" not in environ: + environ["CONTENT_LENGTH"] = str(environ["wsgi.input"].get_content_length()) + + response = WsgiTestServerResponse() + + def start_response(status, headers): + response.status = status + response._headers = headers + + response._body = self.wsgi_app(environ=environ, start_response=start_response) + + return response From 28827082d4431acd29558d2a9127f045c5179913 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Fri, 7 Jun 2024 13:32:50 +0000 Subject: [PATCH 486/719] feat: Add deprecation warnings to Steps from Apps components and Docs (#1089) * Add warnings and comments * deprecate in docs * add deprecation warnings to examples * Improve formating * Update docs/_config.yml * Update docs/_steps/workflow_steps_overview.md Co-authored-by: Fil Maj --------- Co-authored-by: Kazuhiro Sera Co-authored-by: Fil Maj --- docs/_config.yml | 4 +- docs/_includes/sidebar.html | 4 +- docs/_layouts/default.html | 4 +- docs/_steps/workflow_steps_overview.md | 5 +- docs/assets/style.css | 4 +- .../workflow_steps/async_steps_from_apps.py | 5 ++ .../async_steps_from_apps_decorator.py | 5 ++ .../async_steps_from_apps_primitive.py | 5 ++ examples/workflow_steps/steps_from_apps.py | 5 ++ .../steps_from_apps_decorator.py | 5 ++ .../steps_from_apps_primitive.py | 5 ++ slack_bolt/app/app.py | 16 ++++++- slack_bolt/app/async_app.py | 13 +++++ slack_bolt/workflows/step/async_step.py | 47 +++++++++++++++++-- slack_bolt/workflows/step/step.py | 47 +++++++++++++++++-- 15 files changed, 154 insertions(+), 20 deletions(-) diff --git a/docs/_config.yml b/docs/_config.yml index a8d7fa15c..b426f35e0 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -35,7 +35,7 @@ t: start: Getting started contribute: Contributing beta: BETA - legacy: LEGACY + deprecated: Deprecated ja-jp: basic: 基本的な概念 steps: ワークフローステップ @@ -43,7 +43,7 @@ t: start: Bolt 入門ガイド contribute: 貢献 beta: BETA - legacy: LEGACY + deprecated: 非推奨 # Metadata repo_name: bolt-python diff --git a/docs/_includes/sidebar.html b/docs/_includes/sidebar.html index 970cf3869..860188e97 100644 --- a/docs/_includes/sidebar.html +++ b/docs/_includes/sidebar.html @@ -56,8 +56,8 @@
    @@ -131,6 +135,7 @@

    Index

  • slack_bolt.adapter.socket_mode
  • slack_bolt.adapter.starlette
  • slack_bolt.adapter.tornado
  • +
  • slack_bolt.adapter.wsgi
  • diff --git a/docs/api-docs/slack_bolt/adapter/sanic/async_handler.html b/docs/api-docs/slack_bolt/adapter/sanic/async_handler.html index 7619d773a..0ba5912ad 100644 --- a/docs/api-docs/slack_bolt/adapter/sanic/async_handler.html +++ b/docs/api-docs/slack_bolt/adapter/sanic/async_handler.html @@ -99,7 +99,7 @@

    Module slack_bolt.adapter.sanic.async_handler

    Functions

    -def to_async_bolt_request(req: sanic.request.Request) ‑> AsyncBoltRequest +def to_async_bolt_request(req: sanic.request.types.Request) ‑> AsyncBoltRequest
    @@ -116,7 +116,7 @@

    Functions

    -def to_sanic_response(bolt_resp: BoltResponse) ‑> sanic.response.HTTPResponse +def to_sanic_response(bolt_resp: BoltResponse) ‑> sanic.response.types.HTTPResponse
    @@ -188,7 +188,7 @@

    Classes

    Methods

    -async def handle(self, req: sanic.request.Request) ‑> sanic.response.HTTPResponse +async def handle(self, req: sanic.request.types.Request) ‑> sanic.response.types.HTTPResponse
    diff --git a/docs/api-docs/slack_bolt/adapter/sanic/index.html b/docs/api-docs/slack_bolt/adapter/sanic/index.html index 767ed7050..ca2e56bd2 100644 --- a/docs/api-docs/slack_bolt/adapter/sanic/index.html +++ b/docs/api-docs/slack_bolt/adapter/sanic/index.html @@ -86,7 +86,7 @@

    Classes

    Methods

    -async def handle(self, req: sanic.request.Request) ‑> sanic.response.HTTPResponse +async def handle(self, req: sanic.request.types.Request) ‑> sanic.response.types.HTTPResponse
    diff --git a/docs/api-docs/slack_bolt/adapter/wsgi/handler.html b/docs/api-docs/slack_bolt/adapter/wsgi/handler.html new file mode 100644 index 000000000..4a9422e37 --- /dev/null +++ b/docs/api-docs/slack_bolt/adapter/wsgi/handler.html @@ -0,0 +1,317 @@ + + + + + + +slack_bolt.adapter.wsgi.handler API documentation + + + + + + + + + + + +
    +
    +
    +

    Module slack_bolt.adapter.wsgi.handler

    +
    +
    +
    + +Expand source code + +
    from typing import Any, Callable, Dict, Iterable, List, Tuple
    +
    +from slack_bolt import App
    +from slack_bolt.adapter.wsgi.http_request import WsgiHttpRequest
    +from slack_bolt.adapter.wsgi.http_response import WsgiHttpResponse
    +from slack_bolt.oauth.oauth_flow import OAuthFlow
    +from slack_bolt.request import BoltRequest
    +from slack_bolt.response import BoltResponse
    +
    +
    +class SlackRequestHandler:
    +    def __init__(self, app: App, path: str = "/slack/events"):
    +        """Setup Bolt as a WSGI web framework, this will make your application compatible with WSGI web servers.
    +        This can be used for production deployments.
    +
    +        With the default settings, `http://localhost:3000/slack/events`
    +        Run Bolt with [gunicorn](https://gunicorn.org/)
    +
    +        # Python
    +            app = App()
    +
    +            api = SlackRequestHandler(app)
    +
    +        # bash
    +            export SLACK_SIGNING_SECRET=***
    +
    +            export SLACK_BOT_TOKEN=xoxb-***
    +
    +            gunicorn app:api -b 0.0.0.0:3000 --log-level debug
    +
    +        Args:
    +            app: Your bolt application
    +            path: The path to handle request from Slack (Default: `/slack/events`)
    +        """
    +        self.path = path
    +        self.app = app
    +
    +    def dispatch(self, request: WsgiHttpRequest) -> BoltResponse:
    +        return self.app.dispatch(
    +            BoltRequest(body=request.get_body(), query=request.query_string, headers=request.get_headers())
    +        )
    +
    +    def handle_installation(self, request: WsgiHttpRequest) -> BoltResponse:
    +        oauth_flow: OAuthFlow = self.app.oauth_flow
    +        return oauth_flow.handle_installation(
    +            BoltRequest(body=request.get_body(), query=request.query_string, headers=request.get_headers())
    +        )
    +
    +    def handle_callback(self, request: WsgiHttpRequest) -> BoltResponse:
    +        oauth_flow: OAuthFlow = self.app.oauth_flow
    +        return oauth_flow.handle_callback(
    +            BoltRequest(body=request.get_body(), query=request.query_string, headers=request.get_headers())
    +        )
    +
    +    def _get_http_response(self, request: WsgiHttpRequest) -> WsgiHttpResponse:
    +        if request.method == "GET":
    +            if self.app.oauth_flow is not None:
    +                if request.path == self.app.oauth_flow.install_path:
    +                    bolt_response: BoltResponse = self.handle_installation(request)
    +                    return WsgiHttpResponse(
    +                        status=bolt_response.status, headers=bolt_response.headers, body=bolt_response.body
    +                    )
    +                if request.path == self.app.oauth_flow.redirect_uri_path:
    +                    bolt_response: BoltResponse = self.handle_callback(request)
    +                    return WsgiHttpResponse(
    +                        status=bolt_response.status, headers=bolt_response.headers, body=bolt_response.body
    +                    )
    +        if request.method == "POST" and request.path == self.path:
    +            bolt_response: BoltResponse = self.dispatch(request)
    +            return WsgiHttpResponse(status=bolt_response.status, headers=bolt_response.headers, body=bolt_response.body)
    +        return WsgiHttpResponse(status=404, headers={"content-type": ["text/plain;charset=utf-8"]}, body="Not Found")
    +
    +    def __call__(
    +        self,
    +        environ: Dict[str, Any],
    +        start_response: Callable[[str, List[Tuple[str, str]]], None],
    +    ) -> Iterable[bytes]:
    +        request = WsgiHttpRequest(environ)
    +        if "HTTP" in request.protocol:
    +            response: WsgiHttpResponse = self._get_http_response(
    +                request=request,
    +            )
    +            start_response(response.status, response.get_headers())
    +            return response.get_body()
    +        raise TypeError(f"Unsupported SERVER_PROTOCOL: {request.protocol}")
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Classes

    +
    +
    +class SlackRequestHandler +(app: App, path: str = '/slack/events') +
    +
    +

    Setup Bolt as a WSGI web framework, this will make your application compatible with WSGI web servers. +This can be used for production deployments.

    +

    With the default settings, http://localhost:3000/slack/events +Run Bolt with gunicorn

    +

    Python

    +
    app = App()
    +
    +api = SlackRequestHandler(app)
    +
    +

    bash

    +
    export SLACK_SIGNING_SECRET=***
    +
    +export SLACK_BOT_TOKEN=xoxb-***
    +
    +gunicorn app:api -b 0.0.0.0:3000 --log-level debug
    +
    +

    Args

    +
    +
    app
    +
    Your bolt application
    +
    path
    +
    The path to handle request from Slack (Default: /slack/events)
    +
    +
    + +Expand source code + +
    class SlackRequestHandler:
    +    def __init__(self, app: App, path: str = "/slack/events"):
    +        """Setup Bolt as a WSGI web framework, this will make your application compatible with WSGI web servers.
    +        This can be used for production deployments.
    +
    +        With the default settings, `http://localhost:3000/slack/events`
    +        Run Bolt with [gunicorn](https://gunicorn.org/)
    +
    +        # Python
    +            app = App()
    +
    +            api = SlackRequestHandler(app)
    +
    +        # bash
    +            export SLACK_SIGNING_SECRET=***
    +
    +            export SLACK_BOT_TOKEN=xoxb-***
    +
    +            gunicorn app:api -b 0.0.0.0:3000 --log-level debug
    +
    +        Args:
    +            app: Your bolt application
    +            path: The path to handle request from Slack (Default: `/slack/events`)
    +        """
    +        self.path = path
    +        self.app = app
    +
    +    def dispatch(self, request: WsgiHttpRequest) -> BoltResponse:
    +        return self.app.dispatch(
    +            BoltRequest(body=request.get_body(), query=request.query_string, headers=request.get_headers())
    +        )
    +
    +    def handle_installation(self, request: WsgiHttpRequest) -> BoltResponse:
    +        oauth_flow: OAuthFlow = self.app.oauth_flow
    +        return oauth_flow.handle_installation(
    +            BoltRequest(body=request.get_body(), query=request.query_string, headers=request.get_headers())
    +        )
    +
    +    def handle_callback(self, request: WsgiHttpRequest) -> BoltResponse:
    +        oauth_flow: OAuthFlow = self.app.oauth_flow
    +        return oauth_flow.handle_callback(
    +            BoltRequest(body=request.get_body(), query=request.query_string, headers=request.get_headers())
    +        )
    +
    +    def _get_http_response(self, request: WsgiHttpRequest) -> WsgiHttpResponse:
    +        if request.method == "GET":
    +            if self.app.oauth_flow is not None:
    +                if request.path == self.app.oauth_flow.install_path:
    +                    bolt_response: BoltResponse = self.handle_installation(request)
    +                    return WsgiHttpResponse(
    +                        status=bolt_response.status, headers=bolt_response.headers, body=bolt_response.body
    +                    )
    +                if request.path == self.app.oauth_flow.redirect_uri_path:
    +                    bolt_response: BoltResponse = self.handle_callback(request)
    +                    return WsgiHttpResponse(
    +                        status=bolt_response.status, headers=bolt_response.headers, body=bolt_response.body
    +                    )
    +        if request.method == "POST" and request.path == self.path:
    +            bolt_response: BoltResponse = self.dispatch(request)
    +            return WsgiHttpResponse(status=bolt_response.status, headers=bolt_response.headers, body=bolt_response.body)
    +        return WsgiHttpResponse(status=404, headers={"content-type": ["text/plain;charset=utf-8"]}, body="Not Found")
    +
    +    def __call__(
    +        self,
    +        environ: Dict[str, Any],
    +        start_response: Callable[[str, List[Tuple[str, str]]], None],
    +    ) -> Iterable[bytes]:
    +        request = WsgiHttpRequest(environ)
    +        if "HTTP" in request.protocol:
    +            response: WsgiHttpResponse = self._get_http_response(
    +                request=request,
    +            )
    +            start_response(response.status, response.get_headers())
    +            return response.get_body()
    +        raise TypeError(f"Unsupported SERVER_PROTOCOL: {request.protocol}")
    +
    +

    Methods

    +
    +
    +def dispatch(self, request: WsgiHttpRequest) ‑> BoltResponse +
    +
    +
    +
    + +Expand source code + +
    def dispatch(self, request: WsgiHttpRequest) -> BoltResponse:
    +    return self.app.dispatch(
    +        BoltRequest(body=request.get_body(), query=request.query_string, headers=request.get_headers())
    +    )
    +
    +
    +
    +def handle_callback(self, request: WsgiHttpRequest) ‑> BoltResponse +
    +
    +
    +
    + +Expand source code + +
    def handle_callback(self, request: WsgiHttpRequest) -> BoltResponse:
    +    oauth_flow: OAuthFlow = self.app.oauth_flow
    +    return oauth_flow.handle_callback(
    +        BoltRequest(body=request.get_body(), query=request.query_string, headers=request.get_headers())
    +    )
    +
    +
    +
    +def handle_installation(self, request: WsgiHttpRequest) ‑> BoltResponse +
    +
    +
    +
    + +Expand source code + +
    def handle_installation(self, request: WsgiHttpRequest) -> BoltResponse:
    +    oauth_flow: OAuthFlow = self.app.oauth_flow
    +    return oauth_flow.handle_installation(
    +        BoltRequest(body=request.get_body(), query=request.query_string, headers=request.get_headers())
    +    )
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/wsgi/http_request.html b/docs/api-docs/slack_bolt/adapter/wsgi/http_request.html new file mode 100644 index 000000000..8766ee705 --- /dev/null +++ b/docs/api-docs/slack_bolt/adapter/wsgi/http_request.html @@ -0,0 +1,223 @@ + + + + + + +slack_bolt.adapter.wsgi.http_request API documentation + + + + + + + + + + + +
    +
    +
    +

    Module slack_bolt.adapter.wsgi.http_request

    +
    +
    +
    + +Expand source code + +
    from typing import Any, Dict
    +
    +from .internals import ENCODING
    +
    +
    +class WsgiHttpRequest:
    +    """This Class uses the PEP 3333 standard to extract request information
    +    from the WSGI web server running the application
    +
    +    PEP 3333: https://peps.python.org/pep-3333/
    +    """
    +
    +    __slots__ = ("method", "path", "query_string", "protocol", "environ")
    +
    +    def __init__(self, environ: Dict[str, Any]):
    +        self.method: str = environ.get("REQUEST_METHOD", "GET")
    +        self.path: str = environ.get("PATH_INFO", "")
    +        self.query_string: str = environ.get("QUERY_STRING", "")
    +        self.protocol: str = environ.get("SERVER_PROTOCOL", "")
    +        self.environ = environ
    +
    +    def get_headers(self) -> Dict[str, str]:
    +        headers = {}
    +        for key, value in self.environ.items():
    +            if key in {"CONTENT_LENGTH", "CONTENT_TYPE"}:
    +                name = key.lower().replace("_", "-")
    +                headers[name] = value
    +            if key.startswith("HTTP_"):
    +                name = key[len("HTTP_"):].lower().replace("_", "-")  # fmt: skip
    +                headers[name] = value
    +        return headers
    +
    +    def get_body(self) -> str:
    +        if "wsgi.input" not in self.environ:
    +            return ""
    +        content_length = int(self.environ.get("CONTENT_LENGTH", 0))
    +        return self.environ["wsgi.input"].read(content_length).decode(ENCODING)
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Classes

    +
    +
    +class WsgiHttpRequest +(environ: Dict[str, Any]) +
    +
    +

    This Class uses the PEP 3333 standard to extract request information +from the WSGI web server running the application

    +

    PEP 3333: https://peps.python.org/pep-3333/

    +
    + +Expand source code + +
    class WsgiHttpRequest:
    +    """This Class uses the PEP 3333 standard to extract request information
    +    from the WSGI web server running the application
    +
    +    PEP 3333: https://peps.python.org/pep-3333/
    +    """
    +
    +    __slots__ = ("method", "path", "query_string", "protocol", "environ")
    +
    +    def __init__(self, environ: Dict[str, Any]):
    +        self.method: str = environ.get("REQUEST_METHOD", "GET")
    +        self.path: str = environ.get("PATH_INFO", "")
    +        self.query_string: str = environ.get("QUERY_STRING", "")
    +        self.protocol: str = environ.get("SERVER_PROTOCOL", "")
    +        self.environ = environ
    +
    +    def get_headers(self) -> Dict[str, str]:
    +        headers = {}
    +        for key, value in self.environ.items():
    +            if key in {"CONTENT_LENGTH", "CONTENT_TYPE"}:
    +                name = key.lower().replace("_", "-")
    +                headers[name] = value
    +            if key.startswith("HTTP_"):
    +                name = key[len("HTTP_"):].lower().replace("_", "-")  # fmt: skip
    +                headers[name] = value
    +        return headers
    +
    +    def get_body(self) -> str:
    +        if "wsgi.input" not in self.environ:
    +            return ""
    +        content_length = int(self.environ.get("CONTENT_LENGTH", 0))
    +        return self.environ["wsgi.input"].read(content_length).decode(ENCODING)
    +
    +

    Instance variables

    +
    +
    var environ
    +
    +

    Return an attribute of instance, which is of type owner.

    +
    +
    var method
    +
    +

    Return an attribute of instance, which is of type owner.

    +
    +
    var path
    +
    +

    Return an attribute of instance, which is of type owner.

    +
    +
    var protocol
    +
    +

    Return an attribute of instance, which is of type owner.

    +
    +
    var query_string
    +
    +

    Return an attribute of instance, which is of type owner.

    +
    +
    +

    Methods

    +
    +
    +def get_body(self) ‑> str +
    +
    +
    +
    + +Expand source code + +
    def get_body(self) -> str:
    +    if "wsgi.input" not in self.environ:
    +        return ""
    +    content_length = int(self.environ.get("CONTENT_LENGTH", 0))
    +    return self.environ["wsgi.input"].read(content_length).decode(ENCODING)
    +
    +
    +
    +def get_headers(self) ‑> Dict[str, str] +
    +
    +
    +
    + +Expand source code + +
    def get_headers(self) -> Dict[str, str]:
    +    headers = {}
    +    for key, value in self.environ.items():
    +        if key in {"CONTENT_LENGTH", "CONTENT_TYPE"}:
    +            name = key.lower().replace("_", "-")
    +            headers[name] = value
    +        if key.startswith("HTTP_"):
    +            name = key[len("HTTP_"):].lower().replace("_", "-")  # fmt: skip
    +            headers[name] = value
    +    return headers
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/wsgi/http_response.html b/docs/api-docs/slack_bolt/adapter/wsgi/http_response.html new file mode 100644 index 000000000..d91da60bd --- /dev/null +++ b/docs/api-docs/slack_bolt/adapter/wsgi/http_response.html @@ -0,0 +1,190 @@ + + + + + + +slack_bolt.adapter.wsgi.http_response API documentation + + + + + + + + + + + +
    +
    +
    +

    Module slack_bolt.adapter.wsgi.http_response

    +
    +
    +
    + +Expand source code + +
    from http import HTTPStatus
    +from typing import Dict, Iterable, List, Sequence, Tuple
    +
    +from .internals import ENCODING
    +
    +
    +class WsgiHttpResponse:
    +    """This Class uses the PEP 3333 standard to adapt bolt response information
    +    for the WSGI web server running the application
    +
    +    PEP 3333: https://peps.python.org/pep-3333/
    +    """
    +
    +    __slots__ = ("status", "_headers", "_body")
    +
    +    def __init__(self, status: int, headers: Dict[str, Sequence[str]] = {}, body: str = ""):
    +        _status = HTTPStatus(status)
    +        self.status = f"{_status.value} {_status.phrase}"
    +        self._headers = headers
    +        self._body = bytes(body, ENCODING)
    +
    +    def get_headers(self) -> List[Tuple[str, str]]:
    +        headers: List[Tuple[str, str]] = []
    +        for key, value in self._headers.items():
    +            if key.lower() == "content-length":
    +                continue
    +            headers.append((key, value[0]))
    +
    +        headers.append(("content-length", str(len(self._body))))
    +        return headers
    +
    +    def get_body(self) -> Iterable[bytes]:
    +        return [self._body]
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Classes

    +
    +
    +class WsgiHttpResponse +(status: int, headers: Dict[str, Sequence[str]] = {}, body: str = '') +
    +
    +

    This Class uses the PEP 3333 standard to adapt bolt response information +for the WSGI web server running the application

    +

    PEP 3333: https://peps.python.org/pep-3333/

    +
    + +Expand source code + +
    class WsgiHttpResponse:
    +    """This Class uses the PEP 3333 standard to adapt bolt response information
    +    for the WSGI web server running the application
    +
    +    PEP 3333: https://peps.python.org/pep-3333/
    +    """
    +
    +    __slots__ = ("status", "_headers", "_body")
    +
    +    def __init__(self, status: int, headers: Dict[str, Sequence[str]] = {}, body: str = ""):
    +        _status = HTTPStatus(status)
    +        self.status = f"{_status.value} {_status.phrase}"
    +        self._headers = headers
    +        self._body = bytes(body, ENCODING)
    +
    +    def get_headers(self) -> List[Tuple[str, str]]:
    +        headers: List[Tuple[str, str]] = []
    +        for key, value in self._headers.items():
    +            if key.lower() == "content-length":
    +                continue
    +            headers.append((key, value[0]))
    +
    +        headers.append(("content-length", str(len(self._body))))
    +        return headers
    +
    +    def get_body(self) -> Iterable[bytes]:
    +        return [self._body]
    +
    +

    Instance variables

    +
    +
    var status
    +
    +

    Return an attribute of instance, which is of type owner.

    +
    +
    +

    Methods

    +
    +
    +def get_body(self) ‑> Iterable[bytes] +
    +
    +
    +
    + +Expand source code + +
    def get_body(self) -> Iterable[bytes]:
    +    return [self._body]
    +
    +
    +
    +def get_headers(self) ‑> List[Tuple[str, str]] +
    +
    +
    +
    + +Expand source code + +
    def get_headers(self) -> List[Tuple[str, str]]:
    +    headers: List[Tuple[str, str]] = []
    +    for key, value in self._headers.items():
    +        if key.lower() == "content-length":
    +            continue
    +        headers.append((key, value[0]))
    +
    +    headers.append(("content-length", str(len(self._body))))
    +    return headers
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/wsgi/index.html b/docs/api-docs/slack_bolt/adapter/wsgi/index.html new file mode 100644 index 000000000..a6ed350bf --- /dev/null +++ b/docs/api-docs/slack_bolt/adapter/wsgi/index.html @@ -0,0 +1,262 @@ + + + + + + +slack_bolt.adapter.wsgi API documentation + + + + + + + + + + + +
    +
    +
    +

    Module slack_bolt.adapter.wsgi

    +
    +
    +
    + +Expand source code + +
    from .handler import SlackRequestHandler
    +
    +__all__ = ["SlackRequestHandler"]
    +
    +
    +
    +

    Sub-modules

    +
    +
    slack_bolt.adapter.wsgi.handler
    +
    +
    +
    +
    slack_bolt.adapter.wsgi.http_request
    +
    +
    +
    +
    slack_bolt.adapter.wsgi.http_response
    +
    +
    +
    +
    slack_bolt.adapter.wsgi.internals
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Classes

    +
    +
    +class SlackRequestHandler +(app: App, path: str = '/slack/events') +
    +
    +

    Setup Bolt as a WSGI web framework, this will make your application compatible with WSGI web servers. +This can be used for production deployments.

    +

    With the default settings, http://localhost:3000/slack/events +Run Bolt with gunicorn

    +

    Python

    +
    app = App()
    +
    +api = SlackRequestHandler(app)
    +
    +

    bash

    +
    export SLACK_SIGNING_SECRET=***
    +
    +export SLACK_BOT_TOKEN=xoxb-***
    +
    +gunicorn app:api -b 0.0.0.0:3000 --log-level debug
    +
    +

    Args

    +
    +
    app
    +
    Your bolt application
    +
    path
    +
    The path to handle request from Slack (Default: /slack/events)
    +
    +
    + +Expand source code + +
    class SlackRequestHandler:
    +    def __init__(self, app: App, path: str = "/slack/events"):
    +        """Setup Bolt as a WSGI web framework, this will make your application compatible with WSGI web servers.
    +        This can be used for production deployments.
    +
    +        With the default settings, `http://localhost:3000/slack/events`
    +        Run Bolt with [gunicorn](https://gunicorn.org/)
    +
    +        # Python
    +            app = App()
    +
    +            api = SlackRequestHandler(app)
    +
    +        # bash
    +            export SLACK_SIGNING_SECRET=***
    +
    +            export SLACK_BOT_TOKEN=xoxb-***
    +
    +            gunicorn app:api -b 0.0.0.0:3000 --log-level debug
    +
    +        Args:
    +            app: Your bolt application
    +            path: The path to handle request from Slack (Default: `/slack/events`)
    +        """
    +        self.path = path
    +        self.app = app
    +
    +    def dispatch(self, request: WsgiHttpRequest) -> BoltResponse:
    +        return self.app.dispatch(
    +            BoltRequest(body=request.get_body(), query=request.query_string, headers=request.get_headers())
    +        )
    +
    +    def handle_installation(self, request: WsgiHttpRequest) -> BoltResponse:
    +        oauth_flow: OAuthFlow = self.app.oauth_flow
    +        return oauth_flow.handle_installation(
    +            BoltRequest(body=request.get_body(), query=request.query_string, headers=request.get_headers())
    +        )
    +
    +    def handle_callback(self, request: WsgiHttpRequest) -> BoltResponse:
    +        oauth_flow: OAuthFlow = self.app.oauth_flow
    +        return oauth_flow.handle_callback(
    +            BoltRequest(body=request.get_body(), query=request.query_string, headers=request.get_headers())
    +        )
    +
    +    def _get_http_response(self, request: WsgiHttpRequest) -> WsgiHttpResponse:
    +        if request.method == "GET":
    +            if self.app.oauth_flow is not None:
    +                if request.path == self.app.oauth_flow.install_path:
    +                    bolt_response: BoltResponse = self.handle_installation(request)
    +                    return WsgiHttpResponse(
    +                        status=bolt_response.status, headers=bolt_response.headers, body=bolt_response.body
    +                    )
    +                if request.path == self.app.oauth_flow.redirect_uri_path:
    +                    bolt_response: BoltResponse = self.handle_callback(request)
    +                    return WsgiHttpResponse(
    +                        status=bolt_response.status, headers=bolt_response.headers, body=bolt_response.body
    +                    )
    +        if request.method == "POST" and request.path == self.path:
    +            bolt_response: BoltResponse = self.dispatch(request)
    +            return WsgiHttpResponse(status=bolt_response.status, headers=bolt_response.headers, body=bolt_response.body)
    +        return WsgiHttpResponse(status=404, headers={"content-type": ["text/plain;charset=utf-8"]}, body="Not Found")
    +
    +    def __call__(
    +        self,
    +        environ: Dict[str, Any],
    +        start_response: Callable[[str, List[Tuple[str, str]]], None],
    +    ) -> Iterable[bytes]:
    +        request = WsgiHttpRequest(environ)
    +        if "HTTP" in request.protocol:
    +            response: WsgiHttpResponse = self._get_http_response(
    +                request=request,
    +            )
    +            start_response(response.status, response.get_headers())
    +            return response.get_body()
    +        raise TypeError(f"Unsupported SERVER_PROTOCOL: {request.protocol}")
    +
    +

    Methods

    +
    +
    +def dispatch(self, request: WsgiHttpRequest) ‑> BoltResponse +
    +
    +
    +
    + +Expand source code + +
    def dispatch(self, request: WsgiHttpRequest) -> BoltResponse:
    +    return self.app.dispatch(
    +        BoltRequest(body=request.get_body(), query=request.query_string, headers=request.get_headers())
    +    )
    +
    +
    +
    +def handle_callback(self, request: WsgiHttpRequest) ‑> BoltResponse +
    +
    +
    +
    + +Expand source code + +
    def handle_callback(self, request: WsgiHttpRequest) -> BoltResponse:
    +    oauth_flow: OAuthFlow = self.app.oauth_flow
    +    return oauth_flow.handle_callback(
    +        BoltRequest(body=request.get_body(), query=request.query_string, headers=request.get_headers())
    +    )
    +
    +
    +
    +def handle_installation(self, request: WsgiHttpRequest) ‑> BoltResponse +
    +
    +
    +
    + +Expand source code + +
    def handle_installation(self, request: WsgiHttpRequest) -> BoltResponse:
    +    oauth_flow: OAuthFlow = self.app.oauth_flow
    +    return oauth_flow.handle_installation(
    +        BoltRequest(body=request.get_body(), query=request.query_string, headers=request.get_headers())
    +    )
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/adapter/wsgi/internals.html b/docs/api-docs/slack_bolt/adapter/wsgi/internals.html new file mode 100644 index 000000000..b953c1183 --- /dev/null +++ b/docs/api-docs/slack_bolt/adapter/wsgi/internals.html @@ -0,0 +1,59 @@ + + + + + + +slack_bolt.adapter.wsgi.internals API documentation + + + + + + + + + + + +
    +
    +
    +

    Module slack_bolt.adapter.wsgi.internals

    +
    +
    +
    + +Expand source code + +
    ENCODING = "utf-8"  # The content encoding for Slack requests/responses is always utf-8
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/docs/api-docs/slack_bolt/app/app.html b/docs/api-docs/slack_bolt/app/app.html index 3e01431fc..11a307714 100644 --- a/docs/api-docs/slack_bolt/app/app.html +++ b/docs/api-docs/slack_bolt/app/app.html @@ -31,6 +31,7 @@

    Module slack_bolt.app.app

    import logging import os import time +import warnings from concurrent.futures import Executor from concurrent.futures.thread import ThreadPoolExecutor from http.server import SimpleHTTPRequestHandler, HTTPServer @@ -131,6 +132,7 @@

    Module slack_bolt.app.app

    # for multi-workspace apps before_authorize: Optional[Union[Middleware, Callable[..., Any]]] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, + user_facing_authorize_error_message: Optional[str] = None, installation_store: Optional[InstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility installation_store_bot_only: Optional[bool] = None, @@ -187,6 +189,8 @@

    Module slack_bolt.app.app

    before_authorize: A global middleware that can be executed right before authorize function authorize: The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data. + user_facing_authorize_error_message: The user-facing error message to display + when the app is installed but the installation is not managed by this app's installation store installation_store: The module offering save/find operations of installation data installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) request_verification_enabled: False if you would like to disable the built-in middleware (Default: True). @@ -206,7 +210,7 @@

    Module slack_bolt.app.app

    `SslCheck` is a built-in middleware that handles ssl_check requests from Slack. oauth_settings: The settings related to Slack app installation flow (OAuth flow) oauth_flow: Instantiated `slack_bolt.oauth.OAuthFlow`. This is always prioritized over oauth_settings. - verification_token: Deprecated verification mechanism. This can used only for ssl_check requests. + verification_token: Deprecated verification mechanism. This can be used only for ssl_check requests. listener_executor: Custom executor to run background tasks. If absent, the default `ThreadPoolExecutor` will be used. """ @@ -376,6 +380,7 @@

    Module slack_bolt.app.app

    ignoring_self_events_enabled=ignoring_self_events_enabled, ssl_check_enabled=ssl_check_enabled, url_verification_enabled=url_verification_enabled, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) def _init_middleware_list( @@ -385,6 +390,7 @@

    Module slack_bolt.app.app

    ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, + user_facing_authorize_error_message: Optional[str] = None, ): if self._init_middleware_list_done: return @@ -413,13 +419,18 @@

    Module slack_bolt.app.app

    SingleTeamAuthorization( auth_test_result=auth_test_result, base_logger=self._base_logger, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) ) except SlackApiError as err: raise BoltError(error_auth_test_failure(err.response)) elif self._authorize is not None: self._middleware_list.append( - MultiTeamsAuthorization(authorize=self._authorize, base_logger=self._base_logger) + MultiTeamsAuthorization( + authorize=self._authorize, + base_logger=self._base_logger, + user_facing_authorize_error_message=user_facing_authorize_error_message, + ) ) else: raise BoltError(error_token_required()) @@ -429,6 +440,7 @@

    Module slack_bolt.app.app

    authorize=self._authorize, base_logger=self._base_logger, user_token_resolution=self._oauth_flow.settings.user_token_resolution, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) ) if ignoring_self_events_enabled is True: @@ -676,7 +688,13 @@

    Module slack_bolt.app.app

    save: Optional[Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]]] = None, execute: Optional[Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]]] = None, ): - """Registers a new Workflow Step listener. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new Workflow Step listener. + Unlike others, this method doesn't behave as a decorator. If you want to register a workflow step by a decorator, use `WorkflowStepBuilder`'s methods. @@ -705,6 +723,13 @@

    Module slack_bolt.app.app

    save: The function for handling configuration in the Workflow Builder execute: The function for handling the step execution """ + warnings.warn( + ( + "Steps from Apps for legacy workflows are now deprecated. " + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + ), + category=DeprecationWarning, + ) step = callback_id if isinstance(callback_id, (str, Pattern)): step = WorkflowStep( @@ -1485,7 +1510,7 @@

    Classes

    class App -(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, token_verification_enabled: bool = True, client: Optional[slack_sdk.web.client.WebClient] = None, before_authorize: Union[Middleware, Callable[..., Any], ForwardRef(None)] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, verification_token: Optional[str] = None, listener_executor: Optional[concurrent.futures._base.Executor] = None) +(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, token_verification_enabled: bool = True, client: Optional[slack_sdk.web.client.WebClient] = None, before_authorize: Union[Middleware, Callable[..., Any], ForwardRef(None)] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, user_facing_authorize_error_message: Optional[str] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, verification_token: Optional[str] = None, listener_executor: Optional[concurrent.futures._base.Executor] = None)

    Bolt App that provides functionalities to register middleware/listeners.

    @@ -1536,6 +1561,9 @@

    Args

    authorize
    The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data.
    +
    user_facing_authorize_error_message
    +
    The user-facing error message to display +when the app is installed but the installation is not managed by this app's installation store
    installation_store
    The module offering save/find operations of installation data
    installation_store_bot_only
    @@ -1564,7 +1592,7 @@

    Args

    oauth_flow
    Instantiated OAuthFlow. This is always prioritized over oauth_settings.
    verification_token
    -
    Deprecated verification mechanism. This can used only for ssl_check requests.
    +
    Deprecated verification mechanism. This can be used only for ssl_check requests.
    listener_executor
    Custom executor to run background tasks. If absent, the default ThreadPoolExecutor will be used.
    @@ -1593,6 +1621,7 @@

    Args

    # for multi-workspace apps before_authorize: Optional[Union[Middleware, Callable[..., Any]]] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, + user_facing_authorize_error_message: Optional[str] = None, installation_store: Optional[InstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility installation_store_bot_only: Optional[bool] = None, @@ -1649,6 +1678,8 @@

    Args

    before_authorize: A global middleware that can be executed right before authorize function authorize: The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data. + user_facing_authorize_error_message: The user-facing error message to display + when the app is installed but the installation is not managed by this app's installation store installation_store: The module offering save/find operations of installation data installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) request_verification_enabled: False if you would like to disable the built-in middleware (Default: True). @@ -1668,7 +1699,7 @@

    Args

    `SslCheck` is a built-in middleware that handles ssl_check requests from Slack. oauth_settings: The settings related to Slack app installation flow (OAuth flow) oauth_flow: Instantiated `slack_bolt.oauth.OAuthFlow`. This is always prioritized over oauth_settings. - verification_token: Deprecated verification mechanism. This can used only for ssl_check requests. + verification_token: Deprecated verification mechanism. This can be used only for ssl_check requests. listener_executor: Custom executor to run background tasks. If absent, the default `ThreadPoolExecutor` will be used. """ @@ -1838,6 +1869,7 @@

    Args

    ignoring_self_events_enabled=ignoring_self_events_enabled, ssl_check_enabled=ssl_check_enabled, url_verification_enabled=url_verification_enabled, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) def _init_middleware_list( @@ -1847,6 +1879,7 @@

    Args

    ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, + user_facing_authorize_error_message: Optional[str] = None, ): if self._init_middleware_list_done: return @@ -1875,13 +1908,18 @@

    Args

    SingleTeamAuthorization( auth_test_result=auth_test_result, base_logger=self._base_logger, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) ) except SlackApiError as err: raise BoltError(error_auth_test_failure(err.response)) elif self._authorize is not None: self._middleware_list.append( - MultiTeamsAuthorization(authorize=self._authorize, base_logger=self._base_logger) + MultiTeamsAuthorization( + authorize=self._authorize, + base_logger=self._base_logger, + user_facing_authorize_error_message=user_facing_authorize_error_message, + ) ) else: raise BoltError(error_token_required()) @@ -1891,6 +1929,7 @@

    Args

    authorize=self._authorize, base_logger=self._base_logger, user_token_resolution=self._oauth_flow.settings.user_token_resolution, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) ) if ignoring_self_events_enabled is True: @@ -2138,7 +2177,13 @@

    Args

    save: Optional[Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]]] = None, execute: Optional[Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]]] = None, ): - """Registers a new Workflow Step listener. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new Workflow Step listener. + Unlike others, this method doesn't behave as a decorator. If you want to register a workflow step by a decorator, use `WorkflowStepBuilder`'s methods. @@ -2167,6 +2212,13 @@

    Args

    save: The function for handling configuration in the Workflow Builder execute: The function for handling the step execution """ + warnings.warn( + ( + "Steps from Apps for legacy workflows are now deprecated. " + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + ), + category=DeprecationWarning, + ) step = callback_id if isinstance(callback_id, (str, Pattern)): step = WorkflowStep( @@ -3949,8 +4001,11 @@

    Args

    def step(self, callback_id: Union[str, Pattern, WorkflowStepWorkflowStepBuilder], edit: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable], ForwardRef(None)] = None, save: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable], ForwardRef(None)] = None, execute: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable], ForwardRef(None)] = None)
    -

    Registers a new Workflow Step listener. -Unlike others, this method doesn't behave as a decorator. +

    Deprecated

    +

    Steps from Apps for legacy workflows are now deprecated. +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +

    Registers a new Workflow Step listener.

    +

    Unlike others, this method doesn't behave as a decorator. If you want to register a workflow step by a decorator, use WorkflowStepBuilder's methods.

    # Create a new WorkflowStep instance
     from slack_bolt.workflows.step import WorkflowStep
    @@ -3990,7 +4045,13 @@ 

    Args

    save: Optional[Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]]] = None, execute: Optional[Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]]] = None, ): - """Registers a new Workflow Step listener. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new Workflow Step listener. + Unlike others, this method doesn't behave as a decorator. If you want to register a workflow step by a decorator, use `WorkflowStepBuilder`'s methods. @@ -4019,6 +4080,13 @@

    Args

    save: The function for handling configuration in the Workflow Builder execute: The function for handling the step execution """ + warnings.warn( + ( + "Steps from Apps for legacy workflows are now deprecated. " + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + ), + category=DeprecationWarning, + ) step = callback_id if isinstance(callback_id, (str, Pattern)): step = WorkflowStep( diff --git a/docs/api-docs/slack_bolt/app/async_app.html b/docs/api-docs/slack_bolt/app/async_app.html index a1e457055..1449a1c54 100644 --- a/docs/api-docs/slack_bolt/app/async_app.html +++ b/docs/api-docs/slack_bolt/app/async_app.html @@ -31,6 +31,7 @@

    Module slack_bolt.app.async_app

    import os import time from typing import Optional, List, Union, Callable, Pattern, Dict, Awaitable, Sequence, Any +import warnings from aiohttp import web @@ -142,6 +143,7 @@

    Module slack_bolt.app.async_app

    # for multi-workspace apps before_authorize: Optional[Union[AsyncMiddleware, Callable[..., Awaitable[Any]]]] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, + user_facing_authorize_error_message: Optional[str] = None, installation_store: Optional[AsyncInstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility installation_store_bot_only: Optional[bool] = None, @@ -195,6 +197,8 @@

    Module slack_bolt.app.async_app

    before_authorize: A global middleware that can be executed right before authorize function authorize: The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data. + user_facing_authorize_error_message: The user-facing error message to display + when the app is installed but the installation is not managed by this app's installation store installation_store: The module offering save/find operations of installation data installation_store_bot_only: Use `AsyncInstallationStore#async_find_bot()` if True (Default: False) request_verification_enabled: False if you would like to disable the built-in middleware (Default: True). @@ -382,6 +386,7 @@

    Module slack_bolt.app.async_app

    ignoring_self_events_enabled=ignoring_self_events_enabled, ssl_check_enabled=ssl_check_enabled, url_verification_enabled=url_verification_enabled, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) self._server: Optional[AsyncSlackAppServer] = None @@ -392,6 +397,7 @@

    Module slack_bolt.app.async_app

    ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, + user_facing_authorize_error_message: Optional[str] = None, ): if self._init_middleware_list_done: return @@ -411,10 +417,19 @@

    Module slack_bolt.app.async_app

    # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._async_oauth_flow is None: if self._token: - self._async_middleware_list.append(AsyncSingleTeamAuthorization(base_logger=self._base_logger)) + self._async_middleware_list.append( + AsyncSingleTeamAuthorization( + base_logger=self._base_logger, + user_facing_authorize_error_message=user_facing_authorize_error_message, + ) + ) elif self._async_authorize is not None: self._async_middleware_list.append( - AsyncMultiTeamsAuthorization(authorize=self._async_authorize, base_logger=self._base_logger) + AsyncMultiTeamsAuthorization( + authorize=self._async_authorize, + base_logger=self._base_logger, + user_facing_authorize_error_message=user_facing_authorize_error_message, + ) ) else: raise BoltError(error_token_required()) @@ -424,6 +439,7 @@

    Module slack_bolt.app.async_app

    authorize=self._async_authorize, base_logger=self._base_logger, user_token_resolution=self._async_oauth_flow.settings.user_token_resolution, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) ) @@ -702,7 +718,12 @@

    Module slack_bolt.app.async_app

    execute: Optional[Union[Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable]]] = None, ): """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Registers a new Workflow Step listener. + Unlike others, this method doesn't behave as a decorator. If you want to register a workflow step by a decorator, use `AsyncWorkflowStepBuilder`'s methods. @@ -730,6 +751,13 @@

    Module slack_bolt.app.async_app

    save: The function for handling configuration in the Workflow Builder execute: The function for handling the step execution """ + warnings.warn( + ( + "Steps from Apps for legacy workflows are now deprecated. " + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + ), + category=DeprecationWarning, + ) step = callback_id if isinstance(callback_id, (str, Pattern)): step = AsyncWorkflowStep( @@ -1399,7 +1427,7 @@

    Classes

    class AsyncApp -(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, client: Optional[slack_sdk.web.async_client.AsyncWebClient] = None, before_authorize: Union[AsyncMiddleware, Callable[..., Awaitable[Any]], ForwardRef(None)] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[AsyncOAuthSettings] = None, oauth_flow: Optional[AsyncOAuthFlow] = None, verification_token: Optional[str] = None) +(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, client: Optional[slack_sdk.web.async_client.AsyncWebClient] = None, before_authorize: Union[AsyncMiddleware, Callable[..., Awaitable[Any]], ForwardRef(None)] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, user_facing_authorize_error_message: Optional[str] = None, installation_store: Optional[slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[AsyncOAuthSettings] = None, oauth_flow: Optional[AsyncOAuthFlow] = None, verification_token: Optional[str] = None)

    Bolt App that provides functionalities to register middleware/listeners.

    @@ -1448,6 +1476,9 @@

    Args

    authorize
    The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data.
    +
    user_facing_authorize_error_message
    +
    The user-facing error message to display +when the app is installed but the installation is not managed by this app's installation store
    installation_store
    The module offering save/find operations of installation data
    installation_store_bot_only
    @@ -1501,6 +1532,7 @@

    Args

    # for multi-workspace apps before_authorize: Optional[Union[AsyncMiddleware, Callable[..., Awaitable[Any]]]] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, + user_facing_authorize_error_message: Optional[str] = None, installation_store: Optional[AsyncInstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility installation_store_bot_only: Optional[bool] = None, @@ -1554,6 +1586,8 @@

    Args

    before_authorize: A global middleware that can be executed right before authorize function authorize: The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data. + user_facing_authorize_error_message: The user-facing error message to display + when the app is installed but the installation is not managed by this app's installation store installation_store: The module offering save/find operations of installation data installation_store_bot_only: Use `AsyncInstallationStore#async_find_bot()` if True (Default: False) request_verification_enabled: False if you would like to disable the built-in middleware (Default: True). @@ -1741,6 +1775,7 @@

    Args

    ignoring_self_events_enabled=ignoring_self_events_enabled, ssl_check_enabled=ssl_check_enabled, url_verification_enabled=url_verification_enabled, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) self._server: Optional[AsyncSlackAppServer] = None @@ -1751,6 +1786,7 @@

    Args

    ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, + user_facing_authorize_error_message: Optional[str] = None, ): if self._init_middleware_list_done: return @@ -1770,10 +1806,19 @@

    Args

    # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._async_oauth_flow is None: if self._token: - self._async_middleware_list.append(AsyncSingleTeamAuthorization(base_logger=self._base_logger)) + self._async_middleware_list.append( + AsyncSingleTeamAuthorization( + base_logger=self._base_logger, + user_facing_authorize_error_message=user_facing_authorize_error_message, + ) + ) elif self._async_authorize is not None: self._async_middleware_list.append( - AsyncMultiTeamsAuthorization(authorize=self._async_authorize, base_logger=self._base_logger) + AsyncMultiTeamsAuthorization( + authorize=self._async_authorize, + base_logger=self._base_logger, + user_facing_authorize_error_message=user_facing_authorize_error_message, + ) ) else: raise BoltError(error_token_required()) @@ -1783,6 +1828,7 @@

    Args

    authorize=self._async_authorize, base_logger=self._base_logger, user_token_resolution=self._async_oauth_flow.settings.user_token_resolution, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) ) @@ -2061,7 +2107,12 @@

    Args

    execute: Optional[Union[Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable]]] = None, ): """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Registers a new Workflow Step listener. + Unlike others, this method doesn't behave as a decorator. If you want to register a workflow step by a decorator, use `AsyncWorkflowStepBuilder`'s methods. @@ -2089,6 +2140,13 @@

    Args

    save: The function for handling configuration in the Workflow Builder execute: The function for handling the step execution """ + warnings.warn( + ( + "Steps from Apps for legacy workflows are now deprecated. " + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + ), + category=DeprecationWarning, + ) step = callback_id if isinstance(callback_id, (str, Pattern)): step = AsyncWorkflowStep( @@ -3925,8 +3983,11 @@

    Args

    def step(self, callback_id: Union[str, Pattern, AsyncWorkflowStepAsyncWorkflowStepBuilder], edit: Union[Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable], ForwardRef(None)] = None, save: Union[Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable], ForwardRef(None)] = None, execute: Union[Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable], ForwardRef(None)] = None)
    -

    Registers a new Workflow Step listener. -Unlike others, this method doesn't behave as a decorator. +

    Deprecated

    +

    Steps from Apps for legacy workflows are now deprecated. +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +

    Registers a new Workflow Step listener.

    +

    Unlike others, this method doesn't behave as a decorator. If you want to register a workflow step by a decorator, use AsyncWorkflowStepBuilder's methods.

    # Create a new WorkflowStep instance
     from slack_bolt.workflows.async_step import AsyncWorkflowStep
    @@ -3967,7 +4028,12 @@ 

    Args

    execute: Optional[Union[Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable]]] = None, ): """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Registers a new Workflow Step listener. + Unlike others, this method doesn't behave as a decorator. If you want to register a workflow step by a decorator, use `AsyncWorkflowStepBuilder`'s methods. @@ -3995,6 +4061,13 @@

    Args

    save: The function for handling configuration in the Workflow Builder execute: The function for handling the step execution """ + warnings.warn( + ( + "Steps from Apps for legacy workflows are now deprecated. " + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + ), + category=DeprecationWarning, + ) step = callback_id if isinstance(callback_id, (str, Pattern)): step = AsyncWorkflowStep( diff --git a/docs/api-docs/slack_bolt/app/index.html b/docs/api-docs/slack_bolt/app/index.html index 6604ab567..e7bfccc08 100644 --- a/docs/api-docs/slack_bolt/app/index.html +++ b/docs/api-docs/slack_bolt/app/index.html @@ -72,7 +72,7 @@

    Classes

    class App -(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, token_verification_enabled: bool = True, client: Optional[slack_sdk.web.client.WebClient] = None, before_authorize: Union[Middleware, Callable[..., Any], ForwardRef(None)] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, verification_token: Optional[str] = None, listener_executor: Optional[concurrent.futures._base.Executor] = None) +(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, token_verification_enabled: bool = True, client: Optional[slack_sdk.web.client.WebClient] = None, before_authorize: Union[Middleware, Callable[..., Any], ForwardRef(None)] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, user_facing_authorize_error_message: Optional[str] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, verification_token: Optional[str] = None, listener_executor: Optional[concurrent.futures._base.Executor] = None)

    Bolt App that provides functionalities to register middleware/listeners.

    @@ -123,6 +123,9 @@

    Args

    authorize
    The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data.
    +
    user_facing_authorize_error_message
    +
    The user-facing error message to display +when the app is installed but the installation is not managed by this app's installation store
    installation_store
    The module offering save/find operations of installation data
    installation_store_bot_only
    @@ -151,7 +154,7 @@

    Args

    oauth_flow
    Instantiated OAuthFlow. This is always prioritized over oauth_settings.
    verification_token
    -
    Deprecated verification mechanism. This can used only for ssl_check requests.
    +
    Deprecated verification mechanism. This can be used only for ssl_check requests.
    listener_executor
    Custom executor to run background tasks. If absent, the default ThreadPoolExecutor will be used.
    @@ -180,6 +183,7 @@

    Args

    # for multi-workspace apps before_authorize: Optional[Union[Middleware, Callable[..., Any]]] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, + user_facing_authorize_error_message: Optional[str] = None, installation_store: Optional[InstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility installation_store_bot_only: Optional[bool] = None, @@ -236,6 +240,8 @@

    Args

    before_authorize: A global middleware that can be executed right before authorize function authorize: The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data. + user_facing_authorize_error_message: The user-facing error message to display + when the app is installed but the installation is not managed by this app's installation store installation_store: The module offering save/find operations of installation data installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) request_verification_enabled: False if you would like to disable the built-in middleware (Default: True). @@ -255,7 +261,7 @@

    Args

    `SslCheck` is a built-in middleware that handles ssl_check requests from Slack. oauth_settings: The settings related to Slack app installation flow (OAuth flow) oauth_flow: Instantiated `slack_bolt.oauth.OAuthFlow`. This is always prioritized over oauth_settings. - verification_token: Deprecated verification mechanism. This can used only for ssl_check requests. + verification_token: Deprecated verification mechanism. This can be used only for ssl_check requests. listener_executor: Custom executor to run background tasks. If absent, the default `ThreadPoolExecutor` will be used. """ @@ -425,6 +431,7 @@

    Args

    ignoring_self_events_enabled=ignoring_self_events_enabled, ssl_check_enabled=ssl_check_enabled, url_verification_enabled=url_verification_enabled, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) def _init_middleware_list( @@ -434,6 +441,7 @@

    Args

    ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, + user_facing_authorize_error_message: Optional[str] = None, ): if self._init_middleware_list_done: return @@ -462,13 +470,18 @@

    Args

    SingleTeamAuthorization( auth_test_result=auth_test_result, base_logger=self._base_logger, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) ) except SlackApiError as err: raise BoltError(error_auth_test_failure(err.response)) elif self._authorize is not None: self._middleware_list.append( - MultiTeamsAuthorization(authorize=self._authorize, base_logger=self._base_logger) + MultiTeamsAuthorization( + authorize=self._authorize, + base_logger=self._base_logger, + user_facing_authorize_error_message=user_facing_authorize_error_message, + ) ) else: raise BoltError(error_token_required()) @@ -478,6 +491,7 @@

    Args

    authorize=self._authorize, base_logger=self._base_logger, user_token_resolution=self._oauth_flow.settings.user_token_resolution, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) ) if ignoring_self_events_enabled is True: @@ -725,7 +739,13 @@

    Args

    save: Optional[Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]]] = None, execute: Optional[Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]]] = None, ): - """Registers a new Workflow Step listener. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new Workflow Step listener. + Unlike others, this method doesn't behave as a decorator. If you want to register a workflow step by a decorator, use `WorkflowStepBuilder`'s methods. @@ -754,6 +774,13 @@

    Args

    save: The function for handling configuration in the Workflow Builder execute: The function for handling the step execution """ + warnings.warn( + ( + "Steps from Apps for legacy workflows are now deprecated. " + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + ), + category=DeprecationWarning, + ) step = callback_id if isinstance(callback_id, (str, Pattern)): step = WorkflowStep( @@ -2536,8 +2563,11 @@

    Args

    def step(self, callback_id: Union[str, Pattern, WorkflowStepWorkflowStepBuilder], edit: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable], ForwardRef(None)] = None, save: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable], ForwardRef(None)] = None, execute: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable], ForwardRef(None)] = None)
    -

    Registers a new Workflow Step listener. -Unlike others, this method doesn't behave as a decorator. +

    Deprecated

    +

    Steps from Apps for legacy workflows are now deprecated. +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +

    Registers a new Workflow Step listener.

    +

    Unlike others, this method doesn't behave as a decorator. If you want to register a workflow step by a decorator, use WorkflowStepBuilder's methods.

    # Create a new WorkflowStep instance
     from slack_bolt.workflows.step import WorkflowStep
    @@ -2577,7 +2607,13 @@ 

    Args

    save: Optional[Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]]] = None, execute: Optional[Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]]] = None, ): - """Registers a new Workflow Step listener. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new Workflow Step listener. + Unlike others, this method doesn't behave as a decorator. If you want to register a workflow step by a decorator, use `WorkflowStepBuilder`'s methods. @@ -2606,6 +2642,13 @@

    Args

    save: The function for handling configuration in the Workflow Builder execute: The function for handling the step execution """ + warnings.warn( + ( + "Steps from Apps for legacy workflows are now deprecated. " + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + ), + category=DeprecationWarning, + ) step = callback_id if isinstance(callback_id, (str, Pattern)): step = WorkflowStep( diff --git a/docs/api-docs/slack_bolt/async_app.html b/docs/api-docs/slack_bolt/async_app.html index 1e066fb03..e9ae54e14 100644 --- a/docs/api-docs/slack_bolt/async_app.html +++ b/docs/api-docs/slack_bolt/async_app.html @@ -195,7 +195,7 @@

    Class variables

    class AsyncApp -(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, client: Optional[slack_sdk.web.async_client.AsyncWebClient] = None, before_authorize: Union[AsyncMiddleware, Callable[..., Awaitable[Any]], ForwardRef(None)] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[AsyncOAuthSettings] = None, oauth_flow: Optional[AsyncOAuthFlow] = None, verification_token: Optional[str] = None) +(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, client: Optional[slack_sdk.web.async_client.AsyncWebClient] = None, before_authorize: Union[AsyncMiddleware, Callable[..., Awaitable[Any]], ForwardRef(None)] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, user_facing_authorize_error_message: Optional[str] = None, installation_store: Optional[slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[AsyncOAuthSettings] = None, oauth_flow: Optional[AsyncOAuthFlow] = None, verification_token: Optional[str] = None)

    Bolt App that provides functionalities to register middleware/listeners.

    @@ -244,6 +244,9 @@

    Args

    authorize
    The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data.
    +
    user_facing_authorize_error_message
    +
    The user-facing error message to display +when the app is installed but the installation is not managed by this app's installation store
    installation_store
    The module offering save/find operations of installation data
    installation_store_bot_only
    @@ -297,6 +300,7 @@

    Args

    # for multi-workspace apps before_authorize: Optional[Union[AsyncMiddleware, Callable[..., Awaitable[Any]]]] = None, authorize: Optional[Callable[..., Awaitable[AuthorizeResult]]] = None, + user_facing_authorize_error_message: Optional[str] = None, installation_store: Optional[AsyncInstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility installation_store_bot_only: Optional[bool] = None, @@ -350,6 +354,8 @@

    Args

    before_authorize: A global middleware that can be executed right before authorize function authorize: The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data. + user_facing_authorize_error_message: The user-facing error message to display + when the app is installed but the installation is not managed by this app's installation store installation_store: The module offering save/find operations of installation data installation_store_bot_only: Use `AsyncInstallationStore#async_find_bot()` if True (Default: False) request_verification_enabled: False if you would like to disable the built-in middleware (Default: True). @@ -537,6 +543,7 @@

    Args

    ignoring_self_events_enabled=ignoring_self_events_enabled, ssl_check_enabled=ssl_check_enabled, url_verification_enabled=url_verification_enabled, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) self._server: Optional[AsyncSlackAppServer] = None @@ -547,6 +554,7 @@

    Args

    ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, + user_facing_authorize_error_message: Optional[str] = None, ): if self._init_middleware_list_done: return @@ -566,10 +574,19 @@

    Args

    # As authorize is required for making a Bolt app function, we don't offer the flag to disable this if self._async_oauth_flow is None: if self._token: - self._async_middleware_list.append(AsyncSingleTeamAuthorization(base_logger=self._base_logger)) + self._async_middleware_list.append( + AsyncSingleTeamAuthorization( + base_logger=self._base_logger, + user_facing_authorize_error_message=user_facing_authorize_error_message, + ) + ) elif self._async_authorize is not None: self._async_middleware_list.append( - AsyncMultiTeamsAuthorization(authorize=self._async_authorize, base_logger=self._base_logger) + AsyncMultiTeamsAuthorization( + authorize=self._async_authorize, + base_logger=self._base_logger, + user_facing_authorize_error_message=user_facing_authorize_error_message, + ) ) else: raise BoltError(error_token_required()) @@ -579,6 +596,7 @@

    Args

    authorize=self._async_authorize, base_logger=self._base_logger, user_token_resolution=self._async_oauth_flow.settings.user_token_resolution, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) ) @@ -857,7 +875,12 @@

    Args

    execute: Optional[Union[Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable]]] = None, ): """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Registers a new Workflow Step listener. + Unlike others, this method doesn't behave as a decorator. If you want to register a workflow step by a decorator, use `AsyncWorkflowStepBuilder`'s methods. @@ -885,6 +908,13 @@

    Args

    save: The function for handling configuration in the Workflow Builder execute: The function for handling the step execution """ + warnings.warn( + ( + "Steps from Apps for legacy workflows are now deprecated. " + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + ), + category=DeprecationWarning, + ) step = callback_id if isinstance(callback_id, (str, Pattern)): step = AsyncWorkflowStep( @@ -2721,8 +2751,11 @@

    Args

    def step(self, callback_id: Union[str, Pattern, AsyncWorkflowStepAsyncWorkflowStepBuilder], edit: Union[Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable], ForwardRef(None)] = None, save: Union[Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable], ForwardRef(None)] = None, execute: Union[Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable], ForwardRef(None)] = None)
    -

    Registers a new Workflow Step listener. -Unlike others, this method doesn't behave as a decorator. +

    Deprecated

    +

    Steps from Apps for legacy workflows are now deprecated. +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +

    Registers a new Workflow Step listener.

    +

    Unlike others, this method doesn't behave as a decorator. If you want to register a workflow step by a decorator, use AsyncWorkflowStepBuilder's methods.

    # Create a new WorkflowStep instance
     from slack_bolt.workflows.async_step import AsyncWorkflowStep
    @@ -2763,7 +2796,12 @@ 

    Args

    execute: Optional[Union[Callable[..., Optional[BoltResponse]], AsyncListener, Sequence[Callable]]] = None, ): """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Registers a new Workflow Step listener. + Unlike others, this method doesn't behave as a decorator. If you want to register a workflow step by a decorator, use `AsyncWorkflowStepBuilder`'s methods. @@ -2791,6 +2829,13 @@

    Args

    save: The function for handling configuration in the Workflow Builder execute: The function for handling the step execution """ + warnings.warn( + ( + "Steps from Apps for legacy workflows are now deprecated. " + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + ), + category=DeprecationWarning, + ) step = callback_id if isinstance(callback_id, (str, Pattern)): step = AsyncWorkflowStep( diff --git a/docs/api-docs/slack_bolt/index.html b/docs/api-docs/slack_bolt/index.html index 2578ab1f2..f41193602 100644 --- a/docs/api-docs/slack_bolt/index.html +++ b/docs/api-docs/slack_bolt/index.html @@ -210,7 +210,7 @@

    Class variables

    class App -(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, token_verification_enabled: bool = True, client: Optional[slack_sdk.web.client.WebClient] = None, before_authorize: Union[Middleware, Callable[..., Any], ForwardRef(None)] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, verification_token: Optional[str] = None, listener_executor: Optional[concurrent.futures._base.Executor] = None) +(*, logger: Optional[logging.Logger] = None, name: Optional[str] = None, process_before_response: bool = False, raise_error_for_unhandled_request: bool = False, signing_secret: Optional[str] = None, token: Optional[str] = None, token_verification_enabled: bool = True, client: Optional[slack_sdk.web.client.WebClient] = None, before_authorize: Union[Middleware, Callable[..., Any], ForwardRef(None)] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, user_facing_authorize_error_message: Optional[str] = None, installation_store: Optional[slack_sdk.oauth.installation_store.installation_store.InstallationStore] = None, installation_store_bot_only: Optional[bool] = None, request_verification_enabled: bool = True, ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, oauth_settings: Optional[OAuthSettings] = None, oauth_flow: Optional[OAuthFlow] = None, verification_token: Optional[str] = None, listener_executor: Optional[concurrent.futures._base.Executor] = None)

    Bolt App that provides functionalities to register middleware/listeners.

    @@ -261,6 +261,9 @@

    Args

    authorize
    The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data.
    +
    user_facing_authorize_error_message
    +
    The user-facing error message to display +when the app is installed but the installation is not managed by this app's installation store
    installation_store
    The module offering save/find operations of installation data
    installation_store_bot_only
    @@ -289,7 +292,7 @@

    Args

    oauth_flow
    Instantiated OAuthFlow. This is always prioritized over oauth_settings.
    verification_token
    -
    Deprecated verification mechanism. This can used only for ssl_check requests.
    +
    Deprecated verification mechanism. This can be used only for ssl_check requests.
    listener_executor
    Custom executor to run background tasks. If absent, the default ThreadPoolExecutor will be used.
    @@ -318,6 +321,7 @@

    Args

    # for multi-workspace apps before_authorize: Optional[Union[Middleware, Callable[..., Any]]] = None, authorize: Optional[Callable[..., AuthorizeResult]] = None, + user_facing_authorize_error_message: Optional[str] = None, installation_store: Optional[InstallationStore] = None, # for either only bot scope usage or v1.0.x compatibility installation_store_bot_only: Optional[bool] = None, @@ -374,6 +378,8 @@

    Args

    before_authorize: A global middleware that can be executed right before authorize function authorize: The function to authorize an incoming request from Slack by checking if there is a team/user in the installation data. + user_facing_authorize_error_message: The user-facing error message to display + when the app is installed but the installation is not managed by this app's installation store installation_store: The module offering save/find operations of installation data installation_store_bot_only: Use `InstallationStore#find_bot()` if True (Default: False) request_verification_enabled: False if you would like to disable the built-in middleware (Default: True). @@ -393,7 +399,7 @@

    Args

    `SslCheck` is a built-in middleware that handles ssl_check requests from Slack. oauth_settings: The settings related to Slack app installation flow (OAuth flow) oauth_flow: Instantiated `slack_bolt.oauth.OAuthFlow`. This is always prioritized over oauth_settings. - verification_token: Deprecated verification mechanism. This can used only for ssl_check requests. + verification_token: Deprecated verification mechanism. This can be used only for ssl_check requests. listener_executor: Custom executor to run background tasks. If absent, the default `ThreadPoolExecutor` will be used. """ @@ -563,6 +569,7 @@

    Args

    ignoring_self_events_enabled=ignoring_self_events_enabled, ssl_check_enabled=ssl_check_enabled, url_verification_enabled=url_verification_enabled, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) def _init_middleware_list( @@ -572,6 +579,7 @@

    Args

    ignoring_self_events_enabled: bool = True, ssl_check_enabled: bool = True, url_verification_enabled: bool = True, + user_facing_authorize_error_message: Optional[str] = None, ): if self._init_middleware_list_done: return @@ -600,13 +608,18 @@

    Args

    SingleTeamAuthorization( auth_test_result=auth_test_result, base_logger=self._base_logger, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) ) except SlackApiError as err: raise BoltError(error_auth_test_failure(err.response)) elif self._authorize is not None: self._middleware_list.append( - MultiTeamsAuthorization(authorize=self._authorize, base_logger=self._base_logger) + MultiTeamsAuthorization( + authorize=self._authorize, + base_logger=self._base_logger, + user_facing_authorize_error_message=user_facing_authorize_error_message, + ) ) else: raise BoltError(error_token_required()) @@ -616,6 +629,7 @@

    Args

    authorize=self._authorize, base_logger=self._base_logger, user_token_resolution=self._oauth_flow.settings.user_token_resolution, + user_facing_authorize_error_message=user_facing_authorize_error_message, ) ) if ignoring_self_events_enabled is True: @@ -863,7 +877,13 @@

    Args

    save: Optional[Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]]] = None, execute: Optional[Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]]] = None, ): - """Registers a new Workflow Step listener. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new Workflow Step listener. + Unlike others, this method doesn't behave as a decorator. If you want to register a workflow step by a decorator, use `WorkflowStepBuilder`'s methods. @@ -892,6 +912,13 @@

    Args

    save: The function for handling configuration in the Workflow Builder execute: The function for handling the step execution """ + warnings.warn( + ( + "Steps from Apps for legacy workflows are now deprecated. " + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + ), + category=DeprecationWarning, + ) step = callback_id if isinstance(callback_id, (str, Pattern)): step = WorkflowStep( @@ -2674,8 +2701,11 @@

    Args

    def step(self, callback_id: Union[str, Pattern, WorkflowStepWorkflowStepBuilder], edit: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable], ForwardRef(None)] = None, save: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable], ForwardRef(None)] = None, execute: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable], ForwardRef(None)] = None)
    -

    Registers a new Workflow Step listener. -Unlike others, this method doesn't behave as a decorator. +

    Deprecated

    +

    Steps from Apps for legacy workflows are now deprecated. +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +

    Registers a new Workflow Step listener.

    +

    Unlike others, this method doesn't behave as a decorator. If you want to register a workflow step by a decorator, use WorkflowStepBuilder's methods.

    # Create a new WorkflowStep instance
     from slack_bolt.workflows.step import WorkflowStep
    @@ -2715,7 +2745,13 @@ 

    Args

    save: Optional[Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]]] = None, execute: Optional[Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]]] = None, ): - """Registers a new Workflow Step listener. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new Workflow Step listener. + Unlike others, this method doesn't behave as a decorator. If you want to register a workflow step by a decorator, use `WorkflowStepBuilder`'s methods. @@ -2744,6 +2780,13 @@

    Args

    save: The function for handling configuration in the Workflow Builder execute: The function for handling the step execution """ + warnings.warn( + ( + "Steps from Apps for legacy workflows are now deprecated. " + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + ), + category=DeprecationWarning, + ) step = callback_id if isinstance(callback_id, (str, Pattern)): step = WorkflowStep( diff --git a/docs/api-docs/slack_bolt/middleware/async_builtins.html b/docs/api-docs/slack_bolt/middleware/async_builtins.html index d60ff8fee..4746e6c4d 100644 --- a/docs/api-docs/slack_bolt/middleware/async_builtins.html +++ b/docs/api-docs/slack_bolt/middleware/async_builtins.html @@ -275,17 +275,6 @@

    Ancestors

  • Middleware
  • AsyncMiddleware
  • -

    Class variables

    -
    -
    var logger : logging.Logger
    -
    -
    -
    -
    var verification_token : Optional[str]
    -
    -
    -
    -

    Inherited members

    • SslCheck: @@ -382,10 +371,6 @@

      AsyncSslCheck

      -
    • AsyncUrlVerification

      diff --git a/docs/api-docs/slack_bolt/middleware/authorization/async_internals.html b/docs/api-docs/slack_bolt/middleware/authorization/async_internals.html index f7a7a6da5..559ecc0cb 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/async_internals.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/async_internals.html @@ -26,8 +26,7 @@

      Module slack_bolt.middleware.authorization.async_interna Expand source code -
      from slack_bolt.middleware.authorization.internals import _build_error_text
      -from slack_bolt.request.async_request import AsyncBoltRequest
      +
      from slack_bolt.request.async_request import AsyncBoltRequest
       from slack_bolt.response import BoltResponse
       
       
      @@ -43,11 +42,11 @@ 

      Module slack_bolt.middleware.authorization.async_interna return _is_url_verification(req) or _is_ssl_check(req) -def _build_error_response() -> BoltResponse: +def _build_user_facing_error_response(message: str) -> BoltResponse: # show an ephemeral message to the end-user return BoltResponse( status=200, - body=_build_error_text(), + body=message, )

      diff --git a/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html b/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html index 5ffd5d51a..ab17699ba 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html @@ -34,8 +34,8 @@

      Module slack_bolt.middleware.authorization.async_multi_t from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse from .async_authorization import AsyncAuthorization -from .async_internals import _build_error_response, _is_no_auth_required -from .internals import _is_no_auth_test_call_required, _build_error_text +from .async_internals import _build_user_facing_error_response, _is_no_auth_required +from .internals import _is_no_auth_test_call_required, _build_user_facing_authorize_error_message from ...authorization import AuthorizeResult from ...authorization.async_authorize import AsyncAuthorize @@ -49,6 +49,7 @@

      Module slack_bolt.middleware.authorization.async_multi_t authorize: AsyncAuthorize, base_logger: Optional[Logger] = None, user_token_resolution: str = "authed_user", + user_facing_authorize_error_message: Optional[str] = None, ): """Multi-workspace authorization. @@ -56,10 +57,14 @@

      Module slack_bolt.middleware.authorization.async_multi_t authorize: The function to authorize incoming requests from Slack. base_logger: The base logger user_token_resolution: "authed_user" or "actor" + user_facing_authorize_error_message: The user-facing error message when installation is not found """ self.authorize = authorize self.logger = get_bolt_logger(AsyncMultiTeamsAuthorization, base_logger=base_logger) self.user_token_resolution = user_token_resolution + self.user_facing_authorize_error_message = ( + user_facing_authorize_error_message or _build_user_facing_authorize_error_message() + ) async def async_process( self, @@ -120,13 +125,13 @@

      Module slack_bolt.middleware.authorization.async_multi_t "the AuthorizeResult (returned value from authorize) for it was not found." ) if req.context.response_url is not None: - await req.context.respond(_build_error_text()) + await req.context.respond(self.user_facing_authorize_error_message) return BoltResponse(status=200, body="") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message) except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") - return _build_error_response()

      + return _build_user_facing_error_response(self.user_facing_authorize_error_message)

    @@ -140,7 +145,7 @@

    Classes

    class AsyncMultiTeamsAuthorization -(authorize: AsyncAuthorize, base_logger: Optional[logging.Logger] = None, user_token_resolution: str = 'authed_user') +(authorize: AsyncAuthorize, base_logger: Optional[logging.Logger] = None, user_token_resolution: str = 'authed_user', user_facing_authorize_error_message: Optional[str] = None)

    A middleware can process request data before other middleware and listener functions.

    @@ -153,6 +158,8 @@

    Args

    The base logger
    user_token_resolution
    "authed_user" or "actor"
    +
    user_facing_authorize_error_message
    +
    The user-facing error message when installation is not found
    @@ -167,6 +174,7 @@

    Args

    authorize: AsyncAuthorize, base_logger: Optional[Logger] = None, user_token_resolution: str = "authed_user", + user_facing_authorize_error_message: Optional[str] = None, ): """Multi-workspace authorization. @@ -174,10 +182,14 @@

    Args

    authorize: The function to authorize incoming requests from Slack. base_logger: The base logger user_token_resolution: "authed_user" or "actor" + user_facing_authorize_error_message: The user-facing error message when installation is not found """ self.authorize = authorize self.logger = get_bolt_logger(AsyncMultiTeamsAuthorization, base_logger=base_logger) self.user_token_resolution = user_token_resolution + self.user_facing_authorize_error_message = ( + user_facing_authorize_error_message or _build_user_facing_authorize_error_message() + ) async def async_process( self, @@ -238,13 +250,13 @@

    Args

    "the AuthorizeResult (returned value from authorize) for it was not found." ) if req.context.response_url is not None: - await req.context.respond(_build_error_text()) + await req.context.respond(self.user_facing_authorize_error_message) return BoltResponse(status=200, body="") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message) except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") - return _build_error_response()
    + return _build_user_facing_error_response(self.user_facing_authorize_error_message)

    Ancestors

      diff --git a/docs/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html b/docs/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html index 8f3bcff67..3baf4e886 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html @@ -35,16 +35,23 @@

      Module slack_bolt.middleware.authorization.async_single_ from slack_bolt.response import BoltResponse from slack_sdk.web.async_slack_response import AsyncSlackResponse from slack_sdk.errors import SlackApiError -from .async_internals import _build_error_response, _is_no_auth_required -from .internals import _to_authorize_result, _is_no_auth_test_call_required, _build_error_text +from .async_internals import _build_user_facing_error_response, _is_no_auth_required +from .internals import _to_authorize_result, _is_no_auth_test_call_required, _build_user_facing_authorize_error_message from ...authorization import AuthorizeResult class AsyncSingleTeamAuthorization(AsyncAuthorization): - def __init__(self, base_logger: Optional[Logger] = None): + def __init__( + self, + base_logger: Optional[Logger] = None, + user_facing_authorize_error_message: Optional[str] = None, + ): """Single-workspace authorization.""" self.auth_test_result: Optional[AsyncSlackResponse] = None self.logger = get_bolt_logger(AsyncSingleTeamAuthorization, base_logger=base_logger) + self.user_facing_authorize_error_message = ( + user_facing_authorize_error_message or _build_user_facing_authorize_error_message() + ) async def async_process( self, @@ -86,12 +93,12 @@

      Module slack_bolt.middleware.authorization.async_single_ # Just in case self.logger.error("auth.test API call result is unexpectedly None") if req.context.response_url is not None: - await req.context.respond(_build_error_text()) + await req.context.respond(self.user_facing_authorize_error_message) return BoltResponse(status=200, body="") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message) except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message)
      @@ -105,7 +112,7 @@

      Classes

      class AsyncSingleTeamAuthorization -(base_logger: Optional[logging.Logger] = None) +(base_logger: Optional[logging.Logger] = None, user_facing_authorize_error_message: Optional[str] = None)

      A middleware can process request data before other middleware and listener functions.

      @@ -115,10 +122,17 @@

      Classes

      Expand source code
      class AsyncSingleTeamAuthorization(AsyncAuthorization):
      -    def __init__(self, base_logger: Optional[Logger] = None):
      +    def __init__(
      +        self,
      +        base_logger: Optional[Logger] = None,
      +        user_facing_authorize_error_message: Optional[str] = None,
      +    ):
               """Single-workspace authorization."""
               self.auth_test_result: Optional[AsyncSlackResponse] = None
               self.logger = get_bolt_logger(AsyncSingleTeamAuthorization, base_logger=base_logger)
      +        self.user_facing_authorize_error_message = (
      +            user_facing_authorize_error_message or _build_user_facing_authorize_error_message()
      +        )
       
           async def async_process(
               self,
      @@ -160,12 +174,12 @@ 

      Classes

      # Just in case self.logger.error("auth.test API call result is unexpectedly None") if req.context.response_url is not None: - await req.context.respond(_build_error_text()) + await req.context.respond(self.user_facing_authorize_error_message) return BoltResponse(status=200, body="") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message) except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") - return _build_error_response()
      + return _build_user_facing_error_response(self.user_facing_authorize_error_message)

      Ancestors

        diff --git a/docs/api-docs/slack_bolt/middleware/authorization/index.html b/docs/api-docs/slack_bolt/middleware/authorization/index.html index 3a1f6e064..e7c618823 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/index.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/index.html @@ -115,7 +115,7 @@

        Inherited members

      class MultiTeamsAuthorization -(*, authorize: Authorize, base_logger: Optional[logging.Logger] = None, user_token_resolution: str = 'authed_user') +(*, authorize: Authorize, base_logger: Optional[logging.Logger] = None, user_token_resolution: str = 'authed_user', user_facing_authorize_error_message: Optional[str] = None)

      A middleware can process request data before other middleware and listener functions.

      @@ -128,6 +128,8 @@

      Args

      The base logger
      user_token_resolution
      "authed_user" or "actor"
      +
      user_facing_authorize_error_message
      +
      The user-facing error message when installation is not found

    @@ -143,6 +145,7 @@

    Args

    authorize: Authorize, base_logger: Optional[Logger] = None, user_token_resolution: str = "authed_user", + user_facing_authorize_error_message: Optional[str] = None, ): """Multi-workspace authorization. @@ -150,10 +153,14 @@

    Args

    authorize: The function to authorize incoming requests from Slack. base_logger: The base logger user_token_resolution: "authed_user" or "actor" + user_facing_authorize_error_message: The user-facing error message when installation is not found """ self.authorize = authorize self.logger = get_bolt_logger(MultiTeamsAuthorization, base_logger=base_logger) self.user_token_resolution = user_token_resolution + self.user_facing_authorize_error_message = ( + user_facing_authorize_error_message or _build_user_facing_authorize_error_message() + ) def process( self, @@ -211,13 +218,13 @@

    Args

    "the AuthorizeResult (returned value from authorize) for it was not found." ) if req.context.response_url is not None: - req.context.respond(_build_error_text()) + req.context.respond(self.user_facing_authorize_error_message) return BoltResponse(status=200, body="") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message) except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message)

    Ancestors

      @@ -247,7 +254,7 @@

      Inherited members

    class SingleTeamAuthorization -(*, auth_test_result: Optional[slack_sdk.web.slack_response.SlackResponse] = None, base_logger: Optional[logging.Logger] = None) +(*, auth_test_result: Optional[slack_sdk.web.slack_response.SlackResponse] = None, base_logger: Optional[logging.Logger] = None, user_facing_authorize_error_message: Optional[str] = None)

    A middleware can process request data before other middleware and listener functions.

    @@ -269,6 +276,7 @@

    Args

    *, auth_test_result: Optional[SlackResponse] = None, base_logger: Optional[Logger] = None, + user_facing_authorize_error_message: Optional[str] = None, ): """Single-workspace authorization. @@ -278,6 +286,9 @@

    Args

    """ self.auth_test_result = auth_test_result self.logger = get_bolt_logger(SingleTeamAuthorization, base_logger=base_logger) + self.user_facing_authorize_error_message = ( + user_facing_authorize_error_message or _build_user_facing_authorize_error_message() + ) def process( self, @@ -319,12 +330,12 @@

    Args

    # Just in case self.logger.error("auth.test API call result is unexpectedly None") if req.context.response_url is not None: - req.context.respond(_build_error_text()) + req.context.respond(self.user_facing_authorize_error_message) return BoltResponse(status=200, body="") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message) except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message)

    Ancestors

      diff --git a/docs/api-docs/slack_bolt/middleware/authorization/internals.html b/docs/api-docs/slack_bolt/middleware/authorization/internals.html index 4cee299f3..5c015391e 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/internals.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/internals.html @@ -71,18 +71,18 @@

      Module slack_bolt.middleware.authorization.internalsModule slack_bolt.middleware.authorization.multi_teams_a from slack_bolt.response import BoltResponse from .authorization import Authorization from .internals import ( - _build_error_response, + _build_user_facing_error_response, _is_no_auth_required, _is_no_auth_test_call_required, - _build_error_text, + _build_user_facing_authorize_error_message, ) from ...authorization import AuthorizeResult from ...authorization.authorize import Authorize @@ -55,6 +55,7 @@

      Module slack_bolt.middleware.authorization.multi_teams_a authorize: Authorize, base_logger: Optional[Logger] = None, user_token_resolution: str = "authed_user", + user_facing_authorize_error_message: Optional[str] = None, ): """Multi-workspace authorization. @@ -62,10 +63,14 @@

      Module slack_bolt.middleware.authorization.multi_teams_a authorize: The function to authorize incoming requests from Slack. base_logger: The base logger user_token_resolution: "authed_user" or "actor" + user_facing_authorize_error_message: The user-facing error message when installation is not found """ self.authorize = authorize self.logger = get_bolt_logger(MultiTeamsAuthorization, base_logger=base_logger) self.user_token_resolution = user_token_resolution + self.user_facing_authorize_error_message = ( + user_facing_authorize_error_message or _build_user_facing_authorize_error_message() + ) def process( self, @@ -123,13 +128,13 @@

      Module slack_bolt.middleware.authorization.multi_teams_a "the AuthorizeResult (returned value from authorize) for it was not found." ) if req.context.response_url is not None: - req.context.respond(_build_error_text()) + req.context.respond(self.user_facing_authorize_error_message) return BoltResponse(status=200, body="") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message) except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message)
      @@ -143,7 +148,7 @@

      Classes

      class MultiTeamsAuthorization -(*, authorize: Authorize, base_logger: Optional[logging.Logger] = None, user_token_resolution: str = 'authed_user') +(*, authorize: Authorize, base_logger: Optional[logging.Logger] = None, user_token_resolution: str = 'authed_user', user_facing_authorize_error_message: Optional[str] = None)

      A middleware can process request data before other middleware and listener functions.

      @@ -156,6 +161,8 @@

      Args

      The base logger
      user_token_resolution
      "authed_user" or "actor"
      +
      user_facing_authorize_error_message
      +
      The user-facing error message when installation is not found

    @@ -171,6 +178,7 @@

    Args

    authorize: Authorize, base_logger: Optional[Logger] = None, user_token_resolution: str = "authed_user", + user_facing_authorize_error_message: Optional[str] = None, ): """Multi-workspace authorization. @@ -178,10 +186,14 @@

    Args

    authorize: The function to authorize incoming requests from Slack. base_logger: The base logger user_token_resolution: "authed_user" or "actor" + user_facing_authorize_error_message: The user-facing error message when installation is not found """ self.authorize = authorize self.logger = get_bolt_logger(MultiTeamsAuthorization, base_logger=base_logger) self.user_token_resolution = user_token_resolution + self.user_facing_authorize_error_message = ( + user_facing_authorize_error_message or _build_user_facing_authorize_error_message() + ) def process( self, @@ -239,13 +251,13 @@

    Args

    "the AuthorizeResult (returned value from authorize) for it was not found." ) if req.context.response_url is not None: - req.context.respond(_build_error_text()) + req.context.respond(self.user_facing_authorize_error_message) return BoltResponse(status=200, body="") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message) except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") - return _build_error_response()
    + return _build_user_facing_error_response(self.user_facing_authorize_error_message)

    Ancestors

      diff --git a/docs/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html b/docs/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html index 9d023b2d6..038be83c4 100644 --- a/docs/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html +++ b/docs/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html @@ -36,11 +36,11 @@

      Module slack_bolt.middleware.authorization.single_team_a from slack_sdk.errors import SlackApiError from slack_sdk.web import SlackResponse from .internals import ( - _build_error_response, + _build_user_facing_error_response, _is_no_auth_required, _to_authorize_result, _is_no_auth_test_call_required, - _build_error_text, + _build_user_facing_authorize_error_message, ) from ...authorization import AuthorizeResult @@ -51,6 +51,7 @@

      Module slack_bolt.middleware.authorization.single_team_a *, auth_test_result: Optional[SlackResponse] = None, base_logger: Optional[Logger] = None, + user_facing_authorize_error_message: Optional[str] = None, ): """Single-workspace authorization. @@ -60,6 +61,9 @@

      Module slack_bolt.middleware.authorization.single_team_a """ self.auth_test_result = auth_test_result self.logger = get_bolt_logger(SingleTeamAuthorization, base_logger=base_logger) + self.user_facing_authorize_error_message = ( + user_facing_authorize_error_message or _build_user_facing_authorize_error_message() + ) def process( self, @@ -101,12 +105,12 @@

      Module slack_bolt.middleware.authorization.single_team_a # Just in case self.logger.error("auth.test API call result is unexpectedly None") if req.context.response_url is not None: - req.context.respond(_build_error_text()) + req.context.respond(self.user_facing_authorize_error_message) return BoltResponse(status=200, body="") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message) except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message)
      @@ -120,7 +124,7 @@

      Classes

      class SingleTeamAuthorization -(*, auth_test_result: Optional[slack_sdk.web.slack_response.SlackResponse] = None, base_logger: Optional[logging.Logger] = None) +(*, auth_test_result: Optional[slack_sdk.web.slack_response.SlackResponse] = None, base_logger: Optional[logging.Logger] = None, user_facing_authorize_error_message: Optional[str] = None)

      A middleware can process request data before other middleware and listener functions.

      @@ -142,6 +146,7 @@

      Args

      *, auth_test_result: Optional[SlackResponse] = None, base_logger: Optional[Logger] = None, + user_facing_authorize_error_message: Optional[str] = None, ): """Single-workspace authorization. @@ -151,6 +156,9 @@

      Args

      """ self.auth_test_result = auth_test_result self.logger = get_bolt_logger(SingleTeamAuthorization, base_logger=base_logger) + self.user_facing_authorize_error_message = ( + user_facing_authorize_error_message or _build_user_facing_authorize_error_message() + ) def process( self, @@ -192,12 +200,12 @@

      Args

      # Just in case self.logger.error("auth.test API call result is unexpectedly None") if req.context.response_url is not None: - req.context.respond(_build_error_text()) + req.context.respond(self.user_facing_authorize_error_message) return BoltResponse(status=200, body="") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message) except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") - return _build_error_response()
      + return _build_user_facing_error_response(self.user_facing_authorize_error_message)

      Ancestors

        diff --git a/docs/api-docs/slack_bolt/middleware/index.html b/docs/api-docs/slack_bolt/middleware/index.html index ed61cf1ba..f455d6c1f 100644 --- a/docs/api-docs/slack_bolt/middleware/index.html +++ b/docs/api-docs/slack_bolt/middleware/index.html @@ -463,7 +463,7 @@

        Returns

      class MultiTeamsAuthorization -(*, authorize: Authorize, base_logger: Optional[logging.Logger] = None, user_token_resolution: str = 'authed_user') +(*, authorize: Authorize, base_logger: Optional[logging.Logger] = None, user_token_resolution: str = 'authed_user', user_facing_authorize_error_message: Optional[str] = None)

      A middleware can process request data before other middleware and listener functions.

      @@ -476,6 +476,8 @@

      Args

      The base logger
      user_token_resolution
      "authed_user" or "actor"
      +
      user_facing_authorize_error_message
      +
      The user-facing error message when installation is not found
      @@ -491,6 +493,7 @@

      Args

      authorize: Authorize, base_logger: Optional[Logger] = None, user_token_resolution: str = "authed_user", + user_facing_authorize_error_message: Optional[str] = None, ): """Multi-workspace authorization. @@ -498,10 +501,14 @@

      Args

      authorize: The function to authorize incoming requests from Slack. base_logger: The base logger user_token_resolution: "authed_user" or "actor" + user_facing_authorize_error_message: The user-facing error message when installation is not found """ self.authorize = authorize self.logger = get_bolt_logger(MultiTeamsAuthorization, base_logger=base_logger) self.user_token_resolution = user_token_resolution + self.user_facing_authorize_error_message = ( + user_facing_authorize_error_message or _build_user_facing_authorize_error_message() + ) def process( self, @@ -559,13 +566,13 @@

      Args

      "the AuthorizeResult (returned value from authorize) for it was not found." ) if req.context.response_url is not None: - req.context.respond(_build_error_text()) + req.context.respond(self.user_facing_authorize_error_message) return BoltResponse(status=200, body="") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message) except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message)

      Ancestors

        @@ -684,7 +691,7 @@

        Inherited members

    class SingleTeamAuthorization -(*, auth_test_result: Optional[slack_sdk.web.slack_response.SlackResponse] = None, base_logger: Optional[logging.Logger] = None) +(*, auth_test_result: Optional[slack_sdk.web.slack_response.SlackResponse] = None, base_logger: Optional[logging.Logger] = None, user_facing_authorize_error_message: Optional[str] = None)

    A middleware can process request data before other middleware and listener functions.

    @@ -706,6 +713,7 @@

    Args

    *, auth_test_result: Optional[SlackResponse] = None, base_logger: Optional[Logger] = None, + user_facing_authorize_error_message: Optional[str] = None, ): """Single-workspace authorization. @@ -715,6 +723,9 @@

    Args

    """ self.auth_test_result = auth_test_result self.logger = get_bolt_logger(SingleTeamAuthorization, base_logger=base_logger) + self.user_facing_authorize_error_message = ( + user_facing_authorize_error_message or _build_user_facing_authorize_error_message() + ) def process( self, @@ -756,12 +767,12 @@

    Args

    # Just in case self.logger.error("auth.test API call result is unexpectedly None") if req.context.response_url is not None: - req.context.respond(_build_error_text()) + req.context.respond(self.user_facing_authorize_error_message) return BoltResponse(status=200, body="") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message) except SlackApiError as e: self.logger.error(f"Failed to authorize with the given token ({e})") - return _build_error_response() + return _build_user_facing_error_response(self.user_facing_authorize_error_message)

    Ancestors

      diff --git a/docs/api-docs/slack_bolt/middleware/ssl_check/async_ssl_check.html b/docs/api-docs/slack_bolt/middleware/ssl_check/async_ssl_check.html index 6624b8e10..8fe631fee 100644 --- a/docs/api-docs/slack_bolt/middleware/ssl_check/async_ssl_check.html +++ b/docs/api-docs/slack_bolt/middleware/ssl_check/async_ssl_check.html @@ -106,17 +106,6 @@

      Ancestors

    • Middleware
    • AsyncMiddleware
    -

    Class variables

    -
    -
    var logger : logging.Logger
    -
    -
    -
    -
    var verification_token : Optional[str]
    -
    -
    -
    -

    Inherited members

    • SslCheck: @@ -150,10 +139,6 @@

      Index

    • diff --git a/docs/api-docs/slack_bolt/version.html b/docs/api-docs/slack_bolt/version.html index 19a0d5d64..efd03ad4b 100644 --- a/docs/api-docs/slack_bolt/version.html +++ b/docs/api-docs/slack_bolt/version.html @@ -28,7 +28,7 @@

      Module slack_bolt.version

      Expand source code
      """Check the latest version at https://pypi.org/project/slack-bolt/"""
      -__version__ = "1.18.1"
      +__version__ = "1.19.0"
      diff --git a/docs/api-docs/slack_bolt/workflows/step/async_step.html b/docs/api-docs/slack_bolt/workflows/step/async_step.html index b9b685b68..7afd01e37 100644 --- a/docs/api-docs/slack_bolt/workflows/step/async_step.html +++ b/docs/api-docs/slack_bolt/workflows/step/async_step.html @@ -71,7 +71,12 @@

      Module slack_bolt.workflows.step.async_step

      app_name: Optional[str] = None, base_logger: Optional[Logger] = None, ): - """This builder is supposed to be used as decorator. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + This builder is supposed to be used as decorator. my_step = AsyncWorkflowStep.builder("my_step") @my_step.edit @@ -108,7 +113,13 @@

      Module slack_bolt.workflows.step.async_step

      middleware: Optional[Union[Callable, AsyncMiddleware]] = None, lazy: Optional[List[Callable[..., Awaitable[None]]]] = None, ): - """Registers a new edit listener with details. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new edit listener with details. + You can use this method as decorator as well. @my_step.edit @@ -155,7 +166,13 @@

      Module slack_bolt.workflows.step.async_step

      middleware: Optional[Union[Callable, AsyncMiddleware]] = None, lazy: Optional[List[Callable[..., Awaitable[None]]]] = None, ): - """Registers a new save listener with details. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new save listener with details. + You can use this method as decorator as well. @my_step.save @@ -202,7 +219,13 @@

      Module slack_bolt.workflows.step.async_step

      middleware: Optional[Union[Callable, AsyncMiddleware]] = None, lazy: Optional[List[Callable[..., Awaitable[None]]]] = None, ): - """Registers a new execute listener with details. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new execute listener with details. + You can use this method as decorator as well. @my_step.execute @@ -243,7 +266,12 @@

      Module slack_bolt.workflows.step.async_step

      return _inner def build(self, base_logger: Optional[Logger] = None) -> "AsyncWorkflowStep": - """Constructs a WorkflowStep object. This method may raise an exception + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. Returns: @@ -337,6 +365,10 @@

      Module slack_bolt.workflows.step.async_step

      base_logger: Optional[Logger] = None, ): """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Args: callback_id: The callback_id for this workflow step edit: Either a single function or a list of functions for opening a modal in the builder UI @@ -378,6 +410,11 @@

      Module slack_bolt.workflows.step.async_step

      callback_id: Union[str, Pattern], base_logger: Optional[Logger] = None, ) -> AsyncWorkflowStepBuilder: + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + """ return AsyncWorkflowStepBuilder(callback_id, base_logger=base_logger) @classmethod @@ -552,7 +589,10 @@

      Classes

      (*, callback_id: Union[str, Pattern], edit: Union[Callable[..., Awaitable[BoltResponse]], AsyncListener, Sequence[Callable]], save: Union[Callable[..., Awaitable[BoltResponse]], AsyncListener, Sequence[Callable]], execute: Union[Callable[..., Awaitable[BoltResponse]], AsyncListener, Sequence[Callable]], app_name: Optional[str] = None, base_logger: Optional[logging.Logger] = None)
      -

      Args

      +

      Deprecated

      +

      Steps from Apps for legacy workflows are now deprecated. +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

      +

      Args

      callback_id
      The callback_id for this workflow step
      @@ -595,6 +635,10 @@

      Classes

      base_logger: Optional[Logger] = None, ): """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Args: callback_id: The callback_id for this workflow step edit: Either a single function or a list of functions for opening a modal in the builder UI @@ -636,6 +680,11 @@

      Classes

      callback_id: Union[str, Pattern], base_logger: Optional[Logger] = None, ) -> AsyncWorkflowStepBuilder: + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + """ return AsyncWorkflowStepBuilder(callback_id, base_logger=base_logger) @classmethod @@ -781,7 +830,9 @@

      Static methods

      def builder(callback_id: Union[str, Pattern], base_logger: Optional[logging.Logger] = None) ‑> AsyncWorkflowStepBuilder
      -
      +

      Deprecated

      +

      Steps from Apps for legacy workflows are now deprecated. +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

      Expand source code @@ -792,6 +843,11 @@

      Static methods

      callback_id: Union[str, Pattern], base_logger: Optional[Logger] = None, ) -> AsyncWorkflowStepBuilder: + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + """ return AsyncWorkflowStepBuilder(callback_id, base_logger=base_logger)
      @@ -804,6 +860,9 @@

      Static methods

      Steps from Apps Refer to https://api.slack.com/workflows/steps for details.

      +

      Deprecated

      +

      Steps from Apps for legacy workflows are now deprecated. +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

      This builder is supposed to be used as decorator.

      my_step = AsyncWorkflowStep.builder("my_step")
       @my_step.edit
      @@ -850,7 +909,12 @@ 

      Args

      app_name: Optional[str] = None, base_logger: Optional[Logger] = None, ): - """This builder is supposed to be used as decorator. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + This builder is supposed to be used as decorator. my_step = AsyncWorkflowStep.builder("my_step") @my_step.edit @@ -887,7 +951,13 @@

      Args

      middleware: Optional[Union[Callable, AsyncMiddleware]] = None, lazy: Optional[List[Callable[..., Awaitable[None]]]] = None, ): - """Registers a new edit listener with details. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new edit listener with details. + You can use this method as decorator as well. @my_step.edit @@ -934,7 +1004,13 @@

      Args

      middleware: Optional[Union[Callable, AsyncMiddleware]] = None, lazy: Optional[List[Callable[..., Awaitable[None]]]] = None, ): - """Registers a new save listener with details. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new save listener with details. + You can use this method as decorator as well. @my_step.save @@ -981,7 +1057,13 @@

      Args

      middleware: Optional[Union[Callable, AsyncMiddleware]] = None, lazy: Optional[List[Callable[..., Awaitable[None]]]] = None, ): - """Registers a new execute listener with details. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new execute listener with details. + You can use this method as decorator as well. @my_step.execute @@ -1022,7 +1104,12 @@

      Args

      return _inner def build(self, base_logger: Optional[Logger] = None) -> "AsyncWorkflowStep": - """Constructs a WorkflowStep object. This method may raise an exception + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. Returns: @@ -1161,7 +1248,10 @@

      Methods

      def build(self, base_logger: Optional[logging.Logger] = None) ‑> AsyncWorkflowStep
      -

      Constructs a WorkflowStep object. This method may raise an exception +

      Deprecated

      +

      Steps from Apps for legacy workflows are now deprecated. +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

      +

      Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object.

      Returns

      An AsyncWorkflowStep object

      @@ -1170,7 +1260,12 @@

      Returns

      Expand source code
      def build(self, base_logger: Optional[Logger] = None) -> "AsyncWorkflowStep":
      -    """Constructs a WorkflowStep object. This method may raise an exception
      +    """
      +    Deprecated:
      +        Steps from Apps for legacy workflows are now deprecated.
      +        Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
      +
      +    Constructs a WorkflowStep object. This method may raise an exception
           if the builder doesn't have enough configurations to build the object.
       
           Returns:
      @@ -1197,8 +1292,11 @@ 

      Returns

      def edit(self, *args, matchers: Union[Callable[..., Awaitable[bool]], AsyncListenerMatcher, ForwardRef(None)] = None, middleware: Union[Callable, AsyncMiddleware, ForwardRef(None)] = None, lazy: Optional[List[Callable[..., Awaitable[None]]]] = None)
      -

      Registers a new edit listener with details. -You can use this method as decorator as well.

      +

      Deprecated

      +

      Steps from Apps for legacy workflows are now deprecated. +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

      +

      Registers a new edit listener with details.

      +

      You can use this method as decorator as well.

      @my_step.edit
       def edit_my_step(ack, configure):
           pass
      @@ -1233,7 +1331,13 @@ 

      Args

      middleware: Optional[Union[Callable, AsyncMiddleware]] = None, lazy: Optional[List[Callable[..., Awaitable[None]]]] = None, ): - """Registers a new edit listener with details. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new edit listener with details. + You can use this method as decorator as well. @my_step.edit @@ -1278,8 +1382,11 @@

      Args

      def execute(self, *args, matchers: Union[Callable[..., Awaitable[bool]], AsyncListenerMatcher, ForwardRef(None)] = None, middleware: Union[Callable, AsyncMiddleware, ForwardRef(None)] = None, lazy: Optional[List[Callable[..., Awaitable[None]]]] = None)
      -

      Registers a new execute listener with details. -You can use this method as decorator as well.

      +

      Deprecated

      +

      Steps from Apps for legacy workflows are now deprecated. +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

      +

      Registers a new execute listener with details.

      +

      You can use this method as decorator as well.

      @my_step.execute
       def execute_my_step(step, complete, fail):
           pass
      @@ -1314,7 +1421,13 @@ 

      Args

      middleware: Optional[Union[Callable, AsyncMiddleware]] = None, lazy: Optional[List[Callable[..., Awaitable[None]]]] = None, ): - """Registers a new execute listener with details. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new execute listener with details. + You can use this method as decorator as well. @my_step.execute @@ -1359,8 +1472,11 @@

      Args

      def save(self, *args, matchers: Union[Callable[..., Awaitable[bool]], AsyncListenerMatcher, ForwardRef(None)] = None, middleware: Union[Callable, AsyncMiddleware, ForwardRef(None)] = None, lazy: Optional[List[Callable[..., Awaitable[None]]]] = None)
      -

      Registers a new save listener with details. -You can use this method as decorator as well.

      +

      Deprecated

      +

      Steps from Apps for legacy workflows are now deprecated. +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

      +

      Registers a new save listener with details.

      +

      You can use this method as decorator as well.

      @my_step.save
       def save_my_step(ack, step, update):
           pass
      @@ -1395,7 +1511,13 @@ 

      Args

      middleware: Optional[Union[Callable, AsyncMiddleware]] = None, lazy: Optional[List[Callable[..., Awaitable[None]]]] = None, ): - """Registers a new save listener with details. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new save listener with details. + You can use this method as decorator as well. @my_step.save diff --git a/docs/api-docs/slack_bolt/workflows/step/index.html b/docs/api-docs/slack_bolt/workflows/step/index.html index 1e8f214b1..80c93de68 100644 --- a/docs/api-docs/slack_bolt/workflows/step/index.html +++ b/docs/api-docs/slack_bolt/workflows/step/index.html @@ -390,7 +390,10 @@

      Classes

      (*, callback_id: Union[str, Pattern], edit: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]], save: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]], execute: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]], app_name: Optional[str] = None, base_logger: Optional[logging.Logger] = None)
      -

      Args

      +

      Deprecated

      +

      Steps from Apps for legacy workflows are now deprecated. +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

      +

      Args

      callback_id
      The callback_id for this workflow step
      @@ -433,6 +436,10 @@

      Classes

      base_logger: Optional[Logger] = None, ): """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Args: callback_id: The callback_id for this workflow step edit: Either a single function or a list of functions for opening a modal in the builder UI @@ -470,6 +477,11 @@

      Classes

      @classmethod def builder(cls, callback_id: Union[str, Pattern], base_logger: Optional[Logger] = None) -> WorkflowStepBuilder: + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + """ return WorkflowStepBuilder( callback_id, base_logger=base_logger, @@ -646,13 +658,20 @@

      Static methods

      def builder(callback_id: Union[str, Pattern], base_logger: Optional[logging.Logger] = None) ‑> WorkflowStepBuilder
      -
      +

      Deprecated

      +

      Steps from Apps for legacy workflows are now deprecated. +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

      Expand source code
      @classmethod
       def builder(cls, callback_id: Union[str, Pattern], base_logger: Optional[Logger] = None) -> WorkflowStepBuilder:
      +    """
      +    Deprecated:
      +        Steps from Apps for legacy workflows are now deprecated.
      +        Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
      +    """
           return WorkflowStepBuilder(
               callback_id,
               base_logger=base_logger,
      diff --git a/docs/api-docs/slack_bolt/workflows/step/step.html b/docs/api-docs/slack_bolt/workflows/step/step.html
      index 190a78663..8282e3d30 100644
      --- a/docs/api-docs/slack_bolt/workflows/step/step.html
      +++ b/docs/api-docs/slack_bolt/workflows/step/step.html
      @@ -66,7 +66,12 @@ 

      Module slack_bolt.workflows.step.step

      app_name: Optional[str] = None, base_logger: Optional[Logger] = None, ): - """This builder is supposed to be used as decorator. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + This builder is supposed to be used as decorator. my_step = WorkflowStep.builder("my_step") @my_step.edit @@ -103,7 +108,13 @@

      Module slack_bolt.workflows.step.step

      middleware: Optional[Union[Callable, Middleware]] = None, lazy: Optional[List[Callable[..., None]]] = None, ): - """Registers a new edit listener with details. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new edit listener with details. + You can use this method as decorator as well. @my_step.edit @@ -151,7 +162,13 @@

      Module slack_bolt.workflows.step.step

      middleware: Optional[Union[Callable, Middleware]] = None, lazy: Optional[List[Callable[..., None]]] = None, ): - """Registers a new save listener with details. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new save listener with details. + You can use this method as decorator as well. @my_step.save @@ -198,7 +215,13 @@

      Module slack_bolt.workflows.step.step

      middleware: Optional[Union[Callable, Middleware]] = None, lazy: Optional[List[Callable[..., None]]] = None, ): - """Registers a new execute listener with details. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new execute listener with details. + You can use this method as decorator as well. @my_step.execute @@ -239,7 +262,12 @@

      Module slack_bolt.workflows.step.step

      return _inner def build(self, base_logger: Optional[Logger] = None) -> "WorkflowStep": - """Constructs a WorkflowStep object. This method may raise an exception + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. Returns: @@ -348,6 +376,10 @@

      Module slack_bolt.workflows.step.step

      base_logger: Optional[Logger] = None, ): """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Args: callback_id: The callback_id for this workflow step edit: Either a single function or a list of functions for opening a modal in the builder UI @@ -385,6 +417,11 @@

      Module slack_bolt.workflows.step.step

      @classmethod def builder(cls, callback_id: Union[str, Pattern], base_logger: Optional[Logger] = None) -> WorkflowStepBuilder: + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + """ return WorkflowStepBuilder( callback_id, base_logger=base_logger, @@ -571,7 +608,10 @@

      Classes

      (*, callback_id: Union[str, Pattern], edit: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]], save: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]], execute: Union[Callable[..., Optional[BoltResponse]], Listener, Sequence[Callable]], app_name: Optional[str] = None, base_logger: Optional[logging.Logger] = None)
      -

      Args

      +

      Deprecated

      +

      Steps from Apps for legacy workflows are now deprecated. +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

      +

      Args

      callback_id
      The callback_id for this workflow step
      @@ -614,6 +654,10 @@

      Classes

      base_logger: Optional[Logger] = None, ): """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Args: callback_id: The callback_id for this workflow step edit: Either a single function or a list of functions for opening a modal in the builder UI @@ -651,6 +695,11 @@

      Classes

      @classmethod def builder(cls, callback_id: Union[str, Pattern], base_logger: Optional[Logger] = None) -> WorkflowStepBuilder: + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + """ return WorkflowStepBuilder( callback_id, base_logger=base_logger, @@ -827,13 +876,20 @@

      Static methods

      def builder(callback_id: Union[str, Pattern], base_logger: Optional[logging.Logger] = None) ‑> WorkflowStepBuilder
      -
      +

      Deprecated

      +

      Steps from Apps for legacy workflows are now deprecated. +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

      Expand source code
      @classmethod
       def builder(cls, callback_id: Union[str, Pattern], base_logger: Optional[Logger] = None) -> WorkflowStepBuilder:
      +    """
      +    Deprecated:
      +        Steps from Apps for legacy workflows are now deprecated.
      +        Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
      +    """
           return WorkflowStepBuilder(
               callback_id,
               base_logger=base_logger,
      @@ -849,6 +905,9 @@ 

      Static methods

      Steps from Apps Refer to https://api.slack.com/workflows/steps for details.

      +

      Deprecated

      +

      Steps from Apps for legacy workflows are now deprecated. +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

      This builder is supposed to be used as decorator.

      my_step = WorkflowStep.builder("my_step")
       @my_step.edit
      @@ -895,7 +954,12 @@ 

      Args

      app_name: Optional[str] = None, base_logger: Optional[Logger] = None, ): - """This builder is supposed to be used as decorator. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + This builder is supposed to be used as decorator. my_step = WorkflowStep.builder("my_step") @my_step.edit @@ -932,7 +996,13 @@

      Args

      middleware: Optional[Union[Callable, Middleware]] = None, lazy: Optional[List[Callable[..., None]]] = None, ): - """Registers a new edit listener with details. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new edit listener with details. + You can use this method as decorator as well. @my_step.edit @@ -980,7 +1050,13 @@

      Args

      middleware: Optional[Union[Callable, Middleware]] = None, lazy: Optional[List[Callable[..., None]]] = None, ): - """Registers a new save listener with details. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new save listener with details. + You can use this method as decorator as well. @my_step.save @@ -1027,7 +1103,13 @@

      Args

      middleware: Optional[Union[Callable, Middleware]] = None, lazy: Optional[List[Callable[..., None]]] = None, ): - """Registers a new execute listener with details. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new execute listener with details. + You can use this method as decorator as well. @my_step.execute @@ -1068,7 +1150,12 @@

      Args

      return _inner def build(self, base_logger: Optional[Logger] = None) -> "WorkflowStep": - """Constructs a WorkflowStep object. This method may raise an exception + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. Returns: @@ -1237,7 +1324,10 @@

      Methods

      def build(self, base_logger: Optional[logging.Logger] = None) ‑> WorkflowStep
      -

      Constructs a WorkflowStep object. This method may raise an exception +

      Deprecated

      +

      Steps from Apps for legacy workflows are now deprecated. +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

      +

      Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object.

      Returns

      WorkflowStep object

      @@ -1246,7 +1336,12 @@

      Returns

      Expand source code
      def build(self, base_logger: Optional[Logger] = None) -> "WorkflowStep":
      -    """Constructs a WorkflowStep object. This method may raise an exception
      +    """
      +    Deprecated:
      +        Steps from Apps for legacy workflows are now deprecated.
      +        Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
      +
      +    Constructs a WorkflowStep object. This method may raise an exception
           if the builder doesn't have enough configurations to build the object.
       
           Returns:
      @@ -1273,8 +1368,11 @@ 

      Returns

      def edit(self, *args, matchers: Union[Callable[..., bool], ListenerMatcher, ForwardRef(None)] = None, middleware: Union[Callable, Middleware, ForwardRef(None)] = None, lazy: Optional[List[Callable[..., None]]] = None)
      -

      Registers a new edit listener with details. -You can use this method as decorator as well.

      +

      Deprecated

      +

      Steps from Apps for legacy workflows are now deprecated. +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

      +

      Registers a new edit listener with details.

      +

      You can use this method as decorator as well.

      @my_step.edit
       def edit_my_step(ack, configure):
           pass
      @@ -1309,7 +1407,13 @@ 

      Args

      middleware: Optional[Union[Callable, Middleware]] = None, lazy: Optional[List[Callable[..., None]]] = None, ): - """Registers a new edit listener with details. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new edit listener with details. + You can use this method as decorator as well. @my_step.edit @@ -1355,8 +1459,11 @@

      Args

      def execute(self, *args, matchers: Union[Callable[..., bool], ListenerMatcher, ForwardRef(None)] = None, middleware: Union[Callable, Middleware, ForwardRef(None)] = None, lazy: Optional[List[Callable[..., None]]] = None)
      -

      Registers a new execute listener with details. -You can use this method as decorator as well.

      +

      Deprecated

      +

      Steps from Apps for legacy workflows are now deprecated. +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

      +

      Registers a new execute listener with details.

      +

      You can use this method as decorator as well.

      @my_step.execute
       def execute_my_step(step, complete, fail):
           pass
      @@ -1391,7 +1498,13 @@ 

      Args

      middleware: Optional[Union[Callable, Middleware]] = None, lazy: Optional[List[Callable[..., None]]] = None, ): - """Registers a new execute listener with details. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new execute listener with details. + You can use this method as decorator as well. @my_step.execute @@ -1436,8 +1549,11 @@

      Args

      def save(self, *args, matchers: Union[Callable[..., bool], ListenerMatcher, ForwardRef(None)] = None, middleware: Union[Callable, Middleware, ForwardRef(None)] = None, lazy: Optional[List[Callable[..., None]]] = None)
      -

      Registers a new save listener with details. -You can use this method as decorator as well.

      +

      Deprecated

      +

      Steps from Apps for legacy workflows are now deprecated. +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

      +

      Registers a new save listener with details.

      +

      You can use this method as decorator as well.

      @my_step.save
       def save_my_step(ack, step, update):
           pass
      @@ -1472,7 +1588,13 @@ 

      Args

      middleware: Optional[Union[Callable, Middleware]] = None, lazy: Optional[List[Callable[..., None]]] = None, ): - """Registers a new save listener with details. + """ + Deprecated: + Steps from Apps for legacy workflows are now deprecated. + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + + Registers a new save listener with details. + You can use this method as decorator as well. @my_step.save From ce2778076c0b0f7a961a7ad8cdeb80bdf7d5130b Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Tue, 25 Jun 2024 10:35:28 +0900 Subject: [PATCH 490/719] Fix #1099 by locking pytype version (#1100) --- scripts/install_all_and_run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install_all_and_run_tests.sh b/scripts/install_all_and_run_tests.sh index 831acc80c..1271f1761 100755 --- a/scripts/install_all_and_run_tests.sh +++ b/scripts/install_all_and_run_tests.sh @@ -36,6 +36,6 @@ else pip install -U pip click && \ black slack_bolt/ tests/ && \ pytest && \ - pip install -U pytype && \ + pip install "pytype==2022.12.15" && \ pytype slack_bolt/ fi From e2505bffe99b8179f49b36ee0f1886dcdd7cb7fa Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 3 Jul 2024 10:09:33 +0900 Subject: [PATCH 491/719] Add bot|user_scopes to context.authorize_result set by SingleTeamAuthorization (#1104) --- .../middleware/authorization/internals.py | 3 +++ tests/mock_web_api_server.py | 2 ++ .../test_single_team_authorization.py | 24 +++++++++++++++++++ .../test_single_team_authorization.py | 16 +++++++++++++ 4 files changed, 45 insertions(+) diff --git a/slack_bolt/middleware/authorization/internals.py b/slack_bolt/middleware/authorization/internals.py index 814101953..29d65e3b9 100644 --- a/slack_bolt/middleware/authorization/internals.py +++ b/slack_bolt/middleware/authorization/internals.py @@ -68,6 +68,7 @@ def _to_authorize_result( # type: ignore request_user_id: Optional[str], ) -> AuthorizeResult: user_id = auth_test_result.get("user_id") + oauth_scopes: Optional[str] = auth_test_result.headers.get("x-oauth-scopes") return AuthorizeResult( enterprise_id=auth_test_result.get("enterprise_id"), team_id=auth_test_result.get("team_id"), @@ -76,4 +77,6 @@ def _to_authorize_result( # type: ignore bot_token=token if _is_bot_token(token) else None, user_id=request_user_id or (user_id if not _is_bot_token(token) else None), user_token=token if not _is_bot_token(token) else None, + bot_scopes=oauth_scopes if _is_bot_token(token) else None, + user_scopes=None if _is_bot_token(token) else oauth_scopes, ) diff --git a/tests/mock_web_api_server.py b/tests/mock_web_api_server.py index ce42ddb1f..57fc85b26 100644 --- a/tests/mock_web_api_server.py +++ b/tests/mock_web_api_server.py @@ -149,6 +149,7 @@ def _handle(self): if self.is_valid_user_token(): if path == "/auth.test": self.send_response(200) + self.send_header("x-oauth-scopes", "chat:write,search:read") self.set_common_headers(len(USER_AUTH_TEST_RESPONSE)) self.wfile.write(USER_AUTH_TEST_RESPONSE.encode("utf-8")) return @@ -156,6 +157,7 @@ def _handle(self): if self.is_valid_token(): if path == "/auth.test": self.send_response(200) + self.send_header("x-oauth-scopes", "chat:write,commands") self.set_common_headers(len(BOT_AUTH_TEST_RESPONSE)) self.wfile.write(BOT_AUTH_TEST_RESPONSE.encode("utf-8")) return diff --git a/tests/slack_bolt/middleware/authorization/test_single_team_authorization.py b/tests/slack_bolt/middleware/authorization/test_single_team_authorization.py index 4cf5d9600..7e3a0c11d 100644 --- a/tests/slack_bolt/middleware/authorization/test_single_team_authorization.py +++ b/tests/slack_bolt/middleware/authorization/test_single_team_authorization.py @@ -1,4 +1,5 @@ from slack_sdk import WebClient +from slack_sdk.web import SlackResponse from slack_bolt.middleware import SingleTeamAuthorization from slack_bolt.middleware.authorization.internals import _build_user_facing_authorize_error_message @@ -34,6 +35,29 @@ def test_success_pattern(self): assert resp.status == 200 assert resp.body == "" + def test_success_pattern_with_bot_scopes(self): + client = WebClient(base_url=self.mock_api_server_base_url, token="xoxb-valid") + auth_test_result: SlackResponse = SlackResponse( + client=client, + http_verb="POST", + api_url="https://slack.com/api/auth.test", + req_args={}, + data={}, + headers={"x-oauth-scopes": "chat:write,commands"}, + status_code=200, + ) + authorization = SingleTeamAuthorization(auth_test_result=auth_test_result) + req = BoltRequest(body="payload={}", headers={}) + req.context["client"] = client + resp = BoltResponse(status=404) + + resp = authorization.process(req=req, resp=resp, next=next) + + assert resp.status == 200 + assert resp.body == "" + assert req.context.authorize_result.bot_scopes == ["chat:write", "commands"] + assert req.context.authorize_result.user_scopes is None + def test_failure_pattern(self): authorization = SingleTeamAuthorization(auth_test_result={}) req = BoltRequest(body="payload={}", headers={}) diff --git a/tests/slack_bolt_async/middleware/authorization/test_single_team_authorization.py b/tests/slack_bolt_async/middleware/authorization/test_single_team_authorization.py index ef1baded5..05a18eeaf 100644 --- a/tests/slack_bolt_async/middleware/authorization/test_single_team_authorization.py +++ b/tests/slack_bolt_async/middleware/authorization/test_single_team_authorization.py @@ -1,6 +1,7 @@ import asyncio import pytest +from slack.web.async_slack_response import AsyncSlackResponse from slack_sdk.web.async_client import AsyncWebClient from slack_bolt.middleware.authorization.async_single_team_authorization import ( @@ -47,6 +48,21 @@ async def test_success_pattern(self): assert resp.status == 200 assert resp.body == "" + @pytest.mark.asyncio + async def test_success_pattern_with_bot_scopes(self): + client = AsyncWebClient(base_url=self.mock_api_server_base_url, token="xoxb-valid") + authorization = AsyncSingleTeamAuthorization() + req = AsyncBoltRequest(body="payload={}", headers={}) + req.context["client"] = client + resp = BoltResponse(status=404) + + resp = await authorization.async_process(req=req, resp=resp, next=next) + + assert resp.status == 200 + assert resp.body == "" + assert req.context.authorize_result.bot_scopes == ["chat:write", "commands"] + assert req.context.authorize_result.user_scopes is None + @pytest.mark.asyncio async def test_failure_pattern(self): authorization = AsyncSingleTeamAuthorization() From 7b19d3dccfb03f9bf4ebb62229053e6bc5c3ab65 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 3 Jul 2024 10:12:52 +0900 Subject: [PATCH 492/719] version 1.19.1 --- .../slack_bolt/adapter/aiohttp/index.html | 121 +- .../adapter/asgi/aiohttp/index.html | 86 +- .../adapter/asgi/async_handler.html | 36 +- .../slack_bolt/adapter/asgi/base_handler.html | 128 +- .../adapter/asgi/builtin/index.html | 99 +- .../slack_bolt/adapter/asgi/http_request.html | 91 +- .../adapter/asgi/http_response.html | 90 +- .../slack_bolt/adapter/asgi/index.html | 51 +- .../slack_bolt/adapter/asgi/utils.html | 40 +- .../adapter/aws_lambda/chalice_handler.html | 234 +- .../chalice_lazy_listener_runner.html | 82 +- .../adapter/aws_lambda/handler.html | 244 +- .../slack_bolt/adapter/aws_lambda/index.html | 96 +- .../adapter/aws_lambda/internals.html | 42 +- .../aws_lambda/lambda_s3_oauth_flow.html | 154 +- .../aws_lambda/lazy_listener_runner.html | 73 +- .../aws_lambda/local_lambda_client.html | 76 +- .../slack_bolt/adapter/bottle/handler.html | 130 +- .../slack_bolt/adapter/bottle/index.html | 62 +- .../slack_bolt/adapter/cherrypy/handler.html | 195 +- .../slack_bolt/adapter/cherrypy/index.html | 64 +- .../slack_bolt/adapter/django/handler.html | 296 +- .../slack_bolt/adapter/django/index.html | 58 +- .../adapter/falcon/async_resource.html | 137 +- .../slack_bolt/adapter/falcon/index.html | 67 +- .../slack_bolt/adapter/falcon/resource.html | 135 +- .../adapter/fastapi/async_handler.html | 66 +- .../slack_bolt/adapter/fastapi/index.html | 63 +- .../slack_bolt/adapter/flask/handler.html | 124 +- .../slack_bolt/adapter/flask/index.html | 58 +- .../google_cloud_functions/handler.html | 105 +- .../adapter/google_cloud_functions/index.html | 57 +- docs/api-docs/slack_bolt/adapter/index.html | 35 +- .../slack_bolt/adapter/pyramid/handler.html | 169 +- .../slack_bolt/adapter/pyramid/index.html | 61 +- .../adapter/sanic/async_handler.html | 156 +- .../slack_bolt/adapter/sanic/index.html | 62 +- .../adapter/socket_mode/aiohttp/index.html | 124 +- .../socket_mode/async_base_handler.html | 135 +- .../adapter/socket_mode/async_handler.html | 39 +- .../adapter/socket_mode/async_internals.html | 117 +- .../adapter/socket_mode/base_handler.html | 149 +- .../adapter/socket_mode/builtin/index.html | 109 +- .../slack_bolt/adapter/socket_mode/index.html | 47 +- .../adapter/socket_mode/internals.html | 113 +- .../socket_mode/websocket_client/index.html | 103 +- .../adapter/socket_mode/websockets/index.html | 123 +- .../adapter/starlette/async_handler.html | 178 +- .../slack_bolt/adapter/starlette/handler.html | 169 +- .../slack_bolt/adapter/starlette/index.html | 63 +- .../adapter/tornado/async_handler.html | 128 +- .../slack_bolt/adapter/tornado/handler.html | 174 +- .../slack_bolt/adapter/tornado/index.html | 80 +- .../slack_bolt/adapter/wsgi/handler.html | 147 +- .../slack_bolt/adapter/wsgi/http_request.html | 105 +- .../adapter/wsgi/http_response.html | 89 +- .../slack_bolt/adapter/wsgi/index.html | 65 +- .../slack_bolt/adapter/wsgi/internals.html | 34 +- docs/api-docs/slack_bolt/app/app.html | 2402 +---------------- docs/api-docs/slack_bolt/app/async_app.html | 2345 +--------------- .../api-docs/slack_bolt/app/async_server.html | 165 +- docs/api-docs/slack_bolt/app/index.html | 929 +------ docs/api-docs/slack_bolt/async_app.html | 1130 +------- .../authorization/async_authorize.html | 412 +-- .../authorization/async_authorize_args.html | 71 +- .../slack_bolt/authorization/authorize.html | 409 +-- .../authorization/authorize_args.html | 71 +- .../authorization/authorize_result.html | 185 +- .../slack_bolt/authorization/index.html | 84 +- docs/api-docs/slack_bolt/context/ack/ack.html | 79 +- .../slack_bolt/context/ack/async_ack.html | 79 +- .../slack_bolt/context/ack/index.html | 39 +- .../slack_bolt/context/ack/internals.html | 134 +- .../slack_bolt/context/async_context.html | 186 +- .../slack_bolt/context/base_context.html | 228 +- docs/api-docs/slack_bolt/context/context.html | 189 +- docs/api-docs/slack_bolt/context/index.html | 76 +- .../context/respond/async_respond.html | 101 +- .../slack_bolt/context/respond/index.html | 39 +- .../slack_bolt/context/respond/internals.html | 73 +- .../slack_bolt/context/respond/respond.html | 101 +- .../slack_bolt/context/say/async_say.html | 109 +- .../slack_bolt/context/say/index.html | 39 +- .../slack_bolt/context/say/internals.html | 38 +- docs/api-docs/slack_bolt/context/say/say.html | 109 +- docs/api-docs/slack_bolt/error/index.html | 61 +- docs/api-docs/slack_bolt/index.html | 1077 +------- .../slack_bolt/kwargs_injection/args.html | 170 +- .../kwargs_injection/async_args.html | 166 +- .../kwargs_injection/async_utils.html | 229 +- .../slack_bolt/kwargs_injection/index.html | 137 +- .../slack_bolt/kwargs_injection/utils.html | 229 +- .../lazy_listener/async_internals.html | 93 +- .../lazy_listener/async_runner.html | 99 +- .../lazy_listener/asyncio_runner.html | 59 +- .../slack_bolt/lazy_listener/index.html | 95 +- .../slack_bolt/lazy_listener/internals.html | 93 +- .../slack_bolt/lazy_listener/runner.html | 97 +- .../lazy_listener/thread_runner.html | 61 +- .../slack_bolt/listener/async_builtins.html | 98 +- .../slack_bolt/listener/async_listener.html | 252 +- .../async_listener_completion_handler.html | 108 +- .../async_listener_error_handler.html | 120 +- .../async_listener_start_handler.html | 108 +- .../slack_bolt/listener/asyncio_runner.html | 343 +-- .../slack_bolt/listener/builtins.html | 96 +- .../slack_bolt/listener/custom_listener.html | 91 +- docs/api-docs/slack_bolt/listener/index.html | 118 +- .../slack_bolt/listener/listener.html | 166 +- .../listener/listener_completion_handler.html | 108 +- .../listener/listener_error_handler.html | 120 +- .../listener/listener_start_handler.html | 116 +- .../slack_bolt/listener/thread_runner.html | 368 +-- .../listener_matcher/async_builtins.html | 52 +- .../async_listener_matcher.html | 125 +- .../slack_bolt/listener_matcher/builtins.html | 1007 +------ .../custom_listener_matcher.html | 66 +- .../slack_bolt/listener_matcher/index.html | 69 +- .../listener_matcher/listener_matcher.html | 69 +- docs/api-docs/slack_bolt/logger/index.html | 108 +- docs/api-docs/slack_bolt/logger/messages.html | 717 +---- .../slack_bolt/middleware/async_builtins.html | 67 +- .../middleware/async_custom_middleware.html | 91 +- .../middleware/async_middleware.html | 127 +- .../async_middleware_error_handler.html | 120 +- .../authorization/async_authorization.html | 40 +- .../authorization/async_internals.html | 55 +- .../async_multi_teams_authorization.html | 139 +- .../async_single_team_authorization.html | 106 +- .../authorization/authorization.html | 38 +- .../middleware/authorization/index.html | 43 +- .../middleware/authorization/internals.html | 112 +- .../multi_teams_authorization.html | 142 +- .../single_team_authorization.html | 118 +- .../middleware/custom_middleware.html | 80 +- .../async_ignoring_self_events.html | 57 +- .../ignoring_self_events.html | 93 +- .../ignoring_self_events/index.html | 38 +- .../api-docs/slack_bolt/middleware/index.html | 117 +- .../async_message_listener_matches.html | 69 +- .../message_listener_matches/index.html | 38 +- .../message_listener_matches.html | 69 +- .../slack_bolt/middleware/middleware.html | 127 +- .../middleware/middleware_error_handler.html | 120 +- .../async_request_verification.html | 69 +- .../request_verification/index.html | 38 +- .../request_verification.html | 94 +- .../middleware/ssl_check/async_ssl_check.html | 73 +- .../middleware/ssl_check/index.html | 38 +- .../middleware/ssl_check/ssl_check.html | 95 +- .../async_url_verification.html | 58 +- .../middleware/url_verification/index.html | 38 +- .../url_verification/url_verification.html | 77 +- .../oauth/async_callback_options.html | 147 +- .../slack_bolt/oauth/async_internals.html | 117 +- .../slack_bolt/oauth/async_oauth_flow.html | 702 +---- .../oauth/async_oauth_settings.html | 223 +- .../slack_bolt/oauth/callback_options.html | 151 +- docs/api-docs/slack_bolt/oauth/index.html | 349 +-- docs/api-docs/slack_bolt/oauth/internals.html | 237 +- .../api-docs/slack_bolt/oauth/oauth_flow.html | 703 +---- .../slack_bolt/oauth/oauth_settings.html | 216 +- .../slack_bolt/request/async_internals.html | 130 +- .../slack_bolt/request/async_request.html | 130 +- docs/api-docs/slack_bolt/request/index.html | 58 +- .../slack_bolt/request/internals.html | 629 +---- .../slack_bolt/request/payload_utils.html | 439 +-- docs/api-docs/slack_bolt/request/request.html | 129 +- docs/api-docs/slack_bolt/response/index.html | 68 +- .../slack_bolt/response/response.html | 114 +- .../api-docs/slack_bolt/util/async_utils.html | 58 +- docs/api-docs/slack_bolt/util/index.html | 34 +- docs/api-docs/slack_bolt/util/utils.html | 223 +- docs/api-docs/slack_bolt/version.html | 35 +- docs/api-docs/slack_bolt/workflows/index.html | 43 +- .../slack_bolt/workflows/step/async_step.html | 881 +----- .../workflows/step/async_step_middleware.html | 90 +- .../slack_bolt/workflows/step/index.html | 120 +- .../slack_bolt/workflows/step/internals.html | 43 +- .../slack_bolt/workflows/step/step.html | 929 +------ .../workflows/step/step_middleware.html | 93 +- .../step/utilities/async_complete.html | 69 +- .../step/utilities/async_configure.html | 88 +- .../workflows/step/utilities/async_fail.html | 70 +- .../step/utilities/async_update.html | 85 +- .../workflows/step/utilities/complete.html | 69 +- .../workflows/step/utilities/configure.html | 85 +- .../workflows/step/utilities/fail.html | 70 +- .../workflows/step/utilities/index.html | 52 +- .../workflows/step/utilities/update.html | 85 +- slack_bolt/version.py | 2 +- 191 files changed, 3108 insertions(+), 30291 deletions(-) diff --git a/docs/api-docs/slack_bolt/adapter/aiohttp/index.html b/docs/api-docs/slack_bolt/adapter/aiohttp/index.html index 693657840..54bee5e0f 100644 --- a/docs/api-docs/slack_bolt/adapter/aiohttp/index.html +++ b/docs/api-docs/slack_bolt/adapter/aiohttp/index.html @@ -2,18 +2,21 @@ - - + + slack_bolt.adapter.aiohttp API documentation - - - - - - + + + + + + - - + +
      @@ -22,58 +25,6 @@

      Module slack_bolt.adapter.aiohttp

      -
      - -Expand source code - -
      import re
      -
      -from aiohttp import web
      -
      -from slack_bolt.request.async_request import AsyncBoltRequest
      -from slack_bolt.response import BoltResponse
      -
      -
      -async def to_bolt_request(request: web.Request) -> AsyncBoltRequest:
      -    return AsyncBoltRequest(
      -        body=await request.text(),
      -        query=request.query_string,
      -        headers=request.headers,
      -    )
      -
      -
      -async def to_aiohttp_response(bolt_resp: BoltResponse) -> web.Response:
      -    content_type = bolt_resp.headers.pop(
      -        "content-type",
      -        ["application/json" if bolt_resp.body.startswith("{") else "text/plain"],
      -    )[0]
      -    content_type = re.sub(r";\s*charset=utf-8", "", content_type)
      -    resp = web.Response(
      -        status=bolt_resp.status,
      -        body=bolt_resp.body,
      -        headers=bolt_resp.first_headers_without_set_cookie(),
      -        content_type=content_type,
      -    )
      -    for cookie in bolt_resp.cookies():
      -        for name, c in cookie.items():
      -            resp.set_cookie(
      -                name=name,
      -                value=c.value,
      -                max_age=c.get("max-age"),
      -                expires=c.get("expires"),
      -                path=c.get("path"),
      -                domain=c.get("domain"),
      -                secure=True,
      -                httponly=True,
      -            )
      -    return resp
      -
      -
      -__all__ = [
      -    "to_bolt_request",
      -    "to_aiohttp_response",
      -]
      -
      @@ -87,53 +38,12 @@

      Functions

      -
      - -Expand source code - -
      async def to_aiohttp_response(bolt_resp: BoltResponse) -> web.Response:
      -    content_type = bolt_resp.headers.pop(
      -        "content-type",
      -        ["application/json" if bolt_resp.body.startswith("{") else "text/plain"],
      -    )[0]
      -    content_type = re.sub(r";\s*charset=utf-8", "", content_type)
      -    resp = web.Response(
      -        status=bolt_resp.status,
      -        body=bolt_resp.body,
      -        headers=bolt_resp.first_headers_without_set_cookie(),
      -        content_type=content_type,
      -    )
      -    for cookie in bolt_resp.cookies():
      -        for name, c in cookie.items():
      -            resp.set_cookie(
      -                name=name,
      -                value=c.value,
      -                max_age=c.get("max-age"),
      -                expires=c.get("expires"),
      -                path=c.get("path"),
      -                domain=c.get("domain"),
      -                secure=True,
      -                httponly=True,
      -            )
      -    return resp
      -
      async def to_bolt_request(request: aiohttp.web_request.Request) ‑> AsyncBoltRequest
      -
      - -Expand source code - -
      async def to_bolt_request(request: web.Request) -> AsyncBoltRequest:
      -    return AsyncBoltRequest(
      -        body=await request.text(),
      -        query=request.query_string,
      -        headers=request.headers,
      -    )
      -
      @@ -141,7 +51,6 @@

      Functions

      - \ No newline at end of file + diff --git a/docs/api-docs/slack_bolt/adapter/asgi/aiohttp/index.html b/docs/api-docs/slack_bolt/adapter/asgi/aiohttp/index.html index 3bd13d292..6fa6de3a4 100644 --- a/docs/api-docs/slack_bolt/adapter/asgi/aiohttp/index.html +++ b/docs/api-docs/slack_bolt/adapter/asgi/aiohttp/index.html @@ -2,18 +2,21 @@ - - + + slack_bolt.adapter.asgi.aiohttp API documentation - - - - - - + + + + + + - - + +
      @@ -22,64 +25,6 @@

      Module slack_bolt.adapter.asgi.aiohttp

      -
      - -Expand source code - -
      from slack_bolt.oauth.async_oauth_flow import AsyncOAuthFlow
      -
      -from slack_bolt.adapter.asgi.http_request import AsgiHttpRequest
      -from slack_bolt.adapter.asgi.builtin import SlackRequestHandler
      -
      -from slack_bolt.async_app import AsyncApp
      -
      -from slack_bolt.async_app import AsyncBoltRequest
      -from slack_bolt.response import BoltResponse
      -
      -
      -class AsyncSlackRequestHandler(SlackRequestHandler):
      -    app: AsyncApp
      -
      -    def __init__(self, app: AsyncApp, path: str = "/slack/events"):
      -        """Setup Bolt as an ASGI web framework, this will make your application compatible with ASGI web servers.
      -        This can be used for production deployment.
      -
      -        With the default settings, `http://localhost:3000/slack/events`
      -        Run Bolt with [uvicron](https://www.uvicorn.org/)
      -
      -            # Python
      -            app = AsyncApp()
      -            api = SlackRequestHandler(app)
      -
      -            # bash
      -            export SLACK_SIGNING_SECRET=***
      -            export SLACK_BOT_TOKEN=xoxb-***
      -            uvicorn app:api --port 3000 --log-level debug
      -
      -        Args:
      -            app: Your bolt application
      -            path: The path to handle request from Slack (Default: `/slack/events`)
      -        """
      -        self.path = path
      -        self.app = app
      -
      -    async def dispatch(self, request: AsgiHttpRequest) -> BoltResponse:
      -        return await self.app.async_dispatch(
      -            AsyncBoltRequest(body=await request.get_raw_body(), query=request.query_string, headers=request.get_headers())
      -        )
      -
      -    async def handle_installation(self, request: AsgiHttpRequest) -> BoltResponse:
      -        oauth_flow: AsyncOAuthFlow = self.app.oauth_flow
      -        return await oauth_flow.handle_installation(
      -            AsyncBoltRequest(body=await request.get_raw_body(), query=request.query_string, headers=request.get_headers())
      -        )
      -
      -    async def handle_callback(self, request: AsgiHttpRequest) -> BoltResponse:
      -        oauth_flow: AsyncOAuthFlow = self.app.oauth_flow
      -        return await oauth_flow.handle_callback(
      -            AsyncBoltRequest(body=await request.get_raw_body(), query=request.query_string, headers=request.get_headers())
      -        )
      -
      @@ -189,7 +134,6 @@

      Inherited members

      - \ No newline at end of file + diff --git a/docs/api-docs/slack_bolt/adapter/asgi/async_handler.html b/docs/api-docs/slack_bolt/adapter/asgi/async_handler.html index b93e472f9..f100b1161 100644 --- a/docs/api-docs/slack_bolt/adapter/asgi/async_handler.html +++ b/docs/api-docs/slack_bolt/adapter/asgi/async_handler.html @@ -2,18 +2,21 @@ - - + + slack_bolt.adapter.asgi.async_handler API documentation - - - - - - + + + + + + - - + +
      @@ -22,14 +25,6 @@

      Module slack_bolt.adapter.asgi.async_handler

      -
      - -Expand source code - -
      from .aiohttp import AsyncSlackRequestHandler
      -
      -__all__ = ["AsyncSlackRequestHandler"]
      -
      @@ -139,7 +134,6 @@

      Inherited members

    @@ -239,7 +142,6 @@

    Methods

    @@ -158,7 +104,6 @@

    Methods

    @@ -158,7 +105,6 @@

    Methods

    @@ -292,18 +144,6 @@

    Static methods

    -
    - -Expand source code - -
    @classmethod
    -def clear_all_log_handlers(cls):
    -    # https://stackoverflow.com/questions/37703609/using-python-logging-with-aws-lambda
    -    root = logging.getLogger()
    -    if root.handlers:
    -        for handler in root.handlers:
    -            root.removeHandler(handler)
    -

    Methods

    @@ -313,49 +153,6 @@

    Methods

    -
    - -Expand source code - -
    def handle(self, request: Request):
    -    body: str = request.raw_body.decode("utf-8") if request.raw_body else ""
    -    self.logger.debug(f"Incoming request: {request.to_dict()}, body: {body}")
    -
    -    method = request.method
    -    if method is None:
    -        return not_found()
    -    if method == "GET":
    -        if self.app.oauth_flow is not None:
    -            oauth_flow: OAuthFlow = self.app.oauth_flow
    -            bolt_req: BoltRequest = to_bolt_request(request, body)
    -            query = bolt_req.query
    -            is_callback = query is not None and (
    -                (_first_value(query, "code") is not None and _first_value(query, "state") is not None)
    -                or _first_value(query, "error") is not None
    -            )
    -            if is_callback:
    -                bolt_resp = oauth_flow.handle_callback(bolt_req)
    -                return to_chalice_response(bolt_resp)
    -            else:
    -                bolt_resp = oauth_flow.handle_installation(bolt_req)
    -                return to_chalice_response(bolt_resp)
    -    elif method == "POST":
    -        bolt_req: BoltRequest = to_bolt_request(request, body)
    -        # https://docs.aws.amazon.com/lambda/latest/dg/python-context.html
    -        aws_lambda_function_name = self.chalice.lambda_context.function_name
    -        bolt_req.context["aws_lambda_function_name"] = aws_lambda_function_name
    -        bolt_req.context["chalice_request"] = request.to_dict()
    -        bolt_resp = self.app.dispatch(bolt_req)
    -        aws_response = to_chalice_response(bolt_resp)
    -        return aws_response
    -    elif method == "NONE":
    -        bolt_req: BoltRequest = to_bolt_request(request, body)
    -        bolt_resp = self.app.dispatch(bolt_req)
    -        aws_response = to_chalice_response(bolt_resp)
    -        return aws_response
    -
    -    return not_found()
    -
    @@ -363,7 +160,6 @@

    Methods

    diff --git a/docs/static/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html b/docs/static/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html index b5cbb0a1e..e8bd162ec 100644 --- a/docs/static/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html +++ b/docs/static/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html @@ -3,19 +3,30 @@ - + slack_bolt.adapter.aws_lambda.chalice_handler API documentation - + @@ -37,18 +48,51 @@

    Functions

    def not_found() ‑> chalice.app.Response
    +
    + +Expand source code + +
    def not_found() -> Response:
    +    return Response(
    +        status_code=404,
    +        body="Not Found",
    +        headers={},
    +    )
    +
    def to_bolt_request(request: chalice.app.Request, body: str) ‑> BoltRequest
    +
    + +Expand source code + +
    def to_bolt_request(request: Request, body: str) -> BoltRequest:
    +    return BoltRequest(
    +        body=body,
    +        query=request.query_params,  # type: ignore[arg-type]
    +        headers=request.headers,  # type: ignore[arg-type]
    +    )
    +
    def to_chalice_response(resp: BoltResponse) ‑> chalice.app.Response
    +
    + +Expand source code + +
    def to_chalice_response(resp: BoltResponse) -> Response:
    +    return Response(
    +        status_code=resp.status,
    +        body=resp.body,
    +        headers=resp.first_headers(),  # type: ignore[arg-type]
    +    )
    +
    @@ -61,7 +105,6 @@

    Classes

    (app: App,
    chalice: chalice.app.Chalice,
    lambda_client: botocore.client.BaseClient | None = None)
    -
    Expand source code @@ -137,6 +180,7 @@

    Classes

    return not_found()
    +

    Static methods

    @@ -152,6 +196,49 @@

    Methods

    def handle(self, request: chalice.app.Request)
    +
    + +Expand source code + +
    def handle(self, request: Request):
    +    body: str = request.raw_body.decode("utf-8") if request.raw_body else ""  # type: ignore[union-attr]
    +    self.logger.debug(f"Incoming request: {request.to_dict()}, body: {body}")
    +
    +    method = request.method
    +    if method is None:
    +        return not_found()
    +    if method == "GET":
    +        if self.app.oauth_flow is not None:
    +            oauth_flow: OAuthFlow = self.app.oauth_flow
    +            bolt_req: BoltRequest = to_bolt_request(request, body)
    +            query = bolt_req.query
    +            is_callback = query is not None and (
    +                (_first_value(query, "code") is not None and _first_value(query, "state") is not None)
    +                or _first_value(query, "error") is not None
    +            )
    +            if is_callback:
    +                bolt_resp = oauth_flow.handle_callback(bolt_req)
    +                return to_chalice_response(bolt_resp)
    +            else:
    +                bolt_resp = oauth_flow.handle_installation(bolt_req)
    +                return to_chalice_response(bolt_resp)
    +    elif method == "POST":
    +        bolt_req = to_bolt_request(request, body)
    +        # https://docs.aws.amazon.com/lambda/latest/dg/python-context.html
    +        aws_lambda_function_name = self.chalice.lambda_context.function_name
    +        bolt_req.context["aws_lambda_function_name"] = aws_lambda_function_name
    +        bolt_req.context["chalice_request"] = request.to_dict()
    +        bolt_resp = self.app.dispatch(bolt_req)
    +        aws_response = to_chalice_response(bolt_resp)
    +        return aws_response
    +    elif method == "NONE":
    +        bolt_req = to_bolt_request(request, body)
    +        bolt_resp = self.app.dispatch(bolt_req)
    +        aws_response = to_chalice_response(bolt_resp)
    +        return aws_response
    +
    +    return not_found()
    +
    @@ -191,7 +278,7 @@

    -

    Generated by pdoc 0.11.3.

    +

    Generated by pdoc 0.11.5.

    diff --git a/docs/static/api-docs/slack_bolt/adapter/aws_lambda/chalice_lazy_listener_runner.html b/docs/static/api-docs/slack_bolt/adapter/aws_lambda/chalice_lazy_listener_runner.html index 4a882d5bd..8bd6428c1 100644 --- a/docs/static/api-docs/slack_bolt/adapter/aws_lambda/chalice_lazy_listener_runner.html +++ b/docs/static/api-docs/slack_bolt/adapter/aws_lambda/chalice_lazy_listener_runner.html @@ -3,19 +3,30 @@ - + slack_bolt.adapter.aws_lambda.chalice_lazy_listener_runner API documentation - + @@ -40,7 +51,6 @@

    Classes

    (logger: logging.Logger,
    lambda_client: botocore.client.BaseClient | None = None)
    -
    Expand source code @@ -74,6 +84,7 @@

    Classes

    Payload=json.dumps(payload), )
    +

    Ancestors

    class Update @@ -329,7 +329,7 @@

    Classes

    app.step(ws) This utility is a thin wrapper of workflows.stepFailed API method. - Refer to https://api.slack.com/methods/workflows.updateStep for details. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. """ def __init__(self, *, client: WebClient, body: dict): @@ -377,7 +377,7 @@

    Classes

    app.step(ws)

    This utility is a thin wrapper of workflows.stepFailed API method. -Refer to https://api.slack.com/methods/workflows.updateStep for details.

    +Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    class WorkflowStep @@ -411,7 +411,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps Args: callback_id: The callback_id for this step from app @@ -453,7 +453,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps """ return WorkflowStepBuilder( callback_id, @@ -546,7 +546,7 @@

    Classes

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    Args

    callback_id
    @@ -598,7 +598,7 @@

    Static methods

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    diff --git a/docs/static/api-docs/slack_bolt/workflows/step/step.html b/docs/static/api-docs/slack_bolt/workflows/step/step.html index c1500beaf..efaaad899 100644 --- a/docs/static/api-docs/slack_bolt/workflows/step/step.html +++ b/docs/static/api-docs/slack_bolt/workflows/step/step.html @@ -78,7 +78,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps Args: callback_id: The callback_id for this step from app @@ -120,7 +120,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps """ return WorkflowStepBuilder( callback_id, @@ -213,7 +213,7 @@

    Classes

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    Args

    callback_id
    @@ -265,7 +265,7 @@

    Static methods

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    @@ -280,7 +280,7 @@

    Static methods

    class WorkflowStepBuilder:
         """Steps from apps
    -    Refer to https://api.slack.com/workflows/steps for details.
    +    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.
         """
     
         callback_id: Union[str, Pattern]
    @@ -298,7 +298,7 @@ 

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps This builder is supposed to be used as decorator. @@ -340,7 +340,7 @@

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps Registers a new edit listener with details. @@ -394,7 +394,7 @@

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps Registers a new save listener with details. @@ -447,7 +447,7 @@

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps Registers a new execute listener with details. @@ -494,7 +494,7 @@

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. @@ -584,10 +584,10 @@

    Static methods

    return _middleware

    Steps from apps -Refer to https://api.slack.com/workflows/steps for details.

    +Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    This builder is supposed to be used as decorator.

    my_step = WorkflowStep.builder("my_step")
     @my_step.edit
    @@ -703,7 +703,7 @@ 

    Methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. @@ -729,7 +729,7 @@

    Methods

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object.

    Returns

    @@ -753,7 +753,7 @@

    Returns

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps Registers a new edit listener with details. @@ -799,7 +799,7 @@

    Returns

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    Registers a new edit listener with details.

    You can use this method as decorator as well.

    @my_step.edit
    @@ -844,7 +844,7 @@ 

    Args

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps Registers a new execute listener with details. @@ -889,7 +889,7 @@

    Args

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    Registers a new execute listener with details.

    You can use this method as decorator as well.

    @my_step.execute
    @@ -934,7 +934,7 @@ 

    Args

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps Registers a new save listener with details. @@ -979,7 +979,7 @@

    Args

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    Registers a new save listener with details.

    You can use this method as decorator as well.

    @my_step.save
    diff --git a/docs/static/api-docs/slack_bolt/workflows/step/utilities/async_complete.html b/docs/static/api-docs/slack_bolt/workflows/step/utilities/async_complete.html
    index 7dc7744a7..8a8790900 100644
    --- a/docs/static/api-docs/slack_bolt/workflows/step/utilities/async_complete.html
    +++ b/docs/static/api-docs/slack_bolt/workflows/step/utilities/async_complete.html
    @@ -76,7 +76,7 @@ 

    Classes

    app.step(ws) This utility is a thin wrapper of workflows.stepCompleted API method. - Refer to https://api.slack.com/methods/workflows.stepCompleted for details. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. """ def __init__(self, *, client: AsyncWebClient, body: dict): @@ -108,7 +108,7 @@

    Classes

    app.step(ws)

    This utility is a thin wrapper of workflows.stepCompleted API method. -Refer to https://api.slack.com/methods/workflows.stepCompleted for details.

    +Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    diff --git a/docs/static/api-docs/slack_bolt/workflows/step/utilities/async_configure.html b/docs/static/api-docs/slack_bolt/workflows/step/utilities/async_configure.html index 1e0395e92..3151e71bd 100644 --- a/docs/static/api-docs/slack_bolt/workflows/step/utilities/async_configure.html +++ b/docs/static/api-docs/slack_bolt/workflows/step/utilities/async_configure.html @@ -83,7 +83,7 @@

    Classes

    ) app.step(ws) - Refer to https://api.slack.com/workflows/steps for details. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. """ def __init__(self, *, callback_id: str, client: AsyncWebClient, body: dict): @@ -131,7 +131,7 @@

    Classes

    ) app.step(ws)
    -

    Refer to https://api.slack.com/workflows/steps for details.

    +

    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    diff --git a/docs/static/api-docs/slack_bolt/workflows/step/utilities/async_fail.html b/docs/static/api-docs/slack_bolt/workflows/step/utilities/async_fail.html index 683174686..1206c45a6 100644 --- a/docs/static/api-docs/slack_bolt/workflows/step/utilities/async_fail.html +++ b/docs/static/api-docs/slack_bolt/workflows/step/utilities/async_fail.html @@ -73,7 +73,7 @@

    Classes

    app.step(ws) This utility is a thin wrapper of workflows.stepFailed API method. - Refer to https://api.slack.com/methods/workflows.stepFailed for details. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. """ def __init__(self, *, client: AsyncWebClient, body: dict): @@ -106,7 +106,7 @@

    Classes

    app.step(ws)

    This utility is a thin wrapper of workflows.stepFailed API method. -Refer to https://api.slack.com/methods/workflows.stepFailed for details.

    +Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    diff --git a/docs/static/api-docs/slack_bolt/workflows/step/utilities/async_update.html b/docs/static/api-docs/slack_bolt/workflows/step/utilities/async_update.html index 8b8282fae..0d1cad162 100644 --- a/docs/static/api-docs/slack_bolt/workflows/step/utilities/async_update.html +++ b/docs/static/api-docs/slack_bolt/workflows/step/utilities/async_update.html @@ -92,7 +92,7 @@

    Classes

    app.step(ws) This utility is a thin wrapper of workflows.stepFailed API method. - Refer to https://api.slack.com/methods/workflows.updateStep for details. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. """ def __init__(self, *, client: AsyncWebClient, body: dict): @@ -140,7 +140,7 @@

    Classes

    app.step(ws)

    This utility is a thin wrapper of workflows.stepFailed API method. -Refer to https://api.slack.com/methods/workflows.updateStep for details.

    +Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    diff --git a/docs/static/api-docs/slack_bolt/workflows/step/utilities/complete.html b/docs/static/api-docs/slack_bolt/workflows/step/utilities/complete.html index 685a3bd63..c15d51e9c 100644 --- a/docs/static/api-docs/slack_bolt/workflows/step/utilities/complete.html +++ b/docs/static/api-docs/slack_bolt/workflows/step/utilities/complete.html @@ -76,7 +76,7 @@

    Classes

    app.step(ws) This utility is a thin wrapper of workflows.stepCompleted API method. - Refer to https://api.slack.com/methods/workflows.stepCompleted for details. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. """ def __init__(self, *, client: WebClient, body: dict): @@ -108,7 +108,7 @@

    Classes

    app.step(ws)

    This utility is a thin wrapper of workflows.stepCompleted API method. -Refer to https://api.slack.com/methods/workflows.stepCompleted for details.

    +Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    diff --git a/docs/static/api-docs/slack_bolt/workflows/step/utilities/configure.html b/docs/static/api-docs/slack_bolt/workflows/step/utilities/configure.html index 8199f9ea4..2c1aeadbf 100644 --- a/docs/static/api-docs/slack_bolt/workflows/step/utilities/configure.html +++ b/docs/static/api-docs/slack_bolt/workflows/step/utilities/configure.html @@ -83,7 +83,7 @@

    Classes

    ) app.step(ws) - Refer to https://api.slack.com/workflows/steps for details. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. """ def __init__(self, *, callback_id: str, client: WebClient, body: dict): @@ -128,7 +128,7 @@

    Classes

    ) app.step(ws) -

    Refer to https://api.slack.com/workflows/steps for details.

    +

    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    diff --git a/docs/static/api-docs/slack_bolt/workflows/step/utilities/fail.html b/docs/static/api-docs/slack_bolt/workflows/step/utilities/fail.html index 071bbbfed..4c4091fd5 100644 --- a/docs/static/api-docs/slack_bolt/workflows/step/utilities/fail.html +++ b/docs/static/api-docs/slack_bolt/workflows/step/utilities/fail.html @@ -73,7 +73,7 @@

    Classes

    app.step(ws) This utility is a thin wrapper of workflows.stepFailed API method. - Refer to https://api.slack.com/methods/workflows.stepFailed for details. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. """ def __init__(self, *, client: WebClient, body: dict): @@ -106,7 +106,7 @@

    Classes

    app.step(ws)

    This utility is a thin wrapper of workflows.stepFailed API method. -Refer to https://api.slack.com/methods/workflows.stepFailed for details.

    +Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    diff --git a/docs/static/api-docs/slack_bolt/workflows/step/utilities/update.html b/docs/static/api-docs/slack_bolt/workflows/step/utilities/update.html index f24c07836..c93fc7f21 100644 --- a/docs/static/api-docs/slack_bolt/workflows/step/utilities/update.html +++ b/docs/static/api-docs/slack_bolt/workflows/step/utilities/update.html @@ -92,7 +92,7 @@

    Classes

    app.step(ws) This utility is a thin wrapper of workflows.stepFailed API method. - Refer to https://api.slack.com/methods/workflows.updateStep for details. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. """ def __init__(self, *, client: WebClient, body: dict): @@ -140,7 +140,7 @@

    Classes

    app.step(ws)

    This utility is a thin wrapper of workflows.stepFailed API method. -Refer to https://api.slack.com/methods/workflows.updateStep for details.

    +Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    From 1b3e3beadd9be0b925cf0c44c5746b82bc1713df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Apr 2025 09:44:28 -0400 Subject: [PATCH 610/719] chore(deps): bump http-proxy-middleware from 2.0.7 to 2.0.9 in /docs (#1299) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/package-lock.json b/docs/package-lock.json index e65be5252..ec9caf660 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -8868,9 +8868,9 @@ } }, "node_modules/http-proxy-middleware": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz", - "integrity": "sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA==", + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.9.tgz", + "integrity": "sha512-c1IyJYLYppU574+YI7R4QyX2ystMtVXZwIdzazUIPIJsHuWNd+mho2j+bKoHftndicGj9yh+xjd+l0yj7VeT1Q==", "license": "MIT", "dependencies": { "@types/http-proxy": "^1.17.8", From f1c00487ae70eae7fc8ba21f057d78c56c724406 Mon Sep 17 00:00:00 2001 From: Haley Elmendorf <31392893+haleychaas@users.noreply.github.com> Date: Wed, 30 Apr 2025 10:25:33 -0500 Subject: [PATCH 611/719] Docs: Fixed incorrect link (#1300) --- docs/content/tutorial/custom-steps-for-jira.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/tutorial/custom-steps-for-jira.md b/docs/content/tutorial/custom-steps-for-jira.md index d0fbe0979..b38f9337c 100644 --- a/docs/content/tutorial/custom-steps-for-jira.md +++ b/docs/content/tutorial/custom-steps-for-jira.md @@ -21,7 +21,7 @@ If you'd rather skip the tutorial and just head straight to the code, you can us 1. Navigate to the [app creation page](https://api.slack.com/apps/new) and select **From a manifest**. 2. Select the workspace you want to install the application in, then click **Next**. -3. Copy the contents of the [`manifest.json`](https://github.com/slack-samples/bolt-python-ai-chatbot/blob/main/manifest.json) file below into the text box that says **Paste your manifest code here** (within the **JSON** tab), then click **Next**: +3. Copy the contents of the [`manifest.json`](https://github.com/slack-samples/bolt-python-jira-functions/blob/main/manifest.json) file below into the text box that says **Paste your manifest code here** (within the **JSON** tab), then click **Next**: ```js reference title="manifest.json" https://github.com/slack-samples/bolt-python-jira-functions/blob/main/manifest.json From a750470e2f08b85a10f75eeaf277f61d295e6ba0 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 20 May 2025 18:27:31 -0700 Subject: [PATCH 612/719] ci: pin actions workflow step hashes and use minimum permissions (#1303) --- .github/workflows/codecov.yml | 13 +++++++++---- .github/workflows/docs-deploy.yml | 15 +++++++++------ .github/workflows/flake8.yml | 11 ++++++++--- .github/workflows/mypy.yml | 11 ++++++++--- .github/workflows/tests.yml | 13 +++++++++---- .github/workflows/triage-issues.yml | 15 +++++++-------- 6 files changed, 50 insertions(+), 28 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 79fd440b2..391c135c6 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -2,7 +2,8 @@ name: Run codecov on: push: - branches: [main] + branches: + - main pull_request: jobs: @@ -12,12 +13,16 @@ jobs: strategy: matrix: python-version: ["3.13"] + permissions: + contents: read env: BOLT_PYTHON_CODECOV_RUNNING: "1" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -31,7 +36,7 @@ jobs: run: | pytest --cov=./slack_bolt/ --cov-report=xml - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3 with: fail_ci_if_error: true verbose: true diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml index 54523819e..ed18c4b1d 100644 --- a/.github/workflows/docs-deploy.yml +++ b/.github/workflows/docs-deploy.yml @@ -5,23 +5,26 @@ on: branches: - main paths: - - 'docs/**' + - "docs/**" push: branches: - main paths: - - 'docs/**' + - "docs/**" workflow_dispatch: jobs: build: name: Build Docusaurus runs-on: ubuntu-latest + permissions: + contents: read steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 - - uses: actions/setup-node@v4 + persist-credentials: false + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: 20 cache: npm @@ -36,7 +39,7 @@ jobs: working-directory: ./docs - name: Upload Build Artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 with: path: ./docs/build @@ -59,4 +62,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index c64484b1b..87f3496e1 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -2,7 +2,8 @@ name: Run flake8 validation on: push: - branches: [main] + branches: + - main pull_request: jobs: @@ -12,10 +13,14 @@ jobs: strategy: matrix: python-version: ["3.13"] + permissions: + contents: read steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ matrix.python-version }} - name: Run flake8 verification diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index a592bd8cd..f333756b5 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -2,7 +2,8 @@ name: Run mypy validation on: push: - branches: [main] + branches: + - main pull_request: jobs: @@ -12,10 +13,14 @@ jobs: strategy: matrix: python-version: ["3.13"] + permissions: + contents: read steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ matrix.python-version }} - name: Run mypy verification diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bb35112c3..86fa4621c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,7 +2,8 @@ name: Run all the unit tests on: push: - branches: [main] + branches: + - main pull_request: jobs: @@ -20,10 +21,14 @@ jobs: - "3.11" - "3.12" - "3.13" + permissions: + contents: read steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ matrix.python-version }} - name: Install synchronous dependencies @@ -68,7 +73,7 @@ jobs: pytest tests/scenario_tests_async/ --junitxml=reports/test_scenario_async.xml - name: Upload test results to Codecov if: ${{ !cancelled() }} - uses: codecov/test-results-action@v1 + uses: codecov/test-results-action@f2dba722c67b86c6caa034178c6e4d35335f6706 # v1.1.0 with: directory: ./reports/ flags: ${{ matrix.python-version }} diff --git a/.github/workflows/triage-issues.yml b/.github/workflows/triage-issues.yml index d1275a94d..b37c13422 100644 --- a/.github/workflows/triage-issues.yml +++ b/.github/workflows/triage-issues.yml @@ -4,20 +4,19 @@ name: Close stale issues and PRs -on: +on: workflow_dispatch: schedule: - - cron: '0 0 * * 1' - -permissions: - issues: write - pull-requests: write + - cron: "0 0 * * 1" jobs: stale: runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write steps: - - uses: actions/stale@v9.1.0 + - uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0 with: days-before-issue-stale: 30 days-before-issue-close: 10 @@ -30,4 +29,4 @@ jobs: exempt-all-milestones: true remove-stale-when-updated: true enable-statistics: true - operations-per-run: 60 \ No newline at end of file + operations-per-run: 60 From accf85d4a46650b6a51a6ad49538dbf160fc743d Mon Sep 17 00:00:00 2001 From: Tracy Rericha <108959677+technically-tracy@users.noreply.github.com> Date: Tue, 27 May 2025 12:09:34 -0400 Subject: [PATCH 613/719] Docs: moved over custom steps dynamic options page. (#1307) --- .../concepts/custom-steps-dynamic-options.md | 247 ++++++++++++++++++ docs/sidebars.js | 1 + 2 files changed, 248 insertions(+) create mode 100644 docs/content/concepts/custom-steps-dynamic-options.md diff --git a/docs/content/concepts/custom-steps-dynamic-options.md b/docs/content/concepts/custom-steps-dynamic-options.md new file mode 100644 index 000000000..cab3f7a61 --- /dev/null +++ b/docs/content/concepts/custom-steps-dynamic-options.md @@ -0,0 +1,247 @@ +# Custom Steps dynamic options for Workflow Builder + +## Background {#background} + +[Legacy steps from apps](https://docs.slack.dev/changelog/2023-08-workflow-steps-from-apps-step-back) previously enabled Slack apps to create and process custom workflow steps, which could then be shared and used by anyone in Workflow Builder. To support your transition away from them, custom steps used as dynamic options are available. These allow you to use data defined when referencing the step in Workflow Builder as inputs to the step. + +## Example use case {#use-case} + +Let's say a builder wants to add a custom step in Workflow Builder that creates an issue in an external issue-tracking system. First, they'll need to specify a project. Once a project is selected, a project-specific list of fields can be presented to them to choose from when creating the issue. + +As a developer, dynamic options allow you to supply data to input parameters of custom steps so that you can provide builders with varying sets of fields based on the builders' selections. + +In this example, the primary step would invoke a separate project selection step that retrieves the list of available projects. The builder-selected item from the retrieved list would then be used as the input to the secondary issue creation step. + +There are two parts necessary for Slack apps to support dynamic options: custom step definitions, and handling custom step dynamic options. We'll take a look at both in the following sections. + +## Custom step definitions {#custom-step-definitions} + +When defining an input to a custom step intended to be dynamic (rather than explicitly defining a set of input parameters up front), you'll define a `dynamic_options` property that points to another custom step designed to return the set of dynamic elements once this step is added to a workflow from Workflow Builder. + +An input parameter for a custom step can reference a different custom step that defines what data is available for it to return. One Slack app could even use another Slack app’s custom step to define dynamic options for one of its inputs. + +The following code snippet from our issue creation example discussed above shows a `create-issue` custom step that will be used as a workflow step. Another custom step, the `get-projects` step, will dynamically populate the project input parameter to be configured by a builder. This `get-projects` step provides an `array` containing projects fetched dynamically from the external issue-tracking system. + +```js + "functions": { + "create-issue": { + "title": "Create Issue", + "description": "", + "input_parameters": { + "support_channel": { + "type": "slack#/types/channel_id", + "title": "Support Channel", + "description": "", + "name": "support_channel" + }, + "project": { + "type": "string", + "title": "Project", + "description": "A project from the issue tracking system", + "is_required": true, + "dynamic_options": { + "function": "#/functions/get-projects", + "inputs": {} + } + }, + }, + "output_parameters": {} + }, + "get-projects": { + "title": "Get Projects", + "description": "Get the available project from the issue tracking system", + "input_parameters": {}, + "output_parameters": { + "options": { + "type": "slack#/types/options_select", + "title": "Project Options", + } + } + } + }, +``` +### Defining the `function` and `inputs` attributes {#define-attributes} + +Defining the `function` and `inputs` attributes of the `dynamic_options` property would look as follows: + +``` +"dynamic_options": { + "function": "#/functions/get-projects", + "inputs": {} +} +``` + +The `function` attribute specifies the step reference used to resolve the options of the input parameter. For example: `"#/functions/get-projects"`. + +The `inputs` attribute defines the parameters to be passed as inputs to the step referenced by the `function` attribute. For example: + +``` +"inputs": { + "selected_user_id": { + "value": "{{input_parameters.user_id}}" + }, + "query": { + "value": "{{client.query}}" + } +} +``` + +The following format can be used to reference any input parameter defined by the step: `{{input_parameters.}}`. + +In addition, the `{{client.query}}` parameter can be used as a placeholder for an input value. The `{{client.builder_context}}` parameter will inject the [`slack#/types/user_context`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types/#usercontext) of the user building the workflow as the value to the input parameter. + +### Types of dynamic options UIs {#dynamic-option-UIs} + +The above example demonstrates one possible UI to be rendered for builders: a single-select drop-down menu of dynamic options. However, dynamic options in Workflow Builder can be rendered in one of two ways: as a drop-down menu (single-select or multi-select), or as a set of fields. + +The type is dictated by the output parameter of the custom step used as a dynamic option. In order to use a custom step in a dynamic option context, its output must adhere to a defined interface, that is, it must have an `options` parameter of type [`options_select`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#options_select) or [`options_field`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#options_field), as shown in the following code snippet. + +```js +"output_parameters": { + "options": { + "type": "slack#/types/options_select" or "slack#/types/options_field", + "title": "Custom Options", + "description": "Options to be used in a dynamic context", + } + ... +} +``` + +#### Drop-down menus {#drop-down} + +Your dynamic input parameter can be rendered as a drop-down menu, which will use the options obtained from a custom step with an `options` output parameter of the type [`options_select`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#options_select). + +The drop-down menu UI component can be rendered in two ways: single-select, or multi-select. To render the dynamic input as a single-select menu, the input parameter defining the dynamic option must be of the type [`string`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#string). + +```js +"step-with-dynamic-input": { + "title": "Step that uses a dynamic input", + "description": "This step uses a dynamic input rendered as a single-select menu", + "input_parameters": { + "dynamic_single_select": { + "type": "string", // this must be of type string for single-select + "title": "dynamic single select drop-down menu", + "description": "A dynamically-populated single-select drop-down menu", + "is_required": true, + "dynamic_options": { + "function": "#/functions/get-options", + "inputs": {}, + }, + } + }, + "output_parameters": {} +} +``` + +To render the dynamic input as a multi-select menu, the input parameter defining the dynamic option must be of the type [`array`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#array), and its `items` must be of type [`string`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#string). + +```js +"step-with-dynamic-input": { + "title": "Step that uses a dynamic input", + "description": "This step uses a dynamic input rendered as a multi-select menu", + "input_parameters": { + "dynamic_multi_select": { + "type": "array", // this must be of type array for multi-select + "items": { + "type": "string" + }, + "title": "dynamic single select drop-down menu", + "description": "A dynamically-populated multi-select drop-down menu", + "dynamic_options": { + "function": "#/functions/get-options", + "inputs": {}, + }, + } + }, + "output_parameters": {} +} +``` + +#### Fields {#fields} + +In the code snippet below, the input parameter is rendered as a set of fields with keys and values. The option fields are obtained from a custom step with an `options` output parameter of type [`options_field`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#options_field). + +The input parameter that defines the dynamic option must be of type [`object`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#object), as the completed set of fields in Workflow Builder will be passed to the custom step as an [untyped object](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#untyped-object) during workflow execution. + +```js +"test-field-dynamic-options": { + "title": "Test dynamic field options", + "description": "", + "input_parameters": { + "dynamic_fields": { + "type": "object", + "title": "Dynamic custom field options", + "description": "A dynamically-populated section of input fields", + "dynamic_options": { + "function": "#/functions/get-field-options", + "inputs": {} + "selection_type": "key-value", + } + } + }, + "output_parameters": {} +} +``` + +### Dynamic option types {#dynamic-option-types} + +As mentioned earlier, in order to use a custom step as a dynamic option, its output must adhere to a defined interface: it must have an `options` output parameter of the type either [`options_select`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#options_select) or [`options_field`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#options_field). + +To take a look at these in more detail, refer to our [Options Slack type](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#options) documentation. + +## Dynamic options handler {#dynamic-option-handler} + +Each custom step defined in the manifest needs a corresponding handler in your Slack app. Although implemented similarly to existing function execution event handlers, there are two key differences between regular custom step invocations and those used for dynamic options: + +* The custom step must have an `options` output parameter that is of type [`options_select`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#options_select) or [`options_field`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#options_field). +* The [`function_executed`](https://docs.slack.dev/reference/events/function_executed) event must be handled synchronously. This optimizes the response time of returned dynamic options and provides a crisp builder experience. + +### Asynchronous event handling {#async} + +By default, the [Bolt family of frameworks](https://tools.slack.dev/) handles `function_executed` events asynchronously. + +For example, the various modal-related API methods provide two ways to update a view: synchronously using a `response_action` HTTP response, or asynchronously using a separate HTTP API call. Using the asynchronous approach allows developers to handle events free of timeouts, but this isn't desired for dynamic options as it introduces delays and violates our stated goal of providing a crisp builder experience. + +### Synchronous event handling {#sync} + +Dynamic options support synchronous handling of `function_executed` events. By ensuring that the function execution’s state is complete with output parameters provided before responding to the `function_executed` event, Slack can quickly provide Workflow Builder with the requisite dynamic options. + +### Implementation {#implementation} + +To optimize the response time of dynamic options, you must acknowledge the incoming event after calling the [`function.completeSuccess`](https://docs.slack.dev/reference/methods/functions.completeSuccess) or [`function.completeError`](https://docs.slack.dev/reference/methods/functions.completeError) API methods, minimizing asynchronous latency. The `function.completeSuccess` and `function.completeError` API methods are invoked in the complete and fail helper functions. ([For example](https://github.com/slackapi/bolt-python?tab=readme-ov-file#making-things-happen)). + +A new `auto_acknowledge` flag allows you more granular control over whether specific event handlers should operate in synchronous or asynchronous response modes in order to enable a smooth dynamic options experience. + +#### Example {#bolt-py} + +In [Bolt for Python](https://tools.slack.dev/bolt-python/), you can set `auto_acknowledge=False` on a specific function decorator. This allows you to manually control when the `ack()` event acknowledgement helper function is executed. It flips Bolt to synchronous `function_executed` event handling mode for the specific handler. + +```py +@app.function("get-projects", auto_acknowledge=False) +def handle_get_projects(ack: Ack, complete: Complete): + try: + complete( + outputs={ + "options": [ + { + "text": { + "type": "plain_text", + "text": "Secret Squirrel Project", + }, + "value": "p1", + }, + { + "text": { + "type": "plain_text", + "text": "Public Kangaroo Project", + }, + "value": "p2", + }, + ] + } + ) + finally: + ack() +``` + +✨ **To learn more about the Bolt family of frameworks and tools**, check out our [Slack Developer Tools](https://tools.slack.dev/). diff --git a/docs/sidebars.js b/docs/sidebars.js index 752b61787..82209d428 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -41,6 +41,7 @@ const sidebars = { }, "concepts/ai-apps", "concepts/custom-steps", + "concepts/custom-steps-dynamic-options", { type: "category", label: "App Configuration", From dd39ed5350fb4dc3984fb7f8d9e36f321153b8dc Mon Sep 17 00:00:00 2001 From: Tracy Rericha <108959677+technically-tracy@users.noreply.github.com> Date: Tue, 27 May 2025 12:36:17 -0400 Subject: [PATCH 614/719] Docs: Updated links to match Bolt JS. (#1308) --- docs/content/tutorial/custom-steps.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/tutorial/custom-steps.md b/docs/content/tutorial/custom-steps.md index 79b02089b..2486a49ef 100644 --- a/docs/content/tutorial/custom-steps.md +++ b/docs/content/tutorial/custom-steps.md @@ -69,7 +69,7 @@ Field | Type | Description `type` | String | Defines the data type and can fall into one of two categories: primitives or Slack-specific. `title` | String | The label that appears in Workflow Builder when a user sets up this step in their workflow. `description` | String | The description that accompanies the input when a user sets up this step in their workflow. -`dynamic_options` | Object | For custom steps dynamic options in Workflow Builder, define this property and point to a custom step designed to return the set of dynamic elements once the step is added to a workflow within Workflow Builder. Dynamic options in Workflow Builder can be rendered in one of two ways: as a drop-down menu (single-select or multi-select), or as a set of fields. Refer to [custom steps dynamic options in Workflow Builder](/automation/runonslack/custom-steps-dynamic-options) for more details. +`dynamic_options` | Object | For custom steps dynamic options in Workflow Builder, define this property and point to a custom step designed to return the set of dynamic elements once the step is added to a workflow within Workflow Builder. Dynamic options in Workflow Builder can be rendered in one of two ways: as a drop-down menu (single-select or multi-select), or as a set of fields. Refer to custom steps dynamic options for Workflow Builder using [Bolt for JavaScript](https://tools.slack.dev/bolt-js/concepts/custom-steps-dynamic-options/) or [Bolt for Python](https://tools.slack.dev/bolt-python/concepts/custom-steps-dynamic-options/) for more details. `is_required` | Boolean | Indicates whether or not the input is required by the step in order to run. If it’s required and not provided, the user will not be able to save the configuration nor use the step in their workflow. This property is available only in v1 of the manifest. We recommend v2, using the `required` array as noted in the example above. `hint` | String | Helper text that appears below the input when a user sets up this step in their workflow. From e2896fdff75bf65fd8d729cdfe6180e33ecf092c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Jun 2025 18:51:59 -0700 Subject: [PATCH 615/719] chore(deps): bump codecov/test-results-action from 1.1.0 to 1.1.1 (#1310) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 86fa4621c..a1135f265 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,7 +73,7 @@ jobs: pytest tests/scenario_tests_async/ --junitxml=reports/test_scenario_async.xml - name: Upload test results to Codecov if: ${{ !cancelled() }} - uses: codecov/test-results-action@f2dba722c67b86c6caa034178c6e4d35335f6706 # v1.1.0 + uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # v1.1.1 with: directory: ./reports/ flags: ${{ matrix.python-version }} From 79fb18add72b40599dbb1322c41ddf2812c4b2e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Jun 2025 18:55:58 -0700 Subject: [PATCH 616/719] chore(deps): bump the docusaurus group in /docs with 5 updates (#1311) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Michael Brooks --- docs/package-lock.json | 1990 ++++++++++++++++------------------------ docs/package.json | 10 +- 2 files changed, 778 insertions(+), 1222 deletions(-) diff --git a/docs/package-lock.json b/docs/package-lock.json index ec9caf660..303f5487a 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -8,9 +8,9 @@ "name": "website", "version": "2024.08.01", "dependencies": { - "@docusaurus/core": "3.7.0", - "@docusaurus/plugin-client-redirects": "^3.7.0", - "@docusaurus/preset-classic": "3.7.0", + "@docusaurus/core": "3.8.0", + "@docusaurus/plugin-client-redirects": "^3.8.0", + "@docusaurus/preset-classic": "3.8.0", "@mdx-js/react": "^3.1.0", "clsx": "^2.0.0", "docusaurus-theme-github-codeblock": "^2.0.2", @@ -19,8 +19,8 @@ "react-dom": "^19.1.0" }, "devDependencies": { - "@docusaurus/module-type-aliases": "3.7.0", - "@docusaurus/types": "3.7.0" + "@docusaurus/module-type-aliases": "3.8.0", + "@docusaurus/types": "3.8.0" }, "engines": { "node": ">=20.0" @@ -72,99 +72,99 @@ } }, "node_modules/@algolia/client-abtesting": { - "version": "5.20.4", - "resolved": "https://registry.npmjs.org/@algolia/client-abtesting/-/client-abtesting-5.20.4.tgz", - "integrity": "sha512-OZ3Xvvf+k7NMcwmmioIVX+76E/KKtN607NCMNsBEKe+uHqktZ+I5bmi/EVr2m5VF59Gnh9MTlJCdXtBiGjruxw==", + "version": "5.25.0", + "resolved": "https://registry.npmjs.org/@algolia/client-abtesting/-/client-abtesting-5.25.0.tgz", + "integrity": "sha512-1pfQulNUYNf1Tk/svbfjfkLBS36zsuph6m+B6gDkPEivFmso/XnRgwDvjAx80WNtiHnmeNjIXdF7Gos8+OLHqQ==", "license": "MIT", "dependencies": { - "@algolia/client-common": "5.20.4", - "@algolia/requester-browser-xhr": "5.20.4", - "@algolia/requester-fetch": "5.20.4", - "@algolia/requester-node-http": "5.20.4" + "@algolia/client-common": "5.25.0", + "@algolia/requester-browser-xhr": "5.25.0", + "@algolia/requester-fetch": "5.25.0", + "@algolia/requester-node-http": "5.25.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/client-analytics": { - "version": "5.20.4", - "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-5.20.4.tgz", - "integrity": "sha512-8pM5zQpHonCIBxKmMyBLgQoaSKUNBE5u741VEIjn2ArujolhoKRXempRAlLwEg5hrORKl9XIlit00ff4g6LWvA==", + "version": "5.25.0", + "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-5.25.0.tgz", + "integrity": "sha512-AFbG6VDJX/o2vDd9hqncj1B6B4Tulk61mY0pzTtzKClyTDlNP0xaUiEKhl6E7KO9I/x0FJF5tDCm0Hn6v5x18A==", "license": "MIT", "dependencies": { - "@algolia/client-common": "5.20.4", - "@algolia/requester-browser-xhr": "5.20.4", - "@algolia/requester-fetch": "5.20.4", - "@algolia/requester-node-http": "5.20.4" + "@algolia/client-common": "5.25.0", + "@algolia/requester-browser-xhr": "5.25.0", + "@algolia/requester-fetch": "5.25.0", + "@algolia/requester-node-http": "5.25.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/client-common": { - "version": "5.20.4", - "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-5.20.4.tgz", - "integrity": "sha512-OCGa8hKAP6kQKBwi+tu9flTXshz4qeCK5P8J6bI1qq8KYs+/TU1xSotT+E7hO+uyDanGU6dT6soiMSi4A38JgA==", + "version": "5.25.0", + "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-5.25.0.tgz", + "integrity": "sha512-il1zS/+Rc6la6RaCdSZ2YbJnkQC6W1wiBO8+SH+DE6CPMWBU6iDVzH0sCKSAtMWl9WBxoN6MhNjGBnCv9Yy2bA==", "license": "MIT", "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/client-insights": { - "version": "5.20.4", - "resolved": "https://registry.npmjs.org/@algolia/client-insights/-/client-insights-5.20.4.tgz", - "integrity": "sha512-MroyJStJFLf/cYeCbguCRdrA2U6miDVqbi3t9ZGovBWWTef7BZwVQG0mLyInzp4MIjBfwqu3xTrhxsiiOavX3A==", + "version": "5.25.0", + "resolved": "https://registry.npmjs.org/@algolia/client-insights/-/client-insights-5.25.0.tgz", + "integrity": "sha512-blbjrUH1siZNfyCGeq0iLQu00w3a4fBXm0WRIM0V8alcAPo7rWjLbMJMrfBtzL9X5ic6wgxVpDADXduGtdrnkw==", "license": "MIT", "dependencies": { - "@algolia/client-common": "5.20.4", - "@algolia/requester-browser-xhr": "5.20.4", - "@algolia/requester-fetch": "5.20.4", - "@algolia/requester-node-http": "5.20.4" + "@algolia/client-common": "5.25.0", + "@algolia/requester-browser-xhr": "5.25.0", + "@algolia/requester-fetch": "5.25.0", + "@algolia/requester-node-http": "5.25.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/client-personalization": { - "version": "5.20.4", - "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-5.20.4.tgz", - "integrity": "sha512-bVR5sxFfgCQ+G0ZegGVhBqtaDd7jCfr33m5mGuT43U+bH//xeqAHQyIS4abcmRulwqeIAHNm5Yl2J7grT3z//A==", + "version": "5.25.0", + "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-5.25.0.tgz", + "integrity": "sha512-aywoEuu1NxChBcHZ1pWaat0Plw7A8jDMwjgRJ00Mcl7wGlwuPt5dJ/LTNcg3McsEUbs2MBNmw0ignXBw9Tbgow==", "license": "MIT", "dependencies": { - "@algolia/client-common": "5.20.4", - "@algolia/requester-browser-xhr": "5.20.4", - "@algolia/requester-fetch": "5.20.4", - "@algolia/requester-node-http": "5.20.4" + "@algolia/client-common": "5.25.0", + "@algolia/requester-browser-xhr": "5.25.0", + "@algolia/requester-fetch": "5.25.0", + "@algolia/requester-node-http": "5.25.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/client-query-suggestions": { - "version": "5.20.4", - "resolved": "https://registry.npmjs.org/@algolia/client-query-suggestions/-/client-query-suggestions-5.20.4.tgz", - "integrity": "sha512-ZHsV0vceNDR87wIVaz7VjxilwCUCkzbuy4QnqIdnQs3NnC43is7KKbEtKueuNw+YGMdx+wmD5kRI2XKip1R93A==", + "version": "5.25.0", + "resolved": "https://registry.npmjs.org/@algolia/client-query-suggestions/-/client-query-suggestions-5.25.0.tgz", + "integrity": "sha512-a/W2z6XWKjKjIW1QQQV8PTTj1TXtaKx79uR3NGBdBdGvVdt24KzGAaN7sCr5oP8DW4D3cJt44wp2OY/fZcPAVA==", "license": "MIT", "dependencies": { - "@algolia/client-common": "5.20.4", - "@algolia/requester-browser-xhr": "5.20.4", - "@algolia/requester-fetch": "5.20.4", - "@algolia/requester-node-http": "5.20.4" + "@algolia/client-common": "5.25.0", + "@algolia/requester-browser-xhr": "5.25.0", + "@algolia/requester-fetch": "5.25.0", + "@algolia/requester-node-http": "5.25.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/client-search": { - "version": "5.20.4", - "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-5.20.4.tgz", - "integrity": "sha512-hXM2LpwTzG5kGQSyq3feIijzzl6vkjYPP+LF3ru1relNUIh7fWJ4uYQay2NMNbWX5LWQzF8Vr9qlIA139doQXg==", + "version": "5.25.0", + "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-5.25.0.tgz", + "integrity": "sha512-9rUYcMIBOrCtYiLX49djyzxqdK9Dya/6Z/8sebPn94BekT+KLOpaZCuc6s0Fpfq7nx5J6YY5LIVFQrtioK9u0g==", "license": "MIT", "dependencies": { - "@algolia/client-common": "5.20.4", - "@algolia/requester-browser-xhr": "5.20.4", - "@algolia/requester-fetch": "5.20.4", - "@algolia/requester-node-http": "5.20.4" + "@algolia/client-common": "5.25.0", + "@algolia/requester-browser-xhr": "5.25.0", + "@algolia/requester-fetch": "5.25.0", + "@algolia/requester-node-http": "5.25.0" }, "engines": { "node": ">= 14.0.0" @@ -177,81 +177,81 @@ "license": "MIT" }, "node_modules/@algolia/ingestion": { - "version": "1.20.4", - "resolved": "https://registry.npmjs.org/@algolia/ingestion/-/ingestion-1.20.4.tgz", - "integrity": "sha512-idAe53XsTlLSSQ7pJcjscUEmc67vEM+VohYkr78Ebfb43vtfKH0ik8ux9OGQpLRNGntaHqpe/lfU5PDRi5/92w==", + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/@algolia/ingestion/-/ingestion-1.25.0.tgz", + "integrity": "sha512-jJeH/Hk+k17Vkokf02lkfYE4A+EJX+UgnMhTLR/Mb+d1ya5WhE+po8p5a/Nxb6lo9OLCRl6w3Hmk1TX1e9gVbQ==", "license": "MIT", "dependencies": { - "@algolia/client-common": "5.20.4", - "@algolia/requester-browser-xhr": "5.20.4", - "@algolia/requester-fetch": "5.20.4", - "@algolia/requester-node-http": "5.20.4" + "@algolia/client-common": "5.25.0", + "@algolia/requester-browser-xhr": "5.25.0", + "@algolia/requester-fetch": "5.25.0", + "@algolia/requester-node-http": "5.25.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/monitoring": { - "version": "1.20.4", - "resolved": "https://registry.npmjs.org/@algolia/monitoring/-/monitoring-1.20.4.tgz", - "integrity": "sha512-O6HjdSWtyu5LhHR7gdU83oWbl1vVVRwoTxkENHF61Ar7l9C1Ok91VtnK7RtXB9pJL1kpIMDExwZOT5sEN2Ppfw==", + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/@algolia/monitoring/-/monitoring-1.25.0.tgz", + "integrity": "sha512-Ls3i1AehJ0C6xaHe7kK9vPmzImOn5zBg7Kzj8tRYIcmCWVyuuFwCIsbuIIz/qzUf1FPSWmw0TZrGeTumk2fqXg==", "license": "MIT", "dependencies": { - "@algolia/client-common": "5.20.4", - "@algolia/requester-browser-xhr": "5.20.4", - "@algolia/requester-fetch": "5.20.4", - "@algolia/requester-node-http": "5.20.4" + "@algolia/client-common": "5.25.0", + "@algolia/requester-browser-xhr": "5.25.0", + "@algolia/requester-fetch": "5.25.0", + "@algolia/requester-node-http": "5.25.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/recommend": { - "version": "5.20.4", - "resolved": "https://registry.npmjs.org/@algolia/recommend/-/recommend-5.20.4.tgz", - "integrity": "sha512-p8M78pQjPrN6PudO2TnkWiOJbyp/IPhgCFBW8aZrLshhZpPkV9N4u0YsU/w6OoeYDKSxmXntWQrKYiU1dVRWfg==", + "version": "5.25.0", + "resolved": "https://registry.npmjs.org/@algolia/recommend/-/recommend-5.25.0.tgz", + "integrity": "sha512-79sMdHpiRLXVxSjgw7Pt4R1aNUHxFLHiaTDnN2MQjHwJ1+o3wSseb55T9VXU4kqy3m7TUme3pyRhLk5ip/S4Mw==", "license": "MIT", "dependencies": { - "@algolia/client-common": "5.20.4", - "@algolia/requester-browser-xhr": "5.20.4", - "@algolia/requester-fetch": "5.20.4", - "@algolia/requester-node-http": "5.20.4" + "@algolia/client-common": "5.25.0", + "@algolia/requester-browser-xhr": "5.25.0", + "@algolia/requester-fetch": "5.25.0", + "@algolia/requester-node-http": "5.25.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/requester-browser-xhr": { - "version": "5.20.4", - "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-5.20.4.tgz", - "integrity": "sha512-Y8GThjDVdhFUurZKKDdzAML/LNKOA/BOydEcaFeb/g4Iv4Iq0qQJs6aIbtdsngUU6cu74qH/2P84kr2h16uVvQ==", + "version": "5.25.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-5.25.0.tgz", + "integrity": "sha512-JLaF23p1SOPBmfEqozUAgKHQrGl3z/Z5RHbggBu6s07QqXXcazEsub5VLonCxGVqTv6a61AAPr8J1G5HgGGjEw==", "license": "MIT", "dependencies": { - "@algolia/client-common": "5.20.4" + "@algolia/client-common": "5.25.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/requester-fetch": { - "version": "5.20.4", - "resolved": "https://registry.npmjs.org/@algolia/requester-fetch/-/requester-fetch-5.20.4.tgz", - "integrity": "sha512-OrAUSrvbFi46U7AxOXkyl9QQiaW21XWpixWmcx3D2S65P/DCIGOVE6K2741ZE+WiKIqp+RSYkyDFj3BiFHzLTg==", + "version": "5.25.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-fetch/-/requester-fetch-5.25.0.tgz", + "integrity": "sha512-rtzXwqzFi1edkOF6sXxq+HhmRKDy7tz84u0o5t1fXwz0cwx+cjpmxu/6OQKTdOJFS92JUYHsG51Iunie7xbqfQ==", "license": "MIT", "dependencies": { - "@algolia/client-common": "5.20.4" + "@algolia/client-common": "5.25.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/requester-node-http": { - "version": "5.20.4", - "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-5.20.4.tgz", - "integrity": "sha512-Jc/bofGBw4P9nBii4oCzCqqusv8DAFFORfUD2Ce1cZk3fvUPk+q/Qnu7i9JpTSHjMc0MWzqApLdq7Nwh1gelLg==", + "version": "5.25.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-5.25.0.tgz", + "integrity": "sha512-ZO0UKvDyEFvyeJQX0gmZDQEvhLZ2X10K+ps6hViMo1HgE2V8em00SwNsQ+7E/52a+YiBkVWX61pJJJE44juDMQ==", "license": "MIT", "dependencies": { - "@algolia/client-common": "5.20.4" + "@algolia/client-common": "5.25.0" }, "engines": { "node": ">= 14.0.0" @@ -270,13 +270,14 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", - "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.25.9", + "@babel/helper-validator-identifier": "^7.27.1", "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" + "picocolors": "^1.1.1" }, "engines": { "node": ">=6.9.0" @@ -328,12 +329,13 @@ } }, "node_modules/@babel/generator": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.2.tgz", - "integrity": "sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==", + "version": "7.27.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.3.tgz", + "integrity": "sha512-xnlJYj5zepml8NXtjkG0WquFUv8RskFqyFcVgTBp5k+NaA/8uw/K+OSVf8AMGw5e9HKP2ETd5xpK5MLZQD6b4Q==", + "license": "MIT", "dependencies": { - "@babel/parser": "^7.26.2", - "@babel/types": "^7.26.0", + "@babel/parser": "^7.27.3", + "@babel/types": "^7.27.3", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^3.0.2" @@ -441,9 +443,10 @@ } }, "node_modules/@babel/helper-define-polyfill-provider": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.2.tgz", - "integrity": "sha512-LV76g+C502biUK6AyZ3LK10vDpDyCzZnhZFXkH1L75zHPj68+qc8Zfpx2th+gzwA2MzyK+1g/3EPl62yFnVttQ==", + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.4.tgz", + "integrity": "sha512-jljfR1rGnXXNWnmQg2K3+bvhkxB51Rl32QRaOTuwwjviGrHzIbSc8+x9CpraDtbT7mfyjXObULP4w/adunNwAw==", + "license": "MIT", "dependencies": { "@babel/helper-compilation-targets": "^7.22.6", "@babel/helper-plugin-utils": "^7.22.5", @@ -468,12 +471,13 @@ } }, "node_modules/@babel/helper-module-imports": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", - "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", + "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", + "license": "MIT", "dependencies": { - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.25.9" + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -507,9 +511,9 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.26.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.26.5.tgz", - "integrity": "sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz", + "integrity": "sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==", "license": "MIT", "engines": { "node": ">=6.9.0" @@ -572,17 +576,19 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", - "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", - "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", + "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -622,12 +628,12 @@ } }, "node_modules/@babel/parser": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.10.tgz", - "integrity": "sha512-6aQR2zGE/QFi8JpDLjUZEPYOs7+mhKXm86VaKFiLP35JQwQb6bwUE+XbvkH0EptsYhbNBSUGaUBLKqxH1xSgsA==", + "version": "7.27.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.4.tgz", + "integrity": "sha512-BRmLHGwpUqLFR2jzx9orBuX/ABDkj2jLKOXrHDTN2aOKL+jFDDKaRNo9nyYsIl9h/UE/7lMKdDjKQQyxKKDZ7g==", "license": "MIT", "dependencies": { - "@babel/types": "^7.26.10" + "@babel/types": "^7.27.3" }, "bin": { "parser": "bin/babel-parser.js" @@ -1370,12 +1376,12 @@ } }, "node_modules/@babel/plugin-transform-react-constant-elements": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.25.9.tgz", - "integrity": "sha512-Ncw2JFsJVuvfRsa2lSHiC55kETQVLSnsYGQ1JDDwkUeWGTL/8Tom8aLTnlqgoeuopWrbbGndrc9AlLYrIosrow==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.27.1.tgz", + "integrity": "sha512-edoidOjl/ZxvYo4lSBOQGDSyToYVkTAwyVoa2tkuYTSmjrB1+uAedoL5iROVLXkxH+vRgA7uP4tMg2pUJpZ3Ug==", "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1490,15 +1496,15 @@ } }, "node_modules/@babel/plugin-transform-runtime": { - "version": "7.26.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.26.9.tgz", - "integrity": "sha512-Jf+8y9wXQbbxvVYTM8gO5oEF2POdNji0NMltEkG7FtmzD9PVz7/lxpqSdTvwsjTMU5HIHuDVNf2SOxLkWi+wPQ==", + "version": "7.27.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.27.4.tgz", + "integrity": "sha512-D68nR5zxU64EUzV8i7T3R5XP0Xhrou/amNnddsRQssx6GrTLdZl1rLxyjtVZBd+v/NVX4AbTPOB5aU8thAZV1A==", "license": "MIT", "dependencies": { - "@babel/helper-module-imports": "^7.25.9", - "@babel/helper-plugin-utils": "^7.26.5", + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-plugin-utils": "^7.27.1", "babel-plugin-polyfill-corejs2": "^0.4.10", - "babel-plugin-polyfill-corejs3": "^0.10.6", + "babel-plugin-polyfill-corejs3": "^0.11.0", "babel-plugin-polyfill-regenerator": "^0.6.1", "semver": "^6.3.1" }, @@ -1509,6 +1515,19 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-transform-runtime/node_modules/babel-plugin-polyfill-corejs3": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.11.1.tgz", + "integrity": "sha512-yGCqvBT4rwMczo28xkH/noxJ6MZ4nJfkVYdoDaC/utLtWrXxv27HVrzAeSbqR8SxDsp46n0YF47EbHoixy6rXQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.3", + "core-js-compat": "^3.40.0" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, "node_modules/@babel/plugin-transform-runtime/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -1819,42 +1838,42 @@ } }, "node_modules/@babel/runtime-corejs3": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.26.10.tgz", - "integrity": "sha512-uITFQYO68pMEYR46AHgQoyBg7KPPJDAbGn4jUTIRgCFJIp88MIBUianVOplhZDEec07bp9zIyr4Kp0FCyQzmWg==", + "version": "7.27.4", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.27.4.tgz", + "integrity": "sha512-H7QhL0ucCGOObsUETNbB2PuzF4gAvN8p32P6r91bX7M/hk4bx+3yz2hTwHL9d/Efzwu1upeb4/cd7oSxCzup3w==", "license": "MIT", "dependencies": { - "core-js-pure": "^3.30.2", - "regenerator-runtime": "^0.14.0" + "core-js-pure": "^3.30.2" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/template": { - "version": "7.26.9", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz", - "integrity": "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA==", + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", + "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.26.2", - "@babel/parser": "^7.26.9", - "@babel/types": "^7.26.9" + "@babel/code-frame": "^7.27.1", + "@babel/parser": "^7.27.2", + "@babel/types": "^7.27.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz", - "integrity": "sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==", + "version": "7.27.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.4.tgz", + "integrity": "sha512-oNcu2QbHqts9BtOWJosOVJapWjBDSxGCpFvikNR5TGDYDQf3JwpIoMzIKrvfoti93cLfPJEG4tH9SPVeyCGgdA==", + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.25.9", - "@babel/generator": "^7.25.9", - "@babel/parser": "^7.25.9", - "@babel/template": "^7.25.9", - "@babel/types": "^7.25.9", + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.27.3", + "@babel/parser": "^7.27.4", + "@babel/template": "^7.27.2", + "@babel/types": "^7.27.3", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -1863,13 +1882,13 @@ } }, "node_modules/@babel/types": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.10.tgz", - "integrity": "sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ==", + "version": "7.27.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.3.tgz", + "integrity": "sha512-Y1GkI4ktrtvmawoSq+4FCVHNryea6uR+qUQy0AGxLSsjCX0nVmkYQMBLHDkXZuo5hGx7eYdnIaslsdBFm7zbUw==", "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.25.9", - "@babel/helper-validator-identifier": "^7.25.9" + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1886,9 +1905,9 @@ } }, "node_modules/@csstools/cascade-layer-name-parser": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@csstools/cascade-layer-name-parser/-/cascade-layer-name-parser-2.0.4.tgz", - "integrity": "sha512-7DFHlPuIxviKYZrOiwVU/PiHLm3lLUR23OMuEEtfEOQTOp9hzQ2JjdY6X5H18RVuUPJqSCI+qNnD5iOLMVE0bA==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@csstools/cascade-layer-name-parser/-/cascade-layer-name-parser-2.0.5.tgz", + "integrity": "sha512-p1ko5eHgV+MgXFVa4STPKpvPxr6ReS8oS2jzTukjR74i5zJNyWO1ZM1m8YKBXnzDKWfBN1ztLYlHxbVemDD88A==", "funding": [ { "type": "github", @@ -1904,8 +1923,8 @@ "node": ">=18" }, "peerDependencies": { - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3" + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" } }, "node_modules/@csstools/color-helpers": { @@ -1928,9 +1947,9 @@ } }, "node_modules/@csstools/css-calc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.2.tgz", - "integrity": "sha512-TklMyb3uBB28b5uQdxjReG4L80NxAqgrECqLZFQbyLekwwlcDDS8r3f07DKqeo8C4926Br0gf/ZDe17Zv4wIuw==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.4.tgz", + "integrity": "sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==", "funding": [ { "type": "github", @@ -1946,14 +1965,14 @@ "node": ">=18" }, "peerDependencies": { - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3" + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" } }, "node_modules/@csstools/css-color-parser": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.0.8.tgz", - "integrity": "sha512-pdwotQjCCnRPuNi06jFuP68cykU1f3ZWExLe/8MQ1LOs8Xq+fTkYgd+2V8mWUWMrOn9iS2HftPVaMZDaXzGbhQ==", + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.0.10.tgz", + "integrity": "sha512-TiJ5Ajr6WRd1r8HSiwJvZBiJOqtH86aHpUjq5aEKWHiII2Qfjqd/HCWKPOW8EP4vcspXbHnXrwIDlu5savQipg==", "funding": [ { "type": "github", @@ -1967,20 +1986,20 @@ "license": "MIT", "dependencies": { "@csstools/color-helpers": "^5.0.2", - "@csstools/css-calc": "^2.1.2" + "@csstools/css-calc": "^2.1.4" }, "engines": { "node": ">=18" }, "peerDependencies": { - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3" + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" } }, "node_modules/@csstools/css-parser-algorithms": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.4.tgz", - "integrity": "sha512-Up7rBoV77rv29d3uKHUIVubz1BTcgyUK72IvCQAbfbMv584xHcGKCKbWh7i8hPrRJ7qU4Y8IO3IY9m+iTB7P3A==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.5.tgz", + "integrity": "sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==", "funding": [ { "type": "github", @@ -1996,13 +2015,13 @@ "node": ">=18" }, "peerDependencies": { - "@csstools/css-tokenizer": "^3.0.3" + "@csstools/css-tokenizer": "^3.0.4" } }, "node_modules/@csstools/css-tokenizer": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.3.tgz", - "integrity": "sha512-UJnjoFsmxfKUdNYdWgOB0mWUypuLvAfQPH1+pyvRJs6euowbFkFC6P13w1l8mJyi3vxYMxc9kld5jZEGRQs6bw==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.4.tgz", + "integrity": "sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==", "funding": [ { "type": "github", @@ -2019,9 +2038,9 @@ } }, "node_modules/@csstools/media-query-list-parser": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-4.0.2.tgz", - "integrity": "sha512-EUos465uvVvMJehckATTlNqGj4UJWkTmdWuDMjqvSUkjGpmOyFZBVwb4knxCm/k2GMTXY+c/5RkdndzFYWeX5A==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-4.0.3.tgz", + "integrity": "sha512-HAYH7d3TLRHDOUQK4mZKf9k9Ph/m8Akstg66ywKR4SFAigjs3yBiUeZtFxywiTm5moZMAp/5W/ZuFnNXXYLuuQ==", "funding": [ { "type": "github", @@ -2037,8 +2056,8 @@ "node": ">=18" }, "peerDependencies": { - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3" + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" } }, "node_modules/@csstools/postcss-cascade-layers": { @@ -2103,9 +2122,9 @@ } }, "node_modules/@csstools/postcss-color-function": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/@csstools/postcss-color-function/-/postcss-color-function-4.0.8.tgz", - "integrity": "sha512-9dUvP2qpZI6PlGQ/sob+95B3u5u7nkYt9yhZFCC7G9HBRHBxj+QxS/wUlwaMGYW0waf+NIierI8aoDTssEdRYw==", + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/@csstools/postcss-color-function/-/postcss-color-function-4.0.10.tgz", + "integrity": "sha512-4dY0NBu7NVIpzxZRgh/Q/0GPSz/jLSw0i/u3LTUor0BkQcz/fNhN10mSWBDsL0p9nDb0Ky1PD6/dcGbhACuFTQ==", "funding": [ { "type": "github", @@ -2118,10 +2137,10 @@ ], "license": "MIT-0", "dependencies": { - "@csstools/css-color-parser": "^3.0.8", - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3", - "@csstools/postcss-progressive-custom-properties": "^4.0.0", + "@csstools/css-color-parser": "^3.0.10", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4", + "@csstools/postcss-progressive-custom-properties": "^4.1.0", "@csstools/utilities": "^2.0.0" }, "engines": { @@ -2132,9 +2151,38 @@ } }, "node_modules/@csstools/postcss-color-mix-function": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/@csstools/postcss-color-mix-function/-/postcss-color-mix-function-3.0.8.tgz", - "integrity": "sha512-yuZpgWUzqZWQhEqfvtJufhl28DgO9sBwSbXbf/59gejNuvZcoUTRGQZhzhwF4ccqb53YAGB+u92z9+eSKoB4YA==", + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@csstools/postcss-color-mix-function/-/postcss-color-mix-function-3.0.10.tgz", + "integrity": "sha512-P0lIbQW9I4ShE7uBgZRib/lMTf9XMjJkFl/d6w4EMNHu2qvQ6zljJGEcBkw/NsBtq/6q3WrmgxSS8kHtPMkK4Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT-0", + "dependencies": { + "@csstools/css-color-parser": "^3.0.10", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4", + "@csstools/postcss-progressive-custom-properties": "^4.1.0", + "@csstools/utilities": "^2.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "postcss": "^8.4" + } + }, + "node_modules/@csstools/postcss-color-mix-variadic-function-arguments": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@csstools/postcss-color-mix-variadic-function-arguments/-/postcss-color-mix-variadic-function-arguments-1.0.0.tgz", + "integrity": "sha512-Z5WhouTyD74dPFPrVE7KydgNS9VvnjB8qcdes9ARpCOItb4jTnm7cHp4FhxCRUoyhabD0WVv43wbkJ4p8hLAlQ==", "funding": [ { "type": "github", @@ -2147,10 +2195,10 @@ ], "license": "MIT-0", "dependencies": { - "@csstools/css-color-parser": "^3.0.8", - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3", - "@csstools/postcss-progressive-custom-properties": "^4.0.0", + "@csstools/css-color-parser": "^3.0.10", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4", + "@csstools/postcss-progressive-custom-properties": "^4.1.0", "@csstools/utilities": "^2.0.0" }, "engines": { @@ -2161,9 +2209,9 @@ } }, "node_modules/@csstools/postcss-content-alt-text": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@csstools/postcss-content-alt-text/-/postcss-content-alt-text-2.0.4.tgz", - "integrity": "sha512-YItlZUOuZJCBlRaCf8Aucc1lgN41qYGALMly0qQllrxYJhiyzlI6RxOTMUvtWk+KhS8GphMDsDhKQ7KTPfEMSw==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@csstools/postcss-content-alt-text/-/postcss-content-alt-text-2.0.6.tgz", + "integrity": "sha512-eRjLbOjblXq+byyaedQRSrAejKGNAFued+LcbzT+LCL78fabxHkxYjBbxkroONxHHYu2qxhFK2dBStTLPG3jpQ==", "funding": [ { "type": "github", @@ -2176,9 +2224,9 @@ ], "license": "MIT-0", "dependencies": { - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3", - "@csstools/postcss-progressive-custom-properties": "^4.0.0", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4", + "@csstools/postcss-progressive-custom-properties": "^4.1.0", "@csstools/utilities": "^2.0.0" }, "engines": { @@ -2189,9 +2237,9 @@ } }, "node_modules/@csstools/postcss-exponential-functions": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/@csstools/postcss-exponential-functions/-/postcss-exponential-functions-2.0.7.tgz", - "integrity": "sha512-XTb6Mw0v2qXtQYRW9d9duAjDnoTbBpsngD7sRNLmYDjvwU2ebpIHplyxgOeo6jp/Kr52gkLi5VaK5RDCqzMzZQ==", + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@csstools/postcss-exponential-functions/-/postcss-exponential-functions-2.0.9.tgz", + "integrity": "sha512-abg2W/PI3HXwS/CZshSa79kNWNZHdJPMBXeZNyPQFbbj8sKO3jXxOt/wF7juJVjyDTc6JrvaUZYFcSBZBhaxjw==", "funding": [ { "type": "github", @@ -2204,9 +2252,9 @@ ], "license": "MIT-0", "dependencies": { - "@csstools/css-calc": "^2.1.2", - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3" + "@csstools/css-calc": "^2.1.4", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" }, "engines": { "node": ">=18" @@ -2242,9 +2290,9 @@ } }, "node_modules/@csstools/postcss-gamut-mapping": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@csstools/postcss-gamut-mapping/-/postcss-gamut-mapping-2.0.8.tgz", - "integrity": "sha512-/K8u9ZyGMGPjmwCSIjgaOLKfic2RIGdFHHes84XW5LnmrvdhOTVxo255NppHi3ROEvoHPW7MplMJgjZK5Q+TxA==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@csstools/postcss-gamut-mapping/-/postcss-gamut-mapping-2.0.10.tgz", + "integrity": "sha512-QDGqhJlvFnDlaPAfCYPsnwVA6ze+8hhrwevYWlnUeSjkkZfBpcCO42SaUD8jiLlq7niouyLgvup5lh+f1qessg==", "funding": [ { "type": "github", @@ -2257,9 +2305,9 @@ ], "license": "MIT-0", "dependencies": { - "@csstools/css-color-parser": "^3.0.8", - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3" + "@csstools/css-color-parser": "^3.0.10", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" }, "engines": { "node": ">=18" @@ -2269,9 +2317,9 @@ } }, "node_modules/@csstools/postcss-gradients-interpolation-method": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/@csstools/postcss-gradients-interpolation-method/-/postcss-gradients-interpolation-method-5.0.8.tgz", - "integrity": "sha512-CoHQ/0UXrvxLovu0ZeW6c3/20hjJ/QRg6lyXm3dZLY/JgvRU6bdbQZF/Du30A4TvowfcgvIHQmP1bNXUxgDrAw==", + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/@csstools/postcss-gradients-interpolation-method/-/postcss-gradients-interpolation-method-5.0.10.tgz", + "integrity": "sha512-HHPauB2k7Oits02tKFUeVFEU2ox/H3OQVrP3fSOKDxvloOikSal+3dzlyTZmYsb9FlY9p5EUpBtz0//XBmy+aw==", "funding": [ { "type": "github", @@ -2284,10 +2332,10 @@ ], "license": "MIT-0", "dependencies": { - "@csstools/css-color-parser": "^3.0.8", - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3", - "@csstools/postcss-progressive-custom-properties": "^4.0.0", + "@csstools/css-color-parser": "^3.0.10", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4", + "@csstools/postcss-progressive-custom-properties": "^4.1.0", "@csstools/utilities": "^2.0.0" }, "engines": { @@ -2298,9 +2346,9 @@ } }, "node_modules/@csstools/postcss-hwb-function": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/@csstools/postcss-hwb-function/-/postcss-hwb-function-4.0.8.tgz", - "integrity": "sha512-LpFKjX6hblpeqyych1cKmk+3FJZ19QmaJtqincySoMkbkG/w2tfbnO5oE6mlnCTXcGUJ0rCEuRHvTqKK0nHYUQ==", + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/@csstools/postcss-hwb-function/-/postcss-hwb-function-4.0.10.tgz", + "integrity": "sha512-nOKKfp14SWcdEQ++S9/4TgRKchooLZL0TUFdun3nI4KPwCjETmhjta1QT4ICQcGVWQTvrsgMM/aLB5We+kMHhQ==", "funding": [ { "type": "github", @@ -2313,10 +2361,10 @@ ], "license": "MIT-0", "dependencies": { - "@csstools/css-color-parser": "^3.0.8", - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3", - "@csstools/postcss-progressive-custom-properties": "^4.0.0", + "@csstools/css-color-parser": "^3.0.10", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4", + "@csstools/postcss-progressive-custom-properties": "^4.1.0", "@csstools/utilities": "^2.0.0" }, "engines": { @@ -2327,9 +2375,9 @@ } }, "node_modules/@csstools/postcss-ic-unit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@csstools/postcss-ic-unit/-/postcss-ic-unit-4.0.0.tgz", - "integrity": "sha512-9QT5TDGgx7wD3EEMN3BSUG6ckb6Eh5gSPT5kZoVtUuAonfPmLDJyPhqR4ntPpMYhUKAMVKAg3I/AgzqHMSeLhA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@csstools/postcss-ic-unit/-/postcss-ic-unit-4.0.2.tgz", + "integrity": "sha512-lrK2jjyZwh7DbxaNnIUjkeDmU8Y6KyzRBk91ZkI5h8nb1ykEfZrtIVArdIjX4DHMIBGpdHrgP0n4qXDr7OHaKA==", "funding": [ { "type": "github", @@ -2342,7 +2390,7 @@ ], "license": "MIT-0", "dependencies": { - "@csstools/postcss-progressive-custom-properties": "^4.0.0", + "@csstools/postcss-progressive-custom-properties": "^4.1.0", "@csstools/utilities": "^2.0.0", "postcss-value-parser": "^4.2.0" }, @@ -2437,9 +2485,9 @@ } }, "node_modules/@csstools/postcss-light-dark-function": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/@csstools/postcss-light-dark-function/-/postcss-light-dark-function-2.0.7.tgz", - "integrity": "sha512-ZZ0rwlanYKOHekyIPaU+sVm3BEHCe+Ha0/px+bmHe62n0Uc1lL34vbwrLYn6ote8PHlsqzKeTQdIejQCJ05tfw==", + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@csstools/postcss-light-dark-function/-/postcss-light-dark-function-2.0.9.tgz", + "integrity": "sha512-1tCZH5bla0EAkFAI2r0H33CDnIBeLUaJh1p+hvvsylJ4svsv2wOmJjJn+OXwUZLXef37GYbRIVKX+X+g6m+3CQ==", "funding": [ { "type": "github", @@ -2452,9 +2500,9 @@ ], "license": "MIT-0", "dependencies": { - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3", - "@csstools/postcss-progressive-custom-properties": "^4.0.0", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4", + "@csstools/postcss-progressive-custom-properties": "^4.1.0", "@csstools/utilities": "^2.0.0" }, "engines": { @@ -2556,9 +2604,9 @@ } }, "node_modules/@csstools/postcss-logical-viewport-units": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@csstools/postcss-logical-viewport-units/-/postcss-logical-viewport-units-3.0.3.tgz", - "integrity": "sha512-OC1IlG/yoGJdi0Y+7duz/kU/beCwO+Gua01sD6GtOtLi7ByQUpcIqs7UE/xuRPay4cHgOMatWdnDdsIDjnWpPw==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@csstools/postcss-logical-viewport-units/-/postcss-logical-viewport-units-3.0.4.tgz", + "integrity": "sha512-q+eHV1haXA4w9xBwZLKjVKAWn3W2CMqmpNpZUk5kRprvSiBEGMgrNH3/sJZ8UA3JgyHaOt3jwT9uFa4wLX4EqQ==", "funding": [ { "type": "github", @@ -2571,7 +2619,7 @@ ], "license": "MIT-0", "dependencies": { - "@csstools/css-tokenizer": "^3.0.3", + "@csstools/css-tokenizer": "^3.0.4", "@csstools/utilities": "^2.0.0" }, "engines": { @@ -2582,9 +2630,9 @@ } }, "node_modules/@csstools/postcss-media-minmax": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/@csstools/postcss-media-minmax/-/postcss-media-minmax-2.0.7.tgz", - "integrity": "sha512-LB6tIP7iBZb5CYv8iRenfBZmbaG3DWNEziOnPjGoQX5P94FBPvvTBy68b/d9NnS5PELKwFmmOYsAEIgEhDPCHA==", + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@csstools/postcss-media-minmax/-/postcss-media-minmax-2.0.9.tgz", + "integrity": "sha512-af9Qw3uS3JhYLnCbqtZ9crTvvkR+0Se+bBqSr7ykAnl9yKhk6895z9rf+2F4dClIDJWxgn0iZZ1PSdkhrbs2ig==", "funding": [ { "type": "github", @@ -2597,10 +2645,10 @@ ], "license": "MIT", "dependencies": { - "@csstools/css-calc": "^2.1.2", - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3", - "@csstools/media-query-list-parser": "^4.0.2" + "@csstools/css-calc": "^2.1.4", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4", + "@csstools/media-query-list-parser": "^4.0.3" }, "engines": { "node": ">=18" @@ -2610,9 +2658,9 @@ } }, "node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@csstools/postcss-media-queries-aspect-ratio-number-values/-/postcss-media-queries-aspect-ratio-number-values-3.0.4.tgz", - "integrity": "sha512-AnGjVslHMm5xw9keusQYvjVWvuS7KWK+OJagaG0+m9QnIjZsrysD2kJP/tr/UJIyYtMCtu8OkUd+Rajb4DqtIQ==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@csstools/postcss-media-queries-aspect-ratio-number-values/-/postcss-media-queries-aspect-ratio-number-values-3.0.5.tgz", + "integrity": "sha512-zhAe31xaaXOY2Px8IYfoVTB3wglbJUVigGphFLj6exb7cjZRH9A6adyE22XfFK3P2PzwRk0VDeTJmaxpluyrDg==", "funding": [ { "type": "github", @@ -2625,9 +2673,9 @@ ], "license": "MIT-0", "dependencies": { - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3", - "@csstools/media-query-list-parser": "^4.0.2" + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4", + "@csstools/media-query-list-parser": "^4.0.3" }, "engines": { "node": ">=18" @@ -2688,9 +2736,9 @@ } }, "node_modules/@csstools/postcss-oklab-function": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/@csstools/postcss-oklab-function/-/postcss-oklab-function-4.0.8.tgz", - "integrity": "sha512-+5aPsNWgxohXoYNS1f+Ys0x3Qnfehgygv3qrPyv+Y25G0yX54/WlVB+IXprqBLOXHM1gsVF+QQSjlArhygna0Q==", + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/@csstools/postcss-oklab-function/-/postcss-oklab-function-4.0.10.tgz", + "integrity": "sha512-ZzZUTDd0fgNdhv8UUjGCtObPD8LYxMH+MJsW9xlZaWTV8Ppr4PtxlHYNMmF4vVWGl0T6f8tyWAKjoI6vePSgAg==", "funding": [ { "type": "github", @@ -2703,10 +2751,10 @@ ], "license": "MIT-0", "dependencies": { - "@csstools/css-color-parser": "^3.0.8", - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3", - "@csstools/postcss-progressive-custom-properties": "^4.0.0", + "@csstools/css-color-parser": "^3.0.10", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4", + "@csstools/postcss-progressive-custom-properties": "^4.1.0", "@csstools/utilities": "^2.0.0" }, "engines": { @@ -2717,9 +2765,9 @@ } }, "node_modules/@csstools/postcss-progressive-custom-properties": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@csstools/postcss-progressive-custom-properties/-/postcss-progressive-custom-properties-4.0.0.tgz", - "integrity": "sha512-XQPtROaQjomnvLUSy/bALTR5VCtTVUFwYs1SblvYgLSeTo2a/bMNwUwo2piXw5rTv/FEYiy5yPSXBqg9OKUx7Q==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@csstools/postcss-progressive-custom-properties/-/postcss-progressive-custom-properties-4.1.0.tgz", + "integrity": "sha512-YrkI9dx8U4R8Sz2EJaoeD9fI7s7kmeEBfmO+UURNeL6lQI7VxF6sBE+rSqdCBn4onwqmxFdBU3lTwyYb/lCmxA==", "funding": [ { "type": "github", @@ -2742,9 +2790,9 @@ } }, "node_modules/@csstools/postcss-random-function": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@csstools/postcss-random-function/-/postcss-random-function-1.0.3.tgz", - "integrity": "sha512-dbNeEEPHxAwfQJ3duRL5IPpuD77QAHtRl4bAHRs0vOVhVbHrsL7mHnwe0irYjbs9kYwhAHZBQTLBgmvufPuRkA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@csstools/postcss-random-function/-/postcss-random-function-2.0.1.tgz", + "integrity": "sha512-q+FQaNiRBhnoSNo+GzqGOIBKoHQ43lYz0ICrV+UudfWnEF6ksS6DsBIJSISKQT2Bvu3g4k6r7t0zYrk5pDlo8w==", "funding": [ { "type": "github", @@ -2757,9 +2805,9 @@ ], "license": "MIT-0", "dependencies": { - "@csstools/css-calc": "^2.1.2", - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3" + "@csstools/css-calc": "^2.1.4", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" }, "engines": { "node": ">=18" @@ -2769,9 +2817,9 @@ } }, "node_modules/@csstools/postcss-relative-color-syntax": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/@csstools/postcss-relative-color-syntax/-/postcss-relative-color-syntax-3.0.8.tgz", - "integrity": "sha512-eGE31oLnJDoUysDdjS9MLxNZdtqqSxjDXMdISpLh80QMaYrKs7VINpid34tWQ+iU23Wg5x76qAzf1Q/SLLbZVg==", + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@csstools/postcss-relative-color-syntax/-/postcss-relative-color-syntax-3.0.10.tgz", + "integrity": "sha512-8+0kQbQGg9yYG8hv0dtEpOMLwB9M+P7PhacgIzVzJpixxV4Eq9AUQtQw8adMmAJU1RBBmIlpmtmm3XTRd/T00g==", "funding": [ { "type": "github", @@ -2784,10 +2832,10 @@ ], "license": "MIT-0", "dependencies": { - "@csstools/css-color-parser": "^3.0.8", - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3", - "@csstools/postcss-progressive-custom-properties": "^4.0.0", + "@csstools/css-color-parser": "^3.0.10", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4", + "@csstools/postcss-progressive-custom-properties": "^4.1.0", "@csstools/utilities": "^2.0.0" }, "engines": { @@ -2836,9 +2884,9 @@ } }, "node_modules/@csstools/postcss-sign-functions": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@csstools/postcss-sign-functions/-/postcss-sign-functions-1.1.2.tgz", - "integrity": "sha512-4EcAvXTUPh7n6UoZZkCzgtCf/wPzMlTNuddcKg7HG8ozfQkUcHsJ2faQKeLmjyKdYPyOUn4YA7yDPf8K/jfIxw==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@csstools/postcss-sign-functions/-/postcss-sign-functions-1.1.4.tgz", + "integrity": "sha512-P97h1XqRPcfcJndFdG95Gv/6ZzxUBBISem0IDqPZ7WMvc/wlO+yU0c5D/OCpZ5TJoTt63Ok3knGk64N+o6L2Pg==", "funding": [ { "type": "github", @@ -2851,9 +2899,9 @@ ], "license": "MIT-0", "dependencies": { - "@csstools/css-calc": "^2.1.2", - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3" + "@csstools/css-calc": "^2.1.4", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" }, "engines": { "node": ">=18" @@ -2863,9 +2911,9 @@ } }, "node_modules/@csstools/postcss-stepped-value-functions": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/@csstools/postcss-stepped-value-functions/-/postcss-stepped-value-functions-4.0.7.tgz", - "integrity": "sha512-rdrRCKRnWtj5FyRin0u/gLla7CIvZRw/zMGI1fVJP0Sg/m1WGicjPVHRANL++3HQtsiXKAbPrcPr+VkyGck0IA==", + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@csstools/postcss-stepped-value-functions/-/postcss-stepped-value-functions-4.0.9.tgz", + "integrity": "sha512-h9btycWrsex4dNLeQfyU3y3w40LMQooJWFMm/SK9lrKguHDcFl4VMkncKKoXi2z5rM9YGWbUQABI8BT2UydIcA==", "funding": [ { "type": "github", @@ -2878,9 +2926,9 @@ ], "license": "MIT-0", "dependencies": { - "@csstools/css-calc": "^2.1.2", - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3" + "@csstools/css-calc": "^2.1.4", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" }, "engines": { "node": ">=18" @@ -2916,9 +2964,9 @@ } }, "node_modules/@csstools/postcss-trigonometric-functions": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/@csstools/postcss-trigonometric-functions/-/postcss-trigonometric-functions-4.0.7.tgz", - "integrity": "sha512-qTrZgLju3AV7Djhzuh2Bq/wjFqbcypnk0FhHjxW8DWJQcZLS1HecIus4X2/RLch1ukX7b+YYCdqbEnpIQO5ccg==", + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@csstools/postcss-trigonometric-functions/-/postcss-trigonometric-functions-4.0.9.tgz", + "integrity": "sha512-Hnh5zJUdpNrJqK9v1/E3BbrQhaDTj5YiX7P61TOvUhoDHnUmsNNxcDAgkQ32RrcWx9GVUvfUNPcUkn8R3vIX6A==", "funding": [ { "type": "github", @@ -2931,9 +2979,9 @@ ], "license": "MIT-0", "dependencies": { - "@csstools/css-calc": "^2.1.2", - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3" + "@csstools/css-calc": "^2.1.4", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" }, "engines": { "node": ">=18" @@ -3034,9 +3082,9 @@ } }, "node_modules/@docusaurus/babel": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/babel/-/babel-3.7.0.tgz", - "integrity": "sha512-0H5uoJLm14S/oKV3Keihxvh8RV+vrid+6Gv+2qhuzbqHanawga8tYnsdpjEyt36ucJjqlby2/Md2ObWjA02UXQ==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/babel/-/babel-3.8.0.tgz", + "integrity": "sha512-9EJwSgS6TgB8IzGk1L8XddJLhZod8fXT4ULYMx6SKqyCBqCFpVCEjR/hNXXhnmtVM2irDuzYoVLGWv7srG/VOA==", "license": "MIT", "dependencies": { "@babel/core": "^7.25.9", @@ -3049,8 +3097,8 @@ "@babel/runtime": "^7.25.9", "@babel/runtime-corejs3": "^7.25.9", "@babel/traverse": "^7.25.9", - "@docusaurus/logger": "3.7.0", - "@docusaurus/utils": "3.7.0", + "@docusaurus/logger": "3.8.0", + "@docusaurus/utils": "3.8.0", "babel-plugin-dynamic-import-node": "^2.3.3", "fs-extra": "^11.1.1", "tslib": "^2.6.0" @@ -3060,17 +3108,17 @@ } }, "node_modules/@docusaurus/bundler": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/bundler/-/bundler-3.7.0.tgz", - "integrity": "sha512-CUUT9VlSGukrCU5ctZucykvgCISivct+cby28wJwCC/fkQFgAHRp/GKv2tx38ZmXb7nacrKzFTcp++f9txUYGg==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/bundler/-/bundler-3.8.0.tgz", + "integrity": "sha512-Rq4Z/MSeAHjVzBLirLeMcjLIAQy92pF1OI+2rmt18fSlMARfTGLWRE8Vb+ljQPTOSfJxwDYSzsK6i7XloD2rNA==", "license": "MIT", "dependencies": { "@babel/core": "^7.25.9", - "@docusaurus/babel": "3.7.0", - "@docusaurus/cssnano-preset": "3.7.0", - "@docusaurus/logger": "3.7.0", - "@docusaurus/types": "3.7.0", - "@docusaurus/utils": "3.7.0", + "@docusaurus/babel": "3.8.0", + "@docusaurus/cssnano-preset": "3.8.0", + "@docusaurus/logger": "3.8.0", + "@docusaurus/types": "3.8.0", + "@docusaurus/utils": "3.8.0", "babel-loader": "^9.2.1", "clean-css": "^5.3.2", "copy-webpack-plugin": "^11.0.0", @@ -3084,7 +3132,6 @@ "postcss": "^8.4.26", "postcss-loader": "^7.3.3", "postcss-preset-env": "^10.1.0", - "react-dev-utils": "^12.0.1", "terser-webpack-plugin": "^5.3.9", "tslib": "^2.6.0", "url-loader": "^4.1.1", @@ -3104,18 +3151,18 @@ } }, "node_modules/@docusaurus/core": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/core/-/core-3.7.0.tgz", - "integrity": "sha512-b0fUmaL+JbzDIQaamzpAFpTviiaU4cX3Qz8cuo14+HGBCwa0evEK0UYCBFY3n4cLzL8Op1BueeroUD2LYAIHbQ==", - "license": "MIT", - "dependencies": { - "@docusaurus/babel": "3.7.0", - "@docusaurus/bundler": "3.7.0", - "@docusaurus/logger": "3.7.0", - "@docusaurus/mdx-loader": "3.7.0", - "@docusaurus/utils": "3.7.0", - "@docusaurus/utils-common": "3.7.0", - "@docusaurus/utils-validation": "3.7.0", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/core/-/core-3.8.0.tgz", + "integrity": "sha512-c7u6zFELmSGPEP9WSubhVDjgnpiHgDqMh1qVdCB7rTflh4Jx0msTYmMiO91Ez0KtHj4sIsDsASnjwfJ2IZp3Vw==", + "license": "MIT", + "dependencies": { + "@docusaurus/babel": "3.8.0", + "@docusaurus/bundler": "3.8.0", + "@docusaurus/logger": "3.8.0", + "@docusaurus/mdx-loader": "3.8.0", + "@docusaurus/utils": "3.8.0", + "@docusaurus/utils-common": "3.8.0", + "@docusaurus/utils-validation": "3.8.0", "boxen": "^6.2.1", "chalk": "^4.1.2", "chokidar": "^3.5.3", @@ -3123,19 +3170,19 @@ "combine-promises": "^1.1.0", "commander": "^5.1.0", "core-js": "^3.31.1", - "del": "^6.1.1", "detect-port": "^1.5.1", "escape-html": "^1.0.3", "eta": "^2.2.0", "eval": "^0.1.8", + "execa": "5.1.1", "fs-extra": "^11.1.1", "html-tags": "^3.3.1", "html-webpack-plugin": "^5.6.0", "leven": "^3.1.0", "lodash": "^4.17.21", + "open": "^8.4.0", "p-map": "^4.0.0", "prompts": "^2.4.2", - "react-dev-utils": "^12.0.1", "react-helmet-async": "npm:@slorber/react-helmet-async@1.3.0", "react-loadable": "npm:@docusaurus/react-loadable@6.0.0", "react-loadable-ssr-addon-v5-slorber": "^1.0.1", @@ -3144,7 +3191,7 @@ "react-router-dom": "^5.3.4", "semver": "^7.5.4", "serve-handler": "^6.1.6", - "shelljs": "^0.8.5", + "tinypool": "^1.0.2", "tslib": "^2.6.0", "update-notifier": "^6.0.2", "webpack": "^5.95.0", @@ -3165,9 +3212,9 @@ } }, "node_modules/@docusaurus/cssnano-preset": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/cssnano-preset/-/cssnano-preset-3.7.0.tgz", - "integrity": "sha512-X9GYgruZBSOozg4w4dzv9uOz8oK/EpPVQXkp0MM6Tsgp/nRIU9hJzJ0Pxg1aRa3xCeEQTOimZHcocQFlLwYajQ==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/cssnano-preset/-/cssnano-preset-3.8.0.tgz", + "integrity": "sha512-UJ4hAS2T0R4WNy+phwVff2Q0L5+RXW9cwlH6AEphHR5qw3m/yacfWcSK7ort2pMMbDn8uGrD38BTm4oLkuuNoQ==", "license": "MIT", "dependencies": { "cssnano-preset-advanced": "^6.1.2", @@ -3180,9 +3227,9 @@ } }, "node_modules/@docusaurus/logger": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/logger/-/logger-3.7.0.tgz", - "integrity": "sha512-z7g62X7bYxCYmeNNuO9jmzxLQG95q9QxINCwpboVcNff3SJiHJbGrarxxOVMVmAh1MsrSfxWkVGv4P41ktnFsA==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/logger/-/logger-3.8.0.tgz", + "integrity": "sha512-7eEMaFIam5Q+v8XwGqF/n0ZoCld4hV4eCCgQkfcN9Mq5inoZa6PHHW9Wu6lmgzoK5Kx3keEeABcO2SxwraoPDQ==", "license": "MIT", "dependencies": { "chalk": "^4.1.2", @@ -3193,21 +3240,21 @@ } }, "node_modules/@docusaurus/mdx-loader": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/mdx-loader/-/mdx-loader-3.7.0.tgz", - "integrity": "sha512-OFBG6oMjZzc78/U3WNPSHs2W9ZJ723ewAcvVJaqS0VgyeUfmzUV8f1sv+iUHA0DtwiR5T5FjOxj6nzEE8LY6VA==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/mdx-loader/-/mdx-loader-3.8.0.tgz", + "integrity": "sha512-mDPSzssRnpjSdCGuv7z2EIAnPS1MHuZGTaRLwPn4oQwszu4afjWZ/60sfKjTnjBjI8Vl4OgJl2vMmfmiNDX4Ng==", "license": "MIT", "dependencies": { - "@docusaurus/logger": "3.7.0", - "@docusaurus/utils": "3.7.0", - "@docusaurus/utils-validation": "3.7.0", + "@docusaurus/logger": "3.8.0", + "@docusaurus/utils": "3.8.0", + "@docusaurus/utils-validation": "3.8.0", "@mdx-js/mdx": "^3.0.0", "@slorber/remark-comment": "^1.0.0", "escape-html": "^1.0.3", "estree-util-value-to-estree": "^3.0.1", "file-loader": "^6.2.0", "fs-extra": "^11.1.1", - "image-size": "^1.0.2", + "image-size": "^2.0.2", "mdast-util-mdx": "^3.0.0", "mdast-util-to-string": "^4.0.0", "rehype-raw": "^7.0.0", @@ -3232,17 +3279,17 @@ } }, "node_modules/@docusaurus/module-type-aliases": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/module-type-aliases/-/module-type-aliases-3.7.0.tgz", - "integrity": "sha512-g7WdPqDNaqA60CmBrr0cORTrsOit77hbsTj7xE2l71YhBn79sxdm7WMK7wfhcaafkbpIh7jv5ef5TOpf1Xv9Lg==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/module-type-aliases/-/module-type-aliases-3.8.0.tgz", + "integrity": "sha512-/uMb4Ipt5J/QnD13MpnoC/A4EYAe6DKNWqTWLlGrqsPJwJv73vSwkA25xnYunwfqWk0FlUQfGv/Swdh5eCCg7g==", "license": "MIT", "dependencies": { - "@docusaurus/types": "3.7.0", + "@docusaurus/types": "3.8.0", "@types/history": "^4.7.11", "@types/react": "*", "@types/react-router-config": "*", "@types/react-router-dom": "*", - "react-helmet-async": "npm:@slorber/react-helmet-async@*", + "react-helmet-async": "npm:@slorber/react-helmet-async@1.3.0", "react-loadable": "npm:@docusaurus/react-loadable@6.0.0" }, "peerDependencies": { @@ -3251,16 +3298,16 @@ } }, "node_modules/@docusaurus/plugin-client-redirects": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-client-redirects/-/plugin-client-redirects-3.7.0.tgz", - "integrity": "sha512-6B4XAtE5ZVKOyhPgpgMkb7LwCkN+Hgd4vOnlbwR8nCdTQhLjz8MHbGlwwvZ/cay2SPNRX5KssqKAlcHVZP2m8g==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-client-redirects/-/plugin-client-redirects-3.8.0.tgz", + "integrity": "sha512-J8f5qzAlO61BnG1I91+N5WH1b/lPWqn6ifTxf/Bluz9JVe1bhFNSl0yW03p+Ff3AFOINDy2ofX70al9nOnOLyw==", "license": "MIT", "dependencies": { - "@docusaurus/core": "3.7.0", - "@docusaurus/logger": "3.7.0", - "@docusaurus/utils": "3.7.0", - "@docusaurus/utils-common": "3.7.0", - "@docusaurus/utils-validation": "3.7.0", + "@docusaurus/core": "3.8.0", + "@docusaurus/logger": "3.8.0", + "@docusaurus/utils": "3.8.0", + "@docusaurus/utils-common": "3.8.0", + "@docusaurus/utils-validation": "3.8.0", "eta": "^2.2.0", "fs-extra": "^11.1.1", "lodash": "^4.17.21", @@ -3275,24 +3322,24 @@ } }, "node_modules/@docusaurus/plugin-content-blog": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-blog/-/plugin-content-blog-3.7.0.tgz", - "integrity": "sha512-EFLgEz6tGHYWdPU0rK8tSscZwx+AsyuBW/r+tNig2kbccHYGUJmZtYN38GjAa3Fda4NU+6wqUO5kTXQSRBQD3g==", - "license": "MIT", - "dependencies": { - "@docusaurus/core": "3.7.0", - "@docusaurus/logger": "3.7.0", - "@docusaurus/mdx-loader": "3.7.0", - "@docusaurus/theme-common": "3.7.0", - "@docusaurus/types": "3.7.0", - "@docusaurus/utils": "3.7.0", - "@docusaurus/utils-common": "3.7.0", - "@docusaurus/utils-validation": "3.7.0", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-blog/-/plugin-content-blog-3.8.0.tgz", + "integrity": "sha512-0SlOTd9R55WEr1GgIXu+hhTT0hzARYx3zIScA5IzpdekZQesI/hKEa5LPHBd415fLkWMjdD59TaW/3qQKpJ0Lg==", + "license": "MIT", + "dependencies": { + "@docusaurus/core": "3.8.0", + "@docusaurus/logger": "3.8.0", + "@docusaurus/mdx-loader": "3.8.0", + "@docusaurus/theme-common": "3.8.0", + "@docusaurus/types": "3.8.0", + "@docusaurus/utils": "3.8.0", + "@docusaurus/utils-common": "3.8.0", + "@docusaurus/utils-validation": "3.8.0", "cheerio": "1.0.0-rc.12", "feed": "^4.2.2", "fs-extra": "^11.1.1", "lodash": "^4.17.21", - "reading-time": "^1.5.0", + "schema-dts": "^1.1.2", "srcset": "^4.0.0", "tslib": "^2.6.0", "unist-util-visit": "^5.0.0", @@ -3309,25 +3356,26 @@ } }, "node_modules/@docusaurus/plugin-content-docs": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-docs/-/plugin-content-docs-3.7.0.tgz", - "integrity": "sha512-GXg5V7kC9FZE4FkUZA8oo/NrlRb06UwuICzI6tcbzj0+TVgjq/mpUXXzSgKzMS82YByi4dY2Q808njcBCyy6tQ==", - "license": "MIT", - "dependencies": { - "@docusaurus/core": "3.7.0", - "@docusaurus/logger": "3.7.0", - "@docusaurus/mdx-loader": "3.7.0", - "@docusaurus/module-type-aliases": "3.7.0", - "@docusaurus/theme-common": "3.7.0", - "@docusaurus/types": "3.7.0", - "@docusaurus/utils": "3.7.0", - "@docusaurus/utils-common": "3.7.0", - "@docusaurus/utils-validation": "3.7.0", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-docs/-/plugin-content-docs-3.8.0.tgz", + "integrity": "sha512-fRDMFLbUN6eVRXcjP8s3Y7HpAt9pzPYh1F/7KKXOCxvJhjjCtbon4VJW0WndEPInVz4t8QUXn5QZkU2tGVCE2g==", + "license": "MIT", + "dependencies": { + "@docusaurus/core": "3.8.0", + "@docusaurus/logger": "3.8.0", + "@docusaurus/mdx-loader": "3.8.0", + "@docusaurus/module-type-aliases": "3.8.0", + "@docusaurus/theme-common": "3.8.0", + "@docusaurus/types": "3.8.0", + "@docusaurus/utils": "3.8.0", + "@docusaurus/utils-common": "3.8.0", + "@docusaurus/utils-validation": "3.8.0", "@types/react-router-config": "^5.0.7", "combine-promises": "^1.1.0", "fs-extra": "^11.1.1", "js-yaml": "^4.1.0", "lodash": "^4.17.21", + "schema-dts": "^1.1.2", "tslib": "^2.6.0", "utility-types": "^3.10.0", "webpack": "^5.88.1" @@ -3341,16 +3389,16 @@ } }, "node_modules/@docusaurus/plugin-content-pages": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-pages/-/plugin-content-pages-3.7.0.tgz", - "integrity": "sha512-YJSU3tjIJf032/Aeao8SZjFOrXJbz/FACMveSMjLyMH4itQyZ2XgUIzt4y+1ISvvk5zrW4DABVT2awTCqBkx0Q==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-pages/-/plugin-content-pages-3.8.0.tgz", + "integrity": "sha512-39EDx2y1GA0Pxfion5tQZLNJxL4gq6susd1xzetVBjVIQtwpCdyloOfQBAgX0FylqQxfJrYqL0DIUuq7rd7uBw==", "license": "MIT", "dependencies": { - "@docusaurus/core": "3.7.0", - "@docusaurus/mdx-loader": "3.7.0", - "@docusaurus/types": "3.7.0", - "@docusaurus/utils": "3.7.0", - "@docusaurus/utils-validation": "3.7.0", + "@docusaurus/core": "3.8.0", + "@docusaurus/mdx-loader": "3.8.0", + "@docusaurus/types": "3.8.0", + "@docusaurus/utils": "3.8.0", + "@docusaurus/utils-validation": "3.8.0", "fs-extra": "^11.1.1", "tslib": "^2.6.0", "webpack": "^5.88.1" @@ -3363,48 +3411,51 @@ "react-dom": "^18.0.0 || ^19.0.0" } }, - "node_modules/@docusaurus/plugin-debug": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-debug/-/plugin-debug-3.7.0.tgz", - "integrity": "sha512-Qgg+IjG/z4svtbCNyTocjIwvNTNEwgRjSXXSJkKVG0oWoH0eX/HAPiu+TS1HBwRPQV+tTYPWLrUypYFepfujZA==", + "node_modules/@docusaurus/plugin-css-cascade-layers": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-css-cascade-layers/-/plugin-css-cascade-layers-3.8.0.tgz", + "integrity": "sha512-/VBTNymPIxQB8oA3ZQ4GFFRYdH4ZxDRRBECxyjRyv486mfUPXfcdk+im4S5mKWa6EK2JzBz95IH/Wu0qQgJ5yQ==", "license": "MIT", "dependencies": { - "@docusaurus/core": "3.7.0", - "@docusaurus/types": "3.7.0", - "@docusaurus/utils": "3.7.0", - "fs-extra": "^11.1.1", - "react-json-view-lite": "^1.2.0", + "@docusaurus/core": "3.8.0", + "@docusaurus/types": "3.8.0", + "@docusaurus/utils-validation": "3.8.0", "tslib": "^2.6.0" }, "engines": { "node": ">=18.0" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" } }, - "node_modules/@docusaurus/plugin-debug/node_modules/react-json-view-lite": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/react-json-view-lite/-/react-json-view-lite-1.5.0.tgz", - "integrity": "sha512-nWqA1E4jKPklL2jvHWs6s+7Na0qNgw9HCP6xehdQJeg6nPBTFZgGwyko9Q0oj+jQWKTTVRS30u0toM5wiuL3iw==", + "node_modules/@docusaurus/plugin-debug": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-debug/-/plugin-debug-3.8.0.tgz", + "integrity": "sha512-teonJvJsDB9o2OnG6ifbhblg/PXzZvpUKHFgD8dOL1UJ58u0lk8o0ZOkvaYEBa9nDgqzoWrRk9w+e3qaG2mOhQ==", "license": "MIT", + "dependencies": { + "@docusaurus/core": "3.8.0", + "@docusaurus/types": "3.8.0", + "@docusaurus/utils": "3.8.0", + "fs-extra": "^11.1.1", + "react-json-view-lite": "^2.3.0", + "tslib": "^2.6.0" + }, "engines": { - "node": ">=14" + "node": ">=18.0" }, "peerDependencies": { - "react": "^16.13.1 || ^17.0.0 || ^18.0.0" + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" } }, "node_modules/@docusaurus/plugin-google-analytics": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-analytics/-/plugin-google-analytics-3.7.0.tgz", - "integrity": "sha512-otIqiRV/jka6Snjf+AqB360XCeSv7lQC+DKYW+EUZf6XbuE8utz5PeUQ8VuOcD8Bk5zvT1MC4JKcd5zPfDuMWA==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-analytics/-/plugin-google-analytics-3.8.0.tgz", + "integrity": "sha512-aKKa7Q8+3xRSRESipNvlFgNp3FNPELKhuo48Cg/svQbGNwidSHbZT03JqbW4cBaQnyyVchO1ttk+kJ5VC9Gx0w==", "license": "MIT", "dependencies": { - "@docusaurus/core": "3.7.0", - "@docusaurus/types": "3.7.0", - "@docusaurus/utils-validation": "3.7.0", + "@docusaurus/core": "3.8.0", + "@docusaurus/types": "3.8.0", + "@docusaurus/utils-validation": "3.8.0", "tslib": "^2.6.0" }, "engines": { @@ -3416,14 +3467,14 @@ } }, "node_modules/@docusaurus/plugin-google-gtag": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-3.7.0.tgz", - "integrity": "sha512-M3vrMct1tY65ModbyeDaMoA+fNJTSPe5qmchhAbtqhDD/iALri0g9LrEpIOwNaoLmm6lO88sfBUADQrSRSGSWA==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-3.8.0.tgz", + "integrity": "sha512-ugQYMGF4BjbAW/JIBtVcp+9eZEgT9HRdvdcDudl5rywNPBA0lct+lXMG3r17s02rrhInMpjMahN3Yc9Cb3H5/g==", "license": "MIT", "dependencies": { - "@docusaurus/core": "3.7.0", - "@docusaurus/types": "3.7.0", - "@docusaurus/utils-validation": "3.7.0", + "@docusaurus/core": "3.8.0", + "@docusaurus/types": "3.8.0", + "@docusaurus/utils-validation": "3.8.0", "@types/gtag.js": "^0.0.12", "tslib": "^2.6.0" }, @@ -3436,14 +3487,14 @@ } }, "node_modules/@docusaurus/plugin-google-tag-manager": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-tag-manager/-/plugin-google-tag-manager-3.7.0.tgz", - "integrity": "sha512-X8U78nb8eiMiPNg3jb9zDIVuuo/rE1LjGDGu+5m5CX4UBZzjMy+klOY2fNya6x8ACyE/L3K2erO1ErheP55W/w==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-tag-manager/-/plugin-google-tag-manager-3.8.0.tgz", + "integrity": "sha512-9juRWxbwZD3SV02Jd9QB6yeN7eu+7T4zB0bvJLcVQwi+am51wAxn2CwbdL0YCCX+9OfiXbADE8D8Q65Hbopu/w==", "license": "MIT", "dependencies": { - "@docusaurus/core": "3.7.0", - "@docusaurus/types": "3.7.0", - "@docusaurus/utils-validation": "3.7.0", + "@docusaurus/core": "3.8.0", + "@docusaurus/types": "3.8.0", + "@docusaurus/utils-validation": "3.8.0", "tslib": "^2.6.0" }, "engines": { @@ -3455,17 +3506,17 @@ } }, "node_modules/@docusaurus/plugin-sitemap": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-sitemap/-/plugin-sitemap-3.7.0.tgz", - "integrity": "sha512-bTRT9YLZ/8I/wYWKMQke18+PF9MV8Qub34Sku6aw/vlZ/U+kuEuRpQ8bTcNOjaTSfYsWkK4tTwDMHK2p5S86cA==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-sitemap/-/plugin-sitemap-3.8.0.tgz", + "integrity": "sha512-fGpOIyJvNiuAb90nSJ2Gfy/hUOaDu6826e5w5UxPmbpCIc7KlBHNAZ5g4L4ZuHhc4hdfq4mzVBsQSnne+8Ze1g==", "license": "MIT", "dependencies": { - "@docusaurus/core": "3.7.0", - "@docusaurus/logger": "3.7.0", - "@docusaurus/types": "3.7.0", - "@docusaurus/utils": "3.7.0", - "@docusaurus/utils-common": "3.7.0", - "@docusaurus/utils-validation": "3.7.0", + "@docusaurus/core": "3.8.0", + "@docusaurus/logger": "3.8.0", + "@docusaurus/types": "3.8.0", + "@docusaurus/utils": "3.8.0", + "@docusaurus/utils-common": "3.8.0", + "@docusaurus/utils-validation": "3.8.0", "fs-extra": "^11.1.1", "sitemap": "^7.1.1", "tslib": "^2.6.0" @@ -3479,15 +3530,15 @@ } }, "node_modules/@docusaurus/plugin-svgr": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-svgr/-/plugin-svgr-3.7.0.tgz", - "integrity": "sha512-HByXIZTbc4GV5VAUkZ2DXtXv1Qdlnpk3IpuImwSnEzCDBkUMYcec5282hPjn6skZqB25M1TYCmWS91UbhBGxQg==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-svgr/-/plugin-svgr-3.8.0.tgz", + "integrity": "sha512-kEDyry+4OMz6BWLG/lEqrNsL/w818bywK70N1gytViw4m9iAmoxCUT7Ri9Dgs7xUdzCHJ3OujolEmD88Wy44OA==", "license": "MIT", "dependencies": { - "@docusaurus/core": "3.7.0", - "@docusaurus/types": "3.7.0", - "@docusaurus/utils": "3.7.0", - "@docusaurus/utils-validation": "3.7.0", + "@docusaurus/core": "3.8.0", + "@docusaurus/types": "3.8.0", + "@docusaurus/utils": "3.8.0", + "@docusaurus/utils-validation": "3.8.0", "@svgr/core": "8.1.0", "@svgr/webpack": "^8.1.0", "tslib": "^2.6.0", @@ -3502,25 +3553,26 @@ } }, "node_modules/@docusaurus/preset-classic": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/preset-classic/-/preset-classic-3.7.0.tgz", - "integrity": "sha512-nPHj8AxDLAaQXs+O6+BwILFuhiWbjfQWrdw2tifOClQoNfuXDjfjogee6zfx6NGHWqshR23LrcN115DmkHC91Q==", - "license": "MIT", - "dependencies": { - "@docusaurus/core": "3.7.0", - "@docusaurus/plugin-content-blog": "3.7.0", - "@docusaurus/plugin-content-docs": "3.7.0", - "@docusaurus/plugin-content-pages": "3.7.0", - "@docusaurus/plugin-debug": "3.7.0", - "@docusaurus/plugin-google-analytics": "3.7.0", - "@docusaurus/plugin-google-gtag": "3.7.0", - "@docusaurus/plugin-google-tag-manager": "3.7.0", - "@docusaurus/plugin-sitemap": "3.7.0", - "@docusaurus/plugin-svgr": "3.7.0", - "@docusaurus/theme-classic": "3.7.0", - "@docusaurus/theme-common": "3.7.0", - "@docusaurus/theme-search-algolia": "3.7.0", - "@docusaurus/types": "3.7.0" + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/preset-classic/-/preset-classic-3.8.0.tgz", + "integrity": "sha512-qOu6tQDOWv+rpTlKu+eJATCJVGnABpRCPuqf7LbEaQ1mNY//N/P8cHQwkpAU+aweQfarcZ0XfwCqRHJfjeSV/g==", + "license": "MIT", + "dependencies": { + "@docusaurus/core": "3.8.0", + "@docusaurus/plugin-content-blog": "3.8.0", + "@docusaurus/plugin-content-docs": "3.8.0", + "@docusaurus/plugin-content-pages": "3.8.0", + "@docusaurus/plugin-css-cascade-layers": "3.8.0", + "@docusaurus/plugin-debug": "3.8.0", + "@docusaurus/plugin-google-analytics": "3.8.0", + "@docusaurus/plugin-google-gtag": "3.8.0", + "@docusaurus/plugin-google-tag-manager": "3.8.0", + "@docusaurus/plugin-sitemap": "3.8.0", + "@docusaurus/plugin-svgr": "3.8.0", + "@docusaurus/theme-classic": "3.8.0", + "@docusaurus/theme-common": "3.8.0", + "@docusaurus/theme-search-algolia": "3.8.0", + "@docusaurus/types": "3.8.0" }, "engines": { "node": ">=18.0" @@ -3531,24 +3583,24 @@ } }, "node_modules/@docusaurus/theme-classic": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-classic/-/theme-classic-3.7.0.tgz", - "integrity": "sha512-MnLxG39WcvLCl4eUzHr0gNcpHQfWoGqzADCly54aqCofQX6UozOS9Th4RK3ARbM9m7zIRv3qbhggI53dQtx/hQ==", - "license": "MIT", - "dependencies": { - "@docusaurus/core": "3.7.0", - "@docusaurus/logger": "3.7.0", - "@docusaurus/mdx-loader": "3.7.0", - "@docusaurus/module-type-aliases": "3.7.0", - "@docusaurus/plugin-content-blog": "3.7.0", - "@docusaurus/plugin-content-docs": "3.7.0", - "@docusaurus/plugin-content-pages": "3.7.0", - "@docusaurus/theme-common": "3.7.0", - "@docusaurus/theme-translations": "3.7.0", - "@docusaurus/types": "3.7.0", - "@docusaurus/utils": "3.7.0", - "@docusaurus/utils-common": "3.7.0", - "@docusaurus/utils-validation": "3.7.0", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-classic/-/theme-classic-3.8.0.tgz", + "integrity": "sha512-nQWFiD5ZjoT76OaELt2n33P3WVuuCz8Dt5KFRP2fCBo2r9JCLsp2GJjZpnaG24LZ5/arRjv4VqWKgpK0/YLt7g==", + "license": "MIT", + "dependencies": { + "@docusaurus/core": "3.8.0", + "@docusaurus/logger": "3.8.0", + "@docusaurus/mdx-loader": "3.8.0", + "@docusaurus/module-type-aliases": "3.8.0", + "@docusaurus/plugin-content-blog": "3.8.0", + "@docusaurus/plugin-content-docs": "3.8.0", + "@docusaurus/plugin-content-pages": "3.8.0", + "@docusaurus/theme-common": "3.8.0", + "@docusaurus/theme-translations": "3.8.0", + "@docusaurus/types": "3.8.0", + "@docusaurus/utils": "3.8.0", + "@docusaurus/utils-common": "3.8.0", + "@docusaurus/utils-validation": "3.8.0", "@mdx-js/react": "^3.0.0", "clsx": "^2.0.0", "copy-text-to-clipboard": "^3.2.0", @@ -3572,15 +3624,15 @@ } }, "node_modules/@docusaurus/theme-common": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-common/-/theme-common-3.7.0.tgz", - "integrity": "sha512-8eJ5X0y+gWDsURZnBfH0WabdNm8XMCXHv8ENy/3Z/oQKwaB/EHt5lP9VsTDTf36lKEp0V6DjzjFyFIB+CetL0A==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-common/-/theme-common-3.8.0.tgz", + "integrity": "sha512-YqV2vAWpXGLA+A3PMLrOMtqgTHJLDcT+1Caa6RF7N4/IWgrevy5diY8oIHFkXR/eybjcrFFjUPrHif8gSGs3Tw==", "license": "MIT", "dependencies": { - "@docusaurus/mdx-loader": "3.7.0", - "@docusaurus/module-type-aliases": "3.7.0", - "@docusaurus/utils": "3.7.0", - "@docusaurus/utils-common": "3.7.0", + "@docusaurus/mdx-loader": "3.8.0", + "@docusaurus/module-type-aliases": "3.8.0", + "@docusaurus/utils": "3.8.0", + "@docusaurus/utils-common": "3.8.0", "@types/history": "^4.7.11", "@types/react": "*", "@types/react-router-config": "*", @@ -3600,19 +3652,19 @@ } }, "node_modules/@docusaurus/theme-search-algolia": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-search-algolia/-/theme-search-algolia-3.7.0.tgz", - "integrity": "sha512-Al/j5OdzwRU1m3falm+sYy9AaB93S1XF1Lgk9Yc6amp80dNxJVplQdQTR4cYdzkGtuQqbzUA8+kaoYYO0RbK6g==", - "license": "MIT", - "dependencies": { - "@docsearch/react": "^3.8.1", - "@docusaurus/core": "3.7.0", - "@docusaurus/logger": "3.7.0", - "@docusaurus/plugin-content-docs": "3.7.0", - "@docusaurus/theme-common": "3.7.0", - "@docusaurus/theme-translations": "3.7.0", - "@docusaurus/utils": "3.7.0", - "@docusaurus/utils-validation": "3.7.0", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-search-algolia/-/theme-search-algolia-3.8.0.tgz", + "integrity": "sha512-GBZ5UOcPgiu6nUw153+0+PNWvFKweSnvKIL6Rp04H9olKb475jfKjAwCCtju5D2xs5qXHvCMvzWOg5o9f6DtuQ==", + "license": "MIT", + "dependencies": { + "@docsearch/react": "^3.9.0", + "@docusaurus/core": "3.8.0", + "@docusaurus/logger": "3.8.0", + "@docusaurus/plugin-content-docs": "3.8.0", + "@docusaurus/theme-common": "3.8.0", + "@docusaurus/theme-translations": "3.8.0", + "@docusaurus/utils": "3.8.0", + "@docusaurus/utils-validation": "3.8.0", "algoliasearch": "^5.17.1", "algoliasearch-helper": "^3.22.6", "clsx": "^2.0.0", @@ -3631,9 +3683,9 @@ } }, "node_modules/@docusaurus/theme-translations": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-translations/-/theme-translations-3.7.0.tgz", - "integrity": "sha512-Ewq3bEraWDmienM6eaNK7fx+/lHMtGDHQyd1O+4+3EsDxxUmrzPkV7Ct3nBWTuE0MsoZr3yNwQVKjllzCMuU3g==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-translations/-/theme-translations-3.8.0.tgz", + "integrity": "sha512-1DTy/snHicgkCkryWq54fZvsAglTdjTx4qjOXgqnXJ+DIty1B+aPQrAVUu8LiM+6BiILfmNxYsxhKTj+BS3PZg==", "license": "MIT", "dependencies": { "fs-extra": "^11.1.1", @@ -3644,9 +3696,9 @@ } }, "node_modules/@docusaurus/types": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/types/-/types-3.7.0.tgz", - "integrity": "sha512-kOmZg5RRqJfH31m+6ZpnwVbkqMJrPOG5t0IOl4i/+3ruXyNfWzZ0lVtVrD0u4ONc/0NOsS9sWYaxxWNkH1LdLQ==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/types/-/types-3.8.0.tgz", + "integrity": "sha512-RDEClpwNxZq02c+JlaKLWoS13qwWhjcNsi2wG1UpzmEnuti/z1Wx4SGpqbUqRPNSd8QWWePR8Cb7DvG0VN/TtA==", "license": "MIT", "dependencies": { "@mdx-js/mdx": "^3.0.0", @@ -3679,15 +3731,16 @@ } }, "node_modules/@docusaurus/utils": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/utils/-/utils-3.7.0.tgz", - "integrity": "sha512-e7zcB6TPnVzyUaHMJyLSArKa2AG3h9+4CfvKXKKWNx6hRs+p0a+u7HHTJBgo6KW2m+vqDnuIHK4X+bhmoghAFA==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/utils/-/utils-3.8.0.tgz", + "integrity": "sha512-2wvtG28ALCN/A1WCSLxPASFBFzXCnP0YKCAFIPcvEb6imNu1wg7ni/Svcp71b3Z2FaOFFIv4Hq+j4gD7gA0yfQ==", "license": "MIT", "dependencies": { - "@docusaurus/logger": "3.7.0", - "@docusaurus/types": "3.7.0", - "@docusaurus/utils-common": "3.7.0", + "@docusaurus/logger": "3.8.0", + "@docusaurus/types": "3.8.0", + "@docusaurus/utils-common": "3.8.0", "escape-string-regexp": "^4.0.0", + "execa": "5.1.1", "file-loader": "^6.2.0", "fs-extra": "^11.1.1", "github-slugger": "^1.5.0", @@ -3697,9 +3750,9 @@ "js-yaml": "^4.1.0", "lodash": "^4.17.21", "micromatch": "^4.0.5", + "p-queue": "^6.6.2", "prompts": "^2.4.2", "resolve-pathname": "^3.0.0", - "shelljs": "^0.8.5", "tslib": "^2.6.0", "url-loader": "^4.1.1", "utility-types": "^3.10.0", @@ -3710,12 +3763,12 @@ } }, "node_modules/@docusaurus/utils-common": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/utils-common/-/utils-common-3.7.0.tgz", - "integrity": "sha512-IZeyIfCfXy0Mevj6bWNg7DG7B8G+S6o6JVpddikZtWyxJguiQ7JYr0SIZ0qWd8pGNuMyVwriWmbWqMnK7Y5PwA==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/utils-common/-/utils-common-3.8.0.tgz", + "integrity": "sha512-3TGF+wVTGgQ3pAc9+5jVchES4uXUAhAt9pwv7uws4mVOxL4alvU3ue/EZ+R4XuGk94pDy7CNXjRXpPjlfZXQfw==", "license": "MIT", "dependencies": { - "@docusaurus/types": "3.7.0", + "@docusaurus/types": "3.8.0", "tslib": "^2.6.0" }, "engines": { @@ -3723,14 +3776,14 @@ } }, "node_modules/@docusaurus/utils-validation": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docusaurus/utils-validation/-/utils-validation-3.7.0.tgz", - "integrity": "sha512-w8eiKk8mRdN+bNfeZqC4nyFoxNyI1/VExMKAzD9tqpJfLLbsa46Wfn5wcKH761g9WkKh36RtFV49iL9lh1DYBA==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@docusaurus/utils-validation/-/utils-validation-3.8.0.tgz", + "integrity": "sha512-MrnEbkigr54HkdFeg8e4FKc4EF+E9dlVwsY3XQZsNkbv3MKZnbHQ5LsNJDIKDROFe8PBf5C4qCAg5TPBpsjrjg==", "license": "MIT", "dependencies": { - "@docusaurus/logger": "3.7.0", - "@docusaurus/utils": "3.7.0", - "@docusaurus/utils-common": "3.7.0", + "@docusaurus/logger": "3.8.0", + "@docusaurus/utils": "3.8.0", + "@docusaurus/utils-common": "3.8.0", "fs-extra": "^11.2.0", "joi": "^17.9.2", "js-yaml": "^4.1.0", @@ -4531,12 +4584,6 @@ "@types/node": "*" } }, - "node_modules/@types/parse-json": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.2.tgz", - "integrity": "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==", - "license": "MIT" - }, "node_modules/@types/prismjs": { "version": "1.26.4", "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.4.tgz", @@ -4969,33 +5016,33 @@ } }, "node_modules/algoliasearch": { - "version": "5.20.4", - "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-5.20.4.tgz", - "integrity": "sha512-wjfzqruxovJyDqga8M6Xk5XtfuVg3igrWjhjgkRya87+WwfEa1kg+IluujBLzgAiMSd6rO6jqRb7czjgeeSYgQ==", - "license": "MIT", - "dependencies": { - "@algolia/client-abtesting": "5.20.4", - "@algolia/client-analytics": "5.20.4", - "@algolia/client-common": "5.20.4", - "@algolia/client-insights": "5.20.4", - "@algolia/client-personalization": "5.20.4", - "@algolia/client-query-suggestions": "5.20.4", - "@algolia/client-search": "5.20.4", - "@algolia/ingestion": "1.20.4", - "@algolia/monitoring": "1.20.4", - "@algolia/recommend": "5.20.4", - "@algolia/requester-browser-xhr": "5.20.4", - "@algolia/requester-fetch": "5.20.4", - "@algolia/requester-node-http": "5.20.4" + "version": "5.25.0", + "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-5.25.0.tgz", + "integrity": "sha512-n73BVorL4HIwKlfJKb4SEzAYkR3Buwfwbh+MYxg2mloFph2fFGV58E90QTzdbfzWrLn4HE5Czx/WTjI8fcHaMg==", + "license": "MIT", + "dependencies": { + "@algolia/client-abtesting": "5.25.0", + "@algolia/client-analytics": "5.25.0", + "@algolia/client-common": "5.25.0", + "@algolia/client-insights": "5.25.0", + "@algolia/client-personalization": "5.25.0", + "@algolia/client-query-suggestions": "5.25.0", + "@algolia/client-search": "5.25.0", + "@algolia/ingestion": "1.25.0", + "@algolia/monitoring": "1.25.0", + "@algolia/recommend": "5.25.0", + "@algolia/requester-browser-xhr": "5.25.0", + "@algolia/requester-fetch": "5.25.0", + "@algolia/requester-node-http": "5.25.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/algoliasearch-helper": { - "version": "3.24.2", - "resolved": "https://registry.npmjs.org/algoliasearch-helper/-/algoliasearch-helper-3.24.2.tgz", - "integrity": "sha512-vBw/INZDfyh/THbVeDy8On8lZqd2qiUAHde5N4N1ygL4SoeLqLGJ4GHneHrDAYsjikRwTTtodEP0fiXl5MxHFQ==", + "version": "3.25.0", + "resolved": "https://registry.npmjs.org/algoliasearch-helper/-/algoliasearch-helper-3.25.0.tgz", + "integrity": "sha512-vQoK43U6HXA9/euCqLjvyNdM4G2Fiu/VFp4ae0Gau9sZeIKBPvUPnXfLYAe65Bg7PFuw03coeu5K6lTPSXRObw==", "license": "MIT", "dependencies": { "@algolia/events": "^4.0.1" @@ -5141,19 +5188,10 @@ "astring": "bin/astring" } }, - "node_modules/at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", - "license": "ISC", - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/autoprefixer": { - "version": "10.4.20", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.20.tgz", - "integrity": "sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g==", + "version": "10.4.21", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.21.tgz", + "integrity": "sha512-O+A6LWV5LDHSJD3LjHYoNi4VLsj/Whi7k6zG12xTYaU4cQ8oxQGckXNX8cRHK5yOZ/ppVHe0ZBXGzSV9jXdVbQ==", "funding": [ { "type": "opencollective", @@ -5170,11 +5208,11 @@ ], "license": "MIT", "dependencies": { - "browserslist": "^4.23.3", - "caniuse-lite": "^1.0.30001646", + "browserslist": "^4.24.4", + "caniuse-lite": "^1.0.30001702", "fraction.js": "^4.3.7", "normalize-range": "^0.1.2", - "picocolors": "^1.0.1", + "picocolors": "^1.1.1", "postcss-value-parser": "^4.2.0" }, "bin": { @@ -5403,9 +5441,9 @@ } }, "node_modules/browserslist": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", - "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", + "version": "4.25.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.0.tgz", + "integrity": "sha512-PJ8gYKeS5e/whHBh8xrwYK+dAvEj7JXtz6uTucnMRB8OiGTsKccFekoRrjajPBHV8oOY+2tI4uxeceSimKwMFA==", "funding": [ { "type": "opencollective", @@ -5422,10 +5460,10 @@ ], "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001688", - "electron-to-chromium": "^1.5.73", + "caniuse-lite": "^1.0.30001718", + "electron-to-chromium": "^1.5.160", "node-releases": "^2.0.19", - "update-browserslist-db": "^1.1.1" + "update-browserslist-db": "^1.1.3" }, "bin": { "browserslist": "cli.js" @@ -5564,9 +5602,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001702", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001702.tgz", - "integrity": "sha512-LoPe/D7zioC0REI5W73PeR1e1MLCipRGq/VkovJnd6Df+QVqT+vT33OXCp8QUd7kA7RZrHWxb1B36OQKI/0gOA==", + "version": "1.0.30001720", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001720.tgz", + "integrity": "sha512-Ec/2yV2nNPwb4DnTANEV99ZWwm3ZWfdlfkQbWSDDt+PsXEVYwlhPH8tdMaPunYTKKmz7AnHi2oNEi1GcmKCD8g==", "funding": [ { "type": "opencollective", @@ -6010,9 +6048,9 @@ } }, "node_modules/consola": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.0.tgz", - "integrity": "sha512-EiPU8G6dQG0GFHNR8ljnZFki/8a+cQwEQ+7wpxdChl02Q8HXlwEZWD5lqAF8vC2sEC3Tehr8hy7vErz88LHyUA==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", "license": "MIT", "engines": { "node": "^14.18.0 || >=16.10.0" @@ -6147,11 +6185,12 @@ } }, "node_modules/core-js-compat": { - "version": "3.39.0", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.39.0.tgz", - "integrity": "sha512-VgEUx3VwlExr5no0tXlBt+silBvhTryPwCXRI2Id1PN8WTKu7MreethvddqOubrYxkFdv/RnYrqlv1sFNAUelw==", + "version": "3.42.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.42.0.tgz", + "integrity": "sha512-bQasjMfyDGyaeWKBIu33lHh9qlSR0MFE/Nmc6nMjf/iU9b3rSMdAYz1Baxrv4lPdGUsTqZudHA4jIGSJy0SWZQ==", + "license": "MIT", "dependencies": { - "browserslist": "^4.24.2" + "browserslist": "^4.24.4" }, "funding": { "type": "opencollective", @@ -6159,9 +6198,9 @@ } }, "node_modules/core-js-pure": { - "version": "3.41.0", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.41.0.tgz", - "integrity": "sha512-71Gzp96T9YPk63aUvE5Q5qP+DryB4ZloUZPSOebGM88VNw8VNfvdA7z6kGA8iGOTEzAomsRidp4jXSmUIJsL+Q==", + "version": "3.42.0", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.42.0.tgz", + "integrity": "sha512-007bM04u91fF4kMgwom2I5cQxAFIy8jVulgr9eozILl/SZE53QOqnW/+vviC+wQWLv+AunBG+8Q0TLoeSsSxRQ==", "hasInstallScript": true, "license": "MIT", "funding": { @@ -6493,9 +6532,9 @@ } }, "node_modules/cssdb": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/cssdb/-/cssdb-8.2.3.tgz", - "integrity": "sha512-9BDG5XmJrJQQnJ51VFxXCAtpZ5ebDlAREmO8sxMOVU0aSxN/gocbctjIG5LMh3WBUq+xTlb/jw2LoljBEqraTA==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/cssdb/-/cssdb-8.3.0.tgz", + "integrity": "sha512-c7bmItIg38DgGjSwDPZOYF/2o0QU/sSgkWOMyl8votOfgFuyiFKWPesmCGEsrGLxEA9uL540cp8LdaGEjUGsZQ==", "funding": [ { "type": "opencollective", @@ -6726,6 +6765,7 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -6794,28 +6834,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/del": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/del/-/del-6.1.1.tgz", - "integrity": "sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg==", - "license": "MIT", - "dependencies": { - "globby": "^11.0.1", - "graceful-fs": "^4.2.4", - "is-glob": "^4.0.1", - "is-path-cwd": "^2.2.0", - "is-path-inside": "^3.0.2", - "p-map": "^4.0.0", - "rimraf": "^3.0.2", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -6866,38 +6884,6 @@ "node": ">= 4.0.0" } }, - "node_modules/detect-port-alt": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/detect-port-alt/-/detect-port-alt-1.1.6.tgz", - "integrity": "sha512-5tQykt+LqfJFBEYaDITx7S7cR7mJ/zQmLXZ2qt5w04ainYZw6tBf9dBunMjVeVOdYVRUzUOE4HkY5J7+uttb5Q==", - "license": "MIT", - "dependencies": { - "address": "^1.0.1", - "debug": "^2.6.0" - }, - "bin": { - "detect": "bin/detect-port", - "detect-port": "bin/detect-port" - }, - "engines": { - "node": ">= 4.2.1" - } - }, - "node_modules/detect-port-alt/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/detect-port-alt/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT" - }, "node_modules/devlop": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", @@ -7067,9 +7053,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.112", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.112.tgz", - "integrity": "sha512-oen93kVyqSb3l+ziUgzIOlWt/oOuy4zRmpwestMn4rhFWAoFJeFuCVte9F2fASjeZZo7l/Cif9TiyrdW4CwEMA==", + "version": "1.5.161", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.161.tgz", + "integrity": "sha512-hwtetwfKNZo/UlwHIVBlKZVdy7o8bIZxxKs0Mv/ROPiQQQmDgdm5a+KvKtBsxM8ZjFzTaCeLoodZ8jiBE3o9rA==", "license": "ISC" }, "node_modules/emoji-regex": { @@ -7702,15 +7688,6 @@ "url": "https://opencollective.com/webpack" } }, - "node_modules/filesize": { - "version": "8.0.7", - "resolved": "https://registry.npmjs.org/filesize/-/filesize-8.0.7.tgz", - "integrity": "sha512-pjmC+bkIF8XI7fWaH8KxHcZL3DPybs1roSKP4rKDvy20tAWwIObE4+JIseG2byfGKhud5ZnM4YSGKBz7Sh0ndQ==", - "license": "BSD-3-Clause", - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -7815,134 +7792,6 @@ } } }, - "node_modules/fork-ts-checker-webpack-plugin": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-6.5.3.tgz", - "integrity": "sha512-SbH/l9ikmMWycd5puHJKTkZJKddF4iRLyW3DeZ08HTI7NGyLS38MXd/KGgeWumQO7YNQbW2u/NtPT2YowbPaGQ==", - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.8.3", - "@types/json-schema": "^7.0.5", - "chalk": "^4.1.0", - "chokidar": "^3.4.2", - "cosmiconfig": "^6.0.0", - "deepmerge": "^4.2.2", - "fs-extra": "^9.0.0", - "glob": "^7.1.6", - "memfs": "^3.1.2", - "minimatch": "^3.0.4", - "schema-utils": "2.7.0", - "semver": "^7.3.2", - "tapable": "^1.0.0" - }, - "engines": { - "node": ">=10", - "yarn": ">=1.0.0" - }, - "peerDependencies": { - "eslint": ">= 6", - "typescript": ">= 2.7", - "vue-template-compiler": "*", - "webpack": ">= 4" - }, - "peerDependenciesMeta": { - "eslint": { - "optional": true - }, - "vue-template-compiler": { - "optional": true - } - } - }, - "node_modules/fork-ts-checker-webpack-plugin/node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/fork-ts-checker-webpack-plugin/node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "license": "MIT", - "peerDependencies": { - "ajv": "^6.9.1" - } - }, - "node_modules/fork-ts-checker-webpack-plugin/node_modules/cosmiconfig": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", - "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", - "license": "MIT", - "dependencies": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.1.0", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.7.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fork-ts-checker-webpack-plugin/node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "license": "MIT", - "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/fork-ts-checker-webpack-plugin/node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "license": "MIT" - }, - "node_modules/fork-ts-checker-webpack-plugin/node_modules/schema-utils": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz", - "integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==", - "license": "MIT", - "dependencies": { - "@types/json-schema": "^7.0.4", - "ajv": "^6.12.2", - "ajv-keywords": "^3.4.1" - }, - "engines": { - "node": ">= 8.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/fork-ts-checker-webpack-plugin/node_modules/tapable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", - "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/form-data-encoder": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.4.tgz", @@ -8152,55 +8001,17 @@ "engines": { "node": ">=10" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/global-dirs/node_modules/ini": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", - "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/global-modules": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", - "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", - "license": "MIT", - "dependencies": { - "global-prefix": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/global-prefix": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", - "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", - "license": "MIT", - "dependencies": { - "ini": "^1.3.5", - "kind-of": "^6.0.2", - "which": "^1.3.1" - }, - "engines": { - "node": ">=6" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/global-prefix/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "node_modules/global-dirs/node_modules/ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" + "engines": { + "node": ">=10" } }, "node_modules/globals": { @@ -8958,13 +8769,10 @@ } }, "node_modules/image-size": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/image-size/-/image-size-1.2.1.tgz", - "integrity": "sha512-rH+46sQJ2dlwfjfhCyNx5thzrv+dtmBIhPHk0zgRUukHzZ/kRueTJXoYYsclBaKcSMBWuGbOFXtioLpzTb5euw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-2.0.2.tgz", + "integrity": "sha512-IRqXKlaXwgSMAMtpNzZa1ZAe8m+Sa1770Dhk8VkSsP9LS+iHD62Zd8FQKs8fbPiagBE7BzoFX23cxFnwshpV6w==", "license": "MIT", - "dependencies": { - "queue": "6.0.2" - }, "bin": { "image-size": "bin/image-size.js" }, @@ -8972,16 +8780,6 @@ "node": ">=16.x" } }, - "node_modules/immer": { - "version": "9.0.21", - "resolved": "https://registry.npmjs.org/immer/-/immer-9.0.21.tgz", - "integrity": "sha512-bc4NBHqOqSfRW7POMkHd51LvClaeMXpm8dx0e8oE2GORbq5aRK7Bxl4FyzVLdGtLmvLKL7BTDBG5ACQm4HWjTA==", - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/immer" - } - }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -9059,14 +8857,6 @@ "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz", "integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==" }, - "node_modules/interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", - "engines": { - "node": ">= 0.10" - } - }, "node_modules/invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", @@ -9264,15 +9054,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-path-cwd": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", - "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/is-path-inside": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", @@ -9321,15 +9102,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-root": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-root/-/is-root-2.1.0.tgz", - "integrity": "sha512-AGOriNp96vNBd3HtU+RzFEc75FfR5ymiYv8E553I71SCeXBiMsVDUtdio1OEFvrPyLIQ9tVR5RxXIFe5PUFjMg==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -12355,6 +12127,15 @@ "node": ">=12.20" } }, + "node_modules/p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/p-limit": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", @@ -12400,6 +12181,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-queue": { + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-6.6.2.tgz", + "integrity": "sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ==", + "license": "MIT", + "dependencies": { + "eventemitter3": "^4.0.4", + "p-timeout": "^3.2.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-retry": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz", @@ -12413,13 +12210,16 @@ "node": ">=8" } }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "node_modules/p-timeout": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", + "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", "license": "MIT", + "dependencies": { + "p-finally": "^1.0.0" + }, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/package-json": { @@ -12645,79 +12445,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/pkg-up": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-3.1.0.tgz", - "integrity": "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==", - "license": "MIT", - "dependencies": { - "find-up": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-up/node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "license": "MIT", - "dependencies": { - "locate-path": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/pkg-up/node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "license": "MIT", - "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/pkg-up/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "license": "MIT", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/pkg-up/node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "license": "MIT", - "dependencies": { - "p-limit": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/pkg-up/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/postcss": { "version": "8.4.39", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.39.tgz", @@ -12815,9 +12542,9 @@ } }, "node_modules/postcss-color-functional-notation": { - "version": "7.0.8", - "resolved": "https://registry.npmjs.org/postcss-color-functional-notation/-/postcss-color-functional-notation-7.0.8.tgz", - "integrity": "sha512-S/TpMKVKofNvsxfau/+bw+IA6cSfB6/kmzFj5szUofHOVnFFMB2WwK+Zu07BeMD8T0n+ZnTO5uXiMvAKe2dPkA==", + "version": "7.0.10", + "resolved": "https://registry.npmjs.org/postcss-color-functional-notation/-/postcss-color-functional-notation-7.0.10.tgz", + "integrity": "sha512-k9qX+aXHBiLTRrWoCJuUFI6F1iF6QJQUXNVWJVSbqZgj57jDhBlOvD8gNUGl35tgqDivbGLhZeW3Ongz4feuKA==", "funding": [ { "type": "github", @@ -12830,10 +12557,10 @@ ], "license": "MIT-0", "dependencies": { - "@csstools/css-color-parser": "^3.0.8", - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3", - "@csstools/postcss-progressive-custom-properties": "^4.0.0", + "@csstools/css-color-parser": "^3.0.10", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4", + "@csstools/postcss-progressive-custom-properties": "^4.1.0", "@csstools/utilities": "^2.0.0" }, "engines": { @@ -12930,9 +12657,9 @@ } }, "node_modules/postcss-custom-media": { - "version": "11.0.5", - "resolved": "https://registry.npmjs.org/postcss-custom-media/-/postcss-custom-media-11.0.5.tgz", - "integrity": "sha512-SQHhayVNgDvSAdX9NQ/ygcDQGEY+aSF4b/96z7QUX6mqL5yl/JgG/DywcF6fW9XbnCRE+aVYk+9/nqGuzOPWeQ==", + "version": "11.0.6", + "resolved": "https://registry.npmjs.org/postcss-custom-media/-/postcss-custom-media-11.0.6.tgz", + "integrity": "sha512-C4lD4b7mUIw+RZhtY7qUbf4eADmb7Ey8BFA2px9jUbwg7pjTZDl4KY4bvlUV+/vXQvzQRfiGEVJyAbtOsCMInw==", "funding": [ { "type": "github", @@ -12945,10 +12672,10 @@ ], "license": "MIT", "dependencies": { - "@csstools/cascade-layer-name-parser": "^2.0.4", - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3", - "@csstools/media-query-list-parser": "^4.0.2" + "@csstools/cascade-layer-name-parser": "^2.0.5", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4", + "@csstools/media-query-list-parser": "^4.0.3" }, "engines": { "node": ">=18" @@ -12958,9 +12685,9 @@ } }, "node_modules/postcss-custom-properties": { - "version": "14.0.4", - "resolved": "https://registry.npmjs.org/postcss-custom-properties/-/postcss-custom-properties-14.0.4.tgz", - "integrity": "sha512-QnW8FCCK6q+4ierwjnmXF9Y9KF8q0JkbgVfvQEMa93x1GT8FvOiUevWCN2YLaOWyByeDX8S6VFbZEeWoAoXs2A==", + "version": "14.0.5", + "resolved": "https://registry.npmjs.org/postcss-custom-properties/-/postcss-custom-properties-14.0.5.tgz", + "integrity": "sha512-UWf/vhMapZatv+zOuqlfLmYXeOhhHLh8U8HAKGI2VJ00xLRYoAJh4xv8iX6FB6+TLXeDnm0DBLMi00E0hodbQw==", "funding": [ { "type": "github", @@ -12973,9 +12700,9 @@ ], "license": "MIT", "dependencies": { - "@csstools/cascade-layer-name-parser": "^2.0.4", - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3", + "@csstools/cascade-layer-name-parser": "^2.0.5", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4", "@csstools/utilities": "^2.0.0", "postcss-value-parser": "^4.2.0" }, @@ -12987,9 +12714,9 @@ } }, "node_modules/postcss-custom-selectors": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/postcss-custom-selectors/-/postcss-custom-selectors-8.0.4.tgz", - "integrity": "sha512-ASOXqNvDCE0dAJ/5qixxPeL1aOVGHGW2JwSy7HyjWNbnWTQCl+fDc968HY1jCmZI0+BaYT5CxsOiUhavpG/7eg==", + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/postcss-custom-selectors/-/postcss-custom-selectors-8.0.5.tgz", + "integrity": "sha512-9PGmckHQswiB2usSO6XMSswO2yFWVoCAuih1yl9FVcwkscLjRKjwsjM3t+NIWpSU2Jx3eOiK2+t4vVTQaoCHHg==", "funding": [ { "type": "github", @@ -13002,9 +12729,9 @@ ], "license": "MIT", "dependencies": { - "@csstools/cascade-layer-name-parser": "^2.0.4", - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3", + "@csstools/cascade-layer-name-parser": "^2.0.5", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4", "postcss-selector-parser": "^7.0.0" }, "engines": { @@ -13129,9 +12856,9 @@ } }, "node_modules/postcss-double-position-gradients": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/postcss-double-position-gradients/-/postcss-double-position-gradients-6.0.0.tgz", - "integrity": "sha512-JkIGah3RVbdSEIrcobqj4Gzq0h53GG4uqDPsho88SgY84WnpkTpI0k50MFK/sX7XqVisZ6OqUfFnoUO6m1WWdg==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-double-position-gradients/-/postcss-double-position-gradients-6.0.2.tgz", + "integrity": "sha512-7qTqnL7nfLRyJK/AHSVrrXOuvDDzettC+wGoienURV8v2svNbu6zJC52ruZtHaO6mfcagFmuTGFdzRsJKB3k5Q==", "funding": [ { "type": "github", @@ -13144,7 +12871,7 @@ ], "license": "MIT-0", "dependencies": { - "@csstools/postcss-progressive-custom-properties": "^4.0.0", + "@csstools/postcss-progressive-custom-properties": "^4.1.0", "@csstools/utilities": "^2.0.0", "postcss-value-parser": "^4.2.0" }, @@ -13289,9 +13016,9 @@ } }, "node_modules/postcss-lab-function": { - "version": "7.0.8", - "resolved": "https://registry.npmjs.org/postcss-lab-function/-/postcss-lab-function-7.0.8.tgz", - "integrity": "sha512-plV21I86Hg9q8omNz13G9fhPtLopIWH06bt/Cb5cs1XnaGU2kUtEitvVd4vtQb/VqCdNUHK5swKn3QFmMRbpDg==", + "version": "7.0.10", + "resolved": "https://registry.npmjs.org/postcss-lab-function/-/postcss-lab-function-7.0.10.tgz", + "integrity": "sha512-tqs6TCEv9tC1Riq6fOzHuHcZyhg4k3gIAMB8GGY/zA1ssGdm6puHMVE7t75aOSoFg7UD2wyrFFhbldiCMyyFTQ==", "funding": [ { "type": "github", @@ -13304,10 +13031,10 @@ ], "license": "MIT-0", "dependencies": { - "@csstools/css-color-parser": "^3.0.8", - "@csstools/css-parser-algorithms": "^3.0.4", - "@csstools/css-tokenizer": "^3.0.3", - "@csstools/postcss-progressive-custom-properties": "^4.0.0", + "@csstools/css-color-parser": "^3.0.10", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4", + "@csstools/postcss-progressive-custom-properties": "^4.1.0", "@csstools/utilities": "^2.0.0" }, "engines": { @@ -13878,9 +13605,9 @@ } }, "node_modules/postcss-preset-env": { - "version": "10.1.5", - "resolved": "https://registry.npmjs.org/postcss-preset-env/-/postcss-preset-env-10.1.5.tgz", - "integrity": "sha512-LQybafF/K7H+6fAs4SIkgzkSCixJy0/h0gubDIAP3Ihz+IQBRwsjyvBnAZ3JUHD+A/ITaxVRPDxn//a3Qy4pDw==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/postcss-preset-env/-/postcss-preset-env-10.2.0.tgz", + "integrity": "sha512-cl13sPBbSqo1Q7Ryb19oT5NZO5IHFolRbIMdgDq4f9w1MHYiL6uZS7uSsjXJ1KzRIcX5BMjEeyxmAevVXENa3Q==", "funding": [ { "type": "github", @@ -13894,59 +13621,60 @@ "license": "MIT-0", "dependencies": { "@csstools/postcss-cascade-layers": "^5.0.1", - "@csstools/postcss-color-function": "^4.0.8", - "@csstools/postcss-color-mix-function": "^3.0.8", - "@csstools/postcss-content-alt-text": "^2.0.4", - "@csstools/postcss-exponential-functions": "^2.0.7", + "@csstools/postcss-color-function": "^4.0.10", + "@csstools/postcss-color-mix-function": "^3.0.10", + "@csstools/postcss-color-mix-variadic-function-arguments": "^1.0.0", + "@csstools/postcss-content-alt-text": "^2.0.6", + "@csstools/postcss-exponential-functions": "^2.0.9", "@csstools/postcss-font-format-keywords": "^4.0.0", - "@csstools/postcss-gamut-mapping": "^2.0.8", - "@csstools/postcss-gradients-interpolation-method": "^5.0.8", - "@csstools/postcss-hwb-function": "^4.0.8", - "@csstools/postcss-ic-unit": "^4.0.0", + "@csstools/postcss-gamut-mapping": "^2.0.10", + "@csstools/postcss-gradients-interpolation-method": "^5.0.10", + "@csstools/postcss-hwb-function": "^4.0.10", + "@csstools/postcss-ic-unit": "^4.0.2", "@csstools/postcss-initial": "^2.0.1", "@csstools/postcss-is-pseudo-class": "^5.0.1", - "@csstools/postcss-light-dark-function": "^2.0.7", + "@csstools/postcss-light-dark-function": "^2.0.9", "@csstools/postcss-logical-float-and-clear": "^3.0.0", "@csstools/postcss-logical-overflow": "^2.0.0", "@csstools/postcss-logical-overscroll-behavior": "^2.0.0", "@csstools/postcss-logical-resize": "^3.0.0", - "@csstools/postcss-logical-viewport-units": "^3.0.3", - "@csstools/postcss-media-minmax": "^2.0.7", - "@csstools/postcss-media-queries-aspect-ratio-number-values": "^3.0.4", + "@csstools/postcss-logical-viewport-units": "^3.0.4", + "@csstools/postcss-media-minmax": "^2.0.9", + "@csstools/postcss-media-queries-aspect-ratio-number-values": "^3.0.5", "@csstools/postcss-nested-calc": "^4.0.0", "@csstools/postcss-normalize-display-values": "^4.0.0", - "@csstools/postcss-oklab-function": "^4.0.8", - "@csstools/postcss-progressive-custom-properties": "^4.0.0", - "@csstools/postcss-random-function": "^1.0.3", - "@csstools/postcss-relative-color-syntax": "^3.0.8", + "@csstools/postcss-oklab-function": "^4.0.10", + "@csstools/postcss-progressive-custom-properties": "^4.1.0", + "@csstools/postcss-random-function": "^2.0.1", + "@csstools/postcss-relative-color-syntax": "^3.0.10", "@csstools/postcss-scope-pseudo-class": "^4.0.1", - "@csstools/postcss-sign-functions": "^1.1.2", - "@csstools/postcss-stepped-value-functions": "^4.0.7", + "@csstools/postcss-sign-functions": "^1.1.4", + "@csstools/postcss-stepped-value-functions": "^4.0.9", "@csstools/postcss-text-decoration-shorthand": "^4.0.2", - "@csstools/postcss-trigonometric-functions": "^4.0.7", + "@csstools/postcss-trigonometric-functions": "^4.0.9", "@csstools/postcss-unset-value": "^4.0.0", - "autoprefixer": "^10.4.19", - "browserslist": "^4.24.4", + "autoprefixer": "^10.4.21", + "browserslist": "^4.24.5", "css-blank-pseudo": "^7.0.1", "css-has-pseudo": "^7.0.2", "css-prefers-color-scheme": "^10.0.0", - "cssdb": "^8.2.3", + "cssdb": "^8.3.0", "postcss-attribute-case-insensitive": "^7.0.1", "postcss-clamp": "^4.1.0", - "postcss-color-functional-notation": "^7.0.8", + "postcss-color-functional-notation": "^7.0.10", "postcss-color-hex-alpha": "^10.0.0", "postcss-color-rebeccapurple": "^10.0.0", - "postcss-custom-media": "^11.0.5", - "postcss-custom-properties": "^14.0.4", - "postcss-custom-selectors": "^8.0.4", + "postcss-custom-media": "^11.0.6", + "postcss-custom-properties": "^14.0.5", + "postcss-custom-selectors": "^8.0.5", "postcss-dir-pseudo-class": "^9.0.1", - "postcss-double-position-gradients": "^6.0.0", + "postcss-double-position-gradients": "^6.0.2", "postcss-focus-visible": "^10.0.1", "postcss-focus-within": "^9.0.1", "postcss-font-variant": "^5.0.0", "postcss-gap-properties": "^6.0.0", "postcss-image-set-function": "^7.0.0", - "postcss-lab-function": "^7.0.8", + "postcss-lab-function": "^7.0.10", "postcss-logical": "^8.1.0", "postcss-nesting": "^13.0.1", "postcss-opacity-percentage": "^3.0.0", @@ -14307,15 +14035,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/queue": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/queue/-/queue-6.0.2.tgz", - "integrity": "sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==", - "license": "MIT", - "dependencies": { - "inherits": "~2.0.3" - } - }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -14421,132 +14140,6 @@ "node": ">=0.10.0" } }, - "node_modules/react-dev-utils": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-12.0.1.tgz", - "integrity": "sha512-84Ivxmr17KjUupyqzFode6xKhjwuEJDROWKJy/BthkL7Wn6NJ8h4WE6k/exAv6ImS+0oZLRRW5j/aINMHyeGeQ==", - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.16.0", - "address": "^1.1.2", - "browserslist": "^4.18.1", - "chalk": "^4.1.2", - "cross-spawn": "^7.0.3", - "detect-port-alt": "^1.1.6", - "escape-string-regexp": "^4.0.0", - "filesize": "^8.0.6", - "find-up": "^5.0.0", - "fork-ts-checker-webpack-plugin": "^6.5.0", - "global-modules": "^2.0.0", - "globby": "^11.0.4", - "gzip-size": "^6.0.0", - "immer": "^9.0.7", - "is-root": "^2.1.0", - "loader-utils": "^3.2.0", - "open": "^8.4.0", - "pkg-up": "^3.1.0", - "prompts": "^2.4.2", - "react-error-overlay": "^6.0.11", - "recursive-readdir": "^2.2.2", - "shell-quote": "^1.7.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/react-dev-utils/node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "license": "MIT", - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/react-dev-utils/node_modules/loader-utils": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-3.3.1.tgz", - "integrity": "sha512-FMJTLMXfCLMLfJxcX9PFqX5qD88Z5MRGaZCVzfuqeZSPsyiBzs+pahDQjbIWz2QIzPZz0NX9Zy4FX3lmK6YHIg==", - "license": "MIT", - "engines": { - "node": ">= 12.13.0" - } - }, - "node_modules/react-dev-utils/node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "license": "MIT", - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/react-dev-utils/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "license": "MIT", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/react-dev-utils/node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "license": "MIT", - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/react-dev-utils/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/react-dev-utils/node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/react-dom": { "version": "19.1.0", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.0.tgz", @@ -14559,12 +14152,6 @@ "react": "^19.1.0" } }, - "node_modules/react-error-overlay": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.1.0.tgz", - "integrity": "sha512-SN/U6Ytxf1QGkw/9ve5Y+NxBbZM6Ht95tuXNMKs8EJyFa/Vy/+Co3stop3KBHARfn/giv+Lj1uUnTfOJ3moFEQ==", - "license": "MIT" - }, "node_modules/react-fast-compare": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.2.tgz", @@ -14594,6 +14181,18 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, + "node_modules/react-json-view-lite": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/react-json-view-lite/-/react-json-view-lite-2.4.1.tgz", + "integrity": "sha512-fwFYknRIBxjbFm0kBDrzgBy1xa5tDg2LyXXBepC5f1b+MY3BUClMCsvanMPn089JbV1Eg3nZcrp0VCuH43aXnA==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "react": "^18.0.0 || ^19.0.0" + } + }, "node_modules/react-loadable": { "name": "@docusaurus/react-loadable", "version": "6.0.0", @@ -14697,35 +14296,6 @@ "node": ">=8.10.0" } }, - "node_modules/reading-time": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/reading-time/-/reading-time-1.5.0.tgz", - "integrity": "sha512-onYyVhBNr4CmAxFsKS7bz+uTLRakypIe4R+5A824vBSkQy/hB3fZepoVEf8OVAxzLvK+H/jm9TzpI3ETSm64Kg==", - "license": "MIT" - }, - "node_modules/rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", - "dependencies": { - "resolve": "^1.1.6" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/recursive-readdir": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz", - "integrity": "sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==", - "license": "MIT", - "dependencies": { - "minimatch": "^3.0.5" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -15256,6 +14826,12 @@ "integrity": "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==", "license": "MIT" }, + "node_modules/schema-dts": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/schema-dts/-/schema-dts-1.1.5.tgz", + "integrity": "sha512-RJr9EaCmsLzBX2NDiO5Z3ux2BVosNZN5jo0gWgsyKvxKIUL5R3swNvoorulAeL9kLB0iTSX7V6aokhla2m7xbg==", + "license": "Apache-2.0" + }, "node_modules/schema-utils": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.0.tgz", @@ -15598,22 +15174,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/shelljs": { - "version": "0.8.5", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", - "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", - "dependencies": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" - }, - "bin": { - "shjs": "bin/shjs" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/side-channel": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", @@ -15885,9 +15445,9 @@ } }, "node_modules/std-env": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.8.1.tgz", - "integrity": "sha512-vj5lIj3Mwf9D79hBkltk5qmkFI+biIKWS2IBxEyEU3AX1tUf7AoL8nSazCOiiqQsGKIq01SClsKEzweu34uwvA==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.9.0.tgz", + "integrity": "sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==", "license": "MIT" }, "node_modules/string_decoder": { @@ -16230,12 +15790,6 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "license": "MIT" - }, "node_modules/thunky": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", @@ -16252,6 +15806,15 @@ "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" }, + "node_modules/tinypool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.0.tgz", + "integrity": "sha512-7CotroY9a8DKsKprEy/a14aCCm8jYVmR7aFy4fpkZM8sdpNJbKkixuNjgM50yCmip2ezc8z4N7k3oe2+rfRJCQ==", + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -16363,6 +15926,7 @@ "version": "5.5.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz", "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", + "optional": true, "peer": true, "bin": { "tsc": "bin/tsc", @@ -16561,9 +16125,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", - "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", + "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", "funding": [ { "type": "opencollective", @@ -16578,9 +16142,10 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { "escalade": "^3.2.0", - "picocolors": "^1.1.0" + "picocolors": "^1.1.1" }, "bin": { "update-browserslist-db": "cli.js" @@ -17445,19 +17010,10 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, - "node_modules/yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "license": "ISC", - "engines": { - "node": ">= 6" - } - }, "node_modules/yocto-queue": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz", - "integrity": "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.1.tgz", + "integrity": "sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg==", "license": "MIT", "engines": { "node": ">=12.20" diff --git a/docs/package.json b/docs/package.json index 7c155bd9e..2bb440711 100644 --- a/docs/package.json +++ b/docs/package.json @@ -14,9 +14,9 @@ "write-heading-ids": "docusaurus write-heading-ids" }, "dependencies": { - "@docusaurus/core": "3.7.0", - "@docusaurus/plugin-client-redirects": "^3.7.0", - "@docusaurus/preset-classic": "3.7.0", + "@docusaurus/core": "3.8.0", + "@docusaurus/plugin-client-redirects": "^3.8.0", + "@docusaurus/preset-classic": "3.8.0", "@mdx-js/react": "^3.1.0", "clsx": "^2.0.0", "docusaurus-theme-github-codeblock": "^2.0.2", @@ -25,8 +25,8 @@ "react-dom": "^19.1.0" }, "devDependencies": { - "@docusaurus/module-type-aliases": "3.7.0", - "@docusaurus/types": "3.7.0" + "@docusaurus/module-type-aliases": "3.8.0", + "@docusaurus/types": "3.8.0" }, "browserslist": { "production": [ From cbd8f3a870580e55892e2e207da8d45bcc2007ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Jun 2025 11:57:19 -0400 Subject: [PATCH 617/719] chore(deps): bump mypy from 1.15.0 to 1.16.0 (#1309) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: William Bergamin Co-authored-by: William Bergamin --- requirements/tools.txt | 2 +- slack_bolt/adapter/falcon/async_resource.py | 2 +- slack_bolt/adapter/falcon/resource.py | 4 ++-- slack_bolt/app/app.py | 2 +- slack_bolt/app/async_app.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements/tools.txt b/requirements/tools.txt index 0fd423ad2..0e6090497 100644 --- a/requirements/tools.txt +++ b/requirements/tools.txt @@ -1,3 +1,3 @@ -mypy==1.15.0 +mypy==1.16.0 flake8==7.2.0 black==24.8.0 # Until we drop Python 3.6 support, we have to stay with this version diff --git a/slack_bolt/adapter/falcon/async_resource.py b/slack_bolt/adapter/falcon/async_resource.py index eece0a323..8d03b456c 100644 --- a/slack_bolt/adapter/falcon/async_resource.py +++ b/slack_bolt/adapter/falcon/async_resource.py @@ -42,7 +42,7 @@ async def on_get(self, req: Request, resp: Response): resp.status = "404" # Falcon 4.x w/ mypy fails to correctly infer the str type here - resp.body = "The page is not found..." # type: ignore[assignment] + resp.body = "The page is not found..." async def on_post(self, req: Request, resp: Response): bolt_req = await self._to_bolt_request(req) diff --git a/slack_bolt/adapter/falcon/resource.py b/slack_bolt/adapter/falcon/resource.py index baf0f9745..53792775f 100644 --- a/slack_bolt/adapter/falcon/resource.py +++ b/slack_bolt/adapter/falcon/resource.py @@ -36,7 +36,7 @@ def on_get(self, req: Request, resp: Response): resp.status = "404" # Falcon 4.x w/ mypy fails to correctly infer the str type here - resp.body = "The page is not found..." # type: ignore[assignment] + resp.body = "The page is not found..." def on_post(self, req: Request, resp: Response): bolt_req = self._to_bolt_request(req) @@ -53,7 +53,7 @@ def _to_bolt_request(self, req: Request) -> BoltRequest: def _write_response(self, bolt_resp: BoltResponse, resp: Response): if falcon_version.__version__.startswith("2."): # Falcon 4.x w/ mypy fails to correctly infer the str type here - resp.body = bolt_resp.body # type: ignore[assignment] + resp.body = bolt_resp.body else: resp.text = bolt_resp.body diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 69da0a0d8..c117740a1 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -1448,7 +1448,7 @@ def _register_listener( CustomListener( app_name=self.name, ack_function=functions.pop(0), - lazy_functions=functions, + lazy_functions=functions, # type:ignore[arg-type] matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 3fcc3d955..c04326291 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -1487,7 +1487,7 @@ def _register_listener( AsyncCustomListener( app_name=self.name, ack_function=functions.pop(0), - lazy_functions=functions, + lazy_functions=functions, # type:ignore[arg-type] matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, From 260e9b9c34ac930c99769077ee682dda9e0f1426 Mon Sep 17 00:00:00 2001 From: Tracy Rericha <108959677+technically-tracy@users.noreply.github.com> Date: Tue, 3 Jun 2025 12:09:24 -0400 Subject: [PATCH 618/719] docs: updated nav (#1313) --- docs/sidebars.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/sidebars.js b/docs/sidebars.js index 82209d428..65c5e85f4 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -40,8 +40,14 @@ const sidebars = { ], }, "concepts/ai-apps", - "concepts/custom-steps", - "concepts/custom-steps-dynamic-options", + { + type: 'category', + label: 'Custom Steps', + items: [ + 'concepts/custom-steps', + 'concepts/custom-steps-dynamic-options', + ] + }, { type: "category", label: "App Configuration", From 5778bf59c6c28379faa2ffee62c0b1e862b2a3f0 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Thu, 26 Jun 2025 13:22:57 -0400 Subject: [PATCH 619/719] fix: sanic dependencies for tests (#1320) --- .github/workflows/tests.yml | 14 +++++++------- requirements/adapter.txt | 5 +++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a1135f265..1d16d1a1b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -53,20 +53,20 @@ jobs: - name: Install async dependencies run: | pip install -r requirements/async.txt - - name: Run tests for HTTP Mode adapters (ASGI) - run: | - # Requires async test dependencies - pytest tests/adapter_tests/asgi/ --junitxml=reports/test_adapter_asgi.xml - name: Run tests for Socket Mode adapters run: | # Requires async test dependencies pytest tests/adapter_tests/socket_mode/ --junitxml=reports/test_adapter_socket_mode.xml - - name: Run tests for HTTP Mode adapters (asyncio-based libraries) - run: | - pytest tests/adapter_tests_async/ --junitxml=reports/test_adapter_async.xml - name: Install all dependencies run: | pip install -r requirements/testing.txt + - name: Run tests for HTTP Mode adapters (ASGI) + run: | + # Requires async test dependencies + pytest tests/adapter_tests/asgi/ --junitxml=reports/test_adapter_asgi.xml + - name: Run tests for HTTP Mode adapters (asyncio-based libraries) + run: | + pytest tests/adapter_tests_async/ --junitxml=reports/test_adapter_async.xml - name: Run asynchronous tests run: | pytest tests/slack_bolt_async/ --junitxml=reports/test_slack_bolt_async.xml diff --git a/requirements/adapter.txt b/requirements/adapter.txt index 6618f2b6f..b8cadb510 100644 --- a/requirements/adapter.txt +++ b/requirements/adapter.txt @@ -13,9 +13,14 @@ fastapi>=0.70.0,<1 Flask>=1,<4 Werkzeug>=2,<4 pyramid>=1,<3 + +# Sanic and its dependencies +# Note: Sanic imports tracerite with wild card versions +tracerite<1.1.2; python_version<="3.8" # older versions of python are not compatible with tracerite>1.1.2 sanic>=20,<21; python_version=="3.6" sanic>=21,<24; python_version>"3.6" and python_version<="3.8" sanic>=21,<26; python_version>"3.8" + starlette>=0.19.1,<1 tornado>=6,<7 uvicorn<1 # The oldest version can vary among Python runtime versions From 7f9ae9cdb68c4f98995f557c2fec6bbbfaf62239 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Jun 2025 16:06:07 -0700 Subject: [PATCH 620/719] chore(deps): bump brace-expansion from 1.1.11 to 1.1.12 in /docs (#1321) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/package-lock.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/package-lock.json b/docs/package-lock.json index 303f5487a..4e7d7b445 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -5421,9 +5421,10 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" From 35295329f4118c16d2cc3e4545661a98eac7b192 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Fri, 27 Jun 2025 12:59:44 -0700 Subject: [PATCH 621/719] ci: run unit tests on main once a day (#1319) Co-authored-by: William Bergamin --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1d16d1a1b..748ddcd30 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,6 +5,8 @@ on: branches: - main pull_request: + schedule: + - cron: "0 0 * * *" jobs: build: From 079552dc861d710b846a4bdb4044cb6431a5f304 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Fri, 27 Jun 2025 16:29:56 -0400 Subject: [PATCH 622/719] chore: run CI tests from the Github UI (#1322) --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 748ddcd30..3b396b201 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,6 +7,7 @@ on: pull_request: schedule: - cron: "0 0 * * *" + workflow_dispatch: jobs: build: From d3ca0550196a2211c991f5db34ff40945e980095 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Fri, 27 Jun 2025 14:10:07 -0700 Subject: [PATCH 623/719] ci: send a notification of failing tests on the main branch (#1323) Co-authored-by: William Bergamin --- .github/workflows/tests.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3b396b201..4fe757b1a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -82,3 +82,18 @@ jobs: flags: ${{ matrix.python-version }} token: ${{ secrets.CODECOV_TOKEN }} verbose: true + notifications: + name: Regression notifications + runs-on: ubuntu-latest + needs: build + if: failure() && github.ref == 'refs/heads/main' && github.event_name != 'workflow_dispatch' + steps: + - name: Send notifications of failing tests + uses: slackapi/slack-github-action@b0fa283ad8fea605de13dc3f449259339835fc52 # v2.1.0 + with: + errors: true + webhook: ${{ secrets.SLACK_REGRESSION_FAILURES_WEBHOOK_URL }} + webhook-type: webhook-trigger + payload: | + action_url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + repository: "${{ github.repository }}" From b9c9999b1d3777997af1c8f57a4d59aa9e148256 Mon Sep 17 00:00:00 2001 From: Tracy Rericha <108959677+technically-tracy@users.noreply.github.com> Date: Tue, 1 Jul 2025 06:57:34 -0400 Subject: [PATCH 624/719] docs: add quick start guide using the slack cli and terminal (#1317) --- docs/content/building-an-app.md | 483 +++++++++++++++++++++++++++++ docs/content/getting-started.md | 527 +++++++++++--------------------- docs/docusaurus.config.js | 1 + docs/sidebars.js | 6 +- 4 files changed, 662 insertions(+), 355 deletions(-) create mode 100644 docs/content/building-an-app.md diff --git a/docs/content/building-an-app.md b/docs/content/building-an-app.md new file mode 100644 index 000000000..deb3146b9 --- /dev/null +++ b/docs/content/building-an-app.md @@ -0,0 +1,483 @@ +--- +title: Building an App with Bolt for Python +sidebar_label: Building an App +--- + +# Building an App with Bolt for Python + +This guide is meant to walk you through getting up and running with a Slack app using Bolt for Python. Along the way, we’ll create a new Slack app, set up your local environment, and develop an app that listens and responds to messages from a Slack workspace. + +When you're finished, you'll have created the [Getting Started app](https://github.com/slackapi/bolt-python/tree/main/examples/getting_started) to run, modify, and make your own. ⚡️ + +--- + +### Create an app {#create-an-app} +First thing's first: before you start developing with Bolt, you'll want to [create a Slack app](https://api.slack.com/apps/new). + +:::tip[A place to test and learn] + +We recommend using a workspace where you won't disrupt real work getting done — [you can create a new one for free](https://slack.com/get-started#create). + +::: + +After you fill out an app name (_you can change it later_) and pick a workspace to install it to, hit the `Create App` button and you'll land on your app's **Basic Information** page. + +This page contains an overview of your app in addition to important credentials you'll need later. + +![Basic Information page](/img/boltpy/basic-information-page.png "Basic Information page") + +Look around, add an app icon and description, and then let's start configuring your app 🔩 + +--- + +### Tokens and installing apps {#tokens-and-installing-apps} +Slack apps use [OAuth to manage access to Slack's APIs](https://docs.slack.dev/authentication/installing-with-oauth). When an app is installed, you'll receive a token that the app can use to call API methods. + +There are three main token types available to a Slack app: user (`xoxp`), bot (`xoxb`), and app-level (`xapp`) tokens. +- [User tokens](https://docs.slack.dev/authentication/tokens#user) allow you to call API methods on behalf of users after they install or authenticate the app. There may be several user tokens for a single workspace. +- [Bot tokens](https://docs.slack.dev/authentication/tokens#bot) are associated with bot users, and are only granted once in a workspace where someone installs the app. The bot token your app uses will be the same no matter which user performed the installation. Bot tokens are the token type that _most_ apps use. +- [App-level tokens](https://docs.slack.dev/authentication/tokens#app-level) represent your app across organizations, including installations by all individual users on all workspaces in a given organization and are commonly used for creating WebSocket connections to your app. + +We're going to use bot and app-level tokens for this guide. + +1. Navigate to **OAuth & Permissions** on the left sidebar and scroll down to the **Bot Token Scopes** section. Click **Add an OAuth Scope**. + +2. For now, we'll just add one scope: [`chat:write`](https://docs.slack.dev/reference/scopes/chat.write). This grants your app the permission to post messages in channels it's a member of. + +3. Scroll up to the top of the **OAuth & Permissions** page and click **Install App to Workspace**. You'll be led through Slack's OAuth UI, where you should allow your app to be installed to your development workspace. + +4. Once you authorize the installation, you'll land on the **OAuth & Permissions** page and see a **Bot User OAuth Access Token**. + +![OAuth Tokens](/img/boltpy/bot-token.png "Bot OAuth Token") + +5. Head over to **Basic Information** and scroll down under the App Token section and click **Generate Token and Scopes** to generate an app-level token. Add the `connections:write` scope to this token and save the generated `xapp` token. + +6. Navigate to **Socket Mode** on the left side menu and toggle to enable. + +:::tip[Not sharing is sometimes caring] + +Treat your tokens like passwords and [keep them safe](https://docs.slack.dev/authentication/best-practices-for-security). Your app uses tokens to post and retrieve information from Slack workspaces. + +::: + +--- + +### Setting up your project {#setting-up-your-project} + +With the initial configuration handled, it's time to set up a new Bolt project. This is where you'll write the code that handles the logic for your app. + +If you don’t already have a project, let’s create a new one. Create an empty directory: + +```sh +$ mkdir first-bolt-app +$ cd first-bolt-app +``` + +Next, we recommend using a [Python virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment) to manage your project's dependencies. This is a great way to prevent conflicts with your system's Python packages. Let's create and activate a new virtual environment with [Python 3.6 or later](https://www.python.org/downloads/): + +```sh +$ python3 -m venv .venv +$ source .venv/bin/activate +$ pip install -r requirements.txt +``` + +We can confirm that the virtual environment is active by checking that the path to `python3` is _inside_ your project ([a similar command is available on Windows](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#activating-a-virtual-environment)): + +```sh +$ which python3 +# Output: /path/to/first-bolt-app/.venv/bin/python3 +``` + +Before we install the Bolt for Python package to your new project, let's save the **bot token** and **app-level token** that were generated when you configured your app. + +1. **Copy your bot (xoxb) token from the OAuth & Permissions page** and store it in a new environment variable. The following example works on Linux and macOS; but [similar commands are available on Windows](https://superuser.com/questions/212150/how-to-set-env-variable-in-windows-cmd-line/212153#212153). + +```sh +$ export SLACK_BOT_TOKEN=xoxb- +``` + +2. **Copy your app-level (xapp) token from the Basic Information page** and then store it in a new environment variable. + +```sh +$ export SLACK_APP_TOKEN= +``` + +:::warning[Keep it secret. Keep it safe.] + +Remember to keep your tokens secure. At a minimum, you should avoid checking them into public version control, and access them via environment variables as we've done above. Check out the API documentation for more on [best practices for app security](https://docs.slack.dev/authentication/best-practices-for-security). + +::: + +Now, let's create your app. Install the `slack_bolt` Python package to your virtual environment using the following command: + +```sh +$ pip install slack_bolt +``` + +Create a new file called `app.py` in this directory and add the following code: + +```python +import os +from slack_bolt import App +from slack_bolt.adapter.socket_mode import SocketModeHandler + +# Initializes your app with your bot token and socket mode handler +app = App(token=os.environ.get("SLACK_BOT_TOKEN")) + +# Start your app +if __name__ == "__main__": + SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]).start() +``` + +Your tokens are enough to create your first Bolt app. Save your `app.py` file then on the command line run the following: + +```sh +$ python3 app.py +``` + +Your app should let you know that it's up and running. 🎉 + +--- + +### Setting up events {#setting-up-events} +Your app behaves similarly to people on your team — it can post messages, add emoji reactions, and listen and respond to events. + +To listen for events happening in a Slack workspace (like when a message is posted or when a reaction is posted to a message) you'll use the [Events API to subscribe to event types](https://docs.slack.dev/apis/events-api/). + +For those just starting, we recommend using [Socket Mode](https://docs.slack.dev/apis/events-api/using-socket-mode). Socket Mode allows your app to use the Events API and interactive features without exposing a public HTTP Request URL. This can be helpful during development, or if you're receiving requests from behind a firewall. + +That being said, you're welcome to set up an app with a public HTTP Request URL. HTTP is more useful for apps being deployed to hosting environments to respond within a large corporate Slack workspaces/organization, or apps intended for distribution via the Slack Marketplace. + +We've provided instructions for both ways in this guide. + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + +1. Head to your app's configuration page (click on the app [from your app settings page](https://api.slack.com/apps)). Navigate to **Socket Mode** on the left side menu and toggle to enable. + +2. Go to **Basic Information** and scroll down under the App-Level Tokens section and click **Generate Token and Scopes** to generate an app-level token. Add the `connections:write` scope to this token and save the generated `xapp` token, we'll use that in just a moment. + +3. Finally, it's time to tell Slack what events we'd like to listen for. Under **Event Subscriptions**, toggle the switch labeled **Enable Events**. + +When an event occurs, Slack will send your app some information about the event, like the user that triggered it and the channel it occurred in. Your app will process the details and can respond accordingly. + + + + +1. Go back to your app configuration page (click on the app [from your app management page](https://api.slack.com/apps)). Click **Event Subscriptions** on the left sidebar. Toggle the switch labeled **Enable Events**. + +2. Add your Request URL. Slack will send HTTP POST requests corresponding to events to this [Request URL](https://docs.slack.dev/apis/events-api/#subscribing) endpoint. Bolt uses the `/slack/events` path to listen to all incoming requests (whether shortcuts, events, or interactivity payloads). When configuring your Request URL within your app configuration, you'll append `/slack/events`, e.g. `https:///slack/events`. 💡 As long as your Bolt app is still running, your URL should become verified. + +:::tip[Using proxy services] + +For local development, you can use a proxy service like ngrok to create a public URL and tunnel requests to your development environment. Refer to [ngrok's getting started guide](https://ngrok.com/docs#getting-started-expose) on how to create this tunnel. And when you get to hosting your app, we've collected some of the most common hosting providers Slack developers use to host their apps [on our API site](https://docs.slack.dev/distribution/hosting-slack-apps/). + +::: + + + + +Navigate to **Event Subscriptions** on the left sidebar and toggle to enable. Under **Subscribe to Bot Events**, you can add events for your bot to respond to. There are four events related to messages: +- [`message.channels`](https://docs.slack.dev/reference/events/message.channels) listens for messages in public channels that your app is added to. +- [`message.groups`](https://docs.slack.dev/reference/events/message.groups) listens for messages in 🔒 private channels that your app is added to. +- [`message.im`](https://docs.slack.dev/reference/events/message.im) listens for messages in your app's DMs with users. +- [`message.mpim`](https://docs.slack.dev/reference/events/message.mpim) listens for messages in multi-person DMs that your app is added to. + +If you want your bot to listen to messages from everywhere it is added to, choose all four message events. After you’ve selected the events you want your bot to listen to, click the green **Save Changes** button. + +--- + +### Listening and responding to a message {#listening-and-responding-to-a-message} +Your app is now ready for some logic. Let's start by using the `message()` method to attach a listener for messages. + +The following example listens and responds to all messages in channels/DMs where your app has been added that contain the word "hello": + + + + +```python +import os +from slack_bolt import App +from slack_bolt.adapter.socket_mode import SocketModeHandler + +# Initializes your app with your bot token and socket mode handler +app = App(token=os.environ.get("SLACK_BOT_TOKEN")) + +# Listens to incoming messages that contain "hello" +# To learn available listener arguments, +# visit https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html +@app.message("hello") +def message_hello(message, say): + # say() sends a message to the channel where the event was triggered + say(f"Hey there <@{message['user']}>!") + +# Start your app +if __name__ == "__main__": + SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]).start() +``` + + + + +```python +import os +from slack_bolt import App + +# Initializes your app with your bot token and signing secret +app = App( + token=os.environ.get("SLACK_BOT_TOKEN"), + signing_secret=os.environ.get("SLACK_SIGNING_SECRET") +) + +# Listens to incoming messages that contain "hello" +# To learn available listener arguments, +# visit https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html +@app.message("hello") +def message_hello(message, say): + # say() sends a message to the channel where the event was triggered + say(f"Hey there <@{message['user']}>!") + +# Start your app +if __name__ == "__main__": + app.start(port=int(os.environ.get("PORT", 3000))) +``` + + + + +If you restart your app, so long as your bot user has been added to the channel or DM conversation, when you send any message that contains "hello", it will respond. + +This is a basic example, but it gives you a place to start customizing your app based on your own goals. Let's try something a little more interactive by sending a button rather than plain text. + +--- + +### Sending and responding to actions {#sending-and-responding-to-actions} + +To use features like buttons, select menus, datepickers, modals, and shortcuts, you’ll need to enable interactivity. Head over to **Interactivity & Shortcuts** in your app configuration. + + + + +With Socket Mode on, basic interactivity is enabled by default, so no further action is needed. + + + + +Similar to events, you'll need to specify a URL for Slack to send the action (such as _user clicked a button_). Back on your app configuration page, click on **Interactivity & Shortcuts** on the left side. You'll see that there's another **Request URL** box. + +:::tip + +By default, Bolt is configured to use the same endpoint for interactive components that it uses for events, so use the same request URL as above (for example, `https://8e8ec2d7.ngrok.io/slack/events`). Press the **Save Changes** button in the lower right hand corner, and that's it. Your app is set up to handle interactivity! + +::: + + + + +When interactivity is enabled, interactions with shortcuts, modals, or interactive components (such as buttons, select menus, and datepickers) will be sent to your app as events. + +Now, let's go back to your app's code and add logic to handle those events: +- First, we'll send a message that contains an interactive component (in this case a button). +- Next, we'll listen for the action of a user clicking the button before responding. + +Below, the code from the last section is modified to send a message containing a button rather than just a string: + + + + +```python +import os +from slack_bolt import App +from slack_bolt.adapter.socket_mode import SocketModeHandler + +# Initializes your app with your bot token and socket mode handler +app = App( + token=os.environ.get("SLACK_BOT_TOKEN"), + # signing_secret=os.environ.get("SLACK_SIGNING_SECRET") # not required for socket mode +) + +# Listens to incoming messages that contain "hello" +@app.message("hello") +def message_hello(message, say): + # say() sends a message to the channel where the event was triggered + say( + blocks=[ + { + "type": "section", + "text": {"type": "mrkdwn", "text": f"Hey there <@{message['user']}>!"}, + "accessory": { + "type": "button", + "text": {"type": "plain_text", "text": "Click Me"}, + "action_id": "button_click" + } + } + ], + text=f"Hey there <@{message['user']}>!" + ) + +# Start your app +if __name__ == "__main__": + SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]).start() + +``` + + + + +```python +import os +from slack_bolt import App + +# Initializes your app with your bot token and signing secret +app = App( + token=os.environ.get("SLACK_BOT_TOKEN"), + signing_secret=os.environ.get("SLACK_SIGNING_SECRET") +) + +# Listens to incoming messages that contain "hello" +@app.message("hello") +def message_hello(message, say): + # say() sends a message to the channel where the event was triggered + say( + blocks=[ + { + "type": "section", + "text": {"type": "mrkdwn", "text": f"Hey there <@{message['user']}>!"}, + "accessory": { + "type": "button", + "text": {"type": "plain_text", "text": "Click Me"}, + "action_id": "button_click" + } + } + ], + text=f"Hey there <@{message['user']}>!" + ) + +# Start your app +if __name__ == "__main__": + app.start(port=int(os.environ.get("PORT", 3000))) +``` + + + + +The value inside of `say()` is now an object that contains an array of `blocks`. Blocks are the building components of a Slack message and can range from text to images to datepickers. In this case, your app will respond with a section block that includes a button as an accessory. Since we're using `blocks`, the `text` is a fallback for notifications and accessibility. + +You'll notice in the button `accessory` object, there is an `action_id`. This will act as a unique identifier for the button so your app can specify which action it wants to respond to. + +:::tip[Using Block Kit Builder] + +The [Block Kit Builder](https://app.slack.com/block-kit-builder) is an simple way to prototype your interactive messages. The builder lets you (or anyone on your team) mock up messages and generates the corresponding JSON that you can paste directly in your app. + +::: + +Now, if you restart your app and say "hello" in a channel your app is in, you'll see a message with a button. But if you click the button, nothing happens (_yet!_). + +Let's add a handler to send a follow-up message when someone clicks the button: + + + + +```python +import os +from slack_bolt import App +from slack_bolt.adapter.socket_mode import SocketModeHandler + +# Initializes your app with your bot token and socket mode handler +app = App(token=os.environ.get("SLACK_BOT_TOKEN")) + +# Listens to incoming messages that contain "hello" +@app.message("hello") +def message_hello(message, say): + # say() sends a message to the channel where the event was triggered + say( + blocks=[ + { + "type": "section", + "text": {"type": "mrkdwn", "text": f"Hey there <@{message['user']}>!"}, + "accessory": { + "type": "button", + "text": {"type": "plain_text", "text": "Click Me"}, + "action_id": "button_click" + } + } + ], + text=f"Hey there <@{message['user']}>!" + ) + +@app.action("button_click") +def action_button_click(body, ack, say): + # Acknowledge the action + ack() + say(f"<@{body['user']['id']}> clicked the button") + +# Start your app +if __name__ == "__main__": + SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]).start() +``` + + + + +```python +import os +from slack_bolt import App + +# Initializes your app with your bot token and signing secret +app = App( + token=os.environ.get("SLACK_BOT_TOKEN"), + signing_secret=os.environ.get("SLACK_SIGNING_SECRET") +) + +# Listens to incoming messages that contain "hello" +@app.message("hello") +def message_hello(message, say): + # say() sends a message to the channel where the event was triggered + say( + blocks=[ + { + "type": "section", + "text": {"type": "mrkdwn", "text": f"Hey there <@{message['user']}>!"}, + "accessory": { + "type": "button", + "text": {"type": "plain_text", "text": "Click Me"}, + "action_id": "button_click" + } + } + ], + text=f"Hey there <@{message['user']}>!" + ) + +@app.action("button_click") +def action_button_click(body, ack, say): + # Acknowledge the action + ack() + say(f"<@{body['user']['id']}> clicked the button") + +# Start your app +if __name__ == "__main__": + app.start(port=int(os.environ.get("PORT", 3000))) +``` + + + + +You can see that we used `app.action()` to listen for the `action_id` that we named `button_click`. If you restart your app and click the button, you'll see a new message from your app that says you clicked the button. + +--- + +### Next steps {#next-steps} +You just built your first [Bolt for Python app](https://github.com/slackapi/bolt-python/tree/main/examples/getting_started)! 🎉 + +Now that you have a basic app up and running, you can start exploring how to make your Bolt app stand out. Here are some ideas about what to explore next: + +* Read through the concepts pages to learn about the different methods and features your Bolt app has access to. + +* Explore the different events your bot can listen to with the [`app.event()`](/concepts/event-listening) method. All of the events are listed [on the API docs site](https://docs.slack.dev/reference/events). + +* Bolt allows you to [call Web API methods](/concepts/web-api) with the client attached to your app. There are [over 200 methods](https://docs.slack.dev/reference/methods) on our API site. + +* Learn more about the different token types [on the API docs site](https://docs.slack.dev/authentication/tokens). Your app may need different tokens depending on the actions you want it to perform. diff --git a/docs/content/getting-started.md b/docs/content/getting-started.md index d1b7d5e2c..a794f3176 100644 --- a/docs/content/getting-started.md +++ b/docs/content/getting-started.md @@ -1,481 +1,300 @@ --- -title: Getting Started -slug: getting-started -lang: en +title: Quickstart guide with Bolt for Python +sidebar_label: Quickstart --- # Getting started with Bolt for Python -This guide is meant to walk you through getting up and running with a Slack app using Bolt for Python. Along the way, we’ll create a new Slack app, set up your local environment, and develop an app that listens and responds to messages from a Slack workspace. +This quickstart guide aims to help you get a Slack app using Bolt for Python up and running as soon as possible! -When you're finished, you'll have this ⚡️[Getting Started with Slack app](https://github.com/slackapi/bolt-python/tree/main/examples/getting_started) to run, modify, and make your own. - ---- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; -### Create an app {#create-an-app} -First thing's first: before you start developing with Bolt, you'll want to [create a Slack app](https://api.slack.com/apps/new). +When complete, you'll have a local environment configured with a customized [app](https://github.com/slack-samples/bolt-python-getting-started-app) running to modify and make your own. -:::tip +:::tip[Reference for readers] -We recommend using a workspace where you won't disrupt real work getting done — [you can create a new one for free](https://slack.com/get-started#create). +In search of the complete guide to building an app from scratch? Check out the [building an app](/building-an-app) guide. ::: -After you fill out an app name (_you can change it later_) and pick a workspace to install it to, hit the `Create App` button and you'll land on your app's **Basic Information** page. +#### Prerequisites -This page contains an overview of your app in addition to important credentials you'll need later. +A few tools are needed for the following steps. We recommend using the [**Slack CLI**](https://tools.slack.dev/slack-cli/) for the smoothest experience, but other options remain available. -![Basic Information page](/img/boltpy/basic-information-page.png "Basic Information page") +You can also begin by installing git and downloading [Python 3.6 or later](https://www.python.org/downloads/), or the latest stable version of Python. Refer to [Python's setup and building guide](https://devguide.python.org/getting-started/setup-building/) for more details. -Look around, add an app icon and description, and then let's start configuring your app 🔩 +Install the latest version of the Slack CLI to get started: ---- +- [Slack CLI for macOS & Linux](https://tools.slack.dev/slack-cli/guides/installing-the-slack-cli-for-mac-and-linux) +- [Slack CLI for Windows](https://tools.slack.dev/slack-cli/guides/installing-the-slack-cli-for-windows) -### Tokens and installing apps {#tokens-and-installing-apps} -Slack apps use [OAuth to manage access to Slack's APIs](https://docs.slack.dev/authentication/installing-with-oauth). When an app is installed, you'll receive a token that the app can use to call API methods. +Then confirm a successful installation with the following command: -There are three main token types available to a Slack app: user (`xoxp`), bot (`xoxb`), and app-level (`xapp`) tokens. -- [User tokens](https://docs.slack.dev/authentication/tokens#user) allow you to call API methods on behalf of users after they install or authenticate the app. There may be several user tokens for a single workspace. -- [Bot tokens](https://docs.slack.dev/authentication/tokens#bot) are associated with bot users, and are only granted once in a workspace where someone installs the app. The bot token your app uses will be the same no matter which user performed the installation. Bot tokens are the token type that _most_ apps use. -- [App-level tokens](https://docs.slack.dev/authentication/tokens#app-level) represent your app across organizations, including installations by all individual users on all workspaces in a given organization and are commonly used for creating WebSocket connections to your app. +```sh +$ slack version +``` -We're going to use bot and app-level tokens for this guide. +An authenticated login is also required if this hasn't been done before: -1. Navigate to the **OAuth & Permissions** on the left sidebar and scroll down to the **Bot Token Scopes** section. Click **Add an OAuth Scope**. +```sh +$ slack login +``` -2. For now, we'll just add one scope: [`chat:write`](https://docs.slack.dev/reference/scopes/chat.write). This grants your app the permission to post messages in channels it's a member of. +:::info[A place to belong] -3. Scroll up to the top of the **OAuth & Permissions** page and click **Install App to Workspace**. You'll be led through Slack's OAuth UI, where you should allow your app to be installed to your development workspace. +A workspace where development can happen is also needed. -4. Once you authorize the installation, you'll land on the **OAuth & Permissions** page and see a **Bot User OAuth Access Token**. +We recommend using [developer sandboxes](https://docs.slack.dev/tools/developer-sandboxes) to avoid disruptions where real work gets done. -![OAuth Tokens](/img/boltpy/bot-token.png "Bot OAuth Token") +::: -5. Then head over to **Basic Information** and scroll down under the App Token section and click **Generate Token and Scopes** to generate an app-level token. Add the `connections:write` scope to this token and save the generated `xapp` token, we'll use both these tokens in just a moment. +## Creating a project {#creating-a-project} -6. Navigate to **Socket Mode** on the left side menu and toggle to enable. +With the toolchain configured, it's time to set up a new Bolt project. This contains the code that handles logic for your app. -:::tip +If you don’t already have a project, let’s create a new one! -Treat your tokens like passwords and [keep them safe](https://docs.slack.dev/authentication/best-practices-for-security). Your app uses tokens to post and retrieve information from Slack workspaces. + + -::: +A starter template can be used to start with project scaffolding: ---- - -### Setting up your project {#setting-up-your-project} +```sh +$ slack create first-bolt-app --template slack-samples/bolt-python-getting-started-app +$ cd first-bolt-app +``` -With the initial configuration handled, it's time to set up a new Bolt project. This is where you'll write the code that handles the logic for your app. +After a project is created you'll have a `requirements.txt` file for app dependencies and a `.slack` directory for Slack CLI configuration. -If you don’t already have a project, let’s create a new one. Create an empty directory: +A few other files exist too, but we'll visit these later. -```shell -mkdir first-bolt-app -cd first-bolt-app -``` + + -Next, we recommend using a [Python virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment) to manage your project's dependencies. This is a great way to prevent conflicts with your system's Python packages. Let's create and activate a new virtual environment with [Python 3.6 or later](https://www.python.org/downloads/): +A starter template can be cloned to start with project scaffolding: -```shell -python3 -m venv .venv -source .venv/bin/activate +```sh +$ git clone https://github.com/slack-samples/bolt-python-getting-started-app first-bolt-app +$ cd first-bolt-app ``` -We can confirm that the virtual environment is active by checking that the path to `python3` is _inside_ your project ([a similar command is available on Windows](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#activating-a-virtual-environment)): +Outlines of a project are taking shape, so we can move on to running the app! -```shell -which python3 -# Output: /path/to/first-bolt-app/.venv/bin/python3 -``` + + -Before we install the Bolt for Python package to your new project, let's save the **bot token** and **app-level token** that were generated when you configured your app. +We recommend using a [Python virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment) to manage your project's dependencies. This is a great way to prevent conflicts with your system's Python packages. Let's create and activate a new virtual environment with [Python 3.6 or later](https://www.python.org/downloads/): -1. **Copy your bot (xoxb) token from the OAuth & Permissions page** and store it in a new environment variable. The following example works on Linux and macOS; but [similar commands are available on Windows](https://superuser.com/questions/212150/how-to-set-env-variable-in-windows-cmd-line/212153#212153). -```shell -export SLACK_BOT_TOKEN=xoxb- +```sh +$ python3 -m venv .venv +$ source .venv/bin/activate +$ pip install -r requirements.txt ``` -2. **Copy your app-level (xapp) token from the Basic Information page** and then store it in a new environment variable. -```shell -export SLACK_APP_TOKEN= +Confirm the virtual environment is active by checking that the path to `python3` is _inside_ your project ([a similar command is available on Windows](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#activating-a-virtual-environment)): + +```sh +$ which python3 +# Output: /path/to/first-bolt-app/.venv/bin/python3 ``` -:::warning +## Running the app {#running-the-app} -Remember to keep your tokens secure. At a minimum, you should avoid checking them into public version control, and access them via environment variables as we've done above. Check out the API documentation for more on [best practices for app security](https://docs.slack.dev/authentication/best-practices-for-security). +Before you can start developing with Bolt, you will want a running Slack app. -::: + + -Now, let's create your app. Install the `slack_bolt` Python package to your virtual environment using the following command: +The getting started app template contains a `manifest.json` file with details about an app that we will use to get started. Use the following command and select "Create a new app" to install the app to the team of choice: -```shell -pip install slack_bolt +```sh +$ slack run +... +⚡️ Bolt app is running! ``` -Create a new file called `app.py` in this directory and add the following code: +With the app running, you can test it out with the following steps in Slack: -```python -import os -from slack_bolt import App -from slack_bolt.adapter.socket_mode import SocketModeHandler +1. Open a direct message with your app or invite the bot `@first-bolt-app (local)` to a public channel. +2. Send "hello" to the current conversation and wait for a response. +3. Click the attached button labelled "Click Me" to post another reply. -# Initializes your app with your bot token and socket mode handler -app = App(token=os.environ.get("SLACK_BOT_TOKEN")) +After confirming the app responds, celebrate, then interrupt the process by pressing `CTRL+C` in the terminal to stop your app from running. -# Start your app -if __name__ == "__main__": - SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]).start() -``` + + -Your tokens are enough to create your first Bolt app. Save your `app.py` file then on the command line run the following: +Navigate to your list of apps and [create a new Slack app](https://api.slack.com/apps/new) using the "from a manifest" option: -```script -python3 app.py -``` +1. Select the workspace to develop your app in. +2. Copy and paste the `manifest.json` file contents to create your app. +3. Confirm the app features and click "Create". -Your app should let you know that it's up and running. 🎉 +You'll then land on your app's **Basic Information** page, which is an overview of your app and which contains important credentials: ---- +![Basic Information page](/img/boltpy/basic-information-page.png "Basic Information page") -### Setting up events {#setting-up-events} -Your app behaves similarly to people on your team — it can post messages, add emoji reactions, and listen and respond to events. +To listen for events happening in Slack (such as a new posted message) without opening a port or exposing an endpoint, we will use [Socket Mode](/concepts/socket-mode). This connection requires a specific app token: -To listen for events happening in a Slack workspace (like when a message is posted or when a reaction is posted to a message) you'll use the [Events API to subscribe to event types](https://docs.slack.dev/apis/events-api/). +1. On the **Basic Information** page, scroll to the **App-Level Tokens** section and click **Generate Token and Scopes**. +2. Name the token "Development" or something similar and add the `connections:write` scope, then click **Generate**. +3. Save the generated `xapp` token as an environment variable within your project: -For those just starting, we recommend using [Socket Mode](https://docs.slack.dev/apis/events-api/using-socket-mode). Socket Mode allows your app to use the Events API and interactive features without exposing a public HTTP Request URL. This can be helpful during development, or if you're receiving requests from behind a firewall. +```sh +$ export SLACK_APP_TOKEN= +``` -That being said, you're welcome to set up an app with a public HTTP Request URL. HTTP is more useful for apps being deployed to hosting environments to respond within a large corporate Slack workspaces/organization, or apps intended for distribution via the Slack Marketplace. +The above command works on Linux and macOS but [similar commands are available on Windows](https://superuser.com/questions/212150/how-to-set-env-variable-in-windows-cmd-line/212153#212153). -We've provided instructions for both ways in this guide. +:::warning[Keep it secret. Keep it safe.] -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; +Treat your tokens like a password and [keep it safe](https://docs.slack.dev/authentication/best-practices-for-security). Your app uses these to retrieve and send information to Slack. - - +::: -1. Head to your app's configuration page (click on the app [from your app settings page](https://api.slack.com/apps)). Navigate to **Socket Mode** on the left side menu and toggle to enable. +A bot token is also needed to interact with the Web API methods as your app's bot user. We can gather this as follows: -2. Go to **Basic Information** and scroll down under the App-Level Tokens section and click **Generate Token and Scopes** to generate an app token. Add the `connections:write` scope to this token and save the generated `xapp` token, we'll use that in just a moment. +1. Navigate to the **OAuth & Permissions** on the left sidebar and install your app to your workspace to generate a token. +2. After authorizing the installation, you'll return to the **OAuth & Permissions** page and find a **Bot User OAuth Token**: -3. Finally, it's time to tell Slack what events we'd like to listen for. Under **Event Subscriptions**, toggle the switch labeled **Enable Events**. +![OAuth Tokens](/img/boltpy/bot-token.png "Bot OAuth Token") -When an event occurs, Slack will send your app some information about the event, like the user that triggered it and the channel it occurred in. Your app will process the details and can respond accordingly. +3. Copy the bot token beginning with `xoxb` from the **OAuth & Permissions page** and then store it in a new environment variable: - - +```sh +$ export SLACK_BOT_TOKEN=xoxb- +``` -1. Go back to your app configuration page (click on the app [from your app management page](https://api.slack.com/apps)). Click **Event Subscriptions** on the left sidebar. Toggle the switch labeled **Enable Events**. +After saving tokens for the app you created, it is time to run it: -2. Add your Request URL. Slack will send HTTP POST requests corresponding to events to this [Request URL](https://docs.slack.dev/apis/events-api/#subscribing) endpoint. Bolt uses the `/slack/events` path to listen to all incoming requests (whether shortcuts, events, or interactivity payloads). When configuring your Request URL within your app configuration, you'll append `/slack/events`, e.g. `https:///slack/events`. 💡 As long as your Bolt app is still running, your URL should become verified. +```sh +$ python3 app.py +... +⚡️ Bolt app is running! +``` -:::tip +With the app running, you can test it out with the following steps in Slack: -For local development, you can use a proxy service like ngrok to create a public URL and tunnel requests to your development environment. Refer to [ngrok's getting started guide](https://ngrok.com/docs#getting-started-expose) on how to create this tunnel. And when you get to hosting your app, we've collected some of the most common hosting providers Slack developers use to host their apps [on our API site](https://docs.slack.dev/distribution/hosting-slack-apps/). +1. Open a direct message with your app or invite the bot `@BoltApp` to a public channel. +2. Send "hello" to the current conversation and wait for a response. +3. Click the attached button labelled "Click Me" to post another reply. -::: +After confirming the app responds, celebrate, then interrupt the process by pressing `CTRL+C` in the terminal to stop your app from running. -Navigate to **Event Subscriptions** on the left sidebar and toggle to enable. Under **Subscribe to Bot Events**, you can add events for your bot to respond to. There are four events related to messages: -- [`message.channels`](https://docs.slack.dev/reference/events/message.channels) listens for messages in public channels that your app is added to -- [`message.groups`](https://docs.slack.dev/reference/events/message.groups) listens for messages in 🔒 private channels that your app is added to -- [`message.im`](https://docs.slack.dev/reference/events/message.im) listens for messages in your app's DMs with users -- [`message.mpim`](https://docs.slack.dev/reference/events/message.mpim) listens for messages in multi-person DMs that your app is added to +## Updating the app -If you want your bot to listen to messages from everywhere it is added to, choose all four message events. After you’ve selected the events you want your bot to listen to, click the green **Save Changes** button. +At this point, you've successfully run the getting started Bolt for Python [app](https://github.com/slack-samples/bolt-python-getting-started-app)! ---- +The defaults included leave opportunities abound, so to personalize this app let's now edit the code to respond with a kind farewell. -### Listening and responding to a message {#listening-and-responding-to-a-message} -Your app is now ready for some logic. Let's start by using the `message()` method to attach a listener for messages. +#### Responding to a farewell -The following example listens and responds to all messages in channels/DMs where your app has been added that contain the word "hello": +Chat is a common thing apps do and responding to various types of messages can make conversations more interesting. - - +Using an editor of choice, open the `app.py` file and add the following import to the top of the file, and message listener after the "hello" handler: ```python -import os -from slack_bolt import App -from slack_bolt.adapter.socket_mode import SocketModeHandler - -# Initializes your app with your bot token and socket mode handler -app = App(token=os.environ.get("SLACK_BOT_TOKEN")) - -# Listens to incoming messages that contain "hello" -# To learn available listener arguments, -# visit https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html -@app.message("hello") -def message_hello(message, say): - # say() sends a message to the channel where the event was triggered - say(f"Hey there <@{message['user']}>!") - -# Start your app -if __name__ == "__main__": - SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]).start() -``` - - - +import random -```python -import os -from slack_bolt import App - -# Initializes your app with your bot token and signing secret -app = App( - token=os.environ.get("SLACK_BOT_TOKEN"), - signing_secret=os.environ.get("SLACK_SIGNING_SECRET") -) - -# Listens to incoming messages that contain "hello" -# To learn available listener arguments, -# visit https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html -@app.message("hello") -def message_hello(message, say): - # say() sends a message to the channel where the event was triggered - say(f"Hey there <@{message['user']}>!") - -# Start your app -if __name__ == "__main__": - app.start(port=int(os.environ.get("PORT", 3000))) +@app.message("goodbye") +def message_goodbye(say): + responses = ["Adios", "Au revoir", "Farewell"] + parting = random.choice(responses) + say(f"{parting}!") ``` - - - -If you restart your app, so long as your bot user has been added to the channel/DM, when you send any message that contains "hello", it will respond. +Once the file is updated, save the changes and then we'll make sure those changes are being used. -This is a basic example, but it gives you a place to start customizing your app based on your own goals. Let's try something a little more interactive by sending a button rather than plain text. + + ---- +Run the following command and select the app created earlier to start, or restart, your app with the latest changes: -### Sending and responding to actions {#sending-and-responding-to-actions} +```sh +$ slack run +... +⚡️ Bolt app is running! +``` -To use features like buttons, select menus, datepickers, modals, and shortcuts, you’ll need to enable interactivity. Head over to **Interactivity & Shortcuts** in your app configuration. +After finding the above output appears, open Slack to perform these steps: - - +1. Return to the direct message or public channel with your bot. +2. Send "goodbye" to the conversation. +3. Receive a parting response from before and repeat "goodbye" to find another one. -With Socket Mode on, basic interactivity is enabled by default, so no further action is needed. +Your app can be stopped again by pressing `CTRL+C` in the terminal to end these chats. - + -Similar to events, you'll need to specify a URL for Slack to send the action (such as *user clicked a button*). Back on your app configuration page, click on **Interactivity & Shortcuts** on the left side. You'll see that there's another **Request URL** box. +Run the following command to start, or restart, your app with the latest changes: -:::tip +```sh +$ python3 app.py +... +⚡️ Bolt app is running! +``` -By default, Bolt is configured to use the same endpoint for interactive components that it uses for events, so use the same request URL as above (for example, `https://8e8ec2d7.ngrok.io/slack/events`). Press the **Save Changes** button in the lower right hand corner, and that's it. Your app is set up to handle interactivity! +After finding the above output appears, open Slack to perform these steps: -::: +1. Return to the direct message or public channel with your bot. +2. Send "goodbye" to the conversation. +3. Receive a parting response from before and repeat "goodbye" to find another one. + +Your app can be stopped again by pressing `CTRL+C` in the terminal to end these chats. -When interactivity is enabled, interactions with shortcuts, modals, or interactive components (such as buttons, select menus, and datepickers) will be sent to your app as events. +#### Customizing app settings -Now, let's go back to your app's code and add logic to handle those events: -- First, we'll send a message that contains an interactive component (in this case a button) -- Next, we'll listen for the action of a user clicking the button before responding +The created app will have some placeholder values and a small set of [scopes](https://docs.slack.dev/reference/scopes) to start, but we recommend exploring the customizations possible on app settings. -Below, the code from the last section is modified to send a message containing a button rather than just a string: + + - - - -```python -import os -from slack_bolt import App -from slack_bolt.adapter.socket_mode import SocketModeHandler - -# Initializes your app with your bot token and socket mode handler -app = App( - token=os.environ.get("SLACK_BOT_TOKEN"), - # signing_secret=os.environ.get("SLACK_SIGNING_SECRET") # not required for socket mode -) - -# Listens to incoming messages that contain "hello" -@app.message("hello") -def message_hello(message, say): - # say() sends a message to the channel where the event was triggered - say( - blocks=[ - { - "type": "section", - "text": {"type": "mrkdwn", "text": f"Hey there <@{message['user']}>!"}, - "accessory": { - "type": "button", - "text": {"type": "plain_text", "text": "Click Me"}, - "action_id": "button_click" - } - } - ], - text=f"Hey there <@{message['user']}>!" - ) - -# Start your app -if __name__ == "__main__": - SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]).start() +Open app settings for your app with the following command: +```sh +$ slack app settings ``` - - +This will open the following page in a web browser: -```python -import os -from slack_bolt import App - -# Initializes your app with your bot token and signing secret -app = App( - token=os.environ.get("SLACK_BOT_TOKEN"), - signing_secret=os.environ.get("SLACK_SIGNING_SECRET") -) - -# Listens to incoming messages that contain "hello" -@app.message("hello") -def message_hello(message, say): - # say() sends a message to the channel where the event was triggered - say( - blocks=[ - { - "type": "section", - "text": {"type": "mrkdwn", "text": f"Hey there <@{message['user']}>!"}, - "accessory": { - "type": "button", - "text": {"type": "plain_text", "text": "Click Me"}, - "action_id": "button_click" - } - } - ], - text=f"Hey there <@{message['user']}>!" - ) - -# Start your app -if __name__ == "__main__": - app.start(port=int(os.environ.get("PORT", 3000))) -``` +![Basic Information page](/img/boltpy/basic-information-page.png "Basic Information page") - - -The value inside of `say()` is now an object that contains an array of `blocks`. Blocks are the building components of a Slack message and can range from text to images to datepickers. In this case, your app will respond with a section block that includes a button as an accessory. Since we're using `blocks`, the `text` is a fallback for notifications and accessibility. - -You'll notice in the button `accessory` object, there is an `action_id`. This will act as a unique identifier for the button so your app can specify what action it wants to respond to. - -:::tip - -The [Block Kit Builder](https://app.slack.com/block-kit-builder) is an simple way to prototype your interactive messages. The builder lets you (or anyone on your team) mockup messages and generates the corresponding JSON that you can paste directly in your app. - -::: - -Now, if you restart your app and say "hello" in a channel your app is in, you'll see a message with a button. But if you click the button, nothing happens (*yet!*). - -Let's add a handler to send a followup message when someone clicks the button: + - - +Browse to https://api.slack.com/apps and select your app "Getting Started Bolt App" from the list. -```python -import os -from slack_bolt import App -from slack_bolt.adapter.socket_mode import SocketModeHandler - -# Initializes your app with your bot token and socket mode handler -app = App(token=os.environ.get("SLACK_BOT_TOKEN")) - -# Listens to incoming messages that contain "hello" -@app.message("hello") -def message_hello(message, say): - # say() sends a message to the channel where the event was triggered - say( - blocks=[ - { - "type": "section", - "text": {"type": "mrkdwn", "text": f"Hey there <@{message['user']}>!"}, - "accessory": { - "type": "button", - "text": {"type": "plain_text", "text": "Click Me"}, - "action_id": "button_click" - } - } - ], - text=f"Hey there <@{message['user']}>!" - ) - -@app.action("button_click") -def action_button_click(body, ack, say): - # Acknowledge the action - ack() - say(f"<@{body['user']['id']}> clicked the button") - -# Start your app -if __name__ == "__main__": - SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]).start() -``` +This will open the following page: - - - -```python -import os -from slack_bolt import App - -# Initializes your app with your bot token and signing secret -app = App( - token=os.environ.get("SLACK_BOT_TOKEN"), - signing_secret=os.environ.get("SLACK_SIGNING_SECRET") -) - -# Listens to incoming messages that contain "hello" -@app.message("hello") -def message_hello(message, say): - # say() sends a message to the channel where the event was triggered - say( - blocks=[ - { - "type": "section", - "text": {"type": "mrkdwn", "text": f"Hey there <@{message['user']}>!"}, - "accessory": { - "type": "button", - "text": {"type": "plain_text", "text": "Click Me"}, - "action_id": "button_click" - } - } - ], - text=f"Hey there <@{message['user']}>!" - ) - -@app.action("button_click") -def action_button_click(body, ack, say): - # Acknowledge the action - ack() - say(f"<@{body['user']['id']}> clicked the button") - -# Start your app -if __name__ == "__main__": - app.start(port=int(os.environ.get("PORT", 3000))) -``` +![Basic Information page](/img/boltpy/basic-information-page.png "Basic Information page") -You can see that we used `app.action()` to listen for the `action_id` that we named `button_click`. If you restart your app and click the button, you'll see a new message from your app that says you clicked the button. +On these pages you're free to make changes such as updating your app icon, configuring app features, and perhaps even distributing your app! ---- +## Next steps {#next-steps} -### Next steps {#next-steps} -You just built your first [Bolt for Python app](https://github.com/slackapi/bolt-python/tree/main/examples/getting_started)! 🎉 +Congrats once more on getting up and running with this quick start. -Now that you have a basic app up and running, you can start exploring how to make your Bolt app stand out. Here are some ideas about what to explore next: +:::info[Dive deeper] -* Read through the _Basic concepts_ to learn about the different methods and features your Bolt app has access to. +Follow along with the steps that went into making this app on the [building an app](/building-an-app) guide for an educational overview. -* Explore the different events your bot can listen to with the [`app.event()`](/concepts/event-listening) method. All of the events are listed [on the API site](https://docs.slack.dev/reference/events). +::: -* Bolt allows you to [call Web API methods](/concepts/web-api) with the client attached to your app. There are [over 220 methods](https://docs.slack.dev/reference/methods) on our API site. +You can now continue customizing your app with various features to make it right for whatever job's at hand. Here are some ideas about what to explore next: -* Learn more about the different token types [on our API site](https://docs.slack.dev/authentication/tokens). Your app may need different tokens depending on the actions you want it to perform. +- Explore the different events your bot can listen to with the [`app.event()`](/concepts/event-listening) method. All of the [events](https://docs.slack.dev/reference/events) are listed on the API docs site. +- Bolt allows you to call [Web API](/concepts/web-api) methods with the client attached to your app. There are [over 200 methods](https://docs.slack.dev/reference/methods) on the API docs site. +- Learn more about the different [token types](https://docs.slack.dev/authentication/tokens) and [authentication setups](/concepts/authenticating-oauth). Your app might need different tokens depending on the actions you want to perform or for installations to multiple workspaces. +- Receive events using HTTP for various deployment methods, such as deploying to [Heroku](/deployments/heroku) or [AWS Lambda](/deployments/aws-lambda). +- Read on [app design](https://docs.slack.dev/surfaces/app-design) and compose fancy messages with blocks using [Block Kit Builder](https://app.slack.com/block-kit-builder) to prototype messages. diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 60f3eae81..0d80161e6 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -98,6 +98,7 @@ const config = { // switch to alucard when available in prism? theme: prismThemes.github, darkTheme: prismThemes.dracula, + additionalLanguages: ['bash'], }, codeblock: { showGithubLink: true, diff --git a/docs/sidebars.js b/docs/sidebars.js index 65c5e85f4..decb8cccb 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -7,13 +7,17 @@ const sidebars = { label: 'Bolt for Python', className: 'sidebar-title', }, + { + type: 'doc', + id: 'getting-started', + }, { type: 'html', value: '
    ' }, { type: 'category', label: 'Guides', collapsed: false, items: [ - "getting-started", + "building-an-app", { type: "category", label: "Slack API calls", From 227ca8e8936dffa93938591dabb14ddc79dc8a18 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Jul 2025 00:21:59 +0000 Subject: [PATCH 625/719] chore(deps): bump the docusaurus group in /docs with 5 updates (#1325) --- docs/package-lock.json | 1072 +++++++++++++++------------------------- docs/package.json | 10 +- 2 files changed, 392 insertions(+), 690 deletions(-) diff --git a/docs/package-lock.json b/docs/package-lock.json index 4e7d7b445..6790558aa 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -8,9 +8,9 @@ "name": "website", "version": "2024.08.01", "dependencies": { - "@docusaurus/core": "3.8.0", - "@docusaurus/plugin-client-redirects": "^3.8.0", - "@docusaurus/preset-classic": "3.8.0", + "@docusaurus/core": "3.8.1", + "@docusaurus/plugin-client-redirects": "^3.8.1", + "@docusaurus/preset-classic": "3.8.1", "@mdx-js/react": "^3.1.0", "clsx": "^2.0.0", "docusaurus-theme-github-codeblock": "^2.0.2", @@ -19,8 +19,8 @@ "react-dom": "^19.1.0" }, "devDependencies": { - "@docusaurus/module-type-aliases": "3.8.0", - "@docusaurus/types": "3.8.0" + "@docusaurus/module-type-aliases": "3.8.1", + "@docusaurus/types": "3.8.1" }, "engines": { "node": ">=20.0" @@ -30,7 +30,6 @@ "version": "1.17.9", "resolved": "https://registry.npmjs.org/@algolia/autocomplete-core/-/autocomplete-core-1.17.9.tgz", "integrity": "sha512-O7BxrpLDPJWWHv/DLA9DRFWs+iY1uOJZkqUwjS5HSZAGcl0hIVCQ97LTLewiZmZ402JYUrun+8NqFP+hCknlbQ==", - "license": "MIT", "dependencies": { "@algolia/autocomplete-plugin-algolia-insights": "1.17.9", "@algolia/autocomplete-shared": "1.17.9" @@ -40,7 +39,6 @@ "version": "1.17.9", "resolved": "https://registry.npmjs.org/@algolia/autocomplete-plugin-algolia-insights/-/autocomplete-plugin-algolia-insights-1.17.9.tgz", "integrity": "sha512-u1fEHkCbWF92DBeB/KHeMacsjsoI0wFhjZtlCq2ddZbAehshbZST6Hs0Avkc0s+4UyBGbMDnSuXHLuvRWK5iDQ==", - "license": "MIT", "dependencies": { "@algolia/autocomplete-shared": "1.17.9" }, @@ -52,7 +50,6 @@ "version": "1.17.9", "resolved": "https://registry.npmjs.org/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.17.9.tgz", "integrity": "sha512-Na1OuceSJeg8j7ZWn5ssMu/Ax3amtOwk76u4h5J4eK2Nx2KB5qt0Z4cOapCsxot9VcEN11ADV5aUSlQF4RhGjQ==", - "license": "MIT", "dependencies": { "@algolia/autocomplete-shared": "1.17.9" }, @@ -65,106 +62,98 @@ "version": "1.17.9", "resolved": "https://registry.npmjs.org/@algolia/autocomplete-shared/-/autocomplete-shared-1.17.9.tgz", "integrity": "sha512-iDf05JDQ7I0b7JEA/9IektxN/80a2MZ1ToohfmNS3rfeuQnIKI3IJlIafD0xu4StbtQTghx9T3Maa97ytkXenQ==", - "license": "MIT", "peerDependencies": { "@algolia/client-search": ">= 4.9.1 < 6", "algoliasearch": ">= 4.9.1 < 6" } }, "node_modules/@algolia/client-abtesting": { - "version": "5.25.0", - "resolved": "https://registry.npmjs.org/@algolia/client-abtesting/-/client-abtesting-5.25.0.tgz", - "integrity": "sha512-1pfQulNUYNf1Tk/svbfjfkLBS36zsuph6m+B6gDkPEivFmso/XnRgwDvjAx80WNtiHnmeNjIXdF7Gos8+OLHqQ==", - "license": "MIT", + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@algolia/client-abtesting/-/client-abtesting-5.30.0.tgz", + "integrity": "sha512-Q3OQXYlTNqVUN/V1qXX8VIzQbLjP3yrRBO9m6NRe1CBALmoGHh9JrYosEGvfior28+DjqqU3Q+nzCSuf/bX0Gw==", "dependencies": { - "@algolia/client-common": "5.25.0", - "@algolia/requester-browser-xhr": "5.25.0", - "@algolia/requester-fetch": "5.25.0", - "@algolia/requester-node-http": "5.25.0" + "@algolia/client-common": "5.30.0", + "@algolia/requester-browser-xhr": "5.30.0", + "@algolia/requester-fetch": "5.30.0", + "@algolia/requester-node-http": "5.30.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/client-analytics": { - "version": "5.25.0", - "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-5.25.0.tgz", - "integrity": "sha512-AFbG6VDJX/o2vDd9hqncj1B6B4Tulk61mY0pzTtzKClyTDlNP0xaUiEKhl6E7KO9I/x0FJF5tDCm0Hn6v5x18A==", - "license": "MIT", + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-5.30.0.tgz", + "integrity": "sha512-/b+SAfHjYjx/ZVeVReCKTTnFAiZWOyvYLrkYpeNMraMT6akYRR8eC1AvFcvR60GLG/jytxcJAp42G8nN5SdcLg==", "dependencies": { - "@algolia/client-common": "5.25.0", - "@algolia/requester-browser-xhr": "5.25.0", - "@algolia/requester-fetch": "5.25.0", - "@algolia/requester-node-http": "5.25.0" + "@algolia/client-common": "5.30.0", + "@algolia/requester-browser-xhr": "5.30.0", + "@algolia/requester-fetch": "5.30.0", + "@algolia/requester-node-http": "5.30.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/client-common": { - "version": "5.25.0", - "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-5.25.0.tgz", - "integrity": "sha512-il1zS/+Rc6la6RaCdSZ2YbJnkQC6W1wiBO8+SH+DE6CPMWBU6iDVzH0sCKSAtMWl9WBxoN6MhNjGBnCv9Yy2bA==", - "license": "MIT", + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-5.30.0.tgz", + "integrity": "sha512-tbUgvkp2d20mHPbM0+NPbLg6SzkUh0lADUUjzNCF+HiPkjFRaIW3NGMlESKw5ia4Oz6ZvFzyREquUX6rdkdJcQ==", "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/client-insights": { - "version": "5.25.0", - "resolved": "https://registry.npmjs.org/@algolia/client-insights/-/client-insights-5.25.0.tgz", - "integrity": "sha512-blbjrUH1siZNfyCGeq0iLQu00w3a4fBXm0WRIM0V8alcAPo7rWjLbMJMrfBtzL9X5ic6wgxVpDADXduGtdrnkw==", - "license": "MIT", + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@algolia/client-insights/-/client-insights-5.30.0.tgz", + "integrity": "sha512-caXuZqJK761m32KoEAEkjkE2WF/zYg1McuGesWXiLSgfxwZZIAf+DljpiSToBUXhoPesvjcLtINyYUzbkwE0iw==", "dependencies": { - "@algolia/client-common": "5.25.0", - "@algolia/requester-browser-xhr": "5.25.0", - "@algolia/requester-fetch": "5.25.0", - "@algolia/requester-node-http": "5.25.0" + "@algolia/client-common": "5.30.0", + "@algolia/requester-browser-xhr": "5.30.0", + "@algolia/requester-fetch": "5.30.0", + "@algolia/requester-node-http": "5.30.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/client-personalization": { - "version": "5.25.0", - "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-5.25.0.tgz", - "integrity": "sha512-aywoEuu1NxChBcHZ1pWaat0Plw7A8jDMwjgRJ00Mcl7wGlwuPt5dJ/LTNcg3McsEUbs2MBNmw0ignXBw9Tbgow==", - "license": "MIT", + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-5.30.0.tgz", + "integrity": "sha512-7K6P7TRBHLX1zTmwKDrIeBSgUidmbj6u3UW/AfroLRDGf9oZFytPKU49wg28lz/yulPuHY0nZqiwbyAxq9V17w==", "dependencies": { - "@algolia/client-common": "5.25.0", - "@algolia/requester-browser-xhr": "5.25.0", - "@algolia/requester-fetch": "5.25.0", - "@algolia/requester-node-http": "5.25.0" + "@algolia/client-common": "5.30.0", + "@algolia/requester-browser-xhr": "5.30.0", + "@algolia/requester-fetch": "5.30.0", + "@algolia/requester-node-http": "5.30.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/client-query-suggestions": { - "version": "5.25.0", - "resolved": "https://registry.npmjs.org/@algolia/client-query-suggestions/-/client-query-suggestions-5.25.0.tgz", - "integrity": "sha512-a/W2z6XWKjKjIW1QQQV8PTTj1TXtaKx79uR3NGBdBdGvVdt24KzGAaN7sCr5oP8DW4D3cJt44wp2OY/fZcPAVA==", - "license": "MIT", + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@algolia/client-query-suggestions/-/client-query-suggestions-5.30.0.tgz", + "integrity": "sha512-WMjWuBjYxJheRt7Ec5BFr33k3cV0mq2WzmH9aBf5W4TT8kUp34x91VRsYVaWOBRlxIXI8o/WbhleqSngiuqjLA==", "dependencies": { - "@algolia/client-common": "5.25.0", - "@algolia/requester-browser-xhr": "5.25.0", - "@algolia/requester-fetch": "5.25.0", - "@algolia/requester-node-http": "5.25.0" + "@algolia/client-common": "5.30.0", + "@algolia/requester-browser-xhr": "5.30.0", + "@algolia/requester-fetch": "5.30.0", + "@algolia/requester-node-http": "5.30.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/client-search": { - "version": "5.25.0", - "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-5.25.0.tgz", - "integrity": "sha512-9rUYcMIBOrCtYiLX49djyzxqdK9Dya/6Z/8sebPn94BekT+KLOpaZCuc6s0Fpfq7nx5J6YY5LIVFQrtioK9u0g==", - "license": "MIT", + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-5.30.0.tgz", + "integrity": "sha512-puc1/LREfSqzgmrOFMY5L/aWmhYOlJ0TTpa245C0ZNMKEkdOkcimFbXTXQ8lZhzh+rlyFgR7cQGNtXJ5H0XgZg==", "dependencies": { - "@algolia/client-common": "5.25.0", - "@algolia/requester-browser-xhr": "5.25.0", - "@algolia/requester-fetch": "5.25.0", - "@algolia/requester-node-http": "5.25.0" + "@algolia/client-common": "5.30.0", + "@algolia/requester-browser-xhr": "5.30.0", + "@algolia/requester-fetch": "5.30.0", + "@algolia/requester-node-http": "5.30.0" }, "engines": { "node": ">= 14.0.0" @@ -173,85 +162,78 @@ "node_modules/@algolia/events": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@algolia/events/-/events-4.0.1.tgz", - "integrity": "sha512-FQzvOCgoFXAbf5Y6mYozw2aj5KCJoA3m4heImceldzPSMbdyS4atVjJzXKMsfX3wnZTFYwkkt8/z8UesLHlSBQ==", - "license": "MIT" + "integrity": "sha512-FQzvOCgoFXAbf5Y6mYozw2aj5KCJoA3m4heImceldzPSMbdyS4atVjJzXKMsfX3wnZTFYwkkt8/z8UesLHlSBQ==" }, "node_modules/@algolia/ingestion": { - "version": "1.25.0", - "resolved": "https://registry.npmjs.org/@algolia/ingestion/-/ingestion-1.25.0.tgz", - "integrity": "sha512-jJeH/Hk+k17Vkokf02lkfYE4A+EJX+UgnMhTLR/Mb+d1ya5WhE+po8p5a/Nxb6lo9OLCRl6w3Hmk1TX1e9gVbQ==", - "license": "MIT", + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/@algolia/ingestion/-/ingestion-1.30.0.tgz", + "integrity": "sha512-NfqiIKVgGKTLr6T9F81oqB39pPiEtILTy0z8ujxPKg2rCvI/qQeDqDWFBmQPElCfUTU6kk67QAgMkQ7T6fE+gg==", "dependencies": { - "@algolia/client-common": "5.25.0", - "@algolia/requester-browser-xhr": "5.25.0", - "@algolia/requester-fetch": "5.25.0", - "@algolia/requester-node-http": "5.25.0" + "@algolia/client-common": "5.30.0", + "@algolia/requester-browser-xhr": "5.30.0", + "@algolia/requester-fetch": "5.30.0", + "@algolia/requester-node-http": "5.30.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/monitoring": { - "version": "1.25.0", - "resolved": "https://registry.npmjs.org/@algolia/monitoring/-/monitoring-1.25.0.tgz", - "integrity": "sha512-Ls3i1AehJ0C6xaHe7kK9vPmzImOn5zBg7Kzj8tRYIcmCWVyuuFwCIsbuIIz/qzUf1FPSWmw0TZrGeTumk2fqXg==", - "license": "MIT", + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/@algolia/monitoring/-/monitoring-1.30.0.tgz", + "integrity": "sha512-/eeM3aqLKro5KBZw0W30iIA6afkGa+bcpvEM0NDa92m5t3vil4LOmJI9FkgzfmSkF4368z/SZMOTPShYcaVXjA==", "dependencies": { - "@algolia/client-common": "5.25.0", - "@algolia/requester-browser-xhr": "5.25.0", - "@algolia/requester-fetch": "5.25.0", - "@algolia/requester-node-http": "5.25.0" + "@algolia/client-common": "5.30.0", + "@algolia/requester-browser-xhr": "5.30.0", + "@algolia/requester-fetch": "5.30.0", + "@algolia/requester-node-http": "5.30.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/recommend": { - "version": "5.25.0", - "resolved": "https://registry.npmjs.org/@algolia/recommend/-/recommend-5.25.0.tgz", - "integrity": "sha512-79sMdHpiRLXVxSjgw7Pt4R1aNUHxFLHiaTDnN2MQjHwJ1+o3wSseb55T9VXU4kqy3m7TUme3pyRhLk5ip/S4Mw==", - "license": "MIT", + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@algolia/recommend/-/recommend-5.30.0.tgz", + "integrity": "sha512-iWeAUWqw+xT+2IyUyTqnHCK+cyCKYV5+B6PXKdagc9GJJn6IaPs8vovwoC0Za5vKCje/aXQ24a2Z1pKpc/tdHg==", "dependencies": { - "@algolia/client-common": "5.25.0", - "@algolia/requester-browser-xhr": "5.25.0", - "@algolia/requester-fetch": "5.25.0", - "@algolia/requester-node-http": "5.25.0" + "@algolia/client-common": "5.30.0", + "@algolia/requester-browser-xhr": "5.30.0", + "@algolia/requester-fetch": "5.30.0", + "@algolia/requester-node-http": "5.30.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/requester-browser-xhr": { - "version": "5.25.0", - "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-5.25.0.tgz", - "integrity": "sha512-JLaF23p1SOPBmfEqozUAgKHQrGl3z/Z5RHbggBu6s07QqXXcazEsub5VLonCxGVqTv6a61AAPr8J1G5HgGGjEw==", - "license": "MIT", + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-5.30.0.tgz", + "integrity": "sha512-alo3ly0tdNLjfMSPz9dmNwYUFHx7guaz5dTGlIzVGnOiwLgIoM6NgA+MJLMcH6e1S7OpmE2AxOy78svlhst2tQ==", "dependencies": { - "@algolia/client-common": "5.25.0" + "@algolia/client-common": "5.30.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/requester-fetch": { - "version": "5.25.0", - "resolved": "https://registry.npmjs.org/@algolia/requester-fetch/-/requester-fetch-5.25.0.tgz", - "integrity": "sha512-rtzXwqzFi1edkOF6sXxq+HhmRKDy7tz84u0o5t1fXwz0cwx+cjpmxu/6OQKTdOJFS92JUYHsG51Iunie7xbqfQ==", - "license": "MIT", + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-fetch/-/requester-fetch-5.30.0.tgz", + "integrity": "sha512-WOnTYUIY2InllHBy6HHMpGIOo7Or4xhYUx/jkoSK/kPIa1BRoFEHqa8v4pbKHtoG7oLvM2UAsylSnjVpIhGZXg==", "dependencies": { - "@algolia/client-common": "5.25.0" + "@algolia/client-common": "5.30.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/@algolia/requester-node-http": { - "version": "5.25.0", - "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-5.25.0.tgz", - "integrity": "sha512-ZO0UKvDyEFvyeJQX0gmZDQEvhLZ2X10K+ps6hViMo1HgE2V8em00SwNsQ+7E/52a+YiBkVWX61pJJJE44juDMQ==", - "license": "MIT", + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-5.30.0.tgz", + "integrity": "sha512-uSTUh9fxeHde1c7KhvZKUrivk90sdiDftC+rSKNFKKEU9TiIKAGA7B2oKC+AoMCqMymot1vW9SGbeESQPTZd0w==", "dependencies": { - "@algolia/client-common": "5.25.0" + "@algolia/client-common": "5.30.0" }, "engines": { "node": ">= 14.0.0" @@ -731,7 +713,6 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -1379,7 +1360,6 @@ "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.27.1.tgz", "integrity": "sha512-edoidOjl/ZxvYo4lSBOQGDSyToYVkTAwyVoa2tkuYTSmjrB1+uAedoL5iROVLXkxH+vRgA7uP4tMg2pUJpZ3Ug==", - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" }, @@ -1499,7 +1479,6 @@ "version": "7.27.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.27.4.tgz", "integrity": "sha512-D68nR5zxU64EUzV8i7T3R5XP0Xhrou/amNnddsRQssx6GrTLdZl1rLxyjtVZBd+v/NVX4AbTPOB5aU8thAZV1A==", - "license": "MIT", "dependencies": { "@babel/helper-module-imports": "^7.27.1", "@babel/helper-plugin-utils": "^7.27.1", @@ -1519,7 +1498,6 @@ "version": "0.11.1", "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.11.1.tgz", "integrity": "sha512-yGCqvBT4rwMczo28xkH/noxJ6MZ4nJfkVYdoDaC/utLtWrXxv27HVrzAeSbqR8SxDsp46n0YF47EbHoixy6rXQ==", - "license": "MIT", "dependencies": { "@babel/helper-define-polyfill-provider": "^0.6.3", "core-js-compat": "^3.40.0" @@ -1532,7 +1510,6 @@ "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -1838,10 +1815,9 @@ } }, "node_modules/@babel/runtime-corejs3": { - "version": "7.27.4", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.27.4.tgz", - "integrity": "sha512-H7QhL0ucCGOObsUETNbB2PuzF4gAvN8p32P6r91bX7M/hk4bx+3yz2hTwHL9d/Efzwu1upeb4/cd7oSxCzup3w==", - "license": "MIT", + "version": "7.27.6", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.27.6.tgz", + "integrity": "sha512-vDVrlmRAY8z9Ul/HxT+8ceAru95LQgkSKiXkSYZvqtbkPSfhZJgpRp45Cldbh1GJ1kxzQkI70AqyrTI58KpaWQ==", "dependencies": { "core-js-pure": "^3.30.2" }, @@ -1918,7 +1894,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT", "engines": { "node": ">=18" }, @@ -1941,7 +1916,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "engines": { "node": ">=18" } @@ -1960,7 +1934,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT", "engines": { "node": ">=18" }, @@ -1983,7 +1956,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT", "dependencies": { "@csstools/color-helpers": "^5.0.2", "@csstools/css-calc": "^2.1.4" @@ -2010,7 +1982,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT", "engines": { "node": ">=18" }, @@ -2032,7 +2003,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT", "engines": { "node": ">=18" } @@ -2051,7 +2021,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT", "engines": { "node": ">=18" }, @@ -2061,9 +2030,9 @@ } }, "node_modules/@csstools/postcss-cascade-layers": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@csstools/postcss-cascade-layers/-/postcss-cascade-layers-5.0.1.tgz", - "integrity": "sha512-XOfhI7GShVcKiKwmPAnWSqd2tBR0uxt+runAxttbSp/LY2U16yAVPmAf7e9q4JJ0d+xMNmpwNDLBXnmRCl3HMQ==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@csstools/postcss-cascade-layers/-/postcss-cascade-layers-5.0.2.tgz", + "integrity": "sha512-nWBE08nhO8uWl6kSAeCx4im7QfVko3zLrtgWZY4/bP87zrSPpSyN/3W3TDqz1jJuH+kbKOHXg5rJnK+ZVYcFFg==", "funding": [ { "type": "github", @@ -2074,7 +2043,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/selector-specificity": "^5.0.0", "postcss-selector-parser": "^7.0.0" @@ -2100,7 +2068,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "engines": { "node": ">=18" }, @@ -2112,7 +2079,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "license": "MIT", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -2135,7 +2101,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/css-color-parser": "^3.0.10", "@csstools/css-parser-algorithms": "^3.0.5", @@ -2164,7 +2129,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/css-color-parser": "^3.0.10", "@csstools/css-parser-algorithms": "^3.0.5", @@ -2193,7 +2157,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/css-color-parser": "^3.0.10", "@csstools/css-parser-algorithms": "^3.0.5", @@ -2222,7 +2185,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/css-parser-algorithms": "^3.0.5", "@csstools/css-tokenizer": "^3.0.4", @@ -2250,7 +2212,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/css-calc": "^2.1.4", "@csstools/css-parser-algorithms": "^3.0.5", @@ -2277,7 +2238,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/utilities": "^2.0.0", "postcss-value-parser": "^4.2.0" @@ -2303,7 +2263,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/css-color-parser": "^3.0.10", "@csstools/css-parser-algorithms": "^3.0.5", @@ -2330,7 +2289,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/css-color-parser": "^3.0.10", "@csstools/css-parser-algorithms": "^3.0.5", @@ -2359,7 +2317,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/css-color-parser": "^3.0.10", "@csstools/css-parser-algorithms": "^3.0.5", @@ -2388,7 +2345,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/postcss-progressive-custom-properties": "^4.1.0", "@csstools/utilities": "^2.0.0", @@ -2415,7 +2371,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "engines": { "node": ">=18" }, @@ -2424,9 +2379,9 @@ } }, "node_modules/@csstools/postcss-is-pseudo-class": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@csstools/postcss-is-pseudo-class/-/postcss-is-pseudo-class-5.0.1.tgz", - "integrity": "sha512-JLp3POui4S1auhDR0n8wHd/zTOWmMsmK3nQd3hhL6FhWPaox5W7j1se6zXOG/aP07wV2ww0lxbKYGwbBszOtfQ==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@csstools/postcss-is-pseudo-class/-/postcss-is-pseudo-class-5.0.3.tgz", + "integrity": "sha512-jS/TY4SpG4gszAtIg7Qnf3AS2pjcUM5SzxpApOrlndMeGhIbaTzWBzzP/IApXoNWEW7OhcjkRT48jnAUIFXhAQ==", "funding": [ { "type": "github", @@ -2437,7 +2392,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/selector-specificity": "^5.0.0", "postcss-selector-parser": "^7.0.0" @@ -2463,7 +2417,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "engines": { "node": ">=18" }, @@ -2475,7 +2428,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "license": "MIT", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -2498,7 +2450,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/css-parser-algorithms": "^3.0.5", "@csstools/css-tokenizer": "^3.0.4", @@ -2526,7 +2477,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "engines": { "node": ">=18" }, @@ -2548,7 +2498,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "engines": { "node": ">=18" }, @@ -2570,7 +2519,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "engines": { "node": ">=18" }, @@ -2592,7 +2540,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "postcss-value-parser": "^4.2.0" }, @@ -2617,7 +2564,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/css-tokenizer": "^3.0.4", "@csstools/utilities": "^2.0.0" @@ -2643,7 +2589,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT", "dependencies": { "@csstools/css-calc": "^2.1.4", "@csstools/css-parser-algorithms": "^3.0.5", @@ -2671,7 +2616,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/css-parser-algorithms": "^3.0.5", "@csstools/css-tokenizer": "^3.0.4", @@ -2698,7 +2642,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/utilities": "^2.0.0", "postcss-value-parser": "^4.2.0" @@ -2724,7 +2667,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "postcss-value-parser": "^4.2.0" }, @@ -2749,7 +2691,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/css-color-parser": "^3.0.10", "@csstools/css-parser-algorithms": "^3.0.5", @@ -2778,7 +2719,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "postcss-value-parser": "^4.2.0" }, @@ -2803,7 +2743,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/css-calc": "^2.1.4", "@csstools/css-parser-algorithms": "^3.0.5", @@ -2830,7 +2769,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/css-color-parser": "^3.0.10", "@csstools/css-parser-algorithms": "^3.0.5", @@ -2859,7 +2797,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "postcss-selector-parser": "^7.0.0" }, @@ -2874,7 +2811,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "license": "MIT", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -2897,7 +2833,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/css-calc": "^2.1.4", "@csstools/css-parser-algorithms": "^3.0.5", @@ -2924,7 +2859,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/css-calc": "^2.1.4", "@csstools/css-parser-algorithms": "^3.0.5", @@ -2951,7 +2885,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/color-helpers": "^5.0.2", "postcss-value-parser": "^4.2.0" @@ -2977,7 +2910,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/css-calc": "^2.1.4", "@csstools/css-parser-algorithms": "^3.0.5", @@ -3004,7 +2936,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "engines": { "node": ">=18" }, @@ -3026,7 +2957,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "engines": { "node": ">=18" }, @@ -3046,14 +2976,12 @@ "node_modules/@docsearch/css": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/@docsearch/css/-/css-3.9.0.tgz", - "integrity": "sha512-cQbnVbq0rrBwNAKegIac/t6a8nWoUAn8frnkLFW6YARaRmAQr5/Eoe6Ln2fqkUCZ40KpdrKbpSAmgrkviOxuWA==", - "license": "MIT" + "integrity": "sha512-cQbnVbq0rrBwNAKegIac/t6a8nWoUAn8frnkLFW6YARaRmAQr5/Eoe6Ln2fqkUCZ40KpdrKbpSAmgrkviOxuWA==" }, "node_modules/@docsearch/react": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/@docsearch/react/-/react-3.9.0.tgz", "integrity": "sha512-mb5FOZYZIkRQ6s/NWnM98k879vu5pscWqTLubLFBO87igYYT4VzVazh4h5o/zCvTIZgEt3PvsCOMOswOUo9yHQ==", - "license": "MIT", "dependencies": { "@algolia/autocomplete-core": "1.17.9", "@algolia/autocomplete-preset-algolia": "1.17.9", @@ -3082,10 +3010,9 @@ } }, "node_modules/@docusaurus/babel": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/babel/-/babel-3.8.0.tgz", - "integrity": "sha512-9EJwSgS6TgB8IzGk1L8XddJLhZod8fXT4ULYMx6SKqyCBqCFpVCEjR/hNXXhnmtVM2irDuzYoVLGWv7srG/VOA==", - "license": "MIT", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/babel/-/babel-3.8.1.tgz", + "integrity": "sha512-3brkJrml8vUbn9aeoZUlJfsI/GqyFcDgQJwQkmBtclJgWDEQBKKeagZfOgx0WfUQhagL1sQLNW0iBdxnI863Uw==", "dependencies": { "@babel/core": "^7.25.9", "@babel/generator": "^7.25.9", @@ -3097,8 +3024,8 @@ "@babel/runtime": "^7.25.9", "@babel/runtime-corejs3": "^7.25.9", "@babel/traverse": "^7.25.9", - "@docusaurus/logger": "3.8.0", - "@docusaurus/utils": "3.8.0", + "@docusaurus/logger": "3.8.1", + "@docusaurus/utils": "3.8.1", "babel-plugin-dynamic-import-node": "^2.3.3", "fs-extra": "^11.1.1", "tslib": "^2.6.0" @@ -3108,30 +3035,29 @@ } }, "node_modules/@docusaurus/bundler": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/bundler/-/bundler-3.8.0.tgz", - "integrity": "sha512-Rq4Z/MSeAHjVzBLirLeMcjLIAQy92pF1OI+2rmt18fSlMARfTGLWRE8Vb+ljQPTOSfJxwDYSzsK6i7XloD2rNA==", - "license": "MIT", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/bundler/-/bundler-3.8.1.tgz", + "integrity": "sha512-/z4V0FRoQ0GuSLToNjOSGsk6m2lQUG4FRn8goOVoZSRsTrU8YR2aJacX5K3RG18EaX9b+52pN4m1sL3MQZVsQA==", "dependencies": { "@babel/core": "^7.25.9", - "@docusaurus/babel": "3.8.0", - "@docusaurus/cssnano-preset": "3.8.0", - "@docusaurus/logger": "3.8.0", - "@docusaurus/types": "3.8.0", - "@docusaurus/utils": "3.8.0", + "@docusaurus/babel": "3.8.1", + "@docusaurus/cssnano-preset": "3.8.1", + "@docusaurus/logger": "3.8.1", + "@docusaurus/types": "3.8.1", + "@docusaurus/utils": "3.8.1", "babel-loader": "^9.2.1", - "clean-css": "^5.3.2", + "clean-css": "^5.3.3", "copy-webpack-plugin": "^11.0.0", - "css-loader": "^6.8.1", + "css-loader": "^6.11.0", "css-minimizer-webpack-plugin": "^5.0.1", "cssnano": "^6.1.2", "file-loader": "^6.2.0", "html-minifier-terser": "^7.2.0", - "mini-css-extract-plugin": "^2.9.1", + "mini-css-extract-plugin": "^2.9.2", "null-loader": "^4.0.1", - "postcss": "^8.4.26", - "postcss-loader": "^7.3.3", - "postcss-preset-env": "^10.1.0", + "postcss": "^8.5.4", + "postcss-loader": "^7.3.4", + "postcss-preset-env": "^10.2.1", "terser-webpack-plugin": "^5.3.9", "tslib": "^2.6.0", "url-loader": "^4.1.1", @@ -3151,18 +3077,17 @@ } }, "node_modules/@docusaurus/core": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/core/-/core-3.8.0.tgz", - "integrity": "sha512-c7u6zFELmSGPEP9WSubhVDjgnpiHgDqMh1qVdCB7rTflh4Jx0msTYmMiO91Ez0KtHj4sIsDsASnjwfJ2IZp3Vw==", - "license": "MIT", - "dependencies": { - "@docusaurus/babel": "3.8.0", - "@docusaurus/bundler": "3.8.0", - "@docusaurus/logger": "3.8.0", - "@docusaurus/mdx-loader": "3.8.0", - "@docusaurus/utils": "3.8.0", - "@docusaurus/utils-common": "3.8.0", - "@docusaurus/utils-validation": "3.8.0", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/core/-/core-3.8.1.tgz", + "integrity": "sha512-ENB01IyQSqI2FLtOzqSI3qxG2B/jP4gQPahl2C3XReiLebcVh5B5cB9KYFvdoOqOWPyr5gXK4sjgTKv7peXCrA==", + "dependencies": { + "@docusaurus/babel": "3.8.1", + "@docusaurus/bundler": "3.8.1", + "@docusaurus/logger": "3.8.1", + "@docusaurus/mdx-loader": "3.8.1", + "@docusaurus/utils": "3.8.1", + "@docusaurus/utils-common": "3.8.1", + "@docusaurus/utils-validation": "3.8.1", "boxen": "^6.2.1", "chalk": "^4.1.2", "chokidar": "^3.5.3", @@ -3212,13 +3137,12 @@ } }, "node_modules/@docusaurus/cssnano-preset": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/cssnano-preset/-/cssnano-preset-3.8.0.tgz", - "integrity": "sha512-UJ4hAS2T0R4WNy+phwVff2Q0L5+RXW9cwlH6AEphHR5qw3m/yacfWcSK7ort2pMMbDn8uGrD38BTm4oLkuuNoQ==", - "license": "MIT", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/cssnano-preset/-/cssnano-preset-3.8.1.tgz", + "integrity": "sha512-G7WyR2N6SpyUotqhGznERBK+x84uyhfMQM2MmDLs88bw4Flom6TY46HzkRkSEzaP9j80MbTN8naiL1fR17WQug==", "dependencies": { "cssnano-preset-advanced": "^6.1.2", - "postcss": "^8.4.38", + "postcss": "^8.5.4", "postcss-sort-media-queries": "^5.2.0", "tslib": "^2.6.0" }, @@ -3227,10 +3151,9 @@ } }, "node_modules/@docusaurus/logger": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/logger/-/logger-3.8.0.tgz", - "integrity": "sha512-7eEMaFIam5Q+v8XwGqF/n0ZoCld4hV4eCCgQkfcN9Mq5inoZa6PHHW9Wu6lmgzoK5Kx3keEeABcO2SxwraoPDQ==", - "license": "MIT", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/logger/-/logger-3.8.1.tgz", + "integrity": "sha512-2wjeGDhKcExEmjX8k1N/MRDiPKXGF2Pg+df/bDDPnnJWHXnVEZxXj80d6jcxp1Gpnksl0hF8t/ZQw9elqj2+ww==", "dependencies": { "chalk": "^4.1.2", "tslib": "^2.6.0" @@ -3240,14 +3163,13 @@ } }, "node_modules/@docusaurus/mdx-loader": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/mdx-loader/-/mdx-loader-3.8.0.tgz", - "integrity": "sha512-mDPSzssRnpjSdCGuv7z2EIAnPS1MHuZGTaRLwPn4oQwszu4afjWZ/60sfKjTnjBjI8Vl4OgJl2vMmfmiNDX4Ng==", - "license": "MIT", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/mdx-loader/-/mdx-loader-3.8.1.tgz", + "integrity": "sha512-DZRhagSFRcEq1cUtBMo4TKxSNo/W6/s44yhr8X+eoXqCLycFQUylebOMPseHi5tc4fkGJqwqpWJLz6JStU9L4w==", "dependencies": { - "@docusaurus/logger": "3.8.0", - "@docusaurus/utils": "3.8.0", - "@docusaurus/utils-validation": "3.8.0", + "@docusaurus/logger": "3.8.1", + "@docusaurus/utils": "3.8.1", + "@docusaurus/utils-validation": "3.8.1", "@mdx-js/mdx": "^3.0.0", "@slorber/remark-comment": "^1.0.0", "escape-html": "^1.0.3", @@ -3279,12 +3201,11 @@ } }, "node_modules/@docusaurus/module-type-aliases": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/module-type-aliases/-/module-type-aliases-3.8.0.tgz", - "integrity": "sha512-/uMb4Ipt5J/QnD13MpnoC/A4EYAe6DKNWqTWLlGrqsPJwJv73vSwkA25xnYunwfqWk0FlUQfGv/Swdh5eCCg7g==", - "license": "MIT", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/module-type-aliases/-/module-type-aliases-3.8.1.tgz", + "integrity": "sha512-6xhvAJiXzsaq3JdosS7wbRt/PwEPWHr9eM4YNYqVlbgG1hSK3uQDXTVvQktasp3VO6BmfYWPozueLWuj4gB+vg==", "dependencies": { - "@docusaurus/types": "3.8.0", + "@docusaurus/types": "3.8.1", "@types/history": "^4.7.11", "@types/react": "*", "@types/react-router-config": "*", @@ -3298,16 +3219,15 @@ } }, "node_modules/@docusaurus/plugin-client-redirects": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-client-redirects/-/plugin-client-redirects-3.8.0.tgz", - "integrity": "sha512-J8f5qzAlO61BnG1I91+N5WH1b/lPWqn6ifTxf/Bluz9JVe1bhFNSl0yW03p+Ff3AFOINDy2ofX70al9nOnOLyw==", - "license": "MIT", - "dependencies": { - "@docusaurus/core": "3.8.0", - "@docusaurus/logger": "3.8.0", - "@docusaurus/utils": "3.8.0", - "@docusaurus/utils-common": "3.8.0", - "@docusaurus/utils-validation": "3.8.0", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-client-redirects/-/plugin-client-redirects-3.8.1.tgz", + "integrity": "sha512-F+86R7PBn6VNgy/Ux8w3ZRypJGJEzksbejQKlbTC8u6uhBUhfdXWkDp6qdOisIoW0buY5nLqucvZt1zNJzhJhA==", + "dependencies": { + "@docusaurus/core": "3.8.1", + "@docusaurus/logger": "3.8.1", + "@docusaurus/utils": "3.8.1", + "@docusaurus/utils-common": "3.8.1", + "@docusaurus/utils-validation": "3.8.1", "eta": "^2.2.0", "fs-extra": "^11.1.1", "lodash": "^4.17.21", @@ -3322,19 +3242,18 @@ } }, "node_modules/@docusaurus/plugin-content-blog": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-blog/-/plugin-content-blog-3.8.0.tgz", - "integrity": "sha512-0SlOTd9R55WEr1GgIXu+hhTT0hzARYx3zIScA5IzpdekZQesI/hKEa5LPHBd415fLkWMjdD59TaW/3qQKpJ0Lg==", - "license": "MIT", - "dependencies": { - "@docusaurus/core": "3.8.0", - "@docusaurus/logger": "3.8.0", - "@docusaurus/mdx-loader": "3.8.0", - "@docusaurus/theme-common": "3.8.0", - "@docusaurus/types": "3.8.0", - "@docusaurus/utils": "3.8.0", - "@docusaurus/utils-common": "3.8.0", - "@docusaurus/utils-validation": "3.8.0", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-blog/-/plugin-content-blog-3.8.1.tgz", + "integrity": "sha512-vNTpMmlvNP9n3hGEcgPaXyvTljanAKIUkuG9URQ1DeuDup0OR7Ltvoc8yrmH+iMZJbcQGhUJF+WjHLwuk8HSdw==", + "dependencies": { + "@docusaurus/core": "3.8.1", + "@docusaurus/logger": "3.8.1", + "@docusaurus/mdx-loader": "3.8.1", + "@docusaurus/theme-common": "3.8.1", + "@docusaurus/types": "3.8.1", + "@docusaurus/utils": "3.8.1", + "@docusaurus/utils-common": "3.8.1", + "@docusaurus/utils-validation": "3.8.1", "cheerio": "1.0.0-rc.12", "feed": "^4.2.2", "fs-extra": "^11.1.1", @@ -3356,20 +3275,19 @@ } }, "node_modules/@docusaurus/plugin-content-docs": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-docs/-/plugin-content-docs-3.8.0.tgz", - "integrity": "sha512-fRDMFLbUN6eVRXcjP8s3Y7HpAt9pzPYh1F/7KKXOCxvJhjjCtbon4VJW0WndEPInVz4t8QUXn5QZkU2tGVCE2g==", - "license": "MIT", - "dependencies": { - "@docusaurus/core": "3.8.0", - "@docusaurus/logger": "3.8.0", - "@docusaurus/mdx-loader": "3.8.0", - "@docusaurus/module-type-aliases": "3.8.0", - "@docusaurus/theme-common": "3.8.0", - "@docusaurus/types": "3.8.0", - "@docusaurus/utils": "3.8.0", - "@docusaurus/utils-common": "3.8.0", - "@docusaurus/utils-validation": "3.8.0", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-docs/-/plugin-content-docs-3.8.1.tgz", + "integrity": "sha512-oByRkSZzeGNQByCMaX+kif5Nl2vmtj2IHQI2fWjCfCootsdKZDPFLonhIp5s3IGJO7PLUfe0POyw0Xh/RrGXJA==", + "dependencies": { + "@docusaurus/core": "3.8.1", + "@docusaurus/logger": "3.8.1", + "@docusaurus/mdx-loader": "3.8.1", + "@docusaurus/module-type-aliases": "3.8.1", + "@docusaurus/theme-common": "3.8.1", + "@docusaurus/types": "3.8.1", + "@docusaurus/utils": "3.8.1", + "@docusaurus/utils-common": "3.8.1", + "@docusaurus/utils-validation": "3.8.1", "@types/react-router-config": "^5.0.7", "combine-promises": "^1.1.0", "fs-extra": "^11.1.1", @@ -3389,16 +3307,15 @@ } }, "node_modules/@docusaurus/plugin-content-pages": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-pages/-/plugin-content-pages-3.8.0.tgz", - "integrity": "sha512-39EDx2y1GA0Pxfion5tQZLNJxL4gq6susd1xzetVBjVIQtwpCdyloOfQBAgX0FylqQxfJrYqL0DIUuq7rd7uBw==", - "license": "MIT", - "dependencies": { - "@docusaurus/core": "3.8.0", - "@docusaurus/mdx-loader": "3.8.0", - "@docusaurus/types": "3.8.0", - "@docusaurus/utils": "3.8.0", - "@docusaurus/utils-validation": "3.8.0", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-pages/-/plugin-content-pages-3.8.1.tgz", + "integrity": "sha512-a+V6MS2cIu37E/m7nDJn3dcxpvXb6TvgdNI22vJX8iUTp8eoMoPa0VArEbWvCxMY/xdC26WzNv4wZ6y0iIni/w==", + "dependencies": { + "@docusaurus/core": "3.8.1", + "@docusaurus/mdx-loader": "3.8.1", + "@docusaurus/types": "3.8.1", + "@docusaurus/utils": "3.8.1", + "@docusaurus/utils-validation": "3.8.1", "fs-extra": "^11.1.1", "tslib": "^2.6.0", "webpack": "^5.88.1" @@ -3412,14 +3329,14 @@ } }, "node_modules/@docusaurus/plugin-css-cascade-layers": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-css-cascade-layers/-/plugin-css-cascade-layers-3.8.0.tgz", - "integrity": "sha512-/VBTNymPIxQB8oA3ZQ4GFFRYdH4ZxDRRBECxyjRyv486mfUPXfcdk+im4S5mKWa6EK2JzBz95IH/Wu0qQgJ5yQ==", - "license": "MIT", - "dependencies": { - "@docusaurus/core": "3.8.0", - "@docusaurus/types": "3.8.0", - "@docusaurus/utils-validation": "3.8.0", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-css-cascade-layers/-/plugin-css-cascade-layers-3.8.1.tgz", + "integrity": "sha512-VQ47xRxfNKjHS5ItzaVXpxeTm7/wJLFMOPo1BkmoMG4Cuz4nuI+Hs62+RMk1OqVog68Swz66xVPK8g9XTrBKRw==", + "dependencies": { + "@docusaurus/core": "3.8.1", + "@docusaurus/types": "3.8.1", + "@docusaurus/utils": "3.8.1", + "@docusaurus/utils-validation": "3.8.1", "tslib": "^2.6.0" }, "engines": { @@ -3427,14 +3344,13 @@ } }, "node_modules/@docusaurus/plugin-debug": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-debug/-/plugin-debug-3.8.0.tgz", - "integrity": "sha512-teonJvJsDB9o2OnG6ifbhblg/PXzZvpUKHFgD8dOL1UJ58u0lk8o0ZOkvaYEBa9nDgqzoWrRk9w+e3qaG2mOhQ==", - "license": "MIT", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-debug/-/plugin-debug-3.8.1.tgz", + "integrity": "sha512-nT3lN7TV5bi5hKMB7FK8gCffFTBSsBsAfV84/v293qAmnHOyg1nr9okEw8AiwcO3bl9vije5nsUvP0aRl2lpaw==", "dependencies": { - "@docusaurus/core": "3.8.0", - "@docusaurus/types": "3.8.0", - "@docusaurus/utils": "3.8.0", + "@docusaurus/core": "3.8.1", + "@docusaurus/types": "3.8.1", + "@docusaurus/utils": "3.8.1", "fs-extra": "^11.1.1", "react-json-view-lite": "^2.3.0", "tslib": "^2.6.0" @@ -3448,14 +3364,13 @@ } }, "node_modules/@docusaurus/plugin-google-analytics": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-analytics/-/plugin-google-analytics-3.8.0.tgz", - "integrity": "sha512-aKKa7Q8+3xRSRESipNvlFgNp3FNPELKhuo48Cg/svQbGNwidSHbZT03JqbW4cBaQnyyVchO1ttk+kJ5VC9Gx0w==", - "license": "MIT", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-analytics/-/plugin-google-analytics-3.8.1.tgz", + "integrity": "sha512-Hrb/PurOJsmwHAsfMDH6oVpahkEGsx7F8CWMjyP/dw1qjqmdS9rcV1nYCGlM8nOtD3Wk/eaThzUB5TSZsGz+7Q==", "dependencies": { - "@docusaurus/core": "3.8.0", - "@docusaurus/types": "3.8.0", - "@docusaurus/utils-validation": "3.8.0", + "@docusaurus/core": "3.8.1", + "@docusaurus/types": "3.8.1", + "@docusaurus/utils-validation": "3.8.1", "tslib": "^2.6.0" }, "engines": { @@ -3467,14 +3382,13 @@ } }, "node_modules/@docusaurus/plugin-google-gtag": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-3.8.0.tgz", - "integrity": "sha512-ugQYMGF4BjbAW/JIBtVcp+9eZEgT9HRdvdcDudl5rywNPBA0lct+lXMG3r17s02rrhInMpjMahN3Yc9Cb3H5/g==", - "license": "MIT", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-3.8.1.tgz", + "integrity": "sha512-tKE8j1cEZCh8KZa4aa80zpSTxsC2/ZYqjx6AAfd8uA8VHZVw79+7OTEP2PoWi0uL5/1Is0LF5Vwxd+1fz5HlKg==", "dependencies": { - "@docusaurus/core": "3.8.0", - "@docusaurus/types": "3.8.0", - "@docusaurus/utils-validation": "3.8.0", + "@docusaurus/core": "3.8.1", + "@docusaurus/types": "3.8.1", + "@docusaurus/utils-validation": "3.8.1", "@types/gtag.js": "^0.0.12", "tslib": "^2.6.0" }, @@ -3487,14 +3401,13 @@ } }, "node_modules/@docusaurus/plugin-google-tag-manager": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-tag-manager/-/plugin-google-tag-manager-3.8.0.tgz", - "integrity": "sha512-9juRWxbwZD3SV02Jd9QB6yeN7eu+7T4zB0bvJLcVQwi+am51wAxn2CwbdL0YCCX+9OfiXbADE8D8Q65Hbopu/w==", - "license": "MIT", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-tag-manager/-/plugin-google-tag-manager-3.8.1.tgz", + "integrity": "sha512-iqe3XKITBquZq+6UAXdb1vI0fPY5iIOitVjPQ581R1ZKpHr0qe+V6gVOrrcOHixPDD/BUKdYwkxFjpNiEN+vBw==", "dependencies": { - "@docusaurus/core": "3.8.0", - "@docusaurus/types": "3.8.0", - "@docusaurus/utils-validation": "3.8.0", + "@docusaurus/core": "3.8.1", + "@docusaurus/types": "3.8.1", + "@docusaurus/utils-validation": "3.8.1", "tslib": "^2.6.0" }, "engines": { @@ -3506,17 +3419,16 @@ } }, "node_modules/@docusaurus/plugin-sitemap": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-sitemap/-/plugin-sitemap-3.8.0.tgz", - "integrity": "sha512-fGpOIyJvNiuAb90nSJ2Gfy/hUOaDu6826e5w5UxPmbpCIc7KlBHNAZ5g4L4ZuHhc4hdfq4mzVBsQSnne+8Ze1g==", - "license": "MIT", - "dependencies": { - "@docusaurus/core": "3.8.0", - "@docusaurus/logger": "3.8.0", - "@docusaurus/types": "3.8.0", - "@docusaurus/utils": "3.8.0", - "@docusaurus/utils-common": "3.8.0", - "@docusaurus/utils-validation": "3.8.0", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-sitemap/-/plugin-sitemap-3.8.1.tgz", + "integrity": "sha512-+9YV/7VLbGTq8qNkjiugIelmfUEVkTyLe6X8bWq7K5qPvGXAjno27QAfFq63mYfFFbJc7z+pudL63acprbqGzw==", + "dependencies": { + "@docusaurus/core": "3.8.1", + "@docusaurus/logger": "3.8.1", + "@docusaurus/types": "3.8.1", + "@docusaurus/utils": "3.8.1", + "@docusaurus/utils-common": "3.8.1", + "@docusaurus/utils-validation": "3.8.1", "fs-extra": "^11.1.1", "sitemap": "^7.1.1", "tslib": "^2.6.0" @@ -3530,15 +3442,14 @@ } }, "node_modules/@docusaurus/plugin-svgr": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-svgr/-/plugin-svgr-3.8.0.tgz", - "integrity": "sha512-kEDyry+4OMz6BWLG/lEqrNsL/w818bywK70N1gytViw4m9iAmoxCUT7Ri9Dgs7xUdzCHJ3OujolEmD88Wy44OA==", - "license": "MIT", - "dependencies": { - "@docusaurus/core": "3.8.0", - "@docusaurus/types": "3.8.0", - "@docusaurus/utils": "3.8.0", - "@docusaurus/utils-validation": "3.8.0", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-svgr/-/plugin-svgr-3.8.1.tgz", + "integrity": "sha512-rW0LWMDsdlsgowVwqiMb/7tANDodpy1wWPwCcamvhY7OECReN3feoFwLjd/U4tKjNY3encj0AJSTxJA+Fpe+Gw==", + "dependencies": { + "@docusaurus/core": "3.8.1", + "@docusaurus/types": "3.8.1", + "@docusaurus/utils": "3.8.1", + "@docusaurus/utils-validation": "3.8.1", "@svgr/core": "8.1.0", "@svgr/webpack": "^8.1.0", "tslib": "^2.6.0", @@ -3553,26 +3464,25 @@ } }, "node_modules/@docusaurus/preset-classic": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/preset-classic/-/preset-classic-3.8.0.tgz", - "integrity": "sha512-qOu6tQDOWv+rpTlKu+eJATCJVGnABpRCPuqf7LbEaQ1mNY//N/P8cHQwkpAU+aweQfarcZ0XfwCqRHJfjeSV/g==", - "license": "MIT", - "dependencies": { - "@docusaurus/core": "3.8.0", - "@docusaurus/plugin-content-blog": "3.8.0", - "@docusaurus/plugin-content-docs": "3.8.0", - "@docusaurus/plugin-content-pages": "3.8.0", - "@docusaurus/plugin-css-cascade-layers": "3.8.0", - "@docusaurus/plugin-debug": "3.8.0", - "@docusaurus/plugin-google-analytics": "3.8.0", - "@docusaurus/plugin-google-gtag": "3.8.0", - "@docusaurus/plugin-google-tag-manager": "3.8.0", - "@docusaurus/plugin-sitemap": "3.8.0", - "@docusaurus/plugin-svgr": "3.8.0", - "@docusaurus/theme-classic": "3.8.0", - "@docusaurus/theme-common": "3.8.0", - "@docusaurus/theme-search-algolia": "3.8.0", - "@docusaurus/types": "3.8.0" + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/preset-classic/-/preset-classic-3.8.1.tgz", + "integrity": "sha512-yJSjYNHXD8POMGc2mKQuj3ApPrN+eG0rO1UPgSx7jySpYU+n4WjBikbrA2ue5ad9A7aouEtMWUoiSRXTH/g7KQ==", + "dependencies": { + "@docusaurus/core": "3.8.1", + "@docusaurus/plugin-content-blog": "3.8.1", + "@docusaurus/plugin-content-docs": "3.8.1", + "@docusaurus/plugin-content-pages": "3.8.1", + "@docusaurus/plugin-css-cascade-layers": "3.8.1", + "@docusaurus/plugin-debug": "3.8.1", + "@docusaurus/plugin-google-analytics": "3.8.1", + "@docusaurus/plugin-google-gtag": "3.8.1", + "@docusaurus/plugin-google-tag-manager": "3.8.1", + "@docusaurus/plugin-sitemap": "3.8.1", + "@docusaurus/plugin-svgr": "3.8.1", + "@docusaurus/theme-classic": "3.8.1", + "@docusaurus/theme-common": "3.8.1", + "@docusaurus/theme-search-algolia": "3.8.1", + "@docusaurus/types": "3.8.1" }, "engines": { "node": ">=18.0" @@ -3583,31 +3493,30 @@ } }, "node_modules/@docusaurus/theme-classic": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-classic/-/theme-classic-3.8.0.tgz", - "integrity": "sha512-nQWFiD5ZjoT76OaELt2n33P3WVuuCz8Dt5KFRP2fCBo2r9JCLsp2GJjZpnaG24LZ5/arRjv4VqWKgpK0/YLt7g==", - "license": "MIT", - "dependencies": { - "@docusaurus/core": "3.8.0", - "@docusaurus/logger": "3.8.0", - "@docusaurus/mdx-loader": "3.8.0", - "@docusaurus/module-type-aliases": "3.8.0", - "@docusaurus/plugin-content-blog": "3.8.0", - "@docusaurus/plugin-content-docs": "3.8.0", - "@docusaurus/plugin-content-pages": "3.8.0", - "@docusaurus/theme-common": "3.8.0", - "@docusaurus/theme-translations": "3.8.0", - "@docusaurus/types": "3.8.0", - "@docusaurus/utils": "3.8.0", - "@docusaurus/utils-common": "3.8.0", - "@docusaurus/utils-validation": "3.8.0", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-classic/-/theme-classic-3.8.1.tgz", + "integrity": "sha512-bqDUCNqXeYypMCsE1VcTXSI1QuO4KXfx8Cvl6rYfY0bhhqN6d2WZlRkyLg/p6pm+DzvanqHOyYlqdPyP0iz+iw==", + "dependencies": { + "@docusaurus/core": "3.8.1", + "@docusaurus/logger": "3.8.1", + "@docusaurus/mdx-loader": "3.8.1", + "@docusaurus/module-type-aliases": "3.8.1", + "@docusaurus/plugin-content-blog": "3.8.1", + "@docusaurus/plugin-content-docs": "3.8.1", + "@docusaurus/plugin-content-pages": "3.8.1", + "@docusaurus/theme-common": "3.8.1", + "@docusaurus/theme-translations": "3.8.1", + "@docusaurus/types": "3.8.1", + "@docusaurus/utils": "3.8.1", + "@docusaurus/utils-common": "3.8.1", + "@docusaurus/utils-validation": "3.8.1", "@mdx-js/react": "^3.0.0", "clsx": "^2.0.0", "copy-text-to-clipboard": "^3.2.0", "infima": "0.2.0-alpha.45", "lodash": "^4.17.21", "nprogress": "^0.2.0", - "postcss": "^8.4.26", + "postcss": "^8.5.4", "prism-react-renderer": "^2.3.0", "prismjs": "^1.29.0", "react-router-dom": "^5.3.4", @@ -3624,15 +3533,14 @@ } }, "node_modules/@docusaurus/theme-common": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-common/-/theme-common-3.8.0.tgz", - "integrity": "sha512-YqV2vAWpXGLA+A3PMLrOMtqgTHJLDcT+1Caa6RF7N4/IWgrevy5diY8oIHFkXR/eybjcrFFjUPrHif8gSGs3Tw==", - "license": "MIT", - "dependencies": { - "@docusaurus/mdx-loader": "3.8.0", - "@docusaurus/module-type-aliases": "3.8.0", - "@docusaurus/utils": "3.8.0", - "@docusaurus/utils-common": "3.8.0", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-common/-/theme-common-3.8.1.tgz", + "integrity": "sha512-UswMOyTnPEVRvN5Qzbo+l8k4xrd5fTFu2VPPfD6FcW/6qUtVLmJTQCktbAL3KJ0BVXGm5aJXz/ZrzqFuZERGPw==", + "dependencies": { + "@docusaurus/mdx-loader": "3.8.1", + "@docusaurus/module-type-aliases": "3.8.1", + "@docusaurus/utils": "3.8.1", + "@docusaurus/utils-common": "3.8.1", "@types/history": "^4.7.11", "@types/react": "*", "@types/react-router-config": "*", @@ -3652,19 +3560,18 @@ } }, "node_modules/@docusaurus/theme-search-algolia": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-search-algolia/-/theme-search-algolia-3.8.0.tgz", - "integrity": "sha512-GBZ5UOcPgiu6nUw153+0+PNWvFKweSnvKIL6Rp04H9olKb475jfKjAwCCtju5D2xs5qXHvCMvzWOg5o9f6DtuQ==", - "license": "MIT", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-search-algolia/-/theme-search-algolia-3.8.1.tgz", + "integrity": "sha512-NBFH5rZVQRAQM087aYSRKQ9yGEK9eHd+xOxQjqNpxMiV85OhJDD4ZGz6YJIod26Fbooy54UWVdzNU0TFeUUUzQ==", "dependencies": { "@docsearch/react": "^3.9.0", - "@docusaurus/core": "3.8.0", - "@docusaurus/logger": "3.8.0", - "@docusaurus/plugin-content-docs": "3.8.0", - "@docusaurus/theme-common": "3.8.0", - "@docusaurus/theme-translations": "3.8.0", - "@docusaurus/utils": "3.8.0", - "@docusaurus/utils-validation": "3.8.0", + "@docusaurus/core": "3.8.1", + "@docusaurus/logger": "3.8.1", + "@docusaurus/plugin-content-docs": "3.8.1", + "@docusaurus/theme-common": "3.8.1", + "@docusaurus/theme-translations": "3.8.1", + "@docusaurus/utils": "3.8.1", + "@docusaurus/utils-validation": "3.8.1", "algoliasearch": "^5.17.1", "algoliasearch-helper": "^3.22.6", "clsx": "^2.0.0", @@ -3683,10 +3590,9 @@ } }, "node_modules/@docusaurus/theme-translations": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-translations/-/theme-translations-3.8.0.tgz", - "integrity": "sha512-1DTy/snHicgkCkryWq54fZvsAglTdjTx4qjOXgqnXJ+DIty1B+aPQrAVUu8LiM+6BiILfmNxYsxhKTj+BS3PZg==", - "license": "MIT", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-translations/-/theme-translations-3.8.1.tgz", + "integrity": "sha512-OTp6eebuMcf2rJt4bqnvuwmm3NVXfzfYejL+u/Y1qwKhZPrjPoKWfk1CbOP5xH5ZOPkiAsx4dHdQBRJszK3z2g==", "dependencies": { "fs-extra": "^11.1.1", "tslib": "^2.6.0" @@ -3696,10 +3602,9 @@ } }, "node_modules/@docusaurus/types": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/types/-/types-3.8.0.tgz", - "integrity": "sha512-RDEClpwNxZq02c+JlaKLWoS13qwWhjcNsi2wG1UpzmEnuti/z1Wx4SGpqbUqRPNSd8QWWePR8Cb7DvG0VN/TtA==", - "license": "MIT", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/types/-/types-3.8.1.tgz", + "integrity": "sha512-ZPdW5AB+pBjiVrcLuw3dOS6BFlrG0XkS2lDGsj8TizcnREQg3J8cjsgfDviszOk4CweNfwo1AEELJkYaMUuOPg==", "dependencies": { "@mdx-js/mdx": "^3.0.0", "@types/history": "^4.7.11", @@ -3731,14 +3636,13 @@ } }, "node_modules/@docusaurus/utils": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/utils/-/utils-3.8.0.tgz", - "integrity": "sha512-2wvtG28ALCN/A1WCSLxPASFBFzXCnP0YKCAFIPcvEb6imNu1wg7ni/Svcp71b3Z2FaOFFIv4Hq+j4gD7gA0yfQ==", - "license": "MIT", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/utils/-/utils-3.8.1.tgz", + "integrity": "sha512-P1ml0nvOmEFdmu0smSXOqTS1sxU5tqvnc0dA4MTKV39kye+bhQnjkIKEE18fNOvxjyB86k8esoCIFM3x4RykOQ==", "dependencies": { - "@docusaurus/logger": "3.8.0", - "@docusaurus/types": "3.8.0", - "@docusaurus/utils-common": "3.8.0", + "@docusaurus/logger": "3.8.1", + "@docusaurus/types": "3.8.1", + "@docusaurus/utils-common": "3.8.1", "escape-string-regexp": "^4.0.0", "execa": "5.1.1", "file-loader": "^6.2.0", @@ -3763,12 +3667,11 @@ } }, "node_modules/@docusaurus/utils-common": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/utils-common/-/utils-common-3.8.0.tgz", - "integrity": "sha512-3TGF+wVTGgQ3pAc9+5jVchES4uXUAhAt9pwv7uws4mVOxL4alvU3ue/EZ+R4XuGk94pDy7CNXjRXpPjlfZXQfw==", - "license": "MIT", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/utils-common/-/utils-common-3.8.1.tgz", + "integrity": "sha512-zTZiDlvpvoJIrQEEd71c154DkcriBecm4z94OzEE9kz7ikS3J+iSlABhFXM45mZ0eN5pVqqr7cs60+ZlYLewtg==", "dependencies": { - "@docusaurus/types": "3.8.0", + "@docusaurus/types": "3.8.1", "tslib": "^2.6.0" }, "engines": { @@ -3776,14 +3679,13 @@ } }, "node_modules/@docusaurus/utils-validation": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@docusaurus/utils-validation/-/utils-validation-3.8.0.tgz", - "integrity": "sha512-MrnEbkigr54HkdFeg8e4FKc4EF+E9dlVwsY3XQZsNkbv3MKZnbHQ5LsNJDIKDROFe8PBf5C4qCAg5TPBpsjrjg==", - "license": "MIT", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@docusaurus/utils-validation/-/utils-validation-3.8.1.tgz", + "integrity": "sha512-gs5bXIccxzEbyVecvxg6upTwaUbfa0KMmTj7HhHzc016AGyxH2o73k1/aOD0IFrdCsfJNt37MqNI47s2MgRZMA==", "dependencies": { - "@docusaurus/logger": "3.8.0", - "@docusaurus/utils": "3.8.0", - "@docusaurus/utils-common": "3.8.0", + "@docusaurus/logger": "3.8.1", + "@docusaurus/utils": "3.8.1", + "@docusaurus/utils-common": "3.8.1", "fs-extra": "^11.2.0", "joi": "^17.9.2", "js-yaml": "^4.1.0", @@ -3811,7 +3713,6 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", - "license": "MIT", "dependencies": { "@sinclair/typebox": "^0.27.8" }, @@ -3823,7 +3724,6 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "license": "MIT", "dependencies": { "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", @@ -4044,8 +3944,7 @@ "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", - "license": "MIT" + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==" }, "node_modules/@sindresorhus/is": { "version": "4.6.0", @@ -4074,7 +3973,6 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-8.0.0.tgz", "integrity": "sha512-b9MIk7yhdS1pMCZM8VeNfUlSKVRhsHZNMl5O9SfaX0l0t5wjdgu4IDzGB8bpnGBBOjGST3rRFVsaaEtI4W6f7g==", - "license": "MIT", "engines": { "node": ">=14" }, @@ -4090,7 +3988,6 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-attribute/-/babel-plugin-remove-jsx-attribute-8.0.0.tgz", "integrity": "sha512-BcCkm/STipKvbCl6b7QFrMh/vx00vIP63k2eM66MfHJzPr6O2U0jYEViXkHJWqXqQYjdeA9cuCl5KWmlwjDvbA==", - "license": "MIT", "engines": { "node": ">=14" }, @@ -4106,7 +4003,6 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-empty-expression/-/babel-plugin-remove-jsx-empty-expression-8.0.0.tgz", "integrity": "sha512-5BcGCBfBxB5+XSDSWnhTThfI9jcO5f0Ai2V24gZpG+wXF14BzwxxdDb4g6trdOux0rhibGs385BeFMSmxtS3uA==", - "license": "MIT", "engines": { "node": ">=14" }, @@ -4122,7 +4018,6 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-replace-jsx-attribute-value/-/babel-plugin-replace-jsx-attribute-value-8.0.0.tgz", "integrity": "sha512-KVQ+PtIjb1BuYT3ht8M5KbzWBhdAjjUPdlMtpuw/VjT8coTrItWX6Qafl9+ji831JaJcu6PJNKCV0bp01lBNzQ==", - "license": "MIT", "engines": { "node": ">=14" }, @@ -4138,7 +4033,6 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-dynamic-title/-/babel-plugin-svg-dynamic-title-8.0.0.tgz", "integrity": "sha512-omNiKqwjNmOQJ2v6ge4SErBbkooV2aAWwaPFs2vUY7p7GhVkzRkJ00kILXQvRhA6miHnNpXv7MRnnSjdRjK8og==", - "license": "MIT", "engines": { "node": ">=14" }, @@ -4154,7 +4048,6 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-em-dimensions/-/babel-plugin-svg-em-dimensions-8.0.0.tgz", "integrity": "sha512-mURHYnu6Iw3UBTbhGwE/vsngtCIbHE43xCRK7kCw4t01xyGqb2Pd+WXekRRoFOBIY29ZoOhUCTEweDMdrjfi9g==", - "license": "MIT", "engines": { "node": ">=14" }, @@ -4170,7 +4063,6 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-react-native-svg/-/babel-plugin-transform-react-native-svg-8.1.0.tgz", "integrity": "sha512-Tx8T58CHo+7nwJ+EhUwx3LfdNSG9R2OKfaIXXs5soiy5HtgoAEkDay9LIimLOcG8dJQH1wPZp/cnAv6S9CrR1Q==", - "license": "MIT", "engines": { "node": ">=14" }, @@ -4186,7 +4078,6 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-svg-component/-/babel-plugin-transform-svg-component-8.0.0.tgz", "integrity": "sha512-DFx8xa3cZXTdb/k3kfPeaixecQLgKh5NVBMwD0AQxOzcZawK4oo1Jh9LbrcACUivsCA7TLG8eeWgrDXjTMhRmw==", - "license": "MIT", "engines": { "node": ">=12" }, @@ -4202,7 +4093,6 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/@svgr/babel-preset/-/babel-preset-8.1.0.tgz", "integrity": "sha512-7EYDbHE7MxHpv4sxvnVPngw5fuR6pw79SkcrILHJ/iMpuKySNCl5W1qcwPEpU+LgyRXOaAFgH0KhwD18wwg6ug==", - "license": "MIT", "dependencies": { "@svgr/babel-plugin-add-jsx-attribute": "8.0.0", "@svgr/babel-plugin-remove-jsx-attribute": "8.0.0", @@ -4228,7 +4118,6 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/@svgr/core/-/core-8.1.0.tgz", "integrity": "sha512-8QqtOQT5ACVlmsvKOJNEaWmRPmcojMOzCz4Hs2BGG/toAp/K38LcsMRyLp349glq5AzJbCEeimEoxaX6v/fLrA==", - "license": "MIT", "dependencies": { "@babel/core": "^7.21.3", "@svgr/babel-preset": "8.1.0", @@ -4248,7 +4137,6 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/@svgr/hast-util-to-babel-ast/-/hast-util-to-babel-ast-8.0.0.tgz", "integrity": "sha512-EbDKwO9GpfWP4jN9sGdYwPBU0kdomaPIL2Eu4YwmgP+sJeXT+L7bMwJUBnhzfH8Q2qMBqZ4fJwpCyYsAN3mt2Q==", - "license": "MIT", "dependencies": { "@babel/types": "^7.21.3", "entities": "^4.4.0" @@ -4265,7 +4153,6 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/@svgr/plugin-jsx/-/plugin-jsx-8.1.0.tgz", "integrity": "sha512-0xiIyBsLlr8quN+WyuxooNW9RJ0Dpr8uOnH/xrCVO8GLUcwHISwj1AG0k+LFzteTkAA0GbX0kj9q6Dk70PTiPA==", - "license": "MIT", "dependencies": { "@babel/core": "^7.21.3", "@svgr/babel-preset": "8.1.0", @@ -4287,7 +4174,6 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/@svgr/plugin-svgo/-/plugin-svgo-8.1.0.tgz", "integrity": "sha512-Ywtl837OGO9pTLIN/onoWLmDQ4zFUycI1g76vuKGEz6evR/ZTJlJuz3G/fIkb6OVBJ2g0o6CGJzaEjfmEo3AHA==", - "license": "MIT", "dependencies": { "cosmiconfig": "^8.1.3", "deepmerge": "^4.3.1", @@ -4308,7 +4194,6 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/@svgr/webpack/-/webpack-8.1.0.tgz", "integrity": "sha512-LnhVjMWyMQV9ZmeEy26maJk+8HTIbd59cH4F2MJ439k9DqejRisfFNGAPvRYlKETuh9LrImlS8aKsBgKjMA8WA==", - "license": "MIT", "dependencies": { "@babel/core": "^7.21.3", "@babel/plugin-transform-react-constant-elements": "^7.21.3", @@ -4471,8 +4356,7 @@ "node_modules/@types/gtag.js": { "version": "0.0.12", "resolved": "https://registry.npmjs.org/@types/gtag.js/-/gtag.js-0.0.12.tgz", - "integrity": "sha512-YQV9bUsemkzG81Ea295/nF/5GijnD2Af7QhEofh7xu+kvCN6RdodgNwwGWXB5GMI3NoyvQo0odNctoH/qLMIpg==", - "license": "MIT" + "integrity": "sha512-YQV9bUsemkzG81Ea295/nF/5GijnD2Af7QhEofh7xu+kvCN6RdodgNwwGWXB5GMI3NoyvQo0odNctoH/qLMIpg==" }, "node_modules/@types/hast": { "version": "3.0.4", @@ -4517,14 +4401,12 @@ "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", - "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", - "license": "MIT" + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==" }, "node_modules/@types/istanbul-lib-report": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", - "license": "MIT", "dependencies": { "@types/istanbul-lib-coverage": "*" } @@ -4533,7 +4415,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", - "license": "MIT", "dependencies": { "@types/istanbul-lib-report": "*" } @@ -4655,7 +4536,6 @@ "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/sax/-/sax-1.2.7.tgz", "integrity": "sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==", - "license": "MIT", "dependencies": { "@types/node": "*" } @@ -4717,7 +4597,6 @@ "version": "17.0.33", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", "integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==", - "license": "MIT", "dependencies": { "@types/yargs-parser": "*" } @@ -4725,8 +4604,7 @@ "node_modules/@types/yargs-parser": { "version": "21.0.3", "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", - "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", - "license": "MIT" + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==" }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", @@ -5016,34 +4894,32 @@ } }, "node_modules/algoliasearch": { - "version": "5.25.0", - "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-5.25.0.tgz", - "integrity": "sha512-n73BVorL4HIwKlfJKb4SEzAYkR3Buwfwbh+MYxg2mloFph2fFGV58E90QTzdbfzWrLn4HE5Czx/WTjI8fcHaMg==", - "license": "MIT", - "dependencies": { - "@algolia/client-abtesting": "5.25.0", - "@algolia/client-analytics": "5.25.0", - "@algolia/client-common": "5.25.0", - "@algolia/client-insights": "5.25.0", - "@algolia/client-personalization": "5.25.0", - "@algolia/client-query-suggestions": "5.25.0", - "@algolia/client-search": "5.25.0", - "@algolia/ingestion": "1.25.0", - "@algolia/monitoring": "1.25.0", - "@algolia/recommend": "5.25.0", - "@algolia/requester-browser-xhr": "5.25.0", - "@algolia/requester-fetch": "5.25.0", - "@algolia/requester-node-http": "5.25.0" + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-5.30.0.tgz", + "integrity": "sha512-ILSdPX4je0n5WUKD34TMe57/eqiXUzCIjAsdtLQYhomqOjTtFUg1s6dE7kUegc4Mc43Xr7IXYlMutU9HPiYfdw==", + "dependencies": { + "@algolia/client-abtesting": "5.30.0", + "@algolia/client-analytics": "5.30.0", + "@algolia/client-common": "5.30.0", + "@algolia/client-insights": "5.30.0", + "@algolia/client-personalization": "5.30.0", + "@algolia/client-query-suggestions": "5.30.0", + "@algolia/client-search": "5.30.0", + "@algolia/ingestion": "1.30.0", + "@algolia/monitoring": "1.30.0", + "@algolia/recommend": "5.30.0", + "@algolia/requester-browser-xhr": "5.30.0", + "@algolia/requester-fetch": "5.30.0", + "@algolia/requester-node-http": "5.30.0" }, "engines": { "node": ">= 14.0.0" } }, "node_modules/algoliasearch-helper": { - "version": "3.25.0", - "resolved": "https://registry.npmjs.org/algoliasearch-helper/-/algoliasearch-helper-3.25.0.tgz", - "integrity": "sha512-vQoK43U6HXA9/euCqLjvyNdM4G2Fiu/VFp4ae0Gau9sZeIKBPvUPnXfLYAe65Bg7PFuw03coeu5K6lTPSXRObw==", - "license": "MIT", + "version": "3.26.0", + "resolved": "https://registry.npmjs.org/algoliasearch-helper/-/algoliasearch-helper-3.26.0.tgz", + "integrity": "sha512-Rv2x3GXleQ3ygwhkhJubhhYGsICmShLAiqtUuJTUkr9uOCOXyF2E71LVT4XDnVffbknv8XgScP4U0Oxtgm+hIw==", "dependencies": { "@algolia/events": "^4.0.1" }, @@ -5084,7 +4960,6 @@ "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "license": "MIT", "dependencies": { "type-fest": "^0.21.3" }, @@ -5099,7 +4974,6 @@ "version": "0.21.3", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -5158,8 +5032,7 @@ "node_modules/arg": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", - "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", - "license": "MIT" + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==" }, "node_modules/argparse": { "version": "2.0.1", @@ -5206,7 +5079,6 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { "browserslist": "^4.24.4", "caniuse-lite": "^1.0.30001702", @@ -5229,7 +5101,6 @@ "version": "9.2.1", "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-9.2.1.tgz", "integrity": "sha512-fqe8naHt46e0yIdkjUZYqddSXfej3AHajX+CSO5X7oy0EmPc6o5Xh+RClNoHjnieWz9AW4kZxW9yyFMhVB1QLA==", - "license": "MIT", "dependencies": { "find-cache-dir": "^4.0.0", "schema-utils": "^4.0.0" @@ -5246,7 +5117,6 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", - "license": "MIT", "dependencies": { "object.assign": "^4.1.0" } @@ -5518,7 +5388,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", - "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", @@ -5594,7 +5463,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz", "integrity": "sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==", - "license": "MIT", "dependencies": { "browserslist": "^4.0.0", "caniuse-lite": "^1.0.0", @@ -5695,7 +5563,6 @@ "version": "1.0.0-rc.12", "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", - "license": "MIT", "dependencies": { "cheerio-select": "^2.1.0", "dom-serializer": "^2.0.0", @@ -5716,7 +5583,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", - "license": "BSD-2-Clause", "dependencies": { "boolbase": "^1.0.0", "css-select": "^5.1.0", @@ -5902,8 +5768,7 @@ "node_modules/colord": { "version": "2.9.3", "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", - "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==", - "license": "MIT" + "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==" }, "node_modules/colorette": { "version": "2.0.20", @@ -5939,8 +5804,7 @@ "node_modules/common-path-prefix": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz", - "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", - "license": "ISC" + "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==" }, "node_modules/compressible": { "version": "2.0.18", @@ -6052,7 +5916,6 @@ "version": "3.4.2", "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", - "license": "MIT", "engines": { "node": "^14.18.0 || >=16.10.0" } @@ -6099,7 +5962,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.0.tgz", "integrity": "sha512-RnJFp1XR/LOBDckxTib5Qjr/PMfkatD0MUCQgdpqS8MdKiNUzBjAQBEN6oUy+jW7LI93BBG3DtMB2KOOKpGs2Q==", - "license": "MIT", "engines": { "node": ">=12" }, @@ -6111,7 +5973,6 @@ "version": "11.0.0", "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-11.0.0.tgz", "integrity": "sha512-fX2MWpamkW0hZxMEg0+mYnA40LTosOSa5TqZ9GYIBzyJa9C3QUaMPSE2xAi/buNr8u89SfD9wHSQVBzrRa/SOQ==", - "license": "MIT", "dependencies": { "fast-glob": "^3.2.11", "glob-parent": "^6.0.1", @@ -6135,7 +5996,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, @@ -6147,7 +6007,6 @@ "version": "13.2.2", "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", - "license": "MIT", "dependencies": { "dir-glob": "^3.0.1", "fast-glob": "^3.3.0", @@ -6166,7 +6025,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", - "license": "MIT", "engines": { "node": ">=12" }, @@ -6199,11 +6057,10 @@ } }, "node_modules/core-js-pure": { - "version": "3.42.0", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.42.0.tgz", - "integrity": "sha512-007bM04u91fF4kMgwom2I5cQxAFIy8jVulgr9eozILl/SZE53QOqnW/+vviC+wQWLv+AunBG+8Q0TLoeSsSxRQ==", + "version": "3.43.0", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.43.0.tgz", + "integrity": "sha512-i/AgxU2+A+BbJdMxh3v7/vxi2SbFqxiFmg6VsDwYB4jkucrd1BZNA9a9gphC0fYMG5IBSgQcbQnk865VCLe7xA==", "hasInstallScript": true, - "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/core-js" @@ -6295,7 +6152,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "postcss-selector-parser": "^7.0.0" }, @@ -6310,7 +6166,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "license": "MIT", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -6323,7 +6178,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-7.2.0.tgz", "integrity": "sha512-h70rUM+3PNFuaBDTLe8wF/cdWu+dOZmb7pJt8Z2sedYbAcQVQV/tEchueg3GWxwqS0cxtbxmaHEdkNACqcvsow==", - "license": "ISC", "engines": { "node": "^14 || ^16 || >=18" }, @@ -6345,7 +6199,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/selector-specificity": "^5.0.0", "postcss-selector-parser": "^7.0.0", @@ -6372,7 +6225,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "engines": { "node": ">=18" }, @@ -6384,7 +6236,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "license": "MIT", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -6397,7 +6248,6 @@ "version": "6.11.0", "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.11.0.tgz", "integrity": "sha512-CTJ+AEQJjq5NzLga5pE39qdiSV56F8ywCIsqNIRF0r7BDgWsN25aazToqAFg7ZrtA/U016xudB3ffgweORxX7g==", - "license": "MIT", "dependencies": { "icss-utils": "^5.1.0", "postcss": "^8.4.33", @@ -6432,7 +6282,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/css-minimizer-webpack-plugin/-/css-minimizer-webpack-plugin-5.0.1.tgz", "integrity": "sha512-3caImjKFQkS+ws1TGcFn0V1HyDJFq1Euy589JlD6/3rV2kj+w7r5G9WDMgSHvpvXHNZ2calVypZWuEDQd9wfLg==", - "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "^0.3.18", "cssnano": "^6.0.1", @@ -6486,7 +6335,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "engines": { "node": ">=18" }, @@ -6533,9 +6381,9 @@ } }, "node_modules/cssdb": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/cssdb/-/cssdb-8.3.0.tgz", - "integrity": "sha512-c7bmItIg38DgGjSwDPZOYF/2o0QU/sSgkWOMyl8votOfgFuyiFKWPesmCGEsrGLxEA9uL540cp8LdaGEjUGsZQ==", + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/cssdb/-/cssdb-8.3.1.tgz", + "integrity": "sha512-XnDRQMXucLueX92yDe0LPKupXetWoFOgawr4O4X41l5TltgK2NVbJJVDnnOywDYfW1sTJ28AcXGKOqdRKwCcmQ==", "funding": [ { "type": "opencollective", @@ -6545,14 +6393,12 @@ "type": "github", "url": "https://github.com/sponsors/csstools" } - ], - "license": "MIT-0" + ] }, "node_modules/cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", - "license": "MIT", "bin": { "cssesc": "bin/cssesc" }, @@ -6564,7 +6410,6 @@ "version": "6.1.2", "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-6.1.2.tgz", "integrity": "sha512-rYk5UeX7VAM/u0lNqewCdasdtPK81CgX8wJFLEIXHbV2oldWRgJAsZrdhRXkV1NJzA2g850KiFm9mMU2HxNxMA==", - "license": "MIT", "dependencies": { "cssnano-preset-default": "^6.1.2", "lilconfig": "^3.1.1" @@ -6584,7 +6429,6 @@ "version": "6.1.2", "resolved": "https://registry.npmjs.org/cssnano-preset-advanced/-/cssnano-preset-advanced-6.1.2.tgz", "integrity": "sha512-Nhao7eD8ph2DoHolEzQs5CfRpiEP0xa1HBdnFZ82kvqdmbwVBUr2r1QuQ4t1pi+D1ZpqpcO4T+wy/7RxzJ/WPQ==", - "license": "MIT", "dependencies": { "autoprefixer": "^10.4.19", "browserslist": "^4.23.0", @@ -6605,7 +6449,6 @@ "version": "6.1.2", "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-6.1.2.tgz", "integrity": "sha512-1C0C+eNaeN8OcHQa193aRgYexyJtU8XwbdieEjClw+J9d94E41LwT6ivKH0WT+fYwYWB0Zp3I3IZ7tI/BbUbrg==", - "license": "MIT", "dependencies": { "browserslist": "^4.23.0", "css-declaration-sorter": "^7.2.0", @@ -6649,7 +6492,6 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-4.0.2.tgz", "integrity": "sha512-ZR1jHg+wZ8o4c3zqf1SIUSTIvm/9mU343FMR6Obe/unskbvpGhZOo1J6d/r8D1pzkRQYuwbcH3hToOuoA2G7oQ==", - "license": "MIT", "engines": { "node": "^14 || ^16 || >=18.0" }, @@ -6766,7 +6608,6 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -6796,7 +6637,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -6822,7 +6662,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "license": "MIT", "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", @@ -7593,7 +7432,6 @@ "version": "4.2.2", "resolved": "https://registry.npmjs.org/feed/-/feed-4.2.2.tgz", "integrity": "sha512-u5/sxGfiMfZNtJ3OvQpXcvotFpYkL0n9u9mM2vkui2nGo8b4wvDkJ8gAkYqbA8QpGyFCv3RK0Z+Iv+9veCS9bQ==", - "license": "MIT", "dependencies": { "xml-js": "^1.6.11" }, @@ -7605,7 +7443,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "license": "MIT", "dependencies": { "escape-string-regexp": "^1.0.5" }, @@ -7620,7 +7457,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "license": "MIT", "engines": { "node": ">=0.8.0" } @@ -7737,7 +7573,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-4.0.0.tgz", "integrity": "sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg==", - "license": "MIT", "dependencies": { "common-path-prefix": "^3.0.0", "pkg-dir": "^7.0.0" @@ -7753,7 +7588,6 @@ "version": "6.3.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", - "license": "MIT", "dependencies": { "locate-path": "^7.1.0", "path-exists": "^5.0.0" @@ -7823,7 +7657,6 @@ "version": "4.3.7", "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", "integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==", - "license": "MIT", "engines": { "node": "*" }, @@ -8163,7 +7996,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "license": "MIT", "dependencies": { "es-define-property": "^1.0.0" }, @@ -8502,7 +8334,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-7.2.0.tgz", "integrity": "sha512-tXgn3QfqPIpGl9o+K5tpcj3/MN4SfLtsx2GWwBC3SSd0tXQGyF3gsSqad8loJgKZGM3ZxbYDd5yhiBIdWpmvLA==", - "license": "MIT", "dependencies": { "camel-case": "^4.1.2", "clean-css": "~5.3.2", @@ -8523,7 +8354,6 @@ "version": "10.0.1", "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "license": "MIT", "engines": { "node": ">=14" } @@ -8623,7 +8453,6 @@ "url": "https://github.com/sponsors/fb55" } ], - "license": "MIT", "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.3", @@ -8753,7 +8582,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", - "license": "ISC", "engines": { "node": "^10 || ^12 || >= 14" }, @@ -8827,7 +8655,6 @@ "version": "0.2.0-alpha.45", "resolved": "https://registry.npmjs.org/infima/-/infima-0.2.0-alpha.45.tgz", "integrity": "sha512-uyH0zfr1erU1OohLk0fT4Rrb94AOhguWNOcD9uGrSpRvNB+6gZXUoJX5J0NtvzBO10YZ9PgvA4NFgt+fYg8ojw==", - "license": "MIT", "engines": { "node": ">=12" } @@ -9165,7 +8992,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", - "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", @@ -9182,7 +9008,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", - "license": "MIT", "dependencies": { "@types/node": "*", "jest-util": "^29.7.0", @@ -9197,7 +9022,6 @@ "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -9357,7 +9181,6 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", - "license": "MIT", "engines": { "node": ">=14" }, @@ -9395,7 +9218,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", - "license": "MIT", "dependencies": { "p-locate": "^6.0.0" }, @@ -9419,14 +9241,12 @@ "node_modules/lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", - "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", - "license": "MIT" + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==" }, "node_modules/lodash.uniq": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", - "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==", - "license": "MIT" + "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==" }, "node_modules/longest-streak": { "version": "3.1.0", @@ -11727,7 +11547,6 @@ "version": "2.9.2", "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.9.2.tgz", "integrity": "sha512-GJuACcS//jtq4kCtd5ii/M0SZf7OZRH+BxdqXZHaJfb8TJiVl+NgQRPwiYt2EuqeSkNydn/7vP+bcE27C5mb9w==", - "license": "MIT", "dependencies": { "schema-utils": "^4.0.0", "tapable": "^2.2.1" @@ -11797,9 +11616,9 @@ } }, "node_modules/nanoid": { - "version": "3.3.8", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", - "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", "funding": [ { "type": "github", @@ -11879,7 +11698,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==", - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -11911,8 +11729,7 @@ "node_modules/nprogress": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/nprogress/-/nprogress-0.2.0.tgz", - "integrity": "sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==", - "license": "MIT" + "integrity": "sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==" }, "node_modules/nth-check": { "version": "2.1.1", @@ -11929,7 +11746,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/null-loader/-/null-loader-4.0.1.tgz", "integrity": "sha512-pxqVbi4U6N26lq+LmgIbB5XATP0VdZKOG25DhHi8btMmJJefGArFyDg1yc4U3hWCJbMqSrw0qyrz1UQX+qYXqg==", - "license": "MIT", "dependencies": { "loader-utils": "^2.0.0", "schema-utils": "^3.0.0" @@ -11949,7 +11765,6 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -11965,7 +11780,6 @@ "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "license": "MIT", "peerDependencies": { "ajv": "^6.9.1" } @@ -11973,14 +11787,12 @@ "node_modules/null-loader/node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "license": "MIT" + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, "node_modules/null-loader/node_modules/schema-utils": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", - "license": "MIT", "dependencies": { "@types/json-schema": "^7.0.8", "ajv": "^6.12.5", @@ -12018,7 +11830,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "license": "MIT", "engines": { "node": ">= 0.4" } @@ -12027,7 +11838,6 @@ "version": "4.1.7", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", - "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", @@ -12141,7 +11951,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", - "license": "MIT", "dependencies": { "yocto-queue": "^1.0.0" }, @@ -12156,7 +11965,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", - "license": "MIT", "dependencies": { "p-limit": "^4.0.0" }, @@ -12306,8 +12114,7 @@ "node_modules/parse-numeric-range": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/parse-numeric-range/-/parse-numeric-range-1.3.0.tgz", - "integrity": "sha512-twN+njEipszzlMJd4ONUYgSfZPDxgHhT9Ahed5uTigpQn90FggW4SA/AIPq/6a149fTbE9qBEcSwE3FAEp6wQQ==", - "license": "ISC" + "integrity": "sha512-twN+njEipszzlMJd4ONUYgSfZPDxgHhT9Ahed5uTigpQn90FggW4SA/AIPq/6a149fTbE9qBEcSwE3FAEp6wQQ==" }, "node_modules/parse5": { "version": "7.1.2", @@ -12324,7 +12131,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz", "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==", - "license": "MIT", "dependencies": { "domhandler": "^5.0.3", "parse5": "^7.0.0" @@ -12356,7 +12162,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } @@ -12435,7 +12240,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-7.0.0.tgz", "integrity": "sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA==", - "license": "MIT", "dependencies": { "find-up": "^6.3.0" }, @@ -12447,9 +12251,9 @@ } }, "node_modules/postcss": { - "version": "8.4.39", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.39.tgz", - "integrity": "sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==", + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", "funding": [ { "type": "opencollective", @@ -12465,9 +12269,9 @@ } ], "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.0.1", - "source-map-js": "^1.2.0" + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" }, "engines": { "node": "^10 || ^12 || >=14" @@ -12487,7 +12291,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT", "dependencies": { "postcss-selector-parser": "^7.0.0" }, @@ -12502,7 +12305,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "license": "MIT", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -12515,7 +12317,6 @@ "version": "9.0.1", "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-9.0.1.tgz", "integrity": "sha512-TipgjGyzP5QzEhsOZUaIkeO5mKeMFpebWzRogWG/ysonUlnHcq5aJe0jOjpfzUU8PeSaBQnrE8ehR0QA5vs8PQ==", - "license": "MIT", "dependencies": { "postcss-selector-parser": "^6.0.11", "postcss-value-parser": "^4.2.0" @@ -12531,7 +12332,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/postcss-clamp/-/postcss-clamp-4.1.0.tgz", "integrity": "sha512-ry4b1Llo/9zz+PKC+030KUnPITTJAHeOwjfAyyB60eT0AorGLdzp52s31OsPRHRf8NchkgFoG2y6fCfn1IV1Ow==", - "license": "MIT", "dependencies": { "postcss-value-parser": "^4.2.0" }, @@ -12556,7 +12356,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/css-color-parser": "^3.0.10", "@csstools/css-parser-algorithms": "^3.0.5", @@ -12585,7 +12384,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT", "dependencies": { "@csstools/utilities": "^2.0.0", "postcss-value-parser": "^4.2.0" @@ -12611,7 +12409,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/utilities": "^2.0.0", "postcss-value-parser": "^4.2.0" @@ -12627,7 +12424,6 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-6.1.0.tgz", "integrity": "sha512-x9yX7DOxeMAR+BgGVnNSAxmAj98NX/YxEMNFP+SDCEeNLb2r3i6Hh1ksMsnW8Ub5SLCpbescQqn9YEbE9554Sw==", - "license": "MIT", "dependencies": { "browserslist": "^4.23.0", "caniuse-api": "^3.0.0", @@ -12645,7 +12441,6 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-6.1.0.tgz", "integrity": "sha512-zx8IwP/ts9WvUM6NkVSkiU902QZL1bwPhaVaLynPtCsOTqp+ZKbNi+s6XJg3rfqpKGA/oc7Oxk5t8pOQJcwl/w==", - "license": "MIT", "dependencies": { "browserslist": "^4.23.0", "postcss-value-parser": "^4.2.0" @@ -12671,7 +12466,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT", "dependencies": { "@csstools/cascade-layer-name-parser": "^2.0.5", "@csstools/css-parser-algorithms": "^3.0.5", @@ -12686,9 +12480,9 @@ } }, "node_modules/postcss-custom-properties": { - "version": "14.0.5", - "resolved": "https://registry.npmjs.org/postcss-custom-properties/-/postcss-custom-properties-14.0.5.tgz", - "integrity": "sha512-UWf/vhMapZatv+zOuqlfLmYXeOhhHLh8U8HAKGI2VJ00xLRYoAJh4xv8iX6FB6+TLXeDnm0DBLMi00E0hodbQw==", + "version": "14.0.6", + "resolved": "https://registry.npmjs.org/postcss-custom-properties/-/postcss-custom-properties-14.0.6.tgz", + "integrity": "sha512-fTYSp3xuk4BUeVhxCSJdIPhDLpJfNakZKoiTDx7yRGCdlZrSJR7mWKVOBS4sBF+5poPQFMj2YdXx1VHItBGihQ==", "funding": [ { "type": "github", @@ -12699,7 +12493,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT", "dependencies": { "@csstools/cascade-layer-name-parser": "^2.0.5", "@csstools/css-parser-algorithms": "^3.0.5", @@ -12728,7 +12521,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT", "dependencies": { "@csstools/cascade-layer-name-parser": "^2.0.5", "@csstools/css-parser-algorithms": "^3.0.5", @@ -12746,7 +12538,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "license": "MIT", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -12769,7 +12560,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "postcss-selector-parser": "^7.0.0" }, @@ -12784,7 +12574,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "license": "MIT", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -12797,7 +12586,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-6.0.2.tgz", "integrity": "sha512-65w/uIqhSBBfQmYnG92FO1mWZjJ4GL5b8atm5Yw2UgrwD7HiNiSSNwJor1eCFGzUgYnN/iIknhNRVqjrrpuglw==", - "license": "MIT", "engines": { "node": "^14 || ^16 || >=18.0" }, @@ -12809,7 +12597,6 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-6.0.3.tgz", "integrity": "sha512-+JA0DCvc5XvFAxwx6f/e68gQu/7Z9ud584VLmcgto28eB8FqSFZwtrLwB5Kcp70eIoWP/HXqz4wpo8rD8gpsTw==", - "license": "MIT", "engines": { "node": "^14 || ^16 || >=18.0" }, @@ -12821,7 +12608,6 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-6.0.3.tgz", "integrity": "sha512-znyno9cHKQsK6PtxL5D19Fj9uwSzC2mB74cpT66fhgOadEUPyXFkbgwm5tvc3bt3NAy8ltE5MrghxovZRVnOjQ==", - "license": "MIT", "engines": { "node": "^14 || ^16 || >=18.0" }, @@ -12833,7 +12619,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-6.0.2.tgz", "integrity": "sha512-j87xzI4LUggC5zND7KdjsI25APtyMuynXZSujByMaav2roV6OZX+8AaCUcZSWqckZpjAjRyFDdpqybgjFO0HJQ==", - "license": "MIT", "engines": { "node": "^14 || ^16 || >=18.0" }, @@ -12845,7 +12630,6 @@ "version": "6.0.5", "resolved": "https://registry.npmjs.org/postcss-discard-unused/-/postcss-discard-unused-6.0.5.tgz", "integrity": "sha512-wHalBlRHkaNnNwfC8z+ppX57VhvS+HWgjW508esjdaEYr3Mx7Gnn2xA4R/CKf5+Z9S5qsqC+Uzh4ueENWwCVUA==", - "license": "MIT", "dependencies": { "postcss-selector-parser": "^6.0.16" }, @@ -12870,7 +12654,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/postcss-progressive-custom-properties": "^4.1.0", "@csstools/utilities": "^2.0.0", @@ -12897,7 +12680,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "postcss-selector-parser": "^7.0.0" }, @@ -12912,7 +12694,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "license": "MIT", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -12935,7 +12716,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "postcss-selector-parser": "^7.0.0" }, @@ -12950,7 +12730,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "license": "MIT", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -12963,7 +12742,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/postcss-font-variant/-/postcss-font-variant-5.0.0.tgz", "integrity": "sha512-1fmkBaCALD72CK2a9i468mA/+tr9/1cBxRRMXOUaZqO43oWPR5imcyPjXwuv7PXbCid4ndlP5zWhidQVVa3hmA==", - "license": "MIT", "peerDependencies": { "postcss": "^8.1.0" } @@ -12982,7 +12760,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "engines": { "node": ">=18" }, @@ -13004,7 +12781,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/utilities": "^2.0.0", "postcss-value-parser": "^4.2.0" @@ -13030,7 +12806,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "@csstools/css-color-parser": "^3.0.10", "@csstools/css-parser-algorithms": "^3.0.5", @@ -13049,7 +12824,6 @@ "version": "7.3.4", "resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-7.3.4.tgz", "integrity": "sha512-iW5WTTBSC5BfsBJ9daFMPVrLT36MrNiC6fqOZTTaHjBNX6Pfd5p+hSBqe/fEeNd7pc13QiAyGt7VdGMw4eRC4A==", - "license": "MIT", "dependencies": { "cosmiconfig": "^8.3.5", "jiti": "^1.20.0", @@ -13081,7 +12855,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "postcss-value-parser": "^4.2.0" }, @@ -13096,7 +12869,6 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/postcss-merge-idents/-/postcss-merge-idents-6.0.3.tgz", "integrity": "sha512-1oIoAsODUs6IHQZkLQGO15uGEbK3EAl5wi9SS8hs45VgsxQfMnxvt+L+zIr7ifZFIH14cfAeVe2uCTa+SPRa3g==", - "license": "MIT", "dependencies": { "cssnano-utils": "^4.0.2", "postcss-value-parser": "^4.2.0" @@ -13112,7 +12884,6 @@ "version": "6.0.5", "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-6.0.5.tgz", "integrity": "sha512-5LOiordeTfi64QhICp07nzzuTDjNSO8g5Ksdibt44d+uvIIAE1oZdRn8y/W5ZtYgRH/lnLDlvi9F8btZcVzu3w==", - "license": "MIT", "dependencies": { "postcss-value-parser": "^4.2.0", "stylehacks": "^6.1.1" @@ -13128,7 +12899,6 @@ "version": "6.1.1", "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-6.1.1.tgz", "integrity": "sha512-KOdWF0gju31AQPZiD+2Ar9Qjowz1LTChSjFFbS+e2sFgc4uHOp3ZvVX4sNeTlk0w2O31ecFGgrFzhO0RSWbWwQ==", - "license": "MIT", "dependencies": { "browserslist": "^4.23.0", "caniuse-api": "^3.0.0", @@ -13146,7 +12916,6 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-6.1.0.tgz", "integrity": "sha512-gklfI/n+9rTh8nYaSJXlCo3nOKqMNkxuGpTn/Qm0gstL3ywTr9/WRKznE+oy6fvfolH6dF+QM4nCo8yPLdvGJg==", - "license": "MIT", "dependencies": { "postcss-value-parser": "^4.2.0" }, @@ -13161,7 +12930,6 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-6.0.3.tgz", "integrity": "sha512-4KXAHrYlzF0Rr7uc4VrfwDJ2ajrtNEpNEuLxFgwkhFZ56/7gaE4Nr49nLsQDZyUe+ds+kEhf+YAUolJiYXF8+Q==", - "license": "MIT", "dependencies": { "colord": "^2.9.3", "cssnano-utils": "^4.0.2", @@ -13178,7 +12946,6 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-6.1.0.tgz", "integrity": "sha512-bmSKnDtyyE8ujHQK0RQJDIKhQ20Jq1LYiez54WiaOoBtcSuflfK3Nm596LvbtlFcpipMjgClQGyGr7GAs+H1uA==", - "license": "MIT", "dependencies": { "browserslist": "^4.23.0", "cssnano-utils": "^4.0.2", @@ -13195,7 +12962,6 @@ "version": "6.0.4", "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-6.0.4.tgz", "integrity": "sha512-L8dZSwNLgK7pjTto9PzWRoMbnLq5vsZSTu8+j1P/2GB8qdtGQfn+K1uSvFgYvgh83cbyxT5m43ZZhUMTJDSClQ==", - "license": "MIT", "dependencies": { "postcss-selector-parser": "^6.0.16" }, @@ -13210,7 +12976,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.1.0.tgz", "integrity": "sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==", - "license": "ISC", "engines": { "node": "^10 || ^12 || >= 14" }, @@ -13222,7 +12987,6 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.2.0.tgz", "integrity": "sha512-5kcJm/zk+GJDSfw+V/42fJ5fhjL5YbFDl8nVdXkJPLLW+Vf9mTD5Xe0wqIaDnLuL2U6cDNpTr+UQ+v2HWIBhzw==", - "license": "MIT", "dependencies": { "icss-utils": "^5.0.0", "postcss-selector-parser": "^7.0.0", @@ -13239,7 +13003,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "license": "MIT", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -13252,7 +13015,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.2.1.tgz", "integrity": "sha512-m9jZstCVaqGjTAuny8MdgE88scJnCiQSlSrOWcTQgM2t32UBe+MUmFSO5t7VMSfAf/FJKImAxBav8ooCHJXCJA==", - "license": "ISC", "dependencies": { "postcss-selector-parser": "^7.0.0" }, @@ -13267,7 +13029,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "license": "MIT", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -13280,7 +13041,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz", "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==", - "license": "ISC", "dependencies": { "icss-utils": "^5.0.0" }, @@ -13292,9 +13052,9 @@ } }, "node_modules/postcss-nesting": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/postcss-nesting/-/postcss-nesting-13.0.1.tgz", - "integrity": "sha512-VbqqHkOBOt4Uu3G8Dm8n6lU5+9cJFxiuty9+4rcoyRPO9zZS1JIs6td49VIoix3qYqELHlJIn46Oih9SAKo+yQ==", + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/postcss-nesting/-/postcss-nesting-13.0.2.tgz", + "integrity": "sha512-1YCI290TX+VP0U/K/aFxzHzQWHWURL+CtHMSbex1lCdpXD1SoR2sYuxDu5aNI9lPoXpKTCggFZiDJbwylU0LEQ==", "funding": [ { "type": "github", @@ -13305,9 +13065,8 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { - "@csstools/selector-resolve-nested": "^3.0.0", + "@csstools/selector-resolve-nested": "^3.1.0", "@csstools/selector-specificity": "^5.0.0", "postcss-selector-parser": "^7.0.0" }, @@ -13319,9 +13078,9 @@ } }, "node_modules/postcss-nesting/node_modules/@csstools/selector-resolve-nested": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@csstools/selector-resolve-nested/-/selector-resolve-nested-3.0.0.tgz", - "integrity": "sha512-ZoK24Yku6VJU1gS79a5PFmC8yn3wIapiKmPgun0hZgEI5AOqgH2kiPRsPz1qkGv4HL+wuDLH83yQyk6inMYrJQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@csstools/selector-resolve-nested/-/selector-resolve-nested-3.1.0.tgz", + "integrity": "sha512-mf1LEW0tJLKfWyvn5KdDrhpxHyuxpbNwTIwOYLIvsTffeyOf85j5oIzfG0yosxDgx/sswlqBnESYUcQH0vgZ0g==", "funding": [ { "type": "github", @@ -13332,7 +13091,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "engines": { "node": ">=18" }, @@ -13354,7 +13112,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "engines": { "node": ">=18" }, @@ -13366,7 +13123,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "license": "MIT", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -13379,7 +13135,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-6.0.2.tgz", "integrity": "sha512-a8N9czmdnrjPHa3DeFlwqst5eaL5W8jYu3EBbTTkI5FHkfMhFZh1EGbku6jhHhIzTA6tquI2P42NtZ59M/H/kQ==", - "license": "MIT", "engines": { "node": "^14 || ^16 || >=18.0" }, @@ -13391,7 +13146,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-6.0.2.tgz", "integrity": "sha512-8H04Mxsb82ON/aAkPeq8kcBbAtI5Q2a64X/mnRRfPXBq7XeogoQvReqxEfc0B4WPq1KimjezNC8flUtC3Qz6jg==", - "license": "MIT", "dependencies": { "postcss-value-parser": "^4.2.0" }, @@ -13406,7 +13160,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-6.0.2.tgz", "integrity": "sha512-/JFzI441OAB9O7VnLA+RtSNZvQ0NCFZDOtp6QPFo1iIyawyXg0YI3CYM9HBy1WvwCRHnPep/BvI1+dGPKoXx/Q==", - "license": "MIT", "dependencies": { "postcss-value-parser": "^4.2.0" }, @@ -13421,7 +13174,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-6.0.2.tgz", "integrity": "sha512-YdCgsfHkJ2jEXwR4RR3Tm/iOxSfdRt7jplS6XRh9Js9PyCR/aka/FCb6TuHT2U8gQubbm/mPmF6L7FY9d79VwQ==", - "license": "MIT", "dependencies": { "postcss-value-parser": "^4.2.0" }, @@ -13436,7 +13188,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-6.0.2.tgz", "integrity": "sha512-vQZIivlxlfqqMp4L9PZsFE4YUkWniziKjQWUtsxUiVsSSPelQydwS8Wwcuw0+83ZjPWNTl02oxlIvXsmmG+CiQ==", - "license": "MIT", "dependencies": { "postcss-value-parser": "^4.2.0" }, @@ -13451,7 +13202,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-6.0.2.tgz", "integrity": "sha512-a+YrtMox4TBtId/AEwbA03VcJgtyW4dGBizPl7e88cTFULYsprgHWTbfyjSLyHeBcK/Q9JhXkt2ZXiwaVHoMzA==", - "license": "MIT", "dependencies": { "postcss-value-parser": "^4.2.0" }, @@ -13466,7 +13216,6 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-6.1.0.tgz", "integrity": "sha512-QVC5TQHsVj33otj8/JD869Ndr5Xcc/+fwRh4HAsFsAeygQQXm+0PySrKbr/8tkDKzW+EVT3QkqZMfFrGiossDg==", - "license": "MIT", "dependencies": { "browserslist": "^4.23.0", "postcss-value-parser": "^4.2.0" @@ -13482,7 +13231,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-6.0.2.tgz", "integrity": "sha512-kVNcWhCeKAzZ8B4pv/DnrU1wNh458zBNp8dh4y5hhxih5RZQ12QWMuQrDgPRw3LRl8mN9vOVfHl7uhvHYMoXsQ==", - "license": "MIT", "dependencies": { "postcss-value-parser": "^4.2.0" }, @@ -13497,7 +13245,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-6.0.2.tgz", "integrity": "sha512-sXZ2Nj1icbJOKmdjXVT9pnyHQKiSAyuNQHSgRCUgThn2388Y9cGVDR+E9J9iAYbSbLHI+UUwLVl1Wzco/zgv0Q==", - "license": "MIT", "dependencies": { "postcss-value-parser": "^4.2.0" }, @@ -13522,7 +13269,6 @@ "url": "https://liberapay.com/mrcgrtz" } ], - "license": "MIT", "engines": { "node": ">=18" }, @@ -13534,7 +13280,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-6.0.2.tgz", "integrity": "sha512-VRZSOB+JU32RsEAQrO94QPkClGPKJEL/Z9PCBImXMhIeK5KAYo6slP/hBYlLgrCjFxyqvn5VC81tycFEDBLG1Q==", - "license": "MIT", "dependencies": { "cssnano-utils": "^4.0.2", "postcss-value-parser": "^4.2.0" @@ -13560,7 +13305,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "postcss-value-parser": "^4.2.0" }, @@ -13575,7 +13319,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/postcss-page-break/-/postcss-page-break-3.0.4.tgz", "integrity": "sha512-1JGu8oCjVXLa9q9rFTo4MbeeA5FMe00/9C7lN4va606Rdb+HkxXtXsmEDrIraQ11fGz/WvKWa8gMuCKkrXpTsQ==", - "license": "MIT", "peerDependencies": { "postcss": "^8" } @@ -13594,7 +13337,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "postcss-value-parser": "^4.2.0" }, @@ -13606,9 +13348,9 @@ } }, "node_modules/postcss-preset-env": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/postcss-preset-env/-/postcss-preset-env-10.2.0.tgz", - "integrity": "sha512-cl13sPBbSqo1Q7Ryb19oT5NZO5IHFolRbIMdgDq4f9w1MHYiL6uZS7uSsjXJ1KzRIcX5BMjEeyxmAevVXENa3Q==", + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/postcss-preset-env/-/postcss-preset-env-10.2.4.tgz", + "integrity": "sha512-q+lXgqmTMdB0Ty+EQ31SuodhdfZetUlwCA/F0zRcd/XdxjzI+Rl2JhZNz5US2n/7t9ePsvuhCnEN4Bmu86zXlA==", "funding": [ { "type": "github", @@ -13619,9 +13361,8 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { - "@csstools/postcss-cascade-layers": "^5.0.1", + "@csstools/postcss-cascade-layers": "^5.0.2", "@csstools/postcss-color-function": "^4.0.10", "@csstools/postcss-color-mix-function": "^3.0.10", "@csstools/postcss-color-mix-variadic-function-arguments": "^1.0.0", @@ -13633,7 +13374,7 @@ "@csstools/postcss-hwb-function": "^4.0.10", "@csstools/postcss-ic-unit": "^4.0.2", "@csstools/postcss-initial": "^2.0.1", - "@csstools/postcss-is-pseudo-class": "^5.0.1", + "@csstools/postcss-is-pseudo-class": "^5.0.3", "@csstools/postcss-light-dark-function": "^2.0.9", "@csstools/postcss-logical-float-and-clear": "^3.0.0", "@csstools/postcss-logical-overflow": "^2.0.0", @@ -13655,7 +13396,7 @@ "@csstools/postcss-trigonometric-functions": "^4.0.9", "@csstools/postcss-unset-value": "^4.0.0", "autoprefixer": "^10.4.21", - "browserslist": "^4.24.5", + "browserslist": "^4.25.0", "css-blank-pseudo": "^7.0.1", "css-has-pseudo": "^7.0.2", "css-prefers-color-scheme": "^10.0.0", @@ -13666,7 +13407,7 @@ "postcss-color-hex-alpha": "^10.0.0", "postcss-color-rebeccapurple": "^10.0.0", "postcss-custom-media": "^11.0.6", - "postcss-custom-properties": "^14.0.5", + "postcss-custom-properties": "^14.0.6", "postcss-custom-selectors": "^8.0.5", "postcss-dir-pseudo-class": "^9.0.1", "postcss-double-position-gradients": "^6.0.2", @@ -13677,7 +13418,7 @@ "postcss-image-set-function": "^7.0.0", "postcss-lab-function": "^7.0.10", "postcss-logical": "^8.1.0", - "postcss-nesting": "^13.0.1", + "postcss-nesting": "^13.0.2", "postcss-opacity-percentage": "^3.0.0", "postcss-overflow-shorthand": "^6.0.0", "postcss-page-break": "^3.0.4", @@ -13707,7 +13448,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT-0", "dependencies": { "postcss-selector-parser": "^7.0.0" }, @@ -13722,7 +13462,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "license": "MIT", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -13735,7 +13474,6 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/postcss-reduce-idents/-/postcss-reduce-idents-6.0.3.tgz", "integrity": "sha512-G3yCqZDpsNPoQgbDUy3T0E6hqOQ5xigUtBQyrmq3tn2GxlyiL0yyl7H+T8ulQR6kOcHJ9t7/9H4/R2tv8tJbMA==", - "license": "MIT", "dependencies": { "postcss-value-parser": "^4.2.0" }, @@ -13750,7 +13488,6 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-6.1.0.tgz", "integrity": "sha512-RarLgBK/CrL1qZags04oKbVbrrVK2wcxhvta3GCxrZO4zveibqbRPmm2VI8sSgCXwoUHEliRSbOfpR0b/VIoiw==", - "license": "MIT", "dependencies": { "browserslist": "^4.23.0", "caniuse-api": "^3.0.0" @@ -13766,7 +13503,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-6.0.2.tgz", "integrity": "sha512-sB+Ya++3Xj1WaT9+5LOOdirAxP7dJZms3GRcYheSPi1PiTMigsxHAdkrbItHxwYHr4kt1zL7mmcHstgMYT+aiA==", - "license": "MIT", "dependencies": { "postcss-value-parser": "^4.2.0" }, @@ -13781,7 +13517,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/postcss-replace-overflow-wrap/-/postcss-replace-overflow-wrap-4.0.0.tgz", "integrity": "sha512-KmF7SBPphT4gPPcKZc7aDkweHiKEEO8cla/GjcBK+ckKxiZslIu3C4GCRW3DNfL0o7yW7kMQu9xlZ1kXRXLXtw==", - "license": "MIT", "peerDependencies": { "postcss": "^8.0.3" } @@ -13800,7 +13535,6 @@ "url": "https://opencollective.com/csstools" } ], - "license": "MIT", "dependencies": { "postcss-selector-parser": "^7.0.0" }, @@ -13815,7 +13549,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "license": "MIT", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -13828,7 +13561,6 @@ "version": "6.1.2", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", - "license": "MIT", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -13841,7 +13573,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/postcss-sort-media-queries/-/postcss-sort-media-queries-5.2.0.tgz", "integrity": "sha512-AZ5fDMLD8SldlAYlvi8NIqo0+Z8xnXU2ia0jxmuhxAU+Lqt9K+AlmLNJ/zWEnE9x+Zx3qL3+1K20ATgNOr3fAA==", - "license": "MIT", "dependencies": { "sort-css-media-queries": "2.2.0" }, @@ -13856,7 +13587,6 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-6.0.3.tgz", "integrity": "sha512-dlrahRmxP22bX6iKEjOM+c8/1p+81asjKT+V5lrgOH944ryx/OHpclnIbGsKVd3uWOXFLYJwCVf0eEkJGvO96g==", - "license": "MIT", "dependencies": { "postcss-value-parser": "^4.2.0", "svgo": "^3.2.0" @@ -13872,7 +13602,6 @@ "version": "6.0.4", "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-6.0.4.tgz", "integrity": "sha512-K38OCaIrO8+PzpArzkLKB42dSARtC2tmG6PvD4b1o1Q2E9Os8jzfWFfSy/rixsHwohtsDdFtAWGjFVFUdwYaMg==", - "license": "MIT", "dependencies": { "postcss-selector-parser": "^6.0.16" }, @@ -13886,14 +13615,12 @@ "node_modules/postcss-value-parser": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", - "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", - "license": "MIT" + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" }, "node_modules/postcss-zindex": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/postcss-zindex/-/postcss-zindex-6.0.2.tgz", "integrity": "sha512-5BxW9l1evPB/4ZIc+2GobEBoKC+h8gPGCMi+jxsYvd2x0mjq7wazk6DrP71pStqxE9Foxh5TVnonbWpFZzXaYg==", - "license": "MIT", "engines": { "node": "^14 || ^16 || >=18.0" }, @@ -13915,7 +13642,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/pretty-time/-/pretty-time-1.1.0.tgz", "integrity": "sha512-28iF6xPQrP8Oa6uxE6a1biz+lWeTOAPKggvjB8HAs6nVMKZwf5bG++632Dx614hIWgUPkgivRfG+a8uAXGTIbA==", - "license": "MIT", "engines": { "node": ">=4" } @@ -13936,7 +13662,6 @@ "version": "1.30.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz", "integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==", - "license": "MIT", "engines": { "node": ">=6" } @@ -14186,7 +13911,6 @@ "version": "2.4.1", "resolved": "https://registry.npmjs.org/react-json-view-lite/-/react-json-view-lite-2.4.1.tgz", "integrity": "sha512-fwFYknRIBxjbFm0kBDrzgBy1xa5tDg2LyXXBepC5f1b+MY3BUClMCsvanMPn089JbV1Eg3nZcrp0VCuH43aXnA==", - "license": "MIT", "engines": { "node": ">=18" }, @@ -14638,7 +14362,6 @@ "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", - "license": "MIT", "engines": { "node": ">=0.10" } @@ -14754,7 +14477,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/rtlcss/-/rtlcss-4.3.0.tgz", "integrity": "sha512-FI+pHEn7Wc4NqKXMXFM+VAYKEj/mRIcW4h24YVwVtyjI+EqGrLc2Hx/Ny0lrZ21cBWU2goLy36eqMcNj3AQJig==", - "license": "MIT", "dependencies": { "escalade": "^3.1.1", "picocolors": "^1.0.0", @@ -14818,8 +14540,7 @@ "node_modules/sax": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", - "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==", - "license": "ISC" + "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==" }, "node_modules/scheduler": { "version": "0.26.0", @@ -14830,8 +14551,7 @@ "node_modules/schema-dts": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/schema-dts/-/schema-dts-1.1.5.tgz", - "integrity": "sha512-RJr9EaCmsLzBX2NDiO5Z3ux2BVosNZN5jo0gWgsyKvxKIUL5R3swNvoorulAeL9kLB0iTSX7V6aokhla2m7xbg==", - "license": "Apache-2.0" + "integrity": "sha512-RJr9EaCmsLzBX2NDiO5Z3ux2BVosNZN5jo0gWgsyKvxKIUL5R3swNvoorulAeL9kLB0iTSX7V6aokhla2m7xbg==" }, "node_modules/schema-utils": { "version": "4.3.0", @@ -14856,7 +14576,6 @@ "version": "2.17.3", "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.17.3.tgz", "integrity": "sha512-RQPdCYTa8A68uM2jwxoY842xDhvx3E5LFL1LxvxCNMev4o5mLuokczhzjAgGwUZBAmOKZknArSxLKmXtIi2AxQ==", - "license": "MIT", "peer": true }, "node_modules/section-matter": { @@ -15106,7 +14825,6 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -15276,7 +14994,6 @@ "version": "7.1.2", "resolved": "https://registry.npmjs.org/sitemap/-/sitemap-7.1.2.tgz", "integrity": "sha512-ARCqzHJ0p4gWt+j7NlU5eDlIO9+Rkr/JhPFZKKQ1l5GCus7rJH4UdrlVAh0xC/gDS/Qir2UMxqYNHtsKr2rpCw==", - "license": "MIT", "dependencies": { "@types/node": "^17.0.5", "@types/sax": "^1.2.1", @@ -15294,8 +15011,7 @@ "node_modules/sitemap/node_modules/@types/node": { "version": "17.0.45", "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", - "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==", - "license": "MIT" + "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==" }, "node_modules/skin-tone": { "version": "2.0.0", @@ -15321,7 +15037,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", - "license": "MIT", "dependencies": { "dot-case": "^3.0.4", "tslib": "^2.0.3" @@ -15342,7 +15057,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/sort-css-media-queries/-/sort-css-media-queries-2.2.0.tgz", "integrity": "sha512-0xtkGhWCC9MGt/EzgnvbbbKhqWjl1+/rncmhTh5qCpbYguXh6S/qwePfv/JQ8jePXXmqingylxoC49pCkSPIbA==", - "license": "MIT", "engines": { "node": ">= 6.3.0" } @@ -15356,9 +15070,9 @@ } }, "node_modules/source-map-js": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", - "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "engines": { "node": ">=0.10.0" } @@ -15428,7 +15142,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/srcset/-/srcset-4.0.0.tgz", "integrity": "sha512-wvLeHgcVHKO8Sc/H/5lkGreJQVeYMm9rlmt8PuR1xE31rIuXhuzznUUqAt8MqLhB3MqJdFzlNAfpcWnxiFUcPw==", - "license": "MIT", "engines": { "node": ">=12" }, @@ -15448,8 +15161,7 @@ "node_modules/std-env": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.9.0.tgz", - "integrity": "sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==", - "license": "MIT" + "integrity": "sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==" }, "node_modules/string_decoder": { "version": "1.3.0", @@ -15564,7 +15276,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "license": "MIT", "engines": { "node": ">=8" }, @@ -15584,7 +15295,6 @@ "version": "6.1.1", "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-6.1.1.tgz", "integrity": "sha512-gSTTEQ670cJNoaeIp9KX6lZmm8LJ3jPB5yJmX8Zq/wQxOsAFXV3qjWzHas3YYk1qesuVIyYWWUpZ0vSE/dTSGg==", - "license": "MIT", "dependencies": { "browserslist": "^4.23.0", "postcss-selector-parser": "^6.0.16" @@ -15621,8 +15331,7 @@ "node_modules/svg-parser": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/svg-parser/-/svg-parser-2.0.4.tgz", - "integrity": "sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==", - "license": "MIT" + "integrity": "sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==" }, "node_modules/svgo": { "version": "3.3.2", @@ -16762,7 +16471,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/webpackbar/-/webpackbar-6.0.1.tgz", "integrity": "sha512-TnErZpmuKdwWBdMoexjio3KKX6ZtoKHRVvLIU0A47R0VVBDtx3ZyOJDktgYixhoJokZTYTt1Z37OkO9pnGJa9Q==", - "license": "MIT", "dependencies": { "ansi-escapes": "^4.3.2", "chalk": "^4.1.2", @@ -16783,14 +16491,12 @@ "node_modules/webpackbar/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "license": "MIT" + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/webpackbar/node_modules/markdown-table": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz", "integrity": "sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A==", - "license": "MIT", "dependencies": { "repeat-string": "^1.0.0" }, @@ -16803,7 +16509,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -16817,7 +16522,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -16998,7 +16702,6 @@ "version": "1.6.11", "resolved": "https://registry.npmjs.org/xml-js/-/xml-js-1.6.11.tgz", "integrity": "sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g==", - "license": "MIT", "dependencies": { "sax": "^1.2.4" }, @@ -17015,7 +16718,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.1.tgz", "integrity": "sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg==", - "license": "MIT", "engines": { "node": ">=12.20" }, diff --git a/docs/package.json b/docs/package.json index 2bb440711..def8214d8 100644 --- a/docs/package.json +++ b/docs/package.json @@ -14,9 +14,9 @@ "write-heading-ids": "docusaurus write-heading-ids" }, "dependencies": { - "@docusaurus/core": "3.8.0", - "@docusaurus/plugin-client-redirects": "^3.8.0", - "@docusaurus/preset-classic": "3.8.0", + "@docusaurus/core": "3.8.1", + "@docusaurus/plugin-client-redirects": "^3.8.1", + "@docusaurus/preset-classic": "3.8.1", "@mdx-js/react": "^3.1.0", "clsx": "^2.0.0", "docusaurus-theme-github-codeblock": "^2.0.2", @@ -25,8 +25,8 @@ "react-dom": "^19.1.0" }, "devDependencies": { - "@docusaurus/module-type-aliases": "3.8.0", - "@docusaurus/types": "3.8.0" + "@docusaurus/module-type-aliases": "3.8.1", + "@docusaurus/types": "3.8.1" }, "browserslist": { "production": [ From 50b424e8e644606646e1800e28d68301b7c1b703 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Jul 2025 00:26:36 +0000 Subject: [PATCH 626/719] chore(deps): bump flake8 from 7.2.0 to 7.3.0 (#1326) --- requirements/tools.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/tools.txt b/requirements/tools.txt index 0e6090497..41c427cf7 100644 --- a/requirements/tools.txt +++ b/requirements/tools.txt @@ -1,3 +1,3 @@ mypy==1.16.0 -flake8==7.2.0 +flake8==7.3.0 black==24.8.0 # Until we drop Python 3.6 support, we have to stay with this version From c75897e7b18c44e53455258836f0408fcfe9c1ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Jul 2025 00:30:46 +0000 Subject: [PATCH 627/719] chore(deps): bump mypy from 1.16.0 to 1.16.1 (#1327) --- requirements/tools.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/tools.txt b/requirements/tools.txt index 41c427cf7..0603319d7 100644 --- a/requirements/tools.txt +++ b/requirements/tools.txt @@ -1,3 +1,3 @@ -mypy==1.16.0 +mypy==1.16.1 flake8==7.3.0 black==24.8.0 # Until we drop Python 3.6 support, we have to stay with this version From 347cb5e0e4f32a26fa8d19268557bf6cd2a42052 Mon Sep 17 00:00:00 2001 From: ewanek1 Date: Wed, 2 Jul 2025 09:53:15 -0700 Subject: [PATCH 628/719] Remove py36 references (#1330) --- .github/maintainers_guide.md | 1 - README.md | 2 +- pyproject.toml | 3 +-- scripts/install_all_and_run_tests.sh | 7 +------ slack_bolt/async_app.py | 2 +- 5 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/maintainers_guide.md b/.github/maintainers_guide.md index 85b4e13be..4ab491789 100644 --- a/.github/maintainers_guide.md +++ b/.github/maintainers_guide.md @@ -25,7 +25,6 @@ $ pyenv local 3.8.5 $ pyenv versions system - 3.6.10 3.7.7 * 3.8.5 (set by /path-to-bolt-python/.python-version) diff --git a/README.md b/README.md index 7576597d5..862c63e96 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ A Python framework to build Slack apps in a flash with the latest platform featu ## Setup ```bash -# Python 3.6+ required +# Python 3.7+ required python -m venv .venv source .venv/bin/activate diff --git a/pyproject.toml b/pyproject.toml index 5ce2c62bc..5337b5c55 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,6 @@ dynamic = ["version", "readme", "dependencies", "authors"] description = "The Bolt Framework for Python" license = { text = "MIT" } classifiers = [ - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", @@ -20,7 +19,7 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ] -requires-python = ">=3.6" +requires-python = ">=3.7" [project.urls] diff --git a/scripts/install_all_and_run_tests.sh b/scripts/install_all_and_run_tests.sh index 21660dca5..e71c8511b 100755 --- a/scripts/install_all_and_run_tests.sh +++ b/scripts/install_all_and_run_tests.sh @@ -16,12 +16,7 @@ pip uninstall python-lambda test_target="$1" python_version=`python --version | awk '{print $2}'` -if [ ${python_version:0:3} == "3.6" ] -then - pip install -U -r requirements.txt -else - pip install -e . -fi +pip install -e . if [[ $test_target != "" ]] then diff --git a/slack_bolt/async_app.py b/slack_bolt/async_app.py index 10878c51b..fdf724d4c 100644 --- a/slack_bolt/async_app.py +++ b/slack_bolt/async_app.py @@ -5,7 +5,7 @@ If you'd prefer to build your app with [asyncio](https://docs.python.org/3/library/asyncio.html), you can import the [AIOHTTP](https://docs.aiohttp.org/en/stable/) library and call the `AsyncApp` constructor. Within async apps, you can use the async/await pattern. ```bash -# Python 3.6+ required +# Python 3.7+ required python -m venv .venv source .venv/bin/activate From 46e25d3e1f02a9a50bc1b214f3772957473d70a5 Mon Sep 17 00:00:00 2001 From: ewanek1 Date: Wed, 2 Jul 2025 12:16:29 -0700 Subject: [PATCH 629/719] Remove py36 references (#1331) --- .github/maintainers_guide.md | 1 + README.md | 2 +- pyproject.toml | 3 ++- scripts/install_all_and_run_tests.sh | 7 ++++++- slack_bolt/async_app.py | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/maintainers_guide.md b/.github/maintainers_guide.md index 4ab491789..85b4e13be 100644 --- a/.github/maintainers_guide.md +++ b/.github/maintainers_guide.md @@ -25,6 +25,7 @@ $ pyenv local 3.8.5 $ pyenv versions system + 3.6.10 3.7.7 * 3.8.5 (set by /path-to-bolt-python/.python-version) diff --git a/README.md b/README.md index 862c63e96..7576597d5 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ A Python framework to build Slack apps in a flash with the latest platform featu ## Setup ```bash -# Python 3.7+ required +# Python 3.6+ required python -m venv .venv source .venv/bin/activate diff --git a/pyproject.toml b/pyproject.toml index 5337b5c55..5ce2c62bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,7 @@ dynamic = ["version", "readme", "dependencies", "authors"] description = "The Bolt Framework for Python" license = { text = "MIT" } classifiers = [ + "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", @@ -19,7 +20,7 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ] -requires-python = ">=3.7" +requires-python = ">=3.6" [project.urls] diff --git a/scripts/install_all_and_run_tests.sh b/scripts/install_all_and_run_tests.sh index e71c8511b..21660dca5 100755 --- a/scripts/install_all_and_run_tests.sh +++ b/scripts/install_all_and_run_tests.sh @@ -16,7 +16,12 @@ pip uninstall python-lambda test_target="$1" python_version=`python --version | awk '{print $2}'` -pip install -e . +if [ ${python_version:0:3} == "3.6" ] +then + pip install -U -r requirements.txt +else + pip install -e . +fi if [[ $test_target != "" ]] then diff --git a/slack_bolt/async_app.py b/slack_bolt/async_app.py index fdf724d4c..10878c51b 100644 --- a/slack_bolt/async_app.py +++ b/slack_bolt/async_app.py @@ -5,7 +5,7 @@ If you'd prefer to build your app with [asyncio](https://docs.python.org/3/library/asyncio.html), you can import the [AIOHTTP](https://docs.aiohttp.org/en/stable/) library and call the `AsyncApp` constructor. Within async apps, you can use the async/await pattern. ```bash -# Python 3.7+ required +# Python 3.6+ required python -m venv .venv source .venv/bin/activate From 1e69f1d0c9a68c9967864f52e50544c19b2b1d3b Mon Sep 17 00:00:00 2001 From: Luke Russell <31357343+lukegalbraithrussell@users.noreply.github.com> Date: Fri, 11 Jul 2025 10:05:33 -0700 Subject: [PATCH 630/719] Docs: Updates Modals tutorial to not use Glitch (#1334) --- docs/content/tutorial/modals.md | 166 +++++++++++++++++++------------- 1 file changed, 100 insertions(+), 66 deletions(-) diff --git a/docs/content/tutorial/modals.md b/docs/content/tutorial/modals.md index 678d3783b..b6d672d08 100644 --- a/docs/content/tutorial/modals.md +++ b/docs/content/tutorial/modals.md @@ -1,101 +1,135 @@ + # Modals -If you're learning about Slack apps, modals, or slash commands for the first time, you've come to the right place! In this tutorial, we'll take a look at setting up your very own server using Glitch, and using that server to run your Slack app. +If you're learning about Slack apps, modals, or slash commands for the first time, you've come to the right place! In this tutorial, we'll take a look at setting up your very own server using GitHub Codespaces, then using that server to run your Slack app built with the [**Bolt for Python framework**](https://github.com/SlackAPI/bolt-python). -Let's take a look at the technologies we'll use in this tutorial: +:::info[GitHub Codespaces] +GitHub Codespaces is an online IDE that allows you to work on code and host your own server at the same time. While Codespaces is good for testing and development purposes, it should not be used in production. -* Glitch is a online IDE that allows you to collaboratively work on code and host your own server. Glitch should only be used for development purposes and should not be used in production. -* We'll use Python in conjunction with our [Bolt for Python](https://github.com/SlackAPI/bolt-python) SDK. -* [Block Kit](https://docs.slack.dev/block-kit/) is a UI framework for Slack apps that allows you to create beautiful, interactive messages within Slack. If you've ever seen a message in Slack with buttons or a select menu, that's Block Kit. -* Modals are similar to a pop-up window that displays right in Slack. They grab the attention of the user, and are normally used to prompt users to provide some kind of information or input. +::: ---- +At the end of this tutorial, your final app will look like this: -## Final product overview {#final_product} -If you follow through with the extra credit tasks, your final app will look like this: +![announce](https://github.com/user-attachments/assets/0bf1c2f0-4b22-4c9c-98b3-b21e9bcc14a8) -![Final product](/img/tutorials/modals/final_product.gif) +And will make use of these Slack concepts: +* [**Block Kit**](https://docs.slack.dev/block-kit/) is a UI framework for Slack apps that allows you to create beautiful, interactive messages within Slack. If you've ever seen a message in Slack with buttons or a select menu, that's Block Kit. +* [**Modals**](https://docs.slack.dev/surfaces/modals) are a pop-up window that displays right in Slack. They grab the attention of the user, and are normally used to prompt users to provide some kind of information or input in a form. +* [**Slash Commands**](https://docs.slack.dev/interactivity/implementing-slash-commands) allow you to invoke your app within Slack by just typing into the message composer box. e.g. `/remind`, `/topic`. ---- +If you're familiar with using Heroku you can also deploy directly to Heroku with the following button. -## The process {#steps} +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://www.heroku.com/deploy?template=https://github.com/wongjas/modal-example) -1. [Create a new app](https://api.slack.com/apps/new) and name it whatever you like. +--- + +## Setting up your app within App Settings {#setting-up-app-settings} -2. [Remix (or clone)](https://glitch.com/edit/#!/remix/intro-to-modals-bolt) the Glitch template. +You'll need to create an app and configure it properly within App Settings before using it. -Here's a copy of what the modal payload looks like — this is what powers the modal. +1. [Create a new app](https://api.slack.com/apps/new), click `From a Manifest`, and choose the workspace that you want to develop on. Then copy the following JSON object; it describes the metadata about your app, like its name, its bot display name and permissions it will request. ```json { - "type": "modal", - "callback_id": "gratitude-modal", - "title": { - "type": "plain_text", - "text": "Gratitude Box", - "emoji": true - }, - "submit": { - "type": "plain_text", - "text": "Submit", - "emoji": true - }, - "close": { - "type": "plain_text", - "text": "Cancel", - "emoji": true - }, - "blocks": [ - { - "type": "input", - "block_id": "my_block", - "element": { - "type": "plain_text_input", - "action_id": "my_action" - }, - "label": { - "type": "plain_text", - "text": "Say something nice!", - "emoji": true - } + "display_information": { + "name": "Intro to Modals" + }, + "features": { + "bot_user": { + "display_name": "Intro to Modals", + "always_online": false + }, + "slash_commands": [ + { + "command": "/announce", + "description": "Makes an announcement", + "should_escape": false + } + ] + }, + "oauth_config": { + "scopes": { + "bot": [ + "chat:write", + "commands" + ] + } + }, + "settings": { + "interactivity": { + "is_enabled": true + }, + "org_deploy_enabled": false, + "socket_mode_enabled": true, + "token_rotation_enabled": false } - ] } ``` -3. Find the base path to your server by clicking **Share**, then copy the Live site link. +2. Once your app has been created, scroll down to `App-Level Tokens` and create a token that requests for the [`connections:write`](https://docs.slack.dev/reference/scopes/connections.write) scope, which allows you to use [Socket Mode](https://docs.slack.dev/apis/events-api/using-socket-mode), a secure way to develop on Slack through the use of WebSockets. Copy the value of your app token and keep it for safe-keeping. + +3. Install your app by heading to `Install App` in the left sidebar. Hit `Allow`, which means you're agreeing to install your app with the permissions that it is requesting. Be sure to copy the token that you receive, and keep it somewhere secret and safe. - ![Get the base link](/img/tutorials/modals/base_link.gif) +## Starting your Codespaces server {#starting-server} -4. On your app page, navigate to **Interactivity & Shortcuts**. Append "/slack/events" to your base path URL and enter it into the **Request URL** e.g., `https://festive-harmonious-march.glitch.me/slack/events`. This allows your server to retrieve information from the modal. You can see the code for this within the Glitch project. +1. Log into GitHub and head to this [repository](https://github.com/wongjas/modal-example). - ![Interactivity URL](/img/tutorials/modals/interactivity_url.png) +2. Click the green `Code` button and hit the `Codespaces` tab and then `Create codespace on main`. This will bring up a code editor within your browser so you can start coding. -5. Create the slash command so you can access it within Slack. Navigate to the **Slash Commands** section and create a new command. Note the **Request URL** is the same link as above, e.g. `https://festive-harmonious-march.glitch.me/slack/events` . The code that powers the slash command and opens a modal can be found within the Glitch project. +## Understanding the project files {#understanding-files} - ![Slash command details](/img/tutorials/modals/slash_command.png) +Within the project you'll find a `manifest.json` file. This is a a configuration file used by Slack apps. With a manifest, you can create an app with a pre-defined configuration, or adjust the configuration of an existing app. -6. Select **Install App**. After you've done this, you'll see a **Bot User OAuth Access Token**, copy this. +The `simple_modal_example.py` Python script contains the code that powers your app. If you're going to tinker with the app itself, take a look at the comments found within the `simple_modal_example.py` file! -7. Navigate to your Glitch project and click the `.env` file where the credentials are stored, and paste your bot token where the `SLACK_BOT_TOKEN` variable is shown. This allows your server to send authenticated requests to the Slack API. You'll also need to head to your app's settings page under **Basic Information** and copy the _Signing secret_ to place into the `SLACK_SIGNING_SECRET` variable. +The `requirements.txt` file contains the Python package dependencies needed to run this app. - ![Environment variables](/img/tutorials/modals/heart_icon.gif) +:::info[This repo contains optional Heroku-specific configurations] -8. Test by heading to Slack and typing `/thankyou`. +The `app.json` file defines your Heroku app configuration including environment variables and deployment settings, to allow your app to deploy with one click. `Procfile` is a Heroku-specific file that tells Heroku what command to run when starting your app — in this case a Python script would run as a `worker` process. If you aren't deploying to Heroku, you can ignore both these files. -All done! 🎉 You've created your first slash command using Block Kit and modals! The world is your oyster; you can create more complex modals by playing around with [Block Kit Builder](https://app.slack.com/block-kit-builder). +::: + +## Adding tokens {#adding-tokens} + +1. Open a terminal up within the browser's editor. + +2. Grab the app and bot tokens that you kept safe. We're going to set them as environment variables. + +```bash +export SLACK_APP_TOKEN= +export SLACK_BOT_TOKEN= +``` -### Extra credit {#extra_credit} +## Running the app {#running-app} + +1. Activate a virtual environment for your Python packages to be installed. + +```bash +# Setup your python virtual environment +python3 -m venv .venv +source .venv/bin/activate +``` + +2. Install the dependencies from the `requirements.txt` file. + + +```bash +# Install the dependencies +pip install -r requirements.txt +``` + +3. Start your app using the `python3 simple_modal_example.py` command. + +```bash +# Start your local server +python3 simple_modal_example.py +``` -For a little extra credit, let's post the feedback we received in a channel. +4. Now that your app is running, you should be able to see it within Slack. Test this by heading to Slack and typing `/announce`. -1. Add the `chat:write` bot scope, which allows your bot to post messages within Slack. You can do this in the **OAuth & Permissions** section for your Slack app. -2. Reinstall your app to apply the scope. -3. Create a channel and name it `#thanks`. Get its ID by right clicking the channel name, copying the link, and copying the last part starting with the letter `C`. For example, if your channel link looks like this: https://my.slack.com/archives/C123FCN2MLM, the ID is `C123FCN2MLM`. -4. Add your bot to the channel by typing the command `/invite @your_bots_name`. -5. Uncomment the `Extra Credit` code within your Glitch project and make sure to replace `your_channel_id` with the ID above. -6. Test it out by typing `/thankyou`, and watching all the feedback come into your channel! +All done! 🎉 You've created your first slash command using Block Kit and modals! The world is your oyster; play around with [Block Kit Builder](https://app.slack.com/block-kit-builder) and create more complex modals and place them in your code to see what happens! ## Next steps {#next-steps} -If you want to learn more about Bolt for Python, refer to the [Getting Started guide](/bolt-python/getting-started). +If you want to learn more about Bolt for Python, refer to the [Getting Started guide](https://tools.slack.dev/bolt-python/getting-started). \ No newline at end of file From e6b34ebba6c5f43d72e006190e9072a7af5b3ada Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Jul 2025 21:05:45 -0400 Subject: [PATCH 631/719] chore(deps): bump on-headers and compression in /docs (#1336) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/package-lock.json b/docs/package-lock.json index 6790558aa..773665646 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -5828,16 +5828,16 @@ } }, "node_modules/compression": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.8.0.tgz", - "integrity": "sha512-k6WLKfunuqCYD3t6AsuPGvQWaKwuLLh2/xHNcX4qE+vIfDNXpSqnrhwA7O53R7WVQUnt8dVAIW+YHr7xTgOgGA==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.8.1.tgz", + "integrity": "sha512-9mAqGPHLakhCLeNyxPkK4xVo746zQ/czLH1Ky+vkitMnWfWZps8r0qXuwhwizagCRttsL4lfG4pIOvaWLpAP0w==", "license": "MIT", "dependencies": { "bytes": "3.1.2", "compressible": "~2.0.18", "debug": "2.6.9", "negotiator": "~0.6.4", - "on-headers": "~1.0.2", + "on-headers": "~1.1.0", "safe-buffer": "5.2.1", "vary": "~1.1.2" }, @@ -11872,9 +11872,9 @@ } }, "node_modules/on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.1.0.tgz", + "integrity": "sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==", "license": "MIT", "engines": { "node": ">= 0.8" From 88ddc7cbe1cf23b45dd4349a357f60d9bfcaa1a6 Mon Sep 17 00:00:00 2001 From: Haley Elmendorf <31392893+haleychaas@users.noreply.github.com> Date: Mon, 21 Jul 2025 13:43:07 -0500 Subject: [PATCH 632/719] Docs: Update language around AI Apps (#1335) --- docs/content/concepts/ai-apps.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/content/concepts/ai-apps.md b/docs/content/concepts/ai-apps.md index d30513bdd..a8da2bf1f 100644 --- a/docs/content/concepts/ai-apps.md +++ b/docs/content/concepts/ai-apps.md @@ -1,5 +1,5 @@ --- -title: AI Apps +title: Using AI in Apps lang: en slug: /concepts/ai-apps --- @@ -8,7 +8,7 @@ slug: /concepts/ai-apps If you don't have a paid workspace for development, you can join the [Developer Program](https://api.slack.com/developer-program) and provision a sandbox with access to all Slack features for free. ::: -AI apps comprise a new messaging experience for Slack. If you're unfamiliar with using AI apps within Slack, you'll want to read the [API documentation on the subject](https://docs.slack.dev/ai/). Then come back here to implement them with Bolt! +The Agents & AI Apps feature comprises a unique messaging experience for Slack. If you're unfamiliar with using the Agents & AI Apps feature within Slack, you'll want to read the [API documentation on the subject](https://docs.slack.dev/ai/). Then come back here to implement them with Bolt! ## Configuring your app to support AI features {#configuring-your-app} @@ -25,12 +25,12 @@ AI apps comprise a new messaging experience for Slack. If you're unfamiliar with * [`message.im`](https://docs.slack.dev/reference/events/message.im) :::info -You _could_ implement your own AI app by [listening](event-listening) for the `assistant_thread_started`, `assistant_thread_context_changed`, and `message.im` events (see implementation details below). That being said, using the `Assistant` class will streamline the process. And we already wrote this nice guide for you! +You _could_ go it alone and [listen](event-listening) for the `assistant_thread_started`, `assistant_thread_context_changed`, and `message.im` events (see implementation details below) in order to implement the AI features in your app. That being said, using the `Assistant` class will streamline the process. And we already wrote this nice guide for you! ::: ## The `Assistant` class instance {#assistant-class} -The `Assistant` class can be used to handle the incoming events expected from a user interacting with an AI app in Slack. A typical flow would look like: +The `Assistant` class can be used to handle the incoming events expected from a user interacting with an app in Slack that has the Agents & AI Apps feature enabled. A typical flow would look like: 1. [The user starts a thread](#handling-a-new-thread). The `Assistant` class handles the incoming [`assistant_thread_started`](https://docs.slack.dev/reference/events/assistant_thread_started) event. 2. [The thread context may change at any point](#handling-thread-context-changes). The `Assistant` class can handle any incoming [`assistant_thread_context_changed`](https://docs.slack.dev/reference/events/assistant_thread_context_changed) events. The class also provides a default context store to keep track of thread context changes as the user moves through Slack. @@ -107,13 +107,13 @@ Refer to the [module document](https://tools.slack.dev/bolt-python/api-docs/slac ## Handling a new thread {#handling-a-new-thread} -When the user opens a new thread with your AI app, the [`assistant_thread_started`](https://docs.slack.dev/reference/events/assistant_thread_started) event will be sent to your app. +When the user opens a new thread with your AI-enabled app, the [`assistant_thread_started`](https://docs.slack.dev/reference/events/assistant_thread_started) event will be sent to your app. :::tip -When a user opens an AI app thread while in a channel, the channel info is stored as the thread's `AssistantThreadContext` data. You can grab that info by using the `get_thread_context` utility, as subsequent user message event payloads won't include the channel info. +When a user opens an app thread while in a channel, the channel info is stored as the thread's `AssistantThreadContext` data. You can grab that info by using the `get_thread_context` utility, as subsequent user message event payloads won't include the channel info. ::: -### Block Kit interactions in the AI app thread {#block-kit-interactions} +### Block Kit interactions in the app thread {#block-kit-interactions} For advanced use cases, Block Kit buttons may be used instead of suggested prompts, as well as the sending of messages with structured [metadata](https://docs.slack.dev/messaging/message-metadata/) to trigger subsequent interactions with the user. From beba392234ca149a8f3b2cd65141619a09aeea3d Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Thu, 24 Jul 2025 19:49:22 -0700 Subject: [PATCH 633/719] docs: filter against bot_id in listener middleware example (#1339) --- docs/content/concepts/listener-middleware.md | 11 +++++------ .../current/concepts/listener-middleware.md | 13 ++++++------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/docs/content/concepts/listener-middleware.md b/docs/content/concepts/listener-middleware.md index 338cb0d4f..3507d7d97 100644 --- a/docs/content/concepts/listener-middleware.md +++ b/docs/content/concepts/listener-middleware.md @@ -11,11 +11,10 @@ If your listener middleware is a quite simple one, you can use a listener matche Refer to [the module document](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) to learn the available listener arguments. ```python -# Listener middleware which filters out messages with "bot_message" subtype +# Listener middleware which filters out messages from a bot def no_bot_messages(message, next): - subtype = message.get("subtype") - if subtype != "bot_message": - next() + if "bot_id" not in message: + next() # This listener only receives messages from humans @app.event(event="message", middleware=[no_bot_messages]) @@ -24,10 +23,10 @@ def log_message(logger, event): # Listener matchers: simplified version of listener middleware def no_bot_messages(message) -> bool: - return message.get("subtype") != "bot_message" + return "bot_id" not in message @app.event( - event="message", + event="message", matchers=[no_bot_messages] # or matchers=[lambda message: message.get("subtype") != "bot_message"] ) diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/listener-middleware.md b/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/listener-middleware.md index 822b5ac63..a013dde42 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/listener-middleware.md +++ b/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/listener-middleware.md @@ -11,11 +11,10 @@ slug: /concepts/listener-middleware 指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python -# "bot_message" サブタイプのメッセージを抽出するリスナーミドルウェア +# ボットからのメッセージをフィルタリングするリスナーミドルウェア def no_bot_messages(message, next): - subtype = message.get("subtype") - if subtype != "bot_message": - next() + if "bot_id" not in message: + next() # このリスナーは人間によって送信されたメッセージのみを受け取ります @app.event(event="message", middleware=[no_bot_messages]) @@ -24,13 +23,13 @@ def log_message(logger, event): # リスナーマッチャー: 簡略化されたバージョンのリスナーミドルウェア def no_bot_messages(message) -> bool: - return message.get("subtype") != "bot_message" + return "bot_id" not in message @app.event( - event="message", + event="message", matchers=[no_bot_messages] # or matchers=[lambda message: message.get("subtype") != "bot_message"] ) def log_message(logger, event): logger.info(f"(MSG) User: {event['user']}\nMessage: {event['text']}") -``` \ No newline at end of file +``` From df3c426093dd3349ba05dae49820e3709117b25b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 16:53:42 -0400 Subject: [PATCH 634/719] chore(deps): update pytest requirement from <8.4,>=6.2.5 to >=6.2.5,<8.5 (#1328) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: William Bergamin --- requirements/testing_without_asyncio.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/testing_without_asyncio.txt b/requirements/testing_without_asyncio.txt index 754889faf..d10c4345e 100644 --- a/requirements/testing_without_asyncio.txt +++ b/requirements/testing_without_asyncio.txt @@ -1,3 +1,3 @@ # pip install -r requirements/testing_without_asyncio.txt -pytest>=6.2.5,<8.4 # https://github.com/tornadoweb/tornado/issues/3375 +pytest>=6.2.5,<8.5 # https://github.com/tornadoweb/tornado/issues/3375 pytest-cov>=3,<7 From 1b876abb16b1cd9f0a6bf8ab8decaaa7a179e85c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 15:42:14 -0700 Subject: [PATCH 635/719] chore(deps): bump mypy from 1.16.1 to 1.17.1 (#1343) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/tools.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/tools.txt b/requirements/tools.txt index 0603319d7..c3a383a13 100644 --- a/requirements/tools.txt +++ b/requirements/tools.txt @@ -1,3 +1,3 @@ -mypy==1.16.1 +mypy==1.17.1 flake8==7.3.0 black==24.8.0 # Until we drop Python 3.6 support, we have to stay with this version From dd4d622e8a407567dfbd22b0b36a741b51c574fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 22:47:10 +0000 Subject: [PATCH 636/719] chore(deps): bump the react group in /docs with 2 updates (#1344) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/package-lock.json | 18 +++++++++--------- docs/package.json | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/package-lock.json b/docs/package-lock.json index 773665646..ec7f3558a 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -15,8 +15,8 @@ "clsx": "^2.0.0", "docusaurus-theme-github-codeblock": "^2.0.2", "prism-react-renderer": "^2.4.1", - "react": "^19.1.0", - "react-dom": "^19.1.0" + "react": "^19.1.1", + "react-dom": "^19.1.1" }, "devDependencies": { "@docusaurus/module-type-aliases": "3.8.1", @@ -13858,24 +13858,24 @@ } }, "node_modules/react": { - "version": "19.1.0", - "resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz", - "integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==", + "version": "19.1.1", + "resolved": "https://registry.npmjs.org/react/-/react-19.1.1.tgz", + "integrity": "sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ==", "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/react-dom": { - "version": "19.1.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.0.tgz", - "integrity": "sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==", + "version": "19.1.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.1.tgz", + "integrity": "sha512-Dlq/5LAZgF0Gaz6yiqZCf6VCcZs1ghAJyrsu84Q/GT0gV+mCxbfmKNoGRKBYMJ8IEdGPqu49YWXD02GCknEDkw==", "license": "MIT", "dependencies": { "scheduler": "^0.26.0" }, "peerDependencies": { - "react": "^19.1.0" + "react": "^19.1.1" } }, "node_modules/react-fast-compare": { diff --git a/docs/package.json b/docs/package.json index def8214d8..b67d8a7a4 100644 --- a/docs/package.json +++ b/docs/package.json @@ -21,8 +21,8 @@ "clsx": "^2.0.0", "docusaurus-theme-github-codeblock": "^2.0.2", "prism-react-renderer": "^2.4.1", - "react": "^19.1.0", - "react-dom": "^19.1.0" + "react": "^19.1.1", + "react-dom": "^19.1.1" }, "devDependencies": { "@docusaurus/module-type-aliases": "3.8.1", From 9596797e55f56c92a07868595f002eb2751f0739 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 23:45:47 +0000 Subject: [PATCH 637/719] chore(deps): bump slackapi/slack-github-action from 2.1.0 to 2.1.1 (#1345) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4fe757b1a..f53a603ff 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -89,7 +89,7 @@ jobs: if: failure() && github.ref == 'refs/heads/main' && github.event_name != 'workflow_dispatch' steps: - name: Send notifications of failing tests - uses: slackapi/slack-github-action@b0fa283ad8fea605de13dc3f449259339835fc52 # v2.1.0 + uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1 with: errors: true webhook: ${{ secrets.SLACK_REGRESSION_FAILURES_WEBHOOK_URL }} From eb3a51923a38fda54f89515dd9e3853014ffaf64 Mon Sep 17 00:00:00 2001 From: Luke Russell <31357343+lukegalbraithrussell@users.noreply.github.com> Date: Thu, 7 Aug 2025 12:04:46 -0700 Subject: [PATCH 638/719] Build: remove docusaurus configuration files (#1342) --- .github/workflows/docs-deploy.yml | 65 - README.md | 6 +- docs/.gitignore | 3 - docs/README.md | 129 - docs/babel.config.js | 3 - docs/content/concepts/custom-steps.md | 154 - docs/content/concepts/web-api.md | 28 - docs/docusaurus.config.js | 114 - docs/english/_sidebar.json | 209 + docs/{content => english}/building-an-app.md | 49 +- .../concepts/acknowledge.md | 14 +- docs/{content => english}/concepts/actions.md | 14 +- .../{content => english}/concepts/adapters.md | 6 +- docs/{content => english}/concepts/ai-apps.md | 62 +- .../{content => english}/concepts/app-home.md | 14 +- docs/{content => english}/concepts/async.md | 6 +- .../concepts/authenticating-oauth.md | 12 +- .../concepts/authorization.md | 8 +- .../{content => english}/concepts/commands.md | 10 +- docs/{content => english}/concepts/context.md | 6 +- .../concepts/custom-adapters.md | 8 +- .../concepts/custom-steps-dynamic-options.md | 32 +- .../concepts/custom-steps.md | 16 +- docs/{content => english}/concepts/errors.md | 6 +- .../concepts/event-listening.md | 12 +- .../concepts/global-middleware.md | 8 +- .../concepts/lazy-listeners.md | 6 +- .../concepts/listener-middleware.md | 8 +- docs/{content => english}/concepts/logging.md | 6 +- .../concepts/message-listening.md | 13 +- .../concepts/message-sending.md | 12 +- .../concepts/opening-modals.md | 12 +- .../concepts/select-menu-options.md | 14 +- .../concepts/shortcuts.md | 18 +- .../concepts/socket-mode.md | 10 +- .../concepts/token-rotation.md | 10 +- .../concepts/updating-pushing-views.md | 14 +- .../concepts/view-submissions.md | 16 +- docs/english/concepts/web-api.md | 22 + docs/{content => english}/getting-started.md | 39 +- docs/{content => english}/index.md | 2 +- .../legacy}/steps-from-apps.md | 38 +- .../tutorial}/ai-chatbot/1.png | Bin .../tutorial}/ai-chatbot/2.png | Bin .../tutorial}/ai-chatbot/3.png | Bin .../tutorial}/ai-chatbot/4.png | Bin .../tutorial}/ai-chatbot/5.png | Bin .../tutorial}/ai-chatbot/6.png | Bin .../tutorial}/ai-chatbot/7.png | Bin .../tutorial}/ai-chatbot/8.png | Bin .../tutorial/ai-chatbot}/ai-chatbot.md | 26 +- .../tutorial/custom-steps-for-jira}/1.png | Bin .../tutorial/custom-steps-for-jira}/2.png | Bin .../tutorial/custom-steps-for-jira}/3.png | Bin .../tutorial/custom-steps-for-jira}/4.png | Bin .../tutorial/custom-steps-for-jira}/5.png | Bin .../tutorial/custom-steps-for-jira}/6.png | Bin .../tutorial/custom-steps-for-jira}/7.png | Bin .../custom-steps-for-jira.md | 24 +- .../add-step.png | Bin .../app-message.png | Bin .../custom-steps-workflow-builder-existing.md | 26 +- .../define-step.png | Bin .../find-step.png | Bin .../inputs.png | Bin .../org-ready.png | Bin .../outputs.png | Bin .../step-inputs.png | Bin .../app-token.png | Bin .../bot-token.png | Bin .../custom-steps-workflow-builder-new.md | 49 +- .../install.png | Bin .../manifest.png | Bin .../wfb-1.png | Bin .../wfb-10.png | Bin .../wfb-11.png | Bin .../wfb-12.png | Bin .../wfb-2.png | Bin .../wfb-3.png | Bin .../wfb-4.png | Bin .../wfb-5.png | Bin .../wfb-6.png | Bin .../wfb-7.png | Bin .../wfb-8.png | Bin .../wfb-9.png | Bin .../workflow-step.png | Bin .../tutorial/custom-steps.md | 12 +- .../tutorial}/modals/base_link.gif | Bin .../tutorial}/modals/final_product.gif | Bin .../tutorial}/modals/heart_icon.gif | Bin .../tutorial}/modals/interactivity_url.png | Bin .../tutorial/modals}/modals.md | 11 +- .../tutorial}/modals/slash_command.png | Bin docs/footerConfig.js | 21 - docs/i18n/ja-jp/README.md | 121 - docs/i18n/ja-jp/code.json | 321 - .../current.json | 78 - .../current/concepts/app-home.md | 43 - .../current/concepts/web-api.md | 23 - .../docusaurus-theme-classic/footer.json | 6 - .../docusaurus-theme-classic/navbar.json | 62 - .../boltpy => img}/basic-information-page.png | Bin docs/{static/img/boltpy => img}/bot-token.png | Bin .../concepts/acknowledge.md | 12 +- .../current => japanese}/concepts/actions.md | 14 +- .../current => japanese}/concepts/adapters.md | 6 +- docs/japanese/concepts/app-home.md | 40 + .../concepts/assistant.md | 16 +- .../current => japanese}/concepts/async.md | 6 +- .../concepts/authenticating-oauth.md | 12 +- .../concepts/authorization.md | 8 +- .../current => japanese}/concepts/commands.md | 10 +- .../current => japanese}/concepts/context.md | 6 +- .../concepts/custom-adapters.md | 8 +- .../current => japanese}/concepts/errors.md | 6 +- .../concepts/event-listening.md | 12 +- .../concepts/global-middleware.md | 9 +- .../concepts/lazy-listeners.md | 6 +- .../concepts/listener-middleware.md | 8 +- .../current => japanese}/concepts/logging.md | 6 +- .../concepts/message-listening.md | 10 +- .../concepts/message-sending.md | 12 +- .../concepts/opening-modals.md | 12 +- .../concepts/select-menu-options.md | 14 +- .../concepts/shortcuts.md | 18 +- .../concepts/socket-mode.md | 10 +- .../concepts/token-rotation.md | 10 +- .../concepts/updating-pushing-views.md | 14 +- .../concepts/view-submissions.md | 16 +- docs/japanese/concepts/web-api.md | 19 + .../current => japanese}/getting-started.md | 62 +- .../legacy/steps-from-apps.md | 30 +- docs/navbarConfig.js | 97 - docs/package-lock.json | 16738 ---------------- docs/package.json | 46 - .../adapter/aiohttp/index.html | 0 .../adapter/asgi/aiohttp/index.html | 0 .../adapter/asgi/async_handler.html | 0 .../adapter/asgi/base_handler.html | 0 .../adapter/asgi/builtin/index.html | 0 .../adapter/asgi/http_request.html | 0 .../adapter/asgi/http_response.html | 0 .../adapter/asgi/index.html | 0 .../adapter/asgi/utils.html | 0 .../adapter/aws_lambda/chalice_handler.html | 0 .../chalice_lazy_listener_runner.html | 0 .../adapter/aws_lambda/handler.html | 0 .../adapter/aws_lambda/index.html | 0 .../adapter/aws_lambda/internals.html | 0 .../aws_lambda/lambda_s3_oauth_flow.html | 0 .../aws_lambda/lazy_listener_runner.html | 0 .../aws_lambda/local_lambda_client.html | 0 .../adapter/bottle/handler.html | 0 .../adapter/bottle/index.html | 0 .../adapter/cherrypy/handler.html | 0 .../adapter/cherrypy/index.html | 0 .../adapter/django/handler.html | 0 .../adapter/django/index.html | 0 .../adapter/falcon/async_resource.html | 0 .../adapter/falcon/index.html | 0 .../adapter/falcon/resource.html | 0 .../adapter/fastapi/async_handler.html | 0 .../adapter/fastapi/index.html | 0 .../adapter/flask/handler.html | 0 .../adapter/flask/index.html | 0 .../google_cloud_functions/handler.html | 0 .../adapter/google_cloud_functions/index.html | 0 .../adapter/index.html | 0 .../adapter/pyramid/handler.html | 0 .../adapter/pyramid/index.html | 0 .../adapter/sanic/async_handler.html | 0 .../adapter/sanic/index.html | 0 .../adapter/socket_mode/aiohttp/index.html | 0 .../socket_mode/async_base_handler.html | 0 .../adapter/socket_mode/async_handler.html | 0 .../adapter/socket_mode/async_internals.html | 0 .../adapter/socket_mode/base_handler.html | 0 .../adapter/socket_mode/builtin/index.html | 0 .../adapter/socket_mode/index.html | 0 .../adapter/socket_mode/internals.html | 0 .../socket_mode/websocket_client/index.html | 0 .../adapter/socket_mode/websockets/index.html | 0 .../adapter/starlette/async_handler.html | 0 .../adapter/starlette/handler.html | 0 .../adapter/starlette/index.html | 0 .../adapter/tornado/async_handler.html | 0 .../adapter/tornado/handler.html | 0 .../adapter/tornado/index.html | 0 .../adapter/wsgi/handler.html | 0 .../adapter/wsgi/http_request.html | 0 .../adapter/wsgi/http_response.html | 0 .../adapter/wsgi/index.html | 0 .../adapter/wsgi/internals.html | 0 .../slack_bolt => reference}/app/app.html | 0 .../app/async_app.html | 0 .../app/async_server.html | 0 .../slack_bolt => reference}/app/index.html | 0 .../slack_bolt => reference}/async_app.html | 0 .../authorization/async_authorize.html | 0 .../authorization/async_authorize_args.html | 0 .../authorization/authorize.html | 0 .../authorization/authorize_args.html | 0 .../authorization/authorize_result.html | 0 .../authorization/index.html | 0 .../context/ack/ack.html | 0 .../context/ack/async_ack.html | 0 .../context/ack/index.html | 0 .../context/ack/internals.html | 0 .../assistant/assistant_utilities.html | 0 .../assistant/async_assistant_utilities.html | 0 .../context/assistant/index.html | 0 .../context/assistant/internals.html | 0 .../assistant/thread_context/index.html | 0 .../thread_context_store/async_store.html | 0 .../default_async_store.html | 0 .../thread_context_store/default_store.html | 0 .../thread_context_store/file/index.html | 0 .../assistant/thread_context_store/index.html | 0 .../assistant/thread_context_store/store.html | 0 .../context/async_context.html | 0 .../context/base_context.html | 0 .../context/complete/async_complete.html | 0 .../context/complete/complete.html | 0 .../context/complete/index.html | 0 .../context/context.html | 0 .../context/fail/async_fail.html | 0 .../context/fail/fail.html | 0 .../context/fail/index.html | 0 .../async_get_thread_context.html | 0 .../get_thread_context.html | 0 .../context/get_thread_context/index.html | 0 .../context/index.html | 0 .../context/respond/async_respond.html | 0 .../context/respond/index.html | 0 .../context/respond/internals.html | 0 .../context/respond/respond.html | 0 .../async_save_thread_context.html | 0 .../context/save_thread_context/index.html | 0 .../save_thread_context.html | 0 .../context/say/async_say.html | 0 .../context/say/index.html | 0 .../context/say/internals.html | 0 .../context/say/say.html | 0 .../context/set_status/async_set_status.html | 0 .../context/set_status/index.html | 0 .../context/set_status/set_status.html | 0 .../async_set_suggested_prompts.html | 0 .../context/set_suggested_prompts/index.html | 0 .../set_suggested_prompts.html | 0 .../context/set_title/async_set_title.html | 0 .../context/set_title/index.html | 0 .../context/set_title/set_title.html | 0 .../slack_bolt => reference}/error/index.html | 0 .../slack_bolt => reference}/index.html | 0 .../kwargs_injection/args.html | 0 .../kwargs_injection/async_args.html | 0 .../kwargs_injection/async_utils.html | 0 .../kwargs_injection/index.html | 0 .../kwargs_injection/utils.html | 0 .../lazy_listener/async_internals.html | 0 .../lazy_listener/async_runner.html | 0 .../lazy_listener/asyncio_runner.html | 0 .../lazy_listener/index.html | 0 .../lazy_listener/internals.html | 0 .../lazy_listener/runner.html | 0 .../lazy_listener/thread_runner.html | 0 .../listener/async_builtins.html | 0 .../listener/async_listener.html | 0 .../async_listener_completion_handler.html | 0 .../async_listener_error_handler.html | 0 .../async_listener_start_handler.html | 0 .../listener/asyncio_runner.html | 0 .../listener/builtins.html | 0 .../listener/custom_listener.html | 0 .../listener/index.html | 0 .../listener/listener.html | 0 .../listener/listener_completion_handler.html | 0 .../listener/listener_error_handler.html | 0 .../listener/listener_start_handler.html | 0 .../listener/thread_runner.html | 0 .../listener_matcher/async_builtins.html | 0 .../async_listener_matcher.html | 0 .../listener_matcher/builtins.html | 0 .../custom_listener_matcher.html | 0 .../listener_matcher/index.html | 0 .../listener_matcher/listener_matcher.html | 0 .../logger/index.html | 0 .../logger/messages.html | 0 .../middleware/assistant/assistant.html | 0 .../middleware/assistant/async_assistant.html | 0 .../middleware/assistant/index.html | 0 .../middleware/async_builtins.html | 0 .../middleware/async_custom_middleware.html | 0 .../middleware/async_middleware.html | 0 .../async_middleware_error_handler.html | 0 .../async_attaching_function_token.html | 0 .../attaching_function_token.html | 0 .../attaching_function_token/index.html | 0 .../authorization/async_authorization.html | 0 .../authorization/async_internals.html | 0 .../async_multi_teams_authorization.html | 0 .../async_single_team_authorization.html | 0 .../authorization/authorization.html | 0 .../middleware/authorization/index.html | 0 .../middleware/authorization/internals.html | 0 .../multi_teams_authorization.html | 0 .../single_team_authorization.html | 0 .../middleware/custom_middleware.html | 0 .../async_ignoring_self_events.html | 0 .../ignoring_self_events.html | 0 .../ignoring_self_events/index.html | 0 .../middleware/index.html | 0 .../async_message_listener_matches.html | 0 .../message_listener_matches/index.html | 0 .../message_listener_matches.html | 0 .../middleware/middleware.html | 0 .../middleware/middleware_error_handler.html | 0 .../async_request_verification.html | 0 .../request_verification/index.html | 0 .../request_verification.html | 0 .../middleware/ssl_check/async_ssl_check.html | 0 .../middleware/ssl_check/index.html | 0 .../middleware/ssl_check/ssl_check.html | 0 .../async_url_verification.html | 0 .../middleware/url_verification/index.html | 0 .../url_verification/url_verification.html | 0 .../oauth/async_callback_options.html | 0 .../oauth/async_internals.html | 0 .../oauth/async_oauth_flow.html | 0 .../oauth/async_oauth_settings.html | 0 .../oauth/callback_options.html | 0 .../slack_bolt => reference}/oauth/index.html | 0 .../oauth/internals.html | 0 .../oauth/oauth_flow.html | 0 .../oauth/oauth_settings.html | 0 .../request/async_internals.html | 0 .../request/async_request.html | 0 .../request/index.html | 0 .../request/internals.html | 0 .../request/payload_utils.html | 0 .../request/request.html | 0 .../response/index.html | 0 .../response/response.html | 0 .../util/async_utils.html | 0 .../slack_bolt => reference}/util/index.html | 0 .../slack_bolt => reference}/util/utils.html | 0 .../slack_bolt => reference}/version.html | 0 .../workflows/index.html | 0 .../workflows/step/async_step.html | 0 .../workflows/step/async_step_middleware.html | 0 .../workflows/step/index.html | 0 .../workflows/step/internals.html | 0 .../workflows/step/step.html | 0 .../workflows/step/step_middleware.html | 0 .../step/utilities/async_complete.html | 0 .../step/utilities/async_configure.html | 0 .../workflows/step/utilities/async_fail.html | 0 .../step/utilities/async_update.html | 0 .../workflows/step/utilities/complete.html | 0 .../workflows/step/utilities/configure.html | 0 .../workflows/step/utilities/fail.html | 0 .../workflows/step/utilities/index.html | 0 .../workflows/step/utilities/update.html | 0 docs/sidebars.js | 127 - docs/src/css/custom.css | 583 - docs/src/theme/NotFound/Content/index.js | 36 - docs/src/theme/NotFound/index.js | 19 - docs/static/.nojekyll | 0 docs/static/img/bolt-logo.svg | 1 - docs/static/img/bolt-py-logo.svg | 1 - docs/static/img/boltpy/bolt-favicon.png | Bin 3376 -> 0 bytes docs/static/img/boltpy/ngrok.gif | Bin 49094 -> 0 bytes docs/static/img/boltpy/request-url-config.png | Bin 168494 -> 0 bytes docs/static/img/boltpy/signing-secret.png | Bin 289939 -> 0 bytes docs/static/img/favicon.ico | Bin 24499 -> 0 bytes docs/static/img/slack-logo-on-white.png | Bin 25811 -> 0 bytes docs/static/img/slack-logo.svg | 6 - examples/getting_started/app.py | 2 +- scripts/generate_api_docs.sh | 6 +- 379 files changed, 679 insertions(+), 19452 deletions(-) delete mode 100644 .github/workflows/docs-deploy.yml delete mode 100644 docs/.gitignore delete mode 100644 docs/README.md delete mode 100644 docs/babel.config.js delete mode 100644 docs/content/concepts/custom-steps.md delete mode 100644 docs/content/concepts/web-api.md delete mode 100644 docs/docusaurus.config.js create mode 100644 docs/english/_sidebar.json rename docs/{content => english}/building-an-app.md (81%) rename docs/{content => english}/concepts/acknowledge.md (60%) rename docs/{content => english}/concepts/actions.md (74%) rename docs/{content => english}/concepts/adapters.md (97%) rename docs/{content => english}/concepts/ai-apps.md (79%) rename docs/{content => english}/concepts/app-home.md (52%) rename docs/{content => english}/concepts/async.md (97%) rename docs/{content => english}/concepts/authenticating-oauth.md (89%) rename docs/{content => english}/concepts/authorization.md (94%) rename docs/{content => english}/concepts/commands.md (74%) rename docs/{content => english}/concepts/context.md (96%) rename docs/{content => english}/concepts/custom-adapters.md (92%) rename docs/{content => english}/concepts/custom-steps-dynamic-options.md (75%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => english}/concepts/custom-steps.md (86%) rename docs/{content => english}/concepts/errors.md (90%) rename docs/{content => english}/concepts/event-listening.md (60%) rename docs/{content => english}/concepts/global-middleware.md (82%) rename docs/{content => english}/concepts/lazy-listeners.md (98%) rename docs/{content => english}/concepts/listener-middleware.md (83%) rename docs/{content => english}/concepts/logging.md (94%) rename docs/{content => english}/concepts/message-listening.md (59%) rename docs/{content => english}/concepts/message-sending.md (77%) rename docs/{content => english}/concepts/opening-modals.md (68%) rename docs/{content => english}/concepts/select-menu-options.md (67%) rename docs/{content => english}/concepts/shortcuts.md (74%) rename docs/{content => english}/concepts/socket-mode.md (78%) rename docs/{content => english}/concepts/token-rotation.md (73%) rename docs/{content => english}/concepts/updating-pushing-views.md (64%) rename docs/{content => english}/concepts/view-submissions.md (74%) create mode 100644 docs/english/concepts/web-api.md rename docs/{content => english}/getting-started.md (80%) rename docs/{content => english}/index.md (93%) rename docs/{content/concepts => english/legacy}/steps-from-apps.md (67%) rename docs/{static/img/tutorials => english/tutorial}/ai-chatbot/1.png (100%) rename docs/{static/img/tutorials => english/tutorial}/ai-chatbot/2.png (100%) rename docs/{static/img/tutorials => english/tutorial}/ai-chatbot/3.png (100%) rename docs/{static/img/tutorials => english/tutorial}/ai-chatbot/4.png (100%) rename docs/{static/img/tutorials => english/tutorial}/ai-chatbot/5.png (100%) rename docs/{static/img/tutorials => english/tutorial}/ai-chatbot/6.png (100%) rename docs/{static/img/tutorials => english/tutorial}/ai-chatbot/7.png (100%) rename docs/{static/img/tutorials => english/tutorial}/ai-chatbot/8.png (100%) rename docs/{content/tutorial => english/tutorial/ai-chatbot}/ai-chatbot.md (88%) rename docs/{static/img/tutorials/custom-steps-jira => english/tutorial/custom-steps-for-jira}/1.png (100%) rename docs/{static/img/tutorials/custom-steps-jira => english/tutorial/custom-steps-for-jira}/2.png (100%) rename docs/{static/img/tutorials/custom-steps-jira => english/tutorial/custom-steps-for-jira}/3.png (100%) rename docs/{static/img/tutorials/custom-steps-jira => english/tutorial/custom-steps-for-jira}/4.png (100%) rename docs/{static/img/tutorials/custom-steps-jira => english/tutorial/custom-steps-for-jira}/5.png (100%) rename docs/{static/img/tutorials/custom-steps-jira => english/tutorial/custom-steps-for-jira}/6.png (100%) rename docs/{static/img/tutorials/custom-steps-jira => english/tutorial/custom-steps-for-jira}/7.png (100%) rename docs/{content/tutorial => english/tutorial/custom-steps-for-jira}/custom-steps-for-jira.md (86%) rename docs/{static/img/tutorials/custom-steps-wfb-existing => english/tutorial/custom-steps-workflow-builder-existing}/add-step.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-existing => english/tutorial/custom-steps-workflow-builder-existing}/app-message.png (100%) rename docs/{content/tutorial => english/tutorial/custom-steps-workflow-builder-existing}/custom-steps-workflow-builder-existing.md (91%) rename docs/{static/img/tutorials/custom-steps-wfb-existing => english/tutorial/custom-steps-workflow-builder-existing}/define-step.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-existing => english/tutorial/custom-steps-workflow-builder-existing}/find-step.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-existing => english/tutorial/custom-steps-workflow-builder-existing}/inputs.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-existing => english/tutorial/custom-steps-workflow-builder-existing}/org-ready.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-existing => english/tutorial/custom-steps-workflow-builder-existing}/outputs.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-existing => english/tutorial/custom-steps-workflow-builder-existing}/step-inputs.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-new => english/tutorial/custom-steps-workflow-builder-new}/app-token.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-new => english/tutorial/custom-steps-workflow-builder-new}/bot-token.png (100%) rename docs/{content/tutorial => english/tutorial/custom-steps-workflow-builder-new}/custom-steps-workflow-builder-new.md (90%) rename docs/{static/img/tutorials/custom-steps-wfb-new => english/tutorial/custom-steps-workflow-builder-new}/install.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-new => english/tutorial/custom-steps-workflow-builder-new}/manifest.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-new => english/tutorial/custom-steps-workflow-builder-new}/wfb-1.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-new => english/tutorial/custom-steps-workflow-builder-new}/wfb-10.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-new => english/tutorial/custom-steps-workflow-builder-new}/wfb-11.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-new => english/tutorial/custom-steps-workflow-builder-new}/wfb-12.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-new => english/tutorial/custom-steps-workflow-builder-new}/wfb-2.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-new => english/tutorial/custom-steps-workflow-builder-new}/wfb-3.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-new => english/tutorial/custom-steps-workflow-builder-new}/wfb-4.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-new => english/tutorial/custom-steps-workflow-builder-new}/wfb-5.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-new => english/tutorial/custom-steps-workflow-builder-new}/wfb-6.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-new => english/tutorial/custom-steps-workflow-builder-new}/wfb-7.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-new => english/tutorial/custom-steps-workflow-builder-new}/wfb-8.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-new => english/tutorial/custom-steps-workflow-builder-new}/wfb-9.png (100%) rename docs/{static/img/tutorials/custom-steps-wfb-new => english/tutorial/custom-steps-workflow-builder-new}/workflow-step.png (100%) rename docs/{content => english}/tutorial/custom-steps.md (94%) rename docs/{static/img/tutorials => english/tutorial}/modals/base_link.gif (100%) rename docs/{static/img/tutorials => english/tutorial}/modals/final_product.gif (100%) rename docs/{static/img/tutorials => english/tutorial}/modals/heart_icon.gif (100%) rename docs/{static/img/tutorials => english/tutorial}/modals/interactivity_url.png (100%) rename docs/{content/tutorial => english/tutorial/modals}/modals.md (83%) rename docs/{static/img/tutorials => english/tutorial}/modals/slash_command.png (100%) delete mode 100644 docs/footerConfig.js delete mode 100644 docs/i18n/ja-jp/README.md delete mode 100644 docs/i18n/ja-jp/code.json delete mode 100644 docs/i18n/ja-jp/docusaurus-plugin-content-docs/current.json delete mode 100644 docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/app-home.md delete mode 100644 docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/web-api.md delete mode 100644 docs/i18n/ja-jp/docusaurus-theme-classic/footer.json delete mode 100644 docs/i18n/ja-jp/docusaurus-theme-classic/navbar.json rename docs/{static/img/boltpy => img}/basic-information-page.png (100%) rename docs/{static/img/boltpy => img}/bot-token.png (100%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/acknowledge.md (69%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/actions.md (76%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/adapters.md (97%) create mode 100644 docs/japanese/concepts/app-home.md rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/assistant.md (91%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/async.md (97%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/authenticating-oauth.md (89%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/authorization.md (94%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/commands.md (72%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/context.md (96%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/custom-adapters.md (90%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/errors.md (92%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/event-listening.md (50%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/global-middleware.md (81%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/lazy-listeners.md (98%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/listener-middleware.md (83%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/logging.md (95%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/message-listening.md (55%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/message-sending.md (74%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/opening-modals.md (62%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/select-menu-options.md (68%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/shortcuts.md (77%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/socket-mode.md (86%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/token-rotation.md (67%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/updating-pushing-views.md (60%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/concepts/view-submissions.md (72%) create mode 100644 docs/japanese/concepts/web-api.md rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/getting-started.md (80%) rename docs/{i18n/ja-jp/docusaurus-plugin-content-docs/current => japanese}/legacy/steps-from-apps.md (71%) delete mode 100644 docs/navbarConfig.js delete mode 100644 docs/package-lock.json delete mode 100644 docs/package.json rename docs/{static/api-docs/slack_bolt => reference}/adapter/aiohttp/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/asgi/aiohttp/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/asgi/async_handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/asgi/base_handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/asgi/builtin/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/asgi/http_request.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/asgi/http_response.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/asgi/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/asgi/utils.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/aws_lambda/chalice_handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/aws_lambda/chalice_lazy_listener_runner.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/aws_lambda/handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/aws_lambda/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/aws_lambda/internals.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/aws_lambda/lambda_s3_oauth_flow.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/aws_lambda/lazy_listener_runner.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/aws_lambda/local_lambda_client.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/bottle/handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/bottle/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/cherrypy/handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/cherrypy/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/django/handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/django/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/falcon/async_resource.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/falcon/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/falcon/resource.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/fastapi/async_handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/fastapi/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/flask/handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/flask/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/google_cloud_functions/handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/google_cloud_functions/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/pyramid/handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/pyramid/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/sanic/async_handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/sanic/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/socket_mode/aiohttp/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/socket_mode/async_base_handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/socket_mode/async_handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/socket_mode/async_internals.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/socket_mode/base_handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/socket_mode/builtin/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/socket_mode/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/socket_mode/internals.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/socket_mode/websocket_client/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/socket_mode/websockets/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/starlette/async_handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/starlette/handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/starlette/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/tornado/async_handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/tornado/handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/tornado/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/wsgi/handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/wsgi/http_request.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/wsgi/http_response.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/wsgi/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/adapter/wsgi/internals.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/app/app.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/app/async_app.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/app/async_server.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/app/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/async_app.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/authorization/async_authorize.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/authorization/async_authorize_args.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/authorization/authorize.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/authorization/authorize_args.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/authorization/authorize_result.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/authorization/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/ack/ack.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/ack/async_ack.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/ack/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/ack/internals.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/assistant/assistant_utilities.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/assistant/async_assistant_utilities.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/assistant/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/assistant/internals.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/assistant/thread_context/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/assistant/thread_context_store/async_store.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/assistant/thread_context_store/default_async_store.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/assistant/thread_context_store/default_store.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/assistant/thread_context_store/file/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/assistant/thread_context_store/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/assistant/thread_context_store/store.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/async_context.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/base_context.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/complete/async_complete.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/complete/complete.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/complete/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/context.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/fail/async_fail.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/fail/fail.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/fail/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/get_thread_context/async_get_thread_context.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/get_thread_context/get_thread_context.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/get_thread_context/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/respond/async_respond.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/respond/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/respond/internals.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/respond/respond.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/save_thread_context/async_save_thread_context.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/save_thread_context/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/save_thread_context/save_thread_context.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/say/async_say.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/say/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/say/internals.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/say/say.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/set_status/async_set_status.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/set_status/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/set_status/set_status.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/set_suggested_prompts/async_set_suggested_prompts.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/set_suggested_prompts/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/set_suggested_prompts/set_suggested_prompts.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/set_title/async_set_title.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/set_title/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/context/set_title/set_title.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/error/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/kwargs_injection/args.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/kwargs_injection/async_args.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/kwargs_injection/async_utils.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/kwargs_injection/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/kwargs_injection/utils.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/lazy_listener/async_internals.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/lazy_listener/async_runner.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/lazy_listener/asyncio_runner.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/lazy_listener/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/lazy_listener/internals.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/lazy_listener/runner.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/lazy_listener/thread_runner.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/listener/async_builtins.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/listener/async_listener.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/listener/async_listener_completion_handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/listener/async_listener_error_handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/listener/async_listener_start_handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/listener/asyncio_runner.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/listener/builtins.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/listener/custom_listener.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/listener/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/listener/listener.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/listener/listener_completion_handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/listener/listener_error_handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/listener/listener_start_handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/listener/thread_runner.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/listener_matcher/async_builtins.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/listener_matcher/async_listener_matcher.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/listener_matcher/builtins.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/listener_matcher/custom_listener_matcher.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/listener_matcher/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/listener_matcher/listener_matcher.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/logger/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/logger/messages.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/assistant/assistant.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/assistant/async_assistant.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/assistant/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/async_builtins.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/async_custom_middleware.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/async_middleware.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/async_middleware_error_handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/attaching_function_token/async_attaching_function_token.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/attaching_function_token/attaching_function_token.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/attaching_function_token/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/authorization/async_authorization.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/authorization/async_internals.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/authorization/async_multi_teams_authorization.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/authorization/async_single_team_authorization.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/authorization/authorization.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/authorization/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/authorization/internals.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/authorization/multi_teams_authorization.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/authorization/single_team_authorization.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/custom_middleware.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/ignoring_self_events/async_ignoring_self_events.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/ignoring_self_events/ignoring_self_events.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/ignoring_self_events/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/message_listener_matches/async_message_listener_matches.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/message_listener_matches/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/message_listener_matches/message_listener_matches.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/middleware.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/middleware_error_handler.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/request_verification/async_request_verification.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/request_verification/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/request_verification/request_verification.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/ssl_check/async_ssl_check.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/ssl_check/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/ssl_check/ssl_check.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/url_verification/async_url_verification.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/url_verification/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/middleware/url_verification/url_verification.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/oauth/async_callback_options.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/oauth/async_internals.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/oauth/async_oauth_flow.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/oauth/async_oauth_settings.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/oauth/callback_options.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/oauth/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/oauth/internals.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/oauth/oauth_flow.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/oauth/oauth_settings.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/request/async_internals.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/request/async_request.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/request/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/request/internals.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/request/payload_utils.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/request/request.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/response/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/response/response.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/util/async_utils.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/util/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/util/utils.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/version.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/workflows/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/workflows/step/async_step.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/workflows/step/async_step_middleware.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/workflows/step/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/workflows/step/internals.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/workflows/step/step.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/workflows/step/step_middleware.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/workflows/step/utilities/async_complete.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/workflows/step/utilities/async_configure.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/workflows/step/utilities/async_fail.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/workflows/step/utilities/async_update.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/workflows/step/utilities/complete.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/workflows/step/utilities/configure.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/workflows/step/utilities/fail.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/workflows/step/utilities/index.html (100%) rename docs/{static/api-docs/slack_bolt => reference}/workflows/step/utilities/update.html (100%) delete mode 100644 docs/sidebars.js delete mode 100644 docs/src/css/custom.css delete mode 100644 docs/src/theme/NotFound/Content/index.js delete mode 100644 docs/src/theme/NotFound/index.js delete mode 100644 docs/static/.nojekyll delete mode 100644 docs/static/img/bolt-logo.svg delete mode 100644 docs/static/img/bolt-py-logo.svg delete mode 100644 docs/static/img/boltpy/bolt-favicon.png delete mode 100644 docs/static/img/boltpy/ngrok.gif delete mode 100644 docs/static/img/boltpy/request-url-config.png delete mode 100644 docs/static/img/boltpy/signing-secret.png delete mode 100644 docs/static/img/favicon.ico delete mode 100644 docs/static/img/slack-logo-on-white.png delete mode 100644 docs/static/img/slack-logo.svg diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml deleted file mode 100644 index ed18c4b1d..000000000 --- a/.github/workflows/docs-deploy.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Deploy to GitHub Pages - -on: - pull_request: - branches: - - main - paths: - - "docs/**" - push: - branches: - - main - paths: - - "docs/**" - workflow_dispatch: - -jobs: - build: - name: Build Docusaurus - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - fetch-depth: 0 - persist-credentials: false - - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version: 20 - cache: npm - cache-dependency-path: docs/package-lock.json - - - name: Install dependencies - run: npm ci - working-directory: ./docs - - - name: Build website - run: npm run build - working-directory: ./docs - - - name: Upload Build Artifact - uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 - with: - path: ./docs/build - - deploy: - name: Deploy to GitHub Pages - if: github.event_name != 'pull_request' - needs: build - - # Grant GITHUB_TOKEN the permissions required to make a Pages deployment - permissions: - pages: write # to deploy to Pages - id-token: write # verifies deployment is from an appropriate source - - # Deploy to the github-pages environment - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - runs-on: ubuntu-latest - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 diff --git a/README.md b/README.md index 7576597d5..c6b6a536c 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@
    Python Versions - + Documentation

    -A Python framework to build Slack apps in a flash with the latest platform features. Read the [getting started guide](https://tools.slack.dev/bolt-python/getting-started) and look at our [code examples](https://github.com/slackapi/bolt-python/tree/main/examples) to learn how to build apps using Bolt. The Python module documents are available [here](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/). +A Python framework to build Slack apps in a flash with the latest platform features. Read the [getting started guide](https://docs.slack.dev/tools/bolt-python/getting-started) and look at our [code examples](https://github.com/slackapi/bolt-python/tree/main/examples) to learn how to build apps using Bolt. The Python module documents are available [here](https://docs.slack.dev/tools/bolt-python/reference/). ## Setup @@ -192,7 +192,7 @@ Apps can be run the same way as the syncronous example above. If you'd prefer an ## Getting Help -[The documentation](https://tools.slack.dev/bolt-python) has more information on basic and advanced concepts for Bolt for Python. Also, all the Python module documents of this library are available [here](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/). +[The documentation](https://tools.slack.dev/bolt-python) has more information on basic and advanced concepts for Bolt for Python. Also, all the Python module documents of this library are available [here](https://tools.slack.dev/bolt-python/reference/). If you otherwise get stuck, we're here to help. The following are the best ways to get assistance working through your issue: diff --git a/docs/.gitignore b/docs/.gitignore deleted file mode 100644 index 53a1610fd..000000000 --- a/docs/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules/ -.docusaurus -build \ No newline at end of file diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index 023d89975..000000000 --- a/docs/README.md +++ /dev/null @@ -1,129 +0,0 @@ -# tools.slack.dev/bolt-python - -This website is built using [Docusaurus](https://docusaurus.io/). 'Tis cool. - -Each Bolt/SDK has its own Docusaurus website, with matching CSS and nav/footer. There is also be a Docusaurus website of just the homepage and community tools. - -``` -website/ -├── docs/ (the good stuff. md and mdx files supported) -│ ├── getting-started.md -│ └── concepts -│ └── sending-message.md -├── i18n/ja/ (the japanese translations) -│ ├──docusaurus-theme-classic/ (footer/navbar translations) -│ └──docusaurus-plugin-content-docs/ -│ └── current/ ( file names need to exactly match **/docs/, but japanese content) -│ ├── getting-started.md -│ └── concepts -│ └── sending-message.md -├── static/ -│ ├── css/ -│ │ └── custom.css (the css for everything!) -│ ├── img/ (the pictures for the site) -│ │ ├── rory.png -│ │ └── oslo.svg -│ └── api-docs/slack_bolt (the generated reference docs with their own HTML/CSS) -│ ├── index.html -│ └── adaptor -│ └── index.html -├── src/ -│ ├── pages/ (stuff that isn't docs. This is empty for this repo!) -│ └── theme/ (only contains the 404 page) -├── docusaurus.config.js (main config file) -├── footerConfig.js (footer. go to main repo to change) -├── navbarConfig.js (navbar. go to main repo to change) -└── sidebar.js (manually set where the docs are in the sidebar.) -``` - -A cheat-sheet: -* _I want to edit a doc._ `docs/*/*.md` -* _I want to edit a Japanese doc._ `i18n/ja-jp/docusaurus-plugin-content-docs/current/*/*.md`. See the [Japanese docs README](./docs/README.md) -* _I want to change the docs sidebar._ `sidebar.js` -* _I want to change the css._ Don't use this repo, use the home repo and the changes will propagate here. -* _I want to change anything else._ `docusaurus.config.js` - ----- - -## Adding a doc - -1. Make a markdown file. Add a `# Title` or use [front matter](https://docusaurus.io/docs/next/create-doc) with `title:`. -2. Save it in `docs/folder/title.md` or `docs/title.md`, depending on if it's in a sidebar category. The nuance is just for internal organization. -3. There needs to be 1:1 docs for the sidebar. Copy the folder/file and put it in the Japanese docs: `i18n/ja/docusaurus-plugin-content-docs/current/*`. Just leave it in English if you don't speak Japanese. -4. Add the doc's path to the sidebar within `docusaurus.config.js`. Where ever makes most sense for you. -5. Test the changes ↓ - ---- - -## Running locally - -Docusaurus requires at least Node 18. You can update Node however you want. `nvm` is one way. - -Install `nvm` if you don't have it: - -``` -curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash -``` - -Then grab the latest version of Node. - -``` -nvm install node -``` - -If you are running this project locally for the first time, you'll need to install the packages with the following command: - -``` -npm install -``` - -The following command starts a local development server and opens up a browser window. - -``` -npm run start -``` - -Edits to pages are reflected live — no restarting the server or reloading the page. (I'd say... 95% of the time, and 100% time if you're just editing a markdown file). The generated reference docs only load in prod! - -Remember — you're only viewing the Bolt for Python docs right now. - -#### Running locally in Japanese - -For local runs, Docusaurus treats each language as a different instance of the website. You'll want to specify the language to run the japanese site locally: - -``` -npm run start -- --locale ja-jp -``` - -Don't worry - both languages will be built/served on deployment. - ---- - -## Deploying - -The following command generates static content into the `build` directory. - -``` -$ npm run build -``` - -Then you can test out with the following command: - -``` -npm run serve -``` - -If it looks good, make a PR request! - -### Deployment to GitHub pages - -There is a GitHub action workflow set up in each repo. - -* On PR, it tests a site build. -* On Merge, it builds the site and deploys it. Site should update in a minute or two. - ---- - -## Something's broken - -Luke goofed. Open an issue please! `:bufo-appreciates-the-insight:` \ No newline at end of file diff --git a/docs/babel.config.js b/docs/babel.config.js deleted file mode 100644 index e00595dae..000000000 --- a/docs/babel.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - presets: [require.resolve('@docusaurus/core/lib/babel/preset')], -}; diff --git a/docs/content/concepts/custom-steps.md b/docs/content/concepts/custom-steps.md deleted file mode 100644 index 52e3d76e2..000000000 --- a/docs/content/concepts/custom-steps.md +++ /dev/null @@ -1,154 +0,0 @@ ---- -title: Listening and responding to custom steps -sidebar_label: Custom Steps -lang: en -slug: /concepts/custom-steps ---- - -Your app can use the `function()` method to listen to incoming [custom step requests](https://docs.slack.dev/workflows/workflow-steps). Custom steps are used in Workflow Builder to build workflows. The method requires a step `callback_id` of type `str`. This `callback_id` must also be defined in your [Function](https://docs.slack.dev/reference/app-manifest#functions) definition. Custom steps must be finalized using the `complete()` or `fail()` listener arguments to notify Slack that your app has processed the request. - -* `complete()` requires **one** argument: `outputs` of type `dict`. It ends your custom step **successfully** and provides a dictionary containing the outputs of your custom step as per its definition. -* `fail()` requires **one** argument: `error` of type `str`. It ends your custom step **unsuccessfully** and provides a message containing information regarding why your custom step failed. - -You can reference your custom step's inputs using the `inputs` listener argument of type `dict`. - -Refer to [the module document](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) to learn about the available listener arguments. - -```python -# This sample custom step formats an input and outputs it -@app.function("sample_custom_step") -def sample_step_callback(inputs: dict, fail: Fail, complete: Complete): - try: - message = inputs["message"] - complete( - outputs={ - "message": f":wave: You submitted the following message: \n\n>{message}" - } - ) - except Exception as e: - fail(f"Failed to handle a custom step request (error: {e})") - raise e -``` - -
    - -Example app manifest definition - - -```json -... -"functions": { - "sample_custom_step": { - "title": "Sample custom step", - "description": "Run a sample custom step", - "input_parameters": { - "message": { - "type": "string", - "title": "Message", - "description": "A message to be formatted by the custom step", - "is_required": true, - } - }, - "output_parameters": { - "message": { - "type": "string", - "title": "Messge", - "description": "A formatted message", - "is_required": true, - } - } - } -} -``` - -
    - ---- - -### Listening to custom step interactivity events - -Your app's custom steps may create interactivity points for users, for example: Post a message with a button. - -If such interaction points originate from a custom step execution, the events sent to your app representing the end-user interaction with these points are considered to be _function-scoped interactivity events_. These interactivity events can be handled by your app using the same concepts we covered earlier, such as [Listening to actions](/concepts/action-listening). - -_function-scoped interactivity events_ will contain data related to the custom step (`function_executed` event) they were spawned from, such as custom step `inputs` and access to `complete()` and `fail()` listener arguments. - -Your app can skip calling `complete()` or `fail()` in the `function()` handler method if the custom step creates an interaction point that requires user interaction before the step can end. However, in the relevant interactivity handler method, your app must invoke `complete()` or `fail()` to notify Slack that the custom step has been processed. - -You’ll notice in all interactivity handler examples, `ack()` is used. It is required to call the `ack()` function within an interactivity listener to acknowledge that the request was received from Slack. This is discussed in the [acknowledging requests section](/concepts/acknowledge). - -```python -# This sample custom step posts a message with a button -@app.function("custom_step_button") -def sample_step_callback(inputs, say, fail): - try: - say( - channel=inputs["user_id"], # sending a DM to this user - text="Click the button to signal the step completion", - blocks=[ - { - "type": "section", - "text": {"type": "mrkdwn", "text": "Click the button to signal step completion"}, - "accessory": { - "type": "button", - "text": {"type": "plain_text", "text": "Complete step"}, - "action_id": "sample_click", - }, - } - ], - ) - except Exception as e: - fail(f"Failed to handle a function request (error: {e})") - -# Your listener will be called every time a block element with the action_id "sample_click" is triggered -@app.action("sample_click") -def handle_sample_click(ack, body, context, client, complete, fail): - ack() - try: - # Since the button no longer works, we should remove it - client.chat_update( - channel=context.channel_id, - ts=body["message"]["ts"], - text="Congrats! You clicked the button", - ) - - # Signal that the custom step completed successfully - complete({"user_id": context.actor_user_id}) - except Exception as e: - fail(f"Failed to handle a function request (error: {e})") -``` - -
    - -Example app manifest definition - - -```json -... -"functions": { - "custom_step_button": { - "title": "Custom step with a button", - "description": "Custom step that waits for a button click", - "input_parameters": { - "user_id": { - "type": "slack#/types/user_id", - "title": "User", - "description": "The recipient of a message with a button", - "is_required": true, - } - }, - "output_parameters": { - "user_id": { - "type": "slack#/types/user_id", - "title": "User", - "description": "The user that completed the function", - "is_required": true - } - } - } -} -``` - -
    - -Learn more about responding to interactivity, see the [Slack API documentation](https://docs.slack.dev/interactivity/handling-user-interaction). diff --git a/docs/content/concepts/web-api.md b/docs/content/concepts/web-api.md deleted file mode 100644 index 18b41a029..000000000 --- a/docs/content/concepts/web-api.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: Using the Web API -lang: en -slug: /concepts/web-api ---- - -You can call [any Web API method](https://docs.slack.dev/reference/methods) using the [`WebClient`](https://tools.slack.dev/python-slack-sdk/web) provided to your Bolt app as either `app.client` or `client` in middleware/listener arguments (given that your app has the appropriate scopes). When you call one the client's methods, it returns a `SlackResponse` which contains the response from Slack. - -The token used to initialize Bolt can be found in the `context` object, which is required to call most Web API methods. - -:::info - -Refer to [the module document](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) to learn the available listener arguments. - -::: - -```python -@app.message("wake me up") -def say_hello(client, message): - # Unix Epoch time for September 30, 2020 11:59:59 PM - when_september_ends = 1601510399 - channel_id = message["channel"] - client.chat_scheduleMessage( - channel=channel_id, - post_at=when_september_ends, - text="Summer has come and passed" - ) -``` diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js deleted file mode 100644 index 0d80161e6..000000000 --- a/docs/docusaurus.config.js +++ /dev/null @@ -1,114 +0,0 @@ -import { themes as prismThemes } from 'prism-react-renderer'; -const footer = require('./footerConfig'); -const navbar = require('./navbarConfig'); - -/** @type {import('@docusaurus/types').Config} */ -const config = { - title: "Bolt for Python", - tagline: "Official frameworks, libraries, and SDKs for Slack developers", - favicon: "img/favicon.ico", - url: "https://tools.slack.dev", - baseUrl: "/bolt-python/", - organizationName: "slackapi", - projectName: "bolt-python", - - onBrokenLinks: "ignore", - onBrokenAnchors: "warn", - onBrokenMarkdownLinks: "warn", - - i18n: { - defaultLocale: "en", - locales: ["en", "ja-jp"], - }, - - presets: [ - [ - "classic", - /** @type {import('@docusaurus/preset-classic').Options} */ - ({ - docs: { - path: "content", - breadcrumbs: false, - routeBasePath: "/", // Serve the docs at the site's root - sidebarPath: "./sidebars.js", - editUrl: "https://github.com/slackapi/bolt-python/tree/main/docs", - }, - blog: false, - theme: { - customCss: "./src/css/custom.css", - }, - }), - ], - ], - - plugins: [ - "docusaurus-theme-github-codeblock", - [ - "@docusaurus/plugin-client-redirects", - { - redirects: [ - { - to: "/getting-started", - from: ["/tutorial/getting-started"], - }, - { - to: "/", - from: ["/concepts", "/concepts/basic", "/concepts/advanced"], - }, - { - to: '/concepts/actions', - from: [ - '/concepts/action-listening', - '/concepts/action-responding' - ], - }, - { - to: '/legacy/steps-from-apps', - from: [ - '/concepts/steps', - '/concepts/creating-steps', - '/concepts/adding-editing-steps', - '/concepts/saving-steps', - '/concepts/executing-steps' - ], - }, - { - to: '/concepts/ai-apps', - from: '/concepts/assistant' - } - ], - }, - ], - ], - - themeConfig: - /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ - ({ - colorMode: { - respectPrefersColorScheme: true, - }, - docs: { - sidebar: { - autoCollapseCategories: true, - }, - }, - navbar, - footer, - prism: { - // switch to alucard when available in prism? - theme: prismThemes.github, - darkTheme: prismThemes.dracula, - additionalLanguages: ['bash'], - }, - codeblock: { - showGithubLink: true, - githubLinkLabel: "View on GitHub", - }, - // announcementBar: { - // id: `announcementBar`, - // content: `🎉️ Version 2.26.0 of the developer tools for the Slack automations platform is here! 🎉️ `, - // }, - }), -}; - -export default config; diff --git a/docs/english/_sidebar.json b/docs/english/_sidebar.json new file mode 100644 index 000000000..d42868543 --- /dev/null +++ b/docs/english/_sidebar.json @@ -0,0 +1,209 @@ +[ + { + "type": "doc", + "id": "tools/bolt-python/index", + "label": "Bolt for Python", + "className": "sidebar-title" + }, + "tools/bolt-python/getting-started", + { "type": "html", "value": "
    " }, + "tools/bolt-python/building-an-app", + { + "type": "category", + "label": "Slack API calls", + "items": [ + "tools/bolt-python/concepts/message-sending", + "tools/bolt-python/concepts/web-api" + ] + }, + { + "type": "category", + "label": "Events", + "items": [ + "tools/bolt-python/concepts/message-listening", + "tools/bolt-python/concepts/event-listening" + ] + }, + { + "type": "category", + "label": "App UI & Interactivity", + "items": [ + "tools/bolt-python/concepts/acknowledge", + "tools/bolt-python/concepts/shortcuts", + "tools/bolt-python/concepts/commands", + "tools/bolt-python/concepts/actions", + "tools/bolt-python/concepts/opening-modals", + "tools/bolt-python/concepts/updating-pushing-views", + "tools/bolt-python/concepts/view-submissions", + "tools/bolt-python/concepts/select-menu-options", + "tools/bolt-python/concepts/app-home" + ] + }, + "tools/bolt-python/concepts/ai-apps", + { + "type": "category", + "label": "Custom Steps", + "items": [ + "tools/bolt-python/concepts/custom-steps", + "tools/bolt-python/concepts/custom-steps-dynamic-options" + ] + }, + { + "type": "category", + "label": "App Configuration", + "items": [ + "tools/bolt-python/concepts/socket-mode", + "tools/bolt-python/concepts/errors", + "tools/bolt-python/concepts/logging", + "tools/bolt-python/concepts/async" + ] + }, + { + "type": "category", + "label": "Middleware & Context", + "items": [ + "tools/bolt-python/concepts/global-middleware", + "tools/bolt-python/concepts/listener-middleware", + "tools/bolt-python/concepts/context" + ] + }, + "tools/bolt-python/concepts/lazy-listeners", + { + "type": "category", + "label": "Adaptors", + "items": [ + "tools/bolt-python/concepts/adapters", + "tools/bolt-python/concepts/custom-adapters" + ] + }, + { + "type": "category", + "label": "Authorization & Security", + "items": [ + "tools/bolt-python/concepts/authenticating-oauth", + "tools/bolt-python/concepts/authorization", + "tools/bolt-python/concepts/token-rotation" + ] + }, + { + "type": "category", + "label": "Legacy", + "items": ["tools/bolt-python/legacy/steps-from-apps"] + }, + { "type": "html", "value": "
    " }, + { + "type": "category", + "label": "Tutorials", + "items": [ + "tools/bolt-python/tutorial/ai-chatbot/ai-chatbot", + "tools/bolt-python/tutorial/custom-steps", + "tools/bolt-python/tutorial/custom-steps-for-jira/custom-steps-for-jira", + "tools/bolt-python/tutorial/custom-steps-workflow-builder-new/custom-steps-workflow-builder-new", + "tools/bolt-python/tutorial/custom-steps-workflow-builder-existing/custom-steps-workflow-builder-existing", + "tools/bolt-python/tutorial/modals/modals" + ] + }, + { "type": "html", "value": "
    " }, + { + "type": "link", + "label": "Reference", + "href": "https://docs.slack.dev/tools/bolt-python/reference/index.html" + }, + { "type": "html", "value": "
    " }, + { + "type": "category", + "label": "日本語 (日本)", + "items": [ + "tools/bolt-python/ja-jp/getting-started", + { + "type": "category", + "label": "Slack API コール", + "items": [ + "tools/bolt-python/ja-jp/concepts/message-sending", + "tools/bolt-python/ja-jp/concepts/web-api" + ] + }, + { + "type": "category", + "label": "イベント API", + "items": [ + "tools/bolt-python/ja-jp/concepts/message-listening", + "tools/bolt-python/ja-jp/concepts/event-listening" + ] + }, + { + "type": "category", + "label": "インタラクティビティ & ショートカット", + "items": [ + "tools/bolt-python/ja-jp/concepts/acknowledge", + "tools/bolt-python/ja-jp/concepts/shortcuts", + "tools/bolt-python/ja-jp/concepts/commands", + "tools/bolt-python/ja-jp/concepts/actions", + "tools/bolt-python/ja-jp/concepts/opening-modals", + "tools/bolt-python/ja-jp/concepts/updating-pushing-views", + "tools/bolt-python/ja-jp/concepts/view-submissions", + "tools/bolt-python/ja-jp/concepts/select-menu-options", + "tools/bolt-python/ja-jp/concepts/app-home" + ] + }, + { + "type": "category", + "label": "App の設定", + "items": [ + "tools/bolt-python/ja-jp/concepts/socket-mode", + "tools/bolt-python/ja-jp/concepts/errors", + "tools/bolt-python/ja-jp/concepts/logging", + "tools/bolt-python/ja-jp/concepts/async" + ] + }, + { + "type": "category", + "label": "ミドルウェア & コンテキスト", + "items": [ + "tools/bolt-python/ja-jp/concepts/global-middleware", + "tools/bolt-python/ja-jp/concepts/listener-middleware", + "tools/bolt-python/ja-jp/concepts/context" + ] + }, + "tools/bolt-python/ja-jp/concepts/lazy-listeners", + { + "type": "category", + "label": "アダプター", + "items": [ + "tools/bolt-python/ja-jp/concepts/adapters", + "tools/bolt-python/ja-jp/concepts/custom-adapters" + ] + }, + { + "type": "category", + "label": "認可 & セキュリティ", + "items": [ + "tools/bolt-python/ja-jp/concepts/authenticating-oauth", + "tools/bolt-python/ja-jp/concepts/authorization", + "tools/bolt-python/ja-jp/concepts/token-rotation" + ] + }, + { + "type": "category", + "label": "レガシー(非推奨)", + "items": ["tools/bolt-python/ja-jp/legacy/steps-from-apps"] + } + ] + }, + { "type": "html", "value": "
    " }, + { + "type": "link", + "label": "Release notes", + "href": "https://github.com/slackapi/bolt-python/releases" + }, + { + "type": "link", + "label": "Code on GitHub", + "href": "https://github.com/SlackAPI/bolt-python" + }, + { + "type": "link", + "label": "Contributors Guide", + "href": "https://github.com/SlackAPI/bolt-python/blob/main/.github/contributing.md" + } +] diff --git a/docs/content/building-an-app.md b/docs/english/building-an-app.md similarity index 81% rename from docs/content/building-an-app.md rename to docs/english/building-an-app.md index deb3146b9..87b26163b 100644 --- a/docs/content/building-an-app.md +++ b/docs/english/building-an-app.md @@ -1,5 +1,4 @@ --- -title: Building an App with Bolt for Python sidebar_label: Building an App --- @@ -24,31 +23,31 @@ After you fill out an app name (_you can change it later_) and pick a workspace This page contains an overview of your app in addition to important credentials you'll need later. -![Basic Information page](/img/boltpy/basic-information-page.png "Basic Information page") +![Basic Information page](/img/bolt-python/basic-information-page.png "Basic Information page") Look around, add an app icon and description, and then let's start configuring your app 🔩 --- ### Tokens and installing apps {#tokens-and-installing-apps} -Slack apps use [OAuth to manage access to Slack's APIs](https://docs.slack.dev/authentication/installing-with-oauth). When an app is installed, you'll receive a token that the app can use to call API methods. +Slack apps use [OAuth to manage access to Slack's APIs](/authentication/installing-with-oauth). When an app is installed, you'll receive a token that the app can use to call API methods. There are three main token types available to a Slack app: user (`xoxp`), bot (`xoxb`), and app-level (`xapp`) tokens. -- [User tokens](https://docs.slack.dev/authentication/tokens#user) allow you to call API methods on behalf of users after they install or authenticate the app. There may be several user tokens for a single workspace. -- [Bot tokens](https://docs.slack.dev/authentication/tokens#bot) are associated with bot users, and are only granted once in a workspace where someone installs the app. The bot token your app uses will be the same no matter which user performed the installation. Bot tokens are the token type that _most_ apps use. -- [App-level tokens](https://docs.slack.dev/authentication/tokens#app-level) represent your app across organizations, including installations by all individual users on all workspaces in a given organization and are commonly used for creating WebSocket connections to your app. +- [User tokens](/authentication/tokens#user) allow you to call API methods on behalf of users after they install or authenticate the app. There may be several user tokens for a single workspace. +- [Bot tokens](/authentication/tokens#bot) are associated with bot users, and are only granted once in a workspace where someone installs the app. The bot token your app uses will be the same no matter which user performed the installation. Bot tokens are the token type that _most_ apps use. +- [App-level tokens](/authentication/tokens#app-level) represent your app across organizations, including installations by all individual users on all workspaces in a given organization and are commonly used for creating WebSocket connections to your app. We're going to use bot and app-level tokens for this guide. 1. Navigate to **OAuth & Permissions** on the left sidebar and scroll down to the **Bot Token Scopes** section. Click **Add an OAuth Scope**. -2. For now, we'll just add one scope: [`chat:write`](https://docs.slack.dev/reference/scopes/chat.write). This grants your app the permission to post messages in channels it's a member of. +2. For now, we'll just add one scope: [`chat:write`](/reference/scopes/chat.write). This grants your app the permission to post messages in channels it's a member of. 3. Scroll up to the top of the **OAuth & Permissions** page and click **Install App to Workspace**. You'll be led through Slack's OAuth UI, where you should allow your app to be installed to your development workspace. 4. Once you authorize the installation, you'll land on the **OAuth & Permissions** page and see a **Bot User OAuth Access Token**. -![OAuth Tokens](/img/boltpy/bot-token.png "Bot OAuth Token") +![OAuth Tokens](/img/bolt-python/bot-token.png "Bot OAuth Token") 5. Head over to **Basic Information** and scroll down under the App Token section and click **Generate Token and Scopes** to generate an app-level token. Add the `connections:write` scope to this token and save the generated `xapp` token. @@ -56,7 +55,7 @@ We're going to use bot and app-level tokens for this guide. :::tip[Not sharing is sometimes caring] -Treat your tokens like passwords and [keep them safe](https://docs.slack.dev/authentication/best-practices-for-security). Your app uses tokens to post and retrieve information from Slack workspaces. +Treat your tokens like passwords and [keep them safe](/authentication/best-practices-for-security). Your app uses tokens to post and retrieve information from Slack workspaces. ::: @@ -104,7 +103,7 @@ $ export SLACK_APP_TOKEN= :::warning[Keep it secret. Keep it safe.] -Remember to keep your tokens secure. At a minimum, you should avoid checking them into public version control, and access them via environment variables as we've done above. Check out the API documentation for more on [best practices for app security](https://docs.slack.dev/authentication/best-practices-for-security). +Remember to keep your tokens secure. At a minimum, you should avoid checking them into public version control, and access them via environment variables as we've done above. Check out the API documentation for more on [best practices for app security](/authentication/best-practices-for-security). ::: @@ -142,9 +141,9 @@ Your app should let you know that it's up and running. 🎉 ### Setting up events {#setting-up-events} Your app behaves similarly to people on your team — it can post messages, add emoji reactions, and listen and respond to events. -To listen for events happening in a Slack workspace (like when a message is posted or when a reaction is posted to a message) you'll use the [Events API to subscribe to event types](https://docs.slack.dev/apis/events-api/). +To listen for events happening in a Slack workspace (like when a message is posted or when a reaction is posted to a message) you'll use the [Events API to subscribe to event types](/apis/events-api/). -For those just starting, we recommend using [Socket Mode](https://docs.slack.dev/apis/events-api/using-socket-mode). Socket Mode allows your app to use the Events API and interactive features without exposing a public HTTP Request URL. This can be helpful during development, or if you're receiving requests from behind a firewall. +For those just starting, we recommend using [Socket Mode](/apis/events-api/using-socket-mode). Socket Mode allows your app to use the Events API and interactive features without exposing a public HTTP Request URL. This can be helpful during development, or if you're receiving requests from behind a firewall. That being said, you're welcome to set up an app with a public HTTP Request URL. HTTP is more useful for apps being deployed to hosting environments to respond within a large corporate Slack workspaces/organization, or apps intended for distribution via the Slack Marketplace. @@ -169,11 +168,11 @@ When an event occurs, Slack will send your app some information about the event, 1. Go back to your app configuration page (click on the app [from your app management page](https://api.slack.com/apps)). Click **Event Subscriptions** on the left sidebar. Toggle the switch labeled **Enable Events**. -2. Add your Request URL. Slack will send HTTP POST requests corresponding to events to this [Request URL](https://docs.slack.dev/apis/events-api/#subscribing) endpoint. Bolt uses the `/slack/events` path to listen to all incoming requests (whether shortcuts, events, or interactivity payloads). When configuring your Request URL within your app configuration, you'll append `/slack/events`, e.g. `https:///slack/events`. 💡 As long as your Bolt app is still running, your URL should become verified. +2. Add your Request URL. Slack will send HTTP POST requests corresponding to events to this [Request URL](/apis/events-api/#subscribing) endpoint. Bolt uses the `/slack/events` path to listen to all incoming requests (whether shortcuts, events, or interactivity payloads). When configuring your Request URL within your app configuration, you'll append `/slack/events`, e.g. `https:///slack/events`. 💡 As long as your Bolt app is still running, your URL should become verified. :::tip[Using proxy services] -For local development, you can use a proxy service like ngrok to create a public URL and tunnel requests to your development environment. Refer to [ngrok's getting started guide](https://ngrok.com/docs#getting-started-expose) on how to create this tunnel. And when you get to hosting your app, we've collected some of the most common hosting providers Slack developers use to host their apps [on our API site](https://docs.slack.dev/distribution/hosting-slack-apps/). +For local development, you can use a proxy service like ngrok to create a public URL and tunnel requests to your development environment. Refer to [ngrok's getting started guide](https://ngrok.com/docs#getting-started-expose) on how to create this tunnel. And when you get to hosting your app, we've collected some of the most common hosting providers Slack developers use to host their apps [on our API site](/app-management/hosting-slack-apps). ::: @@ -181,10 +180,10 @@ For local development, you can use a proxy service like ngrok to create a public
    Navigate to **Event Subscriptions** on the left sidebar and toggle to enable. Under **Subscribe to Bot Events**, you can add events for your bot to respond to. There are four events related to messages: -- [`message.channels`](https://docs.slack.dev/reference/events/message.channels) listens for messages in public channels that your app is added to. -- [`message.groups`](https://docs.slack.dev/reference/events/message.groups) listens for messages in 🔒 private channels that your app is added to. -- [`message.im`](https://docs.slack.dev/reference/events/message.im) listens for messages in your app's DMs with users. -- [`message.mpim`](https://docs.slack.dev/reference/events/message.mpim) listens for messages in multi-person DMs that your app is added to. +- [`message.channels`](/reference/events/message.channels) listens for messages in public channels that your app is added to. +- [`message.groups`](/reference/events/message.groups) listens for messages in 🔒 private channels that your app is added to. +- [`message.im`](/reference/events/message.im) listens for messages in your app's DMs with users. +- [`message.mpim`](/reference/events/message.mpim) listens for messages in multi-person DMs that your app is added to. If you want your bot to listen to messages from everywhere it is added to, choose all four message events. After you’ve selected the events you want your bot to listen to, click the green **Save Changes** button. @@ -208,7 +207,7 @@ app = App(token=os.environ.get("SLACK_BOT_TOKEN")) # Listens to incoming messages that contain "hello" # To learn available listener arguments, -# visit https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html +# visit https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html @app.message("hello") def message_hello(message, say): # say() sends a message to the channel where the event was triggered @@ -234,7 +233,7 @@ app = App( # Listens to incoming messages that contain "hello" # To learn available listener arguments, -# visit https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html +# visit https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html @app.message("hello") def message_hello(message, say): # say() sends a message to the channel where the event was triggered @@ -268,9 +267,9 @@ With Socket Mode on, basic interactivity is enabled by default, so no further ac Similar to events, you'll need to specify a URL for Slack to send the action (such as _user clicked a button_). Back on your app configuration page, click on **Interactivity & Shortcuts** on the left side. You'll see that there's another **Request URL** box. -:::tip +:::tip[By default, Bolt is configured to use the same endpoint for interactive components that it uses for events, so use the same request URL as above (for example, `https://8e8ec2d7.ngrok.io/slack/events`).] -By default, Bolt is configured to use the same endpoint for interactive components that it uses for events, so use the same request URL as above (for example, `https://8e8ec2d7.ngrok.io/slack/events`). Press the **Save Changes** button in the lower right hand corner, and that's it. Your app is set up to handle interactivity! +Press the **Save Changes** button in the lower right hand corner, and that's it. Your app is set up to handle interactivity! ::: @@ -476,8 +475,8 @@ Now that you have a basic app up and running, you can start exploring how to mak * Read through the concepts pages to learn about the different methods and features your Bolt app has access to. -* Explore the different events your bot can listen to with the [`app.event()`](/concepts/event-listening) method. All of the events are listed [on the API docs site](https://docs.slack.dev/reference/events). +* Explore the different events your bot can listen to with the [`app.event()`](/tools/bolt-python/concepts/event-listening) method. All of the events are listed [on the API docs site](/reference/events). -* Bolt allows you to [call Web API methods](/concepts/web-api) with the client attached to your app. There are [over 200 methods](https://docs.slack.dev/reference/methods) on our API site. +* Bolt allows you to [call Web API methods](/tools/bolt-python/concepts/web-api) with the client attached to your app. There are [over 200 methods](/reference/methods) on our API site. -* Learn more about the different token types [on the API docs site](https://docs.slack.dev/authentication/tokens). Your app may need different tokens depending on the actions you want it to perform. +* Learn more about the different token types [on the API docs site](/authentication/tokens). Your app may need different tokens depending on the actions you want it to perform. diff --git a/docs/content/concepts/acknowledge.md b/docs/english/concepts/acknowledge.md similarity index 60% rename from docs/content/concepts/acknowledge.md rename to docs/english/concepts/acknowledge.md index 5e5c0ed25..7d91e0851 100644 --- a/docs/content/concepts/acknowledge.md +++ b/docs/english/concepts/acknowledge.md @@ -1,22 +1,16 @@ ---- -title: Acknowledging requests -lang: en -slug: /concepts/acknowledge ---- +# Acknowledging requests Actions, commands, shortcuts, options requests, and view submissions must **always** be acknowledged using the `ack()` function. This lets Slack know that the request was received so that it may update the Slack user interface accordingly. -Depending on the type of request, your acknowledgement may be different. For example, when acknowledging a menu selection associated with an external data source, you would call `ack()` with a list of relevant [options](https://docs.slack.dev/reference/block-kit/composition-objects/option-object/). When acknowledging a view submission, you may supply a `response_action` as part of your acknowledgement to [update the view](/concepts/view_submissions). +Depending on the type of request, your acknowledgement may be different. For example, when acknowledging a menu selection associated with an external data source, you would call `ack()` with a list of relevant [options](/reference/block-kit/composition-objects/option-object/). When acknowledging a view submission, you may supply a `response_action` as part of your acknowledgement to [update the view](/tools/bolt-python/concepts/view-submissions). We recommend calling `ack()` right away before initiating any time-consuming processes such as fetching information from your database or sending a new message, since you only have 3 seconds to respond before Slack registers a timeout error. -:::info - -When working in a FaaS / serverless environment, our guidelines for when to `ack()` are different. See the section on [Lazy listeners (FaaS)](/concepts/lazy-listeners) for more detail on this. +:::info[When working in a FaaS / serverless environment, our guidelines for when to `ack()` are different. See the section on [Lazy listeners (FaaS)](/tools/bolt-python/concepts/lazy-listeners) for more detail on this.] ::: -Refer to [the module document](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) to learn the available listener arguments. +Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. ```python # Example of responding to an external_select options request @app.options("menu_selection") diff --git a/docs/content/concepts/actions.md b/docs/english/concepts/actions.md similarity index 74% rename from docs/content/concepts/actions.md rename to docs/english/concepts/actions.md index 018642b4a..d7dfa6ba1 100644 --- a/docs/content/concepts/actions.md +++ b/docs/english/concepts/actions.md @@ -1,8 +1,4 @@ ---- -title: Listening & responding to actions -lang: en -slug: /concepts/actions ---- +# Listening & responding to actions Your app can listen and respond to user actions, like button clicks, and menu selects, using the `action` method. @@ -10,9 +6,9 @@ Your app can listen and respond to user actions, like button clicks, and menu se Actions can be filtered on an `action_id` parameter of type `str` or `re.Pattern`. The `action_id` parameter acts as a unique identifier for interactive components on the Slack platform. -You'll notice in all `action()` examples, `ack()` is used. It is required to call the `ack()` function within an action listener to acknowledge that the request was received from Slack. This is discussed in the [acknowledging requests guide](/concepts/acknowledge). +You'll notice in all `action()` examples, `ack()` is used. It is required to call the `ack()` function within an action listener to acknowledge that the request was received from Slack. This is discussed in the [acknowledging requests guide](/tools/bolt-python/concepts/acknowledge). -Refer to [the module document](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) to learn the available listener arguments. +Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. ```python # Your listener will be called every time a block element with the action_id "approve_button" is triggered @@ -49,7 +45,7 @@ There are two main ways to respond to actions. The first (and most common) way i The second way to respond to actions is using `respond()`, which is a utility to use the `response_url` associated with the action. -Refer to [the module document](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) to learn the available listener arguments. +Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. ```python # Your listener will be called every time an interactive component with the action_id “approve_button” is triggered @@ -62,7 +58,7 @@ def approve_request(ack, say): ### Using `respond()` method -Since `respond()` is a utility for calling the `response_url`, it behaves in the same way. You can pass [all the message payload properties](https://docs.slack.dev/messaging/#payloads) as keyword arguments along with optional properties like `response_type` (which has a value of `"in_channel"` or `"ephemeral"`), `replace_original`, `delete_original`, `unfurl_links`, and `unfurl_media`. With that, your app can send a new message payload that will be published back to the source of the original interaction. +Since `respond()` is a utility for calling the `response_url`, it behaves in the same way. You can pass [all the message payload properties](/messaging/#payloads) as keyword arguments along with optional properties like `response_type` (which has a value of `"in_channel"` or `"ephemeral"`), `replace_original`, `delete_original`, `unfurl_links`, and `unfurl_media`. With that, your app can send a new message payload that will be published back to the source of the original interaction. ```python # Listens to actions triggered with action_id of “user_select” diff --git a/docs/content/concepts/adapters.md b/docs/english/concepts/adapters.md similarity index 97% rename from docs/content/concepts/adapters.md rename to docs/english/concepts/adapters.md index ad4303b15..321dae0ab 100644 --- a/docs/content/concepts/adapters.md +++ b/docs/english/concepts/adapters.md @@ -1,8 +1,4 @@ ---- -title: Adapters -lang: en -slug: /concepts/adapters ---- +# Adapters Adapters are responsible for handling and parsing incoming requests from Slack to conform to [`BoltRequest`](https://github.com/slackapi/bolt-python/blob/main/slack_bolt/request/request.py), then dispatching those requests to your Bolt app. diff --git a/docs/content/concepts/ai-apps.md b/docs/english/concepts/ai-apps.md similarity index 79% rename from docs/content/concepts/ai-apps.md rename to docs/english/concepts/ai-apps.md index a8da2bf1f..b294c6688 100644 --- a/docs/content/concepts/ai-apps.md +++ b/docs/english/concepts/ai-apps.md @@ -1,40 +1,36 @@ ---- -title: Using AI in Apps -lang: en -slug: /concepts/ai-apps ---- +# Using AI in Apps -:::info This feature requires a paid plan +:::info[This feature requires a paid plan] If you don't have a paid workspace for development, you can join the [Developer Program](https://api.slack.com/developer-program) and provision a sandbox with access to all Slack features for free. ::: -The Agents & AI Apps feature comprises a unique messaging experience for Slack. If you're unfamiliar with using the Agents & AI Apps feature within Slack, you'll want to read the [API documentation on the subject](https://docs.slack.dev/ai/). Then come back here to implement them with Bolt! +The Agents & AI Apps feature comprises a unique messaging experience for Slack. If you're unfamiliar with using the Agents & AI Apps feature within Slack, you'll want to read the [API documentation on the subject](/ai/). Then come back here to implement them with Bolt! ## Configuring your app to support AI features {#configuring-your-app} 1. Within [App Settings](https://api.slack.com/apps), enable the **Agents & AI Apps** feature. 2. Within the App Settings **OAuth & Permissions** page, add the following scopes: -* [`assistant:write`](https://docs.slack.dev/reference/scopes/assistant.write) -* [`chat:write`](https://docs.slack.dev/reference/scopes/chat.write) -* [`im:history`](https://docs.slack.dev/reference/scopes/im.history) +* [`assistant:write`](/reference/scopes/assistant.write) +* [`chat:write`](/reference/scopes/chat.write) +* [`im:history`](/reference/scopes/im.history) 3. Within the App Settings **Event Subscriptions** page, subscribe to the following events: -* [`assistant_thread_started`](https://docs.slack.dev/reference/events/assistant_thread_started) -* [`assistant_thread_context_changed`](https://docs.slack.dev/reference/events/assistant_thread_context_changed) -* [`message.im`](https://docs.slack.dev/reference/events/message.im) +* [`assistant_thread_started`](/reference/events/assistant_thread_started) +* [`assistant_thread_context_changed`](/reference/events/assistant_thread_context_changed) +* [`message.im`](/reference/events/message.im) -:::info -You _could_ go it alone and [listen](event-listening) for the `assistant_thread_started`, `assistant_thread_context_changed`, and `message.im` events (see implementation details below) in order to implement the AI features in your app. That being said, using the `Assistant` class will streamline the process. And we already wrote this nice guide for you! -::: +:::info[You _could_ implement your own AI app by [listening](event-listening) for the `assistant_thread_started`, `assistant_thread_context_changed`, and `message.im` events (see implementation details below).] + +That being said, using the `Assistant` class will streamline the process. And we already wrote this nice guide for you! ## The `Assistant` class instance {#assistant-class} The `Assistant` class can be used to handle the incoming events expected from a user interacting with an app in Slack that has the Agents & AI Apps feature enabled. A typical flow would look like: -1. [The user starts a thread](#handling-a-new-thread). The `Assistant` class handles the incoming [`assistant_thread_started`](https://docs.slack.dev/reference/events/assistant_thread_started) event. -2. [The thread context may change at any point](#handling-thread-context-changes). The `Assistant` class can handle any incoming [`assistant_thread_context_changed`](https://docs.slack.dev/reference/events/assistant_thread_context_changed) events. The class also provides a default context store to keep track of thread context changes as the user moves through Slack. -3. [The user responds](#handling-the-user-response). The `Assistant` class handles the incoming [`message.im`](https://docs.slack.dev/reference/events/message.im) event. +1. [The user starts a thread](#handling-a-new-thread). The `Assistant` class handles the incoming [`assistant_thread_started`](/reference/events/assistant_thread_started) event. +2. [The thread context may change at any point](#handling-thread-context-changes). The `Assistant` class can handle any incoming [`assistant_thread_context_changed`](/reference/events/assistant_thread_context_changed) events. The class also provides a default context store to keep track of thread context changes as the user moves through Slack. +3. [The user responds](#handling-the-user-response). The `Assistant` class handles the incoming [`message.im`](/reference/events/message.im) event. ```python @@ -97,25 +93,25 @@ def respond_in_assistant_thread( app.use(assistant) ``` -While the `assistant_thread_started` and `assistant_thread_context_changed` events do provide Slack-client thread context information, the `message.im` event does not. Any subsequent user message events won't contain thread context data. For that reason, Bolt not only provides a way to store thread context — the `threadContextStore` property — but it also provides an instance that is utilized by default. This implementation relies on storing and retrieving [message metadata](https://docs.slack.dev/messaging/message-metadata/) as the user interacts with the app. +While the `assistant_thread_started` and `assistant_thread_context_changed` events do provide Slack-client thread context information, the `message.im` event does not. Any subsequent user message events won't contain thread context data. For that reason, Bolt not only provides a way to store thread context — the `threadContextStore` property — but it also provides an instance that is utilized by default. This implementation relies on storing and retrieving [message metadata](/messaging/message-metadata/) as the user interacts with the app. If you do provide your own `threadContextStore` property, it must feature `get` and `save` methods. -:::tip -Refer to the [module document](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) to learn the available listener arguments. +:::tip[Refer to the [module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments.] ::: ## Handling a new thread {#handling-a-new-thread} -When the user opens a new thread with your AI-enabled app, the [`assistant_thread_started`](https://docs.slack.dev/reference/events/assistant_thread_started) event will be sent to your app. +When the user opens a new thread with your AI-enabled app, the [`assistant_thread_started`](/reference/events/assistant_thread_started) event will be sent to your app. + +:::tip[When a user opens an app thread while in a channel, the channel info is stored as the thread's `AssistantThreadContext` data.] -:::tip -When a user opens an app thread while in a channel, the channel info is stored as the thread's `AssistantThreadContext` data. You can grab that info by using the `get_thread_context` utility, as subsequent user message event payloads won't include the channel info. +You can grab that info by using the `get_thread_context` utility, as subsequent user message event payloads won't include the channel info. ::: ### Block Kit interactions in the app thread {#block-kit-interactions} -For advanced use cases, Block Kit buttons may be used instead of suggested prompts, as well as the sending of messages with structured [metadata](https://docs.slack.dev/messaging/message-metadata/) to trigger subsequent interactions with the user. +For advanced use cases, Block Kit buttons may be used instead of suggested prompts, as well as the sending of messages with structured [metadata](/messaging/message-metadata/) to trigger subsequent interactions with the user. For example, an app can display a button such as "Summarize the referring channel" in the initial reply. When the user clicks the button and submits detailed information (such as the number of messages, days to check, purpose of the summary, etc.), the app can handle that information and post a message that describes the request with structured metadata. @@ -241,9 +237,9 @@ def respond_to_bot_messages(logger: logging.Logger, set_status: SetStatus, say: ## Handling thread context changes {#handling-thread-context-changes} -When the user switches channels, the [`assistant_thread_context_changed`](https://docs.slack.dev/reference/events/assistant_thread_context_changed) event will be sent to your app. +When the user switches channels, the [`assistant_thread_context_changed`](/reference/events/assistant_thread_context_changed) event will be sent to your app. -If you use the built-in `Assistant` middleware without any custom configuration, the updated context data is automatically saved as [message metadata](https://docs.slack.dev/messaging/message-metadata/) of the first reply from the app. +If you use the built-in `Assistant` middleware without any custom configuration, the updated context data is automatically saved as [message metadata](/messaging/message-metadata/) of the first reply from the app. As long as you use the built-in approach, you don't need to store the context data within a datastore. The downside of this default behavior is the overhead of additional calls to the Slack API. These calls include those to `conversations.history`, which are used to look up the stored message metadata that contains the thread context (via `get_thread_context`). @@ -256,14 +252,14 @@ assistant = Assistant(thread_context_store=FileAssistantThreadContextStore()) ## Handling the user response {#handling-the-user-response} -When the user messages your app, the [`message.im`](https://docs.slack.dev/reference/events/message.im) event will be sent to your app. +When the user messages your app, the [`message.im`](/reference/events/message.im) event will be sent to your app. -Messages sent to the app do not contain a [subtype](https://docs.slack.dev/reference/events/message#subtypes) and must be deduced based on their shape and any provided [message metadata](https://docs.slack.dev/messaging/message-metadata/). +Messages sent to the app do not contain a [subtype](/reference/events/message#subtypes) and must be deduced based on their shape and any provided [message metadata](/messaging/message-metadata/). There are three utilities that are particularly useful in curating the user experience: -* [`say`](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/#slack_bolt.Say) -* [`setTitle`](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/#slack_bolt.SetTitle) -* [`setStatus`](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/#slack_bolt.SetStatus) +* [`say`](https://docs.slack.dev/tools/bolt-python/reference/#slack_bolt.Say) +* [`setTitle`](https://docs.slack.dev/tools/bolt-python/reference/#slack_bolt.SetTitle) +* [`setStatus`](https://docs.slack.dev/tools/bolt-python/reference/#slack_bolt.SetStatus) ```python ... diff --git a/docs/content/concepts/app-home.md b/docs/english/concepts/app-home.md similarity index 52% rename from docs/content/concepts/app-home.md rename to docs/english/concepts/app-home.md index d29bfc4d6..8b0e2cf11 100644 --- a/docs/content/concepts/app-home.md +++ b/docs/english/concepts/app-home.md @@ -1,14 +1,10 @@ ---- -title: Publishing views to App Home -lang: en -slug: /concepts/app-home ---- +# Publishing views to App Home -[Home tabs](https://docs.slack.dev/surfaces/app-home) are customizable surfaces accessible via the sidebar and search that allow apps to display views on a per-user basis. After enabling App Home within your app configuration, home tabs can be published and updated by passing a `user_id` and [view payload](https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission) to the [`views.publish`](https://docs.slack.dev/reference/methods/views.publis) method. +[Home tabs](/surfaces/app-home) are customizable surfaces accessible via the sidebar and search that allow apps to display views on a per-user basis. After enabling App Home within your app configuration, home tabs can be published and updated by passing a `user_id` and [view payload](/reference/interaction-payloads/view-interactions-payload/#view_submission) to the [`views.publish`](/reference/methods/views.publish) method. -You can subscribe to the [`app_home_opened`](https://docs.slack.dev/reference/events/app_home_opened) event to listen for when users open your App Home. +You can subscribe to the [`app_home_opened`](/reference/events/app_home_opened) event to listen for when users open your App Home. -Refer to [the module document](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) to learn the available listener arguments. +Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. ```python @app.event("app_home_opened") def update_home_tab(client, event, logger): @@ -32,7 +28,7 @@ def update_home_tab(client, event, logger): "type": "section", "text": { "type": "mrkdwn", - "text": "Learn how home tabs can be more useful and interactive ." + "text": "Learn how home tabs can be more useful and interactive ." } } ] diff --git a/docs/content/concepts/async.md b/docs/english/concepts/async.md similarity index 97% rename from docs/content/concepts/async.md rename to docs/english/concepts/async.md index 197377f93..e6ae28fc6 100644 --- a/docs/content/concepts/async.md +++ b/docs/english/concepts/async.md @@ -1,8 +1,4 @@ ---- -title: Using async (asyncio) -lang: en -slug: /concepts/async ---- +# Using async (asyncio) To use the async version of Bolt, you can import and initialize an `AsyncApp` instance (rather than `App`). `AsyncApp` relies on [AIOHTTP](https://docs.aiohttp.org) to make API requests, which means you'll need to install `aiohttp` (by adding to `requirements.txt` or running `pip install aiohttp`). diff --git a/docs/content/concepts/authenticating-oauth.md b/docs/english/concepts/authenticating-oauth.md similarity index 89% rename from docs/content/concepts/authenticating-oauth.md rename to docs/english/concepts/authenticating-oauth.md index 1fabe3522..88b422949 100644 --- a/docs/content/concepts/authenticating-oauth.md +++ b/docs/english/concepts/authenticating-oauth.md @@ -1,18 +1,14 @@ ---- -title: Authenticating with OAuth -lang: en -slug: /concepts/authenticating-oauth ---- +# Authenticating with OAuth -Slack apps installed on multiple workspaces will need to implement OAuth, then store installation information (like access tokens) securely. By providing `client_id`, `client_secret`, `scopes`, `installation_store`, and `state_store` when initializing App, Bolt for Python will handle the work of setting up OAuth routes and verifying state. If you're implementing a custom adapter, you can make use of our [OAuth library](https://tools.slack.dev/python-slack-sdk/oauth/), which is what Bolt for Python uses under the hood. +Slack apps installed on multiple workspaces will need to implement OAuth, then store installation information (like access tokens) securely. By providing `client_id`, `client_secret`, `scopes`, `installation_store`, and `state_store` when initializing App, Bolt for Python will handle the work of setting up OAuth routes and verifying state. If you're implementing a custom adapter, you can make use of our [OAuth library](/tools/python-slack-sdk/oauth/), which is what Bolt for Python uses under the hood. Bolt for Python will create a **Redirect URL** `slack/oauth_redirect`, which Slack uses to redirect users after they complete your app's installation flow. You will need to add this **Redirect URL** in your app configuration settings under **OAuth and Permissions**. This path can be configured in the `OAuthSettings` argument described below. Bolt for Python will also create a `slack/install` route, where you can find an **Add to Slack** button for your app to perform direct installs of your app. If you need any additional authorizations (user tokens) from users inside a team when your app is already installed or a reason to dynamically generate an install URL, you can pass your own custom URL generator to `oauth_settings` as `authorize_url_generator`. -Bolt for Python automatically includes support for [org wide installations](https://docs.slack.dev/enterprise-grid/) in version `1.1.0+`. Org wide installations can be enabled in your app configuration settings under **Org Level Apps**. +Bolt for Python automatically includes support for [org wide installations](/enterprise-grid/) in version `1.1.0+`. Org wide installations can be enabled in your app configuration settings under **Org Level Apps**. -To learn more about the OAuth installation flow with Slack, [read the API documentation](https://docs.slack.dev/authentication/installing-with-oauth). +To learn more about the OAuth installation flow with Slack, [read the API documentation](/authentication/installing-with-oauth). ```python import os diff --git a/docs/content/concepts/authorization.md b/docs/english/concepts/authorization.md similarity index 94% rename from docs/content/concepts/authorization.md rename to docs/english/concepts/authorization.md index 4c293b5c2..242a86b39 100644 --- a/docs/content/concepts/authorization.md +++ b/docs/english/concepts/authorization.md @@ -1,12 +1,8 @@ ---- -title: Authorization -lang: en -slug: /concepts/authorization ---- +# Authorization Authorization is the process of determining which Slack credentials should be available while processing an incoming Slack request. -Apps installed on a single workspace can simply pass their bot token into the `App` constructor using the `token` parameter. However, if your app will be installed on multiple workspaces, you have two options. The easier option is to use the built-in OAuth support. This will handle setting up OAuth routes and verifying state. Read the section on [authenticating with OAuth](/concepts/authenticating-oauth) for details. +Apps installed on a single workspace can simply pass their bot token into the `App` constructor using the `token` parameter. However, if your app will be installed on multiple workspaces, you have two options. The easier option is to use the built-in OAuth support. This will handle setting up OAuth routes and verifying state. Read the section on [authenticating with OAuth](/tools/bolt-python/concepts/authenticating-oauth) for details. For a more custom solution, you can set the `authorize` parameter to a function upon `App` instantiation. The `authorize` function should return [an instance of `AuthorizeResult`](https://github.com/slackapi/bolt-python/blob/main/slack_bolt/authorization/authorize_result.py), which contains information about who and where the request is coming from. diff --git a/docs/content/concepts/commands.md b/docs/english/concepts/commands.md similarity index 74% rename from docs/content/concepts/commands.md rename to docs/english/concepts/commands.md index 4c99f6628..81167fb83 100644 --- a/docs/content/concepts/commands.md +++ b/docs/english/concepts/commands.md @@ -1,18 +1,14 @@ ---- -title: Listening & responding to commands -lang: en -slug: /concepts/commands ---- +# Listening & responding to commands Your app can use the `command()` method to listen to incoming slash command requests. The method requires a `command_name` of type `str`. Commands must be acknowledged with `ack()` to inform Slack your app has received the request. -There are two ways to respond to slash commands. The first way is to use `say()`, which accepts a string or JSON payload. The second is `respond()` which is a utility for the `response_url`. These are explained in more depth in the [responding to actions](/concepts/actions) section. +There are two ways to respond to slash commands. The first way is to use `say()`, which accepts a string or JSON payload. The second is `respond()` which is a utility for the `response_url`. These are explained in more depth in the [responding to actions](/tools/bolt-python/concepts/actions) section. When setting up commands within your app configuration, you'll append `/slack/events` to your request URL. -Refer to [the module document](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) to learn the available listener arguments. +Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. ```python # The echo command simply echoes on command @app.command("/echo") diff --git a/docs/content/concepts/context.md b/docs/english/concepts/context.md similarity index 96% rename from docs/content/concepts/context.md rename to docs/english/concepts/context.md index cf7fa45f1..fb134c896 100644 --- a/docs/content/concepts/context.md +++ b/docs/english/concepts/context.md @@ -1,8 +1,4 @@ ---- -title: Adding context -lang: en -slug: /concepts/context ---- +# Adding context All listeners have access to a `context` dictionary, which can be used to enrich requests with additional information. Bolt automatically attaches information that is included in the incoming request, like `user_id`, `team_id`, `channel_id`, and `enterprise_id`. diff --git a/docs/content/concepts/custom-adapters.md b/docs/english/concepts/custom-adapters.md similarity index 92% rename from docs/content/concepts/custom-adapters.md rename to docs/english/concepts/custom-adapters.md index 55c73130d..62532e7cd 100644 --- a/docs/content/concepts/custom-adapters.md +++ b/docs/english/concepts/custom-adapters.md @@ -1,10 +1,6 @@ ---- -title: Custom adapters -lang: en -slug: /concepts/custom-adapters ---- +# Custom adapters -[Adapters](/concepts/adapters) are flexible and can be adjusted based on the framework you prefer. There are two necessary components of adapters: +[Adapters](/tools/bolt-python/concepts/adapters) are flexible and can be adjusted based on the framework you prefer. There are two necessary components of adapters: - `__init__(app: App)`: Constructor that accepts and stores an instance of the Bolt `App`. - `handle(req: Request)`: Function (typically named `handle()`) that receives incoming Slack requests, parses them to conform to an instance of [`BoltRequest`](https://github.com/slackapi/bolt-python/blob/main/slack_bolt/request/request.py), then dispatches them to the stored Bolt app. diff --git a/docs/content/concepts/custom-steps-dynamic-options.md b/docs/english/concepts/custom-steps-dynamic-options.md similarity index 75% rename from docs/content/concepts/custom-steps-dynamic-options.md rename to docs/english/concepts/custom-steps-dynamic-options.md index cab3f7a61..9a152daa0 100644 --- a/docs/content/concepts/custom-steps-dynamic-options.md +++ b/docs/english/concepts/custom-steps-dynamic-options.md @@ -2,7 +2,7 @@ ## Background {#background} -[Legacy steps from apps](https://docs.slack.dev/changelog/2023-08-workflow-steps-from-apps-step-back) previously enabled Slack apps to create and process custom workflow steps, which could then be shared and used by anyone in Workflow Builder. To support your transition away from them, custom steps used as dynamic options are available. These allow you to use data defined when referencing the step in Workflow Builder as inputs to the step. +[Legacy steps from apps](/changelog/2023-08-workflow-steps-from-apps-step-back) previously enabled Slack apps to create and process custom workflow steps, which could then be shared and used by anyone in Workflow Builder. To support your transition away from them, custom steps used as dynamic options are available. These allow you to use data defined when referencing the step in Workflow Builder as inputs to the step. ## Example use case {#use-case} @@ -88,13 +88,13 @@ The `inputs` attribute defines the parameters to be passed as inputs to the step The following format can be used to reference any input parameter defined by the step: `{{input_parameters.}}`. -In addition, the `{{client.query}}` parameter can be used as a placeholder for an input value. The `{{client.builder_context}}` parameter will inject the [`slack#/types/user_context`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types/#usercontext) of the user building the workflow as the value to the input parameter. +In addition, the `{{client.query}}` parameter can be used as a placeholder for an input value. The `{{client.builder_context}}` parameter will inject the [`slack#/types/user_context`](/tools/deno-slack-sdk/reference/slack-types/#usercontext) of the user building the workflow as the value to the input parameter. ### Types of dynamic options UIs {#dynamic-option-UIs} The above example demonstrates one possible UI to be rendered for builders: a single-select drop-down menu of dynamic options. However, dynamic options in Workflow Builder can be rendered in one of two ways: as a drop-down menu (single-select or multi-select), or as a set of fields. -The type is dictated by the output parameter of the custom step used as a dynamic option. In order to use a custom step in a dynamic option context, its output must adhere to a defined interface, that is, it must have an `options` parameter of type [`options_select`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#options_select) or [`options_field`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#options_field), as shown in the following code snippet. +The type is dictated by the output parameter of the custom step used as a dynamic option. In order to use a custom step in a dynamic option context, its output must adhere to a defined interface, that is, it must have an `options` parameter of type [`options_select`](/tools/deno-slack-sdk/reference/slack-types#options_select) or [`options_field`](/tools/deno-slack-sdk/reference/slack-types#options_field), as shown in the following code snippet. ```js "output_parameters": { @@ -109,9 +109,9 @@ The type is dictated by the output parameter of the custom step used as a dynami #### Drop-down menus {#drop-down} -Your dynamic input parameter can be rendered as a drop-down menu, which will use the options obtained from a custom step with an `options` output parameter of the type [`options_select`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#options_select). +Your dynamic input parameter can be rendered as a drop-down menu, which will use the options obtained from a custom step with an `options` output parameter of the type [`options_select`](/tools/deno-slack-sdk/reference/slack-types#options_select). -The drop-down menu UI component can be rendered in two ways: single-select, or multi-select. To render the dynamic input as a single-select menu, the input parameter defining the dynamic option must be of the type [`string`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#string). +The drop-down menu UI component can be rendered in two ways: single-select, or multi-select. To render the dynamic input as a single-select menu, the input parameter defining the dynamic option must be of the type [`string`](/tools/deno-slack-sdk/reference/slack-types#string). ```js "step-with-dynamic-input": { @@ -133,7 +133,7 @@ The drop-down menu UI component can be rendered in two ways: single-select, or m } ``` -To render the dynamic input as a multi-select menu, the input parameter defining the dynamic option must be of the type [`array`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#array), and its `items` must be of type [`string`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#string). +To render the dynamic input as a multi-select menu, the input parameter defining the dynamic option must be of the type [`array`](/tools/deno-slack-sdk/reference/slack-types#array), and its `items` must be of type [`string`](/tools/deno-slack-sdk/reference/slack-types#string). ```js "step-with-dynamic-input": { @@ -159,9 +159,9 @@ To render the dynamic input as a multi-select menu, the input parameter defining #### Fields {#fields} -In the code snippet below, the input parameter is rendered as a set of fields with keys and values. The option fields are obtained from a custom step with an `options` output parameter of type [`options_field`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#options_field). +In the code snippet below, the input parameter is rendered as a set of fields with keys and values. The option fields are obtained from a custom step with an `options` output parameter of type [`options_field`](/tools/deno-slack-sdk/reference/slack-types#options_field). -The input parameter that defines the dynamic option must be of type [`object`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#object), as the completed set of fields in Workflow Builder will be passed to the custom step as an [untyped object](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#untyped-object) during workflow execution. +The input parameter that defines the dynamic option must be of type [`object`](/tools/deno-slack-sdk/reference/slack-types#object), as the completed set of fields in Workflow Builder will be passed to the custom step as an [untyped object](/tools/deno-slack-sdk/reference/slack-types#untyped-object) during workflow execution. ```js "test-field-dynamic-options": { @@ -185,20 +185,20 @@ The input parameter that defines the dynamic option must be of type [`object`](h ### Dynamic option types {#dynamic-option-types} -As mentioned earlier, in order to use a custom step as a dynamic option, its output must adhere to a defined interface: it must have an `options` output parameter of the type either [`options_select`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#options_select) or [`options_field`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#options_field). +As mentioned earlier, in order to use a custom step as a dynamic option, its output must adhere to a defined interface: it must have an `options` output parameter of the type either [`options_select`](/tools/deno-slack-sdk/reference/slack-types#options_select) or [`options_field`](/tools/deno-slack-sdk/reference/slack-types#options_field). -To take a look at these in more detail, refer to our [Options Slack type](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#options) documentation. +To take a look at these in more detail, refer to our [Options Slack type](/tools/deno-slack-sdk/reference/slack-types#options) documentation. ## Dynamic options handler {#dynamic-option-handler} Each custom step defined in the manifest needs a corresponding handler in your Slack app. Although implemented similarly to existing function execution event handlers, there are two key differences between regular custom step invocations and those used for dynamic options: -* The custom step must have an `options` output parameter that is of type [`options_select`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#options_select) or [`options_field`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#options_field). -* The [`function_executed`](https://docs.slack.dev/reference/events/function_executed) event must be handled synchronously. This optimizes the response time of returned dynamic options and provides a crisp builder experience. +* The custom step must have an `options` output parameter that is of type [`options_select`](/tools/deno-slack-sdk/reference/slack-types#options_select) or [`options_field`](/tools/deno-slack-sdk/reference/slack-types#options_field). +* The [`function_executed`](/reference/events/function_executed) event must be handled synchronously. This optimizes the response time of returned dynamic options and provides a crisp builder experience. ### Asynchronous event handling {#async} -By default, the [Bolt family of frameworks](https://tools.slack.dev/) handles `function_executed` events asynchronously. +By default, the Bolt family of frameworks handles `function_executed` events asynchronously. For example, the various modal-related API methods provide two ways to update a view: synchronously using a `response_action` HTTP response, or asynchronously using a separate HTTP API call. Using the asynchronous approach allows developers to handle events free of timeouts, but this isn't desired for dynamic options as it introduces delays and violates our stated goal of providing a crisp builder experience. @@ -208,13 +208,13 @@ Dynamic options support synchronous handling of `function_executed` events. By e ### Implementation {#implementation} -To optimize the response time of dynamic options, you must acknowledge the incoming event after calling the [`function.completeSuccess`](https://docs.slack.dev/reference/methods/functions.completeSuccess) or [`function.completeError`](https://docs.slack.dev/reference/methods/functions.completeError) API methods, minimizing asynchronous latency. The `function.completeSuccess` and `function.completeError` API methods are invoked in the complete and fail helper functions. ([For example](https://github.com/slackapi/bolt-python?tab=readme-ov-file#making-things-happen)). +To optimize the response time of dynamic options, you must acknowledge the incoming event after calling the [`function.completeSuccess`](/reference/methods/functions.completeSuccess) or [`function.completeError`](/reference/methods/functions.completeError) API methods, minimizing asynchronous latency. The `function.completeSuccess` and `function.completeError` API methods are invoked in the complete and fail helper functions. ([For example](https://github.com/slackapi/bolt-python?tab=readme-ov-file#making-things-happen)). A new `auto_acknowledge` flag allows you more granular control over whether specific event handlers should operate in synchronous or asynchronous response modes in order to enable a smooth dynamic options experience. #### Example {#bolt-py} -In [Bolt for Python](https://tools.slack.dev/bolt-python/), you can set `auto_acknowledge=False` on a specific function decorator. This allows you to manually control when the `ack()` event acknowledgement helper function is executed. It flips Bolt to synchronous `function_executed` event handling mode for the specific handler. +In [Bolt for Python](https://docs.slack.dev/tools/bolt-python/), you can set `auto_acknowledge=False` on a specific function decorator. This allows you to manually control when the `ack()` event acknowledgement helper function is executed. It flips Bolt to synchronous `function_executed` event handling mode for the specific handler. ```py @app.function("get-projects", auto_acknowledge=False) @@ -244,4 +244,4 @@ def handle_get_projects(ack: Ack, complete: Complete): ack() ``` -✨ **To learn more about the Bolt family of frameworks and tools**, check out our [Slack Developer Tools](https://tools.slack.dev/). +✨ **To learn more about the Bolt family of frameworks and tools**, check out our [Slack Developer Tools](/tools). diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/custom-steps.md b/docs/english/concepts/custom-steps.md similarity index 86% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/custom-steps.md rename to docs/english/concepts/custom-steps.md index e022c3e38..720c53421 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/custom-steps.md +++ b/docs/english/concepts/custom-steps.md @@ -1,17 +1,17 @@ --- -title: Listening and responding to custom steps -lang: ja-jp -slug: /concepts/custom-steps +sidebar_label: Custom steps --- -Your app can use the `function()` method to listen to incoming [custom step requests](https://docs.slack.dev/workflows/workflow-steps). Custom steps are used in Workflow Builder to build workflows. The method requires a step `callback_id` of type `str`. This `callback_id` must also be defined in your [Function](https://docs.slack.dev/reference/app-manifest#functions) definition. Custom steps must be finalized using the `complete()` or `fail()` listener arguments to notify Slack that your app has processed the request. +# Listening and responding to custom steps + +Your app can use the `function()` method to listen to incoming [custom step requests](/workflows/workflow-steps). Custom steps are used in Workflow Builder to build workflows. The method requires a step `callback_id` of type `str`. This `callback_id` must also be defined in your [Function](/reference/app-manifest#functions) definition. Custom steps must be finalized using the `complete()` or `fail()` listener arguments to notify Slack that your app has processed the request. * `complete()` requires **one** argument: `outputs` of type `dict`. It ends your custom step **successfully** and provides a dictionary containing the outputs of your custom step as per its definition. * `fail()` requires **one** argument: `error` of type `str`. It ends your custom step **unsuccessfully** and provides a message containing information regarding why your custom step failed. You can reference your custom step's inputs using the `inputs` listener argument of type `dict`. -Refer to [the module document](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) to learn about the available listener arguments. +Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn about the available listener arguments. ```python # This sample custom step formats an input and outputs it @@ -68,13 +68,13 @@ Example app manifest definition Your app's custom steps may create interactivity points for users, for example: Post a message with a button. -If such interaction points originate from a custom step execution, the events sent to your app representing the end-user interaction with these points are considered to be _function-scoped interactivity events_. These interactivity events can be handled by your app using the same concepts we covered earlier, such as [Listening to actions](/concepts/action-listening). +If such interaction points originate from a custom step execution, the events sent to your app representing the end-user interaction with these points are considered to be _function-scoped interactivity events_. These interactivity events can be handled by your app using the same concepts we covered earlier, such as [Listening to actions](/tools/bolt-python/concepts/actions). _function-scoped interactivity events_ will contain data related to the custom step (`function_executed` event) they were spawned from, such as custom step `inputs` and access to `complete()` and `fail()` listener arguments. Your app can skip calling `complete()` or `fail()` in the `function()` handler method if the custom step creates an interaction point that requires user interaction before the step can end. However, in the relevant interactivity handler method, your app must invoke `complete()` or `fail()` to notify Slack that the custom step has been processed. -You’ll notice in all interactivity handler examples, `ack()` is used. It is required to call the `ack()` function within an interactivity listener to acknowledge that the request was received from Slack. This is discussed in the [acknowledging requests section](/concepts/acknowledge). +You’ll notice in all interactivity handler examples, `ack()` is used. It is required to call the `ack()` function within an interactivity listener to acknowledge that the request was received from Slack. This is discussed in the [acknowledging requests section](/tools/bolt-python/concepts/acknowledge). ```python # This sample custom step posts a message with a button @@ -150,4 +150,4 @@ Example app manifest definition -Learn more about responding to interactivity, see the [Slack API documentation](https://docs.slack.dev/interactivity/). +Learn more about responding to interactivity, see the [Slack API documentation](/interactivity/handling-user-interaction). diff --git a/docs/content/concepts/errors.md b/docs/english/concepts/errors.md similarity index 90% rename from docs/content/concepts/errors.md rename to docs/english/concepts/errors.md index d0e5cccad..ed41c5816 100644 --- a/docs/content/concepts/errors.md +++ b/docs/english/concepts/errors.md @@ -1,8 +1,4 @@ ---- -title: Handling errors -lang: en -slug: /concepts/errors ---- +# Handling errors If an error occurs in a listener, you can handle it directly using a try/except block. Errors associated with your app will be of type `BoltError`. Errors associated with calling Slack APIs will be of type `SlackApiError`. diff --git a/docs/content/concepts/event-listening.md b/docs/english/concepts/event-listening.md similarity index 60% rename from docs/content/concepts/event-listening.md rename to docs/english/concepts/event-listening.md index 7ffa9e3a2..d7b8e5930 100644 --- a/docs/content/concepts/event-listening.md +++ b/docs/english/concepts/event-listening.md @@ -1,14 +1,10 @@ ---- -title: Listening to events -lang: en -slug: /concepts/event-listening ---- +# Listening to events -You can listen to [any Events API event](https://docs.slack.dev/reference/events) using the `event()` method after subscribing to it in your app configuration. This allows your app to take action when something happens in a workspace where it's installed, like a user reacting to a message or joining a channel. +You can listen to [any Events API event](/reference/events) using the `event()` method after subscribing to it in your app configuration. This allows your app to take action when something happens in a workspace where it's installed, like a user reacting to a message or joining a channel. The `event()` method requires an `eventType` of type `str`. -Refer to [the module document](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) to learn the available listener arguments. +Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. ```python # When a user joins the workspace, send a message in a predefined channel asking them to introduce themselves @app.event("team_join") @@ -23,7 +19,7 @@ def ask_for_introduction(event, say): The `message()` listener is equivalent to `event("message")`. -You can filter on subtypes of events by passing in the additional key `subtype`. Common message subtypes like `bot_message` and `message_replied` can be found [on the message event page](https://docs.slack.dev/reference/events/message#subtypes). +You can filter on subtypes of events by passing in the additional key `subtype`. Common message subtypes like `bot_message` and `message_replied` can be found [on the message event page](/reference/events/message#subtypes). You can explicitly filter for events without a subtype by explicitly setting `None`. ```python diff --git a/docs/content/concepts/global-middleware.md b/docs/english/concepts/global-middleware.md similarity index 82% rename from docs/content/concepts/global-middleware.md rename to docs/english/concepts/global-middleware.md index ec748c000..dbcdeae99 100644 --- a/docs/content/concepts/global-middleware.md +++ b/docs/english/concepts/global-middleware.md @@ -1,14 +1,10 @@ ---- -title: Global middleware -lang: en -slug: /concepts/global-middleware ---- +# Global middleware Global middleware is run for all incoming requests, before any listener middleware. You can add any number of global middleware to your app by passing middleware functions to `app.use()`. Middleware functions are called with the same arguments as listeners, with an additional `next()` function. Both global and listener middleware must call `next()` to pass control of the execution chain to the next middleware. -Refer to [the module document](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) to learn the available listener arguments. +Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. ```python @app.use def auth_acme(client, context, logger, payload, next): diff --git a/docs/content/concepts/lazy-listeners.md b/docs/english/concepts/lazy-listeners.md similarity index 98% rename from docs/content/concepts/lazy-listeners.md rename to docs/english/concepts/lazy-listeners.md index d72c2f9c0..d775106b9 100644 --- a/docs/content/concepts/lazy-listeners.md +++ b/docs/english/concepts/lazy-listeners.md @@ -1,8 +1,4 @@ ---- -title: Lazy listeners (FaaS) -lang: en -slug: /concepts/lazy-listeners ---- +# Lazy listeners (FaaS) Lazy Listeners are a feature which make it easier to deploy Slack apps to FaaS (Function-as-a-Service) environments. Please note that this feature is only available in Bolt for Python, and we are not planning to add the same to other Bolt frameworks. diff --git a/docs/content/concepts/listener-middleware.md b/docs/english/concepts/listener-middleware.md similarity index 83% rename from docs/content/concepts/listener-middleware.md rename to docs/english/concepts/listener-middleware.md index 3507d7d97..c8bfc964e 100644 --- a/docs/content/concepts/listener-middleware.md +++ b/docs/english/concepts/listener-middleware.md @@ -1,14 +1,10 @@ ---- -title: Listener middleware -lang: en -slug: /concepts/listener-middleware ---- +# Listener middleware Listener middleware is only run for the listener in which it's passed. You can pass any number of middleware functions to the listener using the `middleware` parameter, which must be a list that contains one to many middleware functions. If your listener middleware is a quite simple one, you can use a listener matcher, which returns `bool` value (`True` for proceeding) instead of requiring `next()` method call. -Refer to [the module document](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) to learn the available listener arguments. +Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. ```python # Listener middleware which filters out messages from a bot diff --git a/docs/content/concepts/logging.md b/docs/english/concepts/logging.md similarity index 94% rename from docs/content/concepts/logging.md rename to docs/english/concepts/logging.md index 5f82d168a..49e275d2d 100644 --- a/docs/content/concepts/logging.md +++ b/docs/english/concepts/logging.md @@ -1,8 +1,4 @@ ---- -title: Logging -lang: en -slug: /concepts/logging ---- +# Logging By default, Bolt will log information from your app to the output destination. After you've imported the `logging` module, you can customize the root log level by passing the `level` parameter to `basicConfig()`. The available log levels in order of least to most severe are `debug`, `info`, `warning`, `error`, and `critical`. diff --git a/docs/content/concepts/message-listening.md b/docs/english/concepts/message-listening.md similarity index 59% rename from docs/content/concepts/message-listening.md rename to docs/english/concepts/message-listening.md index b2f8bc05c..be6e74678 100644 --- a/docs/content/concepts/message-listening.md +++ b/docs/english/concepts/message-listening.md @@ -1,16 +1,9 @@ ---- -title: Listening to messages -lang: en -slug: /concepts/message-listening ---- - -To listen to messages that [your app has access to receive](https://docs.slack.dev/messaging/retrieving-messages), you can use the `message()` method which filters out events that aren't of type `message`. +# Listening to messages +To listen to messages that [your app has access to receive](/messaging/retrieving-messages), you can use the `message()` method which filters out events that aren't of type `message`. `message()` accepts an argument of type `str` or `re.Pattern` object that filters out any messages that don't match the pattern. -:::info - -Refer to [the module document](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) to learn the available listener arguments. +:::info[Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments.] ::: diff --git a/docs/content/concepts/message-sending.md b/docs/english/concepts/message-sending.md similarity index 77% rename from docs/content/concepts/message-sending.md rename to docs/english/concepts/message-sending.md index b4a2f309e..228a7b6b8 100644 --- a/docs/content/concepts/message-sending.md +++ b/docs/english/concepts/message-sending.md @@ -1,14 +1,10 @@ ---- -title: Sending messages -lang: en -slug: /concepts/message-sending ---- +# Sending messages Within your listener function, `say()` is available whenever there is an associated conversation (for example, a conversation where the event or action which triggered the listener occurred). `say()` accepts a string to post simple messages and JSON payloads to send more complex messages. The message payload you pass in will be sent to the associated conversation. -In the case that you'd like to send a message outside of a listener or you want to do something more advanced (like handle specific errors), you can call `client.chat_postMessage` [using the client attached to your Bolt instance](/concepts/web-api). +In the case that you'd like to send a message outside of a listener or you want to do something more advanced (like handle specific errors), you can call `client.chat_postMessage` [using the client attached to your Bolt instance](/tools/bolt-python/concepts/web-api). -Refer to [the module document](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) to learn the available listener arguments. +Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. ```python # Listens for messages containing "knock knock" and responds with an italicized "who's there?" @app.message("knock knock") @@ -20,7 +16,7 @@ def ask_who(message, say): `say()` accepts more complex message payloads to make it easy to add functionality and structure to your messages. -To explore adding rich message layouts to your app, read through [the guide on our API site](https://docs.slack.dev/messaging/#structure) and look through templates of common app flows [in the Block Kit Builder](https://api.slack.com/tools/block-kit-builder?template=1). +To explore adding rich message layouts to your app, read through [the guide on our API site](/messaging/#structure) and look through templates of common app flows [in the Block Kit Builder](https://api.slack.com/tools/block-kit-builder?template=1). ```python # Sends a section block with datepicker when someone reacts with a 📅 emoji diff --git a/docs/content/concepts/opening-modals.md b/docs/english/concepts/opening-modals.md similarity index 68% rename from docs/content/concepts/opening-modals.md rename to docs/english/concepts/opening-modals.md index e7daceafc..1f053539f 100644 --- a/docs/content/concepts/opening-modals.md +++ b/docs/english/concepts/opening-modals.md @@ -1,16 +1,12 @@ ---- -title: Opening modals -lang: en -slug: /concepts/opening-modals ---- +# Opening modals -[Modals](https://docs.slack.dev/surfaces/modals) are focused surfaces that allow you to collect user data and display dynamic information. You can open a modal by passing a valid `trigger_id` and a [view payload](https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission) to the built-in client's [`views.open`](https://docs.slack.dev/reference/methods/views.open/) method. +[Modals](/surfaces/modals) are focused surfaces that allow you to collect user data and display dynamic information. You can open a modal by passing a valid `trigger_id` and a [view payload](/reference/interaction-payloads/view-interactions-payload/#view_submission) to the built-in client's [`views.open`](/reference/methods/views.open/) method. Your app receives `trigger_id` parameters in payloads sent to your Request URL triggered user invocation like a slash command, button press, or interaction with a select menu. -Read more about modal composition in the [API documentation](https://docs.slack.dev/surfaces/modals#composing_views). +Read more about modal composition in the [API documentation](/surfaces/modals#composing_views). -Refer to [the module document](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) to learn the available listener arguments. +Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. ```python # Listen for a shortcut invocation diff --git a/docs/content/concepts/select-menu-options.md b/docs/english/concepts/select-menu-options.md similarity index 67% rename from docs/content/concepts/select-menu-options.md rename to docs/english/concepts/select-menu-options.md index d699e6370..40d29472c 100644 --- a/docs/content/concepts/select-menu-options.md +++ b/docs/english/concepts/select-menu-options.md @@ -1,19 +1,15 @@ ---- -title: Listening & responding to select menu options -lang: en -slug: /concepts/options ---- +# Listening & responding to select menu options -The `options()` method listens for incoming option request payloads from Slack. [Similar to `action()`](/concepts/action-listening), +The `options()` method listens for incoming option request payloads from Slack. [Similar to `action()`](/tools/bolt-python/concepts/actions), an `action_id` or constraints object is required. In order to load external data into your select menus, you must provide an options load URL in your app configuration, appended with `/slack/events`. While it's recommended to use `action_id` for `external_select` menus, dialogs do not support Block Kit so you'll have to use the constraints object to filter on a `callback_id`. -To respond to options requests, you'll need to call `ack()` with a valid `options` or `option_groups` list. Both [external select response examples](https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select) and [dialog response examples](https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#conversation_multi_select) can be found on our API site. +To respond to options requests, you'll need to call `ack()` with a valid `options` or `option_groups` list. Both [external select response examples](/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select) and [dialog response examples](/reference/block-kit/block-elements/multi-select-menu-element#conversation_multi_select) can be found on our API site. -Additionally, you may want to apply filtering logic to the returned options based on user input. This can be accomplished by using the `payload` argument to your options listener and checking for the contents of the `value` property within it. Based on the `value` you can return different options. All listeners and middleware handlers in Bolt for Python have access to [many useful arguments](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) - be sure to check them out! +Additionally, you may want to apply filtering logic to the returned options based on user input. This can be accomplished by using the `payload` argument to your options listener and checking for the contents of the `value` property within it. Based on the `value` you can return different options. All listeners and middleware handlers in Bolt for Python have access to [many useful arguments](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) - be sure to check them out! -Refer to [the module document](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) to learn the available listener arguments. +Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. ```python # Example of responding to an external_select options request @app.options("external_action") diff --git a/docs/content/concepts/shortcuts.md b/docs/english/concepts/shortcuts.md similarity index 74% rename from docs/content/concepts/shortcuts.md rename to docs/english/concepts/shortcuts.md index 6833d468d..b28f0b352 100644 --- a/docs/content/concepts/shortcuts.md +++ b/docs/english/concepts/shortcuts.md @@ -1,22 +1,18 @@ ---- -title: Listening & responding to shortcuts -lang: en -slug: /concepts/shortcuts ---- +# Listening & responding to shortcuts -The `shortcut()` method supports both [global shortcuts](https://docs.slack.dev/interactivity/implementing-shortcuts#global) and [message shortcuts](https://docs.slack.dev/interactivity/implementing-shortcuts#messages). +The `shortcut()` method supports both [global shortcuts](/interactivity/implementing-shortcuts#global) and [message shortcuts](/interactivity/implementing-shortcuts#messages). Shortcuts are invokable entry points to apps. Global shortcuts are available from within search and text composer area in Slack. Message shortcuts are available in the context menus of messages. Your app can use the `shortcut()` method to listen to incoming shortcut requests. The method requires a `callback_id` parameter of type `str` or `re.Pattern`. Shortcuts must be acknowledged with `ack()` to inform Slack that your app has received the request. -Shortcuts include a `trigger_id` which an app can use to [open a modal](/concepts/opening-modals) that confirms the action the user is taking. +Shortcuts include a `trigger_id` which an app can use to [open a modal](/tools/bolt-python/concepts/opening-modals) that confirms the action the user is taking. When setting up shortcuts within your app configuration, as with other URLs, you'll append `/slack/events` to your request URL. -⚠️ Note that global shortcuts do **not** include a channel ID. If your app needs access to a channel ID, you may use a [`conversations_select`](https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#conversation_multi_select) element within a modal. Message shortcuts do include a channel ID. +⚠️ Note that global shortcuts do **not** include a channel ID. If your app needs access to a channel ID, you may use a [`conversations_select`](/reference/block-kit/block-elements/multi-select-menu-element#conversation_multi_select) element within a modal. Message shortcuts do include a channel ID. -Refer to [the module document](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) to learn the available listener arguments. +Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. ```python # The open_modal shortcut listens to a shortcut with the callback_id "open_modal" @app.shortcut("open_modal") @@ -36,7 +32,7 @@ def open_modal(ack, shortcut, client): "type": "section", "text": { "type": "mrkdwn", - "text": "About the simplest modal you could conceive of :smile:\n\nMaybe or ." + "text": "About the simplest modal you could conceive of :smile:\n\nMaybe or ." } }, { @@ -75,7 +71,7 @@ def open_modal(ack, shortcut, client): "type": "section", "text": { "type": "mrkdwn", - "text": "About the simplest modal you could conceive of :smile:\n\nMaybe or ." + "text": "About the simplest modal you could conceive of :smile:\n\nMaybe or ." } }, { diff --git a/docs/content/concepts/socket-mode.md b/docs/english/concepts/socket-mode.md similarity index 78% rename from docs/content/concepts/socket-mode.md rename to docs/english/concepts/socket-mode.md index 301fbf94e..5156f6e13 100644 --- a/docs/content/concepts/socket-mode.md +++ b/docs/english/concepts/socket-mode.md @@ -1,10 +1,6 @@ ---- -title: Using Socket Mode -lang: en -slug: /concepts/socket-mode ---- +# Using Socket Mode -With the introduction of [Socket Mode](https://docs.slack.dev/apis/events-api/using-socket-mode), Bolt for Python introduced support in version `1.2.0`. With Socket Mode, instead of creating a server with endpoints that Slack sends payloads too, the app will instead connect to Slack via a WebSocket connection and receive data from Slack over the socket connection. Make sure to enable Socket Mode in your app configuration settings. +With the introduction of [Socket Mode](/apis/events-api/using-socket-mode), Bolt for Python introduced support in version `1.2.0`. With Socket Mode, instead of creating a server with endpoints that Slack sends payloads too, the app will instead connect to Slack via a WebSocket connection and receive data from Slack over the socket connection. Make sure to enable Socket Mode in your app configuration settings. To use the Socket Mode, add `SLACK_APP_TOKEN` as an environment variable. You can get your App Token in your app configuration settings under the **Basic Information** section. @@ -38,7 +34,7 @@ if __name__ == "__main__": To use the asyncio-based adapters such as aiohttp, your whole app needs to be compatible with asyncio's async/await programming model. `AsyncSocketModeHandler` is available for running `AsyncApp` and its async middleware and listeners. -To learn how to use `AsyncApp`, checkout the [using Async](/concepts/async) document and relevant [examples](https://github.com/slackapi/bolt-python/tree/main/examples). +To learn how to use `AsyncApp`, checkout the [using Async](/tools/bolt-python/concepts/async) document and relevant [examples](https://github.com/slackapi/bolt-python/tree/main/examples). ```python from slack_bolt.app.async_app import AsyncApp diff --git a/docs/content/concepts/token-rotation.md b/docs/english/concepts/token-rotation.md similarity index 73% rename from docs/content/concepts/token-rotation.md rename to docs/english/concepts/token-rotation.md index 88af29ffa..96a41bb3c 100644 --- a/docs/content/concepts/token-rotation.md +++ b/docs/english/concepts/token-rotation.md @@ -1,13 +1,9 @@ ---- -title: Token rotation -lang: en -slug: /concepts/token-rotation ---- +# Token rotation Supported in Bolt for Python as of [v1.7.0](https://github.com/slackapi/bolt-python/releases/tag/v1.7.0), token rotation provides an extra layer of security for your access tokens and is defined by the [OAuth V2 RFC](https://datatracker.ietf.org/doc/html/rfc6749#section-10.4). Instead of an access token representing an existing installation of your Slack app indefinitely, with token rotation enabled, access tokens expire. A refresh token acts as a long-lived way to refresh your access tokens. -Bolt for Python supports and will handle token rotation automatically so long as the [built-in OAuth](/concepts/authenticating-oauth) functionality is used. +Bolt for Python supports and will handle token rotation automatically so long as the [built-in OAuth](/tools/bolt-python/concepts/authenticating-oauth) functionality is used. -For more information about token rotation, please see the [documentation](https://docs.slack.dev/authentication/using-token-rotation). \ No newline at end of file +For more information about token rotation, please see the [documentation](/authentication/using-token-rotation). \ No newline at end of file diff --git a/docs/content/concepts/updating-pushing-views.md b/docs/english/concepts/updating-pushing-views.md similarity index 64% rename from docs/content/concepts/updating-pushing-views.md rename to docs/english/concepts/updating-pushing-views.md index aa1efa3fa..8c05e79c8 100644 --- a/docs/content/concepts/updating-pushing-views.md +++ b/docs/english/concepts/updating-pushing-views.md @@ -1,10 +1,6 @@ ---- -title: Updating & pushing views -lang: en -slug: /concepts/updating-pushing-views ---- +# Updating & pushing views -Modals contain a stack of views. When you call [`views_open`](https://api.https://docs.slack.dev/reference/methods/views.open/slack.com/methods/views.open), you add the root view to the modal. After the initial call, you can dynamically update a view by calling [`views_update`](https://docs.slack.dev/reference/methods/views.update/), or stack a new view on top of the root view by calling [`views_push`](https://docs.slack.dev/reference/methods/views.push/) +Modals contain a stack of views. When you call [`views_open`](https://api./reference/methods/views.open/slack.com/methods/views.open), you add the root view to the modal. After the initial call, you can dynamically update a view by calling [`views_update`](/reference/methods/views.update/), or stack a new view on top of the root view by calling [`views_push`](/reference/methods/views.push/) ## The `views_update` method @@ -12,11 +8,11 @@ To update a view, you can use the built-in client to call `views_update` with th ## The `views_push` method -To push a new view onto the view stack, you can use the built-in client to call `views_push` with a valid `trigger_id` a new [view payload](https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission). The arguments for `views_push` is the same as [opening modals](/concepts/creating-models). After you open a modal, you may only push two additional views onto the view stack. +To push a new view onto the view stack, you can use the built-in client to call `views_push` with a valid `trigger_id` a new [view payload](/reference/interaction-payloads/view-interactions-payload/#view_submission). The arguments for `views_push` is the same as [opening modals](/tools/bolt-python/concepts/opening-modals). After you open a modal, you may only push two additional views onto the view stack. -Learn more about updating and pushing views in our [API documentation](https://docs.slack.dev/surfaces/modals) +Learn more about updating and pushing views in our [API documentation](/surfaces/modals) -Refer to [the module document](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) to learn the available listener arguments. +Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. ```python # Listen for a button invocation with action_id `button_abc` (assume it's inside of a modal) @app.action("button_abc") diff --git a/docs/content/concepts/view-submissions.md b/docs/english/concepts/view-submissions.md similarity index 74% rename from docs/content/concepts/view-submissions.md rename to docs/english/concepts/view-submissions.md index 60b78cd54..4ff4c2da7 100644 --- a/docs/content/concepts/view-submissions.md +++ b/docs/english/concepts/view-submissions.md @@ -1,10 +1,6 @@ ---- -title: Listening to views -lang: en -slug: /concepts/view_submissions ---- +# Listening to views -If a [view payload](https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission) contains any input blocks, you must listen to `view_submission` requests to receive their values. To listen to `view_submission` requests, you can use the built-in `view()` method. `view()` requires a `callback_id` of type `str` or `re.Pattern`. +If a [view payload](/reference/interaction-payloads/view-interactions-payload/#view_submission) contains any input blocks, you must listen to `view_submission` requests to receive their values. To listen to `view_submission` requests, you can use the built-in `view()` method. `view()` requires a `callback_id` of type `str` or `re.Pattern`. You can access the value of the `input` blocks by accessing the `state` object. `state` contains a `values` object that uses the `block_id` and unique `action_id` to store the input values. @@ -23,9 +19,9 @@ def handle_submission(ack, body): # https://app.slack.com/block-kit-builder/#%7B%22type%22:%22modal%22,%22callback_id%22:%22view_1%22,%22title%22:%7B%22type%22:%22plain_text%22,%22text%22:%22My%20App%22,%22emoji%22:true%7D,%22blocks%22:%5B%5D%7D ack(response_action="update", view=build_new_view(body)) ``` -Similarly, there are options for [displaying errors](https://docs.slack.dev/surfaces/modals#displaying_errors) in response to view submissions. +Similarly, there are options for [displaying errors](/surfaces/modals#displaying_errors) in response to view submissions. -Read more about view submissions in our [API documentation](https://docs.slack.dev/surfaces/modals#interactions) +Read more about view submissions in our [API documentation](/surfaces/modals#interactions) --- @@ -33,7 +29,7 @@ Read more about view submissions in our [API documentation](https://docs.slack.d When listening for `view_closed` requests, you must pass `callback_id` and add a `notify_on_close` property to the view during creation. See below for an example of this: -See the [API documentation](https://docs.slack.dev/surfaces/modals#interactions) for more information about `view_closed`. +See the [API documentation](/surfaces/modals#interactions) for more information about `view_closed`. ```python @@ -62,7 +58,7 @@ def handle_view_closed(ack, body, logger): logger.info(body) ``` -Refer to [the module document](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) to learn the available listener arguments. +Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. ```python # Handle a view_submission request @app.view("view_1") diff --git a/docs/english/concepts/web-api.md b/docs/english/concepts/web-api.md new file mode 100644 index 000000000..9cf436851 --- /dev/null +++ b/docs/english/concepts/web-api.md @@ -0,0 +1,22 @@ +# Using the Web API + +You can call [any Web API method](/reference/methods) using the `WebClient` provided to your Bolt app as either `app.client` or `client` in middleware/listener arguments (given that your app has the appropriate scopes). When you call one the client's methods, it returns a `SlackResponse` which contains the response from Slack. + +The token used to initialize Bolt can be found in the `context` object, which is required to call most Web API methods. + +:::info[Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments.] + +::: + +```python +@app.message("wake me up") +def say_hello(client, message): + # Unix Epoch time for September 30, 2020 11:59:59 PM + when_september_ends = 1601510399 + channel_id = message["channel"] + client.chat_scheduleMessage( + channel=channel_id, + post_at=when_september_ends, + text="Summer has come and passed" + ) +``` diff --git a/docs/content/getting-started.md b/docs/english/getting-started.md similarity index 80% rename from docs/content/getting-started.md rename to docs/english/getting-started.md index a794f3176..ebdf47189 100644 --- a/docs/content/getting-started.md +++ b/docs/english/getting-started.md @@ -1,9 +1,8 @@ --- -title: Quickstart guide with Bolt for Python sidebar_label: Quickstart --- -# Getting started with Bolt for Python +# Quickstart guide with Bolt for Python This quickstart guide aims to help you get a Slack app using Bolt for Python up and running as soon as possible! @@ -14,20 +13,20 @@ When complete, you'll have a local environment configured with a customized [app :::tip[Reference for readers] -In search of the complete guide to building an app from scratch? Check out the [building an app](/building-an-app) guide. +In search of the complete guide to building an app from scratch? Check out the [building an app](/tools/bolt-python/building-an-app) guide. ::: #### Prerequisites -A few tools are needed for the following steps. We recommend using the [**Slack CLI**](https://tools.slack.dev/slack-cli/) for the smoothest experience, but other options remain available. +A few tools are needed for the following steps. We recommend using the [**Slack CLI**](/tools/slack-cli/) for the smoothest experience, but other options remain available. You can also begin by installing git and downloading [Python 3.6 or later](https://www.python.org/downloads/), or the latest stable version of Python. Refer to [Python's setup and building guide](https://devguide.python.org/getting-started/setup-building/) for more details. Install the latest version of the Slack CLI to get started: -- [Slack CLI for macOS & Linux](https://tools.slack.dev/slack-cli/guides/installing-the-slack-cli-for-mac-and-linux) -- [Slack CLI for Windows](https://tools.slack.dev/slack-cli/guides/installing-the-slack-cli-for-windows) +- [Slack CLI for macOS & Linux](/tools/slack-cli/guides/installing-the-slack-cli-for-mac-and-linux) +- [Slack CLI for Windows](/tools/slack-cli/guides/installing-the-slack-cli-for-windows) Then confirm a successful installation with the following command: @@ -45,7 +44,7 @@ $ slack login A workspace where development can happen is also needed. -We recommend using [developer sandboxes](https://docs.slack.dev/tools/developer-sandboxes) to avoid disruptions where real work gets done. +We recommend using [developer sandboxes](/tools/developer-sandboxes) to avoid disruptions where real work gets done. ::: @@ -133,9 +132,9 @@ Navigate to your list of apps and [create a new Slack app](https://api.slack.com You'll then land on your app's **Basic Information** page, which is an overview of your app and which contains important credentials: -![Basic Information page](/img/boltpy/basic-information-page.png "Basic Information page") +![Basic Information page](/img/bolt-python/basic-information-page.png "Basic Information page") -To listen for events happening in Slack (such as a new posted message) without opening a port or exposing an endpoint, we will use [Socket Mode](/concepts/socket-mode). This connection requires a specific app token: +To listen for events happening in Slack (such as a new posted message) without opening a port or exposing an endpoint, we will use [Socket Mode](/tools/bolt-python/concepts/socket-mode). This connection requires a specific app token: 1. On the **Basic Information** page, scroll to the **App-Level Tokens** section and click **Generate Token and Scopes**. 2. Name the token "Development" or something similar and add the `connections:write` scope, then click **Generate**. @@ -149,7 +148,7 @@ The above command works on Linux and macOS but [similar commands are available o :::warning[Keep it secret. Keep it safe.] -Treat your tokens like a password and [keep it safe](https://docs.slack.dev/authentication/best-practices-for-security). Your app uses these to retrieve and send information to Slack. +Treat your tokens like a password and [keep it safe](/authentication/best-practices-for-security). Your app uses these to retrieve and send information to Slack. ::: @@ -158,7 +157,7 @@ A bot token is also needed to interact with the Web API methods as your app's bo 1. Navigate to the **OAuth & Permissions** on the left sidebar and install your app to your workspace to generate a token. 2. After authorizing the installation, you'll return to the **OAuth & Permissions** page and find a **Bot User OAuth Token**: -![OAuth Tokens](/img/boltpy/bot-token.png "Bot OAuth Token") +![OAuth Tokens](/img/bolt-python/bot-token.png "Bot OAuth Token") 3. Copy the bot token beginning with `xoxb` from the **OAuth & Permissions page** and then store it in a new environment variable: @@ -252,7 +251,7 @@ Your app can be stopped again by pressing `CTRL+C` in the terminal to end these #### Customizing app settings -The created app will have some placeholder values and a small set of [scopes](https://docs.slack.dev/reference/scopes) to start, but we recommend exploring the customizations possible on app settings. +The created app will have some placeholder values and a small set of [scopes](/reference/scopes) to start, but we recommend exploring the customizations possible on app settings. @@ -265,7 +264,7 @@ $ slack app settings This will open the following page in a web browser: -![Basic Information page](/img/boltpy/basic-information-page.png "Basic Information page") +![Basic Information page](/img/bolt-python/basic-information-page.png "Basic Information page") @@ -274,7 +273,7 @@ Browse to https://api.slack.com/apps and select your app "Getting Started Bolt A This will open the following page: -![Basic Information page](/img/boltpy/basic-information-page.png "Basic Information page") +![Basic Information page](/img/bolt-python/basic-information-page.png "Basic Information page") @@ -287,14 +286,14 @@ Congrats once more on getting up and running with this quick start. :::info[Dive deeper] -Follow along with the steps that went into making this app on the [building an app](/building-an-app) guide for an educational overview. +Follow along with the steps that went into making this app on the [building an app](/tools/bolt-python/building-an-app) guide for an educational overview. ::: You can now continue customizing your app with various features to make it right for whatever job's at hand. Here are some ideas about what to explore next: -- Explore the different events your bot can listen to with the [`app.event()`](/concepts/event-listening) method. All of the [events](https://docs.slack.dev/reference/events) are listed on the API docs site. -- Bolt allows you to call [Web API](/concepts/web-api) methods with the client attached to your app. There are [over 200 methods](https://docs.slack.dev/reference/methods) on the API docs site. -- Learn more about the different [token types](https://docs.slack.dev/authentication/tokens) and [authentication setups](/concepts/authenticating-oauth). Your app might need different tokens depending on the actions you want to perform or for installations to multiple workspaces. -- Receive events using HTTP for various deployment methods, such as deploying to [Heroku](/deployments/heroku) or [AWS Lambda](/deployments/aws-lambda). -- Read on [app design](https://docs.slack.dev/surfaces/app-design) and compose fancy messages with blocks using [Block Kit Builder](https://app.slack.com/block-kit-builder) to prototype messages. +- Explore the different events your bot can listen to with the [`app.event()`](/tools/bolt-python/concepts/event-listening) method. All of the [events](/reference/events) are listed on the API docs site. +- Bolt allows you to call [Web API](/tools/bolt-python/concepts/web-api) methods with the client attached to your app. There are [over 200 methods](/reference/methods) on the API docs site. +- Learn more about the different [token types](/authentication/tokens) and [authentication setups](/tools/bolt-python/concepts/authenticating-oauth). Your app might need different tokens depending on the actions you want to perform or for installations to multiple workspaces. +- Receive events using HTTP for various deployment methods, such as deploying to Heroku or AWS Lambda. +- Read on [app design](/surfaces/app-design) and compose fancy messages with blocks using [Block Kit Builder](https://app.slack.com/block-kit-builder) to prototype messages. diff --git a/docs/content/index.md b/docs/english/index.md similarity index 93% rename from docs/content/index.md rename to docs/english/index.md index 33204bca1..212bd9690 100644 --- a/docs/content/index.md +++ b/docs/english/index.md @@ -1,6 +1,6 @@ # Bolt for Python -Bolt for Python is a Python framework to build Slack apps with the latest Slack platform features. Read the [Getting Started Guide](/getting-started) to set up and run your first Bolt app. +Bolt for Python is a Python framework to build Slack apps with the latest Slack platform features. Read the [Getting Started Guide](/tools/bolt-python/getting-started) to set up and run your first Bolt app. Then, explore the rest of the pages within the Guides section. The documentation there will help you build a Bolt app for whatever use case you may have. diff --git a/docs/content/concepts/steps-from-apps.md b/docs/english/legacy/steps-from-apps.md similarity index 67% rename from docs/content/concepts/steps-from-apps.md rename to docs/english/legacy/steps-from-apps.md index 09becda0c..03b9fa8ff 100644 --- a/docs/content/concepts/steps-from-apps.md +++ b/docs/english/legacy/steps-from-apps.md @@ -1,20 +1,14 @@ ---- -title: Steps from apps -lang: en -slug: /legacy/steps-from-apps ---- +# Steps from apps -:::danger +:::danger[Steps from Apps is a deprecated feature.] -Steps from Apps is a deprecated feature. +Steps from Apps are different than, and not interchangeable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](/workflows/), such as [custom steps for Bolt](/workflows/workflow-steps). -Steps from Apps are different than, and not interchangeable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](https://docs.slack.dev/workflows/), such as [custom steps for Bolt](https://docs.slack.dev/workflows/workflow-steps). - -Please [read the Slack API changelog entry](https://docs.slack.dev/changelog/2023-08-workflow-steps-from-apps-step-back) for more information. +Please [read the Slack API changelog entry](/changelog/2023-08-workflow-steps-from-apps-step-back) for more information. ::: -Steps from apps allow your app to create and process steps that users can add using [Workflow Builder](https://docs.slack.dev/workflows/workflow-builder). +Steps from apps allow your app to create and process steps that users can add using [Workflow Builder](/workflows/workflow-builder). Steps from apps are made up of three distinct user events: @@ -24,7 +18,7 @@ Steps from apps are made up of three distinct user events: All three events must be handled for a step from app to function. -Read more about steps from apps in the [API documentation](https://docs.slack.dev/workflows/workflow-steps). +Read more about steps from apps in the [API documentation](/workflows/workflow-steps). ## Creating steps from apps @@ -36,9 +30,9 @@ The configuration object contains three keys: `edit`, `save`, and `execute`. Eac After instantiating a `WorkflowStep`, you can pass it into `app.step()`. Behind the scenes, your app will listen and respond to the step’s events using the callbacks provided in the configuration object. -Alternatively, steps from apps can also be created using the `WorkflowStepBuilder` class alongside a decorator pattern. For more information, including an example of this approach, [refer to the documentation](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/workflows/step/step.html#slack_bolt.workflows.step.step.WorkflowStepBuilder). +Alternatively, steps from apps can also be created using the `WorkflowStepBuilder` class alongside a decorator pattern. For more information, including an example of this approach, [refer to the documentation](https://docs.slack.dev/tools/bolt-python/reference/workflows/step/step.html#slack_bolt.workflows.step.step.WorkflowStepBuilder). -Refer to the module documents ([common](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) / [step-specific](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/workflows/step/utilities/index.html)) to learn the available arguments. +Refer to the module documents ([common](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) / [step-specific](https://docs.slack.dev/tools/bolt-python/reference/workflows/step/utilities/index.html)) to learn the available arguments. ```python import os @@ -74,15 +68,15 @@ app.step(ws) ## Adding or editing steps from apps -When a builder adds (or later edits) your step in their workflow, your app will receive a [`workflow_step_edit` event](https://docs.slack.dev/legacy/legacy-steps-from-apps/legacy-steps-from-apps-workflow_step_edit-payload). The `edit` callback in your `WorkflowStep` configuration will be run when this event is received. +When a builder adds (or later edits) your step in their workflow, your app will receive a [`workflow_step_edit` event](/legacy/legacy-steps-from-apps/legacy-steps-from-apps-workflow_step_edit-payload). The `edit` callback in your `WorkflowStep` configuration will be run when this event is received. -Whether a builder is adding or editing a step, you need to send them a [step from app configuration modal](https://docs.slack.dev/legacy/legacy-steps-from-apps/legacy-steps-from-apps-configuration-view-object). This modal is where step-specific settings are chosen, and it has more restrictions than typical modals—most notably, it cannot include `title`, `submit`, or `close` properties. By default, the configuration modal's `callback_id` will be the same as the step from app. +Whether a builder is adding or editing a step, you need to send them a [step from app configuration modal](/legacy/legacy-steps-from-apps/legacy-steps-from-apps-configuration-view-object). This modal is where step-specific settings are chosen, and it has more restrictions than typical modals—most notably, it cannot include `title`, `submit`, or `close` properties. By default, the configuration modal's `callback_id` will be the same as the step from app. Within the `edit` callback, the `configure()` utility can be used to easily open your step's configuration modal by passing in the view's blocks with the corresponding `blocks` argument. To disable saving the configuration before certain conditions are met, you can also pass in `submit_disabled` with a value of `True`. -To learn more about opening configuration modals, [read the documentation](https://docs.slack.dev/legacy/legacy-steps-from-apps/). +To learn more about opening configuration modals, [read the documentation](/legacy/legacy-steps-from-apps/). -Refer to the module documents ([common](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) / [step-specific](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/workflows/step/utilities/index.html)) to learn the available arguments. +Refer to the module documents ([common](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) / [step-specific](https://docs.slack.dev/tools/bolt-python/reference/workflows/step/utilities/index.html)) to learn the available arguments. ```python def edit(ack, step, configure): @@ -132,9 +126,9 @@ Within the `save` callback, the `update()` method can be used to save the builde - `step_name` overrides the default Step name - `step_image_url` overrides the default Step image -To learn more about how to structure these parameters, [read the documentation](https://docs.slack.dev/legacy/legacy-steps-from-apps/). +To learn more about how to structure these parameters, [read the documentation](/legacy/legacy-steps-from-apps/). -Refer to the module documents ([common](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) / [step-specific](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/workflows/step/utilities/index.html)) to learn the available arguments. +Refer to the module documents ([common](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) / [step-specific](https://docs.slack.dev/tools/bolt-python/reference/workflows/step/utilities/index.html)) to learn the available arguments. ```python def save(ack, view, update): @@ -173,13 +167,13 @@ app.step(ws) ## Executing steps from apps -When your step from app is executed by an end user, your app will receive a [`workflow_step_execute` event](https://docs.slack.dev/legacy/legacy-steps-from-apps/legacy-steps-from-apps-workflow_step-object). The `execute` callback in your `WorkflowStep` configuration will be run when this event is received. +When your step from app is executed by an end user, your app will receive a [`workflow_step_execute` event](/legacy/legacy-steps-from-apps/legacy-steps-from-apps-workflow_step-object). The `execute` callback in your `WorkflowStep` configuration will be run when this event is received. Using the `inputs` from the `save` callback, this is where you can make third-party API calls, save information to a database, update the user's Home tab, or decide the outputs that will be available to subsequent steps from apps by mapping values to the `outputs` object. Within the `execute` callback, your app must either call `complete()` to indicate that the step's execution was successful, or `fail()` to indicate that the step's execution failed. -Refer to the module documents ([common](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html) / [step-specific](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/workflows/step/utilities/index.html)) to learn the available arguments. +Refer to the module documents ([common](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) / [step-specific](https://docs.slack.dev/tools/bolt-python/reference/workflows/step/utilities/index.html)) to learn the available arguments. ```python def execute(step, complete, fail): diff --git a/docs/static/img/tutorials/ai-chatbot/1.png b/docs/english/tutorial/ai-chatbot/1.png similarity index 100% rename from docs/static/img/tutorials/ai-chatbot/1.png rename to docs/english/tutorial/ai-chatbot/1.png diff --git a/docs/static/img/tutorials/ai-chatbot/2.png b/docs/english/tutorial/ai-chatbot/2.png similarity index 100% rename from docs/static/img/tutorials/ai-chatbot/2.png rename to docs/english/tutorial/ai-chatbot/2.png diff --git a/docs/static/img/tutorials/ai-chatbot/3.png b/docs/english/tutorial/ai-chatbot/3.png similarity index 100% rename from docs/static/img/tutorials/ai-chatbot/3.png rename to docs/english/tutorial/ai-chatbot/3.png diff --git a/docs/static/img/tutorials/ai-chatbot/4.png b/docs/english/tutorial/ai-chatbot/4.png similarity index 100% rename from docs/static/img/tutorials/ai-chatbot/4.png rename to docs/english/tutorial/ai-chatbot/4.png diff --git a/docs/static/img/tutorials/ai-chatbot/5.png b/docs/english/tutorial/ai-chatbot/5.png similarity index 100% rename from docs/static/img/tutorials/ai-chatbot/5.png rename to docs/english/tutorial/ai-chatbot/5.png diff --git a/docs/static/img/tutorials/ai-chatbot/6.png b/docs/english/tutorial/ai-chatbot/6.png similarity index 100% rename from docs/static/img/tutorials/ai-chatbot/6.png rename to docs/english/tutorial/ai-chatbot/6.png diff --git a/docs/static/img/tutorials/ai-chatbot/7.png b/docs/english/tutorial/ai-chatbot/7.png similarity index 100% rename from docs/static/img/tutorials/ai-chatbot/7.png rename to docs/english/tutorial/ai-chatbot/7.png diff --git a/docs/static/img/tutorials/ai-chatbot/8.png b/docs/english/tutorial/ai-chatbot/8.png similarity index 100% rename from docs/static/img/tutorials/ai-chatbot/8.png rename to docs/english/tutorial/ai-chatbot/8.png diff --git a/docs/content/tutorial/ai-chatbot.md b/docs/english/tutorial/ai-chatbot/ai-chatbot.md similarity index 88% rename from docs/content/tutorial/ai-chatbot.md rename to docs/english/tutorial/ai-chatbot/ai-chatbot.md index 7db10b722..fa4da90a7 100644 --- a/docs/content/tutorial/ai-chatbot.md +++ b/docs/english/tutorial/ai-chatbot/ai-chatbot.md @@ -32,7 +32,7 @@ If you'd rather skip the tutorial and just head straight to the code, you can us Before you'll be able to successfully run the app, you'll need to first obtain and set some environment variables. 1. On the **Install App** page, copy your **Bot User OAuth Token**. You will store this in your environment as `SLACK_BOT_TOKEN` (we'll get to that next). -2. Navigate to **Basic Information** and in the **App-Level Tokens** section , click **Generate Token and Scopes**. Add the [`connections:write`](https://docs.slack.dev/reference/scopes/connections.write) scope, name the token, and click **Generate**. (For more details, refer to [understanding OAuth scopes for bots](https://docs.slack.dev/authentication/tokens#bot)). Copy this token. You will store this in your environment as `SLACK_APP_TOKEN`. +2. Navigate to **Basic Information** and in the **App-Level Tokens** section , click **Generate Token and Scopes**. Add the [`connections:write`](/reference/scopes/connections.write) scope, name the token, and click **Generate**. (For more details, refer to [understanding OAuth scopes for bots](/authentication/tokens#bot)). Copy this token. You will store this in your environment as `SLACK_APP_TOKEN`. To store your tokens and environment variables, run the following commands in the terminal. Replace the placeholder values with your bot and app tokens collected above, as well as the key or keys for the AI provider or providers you want to use: @@ -100,7 +100,7 @@ Navigate to the Bolty **App Home** and select a provider from the drop-down menu If you don't see Bolty listed under **Apps** in your workspace right away, never fear! You can mention **@Bolty** in a public channel to add the app, then navigate to your **App Home**. -![Choose your AI provider](/img/tutorials/ai-chatbot/6.png) +![Choose your AI provider](6.png) ## Setting up your workflow {#workflow} @@ -108,11 +108,11 @@ Within your development workspace, open Workflow Builder by clicking on your wor Click **Untitled Workflow** at the top to rename your workflow. For this tutorial, we'll call the workflow **Welcome to the channel**. Enter a description, such as _Summarizes channels for new members_, and click **Save**. -![Setting up a new workflow](/img/tutorials/ai-chatbot/1.png) +![Setting up a new workflow](1.png) Select **Choose an event** under **Start the workflow...**, and then choose **When a person joins a channel**. Select the channel name from the drop-down menu and click **Save**. -![Start the workflow](/img/tutorials/ai-chatbot/2.png) +![Start the workflow](2.png) Under **Then, do these things**, click **Add steps** and complete the following: @@ -121,20 +121,20 @@ Under **Then, do these things**, click **Add steps** and complete the following: 3. Under **Add a message**, enter a short message, such as _Hi! Welcome to `{}The channel that the user joined`. Would you like a summary of the recent conversation?_ Note that the _`{}The channel that the user joined`_ is a variable; you can insert it by selecting **{}Insert a variable** at the bottom of the message text box. 4. Select the **Add Button** button, and name the button _Yes, give me a summary_. Click **Done**. -![Send a message](/img/tutorials/ai-chatbot/3.png) +![Send a message](3.png) We'll add two more steps under the **Then, do these things** section. First, scroll to the bottom of the list of steps and choose **Custom**, then choose **Bolty** and **Bolty Custom Function**. In the **Channel** drop-down menu, select **Channel that the user joined**. Click **Save**. -![Bolty custom function](/img/tutorials/ai-chatbot/4.png) +![Bolty custom function](4.png) For the final step, complete the following: 1. Choose **Messages** and then **Send a message to a person**. Under **Select a member**, choose **Person who clicked the button** from the drop-down menu. 2. Under **Add a message**, click **Insert a variable** and choose **`{}Summary`** under the **Bolty Custom Function** section in the list that appears. Click **Save**. -![Summary](/img/tutorials/ai-chatbot/5.png) +![Summary](5.png) When finished, click **Finish Up**, then click **Publish** to make the workflow available in your workspace. @@ -149,9 +149,9 @@ In order for Bolty to provide summaries of recent conversation in a channel, Bol To test this, leave the channel you just invited Bolty to and rejoin it. This will kick off your workflow and you'll receive a direct message from **Welcome to the channel**. Click the **Yes, give me a summary** button, and Bolty will summarize the recent conversations in the channel you joined. -![Channel summary](/img/tutorials/ai-chatbot/7.png) +![Channel summary](7.png) -The central part of this functionality is shown in the following code snippet. Note the use of the [`user_context`](https://tools.slack.dev/deno-slack-sdk/reference/slack-types#usercontext) object, a Slack type that represents the user who is interacting with our workflow, as well as the `history` of the channel that will be summarized, which includes the ten most recent messages. +The central part of this functionality is shown in the following code snippet. Note the use of the [`user_context`](/tools/deno-slack-sdk/reference/slack-types#usercontext) object, a Slack type that represents the user who is interacting with our workflow, as well as the `history` of the channel that will be summarized, which includes the ten most recent messages. ```python from ai.providers import get_provider_response @@ -191,12 +191,12 @@ To ask Bolty a question, you can chat with Bolty in any channel the app is in. U You can also navigate to **Bolty** in your **Apps** list and select the **Messages** tab to chat with Bolty directly. -![Ask Bolty](/img/tutorials/ai-chatbot/8.png) +![Ask Bolty](8.png) ## Next steps {#next-steps} Congratulations! You've successfully integrated the power of AI into your workspace. Check out these links to take the next steps in your Bolt for Python journey. -* To learn more about Bolt for Python, refer to the [Getting started](../getting-started) documentation. -* For more details about creating workflow steps using the Bolt SDK, refer to the [workflow steps for Bolt](https://docs.slack.dev/workflows/workflow-steps) guide. -* To use the Bolt for Python SDK to develop on the automations platform, refer to the [Create a workflow step for Workflow Builder: Bolt for Python](/bolt-python/tutorial/custom-steps) tutorial. +* To learn more about Bolt for Python, refer to the [Getting started](/tools/bolt-python/getting-started) documentation. +* For more details about creating workflow steps using the Bolt SDK, refer to the [workflow steps for Bolt](/workflows/workflow-steps) guide. +* To use the Bolt for Python SDK to develop on the automations platform, refer to the [Create a workflow step for Workflow Builder: Bolt for Python](/tools/bolt-python/tutorial/custom-steps-workflow-builder-new) tutorial. diff --git a/docs/static/img/tutorials/custom-steps-jira/1.png b/docs/english/tutorial/custom-steps-for-jira/1.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-jira/1.png rename to docs/english/tutorial/custom-steps-for-jira/1.png diff --git a/docs/static/img/tutorials/custom-steps-jira/2.png b/docs/english/tutorial/custom-steps-for-jira/2.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-jira/2.png rename to docs/english/tutorial/custom-steps-for-jira/2.png diff --git a/docs/static/img/tutorials/custom-steps-jira/3.png b/docs/english/tutorial/custom-steps-for-jira/3.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-jira/3.png rename to docs/english/tutorial/custom-steps-for-jira/3.png diff --git a/docs/static/img/tutorials/custom-steps-jira/4.png b/docs/english/tutorial/custom-steps-for-jira/4.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-jira/4.png rename to docs/english/tutorial/custom-steps-for-jira/4.png diff --git a/docs/static/img/tutorials/custom-steps-jira/5.png b/docs/english/tutorial/custom-steps-for-jira/5.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-jira/5.png rename to docs/english/tutorial/custom-steps-for-jira/5.png diff --git a/docs/static/img/tutorials/custom-steps-jira/6.png b/docs/english/tutorial/custom-steps-for-jira/6.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-jira/6.png rename to docs/english/tutorial/custom-steps-for-jira/6.png diff --git a/docs/static/img/tutorials/custom-steps-jira/7.png b/docs/english/tutorial/custom-steps-for-jira/7.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-jira/7.png rename to docs/english/tutorial/custom-steps-for-jira/7.png diff --git a/docs/content/tutorial/custom-steps-for-jira.md b/docs/english/tutorial/custom-steps-for-jira/custom-steps-for-jira.md similarity index 86% rename from docs/content/tutorial/custom-steps-for-jira.md rename to docs/english/tutorial/custom-steps-for-jira/custom-steps-for-jira.md index b38f9337c..f310e75cc 100644 --- a/docs/content/tutorial/custom-steps-for-jira.md +++ b/docs/english/tutorial/custom-steps-for-jira/custom-steps-for-jira.md @@ -11,7 +11,7 @@ In this tutorial, you'll learn how to configure custom steps for use with JIRA. Before getting started, you will need the following: -* a development workspace where you have permissions to install apps. If you don’t have a workspace, go ahead and set that up now—you can [go here](https://slack.com/get-started#create) to create one, or you can join the [Developer Program](https://api.slack.com/developer-program) and provision a sandbox with access to all Slack features for free. +* a development workspace where you have permissions to install apps. If you don’t have a workspace, go ahead and set that up now—you can [go here](https://slack.com/get-started#create) to create one, or you can join the [Developer Program](https://api.slack.com/developer-program) and provision a sandbox with access to all Slack features for free. * a development environment with [Python 3.6](https://www.python.org/downloads/) or later. **Skip to the code** @@ -35,7 +35,7 @@ https://github.com/slack-samples/bolt-python-jira-functions/blob/main/manifest.j Before you'll be able to successfully run the app, you'll need to obtain and set some environment variables. 1. Once you have installed the app to your workspace, copy the **Bot User OAuth Token** from the **Install App** page. You will store this in your environment as `SLACK_BOT_TOKEN` (we'll get to that next). -2. Navigate to **Basic Information** and in the **App-Level Tokens** section , click **Generate Token and Scopes**. Add the [`connections:write`](https://docs.slack.dev/reference/scopes/connections.write) scope, name the token, and click **Generate**. Copy this token. You will store this in your environment as `SLACK_APP_TOKEN`. +2. Navigate to **Basic Information** and in the **App-Level Tokens** section , click **Generate Token and Scopes**. Add the [`connections:write`](/reference/scopes/connections.write) scope, name the token, and click **Generate**. Copy this token. You will store this in your environment as `SLACK_APP_TOKEN`. 3. Follow [these instructions](https://confluence.atlassian.com/adminjiraserver0909/configure-an-incoming-link-1251415519.html) to create an external app link and to generate its redirect URL (the base of which will be stored as your APP_BASE_URL variable below), client ID, and client secret. 4. Run the following commands in your terminal to store your environment variables, client ID, and client secret. 5. You'll also need to know your team ID (found by opening your Slack instance in a web browser and copying the value within the link that starts with the letter **T**) and your app ID (found under **Basic Information**). @@ -127,21 +127,21 @@ If your app is up and running, you'll see a message noting that the app is start 2. Select **New Workflow** > **Build Workflow**. 3. Click **Untitled Workflow** at the top of the pane to rename your workflow. We'll call it **Create Issue**. For the description, enter _Creates a new issue_, then click **Save**. -![Workflow details](/img/tutorials/custom-steps-jira/1.png) +![Workflow details](1.png) 4. Select **Choose an event** under **Start the workflow...**, and then select **From a link in Slack**. Click **Continue**. -![Start the workflow](/img/tutorials/custom-steps-jira/2.png) +![Start the workflow](2.png) 5. Under **Then, do these things** click **Add steps** to add the custom step. Your custom step will be the function defined in the [`create_issue.py`](https://github.com/slack-samples/bolt-python-jira-functions/blob/main/listeners/functions/create_issue.py) file. Scroll down to the bottom of the list on the right-hand pane and select **Custom**, then **BoltPy Jira Functions** > **Create an issue**. Enter the project details, issue type (optional), summary (optional), and description (optional). Click **Save**. -![Custom function](/img/tutorials/custom-steps-jira/3.png) +![Custom function](3.png) 6. Add another step and select **Messages** > **Send a message to a channel**. Select **Channel where the workflow was used** from the drop-down list and then select **Insert a variable** and **Issue url**. Click **Save**. -![Insert variable for issue URL](/img/tutorials/custom-steps-jira/4.png) +![Insert variable for issue URL](4.png) 7. Click **Publish** to make the workflow available to your workspace. @@ -150,16 +150,16 @@ If your app is up and running, you'll see a message noting that the app is start 1. Copy your workflow link. 2. Navigate to your app's home tab and click **Connect an Account** to connect your JIRA account to the app. -![Connect account](/img/tutorials/custom-steps-jira/5.png) +![Connect account](5.png) 3. Click **Allow** on the screen that appears. -![Allow connection](/img/tutorials/custom-steps-jira/6.png) +![Allow connection](6.png) 4. In any channel, post the workflow link you copied. 5. Click **Start Workflow** and observe as the link to a new JIRA ticket is posted in the channel. Click the link to be directed to the newly-created issue within your JIRA project. -![JIRA issue](/img/tutorials/custom-steps-jira/7.png) +![JIRA issue](7.png) When finished, you can click the **Disconnect Account** button in the home tab to disconnect your app from your JIRA account. @@ -167,6 +167,6 @@ When finished, you can click the **Disconnect Account** button in the home tab t Congratulations! You've successfully customized your workspace with custom steps in Workflow Builder. Check out these links to take the next steps in your journey. -* To learn more about Bolt for Python, refer to the [getting started](/getting-started) documentation. -* For more details about creating workflow steps using the Bolt SDK, refer to the [workflow steps for Bolt](https://docs.slack.dev/workflows/workflow-steps) guide. -* For information about custom steps dynamic options, refer to [custom steps dynamic options in Workflow Builder](https://docs.slack.dev/workflows/creating-custom-steps-dynamic-options). +* To learn more about Bolt for Python, refer to the [getting started](/tools/bolt-python/getting-started) documentation. +* For more details about creating workflow steps using the Bolt SDK, refer to the [workflow steps for Bolt](/workflows/workflow-steps) guide. +* For information about custom steps dynamic options, refer to [custom steps dynamic options in Workflow Builder](/tools/bolt-python/concepts/custom-steps-dynamic-options). diff --git a/docs/static/img/tutorials/custom-steps-wfb-existing/add-step.png b/docs/english/tutorial/custom-steps-workflow-builder-existing/add-step.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-existing/add-step.png rename to docs/english/tutorial/custom-steps-workflow-builder-existing/add-step.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-existing/app-message.png b/docs/english/tutorial/custom-steps-workflow-builder-existing/app-message.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-existing/app-message.png rename to docs/english/tutorial/custom-steps-workflow-builder-existing/app-message.png diff --git a/docs/content/tutorial/custom-steps-workflow-builder-existing.md b/docs/english/tutorial/custom-steps-workflow-builder-existing/custom-steps-workflow-builder-existing.md similarity index 91% rename from docs/content/tutorial/custom-steps-workflow-builder-existing.md rename to docs/english/tutorial/custom-steps-workflow-builder-existing/custom-steps-workflow-builder-existing.md index e5c584a4c..0441b033c 100644 --- a/docs/content/tutorial/custom-steps-workflow-builder-existing.md +++ b/docs/english/tutorial/custom-steps-workflow-builder-existing/custom-steps-workflow-builder-existing.md @@ -1,12 +1,10 @@ ---- -title: Custom Steps for Workflow Builder (existing app) ---- +# Custom Steps for Workflow Builder (existing app) :::info[This feature requires a paid plan] If you don't have a paid workspace for development, you can join the [Developer Program](https://api.slack.com/developer-program) and provision a sandbox with access to all Slack features for free. ::: -If you followed along with our [create a custom step for Workflow Builder: new app](/tutorial/custom-steps-workflow-builder-new) tutorial, you have seen how to add custom steps to a brand new app. But what if you have an app up and running currently to which you'd like to add custom steps? You've come to the right place! +If you followed along with our [create a custom step for Workflow Builder: new app](/tools/bolt-python/tutorial/custom-steps-workflow-builder-new) tutorial, you have seen how to add custom steps to a brand new app. But what if you have an app up and running currently to which you'd like to add custom steps? You've come to the right place! In this tutorial we will: - Start with an existing Bolt app @@ -28,7 +26,7 @@ In order to add custom workflow steps to an app, the app also needs to be org-re Navigate to **Org Level Apps** in the left nav and click **Opt-In**, then confirm **Yes, Opt-In**. -![Make your app org-ready](/img/tutorials/custom-steps-wfb-existing/org-ready.png) +![Make your app org-ready](org-ready.png) ## Adding a new workflow step {#add-step} @@ -54,19 +52,19 @@ Navigate to **App Manifest** in the left nav and add the `function_executed` eve Navigate to **Workflow Steps** in the left nav and click **Add Step**. This is where we'll configure our step's inputs, outputs, name, and description. -![Add step](/img/tutorials/custom-steps-wfb-existing/add-step.png) +![Add step](add-step.png) For illustration purposes in this tutorial, we're going to write a custom step called Request Time Off. When the step is invoked, a message will be sent to the provided manager with an option to approve or deny the time-off request. When the manager takes an action (approves or denies the request), a message is posted with the decision and the manager who made the decision. The step will take two user IDs as inputs, representing the requesting user and their manager, and it will output both of those user IDs as well as the decision made. Add the pertinent details to the step: -![Define step](/img/tutorials/custom-steps-wfb-existing/define-step.png) +![Define step](define-step.png) Remember this `callback_id`. We will use this later when implementing a function listener. Then add the input and output parameters: -![Add inputs](/img/tutorials/custom-steps-wfb-existing/inputs.png) +![Add inputs](inputs.png) -![Add outputs](/img/tutorials/custom-steps-wfb-existing/outputs.png) +![Add outputs](outputs.png) Save your changes. @@ -260,11 +258,11 @@ Click the button to create a **New Workflow**, then **Build Workflow**. Choose t In the **Steps** pane to the right, search for your app name and locate the **Request time off** step we created. -![Find step](/img/tutorials/custom-steps-wfb-existing/find-step.png) +![Find step](find-step.png) Select the step and choose the desired inputs and click **Save**. -![Step inputs](/img/tutorials/custom-steps-wfb-existing/step-inputs.png) +![Step inputs](step-inputs.png) Next, click **Finish Up**, give your workflow a name and description, then click **Publish**. Copy the link for your workflow on the next screen, then click **Done**. @@ -272,12 +270,12 @@ Next, click **Finish Up**, give your workflow a name and description, then click In any channel where your app is installed, paste the link you copied and send it as a message. The link will unfurl into a button to start the workflow. Click the button to start the workflow. If you set yourself up as the manager, you will then see a message from your app. Pressing either button will return a confirmation or denial of your time off request. -![Message](/img/tutorials/custom-steps-wfb-existing/app-message.png) +![Message](app-message.png) ## Next steps {#next-steps} Nice work! Now that you've added a workflow step to your Bolt app, a world of possibilities is open to you! Create and share workflow steps across your organization to optimize Slack users' time and make their working lives more productive. -If you're looking to create a brand new Bolt app with custom workflow steps, check out [the tutorial here](/tutorial/custom-steps-workflow-builder-new). +If you're looking to create a brand new Bolt app with custom workflow steps, check out [the tutorial here](/tools/bolt-python/tutorial/custom-steps-workflow-builder-new). -If you're interested in exploring how to create custom steps to use in Workflow Builder as steps with our Deno Slack SDK, too, that tutorial can be found [here](https://tools.slack.dev/deno-slack-sdk/tutorials/workflow-builder-custom-step/). +If you're interested in exploring how to create custom steps to use in Workflow Builder as steps with our Deno Slack SDK, too, that tutorial can be found [here](/tools/deno-slack-sdk/tutorials/workflow-builder-custom-step/). diff --git a/docs/static/img/tutorials/custom-steps-wfb-existing/define-step.png b/docs/english/tutorial/custom-steps-workflow-builder-existing/define-step.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-existing/define-step.png rename to docs/english/tutorial/custom-steps-workflow-builder-existing/define-step.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-existing/find-step.png b/docs/english/tutorial/custom-steps-workflow-builder-existing/find-step.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-existing/find-step.png rename to docs/english/tutorial/custom-steps-workflow-builder-existing/find-step.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-existing/inputs.png b/docs/english/tutorial/custom-steps-workflow-builder-existing/inputs.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-existing/inputs.png rename to docs/english/tutorial/custom-steps-workflow-builder-existing/inputs.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-existing/org-ready.png b/docs/english/tutorial/custom-steps-workflow-builder-existing/org-ready.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-existing/org-ready.png rename to docs/english/tutorial/custom-steps-workflow-builder-existing/org-ready.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-existing/outputs.png b/docs/english/tutorial/custom-steps-workflow-builder-existing/outputs.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-existing/outputs.png rename to docs/english/tutorial/custom-steps-workflow-builder-existing/outputs.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-existing/step-inputs.png b/docs/english/tutorial/custom-steps-workflow-builder-existing/step-inputs.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-existing/step-inputs.png rename to docs/english/tutorial/custom-steps-workflow-builder-existing/step-inputs.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-new/app-token.png b/docs/english/tutorial/custom-steps-workflow-builder-new/app-token.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-new/app-token.png rename to docs/english/tutorial/custom-steps-workflow-builder-new/app-token.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-new/bot-token.png b/docs/english/tutorial/custom-steps-workflow-builder-new/bot-token.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-new/bot-token.png rename to docs/english/tutorial/custom-steps-workflow-builder-new/bot-token.png diff --git a/docs/content/tutorial/custom-steps-workflow-builder-new.md b/docs/english/tutorial/custom-steps-workflow-builder-new/custom-steps-workflow-builder-new.md similarity index 90% rename from docs/content/tutorial/custom-steps-workflow-builder-new.md rename to docs/english/tutorial/custom-steps-workflow-builder-new/custom-steps-workflow-builder-new.md index 9d01b8676..1dceed45a 100644 --- a/docs/content/tutorial/custom-steps-workflow-builder-new.md +++ b/docs/english/tutorial/custom-steps-workflow-builder-new/custom-steps-workflow-builder-new.md @@ -1,12 +1,10 @@ ---- -title: Custom Steps for Workflow Builder (new app) ---- +# Custom Steps for Workflow Builder (new app) :::info[This feature requires a paid plan] If you don't have a paid workspace for development, you can join the [Developer Program](https://api.slack.com/developer-program) and provision a sandbox with access to all Slack features for free. ::: -Adding a workflow step to your app and implementing a corresponding function listener is how you define a custom Workflow Builder step. In this tutorial, you'll use [Bolt for Python](/bolt-python/) to add your workflow step, then wire it up in [Workflow Builder](https://slack.com/help/articles/360035692513-Guide-to-Workflow-Builder). +Adding a workflow step to your app and implementing a corresponding function listener is how you define a custom Workflow Builder step. In this tutorial, you'll use [Bolt for Python](/tools/bolt-python/) to add your workflow step, then wire it up in [Workflow Builder](https://slack.com/help/articles/360035692513-Guide-to-Workflow-Builder). When finished, you'll be ready to build scalable and innovative workflow steps for anyone using Workflow Builder in your workspace. @@ -58,7 +56,7 @@ We now have a Bolt app ready for development! Open the `manifest.json` file and Open a browser and navigate to [your apps page](https://api.slack.com/apps). This is where we will create a new app with our previously copied manifest details. Click the **Create New App** button, then select **From an app manifest** when prompted to choose how you'd like to configure your app's settings. -![Create app from manifest](/img/tutorials/custom-steps-wfb-new/manifest.png) +![Create app from manifest](manifest.png) Next, select a workspace where you have permissions to install apps, and click **Next**. Select the **JSON** tab and clear the existing contents. Paste the contents of the `manifest.json` file you previously copied. @@ -70,11 +68,11 @@ All of your app's settings can be configured within these screens. By creating a Navigate to **Event Subscriptions** and expand **Subscribe to bot events** to see that we have subscribed to the `function_executed` event. This is also a requirement for adding workflow steps to our app, as it lets our app know when a step has been triggered, allowing our app to respond to it. -Another configuration setting to note is **Socket Mode**. We have turned this on for our local development, but socket mode is not intended for use in a production environment. When you are satisfied with your app and ready to deploy it to a production environment, you should switch to using public HTTP request URLs. Read more about getting started with HTTP in [Bolt for Python here](/bolt-python/getting-started). +Another configuration setting to note is **Socket Mode**. We have turned this on for our local development, but socket mode is not intended for use in a production environment. When you are satisfied with your app and ready to deploy it to a production environment, you should switch to using public HTTP request URLs. Read more about getting started with HTTP in [Bolt for Python here](/tools/bolt-python/getting-started). Clicking on **Workflow Steps** in the left nav will show you that one workflow step has been added! This reflects the `function` defined in our manifest: functions are workflow steps. We will get to this step's implementation later. -![Workflow step](/img/tutorials/custom-steps-wfb-new/workflow-step.png) +![Workflow step](workflow-step.png) ### Tokens {#tokens} @@ -85,17 +83,17 @@ In order to connect our app here with the logic of our sample code set up locall To generate an app token, navigate to **Basic Information** and scroll down to **App-Level Token**. -![App token](/img/tutorials/custom-steps-wfb-new/app-token.png) +![App token](app-token.png) Click **Generate Token and Scopes**, then **Add Scope** and choose `connections:write`. Choose a name for your token and click **Generate**. Copy that value, save it somewhere accessible, and click **Done** to close out of the modal. Next up is the bot token. We can only get this token by installing the app into the workspace. Navigate to **Install App** and click the button to install, choosing **Allow** at the next screen. -![Install app](/img/tutorials/custom-steps-wfb-new/install.png) +![Install app](install.png) You will then have a bot token. Again, copy that value and save it somewhere accessible. -![Bot token](/img/tutorials/custom-steps-wfb-new/bot-token.png) +![Bot token](bot-token.png) 💡 Treat your tokens like passwords and keep them safe. Your app uses them to post and retrieve information from Slack workspaces. Minimally, do NOT commit them to version control. @@ -120,8 +118,7 @@ You'll know the local development server is up and running successfully when it With your development server running, continue to the next step. -:::info -If you need to stop running the local development server, press `` + `c` to end the process. +:::info[If you need to stop running the local development server, press `` + `c` to end the process.] ::: ## Wiring up the sample step in Workflow Builder {#wfb} @@ -130,15 +127,15 @@ The starter project you cloned contains a sample custom step lovingly titled “ In the Slack Client of your development workspace, open Workflow Builder by clicking on the workspace name, **Tools**, then **Workflow Builder**. Create a new workflow, then select **Build Workflow**: -![Creating a new workflow](/img/tutorials/custom-steps-wfb-new/wfb-1.png) +![Creating a new workflow](wfb-1.png) Select **Choose an event** under **Start the workflow...**, then **From a link in Slack** to configure this workflow to start when someone clicks its shortcut link: -![Starting a new workflow from a shortcut link](/img/tutorials/custom-steps-wfb-new/wfb-2.png) +![Starting a new workflow from a shortcut link](wfb-2.png) Click the **Continue** button to confirm that this is workflow should start with a shortcut link: -![Confirming a new shortcut workflow setup](/img/tutorials/custom-steps-wfb-new/wfb-3.png) +![Confirming a new shortcut workflow setup](wfb-3.png) Find the sample step provided in the template by either searching for the name of your app (e.g., `Bolt Custom Step`) or the name of your step (e.g. `Sample step`) in the Steps search bar. @@ -146,43 +143,43 @@ If you search by app name, any custom step that your app has defined will be lis Add the “Sample step" in the search results to the workflow: -![Adding the sample step to the workflow](/img/tutorials/custom-steps-wfb-new/wfb-4.png) +![Adding the sample step to the workflow](wfb-4.png) As soon as you add the “Sample step" to the workflow, a modal will appear to configure the step's input—in this case, a user variable: -![Configuring the sample step's inputs](/img/tutorials/custom-steps-wfb-new/wfb-5.png) +![Configuring the sample step's inputs](wfb-5.png) Configure the user input to be “Person who used this workflow”, then click the **Save** button: -![Saving the sample step after configuring the user input](/img/tutorials/custom-steps-wfb-new/wfb-6.png) +![Saving the sample step after configuring the user input](wfb-6.png) Click the **Finish Up** button, then provide a name and description for your workflow. Finally, click the **Publish** button: -![Publishing a workflow](/img/tutorials/custom-steps-wfb-new/wfb-7.png) +![Publishing a workflow](wfb-7.png) Copy the shortcut link, then exit Workflow Builder and paste the link to a message in any channel you’re in: -![Copying a workflow link](/img/tutorials/custom-steps-wfb-new/wfb-8.png) +![Copying a workflow link](wfb-8.png) After you send a message containing the shortcut link, the link will unfurl and you’ll see a **Start Workflow** button. Click the **Start Workflow** button: -![Starting your new workflow](/img/tutorials/custom-steps-wfb-new/wfb-9.png) +![Starting your new workflow](wfb-9.png) You should see a new direct message from your app: -![A new direct message from your app](/img/tutorials/custom-steps-wfb-new/wfb-10.png) +![A new direct message from your app](wfb-10.png) The message from your app asks you to click the **Complete step** button: -![A new direct message from your app](/img/tutorials/custom-steps-wfb-new/wfb-11.png) +![A new direct message from your app](wfb-11.png) Once you click the button, the direct message to you will be updated to let you know that the step interaction was successfully completed: -![Sample step finished successfully](/img/tutorials/custom-steps-wfb-new/wfb-12.png) +![Sample step finished successfully](wfb-12.png) Now that we’ve gotten a feel for how we will use the custom step, let’s learn more about how function listeners work. @@ -354,6 +351,6 @@ Slack will send an action event payload to your app when the button is clicked o That's it — we hope you learned a lot! -In this tutorial, we added custom steps via the manifest, but if you'd like to see how to add custom steps in the [app settings](https://api.slack.com/apps) to an existing app, follow along with the [Create a custom step for Workflow Builder: existing Bolt app](/tutorials/custom-steps-workflow-builder-existing) tutorial. +In this tutorial, we added custom steps via the manifest, but if you'd like to see how to add custom steps in the [app settings](https://api.slack.com/apps) to an existing app, follow along with the [Create a custom step for Workflow Builder: existing Bolt app](/tools/bolt-python/tutorial/custom-steps-workflow-builder-existing) tutorial. -If you're interested in exploring how to create custom steps to use in Workflow Builder as steps with our Deno Slack SDK, too, that tutorial can be found [here](https://tools.slack.dev/deno-slack-sdk/tutorials/workflow-builder-custom-step/). +If you're interested in exploring how to create custom steps to use in Workflow Builder as steps with our Deno Slack SDK, too, that tutorial can be found [here](/tools/deno-slack-sdk/tutorials/workflow-builder-custom-step/). diff --git a/docs/static/img/tutorials/custom-steps-wfb-new/install.png b/docs/english/tutorial/custom-steps-workflow-builder-new/install.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-new/install.png rename to docs/english/tutorial/custom-steps-workflow-builder-new/install.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-new/manifest.png b/docs/english/tutorial/custom-steps-workflow-builder-new/manifest.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-new/manifest.png rename to docs/english/tutorial/custom-steps-workflow-builder-new/manifest.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-new/wfb-1.png b/docs/english/tutorial/custom-steps-workflow-builder-new/wfb-1.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-new/wfb-1.png rename to docs/english/tutorial/custom-steps-workflow-builder-new/wfb-1.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-new/wfb-10.png b/docs/english/tutorial/custom-steps-workflow-builder-new/wfb-10.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-new/wfb-10.png rename to docs/english/tutorial/custom-steps-workflow-builder-new/wfb-10.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-new/wfb-11.png b/docs/english/tutorial/custom-steps-workflow-builder-new/wfb-11.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-new/wfb-11.png rename to docs/english/tutorial/custom-steps-workflow-builder-new/wfb-11.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-new/wfb-12.png b/docs/english/tutorial/custom-steps-workflow-builder-new/wfb-12.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-new/wfb-12.png rename to docs/english/tutorial/custom-steps-workflow-builder-new/wfb-12.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-new/wfb-2.png b/docs/english/tutorial/custom-steps-workflow-builder-new/wfb-2.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-new/wfb-2.png rename to docs/english/tutorial/custom-steps-workflow-builder-new/wfb-2.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-new/wfb-3.png b/docs/english/tutorial/custom-steps-workflow-builder-new/wfb-3.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-new/wfb-3.png rename to docs/english/tutorial/custom-steps-workflow-builder-new/wfb-3.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-new/wfb-4.png b/docs/english/tutorial/custom-steps-workflow-builder-new/wfb-4.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-new/wfb-4.png rename to docs/english/tutorial/custom-steps-workflow-builder-new/wfb-4.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-new/wfb-5.png b/docs/english/tutorial/custom-steps-workflow-builder-new/wfb-5.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-new/wfb-5.png rename to docs/english/tutorial/custom-steps-workflow-builder-new/wfb-5.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-new/wfb-6.png b/docs/english/tutorial/custom-steps-workflow-builder-new/wfb-6.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-new/wfb-6.png rename to docs/english/tutorial/custom-steps-workflow-builder-new/wfb-6.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-new/wfb-7.png b/docs/english/tutorial/custom-steps-workflow-builder-new/wfb-7.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-new/wfb-7.png rename to docs/english/tutorial/custom-steps-workflow-builder-new/wfb-7.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-new/wfb-8.png b/docs/english/tutorial/custom-steps-workflow-builder-new/wfb-8.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-new/wfb-8.png rename to docs/english/tutorial/custom-steps-workflow-builder-new/wfb-8.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-new/wfb-9.png b/docs/english/tutorial/custom-steps-workflow-builder-new/wfb-9.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-new/wfb-9.png rename to docs/english/tutorial/custom-steps-workflow-builder-new/wfb-9.png diff --git a/docs/static/img/tutorials/custom-steps-wfb-new/workflow-step.png b/docs/english/tutorial/custom-steps-workflow-builder-new/workflow-step.png similarity index 100% rename from docs/static/img/tutorials/custom-steps-wfb-new/workflow-step.png rename to docs/english/tutorial/custom-steps-workflow-builder-new/workflow-step.png diff --git a/docs/content/tutorial/custom-steps.md b/docs/english/tutorial/custom-steps.md similarity index 94% rename from docs/content/tutorial/custom-steps.md rename to docs/english/tutorial/custom-steps.md index 2486a49ef..66dc16198 100644 --- a/docs/content/tutorial/custom-steps.md +++ b/docs/english/tutorial/custom-steps.md @@ -9,7 +9,7 @@ If you don't have a paid workspace for development, you can join the [Developer With custom steps for Bolt apps, your app can create and process workflow steps that users later add in Workflow Builder. This guide goes through how to build a custom step for your app using the [app settings](https://api.slack.com/apps). -If you're looking to build a custom step using the Deno Slack SDK, check out our guide on [creating a custom step for Workflow Builder with the Deno Slack SDK](https://tools.slack.dev/deno-slack-sdk/tutorials/workflow-builder-custom-step/). +If you're looking to build a custom step using the Deno Slack SDK, check out our guide on [creating a custom step for Workflow Builder with the Deno Slack SDK](/tools/deno-slack-sdk/tutorials/workflow-builder-custom-step/). You can also take a look at the template for the [Bolt for Python custom workflow step](https://github.com/slack-samples/bolt-python-custom-step-template) on GitHub. @@ -69,7 +69,7 @@ Field | Type | Description `type` | String | Defines the data type and can fall into one of two categories: primitives or Slack-specific. `title` | String | The label that appears in Workflow Builder when a user sets up this step in their workflow. `description` | String | The description that accompanies the input when a user sets up this step in their workflow. -`dynamic_options` | Object | For custom steps dynamic options in Workflow Builder, define this property and point to a custom step designed to return the set of dynamic elements once the step is added to a workflow within Workflow Builder. Dynamic options in Workflow Builder can be rendered in one of two ways: as a drop-down menu (single-select or multi-select), or as a set of fields. Refer to custom steps dynamic options for Workflow Builder using [Bolt for JavaScript](https://tools.slack.dev/bolt-js/concepts/custom-steps-dynamic-options/) or [Bolt for Python](https://tools.slack.dev/bolt-python/concepts/custom-steps-dynamic-options/) for more details. +`dynamic_options` | Object | For custom steps dynamic options in Workflow Builder, define this property and point to a custom step designed to return the set of dynamic elements once the step is added to a workflow within Workflow Builder. Dynamic options in Workflow Builder can be rendered in one of two ways: as a drop-down menu (single-select or multi-select), or as a set of fields. Refer to custom steps dynamic options for Workflow Builder using [Bolt for JavaScript](/tools/bolt-js/concepts/custom-steps-dynamic-options/) or [Bolt for Python](https://docs.slack.dev/tools/bolt-python/concepts/custom-steps-dynamic-options/) for more details. `is_required` | Boolean | Indicates whether or not the input is required by the step in order to run. If it’s required and not provided, the user will not be able to save the configuration nor use the step in their workflow. This property is available only in v1 of the manifest. We recommend v2, using the `required` array as noted in the example above. `hint` | String | Helper text that appears below the input when a user sets up this step in their workflow. @@ -225,7 +225,7 @@ The second argument is the callback function, or the logic that will run when yo Field | Description ------|------------ -`client` | A `WebClient` instance used to make things happen in Slack. From sending messages to opening modals, `client` makes it all happen. For a full list of available methods, refer to the [Web API methods](/methods). Read more about the `WebClient` for Bolt Python [here](https://tools.slack.dev/bolt-python/concepts/web-api/). +`client` | A `WebClient` instance used to make things happen in Slack. From sending messages to opening modals, `client` makes it all happen. For a full list of available methods, refer to the [Web API methods](/reference/methods). Read more about the `WebClient` for Bolt Python [here](https://docs.slack.dev/tools/bolt-python/concepts/web-api/). `complete` | A utility method that invokes `functions.completeSuccess`. This method indicates to Slack that a step has completed successfully without issue. When called, `complete` requires you include an `outputs` object that matches your step definition in [`output_parameters`](#inputs-outputs). `fail` | A utility method that invokes `functions.completeError`. True to its name, this method signals to Slack that a step has failed to complete. The `fail` method requires an argument of `error` to be sent along with it, which is used to help users understand what went wrong. `inputs` | An alias for the `input_parameters` that were provided to the step upon execution. @@ -255,7 +255,7 @@ When you're ready to deploy your steps for wider use, you'll need to decide *whe ### Control step access {#access} -You can choose who has access to your custom steps. To define this, refer to the [custom function access](/automation/functions/access) page. +You can choose who has access to your custom steps. To define this, refer to the [custom function access](/tools/deno-slack-sdk/guides/controlling-access-to-custom-functions) page. ### Distribution {#distribution} @@ -268,5 +268,5 @@ Apps containing custom steps cannot be distributed publicly or submitted to the ## Related tutorials {#tutorials} -* [Custom steps for Workflow Builder (new app)](/tutorial/custom-steps-WB-new) -* [Custom steps for Workflow Builder (existing app)](/tutorial/custom-steps-WB-existing) +* [Custom steps for Workflow Builder (new app)](/tools/bolt-python/tutorial/custom-steps-workflow-builder-new) +* [Custom steps for Workflow Builder (existing app)](/tools/bolt-python/tutorial/custom-steps-workflow-builder-existing/) \ No newline at end of file diff --git a/docs/static/img/tutorials/modals/base_link.gif b/docs/english/tutorial/modals/base_link.gif similarity index 100% rename from docs/static/img/tutorials/modals/base_link.gif rename to docs/english/tutorial/modals/base_link.gif diff --git a/docs/static/img/tutorials/modals/final_product.gif b/docs/english/tutorial/modals/final_product.gif similarity index 100% rename from docs/static/img/tutorials/modals/final_product.gif rename to docs/english/tutorial/modals/final_product.gif diff --git a/docs/static/img/tutorials/modals/heart_icon.gif b/docs/english/tutorial/modals/heart_icon.gif similarity index 100% rename from docs/static/img/tutorials/modals/heart_icon.gif rename to docs/english/tutorial/modals/heart_icon.gif diff --git a/docs/static/img/tutorials/modals/interactivity_url.png b/docs/english/tutorial/modals/interactivity_url.png similarity index 100% rename from docs/static/img/tutorials/modals/interactivity_url.png rename to docs/english/tutorial/modals/interactivity_url.png diff --git a/docs/content/tutorial/modals.md b/docs/english/tutorial/modals/modals.md similarity index 83% rename from docs/content/tutorial/modals.md rename to docs/english/tutorial/modals/modals.md index b6d672d08..ee6d1e0d8 100644 --- a/docs/content/tutorial/modals.md +++ b/docs/english/tutorial/modals/modals.md @@ -1,4 +1,3 @@ - # Modals If you're learning about Slack apps, modals, or slash commands for the first time, you've come to the right place! In this tutorial, we'll take a look at setting up your very own server using GitHub Codespaces, then using that server to run your Slack app built with the [**Bolt for Python framework**](https://github.com/SlackAPI/bolt-python). @@ -13,9 +12,9 @@ At the end of this tutorial, your final app will look like this: ![announce](https://github.com/user-attachments/assets/0bf1c2f0-4b22-4c9c-98b3-b21e9bcc14a8) And will make use of these Slack concepts: -* [**Block Kit**](https://docs.slack.dev/block-kit/) is a UI framework for Slack apps that allows you to create beautiful, interactive messages within Slack. If you've ever seen a message in Slack with buttons or a select menu, that's Block Kit. -* [**Modals**](https://docs.slack.dev/surfaces/modals) are a pop-up window that displays right in Slack. They grab the attention of the user, and are normally used to prompt users to provide some kind of information or input in a form. -* [**Slash Commands**](https://docs.slack.dev/interactivity/implementing-slash-commands) allow you to invoke your app within Slack by just typing into the message composer box. e.g. `/remind`, `/topic`. +* [**Block Kit**](/block-kit/) is a UI framework for Slack apps that allows you to create beautiful, interactive messages within Slack. If you've ever seen a message in Slack with buttons or a select menu, that's Block Kit. +* [**Modals**](/surfaces/modals) are a pop-up window that displays right in Slack. They grab the attention of the user, and are normally used to prompt users to provide some kind of information or input in a form. +* [**Slash Commands**](/interactivity/implementing-slash-commands) allow you to invoke your app within Slack by just typing into the message composer box. e.g. `/remind`, `/topic`. If you're familiar with using Heroku you can also deploy directly to Heroku with the following button. @@ -66,7 +65,7 @@ You'll need to create an app and configure it properly within App Settings befor } ``` -2. Once your app has been created, scroll down to `App-Level Tokens` and create a token that requests for the [`connections:write`](https://docs.slack.dev/reference/scopes/connections.write) scope, which allows you to use [Socket Mode](https://docs.slack.dev/apis/events-api/using-socket-mode), a secure way to develop on Slack through the use of WebSockets. Copy the value of your app token and keep it for safe-keeping. +2. Once your app has been created, scroll down to `App-Level Tokens` and create a token that requests for the [`connections:write`](/reference/scopes/connections.write) scope, which allows you to use [Socket Mode](/apis/events-api/using-socket-mode), a secure way to develop on Slack through the use of WebSockets. Copy the value of your app token and keep it for safe-keeping. 3. Install your app by heading to `Install App` in the left sidebar. Hit `Allow`, which means you're agreeing to install your app with the permissions that it is requesting. Be sure to copy the token that you receive, and keep it somewhere secret and safe. @@ -132,4 +131,4 @@ All done! 🎉 You've created your first slash command using Block Kit and modal ## Next steps {#next-steps} -If you want to learn more about Bolt for Python, refer to the [Getting Started guide](https://tools.slack.dev/bolt-python/getting-started). \ No newline at end of file +If you want to learn more about Bolt for Python, refer to the [Getting Started guide](https://docs.slack.dev/tools/bolt-python/getting-started). \ No newline at end of file diff --git a/docs/static/img/tutorials/modals/slash_command.png b/docs/english/tutorial/modals/slash_command.png similarity index 100% rename from docs/static/img/tutorials/modals/slash_command.png rename to docs/english/tutorial/modals/slash_command.png diff --git a/docs/footerConfig.js b/docs/footerConfig.js deleted file mode 100644 index 6433c049d..000000000 --- a/docs/footerConfig.js +++ /dev/null @@ -1,21 +0,0 @@ -const footer = { - links: [ - { - items: [ - { - html: ` - -
    - ©2025 Slack Technologies, LLC, a Salesforce company. All rights reserved. Various trademarks held by their respective owners. -
    - `, - }, - ], - }, - ], -}; - -module.exports = footer; diff --git a/docs/i18n/ja-jp/README.md b/docs/i18n/ja-jp/README.md deleted file mode 100644 index e23cb969b..000000000 --- a/docs/i18n/ja-jp/README.md +++ /dev/null @@ -1,121 +0,0 @@ -# Bolt for Python Japanese documentation - -This README describes how the Japanese documentation is created. Please read the [/docs README](./docs/README) for information on _all_ the documentation. - -[Docusaurus](https://docusaurus.io) supports using different languages. Each language is a different version of the same site. The English site is the default. The English page will be viewable if the page is not translated into Japanese. - -There will be English pages on the Japanese site for any non-translated pages. Japanese readers will not miss any content, but they may be confused seeing English and Japanese mixed together. Please give us your thoughts on this setup. - -Because of this, the sidebar does not need to be updated for the Japanese documentation. It's always the same as the English documentation! - -## Testing the Japanese site. - -Please read the [/docs README](./docs/README.md) for instructions. Be sure to run the site in Japanese: - -``` -npm run start -- --locale ja-jp -``` - ---- - -## Japanese documentation files - -``` -docs/ -├── content/ -│ ├── getting-started.md -│ └── concepts -│ └── sending-message.md -├── i18n/ja-jp -│ ├── code.json -│ ├── docusaurus-theme-classic/ -│ │ ├── footer.json -│ │ └── navbar.json -│ └── docusaurus-plugin-content-docs/ -│ └── current/ -│ ├── getting-started.md -│ └── concepts -│ └── sending-message.md -``` - -The Japanese documentation is in `i18n/ja-jp/`. The folder contains `docusaurus-plugin-content-docs`, `docusaurus-theme-classic`, and `code.json`. - -### `docusaurus-plugin-content-docs` - -``` -docs/ -├── content/ (English pages) -│ ├── example-page.md -│ ├── getting-started.md -│ └── concepts -│ └── sending-message.md -├── i18n/ja-jp -│ └── docusaurus-plugin-content-docs/ -│ └── current/ (Japanese pages) -│ ├── getting-started.md -│ └── concepts -│ └── sending-message.md -``` - -If the file is not in `i18n/ja-jp/docusaurus-plugin-content-docs/current/`, then the English file will be used. In the example above, `example-page.md` is not in `i18n/ja-jp/docusaurus-plugin-content-docs/current/`. Therefore, the English version of `example-page.md` will appear on the Japanese site. - -The Japanese page file formats in `i18n/ja-jp/docusaurus-plugin-content-docs/current/` must be the same as the English page files in `docs/content/`. Please keep the file names in English (example: `sending-message.md`). - -Please provide a title in Japanese. It will show up in the sidebar. There are two options: - -``` ---- -title: こんにちは ---- - -# こんにちは - -``` - -[Read the Docusaurus documentation for info on writing pages in markdown](https://docusaurus.io/docs/markdown-features). - -### `docusaurus-theme-classic` - -``` -└── i18n/ja-jp - └── docusaurus-theme-classic/ - ├── footer.json - └── navbar.json -``` - -`docusaurus-theme-classic` You can translate site components (footer and navbar) for the Japanese site. Each JSON object has a `messages` and `description` value: - * `message` - The Japanese translation. It will be in English if not translated. - * `description` - What and where the message is. This stays in English. - -For example: - -``` -{ - "item.label.Hello": { - "message": "こんにちは", - "description": "The title of the page" - } -} -``` - -The JSON files are created with the `npm run write-translations -- --locale ja-jp` command. [Please read the Docusaurus documentation](https://docusaurus.io/docs/i18n/tutorial#translate-your-react-code) for more info. - -### `code.json` - -``` -└── i18n/ja-jp - └── code.json -``` - -The `code.json` file is similar to `docusaurus-theme-classic` JSON objects. `code.json` has translations provided by Docusaurus for site elements. - -For example: - -``` - "theme.CodeBlock.copy": { - "message": "コピー", - "description": "The copy button label on code blocks" - }, -``` - -Be careful changing `code.json`. If you change something in this repo, it will likely need to be changed in the other tools.slack.dev repos too, like the Bolt-Python repo. We want these translations to match for all tools.slack.dev sites. \ No newline at end of file diff --git a/docs/i18n/ja-jp/code.json b/docs/i18n/ja-jp/code.json deleted file mode 100644 index 2b3c80254..000000000 --- a/docs/i18n/ja-jp/code.json +++ /dev/null @@ -1,321 +0,0 @@ -{ - "theme.NotFound.title": { - "message": "ページが見つかりません", - "description": "The title of the 404 page" - }, - "theme.NotFound.p1": { - "message": "お探しのページが見つかりませんでした", - "description": "The first paragraph of the 404 page" - }, - "theme.NotFound.p2": { - "message": "このページにリンクしているサイトの所有者にリンクが壊れていることを伝えてください", - "description": "The 2nd paragraph of the 404 page" - }, - "theme.ErrorPageContent.title": { - "message": "エラーが発生しました", - "description": "The title of the fallback page when the page crashed" - }, - "theme.BackToTopButton.buttonAriaLabel": { - "message": "先頭へ戻る", - "description": "The ARIA label for the back to top button" - }, - "theme.blog.archive.title": { - "message": "アーカイブ", - "description": "The page & hero title of the blog archive page" - }, - "theme.blog.archive.description": { - "message": "アーカイブ", - "description": "The page & hero description of the blog archive page" - }, - "theme.blog.paginator.navAriaLabel": { - "message": "ブログ記事一覧のナビゲーション", - "description": "The ARIA label for the blog pagination" - }, - "theme.blog.paginator.newerEntries": { - "message": "新しい記事", - "description": "The label used to navigate to the newer blog posts page (previous page)" - }, - "theme.blog.paginator.olderEntries": { - "message": "過去の記事", - "description": "The label used to navigate to the older blog posts page (next page)" - }, - "theme.blog.post.paginator.navAriaLabel": { - "message": "ブログ記事のナビゲーション", - "description": "The ARIA label for the blog posts pagination" - }, - "theme.blog.post.paginator.newerPost": { - "message": "新しい記事", - "description": "The blog post button label to navigate to the newer/previous post" - }, - "theme.blog.post.paginator.olderPost": { - "message": "過去の記事", - "description": "The blog post button label to navigate to the older/next post" - }, - "theme.blog.post.plurals": { - "message": "{count}件", - "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" - }, - "theme.blog.tagTitle": { - "message": "「{tagName}」タグの記事が{nPosts}件あります", - "description": "The title of the page for a blog tag" - }, - "theme.tags.tagsPageLink": { - "message": "全てのタグを見る", - "description": "The label of the link targeting the tag list page" - }, - "theme.colorToggle.ariaLabel": { - "message": "ダークモードを切り替える(現在は{mode})", - "description": "The ARIA label for the navbar color mode toggle" - }, - "theme.colorToggle.ariaLabel.mode.dark": { - "message": "ダークモード", - "description": "The name for the dark color mode" - }, - "theme.colorToggle.ariaLabel.mode.light": { - "message": "ライトモード", - "description": "The name for the light color mode" - }, - "theme.docs.breadcrumbs.navAriaLabel": { - "message": "パンくずリストのナビゲーション", - "description": "The ARIA label for the breadcrumbs" - }, - "theme.docs.DocCard.categoryDescription.plurals": { - "message": "{count}項目", - "description": "The default description for a category card in the generated index about how many items this category includes" - }, - "theme.docs.paginator.navAriaLabel": { - "message": "ドキュメントページ", - "description": "The ARIA label for the docs pagination" - }, - "theme.docs.paginator.previous": { - "message": "前へ", - "description": "The label used to navigate to the previous doc" - }, - "theme.docs.paginator.next": { - "message": "次へ", - "description": "The label used to navigate to the next doc" - }, - "theme.docs.tagDocListPageTitle.nDocsTagged": { - "message": "{count}記事", - "description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" - }, - "theme.docs.tagDocListPageTitle": { - "message": "「{tagName}」タグのついた{nDocsTagged}", - "description": "The title of the page for a docs tag" - }, - "theme.docs.versionBadge.label": { - "message": "バージョン: {versionLabel}" - }, - "theme.docs.versions.unreleasedVersionLabel": { - "message": "これはリリース前のバージョン{versionLabel}の{siteTitle}のドキュメントです。", - "description": "The label used to tell the user that he's browsing an unreleased doc version" - }, - "theme.docs.versions.unmaintainedVersionLabel": { - "message": "これはバージョン{versionLabel}の{siteTitle}のドキュメントで現在はメンテナンスされていません", - "description": "The label used to tell the user that he's browsing an unmaintained doc version" - }, - "theme.docs.versions.latestVersionSuggestionLabel": { - "message": "最新のドキュメントは{latestVersionLink} ({versionLabel}) を見てください", - "description": "The label used to tell the user to check the latest version" - }, - "theme.docs.versions.latestVersionLinkLabel": { - "message": "最新バージョン", - "description": "The label used for the latest version suggestion link label" - }, - "theme.common.editThisPage": { - "message": "このページを編集", - "description": "The link label to edit the current page" - }, - "theme.lastUpdated.atDate": { - "message": "{date}に", - "description": "The words used to describe on which date a page has been last updated" - }, - "theme.lastUpdated.byUser": { - "message": "{user}が", - "description": "The words used to describe by who the page has been last updated" - }, - "theme.lastUpdated.lastUpdatedAtBy": { - "message": "{atDate}{byUser}最終更新", - "description": "The sentence used to display when a page has been last updated, and by who" - }, - "theme.common.headingLinkTitle": { - "message": "{heading} への直接リンク", - "description": "Title for link to heading" - }, - "theme.navbar.mobileVersionsDropdown.label": { - "message": "他のバージョン", - "description": "The label for the navbar versions dropdown on mobile view" - }, - "theme.tags.tagsListLabel": { - "message": "タグ:", - "description": "The label alongside a tag list" - }, - "theme.admonition.caution": { - "message": "注意", - "description": "The default label used for the Caution admonition (:::caution)" - }, - "theme.admonition.danger": { - "message": "危険", - "description": "The default label used for the Danger admonition (:::danger)" - }, - "theme.admonition.info": { - "message": "備考", - "description": "The default label used for the Info admonition (:::info)" - }, - "theme.admonition.note": { - "message": "注記", - "description": "The default label used for the Note admonition (:::note)" - }, - "theme.admonition.tip": { - "message": "ヒント", - "description": "The default label used for the Tip admonition (:::tip)" - }, - "theme.admonition.warning": { - "message": "警告", - "description": "The default label used for the Warning admonition (:::warning)" - }, - "theme.AnnouncementBar.closeButtonAriaLabel": { - "message": "閉じる", - "description": "The ARIA label for close button of announcement bar" - }, - "theme.blog.sidebar.navAriaLabel": { - "message": "最近のブログ記事のナビゲーション", - "description": "The ARIA label for recent posts in the blog sidebar" - }, - "theme.CodeBlock.copied": { - "message": "コピーしました", - "description": "The copied button label on code blocks" - }, - "theme.CodeBlock.copyButtonAriaLabel": { - "message": "クリップボードにコードをコピー", - "description": "The ARIA label for copy code blocks button" - }, - "theme.CodeBlock.copy": { - "message": "コピー", - "description": "The copy button label on code blocks" - }, - "theme.CodeBlock.wordWrapToggle": { - "message": "折り返し", - "description": "The title attribute for toggle word wrapping button of code block lines" - }, - "theme.DocSidebarItem.expandCategoryAriaLabel": { - "message": "'{label}'の目次を開く", - "description": "The ARIA label to expand the sidebar category" - }, - "theme.DocSidebarItem.collapseCategoryAriaLabel": { - "message": "'{label}'の目次を隠す", - "description": "The ARIA label to collapse the sidebar category" - }, - "theme.NavBar.navAriaLabel": { - "message": "ナビゲーション", - "description": "The ARIA label for the main navigation" - }, - "theme.navbar.mobileLanguageDropdown.label": { - "message": "他の言語", - "description": "The label for the mobile language switcher dropdown" - }, - "theme.TOCCollapsible.toggleButtonLabel": { - "message": "このページの見出し", - "description": "The label used by the button on the collapsible TOC component" - }, - "theme.blog.post.readMore": { - "message": "もっと見る", - "description": "The label used in blog post item excerpts to link to full blog posts" - }, - "theme.blog.post.readMoreLabel": { - "message": "{title}についてもっと見る", - "description": "The ARIA label for the link to full blog posts from excerpts" - }, - "theme.blog.post.readingTime.plurals": { - "message": "約{readingTime}分", - "description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" - }, - "theme.docs.breadcrumbs.home": { - "message": "ホームページ", - "description": "The ARIA label for the home page in the breadcrumbs" - }, - "theme.docs.sidebar.collapseButtonTitle": { - "message": "サイドバーを隠す", - "description": "The title attribute for collapse button of doc sidebar" - }, - "theme.docs.sidebar.collapseButtonAriaLabel": { - "message": "サイドバーを隠す", - "description": "The title attribute for collapse button of doc sidebar" - }, - "theme.docs.sidebar.navAriaLabel": { - "message": "ドキュメントのサイドバー", - "description": "The ARIA label for the sidebar navigation" - }, - "theme.docs.sidebar.closeSidebarButtonAriaLabel": { - "message": "ナビゲーションバーを閉じる", - "description": "The ARIA label for close button of mobile sidebar" - }, - "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { - "message": "← メインメニューに戻る", - "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)" - }, - "theme.docs.sidebar.toggleSidebarButtonAriaLabel": { - "message": "ナビゲーションバーを開く", - "description": "The ARIA label for hamburger menu button of mobile navigation" - }, - "theme.docs.sidebar.expandButtonTitle": { - "message": "サイドバーを開く", - "description": "The ARIA label and title attribute for expand button of doc sidebar" - }, - "theme.docs.sidebar.expandButtonAriaLabel": { - "message": "サイドバーを開く", - "description": "The ARIA label and title attribute for expand button of doc sidebar" - }, - "theme.ErrorPageContent.tryAgain": { - "message": "もう一度試してください", - "description": "The label of the button to try again rendering when the React error boundary captures an error" - }, - "theme.common.skipToMainContent": { - "message": "メインコンテンツまでスキップ", - "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation" - }, - "theme.tags.tagsPageTitle": { - "message": "タグ", - "description": "The title of the tag list page" - }, - "theme.unlistedContent.title": { - "message": "非公開のページ", - "description": "The unlisted content banner title" - }, - "theme.unlistedContent.message": { - "message": "このページは非公開です。 検索対象外となり、このページのリンクに直接アクセスできるユーザーのみに公開されます。", - "description": "The unlisted content banner message" - }, - "theme.blog.author.pageTitle": { - "message": "{authorName} - {nPosts}", - "description": "The title of the page for a blog author" - }, - "theme.blog.authorsList.pageTitle": { - "message": "著者一覧", - "description": "The title of the authors page" - }, - "theme.blog.authorsList.viewAll": { - "message": "すべての著者を見る", - "description": "The label of the link targeting the blog authors page" - }, - "theme.blog.author.noPosts": { - "message": "この著者による投稿はまだありません。", - "description": "The text for authors with 0 blog post" - }, - "theme.contentVisibility.unlistedBanner.title": { - "message": "非公開のページ", - "description": "The unlisted content banner title" - }, - "theme.contentVisibility.unlistedBanner.message": { - "message": "このページは非公開です。 検索対象外となり、このページのリンクに直接アクセスできるユーザーのみに公開されます。", - "description": "The unlisted content banner message" - }, - "theme.contentVisibility.draftBanner.title": { - "message": "下書きのページ", - "description": "The draft content banner title" - }, - "theme.contentVisibility.draftBanner.message": { - "message": "このページは下書きです。開発環境でのみ表示され、本番環境のビルドには含まれません。", - "description": "The draft content banner message" - } -} diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current.json b/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current.json deleted file mode 100644 index eb3b5be26..000000000 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "version.label": { - "message": "Next", - "description": "The label for version current" - }, - "sidebar.sidebarBoltPy.category.Basic concepts": { - "message": "基本的な概念", - "description": "The label for category Basic concepts in sidebar sidebarBoltPy" - }, - "sidebar.sidebarBoltPy.category.Advanced concepts": { - "message": "応用コンセプト", - "description": "The label for category Advanced concepts in sidebar sidebarBoltPy" - }, - "sidebar.sidebarBoltPy.category.steps from apps (Deprecated)": { - "message": "ワークフローステップ 非推奨", - "description": "The label for category steps from apps (Deprecated) in sidebar sidebarBoltPy" - }, - "sidebar.sidebarBoltPy.category.Tutorials": { - "message": "チュートリアル", - "description": "The label for category Tutorials in sidebar sidebarBoltPy" - }, - "sidebar.sidebarBoltPy.link.Code on GitHub": { - "message": "Code on GitHub", - "description": "The label for link Code on GitHub in sidebar sidebarBoltPy, linking to https://github.com/SlackAPI/bolt-python" - }, - "sidebar.sidebarBoltPy.link.Contributors Guide": { - "message": "貢献", - "description": "The label for link Contributors Guide in sidebar sidebarBoltPy, linking to https://github.com/SlackAPI/bolt-python/blob/main/.github/contributing.md" - }, - "sidebar.sidebarBoltPy.category.Guides": { - "message": "ガイド", - "description": "The label for category Guides in sidebar sidebarBoltPy" - }, - "sidebar.sidebarBoltPy.category.Slack API calls": { - "message": "Slack API コール", - "description": "The label for category Slack API calls in sidebar sidebarBoltPy" - }, - "sidebar.sidebarBoltPy.category.Events": { - "message": "イベント API", - "description": "The label for category Events in sidebar sidebarBoltPy" - }, - "sidebar.sidebarBoltPy.category.App UI & Interactivity": { - "message": "インタラクティビティ & ショートカット", - "description": "The label for category App UI & Interactivity in sidebar sidebarBoltPy" - }, - "sidebar.sidebarBoltPy.category.App Configuration": { - "message": "App の設定", - "description": "The label for category App Configuration in sidebar sidebarBoltPy" - }, - "sidebar.sidebarBoltPy.category.Middleware & Context": { - "message": "ミドルウェア & コンテキスト", - "description": "The label for category Middleware & Context in sidebar sidebarBoltPy" - }, - "sidebar.sidebarBoltPy.category.Adaptors": { - "message": "アダプター", - "description": "The label for category Adaptors in sidebar sidebarBoltPy" - }, - "sidebar.sidebarBoltPy.category.Authorization & Security": { - "message": "認可 & セキュリティ", - "description": "The label for category Authorization & Security in sidebar sidebarBoltPy" - }, - "sidebar.sidebarBoltPy.category.Legacy": { - "message": "レガシー(非推奨)", - "description": "The label for category Legacy in sidebar sidebarBoltPy" - }, - "sidebar.sidebarBoltPy.link.Reference": { - "message": "リファレンス", - "description": "The label for link Reference in sidebar sidebarBoltPy, linking to https://tools.slack.dev/bolt-python/api-docs/slack_bolt/" - }, - "sidebar.sidebarBoltPy.link.Release notes": { - "message": "リリースノート", - "description": "The label for link Release notes in sidebar sidebarBoltPy, linking to https://github.com/slackapi/bolt-python/releases" - }, - "sidebar.sidebarBoltPy.doc.Bolt for Python": { - "message": "Bolt for Python", - "description": "The label for the doc item Bolt for Python in sidebar sidebarBoltPy, linking to the doc index" - } -} diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/app-home.md b/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/app-home.md deleted file mode 100644 index 2dc5fd6c0..000000000 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/app-home.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: ホームタブの更新 -lang: ja-jp -slug: /concepts/app-home ---- - -ホームタブは、サイドバーや検索画面からアクセス可能なサーフェスエリアです。アプリはこのエリアを使ってユーザーごとのビューを表示することができます。アプリ設定ページで App Home の機能を有効にすると、`views.publish` API メソッドの呼び出しで `user_id` と[ビューのペイロード](https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission)を指定して、ホームタブを公開・更新することができるようになります。 - -`app_home_opened` イベントをサブスクライブすると、ユーザーが App Home を開く操作をリッスンできます。 - -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 -```python -@app.event("app_home_opened") -def update_home_tab(client, event, logger): - try: - # 組み込みのクライアントを使って views.publish を呼び出す - client.views_publish( - # イベントに関連づけられたユーザー ID を使用 - user_id=event["user"], - # アプリの設定で予めホームタブが有効になっている必要がある - view={ - "type": "home", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*Welcome home, <@" + event["user"] + "> :house:*" - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text":"Learn how home tabs can be more useful and interactive ." - } - } - ] - } - ) - except Exception as e: - logger.error(f"Error publishing home tab: {e}") -``` \ No newline at end of file diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/web-api.md b/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/web-api.md deleted file mode 100644 index 75953b5bd..000000000 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/web-api.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: Web API の使い方 -lang: ja-jp -slug: /concepts/web-api ---- - -`app.client`、またはミドルウェア・リスナーの引数 `client` として Bolt アプリに提供されている [`WebClient`](https://tools.slack.dev/python-slack-sdk/basic_usage.html) は必要な権限を付与されており、これを利用することで[あらゆる Web API メソッド](https://docs.slack.dev/reference/methods)を呼び出すことができます。このクライアントのメソッドを呼び出すと `SlackResponse` という Slack からの応答情報を含むオブジェクトが返されます。 - -Bolt の初期化に使用するトークンは `context` オブジェクトに設定されます。このトークンは、多くの Web API メソッドを呼び出す際に必要となります。 - -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 -```python -@app.message("wake me up") -def say_hello(client, message): - # 2020 年 9 月 30 日午後 11:59:59 を示す Unix エポック秒 - when_september_ends = 1601510399 - channel_id = message["channel"] - client.chat_scheduleMessage( - channel=channel_id, - post_at=when_september_ends, - text="Summer has come and passed" - ) -``` \ No newline at end of file diff --git a/docs/i18n/ja-jp/docusaurus-theme-classic/footer.json b/docs/i18n/ja-jp/docusaurus-theme-classic/footer.json deleted file mode 100644 index 5a2d1bc10..000000000 --- a/docs/i18n/ja-jp/docusaurus-theme-classic/footer.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "copyright": { - "message": "

    Made with ♡ by Slack and friends

    ", - "description": "The footer copyright" - } -} diff --git a/docs/i18n/ja-jp/docusaurus-theme-classic/navbar.json b/docs/i18n/ja-jp/docusaurus-theme-classic/navbar.json deleted file mode 100644 index 3eee009ee..000000000 --- a/docs/i18n/ja-jp/docusaurus-theme-classic/navbar.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "title": { - "message": "Slack Developer Tools", - "description": "The title in the navbar" - }, - "item.label.SDKs": { - "message": "SDKs", - "description": "Navbar item with label SDKs" - }, - "item.label.Java": { - "message": "Java", - "description": "Navbar item with label Java" - }, - "item.label.JavaScript": { - "message": "JavaScript", - "description": "Navbar item with label JavaScript" - }, - "item.label.Python": { - "message": "Python", - "description": "Navbar item with label Python" - }, - "item.label.Community": { - "message": "Community", - "description": "Navbar item with label Community" - }, - "item.label.Bolt": { - "message": "Bolt", - "description": "Navbar item with label Bolt" - }, - "item.label.API Docs": { - "message": "API Docs", - "description": "Navbar item with label API Docs" - }, - "item.label.Java Slack SDK": { - "message": "Java Slack SDK", - "description": "Navbar item with label Java Slack SDK" - }, - "item.label.Node Slack SDK": { - "message": "Node Slack SDK", - "description": "Navbar item with label Node Slack SDK" - }, - "item.label.Python Slack SDK": { - "message": "Python Slack SDK", - "description": "Navbar item with label Python Slack SDK" - }, - "item.label.Deno Slack SDK": { - "message": "Deno Slack SDK", - "description": "Navbar item with label Deno Slack SDK" - }, - "item.label.Community tools": { - "message": "Community tools", - "description": "Navbar item with label Community tools" - }, - "item.label.Slack Community": { - "message": "Slack Community", - "description": "Navbar item with label Slack Community" - }, - "item.label.Slack CLI": { - "message": "Slack CLI", - "description": "Navbar item with label Slack CLI" - } -} diff --git a/docs/static/img/boltpy/basic-information-page.png b/docs/img/basic-information-page.png similarity index 100% rename from docs/static/img/boltpy/basic-information-page.png rename to docs/img/basic-information-page.png diff --git a/docs/static/img/boltpy/bot-token.png b/docs/img/bot-token.png similarity index 100% rename from docs/static/img/boltpy/bot-token.png rename to docs/img/bot-token.png diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/acknowledge.md b/docs/japanese/concepts/acknowledge.md similarity index 69% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/acknowledge.md rename to docs/japanese/concepts/acknowledge.md index 72cc39257..2b3756009 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/acknowledge.md +++ b/docs/japanese/concepts/acknowledge.md @@ -1,18 +1,14 @@ ---- -title: リクエストの確認 -lang: ja-jp -slug: /concepts/acknowledge ---- +# リクエストの確認 アクション(action)、コマンド(command)、ショートカット(shortcut)、オプション(options)、およびモーダルからのデータ送信(view_submission)の各リクエストは、**必ず** `ack()` 関数を使って確認を行う必要があります。これによってリクエストが受信されたことが Slack に認識され、Slack のユーザーインターフェイスが適切に更新されます。 -リクエストの種類によっては、確認で通知方法が異なる場合があります。例えば、外部データソースを使用する選択メニューのオプションのリクエストに対する確認では、適切な[オプション](https://docs.slack.dev/reference/block-kit/composition-objects/option-object)のリストとともに `ack()` を呼び出します。モーダルからのデータ送信に対する確認では、 `response_action` を渡すことで[モーダルの更新](/concepts/view_submissions)などを行えます。 +リクエストの種類によっては、確認で通知方法が異なる場合があります。例えば、外部データソースを使用する選択メニューのオプションのリクエストに対する確認では、適切な[オプション](/reference/block-kit/composition-objects/option-object)のリストとともに `ack()` を呼び出します。モーダルからのデータ送信に対する確認では、 `response_action` を渡すことで[モーダルの更新](/tools/bolt-python/concepts/view-submissions)などを行えます。 確認までの猶予は 3 秒しかないため、新しいメッセージの送信やデータベースからの情報の取得といった時間のかかる処理は、`ack()` を呼び出した後で行うことをおすすめします。 - FaaS / serverless 環境を使う場合、 `ack()` するタイミングが異なります。 これに関する詳細は [Lazy listeners (FaaS)](/concepts/lazy-listeners) を参照してください。 + FaaS / serverless 環境を使う場合、 `ack()` するタイミングが異なります。 これに関する詳細は [Lazy listeners (FaaS)](/tools/bolt-python/concepts/lazy-listeners) を参照してください。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # 外部データを使用する選択メニューオプションに応答するサンプル @app.options("menu_selection") diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/actions.md b/docs/japanese/concepts/actions.md similarity index 76% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/actions.md rename to docs/japanese/concepts/actions.md index 82d243e99..60019ebb7 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/actions.md +++ b/docs/japanese/concepts/actions.md @@ -1,8 +1,4 @@ ---- -title: アクション -lang: ja-jp -slug: /concepts/actions ---- +# アクション ## アクションのリスニング @@ -10,9 +6,9 @@ Bolt アプリは `action` メソッドを用いて、ボタンのクリック アクションは `str` 型または `re.Pattern` 型の `action_id` でフィルタリングできます。`action_id` は、Slack プラットフォーム上のインタラクティブコンポーネントを区別する一意の識別子として機能します。 -`action()` を使ったすべての例で `ack()` が使用されていることに注目してください。アクションのリスナー内では、Slack からのリクエストを受信したことを確認するために、`ack()` 関数を呼び出す必要があります。これについては、[リクエストの確認](/concepts/acknowledge)セクションで説明しています。 +`action()` を使ったすべての例で `ack()` が使用されていることに注目してください。アクションのリスナー内では、Slack からのリクエストを受信したことを確認するために、`ack()` 関数を呼び出す必要があります。これについては、[リクエストの確認](/tools/bolt-python/concepts/acknowledge)セクションで説明しています。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # 'approve_button' という action_id のブロックエレメントがトリガーされるたびに、このリスナーが呼び出させれる @app.action("approve_button") @@ -49,7 +45,7 @@ def update_message(ack, body, client): 2 つ目は、`respond()` を使用する方法です。これは、アクションに関連づけられた `response_url` を使ったメッセージ送信を行うためのユーティリティです。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # 'approve_button' という action_id のインタラクティブコンポーネントがトリガーされると、このリスナーが呼ばれる @app.action("approve_button") @@ -61,7 +57,7 @@ def approve_request(ack, say): ### respond() の利用 -`respond()` は `response_url` を使って送信するときに便利なメソッドで、これらと同じような動作をします。投稿するメッセージのペイロードには、全ての[メッセージペイロードのプロパティ](https://docs.slack.dev/messaging/#payloads)とオプションのプロパティとして `response_type`(値は `"in_channel"` または `"ephemeral"`)、`replace_original`、`delete_original`、`unfurl_links`、`unfurl_media` などを指定できます。こうすることによってアプリから送信されるメッセージは、やり取りの発生元に反映されます。 +`respond()` は `response_url` を使って送信するときに便利なメソッドで、これらと同じような動作をします。投稿するメッセージのペイロードには、全ての[メッセージペイロードのプロパティ](/messaging/#payloads)とオプションのプロパティとして `response_type`(値は `"in_channel"` または `"ephemeral"`)、`replace_original`、`delete_original`、`unfurl_links`、`unfurl_media` などを指定できます。こうすることによってアプリから送信されるメッセージは、やり取りの発生元に反映されます。 ```python # 'user_select' という action_id を持つアクションのトリガーをリッスン diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/adapters.md b/docs/japanese/concepts/adapters.md similarity index 97% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/adapters.md rename to docs/japanese/concepts/adapters.md index 78c94fca4..a58ed34a2 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/adapters.md +++ b/docs/japanese/concepts/adapters.md @@ -1,8 +1,4 @@ ---- -title: アダプター -lang: ja-jp -slug: /concepts/adapters ---- +# アダプター アダプターは Slack から届く受信リクエストの受付とパーズを担当し、それらのリクエストを `BoltRequest` の形式に変換して Bolt アプリに引き渡します。 diff --git a/docs/japanese/concepts/app-home.md b/docs/japanese/concepts/app-home.md new file mode 100644 index 000000000..d950221ad --- /dev/null +++ b/docs/japanese/concepts/app-home.md @@ -0,0 +1,40 @@ +# ホームタブの更新 + +[ホームタブ](/surfaces/app-home)は、サイドバーや検索画面からアクセス可能なサーフェスエリアです。アプリはこのエリアを使ってユーザーごとのビューを表示することができます。アプリ設定ページで App Home の機能を有効にすると、[`views.publish`](/reference/methods/views.publish) API メソッドの呼び出しで `user_id` と[ビューのペイロード](/reference/interaction-payloads/view-interactions-payload/#view_submission)を指定して、ホームタブを公開・更新することができるようになります。 + +[`app_home_opened`](/reference/events/app_home_opened) イベントをサブスクライブすると、ユーザーが App Home を開く操作をリッスンできます。 + +指定可能な引数の一覧は [モジュールドキュメント](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html)を参考にしてください。 + +```python +@app.event("app_home_opened") +def update_home_tab(client, event, logger): + try: + # 組み込みのクライアントを使って views.publish を呼び出す + client.views_publish( + # イベントに関連づけられたユーザー ID を使用 + user_id=event["user"], + # アプリの設定で予めホームタブが有効になっている必要がある + view={ + "type": "home", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "*Welcome home, <@" + event["user"] + "> :house:*" + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text":"Learn how home tabs can be more useful and interactive ." + } + } + ] + } + ) + except Exception as e: + logger.error(f"Error publishing home tab: {e}") +``` \ No newline at end of file diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/assistant.md b/docs/japanese/concepts/assistant.md similarity index 91% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/assistant.md rename to docs/japanese/concepts/assistant.md index 5ffcb6f10..e819f5361 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/assistant.md +++ b/docs/japanese/concepts/assistant.md @@ -1,12 +1,8 @@ ---- -title: エージェント・アシスタント -lang: en -slug: /concepts/assistant ---- +# エージェント・アシスタント -このページは、Bolt を使ってエージェント・アシスタントを実装するための方法を紹介します。この機能に関する一般的な情報については、[こちらのドキュメントページ(英語)](https://docs.slack.dev/ai/)を参照してください。 +このページは、Bolt を使ってエージェント・アシスタントを実装するための方法を紹介します。この機能に関する一般的な情報については、[こちらのドキュメントページ(英語)](/ai/)を参照してください。 -この機能を実装するためには、まず[アプリの設定画面](https://api.slack.com/apps)で **Agents & Assistants** 機能を有効にし、**OAuth & Permissions** のページで [`assistant:write`](https://docs.slack.dev/reference/scopes/assistant.write)、[chat:write](https://docs.slack.dev/reference/scopes/chat.write)、[`im:history`](https://docs.slack.dev/reference/scopes/im.history) を**ボットの**スコープに追加し、**Event Subscriptions** のページで [`assistant_thread_started`](https://docs.slack.dev/reference/events/assistant_thread_started)、[`assistant_thread_context_changed`](https://docs.slack.dev/reference/events/assistant_thread_context_changed)、[`message.im`](https://docs.slack.dev/reference/events/message.im) イベントを有効にしてください。 +この機能を実装するためには、まず[アプリの設定画面](https://api.slack.com/apps)で **Agents & Assistants** 機能を有効にし、**OAuth & Permissions** のページで [`assistant:write`](/reference/scopes/assistant.write)、[chat:write](/reference/scopes/chat.write)、[`im:history`](/reference/scopes/im.history) を**ボットの**スコープに追加し、**Event Subscriptions** のページで [`assistant_thread_started`](/reference/events/assistant_thread_started)、[`assistant_thread_context_changed`](/reference/events/assistant_thread_context_changed)、[`message.im`](/reference/events/message.im) イベントを有効にしてください。 また、この機能は Slack の有料プランでのみ利用可能です。もし開発用の有料プランのワークスペースをお持ちでない場合は、[Developer Program](https://api.slack.com/developer-program) に参加し、全ての有料プラン向け機能を利用可能なサンドボックス環境をつくることができます。 @@ -72,7 +68,7 @@ def respond_in_assistant_thread( app.use(assistant) ``` -リスナーに指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +リスナーに指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ユーザーがチャンネルの横でアシスタントスレッドを開いた場合、そのチャンネルの情報は、そのスレッドの `AssistantThreadContext` データとして保持され、 `get_thread_context` ユーティリティを使ってアクセスすることができます。Bolt がこのユーティリティを提供している理由は、後続のユーザーメッセージ投稿のイベントペイロードに最新のスレッドのコンテキスト情報は含まれないためです。そのため、アプリはコンテキスト情報が変更されたタイミングでそれを何らかの方法で保存し、後続のメッセージイベントのリスナーコードから参照できるようにする必要があります。 @@ -92,7 +88,7 @@ assistant = Assistant(thread_context_store=FileAssistantThreadContextStore()) ## アシスタントスレッドでの Block Kit インタラクション -より高度なユースケースでは、上のようなプロンプト例の提案ではなく Block Kit のボタンなどを使いたいという場合があるかもしれません。そして、後続の処理のために[構造化されたメッセージメタデータ](https://docs.slack.dev/messaging/message-metadata/)を含むメッセージを送信したいという場合もあるでしょう。 +より高度なユースケースでは、上のようなプロンプト例の提案ではなく Block Kit のボタンなどを使いたいという場合があるかもしれません。そして、後続の処理のために[構造化されたメッセージメタデータ](/messaging/message-metadata/)を含むメッセージを送信したいという場合もあるでしょう。 例えば、アプリが最初の返信で「参照しているチャンネルを要約」のようなボタンを表示し、ユーザーがそれをクリックして、より詳細な情報(例:要約するメッセージ数・日数、要約の目的など)を送信、アプリがそれを構造化されたメータデータに整理した上でリクエスト内容をボットのメッセージとして送信するようなシナリオです。 @@ -107,7 +103,7 @@ app = App( assistant = Assistant() -# リスナーに指定可能な引数の一覧は https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html を参照してください +# リスナーに指定可能な引数の一覧は https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html を参照してください @assistant.thread_started def start_assistant_thread(say: Say): diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/async.md b/docs/japanese/concepts/async.md similarity index 97% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/async.md rename to docs/japanese/concepts/async.md index 19609be89..cc38886d4 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/async.md +++ b/docs/japanese/concepts/async.md @@ -1,8 +1,4 @@ ---- -title: Async(asyncio)の使用 -lang: ja-jp -slug: /concepts/async ---- +# Async(asyncio)の使用 非同期バージョンの Bolt を使用する場合は、`App` の代わりに `AsyncApp` インスタンスをインポートして初期化します。`AsyncApp` では AIOHTTP を使って API リクエストを行うため、`aiohttp` をインストールする必要があります(`requirements.txt` に追記するか、`pip install aiohttp` を実行します)。 diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/authenticating-oauth.md b/docs/japanese/concepts/authenticating-oauth.md similarity index 89% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/authenticating-oauth.md rename to docs/japanese/concepts/authenticating-oauth.md index 82bbaf562..e58743f69 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/authenticating-oauth.md +++ b/docs/japanese/concepts/authenticating-oauth.md @@ -1,18 +1,14 @@ ---- -title: OAuth を使った認証 -lang: ja-jp -slug: /concepts/authenticating-oauth ---- +# OAuth を使った認証 -Slack アプリを複数のワークスペースにインストールできるようにするためには、OAuth フローを実装した上で、アクセストークンなどのインストールに関する情報をセキュアな方法で保存する必要があります。アプリを初期化する際に `client_id`、`client_secret`、`scopes`、`installation_store`、`state_store` を指定することで、OAuth のエンドポイントのルート情報や stateパラメーターの検証をBolt for Python にハンドリングさせることができます。カスタムのアダプターを実装する場合は、SDK が提供する組み込みの[OAuth ライブラリ](https://tools.slack.dev/python-slack-sdk/oauth/)を利用するのが便利です。これは Slack が開発したモジュールで、Bolt for Python 内部でも利用しています。 +Slack アプリを複数のワークスペースにインストールできるようにするためには、OAuth フローを実装した上で、アクセストークンなどのインストールに関する情報をセキュアな方法で保存する必要があります。アプリを初期化する際に `client_id`、`client_secret`、`scopes`、`installation_store`、`state_store` を指定することで、OAuth のエンドポイントのルート情報や stateパラメーターの検証をBolt for Python にハンドリングさせることができます。カスタムのアダプターを実装する場合は、SDK が提供する組み込みの[OAuth ライブラリ](/tools/python-slack-sdk/oauth/)を利用するのが便利です。これは Slack が開発したモジュールで、Bolt for Python 内部でも利用しています。 Bolt for Python によって `slack/oauth_redirect` という**リダイレクト URL** が生成されます。Slack はアプリのインストールフローを完了させたユーザーをこの URL にリダイレクトします。この**リダイレクト URL** は、アプリの設定の「**OAuth and Permissions**」であらかじめ追加しておく必要があります。この URL は、後ほど説明するように `OAuthSettings` というコンストラクタの引数で指定することもできます。 Bolt for Python は `slack/install` というルートも生成します。これはアプリを直接インストールするための「**Add to Slack**」ボタンを表示するために使われます。すでにワークスペースへのアプリのインストールが済んでいる場合に追加で各ユーザーのユーザートークンなどの情報を取得する場合や、カスタムのインストール用の URL を動的に生成したい場合などは、`oauth_settings` の `authorize_url_generator` でカスタムの URL ジェネレーターを指定することができます。 -バージョン 1.1.0 以降の Bolt for Python では、[OrG 全体へのインストール](https://docs.slack.dev/enterprise-grid/)がデフォルトでサポートされています。OrG 全体へのインストールは、アプリの設定の「**Org Level Apps**」で有効化できます。 +バージョン 1.1.0 以降の Bolt for Python では、[OrG 全体へのインストール](/enterprise-grid/)がデフォルトでサポートされています。OrG 全体へのインストールは、アプリの設定の「**Org Level Apps**」で有効化できます。 -Slack での OAuth を使ったインストールフローについて詳しくは、[API ドキュメントを参照してください](https://docs.slack.dev/authentication/installing-with-oauth)。 +Slack での OAuth を使ったインストールフローについて詳しくは、[API ドキュメントを参照してください](/authentication/installing-with-oauth)。 ```python import os diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/authorization.md b/docs/japanese/concepts/authorization.md similarity index 94% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/authorization.md rename to docs/japanese/concepts/authorization.md index 1a8797bb5..b6a14b30a 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/authorization.md +++ b/docs/japanese/concepts/authorization.md @@ -1,13 +1,9 @@ ---- -title: 認可(Authorization) -lang: ja-jp -slug: /concepts/authorization ---- +# 認可(Authorization) 認可(Authorization)は、Slack からの受信リクエストを処理するにあたって、どのようなSlack クレデンシャル (ボットトークンなど) を使用可能にするかを決定するプロセスです。 -単一のワークスペースにインストールされるアプリでは、`token` パラメーターを使って `App` のコンストラクターにボットトークンを渡すという、シンプルな方法が使えます。それに対して、複数のワークスペースにインストールされるアプリでは、次の 2 つの方法のいずれかを使用する必要があります。簡単なのは、組み込みの OAuth サポートを使用する方法です。OAuth サポートは、OAuth フロー用のURLのセットアップとstateの検証を行います。詳細は「[OAuth を使った認証](/concepts/authenticating-oauth)」セクションを参照してください。 +単一のワークスペースにインストールされるアプリでは、`token` パラメーターを使って `App` のコンストラクターにボットトークンを渡すという、シンプルな方法が使えます。それに対して、複数のワークスペースにインストールされるアプリでは、次の 2 つの方法のいずれかを使用する必要があります。簡単なのは、組み込みの OAuth サポートを使用する方法です。OAuth サポートは、OAuth フロー用のURLのセットアップとstateの検証を行います。詳細は「[OAuth を使った認証](/tools/bolt-python/concepts/authenticating-oauth)」セクションを参照してください。 よりカスタマイズできる方法として、`App` をインスタンス化する関数に`authorize` パラメーターを指定する方法があります。`authorize` 関数から返される [`AuthorizeResult` のインスタンス](https://github.com/slackapi/bolt-python/blob/main/slack_bolt/authorization/authorize_result.py)には、どのユーザーがどこで発生させたリクエストかを示す情報が含まれます。 diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/commands.md b/docs/japanese/concepts/commands.md similarity index 72% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/commands.md rename to docs/japanese/concepts/commands.md index 73d262446..c89568dbe 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/commands.md +++ b/docs/japanese/concepts/commands.md @@ -1,18 +1,14 @@ ---- -title: コマンドのリスニングと応答 -lang: ja-jp -slug: /concepts/commands ---- +# コマンドのリスニングと応答 スラッシュコマンドが実行されたリクエストをリッスンするには、`command()` メソッドを使用します。このメソッドでは `str` 型の `command_name` の指定が必要です。 コマンドリクエストをアプリが受信し確認したことを Slack に通知するため、`ack()` を呼び出す必要があります。 -スラッシュコマンドに応答する方法は 2 つあります。1 つ目は `say()` を使う方法で、文字列または JSON のペイロードを渡すことができます。2 つ目は `respond()` を使う方法です。これは `response_url` がある場合に活躍します。これらの方法は[アクションへの応答](/concepts/action-respond)セクションで詳しく説明しています。 +スラッシュコマンドに応答する方法は 2 つあります。1 つ目は `say()` を使う方法で、文字列または JSON のペイロードを渡すことができます。2 つ目は `respond()` を使う方法です。これは `response_url` がある場合に活躍します。これらの方法は[アクションへの応答](/tools/bolt-python/concepts/actions)セクションで詳しく説明しています。 アプリの設定でコマンドを登録するときは、リクエスト URL の末尾に `/slack/events` をつけます。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # echoコマンドは受け取ったコマンドをそのまま返す @app.command("/echo") diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/context.md b/docs/japanese/concepts/context.md similarity index 96% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/context.md rename to docs/japanese/concepts/context.md index 6f4dd8257..13a287728 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/context.md +++ b/docs/japanese/concepts/context.md @@ -1,8 +1,4 @@ ---- -title: コンテキストの追加 -lang: ja-jp -slug: /concepts/context ---- +# コンテキストの追加 すべてのリスナーは `context` ディクショナリにアクセスできます。リスナーはこれを使ってリクエストの付加情報を得ることができます。受信リクエストに含まれる `user_id`、`team_id`、`channel_id`、`enterprise_id` などの情報は、Bolt によって自動的に設定されます。 diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/custom-adapters.md b/docs/japanese/concepts/custom-adapters.md similarity index 90% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/custom-adapters.md rename to docs/japanese/concepts/custom-adapters.md index b72d48ded..584893511 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/custom-adapters.md +++ b/docs/japanese/concepts/custom-adapters.md @@ -1,10 +1,6 @@ ---- -title: カスタムのアダプター -lang: ja-jp -slug: /concepts/custom-adapters ---- +# カスタムのアダプター -[アダプター](/concepts/adapters)はフレキシブルで、あなたが使用したいフレームワークに合わせた調整も可能です。アダプターでは、次の 2 つの要素が必須となっています。 +[アダプター](/tools/bolt-python/concepts/adapters)はフレキシブルで、あなたが使用したいフレームワークに合わせた調整も可能です。アダプターでは、次の 2 つの要素が必須となっています。 - `__init__(app:App)` : コンストラクター。Bolt の `App` のインスタンスを受け取り、保持します。 - `handle(req:Request)` : Slack からの受信リクエストを受け取り、解析を行う関数。通常は `handle()` という名前です。リクエストを [`BoltRequest`](https://github.com/slackapi/bolt-python/blob/main/slack_bolt/request/request.py) のインスタンスに合った形にして、保持している Bolt アプリに引き渡します。 diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/errors.md b/docs/japanese/concepts/errors.md similarity index 92% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/errors.md rename to docs/japanese/concepts/errors.md index 6d715c1d7..2e8e27f90 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/errors.md +++ b/docs/japanese/concepts/errors.md @@ -1,8 +1,4 @@ ---- -title: エラーの処理 -lang: ja-jp -slug: /concepts/errors ---- +# エラーの処理 リスナー内でエラーが発生した場合に try/except ブロックを使用して直接エラーを処理することができます。アプリに関連するエラーは、`BoltError` 型です。Slack API の呼び出しに関連するエラーは、`SlackApiError` 型となります。 diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/event-listening.md b/docs/japanese/concepts/event-listening.md similarity index 50% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/event-listening.md rename to docs/japanese/concepts/event-listening.md index 2790ad5b7..c13638226 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/event-listening.md +++ b/docs/japanese/concepts/event-listening.md @@ -1,14 +1,10 @@ ---- -title: イベントのリスニング -lang: ja-jp -slug: /concepts/event-listening ---- +# イベントのリスニング -`event()` メソッドを使うと、[Events API](https://docs.slack.dev/reference/events) の任意のイベントをリッスンできます。リッスンするイベントは、アプリの設定であらかじめサブスクライブしておく必要があります。これを利用することで、アプリがインストールされたワークスペースで何らかのイベント(例:ユーザーがメッセージにリアクションをつけた、ユーザーがチャンネルに参加した)が発生したときに、アプリに何らかのアクションを実行させることができます。 +`event()` メソッドを使うと、[Events API](/reference/events) の任意のイベントをリッスンできます。リッスンするイベントは、アプリの設定であらかじめサブスクライブしておく必要があります。これを利用することで、アプリがインストールされたワークスペースで何らかのイベント(例:ユーザーがメッセージにリアクションをつけた、ユーザーがチャンネルに参加した)が発生したときに、アプリに何らかのアクションを実行させることができます。 `event()` メソッドには `str` 型の `eventType` を指定する必要があります。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # ユーザーがワークスペースに参加した際に、自己紹介を促すメッセージを指定のチャンネルに送信 @app.event("team_join") @@ -23,7 +19,7 @@ def ask_for_introduction(event, say): `message()` リスナーは `event("message")` と等価の機能を提供します。 -`subtype` という追加のキーを指定して、イベントのサブタイプでフィルタリングすることもできます。よく使われるサブタイプには、`bot_message` や `message_replied` があります。詳しくは[メッセージイベントページ](https://docs.slack.dev/reference/events/message#subtypes)を参照してください。サブタイプなしのイベントだけにフィルターするために明に `None` を指定することもできます。 +`subtype` という追加のキーを指定して、イベントのサブタイプでフィルタリングすることもできます。よく使われるサブタイプには、`bot_message` や `message_replied` があります。詳しくは[メッセージイベントページ](/reference/events/message#subtypes)を参照してください。サブタイプなしのイベントだけにフィルターするために明に `None` を指定することもできます。 ```python # 変更されたすべてのメッセージに一致 diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/global-middleware.md b/docs/japanese/concepts/global-middleware.md similarity index 81% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/global-middleware.md rename to docs/japanese/concepts/global-middleware.md index caace0621..884008090 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/global-middleware.md +++ b/docs/japanese/concepts/global-middleware.md @@ -1,15 +1,10 @@ ---- -title: グローバルミドルウェア -lang: ja-jp -slug: /concepts/global-middleware -order: 8 ---- +# グローバルミドルウェア グローバルミドルウェアは、すべての受信リクエストに対して、リスナーミドルウェアが呼ばれる前に実行されるものです。ミドルウェア関数を `app.use()` に渡すことで、アプリにはグローバルミドルウェアをいくつでも追加できます。ミドルウェア関数で受け取れる引数はリスナー関数と同じものに加えて`next()` 関数があります。 グローバルミドルウェアでもリスナーミドルウェアでも、次のミドルウェアに実行チェーンの制御をリレーするために、`next()` を呼び出す必要があります。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python @app.use diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/lazy-listeners.md b/docs/japanese/concepts/lazy-listeners.md similarity index 98% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/lazy-listeners.md rename to docs/japanese/concepts/lazy-listeners.md index 25eb6294c..029f61d99 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/lazy-listeners.md +++ b/docs/japanese/concepts/lazy-listeners.md @@ -1,8 +1,4 @@ ---- -title: Lazy リスナー(FaaS) -lang: ja-jp -slug: /concepts/lazy-listeners ---- +# Lazy リスナー(FaaS Lazy リスナー関数は、FaaS 環境への Slack アプリのデプロイを容易にする機能です。この機能は Bolt for Python でのみ利用可能で、他の Bolt フレームワークでこの機能に対応することは予定していません。 diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/listener-middleware.md b/docs/japanese/concepts/listener-middleware.md similarity index 83% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/listener-middleware.md rename to docs/japanese/concepts/listener-middleware.md index a013dde42..2b3ea9323 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/listener-middleware.md +++ b/docs/japanese/concepts/listener-middleware.md @@ -1,14 +1,10 @@ ---- -title: リスナーミドルウェア -lang: ja-jp -slug: /concepts/listener-middleware ---- +# リスナーミドルウェア リスナーミドルウェアは、それを渡したリスナーでのみ実行されるミドルウェアです。リスナーには、`middleware` パラメーターを使ってミドルウェア関数をいくつでも渡すことができます。このパラメーターには、1 つまたは複数のミドルウェア関数からなるリストを指定します。 非常にシンプルなリスナーミドルウェアの場合であれば、`next()` メソッドを呼び出す代わりに `bool` 値(処理を継続したい場合は `True`)を返すだけで済む「リスナーマッチャー」を使うとよいでしょう。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # ボットからのメッセージをフィルタリングするリスナーミドルウェア diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/logging.md b/docs/japanese/concepts/logging.md similarity index 95% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/logging.md rename to docs/japanese/concepts/logging.md index 22223fb08..3afa46539 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/logging.md +++ b/docs/japanese/concepts/logging.md @@ -1,8 +1,4 @@ ---- -title: ロギング -lang: ja-jp -slug: /concepts/logging ---- +# ロギング デフォルトでは、アプリからのログ情報は、既定の出力先に出力されます。`logging` モジュールをインポートすれば、`basicConfig()` の `level` パラメーターでrootのログレベルを変更することができます。指定できるログレベルは、重要度の低い方から `debug`、`info`、`warning`、`error`、および `critical` です。 diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/message-listening.md b/docs/japanese/concepts/message-listening.md similarity index 55% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/message-listening.md rename to docs/japanese/concepts/message-listening.md index e7d538e69..824ac67c8 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/message-listening.md +++ b/docs/japanese/concepts/message-listening.md @@ -1,14 +1,10 @@ ---- -title: メッセージのリスニング -lang: ja-jp -slug: /concepts/message-listening ---- +# メッセージのリスニング -[あなたのアプリがアクセス権限を持つ](https://docs.slack.dev/messaging/retrieving-messages)メッセージの投稿イベントをリッスンするには `message()` メソッドを利用します。このメソッドは `type` が `message` ではないイベントを処理対象から除外します。 +[あなたのアプリがアクセス権限を持つ](/messaging/retrieving-messages)メッセージの投稿イベントをリッスンするには `message()` メソッドを利用します。このメソッドは `type` が `message` ではないイベントを処理対象から除外します。 `message()` の引数には `str` 型または `re.Pattern` オブジェクトを指定できます。この条件のパターンに一致しないメッセージは除外されます。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # '👋' が含まれるすべてのメッセージに一致 @app.message(":wave:") diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/message-sending.md b/docs/japanese/concepts/message-sending.md similarity index 74% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/message-sending.md rename to docs/japanese/concepts/message-sending.md index fbcf0ac6b..a299144b6 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/message-sending.md +++ b/docs/japanese/concepts/message-sending.md @@ -1,14 +1,10 @@ ---- -title: メッセージの送信 -lang: ja-jp -slug: /concepts/message-sending ---- +# メッセージの送信 リスナー関数内では、関連づけられた会話(例:リスナー実行のトリガーとなったイベントまたはアクションの発生元の会話)がある場合はいつでも `say()` を使用できます。`say()` には文字列または JSON ペイロードを指定できます。文字列の場合、送信できるのはテキストベースの単純なメッセージです。より複雑なメッセージを送信するには JSON ペイロードを指定します。指定したメッセージのペイロードは、関連づけられた会話内のメッセージとして送信されます。 -リスナー関数の外でメッセージを送信したい場合や、より高度な処理(特定のエラーの処理など)を実行したい場合は、[Bolt インスタンスにアタッチされたクライアント](/concepts/web-api)の `client.chat_postMessage` を呼び出します。 +リスナー関数の外でメッセージを送信したい場合や、より高度な処理(特定のエラーの処理など)を実行したい場合は、[Bolt インスタンスにアタッチされたクライアント](/tools/bolt-python/concepts/web-api)の `client.chat_postMessage` を呼び出します。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # 'knock knock' が含まれるメッセージをリッスンし、イタリック体で 'Who's there?' と返信 @app.message("knock knock") @@ -20,7 +16,7 @@ def ask_who(message, say): `say()` は、より複雑なメッセージペイロードを受け付けるので、メッセージに機能やリッチな構造を与えることが容易です。 -リッチなメッセージレイアウトをアプリに追加する方法については、[API サイトのガイド](https://docs.slack.dev/messaging/#structure)を参照してください。また、[Block Kit ビルダー](https://api.slack.com/tools/block-kit-builder?template=1)の一般的なアプリフローのテンプレートも見てみてください。 +リッチなメッセージレイアウトをアプリに追加する方法については、[API サイトのガイド](/messaging/#structure)を参照してください。また、[Block Kit ビルダー](https://api.slack.com/tools/block-kit-builder?template=1)の一般的なアプリフローのテンプレートも見てみてください。 ```python # ユーザーが 📅 のリアクションをつけたら、日付ピッカーのついた section ブロックを送信 diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/opening-modals.md b/docs/japanese/concepts/opening-modals.md similarity index 62% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/opening-modals.md rename to docs/japanese/concepts/opening-modals.md index a954a658b..68e3b947c 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/opening-modals.md +++ b/docs/japanese/concepts/opening-modals.md @@ -1,16 +1,12 @@ ---- -title: モーダルの開始 -lang: ja-jp -slug: /concepts/opening-modals ---- +# モーダルの開始 -モーダルは、ユーザーからのデータの入力を受け付けたり、動的な情報を表示したりするためのインターフェイスです。組み込みの APIクライアントの `views.open` メソッドに、有効な `trigger_id` とビューのペイロードを指定してモーダルを開始します。 +モーダルは、ユーザーからのデータの入力を受け付けたり、動的な情報を表示したりするためのインターフェイスです。組み込みの APIクライアントの `views.open` メソッドに、有効な `trigger_id` とビューのペイロードを指定してモーダルを開始します。 ショートカットの実行、ボタンを押下、選択メニューの操作などの操作の場合、Request URL に送信されるペイロードには `trigger_id` が含まれます。 -モーダルの生成方法についての詳細は、API ドキュメントを参照してください。 +モーダルの生成方法についての詳細は、API ドキュメントを参照してください。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # ショートカットの呼び出しをリッスン diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/select-menu-options.md b/docs/japanese/concepts/select-menu-options.md similarity index 68% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/select-menu-options.md rename to docs/japanese/concepts/select-menu-options.md index 598fb1cc6..1c2d41c58 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/select-menu-options.md +++ b/docs/japanese/concepts/select-menu-options.md @@ -1,20 +1,16 @@ ---- -title: オプションのリスニングと応答 -lang: ja-jp -slug: /concepts/options ---- +# オプションのリスニングと応答 -`options()` メソッドは、Slack からのオプション(セレクトメニュー内の動的な選択肢)をリクエストするペイロードをリッスンします。 [`action()` と同様に](/concepts/action-listening)、文字列型の `action_id` または制約付きオブジェクトが必要です。 +`options()` メソッドは、Slack からのオプション(セレクトメニュー内の動的な選択肢)をリクエストするペイロードをリッスンします。 [`action()` と同様に](/tools/bolt-python/concepts/actions)、文字列型の `action_id` または制約付きオブジェクトが必要です。 外部データソースを使って選択メニューをロードするためには、末部に `/slack/events` が付加された URL を Options Load URL として予め設定しておく必要があります。 `external_select` メニューでは `action_id` を指定することをおすすめしています。ただし、ダイアログを利用している場合、ダイアログが Block Kit に対応していないため、`callback_id` をフィルタリングするための制約オブジェクトを使用する必要があります。 -オプションのリクエストに応答するときは、有効なオプションを含む `options` または `option_groups` のリストとともに `ack()` を呼び出す必要があります。API サイトにある[外部データを使用する選択メニューに応答するサンプル例](https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select)と、[ダイアログでの応答例](https://docs.slack.dev/legacy/legacy-dialogs/#dynamic_select_elements_external)を参考にしてください。 +オプションのリクエストに応答するときは、有効なオプションを含む `options` または `option_groups` のリストとともに `ack()` を呼び出す必要があります。API サイトにある[外部データを使用する選択メニューに応答するサンプル例](/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select)と、[ダイアログでの応答例](/legacy/legacy-dialogs/#dynamic_select_elements_external)を参考にしてください。 -さらに、ユーザーが入力したキーワードに基づいたオプションを返すようフィルタリングロジックを適用することもできます。 これは `payload` という引数の ` value` の値に基づいて、それぞれのパターンで異なるオプションの一覧を返すように実装することができます。 Bolt for Python のすべてのリスナーやミドルウェアでは、[多くの有用な引数](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html)にアクセスすることができますので、チェックしてみてください。 +さらに、ユーザーが入力したキーワードに基づいたオプションを返すようフィルタリングロジックを適用することもできます。 これは `payload` という引数の ` value` の値に基づいて、それぞれのパターンで異なるオプションの一覧を返すように実装することができます。 Bolt for Python のすべてのリスナーやミドルウェアでは、[多くの有用な引数](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html)にアクセスすることができますので、チェックしてみてください。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # 外部データを使用する選択メニューオプションに応答するサンプル例 @app.options("external_action") diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/shortcuts.md b/docs/japanese/concepts/shortcuts.md similarity index 77% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/shortcuts.md rename to docs/japanese/concepts/shortcuts.md index 995b6e0d7..d9a8ba050 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/shortcuts.md +++ b/docs/japanese/concepts/shortcuts.md @@ -1,22 +1,18 @@ ---- -title: ショートカットのリスニングと応答 -lang: ja-jp -slug: /concepts/shortcuts ---- +# ショートカットのリスニングと応答 -`shortcut()` メソッドは、[グローバルショートカット](https://docs.slack.dev/interactivity/implementing-shortcuts#global)と[メッセージショートカット](https://docs.slack.dev/interactivity/implementing-shortcuts#messages)の 2 つをサポートしています。 +`shortcut()` メソッドは、[グローバルショートカット](/interactivity/implementing-shortcuts#global)と[メッセージショートカット](/interactivity/implementing-shortcuts#messages)の 2 つをサポートしています。 ショートカットは、いつでも呼び出せるアプリのエントリーポイントを提供するものです。グローバルショートカットは Slack のテキスト入力エリアや検索ウィンドウからアクセスできます。メッセージショートカットはメッセージのコンテキストメニューからアクセスできます。アプリは、ショートカットリクエストをリッスンするために `shortcut()` メソッドを使用します。このメソッドには `str` 型または `re.Pattern` 型の `callback_id` パラメーターを指定します。 ショートカットリクエストがアプリによって確認されたことを Slack に伝えるため、`ack()` を呼び出す必要があります。 -ショートカットのペイロードには `trigger_id` が含まれます。アプリはこれを使って、ユーザーにやろうとしていることを確認するための[モーダルを開く](/concepts/opening-modals)ことができます。 +ショートカットのペイロードには `trigger_id` が含まれます。アプリはこれを使って、ユーザーにやろうとしていることを確認するための[モーダルを開く](/tools/bolt-python/concepts/opening-modals)ことができます。 アプリの設定でショートカットを登録する際は、他の URL と同じように、リクエスト URL の末尾に `/slack/events` をつけます。 -⚠️ グローバルショートカットのペイロードにはチャンネル ID が **含まれません**。アプリでチャンネル ID を取得する必要がある場合は、モーダル内に [`conversations_select`](https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#conversation_multi_select) エレメントを配置します。メッセージショートカットにはチャンネル ID が含まれます。 +⚠️ グローバルショートカットのペイロードにはチャンネル ID が **含まれません**。アプリでチャンネル ID を取得する必要がある場合は、モーダル内に [`conversations_select`](/reference/block-kit/block-elements/multi-select-menu-element#conversation_multi_select) エレメントを配置します。メッセージショートカットにはチャンネル ID が含まれます。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # 'open_modal' という callback_id のショートカットをリッスン @app.shortcut("open_modal") @@ -36,7 +32,7 @@ def open_modal(ack, shortcut, client): "type": "section", "text": { "type": "mrkdwn", - "text":"About the simplest modal you could conceive of :smile:\n\nMaybe or ." + "text":"About the simplest modal you could conceive of :smile:\n\nMaybe or ." } }, { @@ -76,7 +72,7 @@ def open_modal(ack, shortcut, client): "type": "section", "text": { "type": "mrkdwn", - "text":"About the simplest modal you could conceive of :smile:\n\nMaybe or ." + "text":"About the simplest modal you could conceive of :smile:\n\nMaybe or ." } }, { diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/socket-mode.md b/docs/japanese/concepts/socket-mode.md similarity index 86% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/socket-mode.md rename to docs/japanese/concepts/socket-mode.md index 061daf853..92922d2de 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/socket-mode.md +++ b/docs/japanese/concepts/socket-mode.md @@ -1,10 +1,6 @@ ---- -title: ソケットモードの利用 -lang: ja-jp -slug: /concepts/socket-mode ---- +# ソケットモードの利用 -[ソケットモード](https://docs.slack.dev/apis/events-api/using-socket-mode)は、アプリに WebSocket での接続と、そのコネクション経由でのデータ受信を可能とします。Bolt for Python は、バージョン 1.2.0 からこれに対応しています。 +[ソケットモード](/apis/events-api/using-socket-mode)は、アプリに WebSocket での接続と、そのコネクション経由でのデータ受信を可能とします。Bolt for Python は、バージョン 1.2.0 からこれに対応しています。 ソケットモードでは、Slack からのペイロード送信を受け付けるエンドポイントをホストする HTTP サーバーを起動する代わりに WebSocket で Slack に接続し、そのコネクション経由でデータを受信します。ソケットモードを使う前に、アプリの管理画面でソケットモードの機能が有効になっていることを確認しておいてください。 @@ -40,7 +36,7 @@ if __name__ == "__main__": aiohttp のような asyncio をベースとしたアダプターを使う場合、アプリケーション全体が asyncio の async/await プログラミングモデルで実装されている必要があります。`AsyncApp` を動作させるためには `AsyncSocketModeHandler` とその async なミドルウェアやリスナーを利用します。 -`AsyncApp` の使い方についての詳細は、[Async (asyncio) の利用](/concepts/async)や、関連する[サンプルコード例](https://github.com/slackapi/bolt-python/tree/main/examples)を参考にしてください。 +`AsyncApp` の使い方についての詳細は、[Async (asyncio) の利用](/tools/bolt-python/concepts/async)や、関連する[サンプルコード例](https://github.com/slackapi/bolt-python/tree/main/examples)を参考にしてください。 ```python from slack_bolt.app.async_app import AsyncApp diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/token-rotation.md b/docs/japanese/concepts/token-rotation.md similarity index 67% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/token-rotation.md rename to docs/japanese/concepts/token-rotation.md index bc622fe98..25a0c735b 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/token-rotation.md +++ b/docs/japanese/concepts/token-rotation.md @@ -1,13 +1,9 @@ ---- -title: トークンのローテーション -lang: ja-jp -slug: /concepts/token-rotation ---- +# トークンのローテーション Bolt for Python [v1.7.0](https://github.com/slackapi/bolt-python/releases/tag/v1.7.0) から、アクセストークンのさらなるセキュリティ強化のレイヤーであるトークンローテーションの機能に対応しています。トークンローテーションは [OAuth V2 の RFC](https://datatracker.ietf.org/doc/html/rfc6749#section-10.4) で規定されているものです。 既存の Slack アプリではアクセストークンが無期限に存在し続けるのに対して、トークンローテーションを有効にしたアプリではアクセストークンが失効するようになります。リフレッシュトークンを利用して、アクセストークンを長期間にわたって更新し続けることができます。 -[Bolt for Python の組み込みの OAuth 機能](/concepts/authenticating-oauth) を使用していれば、Bolt for Python が自動的にトークンローテーションの処理をハンドリングします。 +[Bolt for Python の組み込みの OAuth 機能](/tools/bolt-python/concepts/authenticating-oauth) を使用していれば、Bolt for Python が自動的にトークンローテーションの処理をハンドリングします。 -トークンローテーションに関する詳細は [API ドキュメント](https://docs.slack.dev/authentication/using-token-rotation)を参照してください。 \ No newline at end of file +トークンローテーションに関する詳細は [API ドキュメント](/authentication/using-token-rotation)を参照してください。 \ No newline at end of file diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/updating-pushing-views.md b/docs/japanese/concepts/updating-pushing-views.md similarity index 60% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/updating-pushing-views.md rename to docs/japanese/concepts/updating-pushing-views.md index 42c89157e..cc32f5b69 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/updating-pushing-views.md +++ b/docs/japanese/concepts/updating-pushing-views.md @@ -1,10 +1,6 @@ ---- -title: モーダルの更新と多重表示 -lang: ja-jp -slug: /concepts/updating-pushing-views ---- +# モーダルの更新と多重表示 -モーダル内では、複数のモーダルをスタックのように重ねることができます。`views_open` という APIを呼び出すと、親となるとなるモーダルビューが追加されます。この最初の呼び出しの後、`views_update` を呼び出すことでそのビューを更新することができます。また、`views_push` を呼び出すと、親のモーダルの上にさらに新しいモーダルビューを重ねることもできます。 +モーダル内では、複数のモーダルをスタックのように重ねることができます。`views_open` という APIを呼び出すと、親となるとなるモーダルビューが追加されます。この最初の呼び出しの後、`views_update` を呼び出すことでそのビューを更新することができます。また、`views_push` を呼び出すと、親のモーダルの上にさらに新しいモーダルビューを重ねることもできます。 **`views_update`** @@ -12,11 +8,11 @@ slug: /concepts/updating-pushing-views **`views_push`** -既存のモーダルの上に新しいモーダルをスタックのように追加する場合は、組み込みのクライアントで `views_push` API を呼び出します。この API 呼び出しでは、有効な `trigger_id` と新しいビューのペイロードを指定します。`views_push` の引数は モーダルの開始 と同じです。モーダルを開いた後、このモーダルのスタックに追加できるモーダルビューは 2 つまでです。 +既存のモーダルの上に新しいモーダルをスタックのように追加する場合は、組み込みのクライアントで `views_push` API を呼び出します。この API 呼び出しでは、有効な `trigger_id` と新しいビューのペイロードを指定します。`views_push` の引数は モーダルの開始 と同じです。モーダルを開いた後、このモーダルのスタックに追加できるモーダルビューは 2 つまでです。 -モーダルの更新と多重表示に関する詳細は、API ドキュメントを参照してください。 +モーダルの更新と多重表示に関する詳細は、API ドキュメントを参照してください。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # モーダルに含まれる、`button_abc` という action_id のボタンの呼び出しをリッスン diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/view-submissions.md b/docs/japanese/concepts/view-submissions.md similarity index 72% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/view-submissions.md rename to docs/japanese/concepts/view-submissions.md index 7ad6637bb..5ae78f173 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/concepts/view-submissions.md +++ b/docs/japanese/concepts/view-submissions.md @@ -1,10 +1,6 @@ ---- -title: モーダルの送信のリスニング -lang: ja-jp -slug: /concepts/view_submissions ---- +# モーダルの送信のリスニング -モーダルのペイロードに `input` ブロックを含める場合、その入力値を受け取るために`view_submission` リクエストをリッスンする必要があります。`view_submission` リクエストのリッスンには、組み込みの`view()` メソッドを利用することができます。`view()` の引数には、`str` 型または `re.Pattern` 型の `callback_id` を指定します。 +モーダルのペイロードに `input` ブロックを含める場合、その入力値を受け取るために`view_submission` リクエストをリッスンする必要があります。`view_submission` リクエストのリッスンには、組み込みの`view()` メソッドを利用することができます。`view()` の引数には、`str` 型または `re.Pattern` 型の `callback_id` を指定します。 `input` ブロックの値にアクセスするには `state` オブジェクトを参照します。`state` 内には `values` というオブジェクトがあり、`block_id` と一意の `action_id` に紐づける形で入力値を保持しています。 @@ -23,9 +19,9 @@ def handle_submission(ack, body): # https://app.slack.com/block-kit-builder/#%7B%22type%22:%22modal%22,%22callback_id%22:%22view_1%22,%22title%22:%7B%22type%22:%22plain_text%22,%22text%22:%22My%20App%22,%22emoji%22:true%7D,%22blocks%22:%5B%5D%7D ack(response_action="update", view=build_new_view(body)) ``` -この例と同様に、モーダルでの送信リクエストに対して、エラーを表示するためのオプションもあります。 +この例と同様に、モーダルでの送信リクエストに対して、エラーを表示するためのオプションもあります。 -モーダルの送信について詳しくは、API ドキュメントを参照してください。 +モーダルの送信について詳しくは、API ドキュメントを参照してください。 --- @@ -33,7 +29,7 @@ def handle_submission(ack, body): `view_closed` リクエストをリッスンするためには `callback_id` を指定して、かつ `notify_on_close` 属性をモーダルのビューに設定する必要があります。以下のコード例をご覧ください。 -よく詳しい情報は、API ドキュメントを参照してください。 +よく詳しい情報は、API ドキュメントを参照してください。 ```python client.views_open( @@ -60,7 +56,7 @@ def handle_view_closed(ack, body, logger): logger.info(body) ``` -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 ```python # view_submission リクエストを処理 diff --git a/docs/japanese/concepts/web-api.md b/docs/japanese/concepts/web-api.md new file mode 100644 index 000000000..7a674b9b2 --- /dev/null +++ b/docs/japanese/concepts/web-api.md @@ -0,0 +1,19 @@ +# Web API の使い方 + +`app.client`、またはミドルウェア・リスナーの引数 `client` として Bolt アプリに提供されている `WebClient` は必要な権限を付与されており、これを利用することで[あらゆる Web API メソッド](/reference/methods)を呼び出すことができます。このクライアントのメソッドを呼び出すと `SlackResponse` という Slack からの応答情報を含むオブジェクトが返されます。 + +Bolt の初期化に使用するトークンは `context` オブジェクトに設定されます。このトークンは、多くの Web API メソッドを呼び出す際に必要となります。 + +指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +```python +@app.message("wake me up") +def say_hello(client, message): + # 2020 年 9 月 30 日午後 11:59:59 を示す Unix エポック秒 + when_september_ends = 1601510399 + channel_id = message["channel"] + client.chat_scheduleMessage( + channel=channel_id, + post_at=when_september_ends, + text="Summer has come and passed" + ) +``` \ No newline at end of file diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/getting-started.md b/docs/japanese/getting-started.md similarity index 80% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/getting-started.md rename to docs/japanese/getting-started.md index b29deaef8..2ec34d193 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/getting-started.md +++ b/docs/japanese/getting-started.md @@ -1,9 +1,3 @@ ---- -title: Bolt 入門ガイド -slug: getting-started -lang: ja-jp ---- - # Bolt 入門ガイド このガイドでは、Bolt for Python を使った Slack アプリの設定と起動の方法について説明します。ここで説明する手順では、まず新しい Slack アプリを作成し、ローカルの開発環境をセットアップし、Slack ワークスペースからのメッセージをリッスンして応答するアプリを開発するという流れになります。 @@ -16,9 +10,7 @@ lang: ja-jp ### アプリを作成する {#create-an-app} 最初にやるべきこと : Bolt での開発を始める前に、[Slack アプリを作成](https://api.slack.com/apps/new)します。 -:::tip - -通常の業務の妨げにならないよう、別の開発用のワークスペースを使用することをおすすめします。[新しいワークスペースは無料で作成できます](https://slack.com/get-started#create) +:::tip[通常の業務の妨げにならないよう、別の開発用のワークスペースを使用することをおすすめします。[新しいワークスペースは無料で作成できます](https://slack.com/get-started#create)] ::: @@ -26,39 +18,37 @@ lang: ja-jp このページでは、アプリの概要や重要な認証情報を確認できます。これらの情報は後ほど参照します。 -![Basic Information ページ](/img/boltpy/basic-information-page.png "Basic Information ページ") +![Basic Information ページ](/img/bolt-python/basic-information-page.png "Basic Information ページ") ひと通り確認して、アプリのアイコンと説明を追加したら、アプリのプロジェクトの構成 🔩 を始めましょう。 --- ### トークンとアプリのインストール {#tokens-and-installing-apps} -Slack アプリでは、[Slack API へのアクセスの管理に OAuth を使用します](https://docs.slack.dev/authentication/installing-with-oauth)。アプリがインストールされると、トークンが発行されます。アプリはそのトークンを使って API メソッドを呼び出すことができます。 +Slack アプリでは、[Slack API へのアクセスの管理に OAuth を使用します](/authentication/installing-with-oauth)。アプリがインストールされると、トークンが発行されます。アプリはそのトークンを使って API メソッドを呼び出すことができます。 Slack アプリで使用できるトークンには、ユーザートークン(`xoxp`)とボットトークン(`xoxb`)、アプリレベルトークン(`xapp`)の 3 種類があります。 -- [ユーザートークン](https://docs.slack.dev/authentication/tokens#user) を使用すると、アプリをインストールまたは認証したユーザーに成り代わって API メソッドを呼び出すことができます。1 つのワークスペースに複数のユーザートークンが存在する可能性があります。 -- [ボットトークン](https://docs.slack.dev/authentication/tokens#bot) はボットユーザーに関連づけられ、1 つのワークスペースでは最初に誰かがそのアプリをインストールした際に一度だけ発行されます。どのユーザーがインストールを実行しても、アプリが使用するボットトークンは同じになります。_ほとんど_のアプリで使用されるのは、ボットトークンです。 -- [アプリレベルトークン](https://docs.slack.dev/authentication/tokens#app-level) は、全ての組織(とその配下のワークスペースでの個々のユーザーによるインストール)を横断して、あなたのアプリを代理するものです。アプリレベルトークンは、アプリの WebSocket コネクションを確立するためによく使われます。 +- [ユーザートークン](/authentication/tokens#user) を使用すると、アプリをインストールまたは認証したユーザーに成り代わって API メソッドを呼び出すことができます。1 つのワークスペースに複数のユーザートークンが存在する可能性があります。 +- [ボットトークン](/authentication/tokens#bot) はボットユーザーに関連づけられ、1 つのワークスペースでは最初に誰かがそのアプリをインストールした際に一度だけ発行されます。どのユーザーがインストールを実行しても、アプリが使用するボットトークンは同じになります。_ほとんど_のアプリで使用されるのは、ボットトークンです。 +- [アプリレベルトークン](/authentication/tokens#app-level) は、全ての組織(とその配下のワークスペースでの個々のユーザーによるインストール)を横断して、あなたのアプリを代理するものです。アプリレベルトークンは、アプリの WebSocket コネクションを確立するためによく使われます。 このガイドではボットトークンとアプリレベルトークンを使用します。 1. 左サイドバーの「**OAuth & Permissions**」をクリックし、「**Bot Token Scopes**」セクションまで下にスクロールします。「**Add an OAuth Scope**」をクリックします。 -2. ここでは [`chat:write`](https://docs.slack.dev/reference/scopes/chat.write) というスコープのみを追加します。このスコープはアプリが参加しているチャンネルにメッセージを投稿することを許可します。 +2. ここでは [`chat:write`](/reference/scopes/chat.write) というスコープのみを追加します。このスコープはアプリが参加しているチャンネルにメッセージを投稿することを許可します。 3. OAuth & Permissions ページの一番上までスクロールし、「**Install App to Workspace**」をクリックします。Slack の OAuth 確認画面 が表示されます。この画面で開発用ワークスペースへのアプリのインストールを承認します。 4. インストールを承認すると **OAuth & Permissions** ページが表示され、**Bot User OAuth Access Token** を確認できるでしょう。 -![OAuth トークン](/img/boltpy/bot-token.png "ボット用 OAuth トークン") +![OAuth トークン](/img/bolt-python/bot-token.png "ボット用 OAuth トークン") 5. 次に「**Basic Informationのページ**」まで戻り、アプリレベルトークンのセクションまで下にスクロールし「**Generate Token and Scopes**」をクリックしてアプリレベルトークンを作成します。このトークンに `connections:write` のスコープを付与し、作成された `xapp` トークンを保存します。これらのトークンは後ほど利用します。 6. 左サイドメニューの「**Socket Mode**」を有効にします。 -:::tip - -トークンはパスワードと同様に取り扱い、[安全な方法で保管してください](https://docs.slack.dev/authentication/best-practices-for-security)。アプリはこのトークンを使って Slack ワークスペースで投稿をしたり、情報の取得をしたりします。 +:::tip[トークンはパスワードと同様に取り扱い、[安全な方法で保管してください](/authentication/best-practices-for-security)。アプリはこのトークンを使って Slack ワークスペースで投稿をしたり、情報の取得をしたりします。] ::: @@ -99,9 +89,9 @@ export SLACK_BOT_TOKEN=xoxb-<ボットトークン> ```shell export SLACK_APP_TOKEN=<アプリレベルトークン> ``` -:::warning +:::warning[🔒 全てのトークンは安全に保管してください。] -🔒 全てのトークンは安全に保管してください。少なくともパブリックなバージョン管理にチェックインするようなことは避けるべきでしょう。また、上にあった例のように環境変数を介してアクセスするようにしてください。詳細な情報は [アプリのセキュリティのベストプラクティス](https://docs.slack.dev/authentication/best-practices-for-security)のドキュメントを参照してください。 +少なくともパブリックなバージョン管理にチェックインするようなことは避けるべきでしょう。また、上にあった例のように環境変数を介してアクセスするようにしてください。詳細な情報は [アプリのセキュリティのベストプラクティス](/authentication/best-practices-for-security)のドキュメントを参照してください。 ::: @@ -139,7 +129,7 @@ python3 app.py ### イベントを設定する {#setting-up-events} アプリはワークスペース内の他のメンバーと同じように振る舞い、メッセージを投稿したり、絵文字リアクションを追加したり、イベントをリッスンして返答したりできます。 -Slack ワークスペースで発生するイベント(メッセージが投稿されたときや、メッセージに対するリアクションがつけられたときなど)をリッスンするには、[Events API を使って特定の種類のイベントをサブスクライブします](https://docs.slack.dev/apis/events-api/)。 +Slack ワークスペースで発生するイベント(メッセージが投稿されたときや、メッセージに対するリアクションがつけられたときなど)をリッスンするには、[Events API を使って特定の種類のイベントをサブスクライブします](/apis/events-api/)。 このチュートリアルの序盤でソケットモードを有効にしました。ソケットモードを使うことで、アプリが公開された HTTP エンドポイントを公開せずに Events API やインタラクティブコンポーネントを利用できるようになります。このことは、開発時やファイヤーウォールの裏からのリクエストを受ける際に便利です。HTTP での方式は、ホスティング環境にデプロイするアプリや Slack App Directory で配布されるアプリの開発・運用に適しています。 @@ -164,11 +154,11 @@ import TabItem from '@theme/TabItem'; 1. アプリ構成ページに戻ります ([アプリ管理ページから](https://api.slack.com/apps) アプリをクリックします)。左側のサイドバーで [**イベント サブスクリプション**] をクリックします。 **イベントを有効にする**というラベルの付いたスイッチを切り替えます。 -2. リクエスト URL を追加します。 Slack は、イベントに対応する HTTP POST リクエストをこの [リクエスト URL](https://docs.slack.dev/apis/events-api/#subscribing) に送信します。 Bolt は、`/slack/events` パスを使用して、すべての受信リクエスト (ショートカット、イベント、対話性ペイロードなど) をリッスンします。アプリ構成内でリクエスト URL を構成する場合は、`/slack/events` を追加します。 「https://あなたのドメイン/slack/events」。 💡 Bolt アプリが実行されている限り、URL は検証されるはずです。 +2. リクエスト URL を追加します。 Slack は、イベントに対応する HTTP POST リクエストをこの [リクエスト URL](/apis/events-api/#subscribing) に送信します。 Bolt は、`/slack/events` パスを使用して、すべての受信リクエスト (ショートカット、イベント、対話性ペイロードなど) をリッスンします。アプリ構成内でリクエスト URL を構成する場合は、`/slack/events` を追加します。 「https://あなたのドメイン/slack/events」。 💡 Bolt アプリが実行されている限り、URL は検証されるはずです。 -:::tip +:::tip -ローカル開発の場合、ngrok などのプロキシ サービスを使用してパブリック URL を作成し、リクエストを開発環境にトンネリングできます。このトンネルの作成方法については、[ngrok のスタート ガイド](https://ngrok.com/docs#getting-started-expose) を参照してください。アプリをホスティングする際には、Slack 開発者がアプリをホストするために使用する最も一般的なホスティング プロバイダーを [API サイト](https://docs.slack.dev/distribution/hosting-slack-apps/) に集めました。 +ローカル開発の場合、ngrok などのプロキシ サービスを使用してパブリック URL を作成し、リクエストを開発環境にトンネリングできます。このトンネルの作成方法については、[ngrok のスタート ガイド](https://ngrok.com/docs#getting-started-expose) を参照してください。アプリをホスティングする際には、Slack 開発者がアプリをホストするために使用する最も一般的なホスティング プロバイダーを [API サイト](/app-management/hosting-slack-apps) に集めました。 ::: @@ -176,10 +166,10 @@ import TabItem from '@theme/TabItem'; 左側のサイドバーから **Event Subscriptions** にアクセスして、機能を有効にしてください。 **Subscribe to Bot Events** 配下で、ボットが受け取れるイベントを追加することができます。4つのメッセージに関するイベントがあります。 -- [`message.channels`](https://docs.slack.dev/reference/events/message.channels) アプリが参加しているパブリックチャンネルのメッセージをリッスン -- [`message.groups`](https://docs.slack.dev/reference/events/message.groups) アプリが参加しているプライベートチャンネルのメッセージをリッスン -- [`message.im`](https://docs.slack.dev/reference/events/message.im) あなたのアプリとユーザーのダイレクトメッセージをリッスン -- [`message.mpim`](https://docs.slack.dev/reference/events/message.mpim) あなたのアプリが追加されているグループ DM をリッスン +- [`message.channels`](/reference/events/message.channels) アプリが参加しているパブリックチャンネルのメッセージをリッスン +- [`message.groups`](/reference/events/message.groups) アプリが参加しているプライベートチャンネルのメッセージをリッスン +- [`message.im`](/reference/events/message.im) あなたのアプリとユーザーのダイレクトメッセージをリッスン +- [`message.mpim`](/reference/events/message.mpim) あなたのアプリが追加されているグループ DM をリッスン ボットが参加するすべての場所のメッセージをリッスンさせるには、これら 4 つのメッセージイベントをすべて選択します。ボットにリッスンさせるメッセージイベントの種類を選択したら、「**Save Changes**」ボタンをクリックします。 @@ -203,7 +193,7 @@ app = App(token=os.environ.get("SLACK_BOT_TOKEN")) # 'こんにちは' を含むメッセージをリッスンします # 指定可能なリスナーのメソッド引数の一覧は以下のモジュールドキュメントを参考にしてください: -# https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html +# https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html @app.message("こんにちは") def message_hello(message, say): # イベントがトリガーされたチャンネルへ say() でメッセージを送信します @@ -229,7 +219,7 @@ app = App( # 'hello' を含むメッセージをリッスンします # 指定可能なリスナーのメソッド引数の一覧は以下のモジュールドキュメントを参考にしてください: -# https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html +# https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html @app.message("hello") def message_hello(message, say): # イベントがトリガーされたチャンネルへ say() でメッセージを送信します @@ -359,9 +349,9 @@ if __name__ == "__main__": ボタンを含む `accessory` オブジェクトでは、`action_id` を指定していることがわかります。これは、ボタンを一意に示す識別子として機能します。これを使って、アプリをどのアクションに応答させるかを指定できます。 -:::tip +:::tip[[Block Kit Builder](https://app.slack.com/block-kit-builder) を使用すると、インタラクティブなメッセージのプロトタイプを簡単に作成できます。] -[Block Kit Builder](https://app.slack.com/block-kit-builder) を使用すると、インタラクティブなメッセージのプロトタイプを簡単に作成できます。自分自身やチームメンバーがメッセージのモックアップを作成し、生成される JSON をアプリに直接貼りつけることができます。 +自分自身やチームメンバーがメッセージのモックアップを作成し、生成される JSON をアプリに直接貼りつけることができます。 ::: @@ -468,6 +458,6 @@ if __name__ == "__main__": ここまでで基本的なアプリをセットアップして実行することはできたので、次は自分だけの Bolt アプリを作る方法について調べてみてください。参考になりそうなリソースをいくつかご紹介します。 * 基本的な概念について読んでみてください。Bolt アプリがアクセスできるさまざまメソッドや機能について知ることができます。 -* [`app.event()` メソッド](/concepts/event-listening)でボットがリッスンできるイベントをほかにも試してみましょう。すべてのイベントの一覧は [API サイト](https://docs.slack.dev/reference/events)で確認できます。 -* Bolt では、アプリにアタッチされたクライアントから [Web API メソッドを呼び出す](/concepts/web-api)ことができます。API サイトに [220 以上のメソッド](https://docs.slack.dev/reference/methods)を一覧しています。 -* [API サイト](https://docs.slack.dev/authentication/tokens)でほかのタイプのトークンを確認してみてください。アプリで実行したいアクションによって、異なるトークンが必要になる場合があります。 +* [`app.event()` メソッド](/tools/bolt-python/concepts/event-listening)でボットがリッスンできるイベントをほかにも試してみましょう。すべてのイベントの一覧は [API サイト](/reference/events)で確認できます。 +* Bolt では、アプリにアタッチされたクライアントから [Web API メソッドを呼び出す](/tools/bolt-python/concepts/web-api)ことができます。API サイトに [220 以上のメソッド](/reference/methods)を一覧しています。 +* [API サイト](/authentication/tokens)でほかのタイプのトークンを確認してみてください。アプリで実行したいアクションによって、異なるトークンが必要になる場合があります。 diff --git a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/legacy/steps-from-apps.md b/docs/japanese/legacy/steps-from-apps.md similarity index 71% rename from docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/legacy/steps-from-apps.md rename to docs/japanese/legacy/steps-from-apps.md index 554b2a1f4..a7ef2e04a 100644 --- a/docs/i18n/ja-jp/docusaurus-plugin-content-docs/current/legacy/steps-from-apps.md +++ b/docs/japanese/legacy/steps-from-apps.md @@ -1,10 +1,6 @@ ---- -title: ワークフローステップの概要 -lang: ja-jp -slug: /concepts/steps-from-apps ---- +# ワークフローステップの概要 -(アプリによる)ワークフローステップでは、処理をアプリ側で行うカスタムのワークフローステップを提供することができます。ユーザーは[ワークフロービルダー](https://docs.slack.dev/workflows/workflow-builder)を使ってこれらのステップをワークフローに追加できます。 +(アプリによる)ワークフローステップでは、処理をアプリ側で行うカスタムのワークフローステップを提供することができます。ユーザーは[ワークフロービルダー](/workflows/workflow-builder)を使ってこれらのステップをワークフローに追加できます。 ワークフローステップは、次の 3 つのユーザーイベントで構成されます。 @@ -14,7 +10,7 @@ slug: /concepts/steps-from-apps ワークフローステップを機能させるためには、これら 3 つのイベントすべてに対応する必要があります。 -アプリを使ったワークフローステップに関する詳細は、[API ドキュメント](https://docs.slack.dev/legacy/legacy-steps-from-apps/)を参照してください。 +アプリを使ったワークフローステップに関する詳細は、[API ドキュメント](/legacy/legacy-steps-from-apps/)を参照してください。 ## ステップの定義 @@ -26,9 +22,9 @@ slug: /concepts/steps-from-apps `WorkflowStep` のインスタンスを作成したら、それを`app.step()` メソッドに渡します。これによって、アプリがワークフローステップのイベントをリッスンし、設定オブジェクトで指定されたコールバックを使ってそれに応答できるようになります。 -また、デコレーターとして利用できる `WorkflowStepBuilder` クラスを使ってワークフローステップを定義することもできます。 詳細は、[こちらのドキュメント](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/workflows/step/step.html#slack_bolt.workflows.step.step.WorkflowStepBuilder)のコード例などを参考にしてください。 +また、デコレーターとして利用できる `WorkflowStepBuilder` クラスを使ってワークフローステップを定義することもできます。 詳細は、[こちらのドキュメント](https://docs.slack.dev/tools/bolt-python/reference/workflows/step/step.html#slack_bolt.workflows.step.step.WorkflowStepBuilder)のコード例などを参考にしてください。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください(共通 / ステップ用 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください(共通 / ステップ用 ```python import os @@ -63,15 +59,15 @@ app.step(ws) ## ステップの追加・編集 -作成したワークフローステップがワークフローに追加またはその設定を変更されるタイミングで、[`workflow_step_edit` イベントがアプリに送信されます](https://docs.slack.dev/legacy/legacy-steps-from-apps/legacy-steps-from-apps-workflow_step_edit-payload)。このイベントがアプリに届くと、`WorkflowStep` で設定した `edit` コールバックが実行されます。 +作成したワークフローステップがワークフローに追加またはその設定を変更されるタイミングで、[`workflow_step_edit` イベントがアプリに送信されます](/legacy/legacy-steps-from-apps/legacy-steps-from-apps-workflow_step_edit-payload)。このイベントがアプリに届くと、`WorkflowStep` で設定した `edit` コールバックが実行されます。 -ステップの追加と編集のどちらが行われるときも、[ワークフローステップの設定モーダル](https://docs.slack.dev/legacy/legacy-steps-from-apps/legacy-steps-from-apps-configuration-view-object)をビルダーに送信する必要があります。このモーダルは、そのステップ独自の設定を選択するための場所です。通常のモーダルより制限が強く、例えば `title`、`submit`、`close` のプロパティを含めることができません。設定モーダルの `callback_id` は、デフォルトではワークフローステップと同じものになります。 +ステップの追加と編集のどちらが行われるときも、[ワークフローステップの設定モーダル](/legacy/legacy-steps-from-apps/legacy-steps-from-apps-configuration-view-object)をビルダーに送信する必要があります。このモーダルは、そのステップ独自の設定を選択するための場所です。通常のモーダルより制限が強く、例えば `title`、`submit`、`close` のプロパティを含めることができません。設定モーダルの `callback_id` は、デフォルトではワークフローステップと同じものになります。 `edit` コールバック内で `configure()` ユーティリティを使用すると、対応する `blocks` 引数にビューのblocks 部分だけを渡して、ステップの設定モーダルを簡単に表示させることができます。必要な入力内容が揃うまで設定の保存を無効にするには、`True` の値をセットした `submit_disabled` を渡します。 -設定モーダルの開き方に関する詳細は、[こちらのドキュメント](https://docs.slack.dev/legacy/legacy-steps-from-apps/legacy-steps-from-apps-configuration-view-object)を参照してください。 +設定モーダルの開き方に関する詳細は、[こちらのドキュメント](/legacy/legacy-steps-from-apps/legacy-steps-from-apps-configuration-view-object)を参照してください。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください(共通 / ステップ用 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください(共通 / ステップ用 ```python def edit(ack, step, configure): @@ -121,9 +117,9 @@ app.step(ws) - `step_name` : ステップのデフォルトの名前をオーバーライドします。 - `step_image_url` : ステップのデフォルトの画像をオーバーライドします。 -これらのパラメータの構成方法に関する詳細は、[こちらのドキュメント](https://docs.slack.dev/legacy/legacy-steps-from-apps/legacy-steps-from-apps-workflow_step-object)を参照してください。 +これらのパラメータの構成方法に関する詳細は、[こちらのドキュメント](/legacy/legacy-steps-from-apps/legacy-steps-from-apps-workflow_step-object)を参照してください。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください(共通 / ステップ用 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください(共通 / ステップ用 ```python def save(ack, view, update): @@ -162,13 +158,13 @@ app.step(ws) ## ステップの実行 -エンドユーザーがワークフローステップを実行すると、アプリに [`workflow_step_execute` イベントが送信されます](https://docs.slack.dev/legacy/legacy-steps-from-apps/legacy-steps-from-apps-workflow_step-object)。このイベントがアプリに届くと、`WorkflowStep` で設定した `execute` コールバックが実行されます。 +エンドユーザーがワークフローステップを実行すると、アプリに [`workflow_step_execute` イベントが送信されます](/legacy/legacy-steps-from-apps/legacy-steps-from-apps-workflow_step-object)。このイベントがアプリに届くと、`WorkflowStep` で設定した `execute` コールバックが実行されます。 `save` コールバックで取り出した `inputs` を使って、サードパーティの API を呼び出す、情報をデータベースに保存する、ユーザーのホームタブを更新するといった処理を実行することができます。また、ワークフローの後続のステップで利用する出力値を `outputs` オブジェクトに設定します。 `execute` コールバック内では、`complete()` を呼び出してステップの実行が成功したことを示すか、`fail()` を呼び出してステップの実行が失敗したことを示す必要があります。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください(共通 / ステップ用 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください(共通 / ステップ用 ```python def execute(step, complete, fail): inputs = step["inputs"] diff --git a/docs/navbarConfig.js b/docs/navbarConfig.js deleted file mode 100644 index b243299f1..000000000 --- a/docs/navbarConfig.js +++ /dev/null @@ -1,97 +0,0 @@ -const navbar = { - style: 'dark', - title: 'Slack Developer Tools', - logo: { - src: 'img/slack-logo-on-white.png', - href: 'https://tools.slack.dev', - }, - items: [ - { - type: 'dropdown', - label: 'Bolt', - position: 'left', - items: [ - { - label: 'Java', - to: 'https://tools.slack.dev/java-slack-sdk/guides/bolt-basics', - target: '_self', - }, - { - label: 'JavaScript', - to: 'https://tools.slack.dev/bolt-js', - target: '_self', - }, - { - label: 'Python', - to: 'https://tools.slack.dev/bolt-python', - target: '_self', - }, - ], - }, - { - type: 'dropdown', - label: 'SDKs', - position: 'left', - items: [ - { - label: 'Java Slack SDK', - to: 'https://tools.slack.dev/java-slack-sdk/', - target: '_self', - }, - { - label: 'Node Slack SDK', - to: 'https://tools.slack.dev/node-slack-sdk/', - target: '_self', - }, - { - label: 'Python Slack SDK', - to: 'https://tools.slack.dev/python-slack-sdk/', - target: '_self', - }, - { - label: 'Deno Slack SDK', - to: 'https://tools.slack.dev/deno-slack-sdk/', - target: '_self', - }, - ], - }, - { - to: 'https://tools.slack.dev/slack-cli', - label: 'Slack CLI', - target: '_self', - }, - { - to: 'https://docs.slack.dev/', - label: 'API Docs', - position: 'right', - target: '_self', - }, - { - label: 'Developer Program', - position: 'right', - to: 'https://api.slack.com/developer-program', - target: '_blank', - rel: "noopener noreferrer" - }, - { - label: 'Your apps', - to: 'https://api.slack.com/apps', - position: 'right', - target: '_blank', - rel: "noopener noreferrer" - }, - { - type: 'localeDropdown', - position: 'right', - }, - { - 'aria-label': 'GitHub Repository', - className: 'navbar-github-link', - href: 'https://github.com/slackapi', - position: 'right', - target: '_self', - }, - ], -}; - -module.exports = navbar; diff --git a/docs/package-lock.json b/docs/package-lock.json deleted file mode 100644 index ec7f3558a..000000000 --- a/docs/package-lock.json +++ /dev/null @@ -1,16738 +0,0 @@ -{ - "name": "website", - "version": "2024.08.01", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "website", - "version": "2024.08.01", - "dependencies": { - "@docusaurus/core": "3.8.1", - "@docusaurus/plugin-client-redirects": "^3.8.1", - "@docusaurus/preset-classic": "3.8.1", - "@mdx-js/react": "^3.1.0", - "clsx": "^2.0.0", - "docusaurus-theme-github-codeblock": "^2.0.2", - "prism-react-renderer": "^2.4.1", - "react": "^19.1.1", - "react-dom": "^19.1.1" - }, - "devDependencies": { - "@docusaurus/module-type-aliases": "3.8.1", - "@docusaurus/types": "3.8.1" - }, - "engines": { - "node": ">=20.0" - } - }, - "node_modules/@algolia/autocomplete-core": { - "version": "1.17.9", - "resolved": "https://registry.npmjs.org/@algolia/autocomplete-core/-/autocomplete-core-1.17.9.tgz", - "integrity": "sha512-O7BxrpLDPJWWHv/DLA9DRFWs+iY1uOJZkqUwjS5HSZAGcl0hIVCQ97LTLewiZmZ402JYUrun+8NqFP+hCknlbQ==", - "dependencies": { - "@algolia/autocomplete-plugin-algolia-insights": "1.17.9", - "@algolia/autocomplete-shared": "1.17.9" - } - }, - "node_modules/@algolia/autocomplete-plugin-algolia-insights": { - "version": "1.17.9", - "resolved": "https://registry.npmjs.org/@algolia/autocomplete-plugin-algolia-insights/-/autocomplete-plugin-algolia-insights-1.17.9.tgz", - "integrity": "sha512-u1fEHkCbWF92DBeB/KHeMacsjsoI0wFhjZtlCq2ddZbAehshbZST6Hs0Avkc0s+4UyBGbMDnSuXHLuvRWK5iDQ==", - "dependencies": { - "@algolia/autocomplete-shared": "1.17.9" - }, - "peerDependencies": { - "search-insights": ">= 1 < 3" - } - }, - "node_modules/@algolia/autocomplete-preset-algolia": { - "version": "1.17.9", - "resolved": "https://registry.npmjs.org/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.17.9.tgz", - "integrity": "sha512-Na1OuceSJeg8j7ZWn5ssMu/Ax3amtOwk76u4h5J4eK2Nx2KB5qt0Z4cOapCsxot9VcEN11ADV5aUSlQF4RhGjQ==", - "dependencies": { - "@algolia/autocomplete-shared": "1.17.9" - }, - "peerDependencies": { - "@algolia/client-search": ">= 4.9.1 < 6", - "algoliasearch": ">= 4.9.1 < 6" - } - }, - "node_modules/@algolia/autocomplete-shared": { - "version": "1.17.9", - "resolved": "https://registry.npmjs.org/@algolia/autocomplete-shared/-/autocomplete-shared-1.17.9.tgz", - "integrity": "sha512-iDf05JDQ7I0b7JEA/9IektxN/80a2MZ1ToohfmNS3rfeuQnIKI3IJlIafD0xu4StbtQTghx9T3Maa97ytkXenQ==", - "peerDependencies": { - "@algolia/client-search": ">= 4.9.1 < 6", - "algoliasearch": ">= 4.9.1 < 6" - } - }, - "node_modules/@algolia/client-abtesting": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@algolia/client-abtesting/-/client-abtesting-5.30.0.tgz", - "integrity": "sha512-Q3OQXYlTNqVUN/V1qXX8VIzQbLjP3yrRBO9m6NRe1CBALmoGHh9JrYosEGvfior28+DjqqU3Q+nzCSuf/bX0Gw==", - "dependencies": { - "@algolia/client-common": "5.30.0", - "@algolia/requester-browser-xhr": "5.30.0", - "@algolia/requester-fetch": "5.30.0", - "@algolia/requester-node-http": "5.30.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/client-analytics": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-5.30.0.tgz", - "integrity": "sha512-/b+SAfHjYjx/ZVeVReCKTTnFAiZWOyvYLrkYpeNMraMT6akYRR8eC1AvFcvR60GLG/jytxcJAp42G8nN5SdcLg==", - "dependencies": { - "@algolia/client-common": "5.30.0", - "@algolia/requester-browser-xhr": "5.30.0", - "@algolia/requester-fetch": "5.30.0", - "@algolia/requester-node-http": "5.30.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/client-common": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-5.30.0.tgz", - "integrity": "sha512-tbUgvkp2d20mHPbM0+NPbLg6SzkUh0lADUUjzNCF+HiPkjFRaIW3NGMlESKw5ia4Oz6ZvFzyREquUX6rdkdJcQ==", - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/client-insights": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@algolia/client-insights/-/client-insights-5.30.0.tgz", - "integrity": "sha512-caXuZqJK761m32KoEAEkjkE2WF/zYg1McuGesWXiLSgfxwZZIAf+DljpiSToBUXhoPesvjcLtINyYUzbkwE0iw==", - "dependencies": { - "@algolia/client-common": "5.30.0", - "@algolia/requester-browser-xhr": "5.30.0", - "@algolia/requester-fetch": "5.30.0", - "@algolia/requester-node-http": "5.30.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/client-personalization": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-5.30.0.tgz", - "integrity": "sha512-7K6P7TRBHLX1zTmwKDrIeBSgUidmbj6u3UW/AfroLRDGf9oZFytPKU49wg28lz/yulPuHY0nZqiwbyAxq9V17w==", - "dependencies": { - "@algolia/client-common": "5.30.0", - "@algolia/requester-browser-xhr": "5.30.0", - "@algolia/requester-fetch": "5.30.0", - "@algolia/requester-node-http": "5.30.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/client-query-suggestions": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@algolia/client-query-suggestions/-/client-query-suggestions-5.30.0.tgz", - "integrity": "sha512-WMjWuBjYxJheRt7Ec5BFr33k3cV0mq2WzmH9aBf5W4TT8kUp34x91VRsYVaWOBRlxIXI8o/WbhleqSngiuqjLA==", - "dependencies": { - "@algolia/client-common": "5.30.0", - "@algolia/requester-browser-xhr": "5.30.0", - "@algolia/requester-fetch": "5.30.0", - "@algolia/requester-node-http": "5.30.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/client-search": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-5.30.0.tgz", - "integrity": "sha512-puc1/LREfSqzgmrOFMY5L/aWmhYOlJ0TTpa245C0ZNMKEkdOkcimFbXTXQ8lZhzh+rlyFgR7cQGNtXJ5H0XgZg==", - "dependencies": { - "@algolia/client-common": "5.30.0", - "@algolia/requester-browser-xhr": "5.30.0", - "@algolia/requester-fetch": "5.30.0", - "@algolia/requester-node-http": "5.30.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/events": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@algolia/events/-/events-4.0.1.tgz", - "integrity": "sha512-FQzvOCgoFXAbf5Y6mYozw2aj5KCJoA3m4heImceldzPSMbdyS4atVjJzXKMsfX3wnZTFYwkkt8/z8UesLHlSBQ==" - }, - "node_modules/@algolia/ingestion": { - "version": "1.30.0", - "resolved": "https://registry.npmjs.org/@algolia/ingestion/-/ingestion-1.30.0.tgz", - "integrity": "sha512-NfqiIKVgGKTLr6T9F81oqB39pPiEtILTy0z8ujxPKg2rCvI/qQeDqDWFBmQPElCfUTU6kk67QAgMkQ7T6fE+gg==", - "dependencies": { - "@algolia/client-common": "5.30.0", - "@algolia/requester-browser-xhr": "5.30.0", - "@algolia/requester-fetch": "5.30.0", - "@algolia/requester-node-http": "5.30.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/monitoring": { - "version": "1.30.0", - "resolved": "https://registry.npmjs.org/@algolia/monitoring/-/monitoring-1.30.0.tgz", - "integrity": "sha512-/eeM3aqLKro5KBZw0W30iIA6afkGa+bcpvEM0NDa92m5t3vil4LOmJI9FkgzfmSkF4368z/SZMOTPShYcaVXjA==", - "dependencies": { - "@algolia/client-common": "5.30.0", - "@algolia/requester-browser-xhr": "5.30.0", - "@algolia/requester-fetch": "5.30.0", - "@algolia/requester-node-http": "5.30.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/recommend": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@algolia/recommend/-/recommend-5.30.0.tgz", - "integrity": "sha512-iWeAUWqw+xT+2IyUyTqnHCK+cyCKYV5+B6PXKdagc9GJJn6IaPs8vovwoC0Za5vKCje/aXQ24a2Z1pKpc/tdHg==", - "dependencies": { - "@algolia/client-common": "5.30.0", - "@algolia/requester-browser-xhr": "5.30.0", - "@algolia/requester-fetch": "5.30.0", - "@algolia/requester-node-http": "5.30.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/requester-browser-xhr": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-5.30.0.tgz", - "integrity": "sha512-alo3ly0tdNLjfMSPz9dmNwYUFHx7guaz5dTGlIzVGnOiwLgIoM6NgA+MJLMcH6e1S7OpmE2AxOy78svlhst2tQ==", - "dependencies": { - "@algolia/client-common": "5.30.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/requester-fetch": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@algolia/requester-fetch/-/requester-fetch-5.30.0.tgz", - "integrity": "sha512-WOnTYUIY2InllHBy6HHMpGIOo7Or4xhYUx/jkoSK/kPIa1BRoFEHqa8v4pbKHtoG7oLvM2UAsylSnjVpIhGZXg==", - "dependencies": { - "@algolia/client-common": "5.30.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/requester-node-http": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-5.30.0.tgz", - "integrity": "sha512-uSTUh9fxeHde1c7KhvZKUrivk90sdiDftC+rSKNFKKEU9TiIKAGA7B2oKC+AoMCqMymot1vW9SGbeESQPTZd0w==", - "dependencies": { - "@algolia/client-common": "5.30.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@ampproject/remapping": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", - "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", - "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", - "license": "MIT", - "dependencies": { - "@babel/helper-validator-identifier": "^7.27.1", - "js-tokens": "^4.0.0", - "picocolors": "^1.1.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/compat-data": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.2.tgz", - "integrity": "sha512-Z0WgzSEa+aUcdiJuCIqgujCshpMWgUpgOxXotrYPSA53hA3qopNaqcJpyr0hVb1FeWdnqFA35/fUtXgBK8srQg==", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/core": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz", - "integrity": "sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==", - "dependencies": { - "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.26.0", - "@babel/generator": "^7.26.0", - "@babel/helper-compilation-targets": "^7.25.9", - "@babel/helper-module-transforms": "^7.26.0", - "@babel/helpers": "^7.26.0", - "@babel/parser": "^7.26.0", - "@babel/template": "^7.25.9", - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.26.0", - "convert-source-map": "^2.0.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.3", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" - } - }, - "node_modules/@babel/core/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/generator": { - "version": "7.27.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.3.tgz", - "integrity": "sha512-xnlJYj5zepml8NXtjkG0WquFUv8RskFqyFcVgTBp5k+NaA/8uw/K+OSVf8AMGw5e9HKP2ETd5xpK5MLZQD6b4Q==", - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.27.3", - "@babel/types": "^7.27.3", - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25", - "jsesc": "^3.0.2" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-annotate-as-pure": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz", - "integrity": "sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g==", - "dependencies": { - "@babel/types": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.25.9.tgz", - "integrity": "sha512-C47lC7LIDCnz0h4vai/tpNOI95tCd5ZT3iBt/DBH5lXKHZsyNQv18yf1wIIg2ntiQNgmAvA+DgZ82iW8Qdym8g==", - "dependencies": { - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-compilation-targets": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz", - "integrity": "sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ==", - "dependencies": { - "@babel/compat-data": "^7.25.9", - "@babel/helper-validator-option": "^7.25.9", - "browserslist": "^4.24.0", - "lru-cache": "^5.1.1", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.9.tgz", - "integrity": "sha512-UTZQMvt0d/rSz6KI+qdu7GQze5TIajwTS++GUozlw8VBJDEOAqSXwm1WvmYEZwqdqSGQshRocPDqrt4HBZB3fQ==", - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.25.9", - "@babel/helper-member-expression-to-functions": "^7.25.9", - "@babel/helper-optimise-call-expression": "^7.25.9", - "@babel/helper-replace-supers": "^7.25.9", - "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", - "@babel/traverse": "^7.25.9", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-create-class-features-plugin/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/helper-create-regexp-features-plugin": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.25.9.tgz", - "integrity": "sha512-ORPNZ3h6ZRkOyAa/SaHU+XsLZr0UQzRwuDQ0cczIA17nAzZ+85G5cVkOJIj7QavLZGSe8QXUmNFxSZzjcZF9bw==", - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.25.9", - "regexpu-core": "^6.1.1", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-create-regexp-features-plugin/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/helper-define-polyfill-provider": { - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.4.tgz", - "integrity": "sha512-jljfR1rGnXXNWnmQg2K3+bvhkxB51Rl32QRaOTuwwjviGrHzIbSc8+x9CpraDtbT7mfyjXObULP4w/adunNwAw==", - "license": "MIT", - "dependencies": { - "@babel/helper-compilation-targets": "^7.22.6", - "@babel/helper-plugin-utils": "^7.22.5", - "debug": "^4.1.1", - "lodash.debounce": "^4.0.8", - "resolve": "^1.14.2" - }, - "peerDependencies": { - "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" - } - }, - "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.9.tgz", - "integrity": "sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ==", - "dependencies": { - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-imports": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", - "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", - "license": "MIT", - "dependencies": { - "@babel/traverse": "^7.27.1", - "@babel/types": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-transforms": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", - "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", - "dependencies": { - "@babel/helper-module-imports": "^7.25.9", - "@babel/helper-validator-identifier": "^7.25.9", - "@babel/traverse": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-optimise-call-expression": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.25.9.tgz", - "integrity": "sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ==", - "dependencies": { - "@babel/types": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-plugin-utils": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz", - "integrity": "sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-remap-async-to-generator": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.9.tgz", - "integrity": "sha512-IZtukuUeBbhgOcaW2s06OXTzVNJR0ybm4W5xC1opWFFJMZbwRj5LCk+ByYH7WdZPZTt8KnFwA8pvjN2yqcPlgw==", - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.25.9", - "@babel/helper-wrap-function": "^7.25.9", - "@babel/traverse": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-replace-supers": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.25.9.tgz", - "integrity": "sha512-IiDqTOTBQy0sWyeXyGSC5TBJpGFXBkRynjBeXsvbhQFKj2viwJC76Epz35YLU1fpe/Am6Vppb7W7zM4fPQzLsQ==", - "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.25.9", - "@babel/helper-optimise-call-expression": "^7.25.9", - "@babel/traverse": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-simple-access": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.25.9.tgz", - "integrity": "sha512-c6WHXuiaRsJTyHYLJV75t9IqsmTbItYfdj99PnzYGQZkYKvan5/2jKJ7gu31J3/BJ/A18grImSPModuyG/Eo0Q==", - "dependencies": { - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.9.tgz", - "integrity": "sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA==", - "dependencies": { - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-string-parser": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", - "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", - "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-option": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", - "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-wrap-function": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.25.9.tgz", - "integrity": "sha512-ETzz9UTjQSTmw39GboatdymDq4XIQbR8ySgVrylRhPOFpsd+JrKHIuF0de7GCWmem+T4uC5z7EZguod7Wj4A4g==", - "dependencies": { - "@babel/template": "^7.25.9", - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helpers": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.10.tgz", - "integrity": "sha512-UPYc3SauzZ3JGgj87GgZ89JVdC5dj0AoetR5Bw6wj4niittNyFh6+eOGonYvJ1ao6B8lEa3Q3klS7ADZ53bc5g==", - "license": "MIT", - "dependencies": { - "@babel/template": "^7.26.9", - "@babel/types": "^7.26.10" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/parser": { - "version": "7.27.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.4.tgz", - "integrity": "sha512-BRmLHGwpUqLFR2jzx9orBuX/ABDkj2jLKOXrHDTN2aOKL+jFDDKaRNo9nyYsIl9h/UE/7lMKdDjKQQyxKKDZ7g==", - "license": "MIT", - "dependencies": { - "@babel/types": "^7.27.3" - }, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.9.tgz", - "integrity": "sha512-ZkRyVkThtxQ/J6nv3JFYv1RYY+JT5BvU0y3k5bWrmuG4woXypRa4PXmm9RhOwodRkYFWqC0C0cqcJ4OqR7kW+g==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/traverse": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/plugin-bugfix-safari-class-field-initializer-scope": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.25.9.tgz", - "integrity": "sha512-MrGRLZxLD/Zjj0gdU15dfs+HH/OXvnw/U4jJD8vpcP2CJQapPEv1IWwjc/qMg7ItBlPwSv1hRBbb7LeuANdcnw==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.9.tgz", - "integrity": "sha512-2qUwwfAFpJLZqxd02YW9btUCZHl+RFvdDkNfZwaIJrvB8Tesjsk8pEQkTvGwZXLqXUx/2oyY3ySRhm6HOXuCug==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.25.9.tgz", - "integrity": "sha512-6xWgLZTJXwilVjlnV7ospI3xi+sl8lN8rXXbBD6vYn3UYDlGsag8wrZkKcSI8G6KgqKP7vNFaDgeDnfAABq61g==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", - "@babel/plugin-transform-optional-chaining": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.13.0" - } - }, - "node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.25.9.tgz", - "integrity": "sha512-aLnMXYPnzwwqhYSCyXfKkIkYgJ8zv9RK+roo9DkTXz38ynIhd9XCbN08s3MGvqL2MYGVUGdRQLL/JqBIeJhJBg==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/traverse": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/plugin-proposal-private-property-in-object": { - "version": "7.21.0-placeholder-for-preset-env.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", - "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-dynamic-import": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", - "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-import-assertions": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.26.0.tgz", - "integrity": "sha512-QCWT5Hh830hK5EQa7XzuqIkQU9tT/whqbDz7kuaZMHFl1inRRg7JnuAEOQ0Ur0QUl0NufCk1msK2BeY79Aj/eg==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-import-attributes": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz", - "integrity": "sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz", - "integrity": "sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz", - "integrity": "sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-unicode-sets-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz", - "integrity": "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==", - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/plugin-transform-arrow-functions": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.25.9.tgz", - "integrity": "sha512-6jmooXYIwn9ca5/RylZADJ+EnSxVUS5sjeJ9UPk6RWRzXCmOJCy6dqItPJFpw2cuCangPK4OYr5uhGKcmrm5Qg==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-async-generator-functions": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.9.tgz", - "integrity": "sha512-RXV6QAzTBbhDMO9fWwOmwwTuYaiPbggWQ9INdZqAYeSHyG7FzQ+nOZaUUjNwKv9pV3aE4WFqFm1Hnbci5tBCAw==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-remap-async-to-generator": "^7.25.9", - "@babel/traverse": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-async-to-generator": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.25.9.tgz", - "integrity": "sha512-NT7Ejn7Z/LjUH0Gv5KsBCxh7BH3fbLTV0ptHvpeMvrt3cPThHfJfst9Wrb7S8EvJ7vRTFI7z+VAvFVEQn/m5zQ==", - "dependencies": { - "@babel/helper-module-imports": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-remap-async-to-generator": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-block-scoped-functions": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.25.9.tgz", - "integrity": "sha512-toHc9fzab0ZfenFpsyYinOX0J/5dgJVA2fm64xPewu7CoYHWEivIWKxkK2rMi4r3yQqLnVmheMXRdG+k239CgA==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.25.9.tgz", - "integrity": "sha512-1F05O7AYjymAtqbsFETboN1NvBdcnzMerO+zlMyJBEz6WkMdejvGWw9p05iTSjC85RLlBseHHQpYaM4gzJkBGg==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-class-properties": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.25.9.tgz", - "integrity": "sha512-bbMAII8GRSkcd0h0b4X+36GksxuheLFjP65ul9w6C3KgAamI3JqErNgSrosX6ZPj+Mpim5VvEbawXxJCyEUV3Q==", - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-class-static-block": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.26.0.tgz", - "integrity": "sha512-6J2APTs7BDDm+UMqP1useWqhcRAXo0WIoVj26N7kPFB6S73Lgvyka4KTZYIxtgYXiN5HTyRObA72N2iu628iTQ==", - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.12.0" - } - }, - "node_modules/@babel/plugin-transform-classes": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.9.tgz", - "integrity": "sha512-mD8APIXmseE7oZvZgGABDyM34GUmK45Um2TXiBUt7PnuAxrgoSVf123qUzPxEr/+/BHrRn5NMZCdE2m/1F8DGg==", - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.25.9", - "@babel/helper-compilation-targets": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-replace-supers": "^7.25.9", - "@babel/traverse": "^7.25.9", - "globals": "^11.1.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-computed-properties": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.25.9.tgz", - "integrity": "sha512-HnBegGqXZR12xbcTHlJ9HGxw1OniltT26J5YpfruGqtUHlz/xKf/G2ak9e+t0rVqrjXa9WOhvYPz1ERfMj23AA==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/template": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-destructuring": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.25.9.tgz", - "integrity": "sha512-WkCGb/3ZxXepmMiX101nnGiU+1CAdut8oHyEOHxkKuS1qKpU2SMXE2uSvfz8PBuLd49V6LEsbtyPhWC7fnkgvQ==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-dotall-regex": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.25.9.tgz", - "integrity": "sha512-t7ZQ7g5trIgSRYhI9pIJtRl64KHotutUJsh4Eze5l7olJv+mRSg4/MmbZ0tv1eeqRbdvo/+trvJD/Oc5DmW2cA==", - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-duplicate-keys": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.25.9.tgz", - "integrity": "sha512-LZxhJ6dvBb/f3x8xwWIuyiAHy56nrRG3PeYTpBkkzkYRRQ6tJLu68lEF5VIqMUZiAV7a8+Tb78nEoMCMcqjXBw==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-duplicate-named-capturing-groups-regex": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.25.9.tgz", - "integrity": "sha512-0UfuJS0EsXbRvKnwcLjFtJy/Sxc5J5jhLHnFhy7u4zih97Hz6tJkLU+O+FMMrNZrosUPxDi6sYxJ/EA8jDiAog==", - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/plugin-transform-dynamic-import": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.25.9.tgz", - "integrity": "sha512-GCggjexbmSLaFhqsojeugBpeaRIgWNTcgKVq/0qIteFEqY2A+b9QidYadrWlnbWQUrW5fn+mCvf3tr7OeBFTyg==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-exponentiation-operator": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.25.9.tgz", - "integrity": "sha512-KRhdhlVk2nObA5AYa7QMgTMTVJdfHprfpAk4DjZVtllqRg9qarilstTKEhpVjyt+Npi8ThRyiV8176Am3CodPA==", - "dependencies": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-export-namespace-from": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.25.9.tgz", - "integrity": "sha512-2NsEz+CxzJIVOPx2o9UsW1rXLqtChtLoVnwYHHiB04wS5sgn7mrV45fWMBX0Kk+ub9uXytVYfNP2HjbVbCB3Ww==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-for-of": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.25.9.tgz", - "integrity": "sha512-LqHxduHoaGELJl2uhImHwRQudhCM50pT46rIBNvtT/Oql3nqiS3wOwP+5ten7NpYSXrrVLgtZU3DZmPtWZo16A==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-function-name": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.9.tgz", - "integrity": "sha512-8lP+Yxjv14Vc5MuWBpJsoUCd3hD6V9DgBon2FVYL4jJgbnVQ9fTgYmonchzZJOVNgzEgbxp4OwAf6xz6M/14XA==", - "dependencies": { - "@babel/helper-compilation-targets": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/traverse": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-json-strings": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.25.9.tgz", - "integrity": "sha512-xoTMk0WXceiiIvsaquQQUaLLXSW1KJ159KP87VilruQm0LNNGxWzahxSS6T6i4Zg3ezp4vA4zuwiNUR53qmQAw==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-literals": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.9.tgz", - "integrity": "sha512-9N7+2lFziW8W9pBl2TzaNht3+pgMIRP74zizeCSrtnSKVdUl8mAjjOP2OOVQAfZ881P2cNjDj1uAMEdeD50nuQ==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-logical-assignment-operators": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.25.9.tgz", - "integrity": "sha512-wI4wRAzGko551Y8eVf6iOY9EouIDTtPb0ByZx+ktDGHwv6bHFimrgJM/2T021txPZ2s4c7bqvHbd+vXG6K948Q==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-member-expression-literals": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.25.9.tgz", - "integrity": "sha512-PYazBVfofCQkkMzh2P6IdIUaCEWni3iYEerAsRWuVd8+jlM1S9S9cz1dF9hIzyoZ8IA3+OwVYIp9v9e+GbgZhA==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-modules-amd": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.25.9.tgz", - "integrity": "sha512-g5T11tnI36jVClQlMlt4qKDLlWnG5pP9CSM4GhdRciTNMRgkfpo5cR6b4rGIOYPgRRuFAvwjPQ/Yk+ql4dyhbw==", - "dependencies": { - "@babel/helper-module-transforms": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.25.9.tgz", - "integrity": "sha512-dwh2Ol1jWwL2MgkCzUSOvfmKElqQcuswAZypBSUsScMXvgdT8Ekq5YA6TtqpTVWH+4903NmboMuH1o9i8Rxlyg==", - "dependencies": { - "@babel/helper-module-transforms": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-simple-access": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.9.tgz", - "integrity": "sha512-hyss7iIlH/zLHaehT+xwiymtPOpsiwIIRlCAOwBB04ta5Tt+lNItADdlXw3jAWZ96VJ2jlhl/c+PNIQPKNfvcA==", - "dependencies": { - "@babel/helper-module-transforms": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-validator-identifier": "^7.25.9", - "@babel/traverse": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-modules-umd": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.25.9.tgz", - "integrity": "sha512-bS9MVObUgE7ww36HEfwe6g9WakQ0KF07mQF74uuXdkoziUPfKyu/nIm663kz//e5O1nPInPFx36z7WJmJ4yNEw==", - "dependencies": { - "@babel/helper-module-transforms": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.25.9.tgz", - "integrity": "sha512-oqB6WHdKTGl3q/ItQhpLSnWWOpjUJLsOCLVyeFgeTktkBSCiurvPOsyt93gibI9CmuKvTUEtWmG5VhZD+5T/KA==", - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/plugin-transform-new-target": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.25.9.tgz", - "integrity": "sha512-U/3p8X1yCSoKyUj2eOBIx3FOn6pElFOKvAAGf8HTtItuPyB+ZeOqfn+mvTtg9ZlOAjsPdK3ayQEjqHjU/yLeVQ==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.25.9.tgz", - "integrity": "sha512-ENfftpLZw5EItALAD4WsY/KUWvhUlZndm5GC7G3evUsVeSJB6p0pBeLQUnRnBCBx7zV0RKQjR9kCuwrsIrjWog==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-numeric-separator": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.25.9.tgz", - "integrity": "sha512-TlprrJ1GBZ3r6s96Yq8gEQv82s8/5HnCVHtEJScUj90thHQbwe+E5MLhi2bbNHBEJuzrvltXSru+BUxHDoog7Q==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-object-rest-spread": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.25.9.tgz", - "integrity": "sha512-fSaXafEE9CVHPweLYw4J0emp1t8zYTXyzN3UuG+lylqkvYd7RMrsOQ8TYx5RF231be0vqtFC6jnx3UmpJmKBYg==", - "dependencies": { - "@babel/helper-compilation-targets": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/plugin-transform-parameters": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-object-super": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.25.9.tgz", - "integrity": "sha512-Kj/Gh+Rw2RNLbCK1VAWj2U48yxxqL2x0k10nPtSdRa0O2xnHXalD0s+o1A6a0W43gJ00ANo38jxkQreckOzv5A==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-replace-supers": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-optional-catch-binding": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.25.9.tgz", - "integrity": "sha512-qM/6m6hQZzDcZF3onzIhZeDHDO43bkNNlOX0i8n3lR6zLbu0GN2d8qfM/IERJZYauhAHSLHy39NF0Ctdvcid7g==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-optional-chaining": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.25.9.tgz", - "integrity": "sha512-6AvV0FsLULbpnXeBjrY4dmWF8F7gf8QnvTEoO/wX/5xm/xE1Xo8oPuD3MPS+KS9f9XBEAWN7X1aWr4z9HdOr7A==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-parameters": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.25.9.tgz", - "integrity": "sha512-wzz6MKwpnshBAiRmn4jR8LYz/g8Ksg0o80XmwZDlordjwEk9SxBzTWC7F5ef1jhbrbOW2DJ5J6ayRukrJmnr0g==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-private-methods": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.25.9.tgz", - "integrity": "sha512-D/JUozNpQLAPUVusvqMxyvjzllRaF8/nSrP1s2YGQT/W4LHK4xxsMcHjhOGTS01mp9Hda8nswb+FblLdJornQw==", - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-private-property-in-object": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.25.9.tgz", - "integrity": "sha512-Evf3kcMqzXA3xfYJmZ9Pg1OvKdtqsDMSWBDzZOPLvHiTt36E75jLDQo5w1gtRU95Q4E5PDttrTf25Fw8d/uWLw==", - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.25.9", - "@babel/helper-create-class-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-property-literals": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.25.9.tgz", - "integrity": "sha512-IvIUeV5KrS/VPavfSM/Iu+RE6llrHrYIKY1yfCzyO/lMXHQ+p7uGhonmGVisv6tSBSVgWzMBohTcvkC9vQcQFA==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-react-constant-elements": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.27.1.tgz", - "integrity": "sha512-edoidOjl/ZxvYo4lSBOQGDSyToYVkTAwyVoa2tkuYTSmjrB1+uAedoL5iROVLXkxH+vRgA7uP4tMg2pUJpZ3Ug==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-react-display-name": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.25.9.tgz", - "integrity": "sha512-KJfMlYIUxQB1CJfO3e0+h0ZHWOTLCPP115Awhaz8U0Zpq36Gl/cXlpoyMRnUWlhNUBAzldnCiAZNvCDj7CrKxQ==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-react-jsx": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.25.9.tgz", - "integrity": "sha512-s5XwpQYCqGerXl+Pu6VDL3x0j2d82eiV77UJ8a2mDHAW7j9SWRqQ2y1fNo1Z74CdcYipl5Z41zvjj4Nfzq36rw==", - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.25.9", - "@babel/helper-module-imports": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/plugin-syntax-jsx": "^7.25.9", - "@babel/types": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-react-jsx-development": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.25.9.tgz", - "integrity": "sha512-9mj6rm7XVYs4mdLIpbZnHOYdpW42uoiBCTVowg7sP1thUOiANgMb4UtpRivR0pp5iL+ocvUv7X4mZgFRpJEzGw==", - "dependencies": { - "@babel/plugin-transform-react-jsx": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-react-pure-annotations": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.25.9.tgz", - "integrity": "sha512-KQ/Takk3T8Qzj5TppkS1be588lkbTp5uj7w6a0LeQaTMSckU/wK0oJ/pih+T690tkgI5jfmg2TqDJvd41Sj1Cg==", - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-regenerator": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.25.9.tgz", - "integrity": "sha512-vwDcDNsgMPDGP0nMqzahDWE5/MLcX8sv96+wfX7as7LoF/kr97Bo/7fI00lXY4wUXYfVmwIIyG80fGZ1uvt2qg==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9", - "regenerator-transform": "^0.15.2" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-regexp-modifiers": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regexp-modifiers/-/plugin-transform-regexp-modifiers-7.26.0.tgz", - "integrity": "sha512-vN6saax7lrA2yA/Pak3sCxuD6F5InBjn9IcrIKQPjpsLvuHYLVroTxjdlVRHjjBWxKOqIwpTXDkOssYT4BFdRw==", - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/plugin-transform-reserved-words": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.25.9.tgz", - "integrity": "sha512-7DL7DKYjn5Su++4RXu8puKZm2XBPHyjWLUidaPEkCUBbE7IPcsrkRHggAOOKydH1dASWdcUBxrkOGNxUv5P3Jg==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-runtime": { - "version": "7.27.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.27.4.tgz", - "integrity": "sha512-D68nR5zxU64EUzV8i7T3R5XP0Xhrou/amNnddsRQssx6GrTLdZl1rLxyjtVZBd+v/NVX4AbTPOB5aU8thAZV1A==", - "dependencies": { - "@babel/helper-module-imports": "^7.27.1", - "@babel/helper-plugin-utils": "^7.27.1", - "babel-plugin-polyfill-corejs2": "^0.4.10", - "babel-plugin-polyfill-corejs3": "^0.11.0", - "babel-plugin-polyfill-regenerator": "^0.6.1", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-runtime/node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.11.1.tgz", - "integrity": "sha512-yGCqvBT4rwMczo28xkH/noxJ6MZ4nJfkVYdoDaC/utLtWrXxv27HVrzAeSbqR8SxDsp46n0YF47EbHoixy6rXQ==", - "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.6.3", - "core-js-compat": "^3.40.0" - }, - "peerDependencies": { - "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" - } - }, - "node_modules/@babel/plugin-transform-runtime/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/plugin-transform-shorthand-properties": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.25.9.tgz", - "integrity": "sha512-MUv6t0FhO5qHnS/W8XCbHmiRWOphNufpE1IVxhK5kuN3Td9FT1x4rx4K42s3RYdMXCXpfWkGSbCSd0Z64xA7Ng==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-spread": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.25.9.tgz", - "integrity": "sha512-oNknIB0TbURU5pqJFVbOOFspVlrpVwo2H1+HUIsVDvp5VauGGDP1ZEvO8Nn5xyMEs3dakajOxlmkNW7kNgSm6A==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-sticky-regex": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.25.9.tgz", - "integrity": "sha512-WqBUSgeVwucYDP9U/xNRQam7xV8W5Zf+6Eo7T2SRVUFlhRiMNFdFz58u0KZmCVVqs2i7SHgpRnAhzRNmKfi2uA==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-template-literals": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.25.9.tgz", - "integrity": "sha512-o97AE4syN71M/lxrCtQByzphAdlYluKPDBzDVzMmfCobUjjhAryZV0AIpRPrxN0eAkxXO6ZLEScmt+PNhj2OTw==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-typeof-symbol": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.25.9.tgz", - "integrity": "sha512-v61XqUMiueJROUv66BVIOi0Fv/CUuZuZMl5NkRoCVxLAnMexZ0A3kMe7vvZ0nulxMuMp0Mk6S5hNh48yki08ZA==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-typescript": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.25.9.tgz", - "integrity": "sha512-7PbZQZP50tzv2KGGnhh82GSyMB01yKY9scIjf1a+GfZCtInOWqUH5+1EBU4t9fyR5Oykkkc9vFTs4OHrhHXljQ==", - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.25.9", - "@babel/helper-create-class-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", - "@babel/plugin-syntax-typescript": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-unicode-escapes": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.25.9.tgz", - "integrity": "sha512-s5EDrE6bW97LtxOcGj1Khcx5AaXwiMmi4toFWRDP9/y0Woo6pXC+iyPu/KuhKtfSrNFd7jJB+/fkOtZy6aIC6Q==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-unicode-property-regex": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.25.9.tgz", - "integrity": "sha512-Jt2d8Ga+QwRluxRQ307Vlxa6dMrYEMZCgGxoPR8V52rxPyldHu3hdlHspxaqYmE7oID5+kB+UKUB/eWS+DkkWg==", - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-unicode-regex": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.25.9.tgz", - "integrity": "sha512-yoxstj7Rg9dlNn9UQxzk4fcNivwv4nUYz7fYXBaKxvw/lnmPuOm/ikoELygbYq68Bls3D/D+NBPHiLwZdZZ4HA==", - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-unicode-sets-regex": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.25.9.tgz", - "integrity": "sha512-8BYqO3GeVNHtx69fdPshN3fnzUNLrWdHhk/icSwigksJGczKSizZ+Z6SBCxTs723Fr5VSNorTIK7a+R2tISvwQ==", - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/preset-env": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.26.0.tgz", - "integrity": "sha512-H84Fxq0CQJNdPFT2DrfnylZ3cf5K43rGfWK4LJGPpjKHiZlk0/RzwEus3PDDZZg+/Er7lCA03MVacueUuXdzfw==", - "dependencies": { - "@babel/compat-data": "^7.26.0", - "@babel/helper-compilation-targets": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-validator-option": "^7.25.9", - "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.25.9", - "@babel/plugin-bugfix-safari-class-field-initializer-scope": "^7.25.9", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.25.9", - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.25.9", - "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.25.9", - "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", - "@babel/plugin-syntax-import-assertions": "^7.26.0", - "@babel/plugin-syntax-import-attributes": "^7.26.0", - "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", - "@babel/plugin-transform-arrow-functions": "^7.25.9", - "@babel/plugin-transform-async-generator-functions": "^7.25.9", - "@babel/plugin-transform-async-to-generator": "^7.25.9", - "@babel/plugin-transform-block-scoped-functions": "^7.25.9", - "@babel/plugin-transform-block-scoping": "^7.25.9", - "@babel/plugin-transform-class-properties": "^7.25.9", - "@babel/plugin-transform-class-static-block": "^7.26.0", - "@babel/plugin-transform-classes": "^7.25.9", - "@babel/plugin-transform-computed-properties": "^7.25.9", - "@babel/plugin-transform-destructuring": "^7.25.9", - "@babel/plugin-transform-dotall-regex": "^7.25.9", - "@babel/plugin-transform-duplicate-keys": "^7.25.9", - "@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.25.9", - "@babel/plugin-transform-dynamic-import": "^7.25.9", - "@babel/plugin-transform-exponentiation-operator": "^7.25.9", - "@babel/plugin-transform-export-namespace-from": "^7.25.9", - "@babel/plugin-transform-for-of": "^7.25.9", - "@babel/plugin-transform-function-name": "^7.25.9", - "@babel/plugin-transform-json-strings": "^7.25.9", - "@babel/plugin-transform-literals": "^7.25.9", - "@babel/plugin-transform-logical-assignment-operators": "^7.25.9", - "@babel/plugin-transform-member-expression-literals": "^7.25.9", - "@babel/plugin-transform-modules-amd": "^7.25.9", - "@babel/plugin-transform-modules-commonjs": "^7.25.9", - "@babel/plugin-transform-modules-systemjs": "^7.25.9", - "@babel/plugin-transform-modules-umd": "^7.25.9", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.25.9", - "@babel/plugin-transform-new-target": "^7.25.9", - "@babel/plugin-transform-nullish-coalescing-operator": "^7.25.9", - "@babel/plugin-transform-numeric-separator": "^7.25.9", - "@babel/plugin-transform-object-rest-spread": "^7.25.9", - "@babel/plugin-transform-object-super": "^7.25.9", - "@babel/plugin-transform-optional-catch-binding": "^7.25.9", - "@babel/plugin-transform-optional-chaining": "^7.25.9", - "@babel/plugin-transform-parameters": "^7.25.9", - "@babel/plugin-transform-private-methods": "^7.25.9", - "@babel/plugin-transform-private-property-in-object": "^7.25.9", - "@babel/plugin-transform-property-literals": "^7.25.9", - "@babel/plugin-transform-regenerator": "^7.25.9", - "@babel/plugin-transform-regexp-modifiers": "^7.26.0", - "@babel/plugin-transform-reserved-words": "^7.25.9", - "@babel/plugin-transform-shorthand-properties": "^7.25.9", - "@babel/plugin-transform-spread": "^7.25.9", - "@babel/plugin-transform-sticky-regex": "^7.25.9", - "@babel/plugin-transform-template-literals": "^7.25.9", - "@babel/plugin-transform-typeof-symbol": "^7.25.9", - "@babel/plugin-transform-unicode-escapes": "^7.25.9", - "@babel/plugin-transform-unicode-property-regex": "^7.25.9", - "@babel/plugin-transform-unicode-regex": "^7.25.9", - "@babel/plugin-transform-unicode-sets-regex": "^7.25.9", - "@babel/preset-modules": "0.1.6-no-external-plugins", - "babel-plugin-polyfill-corejs2": "^0.4.10", - "babel-plugin-polyfill-corejs3": "^0.10.6", - "babel-plugin-polyfill-regenerator": "^0.6.1", - "core-js-compat": "^3.38.1", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/preset-env/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/preset-modules": { - "version": "0.1.6-no-external-plugins", - "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz", - "integrity": "sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/types": "^7.4.4", - "esutils": "^2.0.2" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0 || ^8.0.0-0 <8.0.0" - } - }, - "node_modules/@babel/preset-react": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.25.9.tgz", - "integrity": "sha512-D3to0uSPiWE7rBrdIICCd0tJSIGpLaaGptna2+w7Pft5xMqLpA1sz99DK5TZ1TjGbdQ/VI1eCSZ06dv3lT4JOw==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-validator-option": "^7.25.9", - "@babel/plugin-transform-react-display-name": "^7.25.9", - "@babel/plugin-transform-react-jsx": "^7.25.9", - "@babel/plugin-transform-react-jsx-development": "^7.25.9", - "@babel/plugin-transform-react-pure-annotations": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/preset-typescript": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.26.0.tgz", - "integrity": "sha512-NMk1IGZ5I/oHhoXEElcm+xUnL/szL6xflkFZmoEU9xj1qSJXpiS7rsspYo92B4DRCDvZn2erT5LdsCeXAKNCkg==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/helper-validator-option": "^7.25.9", - "@babel/plugin-syntax-jsx": "^7.25.9", - "@babel/plugin-transform-modules-commonjs": "^7.25.9", - "@babel/plugin-transform-typescript": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/runtime": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.10.tgz", - "integrity": "sha512-2WJMeRQPHKSPemqk/awGrAiuFfzBmOIPXKizAsVhWH9YJqLZ0H+HS4c8loHGgW6utJ3E/ejXQUsiGaQy2NZ9Fw==", - "license": "MIT", - "dependencies": { - "regenerator-runtime": "^0.14.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/runtime-corejs3": { - "version": "7.27.6", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.27.6.tgz", - "integrity": "sha512-vDVrlmRAY8z9Ul/HxT+8ceAru95LQgkSKiXkSYZvqtbkPSfhZJgpRp45Cldbh1GJ1kxzQkI70AqyrTI58KpaWQ==", - "dependencies": { - "core-js-pure": "^3.30.2" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/template": { - "version": "7.27.2", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", - "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.27.1", - "@babel/parser": "^7.27.2", - "@babel/types": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse": { - "version": "7.27.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.4.tgz", - "integrity": "sha512-oNcu2QbHqts9BtOWJosOVJapWjBDSxGCpFvikNR5TGDYDQf3JwpIoMzIKrvfoti93cLfPJEG4tH9SPVeyCGgdA==", - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.27.1", - "@babel/generator": "^7.27.3", - "@babel/parser": "^7.27.4", - "@babel/template": "^7.27.2", - "@babel/types": "^7.27.3", - "debug": "^4.3.1", - "globals": "^11.1.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/types": { - "version": "7.27.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.3.tgz", - "integrity": "sha512-Y1GkI4ktrtvmawoSq+4FCVHNryea6uR+qUQy0AGxLSsjCX0nVmkYQMBLHDkXZuo5hGx7eYdnIaslsdBFm7zbUw==", - "license": "MIT", - "dependencies": { - "@babel/helper-string-parser": "^7.27.1", - "@babel/helper-validator-identifier": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@colors/colors": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", - "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.1.90" - } - }, - "node_modules/@csstools/cascade-layer-name-parser": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@csstools/cascade-layer-name-parser/-/cascade-layer-name-parser-2.0.5.tgz", - "integrity": "sha512-p1ko5eHgV+MgXFVa4STPKpvPxr6ReS8oS2jzTukjR74i5zJNyWO1ZM1m8YKBXnzDKWfBN1ztLYlHxbVemDD88A==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4" - } - }, - "node_modules/@csstools/color-helpers": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.0.2.tgz", - "integrity": "sha512-JqWH1vsgdGcw2RR6VliXXdA0/59LttzlU8UlRT/iUUsEeWfYq8I+K0yhihEUTTHLRm1EXvpsCx3083EU15ecsA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@csstools/css-calc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.4.tgz", - "integrity": "sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4" - } - }, - "node_modules/@csstools/css-color-parser": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.0.10.tgz", - "integrity": "sha512-TiJ5Ajr6WRd1r8HSiwJvZBiJOqtH86aHpUjq5aEKWHiII2Qfjqd/HCWKPOW8EP4vcspXbHnXrwIDlu5savQipg==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/color-helpers": "^5.0.2", - "@csstools/css-calc": "^2.1.4" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4" - } - }, - "node_modules/@csstools/css-parser-algorithms": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.5.tgz", - "integrity": "sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@csstools/css-tokenizer": "^3.0.4" - } - }, - "node_modules/@csstools/css-tokenizer": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.4.tgz", - "integrity": "sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@csstools/media-query-list-parser": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-4.0.3.tgz", - "integrity": "sha512-HAYH7d3TLRHDOUQK4mZKf9k9Ph/m8Akstg66ywKR4SFAigjs3yBiUeZtFxywiTm5moZMAp/5W/ZuFnNXXYLuuQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4" - } - }, - "node_modules/@csstools/postcss-cascade-layers": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@csstools/postcss-cascade-layers/-/postcss-cascade-layers-5.0.2.tgz", - "integrity": "sha512-nWBE08nhO8uWl6kSAeCx4im7QfVko3zLrtgWZY4/bP87zrSPpSyN/3W3TDqz1jJuH+kbKOHXg5rJnK+ZVYcFFg==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/selector-specificity": "^5.0.0", - "postcss-selector-parser": "^7.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-cascade-layers/node_modules/@csstools/selector-specificity": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-5.0.0.tgz", - "integrity": "sha512-PCqQV3c4CoVm3kdPhyeZ07VmBRdH2EpMFA/pd9OASpOEC3aXNGoqPDAZ80D0cLpMBxnmk0+yNhGsEx31hq7Gtw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss-selector-parser": "^7.0.0" - } - }, - "node_modules/@csstools/postcss-cascade-layers/node_modules/postcss-selector-parser": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", - "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@csstools/postcss-color-function": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/@csstools/postcss-color-function/-/postcss-color-function-4.0.10.tgz", - "integrity": "sha512-4dY0NBu7NVIpzxZRgh/Q/0GPSz/jLSw0i/u3LTUor0BkQcz/fNhN10mSWBDsL0p9nDb0Ky1PD6/dcGbhACuFTQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/css-color-parser": "^3.0.10", - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4", - "@csstools/postcss-progressive-custom-properties": "^4.1.0", - "@csstools/utilities": "^2.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-color-mix-function": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/@csstools/postcss-color-mix-function/-/postcss-color-mix-function-3.0.10.tgz", - "integrity": "sha512-P0lIbQW9I4ShE7uBgZRib/lMTf9XMjJkFl/d6w4EMNHu2qvQ6zljJGEcBkw/NsBtq/6q3WrmgxSS8kHtPMkK4Q==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/css-color-parser": "^3.0.10", - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4", - "@csstools/postcss-progressive-custom-properties": "^4.1.0", - "@csstools/utilities": "^2.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-color-mix-variadic-function-arguments": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@csstools/postcss-color-mix-variadic-function-arguments/-/postcss-color-mix-variadic-function-arguments-1.0.0.tgz", - "integrity": "sha512-Z5WhouTyD74dPFPrVE7KydgNS9VvnjB8qcdes9ARpCOItb4jTnm7cHp4FhxCRUoyhabD0WVv43wbkJ4p8hLAlQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/css-color-parser": "^3.0.10", - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4", - "@csstools/postcss-progressive-custom-properties": "^4.1.0", - "@csstools/utilities": "^2.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-content-alt-text": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@csstools/postcss-content-alt-text/-/postcss-content-alt-text-2.0.6.tgz", - "integrity": "sha512-eRjLbOjblXq+byyaedQRSrAejKGNAFued+LcbzT+LCL78fabxHkxYjBbxkroONxHHYu2qxhFK2dBStTLPG3jpQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4", - "@csstools/postcss-progressive-custom-properties": "^4.1.0", - "@csstools/utilities": "^2.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-exponential-functions": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@csstools/postcss-exponential-functions/-/postcss-exponential-functions-2.0.9.tgz", - "integrity": "sha512-abg2W/PI3HXwS/CZshSa79kNWNZHdJPMBXeZNyPQFbbj8sKO3jXxOt/wF7juJVjyDTc6JrvaUZYFcSBZBhaxjw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/css-calc": "^2.1.4", - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-font-format-keywords": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@csstools/postcss-font-format-keywords/-/postcss-font-format-keywords-4.0.0.tgz", - "integrity": "sha512-usBzw9aCRDvchpok6C+4TXC57btc4bJtmKQWOHQxOVKen1ZfVqBUuCZ/wuqdX5GHsD0NRSr9XTP+5ID1ZZQBXw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/utilities": "^2.0.0", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-gamut-mapping": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/@csstools/postcss-gamut-mapping/-/postcss-gamut-mapping-2.0.10.tgz", - "integrity": "sha512-QDGqhJlvFnDlaPAfCYPsnwVA6ze+8hhrwevYWlnUeSjkkZfBpcCO42SaUD8jiLlq7niouyLgvup5lh+f1qessg==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/css-color-parser": "^3.0.10", - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-gradients-interpolation-method": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/@csstools/postcss-gradients-interpolation-method/-/postcss-gradients-interpolation-method-5.0.10.tgz", - "integrity": "sha512-HHPauB2k7Oits02tKFUeVFEU2ox/H3OQVrP3fSOKDxvloOikSal+3dzlyTZmYsb9FlY9p5EUpBtz0//XBmy+aw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/css-color-parser": "^3.0.10", - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4", - "@csstools/postcss-progressive-custom-properties": "^4.1.0", - "@csstools/utilities": "^2.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-hwb-function": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/@csstools/postcss-hwb-function/-/postcss-hwb-function-4.0.10.tgz", - "integrity": "sha512-nOKKfp14SWcdEQ++S9/4TgRKchooLZL0TUFdun3nI4KPwCjETmhjta1QT4ICQcGVWQTvrsgMM/aLB5We+kMHhQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/css-color-parser": "^3.0.10", - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4", - "@csstools/postcss-progressive-custom-properties": "^4.1.0", - "@csstools/utilities": "^2.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-ic-unit": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@csstools/postcss-ic-unit/-/postcss-ic-unit-4.0.2.tgz", - "integrity": "sha512-lrK2jjyZwh7DbxaNnIUjkeDmU8Y6KyzRBk91ZkI5h8nb1ykEfZrtIVArdIjX4DHMIBGpdHrgP0n4qXDr7OHaKA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/postcss-progressive-custom-properties": "^4.1.0", - "@csstools/utilities": "^2.0.0", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-initial": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@csstools/postcss-initial/-/postcss-initial-2.0.1.tgz", - "integrity": "sha512-L1wLVMSAZ4wovznquK0xmC7QSctzO4D0Is590bxpGqhqjboLXYA16dWZpfwImkdOgACdQ9PqXsuRroW6qPlEsg==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-is-pseudo-class": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/@csstools/postcss-is-pseudo-class/-/postcss-is-pseudo-class-5.0.3.tgz", - "integrity": "sha512-jS/TY4SpG4gszAtIg7Qnf3AS2pjcUM5SzxpApOrlndMeGhIbaTzWBzzP/IApXoNWEW7OhcjkRT48jnAUIFXhAQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/selector-specificity": "^5.0.0", - "postcss-selector-parser": "^7.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-is-pseudo-class/node_modules/@csstools/selector-specificity": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-5.0.0.tgz", - "integrity": "sha512-PCqQV3c4CoVm3kdPhyeZ07VmBRdH2EpMFA/pd9OASpOEC3aXNGoqPDAZ80D0cLpMBxnmk0+yNhGsEx31hq7Gtw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss-selector-parser": "^7.0.0" - } - }, - "node_modules/@csstools/postcss-is-pseudo-class/node_modules/postcss-selector-parser": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", - "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@csstools/postcss-light-dark-function": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@csstools/postcss-light-dark-function/-/postcss-light-dark-function-2.0.9.tgz", - "integrity": "sha512-1tCZH5bla0EAkFAI2r0H33CDnIBeLUaJh1p+hvvsylJ4svsv2wOmJjJn+OXwUZLXef37GYbRIVKX+X+g6m+3CQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4", - "@csstools/postcss-progressive-custom-properties": "^4.1.0", - "@csstools/utilities": "^2.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-logical-float-and-clear": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@csstools/postcss-logical-float-and-clear/-/postcss-logical-float-and-clear-3.0.0.tgz", - "integrity": "sha512-SEmaHMszwakI2rqKRJgE+8rpotFfne1ZS6bZqBoQIicFyV+xT1UF42eORPxJkVJVrH9C0ctUgwMSn3BLOIZldQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-logical-overflow": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@csstools/postcss-logical-overflow/-/postcss-logical-overflow-2.0.0.tgz", - "integrity": "sha512-spzR1MInxPuXKEX2csMamshR4LRaSZ3UXVaRGjeQxl70ySxOhMpP2252RAFsg8QyyBXBzuVOOdx1+bVO5bPIzA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-logical-overscroll-behavior": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@csstools/postcss-logical-overscroll-behavior/-/postcss-logical-overscroll-behavior-2.0.0.tgz", - "integrity": "sha512-e/webMjoGOSYfqLunyzByZj5KKe5oyVg/YSbie99VEaSDE2kimFm0q1f6t/6Jo+VVCQ/jbe2Xy+uX+C4xzWs4w==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-logical-resize": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@csstools/postcss-logical-resize/-/postcss-logical-resize-3.0.0.tgz", - "integrity": "sha512-DFbHQOFW/+I+MY4Ycd/QN6Dg4Hcbb50elIJCfnwkRTCX05G11SwViI5BbBlg9iHRl4ytB7pmY5ieAFk3ws7yyg==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-logical-viewport-units": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@csstools/postcss-logical-viewport-units/-/postcss-logical-viewport-units-3.0.4.tgz", - "integrity": "sha512-q+eHV1haXA4w9xBwZLKjVKAWn3W2CMqmpNpZUk5kRprvSiBEGMgrNH3/sJZ8UA3JgyHaOt3jwT9uFa4wLX4EqQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/css-tokenizer": "^3.0.4", - "@csstools/utilities": "^2.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-media-minmax": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@csstools/postcss-media-minmax/-/postcss-media-minmax-2.0.9.tgz", - "integrity": "sha512-af9Qw3uS3JhYLnCbqtZ9crTvvkR+0Se+bBqSr7ykAnl9yKhk6895z9rf+2F4dClIDJWxgn0iZZ1PSdkhrbs2ig==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/css-calc": "^2.1.4", - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4", - "@csstools/media-query-list-parser": "^4.0.3" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@csstools/postcss-media-queries-aspect-ratio-number-values/-/postcss-media-queries-aspect-ratio-number-values-3.0.5.tgz", - "integrity": "sha512-zhAe31xaaXOY2Px8IYfoVTB3wglbJUVigGphFLj6exb7cjZRH9A6adyE22XfFK3P2PzwRk0VDeTJmaxpluyrDg==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4", - "@csstools/media-query-list-parser": "^4.0.3" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-nested-calc": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@csstools/postcss-nested-calc/-/postcss-nested-calc-4.0.0.tgz", - "integrity": "sha512-jMYDdqrQQxE7k9+KjstC3NbsmC063n1FTPLCgCRS2/qHUbHM0mNy9pIn4QIiQGs9I/Bg98vMqw7mJXBxa0N88A==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/utilities": "^2.0.0", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-normalize-display-values": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@csstools/postcss-normalize-display-values/-/postcss-normalize-display-values-4.0.0.tgz", - "integrity": "sha512-HlEoG0IDRoHXzXnkV4in47dzsxdsjdz6+j7MLjaACABX2NfvjFS6XVAnpaDyGesz9gK2SC7MbNwdCHusObKJ9Q==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-oklab-function": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/@csstools/postcss-oklab-function/-/postcss-oklab-function-4.0.10.tgz", - "integrity": "sha512-ZzZUTDd0fgNdhv8UUjGCtObPD8LYxMH+MJsW9xlZaWTV8Ppr4PtxlHYNMmF4vVWGl0T6f8tyWAKjoI6vePSgAg==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/css-color-parser": "^3.0.10", - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4", - "@csstools/postcss-progressive-custom-properties": "^4.1.0", - "@csstools/utilities": "^2.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-progressive-custom-properties": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@csstools/postcss-progressive-custom-properties/-/postcss-progressive-custom-properties-4.1.0.tgz", - "integrity": "sha512-YrkI9dx8U4R8Sz2EJaoeD9fI7s7kmeEBfmO+UURNeL6lQI7VxF6sBE+rSqdCBn4onwqmxFdBU3lTwyYb/lCmxA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-random-function": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@csstools/postcss-random-function/-/postcss-random-function-2.0.1.tgz", - "integrity": "sha512-q+FQaNiRBhnoSNo+GzqGOIBKoHQ43lYz0ICrV+UudfWnEF6ksS6DsBIJSISKQT2Bvu3g4k6r7t0zYrk5pDlo8w==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/css-calc": "^2.1.4", - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-relative-color-syntax": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/@csstools/postcss-relative-color-syntax/-/postcss-relative-color-syntax-3.0.10.tgz", - "integrity": "sha512-8+0kQbQGg9yYG8hv0dtEpOMLwB9M+P7PhacgIzVzJpixxV4Eq9AUQtQw8adMmAJU1RBBmIlpmtmm3XTRd/T00g==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/css-color-parser": "^3.0.10", - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4", - "@csstools/postcss-progressive-custom-properties": "^4.1.0", - "@csstools/utilities": "^2.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-scope-pseudo-class": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@csstools/postcss-scope-pseudo-class/-/postcss-scope-pseudo-class-4.0.1.tgz", - "integrity": "sha512-IMi9FwtH6LMNuLea1bjVMQAsUhFxJnyLSgOp/cpv5hrzWmrUYU5fm0EguNDIIOHUqzXode8F/1qkC/tEo/qN8Q==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "postcss-selector-parser": "^7.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-scope-pseudo-class/node_modules/postcss-selector-parser": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", - "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@csstools/postcss-sign-functions": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@csstools/postcss-sign-functions/-/postcss-sign-functions-1.1.4.tgz", - "integrity": "sha512-P97h1XqRPcfcJndFdG95Gv/6ZzxUBBISem0IDqPZ7WMvc/wlO+yU0c5D/OCpZ5TJoTt63Ok3knGk64N+o6L2Pg==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/css-calc": "^2.1.4", - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-stepped-value-functions": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/@csstools/postcss-stepped-value-functions/-/postcss-stepped-value-functions-4.0.9.tgz", - "integrity": "sha512-h9btycWrsex4dNLeQfyU3y3w40LMQooJWFMm/SK9lrKguHDcFl4VMkncKKoXi2z5rM9YGWbUQABI8BT2UydIcA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/css-calc": "^2.1.4", - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-text-decoration-shorthand": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@csstools/postcss-text-decoration-shorthand/-/postcss-text-decoration-shorthand-4.0.2.tgz", - "integrity": "sha512-8XvCRrFNseBSAGxeaVTaNijAu+FzUvjwFXtcrynmazGb/9WUdsPCpBX+mHEHShVRq47Gy4peYAoxYs8ltUnmzA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/color-helpers": "^5.0.2", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-trigonometric-functions": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/@csstools/postcss-trigonometric-functions/-/postcss-trigonometric-functions-4.0.9.tgz", - "integrity": "sha512-Hnh5zJUdpNrJqK9v1/E3BbrQhaDTj5YiX7P61TOvUhoDHnUmsNNxcDAgkQ32RrcWx9GVUvfUNPcUkn8R3vIX6A==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/css-calc": "^2.1.4", - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/postcss-unset-value": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@csstools/postcss-unset-value/-/postcss-unset-value-4.0.0.tgz", - "integrity": "sha512-cBz3tOCI5Fw6NIFEwU3RiwK6mn3nKegjpJuzCndoGq3BZPkUjnsq7uQmIeMNeMbMk7YD2MfKcgCpZwX5jyXqCA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@csstools/utilities": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@csstools/utilities/-/utilities-2.0.0.tgz", - "integrity": "sha512-5VdOr0Z71u+Yp3ozOx8T11N703wIFGVRgOWbOZMKgglPJsWA54MRIoMNVMa7shUToIhx5J8vX4sOZgD2XiihiQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/@discoveryjs/json-ext": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", - "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", - "license": "MIT", - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/@docsearch/css": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/@docsearch/css/-/css-3.9.0.tgz", - "integrity": "sha512-cQbnVbq0rrBwNAKegIac/t6a8nWoUAn8frnkLFW6YARaRmAQr5/Eoe6Ln2fqkUCZ40KpdrKbpSAmgrkviOxuWA==" - }, - "node_modules/@docsearch/react": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/@docsearch/react/-/react-3.9.0.tgz", - "integrity": "sha512-mb5FOZYZIkRQ6s/NWnM98k879vu5pscWqTLubLFBO87igYYT4VzVazh4h5o/zCvTIZgEt3PvsCOMOswOUo9yHQ==", - "dependencies": { - "@algolia/autocomplete-core": "1.17.9", - "@algolia/autocomplete-preset-algolia": "1.17.9", - "@docsearch/css": "3.9.0", - "algoliasearch": "^5.14.2" - }, - "peerDependencies": { - "@types/react": ">= 16.8.0 < 20.0.0", - "react": ">= 16.8.0 < 20.0.0", - "react-dom": ">= 16.8.0 < 20.0.0", - "search-insights": ">= 1 < 3" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "react": { - "optional": true - }, - "react-dom": { - "optional": true - }, - "search-insights": { - "optional": true - } - } - }, - "node_modules/@docusaurus/babel": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/babel/-/babel-3.8.1.tgz", - "integrity": "sha512-3brkJrml8vUbn9aeoZUlJfsI/GqyFcDgQJwQkmBtclJgWDEQBKKeagZfOgx0WfUQhagL1sQLNW0iBdxnI863Uw==", - "dependencies": { - "@babel/core": "^7.25.9", - "@babel/generator": "^7.25.9", - "@babel/plugin-syntax-dynamic-import": "^7.8.3", - "@babel/plugin-transform-runtime": "^7.25.9", - "@babel/preset-env": "^7.25.9", - "@babel/preset-react": "^7.25.9", - "@babel/preset-typescript": "^7.25.9", - "@babel/runtime": "^7.25.9", - "@babel/runtime-corejs3": "^7.25.9", - "@babel/traverse": "^7.25.9", - "@docusaurus/logger": "3.8.1", - "@docusaurus/utils": "3.8.1", - "babel-plugin-dynamic-import-node": "^2.3.3", - "fs-extra": "^11.1.1", - "tslib": "^2.6.0" - }, - "engines": { - "node": ">=18.0" - } - }, - "node_modules/@docusaurus/bundler": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/bundler/-/bundler-3.8.1.tgz", - "integrity": "sha512-/z4V0FRoQ0GuSLToNjOSGsk6m2lQUG4FRn8goOVoZSRsTrU8YR2aJacX5K3RG18EaX9b+52pN4m1sL3MQZVsQA==", - "dependencies": { - "@babel/core": "^7.25.9", - "@docusaurus/babel": "3.8.1", - "@docusaurus/cssnano-preset": "3.8.1", - "@docusaurus/logger": "3.8.1", - "@docusaurus/types": "3.8.1", - "@docusaurus/utils": "3.8.1", - "babel-loader": "^9.2.1", - "clean-css": "^5.3.3", - "copy-webpack-plugin": "^11.0.0", - "css-loader": "^6.11.0", - "css-minimizer-webpack-plugin": "^5.0.1", - "cssnano": "^6.1.2", - "file-loader": "^6.2.0", - "html-minifier-terser": "^7.2.0", - "mini-css-extract-plugin": "^2.9.2", - "null-loader": "^4.0.1", - "postcss": "^8.5.4", - "postcss-loader": "^7.3.4", - "postcss-preset-env": "^10.2.1", - "terser-webpack-plugin": "^5.3.9", - "tslib": "^2.6.0", - "url-loader": "^4.1.1", - "webpack": "^5.95.0", - "webpackbar": "^6.0.1" - }, - "engines": { - "node": ">=18.0" - }, - "peerDependencies": { - "@docusaurus/faster": "*" - }, - "peerDependenciesMeta": { - "@docusaurus/faster": { - "optional": true - } - } - }, - "node_modules/@docusaurus/core": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/core/-/core-3.8.1.tgz", - "integrity": "sha512-ENB01IyQSqI2FLtOzqSI3qxG2B/jP4gQPahl2C3XReiLebcVh5B5cB9KYFvdoOqOWPyr5gXK4sjgTKv7peXCrA==", - "dependencies": { - "@docusaurus/babel": "3.8.1", - "@docusaurus/bundler": "3.8.1", - "@docusaurus/logger": "3.8.1", - "@docusaurus/mdx-loader": "3.8.1", - "@docusaurus/utils": "3.8.1", - "@docusaurus/utils-common": "3.8.1", - "@docusaurus/utils-validation": "3.8.1", - "boxen": "^6.2.1", - "chalk": "^4.1.2", - "chokidar": "^3.5.3", - "cli-table3": "^0.6.3", - "combine-promises": "^1.1.0", - "commander": "^5.1.0", - "core-js": "^3.31.1", - "detect-port": "^1.5.1", - "escape-html": "^1.0.3", - "eta": "^2.2.0", - "eval": "^0.1.8", - "execa": "5.1.1", - "fs-extra": "^11.1.1", - "html-tags": "^3.3.1", - "html-webpack-plugin": "^5.6.0", - "leven": "^3.1.0", - "lodash": "^4.17.21", - "open": "^8.4.0", - "p-map": "^4.0.0", - "prompts": "^2.4.2", - "react-helmet-async": "npm:@slorber/react-helmet-async@1.3.0", - "react-loadable": "npm:@docusaurus/react-loadable@6.0.0", - "react-loadable-ssr-addon-v5-slorber": "^1.0.1", - "react-router": "^5.3.4", - "react-router-config": "^5.1.1", - "react-router-dom": "^5.3.4", - "semver": "^7.5.4", - "serve-handler": "^6.1.6", - "tinypool": "^1.0.2", - "tslib": "^2.6.0", - "update-notifier": "^6.0.2", - "webpack": "^5.95.0", - "webpack-bundle-analyzer": "^4.10.2", - "webpack-dev-server": "^4.15.2", - "webpack-merge": "^6.0.1" - }, - "bin": { - "docusaurus": "bin/docusaurus.mjs" - }, - "engines": { - "node": ">=18.0" - }, - "peerDependencies": { - "@mdx-js/react": "^3.0.0", - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - } - }, - "node_modules/@docusaurus/cssnano-preset": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/cssnano-preset/-/cssnano-preset-3.8.1.tgz", - "integrity": "sha512-G7WyR2N6SpyUotqhGznERBK+x84uyhfMQM2MmDLs88bw4Flom6TY46HzkRkSEzaP9j80MbTN8naiL1fR17WQug==", - "dependencies": { - "cssnano-preset-advanced": "^6.1.2", - "postcss": "^8.5.4", - "postcss-sort-media-queries": "^5.2.0", - "tslib": "^2.6.0" - }, - "engines": { - "node": ">=18.0" - } - }, - "node_modules/@docusaurus/logger": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/logger/-/logger-3.8.1.tgz", - "integrity": "sha512-2wjeGDhKcExEmjX8k1N/MRDiPKXGF2Pg+df/bDDPnnJWHXnVEZxXj80d6jcxp1Gpnksl0hF8t/ZQw9elqj2+ww==", - "dependencies": { - "chalk": "^4.1.2", - "tslib": "^2.6.0" - }, - "engines": { - "node": ">=18.0" - } - }, - "node_modules/@docusaurus/mdx-loader": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/mdx-loader/-/mdx-loader-3.8.1.tgz", - "integrity": "sha512-DZRhagSFRcEq1cUtBMo4TKxSNo/W6/s44yhr8X+eoXqCLycFQUylebOMPseHi5tc4fkGJqwqpWJLz6JStU9L4w==", - "dependencies": { - "@docusaurus/logger": "3.8.1", - "@docusaurus/utils": "3.8.1", - "@docusaurus/utils-validation": "3.8.1", - "@mdx-js/mdx": "^3.0.0", - "@slorber/remark-comment": "^1.0.0", - "escape-html": "^1.0.3", - "estree-util-value-to-estree": "^3.0.1", - "file-loader": "^6.2.0", - "fs-extra": "^11.1.1", - "image-size": "^2.0.2", - "mdast-util-mdx": "^3.0.0", - "mdast-util-to-string": "^4.0.0", - "rehype-raw": "^7.0.0", - "remark-directive": "^3.0.0", - "remark-emoji": "^4.0.0", - "remark-frontmatter": "^5.0.0", - "remark-gfm": "^4.0.0", - "stringify-object": "^3.3.0", - "tslib": "^2.6.0", - "unified": "^11.0.3", - "unist-util-visit": "^5.0.0", - "url-loader": "^4.1.1", - "vfile": "^6.0.1", - "webpack": "^5.88.1" - }, - "engines": { - "node": ">=18.0" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - } - }, - "node_modules/@docusaurus/module-type-aliases": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/module-type-aliases/-/module-type-aliases-3.8.1.tgz", - "integrity": "sha512-6xhvAJiXzsaq3JdosS7wbRt/PwEPWHr9eM4YNYqVlbgG1hSK3uQDXTVvQktasp3VO6BmfYWPozueLWuj4gB+vg==", - "dependencies": { - "@docusaurus/types": "3.8.1", - "@types/history": "^4.7.11", - "@types/react": "*", - "@types/react-router-config": "*", - "@types/react-router-dom": "*", - "react-helmet-async": "npm:@slorber/react-helmet-async@1.3.0", - "react-loadable": "npm:@docusaurus/react-loadable@6.0.0" - }, - "peerDependencies": { - "react": "*", - "react-dom": "*" - } - }, - "node_modules/@docusaurus/plugin-client-redirects": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-client-redirects/-/plugin-client-redirects-3.8.1.tgz", - "integrity": "sha512-F+86R7PBn6VNgy/Ux8w3ZRypJGJEzksbejQKlbTC8u6uhBUhfdXWkDp6qdOisIoW0buY5nLqucvZt1zNJzhJhA==", - "dependencies": { - "@docusaurus/core": "3.8.1", - "@docusaurus/logger": "3.8.1", - "@docusaurus/utils": "3.8.1", - "@docusaurus/utils-common": "3.8.1", - "@docusaurus/utils-validation": "3.8.1", - "eta": "^2.2.0", - "fs-extra": "^11.1.1", - "lodash": "^4.17.21", - "tslib": "^2.6.0" - }, - "engines": { - "node": ">=18.0" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - } - }, - "node_modules/@docusaurus/plugin-content-blog": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-blog/-/plugin-content-blog-3.8.1.tgz", - "integrity": "sha512-vNTpMmlvNP9n3hGEcgPaXyvTljanAKIUkuG9URQ1DeuDup0OR7Ltvoc8yrmH+iMZJbcQGhUJF+WjHLwuk8HSdw==", - "dependencies": { - "@docusaurus/core": "3.8.1", - "@docusaurus/logger": "3.8.1", - "@docusaurus/mdx-loader": "3.8.1", - "@docusaurus/theme-common": "3.8.1", - "@docusaurus/types": "3.8.1", - "@docusaurus/utils": "3.8.1", - "@docusaurus/utils-common": "3.8.1", - "@docusaurus/utils-validation": "3.8.1", - "cheerio": "1.0.0-rc.12", - "feed": "^4.2.2", - "fs-extra": "^11.1.1", - "lodash": "^4.17.21", - "schema-dts": "^1.1.2", - "srcset": "^4.0.0", - "tslib": "^2.6.0", - "unist-util-visit": "^5.0.0", - "utility-types": "^3.10.0", - "webpack": "^5.88.1" - }, - "engines": { - "node": ">=18.0" - }, - "peerDependencies": { - "@docusaurus/plugin-content-docs": "*", - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - } - }, - "node_modules/@docusaurus/plugin-content-docs": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-docs/-/plugin-content-docs-3.8.1.tgz", - "integrity": "sha512-oByRkSZzeGNQByCMaX+kif5Nl2vmtj2IHQI2fWjCfCootsdKZDPFLonhIp5s3IGJO7PLUfe0POyw0Xh/RrGXJA==", - "dependencies": { - "@docusaurus/core": "3.8.1", - "@docusaurus/logger": "3.8.1", - "@docusaurus/mdx-loader": "3.8.1", - "@docusaurus/module-type-aliases": "3.8.1", - "@docusaurus/theme-common": "3.8.1", - "@docusaurus/types": "3.8.1", - "@docusaurus/utils": "3.8.1", - "@docusaurus/utils-common": "3.8.1", - "@docusaurus/utils-validation": "3.8.1", - "@types/react-router-config": "^5.0.7", - "combine-promises": "^1.1.0", - "fs-extra": "^11.1.1", - "js-yaml": "^4.1.0", - "lodash": "^4.17.21", - "schema-dts": "^1.1.2", - "tslib": "^2.6.0", - "utility-types": "^3.10.0", - "webpack": "^5.88.1" - }, - "engines": { - "node": ">=18.0" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - } - }, - "node_modules/@docusaurus/plugin-content-pages": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-pages/-/plugin-content-pages-3.8.1.tgz", - "integrity": "sha512-a+V6MS2cIu37E/m7nDJn3dcxpvXb6TvgdNI22vJX8iUTp8eoMoPa0VArEbWvCxMY/xdC26WzNv4wZ6y0iIni/w==", - "dependencies": { - "@docusaurus/core": "3.8.1", - "@docusaurus/mdx-loader": "3.8.1", - "@docusaurus/types": "3.8.1", - "@docusaurus/utils": "3.8.1", - "@docusaurus/utils-validation": "3.8.1", - "fs-extra": "^11.1.1", - "tslib": "^2.6.0", - "webpack": "^5.88.1" - }, - "engines": { - "node": ">=18.0" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - } - }, - "node_modules/@docusaurus/plugin-css-cascade-layers": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-css-cascade-layers/-/plugin-css-cascade-layers-3.8.1.tgz", - "integrity": "sha512-VQ47xRxfNKjHS5ItzaVXpxeTm7/wJLFMOPo1BkmoMG4Cuz4nuI+Hs62+RMk1OqVog68Swz66xVPK8g9XTrBKRw==", - "dependencies": { - "@docusaurus/core": "3.8.1", - "@docusaurus/types": "3.8.1", - "@docusaurus/utils": "3.8.1", - "@docusaurus/utils-validation": "3.8.1", - "tslib": "^2.6.0" - }, - "engines": { - "node": ">=18.0" - } - }, - "node_modules/@docusaurus/plugin-debug": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-debug/-/plugin-debug-3.8.1.tgz", - "integrity": "sha512-nT3lN7TV5bi5hKMB7FK8gCffFTBSsBsAfV84/v293qAmnHOyg1nr9okEw8AiwcO3bl9vije5nsUvP0aRl2lpaw==", - "dependencies": { - "@docusaurus/core": "3.8.1", - "@docusaurus/types": "3.8.1", - "@docusaurus/utils": "3.8.1", - "fs-extra": "^11.1.1", - "react-json-view-lite": "^2.3.0", - "tslib": "^2.6.0" - }, - "engines": { - "node": ">=18.0" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - } - }, - "node_modules/@docusaurus/plugin-google-analytics": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-analytics/-/plugin-google-analytics-3.8.1.tgz", - "integrity": "sha512-Hrb/PurOJsmwHAsfMDH6oVpahkEGsx7F8CWMjyP/dw1qjqmdS9rcV1nYCGlM8nOtD3Wk/eaThzUB5TSZsGz+7Q==", - "dependencies": { - "@docusaurus/core": "3.8.1", - "@docusaurus/types": "3.8.1", - "@docusaurus/utils-validation": "3.8.1", - "tslib": "^2.6.0" - }, - "engines": { - "node": ">=18.0" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - } - }, - "node_modules/@docusaurus/plugin-google-gtag": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-3.8.1.tgz", - "integrity": "sha512-tKE8j1cEZCh8KZa4aa80zpSTxsC2/ZYqjx6AAfd8uA8VHZVw79+7OTEP2PoWi0uL5/1Is0LF5Vwxd+1fz5HlKg==", - "dependencies": { - "@docusaurus/core": "3.8.1", - "@docusaurus/types": "3.8.1", - "@docusaurus/utils-validation": "3.8.1", - "@types/gtag.js": "^0.0.12", - "tslib": "^2.6.0" - }, - "engines": { - "node": ">=18.0" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - } - }, - "node_modules/@docusaurus/plugin-google-tag-manager": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-tag-manager/-/plugin-google-tag-manager-3.8.1.tgz", - "integrity": "sha512-iqe3XKITBquZq+6UAXdb1vI0fPY5iIOitVjPQ581R1ZKpHr0qe+V6gVOrrcOHixPDD/BUKdYwkxFjpNiEN+vBw==", - "dependencies": { - "@docusaurus/core": "3.8.1", - "@docusaurus/types": "3.8.1", - "@docusaurus/utils-validation": "3.8.1", - "tslib": "^2.6.0" - }, - "engines": { - "node": ">=18.0" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - } - }, - "node_modules/@docusaurus/plugin-sitemap": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-sitemap/-/plugin-sitemap-3.8.1.tgz", - "integrity": "sha512-+9YV/7VLbGTq8qNkjiugIelmfUEVkTyLe6X8bWq7K5qPvGXAjno27QAfFq63mYfFFbJc7z+pudL63acprbqGzw==", - "dependencies": { - "@docusaurus/core": "3.8.1", - "@docusaurus/logger": "3.8.1", - "@docusaurus/types": "3.8.1", - "@docusaurus/utils": "3.8.1", - "@docusaurus/utils-common": "3.8.1", - "@docusaurus/utils-validation": "3.8.1", - "fs-extra": "^11.1.1", - "sitemap": "^7.1.1", - "tslib": "^2.6.0" - }, - "engines": { - "node": ">=18.0" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - } - }, - "node_modules/@docusaurus/plugin-svgr": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-svgr/-/plugin-svgr-3.8.1.tgz", - "integrity": "sha512-rW0LWMDsdlsgowVwqiMb/7tANDodpy1wWPwCcamvhY7OECReN3feoFwLjd/U4tKjNY3encj0AJSTxJA+Fpe+Gw==", - "dependencies": { - "@docusaurus/core": "3.8.1", - "@docusaurus/types": "3.8.1", - "@docusaurus/utils": "3.8.1", - "@docusaurus/utils-validation": "3.8.1", - "@svgr/core": "8.1.0", - "@svgr/webpack": "^8.1.0", - "tslib": "^2.6.0", - "webpack": "^5.88.1" - }, - "engines": { - "node": ">=18.0" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - } - }, - "node_modules/@docusaurus/preset-classic": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/preset-classic/-/preset-classic-3.8.1.tgz", - "integrity": "sha512-yJSjYNHXD8POMGc2mKQuj3ApPrN+eG0rO1UPgSx7jySpYU+n4WjBikbrA2ue5ad9A7aouEtMWUoiSRXTH/g7KQ==", - "dependencies": { - "@docusaurus/core": "3.8.1", - "@docusaurus/plugin-content-blog": "3.8.1", - "@docusaurus/plugin-content-docs": "3.8.1", - "@docusaurus/plugin-content-pages": "3.8.1", - "@docusaurus/plugin-css-cascade-layers": "3.8.1", - "@docusaurus/plugin-debug": "3.8.1", - "@docusaurus/plugin-google-analytics": "3.8.1", - "@docusaurus/plugin-google-gtag": "3.8.1", - "@docusaurus/plugin-google-tag-manager": "3.8.1", - "@docusaurus/plugin-sitemap": "3.8.1", - "@docusaurus/plugin-svgr": "3.8.1", - "@docusaurus/theme-classic": "3.8.1", - "@docusaurus/theme-common": "3.8.1", - "@docusaurus/theme-search-algolia": "3.8.1", - "@docusaurus/types": "3.8.1" - }, - "engines": { - "node": ">=18.0" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - } - }, - "node_modules/@docusaurus/theme-classic": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-classic/-/theme-classic-3.8.1.tgz", - "integrity": "sha512-bqDUCNqXeYypMCsE1VcTXSI1QuO4KXfx8Cvl6rYfY0bhhqN6d2WZlRkyLg/p6pm+DzvanqHOyYlqdPyP0iz+iw==", - "dependencies": { - "@docusaurus/core": "3.8.1", - "@docusaurus/logger": "3.8.1", - "@docusaurus/mdx-loader": "3.8.1", - "@docusaurus/module-type-aliases": "3.8.1", - "@docusaurus/plugin-content-blog": "3.8.1", - "@docusaurus/plugin-content-docs": "3.8.1", - "@docusaurus/plugin-content-pages": "3.8.1", - "@docusaurus/theme-common": "3.8.1", - "@docusaurus/theme-translations": "3.8.1", - "@docusaurus/types": "3.8.1", - "@docusaurus/utils": "3.8.1", - "@docusaurus/utils-common": "3.8.1", - "@docusaurus/utils-validation": "3.8.1", - "@mdx-js/react": "^3.0.0", - "clsx": "^2.0.0", - "copy-text-to-clipboard": "^3.2.0", - "infima": "0.2.0-alpha.45", - "lodash": "^4.17.21", - "nprogress": "^0.2.0", - "postcss": "^8.5.4", - "prism-react-renderer": "^2.3.0", - "prismjs": "^1.29.0", - "react-router-dom": "^5.3.4", - "rtlcss": "^4.1.0", - "tslib": "^2.6.0", - "utility-types": "^3.10.0" - }, - "engines": { - "node": ">=18.0" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - } - }, - "node_modules/@docusaurus/theme-common": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-common/-/theme-common-3.8.1.tgz", - "integrity": "sha512-UswMOyTnPEVRvN5Qzbo+l8k4xrd5fTFu2VPPfD6FcW/6qUtVLmJTQCktbAL3KJ0BVXGm5aJXz/ZrzqFuZERGPw==", - "dependencies": { - "@docusaurus/mdx-loader": "3.8.1", - "@docusaurus/module-type-aliases": "3.8.1", - "@docusaurus/utils": "3.8.1", - "@docusaurus/utils-common": "3.8.1", - "@types/history": "^4.7.11", - "@types/react": "*", - "@types/react-router-config": "*", - "clsx": "^2.0.0", - "parse-numeric-range": "^1.3.0", - "prism-react-renderer": "^2.3.0", - "tslib": "^2.6.0", - "utility-types": "^3.10.0" - }, - "engines": { - "node": ">=18.0" - }, - "peerDependencies": { - "@docusaurus/plugin-content-docs": "*", - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - } - }, - "node_modules/@docusaurus/theme-search-algolia": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-search-algolia/-/theme-search-algolia-3.8.1.tgz", - "integrity": "sha512-NBFH5rZVQRAQM087aYSRKQ9yGEK9eHd+xOxQjqNpxMiV85OhJDD4ZGz6YJIod26Fbooy54UWVdzNU0TFeUUUzQ==", - "dependencies": { - "@docsearch/react": "^3.9.0", - "@docusaurus/core": "3.8.1", - "@docusaurus/logger": "3.8.1", - "@docusaurus/plugin-content-docs": "3.8.1", - "@docusaurus/theme-common": "3.8.1", - "@docusaurus/theme-translations": "3.8.1", - "@docusaurus/utils": "3.8.1", - "@docusaurus/utils-validation": "3.8.1", - "algoliasearch": "^5.17.1", - "algoliasearch-helper": "^3.22.6", - "clsx": "^2.0.0", - "eta": "^2.2.0", - "fs-extra": "^11.1.1", - "lodash": "^4.17.21", - "tslib": "^2.6.0", - "utility-types": "^3.10.0" - }, - "engines": { - "node": ">=18.0" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - } - }, - "node_modules/@docusaurus/theme-translations": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-translations/-/theme-translations-3.8.1.tgz", - "integrity": "sha512-OTp6eebuMcf2rJt4bqnvuwmm3NVXfzfYejL+u/Y1qwKhZPrjPoKWfk1CbOP5xH5ZOPkiAsx4dHdQBRJszK3z2g==", - "dependencies": { - "fs-extra": "^11.1.1", - "tslib": "^2.6.0" - }, - "engines": { - "node": ">=18.0" - } - }, - "node_modules/@docusaurus/types": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/types/-/types-3.8.1.tgz", - "integrity": "sha512-ZPdW5AB+pBjiVrcLuw3dOS6BFlrG0XkS2lDGsj8TizcnREQg3J8cjsgfDviszOk4CweNfwo1AEELJkYaMUuOPg==", - "dependencies": { - "@mdx-js/mdx": "^3.0.0", - "@types/history": "^4.7.11", - "@types/react": "*", - "commander": "^5.1.0", - "joi": "^17.9.2", - "react-helmet-async": "npm:@slorber/react-helmet-async@1.3.0", - "utility-types": "^3.10.0", - "webpack": "^5.95.0", - "webpack-merge": "^5.9.0" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" - } - }, - "node_modules/@docusaurus/types/node_modules/webpack-merge": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.10.0.tgz", - "integrity": "sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==", - "license": "MIT", - "dependencies": { - "clone-deep": "^4.0.1", - "flat": "^5.0.2", - "wildcard": "^2.0.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/@docusaurus/utils": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/utils/-/utils-3.8.1.tgz", - "integrity": "sha512-P1ml0nvOmEFdmu0smSXOqTS1sxU5tqvnc0dA4MTKV39kye+bhQnjkIKEE18fNOvxjyB86k8esoCIFM3x4RykOQ==", - "dependencies": { - "@docusaurus/logger": "3.8.1", - "@docusaurus/types": "3.8.1", - "@docusaurus/utils-common": "3.8.1", - "escape-string-regexp": "^4.0.0", - "execa": "5.1.1", - "file-loader": "^6.2.0", - "fs-extra": "^11.1.1", - "github-slugger": "^1.5.0", - "globby": "^11.1.0", - "gray-matter": "^4.0.3", - "jiti": "^1.20.0", - "js-yaml": "^4.1.0", - "lodash": "^4.17.21", - "micromatch": "^4.0.5", - "p-queue": "^6.6.2", - "prompts": "^2.4.2", - "resolve-pathname": "^3.0.0", - "tslib": "^2.6.0", - "url-loader": "^4.1.1", - "utility-types": "^3.10.0", - "webpack": "^5.88.1" - }, - "engines": { - "node": ">=18.0" - } - }, - "node_modules/@docusaurus/utils-common": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/utils-common/-/utils-common-3.8.1.tgz", - "integrity": "sha512-zTZiDlvpvoJIrQEEd71c154DkcriBecm4z94OzEE9kz7ikS3J+iSlABhFXM45mZ0eN5pVqqr7cs60+ZlYLewtg==", - "dependencies": { - "@docusaurus/types": "3.8.1", - "tslib": "^2.6.0" - }, - "engines": { - "node": ">=18.0" - } - }, - "node_modules/@docusaurus/utils-validation": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@docusaurus/utils-validation/-/utils-validation-3.8.1.tgz", - "integrity": "sha512-gs5bXIccxzEbyVecvxg6upTwaUbfa0KMmTj7HhHzc016AGyxH2o73k1/aOD0IFrdCsfJNt37MqNI47s2MgRZMA==", - "dependencies": { - "@docusaurus/logger": "3.8.1", - "@docusaurus/utils": "3.8.1", - "@docusaurus/utils-common": "3.8.1", - "fs-extra": "^11.2.0", - "joi": "^17.9.2", - "js-yaml": "^4.1.0", - "lodash": "^4.17.21", - "tslib": "^2.6.0" - }, - "engines": { - "node": ">=18.0" - } - }, - "node_modules/@hapi/hoek": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", - "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==" - }, - "node_modules/@hapi/topo": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", - "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", - "dependencies": { - "@hapi/hoek": "^9.0.0" - } - }, - "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", - "dependencies": { - "@sinclair/typebox": "^0.27.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", - "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/source-map": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", - "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@leichtgewicht/ip-codec": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz", - "integrity": "sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==", - "license": "MIT" - }, - "node_modules/@mdx-js/mdx": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.0.1.tgz", - "integrity": "sha512-eIQ4QTrOWyL3LWEe/bu6Taqzq2HQvHcyTMaOrI95P2/LmJE7AsfPfgJGuFLPVqBUE1BC1rik3VIhU+s9u72arA==", - "dependencies": { - "@types/estree": "^1.0.0", - "@types/estree-jsx": "^1.0.0", - "@types/hast": "^3.0.0", - "@types/mdx": "^2.0.0", - "collapse-white-space": "^2.0.0", - "devlop": "^1.0.0", - "estree-util-build-jsx": "^3.0.0", - "estree-util-is-identifier-name": "^3.0.0", - "estree-util-to-js": "^2.0.0", - "estree-walker": "^3.0.0", - "hast-util-to-estree": "^3.0.0", - "hast-util-to-jsx-runtime": "^2.0.0", - "markdown-extensions": "^2.0.0", - "periscopic": "^3.0.0", - "remark-mdx": "^3.0.0", - "remark-parse": "^11.0.0", - "remark-rehype": "^11.0.0", - "source-map": "^0.7.0", - "unified": "^11.0.0", - "unist-util-position-from-estree": "^2.0.0", - "unist-util-stringify-position": "^4.0.0", - "unist-util-visit": "^5.0.0", - "vfile": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/@mdx-js/react": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@mdx-js/react/-/react-3.1.0.tgz", - "integrity": "sha512-QjHtSaoameoalGnKDT3FoIl4+9RwyTmo9ZJGBdLOks/YOiWHoRDI3PUwEzOE7kEmGcV3AFcp9K6dYu9rEuKLAQ==", - "dependencies": { - "@types/mdx": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - }, - "peerDependencies": { - "@types/react": ">=16", - "react": ">=16" - } - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@pnpm/config.env-replace": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", - "integrity": "sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==", - "license": "MIT", - "engines": { - "node": ">=12.22.0" - } - }, - "node_modules/@pnpm/network.ca-file": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.2.tgz", - "integrity": "sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==", - "license": "MIT", - "dependencies": { - "graceful-fs": "4.2.10" - }, - "engines": { - "node": ">=12.22.0" - } - }, - "node_modules/@pnpm/network.ca-file/node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "license": "ISC" - }, - "node_modules/@pnpm/npm-conf": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.3.1.tgz", - "integrity": "sha512-c83qWb22rNRuB0UaVCI0uRPNRr8Z0FWnEIvT47jiHAmOIUHbBOg5XvV7pM5x+rKn9HRpjxquDbXYSXr3fAKFcw==", - "license": "MIT", - "dependencies": { - "@pnpm/config.env-replace": "^1.1.0", - "@pnpm/network.ca-file": "^1.0.1", - "config-chain": "^1.1.11" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@polka/url": { - "version": "1.0.0-next.28", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.28.tgz", - "integrity": "sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==", - "license": "MIT" - }, - "node_modules/@sideway/address": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.5.tgz", - "integrity": "sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==", - "dependencies": { - "@hapi/hoek": "^9.0.0" - } - }, - "node_modules/@sideway/formula": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", - "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==" - }, - "node_modules/@sideway/pinpoint": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", - "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==" - }, - "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==" - }, - "node_modules/@sindresorhus/is": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", - "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, - "node_modules/@slorber/remark-comment": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@slorber/remark-comment/-/remark-comment-1.0.0.tgz", - "integrity": "sha512-RCE24n7jsOj1M0UPvIQCHTe7fI0sFL4S2nwKVWwHyVr/wI/H8GosgsJGyhnsZoGFnD/P2hLf1mSbrrgSLN93NA==", - "license": "MIT", - "dependencies": { - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.1.0", - "micromark-util-symbol": "^1.0.1" - } - }, - "node_modules/@svgr/babel-plugin-add-jsx-attribute": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-8.0.0.tgz", - "integrity": "sha512-b9MIk7yhdS1pMCZM8VeNfUlSKVRhsHZNMl5O9SfaX0l0t5wjdgu4IDzGB8bpnGBBOjGST3rRFVsaaEtI4W6f7g==", - "engines": { - "node": ">=14" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/gregberge" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@svgr/babel-plugin-remove-jsx-attribute": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-attribute/-/babel-plugin-remove-jsx-attribute-8.0.0.tgz", - "integrity": "sha512-BcCkm/STipKvbCl6b7QFrMh/vx00vIP63k2eM66MfHJzPr6O2U0jYEViXkHJWqXqQYjdeA9cuCl5KWmlwjDvbA==", - "engines": { - "node": ">=14" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/gregberge" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@svgr/babel-plugin-remove-jsx-empty-expression": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-empty-expression/-/babel-plugin-remove-jsx-empty-expression-8.0.0.tgz", - "integrity": "sha512-5BcGCBfBxB5+XSDSWnhTThfI9jcO5f0Ai2V24gZpG+wXF14BzwxxdDb4g6trdOux0rhibGs385BeFMSmxtS3uA==", - "engines": { - "node": ">=14" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/gregberge" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@svgr/babel-plugin-replace-jsx-attribute-value": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-replace-jsx-attribute-value/-/babel-plugin-replace-jsx-attribute-value-8.0.0.tgz", - "integrity": "sha512-KVQ+PtIjb1BuYT3ht8M5KbzWBhdAjjUPdlMtpuw/VjT8coTrItWX6Qafl9+ji831JaJcu6PJNKCV0bp01lBNzQ==", - "engines": { - "node": ">=14" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/gregberge" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@svgr/babel-plugin-svg-dynamic-title": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-dynamic-title/-/babel-plugin-svg-dynamic-title-8.0.0.tgz", - "integrity": "sha512-omNiKqwjNmOQJ2v6ge4SErBbkooV2aAWwaPFs2vUY7p7GhVkzRkJ00kILXQvRhA6miHnNpXv7MRnnSjdRjK8og==", - "engines": { - "node": ">=14" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/gregberge" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@svgr/babel-plugin-svg-em-dimensions": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-em-dimensions/-/babel-plugin-svg-em-dimensions-8.0.0.tgz", - "integrity": "sha512-mURHYnu6Iw3UBTbhGwE/vsngtCIbHE43xCRK7kCw4t01xyGqb2Pd+WXekRRoFOBIY29ZoOhUCTEweDMdrjfi9g==", - "engines": { - "node": ">=14" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/gregberge" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@svgr/babel-plugin-transform-react-native-svg": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-react-native-svg/-/babel-plugin-transform-react-native-svg-8.1.0.tgz", - "integrity": "sha512-Tx8T58CHo+7nwJ+EhUwx3LfdNSG9R2OKfaIXXs5soiy5HtgoAEkDay9LIimLOcG8dJQH1wPZp/cnAv6S9CrR1Q==", - "engines": { - "node": ">=14" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/gregberge" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@svgr/babel-plugin-transform-svg-component": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-svg-component/-/babel-plugin-transform-svg-component-8.0.0.tgz", - "integrity": "sha512-DFx8xa3cZXTdb/k3kfPeaixecQLgKh5NVBMwD0AQxOzcZawK4oo1Jh9LbrcACUivsCA7TLG8eeWgrDXjTMhRmw==", - "engines": { - "node": ">=12" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/gregberge" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@svgr/babel-preset": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@svgr/babel-preset/-/babel-preset-8.1.0.tgz", - "integrity": "sha512-7EYDbHE7MxHpv4sxvnVPngw5fuR6pw79SkcrILHJ/iMpuKySNCl5W1qcwPEpU+LgyRXOaAFgH0KhwD18wwg6ug==", - "dependencies": { - "@svgr/babel-plugin-add-jsx-attribute": "8.0.0", - "@svgr/babel-plugin-remove-jsx-attribute": "8.0.0", - "@svgr/babel-plugin-remove-jsx-empty-expression": "8.0.0", - "@svgr/babel-plugin-replace-jsx-attribute-value": "8.0.0", - "@svgr/babel-plugin-svg-dynamic-title": "8.0.0", - "@svgr/babel-plugin-svg-em-dimensions": "8.0.0", - "@svgr/babel-plugin-transform-react-native-svg": "8.1.0", - "@svgr/babel-plugin-transform-svg-component": "8.0.0" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/gregberge" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@svgr/core": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@svgr/core/-/core-8.1.0.tgz", - "integrity": "sha512-8QqtOQT5ACVlmsvKOJNEaWmRPmcojMOzCz4Hs2BGG/toAp/K38LcsMRyLp349glq5AzJbCEeimEoxaX6v/fLrA==", - "dependencies": { - "@babel/core": "^7.21.3", - "@svgr/babel-preset": "8.1.0", - "camelcase": "^6.2.0", - "cosmiconfig": "^8.1.3", - "snake-case": "^3.0.4" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/gregberge" - } - }, - "node_modules/@svgr/hast-util-to-babel-ast": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@svgr/hast-util-to-babel-ast/-/hast-util-to-babel-ast-8.0.0.tgz", - "integrity": "sha512-EbDKwO9GpfWP4jN9sGdYwPBU0kdomaPIL2Eu4YwmgP+sJeXT+L7bMwJUBnhzfH8Q2qMBqZ4fJwpCyYsAN3mt2Q==", - "dependencies": { - "@babel/types": "^7.21.3", - "entities": "^4.4.0" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/gregberge" - } - }, - "node_modules/@svgr/plugin-jsx": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@svgr/plugin-jsx/-/plugin-jsx-8.1.0.tgz", - "integrity": "sha512-0xiIyBsLlr8quN+WyuxooNW9RJ0Dpr8uOnH/xrCVO8GLUcwHISwj1AG0k+LFzteTkAA0GbX0kj9q6Dk70PTiPA==", - "dependencies": { - "@babel/core": "^7.21.3", - "@svgr/babel-preset": "8.1.0", - "@svgr/hast-util-to-babel-ast": "8.0.0", - "svg-parser": "^2.0.4" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/gregberge" - }, - "peerDependencies": { - "@svgr/core": "*" - } - }, - "node_modules/@svgr/plugin-svgo": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@svgr/plugin-svgo/-/plugin-svgo-8.1.0.tgz", - "integrity": "sha512-Ywtl837OGO9pTLIN/onoWLmDQ4zFUycI1g76vuKGEz6evR/ZTJlJuz3G/fIkb6OVBJ2g0o6CGJzaEjfmEo3AHA==", - "dependencies": { - "cosmiconfig": "^8.1.3", - "deepmerge": "^4.3.1", - "svgo": "^3.0.2" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/gregberge" - }, - "peerDependencies": { - "@svgr/core": "*" - } - }, - "node_modules/@svgr/webpack": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@svgr/webpack/-/webpack-8.1.0.tgz", - "integrity": "sha512-LnhVjMWyMQV9ZmeEy26maJk+8HTIbd59cH4F2MJ439k9DqejRisfFNGAPvRYlKETuh9LrImlS8aKsBgKjMA8WA==", - "dependencies": { - "@babel/core": "^7.21.3", - "@babel/plugin-transform-react-constant-elements": "^7.21.3", - "@babel/preset-env": "^7.20.2", - "@babel/preset-react": "^7.18.6", - "@babel/preset-typescript": "^7.21.0", - "@svgr/core": "8.1.0", - "@svgr/plugin-jsx": "8.1.0", - "@svgr/plugin-svgo": "8.1.0" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/gregberge" - } - }, - "node_modules/@szmarczak/http-timer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", - "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", - "license": "MIT", - "dependencies": { - "defer-to-connect": "^2.0.1" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/@trysound/sax": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", - "integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==", - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/@types/acorn": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@types/acorn/-/acorn-4.0.6.tgz", - "integrity": "sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==", - "dependencies": { - "@types/estree": "*" - } - }, - "node_modules/@types/body-parser": { - "version": "1.19.5", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", - "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", - "license": "MIT", - "dependencies": { - "@types/connect": "*", - "@types/node": "*" - } - }, - "node_modules/@types/bonjour": { - "version": "3.5.13", - "resolved": "https://registry.npmjs.org/@types/bonjour/-/bonjour-3.5.13.tgz", - "integrity": "sha512-z9fJ5Im06zvUL548KvYNecEVlA7cVDkGUi6kZusb04mpyEFKCIZJvloCcmpmLaIahDpOQGHaHmG6imtPMmPXGQ==", - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/connect": { - "version": "3.4.38", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", - "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/connect-history-api-fallback": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.5.4.tgz", - "integrity": "sha512-n6Cr2xS1h4uAulPRdlw6Jl6s1oG8KrVilPN2yUITEs+K48EzMJJ3W1xy8K5eWuFvjp3R74AOIGSmp2UfBJ8HFw==", - "license": "MIT", - "dependencies": { - "@types/express-serve-static-core": "*", - "@types/node": "*" - } - }, - "node_modules/@types/debug": { - "version": "4.1.12", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", - "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", - "dependencies": { - "@types/ms": "*" - } - }, - "node_modules/@types/eslint": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", - "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/eslint-scope": { - "version": "3.7.7", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", - "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, - "node_modules/@types/estree": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", - "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==" - }, - "node_modules/@types/estree-jsx": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.5.tgz", - "integrity": "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==", - "dependencies": { - "@types/estree": "*" - } - }, - "node_modules/@types/express": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", - "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", - "license": "MIT", - "dependencies": { - "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.33", - "@types/qs": "*", - "@types/serve-static": "*" - } - }, - "node_modules/@types/express-serve-static-core": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.6.tgz", - "integrity": "sha512-3xhRnjJPkULekpSzgtoNYYcTWgEZkp4myc+Saevii5JPnHNvHMRlBSHDbs7Bh1iPPoVTERHEZXyhyLbMEsExsA==", - "license": "MIT", - "dependencies": { - "@types/node": "*", - "@types/qs": "*", - "@types/range-parser": "*", - "@types/send": "*" - } - }, - "node_modules/@types/express/node_modules/@types/express-serve-static-core": { - "version": "4.19.6", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.6.tgz", - "integrity": "sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==", - "license": "MIT", - "dependencies": { - "@types/node": "*", - "@types/qs": "*", - "@types/range-parser": "*", - "@types/send": "*" - } - }, - "node_modules/@types/gtag.js": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/@types/gtag.js/-/gtag.js-0.0.12.tgz", - "integrity": "sha512-YQV9bUsemkzG81Ea295/nF/5GijnD2Af7QhEofh7xu+kvCN6RdodgNwwGWXB5GMI3NoyvQo0odNctoH/qLMIpg==" - }, - "node_modules/@types/hast": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", - "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", - "dependencies": { - "@types/unist": "*" - } - }, - "node_modules/@types/history": { - "version": "4.7.11", - "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", - "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==" - }, - "node_modules/@types/html-minifier-terser": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz", - "integrity": "sha512-oh/6byDPnL1zeNXFrDXFLyZjkr1MsBG667IM792caf1L2UPOOMf65NFzjUH/ltyfwjAGfs1rsX1eftK0jC/KIg==", - "license": "MIT" - }, - "node_modules/@types/http-cache-semantics": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", - "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==", - "license": "MIT" - }, - "node_modules/@types/http-errors": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", - "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", - "license": "MIT" - }, - "node_modules/@types/http-proxy": { - "version": "1.17.16", - "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.16.tgz", - "integrity": "sha512-sdWoUajOB1cd0A8cRRQ1cfyWNbmFKLAqBB89Y8x5iYyG/mkJHc0YUH8pdWBy2omi9qtCpiIgGjuwO0dQST2l5w==", - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", - "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==" - }, - "node_modules/@types/istanbul-lib-report": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", - "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", - "dependencies": { - "@types/istanbul-lib-coverage": "*" - } - }, - "node_modules/@types/istanbul-reports": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", - "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", - "dependencies": { - "@types/istanbul-lib-report": "*" - } - }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==" - }, - "node_modules/@types/mdast": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", - "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", - "dependencies": { - "@types/unist": "*" - } - }, - "node_modules/@types/mdx": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/@types/mdx/-/mdx-2.0.13.tgz", - "integrity": "sha512-+OWZQfAYyio6YkJb3HLxDrvnx6SWWDbC0zVPfBRzUk0/nqoDyf6dNxQi3eArPe8rJ473nobTMQ/8Zk+LxJ+Yuw==" - }, - "node_modules/@types/mime": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", - "license": "MIT" - }, - "node_modules/@types/ms": { - "version": "0.7.34", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", - "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" - }, - "node_modules/@types/node": { - "version": "20.14.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz", - "integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==", - "dependencies": { - "undici-types": "~5.26.4" - } - }, - "node_modules/@types/node-forge": { - "version": "1.3.11", - "resolved": "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.11.tgz", - "integrity": "sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ==", - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/prismjs": { - "version": "1.26.4", - "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.4.tgz", - "integrity": "sha512-rlAnzkW2sZOjbqZ743IHUhFcvzaGbqijwOu8QZnZCjfQzBqFE3s4lOTJEsxikImav9uzz/42I+O7YUs1mWgMlg==" - }, - "node_modules/@types/prop-types": { - "version": "15.7.12", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.12.tgz", - "integrity": "sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==" - }, - "node_modules/@types/qs": { - "version": "6.9.18", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.18.tgz", - "integrity": "sha512-kK7dgTYDyGqS+e2Q4aK9X3D7q234CIZ1Bv0q/7Z5IwRDoADNU81xXJK/YVyLbLTZCoIwUoDoffFeF+p/eIklAA==", - "license": "MIT" - }, - "node_modules/@types/range-parser": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", - "license": "MIT" - }, - "node_modules/@types/react": { - "version": "18.3.3", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.3.tgz", - "integrity": "sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==", - "dependencies": { - "@types/prop-types": "*", - "csstype": "^3.0.2" - } - }, - "node_modules/@types/react-router": { - "version": "5.1.20", - "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz", - "integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*" - } - }, - "node_modules/@types/react-router-config": { - "version": "5.0.11", - "resolved": "https://registry.npmjs.org/@types/react-router-config/-/react-router-config-5.0.11.tgz", - "integrity": "sha512-WmSAg7WgqW7m4x8Mt4N6ZyKz0BubSj/2tVUMsAHp+Yd2AMwcSbeFq9WympT19p5heCFmF97R9eD5uUR/t4HEqw==", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*", - "@types/react-router": "^5.1.0" - } - }, - "node_modules/@types/react-router-dom": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", - "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", - "license": "MIT", - "dependencies": { - "@types/history": "^4.7.11", - "@types/react": "*", - "@types/react-router": "*" - } - }, - "node_modules/@types/retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==", - "license": "MIT" - }, - "node_modules/@types/sax": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@types/sax/-/sax-1.2.7.tgz", - "integrity": "sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/send": { - "version": "0.17.4", - "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", - "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", - "license": "MIT", - "dependencies": { - "@types/mime": "^1", - "@types/node": "*" - } - }, - "node_modules/@types/serve-index": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.4.tgz", - "integrity": "sha512-qLpGZ/c2fhSs5gnYsQxtDEq3Oy8SXPClIXkW5ghvAvsNuVSA8k+gCONcUCS/UjLEYvYps+e8uBtfgXgvhwfNug==", - "license": "MIT", - "dependencies": { - "@types/express": "*" - } - }, - "node_modules/@types/serve-static": { - "version": "1.15.7", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", - "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", - "license": "MIT", - "dependencies": { - "@types/http-errors": "*", - "@types/node": "*", - "@types/send": "*" - } - }, - "node_modules/@types/sockjs": { - "version": "0.3.36", - "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.36.tgz", - "integrity": "sha512-MK9V6NzAS1+Ud7JV9lJLFqW85VbC9dq3LmwZCuBe4wBDgKC0Kj/jd8Xl+nSviU+Qc3+m7umHHyHg//2KSa0a0Q==", - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/unist": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", - "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==" - }, - "node_modules/@types/ws": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.0.tgz", - "integrity": "sha512-8svvI3hMyvN0kKCJMvTJP/x6Y/EoQbepff882wL+Sn5QsXb3etnamgrJq4isrBxSJj5L2AuXcI0+bgkoAXGUJw==", - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/yargs": { - "version": "17.0.33", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", - "integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/@types/yargs-parser": { - "version": "21.0.3", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", - "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==" - }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" - }, - "node_modules/@webassemblyjs/ast": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", - "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", - "dependencies": { - "@webassemblyjs/helper-numbers": "1.11.6", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6" - } - }, - "node_modules/@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", - "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==" - }, - "node_modules/@webassemblyjs/helper-api-error": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", - "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==" - }, - "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", - "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==" - }, - "node_modules/@webassemblyjs/helper-numbers": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", - "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", - "dependencies": { - "@webassemblyjs/floating-point-hex-parser": "1.11.6", - "@webassemblyjs/helper-api-error": "1.11.6", - "@xtuc/long": "4.2.2" - } - }, - "node_modules/@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", - "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==" - }, - "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", - "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", - "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@webassemblyjs/helper-buffer": "1.12.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/wasm-gen": "1.12.1" - } - }, - "node_modules/@webassemblyjs/ieee754": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", - "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", - "dependencies": { - "@xtuc/ieee754": "^1.2.0" - } - }, - "node_modules/@webassemblyjs/leb128": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", - "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", - "dependencies": { - "@xtuc/long": "4.2.2" - } - }, - "node_modules/@webassemblyjs/utf8": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", - "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==" - }, - "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", - "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", - "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@webassemblyjs/helper-buffer": "1.12.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/helper-wasm-section": "1.12.1", - "@webassemblyjs/wasm-gen": "1.12.1", - "@webassemblyjs/wasm-opt": "1.12.1", - "@webassemblyjs/wasm-parser": "1.12.1", - "@webassemblyjs/wast-printer": "1.12.1" - } - }, - "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", - "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", - "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/ieee754": "1.11.6", - "@webassemblyjs/leb128": "1.11.6", - "@webassemblyjs/utf8": "1.11.6" - } - }, - "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", - "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", - "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@webassemblyjs/helper-buffer": "1.12.1", - "@webassemblyjs/wasm-gen": "1.12.1", - "@webassemblyjs/wasm-parser": "1.12.1" - } - }, - "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", - "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", - "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@webassemblyjs/helper-api-error": "1.11.6", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/ieee754": "1.11.6", - "@webassemblyjs/leb128": "1.11.6", - "@webassemblyjs/utf8": "1.11.6" - } - }, - "node_modules/@webassemblyjs/wast-printer": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", - "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", - "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@xtuc/long": "4.2.2" - } - }, - "node_modules/@xtuc/ieee754": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==" - }, - "node_modules/@xtuc/long": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==" - }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "license": "MIT", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/accepts/node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/accepts/node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/accepts/node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/acorn": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", - "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/acorn-walk": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", - "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", - "license": "MIT", - "dependencies": { - "acorn": "^8.11.0" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/address": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/address/-/address-1.2.2.tgz", - "integrity": "sha512-4B/qKCfeE/ODUaAUpSwfzazo5x29WD4r3vXiWsB7I2mSDAihwEqKO+g8GELZUQSSAo5e1XTYh3ZVfLyxBc12nA==", - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "license": "MIT", - "dependencies": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ajv-formats": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", - "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", - "license": "MIT", - "dependencies": { - "ajv": "^8.0.0" - }, - "peerDependencies": { - "ajv": "^8.0.0" - }, - "peerDependenciesMeta": { - "ajv": { - "optional": true - } - } - }, - "node_modules/ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.3" - }, - "peerDependencies": { - "ajv": "^8.8.2" - } - }, - "node_modules/algoliasearch": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-5.30.0.tgz", - "integrity": "sha512-ILSdPX4je0n5WUKD34TMe57/eqiXUzCIjAsdtLQYhomqOjTtFUg1s6dE7kUegc4Mc43Xr7IXYlMutU9HPiYfdw==", - "dependencies": { - "@algolia/client-abtesting": "5.30.0", - "@algolia/client-analytics": "5.30.0", - "@algolia/client-common": "5.30.0", - "@algolia/client-insights": "5.30.0", - "@algolia/client-personalization": "5.30.0", - "@algolia/client-query-suggestions": "5.30.0", - "@algolia/client-search": "5.30.0", - "@algolia/ingestion": "1.30.0", - "@algolia/monitoring": "1.30.0", - "@algolia/recommend": "5.30.0", - "@algolia/requester-browser-xhr": "5.30.0", - "@algolia/requester-fetch": "5.30.0", - "@algolia/requester-node-http": "5.30.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/algoliasearch-helper": { - "version": "3.26.0", - "resolved": "https://registry.npmjs.org/algoliasearch-helper/-/algoliasearch-helper-3.26.0.tgz", - "integrity": "sha512-Rv2x3GXleQ3ygwhkhJubhhYGsICmShLAiqtUuJTUkr9uOCOXyF2E71LVT4XDnVffbknv8XgScP4U0Oxtgm+hIw==", - "dependencies": { - "@algolia/events": "^4.0.1" - }, - "peerDependencies": { - "algoliasearch": ">= 3.1 < 6" - } - }, - "node_modules/ansi-align": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", - "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", - "license": "ISC", - "dependencies": { - "string-width": "^4.1.0" - } - }, - "node_modules/ansi-align/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "license": "MIT" - }, - "node_modules/ansi-align/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "dependencies": { - "type-fest": "^0.21.3" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ansi-escapes/node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ansi-html-community": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz", - "integrity": "sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==", - "engines": [ - "node >= 0.8.0" - ], - "license": "Apache-2.0", - "bin": { - "ansi-html": "bin/ansi-html" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "license": "ISC", - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/arg": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", - "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==" - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", - "license": "MIT" - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "engines": { - "node": ">=8" - } - }, - "node_modules/astring": { - "version": "1.8.6", - "resolved": "https://registry.npmjs.org/astring/-/astring-1.8.6.tgz", - "integrity": "sha512-ISvCdHdlTDlH5IpxQJIex7BWBywFWgjJSVdwst+/iQCoEYnyOaQ95+X1JGshuBjGp6nxKUy1jMgE3zPqN7fQdg==", - "bin": { - "astring": "bin/astring" - } - }, - "node_modules/autoprefixer": { - "version": "10.4.21", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.21.tgz", - "integrity": "sha512-O+A6LWV5LDHSJD3LjHYoNi4VLsj/Whi7k6zG12xTYaU4cQ8oxQGckXNX8cRHK5yOZ/ppVHe0ZBXGzSV9jXdVbQ==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/autoprefixer" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "browserslist": "^4.24.4", - "caniuse-lite": "^1.0.30001702", - "fraction.js": "^4.3.7", - "normalize-range": "^0.1.2", - "picocolors": "^1.1.1", - "postcss-value-parser": "^4.2.0" - }, - "bin": { - "autoprefixer": "bin/autoprefixer" - }, - "engines": { - "node": "^10 || ^12 || >=14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/babel-loader": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-9.2.1.tgz", - "integrity": "sha512-fqe8naHt46e0yIdkjUZYqddSXfej3AHajX+CSO5X7oy0EmPc6o5Xh+RClNoHjnieWz9AW4kZxW9yyFMhVB1QLA==", - "dependencies": { - "find-cache-dir": "^4.0.0", - "schema-utils": "^4.0.0" - }, - "engines": { - "node": ">= 14.15.0" - }, - "peerDependencies": { - "@babel/core": "^7.12.0", - "webpack": ">=5" - } - }, - "node_modules/babel-plugin-dynamic-import-node": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", - "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", - "dependencies": { - "object.assign": "^4.1.0" - } - }, - "node_modules/babel-plugin-polyfill-corejs2": { - "version": "0.4.11", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.11.tgz", - "integrity": "sha512-sMEJ27L0gRHShOh5G54uAAPaiCOygY/5ratXuiyb2G46FmlSpc9eFCzYVyDiPxfNbwzA7mYahmjQc5q+CZQ09Q==", - "dependencies": { - "@babel/compat-data": "^7.22.6", - "@babel/helper-define-polyfill-provider": "^0.6.2", - "semver": "^6.3.1" - }, - "peerDependencies": { - "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" - } - }, - "node_modules/babel-plugin-polyfill-corejs2/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.10.6", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.6.tgz", - "integrity": "sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA==", - "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.6.2", - "core-js-compat": "^3.38.0" - }, - "peerDependencies": { - "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" - } - }, - "node_modules/babel-plugin-polyfill-regenerator": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.2.tgz", - "integrity": "sha512-2R25rQZWP63nGwaAswvDazbPXfrM3HwVoBXK6HcqeKrSrL/JqcC/rDcf95l4r7LXLyxDXc8uQDa064GubtCABg==", - "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.6.2" - }, - "peerDependencies": { - "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" - } - }, - "node_modules/bail": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", - "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "node_modules/batch": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", - "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==", - "license": "MIT" - }, - "node_modules/big.js": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", - "engines": { - "node": "*" - } - }, - "node_modules/binary-extensions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", - "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/body-parser": { - "version": "1.20.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", - "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", - "license": "MIT", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.13.0", - "raw-body": "2.5.2", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/body-parser/node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/body-parser/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/body-parser/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT" - }, - "node_modules/bonjour-service": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.3.0.tgz", - "integrity": "sha512-3YuAUiSkWykd+2Azjgyxei8OWf8thdn8AITIog2M4UICzoqfjlqr64WIjEXZllf/W6vK1goqleSR6brGomxQqA==", - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.3", - "multicast-dns": "^7.2.5" - } - }, - "node_modules/boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" - }, - "node_modules/boxen": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-6.2.1.tgz", - "integrity": "sha512-H4PEsJXfFI/Pt8sjDWbHlQPx4zL/bvSQjcilJmaulGt5mLDorHOHpmdXAJcBcmru7PhYSp/cDMWRko4ZUMFkSw==", - "license": "MIT", - "dependencies": { - "ansi-align": "^3.0.1", - "camelcase": "^6.2.0", - "chalk": "^4.1.2", - "cli-boxes": "^3.0.0", - "string-width": "^5.0.1", - "type-fest": "^2.5.0", - "widest-line": "^4.0.1", - "wrap-ansi": "^8.0.1" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/browserslist": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.0.tgz", - "integrity": "sha512-PJ8gYKeS5e/whHBh8xrwYK+dAvEj7JXtz6uTucnMRB8OiGTsKccFekoRrjajPBHV8oOY+2tI4uxeceSimKwMFA==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "caniuse-lite": "^1.0.30001718", - "electron-to-chromium": "^1.5.160", - "node-releases": "^2.0.19", - "update-browserslist-db": "^1.1.3" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" - }, - "node_modules/bytes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/cacheable-lookup": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", - "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", - "license": "MIT", - "engines": { - "node": ">=14.16" - } - }, - "node_modules/cacheable-request": { - "version": "10.2.14", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", - "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", - "license": "MIT", - "dependencies": { - "@types/http-cache-semantics": "^4.0.2", - "get-stream": "^6.0.1", - "http-cache-semantics": "^4.1.1", - "keyv": "^4.5.3", - "mimic-response": "^4.0.0", - "normalize-url": "^8.0.0", - "responselike": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/call-bind": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", - "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", - "dependencies": { - "call-bind-apply-helpers": "^1.0.0", - "es-define-property": "^1.0.0", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/call-bound": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", - "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "get-intrinsic": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "engines": { - "node": ">=6" - } - }, - "node_modules/camel-case": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", - "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", - "license": "MIT", - "dependencies": { - "pascal-case": "^3.1.2", - "tslib": "^2.0.3" - } - }, - "node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/caniuse-api": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz", - "integrity": "sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==", - "dependencies": { - "browserslist": "^4.0.0", - "caniuse-lite": "^1.0.0", - "lodash.memoize": "^4.1.2", - "lodash.uniq": "^4.5.0" - } - }, - "node_modules/caniuse-lite": { - "version": "1.0.30001720", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001720.tgz", - "integrity": "sha512-Ec/2yV2nNPwb4DnTANEV99ZWwm3ZWfdlfkQbWSDDt+PsXEVYwlhPH8tdMaPunYTKKmz7AnHi2oNEi1GcmKCD8g==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "CC-BY-4.0" - }, - "node_modules/ccount": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", - "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/char-regex": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", - "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", - "license": "MIT", - "engines": { - "node": ">=10" - } - }, - "node_modules/character-entities": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", - "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/character-entities-html4": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", - "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/character-entities-legacy": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", - "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/character-reference-invalid": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz", - "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/cheerio": { - "version": "1.0.0-rc.12", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", - "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", - "dependencies": { - "cheerio-select": "^2.1.0", - "dom-serializer": "^2.0.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1", - "htmlparser2": "^8.0.1", - "parse5": "^7.0.0", - "parse5-htmlparser2-tree-adapter": "^7.0.0" - }, - "engines": { - "node": ">= 6" - }, - "funding": { - "url": "https://github.com/cheeriojs/cheerio?sponsor=1" - } - }, - "node_modules/cheerio-select": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", - "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", - "dependencies": { - "boolbase": "^1.0.0", - "css-select": "^5.1.0", - "css-what": "^6.1.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/chokidar": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", - "license": "MIT", - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/chrome-trace-event": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", - "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", - "engines": { - "node": ">=6.0" - } - }, - "node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/clean-css": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.3.tgz", - "integrity": "sha512-D5J+kHaVb/wKSFcyyV75uCn8fiY4sV38XJoe4CUyGQ+mOU/fMVYUdH1hJC+CJQ5uY3EnW27SbJYS4X8BiLrAFg==", - "license": "MIT", - "dependencies": { - "source-map": "~0.6.0" - }, - "engines": { - "node": ">= 10.0" - } - }, - "node_modules/clean-css/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/cli-boxes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz", - "integrity": "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==", - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-table3": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", - "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", - "license": "MIT", - "dependencies": { - "string-width": "^4.2.0" - }, - "engines": { - "node": "10.* || >= 12.*" - }, - "optionalDependencies": { - "@colors/colors": "1.5.0" - } - }, - "node_modules/cli-table3/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "license": "MIT" - }, - "node_modules/cli-table3/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/clone-deep": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", - "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", - "dependencies": { - "is-plain-object": "^2.0.4", - "kind-of": "^6.0.2", - "shallow-clone": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/clsx": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", - "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", - "engines": { - "node": ">=6" - } - }, - "node_modules/collapse-white-space": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-2.1.0.tgz", - "integrity": "sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/colord": { - "version": "2.9.3", - "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", - "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==" - }, - "node_modules/colorette": { - "version": "2.0.20", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", - "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "license": "MIT" - }, - "node_modules/combine-promises": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/combine-promises/-/combine-promises-1.2.0.tgz", - "integrity": "sha512-VcQB1ziGD0NXrhKxiwyNbCDmRzs/OShMs2GqW2DlU2A/Sd0nQxE1oWDAE5O0ygSx5mgQOn9eIFh7yKPgFRVkPQ==", - "engines": { - "node": ">=10" - } - }, - "node_modules/comma-separated-tokens": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", - "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/commander": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", - "engines": { - "node": ">= 6" - } - }, - "node_modules/common-path-prefix": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz", - "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==" - }, - "node_modules/compressible": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", - "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", - "license": "MIT", - "dependencies": { - "mime-db": ">= 1.43.0 < 2" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/compressible/node_modules/mime-db": { - "version": "1.53.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.53.0.tgz", - "integrity": "sha512-oHlN/w+3MQ3rba9rqFr6V/ypF10LSkdwUysQL7GkXoTgIWeV+tcXGA852TBxH+gsh8UWoyhR1hKcoMJTuWflpg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/compression": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.8.1.tgz", - "integrity": "sha512-9mAqGPHLakhCLeNyxPkK4xVo746zQ/czLH1Ky+vkitMnWfWZps8r0qXuwhwizagCRttsL4lfG4pIOvaWLpAP0w==", - "license": "MIT", - "dependencies": { - "bytes": "3.1.2", - "compressible": "~2.0.18", - "debug": "2.6.9", - "negotiator": "~0.6.4", - "on-headers": "~1.1.0", - "safe-buffer": "5.2.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/compression/node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/compression/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/compression/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT" - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, - "node_modules/config-chain": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", - "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", - "license": "MIT", - "dependencies": { - "ini": "^1.3.4", - "proto-list": "~1.2.1" - } - }, - "node_modules/configstore": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-6.0.0.tgz", - "integrity": "sha512-cD31W1v3GqUlQvbBCGcXmd2Nj9SvLDOP1oQ0YFuLETufzSPaKp11rYBsSOm7rCsW3OnIRAFM3OxRhceaXNYHkA==", - "license": "BSD-2-Clause", - "dependencies": { - "dot-prop": "^6.0.1", - "graceful-fs": "^4.2.6", - "unique-string": "^3.0.0", - "write-file-atomic": "^3.0.3", - "xdg-basedir": "^5.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/yeoman/configstore?sponsor=1" - } - }, - "node_modules/connect-history-api-fallback": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz", - "integrity": "sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA==", - "license": "MIT", - "engines": { - "node": ">=0.8" - } - }, - "node_modules/consola": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", - "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", - "engines": { - "node": "^14.18.0 || >=16.10.0" - } - }, - "node_modules/content-disposition": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", - "integrity": "sha512-kRGRZw3bLlFISDBgwTSA1TMBFN6J6GWDeubmDE3AF+3+yXL8hTWv8r5rkLbqYXY4RjPk/EzHnClI3zQf1cFmHA==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" - }, - "node_modules/cookie": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", - "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", - "license": "MIT" - }, - "node_modules/copy-text-to-clipboard": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.0.tgz", - "integrity": "sha512-RnJFp1XR/LOBDckxTib5Qjr/PMfkatD0MUCQgdpqS8MdKiNUzBjAQBEN6oUy+jW7LI93BBG3DtMB2KOOKpGs2Q==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/copy-webpack-plugin": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-11.0.0.tgz", - "integrity": "sha512-fX2MWpamkW0hZxMEg0+mYnA40LTosOSa5TqZ9GYIBzyJa9C3QUaMPSE2xAi/buNr8u89SfD9wHSQVBzrRa/SOQ==", - "dependencies": { - "fast-glob": "^3.2.11", - "glob-parent": "^6.0.1", - "globby": "^13.1.1", - "normalize-path": "^3.0.0", - "schema-utils": "^4.0.0", - "serialize-javascript": "^6.0.0" - }, - "engines": { - "node": ">= 14.15.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^5.1.0" - } - }, - "node_modules/copy-webpack-plugin/node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/copy-webpack-plugin/node_modules/globby": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", - "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", - "dependencies": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.3.0", - "ignore": "^5.2.4", - "merge2": "^1.4.1", - "slash": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/copy-webpack-plugin/node_modules/slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/core-js": { - "version": "3.41.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.41.0.tgz", - "integrity": "sha512-SJ4/EHwS36QMJd6h/Rg+GyR4A5xE0FSI3eZ+iBVpfqf1x0eTSg1smWLHrA+2jQThZSh97fmSgFSU8B61nxosxA==", - "hasInstallScript": true, - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, - "node_modules/core-js-compat": { - "version": "3.42.0", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.42.0.tgz", - "integrity": "sha512-bQasjMfyDGyaeWKBIu33lHh9qlSR0MFE/Nmc6nMjf/iU9b3rSMdAYz1Baxrv4lPdGUsTqZudHA4jIGSJy0SWZQ==", - "license": "MIT", - "dependencies": { - "browserslist": "^4.24.4" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, - "node_modules/core-js-pure": { - "version": "3.43.0", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.43.0.tgz", - "integrity": "sha512-i/AgxU2+A+BbJdMxh3v7/vxi2SbFqxiFmg6VsDwYB4jkucrd1BZNA9a9gphC0fYMG5IBSgQcbQnk865VCLe7xA==", - "hasInstallScript": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "license": "MIT" - }, - "node_modules/cosmiconfig": { - "version": "8.3.6", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz", - "integrity": "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==", - "dependencies": { - "import-fresh": "^3.3.0", - "js-yaml": "^4.1.0", - "parse-json": "^5.2.0", - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/d-fischer" - }, - "peerDependencies": { - "typescript": ">=4.9.5" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/crypto-random-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", - "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", - "license": "MIT", - "dependencies": { - "type-fest": "^1.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/crypto-random-string/node_modules/type-fest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/css-blank-pseudo": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/css-blank-pseudo/-/css-blank-pseudo-7.0.1.tgz", - "integrity": "sha512-jf+twWGDf6LDoXDUode+nc7ZlrqfaNphrBIBrcmeP3D8yw1uPaix1gCC8LUQUGQ6CycuK2opkbFFWFuq/a94ag==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "postcss-selector-parser": "^7.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/css-blank-pseudo/node_modules/postcss-selector-parser": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", - "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/css-declaration-sorter": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-7.2.0.tgz", - "integrity": "sha512-h70rUM+3PNFuaBDTLe8wF/cdWu+dOZmb7pJt8Z2sedYbAcQVQV/tEchueg3GWxwqS0cxtbxmaHEdkNACqcvsow==", - "engines": { - "node": "^14 || ^16 || >=18" - }, - "peerDependencies": { - "postcss": "^8.0.9" - } - }, - "node_modules/css-has-pseudo": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/css-has-pseudo/-/css-has-pseudo-7.0.2.tgz", - "integrity": "sha512-nzol/h+E0bId46Kn2dQH5VElaknX2Sr0hFuB/1EomdC7j+OISt2ZzK7EHX9DZDY53WbIVAR7FYKSO2XnSf07MQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/selector-specificity": "^5.0.0", - "postcss-selector-parser": "^7.0.0", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/css-has-pseudo/node_modules/@csstools/selector-specificity": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-5.0.0.tgz", - "integrity": "sha512-PCqQV3c4CoVm3kdPhyeZ07VmBRdH2EpMFA/pd9OASpOEC3aXNGoqPDAZ80D0cLpMBxnmk0+yNhGsEx31hq7Gtw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss-selector-parser": "^7.0.0" - } - }, - "node_modules/css-has-pseudo/node_modules/postcss-selector-parser": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", - "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/css-loader": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.11.0.tgz", - "integrity": "sha512-CTJ+AEQJjq5NzLga5pE39qdiSV56F8ywCIsqNIRF0r7BDgWsN25aazToqAFg7ZrtA/U016xudB3ffgweORxX7g==", - "dependencies": { - "icss-utils": "^5.1.0", - "postcss": "^8.4.33", - "postcss-modules-extract-imports": "^3.1.0", - "postcss-modules-local-by-default": "^4.0.5", - "postcss-modules-scope": "^3.2.0", - "postcss-modules-values": "^4.0.0", - "postcss-value-parser": "^4.2.0", - "semver": "^7.5.4" - }, - "engines": { - "node": ">= 12.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "@rspack/core": "0.x || 1.x", - "webpack": "^5.0.0" - }, - "peerDependenciesMeta": { - "@rspack/core": { - "optional": true - }, - "webpack": { - "optional": true - } - } - }, - "node_modules/css-minimizer-webpack-plugin": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/css-minimizer-webpack-plugin/-/css-minimizer-webpack-plugin-5.0.1.tgz", - "integrity": "sha512-3caImjKFQkS+ws1TGcFn0V1HyDJFq1Euy589JlD6/3rV2kj+w7r5G9WDMgSHvpvXHNZ2calVypZWuEDQd9wfLg==", - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.18", - "cssnano": "^6.0.1", - "jest-worker": "^29.4.3", - "postcss": "^8.4.24", - "schema-utils": "^4.0.1", - "serialize-javascript": "^6.0.1" - }, - "engines": { - "node": ">= 14.15.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^5.0.0" - }, - "peerDependenciesMeta": { - "@parcel/css": { - "optional": true - }, - "@swc/css": { - "optional": true - }, - "clean-css": { - "optional": true - }, - "csso": { - "optional": true - }, - "esbuild": { - "optional": true - }, - "lightningcss": { - "optional": true - } - } - }, - "node_modules/css-prefers-color-scheme": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/css-prefers-color-scheme/-/css-prefers-color-scheme-10.0.0.tgz", - "integrity": "sha512-VCtXZAWivRglTZditUfB4StnsWr6YVZ2PRtuxQLKTNRdtAf8tpzaVPE9zXIF3VaSc7O70iK/j1+NXxyQCqdPjQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/css-select": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", - "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", - "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^6.1.0", - "domhandler": "^5.0.2", - "domutils": "^3.0.1", - "nth-check": "^2.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/css-tree": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", - "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", - "dependencies": { - "mdn-data": "2.0.30", - "source-map-js": "^1.0.1" - }, - "engines": { - "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" - } - }, - "node_modules/css-what": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", - "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", - "engines": { - "node": ">= 6" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/cssdb": { - "version": "8.3.1", - "resolved": "https://registry.npmjs.org/cssdb/-/cssdb-8.3.1.tgz", - "integrity": "sha512-XnDRQMXucLueX92yDe0LPKupXetWoFOgawr4O4X41l5TltgK2NVbJJVDnnOywDYfW1sTJ28AcXGKOqdRKwCcmQ==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - }, - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - } - ] - }, - "node_modules/cssesc": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", - "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", - "bin": { - "cssesc": "bin/cssesc" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/cssnano": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-6.1.2.tgz", - "integrity": "sha512-rYk5UeX7VAM/u0lNqewCdasdtPK81CgX8wJFLEIXHbV2oldWRgJAsZrdhRXkV1NJzA2g850KiFm9mMU2HxNxMA==", - "dependencies": { - "cssnano-preset-default": "^6.1.2", - "lilconfig": "^3.1.1" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/cssnano" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/cssnano-preset-advanced": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/cssnano-preset-advanced/-/cssnano-preset-advanced-6.1.2.tgz", - "integrity": "sha512-Nhao7eD8ph2DoHolEzQs5CfRpiEP0xa1HBdnFZ82kvqdmbwVBUr2r1QuQ4t1pi+D1ZpqpcO4T+wy/7RxzJ/WPQ==", - "dependencies": { - "autoprefixer": "^10.4.19", - "browserslist": "^4.23.0", - "cssnano-preset-default": "^6.1.2", - "postcss-discard-unused": "^6.0.5", - "postcss-merge-idents": "^6.0.3", - "postcss-reduce-idents": "^6.0.3", - "postcss-zindex": "^6.0.2" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/cssnano-preset-default": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-6.1.2.tgz", - "integrity": "sha512-1C0C+eNaeN8OcHQa193aRgYexyJtU8XwbdieEjClw+J9d94E41LwT6ivKH0WT+fYwYWB0Zp3I3IZ7tI/BbUbrg==", - "dependencies": { - "browserslist": "^4.23.0", - "css-declaration-sorter": "^7.2.0", - "cssnano-utils": "^4.0.2", - "postcss-calc": "^9.0.1", - "postcss-colormin": "^6.1.0", - "postcss-convert-values": "^6.1.0", - "postcss-discard-comments": "^6.0.2", - "postcss-discard-duplicates": "^6.0.3", - "postcss-discard-empty": "^6.0.3", - "postcss-discard-overridden": "^6.0.2", - "postcss-merge-longhand": "^6.0.5", - "postcss-merge-rules": "^6.1.1", - "postcss-minify-font-values": "^6.1.0", - "postcss-minify-gradients": "^6.0.3", - "postcss-minify-params": "^6.1.0", - "postcss-minify-selectors": "^6.0.4", - "postcss-normalize-charset": "^6.0.2", - "postcss-normalize-display-values": "^6.0.2", - "postcss-normalize-positions": "^6.0.2", - "postcss-normalize-repeat-style": "^6.0.2", - "postcss-normalize-string": "^6.0.2", - "postcss-normalize-timing-functions": "^6.0.2", - "postcss-normalize-unicode": "^6.1.0", - "postcss-normalize-url": "^6.0.2", - "postcss-normalize-whitespace": "^6.0.2", - "postcss-ordered-values": "^6.0.2", - "postcss-reduce-initial": "^6.1.0", - "postcss-reduce-transforms": "^6.0.2", - "postcss-svgo": "^6.0.3", - "postcss-unique-selectors": "^6.0.4" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/cssnano-utils": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-4.0.2.tgz", - "integrity": "sha512-ZR1jHg+wZ8o4c3zqf1SIUSTIvm/9mU343FMR6Obe/unskbvpGhZOo1J6d/r8D1pzkRQYuwbcH3hToOuoA2G7oQ==", - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/csso": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", - "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==", - "dependencies": { - "css-tree": "~2.2.0" - }, - "engines": { - "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/csso/node_modules/css-tree": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz", - "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==", - "dependencies": { - "mdn-data": "2.0.28", - "source-map-js": "^1.0.1" - }, - "engines": { - "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/csso/node_modules/mdn-data": { - "version": "2.0.28", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", - "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==" - }, - "node_modules/csstype": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", - "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" - }, - "node_modules/debounce": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz", - "integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==", - "license": "MIT" - }, - "node_modules/debug": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", - "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/decode-named-character-reference": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.0.2.tgz", - "integrity": "sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==", - "dependencies": { - "character-entities": "^2.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "license": "MIT", - "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/decompress-response/node_modules/mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "license": "MIT", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/deepmerge": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/default-gateway": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-6.0.3.tgz", - "integrity": "sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==", - "license": "BSD-2-Clause", - "dependencies": { - "execa": "^5.0.0" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/defer-to-connect": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", - "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", - "license": "MIT", - "engines": { - "node": ">=10" - } - }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/define-lazy-prop": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", - "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/define-properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", - "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "dependencies": { - "define-data-property": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/dequal": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", - "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", - "engines": { - "node": ">=6" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "license": "MIT", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/detect-node": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", - "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", - "license": "MIT" - }, - "node_modules/detect-port": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/detect-port/-/detect-port-1.6.1.tgz", - "integrity": "sha512-CmnVc+Hek2egPx1PeTFVta2W78xy2K/9Rkf6cC4T59S50tVnzKj+tnx5mmx5lwvCkujZ4uRrpRSuV+IVs3f90Q==", - "license": "MIT", - "dependencies": { - "address": "^1.0.1", - "debug": "4" - }, - "bin": { - "detect": "bin/detect-port.js", - "detect-port": "bin/detect-port.js" - }, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/devlop": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", - "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", - "dependencies": { - "dequal": "^2.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/dns-packet": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.1.tgz", - "integrity": "sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==", - "license": "MIT", - "dependencies": { - "@leichtgewicht/ip-codec": "^2.0.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/docusaurus-theme-github-codeblock": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/docusaurus-theme-github-codeblock/-/docusaurus-theme-github-codeblock-2.0.2.tgz", - "integrity": "sha512-H2WoQPWOLjGZO6KS58Gsd+eUVjTFJemkReiSSu9chqokyLc/3Ih3+zPRYfuEZ/HsDvSMIarf7CNcp+Vt+/G+ig==", - "dependencies": { - "@docusaurus/types": "^3.0.0" - } - }, - "node_modules/dom-converter": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz", - "integrity": "sha512-gd3ypIPfOMr9h5jIKq8E3sHOTCjeirnl0WK5ZdS1AW0Odt0b1PaWaHdJ4Qk4klv+YB9aJBS7mESXjFoDQPu6DA==", - "license": "MIT", - "dependencies": { - "utila": "~0.4" - } - }, - "node_modules/dom-serializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", - "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", - "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "entities": "^4.2.0" - }, - "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" - } - }, - "node_modules/domelementtype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", - "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ] - }, - "node_modules/domhandler": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", - "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", - "dependencies": { - "domelementtype": "^2.3.0" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" - } - }, - "node_modules/domutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", - "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", - "dependencies": { - "dom-serializer": "^2.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3" - }, - "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" - } - }, - "node_modules/dot-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", - "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/dot-prop": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", - "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", - "license": "MIT", - "dependencies": { - "is-obj": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/dot-prop/node_modules/is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/duplexer": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", - "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", - "license": "MIT" - }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "license": "MIT" - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "license": "MIT" - }, - "node_modules/electron-to-chromium": { - "version": "1.5.161", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.161.tgz", - "integrity": "sha512-hwtetwfKNZo/UlwHIVBlKZVdy7o8bIZxxKs0Mv/ROPiQQQmDgdm5a+KvKtBsxM8ZjFzTaCeLoodZ8jiBE3o9rA==", - "license": "ISC" - }, - "node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "license": "MIT" - }, - "node_modules/emojilib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/emojilib/-/emojilib-2.4.0.tgz", - "integrity": "sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==", - "license": "MIT" - }, - "node_modules/emojis-list": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", - "engines": { - "node": ">= 4" - } - }, - "node_modules/emoticon": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/emoticon/-/emoticon-4.1.0.tgz", - "integrity": "sha512-VWZfnxqwNcc51hIy/sbOdEem6D+cVtpPzEEtVAFdaas30+1dgkyaOQ4sQ6Bp0tOMqWO1v+HQfYaoodOkdhK6SQ==", - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/encodeurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/enhanced-resolve": { - "version": "5.17.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", - "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", - "dependencies": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dependencies": { - "is-arrayish": "^0.2.1" - } - }, - "node_modules/es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-module-lexer": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", - "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==" - }, - "node_modules/es-object-atoms": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", - "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-goat": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-4.0.0.tgz", - "integrity": "sha512-2Sd4ShcWxbx6OY1IHyla/CVNwvg7XwZVoXZHcSu9w9SReNP1EzzD5T8NWKIR38fIqEns9kDWKUQTXXAmlDrdPg==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estree-util-attach-comments": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/estree-util-attach-comments/-/estree-util-attach-comments-3.0.0.tgz", - "integrity": "sha512-cKUwm/HUcTDsYh/9FgnuFqpfquUbwIqwKM26BVCGDPVgvaCl/nDCCjUfiLlx6lsEZ3Z4RFxNbOQ60pkaEwFxGw==", - "dependencies": { - "@types/estree": "^1.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/estree-util-build-jsx": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/estree-util-build-jsx/-/estree-util-build-jsx-3.0.1.tgz", - "integrity": "sha512-8U5eiL6BTrPxp/CHbs2yMgP8ftMhR5ww1eIKoWRMlqvltHF8fZn5LRDvTKuxD3DUn+shRbLGqXemcP51oFCsGQ==", - "dependencies": { - "@types/estree-jsx": "^1.0.0", - "devlop": "^1.0.0", - "estree-util-is-identifier-name": "^3.0.0", - "estree-walker": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/estree-util-is-identifier-name": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/estree-util-is-identifier-name/-/estree-util-is-identifier-name-3.0.0.tgz", - "integrity": "sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/estree-util-to-js": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/estree-util-to-js/-/estree-util-to-js-2.0.0.tgz", - "integrity": "sha512-WDF+xj5rRWmD5tj6bIqRi6CkLIXbbNQUcxQHzGysQzvHmdYG2G7p/Tf0J0gpxGgkeMZNTIjT/AoSvC9Xehcgdg==", - "dependencies": { - "@types/estree-jsx": "^1.0.0", - "astring": "^1.8.0", - "source-map": "^0.7.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/estree-util-value-to-estree": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/estree-util-value-to-estree/-/estree-util-value-to-estree-3.3.3.tgz", - "integrity": "sha512-Db+m1WSD4+mUO7UgMeKkAwdbfNWwIxLt48XF2oFU9emPfXkIu+k5/nlOj313v7wqtAPo0f9REhUvznFrPkG8CQ==", - "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/remcohaszing" - } - }, - "node_modules/estree-util-visit": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/estree-util-visit/-/estree-util-visit-2.0.0.tgz", - "integrity": "sha512-m5KgiH85xAhhW8Wta0vShLcUvOsh3LLPI2YVwcbio1l7E09NTLL1EyMZFM1OyWowoH0skScNbhOPl4kcBgzTww==", - "dependencies": { - "@types/estree-jsx": "^1.0.0", - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dependencies": { - "@types/estree": "^1.0.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/eta": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/eta/-/eta-2.2.0.tgz", - "integrity": "sha512-UVQ72Rqjy/ZKQalzV5dCCJP80GrmPrMxh6NlNf+erV6ObL0ZFkhCstWRawS85z3smdr3d2wXPsZEY7rDPfGd2g==", - "engines": { - "node": ">=6.0.0" - }, - "funding": { - "url": "https://github.com/eta-dev/eta?sponsor=1" - } - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/eval": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/eval/-/eval-0.1.8.tgz", - "integrity": "sha512-EzV94NYKoO09GLXGjXj9JIlXijVck4ONSr5wiCWDvhsvj5jxSrzTmRU/9C1DyB6uToszLs8aifA6NQ7lEQdvFw==", - "dependencies": { - "@types/node": "*", - "require-like": ">= 0.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", - "license": "MIT" - }, - "node_modules/events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "engines": { - "node": ">=0.8.x" - } - }, - "node_modules/execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "license": "MIT", - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/express": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", - "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", - "license": "MIT", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.3", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.7.1", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.3.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.3", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.12", - "proxy-addr": "~2.0.7", - "qs": "6.13.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.19.0", - "serve-static": "1.16.2", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/express/node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "license": "MIT", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/express/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT" - }, - "node_modules/express/node_modules/path-to-regexp": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", - "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", - "license": "MIT" - }, - "node_modules/express/node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" - }, - "node_modules/fast-uri": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz", - "integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fastify" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/fastify" - } - ], - "license": "BSD-3-Clause" - }, - "node_modules/fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/fault": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fault/-/fault-2.0.1.tgz", - "integrity": "sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==", - "license": "MIT", - "dependencies": { - "format": "^0.2.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/faye-websocket": { - "version": "0.11.4", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", - "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", - "license": "Apache-2.0", - "dependencies": { - "websocket-driver": ">=0.5.1" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/feed": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/feed/-/feed-4.2.2.tgz", - "integrity": "sha512-u5/sxGfiMfZNtJ3OvQpXcvotFpYkL0n9u9mM2vkui2nGo8b4wvDkJ8gAkYqbA8QpGyFCv3RK0Z+Iv+9veCS9bQ==", - "dependencies": { - "xml-js": "^1.6.11" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "dependencies": { - "escape-string-regexp": "^1.0.5" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/figures/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/file-loader": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.2.0.tgz", - "integrity": "sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==", - "dependencies": { - "loader-utils": "^2.0.0", - "schema-utils": "^3.0.0" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^4.0.0 || ^5.0.0" - } - }, - "node_modules/file-loader/node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/file-loader/node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "peerDependencies": { - "ajv": "^6.9.1" - } - }, - "node_modules/file-loader/node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "node_modules/file-loader/node_modules/schema-utils": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", - "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", - "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/finalhandler": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", - "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", - "license": "MIT", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/finalhandler/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/finalhandler/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT" - }, - "node_modules/find-cache-dir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-4.0.0.tgz", - "integrity": "sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg==", - "dependencies": { - "common-path-prefix": "^3.0.0", - "pkg-dir": "^7.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/find-up": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", - "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", - "dependencies": { - "locate-path": "^7.1.0", - "path-exists": "^5.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "bin": { - "flat": "cli.js" - } - }, - "node_modules/follow-redirects": { - "version": "1.15.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", - "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "license": "MIT", - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/form-data-encoder": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.4.tgz", - "integrity": "sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==", - "license": "MIT", - "engines": { - "node": ">= 14.17" - } - }, - "node_modules/format": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz", - "integrity": "sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==", - "engines": { - "node": ">=0.4.x" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fraction.js": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", - "integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==", - "engines": { - "node": "*" - }, - "funding": { - "type": "patreon", - "url": "https://github.com/sponsors/rawify" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fs-extra": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", - "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, - "node_modules/fs-monkey": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.6.tgz", - "integrity": "sha512-b1FMfwetIKymC0eioW7mTywihSQE4oLzQn1dB6rZB5fx/3NpNEdAWeCSMB+60/AeT0TCXsxzAlcYVEFCTAksWg==", - "license": "Unlicense" - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/get-intrinsic": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "function-bind": "^1.1.2", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-own-enumerable-property-symbols": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", - "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", - "license": "ISC" - }, - "node_modules/get-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "license": "MIT", - "dependencies": { - "dunder-proto": "^1.0.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/github-slugger": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-1.5.0.tgz", - "integrity": "sha512-wIh+gKBI9Nshz2o46B0B3f5k/W+WI9ZAv6y5Dn5WJ5SK1t0TnDimB4WE5rmTD05ZAIn8HALCZVmCsvj0w0v0lw==" - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/glob-to-regexp": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==" - }, - "node_modules/global-dirs": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", - "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", - "license": "MIT", - "dependencies": { - "ini": "2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/global-dirs/node_modules/ini": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", - "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "engines": { - "node": ">=4" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/got": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", - "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", - "license": "MIT", - "dependencies": { - "@sindresorhus/is": "^5.2.0", - "@szmarczak/http-timer": "^5.0.1", - "cacheable-lookup": "^7.0.0", - "cacheable-request": "^10.2.8", - "decompress-response": "^6.0.0", - "form-data-encoder": "^2.1.2", - "get-stream": "^6.0.1", - "http2-wrapper": "^2.1.10", - "lowercase-keys": "^3.0.0", - "p-cancelable": "^3.0.0", - "responselike": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" - } - }, - "node_modules/got/node_modules/@sindresorhus/is": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", - "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", - "license": "MIT", - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" - }, - "node_modules/gray-matter": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz", - "integrity": "sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==", - "dependencies": { - "js-yaml": "^3.13.1", - "kind-of": "^6.0.2", - "section-matter": "^1.0.0", - "strip-bom-string": "^1.0.0" - }, - "engines": { - "node": ">=6.0" - } - }, - "node_modules/gray-matter/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/gray-matter/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/gzip-size": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-6.0.0.tgz", - "integrity": "sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==", - "license": "MIT", - "dependencies": { - "duplexer": "^0.1.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/handle-thing": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz", - "integrity": "sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==", - "license": "MIT" - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-yarn": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-3.0.0.tgz", - "integrity": "sha512-IrsVwUHhEULx3R8f/aA8AHuEzAorplsab/v8HBzEiIukwq5i/EC+xmOW+HfP1OaDP+2JkgT1yILHN2O3UFIbcA==", - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/hast-util-from-parse5": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.3.tgz", - "integrity": "sha512-3kxEVkEKt0zvcZ3hCRYI8rqrgwtlIOFMWkbclACvjlDw8Li9S2hk/d51OI0nr/gIpdMHNepwgOKqZ/sy0Clpyg==", - "license": "MIT", - "dependencies": { - "@types/hast": "^3.0.0", - "@types/unist": "^3.0.0", - "devlop": "^1.0.0", - "hastscript": "^9.0.0", - "property-information": "^7.0.0", - "vfile": "^6.0.0", - "vfile-location": "^5.0.0", - "web-namespaces": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/hast-util-from-parse5/node_modules/property-information": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.0.0.tgz", - "integrity": "sha512-7D/qOz/+Y4X/rzSB6jKxKUsQnphO046ei8qxG59mtM3RG3DHgTK81HrxrmoDVINJb8NKT5ZsRbwHvQ6B68Iyhg==", - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/hast-util-parse-selector": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz", - "integrity": "sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==", - "license": "MIT", - "dependencies": { - "@types/hast": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/hast-util-raw": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-9.1.0.tgz", - "integrity": "sha512-Y8/SBAHkZGoNkpzqqfCldijcuUKh7/su31kEBp67cFY09Wy0mTRgtsLYsiIxMJxlu0f6AA5SUTbDR8K0rxnbUw==", - "license": "MIT", - "dependencies": { - "@types/hast": "^3.0.0", - "@types/unist": "^3.0.0", - "@ungap/structured-clone": "^1.0.0", - "hast-util-from-parse5": "^8.0.0", - "hast-util-to-parse5": "^8.0.0", - "html-void-elements": "^3.0.0", - "mdast-util-to-hast": "^13.0.0", - "parse5": "^7.0.0", - "unist-util-position": "^5.0.0", - "unist-util-visit": "^5.0.0", - "vfile": "^6.0.0", - "web-namespaces": "^2.0.0", - "zwitch": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/hast-util-to-estree": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hast-util-to-estree/-/hast-util-to-estree-3.1.0.tgz", - "integrity": "sha512-lfX5g6hqVh9kjS/B9E2gSkvHH4SZNiQFiqWS0x9fENzEl+8W12RqdRxX6d/Cwxi30tPQs3bIO+aolQJNp1bIyw==", - "dependencies": { - "@types/estree": "^1.0.0", - "@types/estree-jsx": "^1.0.0", - "@types/hast": "^3.0.0", - "comma-separated-tokens": "^2.0.0", - "devlop": "^1.0.0", - "estree-util-attach-comments": "^3.0.0", - "estree-util-is-identifier-name": "^3.0.0", - "hast-util-whitespace": "^3.0.0", - "mdast-util-mdx-expression": "^2.0.0", - "mdast-util-mdx-jsx": "^3.0.0", - "mdast-util-mdxjs-esm": "^2.0.0", - "property-information": "^6.0.0", - "space-separated-tokens": "^2.0.0", - "style-to-object": "^0.4.0", - "unist-util-position": "^5.0.0", - "zwitch": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/hast-util-to-jsx-runtime": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.0.tgz", - "integrity": "sha512-H/y0+IWPdsLLS738P8tDnrQ8Z+dj12zQQ6WC11TIM21C8WFVoIxcqWXf2H3hiTVZjF1AWqoimGwrTWecWrnmRQ==", - "dependencies": { - "@types/estree": "^1.0.0", - "@types/hast": "^3.0.0", - "@types/unist": "^3.0.0", - "comma-separated-tokens": "^2.0.0", - "devlop": "^1.0.0", - "estree-util-is-identifier-name": "^3.0.0", - "hast-util-whitespace": "^3.0.0", - "mdast-util-mdx-expression": "^2.0.0", - "mdast-util-mdx-jsx": "^3.0.0", - "mdast-util-mdxjs-esm": "^2.0.0", - "property-information": "^6.0.0", - "space-separated-tokens": "^2.0.0", - "style-to-object": "^1.0.0", - "unist-util-position": "^5.0.0", - "vfile-message": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/hast-util-to-jsx-runtime/node_modules/inline-style-parser": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.3.tgz", - "integrity": "sha512-qlD8YNDqyTKTyuITrDOffsl6Tdhv+UC4hcdAVuQsK4IMQ99nSgd1MIA/Q+jQYoh9r3hVUXhYh7urSRmXPkW04g==" - }, - "node_modules/hast-util-to-jsx-runtime/node_modules/style-to-object": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.6.tgz", - "integrity": "sha512-khxq+Qm3xEyZfKd/y9L3oIWQimxuc4STrQKtQn8aSDRHb8mFgpukgX1hdzfrMEW6JCjyJ8p89x+IUMVnCBI1PA==", - "dependencies": { - "inline-style-parser": "0.2.3" - } - }, - "node_modules/hast-util-to-parse5": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.0.tgz", - "integrity": "sha512-3KKrV5ZVI8if87DVSi1vDeByYrkGzg4mEfeu4alwgmmIeARiBLKCZS2uw5Gb6nU9x9Yufyj3iudm6i7nl52PFw==", - "license": "MIT", - "dependencies": { - "@types/hast": "^3.0.0", - "comma-separated-tokens": "^2.0.0", - "devlop": "^1.0.0", - "property-information": "^6.0.0", - "space-separated-tokens": "^2.0.0", - "web-namespaces": "^2.0.0", - "zwitch": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/hast-util-whitespace": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", - "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", - "dependencies": { - "@types/hast": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/hastscript": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-9.0.1.tgz", - "integrity": "sha512-g7df9rMFX/SPi34tyGCyUBREQoKkapwdY/T04Qn9TDWfHhAYt4/I0gMVirzK5wEzeUqIjEB+LXC/ypb7Aqno5w==", - "license": "MIT", - "dependencies": { - "@types/hast": "^3.0.0", - "comma-separated-tokens": "^2.0.0", - "hast-util-parse-selector": "^4.0.0", - "property-information": "^7.0.0", - "space-separated-tokens": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/hastscript/node_modules/property-information": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.0.0.tgz", - "integrity": "sha512-7D/qOz/+Y4X/rzSB6jKxKUsQnphO046ei8qxG59mtM3RG3DHgTK81HrxrmoDVINJb8NKT5ZsRbwHvQ6B68Iyhg==", - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "license": "MIT", - "bin": { - "he": "bin/he" - } - }, - "node_modules/history": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", - "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", - "dependencies": { - "@babel/runtime": "^7.1.2", - "loose-envify": "^1.2.0", - "resolve-pathname": "^3.0.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0", - "value-equal": "^1.0.1" - } - }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dependencies": { - "react-is": "^16.7.0" - } - }, - "node_modules/hpack.js": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", - "integrity": "sha512-zJxVehUdMGIKsRaNt7apO2Gqp0BdqW5yaiGHXXmbpvxgBYVZnAql+BJb4RO5ad2MgpbZKn5G6nMnegrH1FcNYQ==", - "license": "MIT", - "dependencies": { - "inherits": "^2.0.1", - "obuf": "^1.0.0", - "readable-stream": "^2.0.1", - "wbuf": "^1.1.0" - } - }, - "node_modules/hpack.js/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "license": "MIT" - }, - "node_modules/hpack.js/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/hpack.js/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "license": "MIT" - }, - "node_modules/hpack.js/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/html-entities": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.5.2.tgz", - "integrity": "sha512-K//PSRMQk4FZ78Kyau+mZurHn3FH0Vwr+H36eE0rPbeYkRRi9YxceYPhuN60UwWorxyKHhqoAJl2OFKa4BVtaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/mdevils" - }, - { - "type": "patreon", - "url": "https://patreon.com/mdevils" - } - ], - "license": "MIT" - }, - "node_modules/html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "license": "MIT" - }, - "node_modules/html-minifier-terser": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-7.2.0.tgz", - "integrity": "sha512-tXgn3QfqPIpGl9o+K5tpcj3/MN4SfLtsx2GWwBC3SSd0tXQGyF3gsSqad8loJgKZGM3ZxbYDd5yhiBIdWpmvLA==", - "dependencies": { - "camel-case": "^4.1.2", - "clean-css": "~5.3.2", - "commander": "^10.0.0", - "entities": "^4.4.0", - "param-case": "^3.0.4", - "relateurl": "^0.2.7", - "terser": "^5.15.1" - }, - "bin": { - "html-minifier-terser": "cli.js" - }, - "engines": { - "node": "^14.13.1 || >=16.0.0" - } - }, - "node_modules/html-minifier-terser/node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "engines": { - "node": ">=14" - } - }, - "node_modules/html-tags": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.3.1.tgz", - "integrity": "sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==", - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/html-void-elements": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz", - "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==", - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/html-webpack-plugin": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.6.3.tgz", - "integrity": "sha512-QSf1yjtSAsmf7rYBV7XX86uua4W/vkhIt0xNXKbsi2foEeW7vjJQz4bhnpL3xH+l1ryl1680uNv968Z+X6jSYg==", - "license": "MIT", - "dependencies": { - "@types/html-minifier-terser": "^6.0.0", - "html-minifier-terser": "^6.0.2", - "lodash": "^4.17.21", - "pretty-error": "^4.0.0", - "tapable": "^2.0.0" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/html-webpack-plugin" - }, - "peerDependencies": { - "@rspack/core": "0.x || 1.x", - "webpack": "^5.20.0" - }, - "peerDependenciesMeta": { - "@rspack/core": { - "optional": true - }, - "webpack": { - "optional": true - } - } - }, - "node_modules/html-webpack-plugin/node_modules/commander": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", - "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", - "license": "MIT", - "engines": { - "node": ">= 12" - } - }, - "node_modules/html-webpack-plugin/node_modules/html-minifier-terser": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz", - "integrity": "sha512-YXxSlJBZTP7RS3tWnQw74ooKa6L9b9i9QYXY21eUEvhZ3u9XLfv6OnFsQq6RxkhHygsaUMvYsZRV5rU/OVNZxw==", - "license": "MIT", - "dependencies": { - "camel-case": "^4.1.2", - "clean-css": "^5.2.2", - "commander": "^8.3.0", - "he": "^1.2.0", - "param-case": "^3.0.4", - "relateurl": "^0.2.7", - "terser": "^5.10.0" - }, - "bin": { - "html-minifier-terser": "cli.js" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/htmlparser2": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", - "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", - "funding": [ - "https://github.com/fb55/htmlparser2?sponsor=1", - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ], - "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1", - "entities": "^4.4.0" - } - }, - "node_modules/http-cache-semantics": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", - "license": "BSD-2-Clause" - }, - "node_modules/http-deceiver": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", - "integrity": "sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw==", - "license": "MIT" - }, - "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "license": "MIT", - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/http-parser-js": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.9.tgz", - "integrity": "sha512-n1XsPy3rXVxlqxVioEWdC+0+M+SQw0DpJynwtOPo1X+ZlvdzTLtDBIJJlDQTnwZIFJrZSzSGmIOUdP8tu+SgLw==", - "license": "MIT" - }, - "node_modules/http-proxy": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", - "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", - "license": "MIT", - "dependencies": { - "eventemitter3": "^4.0.0", - "follow-redirects": "^1.0.0", - "requires-port": "^1.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/http-proxy-middleware": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.9.tgz", - "integrity": "sha512-c1IyJYLYppU574+YI7R4QyX2ystMtVXZwIdzazUIPIJsHuWNd+mho2j+bKoHftndicGj9yh+xjd+l0yj7VeT1Q==", - "license": "MIT", - "dependencies": { - "@types/http-proxy": "^1.17.8", - "http-proxy": "^1.18.1", - "is-glob": "^4.0.1", - "is-plain-obj": "^3.0.0", - "micromatch": "^4.0.2" - }, - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "@types/express": "^4.17.13" - }, - "peerDependenciesMeta": { - "@types/express": { - "optional": true - } - } - }, - "node_modules/http-proxy-middleware/node_modules/is-plain-obj": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz", - "integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==", - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/http2-wrapper": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", - "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", - "license": "MIT", - "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.2.0" - }, - "engines": { - "node": ">=10.19.0" - } - }, - "node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "license": "Apache-2.0", - "engines": { - "node": ">=10.17.0" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/icss-utils": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", - "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/ignore": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", - "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", - "engines": { - "node": ">= 4" - } - }, - "node_modules/image-size": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/image-size/-/image-size-2.0.2.tgz", - "integrity": "sha512-IRqXKlaXwgSMAMtpNzZa1ZAe8m+Sa1770Dhk8VkSsP9LS+iHD62Zd8FQKs8fbPiagBE7BzoFX23cxFnwshpV6w==", - "license": "MIT", - "bin": { - "image-size": "bin/image-size.js" - }, - "engines": { - "node": ">=16.x" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/import-lazy": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", - "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "license": "MIT", - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/infima": { - "version": "0.2.0-alpha.45", - "resolved": "https://registry.npmjs.org/infima/-/infima-0.2.0-alpha.45.tgz", - "integrity": "sha512-uyH0zfr1erU1OohLk0fT4Rrb94AOhguWNOcD9uGrSpRvNB+6gZXUoJX5J0NtvzBO10YZ9PgvA4NFgt+fYg8ojw==", - "engines": { - "node": ">=12" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "license": "ISC" - }, - "node_modules/inline-style-parser": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz", - "integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==" - }, - "node_modules/invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", - "license": "MIT", - "dependencies": { - "loose-envify": "^1.0.0" - } - }, - "node_modules/ipaddr.js": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz", - "integrity": "sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==", - "license": "MIT", - "engines": { - "node": ">= 10" - } - }, - "node_modules/is-alphabetical": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz", - "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/is-alphanumerical": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz", - "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==", - "dependencies": { - "is-alphabetical": "^2.0.0", - "is-decimal": "^2.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "license": "MIT", - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-ci": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", - "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", - "license": "MIT", - "dependencies": { - "ci-info": "^3.2.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, - "node_modules/is-core-module": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.14.0.tgz", - "integrity": "sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==", - "dependencies": { - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-decimal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz", - "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", - "license": "MIT", - "bin": { - "is-docker": "cli.js" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-hexadecimal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz", - "integrity": "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/is-installed-globally": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", - "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", - "license": "MIT", - "dependencies": { - "global-dirs": "^3.0.0", - "is-path-inside": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-npm": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-6.0.0.tgz", - "integrity": "sha512-JEjxbSmtPSt1c8XTkVrlujcXdKV1/tvuQ7GwKcAlyiVLeYFQ2VHat8xfrDJsIkhCdF/tZ7CiIR3sy141c6+gPQ==", - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-plain-obj": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", - "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-reference": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.2.tgz", - "integrity": "sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==", - "dependencies": { - "@types/estree": "*" - } - }, - "node_modules/is-regexp": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", - "integrity": "sha512-7zjFAPO4/gwyQAAgRRmqeEeyIICSdmCqa3tsVHMdBzaXXRiqopZL4Cyghg/XulGWrtABTpbnYYzzIRffLkP4oA==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "license": "MIT" - }, - "node_modules/is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "license": "MIT", - "dependencies": { - "is-docker": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-yarn-global": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.4.1.tgz", - "integrity": "sha512-/kppl+R+LO5VmhYSEWARUFjodS25D68gvj8W7z0I7OWhUla5xWu8KL6CtB2V0R6yqhnRgbcaREMr4EEM6htLPQ==", - "license": "MIT", - "engines": { - "node": ">=12" - } - }, - "node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "license": "ISC" - }, - "node_modules/isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/jest-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", - "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", - "dependencies": { - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "graceful-fs": "^4.2.9", - "picomatch": "^2.2.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-worker": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", - "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", - "dependencies": { - "@types/node": "*", - "jest-util": "^29.7.0", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-worker/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/jiti": { - "version": "1.21.6", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.6.tgz", - "integrity": "sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==", - "bin": { - "jiti": "bin/jiti.js" - } - }, - "node_modules/joi": { - "version": "17.13.3", - "resolved": "https://registry.npmjs.org/joi/-/joi-17.13.3.tgz", - "integrity": "sha512-otDA4ldcIx+ZXsKHWmp0YizCweVRZG96J10b0FevjfuncLO1oX59THoAmHkNubYJ+9gWsYsp5k8v4ib6oDv1fA==", - "dependencies": { - "@hapi/hoek": "^9.3.0", - "@hapi/topo": "^5.1.0", - "@sideway/address": "^4.1.5", - "@sideway/formula": "^3.0.1", - "@sideway/pinpoint": "^2.0.0" - } - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" - }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/jsesc": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", - "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "license": "MIT" - }, - "node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" - }, - "node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "license": "MIT" - }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/keyv": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", - "license": "MIT", - "dependencies": { - "json-buffer": "3.0.1" - } - }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", - "engines": { - "node": ">=6" - } - }, - "node_modules/latest-version": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-7.0.0.tgz", - "integrity": "sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg==", - "license": "MIT", - "dependencies": { - "package-json": "^8.1.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/launch-editor": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.10.0.tgz", - "integrity": "sha512-D7dBRJo/qcGX9xlvt/6wUYzQxjh5G1RvZPgPv8vi4KRU99DVQL/oW7tnVOCCTm2HGeo3C5HvGE5Yrh6UBoZ0vA==", - "license": "MIT", - "dependencies": { - "picocolors": "^1.0.0", - "shell-quote": "^1.8.1" - } - }, - "node_modules/leven": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", - "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/lilconfig": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", - "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antonk52" - } - }, - "node_modules/lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" - }, - "node_modules/loader-runner": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", - "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", - "engines": { - "node": ">=6.11.5" - } - }, - "node_modules/loader-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", - "dependencies": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - }, - "engines": { - "node": ">=8.9.0" - } - }, - "node_modules/locate-path": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", - "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", - "dependencies": { - "p-locate": "^6.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "node_modules/lodash.debounce": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==" - }, - "node_modules/lodash.memoize": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", - "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==" - }, - "node_modules/lodash.uniq": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", - "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==" - }, - "node_modules/longest-streak": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", - "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dependencies": { - "js-tokens": "^3.0.0 || ^4.0.0" - }, - "bin": { - "loose-envify": "cli.js" - } - }, - "node_modules/lower-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", - "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", - "dependencies": { - "tslib": "^2.0.3" - } - }, - "node_modules/lowercase-keys": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", - "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dependencies": { - "yallist": "^3.0.2" - } - }, - "node_modules/markdown-extensions": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-2.0.0.tgz", - "integrity": "sha512-o5vL7aDWatOTX8LzaS1WMoaoxIiLRQJuIKKe2wAw6IeULDHaqbiqiggmx+pKvZDb1Sj+pE46Sn1T7lCqfFtg1Q==", - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/markdown-table": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.4.tgz", - "integrity": "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==", - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/mdast-util-directive": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-directive/-/mdast-util-directive-3.1.0.tgz", - "integrity": "sha512-I3fNFt+DHmpWCYAT7quoM6lHf9wuqtI+oCOfvILnoicNIqjh5E3dEJWiXuYME2gNe8vl1iMQwyUHa7bgFmak6Q==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "@types/unist": "^3.0.0", - "ccount": "^2.0.0", - "devlop": "^1.0.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0", - "parse-entities": "^4.0.0", - "stringify-entities": "^4.0.0", - "unist-util-visit-parents": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-find-and-replace": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.2.tgz", - "integrity": "sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "escape-string-regexp": "^5.0.0", - "unist-util-is": "^6.0.0", - "unist-util-visit-parents": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mdast-util-from-markdown": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.1.tgz", - "integrity": "sha512-aJEUyzZ6TzlsX2s5B4Of7lN7EQtAxvtradMMglCQDyaTFgse6CmtmdJ15ElnVRlCg1vpNyVtbem0PWzlNieZsA==", - "dependencies": { - "@types/mdast": "^4.0.0", - "@types/unist": "^3.0.0", - "decode-named-character-reference": "^1.0.0", - "devlop": "^1.0.0", - "mdast-util-to-string": "^4.0.0", - "micromark": "^4.0.0", - "micromark-util-decode-numeric-character-reference": "^2.0.0", - "micromark-util-decode-string": "^2.0.0", - "micromark-util-normalize-identifier": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0", - "unist-util-stringify-position": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-from-markdown/node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/mdast-util-frontmatter": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/mdast-util-frontmatter/-/mdast-util-frontmatter-2.0.1.tgz", - "integrity": "sha512-LRqI9+wdgC25P0URIJY9vwocIzCcksduHQ9OF2joxQoyTNVduwLAFUzjoopuRJbJAReaKrNQKAZKL3uCMugWJA==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "devlop": "^1.0.0", - "escape-string-regexp": "^5.0.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0", - "micromark-extension-frontmatter": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-frontmatter/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mdast-util-gfm": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.1.0.tgz", - "integrity": "sha512-0ulfdQOM3ysHhCJ1p06l0b0VKlhU0wuQs3thxZQagjcjPrlFRqY215uZGHHJan9GEAXd9MbfPjFJz+qMkVR6zQ==", - "license": "MIT", - "dependencies": { - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-gfm-autolink-literal": "^2.0.0", - "mdast-util-gfm-footnote": "^2.0.0", - "mdast-util-gfm-strikethrough": "^2.0.0", - "mdast-util-gfm-table": "^2.0.0", - "mdast-util-gfm-task-list-item": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-gfm-autolink-literal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.1.tgz", - "integrity": "sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "ccount": "^2.0.0", - "devlop": "^1.0.0", - "mdast-util-find-and-replace": "^3.0.0", - "micromark-util-character": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-gfm-autolink-literal/node_modules/micromark-util-character": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", - "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/mdast-util-gfm-autolink-literal/node_modules/micromark-util-symbol": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", - "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/mdast-util-gfm-footnote": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.1.0.tgz", - "integrity": "sha512-sqpDWlsHn7Ac9GNZQMeUzPQSMzR6Wv0WKRNvQRg0KqHh02fpTz69Qc1QSseNX29bhz1ROIyNyxExfawVKTm1GQ==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "devlop": "^1.1.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0", - "micromark-util-normalize-identifier": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-gfm-strikethrough": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz", - "integrity": "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-gfm-table": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz", - "integrity": "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "devlop": "^1.0.0", - "markdown-table": "^3.0.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-gfm-task-list-item": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz", - "integrity": "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "devlop": "^1.0.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-mdx": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-mdx/-/mdast-util-mdx-3.0.0.tgz", - "integrity": "sha512-JfbYLAW7XnYTTbUsmpu0kdBUVe+yKVJZBItEjwyYJiDJuZ9w4eeaqks4HQO+R7objWgS2ymV60GYpI14Ug554w==", - "dependencies": { - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-mdx-expression": "^2.0.0", - "mdast-util-mdx-jsx": "^3.0.0", - "mdast-util-mdxjs-esm": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-mdx-expression": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.0.tgz", - "integrity": "sha512-fGCu8eWdKUKNu5mohVGkhBXCXGnOTLuFqOvGMvdikr+J1w7lDJgxThOKpwRWzzbyXAU2hhSwsmssOY4yTokluw==", - "dependencies": { - "@types/estree-jsx": "^1.0.0", - "@types/hast": "^3.0.0", - "@types/mdast": "^4.0.0", - "devlop": "^1.0.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-mdx-jsx": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.1.2.tgz", - "integrity": "sha512-eKMQDeywY2wlHc97k5eD8VC+9ASMjN8ItEZQNGwJ6E0XWKiW/Z0V5/H8pvoXUf+y+Mj0VIgeRRbujBmFn4FTyA==", - "dependencies": { - "@types/estree-jsx": "^1.0.0", - "@types/hast": "^3.0.0", - "@types/mdast": "^4.0.0", - "@types/unist": "^3.0.0", - "ccount": "^2.0.0", - "devlop": "^1.1.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0", - "parse-entities": "^4.0.0", - "stringify-entities": "^4.0.0", - "unist-util-remove-position": "^5.0.0", - "unist-util-stringify-position": "^4.0.0", - "vfile-message": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-mdxjs-esm": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-2.0.1.tgz", - "integrity": "sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==", - "dependencies": { - "@types/estree-jsx": "^1.0.0", - "@types/hast": "^3.0.0", - "@types/mdast": "^4.0.0", - "devlop": "^1.0.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-phrasing": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", - "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", - "dependencies": { - "@types/mdast": "^4.0.0", - "unist-util-is": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-to-hast": { - "version": "13.2.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz", - "integrity": "sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==", - "dependencies": { - "@types/hast": "^3.0.0", - "@types/mdast": "^4.0.0", - "@ungap/structured-clone": "^1.0.0", - "devlop": "^1.0.0", - "micromark-util-sanitize-uri": "^2.0.0", - "trim-lines": "^3.0.0", - "unist-util-position": "^5.0.0", - "unist-util-visit": "^5.0.0", - "vfile": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-to-markdown": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.0.tgz", - "integrity": "sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ==", - "dependencies": { - "@types/mdast": "^4.0.0", - "@types/unist": "^3.0.0", - "longest-streak": "^3.0.0", - "mdast-util-phrasing": "^4.0.0", - "mdast-util-to-string": "^4.0.0", - "micromark-util-decode-string": "^2.0.0", - "unist-util-visit": "^5.0.0", - "zwitch": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-to-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", - "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", - "dependencies": { - "@types/mdast": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdn-data": { - "version": "2.0.30", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", - "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==" - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/memfs": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.5.3.tgz", - "integrity": "sha512-UERzLsxzllchadvbPs5aolHh65ISpKpM+ccLbOJ8/vvpBKmAWf+la7dXFy7Mr0ySHbdHrFv5kGFCUHHe6GFEmw==", - "license": "Unlicense", - "dependencies": { - "fs-monkey": "^1.0.4" - }, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", - "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "engines": { - "node": ">= 8" - } - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/micromark": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.0.tgz", - "integrity": "sha512-o/sd0nMof8kYff+TqcDx3VSrgBTcZpSvYcAHIfHhv5VAuNmisCxjhx6YmxS8PFEpb9z5WKWKPdzf0jM23ro3RQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "@types/debug": "^4.0.0", - "debug": "^4.0.0", - "decode-named-character-reference": "^1.0.0", - "devlop": "^1.0.0", - "micromark-core-commonmark": "^2.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-chunked": "^2.0.0", - "micromark-util-combine-extensions": "^2.0.0", - "micromark-util-decode-numeric-character-reference": "^2.0.0", - "micromark-util-encode": "^2.0.0", - "micromark-util-normalize-identifier": "^2.0.0", - "micromark-util-resolve-all": "^2.0.0", - "micromark-util-sanitize-uri": "^2.0.0", - "micromark-util-subtokenize": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-core-commonmark": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.1.tgz", - "integrity": "sha512-CUQyKr1e///ZODyD1U3xit6zXwy1a8q2a1S1HKtIlmgvurrEpaw/Y9y6KSIbF8P59cn/NjzHyO+Q2fAyYLQrAA==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "decode-named-character-reference": "^1.0.0", - "devlop": "^1.0.0", - "micromark-factory-destination": "^2.0.0", - "micromark-factory-label": "^2.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-factory-title": "^2.0.0", - "micromark-factory-whitespace": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-chunked": "^2.0.0", - "micromark-util-classify-character": "^2.0.0", - "micromark-util-html-tag-name": "^2.0.0", - "micromark-util-normalize-identifier": "^2.0.0", - "micromark-util-resolve-all": "^2.0.0", - "micromark-util-subtokenize": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-core-commonmark/node_modules/micromark-factory-space": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.0.tgz", - "integrity": "sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-core-commonmark/node_modules/micromark-util-character": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", - "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-core-commonmark/node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-extension-directive": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/micromark-extension-directive/-/micromark-extension-directive-3.0.2.tgz", - "integrity": "sha512-wjcXHgk+PPdmvR58Le9d7zQYWy+vKEU9Se44p2CrCDPiLr2FMyiT4Fyb5UFKFC66wGB3kPlgD7q3TnoqPS7SZA==", - "license": "MIT", - "dependencies": { - "devlop": "^1.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-factory-whitespace": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0", - "parse-entities": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-directive/node_modules/micromark-factory-space": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz", - "integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-extension-directive/node_modules/micromark-util-character": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", - "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-extension-directive/node_modules/micromark-util-symbol": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", - "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/micromark-extension-frontmatter": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-frontmatter/-/micromark-extension-frontmatter-2.0.0.tgz", - "integrity": "sha512-C4AkuM3dA58cgZha7zVnuVxBhDsbttIMiytjgsM2XbHAB2faRVaHRle40558FBN+DJcrLNCoqG5mlrpdU4cRtg==", - "license": "MIT", - "dependencies": { - "fault": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-frontmatter/node_modules/micromark-util-character": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", - "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-extension-frontmatter/node_modules/micromark-util-symbol": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", - "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/micromark-extension-gfm": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz", - "integrity": "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==", - "license": "MIT", - "dependencies": { - "micromark-extension-gfm-autolink-literal": "^2.0.0", - "micromark-extension-gfm-footnote": "^2.0.0", - "micromark-extension-gfm-strikethrough": "^2.0.0", - "micromark-extension-gfm-table": "^2.0.0", - "micromark-extension-gfm-tagfilter": "^2.0.0", - "micromark-extension-gfm-task-list-item": "^2.0.0", - "micromark-util-combine-extensions": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-autolink-literal": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.1.0.tgz", - "integrity": "sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==", - "license": "MIT", - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-sanitize-uri": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-autolink-literal/node_modules/micromark-util-character": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", - "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-extension-gfm-autolink-literal/node_modules/micromark-util-symbol": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", - "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/micromark-extension-gfm-footnote": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.1.0.tgz", - "integrity": "sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw==", - "license": "MIT", - "dependencies": { - "devlop": "^1.0.0", - "micromark-core-commonmark": "^2.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-normalize-identifier": "^2.0.0", - "micromark-util-sanitize-uri": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-footnote/node_modules/micromark-factory-space": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz", - "integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-extension-gfm-footnote/node_modules/micromark-util-character": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", - "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-extension-gfm-footnote/node_modules/micromark-util-symbol": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", - "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/micromark-extension-gfm-strikethrough": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.1.0.tgz", - "integrity": "sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw==", - "license": "MIT", - "dependencies": { - "devlop": "^1.0.0", - "micromark-util-chunked": "^2.0.0", - "micromark-util-classify-character": "^2.0.0", - "micromark-util-resolve-all": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-strikethrough/node_modules/micromark-util-symbol": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", - "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/micromark-extension-gfm-table": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.1.tgz", - "integrity": "sha512-t2OU/dXXioARrC6yWfJ4hqB7rct14e8f7m0cbI5hUmDyyIlwv5vEtooptH8INkbLzOatzKuVbQmAYcbWoyz6Dg==", - "license": "MIT", - "dependencies": { - "devlop": "^1.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-table/node_modules/micromark-factory-space": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz", - "integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-extension-gfm-table/node_modules/micromark-util-character": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", - "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-extension-gfm-table/node_modules/micromark-util-symbol": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", - "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/micromark-extension-gfm-tagfilter": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz", - "integrity": "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==", - "license": "MIT", - "dependencies": { - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-task-list-item": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.1.0.tgz", - "integrity": "sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw==", - "license": "MIT", - "dependencies": { - "devlop": "^1.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-task-list-item/node_modules/micromark-factory-space": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz", - "integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-extension-gfm-task-list-item/node_modules/micromark-util-character": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", - "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-extension-gfm-task-list-item/node_modules/micromark-util-symbol": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", - "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/micromark-extension-mdx-expression": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-mdx-expression/-/micromark-extension-mdx-expression-3.0.0.tgz", - "integrity": "sha512-sI0nwhUDz97xyzqJAbHQhp5TfaxEvZZZ2JDqUo+7NvyIYG6BZ5CPPqj2ogUoPJlmXHBnyZUzISg9+oUmU6tUjQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "@types/estree": "^1.0.0", - "devlop": "^1.0.0", - "micromark-factory-mdx-expression": "^2.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-events-to-acorn": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-extension-mdx-expression/node_modules/micromark-factory-space": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.0.tgz", - "integrity": "sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-extension-mdx-expression/node_modules/micromark-util-character": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", - "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-extension-mdx-expression/node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-extension-mdx-jsx": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-mdx-jsx/-/micromark-extension-mdx-jsx-3.0.0.tgz", - "integrity": "sha512-uvhhss8OGuzR4/N17L1JwvmJIpPhAd8oByMawEKx6NVdBCbesjH4t+vjEp3ZXft9DwvlKSD07fCeI44/N0Vf2w==", - "dependencies": { - "@types/acorn": "^4.0.0", - "@types/estree": "^1.0.0", - "devlop": "^1.0.0", - "estree-util-is-identifier-name": "^3.0.0", - "micromark-factory-mdx-expression": "^2.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0", - "vfile-message": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-mdx-jsx/node_modules/micromark-factory-space": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.0.tgz", - "integrity": "sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-extension-mdx-jsx/node_modules/micromark-util-character": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", - "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-extension-mdx-jsx/node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-extension-mdx-md": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-mdx-md/-/micromark-extension-mdx-md-2.0.0.tgz", - "integrity": "sha512-EpAiszsB3blw4Rpba7xTOUptcFeBFi+6PY8VnJ2hhimH+vCQDirWgsMpz7w1XcZE7LVrSAUGb9VJpG9ghlYvYQ==", - "dependencies": { - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-mdxjs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-mdxjs/-/micromark-extension-mdxjs-3.0.0.tgz", - "integrity": "sha512-A873fJfhnJ2siZyUrJ31l34Uqwy4xIFmvPY1oj+Ean5PHcPBYzEsvqvWGaWcfEIr11O5Dlw3p2y0tZWpKHDejQ==", - "dependencies": { - "acorn": "^8.0.0", - "acorn-jsx": "^5.0.0", - "micromark-extension-mdx-expression": "^3.0.0", - "micromark-extension-mdx-jsx": "^3.0.0", - "micromark-extension-mdx-md": "^2.0.0", - "micromark-extension-mdxjs-esm": "^3.0.0", - "micromark-util-combine-extensions": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-mdxjs-esm": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-mdxjs-esm/-/micromark-extension-mdxjs-esm-3.0.0.tgz", - "integrity": "sha512-DJFl4ZqkErRpq/dAPyeWp15tGrcrrJho1hKK5uBS70BCtfrIFg81sqcTVu3Ta+KD1Tk5vAtBNElWxtAa+m8K9A==", - "dependencies": { - "@types/estree": "^1.0.0", - "devlop": "^1.0.0", - "micromark-core-commonmark": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-events-to-acorn": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0", - "unist-util-position-from-estree": "^2.0.0", - "vfile-message": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-mdxjs-esm/node_modules/micromark-util-character": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", - "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-extension-mdxjs-esm/node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-factory-destination": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.0.tgz", - "integrity": "sha512-j9DGrQLm/Uhl2tCzcbLhy5kXsgkHUrjJHg4fFAeoMRwJmJerT9aw4FEhIbZStWN8A3qMwOp1uzHr4UL8AInxtA==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-factory-destination/node_modules/micromark-util-character": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", - "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-factory-destination/node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-factory-label": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.0.tgz", - "integrity": "sha512-RR3i96ohZGde//4WSe/dJsxOX6vxIg9TimLAS3i4EhBAFx8Sm5SmqVfR8E87DPSR31nEAjZfbt91OMZWcNgdZw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "devlop": "^1.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-factory-label/node_modules/micromark-util-character": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", - "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-factory-label/node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-factory-mdx-expression": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-factory-mdx-expression/-/micromark-factory-mdx-expression-2.0.1.tgz", - "integrity": "sha512-F0ccWIUHRLRrYp5TC9ZYXmZo+p2AM13ggbsW4T0b5CRKP8KHVRB8t4pwtBgTxtjRmwrK0Irwm7vs2JOZabHZfg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "@types/estree": "^1.0.0", - "devlop": "^1.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-events-to-acorn": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0", - "unist-util-position-from-estree": "^2.0.0", - "vfile-message": "^4.0.0" - } - }, - "node_modules/micromark-factory-mdx-expression/node_modules/micromark-util-character": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", - "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-factory-mdx-expression/node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-factory-space": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-1.1.0.tgz", - "integrity": "sha512-cRzEj7c0OL4Mw2v6nwzttyOZe8XY/Z8G0rzmWQZTBi/jjwyw/U4uqKtUORXQrR5bAZZnbTI/feRV/R7hc4jQYQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "node_modules/micromark-factory-space/node_modules/micromark-util-types": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-1.1.0.tgz", - "integrity": "sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/micromark-factory-title": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.0.tgz", - "integrity": "sha512-jY8CSxmpWLOxS+t8W+FG3Xigc0RDQA9bKMY/EwILvsesiRniiVMejYTE4wumNc2f4UbAa4WsHqe3J1QS1sli+A==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-factory-title/node_modules/micromark-factory-space": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.0.tgz", - "integrity": "sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-factory-title/node_modules/micromark-util-character": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", - "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-factory-title/node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-factory-whitespace": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.0.tgz", - "integrity": "sha512-28kbwaBjc5yAI1XadbdPYHX/eDnqaUFVikLwrO7FDnKG7lpgxnvk/XGRhX/PN0mOZ+dBSZ+LgunHS+6tYQAzhA==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-factory-whitespace/node_modules/micromark-factory-space": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.0.tgz", - "integrity": "sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-factory-whitespace/node_modules/micromark-util-character": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", - "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-factory-whitespace/node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-util-character": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-1.2.0.tgz", - "integrity": "sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "node_modules/micromark-util-character/node_modules/micromark-util-types": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-1.1.0.tgz", - "integrity": "sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/micromark-util-chunked": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.0.tgz", - "integrity": "sha512-anK8SWmNphkXdaKgz5hJvGa7l00qmcaUQoMYsBwDlSKFKjc6gjGXPDw3FNL3Nbwq5L8gE+RCbGqTw49FK5Qyvg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-symbol": "^2.0.0" - } - }, - "node_modules/micromark-util-chunked/node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-util-classify-character": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.0.tgz", - "integrity": "sha512-S0ze2R9GH+fu41FA7pbSqNWObo/kzwf8rN/+IGlW/4tC6oACOs8B++bh+i9bVyNnwCcuksbFwsBme5OCKXCwIw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-util-classify-character/node_modules/micromark-util-character": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", - "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-util-classify-character/node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-util-combine-extensions": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.0.tgz", - "integrity": "sha512-vZZio48k7ON0fVS3CUgFatWHoKbbLTK/rT7pzpJ4Bjp5JjkZeasRfrS9wsBdDJK2cJLHMckXZdzPSSr1B8a4oQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-chunked": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-util-decode-numeric-character-reference": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.1.tgz", - "integrity": "sha512-bmkNc7z8Wn6kgjZmVHOX3SowGmVdhYS7yBpMnuMnPzDq/6xwVA604DuOXMZTO1lvq01g+Adfa0pE2UKGlxL1XQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-symbol": "^2.0.0" - } - }, - "node_modules/micromark-util-decode-numeric-character-reference/node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-util-decode-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.0.tgz", - "integrity": "sha512-r4Sc6leeUTn3P6gk20aFMj2ntPwn6qpDZqWvYmAG6NgvFTIlj4WtrAudLi65qYoaGdXYViXYw2pkmn7QnIFasA==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "decode-named-character-reference": "^1.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-decode-numeric-character-reference": "^2.0.0", - "micromark-util-symbol": "^2.0.0" - } - }, - "node_modules/micromark-util-decode-string/node_modules/micromark-util-character": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", - "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-util-decode-string/node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-util-encode": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.0.tgz", - "integrity": "sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-util-events-to-acorn": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/micromark-util-events-to-acorn/-/micromark-util-events-to-acorn-2.0.2.tgz", - "integrity": "sha512-Fk+xmBrOv9QZnEDguL9OI9/NQQp6Hz4FuQ4YmCb/5V7+9eAh1s6AYSvL20kHkD67YIg7EpE54TiSlcsf3vyZgA==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "@types/acorn": "^4.0.0", - "@types/estree": "^1.0.0", - "@types/unist": "^3.0.0", - "devlop": "^1.0.0", - "estree-util-visit": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0", - "vfile-message": "^4.0.0" - } - }, - "node_modules/micromark-util-events-to-acorn/node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-util-html-tag-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.0.tgz", - "integrity": "sha512-xNn4Pqkj2puRhKdKTm8t1YHC/BAjx6CEwRFXntTaRf/x16aqka6ouVoutm+QdkISTlT7e2zU7U4ZdlDLJd2Mcw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-util-normalize-identifier": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.0.tgz", - "integrity": "sha512-2xhYT0sfo85FMrUPtHcPo2rrp1lwbDEEzpx7jiH2xXJLqBuy4H0GgXk5ToU8IEwoROtXuL8ND0ttVa4rNqYK3w==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-symbol": "^2.0.0" - } - }, - "node_modules/micromark-util-normalize-identifier/node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-util-resolve-all": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.0.tgz", - "integrity": "sha512-6KU6qO7DZ7GJkaCgwBNtplXCvGkJToU86ybBAUdavvgsCiG8lSSvYxr9MhwmQ+udpzywHsl4RpGJsYWG1pDOcA==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-util-sanitize-uri": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.0.tgz", - "integrity": "sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-encode": "^2.0.0", - "micromark-util-symbol": "^2.0.0" - } - }, - "node_modules/micromark-util-sanitize-uri/node_modules/micromark-util-character": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", - "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-util-sanitize-uri/node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-util-subtokenize": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.1.tgz", - "integrity": "sha512-jZNtiFl/1aY73yS3UGQkutD0UbhTt68qnRpw2Pifmz5wV9h8gOVsN70v+Lq/f1rKaU/W8pxRe8y8Q9FX1AOe1Q==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "devlop": "^1.0.0", - "micromark-util-chunked": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-util-subtokenize/node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-util-symbol": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-1.1.0.tgz", - "integrity": "sha512-uEjpEYY6KMs1g7QfJ2eX1SQEV+ZT4rUD3UcF6l57acZvLNK7PBZL+ty82Z1qhK1/yXIY4bdx04FKMgR0g4IAag==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/micromark-util-types": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.0.tgz", - "integrity": "sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark/node_modules/micromark-factory-space": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.0.tgz", - "integrity": "sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark/node_modules/micromark-util-character": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", - "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark/node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromatch": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", - "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "dependencies": { - "braces": "^3.0.3", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "license": "MIT", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", - "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.18", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", - "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", - "license": "MIT", - "dependencies": { - "mime-db": "~1.33.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/mimic-response": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", - "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mini-css-extract-plugin": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.9.2.tgz", - "integrity": "sha512-GJuACcS//jtq4kCtd5ii/M0SZf7OZRH+BxdqXZHaJfb8TJiVl+NgQRPwiYt2EuqeSkNydn/7vP+bcE27C5mb9w==", - "dependencies": { - "schema-utils": "^4.0.0", - "tapable": "^2.2.1" - }, - "engines": { - "node": ">= 12.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^5.0.0" - } - }, - "node_modules/minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "license": "ISC" - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/mrmime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz", - "integrity": "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==", - "license": "MIT", - "engines": { - "node": ">=10" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/multicast-dns": { - "version": "7.2.5", - "resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.5.tgz", - "integrity": "sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg==", - "license": "MIT", - "dependencies": { - "dns-packet": "^5.2.2", - "thunky": "^1.0.2" - }, - "bin": { - "multicast-dns": "cli.js" - } - }, - "node_modules/nanoid": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", - "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/negotiator": { - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.4.tgz", - "integrity": "sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" - }, - "node_modules/no-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", - "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", - "dependencies": { - "lower-case": "^2.0.2", - "tslib": "^2.0.3" - } - }, - "node_modules/node-emoji": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-2.2.0.tgz", - "integrity": "sha512-Z3lTE9pLaJF47NyMhd4ww1yFTAP8YhYI8SleJiHzM46Fgpm5cnNzSl9XfzFNqbaz+VlJrIj3fXQ4DeN1Rjm6cw==", - "license": "MIT", - "dependencies": { - "@sindresorhus/is": "^4.6.0", - "char-regex": "^1.0.2", - "emojilib": "^2.4.0", - "skin-tone": "^2.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/node-forge": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", - "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", - "license": "(BSD-3-Clause OR GPL-2.0)", - "engines": { - "node": ">= 6.13.0" - } - }, - "node_modules/node-releases": { - "version": "2.0.19", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", - "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", - "license": "MIT" - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/normalize-range": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", - "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/normalize-url": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.1.tgz", - "integrity": "sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==", - "license": "MIT", - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "license": "MIT", - "dependencies": { - "path-key": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/nprogress": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/nprogress/-/nprogress-0.2.0.tgz", - "integrity": "sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==" - }, - "node_modules/nth-check": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", - "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", - "dependencies": { - "boolbase": "^1.0.0" - }, - "funding": { - "url": "https://github.com/fb55/nth-check?sponsor=1" - } - }, - "node_modules/null-loader": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/null-loader/-/null-loader-4.0.1.tgz", - "integrity": "sha512-pxqVbi4U6N26lq+LmgIbB5XATP0VdZKOG25DhHi8btMmJJefGArFyDg1yc4U3hWCJbMqSrw0qyrz1UQX+qYXqg==", - "dependencies": { - "loader-utils": "^2.0.0", - "schema-utils": "^3.0.0" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^4.0.0 || ^5.0.0" - } - }, - "node_modules/null-loader/node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/null-loader/node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "peerDependencies": { - "ajv": "^6.9.1" - } - }, - "node_modules/null-loader/node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "node_modules/null-loader/node_modules/schema-utils": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", - "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", - "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.assign": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", - "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0", - "has-symbols": "^1.1.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/obuf": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", - "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", - "license": "MIT" - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "license": "MIT", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/on-headers": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.1.0.tgz", - "integrity": "sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "license": "MIT", - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/open": { - "version": "8.4.2", - "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", - "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", - "license": "MIT", - "dependencies": { - "define-lazy-prop": "^2.0.0", - "is-docker": "^2.1.1", - "is-wsl": "^2.2.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/opener": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", - "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", - "license": "(WTFPL OR MIT)", - "bin": { - "opener": "bin/opener-bin.js" - } - }, - "node_modules/p-cancelable": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", - "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", - "license": "MIT", - "engines": { - "node": ">=12.20" - } - }, - "node_modules/p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/p-limit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", - "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", - "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", - "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", - "dependencies": { - "p-limit": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-map": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "license": "MIT", - "dependencies": { - "aggregate-error": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-queue": { - "version": "6.6.2", - "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-6.6.2.tgz", - "integrity": "sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ==", - "license": "MIT", - "dependencies": { - "eventemitter3": "^4.0.4", - "p-timeout": "^3.2.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-retry": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz", - "integrity": "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==", - "license": "MIT", - "dependencies": { - "@types/retry": "0.12.0", - "retry": "^0.13.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-timeout": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", - "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", - "license": "MIT", - "dependencies": { - "p-finally": "^1.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/package-json": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-8.1.1.tgz", - "integrity": "sha512-cbH9IAIJHNj9uXi196JVsRlt7cHKak6u/e6AkL/bkRelZ7rlL3X1YKxsZwa36xipOEKAsdtmaG6aAJoM1fx2zA==", - "license": "MIT", - "dependencies": { - "got": "^12.1.0", - "registry-auth-token": "^5.0.1", - "registry-url": "^6.0.0", - "semver": "^7.3.7" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/param-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", - "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", - "license": "MIT", - "dependencies": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/parse-entities": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.1.tgz", - "integrity": "sha512-SWzvYcSJh4d/SGLIOQfZ/CoNv6BTlI6YEQ7Nj82oDVnRpwe/Z/F1EMx42x3JAOwGBlCjeCH0BRJQbQ/opHL17w==", - "dependencies": { - "@types/unist": "^2.0.0", - "character-entities": "^2.0.0", - "character-entities-legacy": "^3.0.0", - "character-reference-invalid": "^2.0.0", - "decode-named-character-reference": "^1.0.0", - "is-alphanumerical": "^2.0.0", - "is-decimal": "^2.0.0", - "is-hexadecimal": "^2.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/parse-entities/node_modules/@types/unist": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", - "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" - }, - "node_modules/parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/parse-numeric-range": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/parse-numeric-range/-/parse-numeric-range-1.3.0.tgz", - "integrity": "sha512-twN+njEipszzlMJd4ONUYgSfZPDxgHhT9Ahed5uTigpQn90FggW4SA/AIPq/6a149fTbE9qBEcSwE3FAEp6wQQ==" - }, - "node_modules/parse5": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", - "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", - "dependencies": { - "entities": "^4.4.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, - "node_modules/parse5-htmlparser2-tree-adapter": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz", - "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==", - "dependencies": { - "domhandler": "^5.0.3", - "parse5": "^7.0.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/pascal-case": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", - "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", - "license": "MIT", - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==", - "license": "(WTFPL OR MIT)" - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" - }, - "node_modules/path-to-regexp": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.9.0.tgz", - "integrity": "sha512-xIp7/apCFJuUHdDLWe8O1HIkb0kQrOMb/0u6FXQjemHn/ii5LrIzU6bdECnsiTF/GjZkMEKg1xdiZwNqDYlZ6g==", - "dependencies": { - "isarray": "0.0.1" - } - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "engines": { - "node": ">=8" - } - }, - "node_modules/periscopic": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/periscopic/-/periscopic-3.1.0.tgz", - "integrity": "sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==", - "dependencies": { - "@types/estree": "^1.0.0", - "estree-walker": "^3.0.0", - "is-reference": "^3.0.0" - } - }, - "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pkg-dir": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-7.0.0.tgz", - "integrity": "sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA==", - "dependencies": { - "find-up": "^6.3.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/postcss": { - "version": "8.5.6", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", - "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "nanoid": "^3.3.11", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/postcss-attribute-case-insensitive": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/postcss-attribute-case-insensitive/-/postcss-attribute-case-insensitive-7.0.1.tgz", - "integrity": "sha512-Uai+SupNSqzlschRyNx3kbCTWgY/2hcwtHEI/ej2LJWc9JJ77qKgGptd8DHwY1mXtZ7Aoh4z4yxfwMBue9eNgw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "postcss-selector-parser": "^7.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-attribute-case-insensitive/node_modules/postcss-selector-parser": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", - "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss-calc": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-9.0.1.tgz", - "integrity": "sha512-TipgjGyzP5QzEhsOZUaIkeO5mKeMFpebWzRogWG/ysonUlnHcq5aJe0jOjpfzUU8PeSaBQnrE8ehR0QA5vs8PQ==", - "dependencies": { - "postcss-selector-parser": "^6.0.11", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.2.2" - } - }, - "node_modules/postcss-clamp": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/postcss-clamp/-/postcss-clamp-4.1.0.tgz", - "integrity": "sha512-ry4b1Llo/9zz+PKC+030KUnPITTJAHeOwjfAyyB60eT0AorGLdzp52s31OsPRHRf8NchkgFoG2y6fCfn1IV1Ow==", - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": ">=7.6.0" - }, - "peerDependencies": { - "postcss": "^8.4.6" - } - }, - "node_modules/postcss-color-functional-notation": { - "version": "7.0.10", - "resolved": "https://registry.npmjs.org/postcss-color-functional-notation/-/postcss-color-functional-notation-7.0.10.tgz", - "integrity": "sha512-k9qX+aXHBiLTRrWoCJuUFI6F1iF6QJQUXNVWJVSbqZgj57jDhBlOvD8gNUGl35tgqDivbGLhZeW3Ongz4feuKA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/css-color-parser": "^3.0.10", - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4", - "@csstools/postcss-progressive-custom-properties": "^4.1.0", - "@csstools/utilities": "^2.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-color-hex-alpha": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/postcss-color-hex-alpha/-/postcss-color-hex-alpha-10.0.0.tgz", - "integrity": "sha512-1kervM2cnlgPs2a8Vt/Qbe5cQ++N7rkYo/2rz2BkqJZIHQwaVuJgQH38REHrAi4uM0b1fqxMkWYmese94iMp3w==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/utilities": "^2.0.0", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-color-rebeccapurple": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/postcss-color-rebeccapurple/-/postcss-color-rebeccapurple-10.0.0.tgz", - "integrity": "sha512-JFta737jSP+hdAIEhk1Vs0q0YF5P8fFcj+09pweS8ktuGuZ8pPlykHsk6mPxZ8awDl4TrcxUqJo9l1IhVr/OjQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/utilities": "^2.0.0", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-colormin": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-6.1.0.tgz", - "integrity": "sha512-x9yX7DOxeMAR+BgGVnNSAxmAj98NX/YxEMNFP+SDCEeNLb2r3i6Hh1ksMsnW8Ub5SLCpbescQqn9YEbE9554Sw==", - "dependencies": { - "browserslist": "^4.23.0", - "caniuse-api": "^3.0.0", - "colord": "^2.9.3", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-convert-values": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-6.1.0.tgz", - "integrity": "sha512-zx8IwP/ts9WvUM6NkVSkiU902QZL1bwPhaVaLynPtCsOTqp+ZKbNi+s6XJg3rfqpKGA/oc7Oxk5t8pOQJcwl/w==", - "dependencies": { - "browserslist": "^4.23.0", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-custom-media": { - "version": "11.0.6", - "resolved": "https://registry.npmjs.org/postcss-custom-media/-/postcss-custom-media-11.0.6.tgz", - "integrity": "sha512-C4lD4b7mUIw+RZhtY7qUbf4eADmb7Ey8BFA2px9jUbwg7pjTZDl4KY4bvlUV+/vXQvzQRfiGEVJyAbtOsCMInw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/cascade-layer-name-parser": "^2.0.5", - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4", - "@csstools/media-query-list-parser": "^4.0.3" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-custom-properties": { - "version": "14.0.6", - "resolved": "https://registry.npmjs.org/postcss-custom-properties/-/postcss-custom-properties-14.0.6.tgz", - "integrity": "sha512-fTYSp3xuk4BUeVhxCSJdIPhDLpJfNakZKoiTDx7yRGCdlZrSJR7mWKVOBS4sBF+5poPQFMj2YdXx1VHItBGihQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/cascade-layer-name-parser": "^2.0.5", - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4", - "@csstools/utilities": "^2.0.0", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-custom-selectors": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/postcss-custom-selectors/-/postcss-custom-selectors-8.0.5.tgz", - "integrity": "sha512-9PGmckHQswiB2usSO6XMSswO2yFWVoCAuih1yl9FVcwkscLjRKjwsjM3t+NIWpSU2Jx3eOiK2+t4vVTQaoCHHg==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/cascade-layer-name-parser": "^2.0.5", - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4", - "postcss-selector-parser": "^7.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-custom-selectors/node_modules/postcss-selector-parser": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", - "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss-dir-pseudo-class": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/postcss-dir-pseudo-class/-/postcss-dir-pseudo-class-9.0.1.tgz", - "integrity": "sha512-tRBEK0MHYvcMUrAuYMEOa0zg9APqirBcgzi6P21OhxtJyJADo/SWBwY1CAwEohQ/6HDaa9jCjLRG7K3PVQYHEA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "postcss-selector-parser": "^7.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-dir-pseudo-class/node_modules/postcss-selector-parser": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", - "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss-discard-comments": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-6.0.2.tgz", - "integrity": "sha512-65w/uIqhSBBfQmYnG92FO1mWZjJ4GL5b8atm5Yw2UgrwD7HiNiSSNwJor1eCFGzUgYnN/iIknhNRVqjrrpuglw==", - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-discard-duplicates": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-6.0.3.tgz", - "integrity": "sha512-+JA0DCvc5XvFAxwx6f/e68gQu/7Z9ud584VLmcgto28eB8FqSFZwtrLwB5Kcp70eIoWP/HXqz4wpo8rD8gpsTw==", - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-discard-empty": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-6.0.3.tgz", - "integrity": "sha512-znyno9cHKQsK6PtxL5D19Fj9uwSzC2mB74cpT66fhgOadEUPyXFkbgwm5tvc3bt3NAy8ltE5MrghxovZRVnOjQ==", - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-discard-overridden": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-6.0.2.tgz", - "integrity": "sha512-j87xzI4LUggC5zND7KdjsI25APtyMuynXZSujByMaav2roV6OZX+8AaCUcZSWqckZpjAjRyFDdpqybgjFO0HJQ==", - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-discard-unused": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/postcss-discard-unused/-/postcss-discard-unused-6.0.5.tgz", - "integrity": "sha512-wHalBlRHkaNnNwfC8z+ppX57VhvS+HWgjW508esjdaEYr3Mx7Gnn2xA4R/CKf5+Z9S5qsqC+Uzh4ueENWwCVUA==", - "dependencies": { - "postcss-selector-parser": "^6.0.16" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-double-position-gradients": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/postcss-double-position-gradients/-/postcss-double-position-gradients-6.0.2.tgz", - "integrity": "sha512-7qTqnL7nfLRyJK/AHSVrrXOuvDDzettC+wGoienURV8v2svNbu6zJC52ruZtHaO6mfcagFmuTGFdzRsJKB3k5Q==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/postcss-progressive-custom-properties": "^4.1.0", - "@csstools/utilities": "^2.0.0", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-focus-visible": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/postcss-focus-visible/-/postcss-focus-visible-10.0.1.tgz", - "integrity": "sha512-U58wyjS/I1GZgjRok33aE8juW9qQgQUNwTSdxQGuShHzwuYdcklnvK/+qOWX1Q9kr7ysbraQ6ht6r+udansalA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "postcss-selector-parser": "^7.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-focus-visible/node_modules/postcss-selector-parser": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", - "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss-focus-within": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/postcss-focus-within/-/postcss-focus-within-9.0.1.tgz", - "integrity": "sha512-fzNUyS1yOYa7mOjpci/bR+u+ESvdar6hk8XNK/TRR0fiGTp2QT5N+ducP0n3rfH/m9I7H/EQU6lsa2BrgxkEjw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "postcss-selector-parser": "^7.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-focus-within/node_modules/postcss-selector-parser": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", - "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss-font-variant": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/postcss-font-variant/-/postcss-font-variant-5.0.0.tgz", - "integrity": "sha512-1fmkBaCALD72CK2a9i468mA/+tr9/1cBxRRMXOUaZqO43oWPR5imcyPjXwuv7PXbCid4ndlP5zWhidQVVa3hmA==", - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-gap-properties": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/postcss-gap-properties/-/postcss-gap-properties-6.0.0.tgz", - "integrity": "sha512-Om0WPjEwiM9Ru+VhfEDPZJAKWUd0mV1HmNXqp2C29z80aQ2uP9UVhLc7e3aYMIor/S5cVhoPgYQ7RtfeZpYTRw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-image-set-function": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/postcss-image-set-function/-/postcss-image-set-function-7.0.0.tgz", - "integrity": "sha512-QL7W7QNlZuzOwBTeXEmbVckNt1FSmhQtbMRvGGqqU4Nf4xk6KUEQhAoWuMzwbSv5jxiRiSZ5Tv7eiDB9U87znA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/utilities": "^2.0.0", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-lab-function": { - "version": "7.0.10", - "resolved": "https://registry.npmjs.org/postcss-lab-function/-/postcss-lab-function-7.0.10.tgz", - "integrity": "sha512-tqs6TCEv9tC1Riq6fOzHuHcZyhg4k3gIAMB8GGY/zA1ssGdm6puHMVE7t75aOSoFg7UD2wyrFFhbldiCMyyFTQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/css-color-parser": "^3.0.10", - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4", - "@csstools/postcss-progressive-custom-properties": "^4.1.0", - "@csstools/utilities": "^2.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-loader": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-7.3.4.tgz", - "integrity": "sha512-iW5WTTBSC5BfsBJ9daFMPVrLT36MrNiC6fqOZTTaHjBNX6Pfd5p+hSBqe/fEeNd7pc13QiAyGt7VdGMw4eRC4A==", - "dependencies": { - "cosmiconfig": "^8.3.5", - "jiti": "^1.20.0", - "semver": "^7.5.4" - }, - "engines": { - "node": ">= 14.15.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "postcss": "^7.0.0 || ^8.0.1", - "webpack": "^5.0.0" - } - }, - "node_modules/postcss-logical": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/postcss-logical/-/postcss-logical-8.1.0.tgz", - "integrity": "sha512-pL1hXFQ2fEXNKiNiAgtfA005T9FBxky5zkX6s4GZM2D8RkVgRqz3f4g1JUoq925zXv495qk8UNldDwh8uGEDoA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-merge-idents": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/postcss-merge-idents/-/postcss-merge-idents-6.0.3.tgz", - "integrity": "sha512-1oIoAsODUs6IHQZkLQGO15uGEbK3EAl5wi9SS8hs45VgsxQfMnxvt+L+zIr7ifZFIH14cfAeVe2uCTa+SPRa3g==", - "dependencies": { - "cssnano-utils": "^4.0.2", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-merge-longhand": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-6.0.5.tgz", - "integrity": "sha512-5LOiordeTfi64QhICp07nzzuTDjNSO8g5Ksdibt44d+uvIIAE1oZdRn8y/W5ZtYgRH/lnLDlvi9F8btZcVzu3w==", - "dependencies": { - "postcss-value-parser": "^4.2.0", - "stylehacks": "^6.1.1" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-merge-rules": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-6.1.1.tgz", - "integrity": "sha512-KOdWF0gju31AQPZiD+2Ar9Qjowz1LTChSjFFbS+e2sFgc4uHOp3ZvVX4sNeTlk0w2O31ecFGgrFzhO0RSWbWwQ==", - "dependencies": { - "browserslist": "^4.23.0", - "caniuse-api": "^3.0.0", - "cssnano-utils": "^4.0.2", - "postcss-selector-parser": "^6.0.16" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-minify-font-values": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-6.1.0.tgz", - "integrity": "sha512-gklfI/n+9rTh8nYaSJXlCo3nOKqMNkxuGpTn/Qm0gstL3ywTr9/WRKznE+oy6fvfolH6dF+QM4nCo8yPLdvGJg==", - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-minify-gradients": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-6.0.3.tgz", - "integrity": "sha512-4KXAHrYlzF0Rr7uc4VrfwDJ2ajrtNEpNEuLxFgwkhFZ56/7gaE4Nr49nLsQDZyUe+ds+kEhf+YAUolJiYXF8+Q==", - "dependencies": { - "colord": "^2.9.3", - "cssnano-utils": "^4.0.2", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-minify-params": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-6.1.0.tgz", - "integrity": "sha512-bmSKnDtyyE8ujHQK0RQJDIKhQ20Jq1LYiez54WiaOoBtcSuflfK3Nm596LvbtlFcpipMjgClQGyGr7GAs+H1uA==", - "dependencies": { - "browserslist": "^4.23.0", - "cssnano-utils": "^4.0.2", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-minify-selectors": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-6.0.4.tgz", - "integrity": "sha512-L8dZSwNLgK7pjTto9PzWRoMbnLq5vsZSTu8+j1P/2GB8qdtGQfn+K1uSvFgYvgh83cbyxT5m43ZZhUMTJDSClQ==", - "dependencies": { - "postcss-selector-parser": "^6.0.16" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-modules-extract-imports": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.1.0.tgz", - "integrity": "sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==", - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-modules-local-by-default": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.2.0.tgz", - "integrity": "sha512-5kcJm/zk+GJDSfw+V/42fJ5fhjL5YbFDl8nVdXkJPLLW+Vf9mTD5Xe0wqIaDnLuL2U6cDNpTr+UQ+v2HWIBhzw==", - "dependencies": { - "icss-utils": "^5.0.0", - "postcss-selector-parser": "^7.0.0", - "postcss-value-parser": "^4.1.0" - }, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-modules-local-by-default/node_modules/postcss-selector-parser": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", - "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss-modules-scope": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.2.1.tgz", - "integrity": "sha512-m9jZstCVaqGjTAuny8MdgE88scJnCiQSlSrOWcTQgM2t32UBe+MUmFSO5t7VMSfAf/FJKImAxBav8ooCHJXCJA==", - "dependencies": { - "postcss-selector-parser": "^7.0.0" - }, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-modules-scope/node_modules/postcss-selector-parser": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", - "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss-modules-values": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz", - "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==", - "dependencies": { - "icss-utils": "^5.0.0" - }, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-nesting": { - "version": "13.0.2", - "resolved": "https://registry.npmjs.org/postcss-nesting/-/postcss-nesting-13.0.2.tgz", - "integrity": "sha512-1YCI290TX+VP0U/K/aFxzHzQWHWURL+CtHMSbex1lCdpXD1SoR2sYuxDu5aNI9lPoXpKTCggFZiDJbwylU0LEQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/selector-resolve-nested": "^3.1.0", - "@csstools/selector-specificity": "^5.0.0", - "postcss-selector-parser": "^7.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-nesting/node_modules/@csstools/selector-resolve-nested": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@csstools/selector-resolve-nested/-/selector-resolve-nested-3.1.0.tgz", - "integrity": "sha512-mf1LEW0tJLKfWyvn5KdDrhpxHyuxpbNwTIwOYLIvsTffeyOf85j5oIzfG0yosxDgx/sswlqBnESYUcQH0vgZ0g==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss-selector-parser": "^7.0.0" - } - }, - "node_modules/postcss-nesting/node_modules/@csstools/selector-specificity": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-5.0.0.tgz", - "integrity": "sha512-PCqQV3c4CoVm3kdPhyeZ07VmBRdH2EpMFA/pd9OASpOEC3aXNGoqPDAZ80D0cLpMBxnmk0+yNhGsEx31hq7Gtw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss-selector-parser": "^7.0.0" - } - }, - "node_modules/postcss-nesting/node_modules/postcss-selector-parser": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", - "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss-normalize-charset": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-6.0.2.tgz", - "integrity": "sha512-a8N9czmdnrjPHa3DeFlwqst5eaL5W8jYu3EBbTTkI5FHkfMhFZh1EGbku6jhHhIzTA6tquI2P42NtZ59M/H/kQ==", - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-normalize-display-values": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-6.0.2.tgz", - "integrity": "sha512-8H04Mxsb82ON/aAkPeq8kcBbAtI5Q2a64X/mnRRfPXBq7XeogoQvReqxEfc0B4WPq1KimjezNC8flUtC3Qz6jg==", - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-normalize-positions": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-6.0.2.tgz", - "integrity": "sha512-/JFzI441OAB9O7VnLA+RtSNZvQ0NCFZDOtp6QPFo1iIyawyXg0YI3CYM9HBy1WvwCRHnPep/BvI1+dGPKoXx/Q==", - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-normalize-repeat-style": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-6.0.2.tgz", - "integrity": "sha512-YdCgsfHkJ2jEXwR4RR3Tm/iOxSfdRt7jplS6XRh9Js9PyCR/aka/FCb6TuHT2U8gQubbm/mPmF6L7FY9d79VwQ==", - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-normalize-string": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-6.0.2.tgz", - "integrity": "sha512-vQZIivlxlfqqMp4L9PZsFE4YUkWniziKjQWUtsxUiVsSSPelQydwS8Wwcuw0+83ZjPWNTl02oxlIvXsmmG+CiQ==", - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-normalize-timing-functions": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-6.0.2.tgz", - "integrity": "sha512-a+YrtMox4TBtId/AEwbA03VcJgtyW4dGBizPl7e88cTFULYsprgHWTbfyjSLyHeBcK/Q9JhXkt2ZXiwaVHoMzA==", - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-normalize-unicode": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-6.1.0.tgz", - "integrity": "sha512-QVC5TQHsVj33otj8/JD869Ndr5Xcc/+fwRh4HAsFsAeygQQXm+0PySrKbr/8tkDKzW+EVT3QkqZMfFrGiossDg==", - "dependencies": { - "browserslist": "^4.23.0", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-normalize-url": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-6.0.2.tgz", - "integrity": "sha512-kVNcWhCeKAzZ8B4pv/DnrU1wNh458zBNp8dh4y5hhxih5RZQ12QWMuQrDgPRw3LRl8mN9vOVfHl7uhvHYMoXsQ==", - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-normalize-whitespace": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-6.0.2.tgz", - "integrity": "sha512-sXZ2Nj1icbJOKmdjXVT9pnyHQKiSAyuNQHSgRCUgThn2388Y9cGVDR+E9J9iAYbSbLHI+UUwLVl1Wzco/zgv0Q==", - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-opacity-percentage": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/postcss-opacity-percentage/-/postcss-opacity-percentage-3.0.0.tgz", - "integrity": "sha512-K6HGVzyxUxd/VgZdX04DCtdwWJ4NGLG212US4/LA1TLAbHgmAsTWVR86o+gGIbFtnTkfOpb9sCRBx8K7HO66qQ==", - "funding": [ - { - "type": "kofi", - "url": "https://ko-fi.com/mrcgrtz" - }, - { - "type": "liberapay", - "url": "https://liberapay.com/mrcgrtz" - } - ], - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-ordered-values": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-6.0.2.tgz", - "integrity": "sha512-VRZSOB+JU32RsEAQrO94QPkClGPKJEL/Z9PCBImXMhIeK5KAYo6slP/hBYlLgrCjFxyqvn5VC81tycFEDBLG1Q==", - "dependencies": { - "cssnano-utils": "^4.0.2", - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-overflow-shorthand": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/postcss-overflow-shorthand/-/postcss-overflow-shorthand-6.0.0.tgz", - "integrity": "sha512-BdDl/AbVkDjoTofzDQnwDdm/Ym6oS9KgmO7Gr+LHYjNWJ6ExORe4+3pcLQsLA9gIROMkiGVjjwZNoL/mpXHd5Q==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-page-break": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/postcss-page-break/-/postcss-page-break-3.0.4.tgz", - "integrity": "sha512-1JGu8oCjVXLa9q9rFTo4MbeeA5FMe00/9C7lN4va606Rdb+HkxXtXsmEDrIraQ11fGz/WvKWa8gMuCKkrXpTsQ==", - "peerDependencies": { - "postcss": "^8" - } - }, - "node_modules/postcss-place": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/postcss-place/-/postcss-place-10.0.0.tgz", - "integrity": "sha512-5EBrMzat2pPAxQNWYavwAfoKfYcTADJ8AXGVPcUZ2UkNloUTWzJQExgrzrDkh3EKzmAx1evfTAzF9I8NGcc+qw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-preset-env": { - "version": "10.2.4", - "resolved": "https://registry.npmjs.org/postcss-preset-env/-/postcss-preset-env-10.2.4.tgz", - "integrity": "sha512-q+lXgqmTMdB0Ty+EQ31SuodhdfZetUlwCA/F0zRcd/XdxjzI+Rl2JhZNz5US2n/7t9ePsvuhCnEN4Bmu86zXlA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "@csstools/postcss-cascade-layers": "^5.0.2", - "@csstools/postcss-color-function": "^4.0.10", - "@csstools/postcss-color-mix-function": "^3.0.10", - "@csstools/postcss-color-mix-variadic-function-arguments": "^1.0.0", - "@csstools/postcss-content-alt-text": "^2.0.6", - "@csstools/postcss-exponential-functions": "^2.0.9", - "@csstools/postcss-font-format-keywords": "^4.0.0", - "@csstools/postcss-gamut-mapping": "^2.0.10", - "@csstools/postcss-gradients-interpolation-method": "^5.0.10", - "@csstools/postcss-hwb-function": "^4.0.10", - "@csstools/postcss-ic-unit": "^4.0.2", - "@csstools/postcss-initial": "^2.0.1", - "@csstools/postcss-is-pseudo-class": "^5.0.3", - "@csstools/postcss-light-dark-function": "^2.0.9", - "@csstools/postcss-logical-float-and-clear": "^3.0.0", - "@csstools/postcss-logical-overflow": "^2.0.0", - "@csstools/postcss-logical-overscroll-behavior": "^2.0.0", - "@csstools/postcss-logical-resize": "^3.0.0", - "@csstools/postcss-logical-viewport-units": "^3.0.4", - "@csstools/postcss-media-minmax": "^2.0.9", - "@csstools/postcss-media-queries-aspect-ratio-number-values": "^3.0.5", - "@csstools/postcss-nested-calc": "^4.0.0", - "@csstools/postcss-normalize-display-values": "^4.0.0", - "@csstools/postcss-oklab-function": "^4.0.10", - "@csstools/postcss-progressive-custom-properties": "^4.1.0", - "@csstools/postcss-random-function": "^2.0.1", - "@csstools/postcss-relative-color-syntax": "^3.0.10", - "@csstools/postcss-scope-pseudo-class": "^4.0.1", - "@csstools/postcss-sign-functions": "^1.1.4", - "@csstools/postcss-stepped-value-functions": "^4.0.9", - "@csstools/postcss-text-decoration-shorthand": "^4.0.2", - "@csstools/postcss-trigonometric-functions": "^4.0.9", - "@csstools/postcss-unset-value": "^4.0.0", - "autoprefixer": "^10.4.21", - "browserslist": "^4.25.0", - "css-blank-pseudo": "^7.0.1", - "css-has-pseudo": "^7.0.2", - "css-prefers-color-scheme": "^10.0.0", - "cssdb": "^8.3.0", - "postcss-attribute-case-insensitive": "^7.0.1", - "postcss-clamp": "^4.1.0", - "postcss-color-functional-notation": "^7.0.10", - "postcss-color-hex-alpha": "^10.0.0", - "postcss-color-rebeccapurple": "^10.0.0", - "postcss-custom-media": "^11.0.6", - "postcss-custom-properties": "^14.0.6", - "postcss-custom-selectors": "^8.0.5", - "postcss-dir-pseudo-class": "^9.0.1", - "postcss-double-position-gradients": "^6.0.2", - "postcss-focus-visible": "^10.0.1", - "postcss-focus-within": "^9.0.1", - "postcss-font-variant": "^5.0.0", - "postcss-gap-properties": "^6.0.0", - "postcss-image-set-function": "^7.0.0", - "postcss-lab-function": "^7.0.10", - "postcss-logical": "^8.1.0", - "postcss-nesting": "^13.0.2", - "postcss-opacity-percentage": "^3.0.0", - "postcss-overflow-shorthand": "^6.0.0", - "postcss-page-break": "^3.0.4", - "postcss-place": "^10.0.0", - "postcss-pseudo-class-any-link": "^10.0.1", - "postcss-replace-overflow-wrap": "^4.0.0", - "postcss-selector-not": "^8.0.1" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-pseudo-class-any-link": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/postcss-pseudo-class-any-link/-/postcss-pseudo-class-any-link-10.0.1.tgz", - "integrity": "sha512-3el9rXlBOqTFaMFkWDOkHUTQekFIYnaQY55Rsp8As8QQkpiSgIYEcF/6Ond93oHiDsGb4kad8zjt+NPlOC1H0Q==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "postcss-selector-parser": "^7.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-pseudo-class-any-link/node_modules/postcss-selector-parser": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", - "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss-reduce-idents": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/postcss-reduce-idents/-/postcss-reduce-idents-6.0.3.tgz", - "integrity": "sha512-G3yCqZDpsNPoQgbDUy3T0E6hqOQ5xigUtBQyrmq3tn2GxlyiL0yyl7H+T8ulQR6kOcHJ9t7/9H4/R2tv8tJbMA==", - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-reduce-initial": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-6.1.0.tgz", - "integrity": "sha512-RarLgBK/CrL1qZags04oKbVbrrVK2wcxhvta3GCxrZO4zveibqbRPmm2VI8sSgCXwoUHEliRSbOfpR0b/VIoiw==", - "dependencies": { - "browserslist": "^4.23.0", - "caniuse-api": "^3.0.0" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-reduce-transforms": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-6.0.2.tgz", - "integrity": "sha512-sB+Ya++3Xj1WaT9+5LOOdirAxP7dJZms3GRcYheSPi1PiTMigsxHAdkrbItHxwYHr4kt1zL7mmcHstgMYT+aiA==", - "dependencies": { - "postcss-value-parser": "^4.2.0" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-replace-overflow-wrap": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/postcss-replace-overflow-wrap/-/postcss-replace-overflow-wrap-4.0.0.tgz", - "integrity": "sha512-KmF7SBPphT4gPPcKZc7aDkweHiKEEO8cla/GjcBK+ckKxiZslIu3C4GCRW3DNfL0o7yW7kMQu9xlZ1kXRXLXtw==", - "peerDependencies": { - "postcss": "^8.0.3" - } - }, - "node_modules/postcss-selector-not": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/postcss-selector-not/-/postcss-selector-not-8.0.1.tgz", - "integrity": "sha512-kmVy/5PYVb2UOhy0+LqUYAhKj7DUGDpSWa5LZqlkWJaaAV+dxxsOG3+St0yNLu6vsKD7Dmqx+nWQt0iil89+WA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "dependencies": { - "postcss-selector-parser": "^7.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-selector-not/node_modules/postcss-selector-parser": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", - "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss-selector-parser": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", - "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss-sort-media-queries": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/postcss-sort-media-queries/-/postcss-sort-media-queries-5.2.0.tgz", - "integrity": "sha512-AZ5fDMLD8SldlAYlvi8NIqo0+Z8xnXU2ia0jxmuhxAU+Lqt9K+AlmLNJ/zWEnE9x+Zx3qL3+1K20ATgNOr3fAA==", - "dependencies": { - "sort-css-media-queries": "2.2.0" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "postcss": "^8.4.23" - } - }, - "node_modules/postcss-svgo": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-6.0.3.tgz", - "integrity": "sha512-dlrahRmxP22bX6iKEjOM+c8/1p+81asjKT+V5lrgOH944ryx/OHpclnIbGsKVd3uWOXFLYJwCVf0eEkJGvO96g==", - "dependencies": { - "postcss-value-parser": "^4.2.0", - "svgo": "^3.2.0" - }, - "engines": { - "node": "^14 || ^16 || >= 18" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-unique-selectors": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-6.0.4.tgz", - "integrity": "sha512-K38OCaIrO8+PzpArzkLKB42dSARtC2tmG6PvD4b1o1Q2E9Os8jzfWFfSy/rixsHwohtsDdFtAWGjFVFUdwYaMg==", - "dependencies": { - "postcss-selector-parser": "^6.0.16" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/postcss-value-parser": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", - "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" - }, - "node_modules/postcss-zindex": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/postcss-zindex/-/postcss-zindex-6.0.2.tgz", - "integrity": "sha512-5BxW9l1evPB/4ZIc+2GobEBoKC+h8gPGCMi+jxsYvd2x0mjq7wazk6DrP71pStqxE9Foxh5TVnonbWpFZzXaYg==", - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/pretty-error": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-4.0.0.tgz", - "integrity": "sha512-AoJ5YMAcXKYxKhuJGdcvse+Voc6v1RgnsR3nWcYU7q4t6z0Q6T86sv5Zq8VIRbOWWFpvdGE83LtdSMNd+6Y0xw==", - "license": "MIT", - "dependencies": { - "lodash": "^4.17.20", - "renderkid": "^3.0.0" - } - }, - "node_modules/pretty-time": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pretty-time/-/pretty-time-1.1.0.tgz", - "integrity": "sha512-28iF6xPQrP8Oa6uxE6a1biz+lWeTOAPKggvjB8HAs6nVMKZwf5bG++632Dx614hIWgUPkgivRfG+a8uAXGTIbA==", - "engines": { - "node": ">=4" - } - }, - "node_modules/prism-react-renderer": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/prism-react-renderer/-/prism-react-renderer-2.4.1.tgz", - "integrity": "sha512-ey8Ls/+Di31eqzUxC46h8MksNuGx/n0AAC8uKpwFau4RPDYLuE3EXTp8N8G2vX2N7UC/+IXeNUnlWBGGcAG+Ig==", - "dependencies": { - "@types/prismjs": "^1.26.0", - "clsx": "^2.0.0" - }, - "peerDependencies": { - "react": ">=16.0.0" - } - }, - "node_modules/prismjs": { - "version": "1.30.0", - "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz", - "integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==", - "engines": { - "node": ">=6" - } - }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "license": "MIT" - }, - "node_modules/prompts": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", - "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", - "dependencies": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, - "node_modules/property-information": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.5.0.tgz", - "integrity": "sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/proto-list": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", - "license": "ISC" - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "license": "MIT", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/proxy-addr/node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/pupa": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/pupa/-/pupa-3.1.0.tgz", - "integrity": "sha512-FLpr4flz5xZTSJxSeaheeMKN/EDzMdK7b8PTOC6a5PYFKTucWbdqjgqaEyH0shFiSJrVB1+Qqi4Tk19ccU6Aug==", - "license": "MIT", - "dependencies": { - "escape-goat": "^4.0.0" - }, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/qs": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", - "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", - "license": "BSD-3-Clause", - "dependencies": { - "side-channel": "^1.0.6" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/quick-lru": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, - "node_modules/range-parser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "integrity": "sha512-kA5WQoNVo4t9lNx2kQNFCxKeBl5IbbSNBl1M/tLkw9WCn+hxNBAW5Qh8gdhs63CJnhjJ2zQWFoqPJP2sK1AV5A==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", - "license": "MIT", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/raw-body/node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", - "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "bin": { - "rc": "cli.js" - } - }, - "node_modules/rc/node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/react": { - "version": "19.1.1", - "resolved": "https://registry.npmjs.org/react/-/react-19.1.1.tgz", - "integrity": "sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/react-dom": { - "version": "19.1.1", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.1.tgz", - "integrity": "sha512-Dlq/5LAZgF0Gaz6yiqZCf6VCcZs1ghAJyrsu84Q/GT0gV+mCxbfmKNoGRKBYMJ8IEdGPqu49YWXD02GCknEDkw==", - "license": "MIT", - "dependencies": { - "scheduler": "^0.26.0" - }, - "peerDependencies": { - "react": "^19.1.1" - } - }, - "node_modules/react-fast-compare": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.2.tgz", - "integrity": "sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==", - "license": "MIT" - }, - "node_modules/react-helmet-async": { - "name": "@slorber/react-helmet-async", - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@slorber/react-helmet-async/-/react-helmet-async-1.3.0.tgz", - "integrity": "sha512-e9/OK8VhwUSc67diWI8Rb3I0YgI9/SBQtnhe9aEuK6MhZm7ntZZimXgwXnd8W96YTmSOb9M4d8LwhRZyhWr/1A==", - "license": "Apache-2.0", - "dependencies": { - "@babel/runtime": "^7.12.5", - "invariant": "^2.2.4", - "prop-types": "^15.7.2", - "react-fast-compare": "^3.2.0", - "shallowequal": "^1.1.0" - }, - "peerDependencies": { - "react": "^16.6.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", - "react-dom": "^16.6.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - } - }, - "node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, - "node_modules/react-json-view-lite": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/react-json-view-lite/-/react-json-view-lite-2.4.1.tgz", - "integrity": "sha512-fwFYknRIBxjbFm0kBDrzgBy1xa5tDg2LyXXBepC5f1b+MY3BUClMCsvanMPn089JbV1Eg3nZcrp0VCuH43aXnA==", - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0" - } - }, - "node_modules/react-loadable": { - "name": "@docusaurus/react-loadable", - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@docusaurus/react-loadable/-/react-loadable-6.0.0.tgz", - "integrity": "sha512-YMMxTUQV/QFSnbgrP3tjDzLHRg7vsbMn8e9HAa8o/1iXoiomo48b7sk/kkmWEuWNDPJVlKSJRB6Y2fHqdJk+SQ==", - "dependencies": { - "@types/react": "*" - }, - "peerDependencies": { - "react": "*" - } - }, - "node_modules/react-loadable-ssr-addon-v5-slorber": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/react-loadable-ssr-addon-v5-slorber/-/react-loadable-ssr-addon-v5-slorber-1.0.1.tgz", - "integrity": "sha512-lq3Lyw1lGku8zUEJPDxsNm1AfYHBrO9Y1+olAYwpUJ2IGFBskM0DMKok97A6LWUpHm+o7IvQBOWu9MLenp9Z+A==", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.10.3" - }, - "engines": { - "node": ">=10.13.0" - }, - "peerDependencies": { - "react-loadable": "*", - "webpack": ">=4.41.1 || 5.x" - } - }, - "node_modules/react-router": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", - "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==", - "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "hoist-non-react-statics": "^3.1.0", - "loose-envify": "^1.3.1", - "path-to-regexp": "^1.7.0", - "prop-types": "^15.6.2", - "react-is": "^16.6.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" - }, - "peerDependencies": { - "react": ">=15" - } - }, - "node_modules/react-router-config": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/react-router-config/-/react-router-config-5.1.1.tgz", - "integrity": "sha512-DuanZjaD8mQp1ppHjgnnUnyOlqYXZVjnov/JzFhjLEwd3Z4dYjMSnqrEzzGThH47vpCOqPPwJM2FtthLeJ8Pbg==", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.1.2" - }, - "peerDependencies": { - "react": ">=15", - "react-router": ">=5" - } - }, - "node_modules/react-router-dom": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz", - "integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==", - "dependencies": { - "@babel/runtime": "^7.12.13", - "history": "^4.9.0", - "loose-envify": "^1.3.1", - "prop-types": "^15.6.2", - "react-router": "5.3.4", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" - }, - "peerDependencies": { - "react": ">=15" - } - }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "license": "MIT", - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/regenerate": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", - "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==" - }, - "node_modules/regenerate-unicode-properties": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.2.0.tgz", - "integrity": "sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA==", - "dependencies": { - "regenerate": "^1.4.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/regenerator-runtime": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" - }, - "node_modules/regenerator-transform": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.2.tgz", - "integrity": "sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==", - "dependencies": { - "@babel/runtime": "^7.8.4" - } - }, - "node_modules/regexpu-core": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-6.2.0.tgz", - "integrity": "sha512-H66BPQMrv+V16t8xtmq+UC0CBpiTBA60V8ibS1QVReIp8T1z8hwFxqcGzm9K6lgsN7sB5edVH8a+ze6Fqm4weA==", - "dependencies": { - "regenerate": "^1.4.2", - "regenerate-unicode-properties": "^10.2.0", - "regjsgen": "^0.8.0", - "regjsparser": "^0.12.0", - "unicode-match-property-ecmascript": "^2.0.0", - "unicode-match-property-value-ecmascript": "^2.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/registry-auth-token": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.1.0.tgz", - "integrity": "sha512-GdekYuwLXLxMuFTwAPg5UKGLW/UXzQrZvH/Zj791BQif5T05T0RsaLfHc9q3ZOKi7n+BoprPD9mJ0O0k4xzUlw==", - "license": "MIT", - "dependencies": { - "@pnpm/npm-conf": "^2.1.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/registry-url": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-6.0.1.tgz", - "integrity": "sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==", - "license": "MIT", - "dependencies": { - "rc": "1.2.8" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/regjsgen": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.8.0.tgz", - "integrity": "sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q==" - }, - "node_modules/regjsparser": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.12.0.tgz", - "integrity": "sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ==", - "dependencies": { - "jsesc": "~3.0.2" - }, - "bin": { - "regjsparser": "bin/parser" - } - }, - "node_modules/rehype-raw": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-7.0.0.tgz", - "integrity": "sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww==", - "license": "MIT", - "dependencies": { - "@types/hast": "^3.0.0", - "hast-util-raw": "^9.0.0", - "vfile": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/relateurl": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", - "integrity": "sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==", - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/remark-directive": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/remark-directive/-/remark-directive-3.0.1.tgz", - "integrity": "sha512-gwglrEQEZcZYgVyG1tQuA+h58EZfq5CSULw7J90AFuCTyib1thgHPoqQ+h9iFvU6R+vnZ5oNFQR5QKgGpk741A==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "mdast-util-directive": "^3.0.0", - "micromark-extension-directive": "^3.0.0", - "unified": "^11.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-emoji": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/remark-emoji/-/remark-emoji-4.0.1.tgz", - "integrity": "sha512-fHdvsTR1dHkWKev9eNyhTo4EFwbUvJ8ka9SgeWkMPYFX4WoI7ViVBms3PjlQYgw5TLvNQso3GUB/b/8t3yo+dg==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.2", - "emoticon": "^4.0.1", - "mdast-util-find-and-replace": "^3.0.1", - "node-emoji": "^2.1.0", - "unified": "^11.0.4" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/remark-frontmatter": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/remark-frontmatter/-/remark-frontmatter-5.0.0.tgz", - "integrity": "sha512-XTFYvNASMe5iPN0719nPrdItC9aU0ssC4v14mH1BCi1u0n1gAocqcujWUrByftZTbLhRtiKRyjYTSIOcr69UVQ==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "mdast-util-frontmatter": "^2.0.0", - "micromark-extension-frontmatter": "^2.0.0", - "unified": "^11.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-gfm": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.1.tgz", - "integrity": "sha512-1quofZ2RQ9EWdeN34S79+KExV1764+wCUGop5CPL1WGdD0ocPpu91lzPGbwWMECpEpd42kJGQwzRfyov9j4yNg==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "mdast-util-gfm": "^3.0.0", - "micromark-extension-gfm": "^3.0.0", - "remark-parse": "^11.0.0", - "remark-stringify": "^11.0.0", - "unified": "^11.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-mdx": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-3.0.1.tgz", - "integrity": "sha512-3Pz3yPQ5Rht2pM5R+0J2MrGoBSrzf+tJG94N+t/ilfdh8YLyyKYtidAYwTveB20BoHAcwIopOUqhcmh2F7hGYA==", - "dependencies": { - "mdast-util-mdx": "^3.0.0", - "micromark-extension-mdxjs": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-parse": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", - "integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==", - "dependencies": { - "@types/mdast": "^4.0.0", - "mdast-util-from-markdown": "^2.0.0", - "micromark-util-types": "^2.0.0", - "unified": "^11.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-rehype": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.0.tgz", - "integrity": "sha512-z3tJrAs2kIs1AqIIy6pzHmAHlF1hWQ+OdY4/hv+Wxe35EhyLKcajL33iUEn3ScxtFox9nUvRufR/Zre8Q08H/g==", - "dependencies": { - "@types/hast": "^3.0.0", - "@types/mdast": "^4.0.0", - "mdast-util-to-hast": "^13.0.0", - "unified": "^11.0.0", - "vfile": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-stringify": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-11.0.0.tgz", - "integrity": "sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "mdast-util-to-markdown": "^2.0.0", - "unified": "^11.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/renderkid": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/renderkid/-/renderkid-3.0.0.tgz", - "integrity": "sha512-q/7VIQA8lmM1hF+jn+sFSPWGlMkSAeNYcPLmDQx2zzuiDfaLrOmumR8iaUKlenFgh0XRPIUeSPlH3A+AW3Z5pg==", - "license": "MIT", - "dependencies": { - "css-select": "^4.1.3", - "dom-converter": "^0.2.0", - "htmlparser2": "^6.1.0", - "lodash": "^4.17.21", - "strip-ansi": "^6.0.1" - } - }, - "node_modules/renderkid/node_modules/css-select": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz", - "integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==", - "license": "BSD-2-Clause", - "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^6.0.1", - "domhandler": "^4.3.1", - "domutils": "^2.8.0", - "nth-check": "^2.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/renderkid/node_modules/dom-serializer": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz", - "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", - "license": "MIT", - "dependencies": { - "domelementtype": "^2.0.1", - "domhandler": "^4.2.0", - "entities": "^2.0.0" - }, - "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" - } - }, - "node_modules/renderkid/node_modules/domhandler": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", - "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", - "license": "BSD-2-Clause", - "dependencies": { - "domelementtype": "^2.2.0" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" - } - }, - "node_modules/renderkid/node_modules/domutils": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", - "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", - "license": "BSD-2-Clause", - "dependencies": { - "dom-serializer": "^1.0.1", - "domelementtype": "^2.2.0", - "domhandler": "^4.2.0" - }, - "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" - } - }, - "node_modules/renderkid/node_modules/entities": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", - "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", - "license": "BSD-2-Clause", - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, - "node_modules/renderkid/node_modules/htmlparser2": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz", - "integrity": "sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==", - "funding": [ - "https://github.com/fb55/htmlparser2?sponsor=1", - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ], - "license": "MIT", - "dependencies": { - "domelementtype": "^2.0.1", - "domhandler": "^4.0.0", - "domutils": "^2.5.2", - "entities": "^2.0.0" - } - }, - "node_modules/repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", - "engines": { - "node": ">=0.10" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/require-like": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/require-like/-/require-like-0.1.2.tgz", - "integrity": "sha512-oyrU88skkMtDdauHDuKVrgR+zuItqr6/c//FXzvmxRGMexSDc6hNvJInGW3LL46n+8b50RykrvwSUIIQH2LQ5A==", - "engines": { - "node": "*" - } - }, - "node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "license": "MIT" - }, - "node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", - "dependencies": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve-alpn": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", - "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", - "license": "MIT" - }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "engines": { - "node": ">=4" - } - }, - "node_modules/resolve-pathname": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", - "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" - }, - "node_modules/responselike": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", - "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", - "license": "MIT", - "dependencies": { - "lowercase-keys": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/retry": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", - "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rtlcss": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/rtlcss/-/rtlcss-4.3.0.tgz", - "integrity": "sha512-FI+pHEn7Wc4NqKXMXFM+VAYKEj/mRIcW4h24YVwVtyjI+EqGrLc2Hx/Ny0lrZ21cBWU2goLy36eqMcNj3AQJig==", - "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0", - "postcss": "^8.4.21", - "strip-json-comments": "^3.1.1" - }, - "bin": { - "rtlcss": "bin/rtlcss.js" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "license": "MIT" - }, - "node_modules/sax": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", - "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==" - }, - "node_modules/scheduler": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz", - "integrity": "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==", - "license": "MIT" - }, - "node_modules/schema-dts": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/schema-dts/-/schema-dts-1.1.5.tgz", - "integrity": "sha512-RJr9EaCmsLzBX2NDiO5Z3ux2BVosNZN5jo0gWgsyKvxKIUL5R3swNvoorulAeL9kLB0iTSX7V6aokhla2m7xbg==" - }, - "node_modules/schema-utils": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.0.tgz", - "integrity": "sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g==", - "license": "MIT", - "dependencies": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.9.0", - "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.1.0" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/search-insights": { - "version": "2.17.3", - "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.17.3.tgz", - "integrity": "sha512-RQPdCYTa8A68uM2jwxoY842xDhvx3E5LFL1LxvxCNMev4o5mLuokczhzjAgGwUZBAmOKZknArSxLKmXtIi2AxQ==", - "peer": true - }, - "node_modules/section-matter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", - "integrity": "sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==", - "dependencies": { - "extend-shallow": "^2.0.1", - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/select-hose": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", - "integrity": "sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg==", - "license": "MIT" - }, - "node_modules/selfsigned": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-2.4.1.tgz", - "integrity": "sha512-th5B4L2U+eGLq1TVh7zNRGBapioSORUeymIydxgFpwww9d2qyKvtuPU2jJuHvYAwwqi2Y596QBL3eEqcPEYL8Q==", - "license": "MIT", - "dependencies": { - "@types/node-forge": "^1.3.0", - "node-forge": "^1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/semver": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", - "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/semver-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-4.0.0.tgz", - "integrity": "sha512-0Ju4+6A8iOnpL/Thra7dZsSlOHYAHIeMxfhWQRI1/VLcT3WDBZKKtQt/QkBOsiIN9ZpuvHE6cGZ0x4glCMmfiA==", - "license": "MIT", - "dependencies": { - "semver": "^7.3.5" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/send": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", - "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", - "license": "MIT", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/send/node_modules/debug/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT" - }, - "node_modules/send/node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" - }, - "node_modules/send/node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/serialize-javascript": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", - "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", - "dependencies": { - "randombytes": "^2.1.0" - } - }, - "node_modules/serve-handler": { - "version": "6.1.6", - "resolved": "https://registry.npmjs.org/serve-handler/-/serve-handler-6.1.6.tgz", - "integrity": "sha512-x5RL9Y2p5+Sh3D38Fh9i/iQ5ZK+e4xuXRd/pGbM4D13tgo/MGwbttUk8emytcr1YYzBYs+apnUngBDFYfpjPuQ==", - "license": "MIT", - "dependencies": { - "bytes": "3.0.0", - "content-disposition": "0.5.2", - "mime-types": "2.1.18", - "minimatch": "3.1.2", - "path-is-inside": "1.0.2", - "path-to-regexp": "3.3.0", - "range-parser": "1.2.0" - } - }, - "node_modules/serve-handler/node_modules/path-to-regexp": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.3.0.tgz", - "integrity": "sha512-qyCH421YQPS2WFDxDjftfc1ZR5WKQzVzqsp4n9M2kQhVOo/ByahFoUNJfl58kOcEGfQ//7weFTDhm+ss8Ecxgw==", - "license": "MIT" - }, - "node_modules/serve-index": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", - "integrity": "sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==", - "license": "MIT", - "dependencies": { - "accepts": "~1.3.4", - "batch": "0.6.1", - "debug": "2.6.9", - "escape-html": "~1.0.3", - "http-errors": "~1.6.2", - "mime-types": "~2.1.17", - "parseurl": "~1.3.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/serve-index/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/serve-index/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/serve-index/node_modules/http-errors": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==", - "license": "MIT", - "dependencies": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.0", - "statuses": ">= 1.4.0 < 2" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/serve-index/node_modules/inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", - "license": "ISC" - }, - "node_modules/serve-index/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT" - }, - "node_modules/serve-index/node_modules/setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", - "license": "ISC" - }, - "node_modules/serve-index/node_modules/statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/serve-static": { - "version": "1.16.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", - "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", - "license": "MIT", - "dependencies": { - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.19.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "license": "ISC" - }, - "node_modules/shallow-clone": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", - "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", - "dependencies": { - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shallowequal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", - "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==", - "license": "MIT" - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "license": "MIT", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/shell-quote": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.2.tgz", - "integrity": "sha512-AzqKpGKjrj7EM6rKVQEPpB288oCfnrEIuyoT9cyF4nmGa7V8Zk6f7RRqYisX8X9m+Q7bd632aZW4ky7EhbQztA==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", - "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3", - "side-channel-list": "^1.0.0", - "side-channel-map": "^1.0.1", - "side-channel-weakmap": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-list": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", - "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", - "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-weakmap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", - "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3", - "side-channel-map": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "license": "ISC" - }, - "node_modules/sirv": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-2.0.4.tgz", - "integrity": "sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==", - "license": "MIT", - "dependencies": { - "@polka/url": "^1.0.0-next.24", - "mrmime": "^2.0.0", - "totalist": "^3.0.0" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" - }, - "node_modules/sitemap": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/sitemap/-/sitemap-7.1.2.tgz", - "integrity": "sha512-ARCqzHJ0p4gWt+j7NlU5eDlIO9+Rkr/JhPFZKKQ1l5GCus7rJH4UdrlVAh0xC/gDS/Qir2UMxqYNHtsKr2rpCw==", - "dependencies": { - "@types/node": "^17.0.5", - "@types/sax": "^1.2.1", - "arg": "^5.0.0", - "sax": "^1.2.4" - }, - "bin": { - "sitemap": "dist/cli.js" - }, - "engines": { - "node": ">=12.0.0", - "npm": ">=5.6.0" - } - }, - "node_modules/sitemap/node_modules/@types/node": { - "version": "17.0.45", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", - "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==" - }, - "node_modules/skin-tone": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/skin-tone/-/skin-tone-2.0.0.tgz", - "integrity": "sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==", - "license": "MIT", - "dependencies": { - "unicode-emoji-modifier-base": "^1.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "engines": { - "node": ">=8" - } - }, - "node_modules/snake-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", - "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", - "dependencies": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/sockjs": { - "version": "0.3.24", - "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz", - "integrity": "sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ==", - "license": "MIT", - "dependencies": { - "faye-websocket": "^0.11.3", - "uuid": "^8.3.2", - "websocket-driver": "^0.7.4" - } - }, - "node_modules/sort-css-media-queries": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/sort-css-media-queries/-/sort-css-media-queries-2.2.0.tgz", - "integrity": "sha512-0xtkGhWCC9MGt/EzgnvbbbKhqWjl1+/rncmhTh5qCpbYguXh6S/qwePfv/JQ8jePXXmqingylxoC49pCkSPIbA==", - "engines": { - "node": ">= 6.3.0" - } - }, - "node_modules/source-map": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", - "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", - "engines": { - "node": ">= 8" - } - }, - "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/source-map-support/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/space-separated-tokens": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", - "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/spdy": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.2.tgz", - "integrity": "sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==", - "license": "MIT", - "dependencies": { - "debug": "^4.1.0", - "handle-thing": "^2.0.0", - "http-deceiver": "^1.2.7", - "select-hose": "^2.0.0", - "spdy-transport": "^3.0.0" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/spdy-transport": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz", - "integrity": "sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==", - "license": "MIT", - "dependencies": { - "debug": "^4.1.0", - "detect-node": "^2.0.4", - "hpack.js": "^2.1.6", - "obuf": "^1.1.2", - "readable-stream": "^3.0.6", - "wbuf": "^1.7.3" - } - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" - }, - "node_modules/srcset": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/srcset/-/srcset-4.0.0.tgz", - "integrity": "sha512-wvLeHgcVHKO8Sc/H/5lkGreJQVeYMm9rlmt8PuR1xE31rIuXhuzznUUqAt8MqLhB3MqJdFzlNAfpcWnxiFUcPw==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/std-env": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.9.0.tgz", - "integrity": "sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==" - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "license": "MIT", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/string-width/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/string-width/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/stringify-entities": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", - "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", - "dependencies": { - "character-entities-html4": "^2.0.0", - "character-entities-legacy": "^3.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/stringify-object": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", - "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", - "license": "BSD-2-Clause", - "dependencies": { - "get-own-enumerable-property-symbols": "^3.0.0", - "is-obj": "^1.0.1", - "is-regexp": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-bom-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", - "integrity": "sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/style-to-object": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-0.4.4.tgz", - "integrity": "sha512-HYNoHZa2GorYNyqiCaBgsxvcJIn7OHq6inEga+E6Ke3m5JkoqpQbnFssk4jwe+K7AhGa2fcha4wSOf1Kn01dMg==", - "dependencies": { - "inline-style-parser": "0.1.1" - } - }, - "node_modules/stylehacks": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-6.1.1.tgz", - "integrity": "sha512-gSTTEQ670cJNoaeIp9KX6lZmm8LJ3jPB5yJmX8Zq/wQxOsAFXV3qjWzHas3YYk1qesuVIyYWWUpZ0vSE/dTSGg==", - "dependencies": { - "browserslist": "^4.23.0", - "postcss-selector-parser": "^6.0.16" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/svg-parser": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/svg-parser/-/svg-parser-2.0.4.tgz", - "integrity": "sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==" - }, - "node_modules/svgo": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.3.2.tgz", - "integrity": "sha512-OoohrmuUlBs8B8o6MB2Aevn+pRIH9zDALSR+6hhqVfa6fRwG/Qw9VUMSMW9VNg2CFc/MTIfabtdOVl9ODIJjpw==", - "dependencies": { - "@trysound/sax": "0.2.0", - "commander": "^7.2.0", - "css-select": "^5.1.0", - "css-tree": "^2.3.1", - "css-what": "^6.1.0", - "csso": "^5.0.5", - "picocolors": "^1.0.0" - }, - "bin": { - "svgo": "bin/svgo" - }, - "engines": { - "node": ">=14.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/svgo" - } - }, - "node_modules/svgo/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "engines": { - "node": ">= 10" - } - }, - "node_modules/tapable": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", - "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", - "engines": { - "node": ">=6" - } - }, - "node_modules/terser": { - "version": "5.31.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.1.tgz", - "integrity": "sha512-37upzU1+viGvuFtBo9NPufCb9dwM0+l9hMxYyWfBA+fbwrPqNJAhbZ6W47bBFnZHKHTUBnMvi87434qq+qnxOg==", - "dependencies": { - "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.8.2", - "commander": "^2.20.0", - "source-map-support": "~0.5.20" - }, - "bin": { - "terser": "bin/terser" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/terser-webpack-plugin": { - "version": "5.3.10", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", - "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.20", - "jest-worker": "^27.4.5", - "schema-utils": "^3.1.1", - "serialize-javascript": "^6.0.1", - "terser": "^5.26.0" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^5.1.0" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "esbuild": { - "optional": true - }, - "uglify-js": { - "optional": true - } - } - }, - "node_modules/terser-webpack-plugin/node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/terser-webpack-plugin/node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "peerDependencies": { - "ajv": "^6.9.1" - } - }, - "node_modules/terser-webpack-plugin/node_modules/jest-worker": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", - "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", - "dependencies": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "engines": { - "node": ">= 10.13.0" - } - }, - "node_modules/terser-webpack-plugin/node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "node_modules/terser-webpack-plugin/node_modules/schema-utils": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", - "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", - "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/terser-webpack-plugin/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/terser/node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" - }, - "node_modules/thunky": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", - "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", - "license": "MIT" - }, - "node_modules/tiny-invariant": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", - "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==" - }, - "node_modules/tiny-warning": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", - "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" - }, - "node_modules/tinypool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.0.tgz", - "integrity": "sha512-7CotroY9a8DKsKprEy/a14aCCm8jYVmR7aFy4fpkZM8sdpNJbKkixuNjgM50yCmip2ezc8z4N7k3oe2+rfRJCQ==", - "license": "MIT", - "engines": { - "node": "^18.0.0 || >=20.0.0" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "license": "MIT", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/totalist": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", - "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/trim-lines": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", - "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/trough": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz", - "integrity": "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/tslib": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", - "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==" - }, - "node_modules/type-fest": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", - "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "license": "MIT", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/type-is/node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/type-is/node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "license": "MIT", - "dependencies": { - "is-typedarray": "^1.0.0" - } - }, - "node_modules/typescript": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz", - "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", - "optional": true, - "peer": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" - }, - "node_modules/unicode-canonical-property-names-ecmascript": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz", - "integrity": "sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg==", - "engines": { - "node": ">=4" - } - }, - "node_modules/unicode-emoji-modifier-base": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unicode-emoji-modifier-base/-/unicode-emoji-modifier-base-1.0.0.tgz", - "integrity": "sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/unicode-match-property-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", - "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", - "dependencies": { - "unicode-canonical-property-names-ecmascript": "^2.0.0", - "unicode-property-aliases-ecmascript": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/unicode-match-property-value-ecmascript": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.2.0.tgz", - "integrity": "sha512-4IehN3V/+kkr5YeSSDDQG8QLqO26XpL2XP3GQtqwlT/QYSECAwFztxVHjlbh0+gjJ3XmNLS0zDsbgs9jWKExLg==", - "engines": { - "node": ">=4" - } - }, - "node_modules/unicode-property-aliases-ecmascript": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz", - "integrity": "sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==", - "engines": { - "node": ">=4" - } - }, - "node_modules/unified": { - "version": "11.0.5", - "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz", - "integrity": "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==", - "dependencies": { - "@types/unist": "^3.0.0", - "bail": "^2.0.0", - "devlop": "^1.0.0", - "extend": "^3.0.0", - "is-plain-obj": "^4.0.0", - "trough": "^2.0.0", - "vfile": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unique-string": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", - "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", - "license": "MIT", - "dependencies": { - "crypto-random-string": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/unist-util-is": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", - "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-position": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", - "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-position-from-estree": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unist-util-position-from-estree/-/unist-util-position-from-estree-2.0.0.tgz", - "integrity": "sha512-KaFVRjoqLyF6YXCbVLNad/eS4+OfPQQn2yOd7zF/h5T/CSL2v8NpN6a5TPvtbXthAGw5nG+PuTtq+DdIZr+cRQ==", - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-remove-position": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-5.0.0.tgz", - "integrity": "sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q==", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-visit": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-stringify-position": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", - "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-visit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", - "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0", - "unist-util-visit-parents": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-visit-parents": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", - "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/update-browserslist-db": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", - "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/update-notifier": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-6.0.2.tgz", - "integrity": "sha512-EDxhTEVPZZRLWYcJ4ZXjGFN0oP7qYvbXWzEgRm/Yql4dHX5wDbvh89YHP6PK1lzZJYrMtXUuZZz8XGK+U6U1og==", - "license": "BSD-2-Clause", - "dependencies": { - "boxen": "^7.0.0", - "chalk": "^5.0.1", - "configstore": "^6.0.0", - "has-yarn": "^3.0.0", - "import-lazy": "^4.0.0", - "is-ci": "^3.0.1", - "is-installed-globally": "^0.4.0", - "is-npm": "^6.0.0", - "is-yarn-global": "^0.4.0", - "latest-version": "^7.0.0", - "pupa": "^3.1.0", - "semver": "^7.3.7", - "semver-diff": "^4.0.0", - "xdg-basedir": "^5.1.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/yeoman/update-notifier?sponsor=1" - } - }, - "node_modules/update-notifier/node_modules/boxen": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-7.1.1.tgz", - "integrity": "sha512-2hCgjEmP8YLWQ130n2FerGv7rYpfBmnmp9Uy2Le1vge6X3gZIfSmEzP5QTDElFxcvVcXlEn8Aq6MU/PZygIOog==", - "license": "MIT", - "dependencies": { - "ansi-align": "^3.0.1", - "camelcase": "^7.0.1", - "chalk": "^5.2.0", - "cli-boxes": "^3.0.0", - "string-width": "^5.1.2", - "type-fest": "^2.13.0", - "widest-line": "^4.0.1", - "wrap-ansi": "^8.1.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/update-notifier/node_modules/camelcase": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-7.0.1.tgz", - "integrity": "sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==", - "license": "MIT", - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/update-notifier/node_modules/chalk": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz", - "integrity": "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==", - "license": "MIT", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/uri-js/node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "engines": { - "node": ">=6" - } - }, - "node_modules/url-loader": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/url-loader/-/url-loader-4.1.1.tgz", - "integrity": "sha512-3BTV812+AVHHOJQO8O5MkWgZ5aosP7GnROJwvzLS9hWDj00lZ6Z0wNak423Lp9PBZN05N+Jk/N5Si8jRAlGyWA==", - "dependencies": { - "loader-utils": "^2.0.0", - "mime-types": "^2.1.27", - "schema-utils": "^3.0.0" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "file-loader": "*", - "webpack": "^4.0.0 || ^5.0.0" - }, - "peerDependenciesMeta": { - "file-loader": { - "optional": true - } - } - }, - "node_modules/url-loader/node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/url-loader/node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "peerDependencies": { - "ajv": "^6.9.1" - } - }, - "node_modules/url-loader/node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "node_modules/url-loader/node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/url-loader/node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/url-loader/node_modules/schema-utils": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", - "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", - "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "license": "MIT" - }, - "node_modules/utila": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/utila/-/utila-0.4.0.tgz", - "integrity": "sha512-Z0DbgELS9/L/75wZbro8xAnT50pBVFQZ+hUEueGDU5FN51YSCYM+jdxsfCiHjwNP/4LCDD0i/graKpeBnOXKRA==", - "license": "MIT" - }, - "node_modules/utility-types": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/utility-types/-/utility-types-3.11.0.tgz", - "integrity": "sha512-6Z7Ma2aVEWisaL6TvBCy7P8rm2LQoPv6dJ7ecIaIixHcwfbJ0x7mWdbcwlIM5IGQxPZSFYeqRCqlOOeKoJYMkw==", - "engines": { - "node": ">= 4" - } - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "license": "MIT", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "license": "MIT", - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/value-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", - "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/vfile": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", - "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-stringify-position": "^4.0.0", - "vfile-message": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/vfile-location": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-5.0.3.tgz", - "integrity": "sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg==", - "license": "MIT", - "dependencies": { - "@types/unist": "^3.0.0", - "vfile": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/vfile-message": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", - "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-stringify-position": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/watchpack": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.1.tgz", - "integrity": "sha512-8wrBCMtVhqcXP2Sup1ctSkga6uc2Bx0IIvKyT7yTFier5AXHooSI+QyQQAtTb7+E0IUCCKyTFmXqdqgum2XWGg==", - "dependencies": { - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.1.2" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/wbuf": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz", - "integrity": "sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==", - "license": "MIT", - "dependencies": { - "minimalistic-assert": "^1.0.0" - } - }, - "node_modules/web-namespaces": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz", - "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==", - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/webpack": { - "version": "5.96.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.96.1.tgz", - "integrity": "sha512-l2LlBSvVZGhL4ZrPwyr8+37AunkcYj5qh8o6u2/2rzoPc8gxFJkLj1WxNgooi9pnoc06jh0BjuXnamM4qlujZA==", - "dependencies": { - "@types/eslint-scope": "^3.7.7", - "@types/estree": "^1.0.6", - "@webassemblyjs/ast": "^1.12.1", - "@webassemblyjs/wasm-edit": "^1.12.1", - "@webassemblyjs/wasm-parser": "^1.12.1", - "acorn": "^8.14.0", - "browserslist": "^4.24.0", - "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.17.1", - "es-module-lexer": "^1.2.1", - "eslint-scope": "5.1.1", - "events": "^3.2.0", - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.11", - "json-parse-even-better-errors": "^2.3.1", - "loader-runner": "^4.2.0", - "mime-types": "^2.1.27", - "neo-async": "^2.6.2", - "schema-utils": "^3.2.0", - "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.10", - "watchpack": "^2.4.1", - "webpack-sources": "^3.2.3" - }, - "bin": { - "webpack": "bin/webpack.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependenciesMeta": { - "webpack-cli": { - "optional": true - } - } - }, - "node_modules/webpack-bundle-analyzer": { - "version": "4.10.2", - "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.10.2.tgz", - "integrity": "sha512-vJptkMm9pk5si4Bv922ZbKLV8UTT4zib4FPgXMhgzUny0bfDDkLXAVQs3ly3fS4/TN9ROFtb0NFrm04UXFE/Vw==", - "license": "MIT", - "dependencies": { - "@discoveryjs/json-ext": "0.5.7", - "acorn": "^8.0.4", - "acorn-walk": "^8.0.0", - "commander": "^7.2.0", - "debounce": "^1.2.1", - "escape-string-regexp": "^4.0.0", - "gzip-size": "^6.0.0", - "html-escaper": "^2.0.2", - "opener": "^1.5.2", - "picocolors": "^1.0.0", - "sirv": "^2.0.3", - "ws": "^7.3.1" - }, - "bin": { - "webpack-bundle-analyzer": "lib/bin/analyzer.js" - }, - "engines": { - "node": ">= 10.13.0" - } - }, - "node_modules/webpack-bundle-analyzer/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "license": "MIT", - "engines": { - "node": ">= 10" - } - }, - "node_modules/webpack-dev-middleware": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-5.3.4.tgz", - "integrity": "sha512-BVdTqhhs+0IfoeAf7EoH5WE+exCmqGerHfDM0IL096Px60Tq2Mn9MAbnaGUe6HiMa41KMCYF19gyzZmBcq/o4Q==", - "license": "MIT", - "dependencies": { - "colorette": "^2.0.10", - "memfs": "^3.4.3", - "mime-types": "^2.1.31", - "range-parser": "^1.2.1", - "schema-utils": "^4.0.0" - }, - "engines": { - "node": ">= 12.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^4.0.0 || ^5.0.0" - } - }, - "node_modules/webpack-dev-middleware/node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/webpack-dev-middleware/node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/webpack-dev-middleware/node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/webpack-dev-server": { - "version": "4.15.2", - "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.15.2.tgz", - "integrity": "sha512-0XavAZbNJ5sDrCbkpWL8mia0o5WPOd2YGtxrEiZkBK9FjLppIUK2TgxK6qGD2P3hUXTJNNPVibrerKcx5WkR1g==", - "license": "MIT", - "dependencies": { - "@types/bonjour": "^3.5.9", - "@types/connect-history-api-fallback": "^1.3.5", - "@types/express": "^4.17.13", - "@types/serve-index": "^1.9.1", - "@types/serve-static": "^1.13.10", - "@types/sockjs": "^0.3.33", - "@types/ws": "^8.5.5", - "ansi-html-community": "^0.0.8", - "bonjour-service": "^1.0.11", - "chokidar": "^3.5.3", - "colorette": "^2.0.10", - "compression": "^1.7.4", - "connect-history-api-fallback": "^2.0.0", - "default-gateway": "^6.0.3", - "express": "^4.17.3", - "graceful-fs": "^4.2.6", - "html-entities": "^2.3.2", - "http-proxy-middleware": "^2.0.3", - "ipaddr.js": "^2.0.1", - "launch-editor": "^2.6.0", - "open": "^8.0.9", - "p-retry": "^4.5.0", - "rimraf": "^3.0.2", - "schema-utils": "^4.0.0", - "selfsigned": "^2.1.1", - "serve-index": "^1.9.1", - "sockjs": "^0.3.24", - "spdy": "^4.0.2", - "webpack-dev-middleware": "^5.3.4", - "ws": "^8.13.0" - }, - "bin": { - "webpack-dev-server": "bin/webpack-dev-server.js" - }, - "engines": { - "node": ">= 12.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^4.37.0 || ^5.0.0" - }, - "peerDependenciesMeta": { - "webpack": { - "optional": true - }, - "webpack-cli": { - "optional": true - } - } - }, - "node_modules/webpack-dev-server/node_modules/ws": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.1.tgz", - "integrity": "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==", - "license": "MIT", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/webpack-merge": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-6.0.1.tgz", - "integrity": "sha512-hXXvrjtx2PLYx4qruKl+kyRSLc52V+cCvMxRjmKwoA+CBbbF5GfIBtR6kCvl0fYGqTUPKB+1ktVmTHqMOzgCBg==", - "license": "MIT", - "dependencies": { - "clone-deep": "^4.0.1", - "flat": "^5.0.2", - "wildcard": "^2.0.1" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/webpack-sources": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", - "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/webpack/node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/webpack/node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "peerDependencies": { - "ajv": "^6.9.1" - } - }, - "node_modules/webpack/node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "node_modules/webpack/node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/webpack/node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/webpack/node_modules/schema-utils": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", - "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", - "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/webpackbar": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/webpackbar/-/webpackbar-6.0.1.tgz", - "integrity": "sha512-TnErZpmuKdwWBdMoexjio3KKX6ZtoKHRVvLIU0A47R0VVBDtx3ZyOJDktgYixhoJokZTYTt1Z37OkO9pnGJa9Q==", - "dependencies": { - "ansi-escapes": "^4.3.2", - "chalk": "^4.1.2", - "consola": "^3.2.3", - "figures": "^3.2.0", - "markdown-table": "^2.0.0", - "pretty-time": "^1.1.0", - "std-env": "^3.7.0", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=14.21.3" - }, - "peerDependencies": { - "webpack": "3 || 4 || 5" - } - }, - "node_modules/webpackbar/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "node_modules/webpackbar/node_modules/markdown-table": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz", - "integrity": "sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A==", - "dependencies": { - "repeat-string": "^1.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/webpackbar/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/webpackbar/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/websocket-driver": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", - "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==", - "license": "Apache-2.0", - "dependencies": { - "http-parser-js": ">=0.5.1", - "safe-buffer": ">=5.1.0", - "websocket-extensions": ">=0.1.1" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/websocket-extensions": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz", - "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", - "license": "Apache-2.0", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/widest-line": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-4.0.1.tgz", - "integrity": "sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==", - "license": "MIT", - "dependencies": { - "string-width": "^5.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/wildcard": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz", - "integrity": "sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==" - }, - "node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - }, - "node_modules/write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", - "license": "ISC", - "dependencies": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, - "node_modules/ws": { - "version": "7.5.10", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", - "license": "MIT", - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/xdg-basedir": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", - "integrity": "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/xml-js": { - "version": "1.6.11", - "resolved": "https://registry.npmjs.org/xml-js/-/xml-js-1.6.11.tgz", - "integrity": "sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g==", - "dependencies": { - "sax": "^1.2.4" - }, - "bin": { - "xml-js": "bin/cli.js" - } - }, - "node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" - }, - "node_modules/yocto-queue": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.1.tgz", - "integrity": "sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg==", - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/zwitch": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", - "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - } - } -} diff --git a/docs/package.json b/docs/package.json deleted file mode 100644 index b67d8a7a4..000000000 --- a/docs/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "website", - "version": "2024.08.01", - "private": true, - "scripts": { - "docusaurus": "docusaurus", - "start": "docusaurus start", - "build": "docusaurus build", - "swizzle": "docusaurus swizzle", - "deploy": "docusaurus deploy", - "clear": "docusaurus clear", - "serve": "docusaurus serve", - "write-translations": "docusaurus write-translations", - "write-heading-ids": "docusaurus write-heading-ids" - }, - "dependencies": { - "@docusaurus/core": "3.8.1", - "@docusaurus/plugin-client-redirects": "^3.8.1", - "@docusaurus/preset-classic": "3.8.1", - "@mdx-js/react": "^3.1.0", - "clsx": "^2.0.0", - "docusaurus-theme-github-codeblock": "^2.0.2", - "prism-react-renderer": "^2.4.1", - "react": "^19.1.1", - "react-dom": "^19.1.1" - }, - "devDependencies": { - "@docusaurus/module-type-aliases": "3.8.1", - "@docusaurus/types": "3.8.1" - }, - "browserslist": { - "production": [ - ">0.5%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 3 chrome version", - "last 3 firefox version", - "last 5 safari version" - ] - }, - "engines": { - "node": ">=20.0" - } -} diff --git a/docs/static/api-docs/slack_bolt/adapter/aiohttp/index.html b/docs/reference/adapter/aiohttp/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/aiohttp/index.html rename to docs/reference/adapter/aiohttp/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/asgi/aiohttp/index.html b/docs/reference/adapter/asgi/aiohttp/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/asgi/aiohttp/index.html rename to docs/reference/adapter/asgi/aiohttp/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/asgi/async_handler.html b/docs/reference/adapter/asgi/async_handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/asgi/async_handler.html rename to docs/reference/adapter/asgi/async_handler.html diff --git a/docs/static/api-docs/slack_bolt/adapter/asgi/base_handler.html b/docs/reference/adapter/asgi/base_handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/asgi/base_handler.html rename to docs/reference/adapter/asgi/base_handler.html diff --git a/docs/static/api-docs/slack_bolt/adapter/asgi/builtin/index.html b/docs/reference/adapter/asgi/builtin/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/asgi/builtin/index.html rename to docs/reference/adapter/asgi/builtin/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/asgi/http_request.html b/docs/reference/adapter/asgi/http_request.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/asgi/http_request.html rename to docs/reference/adapter/asgi/http_request.html diff --git a/docs/static/api-docs/slack_bolt/adapter/asgi/http_response.html b/docs/reference/adapter/asgi/http_response.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/asgi/http_response.html rename to docs/reference/adapter/asgi/http_response.html diff --git a/docs/static/api-docs/slack_bolt/adapter/asgi/index.html b/docs/reference/adapter/asgi/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/asgi/index.html rename to docs/reference/adapter/asgi/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/asgi/utils.html b/docs/reference/adapter/asgi/utils.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/asgi/utils.html rename to docs/reference/adapter/asgi/utils.html diff --git a/docs/static/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html b/docs/reference/adapter/aws_lambda/chalice_handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html rename to docs/reference/adapter/aws_lambda/chalice_handler.html diff --git a/docs/static/api-docs/slack_bolt/adapter/aws_lambda/chalice_lazy_listener_runner.html b/docs/reference/adapter/aws_lambda/chalice_lazy_listener_runner.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/aws_lambda/chalice_lazy_listener_runner.html rename to docs/reference/adapter/aws_lambda/chalice_lazy_listener_runner.html diff --git a/docs/static/api-docs/slack_bolt/adapter/aws_lambda/handler.html b/docs/reference/adapter/aws_lambda/handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/aws_lambda/handler.html rename to docs/reference/adapter/aws_lambda/handler.html diff --git a/docs/static/api-docs/slack_bolt/adapter/aws_lambda/index.html b/docs/reference/adapter/aws_lambda/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/aws_lambda/index.html rename to docs/reference/adapter/aws_lambda/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/aws_lambda/internals.html b/docs/reference/adapter/aws_lambda/internals.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/aws_lambda/internals.html rename to docs/reference/adapter/aws_lambda/internals.html diff --git a/docs/static/api-docs/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.html b/docs/reference/adapter/aws_lambda/lambda_s3_oauth_flow.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.html rename to docs/reference/adapter/aws_lambda/lambda_s3_oauth_flow.html diff --git a/docs/static/api-docs/slack_bolt/adapter/aws_lambda/lazy_listener_runner.html b/docs/reference/adapter/aws_lambda/lazy_listener_runner.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/aws_lambda/lazy_listener_runner.html rename to docs/reference/adapter/aws_lambda/lazy_listener_runner.html diff --git a/docs/static/api-docs/slack_bolt/adapter/aws_lambda/local_lambda_client.html b/docs/reference/adapter/aws_lambda/local_lambda_client.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/aws_lambda/local_lambda_client.html rename to docs/reference/adapter/aws_lambda/local_lambda_client.html diff --git a/docs/static/api-docs/slack_bolt/adapter/bottle/handler.html b/docs/reference/adapter/bottle/handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/bottle/handler.html rename to docs/reference/adapter/bottle/handler.html diff --git a/docs/static/api-docs/slack_bolt/adapter/bottle/index.html b/docs/reference/adapter/bottle/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/bottle/index.html rename to docs/reference/adapter/bottle/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/cherrypy/handler.html b/docs/reference/adapter/cherrypy/handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/cherrypy/handler.html rename to docs/reference/adapter/cherrypy/handler.html diff --git a/docs/static/api-docs/slack_bolt/adapter/cherrypy/index.html b/docs/reference/adapter/cherrypy/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/cherrypy/index.html rename to docs/reference/adapter/cherrypy/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/django/handler.html b/docs/reference/adapter/django/handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/django/handler.html rename to docs/reference/adapter/django/handler.html diff --git a/docs/static/api-docs/slack_bolt/adapter/django/index.html b/docs/reference/adapter/django/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/django/index.html rename to docs/reference/adapter/django/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/falcon/async_resource.html b/docs/reference/adapter/falcon/async_resource.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/falcon/async_resource.html rename to docs/reference/adapter/falcon/async_resource.html diff --git a/docs/static/api-docs/slack_bolt/adapter/falcon/index.html b/docs/reference/adapter/falcon/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/falcon/index.html rename to docs/reference/adapter/falcon/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/falcon/resource.html b/docs/reference/adapter/falcon/resource.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/falcon/resource.html rename to docs/reference/adapter/falcon/resource.html diff --git a/docs/static/api-docs/slack_bolt/adapter/fastapi/async_handler.html b/docs/reference/adapter/fastapi/async_handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/fastapi/async_handler.html rename to docs/reference/adapter/fastapi/async_handler.html diff --git a/docs/static/api-docs/slack_bolt/adapter/fastapi/index.html b/docs/reference/adapter/fastapi/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/fastapi/index.html rename to docs/reference/adapter/fastapi/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/flask/handler.html b/docs/reference/adapter/flask/handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/flask/handler.html rename to docs/reference/adapter/flask/handler.html diff --git a/docs/static/api-docs/slack_bolt/adapter/flask/index.html b/docs/reference/adapter/flask/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/flask/index.html rename to docs/reference/adapter/flask/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/google_cloud_functions/handler.html b/docs/reference/adapter/google_cloud_functions/handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/google_cloud_functions/handler.html rename to docs/reference/adapter/google_cloud_functions/handler.html diff --git a/docs/static/api-docs/slack_bolt/adapter/google_cloud_functions/index.html b/docs/reference/adapter/google_cloud_functions/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/google_cloud_functions/index.html rename to docs/reference/adapter/google_cloud_functions/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/index.html b/docs/reference/adapter/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/index.html rename to docs/reference/adapter/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/pyramid/handler.html b/docs/reference/adapter/pyramid/handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/pyramid/handler.html rename to docs/reference/adapter/pyramid/handler.html diff --git a/docs/static/api-docs/slack_bolt/adapter/pyramid/index.html b/docs/reference/adapter/pyramid/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/pyramid/index.html rename to docs/reference/adapter/pyramid/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/sanic/async_handler.html b/docs/reference/adapter/sanic/async_handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/sanic/async_handler.html rename to docs/reference/adapter/sanic/async_handler.html diff --git a/docs/static/api-docs/slack_bolt/adapter/sanic/index.html b/docs/reference/adapter/sanic/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/sanic/index.html rename to docs/reference/adapter/sanic/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/socket_mode/aiohttp/index.html b/docs/reference/adapter/socket_mode/aiohttp/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/socket_mode/aiohttp/index.html rename to docs/reference/adapter/socket_mode/aiohttp/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/socket_mode/async_base_handler.html b/docs/reference/adapter/socket_mode/async_base_handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/socket_mode/async_base_handler.html rename to docs/reference/adapter/socket_mode/async_base_handler.html diff --git a/docs/static/api-docs/slack_bolt/adapter/socket_mode/async_handler.html b/docs/reference/adapter/socket_mode/async_handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/socket_mode/async_handler.html rename to docs/reference/adapter/socket_mode/async_handler.html diff --git a/docs/static/api-docs/slack_bolt/adapter/socket_mode/async_internals.html b/docs/reference/adapter/socket_mode/async_internals.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/socket_mode/async_internals.html rename to docs/reference/adapter/socket_mode/async_internals.html diff --git a/docs/static/api-docs/slack_bolt/adapter/socket_mode/base_handler.html b/docs/reference/adapter/socket_mode/base_handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/socket_mode/base_handler.html rename to docs/reference/adapter/socket_mode/base_handler.html diff --git a/docs/static/api-docs/slack_bolt/adapter/socket_mode/builtin/index.html b/docs/reference/adapter/socket_mode/builtin/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/socket_mode/builtin/index.html rename to docs/reference/adapter/socket_mode/builtin/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/socket_mode/index.html b/docs/reference/adapter/socket_mode/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/socket_mode/index.html rename to docs/reference/adapter/socket_mode/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/socket_mode/internals.html b/docs/reference/adapter/socket_mode/internals.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/socket_mode/internals.html rename to docs/reference/adapter/socket_mode/internals.html diff --git a/docs/static/api-docs/slack_bolt/adapter/socket_mode/websocket_client/index.html b/docs/reference/adapter/socket_mode/websocket_client/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/socket_mode/websocket_client/index.html rename to docs/reference/adapter/socket_mode/websocket_client/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/socket_mode/websockets/index.html b/docs/reference/adapter/socket_mode/websockets/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/socket_mode/websockets/index.html rename to docs/reference/adapter/socket_mode/websockets/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/starlette/async_handler.html b/docs/reference/adapter/starlette/async_handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/starlette/async_handler.html rename to docs/reference/adapter/starlette/async_handler.html diff --git a/docs/static/api-docs/slack_bolt/adapter/starlette/handler.html b/docs/reference/adapter/starlette/handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/starlette/handler.html rename to docs/reference/adapter/starlette/handler.html diff --git a/docs/static/api-docs/slack_bolt/adapter/starlette/index.html b/docs/reference/adapter/starlette/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/starlette/index.html rename to docs/reference/adapter/starlette/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/tornado/async_handler.html b/docs/reference/adapter/tornado/async_handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/tornado/async_handler.html rename to docs/reference/adapter/tornado/async_handler.html diff --git a/docs/static/api-docs/slack_bolt/adapter/tornado/handler.html b/docs/reference/adapter/tornado/handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/tornado/handler.html rename to docs/reference/adapter/tornado/handler.html diff --git a/docs/static/api-docs/slack_bolt/adapter/tornado/index.html b/docs/reference/adapter/tornado/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/tornado/index.html rename to docs/reference/adapter/tornado/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/wsgi/handler.html b/docs/reference/adapter/wsgi/handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/wsgi/handler.html rename to docs/reference/adapter/wsgi/handler.html diff --git a/docs/static/api-docs/slack_bolt/adapter/wsgi/http_request.html b/docs/reference/adapter/wsgi/http_request.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/wsgi/http_request.html rename to docs/reference/adapter/wsgi/http_request.html diff --git a/docs/static/api-docs/slack_bolt/adapter/wsgi/http_response.html b/docs/reference/adapter/wsgi/http_response.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/wsgi/http_response.html rename to docs/reference/adapter/wsgi/http_response.html diff --git a/docs/static/api-docs/slack_bolt/adapter/wsgi/index.html b/docs/reference/adapter/wsgi/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/wsgi/index.html rename to docs/reference/adapter/wsgi/index.html diff --git a/docs/static/api-docs/slack_bolt/adapter/wsgi/internals.html b/docs/reference/adapter/wsgi/internals.html similarity index 100% rename from docs/static/api-docs/slack_bolt/adapter/wsgi/internals.html rename to docs/reference/adapter/wsgi/internals.html diff --git a/docs/static/api-docs/slack_bolt/app/app.html b/docs/reference/app/app.html similarity index 100% rename from docs/static/api-docs/slack_bolt/app/app.html rename to docs/reference/app/app.html diff --git a/docs/static/api-docs/slack_bolt/app/async_app.html b/docs/reference/app/async_app.html similarity index 100% rename from docs/static/api-docs/slack_bolt/app/async_app.html rename to docs/reference/app/async_app.html diff --git a/docs/static/api-docs/slack_bolt/app/async_server.html b/docs/reference/app/async_server.html similarity index 100% rename from docs/static/api-docs/slack_bolt/app/async_server.html rename to docs/reference/app/async_server.html diff --git a/docs/static/api-docs/slack_bolt/app/index.html b/docs/reference/app/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/app/index.html rename to docs/reference/app/index.html diff --git a/docs/static/api-docs/slack_bolt/async_app.html b/docs/reference/async_app.html similarity index 100% rename from docs/static/api-docs/slack_bolt/async_app.html rename to docs/reference/async_app.html diff --git a/docs/static/api-docs/slack_bolt/authorization/async_authorize.html b/docs/reference/authorization/async_authorize.html similarity index 100% rename from docs/static/api-docs/slack_bolt/authorization/async_authorize.html rename to docs/reference/authorization/async_authorize.html diff --git a/docs/static/api-docs/slack_bolt/authorization/async_authorize_args.html b/docs/reference/authorization/async_authorize_args.html similarity index 100% rename from docs/static/api-docs/slack_bolt/authorization/async_authorize_args.html rename to docs/reference/authorization/async_authorize_args.html diff --git a/docs/static/api-docs/slack_bolt/authorization/authorize.html b/docs/reference/authorization/authorize.html similarity index 100% rename from docs/static/api-docs/slack_bolt/authorization/authorize.html rename to docs/reference/authorization/authorize.html diff --git a/docs/static/api-docs/slack_bolt/authorization/authorize_args.html b/docs/reference/authorization/authorize_args.html similarity index 100% rename from docs/static/api-docs/slack_bolt/authorization/authorize_args.html rename to docs/reference/authorization/authorize_args.html diff --git a/docs/static/api-docs/slack_bolt/authorization/authorize_result.html b/docs/reference/authorization/authorize_result.html similarity index 100% rename from docs/static/api-docs/slack_bolt/authorization/authorize_result.html rename to docs/reference/authorization/authorize_result.html diff --git a/docs/static/api-docs/slack_bolt/authorization/index.html b/docs/reference/authorization/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/authorization/index.html rename to docs/reference/authorization/index.html diff --git a/docs/static/api-docs/slack_bolt/context/ack/ack.html b/docs/reference/context/ack/ack.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/ack/ack.html rename to docs/reference/context/ack/ack.html diff --git a/docs/static/api-docs/slack_bolt/context/ack/async_ack.html b/docs/reference/context/ack/async_ack.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/ack/async_ack.html rename to docs/reference/context/ack/async_ack.html diff --git a/docs/static/api-docs/slack_bolt/context/ack/index.html b/docs/reference/context/ack/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/ack/index.html rename to docs/reference/context/ack/index.html diff --git a/docs/static/api-docs/slack_bolt/context/ack/internals.html b/docs/reference/context/ack/internals.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/ack/internals.html rename to docs/reference/context/ack/internals.html diff --git a/docs/static/api-docs/slack_bolt/context/assistant/assistant_utilities.html b/docs/reference/context/assistant/assistant_utilities.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/assistant/assistant_utilities.html rename to docs/reference/context/assistant/assistant_utilities.html diff --git a/docs/static/api-docs/slack_bolt/context/assistant/async_assistant_utilities.html b/docs/reference/context/assistant/async_assistant_utilities.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/assistant/async_assistant_utilities.html rename to docs/reference/context/assistant/async_assistant_utilities.html diff --git a/docs/static/api-docs/slack_bolt/context/assistant/index.html b/docs/reference/context/assistant/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/assistant/index.html rename to docs/reference/context/assistant/index.html diff --git a/docs/static/api-docs/slack_bolt/context/assistant/internals.html b/docs/reference/context/assistant/internals.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/assistant/internals.html rename to docs/reference/context/assistant/internals.html diff --git a/docs/static/api-docs/slack_bolt/context/assistant/thread_context/index.html b/docs/reference/context/assistant/thread_context/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/assistant/thread_context/index.html rename to docs/reference/context/assistant/thread_context/index.html diff --git a/docs/static/api-docs/slack_bolt/context/assistant/thread_context_store/async_store.html b/docs/reference/context/assistant/thread_context_store/async_store.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/assistant/thread_context_store/async_store.html rename to docs/reference/context/assistant/thread_context_store/async_store.html diff --git a/docs/static/api-docs/slack_bolt/context/assistant/thread_context_store/default_async_store.html b/docs/reference/context/assistant/thread_context_store/default_async_store.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/assistant/thread_context_store/default_async_store.html rename to docs/reference/context/assistant/thread_context_store/default_async_store.html diff --git a/docs/static/api-docs/slack_bolt/context/assistant/thread_context_store/default_store.html b/docs/reference/context/assistant/thread_context_store/default_store.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/assistant/thread_context_store/default_store.html rename to docs/reference/context/assistant/thread_context_store/default_store.html diff --git a/docs/static/api-docs/slack_bolt/context/assistant/thread_context_store/file/index.html b/docs/reference/context/assistant/thread_context_store/file/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/assistant/thread_context_store/file/index.html rename to docs/reference/context/assistant/thread_context_store/file/index.html diff --git a/docs/static/api-docs/slack_bolt/context/assistant/thread_context_store/index.html b/docs/reference/context/assistant/thread_context_store/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/assistant/thread_context_store/index.html rename to docs/reference/context/assistant/thread_context_store/index.html diff --git a/docs/static/api-docs/slack_bolt/context/assistant/thread_context_store/store.html b/docs/reference/context/assistant/thread_context_store/store.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/assistant/thread_context_store/store.html rename to docs/reference/context/assistant/thread_context_store/store.html diff --git a/docs/static/api-docs/slack_bolt/context/async_context.html b/docs/reference/context/async_context.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/async_context.html rename to docs/reference/context/async_context.html diff --git a/docs/static/api-docs/slack_bolt/context/base_context.html b/docs/reference/context/base_context.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/base_context.html rename to docs/reference/context/base_context.html diff --git a/docs/static/api-docs/slack_bolt/context/complete/async_complete.html b/docs/reference/context/complete/async_complete.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/complete/async_complete.html rename to docs/reference/context/complete/async_complete.html diff --git a/docs/static/api-docs/slack_bolt/context/complete/complete.html b/docs/reference/context/complete/complete.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/complete/complete.html rename to docs/reference/context/complete/complete.html diff --git a/docs/static/api-docs/slack_bolt/context/complete/index.html b/docs/reference/context/complete/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/complete/index.html rename to docs/reference/context/complete/index.html diff --git a/docs/static/api-docs/slack_bolt/context/context.html b/docs/reference/context/context.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/context.html rename to docs/reference/context/context.html diff --git a/docs/static/api-docs/slack_bolt/context/fail/async_fail.html b/docs/reference/context/fail/async_fail.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/fail/async_fail.html rename to docs/reference/context/fail/async_fail.html diff --git a/docs/static/api-docs/slack_bolt/context/fail/fail.html b/docs/reference/context/fail/fail.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/fail/fail.html rename to docs/reference/context/fail/fail.html diff --git a/docs/static/api-docs/slack_bolt/context/fail/index.html b/docs/reference/context/fail/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/fail/index.html rename to docs/reference/context/fail/index.html diff --git a/docs/static/api-docs/slack_bolt/context/get_thread_context/async_get_thread_context.html b/docs/reference/context/get_thread_context/async_get_thread_context.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/get_thread_context/async_get_thread_context.html rename to docs/reference/context/get_thread_context/async_get_thread_context.html diff --git a/docs/static/api-docs/slack_bolt/context/get_thread_context/get_thread_context.html b/docs/reference/context/get_thread_context/get_thread_context.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/get_thread_context/get_thread_context.html rename to docs/reference/context/get_thread_context/get_thread_context.html diff --git a/docs/static/api-docs/slack_bolt/context/get_thread_context/index.html b/docs/reference/context/get_thread_context/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/get_thread_context/index.html rename to docs/reference/context/get_thread_context/index.html diff --git a/docs/static/api-docs/slack_bolt/context/index.html b/docs/reference/context/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/index.html rename to docs/reference/context/index.html diff --git a/docs/static/api-docs/slack_bolt/context/respond/async_respond.html b/docs/reference/context/respond/async_respond.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/respond/async_respond.html rename to docs/reference/context/respond/async_respond.html diff --git a/docs/static/api-docs/slack_bolt/context/respond/index.html b/docs/reference/context/respond/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/respond/index.html rename to docs/reference/context/respond/index.html diff --git a/docs/static/api-docs/slack_bolt/context/respond/internals.html b/docs/reference/context/respond/internals.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/respond/internals.html rename to docs/reference/context/respond/internals.html diff --git a/docs/static/api-docs/slack_bolt/context/respond/respond.html b/docs/reference/context/respond/respond.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/respond/respond.html rename to docs/reference/context/respond/respond.html diff --git a/docs/static/api-docs/slack_bolt/context/save_thread_context/async_save_thread_context.html b/docs/reference/context/save_thread_context/async_save_thread_context.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/save_thread_context/async_save_thread_context.html rename to docs/reference/context/save_thread_context/async_save_thread_context.html diff --git a/docs/static/api-docs/slack_bolt/context/save_thread_context/index.html b/docs/reference/context/save_thread_context/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/save_thread_context/index.html rename to docs/reference/context/save_thread_context/index.html diff --git a/docs/static/api-docs/slack_bolt/context/save_thread_context/save_thread_context.html b/docs/reference/context/save_thread_context/save_thread_context.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/save_thread_context/save_thread_context.html rename to docs/reference/context/save_thread_context/save_thread_context.html diff --git a/docs/static/api-docs/slack_bolt/context/say/async_say.html b/docs/reference/context/say/async_say.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/say/async_say.html rename to docs/reference/context/say/async_say.html diff --git a/docs/static/api-docs/slack_bolt/context/say/index.html b/docs/reference/context/say/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/say/index.html rename to docs/reference/context/say/index.html diff --git a/docs/static/api-docs/slack_bolt/context/say/internals.html b/docs/reference/context/say/internals.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/say/internals.html rename to docs/reference/context/say/internals.html diff --git a/docs/static/api-docs/slack_bolt/context/say/say.html b/docs/reference/context/say/say.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/say/say.html rename to docs/reference/context/say/say.html diff --git a/docs/static/api-docs/slack_bolt/context/set_status/async_set_status.html b/docs/reference/context/set_status/async_set_status.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/set_status/async_set_status.html rename to docs/reference/context/set_status/async_set_status.html diff --git a/docs/static/api-docs/slack_bolt/context/set_status/index.html b/docs/reference/context/set_status/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/set_status/index.html rename to docs/reference/context/set_status/index.html diff --git a/docs/static/api-docs/slack_bolt/context/set_status/set_status.html b/docs/reference/context/set_status/set_status.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/set_status/set_status.html rename to docs/reference/context/set_status/set_status.html diff --git a/docs/static/api-docs/slack_bolt/context/set_suggested_prompts/async_set_suggested_prompts.html b/docs/reference/context/set_suggested_prompts/async_set_suggested_prompts.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/set_suggested_prompts/async_set_suggested_prompts.html rename to docs/reference/context/set_suggested_prompts/async_set_suggested_prompts.html diff --git a/docs/static/api-docs/slack_bolt/context/set_suggested_prompts/index.html b/docs/reference/context/set_suggested_prompts/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/set_suggested_prompts/index.html rename to docs/reference/context/set_suggested_prompts/index.html diff --git a/docs/static/api-docs/slack_bolt/context/set_suggested_prompts/set_suggested_prompts.html b/docs/reference/context/set_suggested_prompts/set_suggested_prompts.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/set_suggested_prompts/set_suggested_prompts.html rename to docs/reference/context/set_suggested_prompts/set_suggested_prompts.html diff --git a/docs/static/api-docs/slack_bolt/context/set_title/async_set_title.html b/docs/reference/context/set_title/async_set_title.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/set_title/async_set_title.html rename to docs/reference/context/set_title/async_set_title.html diff --git a/docs/static/api-docs/slack_bolt/context/set_title/index.html b/docs/reference/context/set_title/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/set_title/index.html rename to docs/reference/context/set_title/index.html diff --git a/docs/static/api-docs/slack_bolt/context/set_title/set_title.html b/docs/reference/context/set_title/set_title.html similarity index 100% rename from docs/static/api-docs/slack_bolt/context/set_title/set_title.html rename to docs/reference/context/set_title/set_title.html diff --git a/docs/static/api-docs/slack_bolt/error/index.html b/docs/reference/error/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/error/index.html rename to docs/reference/error/index.html diff --git a/docs/static/api-docs/slack_bolt/index.html b/docs/reference/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/index.html rename to docs/reference/index.html diff --git a/docs/static/api-docs/slack_bolt/kwargs_injection/args.html b/docs/reference/kwargs_injection/args.html similarity index 100% rename from docs/static/api-docs/slack_bolt/kwargs_injection/args.html rename to docs/reference/kwargs_injection/args.html diff --git a/docs/static/api-docs/slack_bolt/kwargs_injection/async_args.html b/docs/reference/kwargs_injection/async_args.html similarity index 100% rename from docs/static/api-docs/slack_bolt/kwargs_injection/async_args.html rename to docs/reference/kwargs_injection/async_args.html diff --git a/docs/static/api-docs/slack_bolt/kwargs_injection/async_utils.html b/docs/reference/kwargs_injection/async_utils.html similarity index 100% rename from docs/static/api-docs/slack_bolt/kwargs_injection/async_utils.html rename to docs/reference/kwargs_injection/async_utils.html diff --git a/docs/static/api-docs/slack_bolt/kwargs_injection/index.html b/docs/reference/kwargs_injection/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/kwargs_injection/index.html rename to docs/reference/kwargs_injection/index.html diff --git a/docs/static/api-docs/slack_bolt/kwargs_injection/utils.html b/docs/reference/kwargs_injection/utils.html similarity index 100% rename from docs/static/api-docs/slack_bolt/kwargs_injection/utils.html rename to docs/reference/kwargs_injection/utils.html diff --git a/docs/static/api-docs/slack_bolt/lazy_listener/async_internals.html b/docs/reference/lazy_listener/async_internals.html similarity index 100% rename from docs/static/api-docs/slack_bolt/lazy_listener/async_internals.html rename to docs/reference/lazy_listener/async_internals.html diff --git a/docs/static/api-docs/slack_bolt/lazy_listener/async_runner.html b/docs/reference/lazy_listener/async_runner.html similarity index 100% rename from docs/static/api-docs/slack_bolt/lazy_listener/async_runner.html rename to docs/reference/lazy_listener/async_runner.html diff --git a/docs/static/api-docs/slack_bolt/lazy_listener/asyncio_runner.html b/docs/reference/lazy_listener/asyncio_runner.html similarity index 100% rename from docs/static/api-docs/slack_bolt/lazy_listener/asyncio_runner.html rename to docs/reference/lazy_listener/asyncio_runner.html diff --git a/docs/static/api-docs/slack_bolt/lazy_listener/index.html b/docs/reference/lazy_listener/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/lazy_listener/index.html rename to docs/reference/lazy_listener/index.html diff --git a/docs/static/api-docs/slack_bolt/lazy_listener/internals.html b/docs/reference/lazy_listener/internals.html similarity index 100% rename from docs/static/api-docs/slack_bolt/lazy_listener/internals.html rename to docs/reference/lazy_listener/internals.html diff --git a/docs/static/api-docs/slack_bolt/lazy_listener/runner.html b/docs/reference/lazy_listener/runner.html similarity index 100% rename from docs/static/api-docs/slack_bolt/lazy_listener/runner.html rename to docs/reference/lazy_listener/runner.html diff --git a/docs/static/api-docs/slack_bolt/lazy_listener/thread_runner.html b/docs/reference/lazy_listener/thread_runner.html similarity index 100% rename from docs/static/api-docs/slack_bolt/lazy_listener/thread_runner.html rename to docs/reference/lazy_listener/thread_runner.html diff --git a/docs/static/api-docs/slack_bolt/listener/async_builtins.html b/docs/reference/listener/async_builtins.html similarity index 100% rename from docs/static/api-docs/slack_bolt/listener/async_builtins.html rename to docs/reference/listener/async_builtins.html diff --git a/docs/static/api-docs/slack_bolt/listener/async_listener.html b/docs/reference/listener/async_listener.html similarity index 100% rename from docs/static/api-docs/slack_bolt/listener/async_listener.html rename to docs/reference/listener/async_listener.html diff --git a/docs/static/api-docs/slack_bolt/listener/async_listener_completion_handler.html b/docs/reference/listener/async_listener_completion_handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/listener/async_listener_completion_handler.html rename to docs/reference/listener/async_listener_completion_handler.html diff --git a/docs/static/api-docs/slack_bolt/listener/async_listener_error_handler.html b/docs/reference/listener/async_listener_error_handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/listener/async_listener_error_handler.html rename to docs/reference/listener/async_listener_error_handler.html diff --git a/docs/static/api-docs/slack_bolt/listener/async_listener_start_handler.html b/docs/reference/listener/async_listener_start_handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/listener/async_listener_start_handler.html rename to docs/reference/listener/async_listener_start_handler.html diff --git a/docs/static/api-docs/slack_bolt/listener/asyncio_runner.html b/docs/reference/listener/asyncio_runner.html similarity index 100% rename from docs/static/api-docs/slack_bolt/listener/asyncio_runner.html rename to docs/reference/listener/asyncio_runner.html diff --git a/docs/static/api-docs/slack_bolt/listener/builtins.html b/docs/reference/listener/builtins.html similarity index 100% rename from docs/static/api-docs/slack_bolt/listener/builtins.html rename to docs/reference/listener/builtins.html diff --git a/docs/static/api-docs/slack_bolt/listener/custom_listener.html b/docs/reference/listener/custom_listener.html similarity index 100% rename from docs/static/api-docs/slack_bolt/listener/custom_listener.html rename to docs/reference/listener/custom_listener.html diff --git a/docs/static/api-docs/slack_bolt/listener/index.html b/docs/reference/listener/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/listener/index.html rename to docs/reference/listener/index.html diff --git a/docs/static/api-docs/slack_bolt/listener/listener.html b/docs/reference/listener/listener.html similarity index 100% rename from docs/static/api-docs/slack_bolt/listener/listener.html rename to docs/reference/listener/listener.html diff --git a/docs/static/api-docs/slack_bolt/listener/listener_completion_handler.html b/docs/reference/listener/listener_completion_handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/listener/listener_completion_handler.html rename to docs/reference/listener/listener_completion_handler.html diff --git a/docs/static/api-docs/slack_bolt/listener/listener_error_handler.html b/docs/reference/listener/listener_error_handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/listener/listener_error_handler.html rename to docs/reference/listener/listener_error_handler.html diff --git a/docs/static/api-docs/slack_bolt/listener/listener_start_handler.html b/docs/reference/listener/listener_start_handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/listener/listener_start_handler.html rename to docs/reference/listener/listener_start_handler.html diff --git a/docs/static/api-docs/slack_bolt/listener/thread_runner.html b/docs/reference/listener/thread_runner.html similarity index 100% rename from docs/static/api-docs/slack_bolt/listener/thread_runner.html rename to docs/reference/listener/thread_runner.html diff --git a/docs/static/api-docs/slack_bolt/listener_matcher/async_builtins.html b/docs/reference/listener_matcher/async_builtins.html similarity index 100% rename from docs/static/api-docs/slack_bolt/listener_matcher/async_builtins.html rename to docs/reference/listener_matcher/async_builtins.html diff --git a/docs/static/api-docs/slack_bolt/listener_matcher/async_listener_matcher.html b/docs/reference/listener_matcher/async_listener_matcher.html similarity index 100% rename from docs/static/api-docs/slack_bolt/listener_matcher/async_listener_matcher.html rename to docs/reference/listener_matcher/async_listener_matcher.html diff --git a/docs/static/api-docs/slack_bolt/listener_matcher/builtins.html b/docs/reference/listener_matcher/builtins.html similarity index 100% rename from docs/static/api-docs/slack_bolt/listener_matcher/builtins.html rename to docs/reference/listener_matcher/builtins.html diff --git a/docs/static/api-docs/slack_bolt/listener_matcher/custom_listener_matcher.html b/docs/reference/listener_matcher/custom_listener_matcher.html similarity index 100% rename from docs/static/api-docs/slack_bolt/listener_matcher/custom_listener_matcher.html rename to docs/reference/listener_matcher/custom_listener_matcher.html diff --git a/docs/static/api-docs/slack_bolt/listener_matcher/index.html b/docs/reference/listener_matcher/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/listener_matcher/index.html rename to docs/reference/listener_matcher/index.html diff --git a/docs/static/api-docs/slack_bolt/listener_matcher/listener_matcher.html b/docs/reference/listener_matcher/listener_matcher.html similarity index 100% rename from docs/static/api-docs/slack_bolt/listener_matcher/listener_matcher.html rename to docs/reference/listener_matcher/listener_matcher.html diff --git a/docs/static/api-docs/slack_bolt/logger/index.html b/docs/reference/logger/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/logger/index.html rename to docs/reference/logger/index.html diff --git a/docs/static/api-docs/slack_bolt/logger/messages.html b/docs/reference/logger/messages.html similarity index 100% rename from docs/static/api-docs/slack_bolt/logger/messages.html rename to docs/reference/logger/messages.html diff --git a/docs/static/api-docs/slack_bolt/middleware/assistant/assistant.html b/docs/reference/middleware/assistant/assistant.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/assistant/assistant.html rename to docs/reference/middleware/assistant/assistant.html diff --git a/docs/static/api-docs/slack_bolt/middleware/assistant/async_assistant.html b/docs/reference/middleware/assistant/async_assistant.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/assistant/async_assistant.html rename to docs/reference/middleware/assistant/async_assistant.html diff --git a/docs/static/api-docs/slack_bolt/middleware/assistant/index.html b/docs/reference/middleware/assistant/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/assistant/index.html rename to docs/reference/middleware/assistant/index.html diff --git a/docs/static/api-docs/slack_bolt/middleware/async_builtins.html b/docs/reference/middleware/async_builtins.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/async_builtins.html rename to docs/reference/middleware/async_builtins.html diff --git a/docs/static/api-docs/slack_bolt/middleware/async_custom_middleware.html b/docs/reference/middleware/async_custom_middleware.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/async_custom_middleware.html rename to docs/reference/middleware/async_custom_middleware.html diff --git a/docs/static/api-docs/slack_bolt/middleware/async_middleware.html b/docs/reference/middleware/async_middleware.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/async_middleware.html rename to docs/reference/middleware/async_middleware.html diff --git a/docs/static/api-docs/slack_bolt/middleware/async_middleware_error_handler.html b/docs/reference/middleware/async_middleware_error_handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/async_middleware_error_handler.html rename to docs/reference/middleware/async_middleware_error_handler.html diff --git a/docs/static/api-docs/slack_bolt/middleware/attaching_function_token/async_attaching_function_token.html b/docs/reference/middleware/attaching_function_token/async_attaching_function_token.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/attaching_function_token/async_attaching_function_token.html rename to docs/reference/middleware/attaching_function_token/async_attaching_function_token.html diff --git a/docs/static/api-docs/slack_bolt/middleware/attaching_function_token/attaching_function_token.html b/docs/reference/middleware/attaching_function_token/attaching_function_token.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/attaching_function_token/attaching_function_token.html rename to docs/reference/middleware/attaching_function_token/attaching_function_token.html diff --git a/docs/static/api-docs/slack_bolt/middleware/attaching_function_token/index.html b/docs/reference/middleware/attaching_function_token/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/attaching_function_token/index.html rename to docs/reference/middleware/attaching_function_token/index.html diff --git a/docs/static/api-docs/slack_bolt/middleware/authorization/async_authorization.html b/docs/reference/middleware/authorization/async_authorization.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/authorization/async_authorization.html rename to docs/reference/middleware/authorization/async_authorization.html diff --git a/docs/static/api-docs/slack_bolt/middleware/authorization/async_internals.html b/docs/reference/middleware/authorization/async_internals.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/authorization/async_internals.html rename to docs/reference/middleware/authorization/async_internals.html diff --git a/docs/static/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html b/docs/reference/middleware/authorization/async_multi_teams_authorization.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/authorization/async_multi_teams_authorization.html rename to docs/reference/middleware/authorization/async_multi_teams_authorization.html diff --git a/docs/static/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html b/docs/reference/middleware/authorization/async_single_team_authorization.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/authorization/async_single_team_authorization.html rename to docs/reference/middleware/authorization/async_single_team_authorization.html diff --git a/docs/static/api-docs/slack_bolt/middleware/authorization/authorization.html b/docs/reference/middleware/authorization/authorization.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/authorization/authorization.html rename to docs/reference/middleware/authorization/authorization.html diff --git a/docs/static/api-docs/slack_bolt/middleware/authorization/index.html b/docs/reference/middleware/authorization/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/authorization/index.html rename to docs/reference/middleware/authorization/index.html diff --git a/docs/static/api-docs/slack_bolt/middleware/authorization/internals.html b/docs/reference/middleware/authorization/internals.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/authorization/internals.html rename to docs/reference/middleware/authorization/internals.html diff --git a/docs/static/api-docs/slack_bolt/middleware/authorization/multi_teams_authorization.html b/docs/reference/middleware/authorization/multi_teams_authorization.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/authorization/multi_teams_authorization.html rename to docs/reference/middleware/authorization/multi_teams_authorization.html diff --git a/docs/static/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html b/docs/reference/middleware/authorization/single_team_authorization.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/authorization/single_team_authorization.html rename to docs/reference/middleware/authorization/single_team_authorization.html diff --git a/docs/static/api-docs/slack_bolt/middleware/custom_middleware.html b/docs/reference/middleware/custom_middleware.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/custom_middleware.html rename to docs/reference/middleware/custom_middleware.html diff --git a/docs/static/api-docs/slack_bolt/middleware/ignoring_self_events/async_ignoring_self_events.html b/docs/reference/middleware/ignoring_self_events/async_ignoring_self_events.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/ignoring_self_events/async_ignoring_self_events.html rename to docs/reference/middleware/ignoring_self_events/async_ignoring_self_events.html diff --git a/docs/static/api-docs/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.html b/docs/reference/middleware/ignoring_self_events/ignoring_self_events.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/ignoring_self_events/ignoring_self_events.html rename to docs/reference/middleware/ignoring_self_events/ignoring_self_events.html diff --git a/docs/static/api-docs/slack_bolt/middleware/ignoring_self_events/index.html b/docs/reference/middleware/ignoring_self_events/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/ignoring_self_events/index.html rename to docs/reference/middleware/ignoring_self_events/index.html diff --git a/docs/static/api-docs/slack_bolt/middleware/index.html b/docs/reference/middleware/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/index.html rename to docs/reference/middleware/index.html diff --git a/docs/static/api-docs/slack_bolt/middleware/message_listener_matches/async_message_listener_matches.html b/docs/reference/middleware/message_listener_matches/async_message_listener_matches.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/message_listener_matches/async_message_listener_matches.html rename to docs/reference/middleware/message_listener_matches/async_message_listener_matches.html diff --git a/docs/static/api-docs/slack_bolt/middleware/message_listener_matches/index.html b/docs/reference/middleware/message_listener_matches/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/message_listener_matches/index.html rename to docs/reference/middleware/message_listener_matches/index.html diff --git a/docs/static/api-docs/slack_bolt/middleware/message_listener_matches/message_listener_matches.html b/docs/reference/middleware/message_listener_matches/message_listener_matches.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/message_listener_matches/message_listener_matches.html rename to docs/reference/middleware/message_listener_matches/message_listener_matches.html diff --git a/docs/static/api-docs/slack_bolt/middleware/middleware.html b/docs/reference/middleware/middleware.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/middleware.html rename to docs/reference/middleware/middleware.html diff --git a/docs/static/api-docs/slack_bolt/middleware/middleware_error_handler.html b/docs/reference/middleware/middleware_error_handler.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/middleware_error_handler.html rename to docs/reference/middleware/middleware_error_handler.html diff --git a/docs/static/api-docs/slack_bolt/middleware/request_verification/async_request_verification.html b/docs/reference/middleware/request_verification/async_request_verification.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/request_verification/async_request_verification.html rename to docs/reference/middleware/request_verification/async_request_verification.html diff --git a/docs/static/api-docs/slack_bolt/middleware/request_verification/index.html b/docs/reference/middleware/request_verification/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/request_verification/index.html rename to docs/reference/middleware/request_verification/index.html diff --git a/docs/static/api-docs/slack_bolt/middleware/request_verification/request_verification.html b/docs/reference/middleware/request_verification/request_verification.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/request_verification/request_verification.html rename to docs/reference/middleware/request_verification/request_verification.html diff --git a/docs/static/api-docs/slack_bolt/middleware/ssl_check/async_ssl_check.html b/docs/reference/middleware/ssl_check/async_ssl_check.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/ssl_check/async_ssl_check.html rename to docs/reference/middleware/ssl_check/async_ssl_check.html diff --git a/docs/static/api-docs/slack_bolt/middleware/ssl_check/index.html b/docs/reference/middleware/ssl_check/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/ssl_check/index.html rename to docs/reference/middleware/ssl_check/index.html diff --git a/docs/static/api-docs/slack_bolt/middleware/ssl_check/ssl_check.html b/docs/reference/middleware/ssl_check/ssl_check.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/ssl_check/ssl_check.html rename to docs/reference/middleware/ssl_check/ssl_check.html diff --git a/docs/static/api-docs/slack_bolt/middleware/url_verification/async_url_verification.html b/docs/reference/middleware/url_verification/async_url_verification.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/url_verification/async_url_verification.html rename to docs/reference/middleware/url_verification/async_url_verification.html diff --git a/docs/static/api-docs/slack_bolt/middleware/url_verification/index.html b/docs/reference/middleware/url_verification/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/url_verification/index.html rename to docs/reference/middleware/url_verification/index.html diff --git a/docs/static/api-docs/slack_bolt/middleware/url_verification/url_verification.html b/docs/reference/middleware/url_verification/url_verification.html similarity index 100% rename from docs/static/api-docs/slack_bolt/middleware/url_verification/url_verification.html rename to docs/reference/middleware/url_verification/url_verification.html diff --git a/docs/static/api-docs/slack_bolt/oauth/async_callback_options.html b/docs/reference/oauth/async_callback_options.html similarity index 100% rename from docs/static/api-docs/slack_bolt/oauth/async_callback_options.html rename to docs/reference/oauth/async_callback_options.html diff --git a/docs/static/api-docs/slack_bolt/oauth/async_internals.html b/docs/reference/oauth/async_internals.html similarity index 100% rename from docs/static/api-docs/slack_bolt/oauth/async_internals.html rename to docs/reference/oauth/async_internals.html diff --git a/docs/static/api-docs/slack_bolt/oauth/async_oauth_flow.html b/docs/reference/oauth/async_oauth_flow.html similarity index 100% rename from docs/static/api-docs/slack_bolt/oauth/async_oauth_flow.html rename to docs/reference/oauth/async_oauth_flow.html diff --git a/docs/static/api-docs/slack_bolt/oauth/async_oauth_settings.html b/docs/reference/oauth/async_oauth_settings.html similarity index 100% rename from docs/static/api-docs/slack_bolt/oauth/async_oauth_settings.html rename to docs/reference/oauth/async_oauth_settings.html diff --git a/docs/static/api-docs/slack_bolt/oauth/callback_options.html b/docs/reference/oauth/callback_options.html similarity index 100% rename from docs/static/api-docs/slack_bolt/oauth/callback_options.html rename to docs/reference/oauth/callback_options.html diff --git a/docs/static/api-docs/slack_bolt/oauth/index.html b/docs/reference/oauth/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/oauth/index.html rename to docs/reference/oauth/index.html diff --git a/docs/static/api-docs/slack_bolt/oauth/internals.html b/docs/reference/oauth/internals.html similarity index 100% rename from docs/static/api-docs/slack_bolt/oauth/internals.html rename to docs/reference/oauth/internals.html diff --git a/docs/static/api-docs/slack_bolt/oauth/oauth_flow.html b/docs/reference/oauth/oauth_flow.html similarity index 100% rename from docs/static/api-docs/slack_bolt/oauth/oauth_flow.html rename to docs/reference/oauth/oauth_flow.html diff --git a/docs/static/api-docs/slack_bolt/oauth/oauth_settings.html b/docs/reference/oauth/oauth_settings.html similarity index 100% rename from docs/static/api-docs/slack_bolt/oauth/oauth_settings.html rename to docs/reference/oauth/oauth_settings.html diff --git a/docs/static/api-docs/slack_bolt/request/async_internals.html b/docs/reference/request/async_internals.html similarity index 100% rename from docs/static/api-docs/slack_bolt/request/async_internals.html rename to docs/reference/request/async_internals.html diff --git a/docs/static/api-docs/slack_bolt/request/async_request.html b/docs/reference/request/async_request.html similarity index 100% rename from docs/static/api-docs/slack_bolt/request/async_request.html rename to docs/reference/request/async_request.html diff --git a/docs/static/api-docs/slack_bolt/request/index.html b/docs/reference/request/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/request/index.html rename to docs/reference/request/index.html diff --git a/docs/static/api-docs/slack_bolt/request/internals.html b/docs/reference/request/internals.html similarity index 100% rename from docs/static/api-docs/slack_bolt/request/internals.html rename to docs/reference/request/internals.html diff --git a/docs/static/api-docs/slack_bolt/request/payload_utils.html b/docs/reference/request/payload_utils.html similarity index 100% rename from docs/static/api-docs/slack_bolt/request/payload_utils.html rename to docs/reference/request/payload_utils.html diff --git a/docs/static/api-docs/slack_bolt/request/request.html b/docs/reference/request/request.html similarity index 100% rename from docs/static/api-docs/slack_bolt/request/request.html rename to docs/reference/request/request.html diff --git a/docs/static/api-docs/slack_bolt/response/index.html b/docs/reference/response/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/response/index.html rename to docs/reference/response/index.html diff --git a/docs/static/api-docs/slack_bolt/response/response.html b/docs/reference/response/response.html similarity index 100% rename from docs/static/api-docs/slack_bolt/response/response.html rename to docs/reference/response/response.html diff --git a/docs/static/api-docs/slack_bolt/util/async_utils.html b/docs/reference/util/async_utils.html similarity index 100% rename from docs/static/api-docs/slack_bolt/util/async_utils.html rename to docs/reference/util/async_utils.html diff --git a/docs/static/api-docs/slack_bolt/util/index.html b/docs/reference/util/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/util/index.html rename to docs/reference/util/index.html diff --git a/docs/static/api-docs/slack_bolt/util/utils.html b/docs/reference/util/utils.html similarity index 100% rename from docs/static/api-docs/slack_bolt/util/utils.html rename to docs/reference/util/utils.html diff --git a/docs/static/api-docs/slack_bolt/version.html b/docs/reference/version.html similarity index 100% rename from docs/static/api-docs/slack_bolt/version.html rename to docs/reference/version.html diff --git a/docs/static/api-docs/slack_bolt/workflows/index.html b/docs/reference/workflows/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/workflows/index.html rename to docs/reference/workflows/index.html diff --git a/docs/static/api-docs/slack_bolt/workflows/step/async_step.html b/docs/reference/workflows/step/async_step.html similarity index 100% rename from docs/static/api-docs/slack_bolt/workflows/step/async_step.html rename to docs/reference/workflows/step/async_step.html diff --git a/docs/static/api-docs/slack_bolt/workflows/step/async_step_middleware.html b/docs/reference/workflows/step/async_step_middleware.html similarity index 100% rename from docs/static/api-docs/slack_bolt/workflows/step/async_step_middleware.html rename to docs/reference/workflows/step/async_step_middleware.html diff --git a/docs/static/api-docs/slack_bolt/workflows/step/index.html b/docs/reference/workflows/step/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/workflows/step/index.html rename to docs/reference/workflows/step/index.html diff --git a/docs/static/api-docs/slack_bolt/workflows/step/internals.html b/docs/reference/workflows/step/internals.html similarity index 100% rename from docs/static/api-docs/slack_bolt/workflows/step/internals.html rename to docs/reference/workflows/step/internals.html diff --git a/docs/static/api-docs/slack_bolt/workflows/step/step.html b/docs/reference/workflows/step/step.html similarity index 100% rename from docs/static/api-docs/slack_bolt/workflows/step/step.html rename to docs/reference/workflows/step/step.html diff --git a/docs/static/api-docs/slack_bolt/workflows/step/step_middleware.html b/docs/reference/workflows/step/step_middleware.html similarity index 100% rename from docs/static/api-docs/slack_bolt/workflows/step/step_middleware.html rename to docs/reference/workflows/step/step_middleware.html diff --git a/docs/static/api-docs/slack_bolt/workflows/step/utilities/async_complete.html b/docs/reference/workflows/step/utilities/async_complete.html similarity index 100% rename from docs/static/api-docs/slack_bolt/workflows/step/utilities/async_complete.html rename to docs/reference/workflows/step/utilities/async_complete.html diff --git a/docs/static/api-docs/slack_bolt/workflows/step/utilities/async_configure.html b/docs/reference/workflows/step/utilities/async_configure.html similarity index 100% rename from docs/static/api-docs/slack_bolt/workflows/step/utilities/async_configure.html rename to docs/reference/workflows/step/utilities/async_configure.html diff --git a/docs/static/api-docs/slack_bolt/workflows/step/utilities/async_fail.html b/docs/reference/workflows/step/utilities/async_fail.html similarity index 100% rename from docs/static/api-docs/slack_bolt/workflows/step/utilities/async_fail.html rename to docs/reference/workflows/step/utilities/async_fail.html diff --git a/docs/static/api-docs/slack_bolt/workflows/step/utilities/async_update.html b/docs/reference/workflows/step/utilities/async_update.html similarity index 100% rename from docs/static/api-docs/slack_bolt/workflows/step/utilities/async_update.html rename to docs/reference/workflows/step/utilities/async_update.html diff --git a/docs/static/api-docs/slack_bolt/workflows/step/utilities/complete.html b/docs/reference/workflows/step/utilities/complete.html similarity index 100% rename from docs/static/api-docs/slack_bolt/workflows/step/utilities/complete.html rename to docs/reference/workflows/step/utilities/complete.html diff --git a/docs/static/api-docs/slack_bolt/workflows/step/utilities/configure.html b/docs/reference/workflows/step/utilities/configure.html similarity index 100% rename from docs/static/api-docs/slack_bolt/workflows/step/utilities/configure.html rename to docs/reference/workflows/step/utilities/configure.html diff --git a/docs/static/api-docs/slack_bolt/workflows/step/utilities/fail.html b/docs/reference/workflows/step/utilities/fail.html similarity index 100% rename from docs/static/api-docs/slack_bolt/workflows/step/utilities/fail.html rename to docs/reference/workflows/step/utilities/fail.html diff --git a/docs/static/api-docs/slack_bolt/workflows/step/utilities/index.html b/docs/reference/workflows/step/utilities/index.html similarity index 100% rename from docs/static/api-docs/slack_bolt/workflows/step/utilities/index.html rename to docs/reference/workflows/step/utilities/index.html diff --git a/docs/static/api-docs/slack_bolt/workflows/step/utilities/update.html b/docs/reference/workflows/step/utilities/update.html similarity index 100% rename from docs/static/api-docs/slack_bolt/workflows/step/utilities/update.html rename to docs/reference/workflows/step/utilities/update.html diff --git a/docs/sidebars.js b/docs/sidebars.js deleted file mode 100644 index decb8cccb..000000000 --- a/docs/sidebars.js +++ /dev/null @@ -1,127 +0,0 @@ -/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ -const sidebars = { - sidebarBoltPy: [ - { - type: 'doc', - id: 'index', - label: 'Bolt for Python', - className: 'sidebar-title', - }, - { - type: 'doc', - id: 'getting-started', - }, - { type: 'html', value: '


    ' }, - { - type: 'category', - label: 'Guides', - collapsed: false, - items: [ - "building-an-app", - { - type: "category", - label: "Slack API calls", - items: ["concepts/message-sending", "concepts/web-api"], - }, - { - type: "category", - label: "Events", - items: ["concepts/message-listening", "concepts/event-listening"], - }, - { - type: "category", - label: "App UI & Interactivity", - items: [ - "concepts/acknowledge", - "concepts/shortcuts", - "concepts/commands", - "concepts/actions", - "concepts/opening-modals", - "concepts/updating-pushing-views", - "concepts/view-submissions", - "concepts/select-menu-options", - "concepts/app-home", - ], - }, - "concepts/ai-apps", - { - type: 'category', - label: 'Custom Steps', - items: [ - 'concepts/custom-steps', - 'concepts/custom-steps-dynamic-options', - ] - }, - { - type: "category", - label: "App Configuration", - items: [ - "concepts/socket-mode", - "concepts/errors", - "concepts/logging", - "concepts/async", - ], - }, - { - type: "category", - label: "Middleware & Context", - items: [ - "concepts/global-middleware", - "concepts/listener-middleware", - "concepts/context", - ], - }, - "concepts/lazy-listeners", - { - type: "category", - label: "Adaptors", - items: ["concepts/adapters", "concepts/custom-adapters"], - }, - { - type: "category", - label: "Authorization & Security", - items: [ - "concepts/authenticating-oauth", - "concepts/authorization", - "concepts/token-rotation", - ], - }, - { - type: "category", - label: "Legacy", - items: ["concepts/steps-from-apps"], - }, - ], - }, - { type: "html", value: "
    " }, - { - type: "category", - label: "Tutorials", - items: ["tutorial/ai-chatbot", "tutorial/custom-steps", "tutorial/custom-steps-for-jira", "tutorial/custom-steps-workflow-builder-new", "tutorial/custom-steps-workflow-builder-existing", "tutorial/modals"], - }, - { type: "html", value: "
    " }, - { - type: "link", - label: "Reference", - href: "https://tools.slack.dev/bolt-python/api-docs/slack_bolt/", - }, - { type: "html", value: "
    " }, - { - type: "link", - label: "Release notes", - href: "https://github.com/slackapi/bolt-python/releases", - }, - { - type: "link", - label: "Code on GitHub", - href: "https://github.com/SlackAPI/bolt-python", - }, - { - type: "link", - label: "Contributors Guide", - href: "https://github.com/SlackAPI/bolt-python/blob/main/.github/contributing.md", - }, - ], -}; - -export default sidebars; diff --git a/docs/src/css/custom.css b/docs/src/css/custom.css deleted file mode 100644 index 8a0fa6ca2..000000000 --- a/docs/src/css/custom.css +++ /dev/null @@ -1,583 +0,0 @@ -:root { - --ifm-font-size-base: 15px; - - /* set hex colors here pls */ - --dim: #eef2f6; - - --aubergine: #481a54; - --aubergine-background: #552555; - --aubergine-dark: #2c0134; - - --aubergine-active: #7c3085; - --aubergine-active-70: #7c308570; - --aubergine-active-50: #7c308550; - --aubergine-active-30: #7c308530; - - --horchata: #f4ede4; - - --slack-red: #e3066a; - --slack-red-70: #e3066a70; - --slack-red-50: #e3066a50; - --slack-red-30: #e3066a30; - --slack-red-20: #e3066a20; - - --slack-yellow: #fcc003; - --slack-yellow-70: #fcc00370; - --slack-yellow-50: #fcc00350; - --slack-yellow-30: #fcc00330; - --slack-yellow-20: #fcc00320; - - --slack-green: #41b658; - --slack-green-70: #41b65870; - --slack-green-50: #41b65850; - --slack-green-30: #41b65830; - --slack-green-20: #41b65820; - - --slack-blue: #1ab9ff; - --slack-blue-70: #1ab9ff70; - --slack-blue-50: #1ab9ff70; - --slack-blue-30: #1ab9ff30; - --slack-blue-20: #1ab9ff20; - - /* used for dark-mode links */ - --slack-cloud-blue: #1ab9ff; - /* slack marketing color used for light-mode links */ - --slack-dark-blue: #1264a3; - - /* used for functions */ - --unofficial-orange: #e36606; - --unofficial-orange-70: #e3660670; - --unofficial-orange-50: #e3660650; - --unofficial-orange-30: #e3660630; - - /* turns opacity into flat colors for bubbles on top of things */ - --slack-yellow-70-flat: #fcc00370; - - --slack-yellow-30-on-white: #feecb3; - --slack-green-30-on-white: #c6e9cc; - --slack-red-30-on-white: #f6b4d2; - --slack-blue-30-on-white: #baeaff; - --unofficial-orange-30-on-white: #f6d1b4; - --aubergine-active-30-on-white: #d7c0da; - - --ifm-h5-font-size: 1rem; - /* --ifm-heading-font-family: 'AvantGardeForSalesforce', sans-serif; */ - /* --ifm-font-family-base: 'Salesforce_Sans', sans-serif; */ - --ifm-navbar-height: 83px; - - -} - -.navbar__logo img { - height: 150%; - margin-top: -8px; -} - -.navbar--dark { - --ifm-navbar-background-color: #000 !important; - --ifm-navbar-link-hover-color: var(--slack-blue); -} - -.footer { - --ifm-footer-background-color: #000 !important; - --ifm-footer-link-hover-color: var(--slack-blue); - --ifm-footer-color: white !important; -} - -.theme-admonition div{ - text-transform: none !important; /* Disables uppercase transformation */ - -} - -/* resets striped tables that hurt me eyes */ -table tr:nth-child(even) { - background-color: inherit; -} - -h1 { - font-size: 2.5rem; -} - -/* Reduce title size in blog list */ -.blog-list-page h2[class*="title"] -{ - font-size: 2rem; -} - -/* Reduce title size in blog page */ -.blog-post-page h1[class*="title"] -{ - font-size: 2rem; -} - -/* changing the links to blue for accessibility */ -p a, -.markdown a { - color: var(--slack-cloud-blue); - text-decoration: none; -} - -p a, -.markdown a:hover { - text-decoration: underline; -} - -a:hover { - color: var(--slack-cloud-blue); -} - -.article h1 { - font-size: 1rem !important; /* Adjust the size as needed */ -} - -.card { - box-shadow: none; -} - -/* adjusting for light and dark modes */ -[data-theme="light"] { - --docusaurus-highlighted-code-line-bg: var(--dim); - --ifm-color-primary: var(--aubergine-active); - --ifm-navbar-background-color: black; - --ifm-footer-background-color: black; - --slack-cloud-blue: var(--slack-dark-blue); - --reference-section-color: var(--horchata); -} - -[data-theme="dark"] { - --docusaurus-highlighted-code-line-bg: rgb(0 0 0 / 30%); - --ifm-color-primary: var(--slack-cloud-blue); - --ifm-navbar-background-color: #000 !important; - --ifm-footer-background-color: #000 !important; - --ifm-footer-color: white; -} - -.alert--warning { - --ifm-alert-background-color: var(--slack-yellow-30); - --ifm-alert-border-color: var(--slack-yellow); - --ifm-alert-background-color-highlight: var(--slack-yellow-30); -} - -.alert--info { - --ifm-alert-background-color: var(--slack-blue-30); - --ifm-alert-border-color: var(--slack-blue); - /* --ifm-alert-background-color-highlight: var(--slack-blue-30); */ -} - -.alert--danger { - --ifm-alert-background-color: var(--slack-red-30); - --ifm-alert-border-color: var(--slack-red); -} - -.alert--success { - --ifm-alert-background-color: var(--slack-green-30); - --ifm-alert-border-color: var(--slack-green); -} - -.footer { - /* font-size: 80%; */ - padding-bottom: 0.5rem; -} - -.footer__items a { - color: inherit; -} - -.footer .container { - margin: 0; -} - -.table-of-contents__link { - font-size: .9rem; -} - -/* bolding ToC for contrast */ -.table-of-contents__link--active { - font-weight: bold; -} - -/* removing ToC line */ -.table-of-contents__left-border { - border-left: none !important; -} - - -.dropdown-hr { - margin: 0 -} - -/* increasing name of site in sidebar */ -.sidebar-title { - /* padding-bottom: 0.5rem; - font-size: 1.25em; */ - font-weight: bold; -} - -.theme-doc-sidebar-item-link hr { - margin: 1rem; -} - -.sidebar-sdk-title { - /* margin: 0.5rem 0; */ - padding: 0.5rem; - /* border-radius: 4px; */ - border-bottom: 0.5px solid grey; -} - -/* .theme-doc-sidebar-item-category-level-1 .menu__link { - font-weight: bold; -} */ - -.theme-doc-sidebar-item-category-level-1 .menu__list-item .menu__link { - font-weight: normal; -} - -/* removing sidebar line and adding space to match ToC */ -.theme-doc-sidebar-container { - border-right: none !important; - margin-right: 2rem; -} - -/* announcement bar up top */ -div[class^="announcementBar_"] { - font-size: 20px; - height: 50px; - background: var(--horchata); -} - -/* navbar github link */ -.navbar-github-link { - width: 32px; - height: 32px; - padding: 6px; - margin-right: 6px; - margin-left: 6px; - border-radius: 50%; - transition: background var(--ifm-transition-fast); -} - -.navbar-github-link:hover { - background: var(--ifm-color-gray-800); -} - -.navbar-github-link::before { - content: ""; - height: 100%; - display: block; - background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='white' d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E") - no-repeat; -} - -/* Delineate tab blocks */ -.tabs-container { - border: 1px solid var(--ifm-color-primary); - border-radius: 4px; - padding: 0.5em; -} - -summary { - background-color: var(--ifm-background-color); - --docusaurus-details-decoration-color: var(--ifm-color-primary); -} - -details { - border: 1px solid var(--ifm-color-primary)!important; - background-color: var(--ifm-background-color)!important; - --docusaurus-details-decoration-color: var(--ifm-color-primary); -} - -details[open] { - border: 1px solid var(--ifm-color-primary); - background-color: var(--ifm-background-color); - --docusaurus-details-decoration-color: var(--ifm-color-primary); - -} - -/* Docs code bubbles */ -[data-theme="light"] { - --contrast-color: black; - --code-link-background: var(--slack-blue-30); - --code-link-text: rgb(21, 50, 59); - - --method-link-background: var(--slack-green-30-on-white); - --method-link-text: rgb(0, 41, 0); - - --scope-link-background: var(--slack-yellow-30-on-white); - --scope-link-text: rgb(63, 46, 0); - - --event-link-background:#fad4e5; - /* --event-link-text: rgb(63, 0, 24); */ - --event-link-text: rgb(0, 0, 0); - - --function-link-background: var(--unofficial-orange-30-on-white); - --function-link-text: rgb(75, 35, 0); - - --command-link-background: var(--aubergine-active-30-on-white); - --command-link-text: rgb(75, 0, 75); -} - -[data-theme="dark"] { - --contrast-color: white; - --code-link-text: white; - --method-link-text: white; - --scope-link-text: white; - --event-link-text: white; - --function-link-text: white; - --command-link-text: white; - - --code-link-background: var(--slack-blue-70); - --method-link-background: var(--slack-green-70); - --scope-link-background: var(--slack-yellow-70); - --event-link-background: var(--slack-red-70); - --command-link-background: var(--aubergine-active); - --function-link-background: var(--unofficial-orange-70); -} - -a code { - background-color: var(--code-link-background); - color: var(--code-link-text); -} - -a[href^="https://docs.slack.dev/reference/methods"] > code -{ - background-color: var(--method-link-background); - color: var(--method-link-text); -} - -a[href^="/reference/methods"] > code -{ - background-color: var(--method-link-background); - color: var(--method-link-text); -} - -a[href^="https://docs.slack.dev/reference/scopes"] > code -{ - background-color: var(--scope-link-background); - color: var(--scope-link-text); -} - -a[href^="/reference/scopes"] > code -{ - background-color: var(--scope-link-background); - color: var(--scope-link-text); -} - -a[href^="https://docs.slack.dev/reference/events"] > code -{ - background-color: var(--event-link-background); - color: var(--event-link-text); -} - -a[href^="/reference/events"] > code -{ - background-color: var(--event-link-background); - color: var(--event-link-text); -} - -a[href^="/deno-slack-sdk/reference/slack-functions/"] > code { - background-color: var(--function-link-background); - color: var(--function-link-text); -} - -a[href^="/deno-slack-sdk/reference/connector-functions/"] > code { - background-color: var(--function-link-background); - color: var(--function-link-text); -} - -a[href^="/slack-cli/reference/commands"] > code { - background-color: var(--command-link-background); - color: var(--command-link-text); -} - -.facts-section { - margin-top: 2rem; - background-color: var(--slack-green-20) !important; -} - - -.facts-section .tabs-container { - border: none; - border-radius: 0px; - padding: 0em; - --ifm-leading: 0rem - -} - -.facts-section .tabs__item { - padding: 0 0.5rem; - color: inherit; -} - -.facts-section .tabs__item--active { - border-bottom-color: inherit -} - -.errors-section { - background-color: var(--slack-red-20) !important; -} - - -.inputs-section { - background-color: var(--slack-blue-20) !important; -} - -.functions-section { - border-radius: 6px; - padding: 1rem; - margin-bottom: 2rem; -} - -.facts-row-list { - display: flex; - flex-wrap: wrap; - column-gap: 0.5rem; - row-gap: 0.5rem; - align-items: baseline; /* Aligns items to the same baseline */ -} - -.facts-row-list-item { - display: inline-block; -} - - -.inline-icon { - height: 1.9em; /* Matches the height of the text */ - width: auto; /* Maintains aspect ratio */ - vertical-align: middle; /* Aligns with the text */ -} - -.functions-section .type { - text-align: right; -} - -.param-required-section { - padding-top: 1rem; - margin-bottom: 1rem; -} - -.reference-container { - display: flex; - flex-direction: column; - width: 100%; - /* border: 1px solid #ddd; */ - border-radius: 8px; - overflow: hidden; -} -.reference-facts-header { - display: flex; - /* background: #f4f4f4; */ - padding: 10px 0; - font-weight: bold; -} -.reference-facts-item { - display: flex; - padding: 10px 0; - border-bottom: 1px solid var(--ifm-color-emphasis-200); -} -.reference-facts-item:last-child { - border-bottom: none; -} - -.reference-name { - flex: 2; - /* padding: 5px;*/ - min-width: 200px; -} - -.reference-description { - flex: 2; /* Makes description take extra space */ - padding: 5px; -} - -.reference-last-column { - flex: 1; - padding: 5px 0; -} - -.reference-subitems-bubble { - display: inline-block; - background: var(--ifm-color-emphasis-200); - color: var(--ifm-color-emphasis-1000); - padding: 2px 6px; - margin: 2px; - border-radius: 4px; - font-size: 12px; -} - -.param-container { - border-top: 1px solid lightgray; - padding-top: 1rem; - padding-bottom: 1rem; -} - -.param-container:last-child { - padding-bottom: 0; -} - -.param-top-row { - display: flex; - align-items: center; - margin-bottom: 1rem; -} - -/* left-align param name */ -.param-top-row .name { - flex: 1; -} - -/* right-align Required and Type */ -.param-top-row .required, -.param-top-row .type { - margin-left: auto; - text-align: right; -} - -/* add space between Required and Type */ -.param-top-row .required { - margin-left: 10px; -} - -.info-row { - display: flex; - /* align-items: center; */ - padding-top: 1rem; - padding-bottom: 1rem; - border-top: 1px solid var(--ifm-color-emphasis-400); -} - -.info-key { - flex: 0 0 10rem; - align-items: center; -} - -/* hides next and previous */ -.pagination-nav__link { - display: none; -} - -/* -html[data-theme="dark"] .button:hover { - background-color: var(--slack-blue-30-on-white); -} - -html[data-theme="light"] .button:hover { - background-color: var(--aubergine-active-30-on-white); -} */ - -.button { - background-color: var(--aubergine); /* Change color on hover */ - border: 0; - color: white; -} - -.button:hover { - background-color: var(--aubergine-active); - border: 0; - color: white; -} - -.footer-spaced { - display: flex; - gap: 20px; - padding-bottom: 1rem -} \ No newline at end of file diff --git a/docs/src/theme/NotFound/Content/index.js b/docs/src/theme/NotFound/Content/index.js deleted file mode 100644 index c122bc039..000000000 --- a/docs/src/theme/NotFound/Content/index.js +++ /dev/null @@ -1,36 +0,0 @@ -import React from 'react'; -import clsx from 'clsx'; -import Translate from '@docusaurus/Translate'; -import Heading from '@theme/Heading'; -export default function NotFoundContent({className}) { - return ( -
    -
    -
    - - - Oh no! There's nothing here. - - -

    - - If we've led you astray, please let us know. We'll do our best to get things in order. - - -

    -

    - - For now, we suggest heading back to the beginning to get your bearings. May your next journey have clear skies to guide you true. - -

    -
    -
    -
    - ); -} diff --git a/docs/src/theme/NotFound/index.js b/docs/src/theme/NotFound/index.js deleted file mode 100644 index 3b551f9e4..000000000 --- a/docs/src/theme/NotFound/index.js +++ /dev/null @@ -1,19 +0,0 @@ -import React from 'react'; -import {translate} from '@docusaurus/Translate'; -import {PageMetadata} from '@docusaurus/theme-common'; -import Layout from '@theme/Layout'; -import NotFoundContent from '@theme/NotFound/Content'; -export default function Index() { - const title = translate({ - id: 'theme.NotFound.title', - message: 'Page Not Found', - }); - return ( - <> - - - - - - ); -} diff --git a/docs/static/.nojekyll b/docs/static/.nojekyll deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/static/img/bolt-logo.svg b/docs/static/img/bolt-logo.svg deleted file mode 100644 index 5077600d5..000000000 --- a/docs/static/img/bolt-logo.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/docs/static/img/bolt-py-logo.svg b/docs/static/img/bolt-py-logo.svg deleted file mode 100644 index 1dcab5261..000000000 --- a/docs/static/img/bolt-py-logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/static/img/boltpy/bolt-favicon.png b/docs/static/img/boltpy/bolt-favicon.png deleted file mode 100644 index bfe5456c172c5e76fa9b13b1e8ab0a793b6e95cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3376 zcmcIneKb_*AHQb2EK6y88ggmQgUDf-K&lW( z#5fHj6d{RMu<)qTk1mL$Gqhs)RG83!k(7{>L?(h7m!^SS?!QAtq8YSY;gNt^nbP~W z#B%>6DMIo?*gF!GEkX|zNkkw;7Z z!H=2c8E>RawhVz35}Ch5BAiZ??=%aJf|BFxxezQ6Yj_`$gLsZLB99UU`4@FSFqRstVVK%WMd@CA`cp91A_nO2A>8Z2sP3fW_-|v?&nD0cufE``#%;gUjm~XGcjU< zG&?XD2El0tB7W`lLoeP6!0iDDX7f8kqn+JCN|NtQu8(lo5u>APt5n z1U@aoh2VtH83Y#wJ%Rv|T_8S{&!^GpWIT=!Gb1H35rkHXKm@UW&H5I%ltTJSev{xpX^(k4bDDCxgc$w!!65~)apWQbc7nvzeb zL()IVmqQ8vF8?RrJ#d0MNbf#c}gj=CvFZWSe@Jrd%lfz6dv!2bSMZp+ zr(rz-lf`rMZ4wer{CKkI^}cIGdo~4(oqcmIsN!TpocGp7@&urVZBN~BT+h|LbC-Uy{!iM=Fy~L-tcegV zIc}C~6o$#uwJo(T1dNnOd162EtM0H~AVAW(p0d1<))CIu!qiySn7Ld^tH1f=@WJ;Y ztU2}uux)L6bH;9_&bYQx=S)5c!Hn29`GlEz_?8)TT0BP$_+0~%Sz$o(XRGx?*VhOmos;dI`t_nP?R(DMMuiT2(!NH6SGUremcC2cY3H#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N%;Kw%qgPU+%IJ1`j4}E1TQ9zhx2l-Ca@!D99g%U`9~M{W910frIJnnjJ-=x9 zTAregb`B^^0cs4C-R^}?8n37ht6r{h4jhzLS$=hPukMZcQ15GMi7Y6jGvk4qn)1SC z!S&nQfEtsU?6;gBtzz_Rdz&1=H^+CJE+3y$6*QW&%K4CAtok)o%51tM{z+QlodCVW zsvByCS~*5%k2N};Qd(BE{IX#@H}kGx--htSvNWNZIf)s@eA~ncizQrjyb{<)?h96% z_gsDb`O$B7I>V8nyU5QTl;m;`o-4e?Yr%GECm(rFX#CStUir<^U4ntO`nPN{dn{O; z^|M&5yW>(vOIj!w+VSVc+<6bJR-fI%nq^Y`9vV diff --git a/docs/static/img/boltpy/ngrok.gif b/docs/static/img/boltpy/ngrok.gif deleted file mode 100644 index c7c94d51a303aedcbee5302988b5b6629940e8b7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 49094 zcmd?RcU+V0wk`Um2LkxgJ0$cf0RfSsp?3@&Y0{gB0qLS9bdVB?fT$RxS7{;wYUl`v zK~X_aK~O0cKvYnagMQ!IYwdg1*>|7&JNN!`fxi9AzT9cc(SMgBb4PblgVkYDHap`z>oNF$f?s*xQCXWSyRwb)~JRrFTeP zTp&F590b7Z?(Wt%wdoy{g#a9BnOU>5v#~Cwi;IigT%faytDm1Agaxp(vsXQ+H841+ zqopA%Bt$%FsjH_KclMm1xZ-tMiKG60M}38y+}w$YiPO&dXVObg+ZiP1ma51~bai#z z>1;hjJkFtDsA3jWS67=yO}u#V;?t*3$HvAYPlhBUBv|-HOA2!Fu|U$Uw|4an0Du%0 z0GI(lTZ*@?D5Ji+|4vJ}wiw*)bpFxfiLPOZttH8Ax4R1?+^=0stVlmqc9T9hG&IoH z?G_w0&{@^nR$}5Dex6#-0YJD!<=V?Llge+Bvg^9)3y+_@mYiIi7!~As?wT4uvbmzL z_^eM=b#?2VzAN<|qTKsVQ?jn5pTTencC^&g=bf`q6U?vcs>wRv+E9Lqa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? z8@vQS$4`Miqm8}1jb{eI{X6yK{5%6(KK>dN6%~Ml<*#VNf`UXv;E_uct)$kiVT_>< zS4-CbvTD|9rS97DaCNkLKA7A1do#9CjT~f*b3ujOa*6?gvl{aqQxQOBteikOQmQK1 zn&9UE|B?S(aQ{xLS0HV*#O8dyahp0e5R)UaB#b|cG5>STk{0MG6?7$b{>SId6fG`V z>}t=0-w*Ylzl+v*X%L9Q&JGe8pY;Hnvn`PH{pLsrh zo(Pn}bKiM+(LX3SpOGTcLZtWl-MRRn` xjhx&pX5a@8$K*B982UdKy`Mv%7*=y~p&I`v^hAjx`~vus5|e+F{Xoy-{{ZkNhdBTM diff --git a/docs/static/img/boltpy/signing-secret.png b/docs/static/img/boltpy/signing-secret.png deleted file mode 100644 index d32afa03e670f36d023355d91c76f0f475a690f8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 289939 zcmeFYWmH_-wl&I*LV!RB!9BRUOM<%=ZYiLU;1sSQL4t+g4j~CnaCd@h1$TFMw>Puz z+57Bs+xOje|GZ!Ct=6bkEasYP%9vyH-p3$FSy2l83BeO2BqVehX>nB~q$h8YkRIhD z-vf72!dk|_jS>qnF=cTJxSbW$4GBp)C??iS88U(6KUQDKG4tI9^YgEFCa>R{L=fpH ze@3HDv~ei1Cg@FQeioYj@eSURWIk5$OM&sY7#&7>%eRhV3*bNkUl=5fp>amKEw3rTUmKbn4> z*}g{F6L^i(#H90)d96{5AgSZVu9NfL6 z5%9?lphL2$5v0U=$Nh?^KanJNd3qUTK`fd4VF0g?2&L&qD!1DpF~%2<{pj~hm5>P+ zheOFC2BpY@NsKOzr89hF4c-i6hOEq4u9&r*({E*dj826Qep?EtB75ol6LSqF;qQ$& z(A+${mWCm64#`$R`P_Vx7{tE!YJQgrq&36#*<+$&F_`$kNkyidv(`=vH+dqG(a0zu znvfProIiZ@4|(ix_1BwGj~9h5QQp775`3?;jwR`b z4;ACZvT4<#_>BCLBIp4{kn~H3AWtKb;%HiO*`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;bsC$BO!9{9#fRgOKjDLKV_{wKf<*TqSGRD>-l+x2rsv61tI zC;3|_t<^_Bl@t~xcMfHCT8yY{m3>Vxe~EMdPw0i0vB?KT??VaSp2K6-`-V5E)f|0N zRX)NlDYIf8h4Z~(xZH3Ff(n?b92pUjd`(2+=m)XO6@yYkn*cnRVk`kd4M03+9N$pD z7N@4hdZD>dh!oW|i4MQ%KGWtgFxge?$FAZT#8e6pJ~A})wRsNQwq#@;coEKD=Zm*1 zitPN_i;o!7LGaVv1%{)q09T|vW$*=>2MH{vYZH&ZmR`i%!PIsTJbYR(zaJ+91=h

    Bolt Bolt logo for Python

    +

    Bolt Bolt logo for Python

    From c0ea30f8699ad3fe87f0b199c94dadb46420bba7 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Fri, 22 Aug 2025 16:11:49 -0400 Subject: [PATCH 641/719] feat: surface ack_timeout on the handler (#1351) --- slack_bolt/app/app.py | 14 +++++---- slack_bolt/app/async_app.py | 13 +++++---- slack_bolt/listener/async_listener.py | 8 +++--- slack_bolt/listener/asyncio_runner.py | 2 +- slack_bolt/listener/custom_listener.py | 6 ++-- slack_bolt/listener/listener.py | 2 +- slack_bolt/listener/thread_runner.py | 2 +- slack_bolt/logger/messages.py | 6 ++++ tests/scenario_tests/test_function.py | 31 ++++++++++++++++++-- tests/scenario_tests_async/test_function.py | 32 +++++++++++++++++++-- 10 files changed, 92 insertions(+), 24 deletions(-) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 86909ed18..60f20ea9e 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -59,6 +59,7 @@ info_default_oauth_settings_loaded, error_installation_store_required_for_builtin_listeners, warning_unhandled_by_global_middleware, + warning_ack_timeout_has_no_effect, ) from slack_bolt.middleware import ( Middleware, @@ -912,6 +913,7 @@ def function( matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, auto_acknowledge: bool = True, + ack_timeout: int = 3, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new Function listener. This method can be used as either a decorator or a method. @@ -940,15 +942,17 @@ def reverse_string(ack: Ack, inputs: dict, complete: Complete, fail: Fail): Only when all the middleware call `next()` method, the listener function can be invoked. """ + if auto_acknowledge is True: + if ack_timeout != 3: + self._framework_logger.warning(warning_ack_timeout_has_no_effect(callback_id, ack_timeout)) + matchers = list(matchers) if matchers else [] middleware = list(middleware) if middleware else [] def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.function_executed(callback_id=callback_id, base_logger=self._base_logger) - return self._register_listener( - functions, primary_matcher, matchers, middleware, auto_acknowledge, acknowledgement_timeout=5 - ) + return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge, ack_timeout) return __call__ @@ -1424,7 +1428,7 @@ def _register_listener( matchers: Optional[Sequence[Callable[..., bool]]], middleware: Optional[Sequence[Union[Callable, Middleware]]], auto_acknowledgement: bool = False, - acknowledgement_timeout: int = 3, + ack_timeout: int = 3, ) -> Optional[Callable[..., Optional[BoltResponse]]]: value_to_return = None if not isinstance(functions, list): @@ -1455,7 +1459,7 @@ def _register_listener( matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, - acknowledgement_timeout=acknowledgement_timeout, + ack_timeout=ack_timeout, base_logger=self._base_logger, ) ) diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 294fb8b0c..906359fcc 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -68,6 +68,7 @@ info_default_oauth_settings_loaded, error_installation_store_required_for_builtin_listeners, warning_unhandled_by_global_middleware, + warning_ack_timeout_has_no_effect, ) from slack_bolt.lazy_listener.asyncio_runner import AsyncioLazyListenerRunner from slack_bolt.listener.async_listener import AsyncListener, AsyncCustomListener @@ -940,6 +941,7 @@ def function( matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, auto_acknowledge: bool = True, + ack_timeout: int = 3, ) -> Callable[..., Optional[Callable[..., Awaitable[BoltResponse]]]]: """Registers a new Function listener. This method can be used as either a decorator or a method. @@ -967,6 +969,9 @@ async def reverse_string(ack: AsyncAck, inputs: dict, complete: AsyncComplete, f middleware: A list of lister middleware functions. Only when all the middleware call `next()` method, the listener function can be invoked. """ + if auto_acknowledge is True: + if ack_timeout != 3: + self._framework_logger.warning(warning_ack_timeout_has_no_effect(callback_id, ack_timeout)) matchers = list(matchers) if matchers else [] middleware = list(middleware) if middleware else [] @@ -976,9 +981,7 @@ def __call__(*args, **kwargs): primary_matcher = builtin_matchers.function_executed( callback_id=callback_id, base_logger=self._base_logger, asyncio=True ) - return self._register_listener( - functions, primary_matcher, matchers, middleware, auto_acknowledge, acknowledgement_timeout=5 - ) + return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge, ack_timeout) return __call__ @@ -1458,7 +1461,7 @@ def _register_listener( matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]], middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]], auto_acknowledgement: bool = False, - acknowledgement_timeout: int = 3, + ack_timeout: int = 3, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: value_to_return = None if not isinstance(functions, list): @@ -1494,7 +1497,7 @@ def _register_listener( matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, - acknowledgement_timeout=acknowledgement_timeout, + ack_timeout=ack_timeout, base_logger=self._base_logger, ) ) diff --git a/slack_bolt/listener/async_listener.py b/slack_bolt/listener/async_listener.py index ca069b097..0810b91a7 100644 --- a/slack_bolt/listener/async_listener.py +++ b/slack_bolt/listener/async_listener.py @@ -15,7 +15,7 @@ class AsyncListener(metaclass=ABCMeta): ack_function: Callable[..., Awaitable[BoltResponse]] lazy_functions: Sequence[Callable[..., Awaitable[None]]] auto_acknowledgement: bool - acknowledgement_timeout: int + ack_timeout: int async def async_matches( self, @@ -88,7 +88,7 @@ class AsyncCustomListener(AsyncListener): matchers: Sequence[AsyncListenerMatcher] middleware: Sequence[AsyncMiddleware] auto_acknowledgement: bool - acknowledgement_timeout: int + ack_timeout: int arg_names: MutableSequence[str] logger: Logger @@ -101,7 +101,7 @@ def __init__( matchers: Sequence[AsyncListenerMatcher], middleware: Sequence[AsyncMiddleware], auto_acknowledgement: bool = False, - acknowledgement_timeout: int = 3, + ack_timeout: int = 3, base_logger: Optional[Logger] = None, ): self.app_name = app_name @@ -110,7 +110,7 @@ def __init__( self.matchers = matchers self.middleware = middleware self.auto_acknowledgement = auto_acknowledgement - self.acknowledgement_timeout = acknowledgement_timeout + self.ack_timeout = ack_timeout self.arg_names = get_arg_names_of_callable(ack_function) self.logger = get_bolt_app_logger(app_name, self.ack_function, base_logger) diff --git a/slack_bolt/listener/asyncio_runner.py b/slack_bolt/listener/asyncio_runner.py index 98d3bf4f8..81f9e6106 100644 --- a/slack_bolt/listener/asyncio_runner.py +++ b/slack_bolt/listener/asyncio_runner.py @@ -149,7 +149,7 @@ async def run_ack_function_asynchronously( self._start_lazy_function(lazy_func, request) # await for the completion of ack() in the async listener execution - while ack.response is None and time.time() - starting_time <= listener.acknowledgement_timeout: + while ack.response is None and time.time() - starting_time <= listener.ack_timeout: await asyncio.sleep(0.01) if response is None and ack.response is None: diff --git a/slack_bolt/listener/custom_listener.py b/slack_bolt/listener/custom_listener.py index e2977effa..2b73018db 100644 --- a/slack_bolt/listener/custom_listener.py +++ b/slack_bolt/listener/custom_listener.py @@ -18,7 +18,7 @@ class CustomListener(Listener): matchers: Sequence[ListenerMatcher] middleware: Sequence[Middleware] auto_acknowledgement: bool - acknowledgement_timeout: int = 3 + ack_timeout: int = 3 arg_names: MutableSequence[str] logger: Logger @@ -31,7 +31,7 @@ def __init__( matchers: Sequence[ListenerMatcher], middleware: Sequence[Middleware], auto_acknowledgement: bool = False, - acknowledgement_timeout: int = 3, + ack_timeout: int = 3, base_logger: Optional[Logger] = None, ): self.app_name = app_name @@ -40,7 +40,7 @@ def __init__( self.matchers = matchers self.middleware = middleware self.auto_acknowledgement = auto_acknowledgement - self.acknowledgement_timeout = acknowledgement_timeout + self.ack_timeout = ack_timeout self.arg_names = get_arg_names_of_callable(ack_function) self.logger = get_bolt_app_logger(app_name, self.ack_function, base_logger) diff --git a/slack_bolt/listener/listener.py b/slack_bolt/listener/listener.py index 51dadae56..7685f3c7b 100644 --- a/slack_bolt/listener/listener.py +++ b/slack_bolt/listener/listener.py @@ -13,7 +13,7 @@ class Listener(metaclass=ABCMeta): ack_function: Callable[..., BoltResponse] lazy_functions: Sequence[Callable[..., None]] auto_acknowledgement: bool - acknowledgement_timeout: int = 3 + ack_timeout: int = 3 def matches( self, diff --git a/slack_bolt/listener/thread_runner.py b/slack_bolt/listener/thread_runner.py index 61e8d6129..378ca1bfa 100644 --- a/slack_bolt/listener/thread_runner.py +++ b/slack_bolt/listener/thread_runner.py @@ -160,7 +160,7 @@ def run_ack_function_asynchronously(): self._start_lazy_function(lazy_func, request) # await for the completion of ack() in the async listener execution - while ack.response is None and time.time() - starting_time <= listener.acknowledgement_timeout: + while ack.response is None and time.time() - starting_time <= listener.ack_timeout: time.sleep(0.01) if response is None and ack.response is None: diff --git a/slack_bolt/logger/messages.py b/slack_bolt/logger/messages.py index 3ec1fef8a..cffdc445f 100644 --- a/slack_bolt/logger/messages.py +++ b/slack_bolt/logger/messages.py @@ -1,3 +1,4 @@ +from re import Pattern import time from typing import Union, Dict, Any, Optional @@ -331,6 +332,11 @@ def warning_skip_uncommon_arg_name(arg_name: str) -> str: ) +def warning_ack_timeout_has_no_effect(identifier: Union[str, Pattern], ack_timeout: int) -> str: + handler_example = f'@app.function("{identifier}")' if isinstance(identifier, str) else f"@app.function({identifier})" + return f"On {handler_example}, as `auto_acknowledge` is `True`, " f"`ack_timeout={ack_timeout}` you gave will be unused" + + # ------------------------------- # Info # ------------------------------- diff --git a/tests/scenario_tests/test_function.py b/tests/scenario_tests/test_function.py index 41290de8f..0a2152892 100644 --- a/tests/scenario_tests/test_function.py +++ b/tests/scenario_tests/test_function.py @@ -1,4 +1,5 @@ import json +import re import time import pytest from unittest.mock import Mock @@ -149,11 +150,12 @@ def test_auto_acknowledge_false_without_acknowledging(self, caplog, monkeypatch) assert f"WARNING {just_no_ack.__name__} didn't call ack()" in caplog.text def test_function_handler_timeout(self, monkeypatch): + timeout = 5 app = App( client=self.web_client, signing_secret=self.signing_secret, ) - app.function("reverse", auto_acknowledge=False)(just_no_ack) + app.function("reverse", auto_acknowledge=False, ack_timeout=timeout)(just_no_ack) request = self.build_request_from_body(function_body) sleep_mock = Mock() @@ -168,9 +170,34 @@ def test_function_handler_timeout(self, monkeypatch): assert response.status == 404 assert_auth_test_count(self, 1) assert ( - sleep_mock.call_count == 5 + sleep_mock.call_count == timeout ), f"Expected handler to time out after calling time.sleep 5 times, but it was called {sleep_mock.call_count} times" + def test_warning_when_timeout_improperly_set(self, caplog): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + app.function("reverse")(just_no_ack) + assert "WARNING" not in caplog.text + + timeout_argument_name = "ack_timeout" + kwargs = {timeout_argument_name: 5} + + callback_id = "reverse1" + app.function(callback_id, **kwargs)(just_no_ack) + assert ( + f'WARNING On @app.function("{callback_id}"), as `auto_acknowledge` is `True`, `{timeout_argument_name}={kwargs[timeout_argument_name]}` you gave will be unused' + in caplog.text + ) + + callback_id = re.compile(r"hello \w+") + app.function(callback_id, **kwargs)(just_no_ack) + assert ( + f"WARNING On @app.function({callback_id}), as `auto_acknowledge` is `True`, `{timeout_argument_name}={kwargs[timeout_argument_name]}` you gave will be unused" + in caplog.text + ) + function_body = { "token": "verification_token", diff --git a/tests/scenario_tests_async/test_function.py b/tests/scenario_tests_async/test_function.py index fc1299e55..3f8b7a722 100644 --- a/tests/scenario_tests_async/test_function.py +++ b/tests/scenario_tests_async/test_function.py @@ -1,5 +1,6 @@ import asyncio import json +import re import time import pytest @@ -160,11 +161,12 @@ async def test_auto_acknowledge_false_without_acknowledging(self, caplog, monkey @pytest.mark.asyncio async def test_function_handler_timeout(self, monkeypatch): + timeout = 5 app = AsyncApp( client=self.web_client, signing_secret=self.signing_secret, ) - app.function("reverse", auto_acknowledge=False)(just_no_ack) + app.function("reverse", auto_acknowledge=False, ack_timeout=timeout)(just_no_ack) request = self.build_request_from_body(function_body) sleep_mock = MagicMock(side_effect=fake_sleep) @@ -179,9 +181,35 @@ async def test_function_handler_timeout(self, monkeypatch): assert response.status == 404 await assert_auth_test_count_async(self, 1) assert ( - sleep_mock.call_count == 5 + sleep_mock.call_count == timeout ), f"Expected handler to time out after calling time.sleep 5 times, but it was called {sleep_mock.call_count} times" + @pytest.mark.asyncio + async def test_warning_when_timeout_improperly_set(self, caplog): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + app.function("reverse")(just_no_ack) + assert "WARNING" not in caplog.text + + timeout_argument_name = "ack_timeout" + kwargs = {timeout_argument_name: 5} + + callback_id = "reverse1" + app.function(callback_id, **kwargs)(just_no_ack) + assert ( + f'WARNING On @app.function("{callback_id}"), as `auto_acknowledge` is `True`, `{timeout_argument_name}={kwargs[timeout_argument_name]}` you gave will be unused' + in caplog.text + ) + + callback_id = re.compile(r"hello \w+") + app.function(callback_id, **kwargs)(just_no_ack) + assert ( + f"WARNING On @app.function({callback_id}), as `auto_acknowledge` is `True`, `{timeout_argument_name}={kwargs[timeout_argument_name]}` you gave will be unused" + in caplog.text + ) + function_body = { "token": "verification_token", From 67b873ded975b3ec35f07f954f0cbc1a3dceba43 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Wed, 27 Aug 2025 14:49:47 -0400 Subject: [PATCH 642/719] version 1.24.0 (#1354) --- .github/maintainers_guide.md | 2 + docs/reference/adapter/aiohttp/index.html | 4 +- .../reference/adapter/asgi/aiohttp/index.html | 4 +- .../reference/adapter/asgi/async_handler.html | 4 +- docs/reference/adapter/asgi/base_handler.html | 4 +- .../reference/adapter/asgi/builtin/index.html | 4 +- docs/reference/adapter/asgi/http_request.html | 4 +- .../reference/adapter/asgi/http_response.html | 4 +- docs/reference/adapter/asgi/index.html | 4 +- docs/reference/adapter/asgi/utils.html | 4 +- .../adapter/aws_lambda/chalice_handler.html | 4 +- .../chalice_lazy_listener_runner.html | 4 +- .../reference/adapter/aws_lambda/handler.html | 4 +- docs/reference/adapter/aws_lambda/index.html | 4 +- .../adapter/aws_lambda/internals.html | 4 +- .../aws_lambda/lambda_s3_oauth_flow.html | 4 +- .../aws_lambda/lazy_listener_runner.html | 4 +- .../aws_lambda/local_lambda_client.html | 4 +- docs/reference/adapter/bottle/handler.html | 4 +- docs/reference/adapter/bottle/index.html | 4 +- docs/reference/adapter/cherrypy/handler.html | 4 +- docs/reference/adapter/cherrypy/index.html | 4 +- docs/reference/adapter/django/handler.html | 4 +- docs/reference/adapter/django/index.html | 4 +- .../adapter/falcon/async_resource.html | 8 +- docs/reference/adapter/falcon/index.html | 10 +- docs/reference/adapter/falcon/resource.html | 10 +- .../adapter/fastapi/async_handler.html | 4 +- docs/reference/adapter/fastapi/index.html | 4 +- docs/reference/adapter/flask/handler.html | 4 +- docs/reference/adapter/flask/index.html | 4 +- .../google_cloud_functions/handler.html | 4 +- .../adapter/google_cloud_functions/index.html | 4 +- docs/reference/adapter/index.html | 4 +- docs/reference/adapter/pyramid/handler.html | 4 +- docs/reference/adapter/pyramid/index.html | 4 +- .../adapter/sanic/async_handler.html | 4 +- docs/reference/adapter/sanic/index.html | 4 +- .../adapter/socket_mode/aiohttp/index.html | 4 +- .../socket_mode/async_base_handler.html | 4 +- .../adapter/socket_mode/async_handler.html | 4 +- .../adapter/socket_mode/async_internals.html | 4 +- .../adapter/socket_mode/base_handler.html | 4 +- .../adapter/socket_mode/builtin/index.html | 4 +- docs/reference/adapter/socket_mode/index.html | 4 +- .../adapter/socket_mode/internals.html | 4 +- .../socket_mode/websocket_client/index.html | 4 +- .../adapter/socket_mode/websockets/index.html | 4 +- .../adapter/starlette/async_handler.html | 4 +- docs/reference/adapter/starlette/handler.html | 4 +- docs/reference/adapter/starlette/index.html | 4 +- .../adapter/tornado/async_handler.html | 4 +- docs/reference/adapter/tornado/handler.html | 4 +- docs/reference/adapter/tornado/index.html | 4 +- docs/reference/adapter/wsgi/handler.html | 4 +- docs/reference/adapter/wsgi/http_request.html | 4 +- .../reference/adapter/wsgi/http_response.html | 4 +- docs/reference/adapter/wsgi/index.html | 4 +- docs/reference/adapter/wsgi/internals.html | 4 +- docs/reference/app/app.html | 139 +++++++++-------- docs/reference/app/async_app.html | 137 +++++++++-------- docs/reference/app/async_server.html | 4 +- docs/reference/app/index.html | 139 +++++++++-------- docs/reference/async_app.html | 143 +++++++++-------- .../authorization/async_authorize.html | 4 +- .../authorization/async_authorize_args.html | 4 +- docs/reference/authorization/authorize.html | 4 +- .../authorization/authorize_args.html | 4 +- .../authorization/authorize_result.html | 4 +- docs/reference/authorization/index.html | 4 +- docs/reference/context/ack/ack.html | 4 +- docs/reference/context/ack/async_ack.html | 4 +- docs/reference/context/ack/index.html | 4 +- docs/reference/context/ack/internals.html | 4 +- .../assistant/assistant_utilities.html | 4 +- .../assistant/async_assistant_utilities.html | 4 +- docs/reference/context/assistant/index.html | 4 +- .../context/assistant/internals.html | 4 +- .../assistant/thread_context/index.html | 4 +- .../thread_context_store/async_store.html | 4 +- .../default_async_store.html | 4 +- .../thread_context_store/default_store.html | 4 +- .../thread_context_store/file/index.html | 4 +- .../assistant/thread_context_store/index.html | 4 +- .../assistant/thread_context_store/store.html | 4 +- docs/reference/context/async_context.html | 4 +- docs/reference/context/base_context.html | 4 +- .../context/complete/async_complete.html | 4 +- docs/reference/context/complete/complete.html | 4 +- docs/reference/context/complete/index.html | 4 +- docs/reference/context/context.html | 4 +- docs/reference/context/fail/async_fail.html | 4 +- docs/reference/context/fail/fail.html | 4 +- docs/reference/context/fail/index.html | 4 +- .../async_get_thread_context.html | 4 +- .../get_thread_context.html | 4 +- .../context/get_thread_context/index.html | 4 +- docs/reference/context/index.html | 4 +- .../context/respond/async_respond.html | 4 +- docs/reference/context/respond/index.html | 4 +- docs/reference/context/respond/internals.html | 4 +- docs/reference/context/respond/respond.html | 4 +- .../async_save_thread_context.html | 4 +- .../context/save_thread_context/index.html | 4 +- .../save_thread_context.html | 4 +- docs/reference/context/say/async_say.html | 4 +- docs/reference/context/say/index.html | 4 +- docs/reference/context/say/internals.html | 4 +- docs/reference/context/say/say.html | 4 +- .../context/set_status/async_set_status.html | 4 +- docs/reference/context/set_status/index.html | 4 +- .../context/set_status/set_status.html | 4 +- .../async_set_suggested_prompts.html | 4 +- .../context/set_suggested_prompts/index.html | 4 +- .../set_suggested_prompts.html | 4 +- .../context/set_title/async_set_title.html | 4 +- docs/reference/context/set_title/index.html | 4 +- .../context/set_title/set_title.html | 4 +- docs/reference/error/index.html | 4 +- docs/reference/index.html | 145 ++++++++++-------- docs/reference/kwargs_injection/args.html | 4 +- .../kwargs_injection/async_args.html | 4 +- .../kwargs_injection/async_utils.html | 4 +- docs/reference/kwargs_injection/index.html | 4 +- docs/reference/kwargs_injection/utils.html | 4 +- .../lazy_listener/async_internals.html | 4 +- .../reference/lazy_listener/async_runner.html | 4 +- .../lazy_listener/asyncio_runner.html | 4 +- docs/reference/lazy_listener/index.html | 4 +- docs/reference/lazy_listener/internals.html | 4 +- docs/reference/lazy_listener/runner.html | 4 +- .../lazy_listener/thread_runner.html | 4 +- docs/reference/listener/async_builtins.html | 4 +- docs/reference/listener/async_listener.html | 26 +++- .../async_listener_completion_handler.html | 4 +- .../async_listener_error_handler.html | 4 +- .../async_listener_start_handler.html | 4 +- docs/reference/listener/asyncio_runner.html | 8 +- docs/reference/listener/builtins.html | 4 +- docs/reference/listener/custom_listener.html | 10 +- docs/reference/listener/index.html | 16 +- docs/reference/listener/listener.html | 10 +- .../listener/listener_completion_handler.html | 4 +- .../listener/listener_error_handler.html | 4 +- .../listener/listener_start_handler.html | 4 +- docs/reference/listener/thread_runner.html | 12 +- .../listener_matcher/async_builtins.html | 4 +- .../async_listener_matcher.html | 4 +- docs/reference/listener_matcher/builtins.html | 6 +- .../custom_listener_matcher.html | 4 +- docs/reference/listener_matcher/index.html | 4 +- .../listener_matcher/listener_matcher.html | 4 +- docs/reference/logger/index.html | 4 +- docs/reference/logger/messages.html | 19 ++- .../middleware/assistant/assistant.html | 4 +- .../middleware/assistant/async_assistant.html | 4 +- .../reference/middleware/assistant/index.html | 4 +- docs/reference/middleware/async_builtins.html | 16 +- .../middleware/async_custom_middleware.html | 4 +- .../middleware/async_middleware.html | 4 +- .../async_middleware_error_handler.html | 4 +- .../async_attaching_function_token.html | 4 +- .../attaching_function_token.html | 4 +- .../attaching_function_token/index.html | 4 +- .../authorization/async_authorization.html | 4 +- .../authorization/async_internals.html | 4 +- .../async_multi_teams_authorization.html | 4 +- .../async_single_team_authorization.html | 4 +- .../authorization/authorization.html | 4 +- .../middleware/authorization/index.html | 4 +- .../middleware/authorization/internals.html | 4 +- .../multi_teams_authorization.html | 4 +- .../single_team_authorization.html | 4 +- .../middleware/custom_middleware.html | 4 +- .../async_ignoring_self_events.html | 4 +- .../ignoring_self_events.html | 4 +- .../ignoring_self_events/index.html | 4 +- docs/reference/middleware/index.html | 20 +-- .../async_message_listener_matches.html | 4 +- .../message_listener_matches/index.html | 4 +- .../message_listener_matches.html | 4 +- docs/reference/middleware/middleware.html | 4 +- .../middleware/middleware_error_handler.html | 4 +- .../async_request_verification.html | 10 +- .../request_verification/index.html | 8 +- .../request_verification.html | 8 +- .../middleware/ssl_check/async_ssl_check.html | 8 +- .../reference/middleware/ssl_check/index.html | 12 +- .../middleware/ssl_check/ssl_check.html | 12 +- .../async_url_verification.html | 6 +- .../middleware/url_verification/index.html | 8 +- .../url_verification/url_verification.html | 8 +- .../oauth/async_callback_options.html | 4 +- docs/reference/oauth/async_internals.html | 4 +- docs/reference/oauth/async_oauth_flow.html | 4 +- .../reference/oauth/async_oauth_settings.html | 4 +- docs/reference/oauth/callback_options.html | 4 +- docs/reference/oauth/index.html | 4 +- docs/reference/oauth/internals.html | 4 +- docs/reference/oauth/oauth_flow.html | 4 +- docs/reference/oauth/oauth_settings.html | 4 +- docs/reference/request/async_internals.html | 4 +- docs/reference/request/async_request.html | 4 +- docs/reference/request/index.html | 6 +- docs/reference/request/internals.html | 4 +- docs/reference/request/payload_utils.html | 4 +- docs/reference/request/request.html | 4 +- docs/reference/response/index.html | 6 +- docs/reference/response/response.html | 4 +- docs/reference/util/async_utils.html | 4 +- docs/reference/util/index.html | 4 +- docs/reference/util/utils.html | 4 +- docs/reference/version.html | 4 +- docs/reference/workflows/index.html | 6 +- docs/reference/workflows/step/async_step.html | 44 +++--- .../workflows/step/async_step_middleware.html | 4 +- docs/reference/workflows/step/index.html | 28 ++-- docs/reference/workflows/step/internals.html | 4 +- docs/reference/workflows/step/step.html | 44 +++--- .../workflows/step/step_middleware.html | 4 +- .../step/utilities/async_complete.html | 8 +- .../step/utilities/async_configure.html | 8 +- .../workflows/step/utilities/async_fail.html | 8 +- .../step/utilities/async_update.html | 8 +- .../workflows/step/utilities/complete.html | 8 +- .../workflows/step/utilities/configure.html | 8 +- .../workflows/step/utilities/fail.html | 8 +- .../workflows/step/utilities/index.html | 4 +- .../workflows/step/utilities/update.html | 8 +- scripts/generate_api_docs.sh | 6 +- slack_bolt/version.py | 2 +- 231 files changed, 1026 insertions(+), 884 deletions(-) diff --git a/.github/maintainers_guide.md b/.github/maintainers_guide.md index 85b4e13be..69026d602 100644 --- a/.github/maintainers_guide.md +++ b/.github/maintainers_guide.md @@ -157,10 +157,12 @@ password: {your password} - Commit with a message including the new version number. For example `1.2.3` & Push the commit to a branch and create a PR to sanity check. - `git checkout -b v1.2.3` - `git commit -a -m 'version 1.2.3'` + - `git push -u origin HEAD` - Open a PR and merge after receiving at least one approval from other maintainers. 2. Distribute the release - Use the latest stable Python runtime + - `git checkout main && git pull` - `python --version` - `python -m venv .venv` - `./scripts/deploy_to_pypi_org.sh` diff --git a/docs/reference/adapter/aiohttp/index.html b/docs/reference/adapter/aiohttp/index.html index 879b7a023..7d7ceedbe 100644 --- a/docs/reference/adapter/aiohttp/index.html +++ b/docs/reference/adapter/aiohttp/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.aiohttp API documentation @@ -122,7 +122,7 @@

    Functions

    diff --git a/docs/reference/adapter/asgi/aiohttp/index.html b/docs/reference/adapter/asgi/aiohttp/index.html index d598dc6cb..a6aa7c92d 100644 --- a/docs/reference/adapter/asgi/aiohttp/index.html +++ b/docs/reference/adapter/asgi/aiohttp/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.asgi.aiohttp API documentation @@ -158,7 +158,7 @@

    diff --git a/docs/reference/adapter/asgi/async_handler.html b/docs/reference/adapter/asgi/async_handler.html index 9ecdb6fd3..23433ffce 100644 --- a/docs/reference/adapter/asgi/async_handler.html +++ b/docs/reference/adapter/asgi/async_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.asgi.async_handler API documentation @@ -158,7 +158,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/asgi/base_handler.html b/docs/reference/adapter/asgi/base_handler.html index 2e194b12b..b8a6da68f 100644 --- a/docs/reference/adapter/asgi/base_handler.html +++ b/docs/reference/adapter/asgi/base_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.asgi.base_handler API documentation @@ -204,7 +204,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/asgi/builtin/index.html b/docs/reference/adapter/asgi/builtin/index.html index 4a0d0c777..9147380c5 100644 --- a/docs/reference/adapter/asgi/builtin/index.html +++ b/docs/reference/adapter/asgi/builtin/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.asgi.builtin API documentation @@ -159,7 +159,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/asgi/http_request.html b/docs/reference/adapter/asgi/http_request.html index 38ab574da..062ac7ca2 100644 --- a/docs/reference/adapter/asgi/http_request.html +++ b/docs/reference/adapter/asgi/http_request.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.asgi.http_request API documentation @@ -250,7 +250,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/asgi/http_response.html b/docs/reference/adapter/asgi/http_response.html index 93c929224..86e368f6e 100644 --- a/docs/reference/adapter/asgi/http_response.html +++ b/docs/reference/adapter/asgi/http_response.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.asgi.http_response API documentation @@ -252,7 +252,7 @@

    diff --git a/docs/reference/adapter/asgi/index.html b/docs/reference/adapter/asgi/index.html index 295ead704..0f2abec74 100644 --- a/docs/reference/adapter/asgi/index.html +++ b/docs/reference/adapter/asgi/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.asgi API documentation @@ -201,7 +201,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/asgi/utils.html b/docs/reference/adapter/asgi/utils.html index 031deda6c..8eb2a24f1 100644 --- a/docs/reference/adapter/asgi/utils.html +++ b/docs/reference/adapter/asgi/utils.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.asgi.utils API documentation @@ -60,7 +60,7 @@

    Module slack_bolt.adapter.asgi.utils

    diff --git a/docs/reference/adapter/aws_lambda/chalice_handler.html b/docs/reference/adapter/aws_lambda/chalice_handler.html index e8bd162ec..28c75ea6a 100644 --- a/docs/reference/adapter/aws_lambda/chalice_handler.html +++ b/docs/reference/adapter/aws_lambda/chalice_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.aws_lambda.chalice_handler API documentation @@ -278,7 +278,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/aws_lambda/chalice_lazy_listener_runner.html b/docs/reference/adapter/aws_lambda/chalice_lazy_listener_runner.html index 8bd6428c1..f27e09c93 100644 --- a/docs/reference/adapter/aws_lambda/chalice_lazy_listener_runner.html +++ b/docs/reference/adapter/aws_lambda/chalice_lazy_listener_runner.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.aws_lambda.chalice_lazy_listener_runner API documentation @@ -124,7 +124,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/aws_lambda/handler.html b/docs/reference/adapter/aws_lambda/handler.html index 48fd279c2..08e4ac9b7 100644 --- a/docs/reference/adapter/aws_lambda/handler.html +++ b/docs/reference/adapter/aws_lambda/handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.aws_lambda.handler API documentation @@ -281,7 +281,7 @@

    diff --git a/docs/reference/adapter/aws_lambda/index.html b/docs/reference/adapter/aws_lambda/index.html index 023c9b6eb..0aae2c31a 100644 --- a/docs/reference/adapter/aws_lambda/index.html +++ b/docs/reference/adapter/aws_lambda/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.aws_lambda API documentation @@ -249,7 +249,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/aws_lambda/internals.html b/docs/reference/adapter/aws_lambda/internals.html index 94fa2be46..bbbe281b0 100644 --- a/docs/reference/adapter/aws_lambda/internals.html +++ b/docs/reference/adapter/aws_lambda/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.aws_lambda.internals API documentation @@ -60,7 +60,7 @@

    Module slack_bolt.adapter.aws_lambda.internals diff --git a/docs/reference/adapter/aws_lambda/lambda_s3_oauth_flow.html b/docs/reference/adapter/aws_lambda/lambda_s3_oauth_flow.html index 067ad846d..11845c902 100644 --- a/docs/reference/adapter/aws_lambda/lambda_s3_oauth_flow.html +++ b/docs/reference/adapter/aws_lambda/lambda_s3_oauth_flow.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.aws_lambda.lambda_s3_oauth_flow API documentation @@ -204,7 +204,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/aws_lambda/lazy_listener_runner.html b/docs/reference/adapter/aws_lambda/lazy_listener_runner.html index 4fbebcd4e..df53f5f22 100644 --- a/docs/reference/adapter/aws_lambda/lazy_listener_runner.html +++ b/docs/reference/adapter/aws_lambda/lazy_listener_runner.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.aws_lambda.lazy_listener_runner API documentation @@ -116,7 +116,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/aws_lambda/local_lambda_client.html b/docs/reference/adapter/aws_lambda/local_lambda_client.html index 1441fb2b7..45ee0510b 100644 --- a/docs/reference/adapter/aws_lambda/local_lambda_client.html +++ b/docs/reference/adapter/aws_lambda/local_lambda_client.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.aws_lambda.local_lambda_client API documentation @@ -134,7 +134,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/bottle/handler.html b/docs/reference/adapter/bottle/handler.html index e14b2da44..fe6f8ae1a 100644 --- a/docs/reference/adapter/bottle/handler.html +++ b/docs/reference/adapter/bottle/handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.bottle.handler API documentation @@ -186,7 +186,7 @@

    diff --git a/docs/reference/adapter/bottle/index.html b/docs/reference/adapter/bottle/index.html index 0ceecb7f7..f240d52bc 100644 --- a/docs/reference/adapter/bottle/index.html +++ b/docs/reference/adapter/bottle/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.bottle API documentation @@ -153,7 +153,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/cherrypy/handler.html b/docs/reference/adapter/cherrypy/handler.html index 735786296..d41f00148 100644 --- a/docs/reference/adapter/cherrypy/handler.html +++ b/docs/reference/adapter/cherrypy/handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.cherrypy.handler API documentation @@ -228,7 +228,7 @@

    diff --git a/docs/reference/adapter/cherrypy/index.html b/docs/reference/adapter/cherrypy/index.html index a1c121e05..5a322fd7a 100644 --- a/docs/reference/adapter/cherrypy/index.html +++ b/docs/reference/adapter/cherrypy/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.cherrypy API documentation @@ -157,7 +157,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/django/handler.html b/docs/reference/adapter/django/handler.html index a2de8c99d..4fe9e359a 100644 --- a/docs/reference/adapter/django/handler.html +++ b/docs/reference/adapter/django/handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.django.handler API documentation @@ -382,7 +382,7 @@

    diff --git a/docs/reference/adapter/django/index.html b/docs/reference/adapter/django/index.html index ed9f43658..dfb6af63f 100644 --- a/docs/reference/adapter/django/index.html +++ b/docs/reference/adapter/django/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.django API documentation @@ -194,7 +194,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/falcon/async_resource.html b/docs/reference/adapter/falcon/async_resource.html index 07d432390..f43ab11ef 100644 --- a/docs/reference/adapter/falcon/async_resource.html +++ b/docs/reference/adapter/falcon/async_resource.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.falcon.async_resource API documentation @@ -87,7 +87,7 @@

    Classes

    resp.status = "404" # Falcon 4.x w/ mypy fails to correctly infer the str type here - resp.body = "The page is not found..." # type: ignore[assignment] + resp.body = "The page is not found..." async def on_post(self, req: Request, resp: Response): bolt_req = await self._to_bolt_request(req) @@ -151,7 +151,7 @@

    Methods

    resp.status = "404" # Falcon 4.x w/ mypy fails to correctly infer the str type here - resp.body = "The page is not found..." # type: ignore[assignment]
    + resp.body = "The page is not found..."
    @@ -200,7 +200,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/falcon/index.html b/docs/reference/adapter/falcon/index.html index 50874f7b8..82a2a57e2 100644 --- a/docs/reference/adapter/falcon/index.html +++ b/docs/reference/adapter/falcon/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.falcon API documentation @@ -93,7 +93,7 @@

    Classes

    resp.status = "404" # Falcon 4.x w/ mypy fails to correctly infer the str type here - resp.body = "The page is not found..." # type: ignore[assignment] + resp.body = "The page is not found..." def on_post(self, req: Request, resp: Response): bolt_req = self._to_bolt_request(req) @@ -110,7 +110,7 @@

    Classes

    def _write_response(self, bolt_resp: BoltResponse, resp: Response): if falcon_version.__version__.startswith("2."): # Falcon 4.x w/ mypy fails to correctly infer the str type here - resp.body = bolt_resp.body # type: ignore[assignment] + resp.body = bolt_resp.body else: resp.text = bolt_resp.body @@ -161,7 +161,7 @@

    Methods

    resp.status = "404" # Falcon 4.x w/ mypy fails to correctly infer the str type here - resp.body = "The page is not found..." # type: ignore[assignment]
    + resp.body = "The page is not found..."
    @@ -216,7 +216,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/falcon/resource.html b/docs/reference/adapter/falcon/resource.html index b999b290c..73860adc1 100644 --- a/docs/reference/adapter/falcon/resource.html +++ b/docs/reference/adapter/falcon/resource.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.falcon.resource API documentation @@ -82,7 +82,7 @@

    Classes

    resp.status = "404" # Falcon 4.x w/ mypy fails to correctly infer the str type here - resp.body = "The page is not found..." # type: ignore[assignment] + resp.body = "The page is not found..." def on_post(self, req: Request, resp: Response): bolt_req = self._to_bolt_request(req) @@ -99,7 +99,7 @@

    Classes

    def _write_response(self, bolt_resp: BoltResponse, resp: Response): if falcon_version.__version__.startswith("2."): # Falcon 4.x w/ mypy fails to correctly infer the str type here - resp.body = bolt_resp.body # type: ignore[assignment] + resp.body = bolt_resp.body else: resp.text = bolt_resp.body @@ -150,7 +150,7 @@

    Methods

    resp.status = "404" # Falcon 4.x w/ mypy fails to correctly infer the str type here - resp.body = "The page is not found..." # type: ignore[assignment]
    + resp.body = "The page is not found..."
    @@ -199,7 +199,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/fastapi/async_handler.html b/docs/reference/adapter/fastapi/async_handler.html index 0056ce305..6f6205e51 100644 --- a/docs/reference/adapter/fastapi/async_handler.html +++ b/docs/reference/adapter/fastapi/async_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.fastapi.async_handler API documentation @@ -149,7 +149,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/fastapi/index.html b/docs/reference/adapter/fastapi/index.html index 49b91a814..6ffb52f35 100644 --- a/docs/reference/adapter/fastapi/index.html +++ b/docs/reference/adapter/fastapi/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.fastapi API documentation @@ -153,7 +153,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/flask/handler.html b/docs/reference/adapter/flask/handler.html index 1b3952603..489b80a90 100644 --- a/docs/reference/adapter/flask/handler.html +++ b/docs/reference/adapter/flask/handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.flask.handler API documentation @@ -179,7 +179,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/flask/index.html b/docs/reference/adapter/flask/index.html index 7d4b60292..ee765fa1e 100644 --- a/docs/reference/adapter/flask/index.html +++ b/docs/reference/adapter/flask/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.flask API documentation @@ -145,7 +145,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/google_cloud_functions/handler.html b/docs/reference/adapter/google_cloud_functions/handler.html index 0b48a26a4..1d9b0da7f 100644 --- a/docs/reference/adapter/google_cloud_functions/handler.html +++ b/docs/reference/adapter/google_cloud_functions/handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.google_cloud_functions.handler API documentation @@ -170,7 +170,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/google_cloud_functions/index.html b/docs/reference/adapter/google_cloud_functions/index.html index 3ad305b8d..790d210be 100644 --- a/docs/reference/adapter/google_cloud_functions/index.html +++ b/docs/reference/adapter/google_cloud_functions/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.google_cloud_functions API documentation @@ -147,7 +147,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/index.html b/docs/reference/adapter/index.html index 78ef4a2f7..646c0ac81 100644 --- a/docs/reference/adapter/index.html +++ b/docs/reference/adapter/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter API documentation @@ -148,7 +148,7 @@

    Sub-modules

    diff --git a/docs/reference/adapter/pyramid/handler.html b/docs/reference/adapter/pyramid/handler.html index 2f26bbc38..4a4a68849 100644 --- a/docs/reference/adapter/pyramid/handler.html +++ b/docs/reference/adapter/pyramid/handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.pyramid.handler API documentation @@ -195,7 +195,7 @@

    diff --git a/docs/reference/adapter/pyramid/index.html b/docs/reference/adapter/pyramid/index.html index 30d3685e8..7f0903cb6 100644 --- a/docs/reference/adapter/pyramid/index.html +++ b/docs/reference/adapter/pyramid/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.pyramid API documentation @@ -151,7 +151,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/sanic/async_handler.html b/docs/reference/adapter/sanic/async_handler.html index 37945775c..adabe53be 100644 --- a/docs/reference/adapter/sanic/async_handler.html +++ b/docs/reference/adapter/sanic/async_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.sanic.async_handler API documentation @@ -210,7 +210,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/sanic/index.html b/docs/reference/adapter/sanic/index.html index 1ae23450c..558bb321c 100644 --- a/docs/reference/adapter/sanic/index.html +++ b/docs/reference/adapter/sanic/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.sanic API documentation @@ -153,7 +153,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/socket_mode/aiohttp/index.html b/docs/reference/adapter/socket_mode/aiohttp/index.html index f9d240874..cc91a3d06 100644 --- a/docs/reference/adapter/socket_mode/aiohttp/index.html +++ b/docs/reference/adapter/socket_mode/aiohttp/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.socket_mode.aiohttp API documentation @@ -239,7 +239,7 @@

    diff --git a/docs/reference/adapter/socket_mode/async_base_handler.html b/docs/reference/adapter/socket_mode/async_base_handler.html index 31b681b3c..b00420c11 100644 --- a/docs/reference/adapter/socket_mode/async_base_handler.html +++ b/docs/reference/adapter/socket_mode/async_base_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.socket_mode.async_base_handler API documentation @@ -240,7 +240,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/socket_mode/async_handler.html b/docs/reference/adapter/socket_mode/async_handler.html index 5093f1281..447ecf0ea 100644 --- a/docs/reference/adapter/socket_mode/async_handler.html +++ b/docs/reference/adapter/socket_mode/async_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.socket_mode.async_handler API documentation @@ -142,7 +142,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/socket_mode/async_internals.html b/docs/reference/adapter/socket_mode/async_internals.html index 5b7769483..d2e300efa 100644 --- a/docs/reference/adapter/socket_mode/async_internals.html +++ b/docs/reference/adapter/socket_mode/async_internals.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.socket_mode.async_internals API documentation @@ -121,7 +121,7 @@

    Functions

    diff --git a/docs/reference/adapter/socket_mode/base_handler.html b/docs/reference/adapter/socket_mode/base_handler.html index b57156928..450f9ac0e 100644 --- a/docs/reference/adapter/socket_mode/base_handler.html +++ b/docs/reference/adapter/socket_mode/base_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.socket_mode.base_handler API documentation @@ -252,7 +252,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/socket_mode/builtin/index.html b/docs/reference/adapter/socket_mode/builtin/index.html index ab1837ae3..fc66eb203 100644 --- a/docs/reference/adapter/socket_mode/builtin/index.html +++ b/docs/reference/adapter/socket_mode/builtin/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.socket_mode.builtin API documentation @@ -200,7 +200,7 @@

    diff --git a/docs/reference/adapter/socket_mode/index.html b/docs/reference/adapter/socket_mode/index.html index cb26a212a..511ef4840 100644 --- a/docs/reference/adapter/socket_mode/index.html +++ b/docs/reference/adapter/socket_mode/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.socket_mode API documentation @@ -260,7 +260,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/socket_mode/internals.html b/docs/reference/adapter/socket_mode/internals.html index 7c1a7a81f..55d96b054 100644 --- a/docs/reference/adapter/socket_mode/internals.html +++ b/docs/reference/adapter/socket_mode/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.socket_mode.internals API documentation @@ -119,7 +119,7 @@

    Functions

    diff --git a/docs/reference/adapter/socket_mode/websocket_client/index.html b/docs/reference/adapter/socket_mode/websocket_client/index.html index d6a4b50b4..e837ef19b 100644 --- a/docs/reference/adapter/socket_mode/websocket_client/index.html +++ b/docs/reference/adapter/socket_mode/websocket_client/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.socket_mode.websocket_client API documentation @@ -190,7 +190,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/socket_mode/websockets/index.html b/docs/reference/adapter/socket_mode/websockets/index.html index 2b7e9f493..7f96f0021 100644 --- a/docs/reference/adapter/socket_mode/websockets/index.html +++ b/docs/reference/adapter/socket_mode/websockets/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.socket_mode.websockets API documentation @@ -239,7 +239,7 @@

    diff --git a/docs/reference/adapter/starlette/async_handler.html b/docs/reference/adapter/starlette/async_handler.html index e8e596f2a..91345eba3 100644 --- a/docs/reference/adapter/starlette/async_handler.html +++ b/docs/reference/adapter/starlette/async_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.starlette.async_handler API documentation @@ -213,7 +213,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/starlette/handler.html b/docs/reference/adapter/starlette/handler.html index 5171240fd..5c74b71da 100644 --- a/docs/reference/adapter/starlette/handler.html +++ b/docs/reference/adapter/starlette/handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.starlette.handler API documentation @@ -205,7 +205,7 @@

    diff --git a/docs/reference/adapter/starlette/index.html b/docs/reference/adapter/starlette/index.html index 3af382537..bdf5bf42a 100644 --- a/docs/reference/adapter/starlette/index.html +++ b/docs/reference/adapter/starlette/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.starlette API documentation @@ -158,7 +158,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/tornado/async_handler.html b/docs/reference/adapter/tornado/async_handler.html index b7d813420..c274429de 100644 --- a/docs/reference/adapter/tornado/async_handler.html +++ b/docs/reference/adapter/tornado/async_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.tornado.async_handler API documentation @@ -242,7 +242,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/tornado/handler.html b/docs/reference/adapter/tornado/handler.html index 1149311a9..a69adb987 100644 --- a/docs/reference/adapter/tornado/handler.html +++ b/docs/reference/adapter/tornado/handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.tornado.handler API documentation @@ -273,7 +273,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/tornado/index.html b/docs/reference/adapter/tornado/index.html index dac1b6b78..a5bec4ffb 100644 --- a/docs/reference/adapter/tornado/index.html +++ b/docs/reference/adapter/tornado/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.tornado API documentation @@ -234,7 +234,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/wsgi/handler.html b/docs/reference/adapter/wsgi/handler.html index 8369cb636..204499a05 100644 --- a/docs/reference/adapter/wsgi/handler.html +++ b/docs/reference/adapter/wsgi/handler.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.wsgi.handler API documentation @@ -230,7 +230,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/wsgi/http_request.html b/docs/reference/adapter/wsgi/http_request.html index c4495e440..fa845dd93 100644 --- a/docs/reference/adapter/wsgi/http_request.html +++ b/docs/reference/adapter/wsgi/http_request.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.wsgi.http_request API documentation @@ -373,7 +373,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/wsgi/http_response.html b/docs/reference/adapter/wsgi/http_response.html index 3ddc2350c..da7dc33f0 100644 --- a/docs/reference/adapter/wsgi/http_response.html +++ b/docs/reference/adapter/wsgi/http_response.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.wsgi.http_response API documentation @@ -191,7 +191,7 @@

    diff --git a/docs/reference/adapter/wsgi/index.html b/docs/reference/adapter/wsgi/index.html index 49ab0d930..c3cfafea1 100644 --- a/docs/reference/adapter/wsgi/index.html +++ b/docs/reference/adapter/wsgi/index.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.wsgi API documentation @@ -257,7 +257,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/adapter/wsgi/internals.html b/docs/reference/adapter/wsgi/internals.html index addbae583..7fdfa267f 100644 --- a/docs/reference/adapter/wsgi/internals.html +++ b/docs/reference/adapter/wsgi/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.adapter.wsgi.internals API documentation @@ -60,7 +60,7 @@

    Module slack_bolt.adapter.wsgi.internals

    diff --git a/docs/reference/app/app.html b/docs/reference/app/app.html index 02fc5b036..d1224dd5d 100644 --- a/docs/reference/app/app.html +++ b/docs/reference/app/app.html @@ -3,7 +3,7 @@ - + slack_bolt.app.app API documentation @@ -675,7 +675,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new step from app listener. @@ -693,7 +693,7 @@

    Classes

    # Pass Step to set up listeners app.step(ws) - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. + Refer to https://api.slack.com/workflows/steps for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -710,7 +710,7 @@

    Classes

    warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps" + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" ), category=DeprecationWarning, ) @@ -787,7 +787,7 @@

    Classes

    # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. + Refer to https://api.slack.com/apis/connections/events-api for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -825,7 +825,7 @@

    Classes

    # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://docs.slack.dev/reference/events/message for details of `message` events. + Refer to https://api.slack.com/events/message for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -871,6 +871,7 @@

    Classes

    matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, auto_acknowledge: bool = True, + ack_timeout: int = 3, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new Function listener. This method can be used as either a decorator or a method. @@ -899,13 +900,17 @@

    Classes

    Only when all the middleware call `next()` method, the listener function can be invoked. """ + if auto_acknowledge is True: + if ack_timeout != 3: + self._framework_logger.warning(warning_ack_timeout_has_no_effect(callback_id, ack_timeout)) + matchers = list(matchers) if matchers else [] middleware = list(middleware) if middleware else [] def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.function_executed(callback_id=callback_id, base_logger=self._base_logger) - return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge) + return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge, ack_timeout) return __call__ @@ -931,7 +936,7 @@

    Classes

    # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details of Slash Commands. + Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -978,7 +983,7 @@

    Classes

    # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://docs.slack.dev/interactivity/implementing-shortcuts for details about Shortcuts. + Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1046,9 +1051,9 @@

    Classes

    # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for actions in `blocks`. - * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for actions in `attachments`. - * Refer to https://docs.slack.dev/legacy/legacy-dialogs for actions in dialogs. + * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. + * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. + * Refer to https://api.slack.com/dialogs for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1074,7 +1079,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `block_actions` action listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for details. + Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. """ def __call__(*args, **kwargs): @@ -1091,7 +1096,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `interactive_message` action listener. - Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for details.""" + Refer to https://api.slack.com/legacy/message-buttons for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1107,7 +1112,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_submission` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1123,7 +1128,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_cancellation` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1164,7 +1169,7 @@

    Classes

    # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. + Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1190,7 +1195,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_submission for details.""" + Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1206,7 +1211,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_closed` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_closed for details.""" + Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1247,7 +1252,8 @@

    Classes

    Refer to the following documents for details: - * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select + * https://api.slack.com/reference/block-kit/block-elements#external_select + * https://api.slack.com/reference/block-kit/block-elements#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1287,7 +1293,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1380,6 +1386,7 @@

    Classes

    matchers: Optional[Sequence[Callable[..., bool]]], middleware: Optional[Sequence[Union[Callable, Middleware]]], auto_acknowledgement: bool = False, + ack_timeout: int = 3, ) -> Optional[Callable[..., Optional[BoltResponse]]]: value_to_return = None if not isinstance(functions, list): @@ -1406,10 +1413,11 @@

    Classes

    CustomListener( app_name=self.name, ack_function=functions.pop(0), - lazy_functions=functions, + lazy_functions=functions, # type:ignore[arg-type] matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, + ack_timeout=ack_timeout, base_logger=self._base_logger, ) ) @@ -1629,9 +1637,9 @@

    Methods

    # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for actions in `blocks`. - * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for actions in `attachments`. - * Refer to https://docs.slack.dev/legacy/legacy-dialogs for actions in dialogs. + * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. + * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. + * Refer to https://api.slack.com/dialogs for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1660,9 +1668,9 @@

    Methods

    app.action("approve_button")(update_message)

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -1705,7 +1713,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `interactive_message` action listener. - Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for details.""" + Refer to https://api.slack.com/legacy/message-buttons for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1715,7 +1723,7 @@

    Args

    return __call__

    Registers a new interactive_message action listener. -Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for details.

    +Refer to https://api.slack.com/legacy/message-buttons for details.

    def block_action(self,
    constraints: str | Pattern | Dict[str, str | Pattern],
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -1732,7 +1740,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `block_actions` action listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for details. + Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. """ def __call__(*args, **kwargs): @@ -1743,7 +1751,7 @@

    Args

    return __call__

    Registers a new block_actions action listener. -Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for details.

    +Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details.

    def block_suggestion(self,
    action_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -1797,7 +1805,7 @@

    Args

    # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details of Slash Commands. + Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1828,7 +1836,7 @@

    Args

    # Pass a function to this method app.command("/echo")(repeat_text)
    -

    Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details of Slash Commands.

    +

    Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -1891,7 +1899,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_cancellation` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1901,7 +1909,7 @@

    Args

    return __call__

    Registers a new dialog_cancellation listener. -Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.

    +Refer to https://api.slack.com/dialogs for details.

    def dialog_submission(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -1918,7 +1926,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_submission` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1928,7 +1936,7 @@

    Args

    return __call__

    Registers a new dialog_submission listener. -Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.

    +Refer to https://api.slack.com/dialogs for details.

    def dialog_suggestion(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -1945,7 +1953,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1955,7 +1963,7 @@

    Args

    return __call__

    Registers a new dialog_suggestion listener. -Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.

    +Refer to https://api.slack.com/dialogs for details.

    def dispatch(self,
    req: BoltRequest) ‑> BoltResponse
    @@ -2181,7 +2189,7 @@

    Args

    # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. + Refer to https://api.slack.com/apis/connections/events-api for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2213,7 +2221,7 @@

    Args

    # Pass a function to this method app.event("team_join")(ask_for_introduction)
    -

    Refer to https://docs.slack.dev/apis/events-api/ for details of Events API.

    +

    Refer to https://api.slack.com/apis/connections/events-api for details of Events API.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2229,7 +2237,7 @@

    Args

    -def function(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None,
    auto_acknowledge: bool = True) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    +def function(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None,
    auto_acknowledge: bool = True,
    ack_timeout: int = 3) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -2242,6 +2250,7 @@

    Args

    matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, auto_acknowledge: bool = True, + ack_timeout: int = 3, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new Function listener. This method can be used as either a decorator or a method. @@ -2270,13 +2279,17 @@

    Args

    Only when all the middleware call `next()` method, the listener function can be invoked. """ + if auto_acknowledge is True: + if ack_timeout != 3: + self._framework_logger.warning(warning_ack_timeout_has_no_effect(callback_id, ack_timeout)) + matchers = list(matchers) if matchers else [] middleware = list(middleware) if middleware else [] def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.function_executed(callback_id=callback_id, base_logger=self._base_logger) - return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge) + return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge, ack_timeout) return __call__
    @@ -2360,7 +2373,7 @@

    Args

    # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://docs.slack.dev/reference/events/message for details of `message` events. + Refer to https://api.slack.com/events/message for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2411,7 +2424,7 @@

    Args

    # Pass a function to this method app.message(":wave:")(say_hello) -

    Refer to https://docs.slack.dev/reference/events/message for details of message events.

    +

    Refer to https://api.slack.com/events/message for details of message events.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2554,7 +2567,8 @@

    Args

    Refer to the following documents for details: - * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select + * https://api.slack.com/reference/block-kit/block-elements#external_select + * https://api.slack.com/reference/block-kit/block-elements#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2594,7 +2608,8 @@

    Args

    Refer to the following documents for details:

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2640,7 +2655,7 @@

    Args

    # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://docs.slack.dev/interactivity/implementing-shortcuts for details about Shortcuts. + Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2677,7 +2692,7 @@

    Args

    # Pass a function to this method app.shortcut("open_modal")(open_modal) -

    Refer to https://docs.slack.dev/interactivity/implementing-shortcuts for details about Shortcuts.

    +

    Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2763,7 +2778,7 @@

    Args

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new step from app listener. @@ -2781,7 +2796,7 @@

    Args

    # Pass Step to set up listeners app.step(ws) - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. + Refer to https://api.slack.com/workflows/steps for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2798,7 +2813,7 @@

    Args

    warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps" + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" ), category=DeprecationWarning, ) @@ -2820,7 +2835,7 @@

    Args

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    Registers a new step from app listener.

    Unlike others, this method doesn't behave as a decorator. If you want to register a step from app by a decorator, use WorkflowStepBuilder's methods.

    @@ -2835,7 +2850,7 @@

    Args

    # Pass Step to set up listeners app.step(ws) -

    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps.

    +

    Refer to https://api.slack.com/workflows/steps for details of steps from apps.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    For further information about WorkflowStep specific function arguments such as configure, update, complete, and fail, @@ -2906,7 +2921,7 @@

    Args

    # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. + Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2947,7 +2962,7 @@

    Args

    # Pass a function to this method app.view("view_1")(handle_submission) -

    Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads.

    +

    Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2976,7 +2991,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_closed` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_closed for details.""" + Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -2986,7 +3001,7 @@

    Args

    return __call__

    Registers a new view_closed listener. -Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_closed for details.

    +Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.

    def view_submission(self,
    constraints: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -3003,7 +3018,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_submission for details.""" + Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3013,7 +3028,7 @@

    Args

    return __call__

    Registers a new view_submission listener. -Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_submission for details.

    +Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.

    @@ -3264,7 +3279,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/app/async_app.html b/docs/reference/app/async_app.html index 66af8f038..b6634710a 100644 --- a/docs/reference/app/async_app.html +++ b/docs/reference/app/async_app.html @@ -3,7 +3,7 @@ - + slack_bolt.app.async_app API documentation @@ -687,7 +687,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new step from app listener. @@ -705,7 +705,7 @@

    Classes

    # Pass Step to set up listeners app.step(ws) - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. + Refer to https://api.slack.com/workflows/steps for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. For further information about AsyncWorkflowStep specific function arguments @@ -721,7 +721,7 @@

    Classes

    warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps" + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" ), category=DeprecationWarning, ) @@ -803,7 +803,7 @@

    Classes

    # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. + Refer to https://api.slack.com/apis/connections/events-api for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -841,7 +841,7 @@

    Classes

    # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://docs.slack.dev/reference/events/message for details of `message` events. + Refer to https://api.slack.com/events/message for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -890,6 +890,7 @@

    Classes

    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, auto_acknowledge: bool = True, + ack_timeout: int = 3, ) -> Callable[..., Optional[Callable[..., Awaitable[BoltResponse]]]]: """Registers a new Function listener. This method can be used as either a decorator or a method. @@ -917,6 +918,9 @@

    Classes

    middleware: A list of lister middleware functions. Only when all the middleware call `next()` method, the listener function can be invoked. """ + if auto_acknowledge is True: + if ack_timeout != 3: + self._framework_logger.warning(warning_ack_timeout_has_no_effect(callback_id, ack_timeout)) matchers = list(matchers) if matchers else [] middleware = list(middleware) if middleware else [] @@ -926,7 +930,7 @@

    Classes

    primary_matcher = builtin_matchers.function_executed( callback_id=callback_id, base_logger=self._base_logger, asyncio=True ) - return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge) + return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge, ack_timeout) return __call__ @@ -952,7 +956,7 @@

    Classes

    # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details of Slash Commands. + Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -999,7 +1003,7 @@

    Classes

    # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://docs.slack.dev/interactivity/implementing-shortcuts for details about Shortcuts. + Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1067,9 +1071,9 @@

    Classes

    # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for actions in `blocks`. - * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for actions in `attachments`. - * Refer to https://docs.slack.dev/legacy/legacy-dialogs for actions in dialogs. + * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. + * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. + * Refer to https://api.slack.com/dialogs for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1095,7 +1099,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `block_actions` action listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for details. + Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. """ def __call__(*args, **kwargs): @@ -1112,7 +1116,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `interactive_message` action listener. - Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for details.""" + Refer to https://api.slack.com/legacy/message-buttons for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1128,7 +1132,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1144,7 +1148,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1185,7 +1189,7 @@

    Classes

    # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. + Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1211,7 +1215,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_submission` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_submission for details.""" + Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1227,7 +1231,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_closed` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_closed for details.""" + Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1268,7 +1272,8 @@

    Classes

    Refer to the following documents for details: - * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select + * https://api.slack.com/reference/block-kit/block-elements#external_select + * https://api.slack.com/reference/block-kit/block-elements#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1308,7 +1313,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1405,6 +1410,7 @@

    Classes

    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]], middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]], auto_acknowledgement: bool = False, + ack_timeout: int = 3, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: value_to_return = None if not isinstance(functions, list): @@ -1436,10 +1442,11 @@

    Classes

    AsyncCustomListener( app_name=self.name, ack_function=functions.pop(0), - lazy_functions=functions, + lazy_functions=functions, # type:ignore[arg-type] matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, + ack_timeout=ack_timeout, base_logger=self._base_logger, ) ) @@ -1662,9 +1669,9 @@

    Methods

    # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for actions in `blocks`. - * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for actions in `attachments`. - * Refer to https://docs.slack.dev/legacy/legacy-dialogs for actions in dialogs. + * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. + * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. + * Refer to https://api.slack.com/dialogs for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1693,9 +1700,9 @@

    Methods

    app.action("approve_button")(update_message)

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -1866,7 +1873,7 @@

    Returns

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `interactive_message` action listener. - Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for details.""" + Refer to https://api.slack.com/legacy/message-buttons for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1876,7 +1883,7 @@

    Returns

    return __call__

    Registers a new interactive_message action listener. -Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for details.

    +Refer to https://api.slack.com/legacy/message-buttons for details.

    def block_action(self,
    constraints: str | Pattern | Dict[str, str | Pattern],
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None) ‑> Callable[..., Callable[..., Awaitable[BoltResponse | None]] | None]
    @@ -1893,7 +1900,7 @@

    Returns

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `block_actions` action listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for details. + Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. """ def __call__(*args, **kwargs): @@ -1904,7 +1911,7 @@

    Returns

    return __call__

    Registers a new block_actions action listener. -Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for details.

    +Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details.

    def block_suggestion(self,
    action_id: str | Pattern,
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None) ‑> Callable[..., Callable[..., Awaitable[BoltResponse | None]] | None]
    @@ -1958,7 +1965,7 @@

    Returns

    # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details of Slash Commands. + Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1989,7 +1996,7 @@

    Returns

    # Pass a function to this method app.command("/echo")(repeat_text)
    -

    Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details of Slash Commands.

    +

    Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -2052,7 +2059,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -2062,7 +2069,7 @@

    Args

    return __call__

    Registers a new dialog_submission listener. -Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.

    +Refer to https://api.slack.com/dialogs for details.

    def dialog_submission(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None) ‑> Callable[..., Callable[..., Awaitable[BoltResponse | None]] | None]
    @@ -2079,7 +2086,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -2089,7 +2096,7 @@

    Args

    return __call__

    Registers a new dialog_submission listener. -Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.

    +Refer to https://api.slack.com/dialogs for details.

    def dialog_suggestion(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None) ‑> Callable[..., Callable[..., Awaitable[BoltResponse | None]] | None]
    @@ -2106,7 +2113,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -2116,7 +2123,7 @@

    Args

    return __call__

    Registers a new dialog_suggestion listener. -Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.

    +Refer to https://api.slack.com/dialogs for details.

    def enable_token_revocation_listeners(self) ‑> None @@ -2222,7 +2229,7 @@

    Args

    # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. + Refer to https://api.slack.com/apis/connections/events-api for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -2254,7 +2261,7 @@

    Args

    # Pass a function to this method app.event("team_join")(ask_for_introduction)
    -

    Refer to https://docs.slack.dev/apis/events-api/ for details of Events API.

    +

    Refer to https://api.slack.com/apis/connections/events-api for details of Events API.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -2270,7 +2277,7 @@

    Args

    -def function(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None,
    auto_acknowledge: bool = True) ‑> Callable[..., Callable[..., Awaitable[BoltResponse]] | None]
    +def function(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None,
    auto_acknowledge: bool = True,
    ack_timeout: int = 3) ‑> Callable[..., Callable[..., Awaitable[BoltResponse]] | None]
    @@ -2283,6 +2290,7 @@

    Args

    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, auto_acknowledge: bool = True, + ack_timeout: int = 3, ) -> Callable[..., Optional[Callable[..., Awaitable[BoltResponse]]]]: """Registers a new Function listener. This method can be used as either a decorator or a method. @@ -2310,6 +2318,9 @@

    Args

    middleware: A list of lister middleware functions. Only when all the middleware call `next()` method, the listener function can be invoked. """ + if auto_acknowledge is True: + if ack_timeout != 3: + self._framework_logger.warning(warning_ack_timeout_has_no_effect(callback_id, ack_timeout)) matchers = list(matchers) if matchers else [] middleware = list(middleware) if middleware else [] @@ -2319,7 +2330,7 @@

    Args

    primary_matcher = builtin_matchers.function_executed( callback_id=callback_id, base_logger=self._base_logger, asyncio=True ) - return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge) + return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge, ack_timeout) return __call__
    @@ -2403,7 +2414,7 @@

    Args

    # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://docs.slack.dev/reference/events/message for details of `message` events. + Refer to https://api.slack.com/events/message for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -2457,7 +2468,7 @@

    Args

    # Pass a function to this method app.message(":wave:")(say_hello) -

    Refer to https://docs.slack.dev/reference/events/message for details of message events.

    +

    Refer to https://api.slack.com/events/message for details of message events.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -2597,7 +2608,8 @@

    Args

    Refer to the following documents for details: - * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select + * https://api.slack.com/reference/block-kit/block-elements#external_select + * https://api.slack.com/reference/block-kit/block-elements#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -2637,7 +2649,8 @@

    Args

    Refer to the following documents for details:

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -2726,7 +2739,7 @@

    Args

    # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://docs.slack.dev/interactivity/implementing-shortcuts for details about Shortcuts. + Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -2763,7 +2776,7 @@

    Args

    # Pass a function to this method app.shortcut("open_modal")(open_modal) -

    Refer to https://docs.slack.dev/interactivity/implementing-shortcuts for details about Shortcuts.

    +

    Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -2826,7 +2839,7 @@

    Args

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new step from app listener. @@ -2844,7 +2857,7 @@

    Args

    # Pass Step to set up listeners app.step(ws) - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. + Refer to https://api.slack.com/workflows/steps for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. For further information about AsyncWorkflowStep specific function arguments @@ -2860,7 +2873,7 @@

    Args

    warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps" + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" ), category=DeprecationWarning, ) @@ -2882,7 +2895,7 @@

    Args

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    Registers a new step from app listener.

    Unlike others, this method doesn't behave as a decorator. If you want to register a step from app by a decorator, use AsyncWorkflowStepBuilder's methods.

    @@ -2897,7 +2910,7 @@

    Args

    # Pass Step to set up listeners app.step(ws) -

    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps.

    +

    Refer to https://api.slack.com/workflows/steps for details of steps from apps.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document. For further information about AsyncWorkflowStep specific function arguments such as configure, update, complete, and fail, @@ -2965,7 +2978,7 @@

    Args

    # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. + Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -3006,7 +3019,7 @@

    Args

    # Pass a function to this method app.view("view_1")(handle_submission) -

    Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads.

    +

    Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -3035,7 +3048,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_closed` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_closed for details.""" + Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3045,7 +3058,7 @@

    Args

    return __call__

    Registers a new view_closed listener. -Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_closed for details.

    +Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.

    def view_submission(self,
    constraints: str | Pattern,
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None) ‑> Callable[..., Callable[..., Awaitable[BoltResponse | None]] | None]
    @@ -3062,7 +3075,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_submission` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_submission for details.""" + Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3072,7 +3085,7 @@

    Args

    return __call__

    Registers a new view_submission listener. -Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_submission for details.

    +Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.

    def web_app(self, path: str = '/slack/events', port: int = 3000) ‑> aiohttp.web_app.Application @@ -3192,7 +3205,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/app/async_server.html b/docs/reference/app/async_server.html index 25d28fed1..b95b8a2b3 100644 --- a/docs/reference/app/async_server.html +++ b/docs/reference/app/async_server.html @@ -3,7 +3,7 @@ - + slack_bolt.app.async_server API documentation @@ -270,7 +270,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/app/index.html b/docs/reference/app/index.html index f1a7e9655..857fb22c8 100644 --- a/docs/reference/app/index.html +++ b/docs/reference/app/index.html @@ -3,7 +3,7 @@ - + slack_bolt.app API documentation @@ -694,7 +694,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new step from app listener. @@ -712,7 +712,7 @@

    Classes

    # Pass Step to set up listeners app.step(ws) - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. + Refer to https://api.slack.com/workflows/steps for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -729,7 +729,7 @@

    Classes

    warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps" + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" ), category=DeprecationWarning, ) @@ -806,7 +806,7 @@

    Classes

    # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. + Refer to https://api.slack.com/apis/connections/events-api for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -844,7 +844,7 @@

    Classes

    # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://docs.slack.dev/reference/events/message for details of `message` events. + Refer to https://api.slack.com/events/message for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -890,6 +890,7 @@

    Classes

    matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, auto_acknowledge: bool = True, + ack_timeout: int = 3, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new Function listener. This method can be used as either a decorator or a method. @@ -918,13 +919,17 @@

    Classes

    Only when all the middleware call `next()` method, the listener function can be invoked. """ + if auto_acknowledge is True: + if ack_timeout != 3: + self._framework_logger.warning(warning_ack_timeout_has_no_effect(callback_id, ack_timeout)) + matchers = list(matchers) if matchers else [] middleware = list(middleware) if middleware else [] def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.function_executed(callback_id=callback_id, base_logger=self._base_logger) - return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge) + return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge, ack_timeout) return __call__ @@ -950,7 +955,7 @@

    Classes

    # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details of Slash Commands. + Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -997,7 +1002,7 @@

    Classes

    # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://docs.slack.dev/interactivity/implementing-shortcuts for details about Shortcuts. + Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1065,9 +1070,9 @@

    Classes

    # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for actions in `blocks`. - * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for actions in `attachments`. - * Refer to https://docs.slack.dev/legacy/legacy-dialogs for actions in dialogs. + * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. + * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. + * Refer to https://api.slack.com/dialogs for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1093,7 +1098,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `block_actions` action listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for details. + Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. """ def __call__(*args, **kwargs): @@ -1110,7 +1115,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `interactive_message` action listener. - Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for details.""" + Refer to https://api.slack.com/legacy/message-buttons for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1126,7 +1131,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_submission` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1142,7 +1147,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_cancellation` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1183,7 +1188,7 @@

    Classes

    # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. + Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1209,7 +1214,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_submission for details.""" + Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1225,7 +1230,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_closed` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_closed for details.""" + Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1266,7 +1271,8 @@

    Classes

    Refer to the following documents for details: - * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select + * https://api.slack.com/reference/block-kit/block-elements#external_select + * https://api.slack.com/reference/block-kit/block-elements#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1306,7 +1312,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1399,6 +1405,7 @@

    Classes

    matchers: Optional[Sequence[Callable[..., bool]]], middleware: Optional[Sequence[Union[Callable, Middleware]]], auto_acknowledgement: bool = False, + ack_timeout: int = 3, ) -> Optional[Callable[..., Optional[BoltResponse]]]: value_to_return = None if not isinstance(functions, list): @@ -1425,10 +1432,11 @@

    Classes

    CustomListener( app_name=self.name, ack_function=functions.pop(0), - lazy_functions=functions, + lazy_functions=functions, # type:ignore[arg-type] matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, + ack_timeout=ack_timeout, base_logger=self._base_logger, ) ) @@ -1648,9 +1656,9 @@

    Methods

    # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for actions in `blocks`. - * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for actions in `attachments`. - * Refer to https://docs.slack.dev/legacy/legacy-dialogs for actions in dialogs. + * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. + * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. + * Refer to https://api.slack.com/dialogs for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1679,9 +1687,9 @@

    Methods

    app.action("approve_button")(update_message)

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -1724,7 +1732,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `interactive_message` action listener. - Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for details.""" + Refer to https://api.slack.com/legacy/message-buttons for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1734,7 +1742,7 @@

    Args

    return __call__

    Registers a new interactive_message action listener. -Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for details.

    +Refer to https://api.slack.com/legacy/message-buttons for details.

    def block_action(self,
    constraints: str | Pattern | Dict[str, str | Pattern],
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -1751,7 +1759,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `block_actions` action listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for details. + Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. """ def __call__(*args, **kwargs): @@ -1762,7 +1770,7 @@

    Args

    return __call__

    Registers a new block_actions action listener. -Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for details.

    +Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details.

    def block_suggestion(self,
    action_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -1816,7 +1824,7 @@

    Args

    # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details of Slash Commands. + Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1847,7 +1855,7 @@

    Args

    # Pass a function to this method app.command("/echo")(repeat_text)
    -

    Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details of Slash Commands.

    +

    Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -1910,7 +1918,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_cancellation` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1920,7 +1928,7 @@

    Args

    return __call__

    Registers a new dialog_cancellation listener. -Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.

    +Refer to https://api.slack.com/dialogs for details.

    def dialog_submission(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -1937,7 +1945,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_submission` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1947,7 +1955,7 @@

    Args

    return __call__

    Registers a new dialog_submission listener. -Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.

    +Refer to https://api.slack.com/dialogs for details.

    def dialog_suggestion(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -1964,7 +1972,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1974,7 +1982,7 @@

    Args

    return __call__

    Registers a new dialog_suggestion listener. -Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.

    +Refer to https://api.slack.com/dialogs for details.

    def dispatch(self,
    req: BoltRequest) ‑> BoltResponse
    @@ -2200,7 +2208,7 @@

    Args

    # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. + Refer to https://api.slack.com/apis/connections/events-api for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2232,7 +2240,7 @@

    Args

    # Pass a function to this method app.event("team_join")(ask_for_introduction)
    -

    Refer to https://docs.slack.dev/apis/events-api/ for details of Events API.

    +

    Refer to https://api.slack.com/apis/connections/events-api for details of Events API.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2248,7 +2256,7 @@

    Args

    -def function(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None,
    auto_acknowledge: bool = True) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    +def function(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None,
    auto_acknowledge: bool = True,
    ack_timeout: int = 3) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -2261,6 +2269,7 @@

    Args

    matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, auto_acknowledge: bool = True, + ack_timeout: int = 3, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new Function listener. This method can be used as either a decorator or a method. @@ -2289,13 +2298,17 @@

    Args

    Only when all the middleware call `next()` method, the listener function can be invoked. """ + if auto_acknowledge is True: + if ack_timeout != 3: + self._framework_logger.warning(warning_ack_timeout_has_no_effect(callback_id, ack_timeout)) + matchers = list(matchers) if matchers else [] middleware = list(middleware) if middleware else [] def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.function_executed(callback_id=callback_id, base_logger=self._base_logger) - return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge) + return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge, ack_timeout) return __call__
    @@ -2379,7 +2392,7 @@

    Args

    # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://docs.slack.dev/reference/events/message for details of `message` events. + Refer to https://api.slack.com/events/message for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2430,7 +2443,7 @@

    Args

    # Pass a function to this method app.message(":wave:")(say_hello) -

    Refer to https://docs.slack.dev/reference/events/message for details of message events.

    +

    Refer to https://api.slack.com/events/message for details of message events.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2573,7 +2586,8 @@

    Args

    Refer to the following documents for details: - * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select + * https://api.slack.com/reference/block-kit/block-elements#external_select + * https://api.slack.com/reference/block-kit/block-elements#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2613,7 +2627,8 @@

    Args

    Refer to the following documents for details:

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2659,7 +2674,7 @@

    Args

    # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://docs.slack.dev/interactivity/implementing-shortcuts for details about Shortcuts. + Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2696,7 +2711,7 @@

    Args

    # Pass a function to this method app.shortcut("open_modal")(open_modal) -

    Refer to https://docs.slack.dev/interactivity/implementing-shortcuts for details about Shortcuts.

    +

    Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2782,7 +2797,7 @@

    Args

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new step from app listener. @@ -2800,7 +2815,7 @@

    Args

    # Pass Step to set up listeners app.step(ws) - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. + Refer to https://api.slack.com/workflows/steps for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2817,7 +2832,7 @@

    Args

    warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps" + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" ), category=DeprecationWarning, ) @@ -2839,7 +2854,7 @@

    Args

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    Registers a new step from app listener.

    Unlike others, this method doesn't behave as a decorator. If you want to register a step from app by a decorator, use WorkflowStepBuilder's methods.

    @@ -2854,7 +2869,7 @@

    Args

    # Pass Step to set up listeners app.step(ws) -

    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps.

    +

    Refer to https://api.slack.com/workflows/steps for details of steps from apps.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    For further information about WorkflowStep specific function arguments such as configure, update, complete, and fail, @@ -2925,7 +2940,7 @@

    Args

    # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. + Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2966,7 +2981,7 @@

    Args

    # Pass a function to this method app.view("view_1")(handle_submission) -

    Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads.

    +

    Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2995,7 +3010,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_closed` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_closed for details.""" + Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3005,7 +3020,7 @@

    Args

    return __call__

    Registers a new view_closed listener. -Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_closed for details.

    +Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.

    def view_submission(self,
    constraints: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -3022,7 +3037,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_submission for details.""" + Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3032,7 +3047,7 @@

    Args

    return __call__

    Registers a new view_submission listener. -Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_submission for details.

    +Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.

    @@ -3104,7 +3119,7 @@

    App diff --git a/docs/reference/async_app.html b/docs/reference/async_app.html index c067aeb5e..07c1f3627 100644 --- a/docs/reference/async_app.html +++ b/docs/reference/async_app.html @@ -3,7 +3,7 @@ - + slack_bolt.async_app API documentation @@ -778,7 +778,7 @@

    Class variables

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new step from app listener. @@ -796,7 +796,7 @@

    Class variables

    # Pass Step to set up listeners app.step(ws) - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. + Refer to https://api.slack.com/workflows/steps for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. For further information about AsyncWorkflowStep specific function arguments @@ -812,7 +812,7 @@

    Class variables

    warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps" + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" ), category=DeprecationWarning, ) @@ -894,7 +894,7 @@

    Class variables

    # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. + Refer to https://api.slack.com/apis/connections/events-api for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -932,7 +932,7 @@

    Class variables

    # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://docs.slack.dev/reference/events/message for details of `message` events. + Refer to https://api.slack.com/events/message for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -981,6 +981,7 @@

    Class variables

    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, auto_acknowledge: bool = True, + ack_timeout: int = 3, ) -> Callable[..., Optional[Callable[..., Awaitable[BoltResponse]]]]: """Registers a new Function listener. This method can be used as either a decorator or a method. @@ -1008,6 +1009,9 @@

    Class variables

    middleware: A list of lister middleware functions. Only when all the middleware call `next()` method, the listener function can be invoked. """ + if auto_acknowledge is True: + if ack_timeout != 3: + self._framework_logger.warning(warning_ack_timeout_has_no_effect(callback_id, ack_timeout)) matchers = list(matchers) if matchers else [] middleware = list(middleware) if middleware else [] @@ -1017,7 +1021,7 @@

    Class variables

    primary_matcher = builtin_matchers.function_executed( callback_id=callback_id, base_logger=self._base_logger, asyncio=True ) - return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge) + return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge, ack_timeout) return __call__ @@ -1043,7 +1047,7 @@

    Class variables

    # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details of Slash Commands. + Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1090,7 +1094,7 @@

    Class variables

    # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://docs.slack.dev/interactivity/implementing-shortcuts for details about Shortcuts. + Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1158,9 +1162,9 @@

    Class variables

    # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for actions in `blocks`. - * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for actions in `attachments`. - * Refer to https://docs.slack.dev/legacy/legacy-dialogs for actions in dialogs. + * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. + * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. + * Refer to https://api.slack.com/dialogs for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1186,7 +1190,7 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `block_actions` action listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for details. + Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. """ def __call__(*args, **kwargs): @@ -1203,7 +1207,7 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `interactive_message` action listener. - Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for details.""" + Refer to https://api.slack.com/legacy/message-buttons for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1219,7 +1223,7 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1235,7 +1239,7 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1276,7 +1280,7 @@

    Class variables

    # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. + Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1302,7 +1306,7 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_submission` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_submission for details.""" + Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1318,7 +1322,7 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_closed` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_closed for details.""" + Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1359,7 +1363,8 @@

    Class variables

    Refer to the following documents for details: - * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select + * https://api.slack.com/reference/block-kit/block-elements#external_select + * https://api.slack.com/reference/block-kit/block-elements#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1399,7 +1404,7 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1496,6 +1501,7 @@

    Class variables

    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]], middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]], auto_acknowledgement: bool = False, + ack_timeout: int = 3, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: value_to_return = None if not isinstance(functions, list): @@ -1527,10 +1533,11 @@

    Class variables

    AsyncCustomListener( app_name=self.name, ack_function=functions.pop(0), - lazy_functions=functions, + lazy_functions=functions, # type:ignore[arg-type] matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, + ack_timeout=ack_timeout, base_logger=self._base_logger, ) ) @@ -1753,9 +1760,9 @@

    Methods

    # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for actions in `blocks`. - * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for actions in `attachments`. - * Refer to https://docs.slack.dev/legacy/legacy-dialogs for actions in dialogs. + * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. + * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. + * Refer to https://api.slack.com/dialogs for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1784,9 +1791,9 @@

    Methods

    app.action("approve_button")(update_message)

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -1957,7 +1964,7 @@

    Returns

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `interactive_message` action listener. - Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for details.""" + Refer to https://api.slack.com/legacy/message-buttons for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1967,7 +1974,7 @@

    Returns

    return __call__

    Registers a new interactive_message action listener. -Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for details.

    +Refer to https://api.slack.com/legacy/message-buttons for details.

    def block_action(self,
    constraints: str | Pattern | Dict[str, str | Pattern],
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None) ‑> Callable[..., Callable[..., Awaitable[BoltResponse | None]] | None]
    @@ -1984,7 +1991,7 @@

    Returns

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `block_actions` action listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for details. + Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. """ def __call__(*args, **kwargs): @@ -1995,7 +2002,7 @@

    Returns

    return __call__

    Registers a new block_actions action listener. -Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for details.

    +Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details.

    def block_suggestion(self,
    action_id: str | Pattern,
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None) ‑> Callable[..., Callable[..., Awaitable[BoltResponse | None]] | None]
    @@ -2049,7 +2056,7 @@

    Returns

    # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details of Slash Commands. + Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -2080,7 +2087,7 @@

    Returns

    # Pass a function to this method app.command("/echo")(repeat_text)
    -

    Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details of Slash Commands.

    +

    Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -2143,7 +2150,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -2153,7 +2160,7 @@

    Args

    return __call__

    Registers a new dialog_submission listener. -Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.

    +Refer to https://api.slack.com/dialogs for details.

    def dialog_submission(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None) ‑> Callable[..., Callable[..., Awaitable[BoltResponse | None]] | None]
    @@ -2170,7 +2177,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -2180,7 +2187,7 @@

    Args

    return __call__

    Registers a new dialog_submission listener. -Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.

    +Refer to https://api.slack.com/dialogs for details.

    def dialog_suggestion(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None) ‑> Callable[..., Callable[..., Awaitable[BoltResponse | None]] | None]
    @@ -2197,7 +2204,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -2207,7 +2214,7 @@

    Args

    return __call__

    Registers a new dialog_suggestion listener. -Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.

    +Refer to https://api.slack.com/dialogs for details.

    def enable_token_revocation_listeners(self) ‑> None @@ -2313,7 +2320,7 @@

    Args

    # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. + Refer to https://api.slack.com/apis/connections/events-api for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -2345,7 +2352,7 @@

    Args

    # Pass a function to this method app.event("team_join")(ask_for_introduction)
    -

    Refer to https://docs.slack.dev/apis/events-api/ for details of Events API.

    +

    Refer to https://api.slack.com/apis/connections/events-api for details of Events API.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -2361,7 +2368,7 @@

    Args

    -def function(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None,
    auto_acknowledge: bool = True) ‑> Callable[..., Callable[..., Awaitable[BoltResponse]] | None]
    +def function(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None,
    auto_acknowledge: bool = True,
    ack_timeout: int = 3) ‑> Callable[..., Callable[..., Awaitable[BoltResponse]] | None]
    @@ -2374,6 +2381,7 @@

    Args

    matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, auto_acknowledge: bool = True, + ack_timeout: int = 3, ) -> Callable[..., Optional[Callable[..., Awaitable[BoltResponse]]]]: """Registers a new Function listener. This method can be used as either a decorator or a method. @@ -2401,6 +2409,9 @@

    Args

    middleware: A list of lister middleware functions. Only when all the middleware call `next()` method, the listener function can be invoked. """ + if auto_acknowledge is True: + if ack_timeout != 3: + self._framework_logger.warning(warning_ack_timeout_has_no_effect(callback_id, ack_timeout)) matchers = list(matchers) if matchers else [] middleware = list(middleware) if middleware else [] @@ -2410,7 +2421,7 @@

    Args

    primary_matcher = builtin_matchers.function_executed( callback_id=callback_id, base_logger=self._base_logger, asyncio=True ) - return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge) + return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge, ack_timeout) return __call__
    @@ -2494,7 +2505,7 @@

    Args

    # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://docs.slack.dev/reference/events/message for details of `message` events. + Refer to https://api.slack.com/events/message for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -2548,7 +2559,7 @@

    Args

    # Pass a function to this method app.message(":wave:")(say_hello) -

    Refer to https://docs.slack.dev/reference/events/message for details of message events.

    +

    Refer to https://api.slack.com/events/message for details of message events.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -2688,7 +2699,8 @@

    Args

    Refer to the following documents for details: - * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select + * https://api.slack.com/reference/block-kit/block-elements#external_select + * https://api.slack.com/reference/block-kit/block-elements#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -2728,7 +2740,8 @@

    Args

    Refer to the following documents for details:

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -2817,7 +2830,7 @@

    Args

    # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://docs.slack.dev/interactivity/implementing-shortcuts for details about Shortcuts. + Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -2854,7 +2867,7 @@

    Args

    # Pass a function to this method app.shortcut("open_modal")(open_modal) -

    Refer to https://docs.slack.dev/interactivity/implementing-shortcuts for details about Shortcuts.

    +

    Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -2917,7 +2930,7 @@

    Args

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new step from app listener. @@ -2935,7 +2948,7 @@

    Args

    # Pass Step to set up listeners app.step(ws) - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. + Refer to https://api.slack.com/workflows/steps for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. For further information about AsyncWorkflowStep specific function arguments @@ -2951,7 +2964,7 @@

    Args

    warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps" + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" ), category=DeprecationWarning, ) @@ -2973,7 +2986,7 @@

    Args

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    Registers a new step from app listener.

    Unlike others, this method doesn't behave as a decorator. If you want to register a step from app by a decorator, use AsyncWorkflowStepBuilder's methods.

    @@ -2988,7 +3001,7 @@

    Args

    # Pass Step to set up listeners app.step(ws) -

    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps.

    +

    Refer to https://api.slack.com/workflows/steps for details of steps from apps.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document. For further information about AsyncWorkflowStep specific function arguments such as configure, update, complete, and fail, @@ -3056,7 +3069,7 @@

    Args

    # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. + Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -3097,7 +3110,7 @@

    Args

    # Pass a function to this method app.view("view_1")(handle_submission) -

    Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads.

    +

    Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -3126,7 +3139,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_closed` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_closed for details.""" + Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3136,7 +3149,7 @@

    Args

    return __call__

    Registers a new view_closed listener. -Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_closed for details.

    +Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.

    def view_submission(self,
    constraints: str | Pattern,
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None) ‑> Callable[..., Callable[..., Awaitable[BoltResponse | None]] | None]
    @@ -3153,7 +3166,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_submission` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_submission for details.""" + Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3163,7 +3176,7 @@

    Args

    return __call__

    Registers a new view_submission listener. -Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_submission for details.

    +Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.

    def web_app(self, path: str = '/slack/events', port: int = 3000) ‑> aiohttp.web_app.Application @@ -4779,6 +4792,7 @@

    Class variables

    ack_function: Callable[..., Awaitable[BoltResponse]] lazy_functions: Sequence[Callable[..., Awaitable[None]]] auto_acknowledgement: bool + ack_timeout: int async def async_matches( self, @@ -4844,6 +4858,10 @@

    Class variables

    The type of the None singleton.

    +
    var ack_timeout : int
    +
    +

    The type of the None singleton.

    +
    var auto_acknowledgement : bool

    The type of the None singleton.

    @@ -5497,6 +5515,7 @@

    AsyncListener

    • ack_function
    • +
    • ack_timeout
    • async_matches
    • auto_acknowledgement
    • lazy_functions
    • @@ -5561,7 +5580,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/authorization/async_authorize.html b/docs/reference/authorization/async_authorize.html index 0a0640780..b4dfa2682 100644 --- a/docs/reference/authorization/async_authorize.html +++ b/docs/reference/authorization/async_authorize.html @@ -3,7 +3,7 @@ - + slack_bolt.authorization.async_authorize API documentation @@ -518,7 +518,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/authorization/async_authorize_args.html b/docs/reference/authorization/async_authorize_args.html index 642b35f93..5de20f757 100644 --- a/docs/reference/authorization/async_authorize_args.html +++ b/docs/reference/authorization/async_authorize_args.html @@ -3,7 +3,7 @@ - + slack_bolt.authorization.async_authorize_args API documentation @@ -158,7 +158,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/authorization/authorize.html b/docs/reference/authorization/authorize.html index 255c87196..33b50be02 100644 --- a/docs/reference/authorization/authorize.html +++ b/docs/reference/authorization/authorize.html @@ -3,7 +3,7 @@ - + slack_bolt.authorization.authorize API documentation @@ -516,7 +516,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/authorization/authorize_args.html b/docs/reference/authorization/authorize_args.html index 660ac17eb..78423fc40 100644 --- a/docs/reference/authorization/authorize_args.html +++ b/docs/reference/authorization/authorize_args.html @@ -3,7 +3,7 @@ - + slack_bolt.authorization.authorize_args API documentation @@ -158,7 +158,7 @@

      diff --git a/docs/reference/authorization/authorize_result.html b/docs/reference/authorization/authorize_result.html index 3bddc0a35..6eac3724d 100644 --- a/docs/reference/authorization/authorize_result.html +++ b/docs/reference/authorization/authorize_result.html @@ -3,7 +3,7 @@ - + slack_bolt.authorization.authorize_result API documentation @@ -292,7 +292,7 @@

      diff --git a/docs/reference/authorization/index.html b/docs/reference/authorization/index.html index eaa267d29..64ca14f0e 100644 --- a/docs/reference/authorization/index.html +++ b/docs/reference/authorization/index.html @@ -3,7 +3,7 @@ - + slack_bolt.authorization API documentation @@ -328,7 +328,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/ack/ack.html b/docs/reference/context/ack/ack.html index e1b71bcb9..a8b808d86 100644 --- a/docs/reference/context/ack/ack.html +++ b/docs/reference/context/ack/ack.html @@ -3,7 +3,7 @@ - + slack_bolt.context.ack.ack API documentation @@ -127,7 +127,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/ack/async_ack.html b/docs/reference/context/ack/async_ack.html index 0f2989e9f..f744d5693 100644 --- a/docs/reference/context/ack/async_ack.html +++ b/docs/reference/context/ack/async_ack.html @@ -3,7 +3,7 @@ - + slack_bolt.context.ack.async_ack API documentation @@ -127,7 +127,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/ack/index.html b/docs/reference/context/ack/index.html index 230da5d99..89f0600e8 100644 --- a/docs/reference/context/ack/index.html +++ b/docs/reference/context/ack/index.html @@ -3,7 +3,7 @@ - + slack_bolt.context.ack API documentation @@ -149,7 +149,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/ack/internals.html b/docs/reference/context/ack/internals.html index 2fa3d8028..f7f776241 100644 --- a/docs/reference/context/ack/internals.html +++ b/docs/reference/context/ack/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.context.ack.internals API documentation @@ -60,7 +60,7 @@

      Module slack_bolt.context.ack.internals

      diff --git a/docs/reference/context/assistant/assistant_utilities.html b/docs/reference/context/assistant/assistant_utilities.html index 7bfeeeee9..d446b3c02 100644 --- a/docs/reference/context/assistant/assistant_utilities.html +++ b/docs/reference/context/assistant/assistant_utilities.html @@ -3,7 +3,7 @@ - + slack_bolt.context.assistant.assistant_utilities API documentation @@ -289,7 +289,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/assistant/async_assistant_utilities.html b/docs/reference/context/assistant/async_assistant_utilities.html index b4af582a7..fc3cbbe8b 100644 --- a/docs/reference/context/assistant/async_assistant_utilities.html +++ b/docs/reference/context/assistant/async_assistant_utilities.html @@ -3,7 +3,7 @@ - + slack_bolt.context.assistant.async_assistant_utilities API documentation @@ -283,7 +283,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/assistant/index.html b/docs/reference/context/assistant/index.html index 73dcff282..d442e26cf 100644 --- a/docs/reference/context/assistant/index.html +++ b/docs/reference/context/assistant/index.html @@ -3,7 +3,7 @@ - + slack_bolt.context.assistant API documentation @@ -92,7 +92,7 @@

      Sub-modules

      diff --git a/docs/reference/context/assistant/internals.html b/docs/reference/context/assistant/internals.html index b1558b9d2..242bd6f19 100644 --- a/docs/reference/context/assistant/internals.html +++ b/docs/reference/context/assistant/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.context.assistant.internals API documentation @@ -89,7 +89,7 @@

      Functions

      diff --git a/docs/reference/context/assistant/thread_context/index.html b/docs/reference/context/assistant/thread_context/index.html index 7d1232b1d..f3767a1cf 100644 --- a/docs/reference/context/assistant/thread_context/index.html +++ b/docs/reference/context/assistant/thread_context/index.html @@ -3,7 +3,7 @@ - + slack_bolt.context.assistant.thread_context API documentation @@ -126,7 +126,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/assistant/thread_context_store/async_store.html b/docs/reference/context/assistant/thread_context_store/async_store.html index f5045739f..64f4e53ed 100644 --- a/docs/reference/context/assistant/thread_context_store/async_store.html +++ b/docs/reference/context/assistant/thread_context_store/async_store.html @@ -3,7 +3,7 @@ - + slack_bolt.context.assistant.thread_context_store.async_store API documentation @@ -124,7 +124,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/assistant/thread_context_store/default_async_store.html b/docs/reference/context/assistant/thread_context_store/default_async_store.html index 8344971de..f6cd66060 100644 --- a/docs/reference/context/assistant/thread_context_store/default_async_store.html +++ b/docs/reference/context/assistant/thread_context_store/default_async_store.html @@ -3,7 +3,7 @@ - + slack_bolt.context.assistant.thread_context_store.default_async_store API documentation @@ -190,7 +190,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/assistant/thread_context_store/default_store.html b/docs/reference/context/assistant/thread_context_store/default_store.html index d647b9c78..1594c5d38 100644 --- a/docs/reference/context/assistant/thread_context_store/default_store.html +++ b/docs/reference/context/assistant/thread_context_store/default_store.html @@ -3,7 +3,7 @@ - + slack_bolt.context.assistant.thread_context_store.default_store API documentation @@ -188,7 +188,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/assistant/thread_context_store/file/index.html b/docs/reference/context/assistant/thread_context_store/file/index.html index 4190a948f..4a5d944e1 100644 --- a/docs/reference/context/assistant/thread_context_store/file/index.html +++ b/docs/reference/context/assistant/thread_context_store/file/index.html @@ -3,7 +3,7 @@ - + slack_bolt.context.assistant.thread_context_store.file API documentation @@ -159,7 +159,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/assistant/thread_context_store/index.html b/docs/reference/context/assistant/thread_context_store/index.html index 400b3c37a..3083275d9 100644 --- a/docs/reference/context/assistant/thread_context_store/index.html +++ b/docs/reference/context/assistant/thread_context_store/index.html @@ -3,7 +3,7 @@ - + slack_bolt.context.assistant.thread_context_store API documentation @@ -92,7 +92,7 @@

      Sub-modules

      diff --git a/docs/reference/context/assistant/thread_context_store/store.html b/docs/reference/context/assistant/thread_context_store/store.html index fde47afc9..a0a177b09 100644 --- a/docs/reference/context/assistant/thread_context_store/store.html +++ b/docs/reference/context/assistant/thread_context_store/store.html @@ -3,7 +3,7 @@ - + slack_bolt.context.assistant.thread_context_store.store API documentation @@ -125,7 +125,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/async_context.html b/docs/reference/context/async_context.html index 76ac8c5de..9ce4ebd9e 100644 --- a/docs/reference/context/async_context.html +++ b/docs/reference/context/async_context.html @@ -3,7 +3,7 @@ - + slack_bolt.context.async_context API documentation @@ -706,7 +706,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/base_context.html b/docs/reference/context/base_context.html index 54617176b..4a177f8dc 100644 --- a/docs/reference/context/base_context.html +++ b/docs/reference/context/base_context.html @@ -3,7 +3,7 @@ - + slack_bolt.context.base_context API documentation @@ -640,7 +640,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/complete/async_complete.html b/docs/reference/context/complete/async_complete.html index e6ce03d74..36cf1f92f 100644 --- a/docs/reference/context/complete/async_complete.html +++ b/docs/reference/context/complete/async_complete.html @@ -3,7 +3,7 @@ - + slack_bolt.context.complete.async_complete API documentation @@ -127,7 +127,7 @@

      diff --git a/docs/reference/context/complete/complete.html b/docs/reference/context/complete/complete.html index ef6c6c78f..b1f01ea1a 100644 --- a/docs/reference/context/complete/complete.html +++ b/docs/reference/context/complete/complete.html @@ -3,7 +3,7 @@ - + slack_bolt.context.complete.complete API documentation @@ -125,7 +125,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/complete/index.html b/docs/reference/context/complete/index.html index f476fa258..7665622b6 100644 --- a/docs/reference/context/complete/index.html +++ b/docs/reference/context/complete/index.html @@ -3,7 +3,7 @@ - + slack_bolt.context.complete API documentation @@ -142,7 +142,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/context.html b/docs/reference/context/context.html index c1ae2789e..615432502 100644 --- a/docs/reference/context/context.html +++ b/docs/reference/context/context.html @@ -3,7 +3,7 @@ - + slack_bolt.context.context API documentation @@ -708,7 +708,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/fail/async_fail.html b/docs/reference/context/fail/async_fail.html index 91497eff9..6b3e4f1df 100644 --- a/docs/reference/context/fail/async_fail.html +++ b/docs/reference/context/fail/async_fail.html @@ -3,7 +3,7 @@ - + slack_bolt.context.fail.async_fail API documentation @@ -125,7 +125,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/fail/fail.html b/docs/reference/context/fail/fail.html index 20d44d1d5..0152561d8 100644 --- a/docs/reference/context/fail/fail.html +++ b/docs/reference/context/fail/fail.html @@ -3,7 +3,7 @@ - + slack_bolt.context.fail.fail API documentation @@ -125,7 +125,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/fail/index.html b/docs/reference/context/fail/index.html index 2b14ac772..eb2653106 100644 --- a/docs/reference/context/fail/index.html +++ b/docs/reference/context/fail/index.html @@ -3,7 +3,7 @@ - + slack_bolt.context.fail API documentation @@ -142,7 +142,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/get_thread_context/async_get_thread_context.html b/docs/reference/context/get_thread_context/async_get_thread_context.html index 66500752e..1c3fc4d6c 100644 --- a/docs/reference/context/get_thread_context/async_get_thread_context.html +++ b/docs/reference/context/get_thread_context/async_get_thread_context.html @@ -3,7 +3,7 @@ - + slack_bolt.context.get_thread_context.async_get_thread_context API documentation @@ -154,7 +154,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/get_thread_context/get_thread_context.html b/docs/reference/context/get_thread_context/get_thread_context.html index a6777da30..4ac274368 100644 --- a/docs/reference/context/get_thread_context/get_thread_context.html +++ b/docs/reference/context/get_thread_context/get_thread_context.html @@ -3,7 +3,7 @@ - + slack_bolt.context.get_thread_context.get_thread_context API documentation @@ -154,7 +154,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/get_thread_context/index.html b/docs/reference/context/get_thread_context/index.html index ffd095911..13dcd1388 100644 --- a/docs/reference/context/get_thread_context/index.html +++ b/docs/reference/context/get_thread_context/index.html @@ -3,7 +3,7 @@ - + slack_bolt.context.get_thread_context API documentation @@ -171,7 +171,7 @@

      diff --git a/docs/reference/context/index.html b/docs/reference/context/index.html index 4d3f472cc..65cb8054c 100644 --- a/docs/reference/context/index.html +++ b/docs/reference/context/index.html @@ -3,7 +3,7 @@ - + slack_bolt.context API documentation @@ -790,7 +790,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/respond/async_respond.html b/docs/reference/context/respond/async_respond.html index 148e1607e..ed071afaf 100644 --- a/docs/reference/context/respond/async_respond.html +++ b/docs/reference/context/respond/async_respond.html @@ -3,7 +3,7 @@ - + slack_bolt.context.respond.async_respond API documentation @@ -160,7 +160,7 @@

      diff --git a/docs/reference/context/respond/index.html b/docs/reference/context/respond/index.html index 94693dccf..8c116c956 100644 --- a/docs/reference/context/respond/index.html +++ b/docs/reference/context/respond/index.html @@ -3,7 +3,7 @@ - + slack_bolt.context.respond API documentation @@ -182,7 +182,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/respond/internals.html b/docs/reference/context/respond/internals.html index 295a793a3..e61988ef6 100644 --- a/docs/reference/context/respond/internals.html +++ b/docs/reference/context/respond/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.context.respond.internals API documentation @@ -60,7 +60,7 @@

      Module slack_bolt.context.respond.internals

      diff --git a/docs/reference/context/respond/respond.html b/docs/reference/context/respond/respond.html index 5fb010d20..af2271eb6 100644 --- a/docs/reference/context/respond/respond.html +++ b/docs/reference/context/respond/respond.html @@ -3,7 +3,7 @@ - + slack_bolt.context.respond.respond API documentation @@ -160,7 +160,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/save_thread_context/async_save_thread_context.html b/docs/reference/context/save_thread_context/async_save_thread_context.html index 796970dd7..f57291c3c 100644 --- a/docs/reference/context/save_thread_context/async_save_thread_context.html +++ b/docs/reference/context/save_thread_context/async_save_thread_context.html @@ -3,7 +3,7 @@ - + slack_bolt.context.save_thread_context.async_save_thread_context API documentation @@ -123,7 +123,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/save_thread_context/index.html b/docs/reference/context/save_thread_context/index.html index 8b974a213..01f63ecd8 100644 --- a/docs/reference/context/save_thread_context/index.html +++ b/docs/reference/context/save_thread_context/index.html @@ -3,7 +3,7 @@ - + slack_bolt.context.save_thread_context API documentation @@ -140,7 +140,7 @@

      diff --git a/docs/reference/context/save_thread_context/save_thread_context.html b/docs/reference/context/save_thread_context/save_thread_context.html index 17c147505..328441034 100644 --- a/docs/reference/context/save_thread_context/save_thread_context.html +++ b/docs/reference/context/save_thread_context/save_thread_context.html @@ -3,7 +3,7 @@ - + slack_bolt.context.save_thread_context.save_thread_context API documentation @@ -123,7 +123,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/say/async_say.html b/docs/reference/context/say/async_say.html index 78d0b83a6..8547a1188 100644 --- a/docs/reference/context/say/async_say.html +++ b/docs/reference/context/say/async_say.html @@ -3,7 +3,7 @@ - + slack_bolt.context.say.async_say API documentation @@ -183,7 +183,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/say/index.html b/docs/reference/context/say/index.html index 5e2897f38..7a5850760 100644 --- a/docs/reference/context/say/index.html +++ b/docs/reference/context/say/index.html @@ -3,7 +3,7 @@ - + slack_bolt.context.say API documentation @@ -214,7 +214,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/say/internals.html b/docs/reference/context/say/internals.html index ac349a4b5..861065203 100644 --- a/docs/reference/context/say/internals.html +++ b/docs/reference/context/say/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.context.say.internals API documentation @@ -60,7 +60,7 @@

      Module slack_bolt.context.say.internals

      diff --git a/docs/reference/context/say/say.html b/docs/reference/context/say/say.html index 20ad41c0e..5db4f24ba 100644 --- a/docs/reference/context/say/say.html +++ b/docs/reference/context/say/say.html @@ -3,7 +3,7 @@ - + slack_bolt.context.say.say API documentation @@ -192,7 +192,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/set_status/async_set_status.html b/docs/reference/context/set_status/async_set_status.html index d22fb3aa8..6a15d70ae 100644 --- a/docs/reference/context/set_status/async_set_status.html +++ b/docs/reference/context/set_status/async_set_status.html @@ -3,7 +3,7 @@ - + slack_bolt.context.set_status.async_set_status API documentation @@ -123,7 +123,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/set_status/index.html b/docs/reference/context/set_status/index.html index 5a2e8be48..9e53da9a5 100644 --- a/docs/reference/context/set_status/index.html +++ b/docs/reference/context/set_status/index.html @@ -3,7 +3,7 @@ - + slack_bolt.context.set_status API documentation @@ -140,7 +140,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/set_status/set_status.html b/docs/reference/context/set_status/set_status.html index 337fbf576..0ec8df5da 100644 --- a/docs/reference/context/set_status/set_status.html +++ b/docs/reference/context/set_status/set_status.html @@ -3,7 +3,7 @@ - + slack_bolt.context.set_status.set_status API documentation @@ -123,7 +123,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/set_suggested_prompts/async_set_suggested_prompts.html b/docs/reference/context/set_suggested_prompts/async_set_suggested_prompts.html index ee7458fbc..449a72117 100644 --- a/docs/reference/context/set_suggested_prompts/async_set_suggested_prompts.html +++ b/docs/reference/context/set_suggested_prompts/async_set_suggested_prompts.html @@ -3,7 +3,7 @@ - + slack_bolt.context.set_suggested_prompts.async_set_suggested_prompts API documentation @@ -135,7 +135,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/set_suggested_prompts/index.html b/docs/reference/context/set_suggested_prompts/index.html index f3084288a..ee5371cea 100644 --- a/docs/reference/context/set_suggested_prompts/index.html +++ b/docs/reference/context/set_suggested_prompts/index.html @@ -3,7 +3,7 @@ - + slack_bolt.context.set_suggested_prompts API documentation @@ -152,7 +152,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/set_suggested_prompts/set_suggested_prompts.html b/docs/reference/context/set_suggested_prompts/set_suggested_prompts.html index bdb31a3ca..133d3a55a 100644 --- a/docs/reference/context/set_suggested_prompts/set_suggested_prompts.html +++ b/docs/reference/context/set_suggested_prompts/set_suggested_prompts.html @@ -3,7 +3,7 @@ - + slack_bolt.context.set_suggested_prompts.set_suggested_prompts API documentation @@ -135,7 +135,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/set_title/async_set_title.html b/docs/reference/context/set_title/async_set_title.html index 9c195664c..e7db1ca1c 100644 --- a/docs/reference/context/set_title/async_set_title.html +++ b/docs/reference/context/set_title/async_set_title.html @@ -3,7 +3,7 @@ - + slack_bolt.context.set_title.async_set_title API documentation @@ -123,7 +123,7 @@

      diff --git a/docs/reference/context/set_title/index.html b/docs/reference/context/set_title/index.html index 4c88c8539..7ae070fe8 100644 --- a/docs/reference/context/set_title/index.html +++ b/docs/reference/context/set_title/index.html @@ -3,7 +3,7 @@ - + slack_bolt.context.set_title API documentation @@ -140,7 +140,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/context/set_title/set_title.html b/docs/reference/context/set_title/set_title.html index 59a4498bf..cd4d1e27e 100644 --- a/docs/reference/context/set_title/set_title.html +++ b/docs/reference/context/set_title/set_title.html @@ -3,7 +3,7 @@ - + slack_bolt.context.set_title.set_title API documentation @@ -123,7 +123,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/error/index.html b/docs/reference/error/index.html index 8e578eb61..f57d690e9 100644 --- a/docs/reference/error/index.html +++ b/docs/reference/error/index.html @@ -3,7 +3,7 @@ - + slack_bolt.error API documentation @@ -160,7 +160,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/index.html b/docs/reference/index.html index 6aae1d55a..430e36813 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -3,7 +3,7 @@ - + slack_bolt API documentation @@ -815,7 +815,7 @@

      Class variables

      """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new step from app listener. @@ -833,7 +833,7 @@

      Class variables

      # Pass Step to set up listeners app.step(ws) - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. + Refer to https://api.slack.com/workflows/steps for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -850,7 +850,7 @@

      Class variables

      warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps" + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" ), category=DeprecationWarning, ) @@ -927,7 +927,7 @@

      Class variables

      # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. + Refer to https://api.slack.com/apis/connections/events-api for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -965,7 +965,7 @@

      Class variables

      # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://docs.slack.dev/reference/events/message for details of `message` events. + Refer to https://api.slack.com/events/message for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1011,6 +1011,7 @@

      Class variables

      matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, auto_acknowledge: bool = True, + ack_timeout: int = 3, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new Function listener. This method can be used as either a decorator or a method. @@ -1039,13 +1040,17 @@

      Class variables

      Only when all the middleware call `next()` method, the listener function can be invoked. """ + if auto_acknowledge is True: + if ack_timeout != 3: + self._framework_logger.warning(warning_ack_timeout_has_no_effect(callback_id, ack_timeout)) + matchers = list(matchers) if matchers else [] middleware = list(middleware) if middleware else [] def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.function_executed(callback_id=callback_id, base_logger=self._base_logger) - return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge) + return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge, ack_timeout) return __call__ @@ -1071,7 +1076,7 @@

      Class variables

      # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details of Slash Commands. + Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1118,7 +1123,7 @@

      Class variables

      # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://docs.slack.dev/interactivity/implementing-shortcuts for details about Shortcuts. + Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1186,9 +1191,9 @@

      Class variables

      # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for actions in `blocks`. - * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for actions in `attachments`. - * Refer to https://docs.slack.dev/legacy/legacy-dialogs for actions in dialogs. + * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. + * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. + * Refer to https://api.slack.com/dialogs for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1214,7 +1219,7 @@

      Class variables

      middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `block_actions` action listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for details. + Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. """ def __call__(*args, **kwargs): @@ -1231,7 +1236,7 @@

      Class variables

      middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `interactive_message` action listener. - Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for details.""" + Refer to https://api.slack.com/legacy/message-buttons for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1247,7 +1252,7 @@

      Class variables

      middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_submission` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1263,7 +1268,7 @@

      Class variables

      middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_cancellation` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1304,7 +1309,7 @@

      Class variables

      # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. + Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1330,7 +1335,7 @@

      Class variables

      middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_submission for details.""" + Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1346,7 +1351,7 @@

      Class variables

      middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_closed` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_closed for details.""" + Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1387,7 +1392,8 @@

      Class variables

      Refer to the following documents for details: - * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select + * https://api.slack.com/reference/block-kit/block-elements#external_select + * https://api.slack.com/reference/block-kit/block-elements#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1427,7 +1433,7 @@

      Class variables

      middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1520,6 +1526,7 @@

      Class variables

      matchers: Optional[Sequence[Callable[..., bool]]], middleware: Optional[Sequence[Union[Callable, Middleware]]], auto_acknowledgement: bool = False, + ack_timeout: int = 3, ) -> Optional[Callable[..., Optional[BoltResponse]]]: value_to_return = None if not isinstance(functions, list): @@ -1546,10 +1553,11 @@

      Class variables

      CustomListener( app_name=self.name, ack_function=functions.pop(0), - lazy_functions=functions, + lazy_functions=functions, # type:ignore[arg-type] matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, + ack_timeout=ack_timeout, base_logger=self._base_logger, ) ) @@ -1769,9 +1777,9 @@

      Methods

      # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for actions in `blocks`. - * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for actions in `attachments`. - * Refer to https://docs.slack.dev/legacy/legacy-dialogs for actions in dialogs. + * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. + * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. + * Refer to https://api.slack.com/dialogs for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1800,9 +1808,9 @@

      Methods

      app.action("approve_button")(update_message)

      To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

      Args

      @@ -1845,7 +1853,7 @@

      Args

      middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `interactive_message` action listener. - Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for details.""" + Refer to https://api.slack.com/legacy/message-buttons for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1855,7 +1863,7 @@

      Args

      return __call__

      Registers a new interactive_message action listener. -Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons for details.

      +Refer to https://api.slack.com/legacy/message-buttons for details.

    def block_action(self,
    constraints: str | Pattern | Dict[str, str | Pattern],
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -1872,7 +1880,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `block_actions` action listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for details. + Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. """ def __call__(*args, **kwargs): @@ -1883,7 +1891,7 @@

    Args

    return __call__

    Registers a new block_actions action listener. -Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload for details.

    +Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details.

    def block_suggestion(self,
    action_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -1937,7 +1945,7 @@

    Args

    # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details of Slash Commands. + Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1968,7 +1976,7 @@

    Args

    # Pass a function to this method app.command("/echo")(repeat_text)
    -

    Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details of Slash Commands.

    +

    Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2031,7 +2039,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_cancellation` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -2041,7 +2049,7 @@

    Args

    return __call__

    Registers a new dialog_cancellation listener. -Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.

    +Refer to https://api.slack.com/dialogs for details.

    def dialog_submission(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -2058,7 +2066,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_submission` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -2068,7 +2076,7 @@

    Args

    return __call__

    Registers a new dialog_submission listener. -Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.

    +Refer to https://api.slack.com/dialogs for details.

    def dialog_suggestion(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -2085,7 +2093,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.""" + Refer to https://api.slack.com/dialogs for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -2095,7 +2103,7 @@

    Args

    return __call__

    Registers a new dialog_suggestion listener. -Refer to https://docs.slack.dev/legacy/legacy-dialogs for details.

    +Refer to https://api.slack.com/dialogs for details.

    def dispatch(self,
    req: BoltRequest) ‑> BoltResponse
    @@ -2321,7 +2329,7 @@

    Args

    # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. + Refer to https://api.slack.com/apis/connections/events-api for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2353,7 +2361,7 @@

    Args

    # Pass a function to this method app.event("team_join")(ask_for_introduction)
    -

    Refer to https://docs.slack.dev/apis/events-api/ for details of Events API.

    +

    Refer to https://api.slack.com/apis/connections/events-api for details of Events API.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2369,7 +2377,7 @@

    Args

    -def function(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None,
    auto_acknowledge: bool = True) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    +def function(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None,
    auto_acknowledge: bool = True,
    ack_timeout: int = 3) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -2382,6 +2390,7 @@

    Args

    matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, auto_acknowledge: bool = True, + ack_timeout: int = 3, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new Function listener. This method can be used as either a decorator or a method. @@ -2410,13 +2419,17 @@

    Args

    Only when all the middleware call `next()` method, the listener function can be invoked. """ + if auto_acknowledge is True: + if ack_timeout != 3: + self._framework_logger.warning(warning_ack_timeout_has_no_effect(callback_id, ack_timeout)) + matchers = list(matchers) if matchers else [] middleware = list(middleware) if middleware else [] def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.function_executed(callback_id=callback_id, base_logger=self._base_logger) - return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge) + return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge, ack_timeout) return __call__
    @@ -2500,7 +2513,7 @@

    Args

    # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://docs.slack.dev/reference/events/message for details of `message` events. + Refer to https://api.slack.com/events/message for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2551,7 +2564,7 @@

    Args

    # Pass a function to this method app.message(":wave:")(say_hello) -

    Refer to https://docs.slack.dev/reference/events/message for details of message events.

    +

    Refer to https://api.slack.com/events/message for details of message events.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2694,7 +2707,8 @@

    Args

    Refer to the following documents for details: - * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select + * https://api.slack.com/reference/block-kit/block-elements#external_select + * https://api.slack.com/reference/block-kit/block-elements#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2734,7 +2748,8 @@

    Args

    Refer to the following documents for details:

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2780,7 +2795,7 @@

    Args

    # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://docs.slack.dev/interactivity/implementing-shortcuts for details about Shortcuts. + Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2817,7 +2832,7 @@

    Args

    # Pass a function to this method app.shortcut("open_modal")(open_modal) -

    Refer to https://docs.slack.dev/interactivity/implementing-shortcuts for details about Shortcuts.

    +

    Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2903,7 +2918,7 @@

    Args

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new step from app listener. @@ -2921,7 +2936,7 @@

    Args

    # Pass Step to set up listeners app.step(ws) - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. + Refer to https://api.slack.com/workflows/steps for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2938,7 +2953,7 @@

    Args

    warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps" + "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" ), category=DeprecationWarning, ) @@ -2960,7 +2975,7 @@

    Args

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    Registers a new step from app listener.

    Unlike others, this method doesn't behave as a decorator. If you want to register a step from app by a decorator, use WorkflowStepBuilder's methods.

    @@ -2975,7 +2990,7 @@

    Args

    # Pass Step to set up listeners app.step(ws) -

    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps.

    +

    Refer to https://api.slack.com/workflows/steps for details of steps from apps.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    For further information about WorkflowStep specific function arguments such as configure, update, complete, and fail, @@ -3046,7 +3061,7 @@

    Args

    # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. + Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -3087,7 +3102,7 @@

    Args

    # Pass a function to this method app.view("view_1")(handle_submission) -

    Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads.

    +

    Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -3116,7 +3131,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_closed` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_closed for details.""" + Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3126,7 +3141,7 @@

    Args

    return __call__

    Registers a new view_closed listener. -Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_closed for details.

    +Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.

    def view_submission(self,
    constraints: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -3143,7 +3158,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_submission for details.""" + Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3153,7 +3168,7 @@

    Args

    return __call__

    Registers a new view_submission listener. -Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_submission for details.

    +Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.

    @@ -5307,6 +5322,7 @@

    Methods

    ack_function: Callable[..., BoltResponse] lazy_functions: Sequence[Callable[..., None]] auto_acknowledgement: bool + ack_timeout: int = 3 def matches( self, @@ -5372,6 +5388,10 @@

    Class variables

    The type of the None singleton.

    +
    var ack_timeout : int
    +
    +

    The type of the None singleton.

    +
    var auto_acknowledgement : bool

    The type of the None singleton.

    @@ -6115,6 +6135,7 @@

    Listener

    • ack_function
    • +
    • ack_timeout
    • auto_acknowledgement
    • lazy_functions
    • matchers
    • @@ -6180,7 +6201,7 @@

      SetTitle diff --git a/docs/reference/kwargs_injection/args.html b/docs/reference/kwargs_injection/args.html index 9d2eb2c40..4d03687d1 100644 --- a/docs/reference/kwargs_injection/args.html +++ b/docs/reference/kwargs_injection/args.html @@ -3,7 +3,7 @@ - + slack_bolt.kwargs_injection.args API documentation @@ -404,7 +404,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/kwargs_injection/async_args.html b/docs/reference/kwargs_injection/async_args.html index 65a14c2d1..959f35a43 100644 --- a/docs/reference/kwargs_injection/async_args.html +++ b/docs/reference/kwargs_injection/async_args.html @@ -3,7 +3,7 @@ - + slack_bolt.kwargs_injection.async_args API documentation @@ -401,7 +401,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/kwargs_injection/async_utils.html b/docs/reference/kwargs_injection/async_utils.html index 6f433ddca..80952518d 100644 --- a/docs/reference/kwargs_injection/async_utils.html +++ b/docs/reference/kwargs_injection/async_utils.html @@ -3,7 +3,7 @@ - + slack_bolt.kwargs_injection.async_utils API documentation @@ -171,7 +171,7 @@

      Functions

      diff --git a/docs/reference/kwargs_injection/index.html b/docs/reference/kwargs_injection/index.html index 4132bbaba..de7ef4a0a 100644 --- a/docs/reference/kwargs_injection/index.html +++ b/docs/reference/kwargs_injection/index.html @@ -3,7 +3,7 @@ - + slack_bolt.kwargs_injection API documentation @@ -544,7 +544,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/kwargs_injection/utils.html b/docs/reference/kwargs_injection/utils.html index a589350c9..2e6ecd001 100644 --- a/docs/reference/kwargs_injection/utils.html +++ b/docs/reference/kwargs_injection/utils.html @@ -3,7 +3,7 @@ - + slack_bolt.kwargs_injection.utils API documentation @@ -170,7 +170,7 @@

      Functions

      diff --git a/docs/reference/lazy_listener/async_internals.html b/docs/reference/lazy_listener/async_internals.html index 19becac19..9d86a02e5 100644 --- a/docs/reference/lazy_listener/async_internals.html +++ b/docs/reference/lazy_listener/async_internals.html @@ -3,7 +3,7 @@ - + slack_bolt.lazy_listener.async_internals API documentation @@ -102,7 +102,7 @@

      Functions

      diff --git a/docs/reference/lazy_listener/async_runner.html b/docs/reference/lazy_listener/async_runner.html index e58b0a044..701f1640a 100644 --- a/docs/reference/lazy_listener/async_runner.html +++ b/docs/reference/lazy_listener/async_runner.html @@ -3,7 +3,7 @@ - + slack_bolt.lazy_listener.async_runner API documentation @@ -184,7 +184,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/lazy_listener/asyncio_runner.html b/docs/reference/lazy_listener/asyncio_runner.html index d05a4c9ac..2fdcf8ffe 100644 --- a/docs/reference/lazy_listener/asyncio_runner.html +++ b/docs/reference/lazy_listener/asyncio_runner.html @@ -3,7 +3,7 @@ - + slack_bolt.lazy_listener.asyncio_runner API documentation @@ -113,7 +113,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/lazy_listener/index.html b/docs/reference/lazy_listener/index.html index 374164af8..c2eb1c9b0 100644 --- a/docs/reference/lazy_listener/index.html +++ b/docs/reference/lazy_listener/index.html @@ -3,7 +3,7 @@ - + slack_bolt.lazy_listener API documentation @@ -295,7 +295,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/lazy_listener/internals.html b/docs/reference/lazy_listener/internals.html index 96c04a56c..1801abafd 100644 --- a/docs/reference/lazy_listener/internals.html +++ b/docs/reference/lazy_listener/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.lazy_listener.internals API documentation @@ -102,7 +102,7 @@

      Functions

      diff --git a/docs/reference/lazy_listener/runner.html b/docs/reference/lazy_listener/runner.html index 56216c9c8..ff4f449a0 100644 --- a/docs/reference/lazy_listener/runner.html +++ b/docs/reference/lazy_listener/runner.html @@ -3,7 +3,7 @@ - + slack_bolt.lazy_listener.runner API documentation @@ -185,7 +185,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/lazy_listener/thread_runner.html b/docs/reference/lazy_listener/thread_runner.html index 19e6ff29e..b4ca0711a 100644 --- a/docs/reference/lazy_listener/thread_runner.html +++ b/docs/reference/lazy_listener/thread_runner.html @@ -3,7 +3,7 @@ - + slack_bolt.lazy_listener.thread_runner API documentation @@ -119,7 +119,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/listener/async_builtins.html b/docs/reference/listener/async_builtins.html index 61e6fcd9f..015dd94b3 100644 --- a/docs/reference/listener/async_builtins.html +++ b/docs/reference/listener/async_builtins.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.async_builtins API documentation @@ -168,7 +168,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/listener/async_listener.html b/docs/reference/listener/async_listener.html index 52da6d342..a3d1a7fef 100644 --- a/docs/reference/listener/async_listener.html +++ b/docs/reference/listener/async_listener.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.async_listener API documentation @@ -48,7 +48,7 @@

      Classes

      class AsyncCustomListener -(*,
      app_name: str,
      ack_function: Callable[..., Awaitable[BoltResponse | None]],
      lazy_functions: Sequence[Callable[..., Awaitable[None]]],
      matchers: Sequence[AsyncListenerMatcher],
      middleware: Sequence[AsyncMiddleware],
      auto_acknowledgement: bool = False,
      base_logger: logging.Logger | None = None)
      +(*,
      app_name: str,
      ack_function: Callable[..., Awaitable[BoltResponse | None]],
      lazy_functions: Sequence[Callable[..., Awaitable[None]]],
      matchers: Sequence[AsyncListenerMatcher],
      middleware: Sequence[AsyncMiddleware],
      auto_acknowledgement: bool = False,
      ack_timeout: int = 3,
      base_logger: logging.Logger | None = None)
      @@ -62,6 +62,7 @@

      Classes

      matchers: Sequence[AsyncListenerMatcher] middleware: Sequence[AsyncMiddleware] auto_acknowledgement: bool + ack_timeout: int arg_names: MutableSequence[str] logger: Logger @@ -74,6 +75,7 @@

      Classes

      matchers: Sequence[AsyncListenerMatcher], middleware: Sequence[AsyncMiddleware], auto_acknowledgement: bool = False, + ack_timeout: int = 3, base_logger: Optional[Logger] = None, ): self.app_name = app_name @@ -82,6 +84,7 @@

      Classes

      self.matchers = matchers self.middleware = middleware self.auto_acknowledgement = auto_acknowledgement + self.ack_timeout = ack_timeout self.arg_names = get_arg_names_of_callable(ack_function) self.logger = get_bolt_app_logger(app_name, self.ack_function, base_logger) @@ -112,6 +115,10 @@

      Class variables

      The type of the None singleton.

      +
      var ack_timeout : int
      +
      +

      The type of the None singleton.

      +
      var app_name : str

      The type of the None singleton.

      @@ -182,7 +189,7 @@

      Returns

      class cls -(*,
      app_name: str,
      ack_function: Callable[..., Awaitable[BoltResponse | None]],
      lazy_functions: Sequence[Callable[..., Awaitable[None]]],
      matchers: Sequence[AsyncListenerMatcher],
      middleware: Sequence[AsyncMiddleware],
      auto_acknowledgement: bool = False,
      base_logger: logging.Logger | None = None)
      +(*,
      app_name: str,
      ack_function: Callable[..., Awaitable[BoltResponse | None]],
      lazy_functions: Sequence[Callable[..., Awaitable[None]]],
      matchers: Sequence[AsyncListenerMatcher],
      middleware: Sequence[AsyncMiddleware],
      auto_acknowledgement: bool = False,
      ack_timeout: int = 3,
      base_logger: logging.Logger | None = None)
      @@ -196,6 +203,7 @@

      Returns

      matchers: Sequence[AsyncListenerMatcher] middleware: Sequence[AsyncMiddleware] auto_acknowledgement: bool + ack_timeout: int arg_names: MutableSequence[str] logger: Logger @@ -208,6 +216,7 @@

      Returns

      matchers: Sequence[AsyncListenerMatcher], middleware: Sequence[AsyncMiddleware], auto_acknowledgement: bool = False, + ack_timeout: int = 3, base_logger: Optional[Logger] = None, ): self.app_name = app_name @@ -216,6 +225,7 @@

      Returns

      self.matchers = matchers self.middleware = middleware self.auto_acknowledgement = auto_acknowledgement + self.ack_timeout = ack_timeout self.arg_names = get_arg_names_of_callable(ack_function) self.logger = get_bolt_app_logger(app_name, self.ack_function, base_logger) @@ -260,6 +270,7 @@

      Inherited members

    • AsyncListener:
      • ack_function
      • +
      • ack_timeout
      • auto_acknowledgement
      • lazy_functions
      • matchers
      • @@ -284,6 +295,7 @@

        Inherited members

        ack_function: Callable[..., Awaitable[BoltResponse]] lazy_functions: Sequence[Callable[..., Awaitable[None]]] auto_acknowledgement: bool + ack_timeout: int async def async_matches( self, @@ -349,6 +361,10 @@

        Class variables

        The type of the None singleton.

        +
        var ack_timeout : int
        +
        +

        The type of the None singleton.

        +
        var auto_acknowledgement : bool

        The type of the None singleton.

        @@ -490,6 +506,7 @@

        Returns

        AsyncCustomListener

        • ack_function
        • +
        • ack_timeout
        • app_name
        • arg_names
        • auto_acknowledgement
        • @@ -512,6 +529,7 @@

          AsyncListener

          • ack_function
          • +
          • ack_timeout
          • async_matches
          • auto_acknowledgement
          • lazy_functions
          • @@ -527,7 +545,7 @@

            -

            Generated by pdoc 0.11.5.

            +

            Generated by pdoc 0.11.6.

            diff --git a/docs/reference/listener/async_listener_completion_handler.html b/docs/reference/listener/async_listener_completion_handler.html index 2a05e0213..6cde66b93 100644 --- a/docs/reference/listener/async_listener_completion_handler.html +++ b/docs/reference/listener/async_listener_completion_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.async_listener_completion_handler API documentation @@ -220,7 +220,7 @@

            -

            Generated by pdoc 0.11.5.

            +

            Generated by pdoc 0.11.6.

            diff --git a/docs/reference/listener/async_listener_error_handler.html b/docs/reference/listener/async_listener_error_handler.html index 9600a2cfd..1f3789c40 100644 --- a/docs/reference/listener/async_listener_error_handler.html +++ b/docs/reference/listener/async_listener_error_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.async_listener_error_handler API documentation @@ -234,7 +234,7 @@

            -

            Generated by pdoc 0.11.5.

            +

            Generated by pdoc 0.11.6.

            diff --git a/docs/reference/listener/async_listener_start_handler.html b/docs/reference/listener/async_listener_start_handler.html index 23ada5e08..80b25eb29 100644 --- a/docs/reference/listener/async_listener_start_handler.html +++ b/docs/reference/listener/async_listener_start_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.async_listener_start_handler API documentation @@ -220,7 +220,7 @@

            -

            Generated by pdoc 0.11.5.

            +

            Generated by pdoc 0.11.6.

            diff --git a/docs/reference/listener/asyncio_runner.html b/docs/reference/listener/asyncio_runner.html index 8262667f0..4d71a88a7 100644 --- a/docs/reference/listener/asyncio_runner.html +++ b/docs/reference/listener/asyncio_runner.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.asyncio_runner API documentation @@ -180,7 +180,7 @@

            Classes

            self._start_lazy_function(lazy_func, request) # await for the completion of ack() in the async listener execution - while ack.response is None and time.time() - starting_time <= 3: + while ack.response is None and time.time() - starting_time <= listener.ack_timeout: await asyncio.sleep(0.01) if response is None and ack.response is None: @@ -359,7 +359,7 @@

            Methods

            self._start_lazy_function(lazy_func, request) # await for the completion of ack() in the async listener execution - while ack.response is None and time.time() - starting_time <= 3: + while ack.response is None and time.time() - starting_time <= listener.ack_timeout: await asyncio.sleep(0.01) if response is None and ack.response is None: @@ -414,7 +414,7 @@

            diff --git a/docs/reference/listener/builtins.html b/docs/reference/listener/builtins.html index 75f8ca620..5f3759658 100644 --- a/docs/reference/listener/builtins.html +++ b/docs/reference/listener/builtins.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.builtins API documentation @@ -168,7 +168,7 @@

            diff --git a/docs/reference/listener/custom_listener.html b/docs/reference/listener/custom_listener.html index 1cd261379..1f18502f2 100644 --- a/docs/reference/listener/custom_listener.html +++ b/docs/reference/listener/custom_listener.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.custom_listener API documentation @@ -48,7 +48,7 @@

            Classes

            class CustomListener -(*,
            app_name: str,
            ack_function: Callable[..., BoltResponse | None],
            lazy_functions: Sequence[Callable[..., None]],
            matchers: Sequence[ListenerMatcher],
            middleware: Sequence[Middleware],
            auto_acknowledgement: bool = False,
            base_logger: logging.Logger | None = None)
            +(*,
            app_name: str,
            ack_function: Callable[..., BoltResponse | None],
            lazy_functions: Sequence[Callable[..., None]],
            matchers: Sequence[ListenerMatcher],
            middleware: Sequence[Middleware],
            auto_acknowledgement: bool = False,
            ack_timeout: int = 3,
            base_logger: logging.Logger | None = None)
            @@ -62,6 +62,7 @@

            Classes

            matchers: Sequence[ListenerMatcher] middleware: Sequence[Middleware] auto_acknowledgement: bool + ack_timeout: int = 3 arg_names: MutableSequence[str] logger: Logger @@ -74,6 +75,7 @@

            Classes

            matchers: Sequence[ListenerMatcher], middleware: Sequence[Middleware], auto_acknowledgement: bool = False, + ack_timeout: int = 3, base_logger: Optional[Logger] = None, ): self.app_name = app_name @@ -82,6 +84,7 @@

            Classes

            self.matchers = matchers self.middleware = middleware self.auto_acknowledgement = auto_acknowledgement + self.ack_timeout = ack_timeout self.arg_names = get_arg_names_of_callable(ack_function) self.logger = get_bolt_app_logger(app_name, self.ack_function, base_logger) @@ -126,6 +129,7 @@

            Inherited members

          • Listener:
            • ack_function
            • +
            • ack_timeout
            • auto_acknowledgement
            • lazy_functions
            • matchers
            • @@ -165,7 +169,7 @@

              -

              Generated by pdoc 0.11.5.

              +

              Generated by pdoc 0.11.6.

              diff --git a/docs/reference/listener/index.html b/docs/reference/listener/index.html index 677147e21..f31264cac 100644 --- a/docs/reference/listener/index.html +++ b/docs/reference/listener/index.html @@ -3,7 +3,7 @@ - + slack_bolt.listener API documentation @@ -107,7 +107,7 @@

              Classes

              class CustomListener -(*,
              app_name: str,
              ack_function: Callable[..., BoltResponse | None],
              lazy_functions: Sequence[Callable[..., None]],
              matchers: Sequence[ListenerMatcher],
              middleware: Sequence[Middleware],
              auto_acknowledgement: bool = False,
              base_logger: logging.Logger | None = None)
              +(*,
              app_name: str,
              ack_function: Callable[..., BoltResponse | None],
              lazy_functions: Sequence[Callable[..., None]],
              matchers: Sequence[ListenerMatcher],
              middleware: Sequence[Middleware],
              auto_acknowledgement: bool = False,
              ack_timeout: int = 3,
              base_logger: logging.Logger | None = None)
              @@ -121,6 +121,7 @@

              Classes

              matchers: Sequence[ListenerMatcher] middleware: Sequence[Middleware] auto_acknowledgement: bool + ack_timeout: int = 3 arg_names: MutableSequence[str] logger: Logger @@ -133,6 +134,7 @@

              Classes

              matchers: Sequence[ListenerMatcher], middleware: Sequence[Middleware], auto_acknowledgement: bool = False, + ack_timeout: int = 3, base_logger: Optional[Logger] = None, ): self.app_name = app_name @@ -141,6 +143,7 @@

              Classes

              self.matchers = matchers self.middleware = middleware self.auto_acknowledgement = auto_acknowledgement + self.ack_timeout = ack_timeout self.arg_names = get_arg_names_of_callable(ack_function) self.logger = get_bolt_app_logger(app_name, self.ack_function, base_logger) @@ -185,6 +188,7 @@

              Inherited members

            • Listener:
              • ack_function
              • +
              • ack_timeout
              • auto_acknowledgement
              • lazy_functions
              • matchers
              • @@ -209,6 +213,7 @@

                Inherited members

                ack_function: Callable[..., BoltResponse] lazy_functions: Sequence[Callable[..., None]] auto_acknowledgement: bool + ack_timeout: int = 3 def matches( self, @@ -274,6 +279,10 @@

                Class variables

                The type of the None singleton.

                +
                var ack_timeout : int
                +
                +

                The type of the None singleton.

                +
                var auto_acknowledgement : bool

                The type of the None singleton.

                @@ -440,6 +449,7 @@

                Listener

                • ack_function
                • +
                • ack_timeout
                • auto_acknowledgement
                • lazy_functions
                • matchers
                • @@ -455,7 +465,7 @@

                  -

                  Generated by pdoc 0.11.5.

                  +

                  Generated by pdoc 0.11.6.

                  diff --git a/docs/reference/listener/listener.html b/docs/reference/listener/listener.html index 743fb2ceb..034dbe67f 100644 --- a/docs/reference/listener/listener.html +++ b/docs/reference/listener/listener.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.listener API documentation @@ -60,6 +60,7 @@

                  Classes

                  ack_function: Callable[..., BoltResponse] lazy_functions: Sequence[Callable[..., None]] auto_acknowledgement: bool + ack_timeout: int = 3 def matches( self, @@ -125,6 +126,10 @@

                  Class variables

                  The type of the None singleton.

                  +
                  var ack_timeout : int
                  +
                  +

                  The type of the None singleton.

                  +
                  var auto_acknowledgement : bool

                  The type of the None singleton.

                  @@ -266,6 +271,7 @@

                  Returns

                  Listener

                  • ack_function
                  • +
                  • ack_timeout
                  • auto_acknowledgement
                  • lazy_functions
                  • matchers
                  • @@ -281,7 +287,7 @@

                    -

                    Generated by pdoc 0.11.5.

                    +

                    Generated by pdoc 0.11.6.

                    diff --git a/docs/reference/listener/listener_completion_handler.html b/docs/reference/listener/listener_completion_handler.html index 35b2fe8cd..42b1b5413 100644 --- a/docs/reference/listener/listener_completion_handler.html +++ b/docs/reference/listener/listener_completion_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.listener_completion_handler API documentation @@ -221,7 +221,7 @@

                    -

                    Generated by pdoc 0.11.5.

                    +

                    Generated by pdoc 0.11.6.

                    diff --git a/docs/reference/listener/listener_error_handler.html b/docs/reference/listener/listener_error_handler.html index fc49894d2..c9f7c2ccd 100644 --- a/docs/reference/listener/listener_error_handler.html +++ b/docs/reference/listener/listener_error_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.listener_error_handler API documentation @@ -234,7 +234,7 @@

                    -

                    Generated by pdoc 0.11.5.

                    +

                    Generated by pdoc 0.11.6.

                    diff --git a/docs/reference/listener/listener_start_handler.html b/docs/reference/listener/listener_start_handler.html index 63cb98b91..d60c1b9dc 100644 --- a/docs/reference/listener/listener_start_handler.html +++ b/docs/reference/listener/listener_start_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.listener_start_handler API documentation @@ -232,7 +232,7 @@

                    -

                    Generated by pdoc 0.11.5.

                    +

                    Generated by pdoc 0.11.6.

                    diff --git a/docs/reference/listener/thread_runner.html b/docs/reference/listener/thread_runner.html index b6fafae99..5415f9ada 100644 --- a/docs/reference/listener/thread_runner.html +++ b/docs/reference/listener/thread_runner.html @@ -3,7 +3,7 @@ - + slack_bolt.listener.thread_runner API documentation @@ -148,7 +148,7 @@

                    Classes

                    if not request.lazy_only: # start the listener function asynchronously def run_ack_function_asynchronously(): - nonlocal ack, request, response + nonlocal response try: self.listener_start_handler.handle( request=request, @@ -197,7 +197,7 @@

                    Classes

                    self._start_lazy_function(lazy_func, request) # await for the completion of ack() in the async listener execution - while ack.response is None and time.time() - starting_time <= 3: + while ack.response is None and time.time() - starting_time <= listener.ack_timeout: time.sleep(0.01) if response is None and ack.response is None: @@ -346,7 +346,7 @@

                    Methods

                    if not request.lazy_only: # start the listener function asynchronously def run_ack_function_asynchronously(): - nonlocal ack, request, response + nonlocal response try: self.listener_start_handler.handle( request=request, @@ -395,7 +395,7 @@

                    Methods

                    self._start_lazy_function(lazy_func, request) # await for the completion of ack() in the async listener execution - while ack.response is None and time.time() - starting_time <= 3: + while ack.response is None and time.time() - starting_time <= listener.ack_timeout: time.sleep(0.01) if response is None and ack.response is None: @@ -451,7 +451,7 @@

                    diff --git a/docs/reference/listener_matcher/async_builtins.html b/docs/reference/listener_matcher/async_builtins.html index b99d07c82..0df1215de 100644 --- a/docs/reference/listener_matcher/async_builtins.html +++ b/docs/reference/listener_matcher/async_builtins.html @@ -3,7 +3,7 @@ - + slack_bolt.listener_matcher.async_builtins API documentation @@ -112,7 +112,7 @@

                    -

                    Generated by pdoc 0.11.5.

                    +

                    Generated by pdoc 0.11.6.

                    diff --git a/docs/reference/listener_matcher/async_listener_matcher.html b/docs/reference/listener_matcher/async_listener_matcher.html index bc8676302..1366da4e2 100644 --- a/docs/reference/listener_matcher/async_listener_matcher.html +++ b/docs/reference/listener_matcher/async_listener_matcher.html @@ -3,7 +3,7 @@ - + slack_bolt.listener_matcher.async_listener_matcher API documentation @@ -311,7 +311,7 @@

                    -

                    Generated by pdoc 0.11.5.

                    +

                    Generated by pdoc 0.11.6.

                    diff --git a/docs/reference/listener_matcher/builtins.html b/docs/reference/listener_matcher/builtins.html index 29af67f6c..d951deada 100644 --- a/docs/reference/listener_matcher/builtins.html +++ b/docs/reference/listener_matcher/builtins.html @@ -3,7 +3,7 @@ - + slack_bolt.listener_matcher.builtins API documentation @@ -80,7 +80,7 @@

                    Functions

                    return dialog_submission(constraints["callback_id"], asyncio) if action_type == "dialog_cancellation": return dialog_cancellation(constraints["callback_id"], asyncio) - # https://docs.slack.dev/legacy/legacy-steps-from-apps/ + # https://api.slack.com/workflows/steps if action_type == "workflow_step_edit": return workflow_step_edit(constraints["callback_id"], asyncio) @@ -692,7 +692,7 @@

                    diff --git a/docs/reference/listener_matcher/custom_listener_matcher.html b/docs/reference/listener_matcher/custom_listener_matcher.html index 8009e84a1..087d36907 100644 --- a/docs/reference/listener_matcher/custom_listener_matcher.html +++ b/docs/reference/listener_matcher/custom_listener_matcher.html @@ -3,7 +3,7 @@ - + slack_bolt.listener_matcher.custom_listener_matcher API documentation @@ -141,7 +141,7 @@

                    -

                    Generated by pdoc 0.11.5.

                    +

                    Generated by pdoc 0.11.6.

                    diff --git a/docs/reference/listener_matcher/index.html b/docs/reference/listener_matcher/index.html index 622a5e9d9..a93c86d98 100644 --- a/docs/reference/listener_matcher/index.html +++ b/docs/reference/listener_matcher/index.html @@ -3,7 +3,7 @@ - + slack_bolt.listener_matcher API documentation @@ -247,7 +247,7 @@

                    -

                    Generated by pdoc 0.11.5.

                    +

                    Generated by pdoc 0.11.6.

                    diff --git a/docs/reference/listener_matcher/listener_matcher.html b/docs/reference/listener_matcher/listener_matcher.html index a20816088..0618f7e4e 100644 --- a/docs/reference/listener_matcher/listener_matcher.html +++ b/docs/reference/listener_matcher/listener_matcher.html @@ -3,7 +3,7 @@ - + slack_bolt.listener_matcher.listener_matcher API documentation @@ -137,7 +137,7 @@

                    -

                    Generated by pdoc 0.11.5.

                    +

                    Generated by pdoc 0.11.6.

                    diff --git a/docs/reference/logger/index.html b/docs/reference/logger/index.html index c9defacdb..d0b2ef33f 100644 --- a/docs/reference/logger/index.html +++ b/docs/reference/logger/index.html @@ -3,7 +3,7 @@ - + slack_bolt.logger API documentation @@ -121,7 +121,7 @@

                    Functions

                    diff --git a/docs/reference/logger/messages.html b/docs/reference/logger/messages.html index c3ff45156..3c8d67a31 100644 --- a/docs/reference/logger/messages.html +++ b/docs/reference/logger/messages.html @@ -3,7 +3,7 @@ - + slack_bolt.logger.messages API documentation @@ -308,6 +308,20 @@

                    Functions

            • +
              +def warning_ack_timeout_has_no_effect(identifier: str | re.Pattern, ack_timeout: int) ‑> str +
              +
              +
              + +Expand source code + +
              def warning_ack_timeout_has_no_effect(identifier: Union[str, Pattern], ack_timeout: int) -> str:
              +    handler_example = f'@app.function("{identifier}")' if isinstance(identifier, str) else f"@app.function({identifier})"
              +    return f"On {handler_example}, as `auto_acknowledge` is `True`, " f"`ack_timeout={ack_timeout}` you gave will be unused"
              +
              +
              +
              def warning_bot_only_conflicts() ‑> str
              @@ -591,6 +605,7 @@

              Functions

            • error_token_required
            • error_unexpected_listener_middleware
            • info_default_oauth_settings_loaded
            • +
            • warning_ack_timeout_has_no_effect
            • warning_bot_only_conflicts
            • warning_client_prioritized_and_token_skipped
            • warning_did_not_call_ack
            • @@ -605,7 +620,7 @@

              Functions

              diff --git a/docs/reference/middleware/assistant/assistant.html b/docs/reference/middleware/assistant/assistant.html index 76e5dff76..d1184c407 100644 --- a/docs/reference/middleware/assistant/assistant.html +++ b/docs/reference/middleware/assistant/assistant.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.assistant.assistant API documentation @@ -647,7 +647,7 @@

              -

              Generated by pdoc 0.11.5.

              +

              Generated by pdoc 0.11.6.

              diff --git a/docs/reference/middleware/assistant/async_assistant.html b/docs/reference/middleware/assistant/async_assistant.html index 260d493ac..2faf0e34b 100644 --- a/docs/reference/middleware/assistant/async_assistant.html +++ b/docs/reference/middleware/assistant/async_assistant.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.assistant.async_assistant API documentation @@ -707,7 +707,7 @@

              -

              Generated by pdoc 0.11.5.

              +

              Generated by pdoc 0.11.6.

              diff --git a/docs/reference/middleware/assistant/index.html b/docs/reference/middleware/assistant/index.html index 857240adb..92f405cad 100644 --- a/docs/reference/middleware/assistant/index.html +++ b/docs/reference/middleware/assistant/index.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.assistant API documentation @@ -664,7 +664,7 @@

              -

              Generated by pdoc 0.11.5.

              +

              Generated by pdoc 0.11.6.

              diff --git a/docs/reference/middleware/async_builtins.html b/docs/reference/middleware/async_builtins.html index eb46581bb..7528dc0bb 100644 --- a/docs/reference/middleware/async_builtins.html +++ b/docs/reference/middleware/async_builtins.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.async_builtins API documentation @@ -205,7 +205,7 @@

              Inherited members

              """Verifies an incoming request by checking the validity of `x-slack-signature`, `x-slack-request-timestamp`, and its body data. - Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack for details. + Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details. """ async def async_process( @@ -232,10 +232,10 @@

              Inherited members

          • Verifies an incoming request by checking the validity of x-slack-signature, x-slack-request-timestamp, and its body data.

            -

            Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack for details.

            +

            Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details.

            Verifies an incoming request by checking the validity of x-slack-signature, x-slack-request-timestamp, and its body data.

            -

            Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack for details.

            +

            Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details.

            Args

            signing_secret
            @@ -293,12 +293,12 @@

            Inherited members

    • A middleware can process request data before other middleware and listener functions.

      Handles ssl_check requests. -Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details.

      +Refer to https://api.slack.com/interactivity/slash-commands for details.

      Args

      verification_token
      The verification token to check -(optional as it's already deprecated - https://docs.slack.dev/authentication/verifying-requests-from-slack#verification_token_deprecation)
      +(optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation)
      base_logger
      The base logger
      @@ -352,7 +352,7 @@

      Inherited members

      A middleware can process request data before other middleware and listener functions.

      Handles url_verification requests.

      -

      Refer to https://docs.slack.dev/reference/events/url_verification for details.

      +

      Refer to https://api.slack.com/events/url_verification for details.

      Args

      base_logger
      @@ -418,7 +418,7 @@

      diff --git a/docs/reference/middleware/async_custom_middleware.html b/docs/reference/middleware/async_custom_middleware.html index 6ef00baaf..d985458ed 100644 --- a/docs/reference/middleware/async_custom_middleware.html +++ b/docs/reference/middleware/async_custom_middleware.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.async_custom_middleware API documentation @@ -166,7 +166,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/middleware/async_middleware.html b/docs/reference/middleware/async_middleware.html index e0e38cf9c..33b4273e7 100644 --- a/docs/reference/middleware/async_middleware.html +++ b/docs/reference/middleware/async_middleware.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.async_middleware API documentation @@ -232,7 +232,7 @@

      diff --git a/docs/reference/middleware/async_middleware_error_handler.html b/docs/reference/middleware/async_middleware_error_handler.html index 617e490c7..e7cd8bb32 100644 --- a/docs/reference/middleware/async_middleware_error_handler.html +++ b/docs/reference/middleware/async_middleware_error_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.async_middleware_error_handler API documentation @@ -234,7 +234,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/middleware/attaching_function_token/async_attaching_function_token.html b/docs/reference/middleware/attaching_function_token/async_attaching_function_token.html index ab8b609a2..1becac04e 100644 --- a/docs/reference/middleware/attaching_function_token/async_attaching_function_token.html +++ b/docs/reference/middleware/attaching_function_token/async_attaching_function_token.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.attaching_function_token.async_attaching_function_token API documentation @@ -107,7 +107,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/middleware/attaching_function_token/attaching_function_token.html b/docs/reference/middleware/attaching_function_token/attaching_function_token.html index f005e8ac1..8eea36647 100644 --- a/docs/reference/middleware/attaching_function_token/attaching_function_token.html +++ b/docs/reference/middleware/attaching_function_token/attaching_function_token.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.attaching_function_token.attaching_function_token API documentation @@ -107,7 +107,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/middleware/attaching_function_token/index.html b/docs/reference/middleware/attaching_function_token/index.html index 107ae09d6..44efd27a2 100644 --- a/docs/reference/middleware/attaching_function_token/index.html +++ b/docs/reference/middleware/attaching_function_token/index.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.attaching_function_token API documentation @@ -124,7 +124,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/middleware/authorization/async_authorization.html b/docs/reference/middleware/authorization/async_authorization.html index aef0b3cd7..9f38ea711 100644 --- a/docs/reference/middleware/authorization/async_authorization.html +++ b/docs/reference/middleware/authorization/async_authorization.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.authorization.async_authorization API documentation @@ -102,7 +102,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/middleware/authorization/async_internals.html b/docs/reference/middleware/authorization/async_internals.html index 483e8c81f..22b709799 100644 --- a/docs/reference/middleware/authorization/async_internals.html +++ b/docs/reference/middleware/authorization/async_internals.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.authorization.async_internals API documentation @@ -60,7 +60,7 @@

      Module slack_bolt.middleware.authorization.async_interna diff --git a/docs/reference/middleware/authorization/async_multi_teams_authorization.html b/docs/reference/middleware/authorization/async_multi_teams_authorization.html index b9bfa138f..50b529f33 100644 --- a/docs/reference/middleware/authorization/async_multi_teams_authorization.html +++ b/docs/reference/middleware/authorization/async_multi_teams_authorization.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.authorization.async_multi_teams_authorization API documentation @@ -216,7 +216,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/middleware/authorization/async_single_team_authorization.html b/docs/reference/middleware/authorization/async_single_team_authorization.html index 2b3c40369..a167d1c68 100644 --- a/docs/reference/middleware/authorization/async_single_team_authorization.html +++ b/docs/reference/middleware/authorization/async_single_team_authorization.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.authorization.async_single_team_authorization API documentation @@ -157,7 +157,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/middleware/authorization/authorization.html b/docs/reference/middleware/authorization/authorization.html index 6922ca354..7ddd4ce41 100644 --- a/docs/reference/middleware/authorization/authorization.html +++ b/docs/reference/middleware/authorization/authorization.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.authorization.authorization API documentation @@ -101,7 +101,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/middleware/authorization/index.html b/docs/reference/middleware/authorization/index.html index f97cc17bb..9f5c3f393 100644 --- a/docs/reference/middleware/authorization/index.html +++ b/docs/reference/middleware/authorization/index.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.authorization API documentation @@ -398,7 +398,7 @@

      diff --git a/docs/reference/middleware/authorization/internals.html b/docs/reference/middleware/authorization/internals.html index 62db9d31e..c64a7e0f3 100644 --- a/docs/reference/middleware/authorization/internals.html +++ b/docs/reference/middleware/authorization/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.authorization.internals API documentation @@ -60,7 +60,7 @@

      Module slack_bolt.middleware.authorization.internals diff --git a/docs/reference/middleware/authorization/multi_teams_authorization.html b/docs/reference/middleware/authorization/multi_teams_authorization.html index 1414820c6..c2a6a7964 100644 --- a/docs/reference/middleware/authorization/multi_teams_authorization.html +++ b/docs/reference/middleware/authorization/multi_teams_authorization.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.authorization.multi_teams_authorization API documentation @@ -213,7 +213,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/middleware/authorization/single_team_authorization.html b/docs/reference/middleware/authorization/single_team_authorization.html index 535b18532..7687be155 100644 --- a/docs/reference/middleware/authorization/single_team_authorization.html +++ b/docs/reference/middleware/authorization/single_team_authorization.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.authorization.single_team_authorization API documentation @@ -171,7 +171,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/middleware/custom_middleware.html b/docs/reference/middleware/custom_middleware.html index 4364973a6..aba9dc14b 100644 --- a/docs/reference/middleware/custom_middleware.html +++ b/docs/reference/middleware/custom_middleware.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.custom_middleware API documentation @@ -156,7 +156,7 @@

      diff --git a/docs/reference/middleware/ignoring_self_events/async_ignoring_self_events.html b/docs/reference/middleware/ignoring_self_events/async_ignoring_self_events.html index 5b0f31653..4d48b16b9 100644 --- a/docs/reference/middleware/ignoring_self_events/async_ignoring_self_events.html +++ b/docs/reference/middleware/ignoring_self_events/async_ignoring_self_events.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.ignoring_self_events.async_ignoring_self_events API documentation @@ -125,7 +125,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/middleware/ignoring_self_events/ignoring_self_events.html b/docs/reference/middleware/ignoring_self_events/ignoring_self_events.html index 2c1a5eff3..111c096c4 100644 --- a/docs/reference/middleware/ignoring_self_events/ignoring_self_events.html +++ b/docs/reference/middleware/ignoring_self_events/ignoring_self_events.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.ignoring_self_events.ignoring_self_events API documentation @@ -170,7 +170,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/middleware/ignoring_self_events/index.html b/docs/reference/middleware/ignoring_self_events/index.html index 9c37fbb89..f81603f4a 100644 --- a/docs/reference/middleware/ignoring_self_events/index.html +++ b/docs/reference/middleware/ignoring_self_events/index.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.ignoring_self_events API documentation @@ -187,7 +187,7 @@

      -

      Generated by pdoc 0.11.5.

      +

      Generated by pdoc 0.11.6.

      diff --git a/docs/reference/middleware/index.html b/docs/reference/middleware/index.html index 7c8daecd1..98aa15c5d 100644 --- a/docs/reference/middleware/index.html +++ b/docs/reference/middleware/index.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware API documentation @@ -639,7 +639,7 @@

      Inherited members

      """Verifies an incoming request by checking the validity of `x-slack-signature`, `x-slack-request-timestamp`, and its body data. - Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack for details. + Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details. Args: signing_secret: The signing secret @@ -688,7 +688,7 @@

      Inherited members

      A middleware can process request data before other middleware and listener functions.

      Verifies an incoming request by checking the validity of x-slack-signature, x-slack-request-timestamp, and its body data.

      -

      Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack for details.

      +

      Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details.

      Args

      signing_secret
      @@ -834,11 +834,11 @@

      Inherited members

      base_logger: Optional[Logger] = None, ): """Handles `ssl_check` requests. - Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details. + Refer to https://api.slack.com/interactivity/slash-commands for details. Args: verification_token: The verification token to check - (optional as it's already deprecated - https://docs.slack.dev/authentication/verifying-requests-from-slack#verification_token_deprecation) + (optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation) base_logger: The base logger """ # noqa: E501 self.verification_token = verification_token @@ -880,12 +880,12 @@

      Inherited members

      A middleware can process request data before other middleware and listener functions.

      Handles slack_bolt.middleware.ssl_check requests. -Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details.

      +Refer to https://api.slack.com/interactivity/slash-commands for details.

      Args

      verification_token
      The verification token to check -(optional as it's already deprecated - https://docs.slack.dev/authentication/verifying-requests-from-slack#verification_token_deprecation)
      +(optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation)

    base_logger
    The base logger
    @@ -931,7 +931,7 @@

    Inherited members

    def __init__(self, base_logger: Optional[Logger] = None): """Handles url_verification requests. - Refer to https://docs.slack.dev/reference/events/url_verification for details. + Refer to https://api.slack.com/events/url_verification for details. Args: base_logger: The base logger @@ -965,7 +965,7 @@

    Inherited members

    A middleware can process request data before other middleware and listener functions.

    Handles url_verification requests.

    -

    Refer to https://docs.slack.dev/reference/events/url_verification for details.

    +

    Refer to https://api.slack.com/events/url_verification for details.

    Args

    base_logger
    @@ -1077,7 +1077,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/middleware/message_listener_matches/async_message_listener_matches.html b/docs/reference/middleware/message_listener_matches/async_message_listener_matches.html index 790669551..9cbee09ca 100644 --- a/docs/reference/middleware/message_listener_matches/async_message_listener_matches.html +++ b/docs/reference/middleware/message_listener_matches/async_message_listener_matches.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.message_listener_matches.async_message_listener_matches API documentation @@ -124,7 +124,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/middleware/message_listener_matches/index.html b/docs/reference/middleware/message_listener_matches/index.html index 340bfca8b..29dfbb861 100644 --- a/docs/reference/middleware/message_listener_matches/index.html +++ b/docs/reference/middleware/message_listener_matches/index.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.message_listener_matches API documentation @@ -141,7 +141,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/middleware/message_listener_matches/message_listener_matches.html b/docs/reference/middleware/message_listener_matches/message_listener_matches.html index 67481a683..35b5bfa7a 100644 --- a/docs/reference/middleware/message_listener_matches/message_listener_matches.html +++ b/docs/reference/middleware/message_listener_matches/message_listener_matches.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.message_listener_matches.message_listener_matches API documentation @@ -124,7 +124,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/middleware/middleware.html b/docs/reference/middleware/middleware.html index f2940d31b..fb05fd3cc 100644 --- a/docs/reference/middleware/middleware.html +++ b/docs/reference/middleware/middleware.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.middleware API documentation @@ -232,7 +232,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/middleware/middleware_error_handler.html b/docs/reference/middleware/middleware_error_handler.html index 8dcce6026..168fd0409 100644 --- a/docs/reference/middleware/middleware_error_handler.html +++ b/docs/reference/middleware/middleware_error_handler.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.middleware_error_handler API documentation @@ -234,7 +234,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/middleware/request_verification/async_request_verification.html b/docs/reference/middleware/request_verification/async_request_verification.html index dfa1b22bf..dc2b20908 100644 --- a/docs/reference/middleware/request_verification/async_request_verification.html +++ b/docs/reference/middleware/request_verification/async_request_verification.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.request_verification.async_request_verification API documentation @@ -59,7 +59,7 @@

    Classes

    """Verifies an incoming request by checking the validity of `x-slack-signature`, `x-slack-request-timestamp`, and its body data. - Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack for details. + Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details. """ async def async_process( @@ -86,10 +86,10 @@

    Classes

    Verifies an incoming request by checking the validity of x-slack-signature, x-slack-request-timestamp, and its body data.

    -

    Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack for details.

    +

    Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details.

    Verifies an incoming request by checking the validity of x-slack-signature, x-slack-request-timestamp, and its body data.

    -

    Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack for details.

    +

    Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details.

    Args

    signing_secret
    @@ -142,7 +142,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/middleware/request_verification/index.html b/docs/reference/middleware/request_verification/index.html index c841a74dc..ec8e6b941 100644 --- a/docs/reference/middleware/request_verification/index.html +++ b/docs/reference/middleware/request_verification/index.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.request_verification API documentation @@ -71,7 +71,7 @@

    Classes

    """Verifies an incoming request by checking the validity of `x-slack-signature`, `x-slack-request-timestamp`, and its body data. - Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack for details. + Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details. Args: signing_secret: The signing secret @@ -120,7 +120,7 @@

    Classes

    A middleware can process request data before other middleware and listener functions.

    Verifies an incoming request by checking the validity of x-slack-signature, x-slack-request-timestamp, and its body data.

    -

    Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack for details.

    +

    Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details.

    Args

    signing_secret
    @@ -176,7 +176,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/middleware/request_verification/request_verification.html b/docs/reference/middleware/request_verification/request_verification.html index 4c778807a..aa5da095f 100644 --- a/docs/reference/middleware/request_verification/request_verification.html +++ b/docs/reference/middleware/request_verification/request_verification.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.request_verification.request_verification API documentation @@ -60,7 +60,7 @@

    Classes

    """Verifies an incoming request by checking the validity of `x-slack-signature`, `x-slack-request-timestamp`, and its body data. - Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack for details. + Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details. Args: signing_secret: The signing secret @@ -109,7 +109,7 @@

    Classes

    A middleware can process request data before other middleware and listener functions.

    Verifies an incoming request by checking the validity of x-slack-signature, x-slack-request-timestamp, and its body data.

    -

    Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack for details.

    +

    Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details.

    Args

    signing_secret
    @@ -159,7 +159,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/middleware/ssl_check/async_ssl_check.html b/docs/reference/middleware/ssl_check/async_ssl_check.html index a8d6bbfcd..eaacf0846 100644 --- a/docs/reference/middleware/ssl_check/async_ssl_check.html +++ b/docs/reference/middleware/ssl_check/async_ssl_check.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.ssl_check.async_ssl_check API documentation @@ -75,12 +75,12 @@

    Classes

    A middleware can process request data before other middleware and listener functions.

    Handles ssl_check requests. -Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details.

    +Refer to https://api.slack.com/interactivity/slash-commands for details.

    Args

    verification_token
    The verification token to check -(optional as it's already deprecated - https://docs.slack.dev/authentication/verifying-requests-from-slack#verification_token_deprecation)
    +(optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation)
    base_logger
    The base logger
    @@ -131,7 +131,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/middleware/ssl_check/index.html b/docs/reference/middleware/ssl_check/index.html index fd800326a..6a6477071 100644 --- a/docs/reference/middleware/ssl_check/index.html +++ b/docs/reference/middleware/ssl_check/index.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.ssl_check API documentation @@ -76,11 +76,11 @@

    Classes

    base_logger: Optional[Logger] = None, ): """Handles `ssl_check` requests. - Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details. + Refer to https://api.slack.com/interactivity/slash-commands for details. Args: verification_token: The verification token to check - (optional as it's already deprecated - https://docs.slack.dev/authentication/verifying-requests-from-slack#verification_token_deprecation) + (optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation) base_logger: The base logger """ # noqa: E501 self.verification_token = verification_token @@ -122,12 +122,12 @@

    Classes

    A middleware can process request data before other middleware and listener functions.

    Handles slack_bolt.middleware.ssl_check.ssl_check requests. -Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details.

    +Refer to https://api.slack.com/interactivity/slash-commands for details.

    Args

    verification_token
    The verification token to check -(optional as it's already deprecated - https://docs.slack.dev/authentication/verifying-requests-from-slack#verification_token_deprecation)
    +(optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation)
    base_logger
    The base logger
    @@ -194,7 +194,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/middleware/ssl_check/ssl_check.html b/docs/reference/middleware/ssl_check/ssl_check.html index 5d34eb280..72b98724a 100644 --- a/docs/reference/middleware/ssl_check/ssl_check.html +++ b/docs/reference/middleware/ssl_check/ssl_check.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.ssl_check.ssl_check API documentation @@ -65,11 +65,11 @@

    Classes

    base_logger: Optional[Logger] = None, ): """Handles `ssl_check` requests. - Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details. + Refer to https://api.slack.com/interactivity/slash-commands for details. Args: verification_token: The verification token to check - (optional as it's already deprecated - https://docs.slack.dev/authentication/verifying-requests-from-slack#verification_token_deprecation) + (optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation) base_logger: The base logger """ # noqa: E501 self.verification_token = verification_token @@ -111,12 +111,12 @@

    Classes

    A middleware can process request data before other middleware and listener functions.

    Handles ssl_check requests. -Refer to https://docs.slack.dev/interactivity/implementing-slash-commands for details.

    +Refer to https://api.slack.com/interactivity/slash-commands for details.

    Args

    verification_token
    The verification token to check -(optional as it's already deprecated - https://docs.slack.dev/authentication/verifying-requests-from-slack#verification_token_deprecation)
    +(optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation)
    base_logger
    The base logger
    @@ -177,7 +177,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/middleware/url_verification/async_url_verification.html b/docs/reference/middleware/url_verification/async_url_verification.html index 460aecf4d..e7fbb82fe 100644 --- a/docs/reference/middleware/url_verification/async_url_verification.html +++ b/docs/reference/middleware/url_verification/async_url_verification.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.url_verification.async_url_verification API documentation @@ -73,7 +73,7 @@

    Classes

    A middleware can process request data before other middleware and listener functions.

    Handles url_verification requests.

    -

    Refer to https://docs.slack.dev/reference/events/url_verification for details.

    +

    Refer to https://api.slack.com/events/url_verification for details.

    Args

    base_logger
    @@ -124,7 +124,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/middleware/url_verification/index.html b/docs/reference/middleware/url_verification/index.html index e3e98f95f..9e08c1699 100644 --- a/docs/reference/middleware/url_verification/index.html +++ b/docs/reference/middleware/url_verification/index.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.url_verification API documentation @@ -70,7 +70,7 @@

    Classes

    def __init__(self, base_logger: Optional[Logger] = None): """Handles url_verification requests. - Refer to https://docs.slack.dev/reference/events/url_verification for details. + Refer to https://api.slack.com/events/url_verification for details. Args: base_logger: The base logger @@ -104,7 +104,7 @@

    Classes

    A middleware can process request data before other middleware and listener functions.

    Handles url_verification requests.

    -

    Refer to https://docs.slack.dev/reference/events/url_verification for details.

    +

    Refer to https://api.slack.com/events/url_verification for details.

    Args

    base_logger
    @@ -158,7 +158,7 @@

    diff --git a/docs/reference/middleware/url_verification/url_verification.html b/docs/reference/middleware/url_verification/url_verification.html index 32dc64d49..e90bf0395 100644 --- a/docs/reference/middleware/url_verification/url_verification.html +++ b/docs/reference/middleware/url_verification/url_verification.html @@ -3,7 +3,7 @@ - + slack_bolt.middleware.url_verification.url_verification API documentation @@ -59,7 +59,7 @@

    Classes

    def __init__(self, base_logger: Optional[Logger] = None): """Handles url_verification requests. - Refer to https://docs.slack.dev/reference/events/url_verification for details. + Refer to https://api.slack.com/events/url_verification for details. Args: base_logger: The base logger @@ -93,7 +93,7 @@

    Classes

    A middleware can process request data before other middleware and listener functions.

    Handles url_verification requests.

    -

    Refer to https://docs.slack.dev/reference/events/url_verification for details.

    +

    Refer to https://api.slack.com/events/url_verification for details.

    Args

    base_logger
    @@ -141,7 +141,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/oauth/async_callback_options.html b/docs/reference/oauth/async_callback_options.html index 40ae06c1f..822867ea8 100644 --- a/docs/reference/oauth/async_callback_options.html +++ b/docs/reference/oauth/async_callback_options.html @@ -3,7 +3,7 @@ - + slack_bolt.oauth.async_callback_options API documentation @@ -279,7 +279,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/oauth/async_internals.html b/docs/reference/oauth/async_internals.html index ba6a31642..2b35a69c9 100644 --- a/docs/reference/oauth/async_internals.html +++ b/docs/reference/oauth/async_internals.html @@ -3,7 +3,7 @@ - + slack_bolt.oauth.async_internals API documentation @@ -120,7 +120,7 @@

    Functions

    diff --git a/docs/reference/oauth/async_oauth_flow.html b/docs/reference/oauth/async_oauth_flow.html index 182973db5..3ccdfd6f0 100644 --- a/docs/reference/oauth/async_oauth_flow.html +++ b/docs/reference/oauth/async_oauth_flow.html @@ -3,7 +3,7 @@ - + slack_bolt.oauth.async_oauth_flow API documentation @@ -803,7 +803,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/oauth/async_oauth_settings.html b/docs/reference/oauth/async_oauth_settings.html index 18b108491..5e6a543c4 100644 --- a/docs/reference/oauth/async_oauth_settings.html +++ b/docs/reference/oauth/async_oauth_settings.html @@ -3,7 +3,7 @@ - + slack_bolt.oauth.async_oauth_settings API documentation @@ -417,7 +417,7 @@

    diff --git a/docs/reference/oauth/callback_options.html b/docs/reference/oauth/callback_options.html index ac2a200b1..7ad3734b3 100644 --- a/docs/reference/oauth/callback_options.html +++ b/docs/reference/oauth/callback_options.html @@ -3,7 +3,7 @@ - + slack_bolt.oauth.callback_options API documentation @@ -299,7 +299,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/oauth/index.html b/docs/reference/oauth/index.html index 6281fbcc1..d118a5e72 100644 --- a/docs/reference/oauth/index.html +++ b/docs/reference/oauth/index.html @@ -3,7 +3,7 @@ - + slack_bolt.oauth API documentation @@ -856,7 +856,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/oauth/internals.html b/docs/reference/oauth/internals.html index e1b239782..3f1b43a7e 100644 --- a/docs/reference/oauth/internals.html +++ b/docs/reference/oauth/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.oauth.internals API documentation @@ -225,7 +225,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/oauth/oauth_flow.html b/docs/reference/oauth/oauth_flow.html index abae18cb5..75aa3cb88 100644 --- a/docs/reference/oauth/oauth_flow.html +++ b/docs/reference/oauth/oauth_flow.html @@ -3,7 +3,7 @@ - + slack_bolt.oauth.oauth_flow API documentation @@ -807,7 +807,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/oauth/oauth_settings.html b/docs/reference/oauth/oauth_settings.html index 0555b761c..1eb2ab7dd 100644 --- a/docs/reference/oauth/oauth_settings.html +++ b/docs/reference/oauth/oauth_settings.html @@ -3,7 +3,7 @@ - + slack_bolt.oauth.oauth_settings API documentation @@ -415,7 +415,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/request/async_internals.html b/docs/reference/request/async_internals.html index 635bdf586..35a250c8d 100644 --- a/docs/reference/request/async_internals.html +++ b/docs/reference/request/async_internals.html @@ -3,7 +3,7 @@ - + slack_bolt.request.async_internals API documentation @@ -129,7 +129,7 @@

    Functions

    diff --git a/docs/reference/request/async_request.html b/docs/reference/request/async_request.html index c08c47ec9..a3658710a 100644 --- a/docs/reference/request/async_request.html +++ b/docs/reference/request/async_request.html @@ -3,7 +3,7 @@ - + slack_bolt.request.async_request API documentation @@ -238,7 +238,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/request/index.html b/docs/reference/request/index.html index 61908105d..06d9b4933 100644 --- a/docs/reference/request/index.html +++ b/docs/reference/request/index.html @@ -3,7 +3,7 @@ - + slack_bolt.request API documentation @@ -37,7 +37,7 @@

    Module slack_bolt.request

    Incoming request from Slack through either HTTP request or Socket Mode connection.

    -

    Refer to https://docs.slack.dev/apis/events-api/ for the two types of connections. +

    Refer to https://api.slack.com/apis/connections for the two types of connections. This interface encapsulates the difference between the two.

    @@ -272,7 +272,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/request/internals.html b/docs/reference/request/internals.html index 68fa34dae..bc13932ec 100644 --- a/docs/reference/request/internals.html +++ b/docs/reference/request/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.request.internals API documentation @@ -601,7 +601,7 @@

    Functions

    diff --git a/docs/reference/request/payload_utils.html b/docs/reference/request/payload_utils.html index 21490bdc8..4fe75fd81 100644 --- a/docs/reference/request/payload_utils.html +++ b/docs/reference/request/payload_utils.html @@ -3,7 +3,7 @@ - + slack_bolt.request.payload_utils API documentation @@ -622,7 +622,7 @@

    Functions

    diff --git a/docs/reference/request/request.html b/docs/reference/request/request.html index dfd0fa3f1..870b65f08 100644 --- a/docs/reference/request/request.html +++ b/docs/reference/request/request.html @@ -3,7 +3,7 @@ - + slack_bolt.request.request API documentation @@ -237,7 +237,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/response/index.html b/docs/reference/response/index.html index bc86a6770..c986c7150 100644 --- a/docs/reference/response/index.html +++ b/docs/reference/response/index.html @@ -3,7 +3,7 @@ - + slack_bolt.response API documentation @@ -39,7 +39,7 @@

    Module slack_bolt.response

    This interface represents Bolt's synchronous response to Slack.

    In Socket Mode, the response data can be transformed to a WebSocket message. In the HTTP endpoint mode, the response data becomes an HTTP response data.

    -

    Refer to https://docs.slack.dev/apis/events-api/ for the two types of connections.

    +

    Refer to https://api.slack.com/apis/connections for the two types of connections.

    Sub-modules

    @@ -227,7 +227,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/response/response.html b/docs/reference/response/response.html index 65151cf64..5044254e8 100644 --- a/docs/reference/response/response.html +++ b/docs/reference/response/response.html @@ -3,7 +3,7 @@ - + slack_bolt.response.response API documentation @@ -211,7 +211,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/util/async_utils.html b/docs/reference/util/async_utils.html index f7ce77489..f74d8f0ac 100644 --- a/docs/reference/util/async_utils.html +++ b/docs/reference/util/async_utils.html @@ -3,7 +3,7 @@ - + slack_bolt.util.async_utils API documentation @@ -85,7 +85,7 @@

    Functions

    diff --git a/docs/reference/util/index.html b/docs/reference/util/index.html index 54f1dbd8d..6eadaacb9 100644 --- a/docs/reference/util/index.html +++ b/docs/reference/util/index.html @@ -3,7 +3,7 @@ - + slack_bolt.util API documentation @@ -78,7 +78,7 @@

    Sub-modules

    diff --git a/docs/reference/util/utils.html b/docs/reference/util/utils.html index d22c1f581..33e6b1de2 100644 --- a/docs/reference/util/utils.html +++ b/docs/reference/util/utils.html @@ -3,7 +3,7 @@ - + slack_bolt.util.utils API documentation @@ -268,7 +268,7 @@

    Returns

    diff --git a/docs/reference/version.html b/docs/reference/version.html index 404f38d79..c4a0f9b83 100644 --- a/docs/reference/version.html +++ b/docs/reference/version.html @@ -3,7 +3,7 @@ - + slack_bolt.version API documentation @@ -61,7 +61,7 @@

    Module slack_bolt.version

    diff --git a/docs/reference/workflows/index.html b/docs/reference/workflows/index.html index 3e43b0701..caaffe74d 100644 --- a/docs/reference/workflows/index.html +++ b/docs/reference/workflows/index.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows API documentation @@ -43,7 +43,7 @@

    Module slack_bolt.workflows

  • slack_bolt.workflows.step.utilities
  • slack_bolt.workflows.step.async_step (if you use asyncio-based AsyncApp)
  • -

    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    +

    Refer to https://api.slack.com/workflows/steps for details.

    Sub-modules

    @@ -80,7 +80,7 @@

    Sub-modules

    diff --git a/docs/reference/workflows/step/async_step.html b/docs/reference/workflows/step/async_step.html index 0c08a9707..3bf597134 100644 --- a/docs/reference/workflows/step/async_step.html +++ b/docs/reference/workflows/step/async_step.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.async_step API documentation @@ -78,7 +78,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Args: callback_id: The callback_id for this step from app @@ -124,7 +124,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt """ return AsyncWorkflowStepBuilder(callback_id, base_logger=base_logger) @@ -200,7 +200,7 @@

    Classes

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    Args

    callback_id
    @@ -252,7 +252,7 @@

    Static methods

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    @@ -267,7 +267,7 @@

    Static methods

    class AsyncWorkflowStepBuilder:
         """Steps from apps
    -    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.
    +    Refer to https://api.slack.com/workflows/steps for details.
         """
     
         callback_id: Union[str, Pattern]
    @@ -285,7 +285,7 @@ 

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt This builder is supposed to be used as decorator. @@ -327,7 +327,7 @@

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new edit listener with details. @@ -380,7 +380,7 @@

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new save listener with details. @@ -433,7 +433,7 @@

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new execute listener with details. @@ -480,7 +480,7 @@

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. @@ -555,10 +555,10 @@

    Static methods

    return _middleware

    Steps from apps -Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    +Refer to https://api.slack.com/workflows/steps for details.

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    This builder is supposed to be used as decorator.

    my_step = AsyncWorkflowStep.builder("my_step")
     @my_step.edit
    @@ -659,7 +659,7 @@ 

    Methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. @@ -685,7 +685,7 @@

    Methods

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object.

    Returns

    @@ -709,7 +709,7 @@

    Returns

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new edit listener with details. @@ -754,7 +754,7 @@

    Returns

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    Registers a new edit listener with details.

    You can use this method as decorator as well.

    @my_step.edit
    @@ -799,7 +799,7 @@ 

    Args

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new execute listener with details. @@ -844,7 +844,7 @@

    Args

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    Registers a new execute listener with details.

    You can use this method as decorator as well.

    @my_step.execute
    @@ -889,7 +889,7 @@ 

    Args

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new save listener with details. @@ -934,7 +934,7 @@

    Args

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    Registers a new save listener with details.

    You can use this method as decorator as well.

    @my_step.save
    @@ -1007,7 +1007,7 @@ 

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/workflows/step/async_step_middleware.html b/docs/reference/workflows/step/async_step_middleware.html index fff1cda5c..a174b9c11 100644 --- a/docs/reference/workflows/step/async_step_middleware.html +++ b/docs/reference/workflows/step/async_step_middleware.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.async_step_middleware API documentation @@ -140,7 +140,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/workflows/step/index.html b/docs/reference/workflows/step/index.html index ce29a210f..62d989976 100644 --- a/docs/reference/workflows/step/index.html +++ b/docs/reference/workflows/step/index.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step API documentation @@ -103,7 +103,7 @@

    Classes

    app.step(ws) This utility is a thin wrapper of workflows.stepCompleted API method. - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. + Refer to https://api.slack.com/methods/workflows.stepCompleted for details. """ def __init__(self, *, client: WebClient, body: dict): @@ -135,7 +135,7 @@

    Classes

    app.step(ws)

    This utility is a thin wrapper of workflows.stepCompleted API method. -Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    +Refer to https://api.slack.com/methods/workflows.stepCompleted for details.

    class Configure @@ -174,7 +174,7 @@

    Classes

    ) app.step(ws) - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. + Refer to https://api.slack.com/workflows/steps for details. """ def __init__(self, *, callback_id: str, client: WebClient, body: dict): @@ -219,7 +219,7 @@

    Classes

    ) app.step(ws)
    -

    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    +

    Refer to https://api.slack.com/workflows/steps for details.

    class Fail @@ -248,7 +248,7 @@

    Classes

    app.step(ws) This utility is a thin wrapper of workflows.stepFailed API method. - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. + Refer to https://api.slack.com/methods/workflows.stepFailed for details. """ def __init__(self, *, client: WebClient, body: dict): @@ -281,7 +281,7 @@

    Classes

    app.step(ws)

    This utility is a thin wrapper of workflows.stepFailed API method. -Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    +Refer to https://api.slack.com/methods/workflows.stepFailed for details.

    class Update @@ -329,7 +329,7 @@

    Classes

    app.step(ws) This utility is a thin wrapper of workflows.stepFailed API method. - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. + Refer to https://api.slack.com/methods/workflows.updateStep for details. """ def __init__(self, *, client: WebClient, body: dict): @@ -377,7 +377,7 @@

    Classes

    app.step(ws)

    This utility is a thin wrapper of workflows.stepFailed API method. -Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    +Refer to https://api.slack.com/methods/workflows.updateStep for details.

    class WorkflowStep @@ -411,7 +411,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Args: callback_id: The callback_id for this step from app @@ -453,7 +453,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt """ return WorkflowStepBuilder( callback_id, @@ -546,7 +546,7 @@

    Classes

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    Args

    callback_id
    @@ -598,7 +598,7 @@

    Static methods

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    @@ -732,7 +732,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/workflows/step/internals.html b/docs/reference/workflows/step/internals.html index f2067677f..c5fda1012 100644 --- a/docs/reference/workflows/step/internals.html +++ b/docs/reference/workflows/step/internals.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.internals API documentation @@ -60,7 +60,7 @@

    Module slack_bolt.workflows.step.internals

    diff --git a/docs/reference/workflows/step/step.html b/docs/reference/workflows/step/step.html index efaaad899..6e1567bd6 100644 --- a/docs/reference/workflows/step/step.html +++ b/docs/reference/workflows/step/step.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.step API documentation @@ -78,7 +78,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Args: callback_id: The callback_id for this step from app @@ -120,7 +120,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt """ return WorkflowStepBuilder( callback_id, @@ -213,7 +213,7 @@

    Classes

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    Args

    callback_id
    @@ -265,7 +265,7 @@

    Static methods

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    @@ -280,7 +280,7 @@

    Static methods

    class WorkflowStepBuilder:
         """Steps from apps
    -    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.
    +    Refer to https://api.slack.com/workflows/steps for details.
         """
     
         callback_id: Union[str, Pattern]
    @@ -298,7 +298,7 @@ 

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt This builder is supposed to be used as decorator. @@ -340,7 +340,7 @@

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new edit listener with details. @@ -394,7 +394,7 @@

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new save listener with details. @@ -447,7 +447,7 @@

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new execute listener with details. @@ -494,7 +494,7 @@

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. @@ -584,10 +584,10 @@

    Static methods

    return _middleware

    Steps from apps -Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    +Refer to https://api.slack.com/workflows/steps for details.

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    This builder is supposed to be used as decorator.

    my_step = WorkflowStep.builder("my_step")
     @my_step.edit
    @@ -703,7 +703,7 @@ 

    Methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. @@ -729,7 +729,7 @@

    Methods

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object.

    Returns

    @@ -753,7 +753,7 @@

    Returns

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new edit listener with details. @@ -799,7 +799,7 @@

    Returns

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    Registers a new edit listener with details.

    You can use this method as decorator as well.

    @my_step.edit
    @@ -844,7 +844,7 @@ 

    Args

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new execute listener with details. @@ -889,7 +889,7 @@

    Args

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    Registers a new execute listener with details.

    You can use this method as decorator as well.

    @my_step.execute
    @@ -934,7 +934,7 @@ 

    Args

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://docs.slack.dev/workflows/workflow-steps + Use new custom steps: https://api.slack.com/automation/functions/custom-bolt Registers a new save listener with details. @@ -979,7 +979,7 @@

    Args

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://docs.slack.dev/workflows/workflow-steps

    +Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    Registers a new save listener with details.

    You can use this method as decorator as well.

    @my_step.save
    @@ -1052,7 +1052,7 @@ 

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/workflows/step/step_middleware.html b/docs/reference/workflows/step/step_middleware.html index 58a1c6194..2ac62dd93 100644 --- a/docs/reference/workflows/step/step_middleware.html +++ b/docs/reference/workflows/step/step_middleware.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.step_middleware API documentation @@ -143,7 +143,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/workflows/step/utilities/async_complete.html b/docs/reference/workflows/step/utilities/async_complete.html index 8a8790900..8e95cc267 100644 --- a/docs/reference/workflows/step/utilities/async_complete.html +++ b/docs/reference/workflows/step/utilities/async_complete.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.utilities.async_complete API documentation @@ -76,7 +76,7 @@

    Classes

    app.step(ws) This utility is a thin wrapper of workflows.stepCompleted API method. - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. + Refer to https://api.slack.com/methods/workflows.stepCompleted for details. """ def __init__(self, *, client: AsyncWebClient, body: dict): @@ -108,7 +108,7 @@

    Classes

    app.step(ws)

    This utility is a thin wrapper of workflows.stepCompleted API method. -Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    +Refer to https://api.slack.com/methods/workflows.stepCompleted for details.

    @@ -134,7 +134,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/workflows/step/utilities/async_configure.html b/docs/reference/workflows/step/utilities/async_configure.html index 3151e71bd..008c35ab5 100644 --- a/docs/reference/workflows/step/utilities/async_configure.html +++ b/docs/reference/workflows/step/utilities/async_configure.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.utilities.async_configure API documentation @@ -83,7 +83,7 @@

    Classes

    ) app.step(ws) - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. + Refer to https://api.slack.com/workflows/steps for details. """ def __init__(self, *, callback_id: str, client: AsyncWebClient, body: dict): @@ -131,7 +131,7 @@

    Classes

    ) app.step(ws)
    -

    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    +

    Refer to https://api.slack.com/workflows/steps for details.

    @@ -157,7 +157,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/workflows/step/utilities/async_fail.html b/docs/reference/workflows/step/utilities/async_fail.html index 1206c45a6..b27c36251 100644 --- a/docs/reference/workflows/step/utilities/async_fail.html +++ b/docs/reference/workflows/step/utilities/async_fail.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.utilities.async_fail API documentation @@ -73,7 +73,7 @@

    Classes

    app.step(ws) This utility is a thin wrapper of workflows.stepFailed API method. - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. + Refer to https://api.slack.com/methods/workflows.stepFailed for details. """ def __init__(self, *, client: AsyncWebClient, body: dict): @@ -106,7 +106,7 @@

    Classes

    app.step(ws)

    This utility is a thin wrapper of workflows.stepFailed API method. -Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    +Refer to https://api.slack.com/methods/workflows.stepFailed for details.

    @@ -132,7 +132,7 @@

    diff --git a/docs/reference/workflows/step/utilities/async_update.html b/docs/reference/workflows/step/utilities/async_update.html index 0d1cad162..bfb210fc3 100644 --- a/docs/reference/workflows/step/utilities/async_update.html +++ b/docs/reference/workflows/step/utilities/async_update.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.utilities.async_update API documentation @@ -92,7 +92,7 @@

    Classes

    app.step(ws) This utility is a thin wrapper of workflows.stepFailed API method. - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. + Refer to https://api.slack.com/methods/workflows.updateStep for details. """ def __init__(self, *, client: AsyncWebClient, body: dict): @@ -140,7 +140,7 @@

    Classes

    app.step(ws)

    This utility is a thin wrapper of workflows.stepFailed API method. -Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    +Refer to https://api.slack.com/methods/workflows.updateStep for details.

    @@ -166,7 +166,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/workflows/step/utilities/complete.html b/docs/reference/workflows/step/utilities/complete.html index c15d51e9c..f1cf11f56 100644 --- a/docs/reference/workflows/step/utilities/complete.html +++ b/docs/reference/workflows/step/utilities/complete.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.utilities.complete API documentation @@ -76,7 +76,7 @@

    Classes

    app.step(ws) This utility is a thin wrapper of workflows.stepCompleted API method. - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. + Refer to https://api.slack.com/methods/workflows.stepCompleted for details. """ def __init__(self, *, client: WebClient, body: dict): @@ -108,7 +108,7 @@

    Classes

    app.step(ws)

    This utility is a thin wrapper of workflows.stepCompleted API method. -Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    +Refer to https://api.slack.com/methods/workflows.stepCompleted for details.

    @@ -134,7 +134,7 @@

    diff --git a/docs/reference/workflows/step/utilities/configure.html b/docs/reference/workflows/step/utilities/configure.html index 2c1aeadbf..26d646cf2 100644 --- a/docs/reference/workflows/step/utilities/configure.html +++ b/docs/reference/workflows/step/utilities/configure.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.utilities.configure API documentation @@ -83,7 +83,7 @@

    Classes

    ) app.step(ws) - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. + Refer to https://api.slack.com/workflows/steps for details. """ def __init__(self, *, callback_id: str, client: WebClient, body: dict): @@ -128,7 +128,7 @@

    Classes

    ) app.step(ws)
    -

    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    +

    Refer to https://api.slack.com/workflows/steps for details.

    @@ -154,7 +154,7 @@

    diff --git a/docs/reference/workflows/step/utilities/fail.html b/docs/reference/workflows/step/utilities/fail.html index 4c4091fd5..00d0be83d 100644 --- a/docs/reference/workflows/step/utilities/fail.html +++ b/docs/reference/workflows/step/utilities/fail.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.utilities.fail API documentation @@ -73,7 +73,7 @@

    Classes

    app.step(ws) This utility is a thin wrapper of workflows.stepFailed API method. - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. + Refer to https://api.slack.com/methods/workflows.stepFailed for details. """ def __init__(self, *, client: WebClient, body: dict): @@ -106,7 +106,7 @@

    Classes

    app.step(ws)

    This utility is a thin wrapper of workflows.stepFailed API method. -Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    +Refer to https://api.slack.com/methods/workflows.stepFailed for details.

    @@ -132,7 +132,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/docs/reference/workflows/step/utilities/index.html b/docs/reference/workflows/step/utilities/index.html index 1594bacb6..54261ea96 100644 --- a/docs/reference/workflows/step/utilities/index.html +++ b/docs/reference/workflows/step/utilities/index.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.utilities API documentation @@ -127,7 +127,7 @@

    Sub-modules

    diff --git a/docs/reference/workflows/step/utilities/update.html b/docs/reference/workflows/step/utilities/update.html index c93fc7f21..9899448f9 100644 --- a/docs/reference/workflows/step/utilities/update.html +++ b/docs/reference/workflows/step/utilities/update.html @@ -3,7 +3,7 @@ - + slack_bolt.workflows.step.utilities.update API documentation @@ -92,7 +92,7 @@

    Classes

    app.step(ws) This utility is a thin wrapper of workflows.stepFailed API method. - Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. + Refer to https://api.slack.com/methods/workflows.updateStep for details. """ def __init__(self, *, client: WebClient, body: dict): @@ -140,7 +140,7 @@

    Classes

    app.step(ws)

    This utility is a thin wrapper of workflows.stepFailed API method. -Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    +Refer to https://api.slack.com/methods/workflows.updateStep for details.

    @@ -166,7 +166,7 @@

    -

    Generated by pdoc 0.11.5.

    +

    Generated by pdoc 0.11.6.

    diff --git a/scripts/generate_api_docs.sh b/scripts/generate_api_docs.sh index 459476122..f8ea39d0d 100755 --- a/scripts/generate_api_docs.sh +++ b/scripts/generate_api_docs.sh @@ -6,5 +6,9 @@ cd ${script_dir}/.. pip install -U pdoc3 rm -rf docs/reference -pdoc reference --html -o docs + +pdoc slack_bolt --html -o docs/reference +cp -R docs/reference/slack_bolt/* docs/reference/ +rm -rf docs/reference/slack_bolt + open docs/reference/index.html diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 03d768130..b996e1572 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,3 +1,3 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.23.0" +__version__ = "1.24.0" From 9e0b3ed2665d6bfee58f388d3879631e8ae102f3 Mon Sep 17 00:00:00 2001 From: Luke Russell <31357343+lukegalbraithrussell@users.noreply.github.com> Date: Mon, 8 Sep 2025 10:35:44 -0700 Subject: [PATCH 643/719] docs: updates gif and enterprise paths (#1358) --- docs/english/concepts/authenticating-oauth.md | 2 +- docs/english/tutorial/modals/modals.md | 2 +- docs/img/announce.gif | Bin 0 -> 260652 bytes docs/japanese/concepts/authenticating-oauth.md | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 docs/img/announce.gif diff --git a/docs/english/concepts/authenticating-oauth.md b/docs/english/concepts/authenticating-oauth.md index 88b422949..4ce9b205b 100644 --- a/docs/english/concepts/authenticating-oauth.md +++ b/docs/english/concepts/authenticating-oauth.md @@ -6,7 +6,7 @@ Bolt for Python will create a **Redirect URL** `slack/oauth_redirect`, which Sla Bolt for Python will also create a `slack/install` route, where you can find an **Add to Slack** button for your app to perform direct installs of your app. If you need any additional authorizations (user tokens) from users inside a team when your app is already installed or a reason to dynamically generate an install URL, you can pass your own custom URL generator to `oauth_settings` as `authorize_url_generator`. -Bolt for Python automatically includes support for [org wide installations](/enterprise-grid/) in version `1.1.0+`. Org wide installations can be enabled in your app configuration settings under **Org Level Apps**. +Bolt for Python automatically includes support for [org wide installations](/enterprise) in version `1.1.0+`. Org wide installations can be enabled in your app configuration settings under **Org Level Apps**. To learn more about the OAuth installation flow with Slack, [read the API documentation](/authentication/installing-with-oauth). diff --git a/docs/english/tutorial/modals/modals.md b/docs/english/tutorial/modals/modals.md index ee6d1e0d8..d25470b97 100644 --- a/docs/english/tutorial/modals/modals.md +++ b/docs/english/tutorial/modals/modals.md @@ -9,7 +9,7 @@ GitHub Codespaces is an online IDE that allows you to work on code and host your At the end of this tutorial, your final app will look like this: -![announce](https://github.com/user-attachments/assets/0bf1c2f0-4b22-4c9c-98b3-b21e9bcc14a8) +![announce](/img/bolt-python/announce.gif) And will make use of these Slack concepts: * [**Block Kit**](/block-kit/) is a UI framework for Slack apps that allows you to create beautiful, interactive messages within Slack. If you've ever seen a message in Slack with buttons or a select menu, that's Block Kit. diff --git a/docs/img/announce.gif b/docs/img/announce.gif new file mode 100644 index 0000000000000000000000000000000000000000..7602784cead5bdc59bd1cb94e45e9f7300856f85 GIT binary patch literal 260652 zcmV($K;yqhNk%w1VT1!D0(SraA^!_bMO0HmK~P09E-(WD0000X`2+wP0000i00000 zgaaf3hXVov5)29w4G+IABp3}O8x}Gi86h4aC?gs+CKx+08Yd; zU<3j~J48S{WKBXUNkTJOM=DrIHD6FITTwh@Oe|zeIAK#SX<0aQNjh^`Id@|`NJmIb zOHx!zM^H{sSyM(>S6E(NU|eKVVNOY4Oi*cBLu6l7d`m=kSweYQUSeHgZD2xbWLbG< zM0#gce{e*5a#d$%XKZY8Yj|vZU~O=2aCdfh6J?`6T8BJik1BJiL0W};e1;c-WH^#| zB%*RJw0<+Ec`&nmM5%u}gRecZgEhqPNSlI0u7pXqidCYFUZ|5%w2NN3lz)JLZnK

    P%vJ%w#Nh+9a7X-0@@T8VZ_i+NR)X-kx4 zQImU3m3mZ7wAzb4#XyiwAfPR4MYmk|RSCoci zmyLIwlW?SoTc(I*tB7@}m1U=wce09UwTXDNnQOL~cetf=?XoY#mv+Ocd+xbL@xfW| z$##c_hmDPpgOr4qhKrDnkeHX4o}QzewTytgtgV!fqMV_urJ1F-imAMmxu=7(s-3;E zjJdI!r>3W`uCS`Qr?jl6v97VYw5YeYw~@BgzP`YO$*qgXv4_&Klf$%^*1WRDld#ON zirw~@;P$1=z^};OsMy4{*vP%#(4o!ZyW!BS=J~^rklC28$*G3Pt(nQShRU~;(7TJ+ zxRlGIsKmRe!@9TCt-RE=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;BmdV*DIKY$uLv_&^6b@G*h|2*M9^puh+)u@8OZ10nYri$D<3ZVy#_9C7fZ~3PT{^sx z+~SPQ9Pc>3$cBz`fP)Sq@PjtA;S6_gK^XVQM?Vg7ALrov1Kc33QTTnJ5~P9~ufEDD z+;o)uA&vhwS*>mUAPg3vDqK!BM8iFb{cH%?_7OjBwwHv?7hUhSHqx^p$Xm8#ldFC0 zh9uiL#E}hQh(H_ls0SSYAOIB5K^+P4>{8bw&T+U0vl2QSRH_`{3f50)vBM^94nIvx zD>FHrw~_50-M|JNv_N-zkN^M^7y%u! zk@}^jJ@>rt{lw~~4s2*)4%(Q9J+wf94vc^cxc7a%cJKV?OJ84}n+F~IPt*nmQne-@#B9O!~CND?h56(~r9HE4r3h=UYZK{6ORJmP~t2!uf>ghNP#MQDUa zh=fU~gi5GE3}^vg;00hHg;VGSUtj?_h=p0Gg2#0Z~5|5yO7GQ>ApayCn24;ALZ0Lu72#5vfhH^-Vg?Jrwn1EkUhH9`6 z0;C>Tk%+d&uEV^DU%(6j|I4h1_6mv zIEzJ*3Im8zw`fNruqFbST1L^4U&0h0IgSsBh|xn^w>U}_a)~zd0Z0)XUt<453b0=Y z89i%qiB6e11-On=Vn+i=mB7@I$w7%OIe{-TlWz%^7g3W0ScYNH3WiOG}- zkUx1riBLisS;3A3NSW+tnTU9qhQkyG`H{`B!H>YNh+EZM!BB^2$5JpC5^`prXrA0*!zO2Kt Date: Tue, 9 Sep 2025 09:56:26 -0400 Subject: [PATCH 644/719] chore: remove 3.6 support (#1359) --- .github/maintainers_guide.md | 4 ++-- README.md | 4 ++-- docs/english/building-an-app.md | 2 +- docs/english/getting-started.md | 4 ++-- docs/english/tutorial/ai-chatbot/ai-chatbot.md | 2 +- .../custom-steps-for-jira/custom-steps-for-jira.md | 2 +- docs/japanese/getting-started.md | 2 +- pyproject.toml | 5 ++--- requirements/adapter.txt | 6 ++---- requirements/adapter_testing.txt | 2 +- requirements/tools.txt | 2 +- scripts/format.sh | 10 ++++++++++ scripts/install_all_and_run_tests.sh | 8 +------- slack_bolt/async_app.py | 2 +- slack_bolt/listener_matcher/builtins.py | 10 +++------- slack_bolt/logger/messages.py | 2 +- slack_bolt/util/utils.py | 14 +------------- 17 files changed, 33 insertions(+), 48 deletions(-) create mode 100755 scripts/format.sh diff --git a/.github/maintainers_guide.md b/.github/maintainers_guide.md index 69026d602..352398072 100644 --- a/.github/maintainers_guide.md +++ b/.github/maintainers_guide.md @@ -25,8 +25,8 @@ $ pyenv local 3.8.5 $ pyenv versions system - 3.6.10 - 3.7.7 + 3.7.17 + 3.13.7 * 3.8.5 (set by /path-to-bolt-python/.python-version) $ pyenv rehash diff --git a/README.md b/README.md index 10a44a0e5..b3f78adb0 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ A Python framework to build Slack apps in a flash with the latest platform featu ## Setup ```bash -# Python 3.6+ required +# Python 3.7+ required python -m venv .venv source .venv/bin/activate @@ -153,7 +153,7 @@ Most of the app's functionality will be inside listener functions (the `fn` para If you'd prefer to build your app with [asyncio](https://docs.python.org/3/library/asyncio.html), you can import the [AIOHTTP](https://docs.aiohttp.org/en/stable/) library and call the `AsyncApp` constructor. Within async apps, you can use the async/await pattern. ```bash -# Python 3.6+ required +# Python 3.7+ required python -m venv .venv source .venv/bin/activate diff --git a/docs/english/building-an-app.md b/docs/english/building-an-app.md index 87b26163b..301cc52c6 100644 --- a/docs/english/building-an-app.md +++ b/docs/english/building-an-app.md @@ -72,7 +72,7 @@ $ mkdir first-bolt-app $ cd first-bolt-app ``` -Next, we recommend using a [Python virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment) to manage your project's dependencies. This is a great way to prevent conflicts with your system's Python packages. Let's create and activate a new virtual environment with [Python 3.6 or later](https://www.python.org/downloads/): +Next, we recommend using a [Python virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment) to manage your project's dependencies. This is a great way to prevent conflicts with your system's Python packages. Let's create and activate a new virtual environment with [Python 3.7 or later](https://www.python.org/downloads/): ```sh $ python3 -m venv .venv diff --git a/docs/english/getting-started.md b/docs/english/getting-started.md index ebdf47189..a198736bc 100644 --- a/docs/english/getting-started.md +++ b/docs/english/getting-started.md @@ -21,7 +21,7 @@ In search of the complete guide to building an app from scratch? Check out the [ A few tools are needed for the following steps. We recommend using the [**Slack CLI**](/tools/slack-cli/) for the smoothest experience, but other options remain available. -You can also begin by installing git and downloading [Python 3.6 or later](https://www.python.org/downloads/), or the latest stable version of Python. Refer to [Python's setup and building guide](https://devguide.python.org/getting-started/setup-building/) for more details. +You can also begin by installing git and downloading [Python 3.7 or later](https://www.python.org/downloads/), or the latest stable version of Python. Refer to [Python's setup and building guide](https://devguide.python.org/getting-started/setup-building/) for more details. Install the latest version of the Slack CLI to get started: @@ -83,7 +83,7 @@ Outlines of a project are taking shape, so we can move on to running the app! -We recommend using a [Python virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment) to manage your project's dependencies. This is a great way to prevent conflicts with your system's Python packages. Let's create and activate a new virtual environment with [Python 3.6 or later](https://www.python.org/downloads/): +We recommend using a [Python virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment) to manage your project's dependencies. This is a great way to prevent conflicts with your system's Python packages. Let's create and activate a new virtual environment with [Python 3.7 or later](https://www.python.org/downloads/): ```sh $ python3 -m venv .venv diff --git a/docs/english/tutorial/ai-chatbot/ai-chatbot.md b/docs/english/tutorial/ai-chatbot/ai-chatbot.md index fa4da90a7..9da54c149 100644 --- a/docs/english/tutorial/ai-chatbot/ai-chatbot.md +++ b/docs/english/tutorial/ai-chatbot/ai-chatbot.md @@ -13,7 +13,7 @@ In this tutorial, you'll learn how to bring the power of AI into your Slack work Before getting started, you will need the following: * a development workspace where you have permissions to install apps. If you don’t have a workspace, go ahead and set that up now — you can [go here](https://slack.com/get-started#create) to create one, or you can join the [Developer Program](https://api.slack.com/developer-program) and provision a sandbox with access to all Slack features for free. -* a development environment with [Python 3.6](https://www.python.org/downloads/) or later. +* a development environment with [Python 3.7](https://www.python.org/downloads/) or later. * an Anthropic or OpenAI account with sufficient credits, and in which you have generated a secret key. **Skip to the code** diff --git a/docs/english/tutorial/custom-steps-for-jira/custom-steps-for-jira.md b/docs/english/tutorial/custom-steps-for-jira/custom-steps-for-jira.md index f310e75cc..d74b82b8e 100644 --- a/docs/english/tutorial/custom-steps-for-jira/custom-steps-for-jira.md +++ b/docs/english/tutorial/custom-steps-for-jira/custom-steps-for-jira.md @@ -12,7 +12,7 @@ In this tutorial, you'll learn how to configure custom steps for use with JIRA. Before getting started, you will need the following: * a development workspace where you have permissions to install apps. If you don’t have a workspace, go ahead and set that up now—you can [go here](https://slack.com/get-started#create) to create one, or you can join the [Developer Program](https://api.slack.com/developer-program) and provision a sandbox with access to all Slack features for free. -* a development environment with [Python 3.6](https://www.python.org/downloads/) or later. +* a development environment with [Python 3.7](https://www.python.org/downloads/) or later. **Skip to the code** If you'd rather skip the tutorial and just head straight to the code, you can use our [Bolt for Python JIRA functions sample](https://github.com/slack-samples/bolt-python-jira-functions) as a template. diff --git a/docs/japanese/getting-started.md b/docs/japanese/getting-started.md index 2ec34d193..30538bf94 100644 --- a/docs/japanese/getting-started.md +++ b/docs/japanese/getting-started.md @@ -64,7 +64,7 @@ mkdir first-bolt-app cd first-bolt-app ``` -次に、プロジェクトの依存ライブラリを管理する方法として、[Python 仮想環境](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment)を使ったおすすめの方法を紹介します。これはシステム Python に存在するパッケージとのコンフリクトを防ぐために推奨されている優れた方法です。[Python 3.6 以降](https://www.python.org/downloads/)の仮想環境を作成し、アクティブにしてみましょう。 +次に、プロジェクトの依存ライブラリを管理する方法として、[Python 仮想環境](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment)を使ったおすすめの方法を紹介します。これはシステム Python に存在するパッケージとのコンフリクトを防ぐために推奨されている優れた方法です。[Python 3.7 以降](https://www.python.org/downloads/)の仮想環境を作成し、アクティブにしてみましょう。 ```shell python3 -m venv .venv diff --git a/pyproject.toml b/pyproject.toml index 5ce2c62bc..07b338300 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools", "pytest-runner==6.0.1", "wheel"] +requires = ["setuptools", "wheel"] build-backend = "setuptools.build_meta" [project] @@ -8,7 +8,6 @@ dynamic = ["version", "readme", "dependencies", "authors"] description = "The Bolt Framework for Python" license = { text = "MIT" } classifiers = [ - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", @@ -20,7 +19,7 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ] -requires-python = ">=3.6" +requires-python = ">=3.7" [project.urls] diff --git a/requirements/adapter.txt b/requirements/adapter.txt index b8cadb510..8fd5cd33e 100644 --- a/requirements/adapter.txt +++ b/requirements/adapter.txt @@ -3,8 +3,7 @@ # used only under slack_bolt/adapter boto3<=2 bottle>=0.12,<1 -chalice<=1.27.3; python_version=="3.6" -chalice>=1.28,<2; python_version>"3.6" +chalice>=1.28,<2; CherryPy>=18,<19 Django>=3,<6 falcon>=2,<5; python_version<"3.11" @@ -17,8 +16,7 @@ pyramid>=1,<3 # Sanic and its dependencies # Note: Sanic imports tracerite with wild card versions tracerite<1.1.2; python_version<="3.8" # older versions of python are not compatible with tracerite>1.1.2 -sanic>=20,<21; python_version=="3.6" -sanic>=21,<24; python_version>"3.6" and python_version<="3.8" +sanic>=21,<24; python_version<="3.8" sanic>=21,<26; python_version>"3.8" starlette>=0.19.1,<1 diff --git a/requirements/adapter_testing.txt b/requirements/adapter_testing.txt index 3d829ee15..c497a1f3f 100644 --- a/requirements/adapter_testing.txt +++ b/requirements/adapter_testing.txt @@ -2,4 +2,4 @@ moto>=3,<6 # For AWS tests docker>=5,<8 # Used by moto boddle>=0.2,<0.3 # For Bottle app tests -sanic-testing>=0.7; python_version>"3.6" +sanic-testing>=0.7 diff --git a/requirements/tools.txt b/requirements/tools.txt index c3a383a13..b4cf790b9 100644 --- a/requirements/tools.txt +++ b/requirements/tools.txt @@ -1,3 +1,3 @@ mypy==1.17.1 flake8==7.3.0 -black==24.8.0 # Until we drop Python 3.6 support, we have to stay with this version +black==25.1.0 diff --git a/scripts/format.sh b/scripts/format.sh new file mode 100755 index 000000000..10987bdd6 --- /dev/null +++ b/scripts/format.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# ./scripts/format.sh + +script_dir=`dirname $0` +cd ${script_dir}/.. + +pip install -U pip +pip install -r requirements/tools.txt + +black slack_bolt/ tests/ diff --git a/scripts/install_all_and_run_tests.sh b/scripts/install_all_and_run_tests.sh index 21660dca5..a3154ae69 100755 --- a/scripts/install_all_and_run_tests.sh +++ b/scripts/install_all_and_run_tests.sh @@ -14,14 +14,8 @@ pip install -U pip pip uninstall python-lambda test_target="$1" -python_version=`python --version | awk '{print $2}'` -if [ ${python_version:0:3} == "3.6" ] -then - pip install -U -r requirements.txt -else - pip install -e . -fi +pip install -e . if [[ $test_target != "" ]] then diff --git a/slack_bolt/async_app.py b/slack_bolt/async_app.py index 10878c51b..fdf724d4c 100644 --- a/slack_bolt/async_app.py +++ b/slack_bolt/async_app.py @@ -5,7 +5,7 @@ If you'd prefer to build your app with [asyncio](https://docs.python.org/3/library/asyncio.html), you can import the [AIOHTTP](https://docs.aiohttp.org/en/stable/) library and call the `AsyncApp` constructor. Within async apps, you can use the async/await pattern. ```bash -# Python 3.6+ required +# Python 3.7+ required python -m venv .venv source .venv/bin/activate diff --git a/slack_bolt/listener_matcher/builtins.py b/slack_bolt/listener_matcher/builtins.py index fe06b9eef..57dbdf4f1 100644 --- a/slack_bolt/listener_matcher/builtins.py +++ b/slack_bolt/listener_matcher/builtins.py @@ -1,5 +1,4 @@ import re -import sys from logging import Logger from slack_bolt.error import BoltError @@ -25,10 +24,7 @@ from ..logger.messages import error_message_event_type from ..util.utils import get_arg_names_of_callable -if sys.version_info.major == 3 and sys.version_info.minor <= 6: - from re import _pattern_type as Pattern # type: ignore[attr-defined] -else: - from re import Pattern +from re import Pattern from typing import Callable, Awaitable, Any, Sequence, Optional, Union, Dict from slack_bolt.kwargs_injection import build_required_kwargs @@ -169,7 +165,7 @@ def _check_event_subtype(event_payload: dict, constraints: dict) -> bool: return True -def _verify_message_event_type(event_type: str) -> None: +def _verify_message_event_type(event_type: Union[str, Pattern]) -> None: if isinstance(event_type, str) and event_type.startswith("message."): raise ValueError(error_message_event_type(event_type)) if isinstance(event_type, Pattern) and "message\\." in event_type.pattern: @@ -324,7 +320,7 @@ def _block_action( elif isinstance(constraints, dict): # block_id matching is optional block_id: Optional[Union[str, Pattern]] = constraints.get("block_id") - action_id = constraints.get("action_id") + action_id = constraints.get("action_id") # type: ignore[assignment] if block_id is None and action_id is None: return False block_id_matched = block_id is None or _matches(block_id, action.get("block_id")) # type: ignore[union-attr] diff --git a/slack_bolt/logger/messages.py b/slack_bolt/logger/messages.py index cffdc445f..d30f51acb 100644 --- a/slack_bolt/logger/messages.py +++ b/slack_bolt/logger/messages.py @@ -60,7 +60,7 @@ def error_authorize_conflicts() -> str: return "`authorize` in the top-level arguments is not allowed when you pass either `oauth_settings` or `oauth_flow`" -def error_message_event_type(event_type: str) -> str: +def error_message_event_type(event_type: Union[str, Pattern]) -> str: return ( f'Although the document mentions "{event_type}", ' 'it is not a valid event type. Use "message" instead. ' diff --git a/slack_bolt/util/utils.py b/slack_bolt/util/utils.py index 0abdcfcbd..9ee313821 100644 --- a/slack_bolt/util/utils.py +++ b/slack_bolt/util/utils.py @@ -32,19 +32,7 @@ def convert_to_dict(obj: Union[Dict, JsonObject]) -> Dict: def create_copy(original: Any) -> Any: - if sys.version_info.major == 3 and sys.version_info.minor <= 6: - # NOTE: Unfortunately, copy.deepcopy doesn't work in Python 3.6.5. - # -------------------- - # > rv = reductor(4) - # E TypeError: can't pickle _thread.RLock objects - # ../../.pyenv/versions/3.6.10/lib/python3.6/copy.py:169: TypeError - # -------------------- - # As a workaround, this operation uses shallow copies in Python 3.6. - # If your code modifies the shared data in threads / async functions, race conditions may arise. - # Please consider upgrading Python major version to 3.7+ if you encounter some issues due to this. - return copy.copy(original) - else: - return copy.deepcopy(original) + return copy.deepcopy(original) def get_boot_message(development_server: bool = False) -> str: From a3adffaac15237e27f2522c60602697484431554 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Tue, 9 Sep 2025 13:33:43 -0400 Subject: [PATCH 645/719] chore: move dependencies to pyproject.toml (#1360) --- .github/dependabot.yml | 12 ------------ .github/workflows/tests.yml | 2 +- pyproject.toml | 4 ++-- requirements.txt | 1 - scripts/build_pypi_package.sh | 2 +- scripts/deploy_to_pypi_org.sh | 2 +- scripts/deploy_to_test_pypi_org.sh | 2 +- scripts/format.sh | 2 +- scripts/install_all_and_run_tests.sh | 2 +- scripts/run_flake8.sh | 2 +- scripts/run_mypy.sh | 8 ++++---- 11 files changed, 13 insertions(+), 26 deletions(-) delete mode 100644 requirements.txt diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 34b2ad725..dc523d227 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,15 +12,3 @@ updates: directory: "/" schedule: interval: "monthly" - - package-ecosystem: "npm" - directory: "/docs" - schedule: - interval: "monthly" - groups: - docusaurus: - patterns: - - "@docusaurus/*" - react: - patterns: - - "react" - - "react-dom" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f53a603ff..8ee9be411 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -37,7 +37,7 @@ jobs: - name: Install synchronous dependencies run: | pip install -U pip - pip install -r requirements.txt + pip install . pip install -r requirements/testing_without_asyncio.txt - name: Run tests without aiohttp run: | diff --git a/pyproject.toml b/pyproject.toml index 07b338300..024ee6654 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "slack_bolt" -dynamic = ["version", "readme", "dependencies", "authors"] +dynamic = ["version", "readme", "authors"] description = "The Bolt Framework for Python" license = { text = "MIT" } classifiers = [ @@ -20,6 +20,7 @@ classifiers = [ "Operating System :: OS Independent", ] requires-python = ">=3.7" +dependencies = ["slack_sdk>=3.35.0,<4"] [project.urls] @@ -31,7 +32,6 @@ include = ["slack_bolt*"] [tool.setuptools.dynamic] version = { attr = "slack_bolt.version.__version__" } readme = { file = ["README.md"], content-type = "text/markdown" } -dependencies = { file = ["requirements.txt"] } [tool.distutils.bdist_wheel] universal = true diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index c8d66106a..000000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -slack_sdk>=3.35.0,<4 diff --git a/scripts/build_pypi_package.sh b/scripts/build_pypi_package.sh index 79c6db9f2..5806262a6 100755 --- a/scripts/build_pypi_package.sh +++ b/scripts/build_pypi_package.sh @@ -5,7 +5,7 @@ cd ${script_dir}/.. rm -rf ./slack_bolt.egg-info pip install -U pip && \ - pip install twine build && \ + pip install -U twine build && \ rm -rf dist/ build/ slack_bolt.egg-info/ && \ python -m build --sdist --wheel && \ twine check dist/* diff --git a/scripts/deploy_to_pypi_org.sh b/scripts/deploy_to_pypi_org.sh index a3cf431fa..8c5234902 100755 --- a/scripts/deploy_to_pypi_org.sh +++ b/scripts/deploy_to_pypi_org.sh @@ -5,7 +5,7 @@ cd ${script_dir}/.. rm -rf ./slack_bolt.egg-info pip install -U pip && \ - pip install twine build && \ + pip install -U twine build && \ rm -rf dist/ build/ slack_bolt.egg-info/ && \ python -m build --sdist --wheel && \ twine check dist/* && \ diff --git a/scripts/deploy_to_test_pypi_org.sh b/scripts/deploy_to_test_pypi_org.sh index b2cc65a12..a6b9c352d 100644 --- a/scripts/deploy_to_test_pypi_org.sh +++ b/scripts/deploy_to_test_pypi_org.sh @@ -5,7 +5,7 @@ cd ${script_dir}/.. rm -rf ./slack_bolt.egg-info pip install -U pip && \ - pip install twine build && \ + pip install -U twine build && \ rm -rf dist/ build/ slack_bolt.egg-info/ && \ python -m build --sdist --wheel && \ twine check dist/* && \ diff --git a/scripts/format.sh b/scripts/format.sh index 10987bdd6..77cecf9e4 100755 --- a/scripts/format.sh +++ b/scripts/format.sh @@ -5,6 +5,6 @@ script_dir=`dirname $0` cd ${script_dir}/.. pip install -U pip -pip install -r requirements/tools.txt +pip install -U -r requirements/tools.txt black slack_bolt/ tests/ diff --git a/scripts/install_all_and_run_tests.sh b/scripts/install_all_and_run_tests.sh index a3154ae69..1f2690414 100755 --- a/scripts/install_all_and_run_tests.sh +++ b/scripts/install_all_and_run_tests.sh @@ -15,7 +15,7 @@ pip uninstall python-lambda test_target="$1" -pip install -e . +pip install -U -e . if [[ $test_target != "" ]] then diff --git a/scripts/run_flake8.sh b/scripts/run_flake8.sh index 73562da29..e523920f9 100755 --- a/scripts/run_flake8.sh +++ b/scripts/run_flake8.sh @@ -3,5 +3,5 @@ script_dir=$(dirname $0) cd ${script_dir}/.. && \ - pip install -r requirements/tools.txt && \ + pip install -U -r requirements/tools.txt && \ flake8 slack_bolt/ && flake8 examples/ diff --git a/scripts/run_mypy.sh b/scripts/run_mypy.sh index 77a2bacb7..c018443b7 100755 --- a/scripts/run_mypy.sh +++ b/scripts/run_mypy.sh @@ -3,8 +3,8 @@ script_dir=$(dirname $0) cd ${script_dir}/.. && \ - pip install . - pip install -r requirements/async.txt && \ - pip install -r requirements/adapter.txt && \ - pip install -r requirements/tools.txt && \ + pip install -U . + pip install -U -r requirements/async.txt && \ + pip install -U -r requirements/adapter.txt && \ + pip install -U -r requirements/tools.txt && \ mypy --config-file pyproject.toml From 3274d7a2b36101256ad498eee4aba794ab4ee888 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Tue, 9 Sep 2025 15:45:59 -0400 Subject: [PATCH 646/719] chore: version 1.25.0 (#1366) --- docs/reference/async_app.html | 2 +- docs/reference/logger/messages.html | 4 ++-- docs/reference/util/utils.html | 14 +------------- slack_bolt/version.py | 2 +- 4 files changed, 5 insertions(+), 17 deletions(-) diff --git a/docs/reference/async_app.html b/docs/reference/async_app.html index 07c1f3627..ad9192253 100644 --- a/docs/reference/async_app.html +++ b/docs/reference/async_app.html @@ -39,7 +39,7 @@

    Module slack_bolt.async_app

    Module for creating asyncio based apps

    Creating an async app

    If you'd prefer to build your app with asyncio, you can import the AIOHTTP library and call the AsyncApp constructor. Within async apps, you can use the async/await pattern.

    -
    # Python 3.6+ required
    +
    # Python 3.7+ required
     python -m venv .venv
     source .venv/bin/activate
     
    diff --git a/docs/reference/logger/messages.html b/docs/reference/logger/messages.html
    index 3c8d67a31..85e0d94dd 100644
    --- a/docs/reference/logger/messages.html
    +++ b/docs/reference/logger/messages.html
    @@ -208,14 +208,14 @@ 

    Functions

    -def error_message_event_type(event_type: str) ‑> str +def error_message_event_type(event_type: str | re.Pattern) ‑> str
    Expand source code -
    def error_message_event_type(event_type: str) -> str:
    +
    def error_message_event_type(event_type: Union[str, Pattern]) -> str:
         return (
             f'Although the document mentions "{event_type}", '
             'it is not a valid event type. Use "message" instead. '
    diff --git a/docs/reference/util/utils.html b/docs/reference/util/utils.html
    index 33e6b1de2..85d336513 100644
    --- a/docs/reference/util/utils.html
    +++ b/docs/reference/util/utils.html
    @@ -83,19 +83,7 @@ 

    Functions

    Expand source code
    def create_copy(original: Any) -> Any:
    -    if sys.version_info.major == 3 and sys.version_info.minor <= 6:
    -        # NOTE: Unfortunately, copy.deepcopy doesn't work in Python 3.6.5.
    -        # --------------------
    -        # >     rv = reductor(4)
    -        # E     TypeError: can't pickle _thread.RLock objects
    -        # ../../.pyenv/versions/3.6.10/lib/python3.6/copy.py:169: TypeError
    -        # --------------------
    -        # As a workaround, this operation uses shallow copies in Python 3.6.
    -        # If your code modifies the shared data in threads / async functions, race conditions may arise.
    -        # Please consider upgrading Python major version to 3.7+ if you encounter some issues due to this.
    -        return copy.copy(original)
    -    else:
    -        return copy.deepcopy(original)
    + return copy.deepcopy(original)
    diff --git a/slack_bolt/version.py b/slack_bolt/version.py index b996e1572..7f9c19341 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,3 +1,3 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.24.0" +__version__ = "1.25.0" From 420ec6bc4376890f892b2f51c6b92cac71d4978f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 20:00:34 +0000 Subject: [PATCH 647/719] chore(deps): update pytest-cov requirement from <7,>=3 to >=3,<8 (#1365) --- requirements/testing_without_asyncio.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/testing_without_asyncio.txt b/requirements/testing_without_asyncio.txt index d10c4345e..0e493f0e2 100644 --- a/requirements/testing_without_asyncio.txt +++ b/requirements/testing_without_asyncio.txt @@ -1,3 +1,3 @@ # pip install -r requirements/testing_without_asyncio.txt pytest>=6.2.5,<8.5 # https://github.com/tornadoweb/tornado/issues/3375 -pytest-cov>=3,<7 +pytest-cov>=3,<8 From 6f4fbf013ac796421347b6dc354c48577d6d8b6e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 20:55:11 +0000 Subject: [PATCH 648/719] chore(deps): bump actions/setup-python from 5.6.0 to 6.0.0 (#1363) --- .github/workflows/codecov.yml | 2 +- .github/workflows/flake8.yml | 2 +- .github/workflows/mypy.yml | 2 +- .github/workflows/tests.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 391c135c6..0eaf192ba 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -22,7 +22,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index 87f3496e1..ce6271c46 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -20,7 +20,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 with: python-version: ${{ matrix.python-version }} - name: Run flake8 verification diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index f333756b5..fd9ae0203 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -20,7 +20,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 with: python-version: ${{ matrix.python-version }} - name: Run mypy verification diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8ee9be411..8501cae36 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,7 +31,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 with: python-version: ${{ matrix.python-version }} - name: Install synchronous dependencies From f7114844960d3e4949c0d263510467f6256341fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 21:07:47 +0000 Subject: [PATCH 649/719] chore(deps): bump actions/checkout from 4.2.2 to 5.0.0 (#1362) --- .github/workflows/codecov.yml | 2 +- .github/workflows/flake8.yml | 2 +- .github/workflows/mypy.yml | 2 +- .github/workflows/tests.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 0eaf192ba..01e6e6a5d 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -18,7 +18,7 @@ jobs: env: BOLT_PYTHON_CODECOV_RUNNING: "1" steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index ce6271c46..bd4e3dfd8 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -16,7 +16,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index fd9ae0203..1bf4abf0d 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -16,7 +16,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8501cae36..e68997aef 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} From 055b320de04b394264cfb7361837af22b96dea0e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 21:11:57 +0000 Subject: [PATCH 650/719] chore(deps): bump actions/stale from 9.1.0 to 10.0.0 (#1361) --- .github/workflows/triage-issues.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/triage-issues.yml b/.github/workflows/triage-issues.yml index b37c13422..5cb75bf93 100644 --- a/.github/workflows/triage-issues.yml +++ b/.github/workflows/triage-issues.yml @@ -16,7 +16,7 @@ jobs: issues: write pull-requests: write steps: - - uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0 + - uses: actions/stale@3a9db7e6a41a89f618792c92c0e97cc736e1b13f # v10.0.0 with: days-before-issue-stale: 30 days-before-issue-close: 10 From c512c6b08d70f830932031b7d87485e23e9d9fc3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 21:16:01 +0000 Subject: [PATCH 651/719] chore(deps): bump codecov/codecov-action from 5.4.3 to 5.5.1 (#1364) --- .github/workflows/codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 01e6e6a5d..7381117bb 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -36,7 +36,7 @@ jobs: run: | pytest --cov=./slack_bolt/ --cov-report=xml - name: Upload coverage to Codecov - uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3 + uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 with: fail_ci_if_error: true verbose: true From 7cedaac2853d55d2329422c59a1c0bcec3b6ded0 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Mon, 15 Sep 2025 12:26:39 -0700 Subject: [PATCH 652/719] docs: add ai provider token instructions (#1340) --- .../english/tutorial/ai-chatbot/ai-chatbot.md | 69 ++++++++++++++----- 1 file changed, 53 insertions(+), 16 deletions(-) diff --git a/docs/english/tutorial/ai-chatbot/ai-chatbot.md b/docs/english/tutorial/ai-chatbot/ai-chatbot.md index 9da54c149..72005f817 100644 --- a/docs/english/tutorial/ai-chatbot/ai-chatbot.md +++ b/docs/english/tutorial/ai-chatbot/ai-chatbot.md @@ -12,9 +12,9 @@ In this tutorial, you'll learn how to bring the power of AI into your Slack work Before getting started, you will need the following: -* a development workspace where you have permissions to install apps. If you don’t have a workspace, go ahead and set that up now — you can [go here](https://slack.com/get-started#create) to create one, or you can join the [Developer Program](https://api.slack.com/developer-program) and provision a sandbox with access to all Slack features for free. -* a development environment with [Python 3.7](https://www.python.org/downloads/) or later. -* an Anthropic or OpenAI account with sufficient credits, and in which you have generated a secret key. +- a development workspace where you have permissions to install apps. If you don’t have a workspace, go ahead and set that up now — you can [go here](https://slack.com/get-started#create) to create one, or you can join the [Developer Program](https://api.slack.com/developer-program) and provision a sandbox with access to all Slack features for free. +- a development environment with [Python 3.7](https://www.python.org/downloads/) or later. +- an Anthropic or OpenAI account with sufficient credits, and in which you have generated a secret key. **Skip to the code** If you'd rather skip the tutorial and just head straight to the code, you can use our [Bolt for Python AI Chatbot sample](https://github.com/slack-samples/bolt-python-ai-chatbot) as a template. @@ -25,31 +25,66 @@ If you'd rather skip the tutorial and just head straight to the code, you can us 2. Select the workspace you want to install the application in. 3. Copy the contents of the [`manifest.json`](https://github.com/slack-samples/bolt-python-ai-chatbot/blob/main/manifest.json) file into the text box that says **Paste your manifest code here** (within the **JSON** tab) and click **Next**. 4. Review the configuration and click **Create**. -5. You're now in your app configuration's **Basic Information** page. Navigate to the **Install App** link in the left nav and click **Install to Workspace*, then **Allow** on the screen that follows. +5. You're now in your app configuration's **Basic Information** page. Navigate to the **Install App** link in the left nav and click **Install to Workspace**, then **Allow** on the screen that follows. ### Obtaining and storing your environment variables {#environment-variables} Before you'll be able to successfully run the app, you'll need to first obtain and set some environment variables. +#### Slack tokens {#slack-tokens} + +From your app's page on [app settings](https://api.slack.com/apps) collect an app and bot token: + 1. On the **Install App** page, copy your **Bot User OAuth Token**. You will store this in your environment as `SLACK_BOT_TOKEN` (we'll get to that next). 2. Navigate to **Basic Information** and in the **App-Level Tokens** section , click **Generate Token and Scopes**. Add the [`connections:write`](/reference/scopes/connections.write) scope, name the token, and click **Generate**. (For more details, refer to [understanding OAuth scopes for bots](/authentication/tokens#bot)). Copy this token. You will store this in your environment as `SLACK_APP_TOKEN`. -To store your tokens and environment variables, run the following commands in the terminal. Replace the placeholder values with your bot and app tokens collected above, as well as the key or keys for the AI provider or providers you want to use: +To store your tokens and environment variables, run the following commands in the terminal. Replace the placeholder values with your bot and app tokens collected above: **For macOS** + ```bash export SLACK_BOT_TOKEN= export SLACK_APP_TOKEN= -export OPENAI_API_KEY= -export ANTHROPIC_API_KEY= ``` **For Windows** -```bash + +```pwsh set SLACK_BOT_TOKEN= set SLACK_APP_TOKEN= -set OPENAI_API_KEY= -set ANTHROPIC_API_KEY= +``` + +#### Provider tokens {#provider-tokens} + +Models from different AI providers are available if the corresponding environment variable is added as shown in the sections below. + +##### Anthropic {#anthropic} + +To interact with Anthropic models, navigate to your Anthropic account dashboard to [create an API key](https://console.anthropic.com/settings/keys), then export the key as follows: + +```bash +export ANTHROPIC_API_KEY= +``` + +##### Google Cloud Vertex AI {#google-cloud-vertex-ai} + +To use Google Cloud Vertex AI, [follow this quick start](https://cloud.google.com/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal#expandable-1) to create a project for sending requests to the Gemini API, then gather [Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc) with the strategy to match your development environment. + +Once your project and credentials are configured, export environment variables to select from Gemini models: + +```bash +export VERTEX_AI_PROJECT_ID= +export VERTEX_AI_LOCATION= +``` + +The project location can be located under the **Region** on the [Vertex AI](https://console.cloud.google.com/vertex-ai) dashboard, as well as more details about available Gemini models. + +##### OpenAI {#openai} + +Unlock the OpenAI models from your OpenAI account dashboard by clicking [create a new secret key](https://platform.openai.com/api-keys), then export the key like so: + +```bash +export OPENAI_API_KEY= ``` ## Setting up and running your local project {#configure-project} @@ -69,12 +104,14 @@ cd bolt-python-ai-chatbot Start your Python virtual environment: **For macOS** + ```bash python3 -m venv .venv source .venv/bin/activate ``` **For Windows** + ```bash py -m venv .venv .venv\Scripts\activate @@ -123,7 +160,7 @@ Under **Then, do these things**, click **Add steps** and complete the following: ![Send a message](3.png) -We'll add two more steps under the **Then, do these things** section. +We'll add two more steps under the **Then, do these things** section. First, scroll to the bottom of the list of steps and choose **Custom**, then choose **Bolty** and **Bolty Custom Function**. In the **Channel** drop-down menu, select **Channel that the user joined**. Click **Save**. @@ -142,7 +179,7 @@ When finished, click **Finish Up**, then click **Publish** to make the workflow ### Summarizing recent conversations {#summarize} -In order for Bolty to provide summaries of recent conversation in a channel, Bolty _must_ be a member of that channel. +In order for Bolty to provide summaries of recent conversation in a channel, Bolty _must_ be a member of that channel. 1. Invite Bolty to a channel that you are able to leave and rejoin (for example, not the **#general** channel or a private channel someone else created) by mentioning the app in the channel — i.e., tagging **@Bolty** in the channel and sending your message. 2. Slackbot will prompt you to either invite Bolty to the channel, or do nothing. Click **Invite Them**. Now when new users join the channel, the workflow you just created will be kicked off. @@ -189,7 +226,7 @@ def handle_summary_function_callback( To ask Bolty a question, you can chat with Bolty in any channel the app is in. Use the `\ask-bolty` slash command to provide a prompt for Bolty to answer. Note that Bolty is currently not supported in threads. -You can also navigate to **Bolty** in your **Apps** list and select the **Messages** tab to chat with Bolty directly. +You can also navigate to **Bolty** in your **Apps** list and select the **Messages** tab to chat with Bolty directly. ![Ask Bolty](8.png) @@ -197,6 +234,6 @@ You can also navigate to **Bolty** in your **Apps** list and select the **Messag Congratulations! You've successfully integrated the power of AI into your workspace. Check out these links to take the next steps in your Bolt for Python journey. -* To learn more about Bolt for Python, refer to the [Getting started](/tools/bolt-python/getting-started) documentation. -* For more details about creating workflow steps using the Bolt SDK, refer to the [workflow steps for Bolt](/workflows/workflow-steps) guide. -* To use the Bolt for Python SDK to develop on the automations platform, refer to the [Create a workflow step for Workflow Builder: Bolt for Python](/tools/bolt-python/tutorial/custom-steps-workflow-builder-new) tutorial. +- To learn more about Bolt for Python, refer to the [Getting started](/tools/bolt-python/getting-started) documentation. +- For more details about creating workflow steps using the Bolt SDK, refer to the [workflow steps for Bolt](/workflows/workflow-steps) guide. +- To use the Bolt for Python SDK to develop on the automations platform, refer to the [Create a workflow step for Workflow Builder: Bolt for Python](/tools/bolt-python/tutorial/custom-steps-workflow-builder-new) tutorial. From 811d6a25466f7eb119331b47eb94f13402d34ab9 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Thu, 25 Sep 2025 16:53:25 -0700 Subject: [PATCH 653/719] build: require cheroot<11 with adapter test dependencies (#1375) --- requirements/adapter.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/adapter.txt b/requirements/adapter.txt index 8fd5cd33e..3cefd621d 100644 --- a/requirements/adapter.txt +++ b/requirements/adapter.txt @@ -4,6 +4,7 @@ boto3<=2 bottle>=0.12,<1 chalice>=1.28,<2; +cheroot<11 # https://github.com/slackapi/bolt-python/issues/1374 CherryPy>=18,<19 Django>=3,<6 falcon>=2,<5; python_version<"3.11" From e21c4e82800ddff12e8933b0f4ba9ff19e3202fd Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Thu, 25 Sep 2025 17:57:42 -0700 Subject: [PATCH 654/719] build(deps): remove pytest lower bounds from testing requirements (#1333) Co-authored-by: William Bergamin --- requirements/testing_without_asyncio.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/testing_without_asyncio.txt b/requirements/testing_without_asyncio.txt index 0e493f0e2..441b49f8b 100644 --- a/requirements/testing_without_asyncio.txt +++ b/requirements/testing_without_asyncio.txt @@ -1,3 +1,3 @@ # pip install -r requirements/testing_without_asyncio.txt -pytest>=6.2.5,<8.5 # https://github.com/tornadoweb/tornado/issues/3375 +pytest<8.5 pytest-cov>=3,<8 From ef3e178b950cd4a22abf1ed59fe50152e9b0138e Mon Sep 17 00:00:00 2001 From: Haley Elmendorf <31392893+haleychaas@users.noreply.github.com> Date: Tue, 30 Sep 2025 10:39:09 -0500 Subject: [PATCH 655/719] docs: updates for combined quickstart (#1378) --- docs/english/getting-started.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/english/getting-started.md b/docs/english/getting-started.md index a198736bc..8b7438d65 100644 --- a/docs/english/getting-started.md +++ b/docs/english/getting-started.md @@ -1,9 +1,8 @@ --- sidebar_label: Quickstart +title: Quickstart guide with Bolt for Python --- -# Quickstart guide with Bolt for Python - This quickstart guide aims to help you get a Slack app using Bolt for Python up and running as soon as possible! import Tabs from '@theme/Tabs'; @@ -292,8 +291,8 @@ Follow along with the steps that went into making this app on the [building an a You can now continue customizing your app with various features to make it right for whatever job's at hand. Here are some ideas about what to explore next: -- Explore the different events your bot can listen to with the [`app.event()`](/tools/bolt-python/concepts/event-listening) method. All of the [events](/reference/events) are listed on the API docs site. -- Bolt allows you to call [Web API](/tools/bolt-python/concepts/web-api) methods with the client attached to your app. There are [over 200 methods](/reference/methods) on the API docs site. +- Explore the different events your bot can listen to with the [`app.event()`](/tools/bolt-python/concepts/event-listening) method. See the full events reference [here](/reference/events). +- Bolt allows you to call [Web API](/tools/bolt-python/concepts/web-api) methods with the client attached to your app. There are [over 200 methods](/reference/methods) available. - Learn more about the different [token types](/authentication/tokens) and [authentication setups](/tools/bolt-python/concepts/authenticating-oauth). Your app might need different tokens depending on the actions you want to perform or for installations to multiple workspaces. - Receive events using HTTP for various deployment methods, such as deploying to Heroku or AWS Lambda. - Read on [app design](/surfaces/app-design) and compose fancy messages with blocks using [Block Kit Builder](https://app.slack.com/block-kit-builder) to prototype messages. From 9fa6e86fa345c243d2a604c5ef91f225e0448064 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 30 Sep 2025 11:49:12 -0700 Subject: [PATCH 656/719] build: install dependencies needed to autogenerate reference docs (#1377) --- scripts/generate_api_docs.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/generate_api_docs.sh b/scripts/generate_api_docs.sh index f8ea39d0d..c3b9fd260 100755 --- a/scripts/generate_api_docs.sh +++ b/scripts/generate_api_docs.sh @@ -1,10 +1,15 @@ #!/bin/bash # Generate API documents from the latest source code -script_dir=`dirname $0` -cd ${script_dir}/.. +set -e +script_dir=$(dirname "$0") +cd "${script_dir}/.." +pip install -U pip +pip install -U -r requirements/adapter.txt +pip install -U -r requirements/async.txt pip install -U pdoc3 +pip install . rm -rf docs/reference pdoc slack_bolt --html -o docs/reference From cb4130adf305a1299d9864d227e333fddb1739e6 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 30 Sep 2025 13:27:32 -0700 Subject: [PATCH 657/719] ci: post regression notifications if scheduled tests do not succeed (#1376) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e68997aef..167dc2ce4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -86,7 +86,7 @@ jobs: name: Regression notifications runs-on: ubuntu-latest needs: build - if: failure() && github.ref == 'refs/heads/main' && github.event_name != 'workflow_dispatch' + if: ${{ !success() && github.ref == 'refs/heads/main' && github.event_name != 'workflow_dispatch' }} steps: - name: Send notifications of failing tests uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1 From c3e26d94b529278f5107e8fde1b1f011b1727cf7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Oct 2025 19:35:16 -0700 Subject: [PATCH 658/719] chore(deps): bump mypy from 1.17.1 to 1.18.2 (#1379) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/tools.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/tools.txt b/requirements/tools.txt index b4cf790b9..73a342ca6 100644 --- a/requirements/tools.txt +++ b/requirements/tools.txt @@ -1,3 +1,3 @@ -mypy==1.17.1 +mypy==1.18.2 flake8==7.3.0 black==25.1.0 From 95150b80e2ebe688fd834d6ceeaa3468334b25ae Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Fri, 3 Oct 2025 10:23:07 -0700 Subject: [PATCH 659/719] docs: replace links from api.slack.com to docs.slack.dev redirects (#1383) --- .github/ISSUE_TEMPLATE/03_document.md | 2 +- README.md | 12 +- .../custom-steps-workflow-builder-existing.md | 2 +- docs/reference/app/app.html | 132 ++++++++--------- docs/reference/app/async_app.html | 126 ++++++++-------- docs/reference/app/index.html | 132 ++++++++--------- docs/reference/async_app.html | 126 ++++++++-------- docs/reference/authorization/index.html | 2 +- .../thread_context_store/file/index.html | 2 +- docs/reference/context/index.html | 2 +- docs/reference/index.html | 138 +++++++++--------- docs/reference/lazy_listener/index.html | 2 +- docs/reference/listener_matcher/builtins.html | 2 +- docs/reference/logger/messages.html | 2 +- docs/reference/middleware/async_builtins.html | 12 +- docs/reference/middleware/index.html | 16 +- .../async_request_verification.html | 6 +- .../request_verification/index.html | 4 +- .../request_verification.html | 4 +- .../middleware/ssl_check/async_ssl_check.html | 4 +- .../reference/middleware/ssl_check/index.html | 8 +- .../middleware/ssl_check/ssl_check.html | 8 +- .../async_url_verification.html | 2 +- .../middleware/url_verification/index.html | 4 +- .../url_verification/url_verification.html | 4 +- docs/reference/oauth/index.html | 2 +- docs/reference/request/index.html | 2 +- docs/reference/response/index.html | 2 +- docs/reference/workflows/index.html | 2 +- docs/reference/workflows/step/async_step.html | 40 ++--- docs/reference/workflows/step/index.html | 12 +- docs/reference/workflows/step/step.html | 40 ++--- .../step/utilities/async_configure.html | 4 +- .../workflows/step/utilities/configure.html | 4 +- examples/aws_lambda/README.md | 14 +- examples/django/README.md | 8 +- examples/getting_started/README.md | 8 +- examples/message_events.py | 6 +- examples/readme_app.py | 4 +- examples/readme_async_app.py | 4 +- .../workflow_steps/async_steps_from_apps.py | 2 +- .../async_steps_from_apps_decorator.py | 2 +- .../async_steps_from_apps_primitive.py | 2 +- examples/workflow_steps/steps_from_apps.py | 2 +- .../steps_from_apps_decorator.py | 2 +- .../steps_from_apps_primitive.py | 2 +- pyproject.toml | 2 +- slack_bolt/__init__.py | 4 +- slack_bolt/app/app.py | 48 +++--- slack_bolt/app/async_app.py | 46 +++--- slack_bolt/authorization/__init__.py | 2 +- slack_bolt/context/__init__.py | 2 +- slack_bolt/lazy_listener/__init__.py | 2 +- slack_bolt/listener_matcher/builtins.py | 2 +- slack_bolt/logger/messages.py | 2 +- .../async_request_verification.py | 2 +- .../request_verification.py | 2 +- slack_bolt/middleware/ssl_check/ssl_check.py | 4 +- .../url_verification/url_verification.py | 2 +- slack_bolt/oauth/__init__.py | 2 +- slack_bolt/request/__init__.py | 2 +- slack_bolt/response/__init__.py | 2 +- slack_bolt/workflows/__init__.py | 2 +- slack_bolt/workflows/step/async_step.py | 16 +- slack_bolt/workflows/step/step.py | 16 +- .../step/utilities/async_configure.py | 2 +- .../workflows/step/utilities/configure.py | 2 +- .../scenario_tests/test_attachment_actions.py | 2 +- .../test_attachment_actions.py | 2 +- 69 files changed, 545 insertions(+), 541 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/03_document.md b/.github/ISSUE_TEMPLATE/03_document.md index 3ce4e48e5..4eb5af847 100644 --- a/.github/ISSUE_TEMPLATE/03_document.md +++ b/.github/ISSUE_TEMPLATE/03_document.md @@ -10,7 +10,7 @@ assignees: '' ### The page URLs -* https://slack.dev/bolt-python/ +* https://docs.slack.dev/tools/bolt-python/ ## Requirements diff --git a/README.md b/README.md index b3f78adb0..39747df40 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ ngrok http 3000 ## Running a Socket Mode app -If you use [Socket Mode](https://api.slack.com/socket-mode) for running your app, `SocketModeHandler` is available for it. +If you use [Socket Mode](https://docs.slack.dev/apis/events-api/using-socket-mode/) for running your app, `SocketModeHandler` is available for it. ```python import os @@ -91,7 +91,7 @@ python app.py ## Listening for events -Apps typically react to a collection of incoming events, which can correspond to [Events API events](https://api.slack.com/events-api), [actions](https://api.slack.com/interactivity/components), [shortcuts](https://api.slack.com/interactivity/shortcuts), [slash commands](https://api.slack.com/interactivity/slash-commands) or [options requests](https://api.slack.com/reference/block-kit/block-elements#external_select). For each type of +Apps typically react to a collection of incoming events, which can correspond to [Events API events](https://docs.slack.dev/apis/events-api/), [actions](https://docs.slack.dev/block-kit/#making-things-interactive), [shortcuts](https://docs.slack.dev/interactivity/implementing-shortcuts/), [slash commands](https://docs.slack.dev/interactivity/implementing-slash-commands/) or [options requests](https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element#external_select). For each type of request, there's a method to build a listener function. ```python @@ -138,12 +138,12 @@ Most of the app's functionality will be inside listener functions (the `fn` para | Argument | Description | | :---: | :--- | | `body` | Dictionary that contains the entire body of the request (superset of `payload`). Some accessory data is only available outside of the payload (such as `trigger_id` and `authorizations`). -| `payload` | Contents of the incoming event. The payload structure depends on the listener. For example, for an Events API event, `payload` will be the [event type structure](https://api.slack.com/events-api#event_type_structure). For a block action, it will be the action from within the `actions` list. The `payload` dictionary is also accessible via the alias corresponding to the listener (`message`, `event`, `action`, `shortcut`, `view`, `command`, or `options`). For example, if you were building a `message()` listener, you could use the `payload` and `message` arguments interchangably. **An easy way to understand what's in a payload is to log it**. | +| `payload` | Contents of the incoming event. The payload structure depends on the listener. For example, for an Events API event, `payload` will be the [event type structure](https://docs.slack.dev/apis/events-api/#event-type-structure). For a block action, it will be the action from within the `actions` list. The `payload` dictionary is also accessible via the alias corresponding to the listener (`message`, `event`, `action`, `shortcut`, `view`, `command`, or `options`). For example, if you were building a `message()` listener, you could use the `payload` and `message` arguments interchangably. **An easy way to understand what's in a payload is to log it**. | | `context` | Event context. This dictionary contains data about the event and app, such as the `botId`. Middleware can add additional context before the event is passed to listeners. -| `ack` | Function that **must** be called to acknowledge that your app received the incoming event. `ack` exists for all actions, shortcuts, view submissions, slash command and options requests. `ack` returns a promise that resolves when complete. Read more in [Acknowledging events](https://tools.slack.dev/bolt-python/concepts/acknowledge). +| `ack` | Function that **must** be called to acknowledge that your app received the incoming event. `ack` exists for all actions, shortcuts, view submissions, slash command and options requests. `ack` returns a promise that resolves when complete. Read more in [Acknowledging events](https://docs.slack.dev/tools/bolt-python/concepts/acknowledge/). | `respond` | Utility function that responds to incoming events **if** it contains a `response_url` (shortcuts, actions, and slash commands). | `say` | Utility function to send a message to the channel associated with the incoming event. This argument is only available when the listener is triggered for events that contain a `channel_id` (the most common being `message` events). `say` accepts simple strings (for plain-text messages) and dictionaries (for messages containing blocks). -| `client` | Web API client that uses the token associated with the event. For single-workspace installations, the token is provided to the constructor. For multi-workspace installations, the token is returned by using [the OAuth library](https://tools.slack.dev/bolt-python/concepts/authenticating-oauth), or manually using the `authorize` function. +| `client` | Web API client that uses the token associated with the event. For single-workspace installations, the token is provided to the constructor. For multi-workspace installations, the token is returned by using [the OAuth library](https://docs.slack.dev/tools/bolt-python/concepts/authenticating-oauth/), or manually using the `authorize` function. | `logger` | The built-in [`logging.Logger`](https://docs.python.org/3/library/logging.html) instance you can use in middleware/listeners. | `complete` | Utility function used to signal the successful completion of a custom step execution. This tells Slack to proceed with the next steps in the workflow. This argument is only available with the `.function` and `.action` listener when handling custom workflow step executions. | `fail` | Utility function used to signal that a custom step failed to complete. This tells Slack to stop the workflow execution. This argument is only available with the `.function` and `.action` listener when handling custom workflow step executions. @@ -192,7 +192,7 @@ Apps can be run the same way as the syncronous example above. If you'd prefer an ## Getting Help -[The documentation](https://tools.slack.dev/bolt-python) has more information on basic and advanced concepts for Bolt for Python. Also, all the Python module documents of this library are available [here](https://tools.slack.dev/bolt-python/reference/). +[The documentation](https://docs.slack.dev/tools/bolt-python/) has more information on basic and advanced concepts for Bolt for Python. Also, all the Python module documents of this library are available [here](https://docs.slack.dev/tools/bolt-python/reference/). If you otherwise get stuck, we're here to help. The following are the best ways to get assistance working through your issue: diff --git a/docs/english/tutorial/custom-steps-workflow-builder-existing/custom-steps-workflow-builder-existing.md b/docs/english/tutorial/custom-steps-workflow-builder-existing/custom-steps-workflow-builder-existing.md index 0441b033c..c3c5e2af7 100644 --- a/docs/english/tutorial/custom-steps-workflow-builder-existing/custom-steps-workflow-builder-existing.md +++ b/docs/english/tutorial/custom-steps-workflow-builder-existing/custom-steps-workflow-builder-existing.md @@ -9,7 +9,7 @@ If you followed along with our [create a custom step for Workflow Builder: new a In this tutorial we will: - Start with an existing Bolt app - Add a custom **workflow step** in the [app settings](https://api.slack.com/apps) -- Wire up the new step to a **function listener** in our project, using the [Bolt for Python](https://slack.dev/bolt-python/) framework +- Wire up the new step to a **function listener** in our project, using the [Bolt for Python](https://docs.slack.dev/tools/bolt-python/) framework - See the step as a custom workflow step in Workflow Builder ## Prerequisites {#prereqs} diff --git a/docs/reference/app/app.html b/docs/reference/app/app.html index d1224dd5d..3ee02b07c 100644 --- a/docs/reference/app/app.html +++ b/docs/reference/app/app.html @@ -117,10 +117,10 @@

    Classes

    if __name__ == "__main__": app.start(port=int(os.environ.get("PORT", 3000))) - Refer to https://slack.dev/bolt-python/tutorial/getting-started for details. + Refer to https://docs.slack.dev/tools/bolt-python/building-an-app for details. If you would like to build an OAuth app for enabling the app to run with multiple workspaces, - refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app. + refer to https://docs.slack.dev/tools/bolt-python/concepts/authenticating-oauth to learn how to configure the app. Args: logger: The custom logger that can be used in this app. @@ -629,7 +629,7 @@

    Classes

    # Pass a function to this method app.middleware(middleware_func) - Refer to https://slack.dev/bolt-python/concepts#global-middleware for details. + Refer to https://docs.slack.dev/tools/bolt-python/concepts/global-middleware for details. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -675,7 +675,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new step from app listener. @@ -693,7 +693,7 @@

    Classes

    # Pass Step to set up listeners app.step(ws) - Refer to https://api.slack.com/workflows/steps for details of steps from apps. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -710,7 +710,7 @@

    Classes

    warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/" ), category=DeprecationWarning, ) @@ -787,7 +787,7 @@

    Classes

    # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://api.slack.com/apis/connections/events-api for details of Events API. + Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -825,7 +825,7 @@

    Classes

    # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://api.slack.com/events/message for details of `message` events. + Refer to https://docs.slack.dev/reference/events/message/ for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -936,7 +936,7 @@

    Classes

    # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. + Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -983,7 +983,7 @@

    Classes

    # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. + Refer to https://docs.slack.dev/interactivity/implementing-shortcuts/ for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1051,9 +1051,9 @@

    Classes

    # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. - * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. - * Refer to https://api.slack.com/dialogs for actions in dialogs. + * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for actions in `blocks`. + * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for actions in `attachments`. + * Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1079,7 +1079,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `block_actions` action listener. - Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. + Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for details. """ def __call__(*args, **kwargs): @@ -1096,7 +1096,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `interactive_message` action listener. - Refer to https://api.slack.com/legacy/message-buttons for details.""" + Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1112,7 +1112,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_submission` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1128,7 +1128,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_cancellation` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1169,7 +1169,7 @@

    Classes

    # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1195,7 +1195,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1211,7 +1211,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_closed` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1252,8 +1252,8 @@

    Classes

    Refer to the following documents for details: - * https://api.slack.com/reference/block-kit/block-elements#external_select - * https://api.slack.com/reference/block-kit/block-elements#external_multi_select + * https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element#external_select + * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1293,7 +1293,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1443,9 +1443,9 @@

    Classes

    if __name__ == "__main__": app.start(port=int(os.environ.get("PORT", 3000)))
    -

    Refer to https://slack.dev/bolt-python/tutorial/getting-started for details.

    +

    Refer to https://docs.slack.dev/tools/bolt-python/building-an-app for details.

    If you would like to build an OAuth app for enabling the app to run with multiple workspaces, -refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app.

    +refer to https://docs.slack.dev/tools/bolt-python/concepts/authenticating-oauth to learn how to configure the app.

    Args

    logger
    @@ -1637,9 +1637,9 @@

    Methods

    # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. - * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. - * Refer to https://api.slack.com/dialogs for actions in dialogs. + * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for actions in `blocks`. + * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for actions in `attachments`. + * Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1668,9 +1668,9 @@

    Methods

    app.action("approve_button")(update_message)

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -1713,7 +1713,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `interactive_message` action listener. - Refer to https://api.slack.com/legacy/message-buttons for details.""" + Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1723,7 +1723,7 @@

    Args

    return __call__

    Registers a new interactive_message action listener. -Refer to https://api.slack.com/legacy/message-buttons for details.

    +Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for details.

    def block_action(self,
    constraints: str | Pattern | Dict[str, str | Pattern],
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -1740,7 +1740,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `block_actions` action listener. - Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. + Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for details. """ def __call__(*args, **kwargs): @@ -1751,7 +1751,7 @@

    Args

    return __call__

    Registers a new block_actions action listener. -Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details.

    +Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for details.

    def block_suggestion(self,
    action_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -1805,7 +1805,7 @@

    Args

    # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. + Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1836,7 +1836,7 @@

    Args

    # Pass a function to this method app.command("/echo")(repeat_text)
    -

    Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands.

    +

    Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details of Slash Commands.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -1899,7 +1899,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_cancellation` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1909,7 +1909,7 @@

    Args

    return __call__

    Registers a new dialog_cancellation listener. -Refer to https://api.slack.com/dialogs for details.

    +Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.

    def dialog_submission(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -1926,7 +1926,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_submission` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1936,7 +1936,7 @@

    Args

    return __call__

    Registers a new dialog_submission listener. -Refer to https://api.slack.com/dialogs for details.

    +Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.

    def dialog_suggestion(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -1953,7 +1953,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1963,7 +1963,7 @@

    Args

    return __call__

    Registers a new dialog_suggestion listener. -Refer to https://api.slack.com/dialogs for details.

    +Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.

    def dispatch(self,
    req: BoltRequest) ‑> BoltResponse
    @@ -2189,7 +2189,7 @@

    Args

    # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://api.slack.com/apis/connections/events-api for details of Events API. + Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2221,7 +2221,7 @@

    Args

    # Pass a function to this method app.event("team_join")(ask_for_introduction)
    -

    Refer to https://api.slack.com/apis/connections/events-api for details of Events API.

    +

    Refer to https://docs.slack.dev/apis/events-api/ for details of Events API.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2373,7 +2373,7 @@

    Args

    # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://api.slack.com/events/message for details of `message` events. + Refer to https://docs.slack.dev/reference/events/message/ for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2424,7 +2424,7 @@

    Args

    # Pass a function to this method app.message(":wave:")(say_hello)
    -

    Refer to https://api.slack.com/events/message for details of message events.

    +

    Refer to https://docs.slack.dev/reference/events/message/ for details of message events.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2484,7 +2484,7 @@

    Args

    # Pass a function to this method app.middleware(middleware_func) - Refer to https://slack.dev/bolt-python/concepts#global-middleware for details. + Refer to https://docs.slack.dev/tools/bolt-python/concepts/global-middleware for details. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2522,7 +2522,7 @@

    Args

    # Pass a function to this method app.middleware(middleware_func)
    -

    Refer to https://slack.dev/bolt-python/concepts#global-middleware for details.

    +

    Refer to https://docs.slack.dev/tools/bolt-python/concepts/global-middleware for details.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2567,8 +2567,8 @@

    Args

    Refer to the following documents for details: - * https://api.slack.com/reference/block-kit/block-elements#external_select - * https://api.slack.com/reference/block-kit/block-elements#external_multi_select + * https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element#external_select + * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2608,8 +2608,8 @@

    Args

    Refer to the following documents for details:

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2655,7 +2655,7 @@

    Args

    # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. + Refer to https://docs.slack.dev/interactivity/implementing-shortcuts/ for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2692,7 +2692,7 @@

    Args

    # Pass a function to this method app.shortcut("open_modal")(open_modal) -

    Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts.

    +

    Refer to https://docs.slack.dev/interactivity/implementing-shortcuts/ for details about Shortcuts.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2778,7 +2778,7 @@

    Args

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new step from app listener. @@ -2796,7 +2796,7 @@

    Args

    # Pass Step to set up listeners app.step(ws) - Refer to https://api.slack.com/workflows/steps for details of steps from apps. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2813,7 +2813,7 @@

    Args

    warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/" ), category=DeprecationWarning, ) @@ -2835,7 +2835,7 @@

    Args

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/

    Registers a new step from app listener.

    Unlike others, this method doesn't behave as a decorator. If you want to register a step from app by a decorator, use WorkflowStepBuilder's methods.

    @@ -2850,7 +2850,7 @@

    Args

    # Pass Step to set up listeners app.step(ws) -

    Refer to https://api.slack.com/workflows/steps for details of steps from apps.

    +

    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    For further information about WorkflowStep specific function arguments such as configure, update, complete, and fail, @@ -2921,7 +2921,7 @@

    Args

    # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2962,7 +2962,7 @@

    Args

    # Pass a function to this method app.view("view_1")(handle_submission) -

    Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads.

    +

    Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2991,7 +2991,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_closed` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3001,7 +3001,7 @@

    Args

    return __call__

    Registers a new view_closed listener. -Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.

    +Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_closed for details.

    def view_submission(self,
    constraints: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -3018,7 +3018,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3028,7 +3028,7 @@

    Args

    return __call__

    Registers a new view_submission listener. -Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.

    +Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.

    diff --git a/docs/reference/app/async_app.html b/docs/reference/app/async_app.html index b6634710a..78959986b 100644 --- a/docs/reference/app/async_app.html +++ b/docs/reference/app/async_app.html @@ -114,10 +114,10 @@

    Classes

    if __name__ == "__main__": app.start(port=int(os.environ.get("PORT", 3000))) - Refer to https://slack.dev/bolt-python/concepts#async for details. + Refer to https://docs.slack.dev/tools/bolt-python/concepts/async for details. If you would like to build an OAuth app for enabling the app to run with multiple workspaces, - refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app. + refer to https://docs.slack.dev/tools/bolt-python/concepts/authenticating-oauth to learn how to configure the app. Args: logger: The custom logger that can be used in this app. @@ -687,7 +687,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new step from app listener. @@ -705,7 +705,7 @@

    Classes

    # Pass Step to set up listeners app.step(ws) - Refer to https://api.slack.com/workflows/steps for details of steps from apps. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. For further information about AsyncWorkflowStep specific function arguments @@ -721,7 +721,7 @@

    Classes

    warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/" ), category=DeprecationWarning, ) @@ -803,7 +803,7 @@

    Classes

    # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://api.slack.com/apis/connections/events-api for details of Events API. + Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -841,7 +841,7 @@

    Classes

    # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://api.slack.com/events/message for details of `message` events. + Refer to https://docs.slack.dev/reference/events/message/ for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -956,7 +956,7 @@

    Classes

    # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. + Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1003,7 +1003,7 @@

    Classes

    # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. + Refer to https://docs.slack.dev/interactivity/implementing-shortcuts/ for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1071,9 +1071,9 @@

    Classes

    # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. - * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. - * Refer to https://api.slack.com/dialogs for actions in dialogs. + * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for actions in `blocks`. + * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for actions in `attachments`. + * Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1099,7 +1099,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `block_actions` action listener. - Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. + Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for details. """ def __call__(*args, **kwargs): @@ -1116,7 +1116,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `interactive_message` action listener. - Refer to https://api.slack.com/legacy/message-buttons for details.""" + Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1132,7 +1132,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1148,7 +1148,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1189,7 +1189,7 @@

    Classes

    # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1215,7 +1215,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_submission` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1231,7 +1231,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_closed` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1272,8 +1272,8 @@

    Classes

    Refer to the following documents for details: - * https://api.slack.com/reference/block-kit/block-elements#external_select - * https://api.slack.com/reference/block-kit/block-elements#external_multi_select + * https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element#external_select + * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1313,7 +1313,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1473,9 +1473,9 @@

    Classes

    if __name__ == "__main__": app.start(port=int(os.environ.get("PORT", 3000))) -

    Refer to https://slack.dev/bolt-python/concepts#async for details.

    +

    Refer to https://docs.slack.dev/tools/bolt-python/concepts/async for details.

    If you would like to build an OAuth app for enabling the app to run with multiple workspaces, -refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app.

    +refer to https://docs.slack.dev/tools/bolt-python/concepts/authenticating-oauth to learn how to configure the app.

    Args

    logger
    @@ -1669,9 +1669,9 @@

    Methods

    # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. - * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. - * Refer to https://api.slack.com/dialogs for actions in dialogs. + * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for actions in `blocks`. + * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for actions in `attachments`. + * Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1700,9 +1700,9 @@

    Methods

    app.action("approve_button")(update_message)

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -1873,7 +1873,7 @@

    Returns

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `interactive_message` action listener. - Refer to https://api.slack.com/legacy/message-buttons for details.""" + Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1883,7 +1883,7 @@

    Returns

    return __call__

    Registers a new interactive_message action listener. -Refer to https://api.slack.com/legacy/message-buttons for details.

    +Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for details.

    def block_action(self,
    constraints: str | Pattern | Dict[str, str | Pattern],
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None) ‑> Callable[..., Callable[..., Awaitable[BoltResponse | None]] | None]
    @@ -1900,7 +1900,7 @@

    Returns

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `block_actions` action listener. - Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. + Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for details. """ def __call__(*args, **kwargs): @@ -1911,7 +1911,7 @@

    Returns

    return __call__

    Registers a new block_actions action listener. -Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details.

    +Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for details.

    def block_suggestion(self,
    action_id: str | Pattern,
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None) ‑> Callable[..., Callable[..., Awaitable[BoltResponse | None]] | None]
    @@ -1965,7 +1965,7 @@

    Returns

    # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. + Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1996,7 +1996,7 @@

    Returns

    # Pass a function to this method app.command("/echo")(repeat_text)
    -

    Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands.

    +

    Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details of Slash Commands.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -2059,7 +2059,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -2069,7 +2069,7 @@

    Args

    return __call__

    Registers a new dialog_submission listener. -Refer to https://api.slack.com/dialogs for details.

    +Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.

    def dialog_submission(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None) ‑> Callable[..., Callable[..., Awaitable[BoltResponse | None]] | None]
    @@ -2086,7 +2086,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -2096,7 +2096,7 @@

    Args

    return __call__

    Registers a new dialog_submission listener. -Refer to https://api.slack.com/dialogs for details.

    +Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.

    def dialog_suggestion(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None) ‑> Callable[..., Callable[..., Awaitable[BoltResponse | None]] | None]
    @@ -2113,7 +2113,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -2123,7 +2123,7 @@

    Args

    return __call__

    Registers a new dialog_suggestion listener. -Refer to https://api.slack.com/dialogs for details.

    +Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.

    def enable_token_revocation_listeners(self) ‑> None @@ -2229,7 +2229,7 @@

    Args

    # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://api.slack.com/apis/connections/events-api for details of Events API. + Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -2261,7 +2261,7 @@

    Args

    # Pass a function to this method app.event("team_join")(ask_for_introduction)
    -

    Refer to https://api.slack.com/apis/connections/events-api for details of Events API.

    +

    Refer to https://docs.slack.dev/apis/events-api/ for details of Events API.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -2414,7 +2414,7 @@

    Args

    # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://api.slack.com/events/message for details of `message` events. + Refer to https://docs.slack.dev/reference/events/message/ for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -2468,7 +2468,7 @@

    Args

    # Pass a function to this method app.message(":wave:")(say_hello) -

    Refer to https://api.slack.com/events/message for details of message events.

    +

    Refer to https://docs.slack.dev/reference/events/message/ for details of message events.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -2608,8 +2608,8 @@

    Args

    Refer to the following documents for details: - * https://api.slack.com/reference/block-kit/block-elements#external_select - * https://api.slack.com/reference/block-kit/block-elements#external_multi_select + * https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element#external_select + * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -2649,8 +2649,8 @@

    Args

    Refer to the following documents for details:

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -2739,7 +2739,7 @@

    Args

    # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. + Refer to https://docs.slack.dev/interactivity/implementing-shortcuts/ for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -2776,7 +2776,7 @@

    Args

    # Pass a function to this method app.shortcut("open_modal")(open_modal) -

    Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts.

    +

    Refer to https://docs.slack.dev/interactivity/implementing-shortcuts/ for details about Shortcuts.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -2839,7 +2839,7 @@

    Args

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new step from app listener. @@ -2857,7 +2857,7 @@

    Args

    # Pass Step to set up listeners app.step(ws) - Refer to https://api.slack.com/workflows/steps for details of steps from apps. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. For further information about AsyncWorkflowStep specific function arguments @@ -2873,7 +2873,7 @@

    Args

    warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/" ), category=DeprecationWarning, ) @@ -2895,7 +2895,7 @@

    Args

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/

    Registers a new step from app listener.

    Unlike others, this method doesn't behave as a decorator. If you want to register a step from app by a decorator, use AsyncWorkflowStepBuilder's methods.

    @@ -2910,7 +2910,7 @@

    Args

    # Pass Step to set up listeners app.step(ws) -

    Refer to https://api.slack.com/workflows/steps for details of steps from apps.

    +

    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document. For further information about AsyncWorkflowStep specific function arguments such as configure, update, complete, and fail, @@ -2978,7 +2978,7 @@

    Args

    # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -3019,7 +3019,7 @@

    Args

    # Pass a function to this method app.view("view_1")(handle_submission) -

    Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads.

    +

    Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -3048,7 +3048,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_closed` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3058,7 +3058,7 @@

    Args

    return __call__

    Registers a new view_closed listener. -Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.

    +Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_closed for details.

    def view_submission(self,
    constraints: str | Pattern,
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None) ‑> Callable[..., Callable[..., Awaitable[BoltResponse | None]] | None]
    @@ -3075,7 +3075,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_submission` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3085,7 +3085,7 @@

    Args

    return __call__

    Registers a new view_submission listener. -Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.

    +Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.

    def web_app(self, path: str = '/slack/events', port: int = 3000) ‑> aiohttp.web_app.Application diff --git a/docs/reference/app/index.html b/docs/reference/app/index.html index 857fb22c8..a46bc2e71 100644 --- a/docs/reference/app/index.html +++ b/docs/reference/app/index.html @@ -136,10 +136,10 @@

    Classes

    if __name__ == "__main__": app.start(port=int(os.environ.get("PORT", 3000))) - Refer to https://slack.dev/bolt-python/tutorial/getting-started for details. + Refer to https://docs.slack.dev/tools/bolt-python/building-an-app for details. If you would like to build an OAuth app for enabling the app to run with multiple workspaces, - refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app. + refer to https://docs.slack.dev/tools/bolt-python/concepts/authenticating-oauth to learn how to configure the app. Args: logger: The custom logger that can be used in this app. @@ -648,7 +648,7 @@

    Classes

    # Pass a function to this method app.middleware(middleware_func) - Refer to https://slack.dev/bolt-python/concepts#global-middleware for details. + Refer to https://docs.slack.dev/tools/bolt-python/concepts/global-middleware for details. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -694,7 +694,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new step from app listener. @@ -712,7 +712,7 @@

    Classes

    # Pass Step to set up listeners app.step(ws) - Refer to https://api.slack.com/workflows/steps for details of steps from apps. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -729,7 +729,7 @@

    Classes

    warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/" ), category=DeprecationWarning, ) @@ -806,7 +806,7 @@

    Classes

    # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://api.slack.com/apis/connections/events-api for details of Events API. + Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -844,7 +844,7 @@

    Classes

    # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://api.slack.com/events/message for details of `message` events. + Refer to https://docs.slack.dev/reference/events/message/ for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -955,7 +955,7 @@

    Classes

    # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. + Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1002,7 +1002,7 @@

    Classes

    # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. + Refer to https://docs.slack.dev/interactivity/implementing-shortcuts/ for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1070,9 +1070,9 @@

    Classes

    # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. - * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. - * Refer to https://api.slack.com/dialogs for actions in dialogs. + * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for actions in `blocks`. + * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for actions in `attachments`. + * Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1098,7 +1098,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `block_actions` action listener. - Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. + Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for details. """ def __call__(*args, **kwargs): @@ -1115,7 +1115,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `interactive_message` action listener. - Refer to https://api.slack.com/legacy/message-buttons for details.""" + Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1131,7 +1131,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_submission` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1147,7 +1147,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_cancellation` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1188,7 +1188,7 @@

    Classes

    # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1214,7 +1214,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1230,7 +1230,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_closed` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1271,8 +1271,8 @@

    Classes

    Refer to the following documents for details: - * https://api.slack.com/reference/block-kit/block-elements#external_select - * https://api.slack.com/reference/block-kit/block-elements#external_multi_select + * https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element#external_select + * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1312,7 +1312,7 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1462,9 +1462,9 @@

    Classes

    if __name__ == "__main__": app.start(port=int(os.environ.get("PORT", 3000)))
    -

    Refer to https://slack.dev/bolt-python/tutorial/getting-started for details.

    +

    Refer to https://docs.slack.dev/tools/bolt-python/building-an-app for details.

    If you would like to build an OAuth app for enabling the app to run with multiple workspaces, -refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app.

    +refer to https://docs.slack.dev/tools/bolt-python/concepts/authenticating-oauth to learn how to configure the app.

    Args

    logger
    @@ -1656,9 +1656,9 @@

    Methods

    # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. - * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. - * Refer to https://api.slack.com/dialogs for actions in dialogs. + * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for actions in `blocks`. + * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for actions in `attachments`. + * Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1687,9 +1687,9 @@

    Methods

    app.action("approve_button")(update_message)

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -1732,7 +1732,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `interactive_message` action listener. - Refer to https://api.slack.com/legacy/message-buttons for details.""" + Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1742,7 +1742,7 @@

    Args

    return __call__

    Registers a new interactive_message action listener. -Refer to https://api.slack.com/legacy/message-buttons for details.

    +Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for details.

    def block_action(self,
    constraints: str | Pattern | Dict[str, str | Pattern],
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -1759,7 +1759,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `block_actions` action listener. - Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. + Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for details. """ def __call__(*args, **kwargs): @@ -1770,7 +1770,7 @@

    Args

    return __call__

    Registers a new block_actions action listener. -Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details.

    +Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for details.

    def block_suggestion(self,
    action_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -1824,7 +1824,7 @@

    Args

    # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. + Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1855,7 +1855,7 @@

    Args

    # Pass a function to this method app.command("/echo")(repeat_text)
    -

    Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands.

    +

    Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details of Slash Commands.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -1918,7 +1918,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_cancellation` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1928,7 +1928,7 @@

    Args

    return __call__

    Registers a new dialog_cancellation listener. -Refer to https://api.slack.com/dialogs for details.

    +Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.

    def dialog_submission(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -1945,7 +1945,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_submission` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1955,7 +1955,7 @@

    Args

    return __call__

    Registers a new dialog_submission listener. -Refer to https://api.slack.com/dialogs for details.

    +Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.

    def dialog_suggestion(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -1972,7 +1972,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1982,7 +1982,7 @@

    Args

    return __call__

    Registers a new dialog_suggestion listener. -Refer to https://api.slack.com/dialogs for details.

    +Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.

    def dispatch(self,
    req: BoltRequest) ‑> BoltResponse
    @@ -2208,7 +2208,7 @@

    Args

    # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://api.slack.com/apis/connections/events-api for details of Events API. + Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2240,7 +2240,7 @@

    Args

    # Pass a function to this method app.event("team_join")(ask_for_introduction)
    -

    Refer to https://api.slack.com/apis/connections/events-api for details of Events API.

    +

    Refer to https://docs.slack.dev/apis/events-api/ for details of Events API.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2392,7 +2392,7 @@

    Args

    # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://api.slack.com/events/message for details of `message` events. + Refer to https://docs.slack.dev/reference/events/message/ for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2443,7 +2443,7 @@

    Args

    # Pass a function to this method app.message(":wave:")(say_hello) -

    Refer to https://api.slack.com/events/message for details of message events.

    +

    Refer to https://docs.slack.dev/reference/events/message/ for details of message events.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2503,7 +2503,7 @@

    Args

    # Pass a function to this method app.middleware(middleware_func) - Refer to https://slack.dev/bolt-python/concepts#global-middleware for details. + Refer to https://docs.slack.dev/tools/bolt-python/concepts/global-middleware for details. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2541,7 +2541,7 @@

    Args

    # Pass a function to this method app.middleware(middleware_func) -

    Refer to https://slack.dev/bolt-python/concepts#global-middleware for details.

    +

    Refer to https://docs.slack.dev/tools/bolt-python/concepts/global-middleware for details.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2586,8 +2586,8 @@

    Args

    Refer to the following documents for details: - * https://api.slack.com/reference/block-kit/block-elements#external_select - * https://api.slack.com/reference/block-kit/block-elements#external_multi_select + * https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element#external_select + * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2627,8 +2627,8 @@

    Args

    Refer to the following documents for details:

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2674,7 +2674,7 @@

    Args

    # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. + Refer to https://docs.slack.dev/interactivity/implementing-shortcuts/ for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2711,7 +2711,7 @@

    Args

    # Pass a function to this method app.shortcut("open_modal")(open_modal) -

    Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts.

    +

    Refer to https://docs.slack.dev/interactivity/implementing-shortcuts/ for details about Shortcuts.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2797,7 +2797,7 @@

    Args

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new step from app listener. @@ -2815,7 +2815,7 @@

    Args

    # Pass Step to set up listeners app.step(ws) - Refer to https://api.slack.com/workflows/steps for details of steps from apps. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2832,7 +2832,7 @@

    Args

    warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/" ), category=DeprecationWarning, ) @@ -2854,7 +2854,7 @@

    Args

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/

    Registers a new step from app listener.

    Unlike others, this method doesn't behave as a decorator. If you want to register a step from app by a decorator, use WorkflowStepBuilder's methods.

    @@ -2869,7 +2869,7 @@

    Args

    # Pass Step to set up listeners app.step(ws) -

    Refer to https://api.slack.com/workflows/steps for details of steps from apps.

    +

    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    For further information about WorkflowStep specific function arguments such as configure, update, complete, and fail, @@ -2940,7 +2940,7 @@

    Args

    # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2981,7 +2981,7 @@

    Args

    # Pass a function to this method app.view("view_1")(handle_submission) -

    Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads.

    +

    Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -3010,7 +3010,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_closed` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3020,7 +3020,7 @@

    Args

    return __call__

    Registers a new view_closed listener. -Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.

    +Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_closed for details.

    def view_submission(self,
    constraints: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -3037,7 +3037,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3047,7 +3047,7 @@

    Args

    return __call__

    Registers a new view_submission listener. -Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.

    +Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.

    diff --git a/docs/reference/async_app.html b/docs/reference/async_app.html index ad9192253..707bfc3dd 100644 --- a/docs/reference/async_app.html +++ b/docs/reference/async_app.html @@ -205,10 +205,10 @@

    Class variables

    if __name__ == "__main__": app.start(port=int(os.environ.get("PORT", 3000))) - Refer to https://slack.dev/bolt-python/concepts#async for details. + Refer to https://docs.slack.dev/tools/bolt-python/concepts/async for details. If you would like to build an OAuth app for enabling the app to run with multiple workspaces, - refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app. + refer to https://docs.slack.dev/tools/bolt-python/concepts/authenticating-oauth to learn how to configure the app. Args: logger: The custom logger that can be used in this app. @@ -778,7 +778,7 @@

    Class variables

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new step from app listener. @@ -796,7 +796,7 @@

    Class variables

    # Pass Step to set up listeners app.step(ws) - Refer to https://api.slack.com/workflows/steps for details of steps from apps. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. For further information about AsyncWorkflowStep specific function arguments @@ -812,7 +812,7 @@

    Class variables

    warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/" ), category=DeprecationWarning, ) @@ -894,7 +894,7 @@

    Class variables

    # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://api.slack.com/apis/connections/events-api for details of Events API. + Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -932,7 +932,7 @@

    Class variables

    # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://api.slack.com/events/message for details of `message` events. + Refer to https://docs.slack.dev/reference/events/message/ for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1047,7 +1047,7 @@

    Class variables

    # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. + Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1094,7 +1094,7 @@

    Class variables

    # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. + Refer to https://docs.slack.dev/interactivity/implementing-shortcuts/ for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1162,9 +1162,9 @@

    Class variables

    # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. - * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. - * Refer to https://api.slack.com/dialogs for actions in dialogs. + * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for actions in `blocks`. + * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for actions in `attachments`. + * Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1190,7 +1190,7 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `block_actions` action listener. - Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. + Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for details. """ def __call__(*args, **kwargs): @@ -1207,7 +1207,7 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `interactive_message` action listener. - Refer to https://api.slack.com/legacy/message-buttons for details.""" + Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1223,7 +1223,7 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1239,7 +1239,7 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1280,7 +1280,7 @@

    Class variables

    # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1306,7 +1306,7 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_submission` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1322,7 +1322,7 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_closed` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1363,8 +1363,8 @@

    Class variables

    Refer to the following documents for details: - * https://api.slack.com/reference/block-kit/block-elements#external_select - * https://api.slack.com/reference/block-kit/block-elements#external_multi_select + * https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element#external_select + * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1404,7 +1404,7 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1564,9 +1564,9 @@

    Class variables

    if __name__ == "__main__": app.start(port=int(os.environ.get("PORT", 3000))) -

    Refer to https://slack.dev/bolt-python/concepts#async for details.

    +

    Refer to https://docs.slack.dev/tools/bolt-python/concepts/async for details.

    If you would like to build an OAuth app for enabling the app to run with multiple workspaces, -refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app.

    +refer to https://docs.slack.dev/tools/bolt-python/concepts/authenticating-oauth to learn how to configure the app.

    Args

    logger
    @@ -1760,9 +1760,9 @@

    Methods

    # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. - * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. - * Refer to https://api.slack.com/dialogs for actions in dialogs. + * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for actions in `blocks`. + * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for actions in `attachments`. + * Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1791,9 +1791,9 @@

    Methods

    app.action("approve_button")(update_message)

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -1964,7 +1964,7 @@

    Returns

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `interactive_message` action listener. - Refer to https://api.slack.com/legacy/message-buttons for details.""" + Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1974,7 +1974,7 @@

    Returns

    return __call__

    Registers a new interactive_message action listener. -Refer to https://api.slack.com/legacy/message-buttons for details.

    +Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for details.

    def block_action(self,
    constraints: str | Pattern | Dict[str, str | Pattern],
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None) ‑> Callable[..., Callable[..., Awaitable[BoltResponse | None]] | None]
    @@ -1991,7 +1991,7 @@

    Returns

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `block_actions` action listener. - Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. + Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for details. """ def __call__(*args, **kwargs): @@ -2002,7 +2002,7 @@

    Returns

    return __call__

    Registers a new block_actions action listener. -Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details.

    +Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for details.

    def block_suggestion(self,
    action_id: str | Pattern,
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None) ‑> Callable[..., Callable[..., Awaitable[BoltResponse | None]] | None]
    @@ -2056,7 +2056,7 @@

    Returns

    # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. + Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -2087,7 +2087,7 @@

    Returns

    # Pass a function to this method app.command("/echo")(repeat_text)
    -

    Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands.

    +

    Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details of Slash Commands.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -2150,7 +2150,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -2160,7 +2160,7 @@

    Args

    return __call__

    Registers a new dialog_submission listener. -Refer to https://api.slack.com/dialogs for details.

    +Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.

    def dialog_submission(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None) ‑> Callable[..., Callable[..., Awaitable[BoltResponse | None]] | None]
    @@ -2177,7 +2177,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -2187,7 +2187,7 @@

    Args

    return __call__

    Registers a new dialog_submission listener. -Refer to https://api.slack.com/dialogs for details.

    +Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.

    def dialog_suggestion(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None) ‑> Callable[..., Callable[..., Awaitable[BoltResponse | None]] | None]
    @@ -2204,7 +2204,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -2214,7 +2214,7 @@

    Args

    return __call__

    Registers a new dialog_suggestion listener. -Refer to https://api.slack.com/dialogs for details.

    +Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.

    def enable_token_revocation_listeners(self) ‑> None @@ -2320,7 +2320,7 @@

    Args

    # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://api.slack.com/apis/connections/events-api for details of Events API. + Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -2352,7 +2352,7 @@

    Args

    # Pass a function to this method app.event("team_join")(ask_for_introduction)
    -

    Refer to https://api.slack.com/apis/connections/events-api for details of Events API.

    +

    Refer to https://docs.slack.dev/apis/events-api/ for details of Events API.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -2505,7 +2505,7 @@

    Args

    # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://api.slack.com/events/message for details of `message` events. + Refer to https://docs.slack.dev/reference/events/message/ for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -2559,7 +2559,7 @@

    Args

    # Pass a function to this method app.message(":wave:")(say_hello) -

    Refer to https://api.slack.com/events/message for details of message events.

    +

    Refer to https://docs.slack.dev/reference/events/message/ for details of message events.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -2699,8 +2699,8 @@

    Args

    Refer to the following documents for details: - * https://api.slack.com/reference/block-kit/block-elements#external_select - * https://api.slack.com/reference/block-kit/block-elements#external_multi_select + * https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element#external_select + * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -2740,8 +2740,8 @@

    Args

    Refer to the following documents for details:

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -2830,7 +2830,7 @@

    Args

    # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. + Refer to https://docs.slack.dev/interactivity/implementing-shortcuts/ for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -2867,7 +2867,7 @@

    Args

    # Pass a function to this method app.shortcut("open_modal")(open_modal) -

    Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts.

    +

    Refer to https://docs.slack.dev/interactivity/implementing-shortcuts/ for details about Shortcuts.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -2930,7 +2930,7 @@

    Args

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new step from app listener. @@ -2948,7 +2948,7 @@

    Args

    # Pass Step to set up listeners app.step(ws) - Refer to https://api.slack.com/workflows/steps for details of steps from apps. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. For further information about AsyncWorkflowStep specific function arguments @@ -2964,7 +2964,7 @@

    Args

    warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/" ), category=DeprecationWarning, ) @@ -2986,7 +2986,7 @@

    Args

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/

    Registers a new step from app listener.

    Unlike others, this method doesn't behave as a decorator. If you want to register a step from app by a decorator, use AsyncWorkflowStepBuilder's methods.

    @@ -3001,7 +3001,7 @@

    Args

    # Pass Step to set up listeners app.step(ws) -

    Refer to https://api.slack.com/workflows/steps for details of steps from apps.

    +

    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document. For further information about AsyncWorkflowStep specific function arguments such as configure, update, complete, and fail, @@ -3069,7 +3069,7 @@

    Args

    # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -3110,7 +3110,7 @@

    Args

    # Pass a function to this method app.view("view_1")(handle_submission) -

    Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads.

    +

    Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.async_args's API document.

    Args

    @@ -3139,7 +3139,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_closed` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3149,7 +3149,7 @@

    Args

    return __call__

    Registers a new view_closed listener. -Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.

    +Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_closed for details.

    def view_submission(self,
    constraints: str | Pattern,
    matchers: Sequence[Callable[..., Awaitable[bool]]] | None = None,
    middleware: Sequence[Callable | AsyncMiddleware] | None = None) ‑> Callable[..., Callable[..., Awaitable[BoltResponse | None]] | None]
    @@ -3166,7 +3166,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_submission` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3176,7 +3176,7 @@

    Args

    return __call__

    Registers a new view_submission listener. -Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.

    +Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.

    def web_app(self, path: str = '/slack/events', port: int = 3000) ‑> aiohttp.web_app.Application diff --git a/docs/reference/authorization/index.html b/docs/reference/authorization/index.html index 64ca14f0e..19de311df 100644 --- a/docs/reference/authorization/index.html +++ b/docs/reference/authorization/index.html @@ -39,7 +39,7 @@

    Module slack_bolt.authorization

    Authorization is the process of determining which Slack credentials should be available while processing an incoming Slack event.

    -

    Refer to https://slack.dev/bolt-python/concepts#authorization for details.

    +

    Refer to https://docs.slack.dev/tools/bolt-python/concepts/authorization for details.

    Sub-modules

    diff --git a/docs/reference/context/assistant/thread_context_store/file/index.html b/docs/reference/context/assistant/thread_context_store/file/index.html index 4a5d944e1..cbb4e4db6 100644 --- a/docs/reference/context/assistant/thread_context_store/file/index.html +++ b/docs/reference/context/assistant/thread_context_store/file/index.html @@ -48,7 +48,7 @@

    Classes

    class FileAssistantThreadContextStore -(base_dir: str = '/Users/wbergamin/.bolt-app-assistant-thread-contexts') +(base_dir: str = '/Users/eden.zimbelman/.bolt-app-assistant-thread-contexts')
    diff --git a/docs/reference/context/index.html b/docs/reference/context/index.html index 65cb8054c..c761aa47e 100644 --- a/docs/reference/context/index.html +++ b/docs/reference/context/index.html @@ -40,7 +40,7 @@

    Module slack_bolt.context

    All listeners have access to a context dictionary, which can be used to enrich events with additional information. Bolt automatically attaches information that is included in the incoming event, like user_id, team_id, channel_id, and enterprise_id.

    -

    Refer to https://slack.dev/bolt-python/concepts#context for details.

    +

    Refer to https://docs.slack.dev/tools/bolt-python/concepts/context for details.

    Sub-modules

    diff --git a/docs/reference/index.html b/docs/reference/index.html index 430e36813..1ce8cd134 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -36,9 +36,9 @@

    Package slack_bolt

    -

    A Python framework to build Slack apps in a flash with the latest platform features.Read the getting started guide and look at our code examples to learn how to build apps using Bolt.

    +

    A Python framework to build Slack apps in a flash with the latest platform features.Read the getting started guide and look at our code examples to learn how to build apps using Bolt.

    @@ -257,10 +257,10 @@

    Class variables

    if __name__ == "__main__": app.start(port=int(os.environ.get("PORT", 3000))) - Refer to https://slack.dev/bolt-python/tutorial/getting-started for details. + Refer to https://docs.slack.dev/tools/bolt-python/building-an-app for details. If you would like to build an OAuth app for enabling the app to run with multiple workspaces, - refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app. + refer to https://docs.slack.dev/tools/bolt-python/concepts/authenticating-oauth to learn how to configure the app. Args: logger: The custom logger that can be used in this app. @@ -769,7 +769,7 @@

    Class variables

    # Pass a function to this method app.middleware(middleware_func) - Refer to https://slack.dev/bolt-python/concepts#global-middleware for details. + Refer to https://docs.slack.dev/tools/bolt-python/concepts/global-middleware for details. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -815,7 +815,7 @@

    Class variables

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new step from app listener. @@ -833,7 +833,7 @@

    Class variables

    # Pass Step to set up listeners app.step(ws) - Refer to https://api.slack.com/workflows/steps for details of steps from apps. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -850,7 +850,7 @@

    Class variables

    warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/" ), category=DeprecationWarning, ) @@ -927,7 +927,7 @@

    Class variables

    # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://api.slack.com/apis/connections/events-api for details of Events API. + Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -965,7 +965,7 @@

    Class variables

    # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://api.slack.com/events/message for details of `message` events. + Refer to https://docs.slack.dev/reference/events/message/ for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1076,7 +1076,7 @@

    Class variables

    # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. + Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1123,7 +1123,7 @@

    Class variables

    # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. + Refer to https://docs.slack.dev/interactivity/implementing-shortcuts/ for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1191,9 +1191,9 @@

    Class variables

    # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. - * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. - * Refer to https://api.slack.com/dialogs for actions in dialogs. + * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for actions in `blocks`. + * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for actions in `attachments`. + * Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1219,7 +1219,7 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `block_actions` action listener. - Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. + Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for details. """ def __call__(*args, **kwargs): @@ -1236,7 +1236,7 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `interactive_message` action listener. - Refer to https://api.slack.com/legacy/message-buttons for details.""" + Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1252,7 +1252,7 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_submission` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1268,7 +1268,7 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_cancellation` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1309,7 +1309,7 @@

    Class variables

    # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1335,7 +1335,7 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1351,7 +1351,7 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_closed` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1392,8 +1392,8 @@

    Class variables

    Refer to the following documents for details: - * https://api.slack.com/reference/block-kit/block-elements#external_select - * https://api.slack.com/reference/block-kit/block-elements#external_multi_select + * https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element#external_select + * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1433,7 +1433,7 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1583,9 +1583,9 @@

    Class variables

    if __name__ == "__main__": app.start(port=int(os.environ.get("PORT", 3000)))
    -

    Refer to https://slack.dev/bolt-python/tutorial/getting-started for details.

    +

    Refer to https://docs.slack.dev/tools/bolt-python/building-an-app for details.

    If you would like to build an OAuth app for enabling the app to run with multiple workspaces, -refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app.

    +refer to https://docs.slack.dev/tools/bolt-python/concepts/authenticating-oauth to learn how to configure the app.

    Args

    logger
    @@ -1777,9 +1777,9 @@

    Methods

    # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. - * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. - * Refer to https://api.slack.com/dialogs for actions in dialogs. + * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for actions in `blocks`. + * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for actions in `attachments`. + * Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1808,9 +1808,9 @@

    Methods

    app.action("approve_button")(update_message)

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -1853,7 +1853,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `interactive_message` action listener. - Refer to https://api.slack.com/legacy/message-buttons for details.""" + Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1863,7 +1863,7 @@

    Args

    return __call__

    Registers a new interactive_message action listener. -Refer to https://api.slack.com/legacy/message-buttons for details.

    +Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for details.

    def block_action(self,
    constraints: str | Pattern | Dict[str, str | Pattern],
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -1880,7 +1880,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `block_actions` action listener. - Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. + Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for details. """ def __call__(*args, **kwargs): @@ -1891,7 +1891,7 @@

    Args

    return __call__

    Registers a new block_actions action listener. -Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details.

    +Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for details.

    def block_suggestion(self,
    action_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -1945,7 +1945,7 @@

    Args

    # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. + Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1976,7 +1976,7 @@

    Args

    # Pass a function to this method app.command("/echo")(repeat_text)
    -

    Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands.

    +

    Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details of Slash Commands.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2039,7 +2039,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_cancellation` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -2049,7 +2049,7 @@

    Args

    return __call__

    Registers a new dialog_cancellation listener. -Refer to https://api.slack.com/dialogs for details.

    +Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.

    def dialog_submission(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -2066,7 +2066,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_submission` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -2076,7 +2076,7 @@

    Args

    return __call__

    Registers a new dialog_submission listener. -Refer to https://api.slack.com/dialogs for details.

    +Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.

    def dialog_suggestion(self,
    callback_id: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -2093,7 +2093,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -2103,7 +2103,7 @@

    Args

    return __call__

    Registers a new dialog_suggestion listener. -Refer to https://api.slack.com/dialogs for details.

    +Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.

    def dispatch(self,
    req: BoltRequest) ‑> BoltResponse
    @@ -2329,7 +2329,7 @@

    Args

    # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://api.slack.com/apis/connections/events-api for details of Events API. + Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2361,7 +2361,7 @@

    Args

    # Pass a function to this method app.event("team_join")(ask_for_introduction)
    -

    Refer to https://api.slack.com/apis/connections/events-api for details of Events API.

    +

    Refer to https://docs.slack.dev/apis/events-api/ for details of Events API.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2513,7 +2513,7 @@

    Args

    # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://api.slack.com/events/message for details of `message` events. + Refer to https://docs.slack.dev/reference/events/message/ for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2564,7 +2564,7 @@

    Args

    # Pass a function to this method app.message(":wave:")(say_hello) -

    Refer to https://api.slack.com/events/message for details of message events.

    +

    Refer to https://docs.slack.dev/reference/events/message/ for details of message events.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2624,7 +2624,7 @@

    Args

    # Pass a function to this method app.middleware(middleware_func) - Refer to https://slack.dev/bolt-python/concepts#global-middleware for details. + Refer to https://docs.slack.dev/tools/bolt-python/concepts/global-middleware for details. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2662,7 +2662,7 @@

    Args

    # Pass a function to this method app.middleware(middleware_func) -

    Refer to https://slack.dev/bolt-python/concepts#global-middleware for details.

    +

    Refer to https://docs.slack.dev/tools/bolt-python/concepts/global-middleware for details.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2707,8 +2707,8 @@

    Args

    Refer to the following documents for details: - * https://api.slack.com/reference/block-kit/block-elements#external_select - * https://api.slack.com/reference/block-kit/block-elements#external_multi_select + * https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element#external_select + * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2748,8 +2748,8 @@

    Args

    Refer to the following documents for details:

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2795,7 +2795,7 @@

    Args

    # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. + Refer to https://docs.slack.dev/interactivity/implementing-shortcuts/ for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2832,7 +2832,7 @@

    Args

    # Pass a function to this method app.shortcut("open_modal")(open_modal) -

    Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts.

    +

    Refer to https://docs.slack.dev/interactivity/implementing-shortcuts/ for details about Shortcuts.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -2918,7 +2918,7 @@

    Args

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new step from app listener. @@ -2936,7 +2936,7 @@

    Args

    # Pass Step to set up listeners app.step(ws) - Refer to https://api.slack.com/workflows/steps for details of steps from apps. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -2953,7 +2953,7 @@

    Args

    warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/" ), category=DeprecationWarning, ) @@ -2975,7 +2975,7 @@

    Args

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/

    Registers a new step from app listener.

    Unlike others, this method doesn't behave as a decorator. If you want to register a step from app by a decorator, use WorkflowStepBuilder's methods.

    @@ -2990,7 +2990,7 @@

    Args

    # Pass Step to set up listeners app.step(ws) -

    Refer to https://api.slack.com/workflows/steps for details of steps from apps.

    +

    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    For further information about WorkflowStep specific function arguments such as configure, update, complete, and fail, @@ -3061,7 +3061,7 @@

    Args

    # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -3102,7 +3102,7 @@

    Args

    # Pass a function to this method app.view("view_1")(handle_submission) -

    Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads.

    +

    Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads.

    To learn available arguments for middleware/listeners, see slack_bolt.kwargs_injection.args's API document.

    Args

    @@ -3131,7 +3131,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_closed` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3141,7 +3141,7 @@

    Args

    return __call__

    Registers a new view_closed listener. -Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.

    +Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_closed for details.

    def view_submission(self,
    constraints: str | Pattern,
    matchers: Sequence[Callable[..., bool]] | None = None,
    middleware: Sequence[Callable | Middleware] | None = None) ‑> Callable[..., Callable[..., BoltResponse | None] | None]
    @@ -3158,7 +3158,7 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3168,7 +3168,7 @@

    Args

    return __call__

    Registers a new view_submission listener. -Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.

    +Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.

    @@ -5225,7 +5225,7 @@

    Class variables

    class FileAssistantThreadContextStore -(base_dir: str = '/Users/wbergamin/.bolt-app-assistant-thread-contexts') +(base_dir: str = '/Users/eden.zimbelman/.bolt-app-assistant-thread-contexts')
    diff --git a/docs/reference/lazy_listener/index.html b/docs/reference/lazy_listener/index.html index c2eb1c9b0..6bc17015e 100644 --- a/docs/reference/lazy_listener/index.html +++ b/docs/reference/lazy_listener/index.html @@ -56,7 +56,7 @@

    Module slack_bolt.lazy_listener

    lazy=[run_long_process] ) -

    Refer to https://slack.dev/bolt-python/concepts#lazy-listeners for more details.

    +

    Refer to https://docs.slack.dev/tools/bolt-python/concepts/lazy-listeners for more details.

    Sub-modules

    diff --git a/docs/reference/listener_matcher/builtins.html b/docs/reference/listener_matcher/builtins.html index d951deada..a5aff3d0b 100644 --- a/docs/reference/listener_matcher/builtins.html +++ b/docs/reference/listener_matcher/builtins.html @@ -80,7 +80,7 @@

    Functions

    return dialog_submission(constraints["callback_id"], asyncio) if action_type == "dialog_cancellation": return dialog_cancellation(constraints["callback_id"], asyncio) - # https://api.slack.com/workflows/steps + # https://docs.slack.dev/legacy/legacy-steps-from-apps/ if action_type == "workflow_step_edit": return workflow_step_edit(constraints["callback_id"], asyncio) diff --git a/docs/reference/logger/messages.html b/docs/reference/logger/messages.html index 85e0d94dd..1072e6479 100644 --- a/docs/reference/logger/messages.html +++ b/docs/reference/logger/messages.html @@ -303,7 +303,7 @@

    Functions

    "Bolt has enabled the file-based InstallationStore/OAuthStateStore for you. " "Note that these file-based stores are for local development. " "If you'd like to use a different data store, set the oauth_settings argument in the App constructor. " - "Please refer to https://slack.dev/bolt-python/concepts#authenticating-oauth for more details." + "Please refer to https://docs.slack.dev/tools/bolt-python/concepts/authenticating-oauth for more details." )
    diff --git a/docs/reference/middleware/async_builtins.html b/docs/reference/middleware/async_builtins.html index 7528dc0bb..d32deff15 100644 --- a/docs/reference/middleware/async_builtins.html +++ b/docs/reference/middleware/async_builtins.html @@ -205,7 +205,7 @@

    Inherited members

    """Verifies an incoming request by checking the validity of `x-slack-signature`, `x-slack-request-timestamp`, and its body data. - Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details. + Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack/ for details. """ async def async_process( @@ -232,10 +232,10 @@

    Inherited members

    Verifies an incoming request by checking the validity of x-slack-signature, x-slack-request-timestamp, and its body data.

    -

    Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details.

    +

    Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack/ for details.

    Verifies an incoming request by checking the validity of x-slack-signature, x-slack-request-timestamp, and its body data.

    -

    Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details.

    +

    Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack/ for details.

    Args

    signing_secret
    @@ -293,12 +293,12 @@

    Inherited members

    A middleware can process request data before other middleware and listener functions.

    Handles ssl_check requests. -Refer to https://api.slack.com/interactivity/slash-commands for details.

    +Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details.

    Args

    verification_token
    The verification token to check -(optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation)
    +(optional as it's already deprecated - https://docs.slack.dev/authentication/verifying-requests-from-slack/#deprecation)
    base_logger
    The base logger
    @@ -352,7 +352,7 @@

    Inherited members

    A middleware can process request data before other middleware and listener functions.

    Handles url_verification requests.

    -

    Refer to https://api.slack.com/events/url_verification for details.

    +

    Refer to https://docs.slack.dev/reference/events/url_verification/ for details.

    Args

    base_logger
    diff --git a/docs/reference/middleware/index.html b/docs/reference/middleware/index.html index 98aa15c5d..05d773415 100644 --- a/docs/reference/middleware/index.html +++ b/docs/reference/middleware/index.html @@ -639,7 +639,7 @@

    Inherited members

    """Verifies an incoming request by checking the validity of `x-slack-signature`, `x-slack-request-timestamp`, and its body data. - Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details. + Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack/ for details. Args: signing_secret: The signing secret @@ -688,7 +688,7 @@

    Inherited members

    A middleware can process request data before other middleware and listener functions.

    Verifies an incoming request by checking the validity of x-slack-signature, x-slack-request-timestamp, and its body data.

    -

    Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details.

    +

    Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack/ for details.

    Args

    signing_secret
    @@ -834,11 +834,11 @@

    Inherited members

    base_logger: Optional[Logger] = None, ): """Handles `ssl_check` requests. - Refer to https://api.slack.com/interactivity/slash-commands for details. + Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details. Args: verification_token: The verification token to check - (optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation) + (optional as it's already deprecated - https://docs.slack.dev/authentication/verifying-requests-from-slack/#deprecation) base_logger: The base logger """ # noqa: E501 self.verification_token = verification_token @@ -880,12 +880,12 @@

    Inherited members

    A middleware can process request data before other middleware and listener functions.

    Handles slack_bolt.middleware.ssl_check requests. -Refer to https://api.slack.com/interactivity/slash-commands for details.

    +Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details.

    Args

    verification_token
    The verification token to check -(optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation)
    +(optional as it's already deprecated - https://docs.slack.dev/authentication/verifying-requests-from-slack/#deprecation)
    base_logger
    The base logger
    @@ -931,7 +931,7 @@

    Inherited members

    def __init__(self, base_logger: Optional[Logger] = None): """Handles url_verification requests. - Refer to https://api.slack.com/events/url_verification for details. + Refer to https://docs.slack.dev/reference/events/url_verification/ for details. Args: base_logger: The base logger @@ -965,7 +965,7 @@

    Inherited members

    A middleware can process request data before other middleware and listener functions.

    Handles url_verification requests.

    -

    Refer to https://api.slack.com/events/url_verification for details.

    +

    Refer to https://docs.slack.dev/reference/events/url_verification/ for details.

    Args

    base_logger
    diff --git a/docs/reference/middleware/request_verification/async_request_verification.html b/docs/reference/middleware/request_verification/async_request_verification.html index dc2b20908..192f77933 100644 --- a/docs/reference/middleware/request_verification/async_request_verification.html +++ b/docs/reference/middleware/request_verification/async_request_verification.html @@ -59,7 +59,7 @@

    Classes

    """Verifies an incoming request by checking the validity of `x-slack-signature`, `x-slack-request-timestamp`, and its body data. - Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details. + Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack/ for details. """ async def async_process( @@ -86,10 +86,10 @@

    Classes

    Verifies an incoming request by checking the validity of x-slack-signature, x-slack-request-timestamp, and its body data.

    -

    Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details.

    +

    Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack/ for details.

    Verifies an incoming request by checking the validity of x-slack-signature, x-slack-request-timestamp, and its body data.

    -

    Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details.

    +

    Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack/ for details.

    Args

    signing_secret
    diff --git a/docs/reference/middleware/request_verification/index.html b/docs/reference/middleware/request_verification/index.html index ec8e6b941..5dfd6ed82 100644 --- a/docs/reference/middleware/request_verification/index.html +++ b/docs/reference/middleware/request_verification/index.html @@ -71,7 +71,7 @@

    Classes

    """Verifies an incoming request by checking the validity of `x-slack-signature`, `x-slack-request-timestamp`, and its body data. - Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details. + Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack/ for details. Args: signing_secret: The signing secret @@ -120,7 +120,7 @@

    Classes

    A middleware can process request data before other middleware and listener functions.

    Verifies an incoming request by checking the validity of x-slack-signature, x-slack-request-timestamp, and its body data.

    -

    Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details.

    +

    Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack/ for details.

    Args

    signing_secret
    diff --git a/docs/reference/middleware/request_verification/request_verification.html b/docs/reference/middleware/request_verification/request_verification.html index aa5da095f..99134110a 100644 --- a/docs/reference/middleware/request_verification/request_verification.html +++ b/docs/reference/middleware/request_verification/request_verification.html @@ -60,7 +60,7 @@

    Classes

    """Verifies an incoming request by checking the validity of `x-slack-signature`, `x-slack-request-timestamp`, and its body data. - Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details. + Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack/ for details. Args: signing_secret: The signing secret @@ -109,7 +109,7 @@

    Classes

    A middleware can process request data before other middleware and listener functions.

    Verifies an incoming request by checking the validity of x-slack-signature, x-slack-request-timestamp, and its body data.

    -

    Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details.

    +

    Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack/ for details.

    Args

    signing_secret
    diff --git a/docs/reference/middleware/ssl_check/async_ssl_check.html b/docs/reference/middleware/ssl_check/async_ssl_check.html index eaacf0846..48c4bb599 100644 --- a/docs/reference/middleware/ssl_check/async_ssl_check.html +++ b/docs/reference/middleware/ssl_check/async_ssl_check.html @@ -75,12 +75,12 @@

    Classes

    A middleware can process request data before other middleware and listener functions.

    Handles ssl_check requests. -Refer to https://api.slack.com/interactivity/slash-commands for details.

    +Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details.

    Args

    verification_token
    The verification token to check -(optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation)
    +(optional as it's already deprecated - https://docs.slack.dev/authentication/verifying-requests-from-slack/#deprecation)
    base_logger
    The base logger
    diff --git a/docs/reference/middleware/ssl_check/index.html b/docs/reference/middleware/ssl_check/index.html index 6a6477071..6c1e4725e 100644 --- a/docs/reference/middleware/ssl_check/index.html +++ b/docs/reference/middleware/ssl_check/index.html @@ -76,11 +76,11 @@

    Classes

    base_logger: Optional[Logger] = None, ): """Handles `ssl_check` requests. - Refer to https://api.slack.com/interactivity/slash-commands for details. + Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details. Args: verification_token: The verification token to check - (optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation) + (optional as it's already deprecated - https://docs.slack.dev/authentication/verifying-requests-from-slack/#deprecation) base_logger: The base logger """ # noqa: E501 self.verification_token = verification_token @@ -122,12 +122,12 @@

    Classes

    A middleware can process request data before other middleware and listener functions.

    Handles slack_bolt.middleware.ssl_check.ssl_check requests. -Refer to https://api.slack.com/interactivity/slash-commands for details.

    +Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details.

    Args

    verification_token
    The verification token to check -(optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation)
    +(optional as it's already deprecated - https://docs.slack.dev/authentication/verifying-requests-from-slack/#deprecation)
    base_logger
    The base logger
    diff --git a/docs/reference/middleware/ssl_check/ssl_check.html b/docs/reference/middleware/ssl_check/ssl_check.html index 72b98724a..f90ad4d87 100644 --- a/docs/reference/middleware/ssl_check/ssl_check.html +++ b/docs/reference/middleware/ssl_check/ssl_check.html @@ -65,11 +65,11 @@

    Classes

    base_logger: Optional[Logger] = None, ): """Handles `ssl_check` requests. - Refer to https://api.slack.com/interactivity/slash-commands for details. + Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details. Args: verification_token: The verification token to check - (optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation) + (optional as it's already deprecated - https://docs.slack.dev/authentication/verifying-requests-from-slack/#deprecation) base_logger: The base logger """ # noqa: E501 self.verification_token = verification_token @@ -111,12 +111,12 @@

    Classes

    A middleware can process request data before other middleware and listener functions.

    Handles ssl_check requests. -Refer to https://api.slack.com/interactivity/slash-commands for details.

    +Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details.

    Args

    verification_token
    The verification token to check -(optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation)
    +(optional as it's already deprecated - https://docs.slack.dev/authentication/verifying-requests-from-slack/#deprecation)
    base_logger
    The base logger
    diff --git a/docs/reference/middleware/url_verification/async_url_verification.html b/docs/reference/middleware/url_verification/async_url_verification.html index e7fbb82fe..d1408052d 100644 --- a/docs/reference/middleware/url_verification/async_url_verification.html +++ b/docs/reference/middleware/url_verification/async_url_verification.html @@ -73,7 +73,7 @@

    Classes

    A middleware can process request data before other middleware and listener functions.

    Handles url_verification requests.

    -

    Refer to https://api.slack.com/events/url_verification for details.

    +

    Refer to https://docs.slack.dev/reference/events/url_verification/ for details.

    Args

    base_logger
    diff --git a/docs/reference/middleware/url_verification/index.html b/docs/reference/middleware/url_verification/index.html index 9e08c1699..480c861d6 100644 --- a/docs/reference/middleware/url_verification/index.html +++ b/docs/reference/middleware/url_verification/index.html @@ -70,7 +70,7 @@

    Classes

    def __init__(self, base_logger: Optional[Logger] = None): """Handles url_verification requests. - Refer to https://api.slack.com/events/url_verification for details. + Refer to https://docs.slack.dev/reference/events/url_verification/ for details. Args: base_logger: The base logger @@ -104,7 +104,7 @@

    Classes

    A middleware can process request data before other middleware and listener functions.

    Handles url_verification requests.

    -

    Refer to https://api.slack.com/events/url_verification for details.

    +

    Refer to https://docs.slack.dev/reference/events/url_verification/ for details.

    Args

    base_logger
    diff --git a/docs/reference/middleware/url_verification/url_verification.html b/docs/reference/middleware/url_verification/url_verification.html index e90bf0395..ff22c2986 100644 --- a/docs/reference/middleware/url_verification/url_verification.html +++ b/docs/reference/middleware/url_verification/url_verification.html @@ -59,7 +59,7 @@

    Classes

    def __init__(self, base_logger: Optional[Logger] = None): """Handles url_verification requests. - Refer to https://api.slack.com/events/url_verification for details. + Refer to https://docs.slack.dev/reference/events/url_verification/ for details. Args: base_logger: The base logger @@ -93,7 +93,7 @@

    Classes

    A middleware can process request data before other middleware and listener functions.

    Handles url_verification requests.

    -

    Refer to https://api.slack.com/events/url_verification for details.

    +

    Refer to https://docs.slack.dev/reference/events/url_verification/ for details.

    Args

    base_logger
    diff --git a/docs/reference/oauth/index.html b/docs/reference/oauth/index.html index d118a5e72..d53dc6a41 100644 --- a/docs/reference/oauth/index.html +++ b/docs/reference/oauth/index.html @@ -37,7 +37,7 @@

    Module slack_bolt.oauth

    Slack OAuth flow support for building an app that is installable in any workspaces.

    -

    Refer to https://slack.dev/bolt-python/concepts#authenticating-oauth for details.

    +

    Refer to https://docs.slack.dev/tools/bolt-python/concepts/authenticating-oauth for details.

    Sub-modules

    diff --git a/docs/reference/request/index.html b/docs/reference/request/index.html index 06d9b4933..84cd15050 100644 --- a/docs/reference/request/index.html +++ b/docs/reference/request/index.html @@ -37,7 +37,7 @@

    Module slack_bolt.request

    Incoming request from Slack through either HTTP request or Socket Mode connection.

    -

    Refer to https://api.slack.com/apis/connections for the two types of connections. +

    Refer to https://docs.slack.dev/apis/events-api/ for the two types of connections. This interface encapsulates the difference between the two.

    diff --git a/docs/reference/response/index.html b/docs/reference/response/index.html index c986c7150..a4f4989ee 100644 --- a/docs/reference/response/index.html +++ b/docs/reference/response/index.html @@ -39,7 +39,7 @@

    Module slack_bolt.response

    This interface represents Bolt's synchronous response to Slack.

    In Socket Mode, the response data can be transformed to a WebSocket message. In the HTTP endpoint mode, the response data becomes an HTTP response data.

    -

    Refer to https://api.slack.com/apis/connections for the two types of connections.

    +

    Refer to https://docs.slack.dev/apis/events-api/ for the two types of connections.

    Sub-modules

    diff --git a/docs/reference/workflows/index.html b/docs/reference/workflows/index.html index caaffe74d..0dfe7457f 100644 --- a/docs/reference/workflows/index.html +++ b/docs/reference/workflows/index.html @@ -43,7 +43,7 @@

    Module slack_bolt.workflows

  • slack_bolt.workflows.step.utilities
  • slack_bolt.workflows.step.async_step (if you use asyncio-based AsyncApp)
  • -

    Refer to https://api.slack.com/workflows/steps for details.

    +

    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    Sub-modules

    diff --git a/docs/reference/workflows/step/async_step.html b/docs/reference/workflows/step/async_step.html index 3bf597134..18fdd3ab9 100644 --- a/docs/reference/workflows/step/async_step.html +++ b/docs/reference/workflows/step/async_step.html @@ -78,7 +78,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Args: callback_id: The callback_id for this step from app @@ -124,7 +124,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ """ return AsyncWorkflowStepBuilder(callback_id, base_logger=base_logger) @@ -200,7 +200,7 @@

    Classes

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/

    Args

    callback_id
    @@ -252,7 +252,7 @@

    Static methods

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/

    @@ -267,7 +267,7 @@

    Static methods

    class AsyncWorkflowStepBuilder:
         """Steps from apps
    -    Refer to https://api.slack.com/workflows/steps for details.
    +    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.
         """
     
         callback_id: Union[str, Pattern]
    @@ -285,7 +285,7 @@ 

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ This builder is supposed to be used as decorator. @@ -327,7 +327,7 @@

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new edit listener with details. @@ -380,7 +380,7 @@

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new save listener with details. @@ -433,7 +433,7 @@

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new execute listener with details. @@ -480,7 +480,7 @@

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. @@ -555,10 +555,10 @@

    Static methods

    return _middleware

    Steps from apps -Refer to https://api.slack.com/workflows/steps for details.

    +Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/

    This builder is supposed to be used as decorator.

    my_step = AsyncWorkflowStep.builder("my_step")
     @my_step.edit
    @@ -659,7 +659,7 @@ 

    Methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. @@ -685,7 +685,7 @@

    Methods

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/

    Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object.

    Returns

    @@ -709,7 +709,7 @@

    Returns

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new edit listener with details. @@ -754,7 +754,7 @@

    Returns

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/

    Registers a new edit listener with details.

    You can use this method as decorator as well.

    @my_step.edit
    @@ -799,7 +799,7 @@ 

    Args

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new execute listener with details. @@ -844,7 +844,7 @@

    Args

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/

    Registers a new execute listener with details.

    You can use this method as decorator as well.

    @my_step.execute
    @@ -889,7 +889,7 @@ 

    Args

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new save listener with details. @@ -934,7 +934,7 @@

    Args

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/

    Registers a new save listener with details.

    You can use this method as decorator as well.

    @my_step.save
    diff --git a/docs/reference/workflows/step/index.html b/docs/reference/workflows/step/index.html
    index 62d989976..50b52906b 100644
    --- a/docs/reference/workflows/step/index.html
    +++ b/docs/reference/workflows/step/index.html
    @@ -174,7 +174,7 @@ 

    Classes

    ) app.step(ws) - Refer to https://api.slack.com/workflows/steps for details. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. """ def __init__(self, *, callback_id: str, client: WebClient, body: dict): @@ -219,7 +219,7 @@

    Classes

    ) app.step(ws)
    -

    Refer to https://api.slack.com/workflows/steps for details.

    +

    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    class Fail @@ -411,7 +411,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Args: callback_id: The callback_id for this step from app @@ -453,7 +453,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ """ return WorkflowStepBuilder( callback_id, @@ -546,7 +546,7 @@

    Classes

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/

    Args

    callback_id
    @@ -598,7 +598,7 @@

    Static methods

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/

    diff --git a/docs/reference/workflows/step/step.html b/docs/reference/workflows/step/step.html index 6e1567bd6..0309acd88 100644 --- a/docs/reference/workflows/step/step.html +++ b/docs/reference/workflows/step/step.html @@ -78,7 +78,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Args: callback_id: The callback_id for this step from app @@ -120,7 +120,7 @@

    Classes

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ """ return WorkflowStepBuilder( callback_id, @@ -213,7 +213,7 @@

    Classes

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/

    Args

    callback_id
    @@ -265,7 +265,7 @@

    Static methods

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/

    @@ -280,7 +280,7 @@

    Static methods

    class WorkflowStepBuilder:
         """Steps from apps
    -    Refer to https://api.slack.com/workflows/steps for details.
    +    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.
         """
     
         callback_id: Union[str, Pattern]
    @@ -298,7 +298,7 @@ 

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ This builder is supposed to be used as decorator. @@ -340,7 +340,7 @@

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new edit listener with details. @@ -394,7 +394,7 @@

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new save listener with details. @@ -447,7 +447,7 @@

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new execute listener with details. @@ -494,7 +494,7 @@

    Static methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. @@ -584,10 +584,10 @@

    Static methods

    return _middleware

    Steps from apps -Refer to https://api.slack.com/workflows/steps for details.

    +Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/

    This builder is supposed to be used as decorator.

    my_step = WorkflowStep.builder("my_step")
     @my_step.edit
    @@ -703,7 +703,7 @@ 

    Methods

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. @@ -729,7 +729,7 @@

    Methods

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/

    Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object.

    Returns

    @@ -753,7 +753,7 @@

    Returns

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new edit listener with details. @@ -799,7 +799,7 @@

    Returns

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/

    Registers a new edit listener with details.

    You can use this method as decorator as well.

    @my_step.edit
    @@ -844,7 +844,7 @@ 

    Args

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new execute listener with details. @@ -889,7 +889,7 @@

    Args

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/

    Registers a new execute listener with details.

    You can use this method as decorator as well.

    @my_step.execute
    @@ -934,7 +934,7 @@ 

    Args

    """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new save listener with details. @@ -979,7 +979,7 @@

    Args

    Deprecated

    Steps from apps for legacy workflows are now deprecated. -Use new custom steps: https://api.slack.com/automation/functions/custom-bolt

    +Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/

    Registers a new save listener with details.

    You can use this method as decorator as well.

    @my_step.save
    diff --git a/docs/reference/workflows/step/utilities/async_configure.html b/docs/reference/workflows/step/utilities/async_configure.html
    index 008c35ab5..10f236c47 100644
    --- a/docs/reference/workflows/step/utilities/async_configure.html
    +++ b/docs/reference/workflows/step/utilities/async_configure.html
    @@ -83,7 +83,7 @@ 

    Classes

    ) app.step(ws) - Refer to https://api.slack.com/workflows/steps for details. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. """ def __init__(self, *, callback_id: str, client: AsyncWebClient, body: dict): @@ -131,7 +131,7 @@

    Classes

    ) app.step(ws)
    -

    Refer to https://api.slack.com/workflows/steps for details.

    +

    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    diff --git a/docs/reference/workflows/step/utilities/configure.html b/docs/reference/workflows/step/utilities/configure.html index 26d646cf2..258bce312 100644 --- a/docs/reference/workflows/step/utilities/configure.html +++ b/docs/reference/workflows/step/utilities/configure.html @@ -83,7 +83,7 @@

    Classes

    ) app.step(ws) - Refer to https://api.slack.com/workflows/steps for details. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. """ def __init__(self, *, callback_id: str, client: WebClient, body: dict): @@ -128,7 +128,7 @@

    Classes

    ) app.step(ws)
    -

    Refer to https://api.slack.com/workflows/steps for details.

    +

    Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details.

    diff --git a/examples/aws_lambda/README.md b/examples/aws_lambda/README.md index 454f080a7..49a8f7da2 100644 --- a/examples/aws_lambda/README.md +++ b/examples/aws_lambda/README.md @@ -32,16 +32,16 @@ Instructions on how to set up and deploy each example are provided below. `lazy_aws_lambda_config.yaml` - Optionally enter a description for the role, such as "Bolt Python basic role" -3. Ensure you have created an app on api.slack.com/apps as per the [Getting - Started Guide](https://slack.dev/bolt-python/tutorial/getting-started). +3. Ensure you have created an app on api.slack.com/apps as per the + [Building an App](https://docs.slack.dev/tools/bolt-python/building-an-app) guide. Ensure you have installed it to a workspace. 4. Ensure you have exported your Slack Bot Token and Slack Signing Secret for your apps as the environment variables `SLACK_BOT_TOKEN` and - `SLACK_SIGNING_SECRET`, respectively, as per the [Getting - Started Guide](https://slack.dev/bolt-python/tutorial/getting-started). + `SLACK_SIGNING_SECRET`, respectively, as per the + [Building an App](https://docs.slack.dev/tools/bolt-python/building-an-app) guide. 5. You may want to create a dedicated virtual environment for this example app, as - per the "Setting up your project" section of the [Getting - Started Guide](https://slack.dev/bolt-python/tutorial/getting-started). + per the "Setting up your project" section of the + [Building an App](https://docs.slack.dev/tools/bolt-python/building-an-app) guide. 6. Let's deploy the Lambda! Run `./deploy_lazy.sh`. By default it deploys to the us-east-1 region in AWS - you can change this at the top of `lazy_aws_lambda_config.yaml` if you wish. 7. Load up AWS Lambda inside the AWS Console - make sure you are in the correct @@ -150,7 +150,7 @@ Let’s create a user role that will use the custom policy we created as well as 3. "Create Role" ### Create Slack App and Load your Lambda to AWS -Ensure you have created an app on [api.slack.com/apps](https://api.slack.com/apps) as per the [Getting Started Guide](https://slack.dev/bolt-python/tutorial/getting-started). You do not need to ensure you have installed it to a workspace, as the OAuth flow will provide your app the ability to be installed by anyone. +Ensure you have created an app on [api.slack.com/apps](https://api.slack.com/apps) as per the [Building an App](https://docs.slack.dev/tools/bolt-python/building-an-app) guide. You do not need to ensure you have installed it to a workspace, as the OAuth flow will provide your app the ability to be installed by anyone. 1. Remember those S3 buckets we made? You will need the names of these buckets again in the next step. 2. You need many environment variables exported! Specifically the following from api.slack.com/apps diff --git a/examples/django/README.md b/examples/django/README.md index c50681c5b..ca0460fd1 100644 --- a/examples/django/README.md +++ b/examples/django/README.md @@ -4,7 +4,7 @@ This example demonstrates how you can use Bolt for Python in your Django applica ### `simple_app` - Single-workspace App Example -If you want to run a simple app like the one you've tried in the [Getting Started Guide](https://slack.dev/bolt-python/tutorial/getting-started), this is the right one for you. By default, this Django project runs this application. If you want to switch to OAuth flow supported one, modify `myslackapp/urls.py`. +If you want to run a simple app like the one you've tried in the [Building an App](https://docs.slack.dev/tools/bolt-python/building-an-app) guide, this is the right one for you. By default, this Django project runs this application. If you want to switch to OAuth flow supported one, modify `myslackapp/urls.py`. To run this app, all you need to do are: @@ -31,7 +31,7 @@ python manage.py migrate python manage.py runserver 0.0.0.0:3000 ``` -As you did at [Getting Started Guide](https://slack.dev/bolt-python/tutorial/getting-started), configure ngrok or something similar to serve a public endpoint. Lastly, +As you did at [Building an App](https://docs.slack.dev/tools/bolt-python/building-an-app) guide, configure ngrok or something similar to serve a public endpoint. Lastly, * Go back to the Slack app configuration page * Go to "Event Subscriptions" @@ -54,7 +54,7 @@ To run this app, all you need to do are: * Create a new Slack app configuration at https://api.slack.com/apps?new_app=1 * Go to "OAuth & Permissions" * Add `app_mentions:read`, `chat:write` in Scopes > Bot Token Scopes -* Follow the instructions [here](https://slack.dev/bolt-python/concepts#authenticating-oauth) for configuring OAuth flow supported Slack apps +* Follow the instructions [here](https://docs.slack.dev/tools/bolt-python/concepts/authenticating-oauth) for configuring OAuth flow supported Slack apps You can start your Django application this way: @@ -73,7 +73,7 @@ python manage.py migrate python manage.py runserver 0.0.0.0:3000 ``` -As you did at [Getting Started Guide](https://slack.dev/bolt-python/tutorial/getting-started), configure ngrok or something similar to serve a public endpoint. Lastly, +As you did at [Building an App](https://docs.slack.dev/tools/bolt-python/building-an-app) guide, configure ngrok or something similar to serve a public endpoint. Lastly, * Go back to the Slack app configuration page * Go to "Event Subscriptions" diff --git a/examples/getting_started/README.md b/examples/getting_started/README.md index 63875a4dd..5d3c2f61d 100644 --- a/examples/getting_started/README.md +++ b/examples/getting_started/README.md @@ -1,5 +1,5 @@ # Getting Started with ⚡️ Bolt for Python -> Slack app example from 📚 [Getting started with Bolt for Python][1] +> Slack app example from 📚 [Building an App with Bolt for Python][1] ## Overview @@ -42,6 +42,6 @@ ngrok http 3000 python3 app.py ``` -[1]: https://slack.dev/bolt-python/tutorial/getting-started -[2]: https://slack.dev/bolt-python/ -[3]: https://slack.dev/bolt-python/tutorial/getting-started#setting-up-events +[1]: https://docs.slack.dev/tools/bolt-python/building-an-app +[2]: https://docs.slack.dev/tools/bolt-python/ +[3]: https://docs.slack.dev/tools/bolt-python/building-an-app#setting-up-events diff --git a/examples/message_events.py b/examples/message_events.py index 7658be276..3fd424060 100644 --- a/examples/message_events.py +++ b/examples/message_events.py @@ -32,7 +32,7 @@ def extract_subtype(body: dict, context: BoltContext, next: Callable): next() -# https://api.slack.com/events/message +# https://docs.slack.dev/reference/events/message/ # Newly posted messages only # or @app.event("message") @app.event({"type": "message", "subtype": None}) @@ -55,8 +55,8 @@ def detect_deletion(say: Say, body: dict): say(f"You've deleted a message: {text}") -# https://api.slack.com/events/message/file_share -# https://api.slack.com/events/message/bot_message +# https://docs.slack.dev/reference/events/message/file_share +# https://docs.slack.dev/reference/events/message/bot_message @app.event( event={"type": "message", "subtype": re.compile("(me_message)|(file_share)")}, middleware=[extract_subtype], diff --git a/examples/readme_app.py b/examples/readme_app.py index 963938658..fe81a0904 100644 --- a/examples/readme_app.py +++ b/examples/readme_app.py @@ -16,13 +16,13 @@ def log_request(logger, body, next): return next() -# Events API: https://api.slack.com/events-api +# Events API: https://docs.slack.dev/apis/events-api/ @app.event("app_mention") def event_test(say): say("What's up?") -# Interactivity: https://api.slack.com/interactivity +# Interactivity: https://docs.slack.dev/interactivity/ @app.shortcut("callback-id-here") # @app.command("/hello-bolt-python") def open_modal(ack, client, logger, body): diff --git a/examples/readme_async_app.py b/examples/readme_async_app.py index c43d3af32..f11d308a0 100644 --- a/examples/readme_async_app.py +++ b/examples/readme_async_app.py @@ -28,13 +28,13 @@ async def log_request(logger, body, next): return await next() -# Events API: https://api.slack.com/events-api +# Events API: https://docs.slack.dev/apis/events-api/ @app.event("app_mention") async def event_test(say): await say("What's up?") -# Interactivity: https://api.slack.com/interactivity +# Interactivity: https://docs.slack.dev/interactivity/ @app.shortcut("callback-id-here") # @app.command("/hello-bolt-python") async def open_modal(ack, client, logger, body): diff --git a/examples/workflow_steps/async_steps_from_apps.py b/examples/workflow_steps/async_steps_from_apps.py index 11566de6c..ed108cf5e 100644 --- a/examples/workflow_steps/async_steps_from_apps.py +++ b/examples/workflow_steps/async_steps_from_apps.py @@ -11,7 +11,7 @@ ################################################################################ # Steps from apps for legacy workflows are now deprecated. # -# Use new custom steps: https://api.slack.com/automation/functions/custom-bolt # +# Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ # ################################################################################ logging.basicConfig(level=logging.DEBUG) diff --git a/examples/workflow_steps/async_steps_from_apps_decorator.py b/examples/workflow_steps/async_steps_from_apps_decorator.py index 423048a47..e04884723 100644 --- a/examples/workflow_steps/async_steps_from_apps_decorator.py +++ b/examples/workflow_steps/async_steps_from_apps_decorator.py @@ -13,7 +13,7 @@ ################################################################################ # Steps from apps for legacy workflows are now deprecated. # -# Use new custom steps: https://api.slack.com/automation/functions/custom-bolt # +# Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ # ################################################################################ logging.basicConfig(level=logging.DEBUG) diff --git a/examples/workflow_steps/async_steps_from_apps_primitive.py b/examples/workflow_steps/async_steps_from_apps_primitive.py index 2e636e600..06a2956db 100644 --- a/examples/workflow_steps/async_steps_from_apps_primitive.py +++ b/examples/workflow_steps/async_steps_from_apps_primitive.py @@ -5,7 +5,7 @@ ################################################################################ # Steps from apps for legacy workflows are now deprecated. # -# Use new custom steps: https://api.slack.com/automation/functions/custom-bolt # +# Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ # ################################################################################ logging.basicConfig(level=logging.DEBUG) diff --git a/examples/workflow_steps/steps_from_apps.py b/examples/workflow_steps/steps_from_apps.py index efbb2ce65..b5f591700 100644 --- a/examples/workflow_steps/steps_from_apps.py +++ b/examples/workflow_steps/steps_from_apps.py @@ -8,7 +8,7 @@ ################################################################################ # Steps from apps for legacy workflows are now deprecated. # -# Use new custom steps: https://api.slack.com/automation/functions/custom-bolt # +# Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ # ################################################################################ logging.basicConfig(level=logging.DEBUG) diff --git a/examples/workflow_steps/steps_from_apps_decorator.py b/examples/workflow_steps/steps_from_apps_decorator.py index 64ddfcc20..1558e825a 100644 --- a/examples/workflow_steps/steps_from_apps_decorator.py +++ b/examples/workflow_steps/steps_from_apps_decorator.py @@ -9,7 +9,7 @@ ################################################################################ # Steps from apps for legacy workflows are now deprecated. # -# Use new custom steps: https://api.slack.com/automation/functions/custom-bolt # +# Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ # ################################################################################ logging.basicConfig(level=logging.DEBUG) diff --git a/examples/workflow_steps/steps_from_apps_primitive.py b/examples/workflow_steps/steps_from_apps_primitive.py index 6aa5a98bb..dd4231ba6 100644 --- a/examples/workflow_steps/steps_from_apps_primitive.py +++ b/examples/workflow_steps/steps_from_apps_primitive.py @@ -7,7 +7,7 @@ ################################################################################ # Steps from apps for legacy workflows are now deprecated. # -# Use new custom steps: https://api.slack.com/automation/functions/custom-bolt # +# Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ # ################################################################################ logging.basicConfig(level=logging.DEBUG) diff --git a/pyproject.toml b/pyproject.toml index 024ee6654..5a6523f35 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ dependencies = ["slack_sdk>=3.35.0,<4"] [project.urls] -Documentation = "https://slack.dev/bolt-python" +Documentation = "https://docs.slack.dev/tools/bolt-python/" [tool.setuptools.packages.find] include = ["slack_bolt*"] diff --git a/slack_bolt/__init__.py b/slack_bolt/__init__.py index 32ab76721..6331925f8 100644 --- a/slack_bolt/__init__.py +++ b/slack_bolt/__init__.py @@ -1,7 +1,7 @@ """ -A Python framework to build Slack apps in a flash with the latest platform features.Read the [getting started guide](https://slack.dev/bolt-python/tutorial/getting-started) and look at our [code examples](https://github.com/slackapi/bolt-python/tree/main/examples) to learn how to build apps using Bolt. +A Python framework to build Slack apps in a flash with the latest platform features.Read the [getting started guide](https://docs.slack.dev/tools/bolt-python/building-an-app) and look at our [code examples](https://github.com/slackapi/bolt-python/tree/main/examples) to learn how to build apps using Bolt. -* Website: https://slack.dev/bolt-python/ +* Website: https://docs.slack.dev/tools/bolt-python/ * GitHub repository: https://github.com/slackapi/bolt-python * The class representing a Bolt app: `slack_bolt.app.app` """ # noqa: E501 diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 60f20ea9e..5a7f32917 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -159,10 +159,10 @@ def message_hello(message, say): if __name__ == "__main__": app.start(port=int(os.environ.get("PORT", 3000))) - Refer to https://slack.dev/bolt-python/tutorial/getting-started for details. + Refer to https://docs.slack.dev/tools/bolt-python/building-an-app for details. If you would like to build an OAuth app for enabling the app to run with multiple workspaces, - refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app. + refer to https://docs.slack.dev/tools/bolt-python/concepts/authenticating-oauth to learn how to configure the app. Args: logger: The custom logger that can be used in this app. @@ -671,7 +671,7 @@ def middleware_func(logger, body, next): # Pass a function to this method app.middleware(middleware_func) - Refer to https://slack.dev/bolt-python/concepts#global-middleware for details. + Refer to https://docs.slack.dev/tools/bolt-python/concepts/global-middleware for details. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -717,7 +717,7 @@ def step( """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new step from app listener. @@ -735,7 +735,7 @@ def step( # Pass Step to set up listeners app.step(ws) - Refer to https://api.slack.com/workflows/steps for details of steps from apps. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -752,7 +752,7 @@ def step( warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/" ), category=DeprecationWarning, ) @@ -829,7 +829,7 @@ def ask_for_introduction(event, say): # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://api.slack.com/apis/connections/events-api for details of Events API. + Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -867,7 +867,7 @@ def say_hello(message, say): # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://api.slack.com/events/message for details of `message` events. + Refer to https://docs.slack.dev/reference/events/message/ for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -978,7 +978,7 @@ def repeat_text(ack, say, command): # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. + Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1025,7 +1025,7 @@ def open_modal(ack, body, client): # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. + Refer to https://docs.slack.dev/interactivity/implementing-shortcuts/ for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1093,9 +1093,9 @@ def update_message(ack): # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. - * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. - * Refer to https://api.slack.com/dialogs for actions in dialogs. + * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for actions in `blocks`. + * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for actions in `attachments`. + * Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1121,7 +1121,7 @@ def block_action( middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `block_actions` action listener. - Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. + Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for details. """ def __call__(*args, **kwargs): @@ -1138,7 +1138,7 @@ def attachment_action( middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `interactive_message` action listener. - Refer to https://api.slack.com/legacy/message-buttons for details.""" + Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1154,7 +1154,7 @@ def dialog_submission( middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_submission` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1170,7 +1170,7 @@ def dialog_cancellation( middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_cancellation` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1211,7 +1211,7 @@ def handle_submission(ack, body, client, view): # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1237,7 +1237,9 @@ def view_submission( middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for + details. + """ def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1253,7 +1255,7 @@ def view_closed( middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_closed` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1294,8 +1296,8 @@ def show_menu_options(ack): Refer to the following documents for details: - * https://api.slack.com/reference/block-kit/block-elements#external_select - * https://api.slack.com/reference/block-kit/block-elements#external_multi_select + * https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element#external_select + * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.args`'s API document. @@ -1335,7 +1337,7 @@ def dialog_suggestion( middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 906359fcc..39f3c3c0e 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -165,10 +165,10 @@ async def message_hello(message, say): # async function if __name__ == "__main__": app.start(port=int(os.environ.get("PORT", 3000))) - Refer to https://slack.dev/bolt-python/concepts#async for details. + Refer to https://docs.slack.dev/tools/bolt-python/concepts/async for details. If you would like to build an OAuth app for enabling the app to run with multiple workspaces, - refer to https://slack.dev/bolt-python/concepts#authenticating-oauth to learn how to configure the app. + refer to https://docs.slack.dev/tools/bolt-python/concepts/authenticating-oauth to learn how to configure the app. Args: logger: The custom logger that can be used in this app. @@ -738,7 +738,7 @@ def step( """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new step from app listener. @@ -756,7 +756,7 @@ def step( # Pass Step to set up listeners app.step(ws) - Refer to https://api.slack.com/workflows/steps for details of steps from apps. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details of steps from apps. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. For further information about AsyncWorkflowStep specific function arguments @@ -772,7 +772,7 @@ def step( warnings.warn( ( "Steps from apps for legacy workflows are now deprecated. " - "Use new custom steps: https://api.slack.com/automation/functions/custom-bolt" + "Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/" ), category=DeprecationWarning, ) @@ -854,7 +854,7 @@ async def ask_for_introduction(event, say): # Pass a function to this method app.event("team_join")(ask_for_introduction) - Refer to https://api.slack.com/apis/connections/events-api for details of Events API. + Refer to https://docs.slack.dev/apis/events-api/ for details of Events API. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -892,7 +892,7 @@ async def say_hello(message, say): # Pass a function to this method app.message(":wave:")(say_hello) - Refer to https://api.slack.com/events/message for details of `message` events. + Refer to https://docs.slack.dev/reference/events/message/ for details of `message` events. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1007,7 +1007,7 @@ async def repeat_text(ack, say, command): # Pass a function to this method app.command("/echo")(repeat_text) - Refer to https://api.slack.com/interactivity/slash-commands for details of Slash Commands. + Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details of Slash Commands. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1054,7 +1054,7 @@ async def open_modal(ack, body, client): # Pass a function to this method app.shortcut("open_modal")(open_modal) - Refer to https://api.slack.com/interactivity/shortcuts for details about Shortcuts. + Refer to https://docs.slack.dev/interactivity/implementing-shortcuts/ for details about Shortcuts. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1122,9 +1122,9 @@ async def update_message(ack): # Pass a function to this method app.action("approve_button")(update_message) - * Refer to https://api.slack.com/reference/interaction-payloads/block-actions for actions in `blocks`. - * Refer to https://api.slack.com/legacy/message-buttons for actions in `attachments`. - * Refer to https://api.slack.com/dialogs for actions in dialogs. + * Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for actions in `blocks`. + * Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for actions in `attachments`. + * Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for actions in dialogs. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1150,7 +1150,7 @@ def block_action( middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `block_actions` action listener. - Refer to https://api.slack.com/reference/interaction-payloads/block-actions for details. + Refer to https://docs.slack.dev/reference/interaction-payloads/block_actions-payload/ for details. """ def __call__(*args, **kwargs): @@ -1167,7 +1167,7 @@ def attachment_action( middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `interactive_message` action listener. - Refer to https://api.slack.com/legacy/message-buttons for details.""" + Refer to https://docs.slack.dev/legacy/legacy-messaging/legacy-message-buttons/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1183,7 +1183,7 @@ def dialog_submission( middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1199,7 +1199,7 @@ def dialog_cancellation( middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_submission` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1240,7 +1240,7 @@ async def handle_submission(ack, body, client, view): # Pass a function to this method app.view("view_1")(handle_submission) - Refer to https://api.slack.com/reference/interaction-payloads/views for details of payloads. + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload for details of payloads. To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1266,7 +1266,9 @@ def view_submission( middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_submission` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for + details. + """ def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1282,7 +1284,7 @@ def view_closed( middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_closed` listener. - Refer to https://api.slack.com/reference/interaction-payloads/views#view_closed for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_closed for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -1323,8 +1325,8 @@ async def show_menu_options(ack): Refer to the following documents for details: - * https://api.slack.com/reference/block-kit/block-elements#external_select - * https://api.slack.com/reference/block-kit/block-elements#external_multi_select + * https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element#external_select + * https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select To learn available arguments for middleware/listeners, see `slack_bolt.kwargs_injection.async_args`'s API document. @@ -1364,7 +1366,7 @@ def dialog_suggestion( middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `dialog_suggestion` listener. - Refer to https://api.slack.com/dialogs for details.""" + Refer to https://docs.slack.dev/legacy/legacy-dialogs/ for details.""" def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) diff --git a/slack_bolt/authorization/__init__.py b/slack_bolt/authorization/__init__.py index a936a866b..4b80a93bb 100644 --- a/slack_bolt/authorization/__init__.py +++ b/slack_bolt/authorization/__init__.py @@ -1,7 +1,7 @@ """Authorization is the process of determining which Slack credentials should be available while processing an incoming Slack event. -Refer to https://slack.dev/bolt-python/concepts#authorization for details. +Refer to https://docs.slack.dev/tools/bolt-python/concepts/authorization for details. """ from .authorize_result import AuthorizeResult diff --git a/slack_bolt/context/__init__.py b/slack_bolt/context/__init__.py index fb3337c7a..865825601 100644 --- a/slack_bolt/context/__init__.py +++ b/slack_bolt/context/__init__.py @@ -2,7 +2,7 @@ Bolt automatically attaches information that is included in the incoming event, like `user_id`, `team_id`, `channel_id`, and `enterprise_id`. -Refer to https://slack.dev/bolt-python/concepts#context for details. +Refer to https://docs.slack.dev/tools/bolt-python/concepts/context for details. """ # Don't add async module imports here diff --git a/slack_bolt/lazy_listener/__init__.py b/slack_bolt/lazy_listener/__init__.py index 4d9111cc3..a92c18483 100644 --- a/slack_bolt/lazy_listener/__init__.py +++ b/slack_bolt/lazy_listener/__init__.py @@ -19,7 +19,7 @@ def run_long_process(respond, body): lazy=[run_long_process] ) -Refer to https://slack.dev/bolt-python/concepts#lazy-listeners for more details. +Refer to https://docs.slack.dev/tools/bolt-python/concepts/lazy-listeners for more details. """ # Don't add async module imports here diff --git a/slack_bolt/listener_matcher/builtins.py b/slack_bolt/listener_matcher/builtins.py index 57dbdf4f1..76c12d452 100644 --- a/slack_bolt/listener_matcher/builtins.py +++ b/slack_bolt/listener_matcher/builtins.py @@ -294,7 +294,7 @@ def func(body: Dict[str, Any]) -> bool: return dialog_submission(constraints["callback_id"], asyncio) if action_type == "dialog_cancellation": return dialog_cancellation(constraints["callback_id"], asyncio) - # https://api.slack.com/workflows/steps + # https://docs.slack.dev/legacy/legacy-steps-from-apps/ if action_type == "workflow_step_edit": return workflow_step_edit(constraints["callback_id"], asyncio) diff --git a/slack_bolt/logger/messages.py b/slack_bolt/logger/messages.py index d30f51acb..80e68d022 100644 --- a/slack_bolt/logger/messages.py +++ b/slack_bolt/logger/messages.py @@ -348,7 +348,7 @@ def info_default_oauth_settings_loaded() -> str: "Bolt has enabled the file-based InstallationStore/OAuthStateStore for you. " "Note that these file-based stores are for local development. " "If you'd like to use a different data store, set the oauth_settings argument in the App constructor. " - "Please refer to https://slack.dev/bolt-python/concepts#authenticating-oauth for more details." + "Please refer to https://docs.slack.dev/tools/bolt-python/concepts/authenticating-oauth for more details." ) diff --git a/slack_bolt/middleware/request_verification/async_request_verification.py b/slack_bolt/middleware/request_verification/async_request_verification.py index 68484bde0..3fb9e209b 100644 --- a/slack_bolt/middleware/request_verification/async_request_verification.py +++ b/slack_bolt/middleware/request_verification/async_request_verification.py @@ -10,7 +10,7 @@ class AsyncRequestVerification(RequestVerification, AsyncMiddleware): """Verifies an incoming request by checking the validity of `x-slack-signature`, `x-slack-request-timestamp`, and its body data. - Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details. + Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack/ for details. """ async def async_process( diff --git a/slack_bolt/middleware/request_verification/request_verification.py b/slack_bolt/middleware/request_verification/request_verification.py index 5662dcf08..2cf7e361e 100644 --- a/slack_bolt/middleware/request_verification/request_verification.py +++ b/slack_bolt/middleware/request_verification/request_verification.py @@ -14,7 +14,7 @@ def __init__(self, signing_secret: str, base_logger: Optional[Logger] = None): """Verifies an incoming request by checking the validity of `x-slack-signature`, `x-slack-request-timestamp`, and its body data. - Refer to https://api.slack.com/authentication/verifying-requests-from-slack for details. + Refer to https://docs.slack.dev/authentication/verifying-requests-from-slack/ for details. Args: signing_secret: The signing secret diff --git a/slack_bolt/middleware/ssl_check/ssl_check.py b/slack_bolt/middleware/ssl_check/ssl_check.py index d608e5c3d..88c5105ef 100644 --- a/slack_bolt/middleware/ssl_check/ssl_check.py +++ b/slack_bolt/middleware/ssl_check/ssl_check.py @@ -17,11 +17,11 @@ def __init__( base_logger: Optional[Logger] = None, ): """Handles `ssl_check` requests. - Refer to https://api.slack.com/interactivity/slash-commands for details. + Refer to https://docs.slack.dev/interactivity/implementing-slash-commands/ for details. Args: verification_token: The verification token to check - (optional as it's already deprecated - https://api.slack.com/authentication/verifying-requests-from-slack#verification_token_deprecation) + (optional as it's already deprecated - https://docs.slack.dev/authentication/verifying-requests-from-slack/#deprecation) base_logger: The base logger """ # noqa: E501 self.verification_token = verification_token diff --git a/slack_bolt/middleware/url_verification/url_verification.py b/slack_bolt/middleware/url_verification/url_verification.py index e59398fd7..7505c9c15 100644 --- a/slack_bolt/middleware/url_verification/url_verification.py +++ b/slack_bolt/middleware/url_verification/url_verification.py @@ -11,7 +11,7 @@ class UrlVerification(Middleware): def __init__(self, base_logger: Optional[Logger] = None): """Handles url_verification requests. - Refer to https://api.slack.com/events/url_verification for details. + Refer to https://docs.slack.dev/reference/events/url_verification/ for details. Args: base_logger: The base logger diff --git a/slack_bolt/oauth/__init__.py b/slack_bolt/oauth/__init__.py index c4f806698..0a5c3db07 100644 --- a/slack_bolt/oauth/__init__.py +++ b/slack_bolt/oauth/__init__.py @@ -1,6 +1,6 @@ """Slack OAuth flow support for building an app that is installable in any workspaces. -Refer to https://slack.dev/bolt-python/concepts#authenticating-oauth for details. +Refer to https://docs.slack.dev/tools/bolt-python/concepts/authenticating-oauth for details. """ # Don't add async module imports here diff --git a/slack_bolt/request/__init__.py b/slack_bolt/request/__init__.py index ee8b435a7..8610b6019 100644 --- a/slack_bolt/request/__init__.py +++ b/slack_bolt/request/__init__.py @@ -1,6 +1,6 @@ """Incoming request from Slack through either HTTP request or Socket Mode connection. -Refer to https://api.slack.com/apis/connections for the two types of connections. +Refer to https://docs.slack.dev/apis/events-api/ for the two types of connections. This interface encapsulates the difference between the two. """ diff --git a/slack_bolt/response/__init__.py b/slack_bolt/response/__init__.py index 373acccf2..c390b2d8e 100644 --- a/slack_bolt/response/__init__.py +++ b/slack_bolt/response/__init__.py @@ -3,7 +3,7 @@ In Socket Mode, the response data can be transformed to a WebSocket message. In the HTTP endpoint mode, the response data becomes an HTTP response data. -Refer to https://api.slack.com/apis/connections for the two types of connections. +Refer to https://docs.slack.dev/apis/events-api/ for the two types of connections. """ from .response import BoltResponse diff --git a/slack_bolt/workflows/__init__.py b/slack_bolt/workflows/__init__.py index 97e6ec765..c0f6d96b7 100644 --- a/slack_bolt/workflows/__init__.py +++ b/slack_bolt/workflows/__init__.py @@ -6,5 +6,5 @@ * `slack_bolt.workflows.step.utilities` * `slack_bolt.workflows.step.async_step` (if you use asyncio-based `AsyncApp`) -Refer to https://api.slack.com/workflows/steps for details. +Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. """ diff --git a/slack_bolt/workflows/step/async_step.py b/slack_bolt/workflows/step/async_step.py index 250d2e900..7fa0ed858 100644 --- a/slack_bolt/workflows/step/async_step.py +++ b/slack_bolt/workflows/step/async_step.py @@ -29,7 +29,7 @@ class AsyncWorkflowStepBuilder: """Steps from apps - Refer to https://api.slack.com/workflows/steps for details. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. """ callback_id: Union[str, Pattern] @@ -47,7 +47,7 @@ def __init__( """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ This builder is supposed to be used as decorator. @@ -89,7 +89,7 @@ def edit( """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new edit listener with details. @@ -142,7 +142,7 @@ def save( """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new save listener with details. @@ -195,7 +195,7 @@ def execute( """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new execute listener with details. @@ -242,7 +242,7 @@ def build(self, base_logger: Optional[Logger] = None) -> "AsyncWorkflowStep": """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. @@ -340,7 +340,7 @@ def __init__( """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Args: callback_id: The callback_id for this step from app @@ -386,7 +386,7 @@ def builder( """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ """ return AsyncWorkflowStepBuilder(callback_id, base_logger=base_logger) diff --git a/slack_bolt/workflows/step/step.py b/slack_bolt/workflows/step/step.py index 7cdbb913c..4fca25717 100644 --- a/slack_bolt/workflows/step/step.py +++ b/slack_bolt/workflows/step/step.py @@ -24,7 +24,7 @@ class WorkflowStepBuilder: """Steps from apps - Refer to https://api.slack.com/workflows/steps for details. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. """ callback_id: Union[str, Pattern] @@ -42,7 +42,7 @@ def __init__( """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ This builder is supposed to be used as decorator. @@ -84,7 +84,7 @@ def edit( """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new edit listener with details. @@ -138,7 +138,7 @@ def save( """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new save listener with details. @@ -191,7 +191,7 @@ def execute( """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Registers a new execute listener with details. @@ -238,7 +238,7 @@ def build(self, base_logger: Optional[Logger] = None) -> "WorkflowStep": """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Constructs a WorkflowStep object. This method may raise an exception if the builder doesn't have enough configurations to build the object. @@ -351,7 +351,7 @@ def __init__( """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ Args: callback_id: The callback_id for this step from app @@ -393,7 +393,7 @@ def builder(cls, callback_id: Union[str, Pattern], base_logger: Optional[Logger] """ Deprecated: Steps from apps for legacy workflows are now deprecated. - Use new custom steps: https://api.slack.com/automation/functions/custom-bolt + Use new custom steps: https://docs.slack.dev/workflows/workflow-steps/ """ return WorkflowStepBuilder( callback_id, diff --git a/slack_bolt/workflows/step/utilities/async_configure.py b/slack_bolt/workflows/step/utilities/async_configure.py index 721d5049c..5b9a7f9ae 100644 --- a/slack_bolt/workflows/step/utilities/async_configure.py +++ b/slack_bolt/workflows/step/utilities/async_configure.py @@ -32,7 +32,7 @@ async def edit(ack, step, configure): ) app.step(ws) - Refer to https://api.slack.com/workflows/steps for details. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. """ def __init__(self, *, callback_id: str, client: AsyncWebClient, body: dict): diff --git a/slack_bolt/workflows/step/utilities/configure.py b/slack_bolt/workflows/step/utilities/configure.py index d44c8d0da..1280be8f7 100644 --- a/slack_bolt/workflows/step/utilities/configure.py +++ b/slack_bolt/workflows/step/utilities/configure.py @@ -32,7 +32,7 @@ def edit(ack, step, configure): ) app.step(ws) - Refer to https://api.slack.com/workflows/steps for details. + Refer to https://docs.slack.dev/legacy/legacy-steps-from-apps/ for details. """ def __init__(self, *, callback_id: str, client: WebClient, body: dict): diff --git a/tests/scenario_tests/test_attachment_actions.py b/tests/scenario_tests/test_attachment_actions.py index fa40187ee..f40deb22b 100644 --- a/tests/scenario_tests/test_attachment_actions.py +++ b/tests/scenario_tests/test_attachment_actions.py @@ -164,7 +164,7 @@ def test_failure_2(self): assert_auth_test_count(self, 1) -# https://api.slack.com/legacy/interactive-messages +# https://docs.slack.dev/legacy/legacy-messaging/legacy-making-messages-interactive/ body = { "type": "interactive_message", "actions": [ diff --git a/tests/scenario_tests_async/test_attachment_actions.py b/tests/scenario_tests_async/test_attachment_actions.py index f6613837b..c9817dcd7 100644 --- a/tests/scenario_tests_async/test_attachment_actions.py +++ b/tests/scenario_tests_async/test_attachment_actions.py @@ -191,7 +191,7 @@ async def test_failure_2(self): await assert_auth_test_count_async(self, 1) -# https://api.slack.com/legacy/interactive-messages +# https://docs.slack.dev/legacy/legacy-messaging/legacy-making-messages-interactive/ body = { "type": "interactive_message", "actions": [ From fc5bbc109cad1dffa1496c92e6da4ed7c5aea5fd Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Mon, 6 Oct 2025 16:32:48 -0700 Subject: [PATCH 660/719] feat: add ai-enabled features text streaming methods, feedback blocks, and loading state (#1387) Co-authored-by: Luke Russell <31357343+lukegalbraithrussell@users.noreply.github.com> Co-authored-by: Maria Alejandra <104795114+srtaalej@users.noreply.github.com> Co-authored-by: Michael Brooks --- docs/english/concepts/ai-apps.md | 408 ++++++++++++++---- docs/english/concepts/message-sending.md | 61 ++- docs/reference/app/app.html | 11 +- docs/reference/app/async_app.html | 11 +- docs/reference/app/index.html | 11 +- docs/reference/async_app.html | 26 +- docs/reference/context/say/async_say.html | 2 + docs/reference/context/say/index.html | 2 + docs/reference/context/say/say.html | 2 + .../context/set_status/async_set_status.html | 11 +- docs/reference/context/set_status/index.html | 11 +- .../context/set_status/set_status.html | 11 +- .../async_set_suggested_prompts.html | 2 +- .../context/set_suggested_prompts/index.html | 2 +- .../set_suggested_prompts.html | 2 +- docs/reference/index.html | 26 +- pyproject.toml | 2 +- slack_bolt/context/say/async_say.py | 12 +- slack_bolt/context/say/say.py | 4 +- .../context/set_status/async_set_status.py | 13 +- slack_bolt/context/set_status/set_status.py | 13 +- .../async_set_suggested_prompts.py | 4 +- .../set_suggested_prompts.py | 4 +- tests/slack_bolt/context/test_say.py | 10 +- tests/slack_bolt/context/test_set_status.py | 38 ++ .../context/test_set_suggested_prompts.py | 37 ++ .../context/test_async_say.py | 13 +- .../context/test_async_set_status.py | 45 ++ .../test_async_set_suggested_prompts.py | 45 ++ 29 files changed, 693 insertions(+), 146 deletions(-) create mode 100644 tests/slack_bolt/context/test_set_status.py create mode 100644 tests/slack_bolt/context/test_set_suggested_prompts.py create mode 100644 tests/slack_bolt_async/context/test_async_set_status.py create mode 100644 tests/slack_bolt_async/context/test_async_set_suggested_prompts.py diff --git a/docs/english/concepts/ai-apps.md b/docs/english/concepts/ai-apps.md index b294c6688..44bd08df1 100644 --- a/docs/english/concepts/ai-apps.md +++ b/docs/english/concepts/ai-apps.md @@ -1,83 +1,195 @@ -# Using AI in Apps -:::info[This feature requires a paid plan] +# Using AI in Apps {#using-ai-in-apps} + +The Slack platform offers features tailored for AI agents and assistants. Your apps can [utilize the `Assistant` class](#assistant) for a side-panel view designed with AI in mind, or they can utilize features applicable to messages throughout Slack, like [chat streaming](#text-streaming) and [feedback buttons](#adding-and-handling-feedback). + +If you're unfamiliar with using these feature within Slack, you may want to read the [API documentation on the subject](/ai/). Then come back here to implement them with Bolt! + +## The `Assistant` class instance {#assistant} + +:::info[Some features within this guide require a paid plan] If you don't have a paid workspace for development, you can join the [Developer Program](https://api.slack.com/developer-program) and provision a sandbox with access to all Slack features for free. ::: -The Agents & AI Apps feature comprises a unique messaging experience for Slack. If you're unfamiliar with using the Agents & AI Apps feature within Slack, you'll want to read the [API documentation on the subject](/ai/). Then come back here to implement them with Bolt! +The [`Assistant`](/tools/bolt-js/reference#the-assistantconfig-configuration-object) class can be used to handle the incoming events expected from a user interacting with an app in Slack that has the Agents & AI Apps feature enabled. -## Configuring your app to support AI features {#configuring-your-app} +A typical flow would look like: -1. Within [App Settings](https://api.slack.com/apps), enable the **Agents & AI Apps** feature. +1. [The user starts a thread](#handling-new-thread). The `Assistant` class handles the incoming [`assistant_thread_started`](/reference/events/assistant_thread_started) event. +2. [The thread context may change at any point](#handling-thread-context-changes). The `Assistant` class can handle any incoming [`assistant_thread_context_changed`](/reference/events/assistant_thread_context_changed) events. The class also provides a default `context` store to keep track of thread context changes as the user moves through Slack. +3. [The user responds](#handling-user-response). The `Assistant` class handles the incoming [`message.im`](/reference/events/message.im) event. -2. Within the App Settings **OAuth & Permissions** page, add the following scopes: -* [`assistant:write`](/reference/scopes/assistant.write) -* [`chat:write`](/reference/scopes/chat.write) -* [`im:history`](/reference/scopes/im.history) -3. Within the App Settings **Event Subscriptions** page, subscribe to the following events: -* [`assistant_thread_started`](/reference/events/assistant_thread_started) -* [`assistant_thread_context_changed`](/reference/events/assistant_thread_context_changed) -* [`message.im`](/reference/events/message.im) +```python +assistant = Assistant() -:::info[You _could_ implement your own AI app by [listening](event-listening) for the `assistant_thread_started`, `assistant_thread_context_changed`, and `message.im` events (see implementation details below).] +# This listener is invoked when a human user opened an assistant thread +@assistant.thread_started +def start_assistant_thread( + say: Say, + get_thread_context: GetThreadContext, + set_suggested_prompts: SetSuggestedPrompts, + logger: logging.Logger, +): + try: + ... -That being said, using the `Assistant` class will streamline the process. And we already wrote this nice guide for you! +# This listener is invoked when the human user sends a reply in the assistant thread +@assistant.user_message +def respond_in_assistant_thread( + client: WebClient, + context: BoltContext, + get_thread_context: GetThreadContext, + logger: logging.Logger, + payload: dict, + say: Say, + set_status: SetStatus, +): + try: + ... + +# Enable this assistant middleware in your Bolt app +app.use(assistant) +``` + +:::info[Consider the following] +You _could_ go it alone and [listen](/tools/bolt-python/concepts/event-listening) for the `assistant_thread_started`, `assistant_thread_context_changed`, and `message.im` events in order to implement the AI features in your app. That being said, using the `Assistant` class will streamline the process. And we already wrote this nice guide for you! +::: + +While the `assistant_thread_started` and `assistant_thread_context_changed` events do provide Slack-client thread context information, the `message.im` event does not. Any subsequent user message events won't contain thread context data. For that reason, Bolt not only provides a way to store thread context — the `threadContextStore` property — but it also provides a `DefaultThreadContextStore` instance that is utilized by default. This implementation relies on storing and retrieving [message metadata](/messaging/message-metadata/) as the user interacts with the app. -## The `Assistant` class instance {#assistant-class} +If you do provide your own `threadContextStore` property, it must feature `get` and `save` methods. + +:::tip[Refer to the [reference docs](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments.] +::: + +### Configuring your app to support the `Assistant` class {#configuring-assistant-class} + +1. Within [App Settings](https://api.slack.com/apps), enable the **Agents & AI Apps** feature. + +2. Within the App Settings **OAuth & Permissions** page, add the following scopes: + * [`assistant:write`](/reference/scopes/assistant.write) + * [`chat:write`](/reference/scopes/chat.write) + * [`im:history`](/reference/scopes/im.history) -The `Assistant` class can be used to handle the incoming events expected from a user interacting with an app in Slack that has the Agents & AI Apps feature enabled. A typical flow would look like: +3. Within the App Settings **Event Subscriptions** page, subscribe to the following events: + * [`assistant_thread_started`](/reference/events/assistant_thread_started) + * [`assistant_thread_context_changed`](/reference/events/assistant_thread_context_changed) + * [`message.im`](/reference/events/message.im) -1. [The user starts a thread](#handling-a-new-thread). The `Assistant` class handles the incoming [`assistant_thread_started`](/reference/events/assistant_thread_started) event. -2. [The thread context may change at any point](#handling-thread-context-changes). The `Assistant` class can handle any incoming [`assistant_thread_context_changed`](/reference/events/assistant_thread_context_changed) events. The class also provides a default context store to keep track of thread context changes as the user moves through Slack. -3. [The user responds](#handling-the-user-response). The `Assistant` class handles the incoming [`message.im`](/reference/events/message.im) event. +### Handling a new thread {#handling-new-thread} +When the user opens a new thread with your AI-enabled app, the [`assistant_thread_started`](/reference/events/assistant_thread_started) event will be sent to your app. + +:::tip[When a user opens an app thread while in a channel, the channel info is stored as the thread's `AssistantThreadContext` data.] + +You can grab that info by using the `get_thread_context` utility, as subsequent user message event payloads won't include the channel info. +::: ```python assistant = Assistant() -# This listener is invoked when a human user opened an assistant thread @assistant.thread_started -def start_assistant_thread(say: Say, set_suggested_prompts: SetSuggestedPrompts): - # Send the first reply to the human who started chat with your app's assistant bot - say(":wave: Hi, how can I help you today?") - - # Setting suggested prompts is optional - set_suggested_prompts( - prompts=[ - # If the suggested prompt is long, you can use {"title": "short one to display", "message": "full prompt"} instead - "What does SLACK stand for?", - "When Slack was released?", - ], - ) +def start_assistant_thread( + say: Say, + get_thread_context: GetThreadContext, + set_suggested_prompts: SetSuggestedPrompts, + logger: logging.Logger, +): + try: + say("How can I help you?") + + prompts: List[Dict[str, str]] = [ + { + "title": "Suggest names for my Slack app", + "message": "Can you suggest a few names for my Slack app? The app helps my teammates better organize information and plan priorities and action items.", + }, + ] + + thread_context = get_thread_context() + if thread_context is not None and thread_context.channel_id is not None: + summarize_channel = { + "title": "Summarize the referred channel", + "message": "Can you generate a brief summary of the referred channel?", + } + prompts.append(summarize_channel) + + set_suggested_prompts(prompts=prompts) + except Exception as e: + logger.exception(f"Failed to handle an assistant_thread_started event: {e}", e) + say(f":warning: Something went wrong! ({e})") +``` + +You can send more complex messages to the user — see [Sending Block Kit alongside messages](#block-kit-interactions) for more info. + +### Handling thread context changes {#handling-thread-context-changes} + +When the user switches channels, the [`assistant_thread_context_changed`](/reference/events/assistant_thread_context_changed) event will be sent to your app. + +If you use the built-in `Assistant` middleware without any custom configuration, the updated context data is automatically saved as [message metadata](/messaging/message-metadata/) of the first reply from the app. + +As long as you use the built-in approach, you don't need to store the context data within a datastore. The downside of this default behavior is the overhead of additional calls to the Slack API. These calls include those to `conversations.history`, which are used to look up the stored message metadata that contains the thread context (via `get_thread_context`). + +To store context elsewhere, pass a custom `AssistantThreadContextStore` implementation to the `Assistant` constructor. We provide `FileAssistantThreadContextStore`, which is a reference implementation that uses the local file system. Since this reference implementation relies on local files, it's not advised for use in production. For production apps, we recommend creating a class that inherits `AssistantThreadContextStore`. + +```python +from slack_bolt import FileAssistantThreadContextStore +assistant = Assistant(thread_context_store=FileAssistantThreadContextStore()) +``` + +### Handling the user response {#handling-user-response} + +When the user messages your app, the [`message.im`](/reference/events/message.im) event will be sent to your app. +Messages sent to the app do not contain a [subtype](/reference/events/message#subtypes) and must be deduced based on their shape and any provided [message metadata](/messaging/message-metadata/). + +There are three utilities that are particularly useful in curating the user experience: +* [`say`](https://docs.slack.dev/tools/bolt-python/reference/#slack_bolt.Say) +* [`setTitle`](https://docs.slack.dev/tools/bolt-python/reference/#slack_bolt.SetTitle) +* [`setStatus`](https://docs.slack.dev/tools/bolt-python/reference/#slack_bolt.SetStatus) + +Within the `setStatus` utility, you can cycle through strings passed into a `loading_messages` array. + +```python # This listener is invoked when the human user sends a reply in the assistant thread @assistant.user_message def respond_in_assistant_thread( - payload: dict, - logger: logging.Logger, - context: BoltContext, - set_status: SetStatus, client: WebClient, + context: BoltContext, + get_thread_context: GetThreadContext, + logger: logging.Logger, + payload: dict, say: Say, + set_status: SetStatus, ): try: - # Tell the human user the assistant bot acknowledges the request and is working on it - set_status("is typing...") + channel_id = payload["channel"] + team_id = payload["team"] + thread_ts = payload["thread_ts"] + user_id = payload["user"] + user_message = payload["text"] + + set_status( + status="thinking...", + loading_messages=[ + "Untangling the internet cables…", + "Consulting the office goldfish…", + "Convincing the AI to stop overthinking…", + ], + ) # Collect the conversation history with this user - replies_in_thread = client.conversations_replies( + replies = client.conversations_replies( channel=context.channel_id, ts=context.thread_ts, oldest=context.thread_ts, limit=10, ) messages_in_thread: List[Dict[str, str]] = [] - for message in replies_in_thread["messages"]: + for message in replies["messages"]: role = "user" if message.get("bot_id") is None else "assistant" messages_in_thread.append({"role": role, "content": message["text"]}) - # Pass the latest prompt and chat history to the LLM (call_llm is your own code) returned_message = call_llm(messages_in_thread) # Post the result in the assistant thread @@ -93,23 +205,7 @@ def respond_in_assistant_thread( app.use(assistant) ``` -While the `assistant_thread_started` and `assistant_thread_context_changed` events do provide Slack-client thread context information, the `message.im` event does not. Any subsequent user message events won't contain thread context data. For that reason, Bolt not only provides a way to store thread context — the `threadContextStore` property — but it also provides an instance that is utilized by default. This implementation relies on storing and retrieving [message metadata](/messaging/message-metadata/) as the user interacts with the app. - -If you do provide your own `threadContextStore` property, it must feature `get` and `save` methods. - -:::tip[Refer to the [module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments.] -::: - -## Handling a new thread {#handling-a-new-thread} - -When the user opens a new thread with your AI-enabled app, the [`assistant_thread_started`](/reference/events/assistant_thread_started) event will be sent to your app. - -:::tip[When a user opens an app thread while in a channel, the channel info is stored as the thread's `AssistantThreadContext` data.] - -You can grab that info by using the `get_thread_context` utility, as subsequent user message event payloads won't include the channel info. -::: - -### Block Kit interactions in the app thread {#block-kit-interactions} +### Sending Block Kit alongside messages {#block-kit-interactions} For advanced use cases, Block Kit buttons may be used instead of suggested prompts, as well as the sending of messages with structured [metadata](/messaging/message-metadata/) to trigger subsequent interactions with the user. @@ -235,52 +331,182 @@ def respond_to_bot_messages(logger: logging.Logger, set_status: SetStatus, say: ... ``` -## Handling thread context changes {#handling-thread-context-changes} +See the [_Adding and handling feedback_](#adding-and-handling-feedback) section for adding feedback buttons with Block Kit. -When the user switches channels, the [`assistant_thread_context_changed`](/reference/events/assistant_thread_context_changed) event will be sent to your app. +## Text streaming in messages {#text-streaming} -If you use the built-in `Assistant` middleware without any custom configuration, the updated context data is automatically saved as [message metadata](/messaging/message-metadata/) of the first reply from the app. +Three Web API methods work together to provide users a text streaming experience: -As long as you use the built-in approach, you don't need to store the context data within a datastore. The downside of this default behavior is the overhead of additional calls to the Slack API. These calls include those to `conversations.history`, which are used to look up the stored message metadata that contains the thread context (via `get_thread_context`). +* the [`chat.startStream`](/reference/methods/chat.startstream) method starts the text stream, +* the [`chat.appendStream`](/reference/methods/chat.appendstream) method appends text to the stream, and +* the [`chat.stopStream`](/reference/methods/chat.stopstream) method stops it. + +Since you're using Bolt for Python, built upon the Python Slack SDK, you can use the [`chat_stream()`](https://docs.slack.dev/tools/python-slack-sdk/reference/web/client.html#slack_sdk.web.client.WebClient.chat_stream) utility to streamline all three aspects of streaming in your app's messages. + +The following example uses OpenAI's streaming API with the new `chat_stream()` functionality, but you can substitute it with the AI client of your choice. -To store context elsewhere, pass a custom `AssistantThreadContextStore` implementation to the `Assistant` constructor. We provide `FileAssistantThreadContextStore`, which is a reference implementation that uses the local file system. Since this reference implementation relies on local files, it's not advised for use in production. For production apps, we recommend creating a class that inherits `AssistantThreadContextStore`. ```python -from slack_bolt import FileAssistantThreadContextStore -assistant = Assistant(thread_context_store=FileAssistantThreadContextStore()) -``` +import os +from typing import List, Dict + +import openai +from openai import Stream +from openai.types.responses import ResponseStreamEvent + +DEFAULT_SYSTEM_CONTENT = """ +You're an assistant in a Slack workspace. +Users in the workspace will ask you to help them write something or to think better about a specific topic. +You'll respond to those questions in a professional way. +When you include markdown text, convert them to Slack compatible ones. +When a prompt has Slack's special syntax like <@USER_ID> or <#CHANNEL_ID>, you must keep them as-is in your response. +""" + +def call_llm( + messages_in_thread: List[Dict[str, str]], + system_content: str = DEFAULT_SYSTEM_CONTENT, +) -> Stream[ResponseStreamEvent]: + openai_client = openai.OpenAI(api_key=os.getenv("OPENAI_API_KEY")) + messages = [{"role": "system", "content": system_content}] + messages.extend(messages_in_thread) + response = openai_client.responses.create(model="gpt-4o-mini", input=messages, stream=True) + return response + +@assistant.user_message +def respond_in_assistant_thread( + ... +): + try: + ... + replies = client.conversations_replies( + channel=context.channel_id, + ts=context.thread_ts, + oldest=context.thread_ts, + limit=10, + ) + messages_in_thread: List[Dict[str, str]] = [] + for message in replies["messages"]: + role = "user" if message.get("bot_id") is None else "assistant" + messages_in_thread.append({"role": role, "content": message["text"]}) -## Handling the user response {#handling-the-user-response} + returned_message = call_llm(messages_in_thread) -When the user messages your app, the [`message.im`](/reference/events/message.im) event will be sent to your app. + streamer = client.chat_stream( + channel=channel_id, + recipient_team_id=team_id, + recipient_user_id=user_id, + thread_ts=thread_ts, + ) -Messages sent to the app do not contain a [subtype](/reference/events/message#subtypes) and must be deduced based on their shape and any provided [message metadata](/messaging/message-metadata/). + # Loop over OpenAI response stream + # https://platform.openai.com/docs/api-reference/responses/create + for event in returned_message: + if event.type == "response.output_text.delta": + streamer.append(markdown_text=f"{event.delta}") + else: + continue -There are three utilities that are particularly useful in curating the user experience: -* [`say`](https://docs.slack.dev/tools/bolt-python/reference/#slack_bolt.Say) -* [`setTitle`](https://docs.slack.dev/tools/bolt-python/reference/#slack_bolt.SetTitle) -* [`setStatus`](https://docs.slack.dev/tools/bolt-python/reference/#slack_bolt.SetStatus) + streamer.stop() -```python -... -# This listener is invoked when the human user posts a reply -@assistant.user_message -def respond_to_user_messages(logger: logging.Logger, set_status: SetStatus, say: Say): - try: - set_status("is typing...") - say("Please use the buttons in the first reply instead :bow:") except Exception as e: - logger.exception(f"Failed to respond to an inquiry: {e}") - say(f":warning: Sorry, something went wrong during processing your request (error: {e})") + logger.exception(f"Failed to handle a user message event: {e}") + say(f":warning: Something went wrong! ({e})") +``` -# Enable this assistant middleware in your Bolt app -app.use(assistant) +## Adding and handling feedback {#adding-and-handling-feedback} + +Use the [feedback buttons block element](/reference/block-kit/block-elements/feedback-buttons-element/) to allow users to immediately provide feedback regarding your app's responses. Here's a quick example: + +```py +from typing import List +from slack_sdk.models.blocks import Block, ContextActionsBlock, FeedbackButtonsElement, FeedbackButtonObject + + +def create_feedback_block() -> List[Block]: + """ + Create feedback block with thumbs up/down buttons + + Returns: + Block Kit context_actions block + """ + blocks: List[Block] = [ + ContextActionsBlock( + elements=[ + FeedbackButtonsElement( + action_id="feedback", + positive_button=FeedbackButtonObject( + text="Good Response", + accessibility_label="Submit positive feedback on this response", + value="good-feedback", + ), + negative_button=FeedbackButtonObject( + text="Bad Response", + accessibility_label="Submit negative feedback on this response", + value="bad-feedback", + ), + ) + ] + ) + ] + return blocks +``` + +Use the `chat_stream` utility to render the feedback block at the bottom of your app's message. + +```js +... + streamer = client.chat_stream( + channel=channel_id, + recipient_team_id=team_id, + recipient_user_id=user_id, + thread_ts=thread_ts, + ) + + # Loop over OpenAI response stream + # https://platform.openai.com/docs/api-reference/responses/create + for event in returned_message: + if event.type == "response.output_text.delta": + streamer.append(markdown_text=f"{event.delta}") + else: + continue + + feedback_block = create_feedback_block() + streamer.stop(blocks=feedback_block) +... ``` -## Full example: Assistant Template {#full-example} +Then add a response for when the user provides feedback. + +```python +# Handle feedback buttons (thumbs up/down) +def handle_feedback(ack, body, client, logger: logging.Logger): + try: + ack() + message_ts = body["message"]["ts"] + channel_id = body["channel"]["id"] + feedback_type = body["actions"][0]["value"] + is_positive = feedback_type == "good-feedback" + + if is_positive: + client.chat_postEphemeral( + channel=channel_id, + user=body["user"]["id"], + thread_ts=message_ts, + text="We're glad you found this useful.", + ) + else: + client.chat_postEphemeral( + channel=channel_id, + user=body["user"]["id"], + thread_ts=message_ts, + text="Sorry to hear that response wasn't up to par :slightly_frowning_face: Starting a new chat may help with AI mistakes and hallucinations.", + ) + + logger.debug(f"Handled feedback: type={feedback_type}, message_ts={message_ts}") + except Exception as error: + logger.error(f":warning: Something went wrong! {error}") +``` -Below is the `assistant.py` listener file of the [Assistant Template repo](https://github.com/slack-samples/bolt-python-assistant-template) we've created for you to build off of. +## Full example: App Agent Template {#app-agent-template} -```py reference title="assistant.py" -https://github.com/slack-samples/bolt-python-assistant-template/blob/main/listeners/assistant.py -``` \ No newline at end of file +Want to see the functionality described throughout this guide in action? We've created a [App Agent Template](https://github.com/slack-samples/bolt-python-assistant-template) repo for you to build off of. diff --git a/docs/english/concepts/message-sending.md b/docs/english/concepts/message-sending.md index 228a7b6b8..9741bb396 100644 --- a/docs/english/concepts/message-sending.md +++ b/docs/english/concepts/message-sending.md @@ -5,6 +5,7 @@ Within your listener function, `say()` is available whenever there is an associa In the case that you'd like to send a message outside of a listener or you want to do something more advanced (like handle specific errors), you can call `client.chat_postMessage` [using the client attached to your Bolt instance](/tools/bolt-python/concepts/web-api). Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. + ```python # Listens for messages containing "knock knock" and responds with an italicized "who's there?" @app.message("knock knock") @@ -38,4 +39,62 @@ def show_datepicker(event, say): blocks=blocks, text="Pick a date for me to remind you" ) -``` \ No newline at end of file +``` + +## Streaming messages {#streaming-messages} + +You can have your app's messages stream in to replicate conventional AI chatbot behavior. This is done through three Web API methods: + +* [`chat_startStream`](/reference/methods/chat.startstream) +* [`chat_appendStream`](/reference/methods/chat.appendstream) +* [`chat_stopStream`](/reference/methods/chat.stopstream) + +The Python Slack SDK provides a [`chat_stream()`](https://docs.slack.dev/tools/python-slack-sdk/reference/web/client.html#slack_sdk.web.client.WebClient.chat_stream) helper utility to streamline calling these methods. Here's an excerpt from our [Assistant template app](https://github.com/slack-samples/bolt-python-assistant-template): + +```python +streamer = client.chat_stream( + channel=channel_id, + recipient_team_id=team_id, + recipient_user_id=user_id, + thread_ts=thread_ts, +) + +# Loop over OpenAI response stream +# https://platform.openai.com/docs/api-reference/responses/create +for event in returned_message: + if event.type == "response.output_text.delta": + streamer.append(markdown_text=f"{event.delta}") + else: + continue + +feedback_block = create_feedback_block() +streamer.stop(blocks=feedback_block) +``` + +In that example, a [feedback buttons](/reference/block-kit/block-elements/feedback-buttons-element) block element is passed to `streamer.stop` to provide feedback buttons to the user at the bottom of the message. Interaction with these buttons will send a block action event to your app to receive the feedback. + +```python +def create_feedback_block() -> List[Block]: + blocks: List[Block] = [ + ContextActionsBlock( + elements=[ + FeedbackButtonsElement( + action_id="feedback", + positive_button=FeedbackButtonObject( + text="Good Response", + accessibility_label="Submit positive feedback on this response", + value="good-feedback", + ), + negative_button=FeedbackButtonObject( + text="Bad Response", + accessibility_label="Submit negative feedback on this response", + value="bad-feedback", + ), + ) + ] + ) + ] + return blocks +``` + +For information on calling the `chat_*Stream` API methods without the helper utility, see the [_Sending streaming messages_](/tools/python-slack-sdk/web#sending-streaming-messages) section of the Python Slack SDK docs. \ No newline at end of file diff --git a/docs/reference/app/app.html b/docs/reference/app/app.html index 3ee02b07c..c91d020ef 100644 --- a/docs/reference/app/app.html +++ b/docs/reference/app/app.html @@ -1195,7 +1195,9 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for + details. + """ def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3018,7 +3020,9 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for + details. + """ def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3028,7 +3032,8 @@

    Args

    return __call__

    Registers a new view_submission listener. -Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.

    +Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for +details.

    diff --git a/docs/reference/app/async_app.html b/docs/reference/app/async_app.html index 78959986b..9cbc801d0 100644 --- a/docs/reference/app/async_app.html +++ b/docs/reference/app/async_app.html @@ -1215,7 +1215,9 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_submission` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for + details. + """ def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3075,7 +3077,9 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_submission` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for + details. + """ def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3085,7 +3089,8 @@

    Args

    return __call__

    Registers a new view_submission listener. -Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.

    +Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for +details.

    def web_app(self, path: str = '/slack/events', port: int = 3000) ‑> aiohttp.web_app.Application diff --git a/docs/reference/app/index.html b/docs/reference/app/index.html index a46bc2e71..8821e5af9 100644 --- a/docs/reference/app/index.html +++ b/docs/reference/app/index.html @@ -1214,7 +1214,9 @@

    Classes

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for + details. + """ def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3037,7 +3039,9 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for + details. + """ def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3047,7 +3051,8 @@

    Args

    return __call__

    Registers a new view_submission listener. -Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.

    +Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for +details.

    diff --git a/docs/reference/async_app.html b/docs/reference/async_app.html index 707bfc3dd..8fd975be9 100644 --- a/docs/reference/async_app.html +++ b/docs/reference/async_app.html @@ -1306,7 +1306,9 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_submission` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for + details. + """ def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3166,7 +3168,9 @@

    Args

    middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None, ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]: """Registers a new `view_submission` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for + details. + """ def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3176,7 +3180,8 @@

    Args

    return __call__

    Registers a new view_submission listener. -Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.

    +Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for +details.

    def web_app(self, path: str = '/slack/events', port: int = 3000) ‑> aiohttp.web_app.Application @@ -5158,6 +5163,7 @@

    Class variables

    icon_emoji: Optional[str] = None, icon_url: Optional[str] = None, username: Optional[str] = None, + markdown_text: Optional[str] = None, mrkdwn: Optional[bool] = None, link_names: Optional[bool] = None, parse: Optional[str] = None, # none, full @@ -5183,6 +5189,7 @@

    Class variables

    icon_emoji=icon_emoji, icon_url=icon_url, username=username, + markdown_text=markdown_text, mrkdwn=mrkdwn, link_names=link_names, parse=parse, @@ -5248,11 +5255,18 @@

    Class variables

    self.channel_id = channel_id self.thread_ts = thread_ts - async def __call__(self, status: str) -> AsyncSlackResponse: + async def __call__( + self, + status: str, + loading_messages: Optional[List[str]] = None, + **kwargs, + ) -> AsyncSlackResponse: return await self.client.assistant_threads_setStatus( - status=status, channel_id=self.channel_id, thread_ts=self.thread_ts, + status=status, + loading_messages=loading_messages, + **kwargs, )
    @@ -5298,7 +5312,7 @@

    Class variables

    async def __call__( self, - prompts: List[Union[str, Dict[str, str]]], + prompts: Sequence[Union[str, Dict[str, str]]], title: Optional[str] = None, ) -> AsyncSlackResponse: prompts_arg: List[Dict[str, str]] = [] diff --git a/docs/reference/context/say/async_say.html b/docs/reference/context/say/async_say.html index 8547a1188..e170251fe 100644 --- a/docs/reference/context/say/async_say.html +++ b/docs/reference/context/say/async_say.html @@ -87,6 +87,7 @@

    Classes

    icon_emoji: Optional[str] = None, icon_url: Optional[str] = None, username: Optional[str] = None, + markdown_text: Optional[str] = None, mrkdwn: Optional[bool] = None, link_names: Optional[bool] = None, parse: Optional[str] = None, # none, full @@ -112,6 +113,7 @@

    Classes

    icon_emoji=icon_emoji, icon_url=icon_url, username=username, + markdown_text=markdown_text, mrkdwn=mrkdwn, link_names=link_names, parse=parse, diff --git a/docs/reference/context/say/index.html b/docs/reference/context/say/index.html index 7a5850760..e2ed0d03f 100644 --- a/docs/reference/context/say/index.html +++ b/docs/reference/context/say/index.html @@ -105,6 +105,7 @@

    Classes

    icon_emoji: Optional[str] = None, icon_url: Optional[str] = None, username: Optional[str] = None, + markdown_text: Optional[str] = None, mrkdwn: Optional[bool] = None, link_names: Optional[bool] = None, parse: Optional[str] = None, # none, full @@ -130,6 +131,7 @@

    Classes

    icon_emoji=icon_emoji, icon_url=icon_url, username=username, + markdown_text=markdown_text, mrkdwn=mrkdwn, link_names=link_names, parse=parse, diff --git a/docs/reference/context/say/say.html b/docs/reference/context/say/say.html index 5db4f24ba..c66e2776f 100644 --- a/docs/reference/context/say/say.html +++ b/docs/reference/context/say/say.html @@ -90,6 +90,7 @@

    Classes

    icon_emoji: Optional[str] = None, icon_url: Optional[str] = None, username: Optional[str] = None, + markdown_text: Optional[str] = None, mrkdwn: Optional[bool] = None, link_names: Optional[bool] = None, parse: Optional[str] = None, # none, full @@ -115,6 +116,7 @@

    Classes

    icon_emoji=icon_emoji, icon_url=icon_url, username=username, + markdown_text=markdown_text, mrkdwn=mrkdwn, link_names=link_names, parse=parse, diff --git a/docs/reference/context/set_status/async_set_status.html b/docs/reference/context/set_status/async_set_status.html index 6a15d70ae..06efd6447 100644 --- a/docs/reference/context/set_status/async_set_status.html +++ b/docs/reference/context/set_status/async_set_status.html @@ -70,11 +70,18 @@

    Classes

    self.channel_id = channel_id self.thread_ts = thread_ts - async def __call__(self, status: str) -> AsyncSlackResponse: + async def __call__( + self, + status: str, + loading_messages: Optional[List[str]] = None, + **kwargs, + ) -> AsyncSlackResponse: return await self.client.assistant_threads_setStatus( - status=status, channel_id=self.channel_id, thread_ts=self.thread_ts, + status=status, + loading_messages=loading_messages, + **kwargs, )
    diff --git a/docs/reference/context/set_status/index.html b/docs/reference/context/set_status/index.html index 9e53da9a5..aa11815e3 100644 --- a/docs/reference/context/set_status/index.html +++ b/docs/reference/context/set_status/index.html @@ -81,11 +81,18 @@

    Classes

    self.channel_id = channel_id self.thread_ts = thread_ts - def __call__(self, status: str) -> SlackResponse: + def __call__( + self, + status: str, + loading_messages: Optional[List[str]] = None, + **kwargs, + ) -> SlackResponse: return self.client.assistant_threads_setStatus( - status=status, channel_id=self.channel_id, thread_ts=self.thread_ts, + status=status, + loading_messages=loading_messages, + **kwargs, )
    diff --git a/docs/reference/context/set_status/set_status.html b/docs/reference/context/set_status/set_status.html index 0ec8df5da..e4d839f64 100644 --- a/docs/reference/context/set_status/set_status.html +++ b/docs/reference/context/set_status/set_status.html @@ -70,11 +70,18 @@

    Classes

    self.channel_id = channel_id self.thread_ts = thread_ts - def __call__(self, status: str) -> SlackResponse: + def __call__( + self, + status: str, + loading_messages: Optional[List[str]] = None, + **kwargs, + ) -> SlackResponse: return self.client.assistant_threads_setStatus( - status=status, channel_id=self.channel_id, thread_ts=self.thread_ts, + status=status, + loading_messages=loading_messages, + **kwargs, )
    diff --git a/docs/reference/context/set_suggested_prompts/async_set_suggested_prompts.html b/docs/reference/context/set_suggested_prompts/async_set_suggested_prompts.html index 449a72117..4feda52ba 100644 --- a/docs/reference/context/set_suggested_prompts/async_set_suggested_prompts.html +++ b/docs/reference/context/set_suggested_prompts/async_set_suggested_prompts.html @@ -72,7 +72,7 @@

    Classes

    async def __call__( self, - prompts: List[Union[str, Dict[str, str]]], + prompts: Sequence[Union[str, Dict[str, str]]], title: Optional[str] = None, ) -> AsyncSlackResponse: prompts_arg: List[Dict[str, str]] = [] diff --git a/docs/reference/context/set_suggested_prompts/index.html b/docs/reference/context/set_suggested_prompts/index.html index ee5371cea..12d864dde 100644 --- a/docs/reference/context/set_suggested_prompts/index.html +++ b/docs/reference/context/set_suggested_prompts/index.html @@ -83,7 +83,7 @@

    Classes

    def __call__( self, - prompts: List[Union[str, Dict[str, str]]], + prompts: Sequence[Union[str, Dict[str, str]]], title: Optional[str] = None, ) -> SlackResponse: prompts_arg: List[Dict[str, str]] = [] diff --git a/docs/reference/context/set_suggested_prompts/set_suggested_prompts.html b/docs/reference/context/set_suggested_prompts/set_suggested_prompts.html index 133d3a55a..6c0385e57 100644 --- a/docs/reference/context/set_suggested_prompts/set_suggested_prompts.html +++ b/docs/reference/context/set_suggested_prompts/set_suggested_prompts.html @@ -72,7 +72,7 @@

    Classes

    def __call__( self, - prompts: List[Union[str, Dict[str, str]]], + prompts: Sequence[Union[str, Dict[str, str]]], title: Optional[str] = None, ) -> SlackResponse: prompts_arg: List[Dict[str, str]] = [] diff --git a/docs/reference/index.html b/docs/reference/index.html index 1ce8cd134..7bd6d117e 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -1335,7 +1335,9 @@

    Class variables

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for + details. + """ def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3158,7 +3160,9 @@

    Args

    middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, ) -> Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]: """Registers a new `view_submission` listener. - Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.""" + Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for + details. + """ def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) @@ -3168,7 +3172,8 @@

    Args

    return __call__

    Registers a new view_submission listener. -Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for details.

    +Refer to https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload/#view_submission for +details.

    @@ -5691,6 +5696,7 @@

    Class variables

    icon_emoji: Optional[str] = None, icon_url: Optional[str] = None, username: Optional[str] = None, + markdown_text: Optional[str] = None, mrkdwn: Optional[bool] = None, link_names: Optional[bool] = None, parse: Optional[str] = None, # none, full @@ -5716,6 +5722,7 @@

    Class variables

    icon_emoji=icon_emoji, icon_url=icon_url, username=username, + markdown_text=markdown_text, mrkdwn=mrkdwn, link_names=link_names, parse=parse, @@ -5786,11 +5793,18 @@

    Class variables

    self.channel_id = channel_id self.thread_ts = thread_ts - def __call__(self, status: str) -> SlackResponse: + def __call__( + self, + status: str, + loading_messages: Optional[List[str]] = None, + **kwargs, + ) -> SlackResponse: return self.client.assistant_threads_setStatus( - status=status, channel_id=self.channel_id, thread_ts=self.thread_ts, + status=status, + loading_messages=loading_messages, + **kwargs, )
    @@ -5836,7 +5850,7 @@

    Class variables

    def __call__( self, - prompts: List[Union[str, Dict[str, str]]], + prompts: Sequence[Union[str, Dict[str, str]]], title: Optional[str] = None, ) -> SlackResponse: prompts_arg: List[Dict[str, str]] = [] diff --git a/pyproject.toml b/pyproject.toml index 5a6523f35..5361ef1b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ classifiers = [ "Operating System :: OS Independent", ] requires-python = ">=3.7" -dependencies = ["slack_sdk>=3.35.0,<4"] +dependencies = ["slack_sdk>=3.37.0,<4"] [project.urls] diff --git a/slack_bolt/context/say/async_say.py b/slack_bolt/context/say/async_say.py index b771529b0..c492e5d77 100644 --- a/slack_bolt/context/say/async_say.py +++ b/slack_bolt/context/say/async_say.py @@ -1,14 +1,14 @@ -from typing import Optional, Union, Dict, Sequence, Callable, Awaitable +from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -from slack_sdk.models.metadata import Metadata - -from slack_bolt.context.say.internals import _can_say -from slack_bolt.util.utils import create_copy from slack_sdk.models.attachments import Attachment from slack_sdk.models.blocks import Block +from slack_sdk.models.metadata import Metadata from slack_sdk.web.async_client import AsyncWebClient from slack_sdk.web.async_slack_response import AsyncSlackResponse +from slack_bolt.context.say.internals import _can_say +from slack_bolt.util.utils import create_copy + class AsyncSay: client: Optional[AsyncWebClient] @@ -42,6 +42,7 @@ async def __call__( icon_emoji: Optional[str] = None, icon_url: Optional[str] = None, username: Optional[str] = None, + markdown_text: Optional[str] = None, mrkdwn: Optional[bool] = None, link_names: Optional[bool] = None, parse: Optional[str] = None, # none, full @@ -67,6 +68,7 @@ async def __call__( icon_emoji=icon_emoji, icon_url=icon_url, username=username, + markdown_text=markdown_text, mrkdwn=mrkdwn, link_names=link_names, parse=parse, diff --git a/slack_bolt/context/say/say.py b/slack_bolt/context/say/say.py index 6cfbcd801..a6e5904e3 100644 --- a/slack_bolt/context/say/say.py +++ b/slack_bolt/context/say/say.py @@ -1,4 +1,4 @@ -from typing import Optional, Union, Dict, Sequence, Callable +from typing import Callable, Dict, Optional, Sequence, Union from slack_sdk import WebClient from slack_sdk.models.attachments import Attachment @@ -45,6 +45,7 @@ def __call__( icon_emoji: Optional[str] = None, icon_url: Optional[str] = None, username: Optional[str] = None, + markdown_text: Optional[str] = None, mrkdwn: Optional[bool] = None, link_names: Optional[bool] = None, parse: Optional[str] = None, # none, full @@ -70,6 +71,7 @@ def __call__( icon_emoji=icon_emoji, icon_url=icon_url, username=username, + markdown_text=markdown_text, mrkdwn=mrkdwn, link_names=link_names, parse=parse, diff --git a/slack_bolt/context/set_status/async_set_status.py b/slack_bolt/context/set_status/async_set_status.py index 926ec6de8..e2c451f46 100644 --- a/slack_bolt/context/set_status/async_set_status.py +++ b/slack_bolt/context/set_status/async_set_status.py @@ -1,3 +1,5 @@ +from typing import List, Optional + from slack_sdk.web.async_client import AsyncWebClient from slack_sdk.web.async_slack_response import AsyncSlackResponse @@ -17,9 +19,16 @@ def __init__( self.channel_id = channel_id self.thread_ts = thread_ts - async def __call__(self, status: str) -> AsyncSlackResponse: + async def __call__( + self, + status: str, + loading_messages: Optional[List[str]] = None, + **kwargs, + ) -> AsyncSlackResponse: return await self.client.assistant_threads_setStatus( - status=status, channel_id=self.channel_id, thread_ts=self.thread_ts, + status=status, + loading_messages=loading_messages, + **kwargs, ) diff --git a/slack_bolt/context/set_status/set_status.py b/slack_bolt/context/set_status/set_status.py index 8df0d49a7..0ed612e16 100644 --- a/slack_bolt/context/set_status/set_status.py +++ b/slack_bolt/context/set_status/set_status.py @@ -1,3 +1,5 @@ +from typing import List, Optional + from slack_sdk import WebClient from slack_sdk.web import SlackResponse @@ -17,9 +19,16 @@ def __init__( self.channel_id = channel_id self.thread_ts = thread_ts - def __call__(self, status: str) -> SlackResponse: + def __call__( + self, + status: str, + loading_messages: Optional[List[str]] = None, + **kwargs, + ) -> SlackResponse: return self.client.assistant_threads_setStatus( - status=status, channel_id=self.channel_id, thread_ts=self.thread_ts, + status=status, + loading_messages=loading_messages, + **kwargs, ) diff --git a/slack_bolt/context/set_suggested_prompts/async_set_suggested_prompts.py b/slack_bolt/context/set_suggested_prompts/async_set_suggested_prompts.py index aeeb244d7..2079b6448 100644 --- a/slack_bolt/context/set_suggested_prompts/async_set_suggested_prompts.py +++ b/slack_bolt/context/set_suggested_prompts/async_set_suggested_prompts.py @@ -1,4 +1,4 @@ -from typing import List, Dict, Union, Optional +from typing import Dict, List, Optional, Sequence, Union from slack_sdk.web.async_client import AsyncWebClient from slack_sdk.web.async_slack_response import AsyncSlackResponse @@ -21,7 +21,7 @@ def __init__( async def __call__( self, - prompts: List[Union[str, Dict[str, str]]], + prompts: Sequence[Union[str, Dict[str, str]]], title: Optional[str] = None, ) -> AsyncSlackResponse: prompts_arg: List[Dict[str, str]] = [] diff --git a/slack_bolt/context/set_suggested_prompts/set_suggested_prompts.py b/slack_bolt/context/set_suggested_prompts/set_suggested_prompts.py index fc9304b17..21ff815e1 100644 --- a/slack_bolt/context/set_suggested_prompts/set_suggested_prompts.py +++ b/slack_bolt/context/set_suggested_prompts/set_suggested_prompts.py @@ -1,4 +1,4 @@ -from typing import List, Dict, Union, Optional +from typing import Dict, List, Optional, Sequence, Union from slack_sdk import WebClient from slack_sdk.web import SlackResponse @@ -21,7 +21,7 @@ def __init__( def __call__( self, - prompts: List[Union[str, Dict[str, str]]], + prompts: Sequence[Union[str, Dict[str, str]]], title: Optional[str] = None, ) -> SlackResponse: prompts_arg: List[Dict[str, str]] = [] diff --git a/tests/slack_bolt/context/test_say.py b/tests/slack_bolt/context/test_say.py index 9e465e5d5..6ca1fc96a 100644 --- a/tests/slack_bolt/context/test_say.py +++ b/tests/slack_bolt/context/test_say.py @@ -3,10 +3,7 @@ from slack_sdk.web import SlackResponse from slack_bolt import Say -from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, -) +from tests.mock_web_api_server import cleanup_mock_web_api_server, setup_mock_web_api_server class TestSay: @@ -24,6 +21,11 @@ def test_say(self): response: SlackResponse = say(text="Hi there!") assert response.status_code == 200 + def test_say_markdown_text(self): + say = Say(client=self.web_client, channel="C111") + response: SlackResponse = say(markdown_text="**Greetings!**") + assert response.status_code == 200 + def test_say_unfurl_options(self): say = Say(client=self.web_client, channel="C111") response: SlackResponse = say(text="Hi there!", unfurl_media=True, unfurl_links=True) diff --git a/tests/slack_bolt/context/test_set_status.py b/tests/slack_bolt/context/test_set_status.py new file mode 100644 index 000000000..fe998df5e --- /dev/null +++ b/tests/slack_bolt/context/test_set_status.py @@ -0,0 +1,38 @@ +import pytest +from slack_sdk import WebClient +from slack_sdk.web import SlackResponse + +from slack_bolt.context.set_status import SetStatus +from tests.mock_web_api_server import cleanup_mock_web_api_server, setup_mock_web_api_server + + +class TestSetStatus: + def setup_method(self): + setup_mock_web_api_server(self) + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + self.web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + + def test_set_status(self): + set_status = SetStatus(client=self.web_client, channel_id="C111", thread_ts="123.123") + response: SlackResponse = set_status("Thinking...") + assert response.status_code == 200 + + def test_set_status_loading_messages(self): + set_status = SetStatus(client=self.web_client, channel_id="C111", thread_ts="123.123") + response: SlackResponse = set_status( + status="Thinking...", + loading_messages=[ + "Sitting...", + "Waiting...", + ], + ) + assert response.status_code == 200 + + def test_set_status_invalid(self): + set_status = SetStatus(client=self.web_client, channel_id="C111", thread_ts="123.123") + with pytest.raises(TypeError): + set_status() diff --git a/tests/slack_bolt/context/test_set_suggested_prompts.py b/tests/slack_bolt/context/test_set_suggested_prompts.py new file mode 100644 index 000000000..792b974b5 --- /dev/null +++ b/tests/slack_bolt/context/test_set_suggested_prompts.py @@ -0,0 +1,37 @@ +import pytest +from slack_sdk import WebClient +from slack_sdk.web import SlackResponse + +from slack_bolt.context.set_suggested_prompts import SetSuggestedPrompts +from tests.mock_web_api_server import cleanup_mock_web_api_server, setup_mock_web_api_server + + +class TestSetSuggestedPrompts: + def setup_method(self): + setup_mock_web_api_server(self) + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + self.web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + + def test_set_suggested_prompts(self): + set_suggested_prompts = SetSuggestedPrompts(client=self.web_client, channel_id="C111", thread_ts="123.123") + response: SlackResponse = set_suggested_prompts(prompts=["One", "Two"]) + assert response.status_code == 200 + + def test_set_suggested_prompts_objects(self): + set_suggested_prompts = SetSuggestedPrompts(client=self.web_client, channel_id="C111", thread_ts="123.123") + response: SlackResponse = set_suggested_prompts( + prompts=[ + "One", + {"title": "Two", "message": "What's before addition?"}, + ], + ) + assert response.status_code == 200 + + def test_set_suggested_prompts_invalid(self): + set_suggested_prompts = SetSuggestedPrompts(client=self.web_client, channel_id="C111", thread_ts="123.123") + with pytest.raises(TypeError): + set_suggested_prompts() diff --git a/tests/slack_bolt_async/context/test_async_say.py b/tests/slack_bolt_async/context/test_async_say.py index 77ac0cc0e..efa90febc 100644 --- a/tests/slack_bolt_async/context/test_async_say.py +++ b/tests/slack_bolt_async/context/test_async_say.py @@ -2,12 +2,9 @@ from slack_sdk.web.async_client import AsyncWebClient from slack_sdk.web.async_slack_response import AsyncSlackResponse -from tests.utils import get_event_loop from slack_bolt.context.say.async_say import AsyncSay -from tests.mock_web_api_server import ( - cleanup_mock_web_api_server_async, - setup_mock_web_api_server_async, -) +from tests.mock_web_api_server import cleanup_mock_web_api_server_async, setup_mock_web_api_server_async +from tests.utils import get_event_loop class TestAsyncSay: @@ -29,6 +26,12 @@ async def test_say(self): response: AsyncSlackResponse = await say(text="Hi there!") assert response.status_code == 200 + @pytest.mark.asyncio + async def test_say_markdown_text(self): + say = AsyncSay(client=self.web_client, channel="C111") + response: AsyncSlackResponse = await say(markdown_text="**Greetings!**") + assert response.status_code == 200 + @pytest.mark.asyncio async def test_say_unfurl_options(self): say = AsyncSay(client=self.web_client, channel="C111") diff --git a/tests/slack_bolt_async/context/test_async_set_status.py b/tests/slack_bolt_async/context/test_async_set_status.py new file mode 100644 index 000000000..8df34171f --- /dev/null +++ b/tests/slack_bolt_async/context/test_async_set_status.py @@ -0,0 +1,45 @@ +import pytest +from slack_sdk.web.async_client import AsyncWebClient +from slack_sdk.web.async_slack_response import AsyncSlackResponse + +from slack_bolt.context.set_status.async_set_status import AsyncSetStatus +from tests.mock_web_api_server import cleanup_mock_web_api_server_async, setup_mock_web_api_server_async +from tests.utils import get_event_loop + + +class TestAsyncSetStatus: + @pytest.fixture + def event_loop(self): + setup_mock_web_api_server_async(self) + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + self.web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url) + + loop = get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server_async(self) + + @pytest.mark.asyncio + async def test_set_status(self): + set_status = AsyncSetStatus(client=self.web_client, channel_id="C111", thread_ts="123.123") + response: AsyncSlackResponse = await set_status("Thinking...") + assert response.status_code == 200 + + @pytest.mark.asyncio + async def test_set_status_loading_messages(self): + set_status = AsyncSetStatus(client=self.web_client, channel_id="C111", thread_ts="123.123") + response: AsyncSlackResponse = await set_status( + status="Thinking...", + loading_messages=[ + "Sitting...", + "Waiting...", + ], + ) + assert response.status_code == 200 + + @pytest.mark.asyncio + async def test_set_status_invalid(self): + set_status = AsyncSetStatus(client=self.web_client, channel_id="C111", thread_ts="123.123") + with pytest.raises(TypeError): + await set_status() diff --git a/tests/slack_bolt_async/context/test_async_set_suggested_prompts.py b/tests/slack_bolt_async/context/test_async_set_suggested_prompts.py new file mode 100644 index 000000000..70a24efcb --- /dev/null +++ b/tests/slack_bolt_async/context/test_async_set_suggested_prompts.py @@ -0,0 +1,45 @@ +import asyncio + +import pytest +from slack_sdk.web.async_client import AsyncWebClient +from slack_sdk.web.async_slack_response import AsyncSlackResponse + +from slack_bolt.context.set_suggested_prompts.async_set_suggested_prompts import AsyncSetSuggestedPrompts +from tests.mock_web_api_server import cleanup_mock_web_api_server, setup_mock_web_api_server + + +class TestAsyncSetSuggestedPrompts: + @pytest.fixture + def event_loop(self): + setup_mock_web_api_server(self) + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + self.web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url) + + loop = asyncio.get_event_loop() + yield loop + loop.close() + cleanup_mock_web_api_server(self) + + @pytest.mark.asyncio + async def test_set_suggested_prompts(self): + set_suggested_prompts = AsyncSetSuggestedPrompts(client=self.web_client, channel_id="C111", thread_ts="123.123") + response: AsyncSlackResponse = await set_suggested_prompts(prompts=["One", "Two"]) + assert response.status_code == 200 + + @pytest.mark.asyncio + async def test_set_suggested_prompts_objects(self): + set_suggested_prompts = AsyncSetSuggestedPrompts(client=self.web_client, channel_id="C111", thread_ts="123.123") + response: AsyncSlackResponse = await set_suggested_prompts( + prompts=[ + "One", + {"title": "Two", "message": "What's before addition?"}, + ], + ) + assert response.status_code == 200 + + @pytest.mark.asyncio + async def test_set_suggested_prompts_invalid(self): + set_suggested_prompts = AsyncSetSuggestedPrompts(client=self.web_client, channel_id="C111", thread_ts="123.123") + with pytest.raises(TypeError): + await set_suggested_prompts() From 5f6196f1570d348db5916aaafbb3d3c212e374dd Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Mon, 6 Oct 2025 16:40:52 -0700 Subject: [PATCH 661/719] version 1.26.0 (#1388) --- slack_bolt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 7f9c19341..8cfd6f900 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,3 +1,3 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.25.0" +__version__ = "1.26.0" From 1d4e86bfc13118a4f44d8afe96d6cbeb0ebab88e Mon Sep 17 00:00:00 2001 From: Haley Elmendorf <31392893+haleychaas@users.noreply.github.com> Date: Wed, 8 Oct 2025 17:44:35 -0500 Subject: [PATCH 662/719] docs: add AI to quickstart (#1389) --- docs/english/building-an-app.md | 6 +++--- docs/english/getting-started.md | 35 +++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/docs/english/building-an-app.md b/docs/english/building-an-app.md index 301cc52c6..ee0dac967 100644 --- a/docs/english/building-an-app.md +++ b/docs/english/building-an-app.md @@ -475,8 +475,8 @@ Now that you have a basic app up and running, you can start exploring how to mak * Read through the concepts pages to learn about the different methods and features your Bolt app has access to. -* Explore the different events your bot can listen to with the [`app.event()`](/tools/bolt-python/concepts/event-listening) method. All of the events are listed [on the API docs site](/reference/events). +* Explore the different events your bot can listen to with the [`app.event()`](/tools/bolt-python/concepts/event-listening) method. View the full events reference docs [here](/reference/events). -* Bolt allows you to [call Web API methods](/tools/bolt-python/concepts/web-api) with the client attached to your app. There are [over 200 methods](/reference/methods) on our API site. +* Bolt allows you to [call Web API methods](/tools/bolt-python/concepts/web-api) with the client attached to your app. There are over 200 methods; view them [here](/reference/methods). -* Learn more about the different token types [on the API docs site](/authentication/tokens). Your app may need different tokens depending on the actions you want it to perform. +* Learn more about the different token types in the [tokens guide](/authentication/tokens). Your app may need different tokens depending on the actions you want it to perform. \ No newline at end of file diff --git a/docs/english/getting-started.md b/docs/english/getting-started.md index 8b7438d65..cc428a93a 100644 --- a/docs/english/getting-started.md +++ b/docs/english/getting-started.md @@ -279,6 +279,41 @@ This will open the following page: On these pages you're free to make changes such as updating your app icon, configuring app features, and perhaps even distributing your app! +## Adding AI features {#ai-features} + +Now that you're familiar with a basic app setup, try it out again, this time using the AI agent template! + + + + +Get started with the agent template: + +```sh +$ slack create ai-app --template slack-samples/bolt-python-assistant-template +$ cd ai-app +``` + + + + +Get started with the agent template: + +```sh +$ git clone https://github.com/slack-samples/bolt-python-assistant-template ai-app +$ cd ai-app +``` + +Using this method, be sure to set the app and bot tokens as we did in the [Running the app](#running-the-app) section above. + + + + +Once the project is created, update the `.env.sample` file by setting the `OPENAI_API_KEY` with the value of your key and removing the `.sample` from the file name. + +In the `ai` folder of this app, you'll find default instructions for the LLM and an OpenAI client setup. + +The `listeners` include utilities intended for messaging with an LLM. Those are outlined in detail in the guide to [Using AI in apps](/tools/bolt-python/concepts/ai-apps) and [Sending messages](/tools/bolt-python/concepts/message-sending). + ## Next steps {#next-steps} Congrats once more on getting up and running with this quick start. From c8a50bee46fde24631a9e1746bdd8c81e5deea05 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Fri, 10 Oct 2025 16:08:06 -0400 Subject: [PATCH 663/719] feat: add has_been_called on `complete` & `fail` utility (#1390) --- slack_bolt/context/complete/async_complete.py | 11 +++++++++++ slack_bolt/context/complete/complete.py | 11 +++++++++++ slack_bolt/context/fail/async_fail.py | 11 +++++++++++ slack_bolt/context/fail/fail.py | 11 +++++++++++ tests/scenario_tests/test_function.py | 4 ++++ tests/scenario_tests_async/test_function.py | 4 ++++ tests/slack_bolt/context/test_complete.py | 9 +++++++++ tests/slack_bolt/context/test_fail.py | 9 +++++++++ tests/slack_bolt_async/context/test_async_complete.py | 11 +++++++++++ tests/slack_bolt_async/context/test_async_fail.py | 11 +++++++++++ 10 files changed, 92 insertions(+) diff --git a/slack_bolt/context/complete/async_complete.py b/slack_bolt/context/complete/async_complete.py index fe3d796d1..bb81c2d4a 100644 --- a/slack_bolt/context/complete/async_complete.py +++ b/slack_bolt/context/complete/async_complete.py @@ -7,6 +7,7 @@ class AsyncComplete: client: AsyncWebClient function_execution_id: Optional[str] + _called: bool def __init__( self, @@ -15,6 +16,7 @@ def __init__( ): self.client = client self.function_execution_id = function_execution_id + self._called = False async def __call__(self, outputs: Optional[Dict[str, Any]] = None) -> AsyncSlackResponse: """Signal the successful completion of the custom function. @@ -31,6 +33,15 @@ async def __call__(self, outputs: Optional[Dict[str, Any]] = None) -> AsyncSlack if self.function_execution_id is None: raise ValueError("complete is unsupported here as there is no function_execution_id") + self._called = True return await self.client.functions_completeSuccess( function_execution_id=self.function_execution_id, outputs=outputs or {} ) + + def has_been_called(self) -> bool: + """Check if this complete function has been called. + + Returns: + bool: True if the complete function has been called, False otherwise. + """ + return self._called diff --git a/slack_bolt/context/complete/complete.py b/slack_bolt/context/complete/complete.py index acba3a412..dc9382384 100644 --- a/slack_bolt/context/complete/complete.py +++ b/slack_bolt/context/complete/complete.py @@ -7,6 +7,7 @@ class Complete: client: WebClient function_execution_id: Optional[str] + _called: bool def __init__( self, @@ -15,6 +16,7 @@ def __init__( ): self.client = client self.function_execution_id = function_execution_id + self._called = False def __call__(self, outputs: Optional[Dict[str, Any]] = None) -> SlackResponse: """Signal the successful completion of the custom function. @@ -31,4 +33,13 @@ def __call__(self, outputs: Optional[Dict[str, Any]] = None) -> SlackResponse: if self.function_execution_id is None: raise ValueError("complete is unsupported here as there is no function_execution_id") + self._called = True return self.client.functions_completeSuccess(function_execution_id=self.function_execution_id, outputs=outputs or {}) + + def has_been_called(self) -> bool: + """Check if this complete function has been called. + + Returns: + bool: True if the complete function has been called, False otherwise. + """ + return self._called diff --git a/slack_bolt/context/fail/async_fail.py b/slack_bolt/context/fail/async_fail.py index 10a39f735..da01067ba 100644 --- a/slack_bolt/context/fail/async_fail.py +++ b/slack_bolt/context/fail/async_fail.py @@ -7,6 +7,7 @@ class AsyncFail: client: AsyncWebClient function_execution_id: Optional[str] + _called: bool def __init__( self, @@ -15,6 +16,7 @@ def __init__( ): self.client = client self.function_execution_id = function_execution_id + self._called = False async def __call__(self, error: str) -> AsyncSlackResponse: """Signal that the custom function failed to complete. @@ -31,4 +33,13 @@ async def __call__(self, error: str) -> AsyncSlackResponse: if self.function_execution_id is None: raise ValueError("fail is unsupported here as there is no function_execution_id") + self._called = True return await self.client.functions_completeError(function_execution_id=self.function_execution_id, error=error) + + def has_been_called(self) -> bool: + """Check if this fail function has been called. + + Returns: + bool: True if the fail function has been called, False otherwise. + """ + return self._called diff --git a/slack_bolt/context/fail/fail.py b/slack_bolt/context/fail/fail.py index 483bcebc3..9b04f6118 100644 --- a/slack_bolt/context/fail/fail.py +++ b/slack_bolt/context/fail/fail.py @@ -7,6 +7,7 @@ class Fail: client: WebClient function_execution_id: Optional[str] + _called: bool def __init__( self, @@ -15,6 +16,7 @@ def __init__( ): self.client = client self.function_execution_id = function_execution_id + self._called = False def __call__(self, error: str) -> SlackResponse: """Signal that the custom function failed to complete. @@ -31,4 +33,13 @@ def __call__(self, error: str) -> SlackResponse: if self.function_execution_id is None: raise ValueError("fail is unsupported here as there is no function_execution_id") + self._called = True return self.client.functions_completeError(function_execution_id=self.function_execution_id, error=error) + + def has_been_called(self) -> bool: + """Check if this fail function has been called. + + Returns: + bool: True if the fail function has been called, False otherwise. + """ + return self._called diff --git a/tests/scenario_tests/test_function.py b/tests/scenario_tests/test_function.py index 0a2152892..5a4fc2685 100644 --- a/tests/scenario_tests/test_function.py +++ b/tests/scenario_tests/test_function.py @@ -300,16 +300,20 @@ def reverse(body, event, context, client, complete, inputs): assert context.client.token == "xwfp-valid" assert client.token == "xwfp-valid" assert complete.client.token == "xwfp-valid" + assert complete.has_been_called() is False complete( outputs={"reverseString": "olleh"}, ) + assert complete.has_been_called() is True def reverse_error(body, event, fail): assert body == function_body assert event == function_body["event"] assert fail.function_execution_id == "Fx111" + assert fail.has_been_called() is False fail(error="there was an error") + assert fail.has_been_called() is True def complete_it(body, event, complete): diff --git a/tests/scenario_tests_async/test_function.py b/tests/scenario_tests_async/test_function.py index 3f8b7a722..142cc1d6c 100644 --- a/tests/scenario_tests_async/test_function.py +++ b/tests/scenario_tests_async/test_function.py @@ -312,18 +312,22 @@ async def reverse(body, event, client, context, complete, inputs): assert context.client.token == "xwfp-valid" assert client.token == "xwfp-valid" assert complete.client.token == "xwfp-valid" + assert complete.has_been_called() is False await complete( outputs={"reverseString": "olleh"}, ) + assert complete.has_been_called() is True async def reverse_error(body, event, fail): assert body == function_body assert event == function_body["event"] assert fail.function_execution_id == "Fx111" + assert fail.has_been_called() is False await fail( error="there was an error", ) + assert fail.has_been_called() is True async def complete_it(body, event, complete): diff --git a/tests/slack_bolt/context/test_complete.py b/tests/slack_bolt/context/test_complete.py index a920c41eb..63a1d9f04 100644 --- a/tests/slack_bolt/context/test_complete.py +++ b/tests/slack_bolt/context/test_complete.py @@ -30,3 +30,12 @@ def test_complete_no_function_execution_id(self): with pytest.raises(ValueError): complete(outputs={"key": "value"}) + + def test_has_been_called_false_initially(self): + complete = Complete(client=self.web_client, function_execution_id="fn1111") + assert complete.has_been_called() is False + + def test_has_been_called_true_after_complete(self): + complete = Complete(client=self.web_client, function_execution_id="fn1111") + complete(outputs={"key": "value"}) + assert complete.has_been_called() is True diff --git a/tests/slack_bolt/context/test_fail.py b/tests/slack_bolt/context/test_fail.py index e4704d376..14348281f 100644 --- a/tests/slack_bolt/context/test_fail.py +++ b/tests/slack_bolt/context/test_fail.py @@ -30,3 +30,12 @@ def test_fail_no_function_execution_id(self): with pytest.raises(ValueError): fail(error="there was an error") + + def test_has_been_called_false_initially(self): + fail = Fail(client=self.web_client, function_execution_id="fn1111") + assert fail.has_been_called() is False + + def test_has_been_called_true_after_fail(self): + fail = Fail(client=self.web_client, function_execution_id="fn1111") + fail(error="there was an error") + assert fail.has_been_called() is True diff --git a/tests/slack_bolt_async/context/test_async_complete.py b/tests/slack_bolt_async/context/test_async_complete.py index f2fd115ec..b2a464f83 100644 --- a/tests/slack_bolt_async/context/test_async_complete.py +++ b/tests/slack_bolt_async/context/test_async_complete.py @@ -36,3 +36,14 @@ async def test_complete_no_function_execution_id(self): with pytest.raises(ValueError): await complete(outputs={"key": "value"}) + + @pytest.mark.asyncio + async def test_has_been_called_false_initially(self): + complete = AsyncComplete(client=self.web_client, function_execution_id="fn1111") + assert complete.has_been_called() is False + + @pytest.mark.asyncio + async def test_has_been_called_true_after_complete(self): + complete = AsyncComplete(client=self.web_client, function_execution_id="fn1111") + await complete(outputs={"key": "value"}) + assert complete.has_been_called() is True diff --git a/tests/slack_bolt_async/context/test_async_fail.py b/tests/slack_bolt_async/context/test_async_fail.py index 854bc7521..d4708927f 100644 --- a/tests/slack_bolt_async/context/test_async_fail.py +++ b/tests/slack_bolt_async/context/test_async_fail.py @@ -36,3 +36,14 @@ async def test_fail_no_function_execution_id(self): with pytest.raises(ValueError): await fail(error="there was an error") + + @pytest.mark.asyncio + async def test_has_been_called_false_initially(self): + fail = AsyncFail(client=self.web_client, function_execution_id="fn1111") + assert fail.has_been_called() is False + + @pytest.mark.asyncio + async def test_has_been_called_true_after_fail(self): + fail = AsyncFail(client=self.web_client, function_execution_id="fn1111") + await fail(error="there was an error") + assert fail.has_been_called() is True From ad2da997112bd917eb14d73c582066d7ca24b936 Mon Sep 17 00:00:00 2001 From: Haley Elmendorf <31392893+haleychaas@users.noreply.github.com> Date: Wed, 29 Oct 2025 14:29:26 -0500 Subject: [PATCH 664/719] docs: order confirmation tutorial (#1381) --- docs/english/_sidebar.json | 1 + .../order-confirmation/order-confirmation.md | 553 ++++++++++++++++++ docs/img/delivery-tracker-main.png | Bin 0 -> 65799 bytes 3 files changed, 554 insertions(+) create mode 100644 docs/english/tutorial/order-confirmation/order-confirmation.md create mode 100644 docs/img/delivery-tracker-main.png diff --git a/docs/english/_sidebar.json b/docs/english/_sidebar.json index d42868543..859c4b52f 100644 --- a/docs/english/_sidebar.json +++ b/docs/english/_sidebar.json @@ -96,6 +96,7 @@ "label": "Tutorials", "items": [ "tools/bolt-python/tutorial/ai-chatbot/ai-chatbot", + "tools/bolt-python/tutorial/order-confirmation/order-confirmation", "tools/bolt-python/tutorial/custom-steps", "tools/bolt-python/tutorial/custom-steps-for-jira/custom-steps-for-jira", "tools/bolt-python/tutorial/custom-steps-workflow-builder-new/custom-steps-workflow-builder-new", diff --git a/docs/english/tutorial/order-confirmation/order-confirmation.md b/docs/english/tutorial/order-confirmation/order-confirmation.md new file mode 100644 index 000000000..695d6965a --- /dev/null +++ b/docs/english/tutorial/order-confirmation/order-confirmation.md @@ -0,0 +1,553 @@ +--- +title: Create a Salesforce order confirmation app +--- + +In this tutorial, you'll use the [Bolt for Python](/tools/bolt-python/) framework and [Block Kit Builder](https://app.slack.com/block-kit-builder) to create an order confirmation app that links to a system of record, like Salesforce. + +The Slack app will: +* allow users to enter order numbers from within Slack, along with some additional order information, +* post that information to a Slack channel, and +* send the information to the system of record. + +End users will be able to enter information across devices, as many will likely be using a mobile device. + +Along the way, you'll learn how to use the Bolt for Python starter app template as a jumping off point for your own custom apps. Let's begin! + +:::warning[Consider the following] + +This tutorial was created for educational purposes within a Slack workshop. As a result, it has not been tested quite as rigorously as our sample apps. Proceed carefully if you'd like to use a similar app in production. + +::: + +## Getting started + +### Installing the Slack CLI + +If you don't already have the Slack CLI, install it from your terminal: navigate to the installation guide ([for Mac and Linux](/tools/slack-cli/guides/installing-the-slack-cli-for-mac-and-linux) or [for Windows](/tools/slack-cli/guides/installing-the-slack-cli-for-windows)) and follow the steps. + +### Cloning the starter app + +Once installed, use the command `slack create` to get started with the Bolt for Python [starter template](https://github.com/slack-samples/bolt-python-starter-template). Alternatively, you can clone the template using Git. + +You can remove the portions from the template that are not used within this tutorial to make things a bit cleaner for yourself. To do this, open your project in VS Code (you can do this from the terminal with the `code .` command) and delete the `commands`, `events`, and `shortcuts` folders from the `/listeners` folder. You can also do the same to the corresponding folders within the `/listeners/tests` folder as well. Finally, remove the imports of these files from the `/listeners/__init__.py` file. + +## Creating your app + +We’ll use the contents of the `manifest.json` file below. This file describes the metadata associated with your app, like its name and permissions that it requests. + +These values are used to create an app in one of two ways: + +- **With the Slack CLI**: Save the contents of the file to your project's `manifest.json` file then skip ahead to [starting your app](#starting-your-app). +- **With app settings**: Copy the contents of the file and [create a new app](https://api.slack.com/apps/new). Next, choose **From a manifest** and follow the prompts, pasting the manifest file contents you copied. + +```json +{ + "_metadata": { + "major_version": 1, + "minor_version": 1 + }, + "display_information": { + "name": "Delivery Tracker App" + }, + "features": { + "bot_user": { + "display_name": "Delivery Tracker App", + "always_online": false + } + }, + "oauth_config": { + "scopes": { + "bot": [ + "channels:history", + "chat:write" + ] + } + }, + "settings": { + "event_subscriptions": { + "bot_events": [ + "message.channels" + ] + }, + "interactivity": { + "is_enabled": true + }, + "org_deploy_enabled": false, + "socket_mode_enabled": true, + "token_rotation_enabled": false + } +} +``` + +### Tokens + +Once your app has been created, scroll down to **App-Level Tokens** on the **Basic Information** page and create a token that requests the [`connections:write`](/reference/scopes/connections.write) scope. This token will allow you to use [Socket Mode](/apis/events-api/using-socket-mode), which is a secure way to develop on Slack through the use of WebSockets. Save the value of your app token and store it in a safe place (we’ll use it in the next step). + +### Install app + +Still in the app settings, navigate to the **Install App** page in the left sidebar. Install your app. When you press **Allow**, this means you’re agreeing to install your app with the permissions that it’s requesting. Copy the bot token that you receive as well and store this in a safe place as well for subsequent steps. + +## Saving credentials + +Within a terminal of your choice, set the two tokens from the previous step as environment variables using the commands below. Make sure not to mix these two up, `SLACK_APP_TOKEN` will start with “xapp-“ and `SLACK_BOT_TOKEN` will start with “xoxb-“. + +For macOS: + +```bash +export SLACK_APP_TOKEN= +export SLACK_BOT_TOKEN= +``` + +For Windows Command Prompt: + +```cmd +set SLACK_APP_TOKEN= +set SLACK_BOT_TOKEN= +``` + +For Windows PowerShell: + +```powershell +$env:SLACK_APP_TOKEN="YOUR-APP-TOKEN-HERE" +$env:SLACK_BOT_TOKEN="YOUR-BOT-TOKEN-HERE" +``` + +## Starting your app {#starting-your-app} + +Run the following commands to activate a virtual environment for your Python packages to be installed, install the dependencies, and start your app. + +```bash +# Setup your python virtual environment +python -m venv .venv +source .venv/bin/activate + +# Install the dependencies +pip install -r requirements.txt + +# Start your local server +slack run +``` + +If you're not using the Slack CLI, a different `python` command can be used to start your app instead: + +```sh +python app.py +``` + +Now that your app is running, you should be able to see it within Slack. In Slack, create a channel that you can test in and try inviting your bot to it using the `/invite @Your-app-name-here` command. Check that your app works by saying “hi” in the channel where your app is, and you should receive a message back from it. If you don’t, ensure you completed all the steps above. + +## Coding the app + +We'll make four changes to the app: + +* Update the “hi” message to something more interesting and interactive +* Handle when the wrong delivery ID button is pressed +* Handle when the correct delivery IDs are sent and bring up a modal for more information +* Send the information to all of the places needed when the form is submitted (including third-party locations) + +For all of these steps, we will use [Block Kit Builder](https://app.slack.com/block-kit-builder), a tool that helps you create messages, modals and other surfaces within Slack. Open [Block Kit Builder](https://app.slack.com/block-kit-builder), take a look, and play around! We’ll create some views next. + +### Updating the "hi" message + +The first thing we want to do is change the “hi, how are you?” message from our app into something more useful. Here’s a `blocks` object built with Block Kit Builder: + +```json + + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "Confirm *{delivery_id}* is correct?" + } + }, + { + "type": "actions", + "elements": [ + { + "type": "button", + "text": { + "type": "plain_text", + "text": "Correct", + "emoji": true + }, + "style": "primary", + "action_id": "approve_delivery" + }, + { + "type": "button", + "text": { + "type": "plain_text", + "text": "Not correct", + "emoji": true + }, + "style": "danger", + "action_id": "deny_delivery" + } + ] + } + ] + +``` + +Take the function below and place your blocks within the blocks dictionary `[]`. + +```python +def delivery_message_callback(context: BoltContext, say: Say, logger: Logger): + try: + delivery_id = context["matches"][0] + say( + blocks=[] # insert your blocks here + ) + except Exception as e: + logger.error(e) +``` + +Update the payload: +* Remove the initial blocks key and convert any boolean true values to `True` to fit with Python conventions. +* If you see variables within `{}` brackets, this is part of an f-string, which allows you to insert variables within strings in a clean manner. Place the `f` character before these strings like this: + +```python +{ + "type": "section", + "text": { + "type": "mrkdwn", + "text": f"Confirm *{delivery_id}* is correct?", # place the "f" character here at the beginning of the string + }, +}, +``` + +Place all of this in the `sample_message.py` file. + +Next, you’ll need to register this listener to respond when a message is sent in the channel with your app. Head to `messages/__init__.py` and overwrite the function there with the one below, which registers the function. Don’t forget to add the import to the callback function as well! + +```python +from .sample_message import delivery_message_callback # import the function to this file + +def register(app: App): + # This regex will capture any number letters followed by dash + # and then any number of digits, our "confirmation number" e.g. ASDF-1234 + app.message(re.compile(r"[A-Za-z]+-\d+"))(delivery_message_callback) ## add this line! +``` + +Now, restart your server to bring in the new code and test that your function works by sending an order confirmation ID, like `HWOA-1524`, in your testing channel. Your app should respond with the message you created within Block Kit Builder. + +### Handling an incorrect delivery ID + +Notice that if you try to click on either of the buttons within your message, nothing will happen. This is because we have yet to create a function to handle the button click. Let’s start with the `Not correct` button first. + +1. Head to Block Kit Builder once again. We want to build a message that lets the user know that the wrong order ID has been submitted. Here's a [section](/reference/block-kit/blocks/section-block) block to get you started: + +```json + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "Delivery *{delivery_id}* was incorrect ❌" + } + } + ] +``` + +View this block in Block Kit Builder [here](https://app.slack.com/block-kit-builder/#%7B%22blocks%22:%5B%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22Delivery%20*%7Bdelivery_id%7D*%20was%20incorrect%20%E2%9D%8C%22%7D%7D%5D%7D). + +2. Once you have something that you like, add it to the function below and place the function within the `actions/sample_action.py` file. Remember to make any strings with variables into f-strings! + +```python +def deny_delivery_callback(ack, body, client, logger: Logger): + try: + ack() + delivery_id = body["message"]["text"].split("*")[1] + + # Calls the chat.update function to replace the message, + # preventing it from being pressed more than once. + client.chat_update( + channel=body["container"]["channel_id"], + ts=body["container"]["message_ts"], + blocks=[], # Add your blocks here! + ) + + logger.info(f"Delivery denied by user {body['user']['id']}") + except Exception as e: + logger.error(e) +``` + +This function will call the [`chat.update`](/reference/methods/chat.update) Web API method, which will update the original message with buttons, to the one that we created previously. This will also prevent the message from being pressed more than once. + +3. Make the connection to this function again within the `actions/__init__.py` folder with the following code: + +```python +from slack_bolt import App +from .sample_action import sample_action_callback # This can be deleted +from .sample_action import deny_delivery_callback + +def register(app: App): + app.action("sample_action_id")(sample_action_callback) # This can be deleted + app.action("deny_delivery")(deny_delivery_callback) # Add this line +``` + +Test out your app by sending in a confirmation number into your channel and clicking the `Not correct` button. If the message is updated, then you’re good to go onto the next step. + +### Handling a correct delivery ID + +The next step is to handle the `Confirm` button. In this case, we’re going to pull up a modal instead of just a message. + +1. Using the following modal as a base; create a modal that captures the kind of information that you need. + +```json +{ + "title": { + "type": "plain_text", + "text": "Approve Delivery" + }, + "submit": { + "type": "plain_text", + "text": "Approve" + }, + "type": "modal", + "callback_id": "approve_delivery_view", + "private_metadata": "{delivery_id}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "Approving delivery *{delivery_id}*" + } + }, + { + "type": "input", + "block_id": "notes", + "label": { + "type": "plain_text", + "text": "Additional delivery notes" + }, + "element": { + "type": "plain_text_input", + "action_id": "notes_input", + "multiline": true, + "placeholder": { + "type": "plain_text", + "text": "Add notes..." + } + }, + "optional": true + }, + { + "type": "input", + "block_id": "location", + "label": { + "type": "plain_text", + "text": "Delivery Location" + }, + "element": { + "type": "plain_text_input", + "action_id": "location_input", + "placeholder": { + "type": "plain_text", + "text": "Enter the location details..." + } + }, + "optional": true + }, + { + "type": "input", + "block_id": "channel", + "label": { + "type": "plain_text", + "text": "Notification Channel" + }, + "element": { + "type": "channels_select", + "action_id": "channel_select", + "placeholder": { + "type": "plain_text", + "text": "Select channel for notifications" + } + }, + "optional": false + } + ] +} +``` + +View this modal in Block Kit Builder [here](https://app.slack.com/block-kit-builder/#%7B%22type%22:%22modal%22,%22callback_id%22:%22approve_delivery_view%22,%22title%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Approve%20Delivery%22%7D,%22private_metadata%22:%22%7Bdelivery_id%7D%22,%22blocks%22:%5B%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22Approving%20delivery%20*%7Bdelivery_id%7D*%22%7D%7D,%7B%22type%22:%22input%22,%22block_id%22:%22notes%22,%22label%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Additional%20delivery%20notes%22%7D,%22element%22:%7B%22type%22:%22plain_text_input%22,%22action_id%22:%22notes_input%22,%22multiline%22:true,%22placeholder%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Add%20notes...%22%7D%7D,%22optional%22:true%7D,%7B%22type%22:%22input%22,%22block_id%22:%22location%22,%22label%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Delivery%20Location%22%7D,%22element%22:%7B%22type%22:%22plain_text_input%22,%22action_id%22:%22location_input%22,%22placeholder%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Enter%20the%20location%20details...%22%7D%7D,%22optional%22:true%7D,%7B%22type%22:%22input%22,%22block_id%22:%22channel%22,%22label%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Notification%20Channel%22%7D,%22element%22:%7B%22type%22:%22channels_select%22,%22action_id%22:%22channel_select%22,%22placeholder%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Select%20channel%20for%20notifications%22%7D%7D,%22optional%22:false%7D%5D,%22submit%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Approve%22%7D%7D). + +2. Within the `actions/sample_action.py` file, add the following function, replacing the view with the one you created above. Again, any strings with variables will be updated to f-strings and also any booleans will need to be capitalized. + +```python +def approve_delivery_callback(ack, body, client, logger: Logger): + try: + ack() + + delivery_id = body["message"]["text"].split("*")[1] + # Updates the original message so you can't press it twice + client.chat_update( + channel=body["container"]["channel_id"], + ts=body["container"]["message_ts"], + blocks=[ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": f"Processed delivery *{delivery_id}*...", + }, + } + ], + ) + + # Open a modal to gather information from the user + client.views_open( + trigger_id=body["trigger_id"], + view={} # Add your view here + ) + + logger.info(f"Approval modal opened by user {body['user']['id']}") + except Exception as e: + logger.error(e) +``` + +Similar to the `deny` button, we need to hook up all the connections. Your `actions/__init__.py` should look something like this: + +```python +from slack_bolt import App +from .sample_action import deny_delivery_callback +from .sample_action import approve_delivery_callback + + +def register(app: App): + app.action("approve_delivery")(approve_delivery_callback) + app.action("deny_delivery")(deny_delivery_callback) +``` + +Test your app by typing in a confirmation number in channel, click the confirm button and see if the modal comes up and you are able to capture information from the user. + +### Submitting the form + +Lastly, we’ll handle the submission of the form, which will trigger two things. We want to send the information into the specified channel, which will let the user know that the form was successful, as well as send the information into our system of record, Salesforce. + +1. Here’s a simple example of a message that you can use to present the information in channel. + +```json + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "✅ Delivery *{delivery_id}* approved:" + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "*Delivery Notes:*\n{notes or 'None'}" + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "*Delivery Location:*\n{loc or 'None'}" + } + } + ] +``` + +View this in Block Kit Builder [here](https://app.slack.com/block-kit-builder/?1#%7B%22blocks%22:%5B%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22%E2%9C%85%20Delivery%20*%7Bdelivery_id%7D*%20approved:%22%7D%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22*Delivery%20Notes:*%5Cn%7Bnotes%20or%20'None'%7D%22%7D%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22*Delivery%20Location:*%5Cn%7Bloc%20or%20'None'%7D%22%7D%7D%5D%7D). Modify it however you like and then place it within the code below in the `/views/sample_views.py` file. + +```python +def handle_approve_delivery_view(ack, client, view, logger: Logger): + try: + ack() + + delivery_id = view["private_metadata"] + values = view["state"]["values"] + notes = values["notes"]["notes_input"]["value"] + loc = values["location"]["location_input"]["value"] + channel = values["channel"]["channel_select"]["selected_channel"] + + client.chat_postMessage( + channel=channel, + blocks=[], ## Add your message here + ) + + except Exception as e: + logger.error(f"Error in approve_delivery_view: {e}") +``` + +2. Making the connections in the `/views/__init__.py `file, we can test that this works by sending a message once again in our test channel. + +```python +from slack_bolt import App +from .sample_view import handle_approve_delivery_view + +def register(app: App): + app.view("sample_view_id")(sample_view_callback) # This can be deleted + app.view("approve_delivery_view")(handle_approve_delivery_view) ## Add this line +``` + +3. Let’s also send the information to Salesforce. There are [several ways](https://github.com/simple-salesforce/simple-salesforce?tab=readme-ov-file#examples) for you to access Salesforce through its API, but in this example, we’ve utilized `username`, `password` and `token` parameters. If you need help with getting your API token for Salesforce, take a look at [this article](https://help.salesforce.com/s/articleView?id=xcloud.user_security_token.htm&type=5). You’ll need to add these values as environment variables like we did earlier with our Slack tokens. You can use the following commands: + +```bash +export SF_USERNAME= +export SF_PASSWORD= +export SF_TOKEN= +``` + +4. We’re going to use assume that order information is stored in the Order object and that the confirmation IDs map to the 8-digit Order numbers within Salesforce. Given that assumption, we need to make a query to find the correct object, add the inputted information, and we’re done. Place this functionality before the last excerpt within the `/views/sample_views.py` file. + +```python +# Extract just the numeric portion from delivery_id + delivery_number = "".join(filter(str.isdigit, delivery_id)) + + # Update Salesforce order object + try: + sf = Salesforce( + username=os.environ.get("SF_USERNAME"), + password=os.environ.get("SF_PASSWORD"), + security_token=os.environ.get("SF_TOKEN"), + ) + + # Assuming delivery_id maps to Salesforce Order number + order = sf.query(f"SELECT Id FROM Order WHERE OrderNumber = '{delivery_number}'") # noqa: E501 + if order["records"]: + order_id = order["records"][0]["Id"] + sf.Order.update( + order_id, + { + "Status": "Delivered", + "Description": notes, + "Shipping_Location__c": loc, + }, + ) + logger.info(f"Updated order {delivery_id}") + else: + logger.warning(f"No order found for {delivery_id}") + + except Exception as sf_error: + logger.error(f"Update failed for order {delivery_id}: {sf_error}") + # Continue execution even if Salesforce update fails +``` + +You’ll also need to add the two imports that are found within this code to the top of the file. + +```python +import os +from simple_salesforce import Salesforce +``` + +With these imports, add `simple_salesforce` to your `requirements.txt` file, then install that package with the following command once again. + +```bash +pip install -r requirements.txt +``` + +![Image of delivery tracker app](/img/bolt-python/delivery-tracker-main.png) + +## Testing your app + +Test your app one last time, and you’re done! + +Congratulations! You’ve built an app using [Bolt for Python](/tools/bolt-python/) that allows you to send information into Slack, as well as into a third-party service. While there are more features you can add to make this a more robust app, we hope that this serves as a good introduction into connecting services like Salesforce using Slack as a conduit. \ No newline at end of file diff --git a/docs/img/delivery-tracker-main.png b/docs/img/delivery-tracker-main.png new file mode 100644 index 0000000000000000000000000000000000000000..b8d2e885c9ed00d1537203192beb5f7228c6ebef GIT binary patch literal 65799 zcmXtAWmucv&o1sZoFQdnxD9t&WWaED8$R6KbuetWySuxy;qLA_+?}`V_kTZdanbha z$w}_y z3Xq&i0C^G0UO`LBQ zRM~_EU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`*HsH|9@voayHmtgAG35@ab31X!nU%p1@m-HrU_^!51D}(7!k&Ioqb=4K~I=KWiq7-~o$=q{_SH+bWqZtggBu6KrsE%Z?OpnR_a4y( z8*H$_1{)0UJs-PGuiiZyk9S)5-5=jpbvC$JFl;*h$De|GQ`(Ay{l$k{5<=aeu<4(|?L}!5EBKjA3!3G;_@WF*4nR)r}_nAL-i(b9Eqszb_0WcZ)2R`v9u>b%707*qoM6N<$f_wNc Awg3PC literal 0 HcmV?d00001 From 0c1442669114693dbceb12fdae725b4b31a5eb87 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 10:23:44 -0500 Subject: [PATCH 665/719] chore(deps): bump actions/stale from 10.0.0 to 10.1.0 (#1393) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/triage-issues.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/triage-issues.yml b/.github/workflows/triage-issues.yml index 5cb75bf93..85ccb72aa 100644 --- a/.github/workflows/triage-issues.yml +++ b/.github/workflows/triage-issues.yml @@ -16,7 +16,7 @@ jobs: issues: write pull-requests: write steps: - - uses: actions/stale@3a9db7e6a41a89f618792c92c0e97cc736e1b13f # v10.0.0 + - uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0 with: days-before-issue-stale: 30 days-before-issue-close: 10 From 1264ee1bff50bcf5b2e2d00dd69f595f936d0186 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Wed, 5 Nov 2025 11:42:22 -0500 Subject: [PATCH 666/719] chore: automate release process (#1394) --- .github/maintainers_guide.md | 200 +++++++++--------- .github/release.yml | 24 +++ .github/workflows/pypi-release.yml | 87 ++++++++ scripts/deploy_to_pypi_org.sh | 12 -- ...est_pypi_org.sh => deploy_to_test_pypi.sh} | 0 5 files changed, 212 insertions(+), 111 deletions(-) create mode 100644 .github/release.yml create mode 100644 .github/workflows/pypi-release.yml delete mode 100755 scripts/deploy_to_pypi_org.sh rename scripts/{deploy_to_test_pypi_org.sh => deploy_to_test_pypi.sh} (100%) diff --git a/.github/maintainers_guide.md b/.github/maintainers_guide.md index 352398072..8cd600271 100644 --- a/.github/maintainers_guide.md +++ b/.github/maintainers_guide.md @@ -10,14 +10,14 @@ this project. If you use this package within your own software as is but don't p We recommend using [pyenv](https://github.com/pyenv/pyenv) for Python runtime management. If you use macOS, follow the following steps: -```bash -$ brew update -$ brew install pyenv +```sh +brew update +brew install pyenv ``` Install necessary Python runtimes for development/testing. You can rely on GitHub Actions workflows for testing with various major versions. -```bash +```sh $ pyenv install -l | grep -v "-e[conda|stackless|pypy]" $ pyenv install 3.8.5 # select the latest patch version @@ -34,9 +34,9 @@ $ pyenv rehash Then, you can create a new Virtual Environment this way: -```bash -$ python -m venv env_3.8.5 -$ source env_3.8.5/bin/activate +```sh +python -m venv env_3.8.5 +source env_3.8.5/bin/activate ``` ## Tasks @@ -49,27 +49,27 @@ If you make some changes to this SDK, please write corresponding unit tests as m If this is your first time to run tests, although it may take a bit long time, running the following script is the easiest. -```bash -$ ./scripts/install_all_and_run_tests.sh +```sh +./scripts/install_all_and_run_tests.sh ``` Once you installed all the required dependencies, you can use the following one. -```bash -$ ./scripts/run_tests.sh +```sh +./scripts/run_tests.sh ``` Also, you can run a single test this way. -```bash -$ ./scripts/run_tests.sh tests/scenario_tests/test_app.py +```sh +./scripts/run_tests.sh tests/scenario_tests/test_app.py ``` #### Run the Samples If you make changes to `slack_bolt/adapter/*`, please verify if it surely works by running the apps under `examples` directory. -```bash +```sh # Install all optional dependencies $ pip install -r requirements/adapter.txt $ pip install -r requirements/adapter_testing.txt @@ -97,121 +97,123 @@ If you want to test the package locally you can. 1. Build the package locally - Run - ```bash + ```sh scripts/build_pypi_package.sh ``` - This will create a `.whl` file in the `./dist` folder 2. Use the built package - Example `/dist/slack_bolt-1.2.3-py2.py3-none-any.whl` was created - From anywhere on your machine you can install this package to a project with - ```bash + ```sh pip install /dist/slack_bolt-1.2.3-py2.py3-none-any.whl ``` - It is also possible to include `slack_bolt @ file:////dist/slack_bolt-1.2.3-py2.py3-none-any.whl` in a [requirements.txt](https://pip.pypa.io/en/stable/user_guide/#requirements-files) file -### Releasing - -#### Generate API reference documents +### Generate API reference documents -```bash +```sh ./scripts/generate_api_docs.sh ``` +### Releasing + #### test.pypi.org deployment -##### $HOME/.pypirc +[TestPyPI](https://test.pypi.org/) is a separate instance of the Python Package +Index that allows you to try distribution tools and processes without affecting +the real index. This is particularly useful when making changes related to the +package configuration itself, for example, modifications to the `pyproject.toml` file. + +You can deploy this project to TestPyPI using GitHub Actions. -```toml -[testpypi] -username: {your username} -password: {your password} +To deploy using GitHub Actions: + +1. Push your changes to a branch or tag +2. Navigate to +3. Click on "Run workflow" +4. Select your branch or tag from the dropdown +5. Click "Run workflow" to build and deploy your branch to TestPyPI + +Alternatively, you can deploy from your local machine with: + +```sh +./scripts/deploy_to_test_pypi.sh ``` #### Development Deployment -1. Create a branch in which the development release will live: - - Bump the version number in adherence to [Semantic Versioning](http://semver.org/) and [Developmental Release](https://peps.python.org/pep-0440/#developmental-releases) in `slack_bolt/version.py` - - Example the current version is `1.2.3` a proper development bump would be `1.3.0.dev0` +Deploying a new version of this library to PyPI is triggered by publishing a GitHub Release. +Before creating a new release, ensure that everything on a stable branch has +landed, then [run the tests](#run-all-the-unit-tests). + +1. Create the commit for the release + 1. In `slack_bolt/version.py` bump the version number in adherence to [Semantic Versioning](http://semver.org/) and [Developmental Release](https://peps.python.org/pep-0440/#developmental-releases). + - Example: if the current version is `1.2.3`, a proper development bump would be `1.2.4.dev0` - `.dev` will indicate to pip that this is a [Development Release](https://peps.python.org/pep-0440/#developmental-releases) - - Note that the `dev` version can be bumped in development releases: `1.3.0.dev0` -> `1.3.0.dev1` - - Commit with a message including the new version number. For example `1.3.0.dev0` & Push the commit to a branch where the development release will live (create it if it does not exist) - - `git checkout -b future-release` - - `git commit -m 'version 1.3.0.dev0'` - - `git push future-release` - - Create a git tag for the release. For example `git tag v1.3.0.dev0`. - - Push the tag up to github with `git push origin --tags` - -2. Distribute the release - - Use the latest stable Python runtime - - `python -m venv .venv` - - `./scripts/deploy_to_pypi_org.sh` - - You do not need to create a GitHub release - -3. (Slack Internal) Communicate the release internally + - Note that the `dev` version can be bumped in development releases: `1.2.4.dev0` -> `1.2.4.dev1` + 2. Build the docs with `./scripts/generate_api_docs.sh`. + 3. Commit with a message including the new version number. For example `1.2.4.dev0` & push the commit to a branch where the development release will live (create it if it does not exist) + 1. `git checkout -b future-release` + 2. `git commit -m 'chore(release): version 1.2.4.dev0'` + 3. `git push -u origin future-release` +2. Create a new GitHub Release + 1. Navigate to the [Releases page](https://github.com/slackapi/bolt-python/releases). + 2. Click the "Draft a new release" button. + 3. Set the "Target" to the feature branch with the development changes. + 4. Click "Tag: Select tag" + 5. Input a new tag name manually. The tag name must match the version in `slack_bolt/version.py` prefixed with "v" (e.g., if version is `1.2.4.dev0`, enter `v1.2.4.dev0`) + 6. Click the "Create a new tag" button. This won't create your tag immediately. + 7. Click the "Generate release notes" button. + 8. The release name should match the tag name! + 9. Edit the resulting notes to ensure they have decent messaging that is understandable by non-contributors, but each commit should still have its own line. + 10. Set this release as a pre-release. + 11. Publish the release by clicking the "Publish release" button! +3. Navigate to the [release workflow run](https://github.com/slackapi/bolt-python/actions/workflows/pypi-release.yml). You will need to approve the deployment! +4. After a few minutes, the corresponding version will be available on . +5. (Slack Internal) Communicate the release internally #### Production Deployment -1. Create the commit for the release: - - Bump the version number in adherence to [Semantic Versioning](http://semver.org/) in `slack_bolt/version.py` - - Build the docs with `./scripts/generate_api_docs.sh`. - - Commit with a message including the new version number. For example `1.2.3` & Push the commit to a branch and create a PR to sanity check. - - `git checkout -b v1.2.3` - - `git commit -a -m 'version 1.2.3'` - - `git push -u origin HEAD` - - Open a PR and merge after receiving at least one approval from other maintainers. - -2. Distribute the release - - Use the latest stable Python runtime - - `git checkout main && git pull` - - `python --version` - - `python -m venv .venv` - - `./scripts/deploy_to_pypi_org.sh` - - Create a new GitHub Release from the [Releases page](https://github.com/slackapi/bolt-python/releases) by clicking the "Draft a new release" button. - - Enter the new version number updated from the commit (e.g. `v1.2.3`) into the "Choose a tag" input. - - Ensure the tag `Target` branch is `main` (e.g `Target:main`). - - Click the "Create a new tag: x.x.x on publish" button. This won't create your tag immediately. - - Name the release after the version number updated from the commit (e.g. `version 1.2.3`) - - Auto-generate the release notes by clicking the "Auto-generate release - notes" button. This will pull in changes that will be included in your - release. - - Edit the resulting notes to ensure they have decent messaging that are - understandable by non-contributors, but each commit should still have it's - own line. - - Ensure that this version adheres to [semantic versioning](http://semver.org/). See - [Versioning](#versioning-and-tags) for correct version format. Version tags - should match the following pattern: `v2.5.0`. - - ```markdown - ## New Features - - ### Awesome Feature 1 - - Description here. - - ### Awesome Feature 2 - - Description here. - - ## Changes - - * #123 Make it better - thanks @SlackHQ - * #123 Fix something wrong - thanks @seratch - ``` - -3. (Slack Internal) Communicate the release internally - - Include a link to the GitHub release - -4. Make announcements - - #tools-bolt in community.slack.com - -5. (Slack Internal) Tweet by @SlackAPI - - Not necessary for patch updates, might be needed for minor updates, definitely needed for major updates. Include a link to the GitHub release +Deploying a new version of this library to PyPI is triggered by publishing a GitHub Release. +Before creating a new release, ensure that everything on the `main` branch since +the last tag is in a releasable state! At a minimum, [run the tests](#run-all-the-unit-tests). + +1. Create the commit for the release + 1. In `slack_bolt/version.py` bump the version number in adherence to [Semantic Versioning](http://semver.org/) and the [Versioning](#versioning-and-tags) section. + 2. Build the docs with `./scripts/generate_api_docs.sh`. + 3. Commit with a message including the new version number. For example `1.2.3` & push the commit to a branch and create a PR to sanity check. + 1. `git checkout -b 1.2.3-release` + 2. `git commit -m 'chore(release): version 1.2.3'` + 3. `git push -u origin 1.2.3-release` + 4. Add relevant labels to the PR and add the PR to a GitHub Milestone. + 5. Merge in release PR after getting an approval from at least one maintainer. +2. Create a new GitHub Release + 1. Navigate to the [Releases page](https://github.com/slackapi/bolt-python/releases). + 2. Click the "Draft a new release" button. + 3. Set the "Target" to the `main` branch. + 4. Click "Tag: Select tag" + 5. Input a new tag name manually. The tag name must match the version in `slack_bolt/version.py` prefixed with "v" (e.g., if version is `1.2.3`, enter `v1.2.3`) + 6. Click the "Create a new tag" button. This won't create your tag immediately. + 7. Click the "Generate release notes" button. + 8. The release name should match the tag name! + 9. Edit the resulting notes to ensure they have decent messaging that is understandable by non-contributors, but each commit should still have its own line. + 10. Include a link to the current GitHub Milestone. + 11. Ensure the "latest release" checkbox is checked to mark this as the latest stable release. + 12. Publish the release by clicking the "Publish release" button! +3. Navigate to the [release workflow run](https://github.com/slackapi/bolt-python/actions/workflows/pypi-release.yml). You will need to approve the deployment! +4. After a few minutes, the corresponding version will be available on . +5. Close the current GitHub Milestone and create one for the next patch version. +6. (Slack Internal) Communicate the release internally + - Include a link to the GitHub release +7. (Slack Internal) Tweet by @SlackAPI + - Not necessary for patch updates, might be needed for minor updates, + definitely needed for major updates. Include a link to the GitHub release ## Workflow ### Versioning and Tags -This project uses semantic versioning, expressed through the numbering scheme of +This project uses [Semantic Versioning](http://semver.org/), expressed through the numbering scheme of [PEP-0440](https://www.python.org/dev/peps/pep-0440/). ### Branches diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 000000000..b2574b7cc --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,24 @@ +# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuring-automatically-generated-release-notes +changelog: + categories: + - title: 🚀 Enhancements + labels: + - enhancement + - title: 🐛 Bug Fixes + labels: + - bug + - title: 📚 Documentation + labels: + - docs + - title: 🤖 Build + labels: + - build + - title: 🧪 Testing/Code Health + labels: + - code health + - title: 🔒 Security + labels: + - security + - title: 📦 Other changes + labels: + - "*" diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml new file mode 100644 index 000000000..21b472247 --- /dev/null +++ b/.github/workflows/pypi-release.yml @@ -0,0 +1,87 @@ +name: Upload A Release to pypi.org or test.pypi.org + +on: + release: + types: + - published + workflow_dispatch: + inputs: + dry_run: + description: "Dry run (build only, do not publish)" + required: false + type: boolean + +jobs: + release-build: + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + ref: ${{ github.event.release.tag_name || github.ref }} + persist-credentials: false + + - name: Set up Python + uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + with: + python-version: "3.x" + + - name: Build release distributions + run: | + scripts/build_pypi_package.sh + + - name: Persist dist folder + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 + with: + name: release-dist + path: dist/ + + test-pypi-publish: + runs-on: ubuntu-latest + needs: + - release-build + # Run this job for workflow_dispatch events when dry_run input is not 'true' + # Note: The comparison is against a string value 'true' since GitHub Actions inputs are strings + if: github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run != 'true' + environment: + name: testpypi + permissions: + id-token: write + + steps: + - name: Retrieve dist folder + uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 + with: + name: release-dist + path: dist/ + + - name: Publish release distributions to test.pypi.org + # Using OIDC for PyPI publishing (no API tokens needed) + # See: https://docs.github.com/en/actions/how-tos/secure-your-work/security-harden-deployments/oidc-in-pypi + uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 + with: + repository-url: https://test.pypi.org/legacy/ + + pypi-publish: + runs-on: ubuntu-latest + needs: + - release-build + if: github.event_name == 'release' + environment: + name: pypi + permissions: + id-token: write + + steps: + - name: Retrieve dist folder + uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 + with: + name: release-dist + path: dist/ + + - name: Publish release distributions to pypi.org + # Using OIDC for PyPI publishing (no API tokens needed) + # See: https://docs.github.com/en/actions/how-tos/secure-your-work/security-harden-deployments/oidc-in-pypi + uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 diff --git a/scripts/deploy_to_pypi_org.sh b/scripts/deploy_to_pypi_org.sh deleted file mode 100755 index 8c5234902..000000000 --- a/scripts/deploy_to_pypi_org.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -script_dir=`dirname $0` -cd ${script_dir}/.. -rm -rf ./slack_bolt.egg-info - -pip install -U pip && \ - pip install -U twine build && \ - rm -rf dist/ build/ slack_bolt.egg-info/ && \ - python -m build --sdist --wheel && \ - twine check dist/* && \ - twine upload dist/* diff --git a/scripts/deploy_to_test_pypi_org.sh b/scripts/deploy_to_test_pypi.sh similarity index 100% rename from scripts/deploy_to_test_pypi_org.sh rename to scripts/deploy_to_test_pypi.sh From 2086c7a4f5e4c010ef04f5537668d7b228f1bf59 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 11 Nov 2025 08:54:26 -0800 Subject: [PATCH 667/719] ci: upload test results using the recommended codecov action (#1396) --- .github/workflows/codecov.yml | 3 ++- .github/workflows/tests.yml | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 7381117bb..b402079c1 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -39,5 +39,6 @@ jobs: uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 with: fail_ci_if_error: true - verbose: true + report_type: coverage token: ${{ secrets.CODECOV_TOKEN }} + verbose: true diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 167dc2ce4..20262a857 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -76,10 +76,12 @@ jobs: pytest tests/scenario_tests_async/ --junitxml=reports/test_scenario_async.xml - name: Upload test results to Codecov if: ${{ !cancelled() }} - uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # v1.1.1 + uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 with: directory: ./reports/ + fail_ci_if_error: true flags: ${{ matrix.python-version }} + report_type: test_results token: ${{ secrets.CODECOV_TOKEN }} verbose: true notifications: From fe28b14d6fc78cae56cb6fad28d3357cd639c6a8 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Thu, 13 Nov 2025 14:42:49 -0500 Subject: [PATCH 668/719] feat: add support for python 3.14 (#1397) --- .github/workflows/codecov.yml | 2 +- .github/workflows/flake8.yml | 2 +- .github/workflows/mypy.yml | 2 +- .github/workflows/tests.yml | 1 + pyproject.toml | 3 ++- slack_bolt/listener/async_listener.py | 6 ------ slack_bolt/listener_matcher/async_listener_matcher.py | 2 -- 7 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index b402079c1..02c318a20 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -12,7 +12,7 @@ jobs: timeout-minutes: 10 strategy: matrix: - python-version: ["3.13"] + python-version: ["3.14"] permissions: contents: read env: diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index bd4e3dfd8..f777996b4 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -12,7 +12,7 @@ jobs: timeout-minutes: 20 strategy: matrix: - python-version: ["3.13"] + python-version: ["3.14"] permissions: contents: read steps: diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 1bf4abf0d..52d59c830 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -12,7 +12,7 @@ jobs: timeout-minutes: 20 strategy: matrix: - python-version: ["3.13"] + python-version: ["3.14"] permissions: contents: read steps: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 20262a857..42fd58ef6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,6 +24,7 @@ jobs: - "3.11" - "3.12" - "3.13" + - "3.14" permissions: contents: read steps: diff --git a/pyproject.toml b/pyproject.toml index 5361ef1b4..a5c12548b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,12 +15,13 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: Implementation :: CPython", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ] requires-python = ">=3.7" -dependencies = ["slack_sdk>=3.37.0,<4"] +dependencies = ["slack_sdk>=3.38.0,<4"] [project.urls] diff --git a/slack_bolt/listener/async_listener.py b/slack_bolt/listener/async_listener.py index 0810b91a7..1717b1a8d 100644 --- a/slack_bolt/listener/async_listener.py +++ b/slack_bolt/listener/async_listener.py @@ -72,13 +72,7 @@ async def run_ack_function(self, *, request: AsyncBoltRequest, response: BoltRes from logging import Logger -from typing import Callable, Awaitable - -from slack_bolt.listener_matcher.async_listener_matcher import AsyncListenerMatcher from slack_bolt.logger import get_bolt_app_logger -from slack_bolt.middleware.async_middleware import AsyncMiddleware -from slack_bolt.request.async_request import AsyncBoltRequest -from slack_bolt.response import BoltResponse class AsyncCustomListener(AsyncListener): diff --git a/slack_bolt/listener_matcher/async_listener_matcher.py b/slack_bolt/listener_matcher/async_listener_matcher.py index 83e04e478..3230bb342 100644 --- a/slack_bolt/listener_matcher/async_listener_matcher.py +++ b/slack_bolt/listener_matcher/async_listener_matcher.py @@ -25,8 +25,6 @@ async def async_matches(self, req: AsyncBoltRequest, resp: BoltResponse) -> bool from slack_bolt.kwargs_injection.async_utils import build_async_required_kwargs from slack_bolt.logger import get_bolt_app_logger -from slack_bolt.request.async_request import AsyncBoltRequest -from slack_bolt.response import BoltResponse class AsyncCustomListenerMatcher(AsyncListenerMatcher): From 87e342515d104e151cb849f50a0068712ae9a76c Mon Sep 17 00:00:00 2001 From: Michael Brooks Date: Thu, 13 Nov 2025 11:46:33 -0800 Subject: [PATCH 669/719] chore: Add .github/CODEOWNERS file (#1398) --- .github/CODEOWNERS | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000..4a08579c2 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,12 @@ +# Salesforce Open Source project configuration +# Learn more: https://github.com/salesforce/oss-template +#ECCN:Open Source +#GUSINFO:Open Source,Open Source Workflow + +# @slackapi/slack-platform-python +# are code reviewers for all changes in this repo. +* @slackapi/slack-platform-python + +# @slackapi/developer-education +# are code reviewers for changes in the `/docs` directory. +/docs/ @slackapi/developer-education From 9cba291465237eeac6416730fc6b3838e1078b30 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Thu, 13 Nov 2025 15:13:10 -0500 Subject: [PATCH 670/719] chore(release): version 1.27.0 (#1399) --- .../authorization/authorize_result.html | 4 +- docs/reference/authorization/index.html | 4 +- .../thread_context_store/file/index.html | 2 +- .../context/complete/async_complete.html | 40 ++++++++- docs/reference/context/complete/complete.html | 40 ++++++++- docs/reference/context/complete/index.html | 40 ++++++++- docs/reference/context/fail/async_fail.html | 40 ++++++++- docs/reference/context/fail/fail.html | 40 ++++++++- docs/reference/context/fail/index.html | 40 ++++++++- docs/reference/error/index.html | 2 +- docs/reference/index.html | 82 ++++++++++++++++++- docs/reference/logger/messages.html | 4 +- .../reference/oauth/async_oauth_settings.html | 2 +- docs/reference/oauth/oauth_settings.html | 2 +- slack_bolt/version.py | 2 +- 15 files changed, 324 insertions(+), 20 deletions(-) diff --git a/docs/reference/authorization/authorize_result.html b/docs/reference/authorization/authorize_result.html index 6eac3724d..d53c5cd5c 100644 --- a/docs/reference/authorization/authorize_result.html +++ b/docs/reference/authorization/authorize_result.html @@ -48,7 +48,7 @@

    Classes

    class AuthorizeResult -(*,
    enterprise_id: str | None,
    team_id: str | None,
    team: str | None = None,
    url: str | None = None,
    bot_user_id: str | None = None,
    bot_id: str | None = None,
    bot_token: str | None = None,
    bot_scopes: str | Sequence[str] | None = None,
    user_id: str | None = None,
    user: str | None = None,
    user_token: str | None = None,
    user_scopes: str | Sequence[str] | None = None)
    +(*,
    enterprise_id: str | None,
    team_id: str | None,
    team: str | None = None,
    url: str | None = None,
    bot_user_id: str | None = None,
    bot_id: str | None = None,
    bot_token: str | None = None,
    bot_scopes: Sequence[str] | str | None = None,
    user_id: str | None = None,
    user: str | None = None,
    user_token: str | None = None,
    user_scopes: Sequence[str] | str | None = None)
    @@ -246,7 +246,7 @@

    Class variables

    Static methods

    -def from_auth_test_response(*,
    bot_token: str | None = None,
    user_token: str | None = None,
    bot_scopes: str | Sequence[str] | None = None,
    user_scopes: str | Sequence[str] | None = None,
    auth_test_response: slack_sdk.web.slack_response.SlackResponse | ForwardRef('AsyncSlackResponse'),
    user_auth_test_response: slack_sdk.web.slack_response.SlackResponse | ForwardRef('AsyncSlackResponse') | None = None)
    +def from_auth_test_response(*,
    bot_token: str | None = None,
    user_token: str | None = None,
    bot_scopes: Sequence[str] | str | None = None,
    user_scopes: Sequence[str] | str | None = None,
    auth_test_response: slack_sdk.web.slack_response.SlackResponse | AsyncSlackResponse,
    user_auth_test_response: slack_sdk.web.slack_response.SlackResponse | AsyncSlackResponse | None = None)
    diff --git a/docs/reference/authorization/index.html b/docs/reference/authorization/index.html index 19de311df..2fdd1f916 100644 --- a/docs/reference/authorization/index.html +++ b/docs/reference/authorization/index.html @@ -75,7 +75,7 @@

    Classes

    class AuthorizeResult -(*,
    enterprise_id: str | None,
    team_id: str | None,
    team: str | None = None,
    url: str | None = None,
    bot_user_id: str | None = None,
    bot_id: str | None = None,
    bot_token: str | None = None,
    bot_scopes: str | Sequence[str] | None = None,
    user_id: str | None = None,
    user: str | None = None,
    user_token: str | None = None,
    user_scopes: str | Sequence[str] | None = None)
    +(*,
    enterprise_id: str | None,
    team_id: str | None,
    team: str | None = None,
    url: str | None = None,
    bot_user_id: str | None = None,
    bot_id: str | None = None,
    bot_token: str | None = None,
    bot_scopes: Sequence[str] | str | None = None,
    user_id: str | None = None,
    user: str | None = None,
    user_token: str | None = None,
    user_scopes: Sequence[str] | str | None = None)
    @@ -273,7 +273,7 @@

    Class variables

    Static methods

    -def from_auth_test_response(*,
    bot_token: str | None = None,
    user_token: str | None = None,
    bot_scopes: str | Sequence[str] | None = None,
    user_scopes: str | Sequence[str] | None = None,
    auth_test_response: slack_sdk.web.slack_response.SlackResponse | ForwardRef('AsyncSlackResponse'),
    user_auth_test_response: slack_sdk.web.slack_response.SlackResponse | ForwardRef('AsyncSlackResponse') | None = None)
    +def from_auth_test_response(*,
    bot_token: str | None = None,
    user_token: str | None = None,
    bot_scopes: Sequence[str] | str | None = None,
    user_scopes: Sequence[str] | str | None = None,
    auth_test_response: slack_sdk.web.slack_response.SlackResponse | AsyncSlackResponse,
    user_auth_test_response: slack_sdk.web.slack_response.SlackResponse | AsyncSlackResponse | None = None)
    diff --git a/docs/reference/context/assistant/thread_context_store/file/index.html b/docs/reference/context/assistant/thread_context_store/file/index.html index cbb4e4db6..4a5d944e1 100644 --- a/docs/reference/context/assistant/thread_context_store/file/index.html +++ b/docs/reference/context/assistant/thread_context_store/file/index.html @@ -48,7 +48,7 @@

    Classes

    class FileAssistantThreadContextStore -(base_dir: str = '/Users/eden.zimbelman/.bolt-app-assistant-thread-contexts') +(base_dir: str = '/Users/wbergamin/.bolt-app-assistant-thread-contexts')
    diff --git a/docs/reference/context/complete/async_complete.html b/docs/reference/context/complete/async_complete.html index 36cf1f92f..f0546a950 100644 --- a/docs/reference/context/complete/async_complete.html +++ b/docs/reference/context/complete/async_complete.html @@ -58,6 +58,7 @@

    Classes

    class AsyncComplete:
         client: AsyncWebClient
         function_execution_id: Optional[str]
    +    _called: bool
     
         def __init__(
             self,
    @@ -66,6 +67,7 @@ 

    Classes

    ): self.client = client self.function_execution_id = function_execution_id + self._called = False async def __call__(self, outputs: Optional[Dict[str, Any]] = None) -> AsyncSlackResponse: """Signal the successful completion of the custom function. @@ -82,9 +84,18 @@

    Classes

    if self.function_execution_id is None: raise ValueError("complete is unsupported here as there is no function_execution_id") + self._called = True return await self.client.functions_completeSuccess( function_execution_id=self.function_execution_id, outputs=outputs or {} - )
    + ) + + def has_been_called(self) -> bool: + """Check if this complete function has been called. + + Returns: + bool: True if the complete function has been called, False otherwise. + """ + return self._called

    Class variables

    @@ -98,6 +109,32 @@

    Class variables

    The type of the None singleton.

    +

    Methods

    +
    +
    +def has_been_called(self) ‑> bool +
    +
    +
    + +Expand source code + +
    def has_been_called(self) -> bool:
    +    """Check if this complete function has been called.
    +
    +    Returns:
    +        bool: True if the complete function has been called, False otherwise.
    +    """
    +    return self._called
    +
    +

    Check if this complete function has been called.

    +

    Returns

    +
    +
    bool
    +
    True if the complete function has been called, False otherwise.
    +
    +
    +
    @@ -119,6 +156,7 @@

  • client
  • function_execution_id
  • +
  • has_been_called
  • diff --git a/docs/reference/context/complete/complete.html b/docs/reference/context/complete/complete.html index b1f01ea1a..b8c1b083b 100644 --- a/docs/reference/context/complete/complete.html +++ b/docs/reference/context/complete/complete.html @@ -58,6 +58,7 @@

    Classes

    class Complete:
         client: WebClient
         function_execution_id: Optional[str]
    +    _called: bool
     
         def __init__(
             self,
    @@ -66,6 +67,7 @@ 

    Classes

    ): self.client = client self.function_execution_id = function_execution_id + self._called = False def __call__(self, outputs: Optional[Dict[str, Any]] = None) -> SlackResponse: """Signal the successful completion of the custom function. @@ -82,7 +84,16 @@

    Classes

    if self.function_execution_id is None: raise ValueError("complete is unsupported here as there is no function_execution_id") - return self.client.functions_completeSuccess(function_execution_id=self.function_execution_id, outputs=outputs or {})
    + self._called = True + return self.client.functions_completeSuccess(function_execution_id=self.function_execution_id, outputs=outputs or {}) + + def has_been_called(self) -> bool: + """Check if this complete function has been called. + + Returns: + bool: True if the complete function has been called, False otherwise. + """ + return self._called

    Class variables

    @@ -96,6 +107,32 @@

    Class variables

    The type of the None singleton.

    +

    Methods

    +
    +
    +def has_been_called(self) ‑> bool +
    +
    +
    + +Expand source code + +
    def has_been_called(self) -> bool:
    +    """Check if this complete function has been called.
    +
    +    Returns:
    +        bool: True if the complete function has been called, False otherwise.
    +    """
    +    return self._called
    +
    +

    Check if this complete function has been called.

    +

    Returns

    +
    +
    bool
    +
    True if the complete function has been called, False otherwise.
    +
    +
    +
    @@ -117,6 +154,7 @@

  • client
  • function_execution_id
  • +
  • has_been_called
  • diff --git a/docs/reference/context/complete/index.html b/docs/reference/context/complete/index.html index 7665622b6..dddd26a84 100644 --- a/docs/reference/context/complete/index.html +++ b/docs/reference/context/complete/index.html @@ -69,6 +69,7 @@

    Classes

    class Complete:
         client: WebClient
         function_execution_id: Optional[str]
    +    _called: bool
     
         def __init__(
             self,
    @@ -77,6 +78,7 @@ 

    Classes

    ): self.client = client self.function_execution_id = function_execution_id + self._called = False def __call__(self, outputs: Optional[Dict[str, Any]] = None) -> SlackResponse: """Signal the successful completion of the custom function. @@ -93,7 +95,16 @@

    Classes

    if self.function_execution_id is None: raise ValueError("complete is unsupported here as there is no function_execution_id") - return self.client.functions_completeSuccess(function_execution_id=self.function_execution_id, outputs=outputs or {})
    + self._called = True + return self.client.functions_completeSuccess(function_execution_id=self.function_execution_id, outputs=outputs or {}) + + def has_been_called(self) -> bool: + """Check if this complete function has been called. + + Returns: + bool: True if the complete function has been called, False otherwise. + """ + return self._called

    Class variables

    @@ -107,6 +118,32 @@

    Class variables

    The type of the None singleton.

    +

    Methods

    +
    +
    +def has_been_called(self) ‑> bool +
    +
    +
    + +Expand source code + +
    def has_been_called(self) -> bool:
    +    """Check if this complete function has been called.
    +
    +    Returns:
    +        bool: True if the complete function has been called, False otherwise.
    +    """
    +    return self._called
    +
    +

    Check if this complete function has been called.

    +

    Returns

    +
    +
    bool
    +
    True if the complete function has been called, False otherwise.
    +
    +
    +
    @@ -134,6 +171,7 @@

  • client
  • function_execution_id
  • +
  • has_been_called
  • diff --git a/docs/reference/context/fail/async_fail.html b/docs/reference/context/fail/async_fail.html index 6b3e4f1df..80f19d18c 100644 --- a/docs/reference/context/fail/async_fail.html +++ b/docs/reference/context/fail/async_fail.html @@ -58,6 +58,7 @@

    Classes

    class AsyncFail:
         client: AsyncWebClient
         function_execution_id: Optional[str]
    +    _called: bool
     
         def __init__(
             self,
    @@ -66,6 +67,7 @@ 

    Classes

    ): self.client = client self.function_execution_id = function_execution_id + self._called = False async def __call__(self, error: str) -> AsyncSlackResponse: """Signal that the custom function failed to complete. @@ -82,7 +84,16 @@

    Classes

    if self.function_execution_id is None: raise ValueError("fail is unsupported here as there is no function_execution_id") - return await self.client.functions_completeError(function_execution_id=self.function_execution_id, error=error)
    + self._called = True + return await self.client.functions_completeError(function_execution_id=self.function_execution_id, error=error) + + def has_been_called(self) -> bool: + """Check if this fail function has been called. + + Returns: + bool: True if the fail function has been called, False otherwise. + """ + return self._called

    Class variables

    @@ -96,6 +107,32 @@

    Class variables

    The type of the None singleton.

    +

    Methods

    +
    +
    +def has_been_called(self) ‑> bool +
    +
    +
    + +Expand source code + +
    def has_been_called(self) -> bool:
    +    """Check if this fail function has been called.
    +
    +    Returns:
    +        bool: True if the fail function has been called, False otherwise.
    +    """
    +    return self._called
    +
    +

    Check if this fail function has been called.

    +

    Returns

    +
    +
    bool
    +
    True if the fail function has been called, False otherwise.
    +
    +
    +
    @@ -117,6 +154,7 @@

  • client
  • function_execution_id
  • +
  • has_been_called
  • diff --git a/docs/reference/context/fail/fail.html b/docs/reference/context/fail/fail.html index 0152561d8..51f4896a4 100644 --- a/docs/reference/context/fail/fail.html +++ b/docs/reference/context/fail/fail.html @@ -58,6 +58,7 @@

    Classes

    class Fail:
         client: WebClient
         function_execution_id: Optional[str]
    +    _called: bool
     
         def __init__(
             self,
    @@ -66,6 +67,7 @@ 

    Classes

    ): self.client = client self.function_execution_id = function_execution_id + self._called = False def __call__(self, error: str) -> SlackResponse: """Signal that the custom function failed to complete. @@ -82,7 +84,16 @@

    Classes

    if self.function_execution_id is None: raise ValueError("fail is unsupported here as there is no function_execution_id") - return self.client.functions_completeError(function_execution_id=self.function_execution_id, error=error)
    + self._called = True + return self.client.functions_completeError(function_execution_id=self.function_execution_id, error=error) + + def has_been_called(self) -> bool: + """Check if this fail function has been called. + + Returns: + bool: True if the fail function has been called, False otherwise. + """ + return self._called

    Class variables

    @@ -96,6 +107,32 @@

    Class variables

    The type of the None singleton.

    +

    Methods

    +
    +
    +def has_been_called(self) ‑> bool +
    +
    +
    + +Expand source code + +
    def has_been_called(self) -> bool:
    +    """Check if this fail function has been called.
    +
    +    Returns:
    +        bool: True if the fail function has been called, False otherwise.
    +    """
    +    return self._called
    +
    +

    Check if this fail function has been called.

    +

    Returns

    +
    +
    bool
    +
    True if the fail function has been called, False otherwise.
    +
    +
    +
    @@ -117,6 +154,7 @@

  • client
  • function_execution_id
  • +
  • has_been_called
  • diff --git a/docs/reference/context/fail/index.html b/docs/reference/context/fail/index.html index eb2653106..3b35dd6aa 100644 --- a/docs/reference/context/fail/index.html +++ b/docs/reference/context/fail/index.html @@ -69,6 +69,7 @@

    Classes

    class Fail:
         client: WebClient
         function_execution_id: Optional[str]
    +    _called: bool
     
         def __init__(
             self,
    @@ -77,6 +78,7 @@ 

    Classes

    ): self.client = client self.function_execution_id = function_execution_id + self._called = False def __call__(self, error: str) -> SlackResponse: """Signal that the custom function failed to complete. @@ -93,7 +95,16 @@

    Classes

    if self.function_execution_id is None: raise ValueError("fail is unsupported here as there is no function_execution_id") - return self.client.functions_completeError(function_execution_id=self.function_execution_id, error=error)
    + self._called = True + return self.client.functions_completeError(function_execution_id=self.function_execution_id, error=error) + + def has_been_called(self) -> bool: + """Check if this fail function has been called. + + Returns: + bool: True if the fail function has been called, False otherwise. + """ + return self._called

    Class variables

    @@ -107,6 +118,32 @@

    Class variables

    The type of the None singleton.

    +

    Methods

    +
    +
    +def has_been_called(self) ‑> bool +
    +
    +
    + +Expand source code + +
    def has_been_called(self) -> bool:
    +    """Check if this fail function has been called.
    +
    +    Returns:
    +        bool: True if the fail function has been called, False otherwise.
    +    """
    +    return self._called
    +
    +

    Check if this fail function has been called.

    +

    Returns

    +
    +
    bool
    +
    True if the fail function has been called, False otherwise.
    +
    +
    +
    @@ -134,6 +171,7 @@

  • client
  • function_execution_id
  • +
  • has_been_called
  • diff --git a/docs/reference/error/index.html b/docs/reference/error/index.html index f57d690e9..9a9998e63 100644 --- a/docs/reference/error/index.html +++ b/docs/reference/error/index.html @@ -72,7 +72,7 @@

    Subclasses

    class BoltUnhandledRequestError -(*,
    request: ForwardRef('BoltRequest') | ForwardRef('AsyncBoltRequest'),
    current_response: ForwardRef('BoltResponse') | None,
    last_global_middleware_name: str | None = None)
    +(*,
    request: BoltRequest | AsyncBoltRequest,
    current_response: BoltResponse | None,
    last_global_middleware_name: str | None = None)
    diff --git a/docs/reference/index.html b/docs/reference/index.html index 7bd6d117e..1c02a8aeb 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -5073,6 +5073,7 @@

    Methods

    class Complete:
         client: WebClient
         function_execution_id: Optional[str]
    +    _called: bool
     
         def __init__(
             self,
    @@ -5081,6 +5082,7 @@ 

    Methods

    ): self.client = client self.function_execution_id = function_execution_id + self._called = False def __call__(self, outputs: Optional[Dict[str, Any]] = None) -> SlackResponse: """Signal the successful completion of the custom function. @@ -5097,7 +5099,16 @@

    Methods

    if self.function_execution_id is None: raise ValueError("complete is unsupported here as there is no function_execution_id") - return self.client.functions_completeSuccess(function_execution_id=self.function_execution_id, outputs=outputs or {})
    + self._called = True + return self.client.functions_completeSuccess(function_execution_id=self.function_execution_id, outputs=outputs or {}) + + def has_been_called(self) -> bool: + """Check if this complete function has been called. + + Returns: + bool: True if the complete function has been called, False otherwise. + """ + return self._called

    Class variables

    @@ -5111,6 +5122,32 @@

    Class variables

    The type of the None singleton.

    +

    Methods

    +
    +
    +def has_been_called(self) ‑> bool +
    +
    +
    + +Expand source code + +
    def has_been_called(self) -> bool:
    +    """Check if this complete function has been called.
    +
    +    Returns:
    +        bool: True if the complete function has been called, False otherwise.
    +    """
    +    return self._called
    +
    +

    Check if this complete function has been called.

    +

    Returns

    +
    +
    bool
    +
    True if the complete function has been called, False otherwise.
    +
    +
    +
    class CustomListenerMatcher @@ -5189,6 +5226,7 @@

    Inherited members

    class Fail:
         client: WebClient
         function_execution_id: Optional[str]
    +    _called: bool
     
         def __init__(
             self,
    @@ -5197,6 +5235,7 @@ 

    Inherited members

    ): self.client = client self.function_execution_id = function_execution_id + self._called = False def __call__(self, error: str) -> SlackResponse: """Signal that the custom function failed to complete. @@ -5213,7 +5252,16 @@

    Inherited members

    if self.function_execution_id is None: raise ValueError("fail is unsupported here as there is no function_execution_id") - return self.client.functions_completeError(function_execution_id=self.function_execution_id, error=error)
    + self._called = True + return self.client.functions_completeError(function_execution_id=self.function_execution_id, error=error) + + def has_been_called(self) -> bool: + """Check if this fail function has been called. + + Returns: + bool: True if the fail function has been called, False otherwise. + """ + return self._called

    Class variables

    @@ -5227,10 +5275,36 @@

    Class variables

    The type of the None singleton.

    +

    Methods

    +
    +
    +def has_been_called(self) ‑> bool +
    +
    +
    + +Expand source code + +
    def has_been_called(self) -> bool:
    +    """Check if this fail function has been called.
    +
    +    Returns:
    +        bool: True if the fail function has been called, False otherwise.
    +    """
    +    return self._called
    +
    +

    Check if this fail function has been called.

    +

    Returns

    +
    +
    bool
    +
    True if the fail function has been called, False otherwise.
    +
    +
    +
    class FileAssistantThreadContextStore -(base_dir: str = '/Users/eden.zimbelman/.bolt-app-assistant-thread-contexts') +(base_dir: str = '/Users/wbergamin/.bolt-app-assistant-thread-contexts')
    @@ -6120,6 +6194,7 @@

    Complete
  • client
  • function_execution_id
  • +
  • has_been_called
  • @@ -6136,6 +6211,7 @@

    Fail

  • client
  • function_execution_id
  • +
  • has_been_called
  • diff --git a/docs/reference/logger/messages.html b/docs/reference/logger/messages.html index 1072e6479..e69b45fc9 100644 --- a/docs/reference/logger/messages.html +++ b/docs/reference/logger/messages.html @@ -409,7 +409,7 @@

    Functions

  • -def warning_unhandled_by_global_middleware(name: str,
    req: BoltRequest | ForwardRef('AsyncBoltRequest')) ‑> str
    +def warning_unhandled_by_global_middleware(name: str,
    req: BoltRequest | AsyncBoltRequest) ‑> str
    @@ -427,7 +427,7 @@

    Functions

    -def warning_unhandled_request(req: BoltRequest | ForwardRef('AsyncBoltRequest')) ‑> str +def warning_unhandled_request(req: BoltRequest | AsyncBoltRequest) ‑> str
    diff --git a/docs/reference/oauth/async_oauth_settings.html b/docs/reference/oauth/async_oauth_settings.html index 5e6a543c4..3b8c04edb 100644 --- a/docs/reference/oauth/async_oauth_settings.html +++ b/docs/reference/oauth/async_oauth_settings.html @@ -48,7 +48,7 @@

    Classes

    class AsyncOAuthSettings -(*,
    client_id: str | None = None,
    client_secret: str | None = None,
    scopes: str | Sequence[str] | None = None,
    user_scopes: str | Sequence[str] | None = None,
    redirect_uri: str | None = None,
    install_path: str = '/slack/install',
    install_page_rendering_enabled: bool = True,
    redirect_uri_path: str = '/slack/oauth_redirect',
    callback_options: AsyncCallbackOptions | None = None,
    success_url: str | None = None,
    failure_url: str | None = None,
    authorization_url: str | None = None,
    installation_store: slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore | None = None,
    installation_store_bot_only: bool = False,
    token_rotation_expiration_minutes: int = 120,
    user_token_resolution: str = 'authed_user',
    state_validation_enabled: bool = True,
    state_store: slack_sdk.oauth.state_store.async_state_store.AsyncOAuthStateStore | None = None,
    state_cookie_name: str = 'slack-app-oauth-state',
    state_expiration_seconds: int = 600,
    logger: logging.Logger = <Logger slack_bolt.oauth.async_oauth_settings (WARNING)>)
    +(*,
    client_id: str | None = None,
    client_secret: str | None = None,
    scopes: Sequence[str] | str | None = None,
    user_scopes: Sequence[str] | str | None = None,
    redirect_uri: str | None = None,
    install_path: str = '/slack/install',
    install_page_rendering_enabled: bool = True,
    redirect_uri_path: str = '/slack/oauth_redirect',
    callback_options: AsyncCallbackOptions | None = None,
    success_url: str | None = None,
    failure_url: str | None = None,
    authorization_url: str | None = None,
    installation_store: slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore | None = None,
    installation_store_bot_only: bool = False,
    token_rotation_expiration_minutes: int = 120,
    user_token_resolution: str = 'authed_user',
    state_validation_enabled: bool = True,
    state_store: slack_sdk.oauth.state_store.async_state_store.AsyncOAuthStateStore | None = None,
    state_cookie_name: str = 'slack-app-oauth-state',
    state_expiration_seconds: int = 600,
    logger: logging.Logger = <Logger slack_bolt.oauth.async_oauth_settings (WARNING)>)
    diff --git a/docs/reference/oauth/oauth_settings.html b/docs/reference/oauth/oauth_settings.html index 1eb2ab7dd..cd8def497 100644 --- a/docs/reference/oauth/oauth_settings.html +++ b/docs/reference/oauth/oauth_settings.html @@ -48,7 +48,7 @@

    Classes

    class OAuthSettings -(*,
    client_id: str | None = None,
    client_secret: str | None = None,
    scopes: str | Sequence[str] | None = None,
    user_scopes: str | Sequence[str] | None = None,
    redirect_uri: str | None = None,
    install_path: str = '/slack/install',
    install_page_rendering_enabled: bool = True,
    redirect_uri_path: str = '/slack/oauth_redirect',
    callback_options: CallbackOptions | None = None,
    success_url: str | None = None,
    failure_url: str | None = None,
    authorization_url: str | None = None,
    installation_store: slack_sdk.oauth.installation_store.installation_store.InstallationStore | None = None,
    installation_store_bot_only: bool = False,
    token_rotation_expiration_minutes: int = 120,
    user_token_resolution: str = 'authed_user',
    state_validation_enabled: bool = True,
    state_store: slack_sdk.oauth.state_store.state_store.OAuthStateStore | None = None,
    state_cookie_name: str = 'slack-app-oauth-state',
    state_expiration_seconds: int = 600,
    logger: logging.Logger = <Logger slack_bolt.oauth.oauth_settings (WARNING)>)
    +(*,
    client_id: str | None = None,
    client_secret: str | None = None,
    scopes: Sequence[str] | str | None = None,
    user_scopes: Sequence[str] | str | None = None,
    redirect_uri: str | None = None,
    install_path: str = '/slack/install',
    install_page_rendering_enabled: bool = True,
    redirect_uri_path: str = '/slack/oauth_redirect',
    callback_options: CallbackOptions | None = None,
    success_url: str | None = None,
    failure_url: str | None = None,
    authorization_url: str | None = None,
    installation_store: slack_sdk.oauth.installation_store.installation_store.InstallationStore | None = None,
    installation_store_bot_only: bool = False,
    token_rotation_expiration_minutes: int = 120,
    user_token_resolution: str = 'authed_user',
    state_validation_enabled: bool = True,
    state_store: slack_sdk.oauth.state_store.state_store.OAuthStateStore | None = None,
    state_cookie_name: str = 'slack-app-oauth-state',
    state_expiration_seconds: int = 600,
    logger: logging.Logger = <Logger slack_bolt.oauth.oauth_settings (WARNING)>)
    diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 8cfd6f900..9b1349aea 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,3 +1,3 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.26.0" +__version__ = "1.27.0" From 8a8f285b6d89ab951628ac47591a1e22f99a6288 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Fri, 14 Nov 2025 09:48:03 -0500 Subject: [PATCH 671/719] fix: update the release instructions (#1400) --- .github/maintainers_guide.md | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/maintainers_guide.md b/.github/maintainers_guide.md index 8cd600271..f8edeeabd 100644 --- a/.github/maintainers_guide.md +++ b/.github/maintainers_guide.md @@ -147,15 +147,17 @@ Before creating a new release, ensure that everything on a stable branch has landed, then [run the tests](#run-all-the-unit-tests). 1. Create the commit for the release - 1. In `slack_bolt/version.py` bump the version number in adherence to [Semantic Versioning](http://semver.org/) and [Developmental Release](https://peps.python.org/pep-0440/#developmental-releases). + 1. Use the latest supported Python version. Using a [virtual environment](#python-and-friends) is recommended. + 2. In `slack_bolt/version.py` bump the version number in adherence to [Semantic Versioning](http://semver.org/) and [Developmental Release](https://peps.python.org/pep-0440/#developmental-releases). - Example: if the current version is `1.2.3`, a proper development bump would be `1.2.4.dev0` - `.dev` will indicate to pip that this is a [Development Release](https://peps.python.org/pep-0440/#developmental-releases) - Note that the `dev` version can be bumped in development releases: `1.2.4.dev0` -> `1.2.4.dev1` - 2. Build the docs with `./scripts/generate_api_docs.sh`. - 3. Commit with a message including the new version number. For example `1.2.4.dev0` & push the commit to a branch where the development release will live (create it if it does not exist) + 3. Build the docs with `./scripts/generate_api_docs.sh`. + 4. Commit with a message including the new version number. For example `1.2.4.dev0` & push the commit to a branch where the development release will live (create it if it does not exist) 1. `git checkout -b future-release` - 2. `git commit -m 'chore(release): version 1.2.4.dev0'` - 3. `git push -u origin future-release` + 2. `git add --all` (review files with `git status` before committing) + 3. `git commit -m 'chore(release): version 1.2.4.dev0'` + 4. `git push -u origin future-release` 2. Create a new GitHub Release 1. Navigate to the [Releases page](https://github.com/slackapi/bolt-python/releases). 2. Click the "Draft a new release" button. @@ -179,14 +181,16 @@ Before creating a new release, ensure that everything on the `main` branch since the last tag is in a releasable state! At a minimum, [run the tests](#run-all-the-unit-tests). 1. Create the commit for the release - 1. In `slack_bolt/version.py` bump the version number in adherence to [Semantic Versioning](http://semver.org/) and the [Versioning](#versioning-and-tags) section. - 2. Build the docs with `./scripts/generate_api_docs.sh`. - 3. Commit with a message including the new version number. For example `1.2.3` & push the commit to a branch and create a PR to sanity check. + 1. Use the latest supported Python version. Using a [virtual environment](#python-and-friends) is recommended. + 2. In `slack_bolt/version.py` bump the version number in adherence to [Semantic Versioning](http://semver.org/) and the [Versioning](#versioning-and-tags) section. + 3. Build the docs with `./scripts/generate_api_docs.sh`. + 4. Commit with a message including the new version number. For example `1.2.3` & push the commit to a branch and create a PR to sanity check. 1. `git checkout -b 1.2.3-release` - 2. `git commit -m 'chore(release): version 1.2.3'` - 3. `git push -u origin 1.2.3-release` - 4. Add relevant labels to the PR and add the PR to a GitHub Milestone. - 5. Merge in release PR after getting an approval from at least one maintainer. + 2. `git add --all` (review files with `git status` before committing) + 3. `git commit -m 'chore(release): version 1.2.3'` + 4. `git push -u origin 1.2.3-release` + 5. Add relevant labels to the PR and add the PR to a GitHub Milestone. + 6. Merge in release PR after getting an approval from at least one maintainer. 2. Create a new GitHub Release 1. Navigate to the [Releases page](https://github.com/slackapi/bolt-python/releases). 2. Click the "Draft a new release" button. From 9ea1a3bea9ce4f0a7813cf22b714535535c56b04 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Dec 2025 22:00:05 -0500 Subject: [PATCH 672/719] chore(deps): bump actions/setup-python from 6.0.0 to 6.1.0 (#1405) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codecov.yml | 2 +- .github/workflows/flake8.yml | 2 +- .github/workflows/mypy.yml | 2 +- .github/workflows/pypi-release.yml | 2 +- .github/workflows/tests.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 02c318a20..ff9669a8c 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -22,7 +22,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index f777996b4..fda0be853 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -20,7 +20,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ matrix.python-version }} - name: Run flake8 verification diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 52d59c830..64e600fe2 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -20,7 +20,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ matrix.python-version }} - name: Run mypy verification diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 21b472247..11413545a 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -24,7 +24,7 @@ jobs: persist-credentials: false - name: Set up Python - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: "3.x" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 42fd58ef6..5de9f35d1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,7 +32,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ matrix.python-version }} - name: Install synchronous dependencies From db6a5f679926f6e3d6451ee47bcc36af6ea5dbe6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 09:49:09 -0500 Subject: [PATCH 673/719] chore(deps): bump mypy from 1.18.2 to 1.19.0 (#1403) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: William Bergamin --- requirements/tools.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/tools.txt b/requirements/tools.txt index 73a342ca6..f9fbcdac1 100644 --- a/requirements/tools.txt +++ b/requirements/tools.txt @@ -1,3 +1,3 @@ -mypy==1.18.2 +mypy==1.19.0 flake8==7.3.0 black==25.1.0 From 91512bf6f8d6a34d0a84463b54fba3bdd08f207c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 09:53:43 -0500 Subject: [PATCH 674/719] chore(deps): update pytest-asyncio requirement from <1 to <2 (#1329) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: William Bergamin Co-authored-by: William Bergamin --- requirements/testing.txt | 2 +- .../socket_mode/mock_socket_mode_server.py | 2 +- .../socket_mode/test_async_aiohttp.py | 14 ++++++------- .../socket_mode/test_async_lazy_listeners.py | 14 ++++++------- .../socket_mode/test_async_websockets.py | 14 ++++++------- tests/adapter_tests_async/test_async_sanic.py | 14 ++++++------- tests/scenario_tests_async/test_app.py | 14 ++++++------- .../test_app_actor_user_token.py | 14 ++++++------- .../scenario_tests_async/test_app_bot_only.py | 14 ++++++------- .../test_app_custom_authorize.py | 14 ++++++------- .../scenario_tests_async/test_app_dispatch.py | 14 ++++++------- .../test_app_installation_store.py | 14 ++++++------- .../test_app_using_methods_in_class.py | 14 ++++++------- .../test_attachment_actions.py | 14 ++++++------- tests/scenario_tests_async/test_authorize.py | 14 ++++++------- .../test_block_actions.py | 14 ++++++------- .../test_block_actions_respond.py | 14 ++++++------- .../test_block_suggestion.py | 14 ++++++------- tests/scenario_tests_async/test_dialogs.py | 14 ++++++------- .../test_error_handler.py | 14 ++++++------- tests/scenario_tests_async/test_events.py | 14 ++++++------- .../test_events_assistant.py | 14 ++++++------- .../test_events_ignore_self.py | 14 ++++++------- .../test_events_org_apps.py | 14 ++++++------- .../test_events_request_verification.py | 14 ++++++------- .../test_events_shared_channels.py | 14 ++++++------- .../test_events_socket_mode.py | 14 ++++++------- .../test_events_token_revocations.py | 14 ++++++------- .../test_events_url_verification.py | 14 ++++++------- tests/scenario_tests_async/test_function.py | 12 +++++------ .../test_installation_store_authorize.py | 14 ++++++------- tests/scenario_tests_async/test_lazy.py | 14 ++++++------- .../test_listener_middleware.py | 14 ++++++------- tests/scenario_tests_async/test_message.py | 14 ++++++------- .../scenario_tests_async/test_message_bot.py | 14 ++++++------- .../test_message_changed.py | 14 ++++++------- .../test_message_deleted.py | 14 ++++++------- .../test_message_file_share.py | 14 ++++++------- .../test_message_thread_broadcast.py | 14 ++++++------- tests/scenario_tests_async/test_middleware.py | 14 ++++++------- tests/scenario_tests_async/test_shortcut.py | 14 ++++++------- .../test_slash_command.py | 14 ++++++------- tests/scenario_tests_async/test_ssl_check.py | 14 ++++++------- .../scenario_tests_async/test_view_closed.py | 14 ++++++------- .../test_view_submission.py | 14 ++++++------- .../test_web_client_customization.py | 14 ++++++------- .../test_workflow_steps.py | 14 ++++++------- .../test_workflow_steps_decorator_simple.py | 15 ++++++-------- ...test_workflow_steps_decorator_with_args.py | 15 ++++++-------- .../authorization/test_async_authorize.py | 14 ++++++------- .../context/test_async_complete.py | 19 ++++++++++-------- .../context/test_async_fail.py | 18 +++++++++-------- .../context/test_async_respond.py | 17 +++++++++------- .../context/test_async_say.py | 20 ++++++++++--------- .../context/test_async_set_status.py | 20 ++++++++++--------- .../test_async_set_suggested_prompts.py | 19 ++++++++++-------- .../test_single_team_authorization.py | 16 +++++++-------- .../test_request_verification.py | 7 ------- .../oauth/test_async_oauth_flow.py | 18 +++++++++-------- .../oauth/test_async_oauth_flow_sqlite3.py | 15 +++++++------- tests/utils.py | 10 ---------- 61 files changed, 377 insertions(+), 478 deletions(-) diff --git a/requirements/testing.txt b/requirements/testing.txt index 7cd7d353a..62fdcca2d 100644 --- a/requirements/testing.txt +++ b/requirements/testing.txt @@ -1,4 +1,4 @@ # pip install -r requirements/testing.txt -r testing_without_asyncio.txt -r async.txt -pytest-asyncio<1; +pytest-asyncio<2; diff --git a/tests/adapter_tests/socket_mode/mock_socket_mode_server.py b/tests/adapter_tests/socket_mode/mock_socket_mode_server.py index 997657368..f59999192 100644 --- a/tests/adapter_tests/socket_mode/mock_socket_mode_server.py +++ b/tests/adapter_tests/socket_mode/mock_socket_mode_server.py @@ -28,8 +28,8 @@ def reset_server_state(): async def health(request: web.Request): wr = web.Response() - await wr.prepare(request) wr.set_status(200) + await wr.prepare(request) return wr async def link(request: web.Request): diff --git a/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py b/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py index 1720f7ec6..e8077f10c 100644 --- a/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py +++ b/tests/adapter_tests_async/socket_mode/test_async_aiohttp.py @@ -9,7 +9,7 @@ setup_mock_web_api_server, cleanup_mock_web_api_server, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env from ...adapter_tests.socket_mode.mock_socket_mode_server import ( start_socket_mode_server, stop_socket_mode_server, @@ -24,16 +24,14 @@ class TestSocketModeAiohttp: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) try: - setup_mock_web_api_server(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server(self) + yield # run the test here finally: + cleanup_mock_web_api_server(self) restore_os_env(old_os_env) @pytest.mark.asyncio diff --git a/tests/adapter_tests_async/socket_mode/test_async_lazy_listeners.py b/tests/adapter_tests_async/socket_mode/test_async_lazy_listeners.py index 11268c6a1..9144bd239 100644 --- a/tests/adapter_tests_async/socket_mode/test_async_lazy_listeners.py +++ b/tests/adapter_tests_async/socket_mode/test_async_lazy_listeners.py @@ -9,7 +9,7 @@ setup_mock_web_api_server, cleanup_mock_web_api_server, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env from ...adapter_tests.socket_mode.mock_socket_mode_server import ( start_socket_mode_server, stop_socket_mode_server, @@ -24,16 +24,14 @@ class TestSocketModeAiohttp: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) try: - setup_mock_web_api_server(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server(self) + yield # run the test here finally: + cleanup_mock_web_api_server(self) restore_os_env(old_os_env) @pytest.mark.asyncio diff --git a/tests/adapter_tests_async/socket_mode/test_async_websockets.py b/tests/adapter_tests_async/socket_mode/test_async_websockets.py index db2680fc6..84d20b2f9 100644 --- a/tests/adapter_tests_async/socket_mode/test_async_websockets.py +++ b/tests/adapter_tests_async/socket_mode/test_async_websockets.py @@ -9,7 +9,7 @@ setup_mock_web_api_server, cleanup_mock_web_api_server, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env from ...adapter_tests.socket_mode.mock_socket_mode_server import ( start_socket_mode_server, stop_socket_mode_server, @@ -24,16 +24,14 @@ class TestSocketModeWebsockets: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) try: - setup_mock_web_api_server(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server(self) + yield # run the test here finally: + cleanup_mock_web_api_server(self) restore_os_env(old_os_env) @pytest.mark.asyncio diff --git a/tests/adapter_tests_async/test_async_sanic.py b/tests/adapter_tests_async/test_async_sanic.py index 316110a87..9a948e3a6 100644 --- a/tests/adapter_tests_async/test_async_sanic.py +++ b/tests/adapter_tests_async/test_async_sanic.py @@ -17,7 +17,7 @@ cleanup_mock_web_api_server, assert_auth_test_count, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestSanic: @@ -34,16 +34,14 @@ class TestSanic: def unique_sanic_app_name() -> str: return f"awesome-slack-app-{str(time()).replace('.', '-')}" - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) try: - setup_mock_web_api_server(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server(self) + yield # run the test here finally: + cleanup_mock_web_api_server(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_app.py b/tests/scenario_tests_async/test_app.py index 8a9512f74..e27dbd3b3 100644 --- a/tests/scenario_tests_async/test_app.py +++ b/tests/scenario_tests_async/test_app.py @@ -19,7 +19,7 @@ cleanup_mock_web_api_server_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncApp: @@ -27,16 +27,14 @@ class TestAsyncApp: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def setup_method(self): diff --git a/tests/scenario_tests_async/test_app_actor_user_token.py b/tests/scenario_tests_async/test_app_actor_user_token.py index 35bda0798..0028096be 100644 --- a/tests/scenario_tests_async/test_app_actor_user_token.py +++ b/tests/scenario_tests_async/test_app_actor_user_token.py @@ -23,7 +23,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestApp: @@ -36,16 +36,14 @@ class TestApp: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_app_bot_only.py b/tests/scenario_tests_async/test_app_bot_only.py index 58e705bac..b350aeb2d 100644 --- a/tests/scenario_tests_async/test_app_bot_only.py +++ b/tests/scenario_tests_async/test_app_bot_only.py @@ -22,7 +22,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAppBotOnly: @@ -35,16 +35,14 @@ class TestAppBotOnly: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_app_custom_authorize.py b/tests/scenario_tests_async/test_app_custom_authorize.py index f1e435f63..2b0252645 100644 --- a/tests/scenario_tests_async/test_app_custom_authorize.py +++ b/tests/scenario_tests_async/test_app_custom_authorize.py @@ -26,7 +26,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAppCustomAuthorize: @@ -39,16 +39,14 @@ class TestAppCustomAuthorize: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_app_dispatch.py b/tests/scenario_tests_async/test_app_dispatch.py index 814d1897a..c483bed19 100644 --- a/tests/scenario_tests_async/test_app_dispatch.py +++ b/tests/scenario_tests_async/test_app_dispatch.py @@ -7,7 +7,7 @@ cleanup_mock_web_api_server_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncAppDispatch: @@ -16,16 +16,14 @@ class TestAsyncAppDispatch: mock_api_server_base_url = "http://localhost:8888" web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) @pytest.mark.asyncio diff --git a/tests/scenario_tests_async/test_app_installation_store.py b/tests/scenario_tests_async/test_app_installation_store.py index 053adf52f..16670f1b2 100644 --- a/tests/scenario_tests_async/test_app_installation_store.py +++ b/tests/scenario_tests_async/test_app_installation_store.py @@ -23,7 +23,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestApp: @@ -36,16 +36,14 @@ class TestApp: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_app_using_methods_in_class.py b/tests/scenario_tests_async/test_app_using_methods_in_class.py index a24fe9528..989de511e 100644 --- a/tests/scenario_tests_async/test_app_using_methods_in_class.py +++ b/tests/scenario_tests_async/test_app_using_methods_in_class.py @@ -18,7 +18,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAppUsingMethodsInClass: @@ -31,16 +31,14 @@ class TestAppUsingMethodsInClass: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def test_inspect_behaviors(self): diff --git a/tests/scenario_tests_async/test_attachment_actions.py b/tests/scenario_tests_async/test_attachment_actions.py index c9817dcd7..ea07e6ed0 100644 --- a/tests/scenario_tests_async/test_attachment_actions.py +++ b/tests/scenario_tests_async/test_attachment_actions.py @@ -13,7 +13,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncAttachmentActions: @@ -26,16 +26,14 @@ class TestAsyncAttachmentActions: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_authorize.py b/tests/scenario_tests_async/test_authorize.py index 2cd18531b..9d6e3d4af 100644 --- a/tests/scenario_tests_async/test_authorize.py +++ b/tests/scenario_tests_async/test_authorize.py @@ -16,7 +16,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env valid_token = "xoxb-valid" valid_user_token = "xoxp-valid" @@ -60,16 +60,14 @@ class TestAsyncAuthorize: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_block_actions.py b/tests/scenario_tests_async/test_block_actions.py index 716a5a80b..6441b2e4b 100644 --- a/tests/scenario_tests_async/test_block_actions.py +++ b/tests/scenario_tests_async/test_block_actions.py @@ -16,7 +16,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncBlockActions: @@ -29,16 +29,14 @@ class TestAsyncBlockActions: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_block_actions_respond.py b/tests/scenario_tests_async/test_block_actions_respond.py index 6d8f80884..b95e1bbf3 100644 --- a/tests/scenario_tests_async/test_block_actions_respond.py +++ b/tests/scenario_tests_async/test_block_actions_respond.py @@ -8,7 +8,7 @@ cleanup_mock_web_api_server_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncBlockActionsRespond: @@ -20,16 +20,14 @@ class TestAsyncBlockActionsRespond: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) @pytest.mark.asyncio diff --git a/tests/scenario_tests_async/test_block_suggestion.py b/tests/scenario_tests_async/test_block_suggestion.py index fab3b48ec..2450957f4 100644 --- a/tests/scenario_tests_async/test_block_suggestion.py +++ b/tests/scenario_tests_async/test_block_suggestion.py @@ -14,7 +14,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncBlockSuggestion: @@ -27,16 +27,14 @@ class TestAsyncBlockSuggestion: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_dialogs.py b/tests/scenario_tests_async/test_dialogs.py index 1a3573d00..110fca45a 100644 --- a/tests/scenario_tests_async/test_dialogs.py +++ b/tests/scenario_tests_async/test_dialogs.py @@ -13,7 +13,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncAttachmentActions: @@ -26,16 +26,14 @@ class TestAsyncAttachmentActions: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_error_handler.py b/tests/scenario_tests_async/test_error_handler.py index 00cf5c07d..fb0b9ddae 100644 --- a/tests/scenario_tests_async/test_error_handler.py +++ b/tests/scenario_tests_async/test_error_handler.py @@ -16,7 +16,7 @@ cleanup_mock_web_api_server, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncErrorHandler: @@ -29,16 +29,14 @@ class TestAsyncErrorHandler: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) # ---------------- diff --git a/tests/scenario_tests_async/test_events.py b/tests/scenario_tests_async/test_events.py index 774d526ee..0cdaa0fac 100644 --- a/tests/scenario_tests_async/test_events.py +++ b/tests/scenario_tests_async/test_events.py @@ -19,7 +19,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncEvents: @@ -32,16 +32,14 @@ class TestAsyncEvents: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_events_assistant.py b/tests/scenario_tests_async/test_events_assistant.py index ac2c734c5..b131b4e38 100644 --- a/tests/scenario_tests_async/test_events_assistant.py +++ b/tests/scenario_tests_async/test_events_assistant.py @@ -14,7 +14,7 @@ cleanup_mock_web_api_server_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncEventsAssistant: @@ -25,16 +25,14 @@ class TestAsyncEventsAssistant: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) @pytest.mark.asyncio diff --git a/tests/scenario_tests_async/test_events_ignore_self.py b/tests/scenario_tests_async/test_events_ignore_self.py index 14fcb509a..7ec9d0cce 100644 --- a/tests/scenario_tests_async/test_events_ignore_self.py +++ b/tests/scenario_tests_async/test_events_ignore_self.py @@ -11,7 +11,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncEventsIgnoreSelf: @@ -22,16 +22,14 @@ class TestAsyncEventsIgnoreSelf: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) @pytest.mark.asyncio diff --git a/tests/scenario_tests_async/test_events_org_apps.py b/tests/scenario_tests_async/test_events_org_apps.py index 187c59b77..e3706d9c6 100644 --- a/tests/scenario_tests_async/test_events_org_apps.py +++ b/tests/scenario_tests_async/test_events_org_apps.py @@ -20,7 +20,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env valid_token = "xoxb-valid" @@ -57,16 +57,14 @@ class TestAsyncOrgApps: signature_verifier = SignatureVerifier(signing_secret) web_client = AsyncWebClient(token=None, base_url=mock_api_server_base_url) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_events_request_verification.py b/tests/scenario_tests_async/test_events_request_verification.py index f314852b0..51ccfcd98 100644 --- a/tests/scenario_tests_async/test_events_request_verification.py +++ b/tests/scenario_tests_async/test_events_request_verification.py @@ -13,7 +13,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncEventsRequestVerification: @@ -23,16 +23,14 @@ class TestAsyncEventsRequestVerification: signature_verifier = SignatureVerifier(signing_secret) web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_events_shared_channels.py b/tests/scenario_tests_async/test_events_shared_channels.py index 0112de808..ca43f979a 100644 --- a/tests/scenario_tests_async/test_events_shared_channels.py +++ b/tests/scenario_tests_async/test_events_shared_channels.py @@ -17,7 +17,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env valid_token = "xoxb-valid" @@ -39,16 +39,14 @@ class TestAsyncEventsSharedChannels: signature_verifier = SignatureVerifier(signing_secret) web_client = AsyncWebClient(token=None, base_url=mock_api_server_base_url) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_events_socket_mode.py b/tests/scenario_tests_async/test_events_socket_mode.py index 75ab349ad..e3d3fc98f 100644 --- a/tests/scenario_tests_async/test_events_socket_mode.py +++ b/tests/scenario_tests_async/test_events_socket_mode.py @@ -13,7 +13,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncEvents: @@ -24,16 +24,14 @@ class TestAsyncEvents: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def build_valid_app_mention_request(self) -> AsyncBoltRequest: diff --git a/tests/scenario_tests_async/test_events_token_revocations.py b/tests/scenario_tests_async/test_events_token_revocations.py index ecadbc53f..0c079eede 100644 --- a/tests/scenario_tests_async/test_events_token_revocations.py +++ b/tests/scenario_tests_async/test_events_token_revocations.py @@ -18,7 +18,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env valid_token = "xoxb-valid" @@ -49,16 +49,14 @@ class TestEventsTokenRevocations: signature_verifier = SignatureVerifier(signing_secret) web_client = AsyncWebClient(token=None, base_url=mock_api_server_base_url) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_events_url_verification.py b/tests/scenario_tests_async/test_events_url_verification.py index c095791cd..123fd3cce 100644 --- a/tests/scenario_tests_async/test_events_url_verification.py +++ b/tests/scenario_tests_async/test_events_url_verification.py @@ -12,7 +12,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncEventsUrlVerification: @@ -22,16 +22,14 @@ class TestAsyncEventsUrlVerification: signature_verifier = SignatureVerifier(signing_secret) web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_function.py b/tests/scenario_tests_async/test_function.py index 142cc1d6c..abf3ffb48 100644 --- a/tests/scenario_tests_async/test_function.py +++ b/tests/scenario_tests_async/test_function.py @@ -33,16 +33,14 @@ class TestAsyncFunction: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = asyncio.get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_installation_store_authorize.py b/tests/scenario_tests_async/test_installation_store_authorize.py index ad0b24250..bef7d39e0 100644 --- a/tests/scenario_tests_async/test_installation_store_authorize.py +++ b/tests/scenario_tests_async/test_installation_store_authorize.py @@ -18,7 +18,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env valid_token = "xoxb-valid" valid_user_token = "xoxp-valid" @@ -63,16 +63,14 @@ class TestAsyncInstallationStoreAuthorize: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_lazy.py b/tests/scenario_tests_async/test_lazy.py index 02a2bd0fa..7bf780e08 100644 --- a/tests/scenario_tests_async/test_lazy.py +++ b/tests/scenario_tests_async/test_lazy.py @@ -14,7 +14,7 @@ cleanup_mock_web_api_server_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncLazy: @@ -27,16 +27,14 @@ class TestAsyncLazy: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) # ---------------- diff --git a/tests/scenario_tests_async/test_listener_middleware.py b/tests/scenario_tests_async/test_listener_middleware.py index 4e6419e96..1b3d9b17d 100644 --- a/tests/scenario_tests_async/test_listener_middleware.py +++ b/tests/scenario_tests_async/test_listener_middleware.py @@ -12,7 +12,7 @@ cleanup_mock_web_api_server_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncListenerMiddleware: @@ -25,16 +25,14 @@ class TestAsyncListenerMiddleware: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) body = { diff --git a/tests/scenario_tests_async/test_message.py b/tests/scenario_tests_async/test_message.py index cc0fbb8ec..374760323 100644 --- a/tests/scenario_tests_async/test_message.py +++ b/tests/scenario_tests_async/test_message.py @@ -16,7 +16,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncMessage: @@ -29,16 +29,14 @@ class TestAsyncMessage: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_message_bot.py b/tests/scenario_tests_async/test_message_bot.py index 8e5e28c87..50f29271c 100644 --- a/tests/scenario_tests_async/test_message_bot.py +++ b/tests/scenario_tests_async/test_message_bot.py @@ -13,7 +13,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncMessage: @@ -26,16 +26,14 @@ class TestAsyncMessage: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_message_changed.py b/tests/scenario_tests_async/test_message_changed.py index 15658d636..66468f14a 100644 --- a/tests/scenario_tests_async/test_message_changed.py +++ b/tests/scenario_tests_async/test_message_changed.py @@ -11,7 +11,7 @@ cleanup_mock_web_api_server_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncMessageChanged: @@ -24,16 +24,14 @@ class TestAsyncMessageChanged: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_message_deleted.py b/tests/scenario_tests_async/test_message_deleted.py index 09f669d48..d5b6ba80c 100644 --- a/tests/scenario_tests_async/test_message_deleted.py +++ b/tests/scenario_tests_async/test_message_deleted.py @@ -11,7 +11,7 @@ cleanup_mock_web_api_server_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncMessageDeleted: @@ -24,16 +24,14 @@ class TestAsyncMessageDeleted: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_message_file_share.py b/tests/scenario_tests_async/test_message_file_share.py index 6f55957ac..f156d9286 100644 --- a/tests/scenario_tests_async/test_message_file_share.py +++ b/tests/scenario_tests_async/test_message_file_share.py @@ -13,7 +13,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncMessageFileShare: @@ -26,16 +26,14 @@ class TestAsyncMessageFileShare: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_message_thread_broadcast.py b/tests/scenario_tests_async/test_message_thread_broadcast.py index c3ac6dd01..c15bbdc99 100644 --- a/tests/scenario_tests_async/test_message_thread_broadcast.py +++ b/tests/scenario_tests_async/test_message_thread_broadcast.py @@ -13,7 +13,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncMessageThreadBroadcast: @@ -26,16 +26,14 @@ class TestAsyncMessageThreadBroadcast: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_middleware.py b/tests/scenario_tests_async/test_middleware.py index 6272f17e4..f8dfe9623 100644 --- a/tests/scenario_tests_async/test_middleware.py +++ b/tests/scenario_tests_async/test_middleware.py @@ -20,7 +20,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env # Note that async middleware system does not support instance methods n a class. @@ -34,16 +34,14 @@ class TestAsyncMiddleware: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def build_request(self) -> AsyncBoltRequest: diff --git a/tests/scenario_tests_async/test_shortcut.py b/tests/scenario_tests_async/test_shortcut.py index 9ad4b2b03..bd3c595eb 100644 --- a/tests/scenario_tests_async/test_shortcut.py +++ b/tests/scenario_tests_async/test_shortcut.py @@ -13,7 +13,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncShortcut: @@ -26,16 +26,14 @@ class TestAsyncShortcut: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_slash_command.py b/tests/scenario_tests_async/test_slash_command.py index 6c6d9ef88..1ac02bce7 100644 --- a/tests/scenario_tests_async/test_slash_command.py +++ b/tests/scenario_tests_async/test_slash_command.py @@ -12,7 +12,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncSlashCommand: @@ -25,16 +25,14 @@ class TestAsyncSlashCommand: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_ssl_check.py b/tests/scenario_tests_async/test_ssl_check.py index 894bf82c2..ef32bc0dd 100644 --- a/tests/scenario_tests_async/test_ssl_check.py +++ b/tests/scenario_tests_async/test_ssl_check.py @@ -10,7 +10,7 @@ cleanup_mock_web_api_server_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncSSLCheck: @@ -23,16 +23,14 @@ class TestAsyncSSLCheck: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_view_closed.py b/tests/scenario_tests_async/test_view_closed.py index a633b0d3b..1b86d22db 100644 --- a/tests/scenario_tests_async/test_view_closed.py +++ b/tests/scenario_tests_async/test_view_closed.py @@ -13,7 +13,7 @@ cleanup_mock_web_api_server_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncViewClosed: @@ -26,16 +26,14 @@ class TestAsyncViewClosed: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_view_submission.py b/tests/scenario_tests_async/test_view_submission.py index efb1c25f5..49a6e8fc5 100644 --- a/tests/scenario_tests_async/test_view_submission.py +++ b/tests/scenario_tests_async/test_view_submission.py @@ -13,7 +13,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env body = { @@ -198,16 +198,14 @@ class TestAsyncViewSubmission: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_web_client_customization.py b/tests/scenario_tests_async/test_web_client_customization.py index c9b42a617..8ed78b2c3 100644 --- a/tests/scenario_tests_async/test_web_client_customization.py +++ b/tests/scenario_tests_async/test_web_client_customization.py @@ -16,7 +16,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestWebClientCustomization: @@ -30,16 +30,14 @@ class TestWebClientCustomization: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_workflow_steps.py b/tests/scenario_tests_async/test_workflow_steps.py index ea9766361..a99dedbfe 100644 --- a/tests/scenario_tests_async/test_workflow_steps.py +++ b/tests/scenario_tests_async/test_workflow_steps.py @@ -21,7 +21,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncWorkflowSteps: @@ -34,16 +34,14 @@ class TestAsyncWorkflowSteps: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_workflow_steps_decorator_simple.py b/tests/scenario_tests_async/test_workflow_steps_decorator_simple.py index f404bf947..1224949ae 100644 --- a/tests/scenario_tests_async/test_workflow_steps_decorator_simple.py +++ b/tests/scenario_tests_async/test_workflow_steps_decorator_simple.py @@ -21,7 +21,7 @@ cleanup_mock_web_api_server_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncWorkflowStepsDecorator: @@ -34,19 +34,16 @@ class TestAsyncWorkflowStepsDecorator: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) self.app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) self.app.step(copy_review_step) - - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/scenario_tests_async/test_workflow_steps_decorator_with_args.py b/tests/scenario_tests_async/test_workflow_steps_decorator_with_args.py index 02d0ad8c7..53bec512d 100644 --- a/tests/scenario_tests_async/test_workflow_steps_decorator_with_args.py +++ b/tests/scenario_tests_async/test_workflow_steps_decorator_with_args.py @@ -22,7 +22,7 @@ cleanup_mock_web_api_server_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncWorkflowStepsDecorator: @@ -35,19 +35,16 @@ class TestAsyncWorkflowStepsDecorator: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) self.app = AsyncApp(client=self.web_client, signing_secret=self.signing_secret) self.app.step(copy_review_step) - - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) def generate_signature(self, body: str, timestamp: str): diff --git a/tests/slack_bolt_async/authorization/test_async_authorize.py b/tests/slack_bolt_async/authorization/test_async_authorize.py index f978ebfa7..d98a1062f 100644 --- a/tests/slack_bolt_async/authorization/test_async_authorize.py +++ b/tests/slack_bolt_async/authorization/test_async_authorize.py @@ -21,7 +21,7 @@ assert_auth_test_count_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncAuthorize: @@ -30,16 +30,14 @@ class TestAsyncAuthorize: base_url=mock_api_server_base_url, ) - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) @pytest.mark.asyncio diff --git a/tests/slack_bolt_async/context/test_async_complete.py b/tests/slack_bolt_async/context/test_async_complete.py index b2a464f83..4277d4218 100644 --- a/tests/slack_bolt_async/context/test_async_complete.py +++ b/tests/slack_bolt_async/context/test_async_complete.py @@ -7,20 +7,23 @@ setup_mock_web_api_server, cleanup_mock_web_api_server, ) +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncComplete: - @pytest.fixture - def event_loop(self): + + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): + old_os_env = remove_os_env_temporarily() setup_mock_web_api_server(self) valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" - self.web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url) - - loop = asyncio.get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server(self) + try: + self.web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url) + yield # run the test here + finally: + cleanup_mock_web_api_server(self) + restore_os_env(old_os_env) @pytest.mark.asyncio async def test_complete(self): diff --git a/tests/slack_bolt_async/context/test_async_fail.py b/tests/slack_bolt_async/context/test_async_fail.py index d4708927f..d344a6c95 100644 --- a/tests/slack_bolt_async/context/test_async_fail.py +++ b/tests/slack_bolt_async/context/test_async_fail.py @@ -7,20 +7,22 @@ setup_mock_web_api_server, cleanup_mock_web_api_server, ) +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncFail: - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): + old_os_env = remove_os_env_temporarily() setup_mock_web_api_server(self) valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" - self.web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url) - - loop = asyncio.get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server(self) + try: + self.web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url) + yield # run the test here + finally: + cleanup_mock_web_api_server(self) + restore_os_env(old_os_env) @pytest.mark.asyncio async def test_fail(self): diff --git a/tests/slack_bolt_async/context/test_async_respond.py b/tests/slack_bolt_async/context/test_async_respond.py index eba44d6a0..b47ef1056 100644 --- a/tests/slack_bolt_async/context/test_async_respond.py +++ b/tests/slack_bolt_async/context/test_async_respond.py @@ -1,6 +1,6 @@ import pytest -from tests.utils import get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env from slack_bolt.context.respond.async_respond import AsyncRespond from tests.mock_web_api_server import ( cleanup_mock_web_api_server_async, @@ -9,13 +9,16 @@ class TestAsyncRespond: - @pytest.fixture - def event_loop(self): + + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): + old_os_env = remove_os_env_temporarily() setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + try: + yield # run the test here + finally: + cleanup_mock_web_api_server_async(self) + restore_os_env(old_os_env) @pytest.mark.asyncio async def test_respond(self): diff --git a/tests/slack_bolt_async/context/test_async_say.py b/tests/slack_bolt_async/context/test_async_say.py index efa90febc..d8d63ae8a 100644 --- a/tests/slack_bolt_async/context/test_async_say.py +++ b/tests/slack_bolt_async/context/test_async_say.py @@ -4,21 +4,23 @@ from slack_bolt.context.say.async_say import AsyncSay from tests.mock_web_api_server import cleanup_mock_web_api_server_async, setup_mock_web_api_server_async -from tests.utils import get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncSay: - @pytest.fixture - def event_loop(self): + + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): + old_os_env = remove_os_env_temporarily() setup_mock_web_api_server_async(self) valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" - self.web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url) - - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + try: + self.web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url) + yield # run the test here + finally: + cleanup_mock_web_api_server_async(self) + restore_os_env(old_os_env) @pytest.mark.asyncio async def test_say(self): diff --git a/tests/slack_bolt_async/context/test_async_set_status.py b/tests/slack_bolt_async/context/test_async_set_status.py index 8df34171f..e785ff89e 100644 --- a/tests/slack_bolt_async/context/test_async_set_status.py +++ b/tests/slack_bolt_async/context/test_async_set_status.py @@ -4,21 +4,23 @@ from slack_bolt.context.set_status.async_set_status import AsyncSetStatus from tests.mock_web_api_server import cleanup_mock_web_api_server_async, setup_mock_web_api_server_async -from tests.utils import get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncSetStatus: - @pytest.fixture - def event_loop(self): + + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): + old_os_env = remove_os_env_temporarily() setup_mock_web_api_server_async(self) valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" - self.web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url) - - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + try: + self.web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url) + yield # run the test here + finally: + cleanup_mock_web_api_server_async(self) + restore_os_env(old_os_env) @pytest.mark.asyncio async def test_set_status(self): diff --git a/tests/slack_bolt_async/context/test_async_set_suggested_prompts.py b/tests/slack_bolt_async/context/test_async_set_suggested_prompts.py index 70a24efcb..2a09434a8 100644 --- a/tests/slack_bolt_async/context/test_async_set_suggested_prompts.py +++ b/tests/slack_bolt_async/context/test_async_set_suggested_prompts.py @@ -6,20 +6,23 @@ from slack_bolt.context.set_suggested_prompts.async_set_suggested_prompts import AsyncSetSuggestedPrompts from tests.mock_web_api_server import cleanup_mock_web_api_server, setup_mock_web_api_server +from tests.utils import remove_os_env_temporarily, restore_os_env class TestAsyncSetSuggestedPrompts: - @pytest.fixture - def event_loop(self): + + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): + old_os_env = remove_os_env_temporarily() setup_mock_web_api_server(self) valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" - self.web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url) - - loop = asyncio.get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server(self) + try: + self.web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url) + yield # run the test here + finally: + cleanup_mock_web_api_server(self) + restore_os_env(old_os_env) @pytest.mark.asyncio async def test_set_suggested_prompts(self): diff --git a/tests/slack_bolt_async/middleware/authorization/test_single_team_authorization.py b/tests/slack_bolt_async/middleware/authorization/test_single_team_authorization.py index e90eae5c8..0ddb6281d 100644 --- a/tests/slack_bolt_async/middleware/authorization/test_single_team_authorization.py +++ b/tests/slack_bolt_async/middleware/authorization/test_single_team_authorization.py @@ -11,7 +11,7 @@ cleanup_mock_web_api_server_async, setup_mock_web_api_server_async, ) -from tests.utils import remove_os_env_temporarily, restore_os_env, get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env async def next(): @@ -19,18 +19,16 @@ async def next(): class TestSingleTeamAuthorization: - mock_api_server_base_url = "http://localhost:8888" - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) try: - setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + self.mock_api_server_base_url = "http://localhost:8888" + yield # run the test here finally: + cleanup_mock_web_api_server_async(self) restore_os_env(old_os_env) @pytest.mark.asyncio diff --git a/tests/slack_bolt_async/middleware/request_verification/test_request_verification.py b/tests/slack_bolt_async/middleware/request_verification/test_request_verification.py index 0b05079a9..c097dd146 100644 --- a/tests/slack_bolt_async/middleware/request_verification/test_request_verification.py +++ b/tests/slack_bolt_async/middleware/request_verification/test_request_verification.py @@ -1,7 +1,6 @@ from time import time import pytest -from tests.utils import get_event_loop from slack_sdk.signature import SignatureVerifier from slack_bolt.middleware.request_verification.async_request_verification import ( @@ -32,12 +31,6 @@ def build_headers(self, timestamp: str, body: str): "x-slack-request-timestamp": [timestamp], } - @pytest.fixture - def event_loop(self): - loop = get_event_loop() - yield loop - loop.close() - @pytest.mark.asyncio async def test_valid(self): middleware = AsyncRequestVerification(signing_secret="secret") diff --git a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py index 1a7b89552..5714e1a6a 100644 --- a/tests/slack_bolt_async/oauth/test_async_oauth_flow.py +++ b/tests/slack_bolt_async/oauth/test_async_oauth_flow.py @@ -3,7 +3,7 @@ from urllib.parse import quote import pytest -from tests.utils import get_event_loop +from tests.utils import remove_os_env_temporarily, restore_os_env from slack_sdk.oauth.installation_store import FileInstallationStore from slack_sdk.oauth.state_store import FileOAuthStateStore from slack_sdk.oauth.state_store.async_state_store import AsyncOAuthStateStore @@ -30,15 +30,17 @@ class TestAsyncOAuthFlow: - mock_api_server_base_url = "http://localhost:8888" - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): + old_os_env = remove_os_env_temporarily() setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + try: + self.mock_api_server_base_url = "http://localhost:8888" + yield # run the test here + finally: + cleanup_mock_web_api_server_async(self) + restore_os_env(old_os_env) def next(self): pass diff --git a/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py b/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py index 238ce8873..00300929f 100644 --- a/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py +++ b/tests/slack_bolt_async/oauth/test_async_oauth_flow_sqlite3.py @@ -1,7 +1,6 @@ import pytest from slack_sdk.web.async_client import AsyncWebClient -from tests.utils import get_event_loop from slack_bolt import BoltResponse from slack_bolt.oauth.async_callback_options import ( AsyncFailureArgs, @@ -17,15 +16,15 @@ class TestAsyncOAuthFlowSQLite3: - mock_api_server_base_url = "http://localhost:8888" - @pytest.fixture - def event_loop(self): + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): setup_mock_web_api_server_async(self) - loop = get_event_loop() - yield loop - loop.close() - cleanup_mock_web_api_server_async(self) + try: + self.mock_api_server_base_url = "http://localhost:8888" + yield # run the test here + finally: + cleanup_mock_web_api_server_async(self) def next(self): pass diff --git a/tests/utils.py b/tests/utils.py index eb9759c5d..e06d0f861 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -13,13 +13,3 @@ def remove_os_env_temporarily() -> dict: def restore_os_env(old_env: dict) -> None: os.environ.update(old_env) - - -def get_event_loop(): - try: - return asyncio.get_event_loop() - except RuntimeError as ex: - if "There is no current event loop in thread" in str(ex): - loop = asyncio.new_event_loop() - asyncio.set_event_loop(loop) - return loop From 2e042283dd1fac79a797a9e274fbea29c25be4c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 10:12:40 -0500 Subject: [PATCH 675/719] chore(deps): bump actions/checkout from 5.0.0 to 6.0.0 (#1404) --- .github/workflows/codecov.yml | 2 +- .github/workflows/flake8.yml | 2 +- .github/workflows/mypy.yml | 2 +- .github/workflows/pypi-release.yml | 2 +- .github/workflows/tests.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index ff9669a8c..f93864817 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -18,7 +18,7 @@ jobs: env: BOLT_PYTHON_CODECOV_RUNNING: "1" steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index fda0be853..b0602d60a 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -16,7 +16,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 64e600fe2..650c8f9bd 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -16,7 +16,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 11413545a..80fac6d8c 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -18,7 +18,7 @@ jobs: contents: read steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: ref: ${{ github.event.release.tag_name || github.ref }} persist-credentials: false diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5de9f35d1..6de00d7da 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,7 +28,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} From 46f0b9506685c347b475c6ceb19ccee9520ed810 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 13:02:51 -0500 Subject: [PATCH 676/719] chore(deps): update cheroot requirement from <11 to <12 (#1380) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Michael Brooks Co-authored-by: William Bergamin --- requirements/adapter.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/adapter.txt b/requirements/adapter.txt index 3cefd621d..b2097bcdb 100644 --- a/requirements/adapter.txt +++ b/requirements/adapter.txt @@ -4,7 +4,7 @@ boto3<=2 bottle>=0.12,<1 chalice>=1.28,<2; -cheroot<11 # https://github.com/slackapi/bolt-python/issues/1374 +cheroot<12 CherryPy>=18,<19 Django>=3,<6 falcon>=2,<5; python_version<"3.11" From 91de836bd920cb392ca289af0c0923c859433e39 Mon Sep 17 00:00:00 2001 From: Luke Russell <31357343+lukegalbraithrussell@users.noreply.github.com> Date: Wed, 10 Dec 2025 15:31:52 -0800 Subject: [PATCH 677/719] docs: updates old links throughout (#1409) --- docs/english/concepts/ai-apps.md | 6 +++--- docs/english/concepts/message-sending.md | 6 +++--- docs/japanese/concepts/select-menu-options.md | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/english/concepts/ai-apps.md b/docs/english/concepts/ai-apps.md index 44bd08df1..3b057bc7e 100644 --- a/docs/english/concepts/ai-apps.md +++ b/docs/english/concepts/ai-apps.md @@ -337,9 +337,9 @@ See the [_Adding and handling feedback_](#adding-and-handling-feedback) section Three Web API methods work together to provide users a text streaming experience: -* the [`chat.startStream`](/reference/methods/chat.startstream) method starts the text stream, -* the [`chat.appendStream`](/reference/methods/chat.appendstream) method appends text to the stream, and -* the [`chat.stopStream`](/reference/methods/chat.stopstream) method stops it. +* the [`chat.startStream`](/reference/methods/chat.startStream) method starts the text stream, +* the [`chat.appendStream`](/reference/methods/chat.appendStream) method appends text to the stream, and +* the [`chat.stopStream`](/reference/methods/chat.stopStream) method stops it. Since you're using Bolt for Python, built upon the Python Slack SDK, you can use the [`chat_stream()`](https://docs.slack.dev/tools/python-slack-sdk/reference/web/client.html#slack_sdk.web.client.WebClient.chat_stream) utility to streamline all three aspects of streaming in your app's messages. diff --git a/docs/english/concepts/message-sending.md b/docs/english/concepts/message-sending.md index 9741bb396..87c433129 100644 --- a/docs/english/concepts/message-sending.md +++ b/docs/english/concepts/message-sending.md @@ -45,9 +45,9 @@ def show_datepicker(event, say): You can have your app's messages stream in to replicate conventional AI chatbot behavior. This is done through three Web API methods: -* [`chat_startStream`](/reference/methods/chat.startstream) -* [`chat_appendStream`](/reference/methods/chat.appendstream) -* [`chat_stopStream`](/reference/methods/chat.stopstream) +* [`chat_startStream`](/reference/methods/chat.startStream) +* [`chat_appendStream`](/reference/methods/chat.appendStream) +* [`chat_stopStream`](/reference/methods/chat.stopStream) The Python Slack SDK provides a [`chat_stream()`](https://docs.slack.dev/tools/python-slack-sdk/reference/web/client.html#slack_sdk.web.client.WebClient.chat_stream) helper utility to streamline calling these methods. Here's an excerpt from our [Assistant template app](https://github.com/slack-samples/bolt-python-assistant-template): diff --git a/docs/japanese/concepts/select-menu-options.md b/docs/japanese/concepts/select-menu-options.md index 1c2d41c58..2c12af623 100644 --- a/docs/japanese/concepts/select-menu-options.md +++ b/docs/japanese/concepts/select-menu-options.md @@ -2,7 +2,7 @@ `options()` メソッドは、Slack からのオプション(セレクトメニュー内の動的な選択肢)をリクエストするペイロードをリッスンします。 [`action()` と同様に](/tools/bolt-python/concepts/actions)、文字列型の `action_id` または制約付きオブジェクトが必要です。 -外部データソースを使って選択メニューをロードするためには、末部に `/slack/events` が付加された URL を Options Load URL として予め設定しておく必要があります。 +外部データソースを使って選択メニューをロードするためには、末部に `/slack/events` が付加された URL を Options Load URL として予め設定しておく必要があります。 `external_select` メニューでは `action_id` を指定することをおすすめしています。ただし、ダイアログを利用している場合、ダイアログが Block Kit に対応していないため、`callback_id` をフィルタリングするための制約オブジェクトを使用する必要があります。 From f02f8c6330e70e0afd9253a59ab8410237b9aab7 Mon Sep 17 00:00:00 2001 From: Luke Russell <31357343+lukegalbraithrussell@users.noreply.github.com> Date: Thu, 11 Dec 2025 09:55:49 -0800 Subject: [PATCH 678/719] docs: updates outmoded links and standardizes markdown links (#1410) --- docs/english/building-an-app.md | 4 ++-- docs/english/getting-started.md | 2 +- docs/english/legacy/steps-from-apps.md | 10 +++------ docs/japanese/concepts/acknowledge.md | 2 +- docs/japanese/concepts/actions.md | 6 ++++-- docs/japanese/concepts/adapters.md | 6 +++--- docs/japanese/concepts/assistant.md | 2 +- docs/japanese/concepts/async.md | 4 ++-- docs/japanese/concepts/commands.md | 2 +- docs/japanese/concepts/event-listening.md | 2 +- docs/japanese/concepts/global-middleware.md | 2 +- docs/japanese/concepts/listener-middleware.md | 2 +- docs/japanese/concepts/message-listening.md | 2 +- docs/japanese/concepts/message-sending.md | 2 +- docs/japanese/concepts/opening-modals.md | 6 +++--- docs/japanese/concepts/select-menu-options.md | 2 +- docs/japanese/concepts/shortcuts.md | 2 +- .../concepts/updating-pushing-views.md | 8 +++---- docs/japanese/concepts/view-submissions.md | 10 ++++----- docs/japanese/concepts/web-api.md | 2 +- docs/japanese/getting-started.md | 4 ++-- docs/japanese/legacy/steps-from-apps.md | 21 +++++++------------ 22 files changed, 48 insertions(+), 55 deletions(-) diff --git a/docs/english/building-an-app.md b/docs/english/building-an-app.md index ee0dac967..bde340961 100644 --- a/docs/english/building-an-app.md +++ b/docs/english/building-an-app.md @@ -55,7 +55,7 @@ We're going to use bot and app-level tokens for this guide. :::tip[Not sharing is sometimes caring] -Treat your tokens like passwords and [keep them safe](/authentication/best-practices-for-security). Your app uses tokens to post and retrieve information from Slack workspaces. +Treat your tokens like passwords and [keep them safe](/security). Your app uses tokens to post and retrieve information from Slack workspaces. ::: @@ -103,7 +103,7 @@ $ export SLACK_APP_TOKEN= :::warning[Keep it secret. Keep it safe.] -Remember to keep your tokens secure. At a minimum, you should avoid checking them into public version control, and access them via environment variables as we've done above. Check out the API documentation for more on [best practices for app security](/authentication/best-practices-for-security). +Remember to keep your tokens secure. At a minimum, you should avoid checking them into public version control, and access them via environment variables as we've done above. Check out the API documentation for more on [best practices for app security](/security). ::: diff --git a/docs/english/getting-started.md b/docs/english/getting-started.md index cc428a93a..934dd3bae 100644 --- a/docs/english/getting-started.md +++ b/docs/english/getting-started.md @@ -147,7 +147,7 @@ The above command works on Linux and macOS but [similar commands are available o :::warning[Keep it secret. Keep it safe.] -Treat your tokens like a password and [keep it safe](/authentication/best-practices-for-security). Your app uses these to retrieve and send information to Slack. +Treat your tokens like a password and [keep it safe](/security). Your app uses these to retrieve and send information to Slack. ::: diff --git a/docs/english/legacy/steps-from-apps.md b/docs/english/legacy/steps-from-apps.md index 03b9fa8ff..bced20f9e 100644 --- a/docs/english/legacy/steps-from-apps.md +++ b/docs/english/legacy/steps-from-apps.md @@ -68,14 +68,12 @@ app.step(ws) ## Adding or editing steps from apps -When a builder adds (or later edits) your step in their workflow, your app will receive a [`workflow_step_edit` event](/legacy/legacy-steps-from-apps/legacy-steps-from-apps-workflow_step_edit-payload). The `edit` callback in your `WorkflowStep` configuration will be run when this event is received. +When a builder adds (or later edits) your step in their workflow, your app will receive a `workflow_step_edit` event. The `edit` callback in your `WorkflowStep` configuration will be run when this event is received. -Whether a builder is adding or editing a step, you need to send them a [step from app configuration modal](/legacy/legacy-steps-from-apps/legacy-steps-from-apps-configuration-view-object). This modal is where step-specific settings are chosen, and it has more restrictions than typical modals—most notably, it cannot include `title`, `submit`, or `close` properties. By default, the configuration modal's `callback_id` will be the same as the step from app. +Whether a builder is adding or editing a step, you need to send them a step from app configuration modal. This modal is where step-specific settings are chosen, and it has more restrictions than typical modals—most notably, it cannot include `title`, `submit`, or `close` properties. By default, the configuration modal's `callback_id` will be the same as the step from app. Within the `edit` callback, the `configure()` utility can be used to easily open your step's configuration modal by passing in the view's blocks with the corresponding `blocks` argument. To disable saving the configuration before certain conditions are met, you can also pass in `submit_disabled` with a value of `True`. -To learn more about opening configuration modals, [read the documentation](/legacy/legacy-steps-from-apps/). - Refer to the module documents ([common](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) / [step-specific](https://docs.slack.dev/tools/bolt-python/reference/workflows/step/utilities/index.html)) to learn the available arguments. ```python @@ -126,8 +124,6 @@ Within the `save` callback, the `update()` method can be used to save the builde - `step_name` overrides the default Step name - `step_image_url` overrides the default Step image -To learn more about how to structure these parameters, [read the documentation](/legacy/legacy-steps-from-apps/). - Refer to the module documents ([common](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) / [step-specific](https://docs.slack.dev/tools/bolt-python/reference/workflows/step/utilities/index.html)) to learn the available arguments. ```python @@ -167,7 +163,7 @@ app.step(ws) ## Executing steps from apps -When your step from app is executed by an end user, your app will receive a [`workflow_step_execute` event](/legacy/legacy-steps-from-apps/legacy-steps-from-apps-workflow_step-object). The `execute` callback in your `WorkflowStep` configuration will be run when this event is received. +When your step from app is executed by an end user, your app will receive a `workflow_step_execute` event. The `execute` callback in your `WorkflowStep` configuration will be run when this event is received. Using the `inputs` from the `save` callback, this is where you can make third-party API calls, save information to a database, update the user's Home tab, or decide the outputs that will be available to subsequent steps from apps by mapping values to the `outputs` object. diff --git a/docs/japanese/concepts/acknowledge.md b/docs/japanese/concepts/acknowledge.md index 2b3756009..36ba6cba4 100644 --- a/docs/japanese/concepts/acknowledge.md +++ b/docs/japanese/concepts/acknowledge.md @@ -8,7 +8,7 @@ FaaS / serverless 環境を使う場合、 `ack()` するタイミングが異なります。 これに関する詳細は [Lazy listeners (FaaS)](/tools/bolt-python/concepts/lazy-listeners) を参照してください。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧は[モジュールドキュメント](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html)を参考にしてください。 ```python # 外部データを使用する選択メニューオプションに応答するサンプル @app.options("menu_selection") diff --git a/docs/japanese/concepts/actions.md b/docs/japanese/concepts/actions.md index 60019ebb7..8f1d1180e 100644 --- a/docs/japanese/concepts/actions.md +++ b/docs/japanese/concepts/actions.md @@ -8,7 +8,8 @@ Bolt アプリは `action` メソッドを用いて、ボタンのクリック `action()` を使ったすべての例で `ack()` が使用されていることに注目してください。アクションのリスナー内では、Slack からのリクエストを受信したことを確認するために、`ack()` 関数を呼び出す必要があります。これについては、[リクエストの確認](/tools/bolt-python/concepts/acknowledge)セクションで説明しています。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧は[モジュールドキュメント](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html)を参考にしてください。 + ```python # 'approve_button' という action_id のブロックエレメントがトリガーされるたびに、このリスナーが呼び出させれる @app.action("approve_button") @@ -45,7 +46,8 @@ def update_message(ack, body, client): 2 つ目は、`respond()` を使用する方法です。これは、アクションに関連づけられた `response_url` を使ったメッセージ送信を行うためのユーティリティです。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧は[モジュールドキュメント](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html)を参考にしてください。 + ```python # 'approve_button' という action_id のインタラクティブコンポーネントがトリガーされると、このリスナーが呼ばれる @app.action("approve_button") diff --git a/docs/japanese/concepts/adapters.md b/docs/japanese/concepts/adapters.md index a58ed34a2..6ed804c26 100644 --- a/docs/japanese/concepts/adapters.md +++ b/docs/japanese/concepts/adapters.md @@ -1,12 +1,12 @@ # アダプター -アダプターは Slack から届く受信リクエストの受付とパーズを担当し、それらのリクエストを `BoltRequest` の形式に変換して Bolt アプリに引き渡します。 +アダプターは Slack から届く受信リクエストの受付とパーズを担当し、それらのリクエストを [`BoltRequest`](https://github.com/slackapi/bolt-python/blob/main/slack_bolt/request/request.py) の形式に変換して Bolt アプリに引き渡します。 -デフォルトでは、Bolt の組み込みの `HTTPServer` アダプターが使われます。このアダプターは、ローカルで開発するのには問題がありませんが、本番環境での利用は推奨されていません。Bolt for Python には複数の組み込みのアダプターが用意されており、必要に応じてインポートしてアプリで使用することができます。組み込みのアダプターは Flask、Django、Starlette をはじめとする様々な人気の Python フレームワークをサポートしています。これらのアダプターは、あなたが選択した本番環境で利用可能な Webサーバーとともに利用することができます。 +デフォルトでは、Bolt の組み込みの [`HTTPServer`](https://docs.python.org/3/library/http.server.html) アダプターが使われます。このアダプターは、ローカルで開発するのには問題がありませんが、**本番環境での利用は推奨されていません**。Bolt for Python には複数の組み込みのアダプターが用意されており、必要に応じてインポートしてアプリで使用することができます。組み込みのアダプターは Flask、Django、Starlette をはじめとする様々な人気の Python フレームワークをサポートしています。これらのアダプターは、あなたが選択した本番環境で利用可能な Webサーバーとともに利用することができます。 アダプターを使用するには、任意のフレームワークを使ってアプリを開発し、そのコードに対応するアダプターをインポートします。その後、アダプターのインスタンスを初期化して、受信リクエストの受付とパーズを行う関数を呼び出します。 -すべてのアダプターの一覧と、設定や使い方のサンプルは、リポジトリの `examples` フォルダをご覧ください。 +すべてのアダプターの一覧と、設定や使い方のサンプルは、リポジトリの [`examples` フォルダ](https://github.com/slackapi/bolt-python/tree/main/examples)をご覧ください。 ```python from slack_bolt import App diff --git a/docs/japanese/concepts/assistant.md b/docs/japanese/concepts/assistant.md index e819f5361..664108607 100644 --- a/docs/japanese/concepts/assistant.md +++ b/docs/japanese/concepts/assistant.md @@ -68,7 +68,7 @@ def respond_in_assistant_thread( app.use(assistant) ``` -リスナーに指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +リスナーに指定可能な引数の一覧は[モジュールドキュメント](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html)を参考にしてください。 ユーザーがチャンネルの横でアシスタントスレッドを開いた場合、そのチャンネルの情報は、そのスレッドの `AssistantThreadContext` データとして保持され、 `get_thread_context` ユーティリティを使ってアクセスすることができます。Bolt がこのユーティリティを提供している理由は、後続のユーザーメッセージ投稿のイベントペイロードに最新のスレッドのコンテキスト情報は含まれないためです。そのため、アプリはコンテキスト情報が変更されたタイミングでそれを何らかの方法で保存し、後続のメッセージイベントのリスナーコードから参照できるようにする必要があります。 diff --git a/docs/japanese/concepts/async.md b/docs/japanese/concepts/async.md index cc38886d4..6687dcff5 100644 --- a/docs/japanese/concepts/async.md +++ b/docs/japanese/concepts/async.md @@ -1,8 +1,8 @@ # Async(asyncio)の使用 -非同期バージョンの Bolt を使用する場合は、`App` の代わりに `AsyncApp` インスタンスをインポートして初期化します。`AsyncApp` では AIOHTTP を使って API リクエストを行うため、`aiohttp` をインストールする必要があります(`requirements.txt` に追記するか、`pip install aiohttp` を実行します)。 +非同期バージョンの Bolt を使用する場合は、`App` の代わりに `AsyncApp` インスタンスをインポートして初期化します。`AsyncApp` では [AIOHTTP](https://docs.aiohttp.org/) を使って API リクエストを行うため、`aiohttp` をインストールする必要があります(`requirements.txt` に追記するか、`pip install aiohttp` を実行します)。 -非同期バージョンのプロジェクトのサンプルは、リポジトリの `examples` フォルダにあります。 +非同期バージョンのプロジェクトのサンプルは、リポジトリの [`examples` フォルダ](https://github.com/slackapi/bolt-python/tree/main/examples)にあります。 ```python # aiohttp のインストールが必要です diff --git a/docs/japanese/concepts/commands.md b/docs/japanese/concepts/commands.md index c89568dbe..ebb43c4d3 100644 --- a/docs/japanese/concepts/commands.md +++ b/docs/japanese/concepts/commands.md @@ -8,7 +8,7 @@ アプリの設定でコマンドを登録するときは、リクエスト URL の末尾に `/slack/events` をつけます。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧は[モジュールドキュメント](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html)を参考にしてください。 ```python # echoコマンドは受け取ったコマンドをそのまま返す @app.command("/echo") diff --git a/docs/japanese/concepts/event-listening.md b/docs/japanese/concepts/event-listening.md index c13638226..7b21f1fa4 100644 --- a/docs/japanese/concepts/event-listening.md +++ b/docs/japanese/concepts/event-listening.md @@ -4,7 +4,7 @@ `event()` メソッドには `str` 型の `eventType` を指定する必要があります。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧は[モジュールドキュメント](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html)を参考にしてください。 ```python # ユーザーがワークスペースに参加した際に、自己紹介を促すメッセージを指定のチャンネルに送信 @app.event("team_join") diff --git a/docs/japanese/concepts/global-middleware.md b/docs/japanese/concepts/global-middleware.md index 884008090..01ca417ac 100644 --- a/docs/japanese/concepts/global-middleware.md +++ b/docs/japanese/concepts/global-middleware.md @@ -4,7 +4,7 @@ グローバルミドルウェアでもリスナーミドルウェアでも、次のミドルウェアに実行チェーンの制御をリレーするために、`next()` を呼び出す必要があります。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧は[モジュールドキュメント](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html)を参考にしてください。 ```python @app.use diff --git a/docs/japanese/concepts/listener-middleware.md b/docs/japanese/concepts/listener-middleware.md index 2b3ea9323..425ae4ea7 100644 --- a/docs/japanese/concepts/listener-middleware.md +++ b/docs/japanese/concepts/listener-middleware.md @@ -4,7 +4,7 @@ 非常にシンプルなリスナーミドルウェアの場合であれば、`next()` メソッドを呼び出す代わりに `bool` 値(処理を継続したい場合は `True`)を返すだけで済む「リスナーマッチャー」を使うとよいでしょう。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧は[モジュールドキュメント](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html)を参考にしてください。 ```python # ボットからのメッセージをフィルタリングするリスナーミドルウェア diff --git a/docs/japanese/concepts/message-listening.md b/docs/japanese/concepts/message-listening.md index 824ac67c8..dae729b51 100644 --- a/docs/japanese/concepts/message-listening.md +++ b/docs/japanese/concepts/message-listening.md @@ -4,7 +4,7 @@ `message()` の引数には `str` 型または `re.Pattern` オブジェクトを指定できます。この条件のパターンに一致しないメッセージは除外されます。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧は[モジュールドキュメント](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html)を参考にしてください。 ```python # '👋' が含まれるすべてのメッセージに一致 @app.message(":wave:") diff --git a/docs/japanese/concepts/message-sending.md b/docs/japanese/concepts/message-sending.md index a299144b6..ace67051b 100644 --- a/docs/japanese/concepts/message-sending.md +++ b/docs/japanese/concepts/message-sending.md @@ -4,7 +4,7 @@ リスナー関数の外でメッセージを送信したい場合や、より高度な処理(特定のエラーの処理など)を実行したい場合は、[Bolt インスタンスにアタッチされたクライアント](/tools/bolt-python/concepts/web-api)の `client.chat_postMessage` を呼び出します。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧は[モジュールドキュメント](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html)を参考にしてください。 ```python # 'knock knock' が含まれるメッセージをリッスンし、イタリック体で 'Who's there?' と返信 @app.message("knock knock") diff --git a/docs/japanese/concepts/opening-modals.md b/docs/japanese/concepts/opening-modals.md index 68e3b947c..65342afb1 100644 --- a/docs/japanese/concepts/opening-modals.md +++ b/docs/japanese/concepts/opening-modals.md @@ -1,12 +1,12 @@ # モーダルの開始 -モーダルは、ユーザーからのデータの入力を受け付けたり、動的な情報を表示したりするためのインターフェイスです。組み込みの APIクライアントの `views.open` メソッドに、有効な `trigger_id` とビューのペイロードを指定してモーダルを開始します。 +[モーダル](/surfaces/modals)は、ユーザーからのデータの入力を受け付けたり、動的な情報を表示したりするためのインターフェイスです。組み込みの APIクライアントの [`views.open`](/reference/methods/views.open/) メソッドに、有効な `trigger_id` と[ビューのペイロード](/reference/interaction-payloads/view-interactions-payload/#view_submission)を指定してモーダルを開始します。 ショートカットの実行、ボタンを押下、選択メニューの操作などの操作の場合、Request URL に送信されるペイロードには `trigger_id` が含まれます。 -モーダルの生成方法についての詳細は、API ドキュメントを参照してください。 +モーダルの生成方法についての詳細は、[API ドキュメント](/surfaces/modals#composing_views)を参照してください。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧は[モジュールドキュメント](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html)を参考にしてください。 ```python # ショートカットの呼び出しをリッスン diff --git a/docs/japanese/concepts/select-menu-options.md b/docs/japanese/concepts/select-menu-options.md index 2c12af623..4f3a5f357 100644 --- a/docs/japanese/concepts/select-menu-options.md +++ b/docs/japanese/concepts/select-menu-options.md @@ -10,7 +10,7 @@ さらに、ユーザーが入力したキーワードに基づいたオプションを返すようフィルタリングロジックを適用することもできます。 これは `payload` という引数の ` value` の値に基づいて、それぞれのパターンで異なるオプションの一覧を返すように実装することができます。 Bolt for Python のすべてのリスナーやミドルウェアでは、[多くの有用な引数](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html)にアクセスすることができますので、チェックしてみてください。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧は[モジュールドキュメント](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html)を参考にしてください。 ```python # 外部データを使用する選択メニューオプションに応答するサンプル例 @app.options("external_action") diff --git a/docs/japanese/concepts/shortcuts.md b/docs/japanese/concepts/shortcuts.md index d9a8ba050..39fb10ba8 100644 --- a/docs/japanese/concepts/shortcuts.md +++ b/docs/japanese/concepts/shortcuts.md @@ -12,7 +12,7 @@ ⚠️ グローバルショートカットのペイロードにはチャンネル ID が **含まれません**。アプリでチャンネル ID を取得する必要がある場合は、モーダル内に [`conversations_select`](/reference/block-kit/block-elements/multi-select-menu-element#conversation_multi_select) エレメントを配置します。メッセージショートカットにはチャンネル ID が含まれます。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧は[モジュールドキュメント](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html)を参考にしてください。 ```python # 'open_modal' という callback_id のショートカットをリッスン @app.shortcut("open_modal") diff --git a/docs/japanese/concepts/updating-pushing-views.md b/docs/japanese/concepts/updating-pushing-views.md index cc32f5b69..2bbaf5ae5 100644 --- a/docs/japanese/concepts/updating-pushing-views.md +++ b/docs/japanese/concepts/updating-pushing-views.md @@ -1,6 +1,6 @@ # モーダルの更新と多重表示 -モーダル内では、複数のモーダルをスタックのように重ねることができます。`views_open` という APIを呼び出すと、親となるとなるモーダルビューが追加されます。この最初の呼び出しの後、`views_update` を呼び出すことでそのビューを更新することができます。また、`views_push` を呼び出すと、親のモーダルの上にさらに新しいモーダルビューを重ねることもできます。 +モーダル内では、複数のモーダルをスタックのように重ねることができます。[`views_open`](/reference/methods/views.open/) という APIを呼び出すと、親となるとなるモーダルビューが追加されます。この最初の呼び出しの後、[`views_update`](/reference/methods/views.update/) を呼び出すことでそのビューを更新することができます。また、[`views_push`](/reference/methods/views.push) を呼び出すと、親のモーダルの上にさらに新しいモーダルビューを重ねることもできます。 **`views_update`** @@ -8,11 +8,11 @@ **`views_push`** -既存のモーダルの上に新しいモーダルをスタックのように追加する場合は、組み込みのクライアントで `views_push` API を呼び出します。この API 呼び出しでは、有効な `trigger_id` と新しいビューのペイロードを指定します。`views_push` の引数は モーダルの開始 と同じです。モーダルを開いた後、このモーダルのスタックに追加できるモーダルビューは 2 つまでです。 +既存のモーダルの上に新しいモーダルをスタックのように追加する場合は、組み込みのクライアントで `views_push` API を呼び出します。この API 呼び出しでは、有効な `trigger_id` と新しい[ビューのペイロード](/reference/interaction-payloads/view-interactions-payload/#view_submission)を指定します。`views_push` の引数は [モーダルの開始](#creating-modals) と同じです。モーダルを開いた後、このモーダルのスタックに追加できるモーダルビューは 2 つまでです。 -モーダルの更新と多重表示に関する詳細は、API ドキュメントを参照してください。 +モーダルの更新と多重表示に関する詳細は、[API ドキュメント](/surfaces/modals)を参照してください。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧は[モジュールドキュメント](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html)を参考にしてください。 ```python # モーダルに含まれる、`button_abc` という action_id のボタンの呼び出しをリッスン diff --git a/docs/japanese/concepts/view-submissions.md b/docs/japanese/concepts/view-submissions.md index 5ae78f173..f82922004 100644 --- a/docs/japanese/concepts/view-submissions.md +++ b/docs/japanese/concepts/view-submissions.md @@ -1,6 +1,6 @@ # モーダルの送信のリスニング -モーダルのペイロードに `input` ブロックを含める場合、その入力値を受け取るために`view_submission` リクエストをリッスンする必要があります。`view_submission` リクエストのリッスンには、組み込みの`view()` メソッドを利用することができます。`view()` の引数には、`str` 型または `re.Pattern` 型の `callback_id` を指定します。 +[モーダルのペイロード](/reference/interaction-payloads/view-interactions-payload/#view_submission)に `input` ブロックを含める場合、その入力値を受け取るために`view_submission` リクエストをリッスンする必要があります。`view_submission` リクエストのリッスンには、組み込みの`view()` メソッドを利用することができます。`view()` の引数には、`str` 型または `re.Pattern` 型の `callback_id` を指定します。 `input` ブロックの値にアクセスするには `state` オブジェクトを参照します。`state` 内には `values` というオブジェクトがあり、`block_id` と一意の `action_id` に紐づける形で入力値を保持しています。 @@ -19,9 +19,9 @@ def handle_submission(ack, body): # https://app.slack.com/block-kit-builder/#%7B%22type%22:%22modal%22,%22callback_id%22:%22view_1%22,%22title%22:%7B%22type%22:%22plain_text%22,%22text%22:%22My%20App%22,%22emoji%22:true%7D,%22blocks%22:%5B%5D%7D ack(response_action="update", view=build_new_view(body)) ``` -この例と同様に、モーダルでの送信リクエストに対して、エラーを表示するためのオプションもあります。 +この例と同様に、モーダルでの送信リクエストに対して、[エラーを表示する](/surfaces/modals#displaying_errors)ためのオプションもあります。 -モーダルの送信について詳しくは、API ドキュメントを参照してください。 +モーダルの送信について詳しくは、[API ドキュメント](/surfaces/modals#interactions)を参照してください。 --- @@ -29,7 +29,7 @@ def handle_submission(ack, body): `view_closed` リクエストをリッスンするためには `callback_id` を指定して、かつ `notify_on_close` 属性をモーダルのビューに設定する必要があります。以下のコード例をご覧ください。 -よく詳しい情報は、API ドキュメントを参照してください。 +よく詳しい情報は、[API ドキュメント](/surfaces/modals#interactions)を参照してください。 ```python client.views_open( @@ -56,7 +56,7 @@ def handle_view_closed(ack, body, logger): logger.info(body) ``` -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧は[モジュールドキュメント](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html)を参考にしてください。 ```python # view_submission リクエストを処理 diff --git a/docs/japanese/concepts/web-api.md b/docs/japanese/concepts/web-api.md index 7a674b9b2..abb8e4121 100644 --- a/docs/japanese/concepts/web-api.md +++ b/docs/japanese/concepts/web-api.md @@ -4,7 +4,7 @@ Bolt の初期化に使用するトークンは `context` オブジェクトに設定されます。このトークンは、多くの Web API メソッドを呼び出す際に必要となります。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください。 +指定可能な引数の一覧は[モジュールドキュメント](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html)を参考にしてください。 ```python @app.message("wake me up") def say_hello(client, message): diff --git a/docs/japanese/getting-started.md b/docs/japanese/getting-started.md index 30538bf94..41e6ae5cd 100644 --- a/docs/japanese/getting-started.md +++ b/docs/japanese/getting-started.md @@ -48,7 +48,7 @@ Slack アプリで使用できるトークンには、ユーザートークン 6. 左サイドメニューの「**Socket Mode**」を有効にします。 -:::tip[トークンはパスワードと同様に取り扱い、[安全な方法で保管してください](/authentication/best-practices-for-security)。アプリはこのトークンを使って Slack ワークスペースで投稿をしたり、情報の取得をしたりします。] +:::tip[トークンはパスワードと同様に取り扱い、[安全な方法で保管してください](/security)。アプリはこのトークンを使って Slack ワークスペースで投稿をしたり、情報の取得をしたりします。] ::: @@ -91,7 +91,7 @@ export SLACK_APP_TOKEN=<アプリレベルトークン> ``` :::warning[🔒 全てのトークンは安全に保管してください。] -少なくともパブリックなバージョン管理にチェックインするようなことは避けるべきでしょう。また、上にあった例のように環境変数を介してアクセスするようにしてください。詳細な情報は [アプリのセキュリティのベストプラクティス](/authentication/best-practices-for-security)のドキュメントを参照してください。 +少なくともパブリックなバージョン管理にチェックインするようなことは避けるべきでしょう。また、上にあった例のように環境変数を介してアクセスするようにしてください。詳細な情報は [アプリのセキュリティのベストプラクティス](/security)のドキュメントを参照してください。 ::: diff --git a/docs/japanese/legacy/steps-from-apps.md b/docs/japanese/legacy/steps-from-apps.md index a7ef2e04a..802802ab3 100644 --- a/docs/japanese/legacy/steps-from-apps.md +++ b/docs/japanese/legacy/steps-from-apps.md @@ -10,8 +10,6 @@ ワークフローステップを機能させるためには、これら 3 つのイベントすべてに対応する必要があります。 -アプリを使ったワークフローステップに関する詳細は、[API ドキュメント](/legacy/legacy-steps-from-apps/)を参照してください。 - ## ステップの定義 ワークフローステップの作成には、Bolt が提供する `WorkflowStep` クラスを利用します。 @@ -24,7 +22,7 @@ また、デコレーターとして利用できる `WorkflowStepBuilder` クラスを使ってワークフローステップを定義することもできます。 詳細は、[こちらのドキュメント](https://docs.slack.dev/tools/bolt-python/reference/workflows/step/step.html#slack_bolt.workflows.step.step.WorkflowStepBuilder)のコード例などを参考にしてください。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください(共通 / ステップ用 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください([共通](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) / [ステップ用](https://docs.slack.dev/tools/bolt-python/reference/workflows/step/utilities/index.html)) ```python import os @@ -59,15 +57,13 @@ app.step(ws) ## ステップの追加・編集 -作成したワークフローステップがワークフローに追加またはその設定を変更されるタイミングで、[`workflow_step_edit` イベントがアプリに送信されます](/legacy/legacy-steps-from-apps/legacy-steps-from-apps-workflow_step_edit-payload)。このイベントがアプリに届くと、`WorkflowStep` で設定した `edit` コールバックが実行されます。 +作成したワークフローステップがワークフローに追加またはその設定を変更されるタイミングで、`workflow_step_edit` イベントがアプリに送信されます。このイベントがアプリに届くと、`WorkflowStep` で設定した `edit` コールバックが実行されます。 -ステップの追加と編集のどちらが行われるときも、[ワークフローステップの設定モーダル](/legacy/legacy-steps-from-apps/legacy-steps-from-apps-configuration-view-object)をビルダーに送信する必要があります。このモーダルは、そのステップ独自の設定を選択するための場所です。通常のモーダルより制限が強く、例えば `title`、`submit`、`close` のプロパティを含めることができません。設定モーダルの `callback_id` は、デフォルトではワークフローステップと同じものになります。 +ステップの追加と編集のどちらが行われるときも、ワークフローステップの設定モーダルをビルダーに送信する必要があります。このモーダルは、そのステップ独自の設定を選択するための場所です。通常のモーダルより制限が強く、例えば `title`、`submit`、`close` のプロパティを含めることができません。設定モーダルの `callback_id` は、デフォルトではワークフローステップと同じものになります。 `edit` コールバック内で `configure()` ユーティリティを使用すると、対応する `blocks` 引数にビューのblocks 部分だけを渡して、ステップの設定モーダルを簡単に表示させることができます。必要な入力内容が揃うまで設定の保存を無効にするには、`True` の値をセットした `submit_disabled` を渡します。 -設定モーダルの開き方に関する詳細は、[こちらのドキュメント](/legacy/legacy-steps-from-apps/legacy-steps-from-apps-configuration-view-object)を参照してください。 - -指定可能な引数の一覧はモジュールドキュメントを参考にしてください(共通 / ステップ用 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください([共通](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) / [ステップ用](https://docs.slack.dev/tools/bolt-python/reference/workflows/step/utilities/index.html)) ```python def edit(ack, step, configure): @@ -117,9 +113,7 @@ app.step(ws) - `step_name` : ステップのデフォルトの名前をオーバーライドします。 - `step_image_url` : ステップのデフォルトの画像をオーバーライドします。 -これらのパラメータの構成方法に関する詳細は、[こちらのドキュメント](/legacy/legacy-steps-from-apps/legacy-steps-from-apps-workflow_step-object)を参照してください。 - -指定可能な引数の一覧はモジュールドキュメントを参考にしてください(共通 / ステップ用 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください([共通](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) / [ステップ用](https://docs.slack.dev/tools/bolt-python/reference/workflows/step/utilities/index.html)) ```python def save(ack, view, update): @@ -158,13 +152,14 @@ app.step(ws) ## ステップの実行 -エンドユーザーがワークフローステップを実行すると、アプリに [`workflow_step_execute` イベントが送信されます](/legacy/legacy-steps-from-apps/legacy-steps-from-apps-workflow_step-object)。このイベントがアプリに届くと、`WorkflowStep` で設定した `execute` コールバックが実行されます。 +エンドユーザーがワークフローステップを実行すると、アプリに `workflow_step_execute` イベントが送信されます。このイベントがアプリに届くと、`WorkflowStep` で設定した `execute` コールバックが実行されます。 `save` コールバックで取り出した `inputs` を使って、サードパーティの API を呼び出す、情報をデータベースに保存する、ユーザーのホームタブを更新するといった処理を実行することができます。また、ワークフローの後続のステップで利用する出力値を `outputs` オブジェクトに設定します。 `execute` コールバック内では、`complete()` を呼び出してステップの実行が成功したことを示すか、`fail()` を呼び出してステップの実行が失敗したことを示す必要があります。 -指定可能な引数の一覧はモジュールドキュメントを参考にしてください(共通 / ステップ用 +指定可能な引数の一覧はモジュールドキュメントを参考にしてください([共通](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) / [ステップ用](https://docs.slack.dev/tools/bolt-python/reference/workflows/step/utilities/index.html)) + ```python def execute(step, complete, fail): inputs = step["inputs"] From 64e09c5e303af06b1c5643b14b459b9794f21756 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Jan 2026 08:41:42 -0800 Subject: [PATCH 679/719] chore(deps): bump actions/checkout from 6.0.0 to 6.0.1 (#1420) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codecov.yml | 2 +- .github/workflows/flake8.yml | 2 +- .github/workflows/mypy.yml | 2 +- .github/workflows/pypi-release.yml | 2 +- .github/workflows/tests.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index f93864817..3340efe8c 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -18,7 +18,7 @@ jobs: env: BOLT_PYTHON_CODECOV_RUNNING: "1" steps: - - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index b0602d60a..8305fe645 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -16,7 +16,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 650c8f9bd..353bad38b 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -16,7 +16,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 80fac6d8c..9afa946aa 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -18,7 +18,7 @@ jobs: contents: read steps: - - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: ref: ${{ github.event.release.tag_name || github.ref }} persist-credentials: false diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6de00d7da..0f4f0c4b9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,7 +28,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} From 7d95b8ebeffa3e9ebee8890302aba7f0d5e68520 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Jan 2026 16:48:16 +0000 Subject: [PATCH 680/719] chore(deps): bump actions/stale from 10.1.0 to 10.1.1 (#1419) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: William Bergamin --- .github/workflows/triage-issues.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/triage-issues.yml b/.github/workflows/triage-issues.yml index 85ccb72aa..cf13d3afc 100644 --- a/.github/workflows/triage-issues.yml +++ b/.github/workflows/triage-issues.yml @@ -16,7 +16,7 @@ jobs: issues: write pull-requests: write steps: - - uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0 + - uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10.1.1 with: days-before-issue-stale: 30 days-before-issue-close: 10 From a1aa7139c4126ab3fbc23eba5f8f900ae73ecffd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Jan 2026 16:54:36 +0000 Subject: [PATCH 681/719] chore(deps): bump mypy from 1.19.0 to 1.19.1 (#1418) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: William Bergamin --- requirements/tools.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/tools.txt b/requirements/tools.txt index f9fbcdac1..7609eb52e 100644 --- a/requirements/tools.txt +++ b/requirements/tools.txt @@ -1,3 +1,3 @@ -mypy==1.19.0 +mypy==1.19.1 flake8==7.3.0 black==25.1.0 From 252bf23b05cf82a515aa6dbad28b0cd0d5000f4c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Jan 2026 16:46:03 +0000 Subject: [PATCH 682/719] chore(deps): bump codecov/codecov-action from 5.5.1 to 5.5.2 (#1417) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codecov.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 3340efe8c..4485c27ae 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -36,7 +36,7 @@ jobs: run: | pytest --cov=./slack_bolt/ --cov-report=xml - name: Upload coverage to Codecov - uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 + uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 with: fail_ci_if_error: true report_type: coverage diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0f4f0c4b9..3ba2a17f2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -77,7 +77,7 @@ jobs: pytest tests/scenario_tests_async/ --junitxml=reports/test_scenario_async.xml - name: Upload test results to Codecov if: ${{ !cancelled() }} - uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 + uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 with: directory: ./reports/ fail_ci_if_error: true From 13e4a8e44b50b9a80072f4bb232136c9bc8fd7cb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Jan 2026 16:50:08 +0000 Subject: [PATCH 683/719] chore(deps): bump actions/download-artifact from 6.0.0 to 7.0.0 (#1416) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/pypi-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 9afa946aa..7f97da9ed 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -52,7 +52,7 @@ jobs: steps: - name: Retrieve dist folder - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: name: release-dist path: dist/ @@ -76,7 +76,7 @@ jobs: steps: - name: Retrieve dist folder - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: name: release-dist path: dist/ From c8511da19b6d7bcd4e733ac1e50bf244e02247ce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Jan 2026 16:54:30 +0000 Subject: [PATCH 684/719] chore(deps): bump actions/upload-artifact from 5.0.0 to 6.0.0 (#1415) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/pypi-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 7f97da9ed..89a18c827 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -33,7 +33,7 @@ jobs: scripts/build_pypi_package.sh - name: Persist dist folder - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: release-dist path: dist/ From 69181155b266e88331f9e0d17844a2ccf37265be Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Thu, 15 Jan 2026 06:57:13 -0800 Subject: [PATCH 685/719] chore: update the ci pipeline to match other patterns (#1422) --- .github/workflows/{tests.yml => ci-build.yml} | 82 ++++++++++++++++++- .github/workflows/codecov.yml | 44 ---------- .github/workflows/flake8.yml | 28 ------- .github/workflows/mypy.yml | 28 ------- scripts/format.sh | 7 +- scripts/install_all_and_run_tests.sh | 27 +++--- scripts/lint.sh | 12 +++ scripts/run_flake8.sh | 7 -- scripts/run_mypy.sh | 15 ++-- scripts/run_tests.sh | 8 +- 10 files changed, 121 insertions(+), 137 deletions(-) rename .github/workflows/{tests.yml => ci-build.yml} (60%) delete mode 100644 .github/workflows/codecov.yml delete mode 100644 .github/workflows/flake8.yml delete mode 100644 .github/workflows/mypy.yml create mode 100755 scripts/lint.sh delete mode 100755 scripts/run_flake8.sh diff --git a/.github/workflows/tests.yml b/.github/workflows/ci-build.yml similarity index 60% rename from .github/workflows/tests.yml rename to .github/workflows/ci-build.yml index 3ba2a17f2..a11fa10d7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/ci-build.yml @@ -1,4 +1,4 @@ -name: Run all the unit tests +name: Python CI on: push: @@ -9,8 +9,46 @@ on: - cron: "0 0 * * *" workflow_dispatch: +env: + LATEST_SUPPORTED_PY: "3.14" + jobs: - build: + lint: + name: Lint + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: + contents: read + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + persist-credentials: false + - name: Set up Python ${{ env.LATEST_SUPPORTED_PY }} + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + with: + python-version: ${{ env.LATEST_SUPPORTED_PY }} + - name: Run lint verification + run: ./scripts/lint.sh + + typecheck: + name: Typecheck + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: + contents: read + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + persist-credentials: false + - name: Set up Python ${{ env.LATEST_SUPPORTED_PY }} + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + with: + python-version: ${{ env.LATEST_SUPPORTED_PY }} + - name: Run mypy verification + run: ./scripts/run_mypy.sh + + unittest: + name: Unit tests runs-on: ubuntu-22.04 timeout-minutes: 10 strategy: @@ -85,10 +123,48 @@ jobs: report_type: test_results token: ${{ secrets.CODECOV_TOKEN }} verbose: true + + codecov: + name: Code Coverage + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: read + env: + BOLT_PYTHON_CODECOV_RUNNING: "1" + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + persist-credentials: false + - name: Set up Python ${{ env.LATEST_SUPPORTED_PY }} + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + with: + python-version: ${{ env.LATEST_SUPPORTED_PY }} + - name: Install dependencies + run: | + pip install -U pip + pip install . + pip install -r requirements/adapter.txt + pip install -r requirements/testing.txt + pip install -r requirements/adapter_testing.txt + - name: Run all tests for codecov + run: | + pytest --cov=./slack_bolt/ --cov-report=xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 + with: + fail_ci_if_error: true + report_type: coverage + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true + notifications: name: Regression notifications runs-on: ubuntu-latest - needs: build + needs: + - lint + - typecheck + - unittest if: ${{ !success() && github.ref == 'refs/heads/main' && github.event_name != 'workflow_dispatch' }} steps: - name: Send notifications of failing tests diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index 4485c27ae..000000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Run codecov - -on: - push: - branches: - - main - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - timeout-minutes: 10 - strategy: - matrix: - python-version: ["3.14"] - permissions: - contents: read - env: - BOLT_PYTHON_CODECOV_RUNNING: "1" - steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - pip install -U pip - pip install . - pip install -r requirements/adapter.txt - pip install -r requirements/testing.txt - pip install -r requirements/adapter_testing.txt - - name: Run all tests for codecov - run: | - pytest --cov=./slack_bolt/ --cov-report=xml - - name: Upload coverage to Codecov - uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 - with: - fail_ci_if_error: true - report_type: coverage - token: ${{ secrets.CODECOV_TOKEN }} - verbose: true diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml deleted file mode 100644 index 8305fe645..000000000 --- a/.github/workflows/flake8.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Run flake8 validation - -on: - push: - branches: - - main - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - timeout-minutes: 20 - strategy: - matrix: - python-version: ["3.14"] - permissions: - contents: read - steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 - with: - python-version: ${{ matrix.python-version }} - - name: Run flake8 verification - run: | - ./scripts/run_flake8.sh diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml deleted file mode 100644 index 353bad38b..000000000 --- a/.github/workflows/mypy.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Run mypy validation - -on: - push: - branches: - - main - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - timeout-minutes: 20 - strategy: - matrix: - python-version: ["3.14"] - permissions: - contents: read - steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 - with: - python-version: ${{ matrix.python-version }} - - name: Run mypy verification - run: | - ./scripts/run_mypy.sh diff --git a/scripts/format.sh b/scripts/format.sh index 77cecf9e4..e73bcdac4 100755 --- a/scripts/format.sh +++ b/scripts/format.sh @@ -4,7 +4,10 @@ script_dir=`dirname $0` cd ${script_dir}/.. -pip install -U pip -pip install -U -r requirements/tools.txt +if [[ "$1" != "--no-install" ]]; then + export PIP_REQUIRE_VIRTUALENV=1 + pip install -U pip + pip install -U -r requirements/tools.txt +fi black slack_bolt/ tests/ diff --git a/scripts/install_all_and_run_tests.sh b/scripts/install_all_and_run_tests.sh index 1f2690414..2bb9a2050 100755 --- a/scripts/install_all_and_run_tests.sh +++ b/scripts/install_all_and_run_tests.sh @@ -16,25 +16,20 @@ pip uninstall python-lambda test_target="$1" pip install -U -e . +pip install -U -r requirements/testing.txt +pip install -U -r requirements/adapter.txt +pip install -U -r requirements/adapter_testing.txt +pip install -U -r requirements/tools.txt +# To avoid errors due to the old versions of click forced by Chalice +pip install -U pip click if [[ $test_target != "" ]] then - pip install -U -r requirements/testing.txt && \ - pip install -U -r requirements/adapter.txt && \ - pip install -U -r requirements/adapter_testing.txt && \ - # To avoid errors due to the old versions of click forced by Chalice - pip install -U pip click && \ - black slack_bolt/ tests/ && \ + ./scripts/format.sh --no-install pytest $1 else - pip install -U -r requirements/testing.txt && \ - pip install -U -r requirements/adapter.txt && \ - pip install -U -r requirements/adapter_testing.txt && \ - pip install -r requirements/tools.txt && \ - # To avoid errors due to the old versions of click forced by Chalice - pip install -U pip click && \ - black slack_bolt/ tests/ && \ - flake8 slack_bolt/ && flake8 examples/ - pytest && \ - mypy --config-file pyproject.toml + ./scripts/format.sh --no-install + ./scripts/lint.sh --no-install + pytest + ./scripts/run_mypy.sh --no-install fi diff --git a/scripts/lint.sh b/scripts/lint.sh new file mode 100755 index 000000000..efee01ebc --- /dev/null +++ b/scripts/lint.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# ./scripts/lint.sh + +script_dir=$(dirname $0) +cd ${script_dir}/.. + +if [[ "$1" != "--no-install" ]]; then + pip install -U pip + pip install -U -r requirements/tools.txt +fi + +flake8 slack_bolt/ && flake8 examples/ diff --git a/scripts/run_flake8.sh b/scripts/run_flake8.sh deleted file mode 100755 index e523920f9..000000000 --- a/scripts/run_flake8.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# ./scripts/run_flake8.sh - -script_dir=$(dirname $0) -cd ${script_dir}/.. && \ - pip install -U -r requirements/tools.txt && \ - flake8 slack_bolt/ && flake8 examples/ diff --git a/scripts/run_mypy.sh b/scripts/run_mypy.sh index c018443b7..27589b348 100755 --- a/scripts/run_mypy.sh +++ b/scripts/run_mypy.sh @@ -2,9 +2,14 @@ # ./scripts/run_mypy.sh script_dir=$(dirname $0) -cd ${script_dir}/.. && \ +cd ${script_dir}/.. + +if [[ "$1" != "--no-install" ]]; then + pip install -U pip pip install -U . - pip install -U -r requirements/async.txt && \ - pip install -U -r requirements/adapter.txt && \ - pip install -U -r requirements/tools.txt && \ - mypy --config-file pyproject.toml + pip install -U -r requirements/async.txt + pip install -U -r requirements/adapter.txt + pip install -U -r requirements/tools.txt +fi + +mypy --config-file pyproject.toml diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index e4cc99709..cdac3c71c 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -7,12 +7,12 @@ script_dir=`dirname $0` cd ${script_dir}/.. test_target="$1" -python_version=`python --version | awk '{print $2}'` + +./scripts/format.sh --no-install if [[ $test_target != "" ]] then - black slack_bolt/ tests/ && \ - pytest -vv $1 + pytest -vv $1 else - black slack_bolt/ tests/ && pytest + pytest fi From c3929dfd41adb47f303cb7e27120fdb8a2690e45 Mon Sep 17 00:00:00 2001 From: Michael Brooks Date: Tue, 3 Feb 2026 18:42:59 -0800 Subject: [PATCH 686/719] ci(deps): auto-approve / auto-merge dependencies from dependabot (#1434) --- .github/workflows/dependencies.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/dependencies.yml diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml new file mode 100644 index 000000000..824d57701 --- /dev/null +++ b/.github/workflows/dependencies.yml @@ -0,0 +1,29 @@ +name: Merge updates to dependencies +on: + pull_request: +jobs: + dependabot: + name: "@dependabot" + if: github.event.pull_request.user.login == 'dependabot[bot]' + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - name: Collect metadata + id: metadata + uses: dependabot/fetch-metadata@21025c705c08248db411dc16f3619e6b5f9ea21a # v2.5.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Approve + if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Automerge + if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' + run: gh pr merge --auto --squash "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From fbbaaa08f7d7c024302c1b916db3fc3742eaa35f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Feb 2026 16:53:59 +0000 Subject: [PATCH 687/719] chore(deps): bump actions/checkout from 6.0.1 to 6.0.2 (#1424) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Michael Brooks --- .github/workflows/ci-build.yml | 8 ++++---- .github/workflows/pypi-release.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index a11fa10d7..7c360b98d 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -20,7 +20,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Set up Python ${{ env.LATEST_SUPPORTED_PY }} @@ -37,7 +37,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Set up Python ${{ env.LATEST_SUPPORTED_PY }} @@ -66,7 +66,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} @@ -133,7 +133,7 @@ jobs: env: BOLT_PYTHON_CODECOV_RUNNING: "1" steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Set up Python ${{ env.LATEST_SUPPORTED_PY }} diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 89a18c827..a072d20b0 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -18,7 +18,7 @@ jobs: contents: read steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: ref: ${{ github.event.release.tag_name || github.ref }} persist-credentials: false From e5cf0f780760c443a7a5802a2d2c19fb4072c9aa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Feb 2026 17:02:23 +0000 Subject: [PATCH 688/719] chore(deps): bump actions/setup-python from 6.1.0 to 6.2.0 (#1425) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-build.yml | 8 ++++---- .github/workflows/pypi-release.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 7c360b98d..6555a6531 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -24,7 +24,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ env.LATEST_SUPPORTED_PY }} - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.LATEST_SUPPORTED_PY }} - name: Run lint verification @@ -41,7 +41,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ env.LATEST_SUPPORTED_PY }} - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.LATEST_SUPPORTED_PY }} - name: Run mypy verification @@ -70,7 +70,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ matrix.python-version }} - name: Install synchronous dependencies @@ -137,7 +137,7 @@ jobs: with: persist-credentials: false - name: Set up Python ${{ env.LATEST_SUPPORTED_PY }} - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.LATEST_SUPPORTED_PY }} - name: Install dependencies diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index a072d20b0..9c9003c92 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -24,7 +24,7 @@ jobs: persist-credentials: false - name: Set up Python - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: "3.x" From 868cedbce8164a5de5fdbe7db930f28ec6ac85c8 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Tue, 10 Feb 2026 16:43:35 -0800 Subject: [PATCH 689/719] fix: pin setuptools to maintain support for pyramid adapter (#1436) --- .github/dependabot.yml | 4 ++++ requirements/adapter.txt | 1 + 2 files changed, 5 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index dc523d227..774d13833 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,6 +8,10 @@ updates: schedule: interval: "monthly" open-pull-requests-limit: 5 + ignore: + # setuptools is pinned due to pyramid's dependency on deprecated pkg_resources + # See: https://github.com/Pylons/pyramid/issues/3731 + - dependency-name: "setuptools" - package-ecosystem: "github-actions" directory: "/" schedule: diff --git a/requirements/adapter.txt b/requirements/adapter.txt index b2097bcdb..c19c7713b 100644 --- a/requirements/adapter.txt +++ b/requirements/adapter.txt @@ -13,6 +13,7 @@ fastapi>=0.70.0,<1 Flask>=1,<4 Werkzeug>=2,<4 pyramid>=1,<3 +setuptools<82 # Pinned: Pyramid depends on pkg_resources (deprecated in setuptools 67.5.0, removed in 82+). See: https://github.com/Pylons/pyramid/issues/3731 # Sanic and its dependencies # Note: Sanic imports tracerite with wild card versions From 1ad642efded7629ac9b87988a84906783e765560 Mon Sep 17 00:00:00 2001 From: Michael Brooks Date: Sun, 15 Feb 2026 22:23:17 -0800 Subject: [PATCH 690/719] Add 'agent: BoltAgent' listener argument (#1437) Co-authored-by: Luke Russell Co-authored-by: William Bergamin --- .gitignore | 3 + docs/english/_sidebar.json | 5 + docs/english/experiments.md | 34 ++++ slack_bolt/__init__.py | 2 + slack_bolt/adapter/__init__.py | 3 +- slack_bolt/agent/__init__.py | 5 + slack_bolt/agent/agent.py | 73 ++++++++ slack_bolt/agent/async_agent.py | 70 ++++++++ slack_bolt/kwargs_injection/args.py | 5 + slack_bolt/kwargs_injection/async_args.py | 5 + slack_bolt/kwargs_injection/async_utils.py | 23 ++- slack_bolt/kwargs_injection/utils.py | 23 ++- slack_bolt/warning/__init__.py | 6 + tests/scenario_tests/test_events_agent.py | 162 +++++++++++++++++ .../scenario_tests_async/test_events_agent.py | 169 ++++++++++++++++++ tests/slack_bolt/agent/__init__.py | 0 tests/slack_bolt/agent/test_agent.py | 103 +++++++++++ tests/slack_bolt_async/agent/__init__.py | 0 .../agent/test_async_agent.py | 114 ++++++++++++ 19 files changed, 799 insertions(+), 6 deletions(-) create mode 100644 docs/english/experiments.md create mode 100644 slack_bolt/agent/__init__.py create mode 100644 slack_bolt/agent/agent.py create mode 100644 slack_bolt/agent/async_agent.py create mode 100644 slack_bolt/warning/__init__.py create mode 100644 tests/scenario_tests/test_events_agent.py create mode 100644 tests/scenario_tests_async/test_events_agent.py create mode 100644 tests/slack_bolt/agent/__init__.py create mode 100644 tests/slack_bolt/agent/test_agent.py create mode 100644 tests/slack_bolt_async/agent/__init__.py create mode 100644 tests/slack_bolt_async/agent/test_async_agent.py diff --git a/.gitignore b/.gitignore index 2549060e7..b28dfa9ed 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,9 @@ venv/ .venv* .env/ +# claude +.claude/*.local.json + # codecov / coverage .coverage cov_* diff --git a/docs/english/_sidebar.json b/docs/english/_sidebar.json index 859c4b52f..eab9d94f8 100644 --- a/docs/english/_sidebar.json +++ b/docs/english/_sidebar.json @@ -85,6 +85,11 @@ "tools/bolt-python/concepts/token-rotation" ] }, + { + "type": "category", + "label": "Experiments", + "items": ["tools/bolt-python/experiments"] + }, { "type": "category", "label": "Legacy", diff --git a/docs/english/experiments.md b/docs/english/experiments.md new file mode 100644 index 000000000..681c8cbc6 --- /dev/null +++ b/docs/english/experiments.md @@ -0,0 +1,34 @@ +# Experiments + +Bolt for Python includes experimental features still under active development. These features may be fleeting, may not be perfectly polished, and should be thought of as available for use "at your own risk." + +Experimental features are categorized as `semver:patch` until the experimental status is removed. + +We love feedback from our community, so we encourage you to explore and interact with the [GitHub repo](https://github.com/slackapi/bolt-python). Contributions, bug reports, and any feedback are all helpful; let us nurture the Slack CLI together to help make building Slack apps more pleasant for everyone. + +## Available experiments +* [Agent listener argument](#agent) + +## Agent listener argument {#agent} + +The `agent: BoltAgent` listener argument provides access to AI agent-related features. + +The `BoltAgent` and `AsyncBoltAgent` classes offer a `chat_stream()` method that comes pre-configured with event context defaults: `channel_id`, `thread_ts`, `team_id`, and `user_id` fields. + +The listener argument is wired into the Bolt `kwargs` injection system, so listeners can declare it as a parameter or access it via the `context.agent` property. + +### Example + +```python +from slack_bolt import BoltAgent + +@app.event("app_mention") +def handle_mention(agent: BoltAgent): + stream = agent.chat_stream() + stream.append(markdown_text="Hello!") + stream.stop() +``` + +### Limitations + +The `chat_stream()` method currently only works when the `thread_ts` field is available in the event context (DMs and threaded replies). Top-level channel messages do not have a `thread_ts` field, and the `ts` field is not yet provided to `BoltAgent`. \ No newline at end of file diff --git a/slack_bolt/__init__.py b/slack_bolt/__init__.py index 6331925f8..4e43252fd 100644 --- a/slack_bolt/__init__.py +++ b/slack_bolt/__init__.py @@ -21,6 +21,7 @@ from .response import BoltResponse # AI Agents & Assistants +from .agent import BoltAgent from .middleware.assistant.assistant import ( Assistant, ) @@ -46,6 +47,7 @@ "CustomListenerMatcher", "BoltRequest", "BoltResponse", + "BoltAgent", "Assistant", "AssistantThreadContext", "AssistantThreadContextStore", diff --git a/slack_bolt/adapter/__init__.py b/slack_bolt/adapter/__init__.py index f339226bc..9ca556e52 100644 --- a/slack_bolt/adapter/__init__.py +++ b/slack_bolt/adapter/__init__.py @@ -1,2 +1 @@ -"""Adapter modules for running Bolt apps along with Web frameworks or Socket Mode. -""" +"""Adapter modules for running Bolt apps along with Web frameworks or Socket Mode.""" diff --git a/slack_bolt/agent/__init__.py b/slack_bolt/agent/__init__.py new file mode 100644 index 000000000..4d751f27f --- /dev/null +++ b/slack_bolt/agent/__init__.py @@ -0,0 +1,5 @@ +from .agent import BoltAgent + +__all__ = [ + "BoltAgent", +] diff --git a/slack_bolt/agent/agent.py b/slack_bolt/agent/agent.py new file mode 100644 index 000000000..db1c78aa9 --- /dev/null +++ b/slack_bolt/agent/agent.py @@ -0,0 +1,73 @@ +from typing import Optional + +from slack_sdk import WebClient +from slack_sdk.web.chat_stream import ChatStream + + +class BoltAgent: + """Agent listener argument for building AI-powered Slack agents. + + Experimental: + This API is experimental and may change in future releases. + + FIXME: chat_stream() only works when thread_ts is available (DMs and threaded replies). + It does not work on channel messages because ts is not provided to BoltAgent yet. + + @app.event("app_mention") + def handle_mention(agent): + stream = agent.chat_stream() + stream.append(markdown_text="Hello!") + stream.stop() + """ + + def __init__( + self, + *, + client: WebClient, + channel_id: Optional[str] = None, + thread_ts: Optional[str] = None, + team_id: Optional[str] = None, + user_id: Optional[str] = None, + ): + self._client = client + self._channel_id = channel_id + self._thread_ts = thread_ts + self._team_id = team_id + self._user_id = user_id + + def chat_stream( + self, + *, + channel: Optional[str] = None, + thread_ts: Optional[str] = None, + recipient_team_id: Optional[str] = None, + recipient_user_id: Optional[str] = None, + **kwargs, + ) -> ChatStream: + """Creates a ChatStream with defaults from event context. + + Each call creates a new instance. Create multiple for parallel streams. + + Args: + channel: Channel ID. Defaults to the channel from the event context. + thread_ts: Thread timestamp. Defaults to the thread_ts from the event context. + recipient_team_id: Team ID of the recipient. Defaults to the team from the event context. + recipient_user_id: User ID of the recipient. Defaults to the user from the event context. + **kwargs: Additional arguments passed to ``WebClient.chat_stream()``. + + Returns: + A new ``ChatStream`` instance. + """ + provided = [arg for arg in (channel, thread_ts, recipient_team_id, recipient_user_id) if arg is not None] + if provided and len(provided) < 4: + raise ValueError( + "Either provide all of channel, thread_ts, recipient_team_id, and recipient_user_id, or none of them" + ) + # Argument validation is delegated to chat_stream() and the API + return self._client.chat_stream( + channel=channel or self._channel_id, # type: ignore[arg-type] + thread_ts=thread_ts or self._thread_ts, # type: ignore[arg-type] + recipient_team_id=recipient_team_id or self._team_id, + recipient_user_id=recipient_user_id or self._user_id, + **kwargs, + ) diff --git a/slack_bolt/agent/async_agent.py b/slack_bolt/agent/async_agent.py new file mode 100644 index 000000000..2ee15aa2e --- /dev/null +++ b/slack_bolt/agent/async_agent.py @@ -0,0 +1,70 @@ +from typing import Optional + +from slack_sdk.web.async_client import AsyncWebClient +from slack_sdk.web.async_chat_stream import AsyncChatStream + + +class AsyncBoltAgent: + """Async agent listener argument for building AI-powered Slack agents. + + Experimental: + This API is experimental and may change in future releases. + + @app.event("app_mention") + async def handle_mention(agent): + stream = await agent.chat_stream() + await stream.append(markdown_text="Hello!") + await stream.stop() + """ + + def __init__( + self, + *, + client: AsyncWebClient, + channel_id: Optional[str] = None, + thread_ts: Optional[str] = None, + team_id: Optional[str] = None, + user_id: Optional[str] = None, + ): + self._client = client + self._channel_id = channel_id + self._thread_ts = thread_ts + self._team_id = team_id + self._user_id = user_id + + async def chat_stream( + self, + *, + channel: Optional[str] = None, + thread_ts: Optional[str] = None, + recipient_team_id: Optional[str] = None, + recipient_user_id: Optional[str] = None, + **kwargs, + ) -> AsyncChatStream: + """Creates an AsyncChatStream with defaults from event context. + + Each call creates a new instance. Create multiple for parallel streams. + + Args: + channel: Channel ID. Defaults to the channel from the event context. + thread_ts: Thread timestamp. Defaults to the thread_ts from the event context. + recipient_team_id: Team ID of the recipient. Defaults to the team from the event context. + recipient_user_id: User ID of the recipient. Defaults to the user from the event context. + **kwargs: Additional arguments passed to ``AsyncWebClient.chat_stream()``. + + Returns: + A new ``AsyncChatStream`` instance. + """ + provided = [arg for arg in (channel, thread_ts, recipient_team_id, recipient_user_id) if arg is not None] + if provided and len(provided) < 4: + raise ValueError( + "Either provide all of channel, thread_ts, recipient_team_id, and recipient_user_id, or none of them" + ) + # Argument validation is delegated to chat_stream() and the API + return await self._client.chat_stream( + channel=channel or self._channel_id, # type: ignore[arg-type] + thread_ts=thread_ts or self._thread_ts, # type: ignore[arg-type] + recipient_team_id=recipient_team_id or self._team_id, + recipient_user_id=recipient_user_id or self._user_id, + **kwargs, + ) diff --git a/slack_bolt/kwargs_injection/args.py b/slack_bolt/kwargs_injection/args.py index 1a0ec3ca8..113e39c08 100644 --- a/slack_bolt/kwargs_injection/args.py +++ b/slack_bolt/kwargs_injection/args.py @@ -8,6 +8,7 @@ from slack_bolt.context.fail import Fail from slack_bolt.context.get_thread_context.get_thread_context import GetThreadContext from slack_bolt.context.respond import Respond +from slack_bolt.agent.agent import BoltAgent from slack_bolt.context.save_thread_context import SaveThreadContext from slack_bolt.context.say import Say from slack_bolt.context.set_status import SetStatus @@ -102,6 +103,8 @@ def handle_buttons(args): """`get_thread_context()` utility function for AI Agents & Assistants""" save_thread_context: Optional[SaveThreadContext] """`save_thread_context()` utility function for AI Agents & Assistants""" + agent: Optional[BoltAgent] + """`agent` listener argument for AI Agents & Assistants""" # middleware next: Callable[[], None] """`next()` utility function, which tells the middleware chain that it can continue with the next one""" @@ -135,6 +138,7 @@ def __init__( set_suggested_prompts: Optional[SetSuggestedPrompts] = None, get_thread_context: Optional[GetThreadContext] = None, save_thread_context: Optional[SaveThreadContext] = None, + agent: Optional[BoltAgent] = None, # As this method is not supposed to be invoked by bolt-python users, # the naming conflict with the built-in one affects # only the internals of this method @@ -168,6 +172,7 @@ def __init__( self.set_suggested_prompts = set_suggested_prompts self.get_thread_context = get_thread_context self.save_thread_context = save_thread_context + self.agent = agent self.next: Callable[[], None] = next self.next_: Callable[[], None] = next diff --git a/slack_bolt/kwargs_injection/async_args.py b/slack_bolt/kwargs_injection/async_args.py index 4953f2167..1f1dde024 100644 --- a/slack_bolt/kwargs_injection/async_args.py +++ b/slack_bolt/kwargs_injection/async_args.py @@ -1,6 +1,7 @@ from logging import Logger from typing import Callable, Awaitable, Dict, Any, Optional +from slack_bolt.agent.async_agent import AsyncBoltAgent from slack_bolt.context.ack.async_ack import AsyncAck from slack_bolt.context.async_context import AsyncBoltContext from slack_bolt.context.complete.async_complete import AsyncComplete @@ -101,6 +102,8 @@ async def handle_buttons(args): """`get_thread_context()` utility function for AI Agents & Assistants""" save_thread_context: Optional[AsyncSaveThreadContext] """`save_thread_context()` utility function for AI Agents & Assistants""" + agent: Optional[AsyncBoltAgent] + """`agent` listener argument for AI Agents & Assistants""" # middleware next: Callable[[], Awaitable[None]] """`next()` utility function, which tells the middleware chain that it can continue with the next one""" @@ -134,6 +137,7 @@ def __init__( set_suggested_prompts: Optional[AsyncSetSuggestedPrompts] = None, get_thread_context: Optional[AsyncGetThreadContext] = None, save_thread_context: Optional[AsyncSaveThreadContext] = None, + agent: Optional[AsyncBoltAgent] = None, next: Callable[[], Awaitable[None]], **kwargs, # noqa ): @@ -164,6 +168,7 @@ def __init__( self.set_suggested_prompts = set_suggested_prompts self.get_thread_context = get_thread_context self.save_thread_context = save_thread_context + self.agent = agent self.next: Callable[[], Awaitable[None]] = next self.next_: Callable[[], Awaitable[None]] = next diff --git a/slack_bolt/kwargs_injection/async_utils.py b/slack_bolt/kwargs_injection/async_utils.py index c8870c3cc..e43cd0c27 100644 --- a/slack_bolt/kwargs_injection/async_utils.py +++ b/slack_bolt/kwargs_injection/async_utils.py @@ -1,9 +1,11 @@ import inspect import logging +import warnings from typing import Callable, Dict, MutableSequence, Optional, Any from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse +from slack_bolt.warning import ExperimentalWarning from .async_args import AsyncArgs from slack_bolt.request.payload_utils import ( to_options, @@ -29,7 +31,7 @@ def build_async_required_kwargs( error: Optional[Exception] = None, # for error handlers next_keys_required: bool = True, # False for listeners / middleware / error handlers ) -> Dict[str, Any]: - all_available_args = { + all_available_args: Dict[str, Any] = { "logger": logger, "client": request.context.client, "req": request, @@ -83,6 +85,23 @@ def build_async_required_kwargs( if k not in all_available_args: all_available_args[k] = v + # Defer agent creation to avoid constructing AsyncBoltAgent on every request + if "agent" in required_arg_names: + from slack_bolt.agent.async_agent import AsyncBoltAgent + + all_available_args["agent"] = AsyncBoltAgent( + client=request.context.client, + channel_id=request.context.channel_id, + thread_ts=request.context.thread_ts, + team_id=request.context.team_id, + user_id=request.context.user_id, + ) + warnings.warn( + "The agent listener argument is experimental and may change in future versions.", + category=ExperimentalWarning, + stacklevel=2, # Point to the caller, not this internal helper + ) + if len(required_arg_names) > 0: # To support instance/class methods in a class for listeners/middleware, # check if the first argument is either self or cls @@ -102,7 +121,7 @@ def build_async_required_kwargs( for name in required_arg_names: if name == "args": if isinstance(request, AsyncBoltRequest): - kwargs[name] = AsyncArgs(**all_available_args) # type: ignore[arg-type] + kwargs[name] = AsyncArgs(**all_available_args) else: logger.warning(f"Unknown Request object type detected ({type(request)})") diff --git a/slack_bolt/kwargs_injection/utils.py b/slack_bolt/kwargs_injection/utils.py index c1909c67a..73fe99bba 100644 --- a/slack_bolt/kwargs_injection/utils.py +++ b/slack_bolt/kwargs_injection/utils.py @@ -1,9 +1,11 @@ import inspect import logging +import warnings from typing import Callable, Dict, MutableSequence, Optional, Any from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse +from slack_bolt.warning import ExperimentalWarning from .args import Args from slack_bolt.request.payload_utils import ( to_options, @@ -29,7 +31,7 @@ def build_required_kwargs( error: Optional[Exception] = None, # for error handlers next_keys_required: bool = True, # False for listeners / middleware / error handlers ) -> Dict[str, Any]: - all_available_args = { + all_available_args: Dict[str, Any] = { "logger": logger, "client": request.context.client, "req": request, @@ -82,6 +84,23 @@ def build_required_kwargs( if k not in all_available_args: all_available_args[k] = v + # Defer agent creation to avoid constructing BoltAgent on every request + if "agent" in required_arg_names: + from slack_bolt.agent.agent import BoltAgent + + all_available_args["agent"] = BoltAgent( + client=request.context.client, + channel_id=request.context.channel_id, + thread_ts=request.context.thread_ts, + team_id=request.context.team_id, + user_id=request.context.user_id, + ) + warnings.warn( + "The agent listener argument is experimental and may change in future versions.", + category=ExperimentalWarning, + stacklevel=2, # Point to the caller, not this internal helper + ) + if len(required_arg_names) > 0: # To support instance/class methods in a class for listeners/middleware, # check if the first argument is either self or cls @@ -101,7 +120,7 @@ def build_required_kwargs( for name in required_arg_names: if name == "args": if isinstance(request, BoltRequest): - kwargs[name] = Args(**all_available_args) # type: ignore[arg-type] + kwargs[name] = Args(**all_available_args) else: logger.warning(f"Unknown Request object type detected ({type(request)})") diff --git a/slack_bolt/warning/__init__.py b/slack_bolt/warning/__init__.py new file mode 100644 index 000000000..df71b812f --- /dev/null +++ b/slack_bolt/warning/__init__.py @@ -0,0 +1,6 @@ +"""Bolt specific warning types.""" + + +class ExperimentalWarning(FutureWarning): + """Warning for features that are still in experimental phase.""" + pass diff --git a/tests/scenario_tests/test_events_agent.py b/tests/scenario_tests/test_events_agent.py new file mode 100644 index 000000000..667739728 --- /dev/null +++ b/tests/scenario_tests/test_events_agent.py @@ -0,0 +1,162 @@ +import json +from time import sleep + +import pytest +from slack_sdk.web import WebClient + +from slack_bolt import App, BoltRequest, BoltContext, BoltAgent +from slack_bolt.agent.agent import BoltAgent as BoltAgentDirect +from slack_bolt.warning import ExperimentalWarning +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestEventsAgent: + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def test_agent_injected_for_app_mention(self): + app = App(client=self.web_client) + + state = {"called": False} + + def assert_target_called(): + count = 0 + while state["called"] is False and count < 20: + sleep(0.1) + count += 1 + assert state["called"] is True + state["called"] = False + + @app.event("app_mention") + def handle_mention(agent: BoltAgent, context: BoltContext): + assert agent is not None + assert isinstance(agent, BoltAgentDirect) + assert context.channel_id == "C111" + state["called"] = True + + request = BoltRequest(body=app_mention_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called() + + def test_agent_available_in_action_listener(self): + app = App(client=self.web_client) + + state = {"called": False} + + def assert_target_called(): + count = 0 + while state["called"] is False and count < 20: + sleep(0.1) + count += 1 + assert state["called"] is True + state["called"] = False + + @app.action("test_action") + def handle_action(ack, agent: BoltAgent): + ack() + assert agent is not None + assert isinstance(agent, BoltAgentDirect) + state["called"] = True + + request = BoltRequest(body=json.dumps(action_event_body), mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called() + + def test_agent_kwarg_emits_experimental_warning(self): + app = App(client=self.web_client) + + state = {"called": False} + + def assert_target_called(): + count = 0 + while state["called"] is False and count < 20: + sleep(0.1) + count += 1 + assert state["called"] is True + state["called"] = False + + @app.event("app_mention") + def handle_mention(agent: BoltAgent): + state["called"] = True + + request = BoltRequest(body=app_mention_event_body, mode="socket_mode") + with pytest.warns(ExperimentalWarning, match="agent listener argument is experimental"): + response = app.dispatch(request) + assert response.status == 200 + assert_target_called() + + +# ---- Test event bodies ---- + + +def build_payload(event: dict) -> dict: + return { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": event, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authorizations": [ + { + "enterprise_id": "E111", + "team_id": "T111", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + } + + +app_mention_event_body = build_payload( + { + "type": "app_mention", + "user": "W222", + "text": "<@W111> hello", + "ts": "1234567890.123456", + "channel": "C111", + "event_ts": "1234567890.123456", + } +) + +action_event_body = { + "type": "block_actions", + "user": {"id": "W222", "username": "test_user", "name": "test_user", "team_id": "T111"}, + "api_app_id": "A111", + "token": "verification_token", + "container": {"type": "message", "message_ts": "1234567890.123456", "channel_id": "C111", "is_ephemeral": False}, + "channel": {"id": "C111", "name": "test-channel"}, + "team": {"id": "T111", "domain": "test"}, + "enterprise": {"id": "E111", "name": "test"}, + "trigger_id": "111.222.xxx", + "actions": [ + { + "type": "button", + "block_id": "b", + "action_id": "test_action", + "text": {"type": "plain_text", "text": "Button"}, + "action_ts": "1234567890.123456", + } + ], +} diff --git a/tests/scenario_tests_async/test_events_agent.py b/tests/scenario_tests_async/test_events_agent.py new file mode 100644 index 000000000..1702cdb61 --- /dev/null +++ b/tests/scenario_tests_async/test_events_agent.py @@ -0,0 +1,169 @@ +import asyncio +import json + +import pytest +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.agent.async_agent import AsyncBoltAgent +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.context.async_context import AsyncBoltContext +from slack_bolt.request.async_request import AsyncBoltRequest +from slack_bolt.warning import ExperimentalWarning +from tests.mock_web_api_server import ( + cleanup_mock_web_api_server_async, + setup_mock_web_api_server_async, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestAsyncEventsAgent: + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): + old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) + try: + yield + finally: + cleanup_mock_web_api_server_async(self) + restore_os_env(old_os_env) + + @pytest.mark.asyncio + async def test_agent_injected_for_app_mention(self): + app = AsyncApp(client=self.web_client) + + state = {"called": False} + + async def assert_target_called(): + count = 0 + while state["called"] is False and count < 20: + await asyncio.sleep(0.1) + count += 1 + assert state["called"] is True + state["called"] = False + + @app.event("app_mention") + async def handle_mention(agent: AsyncBoltAgent, context: AsyncBoltContext): + assert agent is not None + assert isinstance(agent, AsyncBoltAgent) + assert context.channel_id == "C111" + state["called"] = True + + request = AsyncBoltRequest(body=app_mention_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called() + + @pytest.mark.asyncio + async def test_agent_available_in_action_listener(self): + app = AsyncApp(client=self.web_client) + + state = {"called": False} + + async def assert_target_called(): + count = 0 + while state["called"] is False and count < 20: + await asyncio.sleep(0.1) + count += 1 + assert state["called"] is True + state["called"] = False + + @app.action("test_action") + async def handle_action(ack, agent: AsyncBoltAgent): + await ack() + assert agent is not None + assert isinstance(agent, AsyncBoltAgent) + state["called"] = True + + request = AsyncBoltRequest(body=json.dumps(action_event_body), mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called() + + @pytest.mark.asyncio + async def test_agent_kwarg_emits_experimental_warning(self): + app = AsyncApp(client=self.web_client) + + state = {"called": False} + + async def assert_target_called(): + count = 0 + while state["called"] is False and count < 20: + await asyncio.sleep(0.1) + count += 1 + assert state["called"] is True + state["called"] = False + + @app.event("app_mention") + async def handle_mention(agent: AsyncBoltAgent): + state["called"] = True + + request = AsyncBoltRequest(body=app_mention_event_body, mode="socket_mode") + with pytest.warns(ExperimentalWarning, match="agent listener argument is experimental"): + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called() + + +# ---- Test event bodies ---- + + +def build_payload(event: dict) -> dict: + return { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": event, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1599616881, + "authorizations": [ + { + "enterprise_id": "E111", + "team_id": "T111", + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": False, + } + ], + } + + +app_mention_event_body = build_payload( + { + "type": "app_mention", + "user": "W222", + "text": "<@W111> hello", + "ts": "1234567890.123456", + "channel": "C111", + "event_ts": "1234567890.123456", + } +) + +action_event_body = { + "type": "block_actions", + "user": {"id": "W222", "username": "test_user", "name": "test_user", "team_id": "T111"}, + "api_app_id": "A111", + "token": "verification_token", + "container": {"type": "message", "message_ts": "1234567890.123456", "channel_id": "C111", "is_ephemeral": False}, + "channel": {"id": "C111", "name": "test-channel"}, + "team": {"id": "T111", "domain": "test"}, + "enterprise": {"id": "E111", "name": "test"}, + "trigger_id": "111.222.xxx", + "actions": [ + { + "type": "button", + "block_id": "b", + "action_id": "test_action", + "text": {"type": "plain_text", "text": "Button"}, + "action_ts": "1234567890.123456", + } + ], +} diff --git a/tests/slack_bolt/agent/__init__.py b/tests/slack_bolt/agent/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/slack_bolt/agent/test_agent.py b/tests/slack_bolt/agent/test_agent.py new file mode 100644 index 000000000..00e998379 --- /dev/null +++ b/tests/slack_bolt/agent/test_agent.py @@ -0,0 +1,103 @@ +from unittest.mock import MagicMock + +import pytest +from slack_sdk.web import WebClient +from slack_sdk.web.chat_stream import ChatStream + +from slack_bolt.agent.agent import BoltAgent + + +class TestBoltAgent: + def test_chat_stream_uses_context_defaults(self): + """BoltAgent.chat_stream() passes context defaults to WebClient.chat_stream().""" + client = MagicMock(spec=WebClient) + client.chat_stream.return_value = MagicMock(spec=ChatStream) + + agent = BoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + stream = agent.chat_stream() + + client.chat_stream.assert_called_once_with( + channel="C111", + thread_ts="1234567890.123456", + recipient_team_id="T111", + recipient_user_id="W222", + ) + assert stream is not None + + def test_chat_stream_overrides_context_defaults(self): + """Explicit kwargs to chat_stream() override context defaults.""" + client = MagicMock(spec=WebClient) + client.chat_stream.return_value = MagicMock(spec=ChatStream) + + agent = BoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + stream = agent.chat_stream( + channel="C999", + thread_ts="9999999999.999999", + recipient_team_id="T999", + recipient_user_id="U999", + ) + + client.chat_stream.assert_called_once_with( + channel="C999", + thread_ts="9999999999.999999", + recipient_team_id="T999", + recipient_user_id="U999", + ) + assert stream is not None + + def test_chat_stream_rejects_partial_overrides(self): + """Passing only some of the four context args raises ValueError.""" + client = MagicMock(spec=WebClient) + agent = BoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + with pytest.raises(ValueError, match="Either provide all of"): + agent.chat_stream(channel="C999") + + def test_chat_stream_passes_extra_kwargs(self): + """Extra kwargs are forwarded to WebClient.chat_stream().""" + client = MagicMock(spec=WebClient) + client.chat_stream.return_value = MagicMock(spec=ChatStream) + + agent = BoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + agent.chat_stream(buffer_size=512) + + client.chat_stream.assert_called_once_with( + channel="C111", + thread_ts="1234567890.123456", + recipient_team_id="T111", + recipient_user_id="W222", + buffer_size=512, + ) + + def test_import_from_slack_bolt(self): + from slack_bolt import BoltAgent as ImportedBoltAgent + + assert ImportedBoltAgent is BoltAgent + + def test_import_from_agent_module(self): + from slack_bolt.agent import BoltAgent as ImportedBoltAgent + + assert ImportedBoltAgent is BoltAgent diff --git a/tests/slack_bolt_async/agent/__init__.py b/tests/slack_bolt_async/agent/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/slack_bolt_async/agent/test_async_agent.py b/tests/slack_bolt_async/agent/test_async_agent.py new file mode 100644 index 000000000..02251fa4b --- /dev/null +++ b/tests/slack_bolt_async/agent/test_async_agent.py @@ -0,0 +1,114 @@ +from unittest.mock import MagicMock + +import pytest +from slack_sdk.web.async_client import AsyncWebClient +from slack_sdk.web.async_chat_stream import AsyncChatStream + +from slack_bolt.agent.async_agent import AsyncBoltAgent + + +def _make_async_chat_stream_mock(): + mock_stream = MagicMock(spec=AsyncChatStream) + call_tracker = MagicMock() + + async def fake_chat_stream(**kwargs): + call_tracker(**kwargs) + return mock_stream + + return fake_chat_stream, call_tracker, mock_stream + + +class TestAsyncBoltAgent: + @pytest.mark.asyncio + async def test_chat_stream_uses_context_defaults(self): + """AsyncBoltAgent.chat_stream() passes context defaults to AsyncWebClient.chat_stream().""" + client = MagicMock(spec=AsyncWebClient) + client.chat_stream, call_tracker, _ = _make_async_chat_stream_mock() + + agent = AsyncBoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + stream = await agent.chat_stream() + + call_tracker.assert_called_once_with( + channel="C111", + thread_ts="1234567890.123456", + recipient_team_id="T111", + recipient_user_id="W222", + ) + assert stream is not None + + @pytest.mark.asyncio + async def test_chat_stream_overrides_context_defaults(self): + """Explicit kwargs to chat_stream() override context defaults.""" + client = MagicMock(spec=AsyncWebClient) + client.chat_stream, call_tracker, _ = _make_async_chat_stream_mock() + + agent = AsyncBoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + stream = await agent.chat_stream( + channel="C999", + thread_ts="9999999999.999999", + recipient_team_id="T999", + recipient_user_id="U999", + ) + + call_tracker.assert_called_once_with( + channel="C999", + thread_ts="9999999999.999999", + recipient_team_id="T999", + recipient_user_id="U999", + ) + assert stream is not None + + @pytest.mark.asyncio + async def test_chat_stream_rejects_partial_overrides(self): + """Passing only some of the four context args raises ValueError.""" + client = MagicMock(spec=AsyncWebClient) + agent = AsyncBoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + with pytest.raises(ValueError, match="Either provide all of"): + await agent.chat_stream(channel="C999") + + @pytest.mark.asyncio + async def test_chat_stream_passes_extra_kwargs(self): + """Extra kwargs are forwarded to AsyncWebClient.chat_stream().""" + client = MagicMock(spec=AsyncWebClient) + client.chat_stream, call_tracker, _ = _make_async_chat_stream_mock() + + agent = AsyncBoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + await agent.chat_stream(buffer_size=512) + + call_tracker.assert_called_once_with( + channel="C111", + thread_ts="1234567890.123456", + recipient_team_id="T111", + recipient_user_id="W222", + buffer_size=512, + ) + + @pytest.mark.asyncio + async def test_import_from_agent_module(self): + from slack_bolt.agent.async_agent import AsyncBoltAgent as ImportedAsyncBoltAgent + + assert ImportedAsyncBoltAgent is AsyncBoltAgent From cd52d19b034fbf19ce5949194b336aefe1e48ccb Mon Sep 17 00:00:00 2001 From: Ale Mercado <104795114+srtaalej@users.noreply.github.com> Date: Tue, 17 Feb 2026 13:36:17 -0500 Subject: [PATCH 691/719] feat: add agent set status to BoltAgent (#1441) Co-authored-by: Eden Zimbelman --- slack_bolt/agent/agent.py | 32 ++++- slack_bolt/agent/async_agent.py | 33 ++++- tests/slack_bolt/agent/test_agent.py | 105 +++++++++++++++ .../agent/test_async_agent.py | 121 ++++++++++++++++++ 4 files changed, 288 insertions(+), 3 deletions(-) diff --git a/slack_bolt/agent/agent.py b/slack_bolt/agent/agent.py index db1c78aa9..3663b245b 100644 --- a/slack_bolt/agent/agent.py +++ b/slack_bolt/agent/agent.py @@ -1,6 +1,7 @@ -from typing import Optional +from typing import List, Optional from slack_sdk import WebClient +from slack_sdk.web import SlackResponse from slack_sdk.web.chat_stream import ChatStream @@ -71,3 +72,32 @@ def chat_stream( recipient_user_id=recipient_user_id or self._user_id, **kwargs, ) + + def set_status( + self, + *, + status: str, + loading_messages: Optional[List[str]] = None, + channel: Optional[str] = None, + thread_ts: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """Sets the status of an assistant thread. + + Args: + status: The status text to display. + loading_messages: Optional list of loading messages to cycle through. + channel: Channel ID. Defaults to the channel from the event context. + thread_ts: Thread timestamp. Defaults to the thread_ts from the event context. + **kwargs: Additional arguments passed to ``WebClient.assistant_threads_setStatus()``. + + Returns: + ``SlackResponse`` from the API call. + """ + return self._client.assistant_threads_setStatus( + channel_id=channel or self._channel_id, # type: ignore[arg-type] + thread_ts=thread_ts or self._thread_ts, # type: ignore[arg-type] + status=status, + loading_messages=loading_messages, + **kwargs, + ) diff --git a/slack_bolt/agent/async_agent.py b/slack_bolt/agent/async_agent.py index 2ee15aa2e..5b86533e6 100644 --- a/slack_bolt/agent/async_agent.py +++ b/slack_bolt/agent/async_agent.py @@ -1,6 +1,6 @@ -from typing import Optional +from typing import List, Optional -from slack_sdk.web.async_client import AsyncWebClient +from slack_sdk.web.async_client import AsyncSlackResponse, AsyncWebClient from slack_sdk.web.async_chat_stream import AsyncChatStream @@ -68,3 +68,32 @@ async def chat_stream( recipient_user_id=recipient_user_id or self._user_id, **kwargs, ) + + async def set_status( + self, + *, + status: str, + loading_messages: Optional[List[str]] = None, + channel: Optional[str] = None, + thread_ts: Optional[str] = None, + **kwargs, + ) -> AsyncSlackResponse: + """Sets the status of an assistant thread. + + Args: + status: The status text to display. + loading_messages: Optional list of loading messages to cycle through. + channel: Channel ID. Defaults to the channel from the event context. + thread_ts: Thread timestamp. Defaults to the thread_ts from the event context. + **kwargs: Additional arguments passed to ``AsyncWebClient.assistant_threads_setStatus()``. + + Returns: + ``AsyncSlackResponse`` from the API call. + """ + return await self._client.assistant_threads_setStatus( + channel_id=channel or self._channel_id, # type: ignore[arg-type] + thread_ts=thread_ts or self._thread_ts, # type: ignore[arg-type] + status=status, + loading_messages=loading_messages, + **kwargs, + ) diff --git a/tests/slack_bolt/agent/test_agent.py b/tests/slack_bolt/agent/test_agent.py index 00e998379..7dad481b0 100644 --- a/tests/slack_bolt/agent/test_agent.py +++ b/tests/slack_bolt/agent/test_agent.py @@ -92,6 +92,111 @@ def test_chat_stream_passes_extra_kwargs(self): buffer_size=512, ) + def test_set_status_uses_context_defaults(self): + """BoltAgent.set_status() passes context defaults to WebClient.assistant_threads_setStatus().""" + client = MagicMock(spec=WebClient) + client.assistant_threads_setStatus.return_value = MagicMock() + + agent = BoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + agent.set_status(status="Thinking...") + + client.assistant_threads_setStatus.assert_called_once_with( + channel_id="C111", + thread_ts="1234567890.123456", + status="Thinking...", + loading_messages=None, + ) + + def test_set_status_with_loading_messages(self): + """BoltAgent.set_status() forwards loading_messages.""" + client = MagicMock(spec=WebClient) + client.assistant_threads_setStatus.return_value = MagicMock() + + agent = BoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + agent.set_status( + status="Thinking...", + loading_messages=["Sitting...", "Waiting..."], + ) + + client.assistant_threads_setStatus.assert_called_once_with( + channel_id="C111", + thread_ts="1234567890.123456", + status="Thinking...", + loading_messages=["Sitting...", "Waiting..."], + ) + + def test_set_status_overrides_context_defaults(self): + """Explicit channel/thread_ts override context defaults.""" + client = MagicMock(spec=WebClient) + client.assistant_threads_setStatus.return_value = MagicMock() + + agent = BoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + agent.set_status( + status="Thinking...", + channel="C999", + thread_ts="9999999999.999999", + ) + + client.assistant_threads_setStatus.assert_called_once_with( + channel_id="C999", + thread_ts="9999999999.999999", + status="Thinking...", + loading_messages=None, + ) + + def test_set_status_passes_extra_kwargs(self): + """Extra kwargs are forwarded to WebClient.assistant_threads_setStatus().""" + client = MagicMock(spec=WebClient) + client.assistant_threads_setStatus.return_value = MagicMock() + + agent = BoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + agent.set_status(status="Thinking...", token="xoxb-override") + + client.assistant_threads_setStatus.assert_called_once_with( + channel_id="C111", + thread_ts="1234567890.123456", + status="Thinking...", + loading_messages=None, + token="xoxb-override", + ) + + def test_set_status_requires_status(self): + """set_status() raises TypeError when status is not provided.""" + client = MagicMock(spec=WebClient) + agent = BoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + with pytest.raises(TypeError): + agent.set_status() + def test_import_from_slack_bolt(self): from slack_bolt import BoltAgent as ImportedBoltAgent diff --git a/tests/slack_bolt_async/agent/test_async_agent.py b/tests/slack_bolt_async/agent/test_async_agent.py index 02251fa4b..8e4c4d5c8 100644 --- a/tests/slack_bolt_async/agent/test_async_agent.py +++ b/tests/slack_bolt_async/agent/test_async_agent.py @@ -18,6 +18,17 @@ async def fake_chat_stream(**kwargs): return fake_chat_stream, call_tracker, mock_stream +def _make_async_api_mock(): + mock_response = MagicMock() + call_tracker = MagicMock() + + async def fake_api_call(**kwargs): + call_tracker(**kwargs) + return mock_response + + return fake_api_call, call_tracker, mock_response + + class TestAsyncBoltAgent: @pytest.mark.asyncio async def test_chat_stream_uses_context_defaults(self): @@ -107,6 +118,116 @@ async def test_chat_stream_passes_extra_kwargs(self): buffer_size=512, ) + @pytest.mark.asyncio + async def test_set_status_uses_context_defaults(self): + """AsyncBoltAgent.set_status() passes context defaults to AsyncWebClient.assistant_threads_setStatus().""" + client = MagicMock(spec=AsyncWebClient) + client.assistant_threads_setStatus, call_tracker, _ = _make_async_api_mock() + + agent = AsyncBoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + await agent.set_status(status="Thinking...") + + call_tracker.assert_called_once_with( + channel_id="C111", + thread_ts="1234567890.123456", + status="Thinking...", + loading_messages=None, + ) + + @pytest.mark.asyncio + async def test_set_status_with_loading_messages(self): + """AsyncBoltAgent.set_status() forwards loading_messages.""" + client = MagicMock(spec=AsyncWebClient) + client.assistant_threads_setStatus, call_tracker, _ = _make_async_api_mock() + + agent = AsyncBoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + await agent.set_status( + status="Thinking...", + loading_messages=["Sitting...", "Waiting..."], + ) + + call_tracker.assert_called_once_with( + channel_id="C111", + thread_ts="1234567890.123456", + status="Thinking...", + loading_messages=["Sitting...", "Waiting..."], + ) + + @pytest.mark.asyncio + async def test_set_status_overrides_context_defaults(self): + """Explicit channel/thread_ts override context defaults.""" + client = MagicMock(spec=AsyncWebClient) + client.assistant_threads_setStatus, call_tracker, _ = _make_async_api_mock() + + agent = AsyncBoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + await agent.set_status( + status="Thinking...", + channel="C999", + thread_ts="9999999999.999999", + ) + + call_tracker.assert_called_once_with( + channel_id="C999", + thread_ts="9999999999.999999", + status="Thinking...", + loading_messages=None, + ) + + @pytest.mark.asyncio + async def test_set_status_passes_extra_kwargs(self): + """Extra kwargs are forwarded to AsyncWebClient.assistant_threads_setStatus().""" + client = MagicMock(spec=AsyncWebClient) + client.assistant_threads_setStatus, call_tracker, _ = _make_async_api_mock() + + agent = AsyncBoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + await agent.set_status(status="Thinking...", token="xoxb-override") + + call_tracker.assert_called_once_with( + channel_id="C111", + thread_ts="1234567890.123456", + status="Thinking...", + loading_messages=None, + token="xoxb-override", + ) + + @pytest.mark.asyncio + async def test_set_status_requires_status(self): + """set_status() raises TypeError when status is not provided.""" + client = MagicMock(spec=AsyncWebClient) + agent = AsyncBoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + with pytest.raises(TypeError): + await agent.set_status() + @pytest.mark.asyncio async def test_import_from_agent_module(self): from slack_bolt.agent.async_agent import AsyncBoltAgent as ImportedAsyncBoltAgent From 5cb618256c04ae53fe6a4cf1335a797a2395fee8 Mon Sep 17 00:00:00 2001 From: Haley Elmendorf <31392893+haleychaas@users.noreply.github.com> Date: Wed, 18 Feb 2026 10:49:43 -0600 Subject: [PATCH 692/719] Docs: Add headings so copy as markdown button shows up (#1443) --- docs/english/concepts/acknowledge.md | 3 +++ docs/english/concepts/adapters.md | 2 ++ docs/english/concepts/app-home.md | 3 +++ docs/english/concepts/authorization.md | 2 ++ docs/english/concepts/commands.md | 3 +++ docs/english/concepts/context.md | 2 ++ docs/english/concepts/custom-adapters.md | 2 ++ docs/english/concepts/errors.md | 2 ++ docs/english/concepts/global-middleware.md | 3 +++ docs/english/concepts/listener-middleware.md | 2 ++ docs/english/concepts/logging.md | 2 ++ docs/english/concepts/opening-modals.md | 2 ++ docs/english/concepts/select-menu-options.md | 3 +++ docs/english/concepts/web-api.md | 2 ++ 14 files changed, 33 insertions(+) diff --git a/docs/english/concepts/acknowledge.md b/docs/english/concepts/acknowledge.md index 7d91e0851..57b346bd3 100644 --- a/docs/english/concepts/acknowledge.md +++ b/docs/english/concepts/acknowledge.md @@ -11,6 +11,9 @@ We recommend calling `ack()` right away before initiating any time-consuming pro ::: Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. + +## Example + ```python # Example of responding to an external_select options request @app.options("menu_selection") diff --git a/docs/english/concepts/adapters.md b/docs/english/concepts/adapters.md index 321dae0ab..ad43a27da 100644 --- a/docs/english/concepts/adapters.md +++ b/docs/english/concepts/adapters.md @@ -8,6 +8,8 @@ To use an adapter, you'll create an app with the framework of your choosing and The full list adapters, as well as configuration and sample usage, can be found within the repository's [`examples`](https://github.com/slackapi/bolt-python/tree/main/examples) +## Example + ```python from slack_bolt import App app = App( diff --git a/docs/english/concepts/app-home.md b/docs/english/concepts/app-home.md index 8b0e2cf11..f4f15337f 100644 --- a/docs/english/concepts/app-home.md +++ b/docs/english/concepts/app-home.md @@ -5,6 +5,9 @@ You can subscribe to the [`app_home_opened`](/reference/events/app_home_opened) event to listen for when users open your App Home. Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. + +## Example + ```python @app.event("app_home_opened") def update_home_tab(client, event, logger): diff --git a/docs/english/concepts/authorization.md b/docs/english/concepts/authorization.md index 242a86b39..f6a258491 100644 --- a/docs/english/concepts/authorization.md +++ b/docs/english/concepts/authorization.md @@ -12,6 +12,8 @@ For a more custom solution, you can set the `authorize` parameter to a function - **`enterprise_id`** and **`team_id`**, which can be found in requests sent to your app. - **`user_id`** only when using `user_token`. +## Example + ```python import os from slack_bolt import App diff --git a/docs/english/concepts/commands.md b/docs/english/concepts/commands.md index 81167fb83..cd772c57b 100644 --- a/docs/english/concepts/commands.md +++ b/docs/english/concepts/commands.md @@ -9,6 +9,9 @@ There are two ways to respond to slash commands. The first way is to use `say()` When setting up commands within your app configuration, you'll append `/slack/events` to your request URL. Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. + +## Example + ```python # The echo command simply echoes on command @app.command("/echo") diff --git a/docs/english/concepts/context.md b/docs/english/concepts/context.md index fb134c896..46684ea28 100644 --- a/docs/english/concepts/context.md +++ b/docs/english/concepts/context.md @@ -4,6 +4,8 @@ All listeners have access to a `context` dictionary, which can be used to enrich `context` is just a dictionary, so you can directly modify it. +## Example + ```python # Listener middleware to fetch tasks from external system using user ID def fetch_tasks(context, event, next): diff --git a/docs/english/concepts/custom-adapters.md b/docs/english/concepts/custom-adapters.md index 62532e7cd..21f7f33e0 100644 --- a/docs/english/concepts/custom-adapters.md +++ b/docs/english/concepts/custom-adapters.md @@ -18,6 +18,8 @@ Your adapter will return [an instance of `BoltResponse`](https://github.com/slac For more in-depth examples of custom adapters, look at the implementations of the [built-in adapters](https://github.com/slackapi/bolt-python/tree/main/slack_bolt/adapter). +## Example + ```python # Necessary imports for Flask from flask import Request, Response, make_response diff --git a/docs/english/concepts/errors.md b/docs/english/concepts/errors.md index ed41c5816..7b40adb7f 100644 --- a/docs/english/concepts/errors.md +++ b/docs/english/concepts/errors.md @@ -4,6 +4,8 @@ If an error occurs in a listener, you can handle it directly using a try/except By default, the global error handler will log all non-handled exceptions to the console. To handle global errors yourself, you can attach a global error handler to your app using the `app.error(fn)` function. +## Example + ```python @app.error def custom_error_handler(error, body, logger): diff --git a/docs/english/concepts/global-middleware.md b/docs/english/concepts/global-middleware.md index dbcdeae99..7b7bdb059 100644 --- a/docs/english/concepts/global-middleware.md +++ b/docs/english/concepts/global-middleware.md @@ -5,6 +5,9 @@ Global middleware is run for all incoming requests, before any listener middlewa Both global and listener middleware must call `next()` to pass control of the execution chain to the next middleware. Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. + +## Example + ```python @app.use def auth_acme(client, context, logger, payload, next): diff --git a/docs/english/concepts/listener-middleware.md b/docs/english/concepts/listener-middleware.md index c8bfc964e..dd020373f 100644 --- a/docs/english/concepts/listener-middleware.md +++ b/docs/english/concepts/listener-middleware.md @@ -6,6 +6,8 @@ If your listener middleware is a quite simple one, you can use a listener matche Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. +## Example + ```python # Listener middleware which filters out messages from a bot def no_bot_messages(message, next): diff --git a/docs/english/concepts/logging.md b/docs/english/concepts/logging.md index 49e275d2d..599431550 100644 --- a/docs/english/concepts/logging.md +++ b/docs/english/concepts/logging.md @@ -4,6 +4,8 @@ By default, Bolt will log information from your app to the output destination. A Outside of a global context, you can also log a single message corresponding to a specific level. Because Bolt uses Python’s [standard logging module](https://docs.python.org/3/library/logging.html), you can use any its features. +## Example + ```python import logging diff --git a/docs/english/concepts/opening-modals.md b/docs/english/concepts/opening-modals.md index 1f053539f..01716f613 100644 --- a/docs/english/concepts/opening-modals.md +++ b/docs/english/concepts/opening-modals.md @@ -8,6 +8,8 @@ Read more about modal composition in the [API documentation](/surfaces/modals#co Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. +## Example + ```python # Listen for a shortcut invocation @app.shortcut("open_modal") diff --git a/docs/english/concepts/select-menu-options.md b/docs/english/concepts/select-menu-options.md index 40d29472c..8e6cbb9fe 100644 --- a/docs/english/concepts/select-menu-options.md +++ b/docs/english/concepts/select-menu-options.md @@ -10,6 +10,9 @@ To respond to options requests, you'll need to call `ack()` with a valid `option Additionally, you may want to apply filtering logic to the returned options based on user input. This can be accomplished by using the `payload` argument to your options listener and checking for the contents of the `value` property within it. Based on the `value` you can return different options. All listeners and middleware handlers in Bolt for Python have access to [many useful arguments](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) - be sure to check them out! Refer to [the module document](https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html) to learn the available listener arguments. + +## Example + ```python # Example of responding to an external_select options request @app.options("external_action") diff --git a/docs/english/concepts/web-api.md b/docs/english/concepts/web-api.md index 9cf436851..81f7c9b60 100644 --- a/docs/english/concepts/web-api.md +++ b/docs/english/concepts/web-api.md @@ -8,6 +8,8 @@ The token used to initialize Bolt can be found in the `context` object, which is ::: +## Example + ```python @app.message("wake me up") def say_hello(client, message): From 92bff603ef91d590da0849a6a1c4af319bad4996 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Wed, 18 Feb 2026 18:24:50 -0800 Subject: [PATCH 693/719] feat(agent): add set_suggested_prompts helper (#1442) Co-authored-by: Ale Mercado --- slack_bolt/agent/agent.py | 39 +++++- slack_bolt/agent/async_agent.py | 39 +++++- tests/slack_bolt/agent/test_agent.py | 112 +++++++++++++++++ .../agent/test_async_agent.py | 117 ++++++++++++++++++ 4 files changed, 305 insertions(+), 2 deletions(-) diff --git a/slack_bolt/agent/agent.py b/slack_bolt/agent/agent.py index 3663b245b..056dba986 100644 --- a/slack_bolt/agent/agent.py +++ b/slack_bolt/agent/agent.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Dict, List, Optional, Sequence, Union from slack_sdk import WebClient from slack_sdk.web import SlackResponse @@ -101,3 +101,40 @@ def set_status( loading_messages=loading_messages, **kwargs, ) + + def set_suggested_prompts( + self, + *, + prompts: Sequence[Union[str, Dict[str, str]]], + title: Optional[str] = None, + channel: Optional[str] = None, + thread_ts: Optional[str] = None, + **kwargs, + ) -> SlackResponse: + """Sets suggested prompts for an assistant thread. + + Args: + prompts: A sequence of prompts. Each prompt can be either a string + (used as both title and message) or a dict with 'title' and 'message' keys. + title: Optional title for the suggested prompts section. + channel: Channel ID. Defaults to the channel from the event context. + thread_ts: Thread timestamp. Defaults to the thread_ts from the event context. + **kwargs: Additional arguments passed to ``WebClient.assistant_threads_setSuggestedPrompts()``. + + Returns: + ``SlackResponse`` from the API call. + """ + prompts_arg: List[Dict[str, str]] = [] + for prompt in prompts: + if isinstance(prompt, str): + prompts_arg.append({"title": prompt, "message": prompt}) + else: + prompts_arg.append(prompt) + + return self._client.assistant_threads_setSuggestedPrompts( + channel_id=channel or self._channel_id, # type: ignore[arg-type] + thread_ts=thread_ts or self._thread_ts, # type: ignore[arg-type] + prompts=prompts_arg, + title=title, + **kwargs, + ) diff --git a/slack_bolt/agent/async_agent.py b/slack_bolt/agent/async_agent.py index 5b86533e6..5630e1b81 100644 --- a/slack_bolt/agent/async_agent.py +++ b/slack_bolt/agent/async_agent.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Dict, List, Optional, Sequence, Union from slack_sdk.web.async_client import AsyncSlackResponse, AsyncWebClient from slack_sdk.web.async_chat_stream import AsyncChatStream @@ -97,3 +97,40 @@ async def set_status( loading_messages=loading_messages, **kwargs, ) + + async def set_suggested_prompts( + self, + *, + prompts: Sequence[Union[str, Dict[str, str]]], + title: Optional[str] = None, + channel: Optional[str] = None, + thread_ts: Optional[str] = None, + **kwargs, + ) -> AsyncSlackResponse: + """Sets suggested prompts for an assistant thread. + + Args: + prompts: A sequence of prompts. Each prompt can be either a string + (used as both title and message) or a dict with 'title' and 'message' keys. + title: Optional title for the suggested prompts section. + channel: Channel ID. Defaults to the channel from the event context. + thread_ts: Thread timestamp. Defaults to the thread_ts from the event context. + **kwargs: Additional arguments passed to ``AsyncWebClient.assistant_threads_setSuggestedPrompts()``. + + Returns: + ``AsyncSlackResponse`` from the API call. + """ + prompts_arg: List[Dict[str, str]] = [] + for prompt in prompts: + if isinstance(prompt, str): + prompts_arg.append({"title": prompt, "message": prompt}) + else: + prompts_arg.append(prompt) + + return await self._client.assistant_threads_setSuggestedPrompts( + channel_id=channel or self._channel_id, # type: ignore[arg-type] + thread_ts=thread_ts or self._thread_ts, # type: ignore[arg-type] + prompts=prompts_arg, + title=title, + **kwargs, + ) diff --git a/tests/slack_bolt/agent/test_agent.py b/tests/slack_bolt/agent/test_agent.py index 7dad481b0..1d14eda06 100644 --- a/tests/slack_bolt/agent/test_agent.py +++ b/tests/slack_bolt/agent/test_agent.py @@ -197,6 +197,118 @@ def test_set_status_requires_status(self): with pytest.raises(TypeError): agent.set_status() + def test_set_suggested_prompts_uses_context_defaults(self): + """BoltAgent.set_suggested_prompts() passes context defaults to WebClient.assistant_threads_setSuggestedPrompts().""" + client = MagicMock(spec=WebClient) + client.assistant_threads_setSuggestedPrompts.return_value = MagicMock() + + agent = BoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + agent.set_suggested_prompts(prompts=["What can you do?", "Help me write code"]) + + client.assistant_threads_setSuggestedPrompts.assert_called_once_with( + channel_id="C111", + thread_ts="1234567890.123456", + prompts=[ + {"title": "What can you do?", "message": "What can you do?"}, + {"title": "Help me write code", "message": "Help me write code"}, + ], + title=None, + ) + + def test_set_suggested_prompts_with_dict_prompts(self): + """BoltAgent.set_suggested_prompts() accepts dict prompts with title and message.""" + client = MagicMock(spec=WebClient) + client.assistant_threads_setSuggestedPrompts.return_value = MagicMock() + + agent = BoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + agent.set_suggested_prompts( + prompts=[ + {"title": "Short title", "message": "A much longer message for this prompt"}, + ], + title="Suggestions", + ) + + client.assistant_threads_setSuggestedPrompts.assert_called_once_with( + channel_id="C111", + thread_ts="1234567890.123456", + prompts=[ + {"title": "Short title", "message": "A much longer message for this prompt"}, + ], + title="Suggestions", + ) + + def test_set_suggested_prompts_overrides_context_defaults(self): + """Explicit channel/thread_ts override context defaults.""" + client = MagicMock(spec=WebClient) + client.assistant_threads_setSuggestedPrompts.return_value = MagicMock() + + agent = BoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + agent.set_suggested_prompts( + prompts=["Hello"], + channel="C999", + thread_ts="9999999999.999999", + ) + + client.assistant_threads_setSuggestedPrompts.assert_called_once_with( + channel_id="C999", + thread_ts="9999999999.999999", + prompts=[{"title": "Hello", "message": "Hello"}], + title=None, + ) + + def test_set_suggested_prompts_passes_extra_kwargs(self): + """Extra kwargs are forwarded to WebClient.assistant_threads_setSuggestedPrompts().""" + client = MagicMock(spec=WebClient) + client.assistant_threads_setSuggestedPrompts.return_value = MagicMock() + + agent = BoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + agent.set_suggested_prompts(prompts=["Hello"], token="xoxb-override") + + client.assistant_threads_setSuggestedPrompts.assert_called_once_with( + channel_id="C111", + thread_ts="1234567890.123456", + prompts=[{"title": "Hello", "message": "Hello"}], + title=None, + token="xoxb-override", + ) + + def test_set_suggested_prompts_requires_prompts(self): + """set_suggested_prompts() raises TypeError when prompts is not provided.""" + client = MagicMock(spec=WebClient) + agent = BoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + with pytest.raises(TypeError): + agent.set_suggested_prompts() + def test_import_from_slack_bolt(self): from slack_bolt import BoltAgent as ImportedBoltAgent diff --git a/tests/slack_bolt_async/agent/test_async_agent.py b/tests/slack_bolt_async/agent/test_async_agent.py index 8e4c4d5c8..b934bbaeb 100644 --- a/tests/slack_bolt_async/agent/test_async_agent.py +++ b/tests/slack_bolt_async/agent/test_async_agent.py @@ -228,6 +228,123 @@ async def test_set_status_requires_status(self): with pytest.raises(TypeError): await agent.set_status() + @pytest.mark.asyncio + async def test_set_suggested_prompts_uses_context_defaults(self): + """AsyncBoltAgent.set_suggested_prompts() passes context defaults to AsyncWebClient.assistant_threads_setSuggestedPrompts().""" + client = MagicMock(spec=AsyncWebClient) + client.assistant_threads_setSuggestedPrompts, call_tracker, _ = _make_async_api_mock() + + agent = AsyncBoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + await agent.set_suggested_prompts(prompts=["What can you do?", "Help me write code"]) + + call_tracker.assert_called_once_with( + channel_id="C111", + thread_ts="1234567890.123456", + prompts=[ + {"title": "What can you do?", "message": "What can you do?"}, + {"title": "Help me write code", "message": "Help me write code"}, + ], + title=None, + ) + + @pytest.mark.asyncio + async def test_set_suggested_prompts_with_dict_prompts(self): + """AsyncBoltAgent.set_suggested_prompts() accepts dict prompts with title and message.""" + client = MagicMock(spec=AsyncWebClient) + client.assistant_threads_setSuggestedPrompts, call_tracker, _ = _make_async_api_mock() + + agent = AsyncBoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + await agent.set_suggested_prompts( + prompts=[ + {"title": "Short title", "message": "A much longer message for this prompt"}, + ], + title="Suggestions", + ) + + call_tracker.assert_called_once_with( + channel_id="C111", + thread_ts="1234567890.123456", + prompts=[ + {"title": "Short title", "message": "A much longer message for this prompt"}, + ], + title="Suggestions", + ) + + @pytest.mark.asyncio + async def test_set_suggested_prompts_overrides_context_defaults(self): + """Explicit channel/thread_ts override context defaults.""" + client = MagicMock(spec=AsyncWebClient) + client.assistant_threads_setSuggestedPrompts, call_tracker, _ = _make_async_api_mock() + + agent = AsyncBoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + await agent.set_suggested_prompts( + prompts=["Hello"], + channel="C999", + thread_ts="9999999999.999999", + ) + + call_tracker.assert_called_once_with( + channel_id="C999", + thread_ts="9999999999.999999", + prompts=[{"title": "Hello", "message": "Hello"}], + title=None, + ) + + @pytest.mark.asyncio + async def test_set_suggested_prompts_passes_extra_kwargs(self): + """Extra kwargs are forwarded to AsyncWebClient.assistant_threads_setSuggestedPrompts().""" + client = MagicMock(spec=AsyncWebClient) + client.assistant_threads_setSuggestedPrompts, call_tracker, _ = _make_async_api_mock() + + agent = AsyncBoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + await agent.set_suggested_prompts(prompts=["Hello"], token="xoxb-override") + + call_tracker.assert_called_once_with( + channel_id="C111", + thread_ts="1234567890.123456", + prompts=[{"title": "Hello", "message": "Hello"}], + title=None, + token="xoxb-override", + ) + + @pytest.mark.asyncio + async def test_set_suggested_prompts_requires_prompts(self): + """set_suggested_prompts() raises TypeError when prompts is not provided.""" + client = MagicMock(spec=AsyncWebClient) + agent = AsyncBoltAgent( + client=client, + channel_id="C111", + thread_ts="1234567890.123456", + team_id="T111", + user_id="W222", + ) + with pytest.raises(TypeError): + await agent.set_suggested_prompts() + @pytest.mark.asyncio async def test_import_from_agent_module(self): from slack_bolt.agent.async_agent import AsyncBoltAgent as ImportedAsyncBoltAgent From d789facab62a77c37e0dc0f34609a0a91253230c Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Wed, 18 Feb 2026 18:34:54 -0800 Subject: [PATCH 694/719] feat(agent): default to message 'ts' when no 'thread_ts' is avaialble for 'agent.chat_stream(...)' (#1444) Co-authored-by: Ale Mercado --- slack_bolt/agent/agent.py | 11 ++--- slack_bolt/agent/async_agent.py | 8 ++-- slack_bolt/kwargs_injection/async_utils.py | 5 +- slack_bolt/kwargs_injection/utils.py | 5 +- slack_bolt/request/internals.py | 3 ++ tests/slack_bolt/agent/test_agent.py | 45 ++++++++++++++++++ .../agent/test_async_agent.py | 47 +++++++++++++++++++ 7 files changed, 113 insertions(+), 11 deletions(-) diff --git a/slack_bolt/agent/agent.py b/slack_bolt/agent/agent.py index 056dba986..aa84bae90 100644 --- a/slack_bolt/agent/agent.py +++ b/slack_bolt/agent/agent.py @@ -11,9 +11,6 @@ class BoltAgent: Experimental: This API is experimental and may change in future releases. - FIXME: chat_stream() only works when thread_ts is available (DMs and threaded replies). - It does not work on channel messages because ts is not provided to BoltAgent yet. - @app.event("app_mention") def handle_mention(agent): stream = agent.chat_stream() @@ -27,12 +24,14 @@ def __init__( client: WebClient, channel_id: Optional[str] = None, thread_ts: Optional[str] = None, + ts: Optional[str] = None, team_id: Optional[str] = None, user_id: Optional[str] = None, ): self._client = client self._channel_id = channel_id self._thread_ts = thread_ts + self._ts = ts self._team_id = team_id self._user_id = user_id @@ -67,7 +66,7 @@ def chat_stream( # Argument validation is delegated to chat_stream() and the API return self._client.chat_stream( channel=channel or self._channel_id, # type: ignore[arg-type] - thread_ts=thread_ts or self._thread_ts, # type: ignore[arg-type] + thread_ts=thread_ts or self._thread_ts or self._ts, # type: ignore[arg-type] recipient_team_id=recipient_team_id or self._team_id, recipient_user_id=recipient_user_id or self._user_id, **kwargs, @@ -96,7 +95,7 @@ def set_status( """ return self._client.assistant_threads_setStatus( channel_id=channel or self._channel_id, # type: ignore[arg-type] - thread_ts=thread_ts or self._thread_ts, # type: ignore[arg-type] + thread_ts=thread_ts or self._thread_ts or self._ts, # type: ignore[arg-type] status=status, loading_messages=loading_messages, **kwargs, @@ -133,7 +132,7 @@ def set_suggested_prompts( return self._client.assistant_threads_setSuggestedPrompts( channel_id=channel or self._channel_id, # type: ignore[arg-type] - thread_ts=thread_ts or self._thread_ts, # type: ignore[arg-type] + thread_ts=thread_ts or self._thread_ts or self._ts, # type: ignore[arg-type] prompts=prompts_arg, title=title, **kwargs, diff --git a/slack_bolt/agent/async_agent.py b/slack_bolt/agent/async_agent.py index 5630e1b81..7272338e1 100644 --- a/slack_bolt/agent/async_agent.py +++ b/slack_bolt/agent/async_agent.py @@ -23,12 +23,14 @@ def __init__( client: AsyncWebClient, channel_id: Optional[str] = None, thread_ts: Optional[str] = None, + ts: Optional[str] = None, team_id: Optional[str] = None, user_id: Optional[str] = None, ): self._client = client self._channel_id = channel_id self._thread_ts = thread_ts + self._ts = ts self._team_id = team_id self._user_id = user_id @@ -63,7 +65,7 @@ async def chat_stream( # Argument validation is delegated to chat_stream() and the API return await self._client.chat_stream( channel=channel or self._channel_id, # type: ignore[arg-type] - thread_ts=thread_ts or self._thread_ts, # type: ignore[arg-type] + thread_ts=thread_ts or self._thread_ts or self._ts, # type: ignore[arg-type] recipient_team_id=recipient_team_id or self._team_id, recipient_user_id=recipient_user_id or self._user_id, **kwargs, @@ -92,7 +94,7 @@ async def set_status( """ return await self._client.assistant_threads_setStatus( channel_id=channel or self._channel_id, # type: ignore[arg-type] - thread_ts=thread_ts or self._thread_ts, # type: ignore[arg-type] + thread_ts=thread_ts or self._thread_ts or self._ts, # type: ignore[arg-type] status=status, loading_messages=loading_messages, **kwargs, @@ -129,7 +131,7 @@ async def set_suggested_prompts( return await self._client.assistant_threads_setSuggestedPrompts( channel_id=channel or self._channel_id, # type: ignore[arg-type] - thread_ts=thread_ts or self._thread_ts, # type: ignore[arg-type] + thread_ts=thread_ts or self._thread_ts or self._ts, # type: ignore[arg-type] prompts=prompts_arg, title=title, **kwargs, diff --git a/slack_bolt/kwargs_injection/async_utils.py b/slack_bolt/kwargs_injection/async_utils.py index e43cd0c27..aa84b2d11 100644 --- a/slack_bolt/kwargs_injection/async_utils.py +++ b/slack_bolt/kwargs_injection/async_utils.py @@ -89,10 +89,13 @@ def build_async_required_kwargs( if "agent" in required_arg_names: from slack_bolt.agent.async_agent import AsyncBoltAgent + event = request.body.get("event", {}) + all_available_args["agent"] = AsyncBoltAgent( client=request.context.client, channel_id=request.context.channel_id, - thread_ts=request.context.thread_ts, + thread_ts=request.context.thread_ts or event.get("thread_ts"), + ts=event.get("ts"), team_id=request.context.team_id, user_id=request.context.user_id, ) diff --git a/slack_bolt/kwargs_injection/utils.py b/slack_bolt/kwargs_injection/utils.py index 73fe99bba..5cd410a07 100644 --- a/slack_bolt/kwargs_injection/utils.py +++ b/slack_bolt/kwargs_injection/utils.py @@ -88,10 +88,13 @@ def build_required_kwargs( if "agent" in required_arg_names: from slack_bolt.agent.agent import BoltAgent + event = request.body.get("event", {}) + all_available_args["agent"] = BoltAgent( client=request.context.client, channel_id=request.context.channel_id, - thread_ts=request.context.thread_ts, + thread_ts=request.context.thread_ts or event.get("thread_ts"), + ts=event.get("ts"), team_id=request.context.team_id, user_id=request.context.user_id, ) diff --git a/slack_bolt/request/internals.py b/slack_bolt/request/internals.py index 014a8134a..e6a32db0d 100644 --- a/slack_bolt/request/internals.py +++ b/slack_bolt/request/internals.py @@ -218,6 +218,9 @@ def extract_thread_ts(payload: Dict[str, Any]) -> Optional[str]: # This utility initially supports only the use cases for AI assistants, but it may be fine to add more patterns. # That said, note that thread_ts is always required for assistant threads, but it's not for channels. # Thus, blindly setting this thread_ts to say utility can break existing apps' behaviors. + # + # The BoltAgent class handles non-assistant thread_ts separately by reading from the event directly, + # allowing it to work correctly without affecting say() behavior. if is_assistant_event(payload): event = payload["event"] if ( diff --git a/tests/slack_bolt/agent/test_agent.py b/tests/slack_bolt/agent/test_agent.py index 1d14eda06..87d51d9eb 100644 --- a/tests/slack_bolt/agent/test_agent.py +++ b/tests/slack_bolt/agent/test_agent.py @@ -92,6 +92,51 @@ def test_chat_stream_passes_extra_kwargs(self): buffer_size=512, ) + def test_chat_stream_falls_back_to_ts(self): + """When thread_ts is not set, chat_stream() falls back to ts.""" + client = MagicMock(spec=WebClient) + client.chat_stream.return_value = MagicMock(spec=ChatStream) + + agent = BoltAgent( + client=client, + channel_id="C111", + team_id="T111", + ts="1111111111.111111", + user_id="W222", + ) + stream = agent.chat_stream() + + client.chat_stream.assert_called_once_with( + channel="C111", + thread_ts="1111111111.111111", + recipient_team_id="T111", + recipient_user_id="W222", + ) + assert stream is not None + + def test_chat_stream_prefers_thread_ts_over_ts(self): + """thread_ts takes priority over ts.""" + client = MagicMock(spec=WebClient) + client.chat_stream.return_value = MagicMock(spec=ChatStream) + + agent = BoltAgent( + client=client, + channel_id="C111", + team_id="T111", + thread_ts="1234567890.123456", + ts="1111111111.111111", + user_id="W222", + ) + stream = agent.chat_stream() + + client.chat_stream.assert_called_once_with( + channel="C111", + thread_ts="1234567890.123456", + recipient_team_id="T111", + recipient_user_id="W222", + ) + assert stream is not None + def test_set_status_uses_context_defaults(self): """BoltAgent.set_status() passes context defaults to WebClient.assistant_threads_setStatus().""" client = MagicMock(spec=WebClient) diff --git a/tests/slack_bolt_async/agent/test_async_agent.py b/tests/slack_bolt_async/agent/test_async_agent.py index b934bbaeb..7c01a4301 100644 --- a/tests/slack_bolt_async/agent/test_async_agent.py +++ b/tests/slack_bolt_async/agent/test_async_agent.py @@ -118,6 +118,53 @@ async def test_chat_stream_passes_extra_kwargs(self): buffer_size=512, ) + @pytest.mark.asyncio + async def test_chat_stream_falls_back_to_ts(self): + """When thread_ts is not set, chat_stream() falls back to ts.""" + client = MagicMock(spec=AsyncWebClient) + client.chat_stream, call_tracker, _ = _make_async_chat_stream_mock() + + agent = AsyncBoltAgent( + client=client, + channel_id="C111", + team_id="T111", + ts="1111111111.111111", + user_id="W222", + ) + stream = await agent.chat_stream() + + call_tracker.assert_called_once_with( + channel="C111", + thread_ts="1111111111.111111", + recipient_team_id="T111", + recipient_user_id="W222", + ) + assert stream is not None + + @pytest.mark.asyncio + async def test_chat_stream_prefers_thread_ts_over_ts(self): + """thread_ts takes priority over ts.""" + client = MagicMock(spec=AsyncWebClient) + client.chat_stream, call_tracker, _ = _make_async_chat_stream_mock() + + agent = AsyncBoltAgent( + client=client, + channel_id="C111", + team_id="T111", + thread_ts="1234567890.123456", + ts="1111111111.111111", + user_id="W222", + ) + stream = await agent.chat_stream() + + call_tracker.assert_called_once_with( + channel="C111", + thread_ts="1234567890.123456", + recipient_team_id="T111", + recipient_user_id="W222", + ) + assert stream is not None + @pytest.mark.asyncio async def test_set_status_uses_context_defaults(self): """AsyncBoltAgent.set_status() passes context defaults to AsyncWebClient.assistant_threads_setStatus().""" From 837e120a3119f6b92da1dd52064a2400e9f97ba9 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Thu, 19 Feb 2026 11:28:37 -0800 Subject: [PATCH 695/719] fix(agent): match channel_id api argument for set_status and set_suggested_prompts (#1446) --- slack_bolt/agent/agent.py | 12 ++++++------ slack_bolt/agent/async_agent.py | 12 ++++++------ tests/slack_bolt/agent/test_agent.py | 8 ++++---- tests/slack_bolt_async/agent/test_async_agent.py | 8 ++++---- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/slack_bolt/agent/agent.py b/slack_bolt/agent/agent.py index aa84bae90..523b0e33c 100644 --- a/slack_bolt/agent/agent.py +++ b/slack_bolt/agent/agent.py @@ -77,7 +77,7 @@ def set_status( *, status: str, loading_messages: Optional[List[str]] = None, - channel: Optional[str] = None, + channel_id: Optional[str] = None, thread_ts: Optional[str] = None, **kwargs, ) -> SlackResponse: @@ -86,7 +86,7 @@ def set_status( Args: status: The status text to display. loading_messages: Optional list of loading messages to cycle through. - channel: Channel ID. Defaults to the channel from the event context. + channel_id: Channel ID. Defaults to the channel from the event context. thread_ts: Thread timestamp. Defaults to the thread_ts from the event context. **kwargs: Additional arguments passed to ``WebClient.assistant_threads_setStatus()``. @@ -94,7 +94,7 @@ def set_status( ``SlackResponse`` from the API call. """ return self._client.assistant_threads_setStatus( - channel_id=channel or self._channel_id, # type: ignore[arg-type] + channel_id=channel_id or self._channel_id, # type: ignore[arg-type] thread_ts=thread_ts or self._thread_ts or self._ts, # type: ignore[arg-type] status=status, loading_messages=loading_messages, @@ -106,7 +106,7 @@ def set_suggested_prompts( *, prompts: Sequence[Union[str, Dict[str, str]]], title: Optional[str] = None, - channel: Optional[str] = None, + channel_id: Optional[str] = None, thread_ts: Optional[str] = None, **kwargs, ) -> SlackResponse: @@ -116,7 +116,7 @@ def set_suggested_prompts( prompts: A sequence of prompts. Each prompt can be either a string (used as both title and message) or a dict with 'title' and 'message' keys. title: Optional title for the suggested prompts section. - channel: Channel ID. Defaults to the channel from the event context. + channel_id: Channel ID. Defaults to the channel from the event context. thread_ts: Thread timestamp. Defaults to the thread_ts from the event context. **kwargs: Additional arguments passed to ``WebClient.assistant_threads_setSuggestedPrompts()``. @@ -131,7 +131,7 @@ def set_suggested_prompts( prompts_arg.append(prompt) return self._client.assistant_threads_setSuggestedPrompts( - channel_id=channel or self._channel_id, # type: ignore[arg-type] + channel_id=channel_id or self._channel_id, # type: ignore[arg-type] thread_ts=thread_ts or self._thread_ts or self._ts, # type: ignore[arg-type] prompts=prompts_arg, title=title, diff --git a/slack_bolt/agent/async_agent.py b/slack_bolt/agent/async_agent.py index 7272338e1..da4ec6c0a 100644 --- a/slack_bolt/agent/async_agent.py +++ b/slack_bolt/agent/async_agent.py @@ -76,7 +76,7 @@ async def set_status( *, status: str, loading_messages: Optional[List[str]] = None, - channel: Optional[str] = None, + channel_id: Optional[str] = None, thread_ts: Optional[str] = None, **kwargs, ) -> AsyncSlackResponse: @@ -85,7 +85,7 @@ async def set_status( Args: status: The status text to display. loading_messages: Optional list of loading messages to cycle through. - channel: Channel ID. Defaults to the channel from the event context. + channel_id: Channel ID. Defaults to the channel from the event context. thread_ts: Thread timestamp. Defaults to the thread_ts from the event context. **kwargs: Additional arguments passed to ``AsyncWebClient.assistant_threads_setStatus()``. @@ -93,7 +93,7 @@ async def set_status( ``AsyncSlackResponse`` from the API call. """ return await self._client.assistant_threads_setStatus( - channel_id=channel or self._channel_id, # type: ignore[arg-type] + channel_id=channel_id or self._channel_id, # type: ignore[arg-type] thread_ts=thread_ts or self._thread_ts or self._ts, # type: ignore[arg-type] status=status, loading_messages=loading_messages, @@ -105,7 +105,7 @@ async def set_suggested_prompts( *, prompts: Sequence[Union[str, Dict[str, str]]], title: Optional[str] = None, - channel: Optional[str] = None, + channel_id: Optional[str] = None, thread_ts: Optional[str] = None, **kwargs, ) -> AsyncSlackResponse: @@ -115,7 +115,7 @@ async def set_suggested_prompts( prompts: A sequence of prompts. Each prompt can be either a string (used as both title and message) or a dict with 'title' and 'message' keys. title: Optional title for the suggested prompts section. - channel: Channel ID. Defaults to the channel from the event context. + channel_id: Channel ID. Defaults to the channel from the event context. thread_ts: Thread timestamp. Defaults to the thread_ts from the event context. **kwargs: Additional arguments passed to ``AsyncWebClient.assistant_threads_setSuggestedPrompts()``. @@ -130,7 +130,7 @@ async def set_suggested_prompts( prompts_arg.append(prompt) return await self._client.assistant_threads_setSuggestedPrompts( - channel_id=channel or self._channel_id, # type: ignore[arg-type] + channel_id=channel_id or self._channel_id, # type: ignore[arg-type] thread_ts=thread_ts or self._thread_ts or self._ts, # type: ignore[arg-type] prompts=prompts_arg, title=title, diff --git a/tests/slack_bolt/agent/test_agent.py b/tests/slack_bolt/agent/test_agent.py index 87d51d9eb..76ac7d17b 100644 --- a/tests/slack_bolt/agent/test_agent.py +++ b/tests/slack_bolt/agent/test_agent.py @@ -183,7 +183,7 @@ def test_set_status_with_loading_messages(self): ) def test_set_status_overrides_context_defaults(self): - """Explicit channel/thread_ts override context defaults.""" + """Explicit channel_id/thread_ts override context defaults.""" client = MagicMock(spec=WebClient) client.assistant_threads_setStatus.return_value = MagicMock() @@ -196,7 +196,7 @@ def test_set_status_overrides_context_defaults(self): ) agent.set_status( status="Thinking...", - channel="C999", + channel_id="C999", thread_ts="9999999999.999999", ) @@ -295,7 +295,7 @@ def test_set_suggested_prompts_with_dict_prompts(self): ) def test_set_suggested_prompts_overrides_context_defaults(self): - """Explicit channel/thread_ts override context defaults.""" + """Explicit channel_id/thread_ts override context defaults.""" client = MagicMock(spec=WebClient) client.assistant_threads_setSuggestedPrompts.return_value = MagicMock() @@ -308,7 +308,7 @@ def test_set_suggested_prompts_overrides_context_defaults(self): ) agent.set_suggested_prompts( prompts=["Hello"], - channel="C999", + channel_id="C999", thread_ts="9999999999.999999", ) diff --git a/tests/slack_bolt_async/agent/test_async_agent.py b/tests/slack_bolt_async/agent/test_async_agent.py index 7c01a4301..3ed8ef0b4 100644 --- a/tests/slack_bolt_async/agent/test_async_agent.py +++ b/tests/slack_bolt_async/agent/test_async_agent.py @@ -214,7 +214,7 @@ async def test_set_status_with_loading_messages(self): @pytest.mark.asyncio async def test_set_status_overrides_context_defaults(self): - """Explicit channel/thread_ts override context defaults.""" + """Explicit channel_id/thread_ts override context defaults.""" client = MagicMock(spec=AsyncWebClient) client.assistant_threads_setStatus, call_tracker, _ = _make_async_api_mock() @@ -227,7 +227,7 @@ async def test_set_status_overrides_context_defaults(self): ) await agent.set_status( status="Thinking...", - channel="C999", + channel_id="C999", thread_ts="9999999999.999999", ) @@ -331,7 +331,7 @@ async def test_set_suggested_prompts_with_dict_prompts(self): @pytest.mark.asyncio async def test_set_suggested_prompts_overrides_context_defaults(self): - """Explicit channel/thread_ts override context defaults.""" + """Explicit channel_id/thread_ts override context defaults.""" client = MagicMock(spec=AsyncWebClient) client.assistant_threads_setSuggestedPrompts, call_tracker, _ = _make_async_api_mock() @@ -344,7 +344,7 @@ async def test_set_suggested_prompts_overrides_context_defaults(self): ) await agent.set_suggested_prompts( prompts=["Hello"], - channel="C999", + channel_id="C999", thread_ts="9999999999.999999", ) From bf767eb22fa3dcb2e622e20734247864ac02cbbb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Mar 2026 22:16:55 +0000 Subject: [PATCH 696/719] chore(deps): bump actions/stale from 10.1.1 to 10.2.0 (#1448) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/triage-issues.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/triage-issues.yml b/.github/workflows/triage-issues.yml index cf13d3afc..c29bface2 100644 --- a/.github/workflows/triage-issues.yml +++ b/.github/workflows/triage-issues.yml @@ -16,7 +16,7 @@ jobs: issues: write pull-requests: write steps: - - uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10.1.1 + - uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0 with: days-before-issue-stale: 30 days-before-issue-close: 10 From 0f3afc22e6697f32c32dc1600e7dfbc0ecf15138 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 08:41:08 -0800 Subject: [PATCH 697/719] chore(deps): bump actions/upload-artifact from 6.0.0 to 7.0.0 (#1449) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/pypi-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 9c9003c92..34025a6fd 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -33,7 +33,7 @@ jobs: scripts/build_pypi_package.sh - name: Persist dist folder - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: release-dist path: dist/ From 5a153e689fc1ac2a1bf67a1a9f5ea4cef10e3cce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 16:58:33 +0000 Subject: [PATCH 698/719] chore(deps): bump actions/download-artifact from 7.0.0 to 8.0.0 (#1450) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/pypi-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 34025a6fd..7ec974574 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -52,7 +52,7 @@ jobs: steps: - name: Retrieve dist folder - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 + uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 with: name: release-dist path: dist/ @@ -76,7 +76,7 @@ jobs: steps: - name: Retrieve dist folder - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 + uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 with: name: release-dist path: dist/ From 72a90d242086d7e77abd0f1be076d6d64f74fa82 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Fri, 6 Mar 2026 10:34:16 -0800 Subject: [PATCH 699/719] chore(claude): add claude code support for maintainers (#1445) Co-authored-by: William Bergamin Co-authored-by: William Bergamin --- .claude/.gitignore | 4 + .claude/CLAUDE.md | 1 + .claude/settings.json | 34 +++++ .gitignore | 3 - AGENTS.md | 202 +++++++++++++++++++++++++++ scripts/install.sh | 22 +++ scripts/install_all_and_run_tests.sh | 30 ++-- scripts/run_tests.sh | 10 +- slack_bolt/warning/__init__.py | 1 + 9 files changed, 275 insertions(+), 32 deletions(-) create mode 100644 .claude/.gitignore create mode 100644 .claude/CLAUDE.md create mode 100644 .claude/settings.json create mode 100644 AGENTS.md create mode 100755 scripts/install.sh diff --git a/.claude/.gitignore b/.claude/.gitignore new file mode 100644 index 000000000..3a2f7f6a1 --- /dev/null +++ b/.claude/.gitignore @@ -0,0 +1,4 @@ +CLAUDE.local.md +settings.local.json +worktrees/ +plans/ diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md new file mode 100644 index 000000000..dba71e970 --- /dev/null +++ b/.claude/CLAUDE.md @@ -0,0 +1 @@ +@../AGENTS.md diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 000000000..705fd286c --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,34 @@ +{ + "permissions": { + "allow": [ + "Bash(./scripts/build_pypi_package.sh:*)", + "Bash(./scripts/format.sh:*)", + "Bash(./scripts/install_all_and_run_tests.sh:*)", + "Bash(./scripts/lint.sh:*)", + "Bash(./scripts/run_mypy.sh:*)", + "Bash(./scripts/run_tests.sh:*)", + "Bash(./scripts/install.sh:*)", + "Bash(echo $VIRTUAL_ENV)", + "Bash(gh issue view:*)", + "Bash(gh label list:*)", + "Bash(gh pr checks:*)", + "Bash(gh pr diff:*)", + "Bash(gh pr list:*)", + "Bash(gh pr status:*)", + "Bash(gh pr update-branch:*)", + "Bash(gh pr view:*)", + "Bash(gh search code:*)", + "Bash(git diff:*)", + "Bash(git grep:*)", + "Bash(git log:*)", + "Bash(git show:*)", + "Bash(git status:*)", + "Bash(grep:*)", + "Bash(ls:*)", + "Bash(tree:*)", + "WebFetch(domain:github.com)", + "WebFetch(domain:docs.slack.dev)", + "WebFetch(domain:raw.githubusercontent.com)" + ] + } +} diff --git a/.gitignore b/.gitignore index b28dfa9ed..2549060e7 100644 --- a/.gitignore +++ b/.gitignore @@ -17,9 +17,6 @@ venv/ .venv* .env/ -# claude -.claude/*.local.json - # codecov / coverage .coverage cov_* diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 000000000..537cabfcf --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,202 @@ +# AGENTS.md - bolt-python + +## Project Overview + +Slack Bolt for Python -- a framework for building Slack apps in Python. + +- **Foundation:** Built on top of `slack_sdk` (see `pyproject.toml` constraints). +- **Execution Models:** Supports both synchronous (`App`) and asynchronous (`AsyncApp` using `asyncio`) execution. Async mode requires `aiohttp` as an additional dependency. +- **Framework Adapters:** Features built-in adapters for web frameworks (Flask, FastAPI, Django, Tornado, Pyramid, and many more) and serverless environments (AWS Lambda, Google Cloud Functions). +- **Python Version:** Requires Python 3.7+ as defined in `pyproject.toml`. + +- **Repository**: +- **Documentation**: +- **PyPI**: +- **Current version**: defined in `slack_bolt/version.py` (referenced by `pyproject.toml` via `[tool.setuptools.dynamic]`) + +## Environment Setup + +A python virtual environment (`venv`) should be activated before running any commands. + +```bash +# Create a venv (first time only) +python -m venv .venv + +# Activate +source .venv/bin/activate + +# Install all dependencies +./scripts/install.sh +``` + +You can verify the venv is active by checking `echo $VIRTUAL_ENV`. If tools like `black`, `flake8`, `mypy` or `pytest` are not found, ask the user to activate the venv. + +## Common Commands + +### Testing + +Always use the project scripts instead of calling `pytest` directly: + +```bash +# Install all dependencies and run all tests (formats, lints, tests, typechecks) +./scripts/install_all_and_run_tests.sh + +# Run a single test file +./scripts/run_tests.sh tests/scenario_tests/test_app.py + +# Run a single test function +./scripts/run_tests.sh tests/scenario_tests/test_app.py::TestApp::test_name +``` + +### Formatting, Linting, Type Checking + +```bash +# Format (black, line-length=125) +./scripts/format.sh --no-install + +# Lint (flake8, line-length=125, ignores: F841,F821,W503,E402) +./scripts/lint.sh --no-install + +# Type check (mypy) +./scripts/run_mypy.sh --no-install +``` + +## Architecture + +### Request Processing Pipeline + +Incoming requests flow through a middleware chain before reaching listeners: + +1. **SSL Check** -> **Request Verification** (signature) -> **URL Verification** -> **Authorization** (token injection) -> **Ignoring Self Events** -> Custom middleware +2. **Listener Matching** -- `ListenerMatcher` implementations check if a listener should handle the request +3. **Listener Execution** -- listener-specific middleware runs, then `ack()` is called, then the handler executes + +For FaaS environments (`process_before_response=True`), long-running handlers execute as "lazy listeners" in a thread pool after the ack response is returned. + +### Core Abstractions + +- **`App` / `AsyncApp`** (`slack_bolt/app/`) -- Central class. Registers listeners via decorators (`@app.event()`, `@app.action()`, `@app.command()`, `@app.message()`, `@app.view()`, `@app.shortcut()`, `@app.options()`, `@app.function()`). Dispatches incoming requests through middleware to matching listeners. +- **`Middleware`** (`slack_bolt/middleware/`) -- Abstract base with `process(req, resp, next)`. Built-in: authorization, request verification, SSL check, URL verification, assistant, self-event ignoring. +- **`Listener`** (`slack_bolt/listener/`) -- Has matchers, middleware, and an ack/handler function. `CustomListener` is the main implementation. +- **`ListenerMatcher`** (`slack_bolt/listener_matcher/`) -- Determines if a listener handles a given request. Built-in matchers for events, actions, commands, messages (regex), shortcuts, views, options, functions. +- **`BoltContext`** (`slack_bolt/context/`) -- Dict-like object passed to listeners with `client`, `say()`, `ack()`, `respond()`, `complete()`, `fail()`, plus event metadata (`user_id`, `channel_id`, `team_id`, etc.). +- **`BoltRequest` / `BoltResponse`** (`slack_bolt/request/`, `slack_bolt/response/`) -- Request/response wrappers. Request has `mode` of "http" or "socket_mode". + +### Kwargs Injection + +Listeners receive arguments by parameter name. The framework inspects function signatures and injects matching args: `body`, `event`, `action`, `command`, `payload`, `context`, `client`, `ack`, `say`, `respond`, `logger`, `complete`, `fail`, `agent`, etc. Defined in `slack_bolt/kwargs_injection/args.py`. + +### Adapter System + +Each adapter in `slack_bolt/adapter/` converts between a web framework's request/response types and `BoltRequest`/`BoltResponse`. Adapters exist for: Flask, FastAPI, Django, Starlette, Sanic, Bottle, Tornado, CherryPy, Falcon, Pyramid, AWS Lambda, Google Cloud Functions, Socket Mode, WSGI, ASGI, and more. + +### Sync/Async Mirroring Pattern + +**This is the most important pattern in this codebase.** Almost every module has both a sync and async variant. When you modify one, you almost always must modify the other. + +**File naming convention:** Async files use the `async_` prefix alongside their sync counterpart: + +```text +slack_bolt/middleware/custom_middleware.py # sync +slack_bolt/middleware/async_custom_middleware.py # async + +slack_bolt/context/say/say.py # sync +slack_bolt/context/say/async_say.py # async + +slack_bolt/listener/custom_listener.py # sync +slack_bolt/listener/async_listener.py # async + +slack_bolt/adapter/fastapi/async_handler.py # async-only (no sync FastAPI adapter) +slack_bolt/adapter/flask/handler.py # sync-only (no async Flask adapter) +``` + +**Which modules come in sync/async pairs:** + +- `slack_bolt/app/` -- `app.py` / `async_app.py` +- `slack_bolt/middleware/` -- every middleware has an `async_` counterpart +- `slack_bolt/listener/` -- `listener.py` / `async_listener.py`, plus error/completion/start handlers +- `slack_bolt/listener_matcher/` -- `builtins.py` / `async_builtins.py` +- `slack_bolt/context/` -- each subdirectory (e.g., `say/`, `ack/`, `respond/`) has `async_` variants +- `slack_bolt/kwargs_injection/` -- `args.py` / `async_args.py`, `utils.py` / `async_utils.py` + +**Adapters are an exception:** Most adapters are sync-only or async-only depending on the framework. Async-native frameworks (FastAPI, Starlette, Sanic, Tornado, ASGI, Socket Mode) have `async_handler.py`. Sync-only frameworks (Flask, Django, Bottle, CherryPy, Falcon, Pyramid, AWS Lambda, Google Cloud Functions, WSGI) have `handler.py`. + +### AI Agents & Assistants + +`BoltAgent` (`slack_bolt/agent/`) provides `chat_stream()`, `set_status()`, and `set_suggested_prompts()` for AI-powered agents. `Assistant` middleware (`slack_bolt/middleware/assistant/`) handles assistant thread events. + +## Key Development Patterns + +### Adding or Modifying Middleware + +1. Implement the sync version in `slack_bolt/middleware/` (subclass `Middleware`, implement `process()`) +2. Implement the async version with `async_` prefix (subclass `AsyncMiddleware`, implement `async_process()`) +3. Export built-in middleware from `slack_bolt/middleware/__init__.py` (sync) and `async_builtins.py` (async) + +### Adding a Context Utility + +Each context utility lives in its own subdirectory under `slack_bolt/context/`: + +```text +slack_bolt/context/my_util/ + __init__.py + my_util.py # sync implementation + async_my_util.py # async implementation + internals.py # shared logic (optional) +``` + +Then wire it into `BoltContext` (`slack_bolt/context/context.py`) and `AsyncBoltContext` (`slack_bolt/context/async_context.py`). + +### Adding a New Adapter + +1. Create `slack_bolt/adapter//` +2. Add `__init__.py` and `handler.py` (or `async_handler.py` for async frameworks) +3. The handler converts the framework's request to `BoltRequest`, calls `app.dispatch()`, and converts `BoltResponse` back +4. Add the framework to `requirements/adapter.txt` with version constraints +5. Add adapter tests in `tests/adapter_tests/` (or `tests/adapter_tests_async/`) + +### Adding a Kwargs-Injectable Argument + +1. Add the new arg to `slack_bolt/kwargs_injection/args.py` and `async_args.py` +2. Update the `Args` class with the new property +3. Populate the arg in the appropriate context or listener setup code + +## Dependencies + +The core package has a **single required runtime dependency**: `slack_sdk` (defined in `pyproject.toml`). Do not add runtime dependencies. + +**`requirements/` directory structure:** + +- `async.txt` -- async runtime deps (`aiohttp`, `websockets`) +- `adapter.txt` -- all framework adapter deps (Flask, Django, FastAPI, etc.) +- `testing.txt` -- test runner deps (`pytest`, `pytest-asyncio`, includes `async.txt`) +- `testing_without_asyncio.txt` -- test deps without async (`pytest`, `pytest-cov`) +- `adapter_testing.txt` -- adapter-specific test deps (`moto`, `boddle`, `sanic-testing`) +- `tools.txt` -- dev tools (`mypy`, `flake8`, `black`) + +When adding a new dependency: add it to the appropriate `requirements/*.txt` file with version constraints, never to `pyproject.toml` `dependencies` (unless it's a core runtime dep, which is very rare). + +## Test Organization + +- `tests/scenario_tests/` -- Integration-style tests with realistic Slack payloads +- `tests/slack_bolt/` -- Unit tests mirroring the source structure +- `tests/adapter_tests/` and `tests/adapter_tests_async/` -- Framework adapter tests +- `tests/mock_web_api_server/` -- Mock Slack API server used by tests +- Async test variants use `_async` suffix directories + +**Where to put new tests:** Mirror the source structure. For `slack_bolt/middleware/foo.py`, add tests in `tests/slack_bolt/middleware/test_foo.py`. For async variants, use the `_async` suffix directory or file naming pattern. Adapter tests go in `tests/adapter_tests/` (sync) or `tests/adapter_tests_async/` (async). + +**Mock server:** Many tests use `tests/mock_web_api_server/` to simulate Slack API responses. Look at existing tests for usage patterns rather than making real API calls. + +## Code Style + +- **Black** formatter configured in `pyproject.toml` (line-length=125) +- **Flake8** linter configured in `.flake8` (line-length=125, ignores: F841,F821,W503,E402) +- **MyPy** configured in `pyproject.toml` +- **pytest** configured in `pyproject.toml` + +## GitHub & CI/CD + +- `.github/` -- GitHub-specific configuration and documentation +- `.github/workflows/` -- Continuous integration pipeline definitions that run on GitHub Actions +- `.github/maintainers_guide.md` -- Maintainer workflows and release process diff --git a/scripts/install.sh b/scripts/install.sh new file mode 100755 index 000000000..96159c63c --- /dev/null +++ b/scripts/install.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# Installs all dependencies of the project +# ./scripts/install.sh + +script_dir=`dirname $0` +cd ${script_dir}/.. +rm -rf ./slack_bolt.egg-info + +# Update pip to prevent warnings +pip install -U pip + +# The package causes a conflict with moto +pip uninstall python-lambda + +pip install -U -e . +pip install -U -r requirements/testing.txt +pip install -U -r requirements/adapter.txt +pip install -U -r requirements/adapter_testing.txt +pip install -U -r requirements/tools.txt + +# To avoid errors due to the old versions of click forced by Chalice +pip install -U pip click diff --git a/scripts/install_all_and_run_tests.sh b/scripts/install_all_and_run_tests.sh index 2bb9a2050..939e71ffd 100755 --- a/scripts/install_all_and_run_tests.sh +++ b/scripts/install_all_and_run_tests.sh @@ -5,31 +5,19 @@ script_dir=`dirname $0` cd ${script_dir}/.. -rm -rf ./slack_bolt.egg-info -# Update pip to prevent warnings -pip install -U pip +test_target="${1:-tests/}" -# The package causes a conflict with moto -pip uninstall python-lambda +# keep in sync with LATEST_SUPPORTED_PY in .github/workflows/ci-build.yml +LATEST_SUPPORTED_PY="3.14" +current_py=$(python --version | sed -E 's/Python ([0-9]+\.[0-9]+).*/\1/') -test_target="$1" +./scripts/install.sh -pip install -U -e . -pip install -U -r requirements/testing.txt -pip install -U -r requirements/adapter.txt -pip install -U -r requirements/adapter_testing.txt -pip install -U -r requirements/tools.txt -# To avoid errors due to the old versions of click forced by Chalice -pip install -U pip click +./scripts/format.sh --no-install +./scripts/lint.sh --no-install +pytest $test_target -if [[ $test_target != "" ]] -then - ./scripts/format.sh --no-install - pytest $1 -else - ./scripts/format.sh --no-install - ./scripts/lint.sh --no-install - pytest +if [[ "$current_py" == "$LATEST_SUPPORTED_PY" ]]; then ./scripts/run_mypy.sh --no-install fi diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index cdac3c71c..d4dc767e3 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -6,13 +6,7 @@ script_dir=`dirname $0` cd ${script_dir}/.. -test_target="$1" +test_target="${1:-tests/}" ./scripts/format.sh --no-install - -if [[ $test_target != "" ]] -then - pytest -vv $1 -else - pytest -fi +pytest -vv $test_target diff --git a/slack_bolt/warning/__init__.py b/slack_bolt/warning/__init__.py index df71b812f..4991f4cd9 100644 --- a/slack_bolt/warning/__init__.py +++ b/slack_bolt/warning/__init__.py @@ -3,4 +3,5 @@ class ExperimentalWarning(FutureWarning): """Warning for features that are still in experimental phase.""" + pass From 0fc53805a262c21d80057b41b07552f1d1ac072d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 14:19:30 -0700 Subject: [PATCH 700/719] chore(deps): bump black from 25.1.0 to 26.3.1 in /requirements (#1457) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/tools.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/tools.txt b/requirements/tools.txt index 7609eb52e..dd13bd614 100644 --- a/requirements/tools.txt +++ b/requirements/tools.txt @@ -1,3 +1,3 @@ mypy==1.19.1 flake8==7.3.0 -black==25.1.0 +black==26.3.1 From 4d15431ca824963017e6e8b5e4a5b3cc90232d53 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Thu, 12 Mar 2026 14:55:40 -0700 Subject: [PATCH 701/719] chore: improve AGENTS.md (#1458) --- AGENTS.md | 156 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 100 insertions(+), 56 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 537cabfcf..57f2fa588 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -16,6 +16,8 @@ Slack Bolt for Python -- a framework for building Slack apps in Python. ## Environment Setup +You can verify the venv is active by checking `echo $VIRTUAL_ENV`. If tools like `black`, `flake8`, `mypy` or `pytest` are not found, ask the user to activate the venv. + A python virtual environment (`venv`) should be activated before running any commands. ```bash @@ -29,18 +31,30 @@ source .venv/bin/activate ./scripts/install.sh ``` -You can verify the venv is active by checking `echo $VIRTUAL_ENV`. If tools like `black`, `flake8`, `mypy` or `pytest` are not found, ask the user to activate the venv. - ## Common Commands -### Testing +### Pre-submission Checklist -Always use the project scripts instead of calling `pytest` directly: +Before considering any work complete, you MUST run these commands in order and confirm they all pass: + +```bash +./scripts/format.sh --no-install # 1. Format +./scripts/lint.sh --no-install # 2. Lint +./scripts/run_tests.sh # 3. Run relevant tests (see Testing below) +./scripts/run_mypy.sh --no-install # 4. Type check +``` + +To run everything at once (installs deps + formats + lints + tests + typechecks): ```bash -# Install all dependencies and run all tests (formats, lints, tests, typechecks) ./scripts/install_all_and_run_tests.sh +``` +### Testing + +Always use the project scripts instead of calling `pytest` directly: + +```bash # Run a single test file ./scripts/run_tests.sh tests/scenario_tests/test_app.py @@ -51,16 +65,70 @@ Always use the project scripts instead of calling `pytest` directly: ### Formatting, Linting, Type Checking ```bash -# Format (black, line-length=125) +# Format -- Black, configured in pyproject.toml ./scripts/format.sh --no-install -# Lint (flake8, line-length=125, ignores: F841,F821,W503,E402) +# Lint -- Flake8, configured in .flake8 ./scripts/lint.sh --no-install -# Type check (mypy) +# Type check -- mypy, configured in pyproject.toml ./scripts/run_mypy.sh --no-install ``` +## Critical Conventions + +### Sync/Async Mirroring Rule + +**When modifying any sync module, you MUST also update the corresponding async module (and vice versa).** This is the most important convention in this codebase. + +Almost every module has both a sync and async variant. Async files use the `async_` prefix alongside their sync counterpart: + +```text +slack_bolt/middleware/custom_middleware.py # sync +slack_bolt/middleware/async_custom_middleware.py # async + +slack_bolt/context/say/say.py # sync +slack_bolt/context/say/async_say.py # async + +slack_bolt/listener/custom_listener.py # sync +slack_bolt/listener/async_listener.py # async +``` + +**Modules that come in sync/async pairs:** + +- `slack_bolt/app/` -- `app.py` / `async_app.py` +- `slack_bolt/middleware/` -- every middleware has an `async_` counterpart +- `slack_bolt/listener/` -- `listener.py` / `async_listener.py`, plus error/completion/start handlers +- `slack_bolt/listener_matcher/` -- `builtins.py` / `async_builtins.py` +- `slack_bolt/context/` -- each subdirectory (e.g., `say/`, `ack/`, `respond/`) has `async_` variants +- `slack_bolt/kwargs_injection/` -- `args.py` / `async_args.py`, `utils.py` / `async_utils.py` + +**Adapters are an exception:** Most adapters are sync-only or async-only depending on the framework. Async-native frameworks (FastAPI, Starlette, Sanic, Tornado, ASGI, Socket Mode) have `async_handler.py`. Sync-only frameworks (Flask, Django, Bottle, CherryPy, Falcon, Pyramid, AWS Lambda, Google Cloud Functions, WSGI) have `handler.py`. + +### Prefer the Middleware Pattern + +Middleware is the project's preferred approach for cross-cutting concerns. Before adding logic to individual listeners or utility functions, consider whether it belongs as a built-in middleware in the framework. + +**When to add built-in middleware:** + +- Cross-cutting concerns that apply to many or all requests (logging, metrics, observability) +- Request validation, transformation, or enrichment +- Authorization extensions beyond the built-in `SingleTeamAuthorization`/`MultiTeamsAuthorization` +- Feature-level request handling (the `Assistant` middleware in `slack_bolt/middleware/assistant/assistant.py` is the canonical example -- it intercepts assistant thread events and dispatches them to registered sub-listeners) + +**How to add built-in middleware:** + +1. Subclass `Middleware` (sync) and implement `process(self, *, req, resp, next)`. Call `next()` to continue the chain. +2. Subclass `AsyncMiddleware` (async) and implement `async_process(self, *, req, resp, next)`. Call `await next()` to continue. +3. Export from `slack_bolt/middleware/__init__.py` (sync) and `slack_bolt/middleware/async_builtins.py` (async). +4. Register the middleware in `App.__init__()` (`slack_bolt/app/app.py`) and `AsyncApp.__init__()` (`slack_bolt/app/async_app.py`) where the default middleware chain is assembled. + +**Canonical example:** `AttachingFunctionToken` (`slack_bolt/middleware/attaching_function_token/`) is a good small middleware to follow -- it has a clean sync/async pair, a focused `process()` method, and is properly exported and registered in the app's middleware chain. + +### Single Runtime Dependency Rule + +The core package depends ONLY on `slack_sdk` (defined in `pyproject.toml`). Never add runtime dependencies to `pyproject.toml`. Additional dependencies go in the appropriate `requirements/*.txt` file. + ## Architecture ### Request Processing Pipeline @@ -90,49 +158,12 @@ Listeners receive arguments by parameter name. The framework inspects function s Each adapter in `slack_bolt/adapter/` converts between a web framework's request/response types and `BoltRequest`/`BoltResponse`. Adapters exist for: Flask, FastAPI, Django, Starlette, Sanic, Bottle, Tornado, CherryPy, Falcon, Pyramid, AWS Lambda, Google Cloud Functions, Socket Mode, WSGI, ASGI, and more. -### Sync/Async Mirroring Pattern - -**This is the most important pattern in this codebase.** Almost every module has both a sync and async variant. When you modify one, you almost always must modify the other. - -**File naming convention:** Async files use the `async_` prefix alongside their sync counterpart: - -```text -slack_bolt/middleware/custom_middleware.py # sync -slack_bolt/middleware/async_custom_middleware.py # async - -slack_bolt/context/say/say.py # sync -slack_bolt/context/say/async_say.py # async - -slack_bolt/listener/custom_listener.py # sync -slack_bolt/listener/async_listener.py # async - -slack_bolt/adapter/fastapi/async_handler.py # async-only (no sync FastAPI adapter) -slack_bolt/adapter/flask/handler.py # sync-only (no async Flask adapter) -``` - -**Which modules come in sync/async pairs:** - -- `slack_bolt/app/` -- `app.py` / `async_app.py` -- `slack_bolt/middleware/` -- every middleware has an `async_` counterpart -- `slack_bolt/listener/` -- `listener.py` / `async_listener.py`, plus error/completion/start handlers -- `slack_bolt/listener_matcher/` -- `builtins.py` / `async_builtins.py` -- `slack_bolt/context/` -- each subdirectory (e.g., `say/`, `ack/`, `respond/`) has `async_` variants -- `slack_bolt/kwargs_injection/` -- `args.py` / `async_args.py`, `utils.py` / `async_utils.py` - -**Adapters are an exception:** Most adapters are sync-only or async-only depending on the framework. Async-native frameworks (FastAPI, Starlette, Sanic, Tornado, ASGI, Socket Mode) have `async_handler.py`. Sync-only frameworks (Flask, Django, Bottle, CherryPy, Falcon, Pyramid, AWS Lambda, Google Cloud Functions, WSGI) have `handler.py`. - ### AI Agents & Assistants `BoltAgent` (`slack_bolt/agent/`) provides `chat_stream()`, `set_status()`, and `set_suggested_prompts()` for AI-powered agents. `Assistant` middleware (`slack_bolt/middleware/assistant/`) handles assistant thread events. ## Key Development Patterns -### Adding or Modifying Middleware - -1. Implement the sync version in `slack_bolt/middleware/` (subclass `Middleware`, implement `process()`) -2. Implement the async version with `async_` prefix (subclass `AsyncMiddleware`, implement `async_process()`) -3. Export built-in middleware from `slack_bolt/middleware/__init__.py` (sync) and `async_builtins.py` (async) - ### Adding a Context Utility Each context utility lives in its own subdirectory under `slack_bolt/context/`: @@ -153,7 +184,7 @@ Then wire it into `BoltContext` (`slack_bolt/context/context.py`) and `AsyncBolt 2. Add `__init__.py` and `handler.py` (or `async_handler.py` for async frameworks) 3. The handler converts the framework's request to `BoltRequest`, calls `app.dispatch()`, and converts `BoltResponse` back 4. Add the framework to `requirements/adapter.txt` with version constraints -5. Add adapter tests in `tests/adapter_tests/` (or `tests/adapter_tests_async/`) +5. Add adapter tests in `tests/adapter_tests/` (sync) or `tests/adapter_tests_async/` (async) ### Adding a Kwargs-Injectable Argument @@ -161,6 +192,13 @@ Then wire it into `BoltContext` (`slack_bolt/context/context.py`) and `AsyncBolt 2. Update the `Args` class with the new property 3. Populate the arg in the appropriate context or listener setup code +## Security Considerations + +- **Request Verification:** The built-in `RequestVerification` middleware validates `x-slack-signature` and `x-slack-request-timestamp` on every incoming HTTP request. Never disable this in production. It is automatically skipped for `socket_mode` requests. +- **Tokens & Secrets:** `SLACK_SIGNING_SECRET` and `SLACK_BOT_TOKEN` must come from environment variables. Never hardcode or commit secrets. +- **Authorization Middleware:** `SingleTeamAuthorization` and `MultiTeamsAuthorization` verify tokens and inject an authorized `WebClient` into the context. Do not bypass these. +- **Tests:** Always use mock servers (`tests/mock_web_api_server/`) and dummy values. Never use real tokens in tests. + ## Dependencies The core package has a **single required runtime dependency**: `slack_sdk` (defined in `pyproject.toml`). Do not add runtime dependencies. @@ -176,7 +214,9 @@ The core package has a **single required runtime dependency**: `slack_sdk` (defi When adding a new dependency: add it to the appropriate `requirements/*.txt` file with version constraints, never to `pyproject.toml` `dependencies` (unless it's a core runtime dep, which is very rare). -## Test Organization +## Test Organization and CI + +### Directory Structure - `tests/scenario_tests/` -- Integration-style tests with realistic Slack payloads - `tests/slack_bolt/` -- Unit tests mirroring the source structure @@ -188,15 +228,19 @@ When adding a new dependency: add it to the appropriate `requirements/*.txt` fil **Mock server:** Many tests use `tests/mock_web_api_server/` to simulate Slack API responses. Look at existing tests for usage patterns rather than making real API calls. -## Code Style +### CI Pipeline + +GitHub Actions (`.github/workflows/ci-build.yml`) runs on every push to `main` and every PR: -- **Black** formatter configured in `pyproject.toml` (line-length=125) -- **Flake8** linter configured in `.flake8` (line-length=125, ignores: F841,F821,W503,E402) -- **MyPy** configured in `pyproject.toml` -- **pytest** configured in `pyproject.toml` +- **Lint** -- `./scripts/lint.sh` on latest Python +- **Typecheck** -- `./scripts/run_mypy.sh` on latest Python +- **Unit tests** -- full test suite across Python 3.7--3.14 matrix +- **Code coverage** -- uploaded to Codecov -## GitHub & CI/CD +## PR and Commit Guidelines -- `.github/` -- GitHub-specific configuration and documentation -- `.github/workflows/` -- Continuous integration pipeline definitions that run on GitHub Actions -- `.github/maintainers_guide.md` -- Maintainer workflows and release process +- PRs target the `main` branch +- You MUST run `./scripts/install_all_and_run_tests.sh` before submitting +- PR template (`.github/pull_request_template.md`) requires: Summary, Testing steps, Category checkboxes (`App`, `AsyncApp`, Adapters, Docs, Others) +- Requirements: CLA signed, test suite passes, code review approval +- Commits should be atomic with descriptive messages. Reference related issue numbers. From 898e0b8c987de9df42c89640e0bcbf4acd7a2e56 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Mon, 16 Mar 2026 11:35:03 -0700 Subject: [PATCH 702/719] chore: format project to latest fomatter version (#1460) --- slack_bolt/app/app.py | 4 +- slack_bolt/app/async_app.py | 6 +- slack_bolt/middleware/assistant/assistant.py | 18 ++-- .../middleware/assistant/async_assistant.py | 26 ++--- slack_bolt/request/payload_utils.py | 1 - tests/scenario_tests/test_view_submission.py | 1 - .../test_view_submission.py | 1 - .../logger/test_unmatched_suggestions.py | 98 ++++++------------- .../logger/test_unmatched_suggestions.py | 98 ++++++------------- 9 files changed, 83 insertions(+), 170 deletions(-) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 5a7f32917..fcf5bb788 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -1401,7 +1401,7 @@ def _init_context(self, req: BoltRequest): # For AI Agents & Assistants if is_assistant_event(req.body): assistant = AssistantUtilities( - payload=to_event(req.body), # type:ignore[arg-type] + payload=to_event(req.body), # type: ignore[arg-type] context=req.context, thread_context_store=self._assistant_thread_context_store, ) @@ -1457,7 +1457,7 @@ def _register_listener( CustomListener( app_name=self.name, ack_function=functions.pop(0), - lazy_functions=functions, # type:ignore[arg-type] + lazy_functions=functions, # type: ignore[arg-type] matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 39f3c3c0e..62c491084 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -616,7 +616,7 @@ async def async_middleware_next(): self._framework_logger.debug(debug_checking_listener(listener_name)) if await listener.async_matches(req=req, resp=resp): # type: ignore[arg-type] # run all the middleware attached to this listener first - (middleware_resp, next_was_not_called) = await listener.run_async_middleware( + middleware_resp, next_was_not_called = await listener.run_async_middleware( req=req, resp=resp # type: ignore[arg-type] ) if next_was_not_called: @@ -1434,7 +1434,7 @@ def _init_context(self, req: AsyncBoltRequest): # For AI Agents & Assistants if is_assistant_event(req.body): assistant = AsyncAssistantUtilities( - payload=to_event(req.body), # type:ignore[arg-type] + payload=to_event(req.body), # type: ignore[arg-type] context=req.context, thread_context_store=self._assistant_thread_context_store, ) @@ -1495,7 +1495,7 @@ def _register_listener( AsyncCustomListener( app_name=self.name, ack_function=functions.pop(0), - lazy_functions=functions, # type:ignore[arg-type] + lazy_functions=functions, # type: ignore[arg-type] matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, diff --git a/slack_bolt/middleware/assistant/assistant.py b/slack_bolt/middleware/assistant/assistant.py index beac71bca..d61386105 100644 --- a/slack_bolt/middleware/assistant/assistant.py +++ b/slack_bolt/middleware/assistant/assistant.py @@ -67,7 +67,7 @@ def thread_started( self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -106,7 +106,7 @@ def user_message( self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -145,7 +145,7 @@ def bot_message( self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -184,7 +184,7 @@ def thread_context_changed( self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -214,13 +214,13 @@ def _merge_matchers( ): return [CustomListenerMatcher(app_name=self.app_name, func=primary_matcher)] + ( custom_matchers or [] - ) # type:ignore[operator] + ) # type: ignore[operator] @staticmethod def default_thread_context_changed(save_thread_context: SaveThreadContext, payload: dict): save_thread_context(payload["assistant_thread"]["context"]) - def process( # type:ignore[return] + def process( # type: ignore[return] self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse] ) -> Optional[BoltResponse]: if self._thread_context_changed_listeners is None: @@ -255,8 +255,8 @@ def build_listener( middleware: Optional[List[Middleware]] = None, base_logger: Optional[Logger] = None, ) -> Listener: - if isinstance(listener_or_functions, Callable): # type:ignore[arg-type] - listener_or_functions = [listener_or_functions] # type:ignore[list-item] + if isinstance(listener_or_functions, Callable): # type: ignore[arg-type] + listener_or_functions = [listener_or_functions] # type: ignore[list-item] if isinstance(listener_or_functions, Listener): return listener_or_functions @@ -270,7 +270,7 @@ def build_listener( for matcher in matchers: if isinstance(matcher, ListenerMatcher): listener_matchers.append(matcher) - elif isinstance(matcher, Callable): # type:ignore[arg-type] + elif isinstance(matcher, Callable): # type: ignore[arg-type] listener_matchers.append( build_listener_matcher( func=matcher, diff --git a/slack_bolt/middleware/assistant/async_assistant.py b/slack_bolt/middleware/assistant/async_assistant.py index 2fdd828d7..ae82595a8 100644 --- a/slack_bolt/middleware/assistant/async_assistant.py +++ b/slack_bolt/middleware/assistant/async_assistant.py @@ -63,7 +63,7 @@ def thread_started( func=is_assistant_thread_started_event, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -72,7 +72,7 @@ def thread_started( self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -109,7 +109,7 @@ def user_message( func=is_user_message_event_in_assistant_thread, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -118,7 +118,7 @@ def user_message( self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -155,7 +155,7 @@ def bot_message( func=is_bot_message_event_in_assistant_thread, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -164,7 +164,7 @@ def bot_message( self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -201,7 +201,7 @@ def thread_context_changed( func=is_assistant_thread_context_changed_event, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -210,7 +210,7 @@ def thread_context_changed( self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -238,14 +238,14 @@ def _merge_matchers( primary_matcher: Union[Callable[..., bool], AsyncListenerMatcher], custom_matchers: Optional[Union[Callable[..., bool], AsyncListenerMatcher]], ): - return [primary_matcher] + (custom_matchers or []) # type:ignore[operator] + return [primary_matcher] + (custom_matchers or []) # type: ignore[operator] @staticmethod async def default_thread_context_changed(save_thread_context: AsyncSaveThreadContext, payload: dict): new_context: dict = payload["assistant_thread"]["context"] await save_thread_context(new_context) - async def async_process( # type:ignore[return] + async def async_process( # type: ignore[return] self, *, req: AsyncBoltRequest, @@ -284,8 +284,8 @@ def build_listener( middleware: Optional[List[AsyncMiddleware]] = None, base_logger: Optional[Logger] = None, ) -> AsyncListener: - if isinstance(listener_or_functions, Callable): # type:ignore[arg-type] - listener_or_functions = [listener_or_functions] # type:ignore[list-item] + if isinstance(listener_or_functions, Callable): # type: ignore[arg-type] + listener_or_functions = [listener_or_functions] # type: ignore[list-item] if isinstance(listener_or_functions, AsyncListener): return listener_or_functions @@ -302,7 +302,7 @@ def build_listener( else: listener_matchers.append( build_listener_matcher( - func=matcher, # type:ignore[arg-type] + func=matcher, # type: ignore[arg-type] asyncio=True, base_logger=base_logger, ) diff --git a/slack_bolt/request/payload_utils.py b/slack_bolt/request/payload_utils.py index c1016c65d..1ebf70d4f 100644 --- a/slack_bolt/request/payload_utils.py +++ b/slack_bolt/request/payload_utils.py @@ -1,6 +1,5 @@ from typing import Dict, Any, Optional - # ------------------------------------------ # Public Utilities # ------------------------------------------ diff --git a/tests/scenario_tests/test_view_submission.py b/tests/scenario_tests/test_view_submission.py index b0eb58212..0f5b23f85 100644 --- a/tests/scenario_tests/test_view_submission.py +++ b/tests/scenario_tests/test_view_submission.py @@ -14,7 +14,6 @@ ) from tests.utils import remove_os_env_temporarily, restore_os_env - body = { "type": "view_submission", "team": { diff --git a/tests/scenario_tests_async/test_view_submission.py b/tests/scenario_tests_async/test_view_submission.py index 49a6e8fc5..6511243fa 100644 --- a/tests/scenario_tests_async/test_view_submission.py +++ b/tests/scenario_tests_async/test_view_submission.py @@ -15,7 +15,6 @@ ) from tests.utils import remove_os_env_temporarily, restore_os_env - body = { "type": "view_submission", "team": { diff --git a/tests/slack_bolt/logger/test_unmatched_suggestions.py b/tests/slack_bolt/logger/test_unmatched_suggestions.py index 2c0c82b99..b470fa061 100644 --- a/tests/slack_bolt/logger/test_unmatched_suggestions.py +++ b/tests/slack_bolt/logger/test_unmatched_suggestions.py @@ -22,8 +22,7 @@ def test_block_actions(self): "block_id": "b", "action_id": "action-id-value", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -31,9 +30,7 @@ def test_block_actions(self): def handle_some_action(ack, body, logger): ack() logger.info(body) -""" - == message - ) +""" == message def test_attachment_actions(self): req: BoltRequest = BoltRequest(body=attachment_actions, mode="socket_mode") @@ -49,8 +46,7 @@ def test_attachment_actions(self): } ], } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -58,9 +54,7 @@ def test_attachment_actions(self): def handle_some_action(ack, body, logger): ack() logger.info(body) -""" - == message - ) +""" == message def test_app_mention_event(self): req: BoltRequest = BoltRequest(body=app_mention_event, mode="socket_mode") @@ -69,17 +63,14 @@ def test_app_mention_event(self): "event": {"type": "app_mention"}, } message = warning_unhandled_request(req) - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @app.event("app_mention") def handle_app_mention_events(body, logger): logger.info(body) -""" - == message - ) +""" == message def test_function_event(self): req: BoltRequest = BoltRequest(body=function_event, mode="socket_mode") @@ -88,8 +79,7 @@ def test_function_event(self): "event": {"type": "function_executed"}, } message = warning_unhandled_request(req) - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -104,9 +94,7 @@ def handle_some_function(ack, body, complete, fail, logger): except Exception as e: error = f"Failed to handle a function request (error: {{e}})" fail(error=error) -""" - == message - ) +""" == message def test_commands(self): req: BoltRequest = BoltRequest(body=slash_command, mode="socket_mode") @@ -115,8 +103,7 @@ def test_commands(self): "type": None, "command": "/start-conv", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -124,9 +111,7 @@ def test_commands(self): def handle_some_command(ack, body, logger): ack() logger.info(body) -""" - == message - ) +""" == message def test_shortcut(self): req: BoltRequest = BoltRequest(body=global_shortcut, mode="socket_mode") @@ -135,8 +120,7 @@ def test_shortcut(self): "type": "shortcut", "callback_id": "test-shortcut", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -144,9 +128,7 @@ def test_shortcut(self): def handle_shortcuts(ack, body, logger): ack() logger.info(body) -""" - == message - ) +""" == message req: BoltRequest = BoltRequest(body=message_shortcut, mode="socket_mode") message = warning_unhandled_request(req) @@ -154,8 +136,7 @@ def handle_shortcuts(ack, body, logger): "type": "message_action", "callback_id": "test-shortcut", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -163,9 +144,7 @@ def handle_shortcuts(ack, body, logger): def handle_shortcuts(ack, body, logger): ack() logger.info(body) -""" - == message - ) +""" == message def test_view(self): req: BoltRequest = BoltRequest(body=view_submission, mode="socket_mode") @@ -174,8 +153,7 @@ def test_view(self): "type": "view_submission", "view": {"type": "modal", "callback_id": "view-id"}, } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -183,9 +161,7 @@ def test_view(self): def handle_view_submission_events(ack, body, logger): ack() logger.info(body) -""" - == message - ) +""" == message req: BoltRequest = BoltRequest(body=view_closed, mode="socket_mode") message = warning_unhandled_request(req) @@ -193,8 +169,7 @@ def handle_view_submission_events(ack, body, logger): "type": "view_closed", "view": {"type": "modal", "callback_id": "view-id"}, } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -202,9 +177,7 @@ def handle_view_submission_events(ack, body, logger): def handle_view_closed_events(ack, body, logger): ack() logger.info(body) -""" - == message - ) +""" == message def test_block_suggestion(self): req: BoltRequest = BoltRequest(body=block_suggestion, mode="socket_mode") @@ -216,17 +189,14 @@ def test_block_suggestion(self): "action_id": "the-id", "value": "search word", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @app.options("the-id") def handle_some_options(ack): ack(options=[ ... ]) -""" - == message - ) +""" == message def test_dialog_suggestion(self): req: BoltRequest = BoltRequest(body=dialog_suggestion, mode="socket_mode") @@ -236,17 +206,14 @@ def test_dialog_suggestion(self): "callback_id": "the-id", "value": "search keyword", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @app.options({{"type": "dialog_suggestion", "callback_id": "the-id"}}) def handle_some_options(ack): ack(options=[ ... ]) -""" - == message - ) +""" == message def test_step(self): req: BoltRequest = BoltRequest(body=step_edit_payload, mode="socket_mode") @@ -255,8 +222,7 @@ def test_step(self): "type": "workflow_step_edit", "callback_id": "copy_review", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -269,17 +235,14 @@ def test_step(self): ) # Pass Step to set up listeners app.step(ws) -""" - == message - ) +""" == message req: BoltRequest = BoltRequest(body=step_save_payload, mode="socket_mode") message = warning_unhandled_request(req) filtered_body = { "type": "view_submission", "view": {"type": "workflow_step", "callback_id": "copy_review"}, } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -292,17 +255,14 @@ def test_step(self): ) # Pass Step to set up listeners app.step(ws) -""" - == message - ) +""" == message req: BoltRequest = BoltRequest(body=step_execute_payload, mode="socket_mode") message = warning_unhandled_request(req) filtered_body = { "type": "event_callback", "event": {"type": "workflow_step_execute"}, } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -315,9 +275,7 @@ def test_step(self): ) # Pass Step to set up listeners app.step(ws) -""" - == message - ) +""" == message block_actions = { diff --git a/tests/slack_bolt_async/logger/test_unmatched_suggestions.py b/tests/slack_bolt_async/logger/test_unmatched_suggestions.py index 93343c4a2..d8c659892 100644 --- a/tests/slack_bolt_async/logger/test_unmatched_suggestions.py +++ b/tests/slack_bolt_async/logger/test_unmatched_suggestions.py @@ -22,8 +22,7 @@ def test_block_actions(self): "block_id": "b", "action_id": "action-id-value", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -31,9 +30,7 @@ def test_block_actions(self): async def handle_some_action(ack, body, logger): await ack() logger.info(body) -""" - == message - ) +""" == message def test_attachment_actions(self): req: AsyncBoltRequest = AsyncBoltRequest(body=attachment_actions, mode="socket_mode") @@ -49,8 +46,7 @@ def test_attachment_actions(self): } ], } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -58,9 +54,7 @@ def test_attachment_actions(self): async def handle_some_action(ack, body, logger): await ack() logger.info(body) -""" - == message - ) +""" == message def test_app_mention_event(self): req: AsyncBoltRequest = AsyncBoltRequest(body=app_mention_event, mode="socket_mode") @@ -69,17 +63,14 @@ def test_app_mention_event(self): "event": {"type": "app_mention"}, } message = warning_unhandled_request(req) - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @app.event("app_mention") async def handle_app_mention_events(body, logger): logger.info(body) -""" - == message - ) +""" == message def test_function_event(self): req: AsyncBoltRequest = AsyncBoltRequest(body=function_event, mode="socket_mode") @@ -88,8 +79,7 @@ def test_function_event(self): "event": {"type": "function_executed"}, } message = warning_unhandled_request(req) - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -104,9 +94,7 @@ async def handle_some_function(ack, body, complete, fail, logger): except Exception as e: error = f"Failed to handle a function request (error: {{e}})" await fail(error=error) -""" - == message - ) +""" == message def test_commands(self): req: AsyncBoltRequest = AsyncBoltRequest(body=slash_command, mode="socket_mode") @@ -115,8 +103,7 @@ def test_commands(self): "type": None, "command": "/start-conv", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -124,9 +111,7 @@ def test_commands(self): async def handle_some_command(ack, body, logger): await ack() logger.info(body) -""" - == message - ) +""" == message def test_shortcut(self): req: AsyncBoltRequest = AsyncBoltRequest(body=global_shortcut, mode="socket_mode") @@ -135,8 +120,7 @@ def test_shortcut(self): "type": "shortcut", "callback_id": "test-shortcut", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -144,9 +128,7 @@ def test_shortcut(self): async def handle_shortcuts(ack, body, logger): await ack() logger.info(body) -""" - == message - ) +""" == message req: AsyncBoltRequest = AsyncBoltRequest(body=message_shortcut, mode="socket_mode") message = warning_unhandled_request(req) @@ -154,8 +136,7 @@ async def handle_shortcuts(ack, body, logger): "type": "message_action", "callback_id": "test-shortcut", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -163,9 +144,7 @@ async def handle_shortcuts(ack, body, logger): async def handle_shortcuts(ack, body, logger): await ack() logger.info(body) -""" - == message - ) +""" == message def test_view(self): req: AsyncBoltRequest = AsyncBoltRequest(body=view_submission, mode="socket_mode") @@ -174,8 +153,7 @@ def test_view(self): "type": "view_submission", "view": {"type": "modal", "callback_id": "view-id"}, } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -183,9 +161,7 @@ def test_view(self): async def handle_view_submission_events(ack, body, logger): await ack() logger.info(body) -""" - == message - ) +""" == message req: AsyncBoltRequest = AsyncBoltRequest(body=view_closed, mode="socket_mode") message = warning_unhandled_request(req) @@ -193,8 +169,7 @@ async def handle_view_submission_events(ack, body, logger): "type": "view_closed", "view": {"type": "modal", "callback_id": "view-id"}, } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -202,9 +177,7 @@ async def handle_view_submission_events(ack, body, logger): async def handle_view_closed_events(ack, body, logger): await ack() logger.info(body) -""" - == message - ) +""" == message def test_block_suggestion(self): req: AsyncBoltRequest = AsyncBoltRequest(body=block_suggestion, mode="socket_mode") @@ -216,17 +189,14 @@ def test_block_suggestion(self): "action_id": "the-id", "value": "search word", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @app.options("the-id") async def handle_some_options(ack): await ack(options=[ ... ]) -""" - == message - ) +""" == message def test_dialog_suggestion(self): req: AsyncBoltRequest = AsyncBoltRequest(body=dialog_suggestion, mode="socket_mode") @@ -236,17 +206,14 @@ def test_dialog_suggestion(self): "callback_id": "the-id", "value": "search keyword", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @app.options({{"type": "dialog_suggestion", "callback_id": "the-id"}}) async def handle_some_options(ack): await ack(options=[ ... ]) -""" - == message - ) +""" == message def test_step(self): req: AsyncBoltRequest = AsyncBoltRequest(body=step_edit_payload, mode="socket_mode") @@ -255,8 +222,7 @@ def test_step(self): "type": "workflow_step_edit", "callback_id": "copy_review", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -269,17 +235,14 @@ def test_step(self): ) # Pass Step to set up listeners app.step(ws) -""" - == message - ) +""" == message req: AsyncBoltRequest = AsyncBoltRequest(body=step_save_payload, mode="socket_mode") message = warning_unhandled_request(req) filtered_body = { "type": "view_submission", "view": {"type": "workflow_step", "callback_id": "copy_review"}, } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -292,17 +255,14 @@ def test_step(self): ) # Pass Step to set up listeners app.step(ws) -""" - == message - ) +""" == message req: AsyncBoltRequest = AsyncBoltRequest(body=step_execute_payload, mode="socket_mode") message = warning_unhandled_request(req) filtered_body = { "type": "event_callback", "event": {"type": "workflow_step_execute"}, } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -315,9 +275,7 @@ def test_step(self): ) # Pass Step to set up listeners app.step(ws) -""" - == message - ) +""" == message block_actions = { From f0db283064225c2247a32bf9febb28efbbe3a498 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Tue, 17 Mar 2026 06:21:14 -0700 Subject: [PATCH 703/719] chore: improve testing around assistant utilities (#1461) --- tests/scenario_tests/test_events_assistant.py | 138 +++++++-- ...est_events_assistant_without_middleware.py | 249 ++++++++++++++++ .../test_events_assistant.py | 152 ++++++++-- ...est_events_assistant_without_middleware.py | 268 ++++++++++++++++++ 4 files changed, 750 insertions(+), 57 deletions(-) create mode 100644 tests/scenario_tests/test_events_assistant_without_middleware.py create mode 100644 tests/scenario_tests_async/test_events_assistant_without_middleware.py diff --git a/tests/scenario_tests/test_events_assistant.py b/tests/scenario_tests/test_events_assistant.py index 07f7ede53..3372380fd 100644 --- a/tests/scenario_tests/test_events_assistant.py +++ b/tests/scenario_tests/test_events_assistant.py @@ -1,4 +1,4 @@ -from time import sleep +import time from slack_sdk.web import WebClient @@ -10,6 +10,13 @@ from tests.utils import remove_os_env_temporarily, restore_os_env +def assert_target_called(called: dict, timeout: float = 0.5): + deadline = time.time() + timeout + while called["value"] is not True and time.time() < deadline: + time.sleep(0.1) + assert called["value"] is True + + class TestEventsAssistant: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" @@ -26,81 +33,156 @@ def teardown_method(self): cleanup_mock_web_api_server(self) restore_os_env(self.old_os_env) - def test_assistant_threads(self): + def test_thread_started(self): app = App(client=self.web_client) assistant = Assistant() - - state = {"called": False} - - def assert_target_called(): - count = 0 - while state["called"] is False and count < 20: - sleep(0.1) - count += 1 - assert state["called"] is True - state["called"] = False + called = {"value": False} @assistant.thread_started - def start_thread(say: Say, set_suggested_prompts: SetSuggestedPrompts, context: BoltContext): + def start_thread(say: Say, set_suggested_prompts: SetSuggestedPrompts, set_status: SetStatus, context: BoltContext): assert context.channel_id == "D111" assert context.thread_ts == "1726133698.626339" + assert set_status.thread_ts == context.thread_ts + assert say.thread_ts == context.thread_ts say("Hi, how can I help you today?") set_suggested_prompts(prompts=[{"title": "What does SLACK stand for?", "message": "What does SLACK stand for?"}]) set_suggested_prompts( prompts=[{"title": "What does SLACK stand for?", "message": "What does SLACK stand for?"}], title="foo" ) - state["called"] = True + called["value"] = True + + app.assistant(assistant) + + request = BoltRequest(body=thread_started_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called(called) + + def test_thread_context_changed(self): + app = App(client=self.web_client) + assistant = Assistant() + called = {"value": False} @assistant.thread_context_changed def handle_thread_context_changed(context: BoltContext): assert context.channel_id == "D111" assert context.thread_ts == "1726133698.626339" - state["called"] = True + called["value"] = True + + app.assistant(assistant) + + request = BoltRequest(body=thread_context_changed_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called(called) + + def test_user_message(self): + app = App(client=self.web_client) + assistant = Assistant() + called = {"value": False} @assistant.user_message def handle_user_message(say: Say, set_status: SetStatus, context: BoltContext): assert context.channel_id == "D111" assert context.thread_ts == "1726133698.626339" + assert say.thread_ts == context.thread_ts try: set_status("is typing...") say("Here you are!") - state["called"] = True + called["value"] = True except Exception as e: - say(f"Oops, something went wrong (error: {e}") + say(f"Oops, something went wrong (error: {e})") app.assistant(assistant) - request = BoltRequest(body=thread_started_event_body, mode="socket_mode") + request = BoltRequest(body=user_message_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called() + assert_target_called(called) - request = BoltRequest(body=thread_context_changed_event_body, mode="socket_mode") - response = app.dispatch(request) - assert response.status == 200 - assert_target_called() + def test_user_message_with_assistant_thread(self): + app = App(client=self.web_client) + assistant = Assistant() + called = {"value": False} - request = BoltRequest(body=user_message_event_body, mode="socket_mode") - response = app.dispatch(request) - assert response.status == 200 - assert_target_called() + @assistant.user_message + def handle_user_message(say: Say, set_status: SetStatus, context: BoltContext): + assert context.channel_id == "D111" + assert context.thread_ts == "1726133698.626339" + assert say.thread_ts == context.thread_ts + try: + set_status("is typing...") + say("Here you are!") + called["value"] = True + except Exception as e: + say(f"Oops, something went wrong (error: {e})") + + app.assistant(assistant) request = BoltRequest(body=user_message_event_body_with_assistant_thread, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called() + assert_target_called(called) + + def test_message_changed(self): + app = App(client=self.web_client) + assistant = Assistant() + called = {"value": False} + + @assistant.user_message + def handle_user_message(): + called["value"] = True + + @assistant.bot_message + def handle_bot_message(): + called["value"] = True + + app.assistant(assistant) request = BoltRequest(body=message_changed_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 + assert called["value"] is False + + def test_channel_user_message_ignored(self): + app = App(client=self.web_client) + assistant = Assistant() + called = {"value": False} + + @assistant.user_message + def handle_user_message(): + called["value"] = True + + @assistant.bot_message + def handle_bot_message(): + called["value"] = True + + app.assistant(assistant) request = BoltRequest(body=channel_user_message_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 404 + assert called["value"] is False + + def test_channel_message_changed_ignored(self): + app = App(client=self.web_client) + assistant = Assistant() + called = {"value": False} + + @assistant.user_message + def handle_user_message(): + called["value"] = True + + @assistant.bot_message + def handle_bot_message(): + called["value"] = True + + app.assistant(assistant) request = BoltRequest(body=channel_message_changed_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 404 + assert called["value"] is False def build_payload(event: dict) -> dict: diff --git a/tests/scenario_tests/test_events_assistant_without_middleware.py b/tests/scenario_tests/test_events_assistant_without_middleware.py new file mode 100644 index 000000000..5307aa4c6 --- /dev/null +++ b/tests/scenario_tests/test_events_assistant_without_middleware.py @@ -0,0 +1,249 @@ +from slack_sdk.web import WebClient + +from slack_bolt import App, BoltRequest, Say, SetStatus, SetTitle, SaveThreadContext, BoltContext +from slack_bolt.context.get_thread_context.get_thread_context import GetThreadContext +from slack_bolt.context.set_suggested_prompts.set_suggested_prompts import SetSuggestedPrompts +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.scenario_tests.test_events_assistant import ( + assert_target_called, + channel_message_changed_event_body, + channel_user_message_event_body, + message_changed_event_body, + thread_context_changed_event_body, + thread_started_event_body, + user_message_event_body, + user_message_event_body_with_assistant_thread, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestEventsAssistantWithoutMiddleware: + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def test_thread_started(self): + app = App(client=self.web_client) + called = {"value": False} + + @app.event("assistant_thread_started") + def handle_assistant_thread_started( + say: Say, + set_status: SetStatus, + set_title: SetTitle, + set_suggested_prompts: SetSuggestedPrompts, + get_thread_context: GetThreadContext, + save_thread_context: SaveThreadContext, + context: BoltContext, + ): + assert context.channel_id == "D111" + assert context.thread_ts == "1726133698.626339" + assert say.thread_ts == context.thread_ts + assert set_status is not None + assert set_title is not None + assert set_suggested_prompts is not None + assert get_thread_context is not None + assert save_thread_context is not None + say("Hi, how can I help you today?") + set_suggested_prompts(prompts=[{"title": "What does SLACK stand for?", "message": "What does SLACK stand for?"}]) + called["value"] = True + + request = BoltRequest(body=thread_started_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called(called) + + def test_thread_context_changed(self): + app = App(client=self.web_client) + called = {"value": False} + + @app.event("assistant_thread_context_changed") + def handle_assistant_thread_context_changed( + say: Say, + set_status: SetStatus, + set_title: SetTitle, + set_suggested_prompts: SetSuggestedPrompts, + get_thread_context: GetThreadContext, + save_thread_context: SaveThreadContext, + context: BoltContext, + ): + assert context.channel_id == "D111" + assert context.thread_ts == "1726133698.626339" + assert say.thread_ts == context.thread_ts + assert set_status is not None + assert set_title is not None + assert set_suggested_prompts is not None + assert get_thread_context is not None + assert save_thread_context is not None + called["value"] = True + + request = BoltRequest(body=thread_context_changed_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called(called) + + def test_user_message(self): + app = App(client=self.web_client) + called = {"value": False} + + @app.message("") + def handle_message( + say: Say, + set_status: SetStatus, + set_title: SetTitle, + set_suggested_prompts: SetSuggestedPrompts, + get_thread_context: GetThreadContext, + save_thread_context: SaveThreadContext, + context: BoltContext, + ): + assert context.channel_id == "D111" + assert context.thread_ts == "1726133698.626339" + assert say.thread_ts == context.thread_ts + assert set_status is not None + assert set_title is not None + assert set_suggested_prompts is not None + assert get_thread_context is not None + assert save_thread_context is not None + try: + set_status("is typing...") + say("Here you are!") + called["value"] = True + except Exception as e: + say(f"Oops, something went wrong (error: {e})") + + request = BoltRequest(body=user_message_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called(called) + + def test_user_message_with_assistant_thread(self): + app = App(client=self.web_client) + called = {"value": False} + + @app.message("") + def handle_message( + say: Say, + set_status: SetStatus, + set_title: SetTitle, + set_suggested_prompts: SetSuggestedPrompts, + get_thread_context: GetThreadContext, + save_thread_context: SaveThreadContext, + context: BoltContext, + ): + assert context.channel_id == "D111" + assert context.thread_ts == "1726133698.626339" + assert say.thread_ts == context.thread_ts + assert set_status is not None + assert set_title is not None + assert set_suggested_prompts is not None + assert get_thread_context is not None + assert save_thread_context is not None + try: + set_status("is typing...") + say("Here you are!") + called["value"] = True + except Exception as e: + say(f"Oops, something went wrong (error: {e})") + + request = BoltRequest(body=user_message_event_body_with_assistant_thread, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called(called) + + def test_message_changed(self): + app = App(client=self.web_client) + called = {"value": False} + + @app.event("message") + def handle_message_event( + say: Say, + set_status: SetStatus, + set_title: SetTitle, + set_suggested_prompts: SetSuggestedPrompts, + get_thread_context: GetThreadContext, + save_thread_context: SaveThreadContext, + context: BoltContext, + ): + assert context.thread_ts is None + assert say.thread_ts == context.thread_ts + assert set_status is None + assert set_title is None + assert set_suggested_prompts is None + assert get_thread_context is None + assert save_thread_context is None + called["value"] = True + + request = BoltRequest(body=message_changed_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called(called) + + def test_channel_user_message(self): + app = App(client=self.web_client) + called = {"value": False} + + @app.event("message") + def handle_message_event( + say: Say, + set_status: SetStatus, + set_title: SetTitle, + set_suggested_prompts: SetSuggestedPrompts, + get_thread_context: GetThreadContext, + save_thread_context: SaveThreadContext, + context: BoltContext, + ): + assert context.thread_ts is None + assert say.thread_ts == context.thread_ts + assert set_status is None + assert set_title is None + assert set_suggested_prompts is None + assert get_thread_context is None + assert save_thread_context is None + called["value"] = True + + request = BoltRequest(body=channel_user_message_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called(called) + + def test_channel_message_changed(self): + app = App(client=self.web_client) + called = {"value": False} + + @app.event("message") + def handle_message_event( + say: Say, + set_status: SetStatus, + set_title: SetTitle, + set_suggested_prompts: SetSuggestedPrompts, + get_thread_context: GetThreadContext, + save_thread_context: SaveThreadContext, + context: BoltContext, + ): + assert context.thread_ts is None + assert say.thread_ts == context.thread_ts + assert set_status is None + assert set_title is None + assert set_suggested_prompts is None + assert get_thread_context is None + assert save_thread_context is None + called["value"] = True + + request = BoltRequest(body=channel_message_changed_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called(called) diff --git a/tests/scenario_tests_async/test_events_assistant.py b/tests/scenario_tests_async/test_events_assistant.py index b131b4e38..c6d04474d 100644 --- a/tests/scenario_tests_async/test_events_assistant.py +++ b/tests/scenario_tests_async/test_events_assistant.py @@ -1,4 +1,5 @@ import asyncio +import time import pytest from slack_sdk.web.async_client import AsyncWebClient @@ -17,6 +18,13 @@ from tests.utils import remove_os_env_temporarily, restore_os_env +async def assert_target_called(called: dict, timeout: float = 0.5): + deadline = time.time() + timeout + while called["value"] is not True and time.time() < deadline: + await asyncio.sleep(0.1) + assert called["value"] is True + + class TestAsyncEventsAssistant: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" @@ -29,6 +37,7 @@ class TestAsyncEventsAssistant: def setup_teardown(self): old_os_env = remove_os_env_temporarily() setup_mock_web_api_server_async(self) + try: yield # run the test here finally: @@ -36,25 +45,22 @@ def setup_teardown(self): restore_os_env(old_os_env) @pytest.mark.asyncio - async def test_assistant_events(self): + async def test_thread_started(self): app = AsyncApp(client=self.web_client) - assistant = AsyncAssistant() - - state = {"called": False} - - async def assert_target_called(): - count = 0 - while state["called"] is False and count < 20: - await asyncio.sleep(0.1) - count += 1 - assert state["called"] is True - state["called"] = False + called = {"value": False} @assistant.thread_started - async def start_thread(say: AsyncSay, set_suggested_prompts: AsyncSetSuggestedPrompts, context: AsyncBoltContext): + async def start_thread( + say: AsyncSay, + set_suggested_prompts: AsyncSetSuggestedPrompts, + set_status: AsyncSetStatus, + context: AsyncBoltContext, + ): assert context.channel_id == "D111" assert context.thread_ts == "1726133698.626339" + assert set_status.thread_ts == context.thread_ts + assert say.thread_ts == context.thread_ts await say("Hi, how can I help you today?") await set_suggested_prompts( prompts=[{"title": "What does SLACK stand for?", "message": "What does SLACK stand for?"}] @@ -63,58 +69,146 @@ async def start_thread(say: AsyncSay, set_suggested_prompts: AsyncSetSuggestedPr prompts=[{"title": "What does SLACK stand for?", "message": "What does SLACK stand for?"}], title="foo", ) - state["called"] = True + called["value"] = True + + app.assistant(assistant) + + request = AsyncBoltRequest(body=thread_started_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called(called) + + @pytest.mark.asyncio + async def test_thread_context_changed(self): + app = AsyncApp(client=self.web_client) + assistant = AsyncAssistant() + called = {"value": False} @assistant.thread_context_changed - async def handle_user_message(context: AsyncBoltContext): + async def handle_thread_context_changed(context: AsyncBoltContext): assert context.channel_id == "D111" assert context.thread_ts == "1726133698.626339" - state["called"] = True + called["value"] = True + + app.assistant(assistant) + + request = AsyncBoltRequest(body=thread_context_changed_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called(called) + + @pytest.mark.asyncio + async def test_user_message(self): + app = AsyncApp(client=self.web_client) + assistant = AsyncAssistant() + called = {"value": False} @assistant.user_message async def handle_user_message(say: AsyncSay, set_status: AsyncSetStatus, context: AsyncBoltContext): assert context.channel_id == "D111" assert context.thread_ts == "1726133698.626339" + assert say.thread_ts == context.thread_ts try: await set_status("is typing...") await say("Here you are!") - state["called"] = True + called["value"] = True except Exception as e: - await say(f"Oops, something went wrong (error: {e}") + await say(f"Oops, something went wrong (error: {e})") app.assistant(assistant) - request = AsyncBoltRequest(body=thread_started_event_body, mode="socket_mode") + request = AsyncBoltRequest(body=user_message_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called() + await assert_target_called(called) - request = AsyncBoltRequest(body=thread_context_changed_event_body, mode="socket_mode") - response = await app.async_dispatch(request) - assert response.status == 200 - await assert_target_called() + @pytest.mark.asyncio + async def test_user_message_with_assistant_thread(self): + app = AsyncApp(client=self.web_client) + assistant = AsyncAssistant() + called = {"value": False} - request = AsyncBoltRequest(body=user_message_event_body, mode="socket_mode") - response = await app.async_dispatch(request) - assert response.status == 200 - await assert_target_called() + @assistant.user_message + async def handle_user_message(say: AsyncSay, set_status: AsyncSetStatus, context: AsyncBoltContext): + assert context.channel_id == "D111" + assert context.thread_ts == "1726133698.626339" + assert say.thread_ts == context.thread_ts + try: + await set_status("is typing...") + await say("Here you are!") + called["value"] = True + except Exception as e: + await say(f"Oops, something went wrong (error: {e})") + + app.assistant(assistant) request = AsyncBoltRequest(body=user_message_event_body_with_assistant_thread, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called() + await assert_target_called(called) + + @pytest.mark.asyncio + async def test_message_changed(self): + app = AsyncApp(client=self.web_client) + assistant = AsyncAssistant() + called = {"value": False} + + @assistant.user_message + async def handle_user_message(): + called["value"] = True + + @assistant.bot_message + async def handle_bot_message(): + called["value"] = True + + app.assistant(assistant) request = AsyncBoltRequest(body=message_changed_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 + assert called["value"] is False + + @pytest.mark.asyncio + async def test_channel_user_message_ignored(self): + app = AsyncApp(client=self.web_client) + assistant = AsyncAssistant() + called = {"value": False} + + @assistant.user_message + async def handle_user_message(): + called["value"] = True + + @assistant.bot_message + async def handle_bot_message(): + called["value"] = True + + app.assistant(assistant) request = AsyncBoltRequest(body=channel_user_message_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 404 + assert called["value"] is False + + @pytest.mark.asyncio + async def test_channel_message_changed_ignored(self): + app = AsyncApp(client=self.web_client) + assistant = AsyncAssistant() + called = {"value": False} + + @assistant.user_message + async def handle_user_message(): + called["value"] = True + + @assistant.bot_message + async def handle_bot_message(): + called["value"] = True + + app.assistant(assistant) request = AsyncBoltRequest(body=channel_message_changed_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 404 + assert called["value"] is False def build_payload(event: dict) -> dict: diff --git a/tests/scenario_tests_async/test_events_assistant_without_middleware.py b/tests/scenario_tests_async/test_events_assistant_without_middleware.py new file mode 100644 index 000000000..92f488ff3 --- /dev/null +++ b/tests/scenario_tests_async/test_events_assistant_without_middleware.py @@ -0,0 +1,268 @@ +import pytest +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.context.async_context import AsyncBoltContext +from slack_bolt.context.say.async_say import AsyncSay +from slack_bolt.context.set_status.async_set_status import AsyncSetStatus +from slack_bolt.context.set_title.async_set_title import AsyncSetTitle +from slack_bolt.context.set_suggested_prompts.async_set_suggested_prompts import AsyncSetSuggestedPrompts +from slack_bolt.context.get_thread_context.async_get_thread_context import AsyncGetThreadContext +from slack_bolt.context.save_thread_context.async_save_thread_context import AsyncSaveThreadContext +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + cleanup_mock_web_api_server_async, + setup_mock_web_api_server_async, +) +from tests.scenario_tests_async.test_events_assistant import ( + assert_target_called, + channel_message_changed_event_body, + channel_user_message_event_body, + message_changed_event_body, + thread_context_changed_event_body, + thread_started_event_body, + user_message_event_body, + user_message_event_body_with_assistant_thread, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestAsyncEventsAssistantWithoutMiddleware: + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): + old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) + + try: + yield + finally: + cleanup_mock_web_api_server_async(self) + restore_os_env(old_os_env) + + @pytest.mark.asyncio + async def test_thread_started(self): + app = AsyncApp(client=self.web_client) + called = {"value": False} + + @app.event("assistant_thread_started") + async def handle_assistant_thread_started( + say: AsyncSay, + set_status: AsyncSetStatus, + set_title: AsyncSetTitle, + set_suggested_prompts: AsyncSetSuggestedPrompts, + get_thread_context: AsyncGetThreadContext, + save_thread_context: AsyncSaveThreadContext, + context: AsyncBoltContext, + ): + assert context.channel_id == "D111" + assert context.thread_ts == "1726133698.626339" + assert say.thread_ts == context.thread_ts + assert set_status is not None + assert set_title is not None + assert set_suggested_prompts is not None + assert get_thread_context is not None + assert save_thread_context is not None + await say("Hi, how can I help you today?") + await set_suggested_prompts( + prompts=[{"title": "What does SLACK stand for?", "message": "What does SLACK stand for?"}] + ) + called["value"] = True + + request = AsyncBoltRequest(body=thread_started_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called(called) + + @pytest.mark.asyncio + async def test_thread_context_changed(self): + app = AsyncApp(client=self.web_client) + called = {"value": False} + + @app.event("assistant_thread_context_changed") + async def handle_assistant_thread_context_changed( + say: AsyncSay, + set_status: AsyncSetStatus, + set_title: AsyncSetTitle, + set_suggested_prompts: AsyncSetSuggestedPrompts, + get_thread_context: AsyncGetThreadContext, + save_thread_context: AsyncSaveThreadContext, + context: AsyncBoltContext, + ): + assert context.channel_id == "D111" + assert context.thread_ts == "1726133698.626339" + assert say.thread_ts == context.thread_ts + assert set_status is not None + assert set_title is not None + assert set_suggested_prompts is not None + assert get_thread_context is not None + assert save_thread_context is not None + called["value"] = True + + request = AsyncBoltRequest(body=thread_context_changed_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called(called) + + @pytest.mark.asyncio + async def test_user_message(self): + app = AsyncApp(client=self.web_client) + called = {"value": False} + + @app.message("") + async def handle_message( + say: AsyncSay, + set_status: AsyncSetStatus, + set_title: AsyncSetTitle, + set_suggested_prompts: AsyncSetSuggestedPrompts, + get_thread_context: AsyncGetThreadContext, + save_thread_context: AsyncSaveThreadContext, + context: AsyncBoltContext, + ): + assert context.channel_id == "D111" + assert context.thread_ts == "1726133698.626339" + assert say.thread_ts == context.thread_ts + assert set_status is not None + assert set_title is not None + assert set_suggested_prompts is not None + assert get_thread_context is not None + assert save_thread_context is not None + try: + await set_status("is typing...") + await say("Here you are!") + called["value"] = True + except Exception as e: + await say(f"Oops, something went wrong (error: {e})") + + request = AsyncBoltRequest(body=user_message_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called(called) + + @pytest.mark.asyncio + async def test_user_message_with_assistant_thread(self): + app = AsyncApp(client=self.web_client) + called = {"value": False} + + @app.message("") + async def handle_message( + say: AsyncSay, + set_status: AsyncSetStatus, + set_title: AsyncSetTitle, + set_suggested_prompts: AsyncSetSuggestedPrompts, + get_thread_context: AsyncGetThreadContext, + save_thread_context: AsyncSaveThreadContext, + context: AsyncBoltContext, + ): + assert context.channel_id == "D111" + assert context.thread_ts == "1726133698.626339" + assert say.thread_ts == context.thread_ts + assert set_status is not None + assert set_title is not None + assert set_suggested_prompts is not None + assert get_thread_context is not None + assert save_thread_context is not None + try: + await set_status("is typing...") + await say("Here you are!") + called["value"] = True + except Exception as e: + await say(f"Oops, something went wrong (error: {e})") + + request = AsyncBoltRequest(body=user_message_event_body_with_assistant_thread, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called(called) + + @pytest.mark.asyncio + async def test_message_changed(self): + app = AsyncApp(client=self.web_client) + called = {"value": False} + + @app.event("message") + async def handle_message_event( + say: AsyncSay, + set_status: AsyncSetStatus, + set_title: AsyncSetTitle, + set_suggested_prompts: AsyncSetSuggestedPrompts, + get_thread_context: AsyncGetThreadContext, + save_thread_context: AsyncSaveThreadContext, + context: AsyncBoltContext, + ): + assert context.thread_ts is None + assert say.thread_ts == context.thread_ts + assert set_status is None + assert set_title is None + assert set_suggested_prompts is None + assert get_thread_context is None + assert save_thread_context is None + called["value"] = True + + request = AsyncBoltRequest(body=message_changed_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called(called) + + @pytest.mark.asyncio + async def test_channel_user_message(self): + app = AsyncApp(client=self.web_client) + called = {"value": False} + + @app.event("message") + async def handle_message_event( + say: AsyncSay, + set_status: AsyncSetStatus, + set_title: AsyncSetTitle, + set_suggested_prompts: AsyncSetSuggestedPrompts, + get_thread_context: AsyncGetThreadContext, + save_thread_context: AsyncSaveThreadContext, + context: AsyncBoltContext, + ): + assert context.thread_ts is None + assert say.thread_ts == context.thread_ts + assert set_status is None + assert set_title is None + assert set_suggested_prompts is None + assert get_thread_context is None + assert save_thread_context is None + called["value"] = True + + request = AsyncBoltRequest(body=channel_user_message_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called(called) + + @pytest.mark.asyncio + async def test_channel_message_changed(self): + app = AsyncApp(client=self.web_client) + called = {"value": False} + + @app.event("message") + async def handle_message_event( + say: AsyncSay, + set_status: AsyncSetStatus, + set_title: AsyncSetTitle, + set_suggested_prompts: AsyncSetSuggestedPrompts, + get_thread_context: AsyncGetThreadContext, + save_thread_context: AsyncSaveThreadContext, + context: AsyncBoltContext, + ): + assert context.thread_ts is None + assert say.thread_ts == context.thread_ts + assert set_status is None + assert set_title is None + assert set_suggested_prompts is None + assert get_thread_context is None + assert save_thread_context is None + called["value"] = True + + request = AsyncBoltRequest(body=channel_message_changed_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called(called) From 785b81352ccf2d382c430c7cf57bc05c8f167599 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Tue, 17 Mar 2026 10:01:06 -0700 Subject: [PATCH 704/719] fix(assistant): improve middleware dispatch and inject kwargs in middleware (#1456) --- slack_bolt/app/app.py | 27 +-- slack_bolt/app/async_app.py | 24 +-- slack_bolt/context/async_context.py | 2 +- slack_bolt/context/context.py | 2 +- slack_bolt/middleware/__init__.py | 2 + slack_bolt/middleware/assistant/assistant.py | 11 + .../middleware/assistant/async_assistant.py | 11 + slack_bolt/middleware/async_builtins.py | 2 + .../attaching_agent_kwargs/__init__.py | 5 + .../async_attaching_agent_kwargs.py | 39 ++++ .../attaching_agent_kwargs.py | 33 +++ slack_bolt/request/internals.py | 39 +--- tests/scenario_tests/test_events_assistant.py | 71 +++++++ ...est_events_assistant_without_middleware.py | 31 ++- .../test_events_assistant.py | 127 +++++++++++ ...est_events_assistant_without_middleware.py | 32 ++- .../attaching_agent_kwargs/__init__.py | 0 .../test_attaching_agent_kwargs.py | 64 ++++++ tests/slack_bolt/request/test_internals.py | 201 ++++++++++++++++++ .../attaching_agent_kwargs/__init__.py | 0 .../test_async_attaching_agent_kwargs.py | 69 ++++++ 21 files changed, 715 insertions(+), 77 deletions(-) create mode 100644 slack_bolt/middleware/attaching_agent_kwargs/__init__.py create mode 100644 slack_bolt/middleware/attaching_agent_kwargs/async_attaching_agent_kwargs.py create mode 100644 slack_bolt/middleware/attaching_agent_kwargs/attaching_agent_kwargs.py create mode 100644 tests/slack_bolt/middleware/attaching_agent_kwargs/__init__.py create mode 100644 tests/slack_bolt/middleware/attaching_agent_kwargs/test_attaching_agent_kwargs.py create mode 100644 tests/slack_bolt_async/middleware/attaching_agent_kwargs/__init__.py create mode 100644 tests/slack_bolt_async/middleware/attaching_agent_kwargs/test_async_attaching_agent_kwargs.py diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index fcf5bb788..566eb82d7 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -22,7 +22,6 @@ from slack_bolt.context.assistant.thread_context_store.store import AssistantThreadContextStore -from slack_bolt.context.assistant.assistant_utilities import AssistantUtilities from slack_bolt.error import BoltError, BoltUnhandledRequestError from slack_bolt.lazy_listener.thread_runner import ThreadLazyListenerRunner from slack_bolt.listener.builtins import TokenRevocationListeners @@ -70,6 +69,7 @@ IgnoringSelfEvents, CustomMiddleware, AttachingFunctionToken, + AttachingAgentKwargs, ) from slack_bolt.middleware.assistant import Assistant from slack_bolt.middleware.message_listener_matches import MessageListenerMatches @@ -83,10 +83,6 @@ from slack_bolt.oauth.internals import select_consistent_installation_store from slack_bolt.oauth.oauth_settings import OAuthSettings from slack_bolt.request import BoltRequest -from slack_bolt.request.payload_utils import ( - is_assistant_event, - to_event, -) from slack_bolt.response import BoltResponse from slack_bolt.util.utils import ( create_web_client, @@ -137,6 +133,7 @@ def __init__( listener_executor: Optional[Executor] = None, # for AI Agents & Assistants assistant_thread_context_store: Optional[AssistantThreadContextStore] = None, + attaching_agent_kwargs_enabled: bool = True, ): """Bolt App that provides functionalities to register middleware/listeners. @@ -357,6 +354,7 @@ def message_hello(message, say): listener_executor = ThreadPoolExecutor(max_workers=5) self._assistant_thread_context_store = assistant_thread_context_store + self._attaching_agent_kwargs_enabled = attaching_agent_kwargs_enabled self._process_before_response = process_before_response self._listener_runner = ThreadListenerRunner( @@ -841,10 +839,13 @@ def ask_for_introduction(event, say): middleware: A list of lister middleware functions. Only when all the middleware call `next()` method, the listener function can be invoked. """ + middleware = list(middleware) if middleware else [] def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.event(event, base_logger=self._base_logger) + if self._attaching_agent_kwargs_enabled: + middleware.insert(0, AttachingAgentKwargs(self._assistant_thread_context_store)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) return __call__ @@ -902,6 +903,8 @@ def __call__(*args, **kwargs): primary_matcher = builtin_matchers.message_event( keyword=keyword, constraints=constraints, base_logger=self._base_logger ) + if self._attaching_agent_kwargs_enabled: + middleware.insert(0, AttachingAgentKwargs(self._assistant_thread_context_store)) middleware.insert(0, MessageListenerMatches(keyword)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) @@ -1398,20 +1401,6 @@ def _init_context(self, req: BoltRequest): # It is intended for apps that start lazy listeners from their custom global middleware. req.context["listener_runner"] = self.listener_runner - # For AI Agents & Assistants - if is_assistant_event(req.body): - assistant = AssistantUtilities( - payload=to_event(req.body), # type: ignore[arg-type] - context=req.context, - thread_context_store=self._assistant_thread_context_store, - ) - req.context["say"] = assistant.say - req.context["set_status"] = assistant.set_status - req.context["set_title"] = assistant.set_title - req.context["set_suggested_prompts"] = assistant.set_suggested_prompts - req.context["get_thread_context"] = assistant.get_thread_context - req.context["save_thread_context"] = assistant.save_thread_context - @staticmethod def _to_listener_functions( kwargs: dict, diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 62c491084..9cd8c911f 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -8,7 +8,6 @@ from aiohttp import web from slack_bolt.app.async_server import AsyncSlackAppServer -from slack_bolt.context.assistant.async_assistant_utilities import AsyncAssistantUtilities from slack_bolt.context.assistant.thread_context_store.async_store import ( AsyncAssistantThreadContextStore, ) @@ -30,7 +29,6 @@ AsyncMessageListenerMatches, ) from slack_bolt.oauth.async_internals import select_consistent_installation_store -from slack_bolt.request.payload_utils import is_assistant_event, to_event from slack_bolt.util.utils import get_name_for_callable, is_callable_coroutine from slack_bolt.workflows.step.async_step import ( AsyncWorkflowStep, @@ -88,6 +86,7 @@ AsyncIgnoringSelfEvents, AsyncUrlVerification, AsyncAttachingFunctionToken, + AsyncAttachingAgentKwargs, ) from slack_bolt.middleware.async_custom_middleware import ( AsyncMiddleware, @@ -143,6 +142,7 @@ def __init__( verification_token: Optional[str] = None, # for AI Agents & Assistants assistant_thread_context_store: Optional[AsyncAssistantThreadContextStore] = None, + attaching_agent_kwargs_enabled: bool = True, ): """Bolt App that provides functionalities to register middleware/listeners. @@ -363,6 +363,7 @@ async def message_hello(message, say): # async function self._async_listeners: List[AsyncListener] = [] self._assistant_thread_context_store = assistant_thread_context_store + self._attaching_agent_kwargs_enabled = attaching_agent_kwargs_enabled self._process_before_response = process_before_response self._async_listener_runner = AsyncioListenerRunner( @@ -866,10 +867,13 @@ async def ask_for_introduction(event, say): middleware: A list of lister middleware functions. Only when all the middleware call `next()` method, the listener function can be invoked. """ + middleware = list(middleware) if middleware else [] def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.event(event, True, base_logger=self._base_logger) + if self._attaching_agent_kwargs_enabled: + middleware.insert(0, AsyncAttachingAgentKwargs(self._assistant_thread_context_store)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) return __call__ @@ -930,6 +934,8 @@ def __call__(*args, **kwargs): asyncio=True, base_logger=self._base_logger, ) + if self._attaching_agent_kwargs_enabled: + middleware.insert(0, AsyncAttachingAgentKwargs(self._assistant_thread_context_store)) middleware.insert(0, AsyncMessageListenerMatches(keyword)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) @@ -1431,20 +1437,6 @@ def _init_context(self, req: AsyncBoltRequest): # It is intended for apps that start lazy listeners from their custom global middleware. req.context["listener_runner"] = self.listener_runner - # For AI Agents & Assistants - if is_assistant_event(req.body): - assistant = AsyncAssistantUtilities( - payload=to_event(req.body), # type: ignore[arg-type] - context=req.context, - thread_context_store=self._assistant_thread_context_store, - ) - req.context["say"] = assistant.say - req.context["set_status"] = assistant.set_status - req.context["set_title"] = assistant.set_title - req.context["set_suggested_prompts"] = assistant.set_suggested_prompts - req.context["get_thread_context"] = assistant.get_thread_context - req.context["save_thread_context"] = assistant.save_thread_context - @staticmethod def _to_listener_functions( kwargs: dict, diff --git a/slack_bolt/context/async_context.py b/slack_bolt/context/async_context.py index 47eb4744e..631f74a82 100644 --- a/slack_bolt/context/async_context.py +++ b/slack_bolt/context/async_context.py @@ -110,7 +110,7 @@ async def handle_button_clicks(ack, say): Callable `say()` function """ if "say" not in self: - self["say"] = AsyncSay(client=self.client, channel=self.channel_id, thread_ts=self.thread_ts) + self["say"] = AsyncSay(client=self.client, channel=self.channel_id) return self["say"] @property diff --git a/slack_bolt/context/context.py b/slack_bolt/context/context.py index 31edf2891..48df4ad32 100644 --- a/slack_bolt/context/context.py +++ b/slack_bolt/context/context.py @@ -111,7 +111,7 @@ def handle_button_clicks(ack, say): Callable `say()` function """ if "say" not in self: - self["say"] = Say(client=self.client, channel=self.channel_id, thread_ts=self.thread_ts) + self["say"] = Say(client=self.client, channel=self.channel_id) return self["say"] @property diff --git a/slack_bolt/middleware/__init__.py b/slack_bolt/middleware/__init__.py index 0e4044f99..7b51fb239 100644 --- a/slack_bolt/middleware/__init__.py +++ b/slack_bolt/middleware/__init__.py @@ -17,6 +17,7 @@ from .ssl_check import SslCheck from .url_verification import UrlVerification from .attaching_function_token import AttachingFunctionToken +from .attaching_agent_kwargs import AttachingAgentKwargs builtin_middleware_classes = [ SslCheck, @@ -41,5 +42,6 @@ "SslCheck", "UrlVerification", "AttachingFunctionToken", + "AttachingAgentKwargs", "builtin_middleware_classes", ] diff --git a/slack_bolt/middleware/assistant/assistant.py b/slack_bolt/middleware/assistant/assistant.py index d61386105..9696e826e 100644 --- a/slack_bolt/middleware/assistant/assistant.py +++ b/slack_bolt/middleware/assistant/assistant.py @@ -7,6 +7,7 @@ from slack_bolt.context.assistant.thread_context_store.store import AssistantThreadContextStore from slack_bolt.listener_matcher.builtins import build_listener_matcher +from slack_bolt.middleware.attaching_agent_kwargs import AttachingAgentKwargs from slack_bolt.request.request import BoltRequest from slack_bolt.response.response import BoltResponse from slack_bolt.listener_matcher import CustomListenerMatcher @@ -236,6 +237,15 @@ def process( # type: ignore[return] if listeners is not None: for listener in listeners: if listener.matches(req=req, resp=resp): + middleware_resp, next_was_not_called = listener.run_middleware(req=req, resp=resp) + if next_was_not_called: + if middleware_resp is not None: + return middleware_resp + # The listener middleware didn't call next(). + # Skip this listener and try the next one. + continue + if middleware_resp is not None: + resp = middleware_resp return listener_runner.run( request=req, response=resp, @@ -262,6 +272,7 @@ def build_listener( return listener_or_functions elif isinstance(listener_or_functions, list): middleware = middleware if middleware else [] + middleware.insert(0, AttachingAgentKwargs(self.thread_context_store)) functions = listener_or_functions ack_function = functions.pop(0) diff --git a/slack_bolt/middleware/assistant/async_assistant.py b/slack_bolt/middleware/assistant/async_assistant.py index ae82595a8..d841e2de0 100644 --- a/slack_bolt/middleware/assistant/async_assistant.py +++ b/slack_bolt/middleware/assistant/async_assistant.py @@ -8,6 +8,7 @@ from slack_bolt.listener.asyncio_runner import AsyncioListenerRunner from slack_bolt.listener_matcher.builtins import build_listener_matcher +from slack_bolt.middleware.attaching_agent_kwargs.async_attaching_agent_kwargs import AsyncAttachingAgentKwargs from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse from slack_bolt.error import BoltError @@ -265,6 +266,15 @@ async def async_process( # type: ignore[return] if listeners is not None: for listener in listeners: if listener is not None and await listener.async_matches(req=req, resp=resp): + middleware_resp, next_was_not_called = await listener.run_async_middleware(req=req, resp=resp) + if next_was_not_called: + if middleware_resp is not None: + return middleware_resp + # The listener middleware didn't call next(). + # Skip this listener and try the next one. + continue + if middleware_resp is not None: + resp = middleware_resp return await listener_runner.run( request=req, response=resp, @@ -291,6 +301,7 @@ def build_listener( return listener_or_functions elif isinstance(listener_or_functions, list): middleware = middleware if middleware else [] + middleware.insert(0, AsyncAttachingAgentKwargs(self.thread_context_store)) functions = listener_or_functions ack_function = functions.pop(0) diff --git a/slack_bolt/middleware/async_builtins.py b/slack_bolt/middleware/async_builtins.py index d2d82c1fb..755b55c20 100644 --- a/slack_bolt/middleware/async_builtins.py +++ b/slack_bolt/middleware/async_builtins.py @@ -10,6 +10,7 @@ AsyncMessageListenerMatches, ) from .attaching_function_token.async_attaching_function_token import AsyncAttachingFunctionToken +from .attaching_agent_kwargs.async_attaching_agent_kwargs import AsyncAttachingAgentKwargs __all__ = [ "AsyncIgnoringSelfEvents", @@ -18,4 +19,5 @@ "AsyncUrlVerification", "AsyncMessageListenerMatches", "AsyncAttachingFunctionToken", + "AsyncAttachingAgentKwargs", ] diff --git a/slack_bolt/middleware/attaching_agent_kwargs/__init__.py b/slack_bolt/middleware/attaching_agent_kwargs/__init__.py new file mode 100644 index 000000000..98926fc14 --- /dev/null +++ b/slack_bolt/middleware/attaching_agent_kwargs/__init__.py @@ -0,0 +1,5 @@ +from .attaching_agent_kwargs import AttachingAgentKwargs + +__all__ = [ + "AttachingAgentKwargs", +] diff --git a/slack_bolt/middleware/attaching_agent_kwargs/async_attaching_agent_kwargs.py b/slack_bolt/middleware/attaching_agent_kwargs/async_attaching_agent_kwargs.py new file mode 100644 index 000000000..0b43c21ce --- /dev/null +++ b/slack_bolt/middleware/attaching_agent_kwargs/async_attaching_agent_kwargs.py @@ -0,0 +1,39 @@ +from typing import Optional, Callable, Awaitable + +from slack_bolt.context.assistant.async_assistant_utilities import AsyncAssistantUtilities +from slack_bolt.context.assistant.thread_context_store.async_store import AsyncAssistantThreadContextStore +from slack_bolt.middleware.async_middleware import AsyncMiddleware +from slack_bolt.request.async_request import AsyncBoltRequest +from slack_bolt.request.payload_utils import is_assistant_event, to_event +from slack_bolt.response import BoltResponse + + +class AsyncAttachingAgentKwargs(AsyncMiddleware): + + thread_context_store: Optional[AsyncAssistantThreadContextStore] + + def __init__(self, thread_context_store: Optional[AsyncAssistantThreadContextStore] = None): + self.thread_context_store = thread_context_store + + async def async_process( + self, + *, + req: AsyncBoltRequest, + resp: BoltResponse, + next: Callable[[], Awaitable[BoltResponse]], + ) -> Optional[BoltResponse]: + event = to_event(req.body) + if event is not None: + if is_assistant_event(req.body): + assistant = AsyncAssistantUtilities( + payload=event, + context=req.context, + thread_context_store=self.thread_context_store, + ) + req.context["say"] = assistant.say + req.context["set_status"] = assistant.set_status + req.context["set_title"] = assistant.set_title + req.context["set_suggested_prompts"] = assistant.set_suggested_prompts + req.context["get_thread_context"] = assistant.get_thread_context + req.context["save_thread_context"] = assistant.save_thread_context + return await next() diff --git a/slack_bolt/middleware/attaching_agent_kwargs/attaching_agent_kwargs.py b/slack_bolt/middleware/attaching_agent_kwargs/attaching_agent_kwargs.py new file mode 100644 index 000000000..4963ea67d --- /dev/null +++ b/slack_bolt/middleware/attaching_agent_kwargs/attaching_agent_kwargs.py @@ -0,0 +1,33 @@ +from typing import Optional, Callable + +from slack_bolt.context.assistant.assistant_utilities import AssistantUtilities +from slack_bolt.context.assistant.thread_context_store.store import AssistantThreadContextStore +from slack_bolt.middleware import Middleware +from slack_bolt.request.payload_utils import is_assistant_event, to_event +from slack_bolt.request.request import BoltRequest +from slack_bolt.response.response import BoltResponse + + +class AttachingAgentKwargs(Middleware): + + thread_context_store: Optional[AssistantThreadContextStore] + + def __init__(self, thread_context_store: Optional[AssistantThreadContextStore] = None): + self.thread_context_store = thread_context_store + + def process(self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse]) -> Optional[BoltResponse]: + event = to_event(req.body) + if event is not None: + if is_assistant_event(req.body): + assistant = AssistantUtilities( + payload=event, + context=req.context, + thread_context_store=self.thread_context_store, + ) + req.context["say"] = assistant.say + req.context["set_status"] = assistant.set_status + req.context["set_title"] = assistant.set_title + req.context["set_suggested_prompts"] = assistant.set_suggested_prompts + req.context["get_thread_context"] = assistant.get_thread_context + req.context["save_thread_context"] = assistant.save_thread_context + return next() diff --git a/slack_bolt/request/internals.py b/slack_bolt/request/internals.py index e6a32db0d..466f5daaf 100644 --- a/slack_bolt/request/internals.py +++ b/slack_bolt/request/internals.py @@ -3,7 +3,6 @@ from urllib.parse import parse_qsl, parse_qs from slack_bolt.context import BoltContext -from slack_bolt.request.payload_utils import is_assistant_event def parse_query(query: Optional[Union[str, Dict[str, str], Dict[str, Sequence[str]]]]) -> Dict[str, Sequence[str]]: @@ -215,33 +214,17 @@ def extract_channel_id(payload: Dict[str, Any]) -> Optional[str]: def extract_thread_ts(payload: Dict[str, Any]) -> Optional[str]: - # This utility initially supports only the use cases for AI assistants, but it may be fine to add more patterns. - # That said, note that thread_ts is always required for assistant threads, but it's not for channels. - # Thus, blindly setting this thread_ts to say utility can break existing apps' behaviors. - # - # The BoltAgent class handles non-assistant thread_ts separately by reading from the event directly, - # allowing it to work correctly without affecting say() behavior. - if is_assistant_event(payload): - event = payload["event"] - if ( - event.get("assistant_thread") is not None - and event["assistant_thread"].get("channel_id") is not None - and event["assistant_thread"].get("thread_ts") is not None - ): - # assistant_thread_started, assistant_thread_context_changed - # "assistant_thread" property can exist for message event without channel_id and thread_ts - # Thus, the above if check verifies these properties exist - return event["assistant_thread"]["thread_ts"] - elif event.get("channel") is not None: - if event.get("thread_ts") is not None: - # message in an assistant thread - return event["thread_ts"] - elif event.get("message", {}).get("thread_ts") is not None: - # message_changed - return event["message"]["thread_ts"] - elif event.get("previous_message", {}).get("thread_ts") is not None: - # message_deleted - return event["previous_message"]["thread_ts"] + thread_ts = payload.get("thread_ts") + if thread_ts is not None: + return thread_ts + if payload.get("event") is not None: + return extract_thread_ts(payload["event"]) + if isinstance(payload.get("assistant_thread"), dict): + return extract_thread_ts(payload["assistant_thread"]) + if isinstance(payload.get("message"), dict): + return extract_thread_ts(payload["message"]) + if isinstance(payload.get("previous_message"), dict): + return extract_thread_ts(payload["previous_message"]) return None diff --git a/tests/scenario_tests/test_events_assistant.py b/tests/scenario_tests/test_events_assistant.py index 3372380fd..5bc270d86 100644 --- a/tests/scenario_tests/test_events_assistant.py +++ b/tests/scenario_tests/test_events_assistant.py @@ -1,8 +1,13 @@ import time +from time import sleep +from typing import Callable from slack_sdk.web import WebClient from slack_bolt import App, BoltRequest, Assistant, Say, SetSuggestedPrompts, SetStatus, BoltContext +from slack_bolt.middleware import Middleware +from slack_bolt.request import BoltRequest as BoltRequestType +from slack_bolt.response import BoltResponse from tests.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, @@ -184,6 +189,72 @@ def handle_bot_message(): assert response.status == 404 assert called["value"] is False + def test_assistant_with_custom_listener_middleware(self): + app = App(client=self.web_client) + assistant = Assistant() + handler_called = {"value": False} + middleware_called = {"value": False} + + class TestMiddleware(Middleware): + def process(self, *, req: BoltRequestType, resp: BoltResponse, next: Callable[[], BoltResponse]): + middleware_called["value"] = True + # Verify assistant utilities are available + assert req.context.get("set_status") is not None + assert req.context.get("set_title") is not None + assert req.context.get("set_suggested_prompts") is not None + assert req.context.get("get_thread_context") is not None + assert req.context.get("save_thread_context") is not None + return next() + + @assistant.thread_started(middleware=[TestMiddleware()]) + def start_thread(): + handler_called["value"] = True + + @assistant.user_message(middleware=[TestMiddleware()]) + def handle_user_message(): + handler_called["value"] = True + + app.assistant(assistant) + + request = BoltRequest(body=thread_started_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called(handler_called) + assert_target_called(middleware_called) + + handler_called = {"value": False} + middleware_called = {"value": False} + + request = BoltRequest(body=user_message_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called(handler_called) + assert_target_called(middleware_called) + + def test_assistant_custom_middleware_can_short_circuit(self): + app = App(client=self.web_client) + assistant = Assistant() + handler_called = {"value": False} + middleware_called = {"value": False} + + class BlockingMiddleware(Middleware): + def process(self, *, req: BoltRequestType, resp: BoltResponse, next: Callable[[], BoltResponse]): + middleware_called["value"] = True + # Intentionally not calling next() to short-circuit + return BoltResponse(status=200) + + @assistant.thread_started(middleware=[BlockingMiddleware()]) + def start_thread(say: Say, context: BoltContext): + handler_called["value"] = True + + app.assistant(assistant) + + request = BoltRequest(body=thread_started_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called(middleware_called) + assert handler_called["value"] is False + def build_payload(event: dict) -> dict: return { diff --git a/tests/scenario_tests/test_events_assistant_without_middleware.py b/tests/scenario_tests/test_events_assistant_without_middleware.py index 5307aa4c6..36d86c43a 100644 --- a/tests/scenario_tests/test_events_assistant_without_middleware.py +++ b/tests/scenario_tests/test_events_assistant_without_middleware.py @@ -178,8 +178,8 @@ def handle_message_event( save_thread_context: SaveThreadContext, context: BoltContext, ): - assert context.thread_ts is None - assert say.thread_ts == context.thread_ts + assert context.thread_ts == "1726133698.626339" + assert say.thread_ts == None assert set_status is None assert set_title is None assert set_suggested_prompts is None @@ -206,8 +206,8 @@ def handle_message_event( save_thread_context: SaveThreadContext, context: BoltContext, ): - assert context.thread_ts is None - assert say.thread_ts == context.thread_ts + assert context.thread_ts == "1726133698.626339" + assert say.thread_ts == None assert set_status is None assert set_title is None assert set_suggested_prompts is None @@ -234,8 +234,8 @@ def handle_message_event( save_thread_context: SaveThreadContext, context: BoltContext, ): - assert context.thread_ts is None - assert say.thread_ts == context.thread_ts + assert context.thread_ts == "1726133698.626339" + assert say.thread_ts == None assert set_status is None assert set_title is None assert set_suggested_prompts is None @@ -247,3 +247,22 @@ def handle_message_event( response = app.dispatch(request) assert response.status == 200 assert_target_called(called) + + def test_assistant_events_agent_kwargs_disabled(self): + app = App(client=self.web_client, attaching_agent_kwargs_enabled=False) + + called = {"value": False} + + @app.event("assistant_thread_started") + def start_thread(context: BoltContext): + assert context.get("set_status") is None + assert context.get("set_title") is None + assert context.get("set_suggested_prompts") is None + assert context.get("get_thread_context") is None + assert context.get("save_thread_context") is None + called["value"] = True + + request = BoltRequest(body=thread_started_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called(called) diff --git a/tests/scenario_tests_async/test_events_assistant.py b/tests/scenario_tests_async/test_events_assistant.py index c6d04474d..87b337536 100644 --- a/tests/scenario_tests_async/test_events_assistant.py +++ b/tests/scenario_tests_async/test_events_assistant.py @@ -1,5 +1,6 @@ import asyncio import time +from typing import Awaitable, Callable, Optional import pytest from slack_sdk.web.async_client import AsyncWebClient @@ -10,7 +11,9 @@ from slack_bolt.context.set_status.async_set_status import AsyncSetStatus from slack_bolt.context.set_suggested_prompts.async_set_suggested_prompts import AsyncSetSuggestedPrompts from slack_bolt.middleware.assistant.async_assistant import AsyncAssistant +from slack_bolt.middleware.async_middleware import AsyncMiddleware from slack_bolt.request.async_request import AsyncBoltRequest +from slack_bolt.response import BoltResponse from tests.mock_web_api_server import ( cleanup_mock_web_api_server_async, setup_mock_web_api_server_async, @@ -210,6 +213,130 @@ async def handle_bot_message(): assert response.status == 404 assert called["value"] is False + @pytest.mark.asyncio + async def test_assistant_events_kwargs_disabled(self): + app = AsyncApp(client=self.web_client, attaching_agent_kwargs_enabled=False) + + state = {"called": False} + + async def assert_target_called(): + count = 0 + while state["called"] is False and count < 20: + await asyncio.sleep(0.1) + count += 1 + assert state["called"] is True + state["called"] = False + + @app.event("assistant_thread_started") + async def start_thread(context: AsyncBoltContext): + assert context.get("set_status") is None + assert context.get("set_title") is None + assert context.get("set_suggested_prompts") is None + assert context.get("get_thread_context") is None + assert context.get("save_thread_context") is None + state["called"] = True + + request = AsyncBoltRequest(body=thread_started_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called() + + @pytest.mark.asyncio + async def test_assistant_with_custom_listener_middleware(self): + app = AsyncApp(client=self.web_client) + assistant = AsyncAssistant() + + state = {"called": False, "middleware_called": False} + + async def assert_target_called(): + count = 0 + while state["called"] is False and count < 20: + await asyncio.sleep(0.1) + count += 1 + assert state["called"] is True + state["called"] = False + + class TestAsyncMiddleware(AsyncMiddleware): + async def async_process( + self, + *, + req: AsyncBoltRequest, + resp: BoltResponse, + next: Callable[[], Awaitable[BoltResponse]], + ) -> Optional[BoltResponse]: + state["middleware_called"] = True + # Verify assistant utilities are available (set by _AsyncAssistantMiddleware before this) + assert req.context.get("set_status") is not None + assert req.context.get("set_title") is not None + assert req.context.get("set_suggested_prompts") is not None + assert req.context.get("get_thread_context") is not None + assert req.context.get("save_thread_context") is not None + return await next() + + @assistant.thread_started(middleware=[TestAsyncMiddleware()]) + async def start_thread(say: AsyncSay, set_suggested_prompts: AsyncSetSuggestedPrompts, context: AsyncBoltContext): + assert context.channel_id == "D111" + assert context.thread_ts == "1726133698.626339" + assert say.thread_ts == context.thread_ts + await say("Hi, how can I help you today?") + await set_suggested_prompts( + prompts=[{"title": "What does SLACK stand for?", "message": "What does SLACK stand for?"}] + ) + state["called"] = True + + @assistant.user_message(middleware=[TestAsyncMiddleware()]) + async def handle_user_message(say: AsyncSay, set_status: AsyncSetStatus, context: AsyncBoltContext): + assert context.channel_id == "D111" + assert context.thread_ts == "1726133698.626339" + assert say.thread_ts == context.thread_ts + await set_status("is typing...") + await say("Here you are!") + state["called"] = True + + app.assistant(assistant) + + request = AsyncBoltRequest(body=thread_started_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called() + assert state["middleware_called"] is True + state["middleware_called"] = False + + request = AsyncBoltRequest(body=user_message_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called() + assert state["middleware_called"] is True + + @pytest.mark.asyncio + async def test_assistant_custom_middleware_can_short_circuit(self): + app = AsyncApp(client=self.web_client) + assistant = AsyncAssistant() + + state = {"handler_called": False} + + class BlockingAsyncMiddleware(AsyncMiddleware): + async def async_process( + self, + *, + req: AsyncBoltRequest, + resp: BoltResponse, + next: Callable[[], Awaitable[BoltResponse]], + ) -> Optional[BoltResponse]: + # Intentionally not calling next() to short-circuit + return BoltResponse(status=200) + + @assistant.thread_started(middleware=[BlockingAsyncMiddleware()]) + async def start_thread(say: AsyncSay, context: AsyncBoltContext): + state["handler_called"] = True + + app.assistant(assistant) + + request = AsyncBoltRequest(body=thread_started_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + assert state["handler_called"] is False + def build_payload(event: dict) -> dict: return { diff --git a/tests/scenario_tests_async/test_events_assistant_without_middleware.py b/tests/scenario_tests_async/test_events_assistant_without_middleware.py index 92f488ff3..be6c2b166 100644 --- a/tests/scenario_tests_async/test_events_assistant_without_middleware.py +++ b/tests/scenario_tests_async/test_events_assistant_without_middleware.py @@ -195,8 +195,8 @@ async def handle_message_event( save_thread_context: AsyncSaveThreadContext, context: AsyncBoltContext, ): - assert context.thread_ts is None - assert say.thread_ts == context.thread_ts + assert context.thread_ts == "1726133698.626339" + assert say.thread_ts == None assert set_status is None assert set_title is None assert set_suggested_prompts is None @@ -224,8 +224,8 @@ async def handle_message_event( save_thread_context: AsyncSaveThreadContext, context: AsyncBoltContext, ): - assert context.thread_ts is None - assert say.thread_ts == context.thread_ts + assert context.thread_ts == "1726133698.626339" + assert say.thread_ts == None assert set_status is None assert set_title is None assert set_suggested_prompts is None @@ -253,8 +253,8 @@ async def handle_message_event( save_thread_context: AsyncSaveThreadContext, context: AsyncBoltContext, ): - assert context.thread_ts is None - assert say.thread_ts == context.thread_ts + assert context.thread_ts == "1726133698.626339" + assert say.thread_ts == None assert set_status is None assert set_title is None assert set_suggested_prompts is None @@ -266,3 +266,23 @@ async def handle_message_event( response = await app.async_dispatch(request) assert response.status == 200 await assert_target_called(called) + + @pytest.mark.asyncio + async def test_assistant_events_agent_kwargs_disabled(self): + app = AsyncApp(client=self.web_client, attaching_agent_kwargs_enabled=False) + + called = {"value": False} + + @app.event("assistant_thread_started") + async def start_thread(context: AsyncBoltContext): + assert context.get("set_status") is None + assert context.get("set_title") is None + assert context.get("set_suggested_prompts") is None + assert context.get("get_thread_context") is None + assert context.get("save_thread_context") is None + called["value"] = True + + request = AsyncBoltRequest(body=thread_started_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called(called) diff --git a/tests/slack_bolt/middleware/attaching_agent_kwargs/__init__.py b/tests/slack_bolt/middleware/attaching_agent_kwargs/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/slack_bolt/middleware/attaching_agent_kwargs/test_attaching_agent_kwargs.py b/tests/slack_bolt/middleware/attaching_agent_kwargs/test_attaching_agent_kwargs.py new file mode 100644 index 000000000..f56bd2e62 --- /dev/null +++ b/tests/slack_bolt/middleware/attaching_agent_kwargs/test_attaching_agent_kwargs.py @@ -0,0 +1,64 @@ +from slack_sdk import WebClient + +from slack_bolt.middleware.attaching_agent_kwargs import AttachingAgentKwargs +from slack_bolt.request import BoltRequest +from slack_bolt.response import BoltResponse +from tests.scenario_tests.test_events_assistant import ( + thread_started_event_body, + user_message_event_body, + channel_user_message_event_body, +) + + +def next(): + return BoltResponse(status=200) + + +AGENT_KWARGS = ("say", "set_status", "set_title", "set_suggested_prompts", "get_thread_context", "save_thread_context") + + +class TestAttachingAgentKwargs: + def test_assistant_event_attaches_kwargs(self): + middleware = AttachingAgentKwargs() + req = BoltRequest(body=thread_started_event_body, mode="socket_mode") + req.context["client"] = WebClient(token="xoxb-test") + + resp = middleware.process(req=req, resp=BoltResponse(status=404), next=next) + + assert resp.status == 200 + for key in AGENT_KWARGS: + assert key in req.context, f"{key} should be set on context" + assert req.context["say"].thread_ts == "1726133698.626339" + + def test_user_message_event_attaches_kwargs(self): + middleware = AttachingAgentKwargs() + req = BoltRequest(body=user_message_event_body, mode="socket_mode") + req.context["client"] = WebClient(token="xoxb-test") + + resp = middleware.process(req=req, resp=BoltResponse(status=404), next=next) + + assert resp.status == 200 + for key in AGENT_KWARGS: + assert key in req.context, f"{key} should be set on context" + assert req.context["say"].thread_ts == "1726133698.626339" + + def test_non_assistant_event_does_not_attach_kwargs(self): + middleware = AttachingAgentKwargs() + req = BoltRequest(body=channel_user_message_event_body, mode="socket_mode") + req.context["client"] = WebClient(token="xoxb-test") + + resp = middleware.process(req=req, resp=BoltResponse(status=404), next=next) + + assert resp.status == 200 + for key in AGENT_KWARGS: + assert key not in req.context, f"{key} should not be set on context" + + def test_non_event_does_not_attach_kwargs(self): + middleware = AttachingAgentKwargs() + req = BoltRequest(body="payload={}", headers={}) + + resp = middleware.process(req=req, resp=BoltResponse(status=404), next=next) + + assert resp.status == 200 + for key in AGENT_KWARGS: + assert key not in req.context, f"{key} should not be set on context" diff --git a/tests/slack_bolt/request/test_internals.py b/tests/slack_bolt/request/test_internals.py index 752fa6d2d..0b267e3de 100644 --- a/tests/slack_bolt/request/test_internals.py +++ b/tests/slack_bolt/request/test_internals.py @@ -13,6 +13,7 @@ extract_actor_team_id, extract_actor_user_id, extract_function_execution_id, + extract_thread_ts, ) @@ -111,6 +112,196 @@ def teardown_method(self): }, ] + thread_ts_event_requests = [ + { + "event": { + "type": "app_mention", + "channel": "C111", + "user": "U111", + "ts": "123.420", + "thread_ts": "123.456", + }, + }, + { + "event": { + "type": "message", + "channel": "C111", + "user": "U111", + "ts": "123.420", + "thread_ts": "123.456", + }, + }, + { + "event": { + "type": "message", + "subtype": "bot_message", + "channel": "C111", + "bot_id": "B111", + "ts": "123.420", + "thread_ts": "123.456", + }, + }, + { + "event": { + "type": "message", + "subtype": "file_share", + "channel": "C111", + "user": "U111", + "ts": "123.420", + "thread_ts": "123.456", + }, + }, + { + "event": { + "type": "message", + "subtype": "thread_broadcast", + "channel": "C111", + "user": "U111", + "ts": "123.420", + "thread_ts": "123.456", + "root": {"thread_ts": "123.420"}, + }, + }, + { + "event": { + "type": "link_shared", + "channel": "C111", + "user": "U111", + "thread_ts": "123.456", + "links": [{"url": "https://example.com"}], + }, + }, + { + "event": { + "type": "message", + "subtype": "message_changed", + "channel": "C111", + "message": { + "type": "message", + "user": "U111", + "text": "edited", + "ts": "123.420", + "thread_ts": "123.456", + }, + }, + }, + { + "event": { + "type": "message", + "subtype": "message_changed", + "channel": "C111", + "message": { + "type": "message", + "user": "U111", + "text": "edited", + "ts": "123.420", + "thread_ts": "123.456", + }, + "previous_message": { + "type": "message", + "user": "U111", + "text": "deleted", + "ts": "123.420", + "thread_ts": "123.420", + }, + }, + }, + { + "event": { + "type": "message", + "subtype": "message_deleted", + "channel": "C111", + "previous_message": { + "type": "message", + "user": "U111", + "text": "deleted", + "ts": "123.420", + "thread_ts": "123.456", + }, + }, + }, + { + "event": { + "type": "assistant_thread_started", + "assistant_thread": { + "user_id": "U123ABC456", + "context": { + "channel_id": "C123ABC456", + "team_id": "T123ABC456", + "enterprise_id": "E123ABC456", + }, + "channel_id": "D123ABC456", + "thread_ts": "123.456", + }, + "event_ts": "1715873754.429808", + }, + }, + { + "event": { + "type": "assistant_thread_context_changed", + "assistant_thread": { + "user_id": "U123ABC456", + "context": { + "channel_id": "C123ABC456", + "team_id": "T123ABC456", + "enterprise_id": "E123ABC456", + }, + "channel_id": "D123ABC456", + "thread_ts": "123.456", + }, + "event_ts": "17298244.022142", + }, + }, + { + "event": { + "type": "message", + "subtype": "message_changed", + "message": { + "text": "Chats from 2024-09-28", + "subtype": "assistant_app_thread", + "user": "U123456ABCD", + "type": "message", + "team": "T123456ABCD", + "thread_ts": "123.456", + "reply_count": 1, + "ts": "123.420", + }, + "channel": "D987654ABCD", + "hidden": True, + "ts": "123.420", + "event_ts": "123.420", + "channel_type": "im", + }, + }, + ] + + no_thread_ts_requests = [ + { + "event": { + "type": "reaction_added", + "user": "U111", + "reaction": "thumbsup", + "item": {"type": "message", "channel": "C111", "ts": "123.420"}, + }, + }, + { + "event": { + "type": "channel_created", + "channel": {"id": "C222", "name": "test", "created": 1678455198}, + }, + }, + { + "event": { + "type": "message", + "channel": "C111", + "user": "U111", + "text": "hello", + "ts": "123.420", + }, + }, + {}, + ] + slack_connect_authorizations = [ { "enterprise_id": "INSTALLED_ENTERPRISE_ID", @@ -337,6 +528,16 @@ def test_function_inputs_extraction(self): inputs = extract_function_inputs(req) assert inputs == {"customer_id": "Ux111"} + def test_extract_thread_ts(self): + for req in self.thread_ts_event_requests: + thread_ts = extract_thread_ts(req) + assert thread_ts == "123.456", f"Expected thread_ts for {req}" + + def test_extract_thread_ts_fail(self): + for req in self.no_thread_ts_requests: + thread_ts = extract_thread_ts(req) + assert thread_ts is None, f"Expected None for {req}" + def test_is_enterprise_install_extraction(self): for req in self.requests: should_be_false = extract_is_enterprise_install(req) diff --git a/tests/slack_bolt_async/middleware/attaching_agent_kwargs/__init__.py b/tests/slack_bolt_async/middleware/attaching_agent_kwargs/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/slack_bolt_async/middleware/attaching_agent_kwargs/test_async_attaching_agent_kwargs.py b/tests/slack_bolt_async/middleware/attaching_agent_kwargs/test_async_attaching_agent_kwargs.py new file mode 100644 index 000000000..55883e5f3 --- /dev/null +++ b/tests/slack_bolt_async/middleware/attaching_agent_kwargs/test_async_attaching_agent_kwargs.py @@ -0,0 +1,69 @@ +import pytest +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.middleware.attaching_agent_kwargs.async_attaching_agent_kwargs import AsyncAttachingAgentKwargs +from slack_bolt.request.async_request import AsyncBoltRequest +from slack_bolt.response import BoltResponse +from tests.scenario_tests_async.test_events_assistant import ( + thread_started_event_body, + user_message_event_body, + channel_user_message_event_body, +) + + +async def next(): + return BoltResponse(status=200) + + +AGENT_KWARGS = ("say", "set_status", "set_title", "set_suggested_prompts", "get_thread_context", "save_thread_context") + + +class TestAsyncAttachingAgentKwargs: + @pytest.mark.asyncio + async def test_assistant_event_attaches_kwargs(self): + middleware = AsyncAttachingAgentKwargs() + req = AsyncBoltRequest(body=thread_started_event_body, mode="socket_mode") + req.context["client"] = AsyncWebClient(token="xoxb-test") + + resp = await middleware.async_process(req=req, resp=BoltResponse(status=404), next=next) + + assert resp.status == 200 + for key in AGENT_KWARGS: + assert key in req.context, f"{key} should be set on context" + assert req.context["say"].thread_ts == "1726133698.626339" + + @pytest.mark.asyncio + async def test_user_message_event_attaches_kwargs(self): + middleware = AsyncAttachingAgentKwargs() + req = AsyncBoltRequest(body=user_message_event_body, mode="socket_mode") + req.context["client"] = AsyncWebClient(token="xoxb-test") + + resp = await middleware.async_process(req=req, resp=BoltResponse(status=404), next=next) + + assert resp.status == 200 + for key in AGENT_KWARGS: + assert key in req.context, f"{key} should be set on context" + assert req.context["say"].thread_ts == "1726133698.626339" + + @pytest.mark.asyncio + async def test_non_assistant_event_does_not_attach_kwargs(self): + middleware = AsyncAttachingAgentKwargs() + req = AsyncBoltRequest(body=channel_user_message_event_body, mode="socket_mode") + req.context["client"] = AsyncWebClient(token="xoxb-test") + + resp = await middleware.async_process(req=req, resp=BoltResponse(status=404), next=next) + + assert resp.status == 200 + for key in AGENT_KWARGS: + assert key not in req.context, f"{key} should not be set on context" + + @pytest.mark.asyncio + async def test_non_event_does_not_attach_kwargs(self): + middleware = AsyncAttachingAgentKwargs() + req = AsyncBoltRequest(body="payload={}", headers={}) + + resp = await middleware.async_process(req=req, resp=BoltResponse(status=404), next=next) + + assert resp.status == 200 + for key in AGENT_KWARGS: + assert key not in req.context, f"{key} should not be set on context" From f1bc61f1827a16075ba137c78225e166719f75ec Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Thu, 19 Mar 2026 06:57:33 -0700 Subject: [PATCH 705/719] feat: add support for say_stream utility (#1462) Co-authored-by: Eden Zimbelman --- slack_bolt/__init__.py | 2 + slack_bolt/async_app.py | 2 + slack_bolt/context/async_context.py | 5 + slack_bolt/context/base_context.py | 1 + slack_bolt/context/context.py | 5 + slack_bolt/context/say_stream/__init__.py | 6 + .../context/say_stream/async_say_stream.py | 74 ++++++ slack_bolt/context/say_stream/say_stream.py | 74 ++++++ slack_bolt/kwargs_injection/args.py | 5 + slack_bolt/kwargs_injection/async_args.py | 5 + slack_bolt/kwargs_injection/async_utils.py | 1 + slack_bolt/kwargs_injection/utils.py | 1 + .../async_attaching_agent_kwargs.py | 12 + .../attaching_agent_kwargs.py | 12 + .../scenario_tests/test_events_say_stream.py | 238 +++++++++++++++++ .../test_events_say_stream.py | 250 ++++++++++++++++++ tests/slack_bolt/context/test_say_stream.py | 103 ++++++++ .../context/test_async_say_stream.py | 117 ++++++++ 18 files changed, 913 insertions(+) create mode 100644 slack_bolt/context/say_stream/__init__.py create mode 100644 slack_bolt/context/say_stream/async_say_stream.py create mode 100644 slack_bolt/context/say_stream/say_stream.py create mode 100644 tests/scenario_tests/test_events_say_stream.py create mode 100644 tests/scenario_tests_async/test_events_say_stream.py create mode 100644 tests/slack_bolt/context/test_say_stream.py create mode 100644 tests/slack_bolt_async/context/test_async_say_stream.py diff --git a/slack_bolt/__init__.py b/slack_bolt/__init__.py index 4e43252fd..dfe950bf2 100644 --- a/slack_bolt/__init__.py +++ b/slack_bolt/__init__.py @@ -14,6 +14,7 @@ from .context.fail import Fail from .context.respond import Respond from .context.say import Say +from .context.say_stream import SayStream from .kwargs_injection import Args from .listener import Listener from .listener_matcher import CustomListenerMatcher @@ -42,6 +43,7 @@ "Fail", "Respond", "Say", + "SayStream", "Args", "Listener", "CustomListenerMatcher", diff --git a/slack_bolt/async_app.py b/slack_bolt/async_app.py index fdf724d4c..f95d952aa 100644 --- a/slack_bolt/async_app.py +++ b/slack_bolt/async_app.py @@ -59,6 +59,7 @@ async def command(ack, body, respond): from .context.set_suggested_prompts.async_set_suggested_prompts import AsyncSetSuggestedPrompts from .context.get_thread_context.async_get_thread_context import AsyncGetThreadContext from .context.save_thread_context.async_save_thread_context import AsyncSaveThreadContext +from .context.say_stream.async_say_stream import AsyncSayStream __all__ = [ "AsyncApp", @@ -66,6 +67,7 @@ async def command(ack, body, respond): "AsyncBoltContext", "AsyncRespond", "AsyncSay", + "AsyncSayStream", "AsyncListener", "AsyncCustomListenerMatcher", "AsyncBoltRequest", diff --git a/slack_bolt/context/async_context.py b/slack_bolt/context/async_context.py index 631f74a82..33f260d38 100644 --- a/slack_bolt/context/async_context.py +++ b/slack_bolt/context/async_context.py @@ -10,6 +10,7 @@ from slack_bolt.context.get_thread_context.async_get_thread_context import AsyncGetThreadContext from slack_bolt.context.save_thread_context.async_save_thread_context import AsyncSaveThreadContext from slack_bolt.context.say.async_say import AsyncSay +from slack_bolt.context.say_stream.async_say_stream import AsyncSayStream from slack_bolt.context.set_status.async_set_status import AsyncSetStatus from slack_bolt.context.set_suggested_prompts.async_set_suggested_prompts import AsyncSetSuggestedPrompts from slack_bolt.context.set_title.async_set_title import AsyncSetTitle @@ -203,6 +204,10 @@ def set_suggested_prompts(self) -> Optional[AsyncSetSuggestedPrompts]: def get_thread_context(self) -> Optional[AsyncGetThreadContext]: return self.get("get_thread_context") + @property + def say_stream(self) -> Optional[AsyncSayStream]: + return self.get("say_stream") + @property def save_thread_context(self) -> Optional[AsyncSaveThreadContext]: return self.get("save_thread_context") diff --git a/slack_bolt/context/base_context.py b/slack_bolt/context/base_context.py index 843d5ef60..502febcb8 100644 --- a/slack_bolt/context/base_context.py +++ b/slack_bolt/context/base_context.py @@ -38,6 +38,7 @@ class BaseContext(dict): "set_status", "set_title", "set_suggested_prompts", + "say_stream", ] # Note that these items are not copyable, so when you add new items to this list, # you must modify ThreadListenerRunner/AsyncioListenerRunner's _build_lazy_request method to pass the values. diff --git a/slack_bolt/context/context.py b/slack_bolt/context/context.py index 48df4ad32..6184d5083 100644 --- a/slack_bolt/context/context.py +++ b/slack_bolt/context/context.py @@ -10,6 +10,7 @@ from slack_bolt.context.respond import Respond from slack_bolt.context.save_thread_context import SaveThreadContext from slack_bolt.context.say import Say +from slack_bolt.context.say_stream import SayStream from slack_bolt.context.set_status import SetStatus from slack_bolt.context.set_suggested_prompts import SetSuggestedPrompts from slack_bolt.context.set_title import SetTitle @@ -204,6 +205,10 @@ def set_suggested_prompts(self) -> Optional[SetSuggestedPrompts]: def get_thread_context(self) -> Optional[GetThreadContext]: return self.get("get_thread_context") + @property + def say_stream(self) -> Optional[SayStream]: + return self.get("say_stream") + @property def save_thread_context(self) -> Optional[SaveThreadContext]: return self.get("save_thread_context") diff --git a/slack_bolt/context/say_stream/__init__.py b/slack_bolt/context/say_stream/__init__.py new file mode 100644 index 000000000..86db7b1cc --- /dev/null +++ b/slack_bolt/context/say_stream/__init__.py @@ -0,0 +1,6 @@ +# Don't add async module imports here +from .say_stream import SayStream + +__all__ = [ + "SayStream", +] diff --git a/slack_bolt/context/say_stream/async_say_stream.py b/slack_bolt/context/say_stream/async_say_stream.py new file mode 100644 index 000000000..dc752d02a --- /dev/null +++ b/slack_bolt/context/say_stream/async_say_stream.py @@ -0,0 +1,74 @@ +import warnings +from typing import Optional + +from slack_sdk.web.async_client import AsyncWebClient +from slack_sdk.web.async_chat_stream import AsyncChatStream + +from slack_bolt.warning import ExperimentalWarning + + +class AsyncSayStream: + client: AsyncWebClient + channel: Optional[str] + recipient_team_id: Optional[str] + recipient_user_id: Optional[str] + thread_ts: Optional[str] + + def __init__( + self, + *, + client: AsyncWebClient, + channel: Optional[str] = None, + recipient_team_id: Optional[str] = None, + recipient_user_id: Optional[str] = None, + thread_ts: Optional[str] = None, + ): + self.client = client + self.channel = channel + self.recipient_team_id = recipient_team_id + self.recipient_user_id = recipient_user_id + self.thread_ts = thread_ts + + async def __call__( + self, + *, + buffer_size: Optional[int] = None, + channel: Optional[str] = None, + recipient_team_id: Optional[str] = None, + recipient_user_id: Optional[str] = None, + thread_ts: Optional[str] = None, + **kwargs, + ) -> AsyncChatStream: + """Starts a new chat stream with context. + + Warning: This is an experimental feature and may change in future versions. + """ + warnings.warn( + "say_stream is experimental and may change in future versions.", + category=ExperimentalWarning, + stacklevel=2, + ) + + channel = channel or self.channel + thread_ts = thread_ts or self.thread_ts + if channel is None: + raise ValueError("say_stream without channel here is unsupported") + if thread_ts is None: + raise ValueError("say_stream without thread_ts here is unsupported") + + if buffer_size is not None: + return await self.client.chat_stream( + buffer_size=buffer_size, + channel=channel, + recipient_team_id=recipient_team_id or self.recipient_team_id, + recipient_user_id=recipient_user_id or self.recipient_user_id, + thread_ts=thread_ts, + **kwargs, + ) + return await self.client.chat_stream( + channel=channel, + recipient_team_id=recipient_team_id or self.recipient_team_id, + recipient_user_id=recipient_user_id or self.recipient_user_id, + thread_ts=thread_ts, + **kwargs, + ) diff --git a/slack_bolt/context/say_stream/say_stream.py b/slack_bolt/context/say_stream/say_stream.py new file mode 100644 index 000000000..1e1d7985f --- /dev/null +++ b/slack_bolt/context/say_stream/say_stream.py @@ -0,0 +1,74 @@ +import warnings +from typing import Optional + +from slack_sdk import WebClient +from slack_sdk.web.chat_stream import ChatStream + +from slack_bolt.warning import ExperimentalWarning + + +class SayStream: + client: WebClient + channel: Optional[str] + recipient_team_id: Optional[str] + recipient_user_id: Optional[str] + thread_ts: Optional[str] + + def __init__( + self, + *, + client: WebClient, + channel: Optional[str] = None, + recipient_team_id: Optional[str] = None, + recipient_user_id: Optional[str] = None, + thread_ts: Optional[str] = None, + ): + self.client = client + self.channel = channel + self.recipient_team_id = recipient_team_id + self.recipient_user_id = recipient_user_id + self.thread_ts = thread_ts + + def __call__( + self, + *, + buffer_size: Optional[int] = None, + channel: Optional[str] = None, + recipient_team_id: Optional[str] = None, + recipient_user_id: Optional[str] = None, + thread_ts: Optional[str] = None, + **kwargs, + ) -> ChatStream: + """Starts a new chat stream with context. + + Warning: This is an experimental feature and may change in future versions. + """ + warnings.warn( + "say_stream is experimental and may change in future versions.", + category=ExperimentalWarning, + stacklevel=2, + ) + + channel = channel or self.channel + thread_ts = thread_ts or self.thread_ts + if channel is None: + raise ValueError("say_stream without channel here is unsupported") + if thread_ts is None: + raise ValueError("say_stream without thread_ts here is unsupported") + + if buffer_size is not None: + return self.client.chat_stream( + buffer_size=buffer_size, + channel=channel, + recipient_team_id=recipient_team_id or self.recipient_team_id, + recipient_user_id=recipient_user_id or self.recipient_user_id, + thread_ts=thread_ts, + **kwargs, + ) + return self.client.chat_stream( + channel=channel, + recipient_team_id=recipient_team_id or self.recipient_team_id, + recipient_user_id=recipient_user_id or self.recipient_user_id, + thread_ts=thread_ts, + **kwargs, + ) diff --git a/slack_bolt/kwargs_injection/args.py b/slack_bolt/kwargs_injection/args.py index 113e39c08..dfb242fd1 100644 --- a/slack_bolt/kwargs_injection/args.py +++ b/slack_bolt/kwargs_injection/args.py @@ -11,6 +11,7 @@ from slack_bolt.agent.agent import BoltAgent from slack_bolt.context.save_thread_context import SaveThreadContext from slack_bolt.context.say import Say +from slack_bolt.context.say_stream import SayStream from slack_bolt.context.set_status import SetStatus from slack_bolt.context.set_suggested_prompts import SetSuggestedPrompts from slack_bolt.context.set_title import SetTitle @@ -105,6 +106,8 @@ def handle_buttons(args): """`save_thread_context()` utility function for AI Agents & Assistants""" agent: Optional[BoltAgent] """`agent` listener argument for AI Agents & Assistants""" + say_stream: Optional[SayStream] + """`say_stream()` utility function for AI Agents & Assistants""" # middleware next: Callable[[], None] """`next()` utility function, which tells the middleware chain that it can continue with the next one""" @@ -139,6 +142,7 @@ def __init__( get_thread_context: Optional[GetThreadContext] = None, save_thread_context: Optional[SaveThreadContext] = None, agent: Optional[BoltAgent] = None, + say_stream: Optional[SayStream] = None, # As this method is not supposed to be invoked by bolt-python users, # the naming conflict with the built-in one affects # only the internals of this method @@ -173,6 +177,7 @@ def __init__( self.get_thread_context = get_thread_context self.save_thread_context = save_thread_context self.agent = agent + self.say_stream = say_stream self.next: Callable[[], None] = next self.next_: Callable[[], None] = next diff --git a/slack_bolt/kwargs_injection/async_args.py b/slack_bolt/kwargs_injection/async_args.py index 1f1dde024..19719e900 100644 --- a/slack_bolt/kwargs_injection/async_args.py +++ b/slack_bolt/kwargs_injection/async_args.py @@ -10,6 +10,7 @@ from slack_bolt.context.get_thread_context.async_get_thread_context import AsyncGetThreadContext from slack_bolt.context.save_thread_context.async_save_thread_context import AsyncSaveThreadContext from slack_bolt.context.say.async_say import AsyncSay +from slack_bolt.context.say_stream.async_say_stream import AsyncSayStream from slack_bolt.context.set_status.async_set_status import AsyncSetStatus from slack_bolt.context.set_suggested_prompts.async_set_suggested_prompts import AsyncSetSuggestedPrompts from slack_bolt.context.set_title.async_set_title import AsyncSetTitle @@ -104,6 +105,8 @@ async def handle_buttons(args): """`save_thread_context()` utility function for AI Agents & Assistants""" agent: Optional[AsyncBoltAgent] """`agent` listener argument for AI Agents & Assistants""" + say_stream: Optional[AsyncSayStream] + """`say_stream()` utility function for AI Agents & Assistants""" # middleware next: Callable[[], Awaitable[None]] """`next()` utility function, which tells the middleware chain that it can continue with the next one""" @@ -138,6 +141,7 @@ def __init__( get_thread_context: Optional[AsyncGetThreadContext] = None, save_thread_context: Optional[AsyncSaveThreadContext] = None, agent: Optional[AsyncBoltAgent] = None, + say_stream: Optional[AsyncSayStream] = None, next: Callable[[], Awaitable[None]], **kwargs, # noqa ): @@ -169,6 +173,7 @@ def __init__( self.get_thread_context = get_thread_context self.save_thread_context = save_thread_context self.agent = agent + self.say_stream = say_stream self.next: Callable[[], Awaitable[None]] = next self.next_: Callable[[], Awaitable[None]] = next diff --git a/slack_bolt/kwargs_injection/async_utils.py b/slack_bolt/kwargs_injection/async_utils.py index aa84b2d11..534fb6133 100644 --- a/slack_bolt/kwargs_injection/async_utils.py +++ b/slack_bolt/kwargs_injection/async_utils.py @@ -60,6 +60,7 @@ def build_async_required_kwargs( "set_suggested_prompts": request.context.set_suggested_prompts, "get_thread_context": request.context.get_thread_context, "save_thread_context": request.context.save_thread_context, + "say_stream": request.context.say_stream, # middleware "next": next_func, "next_": next_func, # for the middleware using Python's built-in `next()` function diff --git a/slack_bolt/kwargs_injection/utils.py b/slack_bolt/kwargs_injection/utils.py index 5cd410a07..101e00099 100644 --- a/slack_bolt/kwargs_injection/utils.py +++ b/slack_bolt/kwargs_injection/utils.py @@ -59,6 +59,7 @@ def build_required_kwargs( "set_title": request.context.set_title, "set_suggested_prompts": request.context.set_suggested_prompts, "save_thread_context": request.context.save_thread_context, + "say_stream": request.context.say_stream, # middleware "next": next_func, "next_": next_func, # for the middleware using Python's built-in `next()` function diff --git a/slack_bolt/middleware/attaching_agent_kwargs/async_attaching_agent_kwargs.py b/slack_bolt/middleware/attaching_agent_kwargs/async_attaching_agent_kwargs.py index 0b43c21ce..08851c1eb 100644 --- a/slack_bolt/middleware/attaching_agent_kwargs/async_attaching_agent_kwargs.py +++ b/slack_bolt/middleware/attaching_agent_kwargs/async_attaching_agent_kwargs.py @@ -2,6 +2,7 @@ from slack_bolt.context.assistant.async_assistant_utilities import AsyncAssistantUtilities from slack_bolt.context.assistant.thread_context_store.async_store import AsyncAssistantThreadContextStore +from slack_bolt.context.say_stream.async_say_stream import AsyncSayStream from slack_bolt.middleware.async_middleware import AsyncMiddleware from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.request.payload_utils import is_assistant_event, to_event @@ -36,4 +37,15 @@ async def async_process( req.context["set_suggested_prompts"] = assistant.set_suggested_prompts req.context["get_thread_context"] = assistant.get_thread_context req.context["save_thread_context"] = assistant.save_thread_context + + # TODO: in the future we might want to introduce a "proper" extract_ts utility + thread_ts = req.context.thread_ts or event.get("ts") + if req.context.channel_id and thread_ts: + req.context["say_stream"] = AsyncSayStream( + client=req.context.client, + channel=req.context.channel_id, + recipient_team_id=req.context.team_id or req.context.enterprise_id, + recipient_user_id=req.context.user_id, + thread_ts=thread_ts, + ) return await next() diff --git a/slack_bolt/middleware/attaching_agent_kwargs/attaching_agent_kwargs.py b/slack_bolt/middleware/attaching_agent_kwargs/attaching_agent_kwargs.py index 4963ea67d..38a62c0c8 100644 --- a/slack_bolt/middleware/attaching_agent_kwargs/attaching_agent_kwargs.py +++ b/slack_bolt/middleware/attaching_agent_kwargs/attaching_agent_kwargs.py @@ -2,6 +2,7 @@ from slack_bolt.context.assistant.assistant_utilities import AssistantUtilities from slack_bolt.context.assistant.thread_context_store.store import AssistantThreadContextStore +from slack_bolt.context.say_stream.say_stream import SayStream from slack_bolt.middleware import Middleware from slack_bolt.request.payload_utils import is_assistant_event, to_event from slack_bolt.request.request import BoltRequest @@ -30,4 +31,15 @@ def process(self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], Bo req.context["set_suggested_prompts"] = assistant.set_suggested_prompts req.context["get_thread_context"] = assistant.get_thread_context req.context["save_thread_context"] = assistant.save_thread_context + + # TODO: in the future we might want to introduce a "proper" extract_ts utility + thread_ts = req.context.thread_ts or event.get("ts") + if req.context.channel_id and thread_ts: + req.context["say_stream"] = SayStream( + client=req.context.client, + channel=req.context.channel_id, + recipient_team_id=req.context.team_id or req.context.enterprise_id, + recipient_user_id=req.context.user_id, + thread_ts=thread_ts, + ) return next() diff --git a/tests/scenario_tests/test_events_say_stream.py b/tests/scenario_tests/test_events_say_stream.py new file mode 100644 index 000000000..75b0c612c --- /dev/null +++ b/tests/scenario_tests/test_events_say_stream.py @@ -0,0 +1,238 @@ +import json +import time +from urllib.parse import quote + +from slack_sdk.web import WebClient + +from slack_bolt import App, BoltRequest, BoltContext +from slack_bolt.context.say_stream.say_stream import SayStream +from slack_bolt.middleware.assistant import Assistant +from tests.mock_web_api_server import ( + setup_mock_web_api_server, + cleanup_mock_web_api_server, +) +from tests.scenario_tests.test_app import app_mention_event_body +from tests.scenario_tests.test_events_assistant import ( + thread_started_event_body, + user_message_event_body as threaded_user_message_event_body, +) +from tests.scenario_tests.test_message_bot import bot_message_event_payload, user_message_event_payload +from tests.scenario_tests.test_view_submission import body as view_submission_body +from tests.utils import remove_os_env_temporarily, restore_os_env + + +def assert_target_called(called: dict, timeout: float = 1.0): + deadline = time.time() + timeout + while called["value"] is not True and time.time() < deadline: + time.sleep(0.1) + assert called["value"] is True + + +class TestEventsSayStream: + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def test_say_stream_injected_for_app_mention(self): + app = App(client=self.web_client) + called = {"value": False} + + @app.event("app_mention") + def handle_mention(say_stream: SayStream, context: BoltContext): + assert say_stream is not None + assert isinstance(say_stream, SayStream) + assert say_stream == context.say_stream + assert say_stream.channel == "C111" + assert say_stream.thread_ts == "1595926230.009600" + assert say_stream.recipient_team_id == context.team_id + assert say_stream.recipient_user_id == context.user_id + called["value"] = True + + request = BoltRequest(body=app_mention_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called(called) + + def test_say_stream_with_org_level_install(self): + app = App(client=self.web_client) + called = {"value": False} + + @app.event("app_mention") + def handle_mention(say_stream: SayStream, context: BoltContext): + assert context.team_id is None + assert context.enterprise_id == "E111" + assert say_stream is not None + assert isinstance(say_stream, SayStream) + assert say_stream.recipient_team_id == "E111" + called["value"] = True + + request = BoltRequest(body=org_app_mention_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called(called) + + def test_say_stream_injected_for_threaded_message(self): + app = App(client=self.web_client) + called = {"value": False} + + @app.event("message") + def handle_message(say_stream: SayStream, context: BoltContext): + assert say_stream is not None + assert isinstance(say_stream, SayStream) + assert say_stream == context.say_stream + assert say_stream.channel == "D111" + assert say_stream.thread_ts == "1726133698.626339" + assert say_stream.recipient_team_id == context.team_id + assert say_stream.recipient_user_id == context.user_id + called["value"] = True + + request = BoltRequest(body=threaded_user_message_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called(called) + + def test_say_stream_in_user_message(self): + app = App(client=self.web_client) + called = {"value": False} + + @app.message("") + def handle_user_message(say_stream: SayStream, context: BoltContext): + assert say_stream is not None + assert isinstance(say_stream, SayStream) + assert say_stream == context.say_stream + assert say_stream.channel == "C111" + assert say_stream.thread_ts == "1610261659.001400" + assert say_stream.recipient_team_id == context.team_id + assert say_stream.recipient_user_id == context.user_id + called["value"] = True + + request = BoltRequest(body=user_message_event_payload, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called(called) + + def test_say_stream_in_bot_message(self): + app = App(client=self.web_client) + called = {"value": False} + + @app.message("") + def handle_bot_message(say_stream: SayStream, context: BoltContext): + assert say_stream is not None + assert isinstance(say_stream, SayStream) + assert say_stream == context.say_stream + assert say_stream.channel == "C111" + assert say_stream.thread_ts == "1610261539.000900" + assert say_stream.recipient_team_id == context.team_id + assert say_stream.recipient_user_id == context.user_id + called["value"] = True + + request = BoltRequest(body=bot_message_event_payload, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called(called) + + def test_say_stream_in_assistant_thread_started(self): + app = App(client=self.web_client) + assistant = Assistant() + called = {"value": False} + + @assistant.thread_started + def start_thread(say_stream: SayStream, context: BoltContext): + assert say_stream is not None + assert isinstance(say_stream, SayStream) + assert say_stream == context.say_stream + assert say_stream.channel == "D111" + assert say_stream.thread_ts == "1726133698.626339" + assert say_stream.recipient_team_id == context.team_id + assert say_stream.recipient_user_id == context.user_id + called["value"] = True + + app.assistant(assistant) + + request = BoltRequest(body=thread_started_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called(called) + + def test_say_stream_in_assistant_user_message(self): + app = App(client=self.web_client) + assistant = Assistant() + called = {"value": False} + + @assistant.user_message + def handle_user_message(say_stream: SayStream, context: BoltContext): + assert say_stream is not None + assert isinstance(say_stream, SayStream) + assert say_stream == context.say_stream + assert say_stream.channel == "D111" + assert say_stream.thread_ts == "1726133698.626339" + assert say_stream.recipient_team_id == context.team_id + assert say_stream.recipient_user_id == context.user_id + called["value"] = True + + app.assistant(assistant) + + request = BoltRequest(body=threaded_user_message_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_target_called(called) + + def test_say_stream_is_none_for_view_submission(self): + app = App(client=self.web_client, request_verification_enabled=False) + called = {"value": False} + + @app.view("view-id") + def handle_view(ack, say_stream, context: BoltContext): + ack() + assert say_stream is None + assert context.say_stream is None + called["value"] = True + + request = BoltRequest( + body=f"payload={quote(json.dumps(view_submission_body))}", + ) + response = app.dispatch(request) + assert response.status == 200 + assert_target_called(called) + + +org_app_mention_event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "team": "T111", + "channel": "C111", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, + "authorizations": [ + { + "enterprise_id": "E111", + "team_id": None, + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": True, + } + ], + "is_ext_shared_channel": False, +} diff --git a/tests/scenario_tests_async/test_events_say_stream.py b/tests/scenario_tests_async/test_events_say_stream.py new file mode 100644 index 000000000..c24bc7bfc --- /dev/null +++ b/tests/scenario_tests_async/test_events_say_stream.py @@ -0,0 +1,250 @@ +import asyncio +import json +import time +from urllib.parse import quote + +import pytest +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.async_app import AsyncAssistant +from slack_bolt.context.async_context import AsyncBoltContext +from slack_bolt.context.say_stream.async_say_stream import AsyncSayStream +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + cleanup_mock_web_api_server_async, + setup_mock_web_api_server_async, +) +from tests.scenario_tests_async.test_app import app_mention_event_body +from tests.scenario_tests_async.test_events_assistant import user_message_event_body as threaded_user_message_event_body +from tests.scenario_tests_async.test_events_assistant import thread_started_event_body, user_message_event_body +from tests.scenario_tests_async.test_message_bot import bot_message_event_payload, user_message_event_payload +from tests.scenario_tests_async.test_view_submission import body as view_submission_body +from tests.utils import remove_os_env_temporarily, restore_os_env + + +async def assert_target_called(called: dict, timeout: float = 0.5): + deadline = time.time() + timeout + while called["value"] is not True and time.time() < deadline: + await asyncio.sleep(0.1) + assert called["value"] is True + + +class TestAsyncEventsSayStream: + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): + old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) + try: + yield + finally: + cleanup_mock_web_api_server_async(self) + restore_os_env(old_os_env) + + @pytest.mark.asyncio + async def test_say_stream_injected_for_app_mention(self): + app = AsyncApp(client=self.web_client) + called = {"value": False} + + @app.event("app_mention") + async def handle_mention(say_stream: AsyncSayStream, context: AsyncBoltContext): + assert say_stream is not None + assert isinstance(say_stream, AsyncSayStream) + assert say_stream == context.say_stream + assert say_stream.channel == "C111" + assert say_stream.thread_ts == "1595926230.009600" + assert say_stream.recipient_team_id == context.team_id + assert say_stream.recipient_user_id == context.user_id + called["value"] = True + + request = AsyncBoltRequest(body=app_mention_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called(called) + + @pytest.mark.asyncio + async def test_say_stream_with_org_level_install(self): + app = AsyncApp(client=self.web_client) + called = {"value": False} + + @app.event("app_mention") + async def handle_mention(say_stream: AsyncSayStream, context: AsyncBoltContext): + assert context.team_id is None + assert context.enterprise_id == "E111" + assert say_stream is not None + assert isinstance(say_stream, AsyncSayStream) + assert say_stream.recipient_team_id == "E111" + called["value"] = True + + request = AsyncBoltRequest(body=org_app_mention_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called(called) + + @pytest.mark.asyncio + async def test_say_stream_injected_for_threaded_message(self): + app = AsyncApp(client=self.web_client) + called = {"value": False} + + @app.event("message") + async def handle_message(say_stream: AsyncSayStream, context: AsyncBoltContext): + assert say_stream is not None + assert isinstance(say_stream, AsyncSayStream) + assert say_stream == context.say_stream + assert say_stream.channel == "D111" + assert say_stream.thread_ts == "1726133698.626339" + assert say_stream.recipient_team_id == context.team_id + assert say_stream.recipient_user_id == context.user_id + called["value"] = True + + request = AsyncBoltRequest(body=threaded_user_message_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called(called) + + @pytest.mark.asyncio + async def test_say_stream_in_user_message(self): + app = AsyncApp(client=self.web_client) + called = {"value": False} + + @app.message("") + async def handle_user_message(say_stream: AsyncSayStream, context: AsyncBoltContext): + assert say_stream is not None + assert isinstance(say_stream, AsyncSayStream) + assert say_stream == context.say_stream + assert say_stream.channel == "C111" + assert say_stream.thread_ts == "1610261659.001400" + assert say_stream.recipient_team_id == context.team_id + assert say_stream.recipient_user_id == context.user_id + called["value"] = True + + request = AsyncBoltRequest(body=user_message_event_payload, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called(called) + + @pytest.mark.asyncio + async def test_say_stream_in_bot_message(self): + app = AsyncApp(client=self.web_client) + called = {"value": False} + + @app.message("") + async def handle_user_message(say_stream: AsyncSayStream, context: AsyncBoltContext): + assert say_stream is not None + assert isinstance(say_stream, AsyncSayStream) + assert say_stream == context.say_stream + assert say_stream.channel == "C111" + assert say_stream.thread_ts == "1610261539.000900" + assert say_stream.recipient_team_id == context.team_id + assert say_stream.recipient_user_id == context.user_id + called["value"] = True + + request = AsyncBoltRequest(body=bot_message_event_payload, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called(called) + + @pytest.mark.asyncio + async def test_say_stream_in_assistant_thread_started(self): + app = AsyncApp(client=self.web_client) + assistant = AsyncAssistant() + called = {"value": False} + + @assistant.thread_started + async def start_thread(say_stream: AsyncSayStream, context: AsyncBoltContext): + assert say_stream is not None + assert isinstance(say_stream, AsyncSayStream) + assert say_stream == context.say_stream + assert say_stream.channel == "D111" + assert say_stream.thread_ts == "1726133698.626339" + assert say_stream.recipient_team_id == context.team_id + assert say_stream.recipient_user_id == context.user_id + called["value"] = True + + app.assistant(assistant) + + request = AsyncBoltRequest(body=thread_started_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called(called) + + @pytest.mark.asyncio + async def test_say_stream_in_assistant_user_message(self): + app = AsyncApp(client=self.web_client) + assistant = AsyncAssistant() + called = {"value": False} + + @assistant.user_message + async def handle_user_message(say_stream: AsyncSayStream, context: AsyncBoltContext): + assert say_stream is not None + assert isinstance(say_stream, AsyncSayStream) + assert say_stream == context.say_stream + assert say_stream.channel == "D111" + assert say_stream.thread_ts == "1726133698.626339" + assert say_stream.recipient_team_id == context.team_id + assert say_stream.recipient_user_id == context.user_id + called["value"] = True + + app.assistant(assistant) + + request = AsyncBoltRequest(body=user_message_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called(called) + + @pytest.mark.asyncio + async def test_say_stream_is_none_for_view_submission(self): + app = AsyncApp(client=self.web_client, request_verification_enabled=False) + called = {"value": False} + + @app.view("view-id") + async def handle_view(ack, say_stream, context: AsyncBoltContext): + await ack() + assert say_stream is None + assert context.say_stream is None + called["value"] = True + + request = AsyncBoltRequest( + body=f"payload={quote(json.dumps(view_submission_body))}", + ) + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_target_called(called) + + +org_app_mention_event_body = { + "token": "verification_token", + "team_id": "T111", + "enterprise_id": "E111", + "api_app_id": "A111", + "event": { + "client_msg_id": "9cbd4c5b-7ddf-4ede-b479-ad21fca66d63", + "type": "app_mention", + "text": "<@W111> Hi there!", + "user": "W222", + "ts": "1595926230.009600", + "team": "T111", + "channel": "C111", + "event_ts": "1595926230.009600", + }, + "type": "event_callback", + "event_id": "Ev111", + "event_time": 1595926230, + "authorizations": [ + { + "enterprise_id": "E111", + "team_id": None, + "user_id": "W111", + "is_bot": True, + "is_enterprise_install": True, + } + ], + "is_ext_shared_channel": False, +} diff --git a/tests/slack_bolt/context/test_say_stream.py b/tests/slack_bolt/context/test_say_stream.py new file mode 100644 index 000000000..c8f4c3a31 --- /dev/null +++ b/tests/slack_bolt/context/test_say_stream.py @@ -0,0 +1,103 @@ +import pytest +from slack_sdk import WebClient + +from slack_bolt.context.say_stream.say_stream import SayStream +from slack_bolt.warning import ExperimentalWarning +from tests.mock_web_api_server import cleanup_mock_web_api_server, setup_mock_web_api_server + + +class TestSayStream: + default_chat_stream_buffer_size = WebClient.chat_stream.__kwdefaults__["buffer_size"] + + def setup_method(self): + setup_mock_web_api_server(self) + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + self.web_client = WebClient(token=valid_token, base_url=mock_api_server_base_url) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + + def test_missing_channel_raises(self): + say_stream = SayStream(client=self.web_client, channel=None, thread_ts="111.222") + with pytest.warns(ExperimentalWarning): + with pytest.raises(ValueError, match="channel"): + say_stream() + + def test_missing_thread_ts_raises(self): + say_stream = SayStream(client=self.web_client, channel="C111", thread_ts=None) + with pytest.warns(ExperimentalWarning): + with pytest.raises(ValueError, match="thread_ts"): + say_stream() + + def test_default_params(self): + say_stream = SayStream( + client=self.web_client, + channel="C111", + recipient_team_id="T111", + recipient_user_id="U111", + thread_ts="111.222", + ) + stream = say_stream() + + assert stream._buffer_size == self.default_chat_stream_buffer_size + assert stream._stream_args == { + "channel": "C111", + "thread_ts": "111.222", + "recipient_team_id": "T111", + "recipient_user_id": "U111", + "task_display_mode": None, + } + + def test_parameter_overrides(self): + say_stream = SayStream( + client=self.web_client, + channel="C111", + recipient_team_id="T111", + recipient_user_id="U111", + thread_ts="111.222", + ) + stream = say_stream(channel="C222", thread_ts="333.444", recipient_team_id="T222", recipient_user_id="U222") + + assert stream._buffer_size == self.default_chat_stream_buffer_size + assert stream._stream_args == { + "channel": "C222", + "thread_ts": "333.444", + "recipient_team_id": "T222", + "recipient_user_id": "U222", + "task_display_mode": None, + } + + def test_buffer_size_overrides(self): + say_stream = SayStream( + client=self.web_client, + channel="C111", + recipient_team_id="T111", + recipient_user_id="U111", + thread_ts="111.222", + ) + stream = say_stream( + buffer_size=100, + channel="C222", + thread_ts="333.444", + recipient_team_id="T222", + recipient_user_id="U222", + ) + + assert stream._buffer_size == 100 + assert stream._stream_args == { + "channel": "C222", + "thread_ts": "333.444", + "recipient_team_id": "T222", + "recipient_user_id": "U222", + "task_display_mode": None, + } + + def test_experimental_warning(self): + say_stream = SayStream( + client=self.web_client, + channel="C111", + thread_ts="111.222", + ) + with pytest.warns(ExperimentalWarning, match="say_stream is experimental"): + say_stream() diff --git a/tests/slack_bolt_async/context/test_async_say_stream.py b/tests/slack_bolt_async/context/test_async_say_stream.py new file mode 100644 index 000000000..fbc4c5c7e --- /dev/null +++ b/tests/slack_bolt_async/context/test_async_say_stream.py @@ -0,0 +1,117 @@ +import pytest +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.context.say_stream.async_say_stream import AsyncSayStream +from slack_bolt.warning import ExperimentalWarning +from tests.mock_web_api_server import ( + cleanup_mock_web_api_server, + setup_mock_web_api_server, +) +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestAsyncSayStream: + default_chat_stream_buffer_size = AsyncWebClient.chat_stream.__kwdefaults__["buffer_size"] + + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): + old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + try: + self.web_client = AsyncWebClient(token=valid_token, base_url=mock_api_server_base_url) + yield # run the test here + finally: + cleanup_mock_web_api_server(self) + restore_os_env(old_os_env) + + @pytest.mark.asyncio + async def test_missing_channel_raises(self): + say_stream = AsyncSayStream(client=self.web_client, channel=None, thread_ts="111.222") + with pytest.warns(ExperimentalWarning): + with pytest.raises(ValueError, match="channel"): + await say_stream() + + @pytest.mark.asyncio + async def test_missing_thread_ts_raises(self): + say_stream = AsyncSayStream(client=self.web_client, channel="C111", thread_ts=None) + with pytest.warns(ExperimentalWarning): + with pytest.raises(ValueError, match="thread_ts"): + await say_stream() + + @pytest.mark.asyncio + async def test_default_params(self): + say_stream = AsyncSayStream( + client=self.web_client, + channel="C111", + recipient_team_id="T111", + recipient_user_id="U111", + thread_ts="111.222", + ) + stream = await say_stream() + + assert stream._buffer_size == self.default_chat_stream_buffer_size + assert stream._stream_args == { + "channel": "C111", + "thread_ts": "111.222", + "recipient_team_id": "T111", + "recipient_user_id": "U111", + "task_display_mode": None, + } + + @pytest.mark.asyncio + async def test_parameter_overrides(self): + say_stream = AsyncSayStream( + client=self.web_client, + channel="C111", + recipient_team_id="T111", + recipient_user_id="U111", + thread_ts="111.222", + ) + stream = await say_stream(channel="C222", thread_ts="333.444", recipient_team_id="T222", recipient_user_id="U222") + + assert stream._buffer_size == self.default_chat_stream_buffer_size + assert stream._stream_args == { + "channel": "C222", + "thread_ts": "333.444", + "recipient_team_id": "T222", + "recipient_user_id": "U222", + "task_display_mode": None, + } + + @pytest.mark.asyncio + async def test_buffer_size_overrides(self): + say_stream = AsyncSayStream( + client=self.web_client, + channel="C111", + recipient_team_id="T111", + recipient_user_id="U111", + thread_ts="111.222", + ) + stream = await say_stream( + buffer_size=100, + channel="C222", + thread_ts="333.444", + recipient_team_id="T222", + recipient_user_id="U222", + ) + + assert stream._buffer_size == 100 + assert stream._stream_args == { + "channel": "C222", + "thread_ts": "333.444", + "recipient_team_id": "T222", + "recipient_user_id": "U222", + "task_display_mode": None, + } + + @pytest.mark.asyncio + async def test_experimental_warning(self): + say_stream = AsyncSayStream( + client=self.web_client, + channel="C111", + thread_ts="111.222", + ) + with pytest.warns(ExperimentalWarning, match="say_stream is experimental"): + await say_stream() From 7aa415ff63b9ec4b5a241cb5886fe4ff9f8588eb Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Thu, 19 Mar 2026 11:44:20 -0700 Subject: [PATCH 706/719] fix: improve the robustness of the payload extract logic (#1464) --- slack_bolt/request/internals.py | 42 +++++++++++----------- tests/slack_bolt/request/test_internals.py | 25 +++++++++++++ 2 files changed, 46 insertions(+), 21 deletions(-) diff --git a/slack_bolt/request/internals.py b/slack_bolt/request/internals.py index 466f5daaf..15d1e7367 100644 --- a/slack_bolt/request/internals.py +++ b/slack_bolt/request/internals.py @@ -65,10 +65,10 @@ def extract_enterprise_id(payload: Dict[str, Any]) -> Optional[str]: return extract_enterprise_id(payload["authorizations"][0]) if "enterprise_id" in payload: return payload.get("enterprise_id") - if payload.get("team") is not None and "enterprise_id" in payload["team"]: + if isinstance(payload.get("team"), dict) and "enterprise_id" in payload["team"]: # In the case where the type is view_submission return payload["team"].get("enterprise_id") - if payload.get("event") is not None: + if isinstance(payload.get("event"), dict): return extract_enterprise_id(payload["event"]) return None @@ -88,13 +88,13 @@ def extract_actor_enterprise_id(payload: Dict[str, Any]) -> Optional[str]: def extract_team_id(payload: Dict[str, Any]) -> Optional[str]: - app_installed_team_id = payload.get("view", {}).get("app_installed_team_id") - if app_installed_team_id is not None: + view = payload.get("view") + if isinstance(view, dict) and view.get("app_installed_team_id") is not None: # view_submission payloads can have `view.app_installed_team_id` when a modal view that was opened # in a different workspace via some operations inside a Slack Connect channel. # Note that the same for enterprise_id does not exist. When you need to know the enterprise_id as well, # you have to run some query toward your InstallationStore to know the org where the team_id belongs to. - return app_installed_team_id + return view["app_installed_team_id"] if payload.get("team") is not None: # With org-wide installations, payload.team in interactivity payloads can be None # You need to extract either payload.user.team_id or payload.view.team_id as below @@ -109,12 +109,12 @@ def extract_team_id(payload: Dict[str, Any]) -> Optional[str]: return extract_team_id(payload["authorizations"][0]) if "team_id" in payload: return payload.get("team_id") - if payload.get("event") is not None: + if isinstance(payload.get("event"), dict): return extract_team_id(payload["event"]) - if payload.get("user") is not None: + if isinstance(payload.get("user"), dict): return payload["user"]["team_id"] - if payload.get("view") is not None: - return payload.get("view", {})["team_id"] + if isinstance(payload.get("view"), dict): + return payload["view"]["team_id"] return None @@ -169,12 +169,12 @@ def extract_user_id(payload: Dict[str, Any]) -> Optional[str]: return user.get("id") if "user_id" in payload: return payload.get("user_id") - if payload.get("event") is not None: + if isinstance(payload.get("event"), dict): return extract_user_id(payload["event"]) - if payload.get("message") is not None: + if isinstance(payload.get("message"), dict): # message_changed: body["event"]["message"] return extract_user_id(payload["message"]) - if payload.get("previous_message") is not None: + if isinstance(payload.get("previous_message"), dict): # message_deleted: body["event"]["previous_message"] return extract_user_id(payload["previous_message"]) return None @@ -202,12 +202,12 @@ def extract_channel_id(payload: Dict[str, Any]) -> Optional[str]: return channel.get("id") if "channel_id" in payload: return payload.get("channel_id") - if payload.get("event") is not None: + if isinstance(payload.get("event"), dict): return extract_channel_id(payload["event"]) - if payload.get("item") is not None: + if isinstance(payload.get("item"), dict): # reaction_added: body["event"]["item"] return extract_channel_id(payload["item"]) - if payload.get("assistant_thread") is not None: + if isinstance(payload.get("assistant_thread"), dict): # assistant_thread_started return extract_channel_id(payload["assistant_thread"]) return None @@ -217,7 +217,7 @@ def extract_thread_ts(payload: Dict[str, Any]) -> Optional[str]: thread_ts = payload.get("thread_ts") if thread_ts is not None: return thread_ts - if payload.get("event") is not None: + if isinstance(payload.get("event"), dict): return extract_thread_ts(payload["event"]) if isinstance(payload.get("assistant_thread"), dict): return extract_thread_ts(payload["assistant_thread"]) @@ -231,9 +231,9 @@ def extract_thread_ts(payload: Dict[str, Any]) -> Optional[str]: def extract_function_execution_id(payload: Dict[str, Any]) -> Optional[str]: if payload.get("function_execution_id") is not None: return payload.get("function_execution_id") - if payload.get("event") is not None: + if isinstance(payload.get("event"), dict): return extract_function_execution_id(payload["event"]) - if payload.get("function_data") is not None: + if isinstance(payload.get("function_data"), dict): return payload["function_data"].get("execution_id") return None @@ -241,15 +241,15 @@ def extract_function_execution_id(payload: Dict[str, Any]) -> Optional[str]: def extract_function_bot_access_token(payload: Dict[str, Any]) -> Optional[str]: if payload.get("bot_access_token") is not None: return payload.get("bot_access_token") - if payload.get("event") is not None: + if isinstance(payload.get("event"), dict): return payload["event"].get("bot_access_token") return None def extract_function_inputs(payload: Dict[str, Any]) -> Optional[Dict[str, Any]]: - if payload.get("event") is not None: + if isinstance(payload.get("event"), dict): return payload["event"].get("inputs") - if payload.get("function_data") is not None: + if isinstance(payload.get("function_data"), dict): return payload["function_data"].get("inputs") return None diff --git a/tests/slack_bolt/request/test_internals.py b/tests/slack_bolt/request/test_internals.py index 0b267e3de..8cccf0431 100644 --- a/tests/slack_bolt/request/test_internals.py +++ b/tests/slack_bolt/request/test_internals.py @@ -1248,3 +1248,28 @@ def test_slack_connect_patterns(self): assert extract_actor_enterprise_id(request) == actor_enterprise_id assert extract_actor_team_id(request) == actor_team_id assert extract_actor_user_id(request) == actor_user_id + + def test_extraction_functions_invalid_dict_keys(self): + invalid_payloads = { + "event": {"event": "some_event_type"}, + "user": {"user": "U12345"}, + "team": {"team": "T12345"}, + "view": {"view": "V12345"}, + "message": {"message": "some text"}, + "item": {"item": "item_id"}, + "function_data": {"function_data": "fd_123"}, + "assistant_thread": {"assistant_thread": "at_123"}, + "previous_message": {"previous_message": "old_msg"}, + } + + for _, payload in invalid_payloads.items(): + # We only verify no TypeError/AttributeError is raised and that functions which + # would try to subscript the string value return None instead of crashing. + extract_enterprise_id(payload) + extract_team_id(payload) + extract_user_id(payload) + extract_channel_id(payload) + extract_thread_ts(payload) + extract_function_execution_id(payload) + extract_function_bot_access_token(payload) + extract_function_inputs(payload) From ba7df02bdac421d9a23ebe984cc51ab33da6b693 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Thu, 19 Mar 2026 13:01:15 -0700 Subject: [PATCH 707/719] feat: surface the set_status argument to listeners if required event details are available (#1465) --- .../context/assistant/assistant_utilities.py | 8 + .../assistant/async_assistant_utilities.py | 8 + .../async_attaching_agent_kwargs.py | 7 +- .../attaching_agent_kwargs.py | 7 +- ...est_events_assistant_without_middleware.py | 6 +- .../scenario_tests/test_events_set_status.py | 171 ++++++++++++++++ ...est_events_assistant_without_middleware.py | 6 +- .../test_events_set_status.py | 183 ++++++++++++++++++ .../test_attaching_agent_kwargs.py | 18 +- .../test_async_attaching_agent_kwargs.py | 18 +- 10 files changed, 414 insertions(+), 18 deletions(-) create mode 100644 tests/scenario_tests/test_events_set_status.py create mode 100644 tests/scenario_tests_async/test_events_set_status.py diff --git a/slack_bolt/context/assistant/assistant_utilities.py b/slack_bolt/context/assistant/assistant_utilities.py index 53500efdb..42f05c94b 100644 --- a/slack_bolt/context/assistant/assistant_utilities.py +++ b/slack_bolt/context/assistant/assistant_utilities.py @@ -1,3 +1,4 @@ +import warnings from typing import Optional from slack_sdk.web import WebClient @@ -51,6 +52,13 @@ def is_valid(self) -> bool: @property def set_status(self) -> SetStatus: + warnings.warn( + "AssistantUtilities.set_status is deprecated. " + "Use the set_status argument directly in your listener function " + "or access it via context.set_status instead.", + DeprecationWarning, + stacklevel=2, + ) return SetStatus(self.client, self.channel_id, self.thread_ts) @property diff --git a/slack_bolt/context/assistant/async_assistant_utilities.py b/slack_bolt/context/assistant/async_assistant_utilities.py index 5a7324e99..b40b2619c 100644 --- a/slack_bolt/context/assistant/async_assistant_utilities.py +++ b/slack_bolt/context/assistant/async_assistant_utilities.py @@ -1,3 +1,4 @@ +import warnings from typing import Optional from slack_sdk.web.async_client import AsyncWebClient @@ -54,6 +55,13 @@ def is_valid(self) -> bool: @property def set_status(self) -> AsyncSetStatus: + warnings.warn( + "AsyncAssistantUtilities.set_status is deprecated. " + "Use the set_status argument directly in your listener function " + "or access it via context.set_status instead.", + DeprecationWarning, + stacklevel=2, + ) return AsyncSetStatus(self.client, self.channel_id, self.thread_ts) @property diff --git a/slack_bolt/middleware/attaching_agent_kwargs/async_attaching_agent_kwargs.py b/slack_bolt/middleware/attaching_agent_kwargs/async_attaching_agent_kwargs.py index 08851c1eb..82f1a7671 100644 --- a/slack_bolt/middleware/attaching_agent_kwargs/async_attaching_agent_kwargs.py +++ b/slack_bolt/middleware/attaching_agent_kwargs/async_attaching_agent_kwargs.py @@ -3,6 +3,7 @@ from slack_bolt.context.assistant.async_assistant_utilities import AsyncAssistantUtilities from slack_bolt.context.assistant.thread_context_store.async_store import AsyncAssistantThreadContextStore from slack_bolt.context.say_stream.async_say_stream import AsyncSayStream +from slack_bolt.context.set_status.async_set_status import AsyncSetStatus from slack_bolt.middleware.async_middleware import AsyncMiddleware from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.request.payload_utils import is_assistant_event, to_event @@ -32,7 +33,6 @@ async def async_process( thread_context_store=self.thread_context_store, ) req.context["say"] = assistant.say - req.context["set_status"] = assistant.set_status req.context["set_title"] = assistant.set_title req.context["set_suggested_prompts"] = assistant.set_suggested_prompts req.context["get_thread_context"] = assistant.get_thread_context @@ -41,6 +41,11 @@ async def async_process( # TODO: in the future we might want to introduce a "proper" extract_ts utility thread_ts = req.context.thread_ts or event.get("ts") if req.context.channel_id and thread_ts: + req.context["set_status"] = AsyncSetStatus( + client=req.context.client, + channel_id=req.context.channel_id, + thread_ts=thread_ts, + ) req.context["say_stream"] = AsyncSayStream( client=req.context.client, channel=req.context.channel_id, diff --git a/slack_bolt/middleware/attaching_agent_kwargs/attaching_agent_kwargs.py b/slack_bolt/middleware/attaching_agent_kwargs/attaching_agent_kwargs.py index 38a62c0c8..70f41d561 100644 --- a/slack_bolt/middleware/attaching_agent_kwargs/attaching_agent_kwargs.py +++ b/slack_bolt/middleware/attaching_agent_kwargs/attaching_agent_kwargs.py @@ -3,6 +3,7 @@ from slack_bolt.context.assistant.assistant_utilities import AssistantUtilities from slack_bolt.context.assistant.thread_context_store.store import AssistantThreadContextStore from slack_bolt.context.say_stream.say_stream import SayStream +from slack_bolt.context.set_status.set_status import SetStatus from slack_bolt.middleware import Middleware from slack_bolt.request.payload_utils import is_assistant_event, to_event from slack_bolt.request.request import BoltRequest @@ -26,7 +27,6 @@ def process(self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], Bo thread_context_store=self.thread_context_store, ) req.context["say"] = assistant.say - req.context["set_status"] = assistant.set_status req.context["set_title"] = assistant.set_title req.context["set_suggested_prompts"] = assistant.set_suggested_prompts req.context["get_thread_context"] = assistant.get_thread_context @@ -35,6 +35,11 @@ def process(self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], Bo # TODO: in the future we might want to introduce a "proper" extract_ts utility thread_ts = req.context.thread_ts or event.get("ts") if req.context.channel_id and thread_ts: + req.context["set_status"] = SetStatus( + client=req.context.client, + channel_id=req.context.channel_id, + thread_ts=thread_ts, + ) req.context["say_stream"] = SayStream( client=req.context.client, channel=req.context.channel_id, diff --git a/tests/scenario_tests/test_events_assistant_without_middleware.py b/tests/scenario_tests/test_events_assistant_without_middleware.py index 36d86c43a..6a9381a33 100644 --- a/tests/scenario_tests/test_events_assistant_without_middleware.py +++ b/tests/scenario_tests/test_events_assistant_without_middleware.py @@ -180,7 +180,7 @@ def handle_message_event( ): assert context.thread_ts == "1726133698.626339" assert say.thread_ts == None - assert set_status is None + assert set_status is not None assert set_title is None assert set_suggested_prompts is None assert get_thread_context is None @@ -208,7 +208,7 @@ def handle_message_event( ): assert context.thread_ts == "1726133698.626339" assert say.thread_ts == None - assert set_status is None + assert set_status is not None assert set_title is None assert set_suggested_prompts is None assert get_thread_context is None @@ -236,7 +236,7 @@ def handle_message_event( ): assert context.thread_ts == "1726133698.626339" assert say.thread_ts == None - assert set_status is None + assert set_status is not None assert set_title is None assert set_suggested_prompts is None assert get_thread_context is None diff --git a/tests/scenario_tests/test_events_set_status.py b/tests/scenario_tests/test_events_set_status.py new file mode 100644 index 000000000..2dbdd38b8 --- /dev/null +++ b/tests/scenario_tests/test_events_set_status.py @@ -0,0 +1,171 @@ +import json +from threading import Event +from urllib.parse import quote + +from slack_sdk.web import WebClient + +from slack_bolt import App, BoltContext, BoltRequest +from slack_bolt.context.set_status.set_status import SetStatus +from slack_bolt.middleware.assistant import Assistant +from tests.mock_web_api_server import ( + assert_auth_test_count, + assert_received_request_count, + cleanup_mock_web_api_server, + setup_mock_web_api_server, +) +from tests.scenario_tests.test_app import app_mention_event_body +from tests.scenario_tests.test_events_assistant import thread_started_event_body +from tests.scenario_tests.test_events_assistant import user_message_event_body as threaded_user_message_event_body +from tests.scenario_tests.test_message_bot import bot_message_event_payload, user_message_event_payload +from tests.scenario_tests.test_view_submission import body as view_submission_body +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestEventsSetStatus: + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + web_client = WebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + def setup_method(self): + self.old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server(self) + + def teardown_method(self): + cleanup_mock_web_api_server(self) + restore_os_env(self.old_os_env) + + def test_set_status_injected_for_app_mention(self): + app = App(client=self.web_client) + + @app.event("app_mention") + def handle_mention(set_status: SetStatus, context: BoltContext): + assert set_status is not None + assert isinstance(set_status, SetStatus) + assert set_status == context.set_status + assert set_status.channel_id == "C111" + assert set_status.thread_ts == "1595926230.009600" + set_status(status="Thinking...") + + request = BoltRequest(body=app_mention_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_auth_test_count(self, 1) + assert_received_request_count(self, path="/assistant.threads.setStatus", min_count=1) + + def test_set_status_injected_for_threaded_message(self): + app = App(client=self.web_client) + + @app.event("message") + def handle_message(set_status: SetStatus, context: BoltContext): + assert set_status is not None + assert isinstance(set_status, SetStatus) + assert set_status == context.set_status + assert set_status.channel_id == "D111" + assert set_status.thread_ts == "1726133698.626339" + set_status(status="Thinking...") + + request = BoltRequest(body=threaded_user_message_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_auth_test_count(self, 1) + assert_received_request_count(self, path="/assistant.threads.setStatus", min_count=1) + + def test_set_status_in_user_message(self): + app = App(client=self.web_client) + + @app.message("") + def handle_user_message(set_status: SetStatus, context: BoltContext): + assert set_status is not None + assert isinstance(set_status, SetStatus) + assert set_status == context.set_status + assert set_status.channel_id == "C111" + assert set_status.thread_ts == "1610261659.001400" + set_status(status="Thinking...") + + request = BoltRequest(body=user_message_event_payload, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_auth_test_count(self, 1) + assert_received_request_count(self, path="/assistant.threads.setStatus", min_count=1) + + def test_set_status_in_bot_message(self): + app = App(client=self.web_client) + + @app.message("") + def handle_bot_message(set_status: SetStatus, context: BoltContext): + assert set_status is not None + assert isinstance(set_status, SetStatus) + assert set_status == context.set_status + assert set_status.channel_id == "C111" + assert set_status.thread_ts == "1610261539.000900" + set_status(status="Thinking...") + + request = BoltRequest(body=bot_message_event_payload, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_auth_test_count(self, 1) + assert_received_request_count(self, path="/assistant.threads.setStatus", min_count=1) + + def test_set_status_in_assistant_thread_started(self): + app = App(client=self.web_client) + assistant = Assistant() + + @assistant.thread_started + def start_thread(set_status: SetStatus, context: BoltContext): + assert set_status is not None + assert isinstance(set_status, SetStatus) + assert set_status == context.set_status + assert set_status.channel_id == "D111" + assert set_status.thread_ts == "1726133698.626339" + set_status(status="Thinking...") + + app.assistant(assistant) + + request = BoltRequest(body=thread_started_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_auth_test_count(self, 1) + assert_received_request_count(self, path="/assistant.threads.setStatus", min_count=1) + + def test_set_status_in_assistant_user_message(self): + app = App(client=self.web_client) + assistant = Assistant() + + @assistant.user_message + def handle_user_message(set_status: SetStatus, context: BoltContext): + assert set_status is not None + assert isinstance(set_status, SetStatus) + assert set_status == context.set_status + assert set_status.channel_id == "D111" + assert set_status.thread_ts == "1726133698.626339" + set_status(status="Thinking...") + + app.assistant(assistant) + + request = BoltRequest(body=threaded_user_message_event_body, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert_auth_test_count(self, 1) + assert_received_request_count(self, path="/assistant.threads.setStatus", min_count=1) + + def test_set_status_is_none_for_view_submission(self): + app = App(client=self.web_client, request_verification_enabled=False) + listener_called = Event() + + @app.view("view-id") + def handle_view(ack, set_status, context: BoltContext): + ack() + assert set_status is None + assert context.set_status is None + listener_called.set() + + request = BoltRequest( + body=f"payload={quote(json.dumps(view_submission_body))}", + ) + response = app.dispatch(request) + assert response.status == 200 + assert_auth_test_count(self, 1) + assert listener_called.is_set() diff --git a/tests/scenario_tests_async/test_events_assistant_without_middleware.py b/tests/scenario_tests_async/test_events_assistant_without_middleware.py index be6c2b166..916dfd467 100644 --- a/tests/scenario_tests_async/test_events_assistant_without_middleware.py +++ b/tests/scenario_tests_async/test_events_assistant_without_middleware.py @@ -197,7 +197,7 @@ async def handle_message_event( ): assert context.thread_ts == "1726133698.626339" assert say.thread_ts == None - assert set_status is None + assert set_status is not None assert set_title is None assert set_suggested_prompts is None assert get_thread_context is None @@ -226,7 +226,7 @@ async def handle_message_event( ): assert context.thread_ts == "1726133698.626339" assert say.thread_ts == None - assert set_status is None + assert set_status is not None assert set_title is None assert set_suggested_prompts is None assert get_thread_context is None @@ -255,7 +255,7 @@ async def handle_message_event( ): assert context.thread_ts == "1726133698.626339" assert say.thread_ts == None - assert set_status is None + assert set_status is not None assert set_title is None assert set_suggested_prompts is None assert get_thread_context is None diff --git a/tests/scenario_tests_async/test_events_set_status.py b/tests/scenario_tests_async/test_events_set_status.py new file mode 100644 index 000000000..0e5be3349 --- /dev/null +++ b/tests/scenario_tests_async/test_events_set_status.py @@ -0,0 +1,183 @@ +import asyncio +import json +from urllib.parse import quote + +import pytest +from slack_sdk.web.async_client import AsyncWebClient + +from slack_bolt.app.async_app import AsyncApp +from slack_bolt.async_app import AsyncAssistant +from slack_bolt.context.async_context import AsyncBoltContext +from slack_bolt.context.set_status.async_set_status import AsyncSetStatus +from slack_bolt.request.async_request import AsyncBoltRequest +from tests.mock_web_api_server import ( + assert_auth_test_count_async, + assert_received_request_count_async, + cleanup_mock_web_api_server_async, + setup_mock_web_api_server_async, +) +from tests.scenario_tests_async.test_app import app_mention_event_body +from tests.scenario_tests_async.test_events_assistant import thread_started_event_body +from tests.scenario_tests_async.test_events_assistant import user_message_event_body as threaded_user_message_event_body +from tests.scenario_tests_async.test_message_bot import bot_message_event_payload, user_message_event_payload +from tests.scenario_tests_async.test_view_submission import body as view_submission_body +from tests.utils import remove_os_env_temporarily, restore_os_env + + +class TestAsyncEventsSetStatus: + valid_token = "xoxb-valid" + mock_api_server_base_url = "http://localhost:8888" + web_client = AsyncWebClient( + token=valid_token, + base_url=mock_api_server_base_url, + ) + + @pytest.fixture(scope="function", autouse=True) + def setup_teardown(self): + old_os_env = remove_os_env_temporarily() + setup_mock_web_api_server_async(self) + try: + yield + finally: + cleanup_mock_web_api_server_async(self) + restore_os_env(old_os_env) + + @pytest.mark.asyncio + async def test_set_status_injected_for_app_mention(self): + app = AsyncApp(client=self.web_client) + + @app.event("app_mention") + async def handle_mention(set_status: AsyncSetStatus, context: AsyncBoltContext): + assert set_status is not None + assert isinstance(set_status, AsyncSetStatus) + assert set_status == context.set_status + assert set_status.channel_id == "C111" + assert set_status.thread_ts == "1595926230.009600" + await set_status(status="Thinking...") + + request = AsyncBoltRequest(body=app_mention_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_auth_test_count_async(self, 1) + await assert_received_request_count_async(self, path="/assistant.threads.setStatus", min_count=1) + + @pytest.mark.asyncio + async def test_set_status_injected_for_threaded_message(self): + app = AsyncApp(client=self.web_client) + + @app.event("message") + async def handle_message(set_status: AsyncSetStatus, context: AsyncBoltContext): + assert set_status is not None + assert isinstance(set_status, AsyncSetStatus) + assert set_status == context.set_status + assert set_status.channel_id == "D111" + assert set_status.thread_ts == "1726133698.626339" + await set_status(status="Thinking...") + + request = AsyncBoltRequest(body=threaded_user_message_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_auth_test_count_async(self, 1) + await assert_received_request_count_async(self, path="/assistant.threads.setStatus", min_count=1) + + @pytest.mark.asyncio + async def test_set_status_in_user_message(self): + app = AsyncApp(client=self.web_client) + + @app.message("") + async def handle_user_message(set_status: AsyncSetStatus, context: AsyncBoltContext): + assert set_status is not None + assert isinstance(set_status, AsyncSetStatus) + assert set_status == context.set_status + assert set_status.channel_id == "C111" + assert set_status.thread_ts == "1610261659.001400" + await set_status(status="Thinking...") + + request = AsyncBoltRequest(body=user_message_event_payload, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_auth_test_count_async(self, 1) + await assert_received_request_count_async(self, path="/assistant.threads.setStatus", min_count=1) + + @pytest.mark.asyncio + async def test_set_status_in_bot_message(self): + app = AsyncApp(client=self.web_client) + + @app.message("") + async def handle_user_message(set_status: AsyncSetStatus, context: AsyncBoltContext): + assert set_status is not None + assert isinstance(set_status, AsyncSetStatus) + assert set_status == context.set_status + assert set_status.channel_id == "C111" + assert set_status.thread_ts == "1610261539.000900" + await set_status(status="Thinking...") + + request = AsyncBoltRequest(body=bot_message_event_payload, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_auth_test_count_async(self, 1) + await assert_received_request_count_async(self, path="/assistant.threads.setStatus", min_count=1) + + @pytest.mark.asyncio + async def test_set_status_in_assistant_thread_started(self): + app = AsyncApp(client=self.web_client) + assistant = AsyncAssistant() + + @assistant.thread_started + async def start_thread(set_status: AsyncSetStatus, context: AsyncBoltContext): + assert set_status is not None + assert isinstance(set_status, AsyncSetStatus) + assert set_status == context.set_status + assert set_status.channel_id == "D111" + assert set_status.thread_ts == "1726133698.626339" + await set_status(status="Thinking...") + + app.assistant(assistant) + + request = AsyncBoltRequest(body=thread_started_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_auth_test_count_async(self, 1) + await assert_received_request_count_async(self, path="/assistant.threads.setStatus", min_count=1) + + @pytest.mark.asyncio + async def test_set_status_in_assistant_user_message(self): + app = AsyncApp(client=self.web_client) + assistant = AsyncAssistant() + + @assistant.user_message + async def handle_user_message(set_status: AsyncSetStatus, context: AsyncBoltContext): + assert set_status is not None + assert isinstance(set_status, AsyncSetStatus) + assert set_status == context.set_status + assert set_status.channel_id == "D111" + assert set_status.thread_ts == "1726133698.626339" + await set_status(status="Thinking...") + + app.assistant(assistant) + + request = AsyncBoltRequest(body=threaded_user_message_event_body, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_auth_test_count_async(self, 1) + await assert_received_request_count_async(self, path="/assistant.threads.setStatus", min_count=1) + + @pytest.mark.asyncio + async def test_set_status_is_none_for_view_submission(self): + app = AsyncApp(client=self.web_client, request_verification_enabled=False) + listener_called = asyncio.Event() + + @app.view("view-id") + async def handle_view(ack, set_status, context: AsyncBoltContext): + await ack() + assert set_status is None + assert context.set_status is None + listener_called.set() + + request = AsyncBoltRequest( + body=f"payload={quote(json.dumps(view_submission_body))}", + ) + response = await app.async_dispatch(request) + assert response.status == 200 + await assert_auth_test_count_async(self, 1) + assert listener_called.is_set() diff --git a/tests/slack_bolt/middleware/attaching_agent_kwargs/test_attaching_agent_kwargs.py b/tests/slack_bolt/middleware/attaching_agent_kwargs/test_attaching_agent_kwargs.py index f56bd2e62..8e626fd0c 100644 --- a/tests/slack_bolt/middleware/attaching_agent_kwargs/test_attaching_agent_kwargs.py +++ b/tests/slack_bolt/middleware/attaching_agent_kwargs/test_attaching_agent_kwargs.py @@ -14,7 +14,7 @@ def next(): return BoltResponse(status=200) -AGENT_KWARGS = ("say", "set_status", "set_title", "set_suggested_prompts", "get_thread_context", "save_thread_context") +ASSISTANT_KWARGS = ("say", "set_title", "set_suggested_prompts", "get_thread_context", "save_thread_context") class TestAttachingAgentKwargs: @@ -26,9 +26,11 @@ def test_assistant_event_attaches_kwargs(self): resp = middleware.process(req=req, resp=BoltResponse(status=404), next=next) assert resp.status == 200 - for key in AGENT_KWARGS: + for key in ASSISTANT_KWARGS: assert key in req.context, f"{key} should be set on context" assert req.context["say"].thread_ts == "1726133698.626339" + assert "say_stream" in req.context + assert "set_status" in req.context def test_user_message_event_attaches_kwargs(self): middleware = AttachingAgentKwargs() @@ -38,9 +40,11 @@ def test_user_message_event_attaches_kwargs(self): resp = middleware.process(req=req, resp=BoltResponse(status=404), next=next) assert resp.status == 200 - for key in AGENT_KWARGS: + for key in ASSISTANT_KWARGS: assert key in req.context, f"{key} should be set on context" assert req.context["say"].thread_ts == "1726133698.626339" + assert "say_stream" in req.context + assert "set_status" in req.context def test_non_assistant_event_does_not_attach_kwargs(self): middleware = AttachingAgentKwargs() @@ -50,8 +54,10 @@ def test_non_assistant_event_does_not_attach_kwargs(self): resp = middleware.process(req=req, resp=BoltResponse(status=404), next=next) assert resp.status == 200 - for key in AGENT_KWARGS: + for key in ASSISTANT_KWARGS: assert key not in req.context, f"{key} should not be set on context" + assert "say_stream" in req.context + assert "set_status" in req.context def test_non_event_does_not_attach_kwargs(self): middleware = AttachingAgentKwargs() @@ -60,5 +66,7 @@ def test_non_event_does_not_attach_kwargs(self): resp = middleware.process(req=req, resp=BoltResponse(status=404), next=next) assert resp.status == 200 - for key in AGENT_KWARGS: + for key in ASSISTANT_KWARGS: assert key not in req.context, f"{key} should not be set on context" + assert "say_stream" not in req.context + assert "set_status" not in req.context diff --git a/tests/slack_bolt_async/middleware/attaching_agent_kwargs/test_async_attaching_agent_kwargs.py b/tests/slack_bolt_async/middleware/attaching_agent_kwargs/test_async_attaching_agent_kwargs.py index 55883e5f3..61aa0b59e 100644 --- a/tests/slack_bolt_async/middleware/attaching_agent_kwargs/test_async_attaching_agent_kwargs.py +++ b/tests/slack_bolt_async/middleware/attaching_agent_kwargs/test_async_attaching_agent_kwargs.py @@ -15,7 +15,7 @@ async def next(): return BoltResponse(status=200) -AGENT_KWARGS = ("say", "set_status", "set_title", "set_suggested_prompts", "get_thread_context", "save_thread_context") +ASSISTANT_KWARGS = ("say", "set_title", "set_suggested_prompts", "get_thread_context", "save_thread_context") class TestAsyncAttachingAgentKwargs: @@ -28,9 +28,11 @@ async def test_assistant_event_attaches_kwargs(self): resp = await middleware.async_process(req=req, resp=BoltResponse(status=404), next=next) assert resp.status == 200 - for key in AGENT_KWARGS: + for key in ASSISTANT_KWARGS: assert key in req.context, f"{key} should be set on context" assert req.context["say"].thread_ts == "1726133698.626339" + assert "say_stream" in req.context + assert "set_status" in req.context @pytest.mark.asyncio async def test_user_message_event_attaches_kwargs(self): @@ -41,9 +43,11 @@ async def test_user_message_event_attaches_kwargs(self): resp = await middleware.async_process(req=req, resp=BoltResponse(status=404), next=next) assert resp.status == 200 - for key in AGENT_KWARGS: + for key in ASSISTANT_KWARGS: assert key in req.context, f"{key} should be set on context" assert req.context["say"].thread_ts == "1726133698.626339" + assert "say_stream" in req.context + assert "set_status" in req.context @pytest.mark.asyncio async def test_non_assistant_event_does_not_attach_kwargs(self): @@ -54,8 +58,10 @@ async def test_non_assistant_event_does_not_attach_kwargs(self): resp = await middleware.async_process(req=req, resp=BoltResponse(status=404), next=next) assert resp.status == 200 - for key in AGENT_KWARGS: + for key in ASSISTANT_KWARGS: assert key not in req.context, f"{key} should not be set on context" + assert "say_stream" in req.context + assert "set_status" in req.context @pytest.mark.asyncio async def test_non_event_does_not_attach_kwargs(self): @@ -65,5 +71,7 @@ async def test_non_event_does_not_attach_kwargs(self): resp = await middleware.async_process(req=req, resp=BoltResponse(status=404), next=next) assert resp.status == 200 - for key in AGENT_KWARGS: + for key in ASSISTANT_KWARGS: assert key not in req.context, f"{key} should not be set on context" + assert "say_stream" not in req.context + assert "set_status" not in req.context From 6406058f35f3eee85539e73f87e995ee74ece2ed Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Fri, 20 Mar 2026 07:11:21 -0700 Subject: [PATCH 708/719] fix: Remove 'agent: BoltAgent' listener argument (#1466) --- AGENTS.md | 4 +- slack_bolt/__init__.py | 2 - slack_bolt/agent/__init__.py | 5 - slack_bolt/agent/agent.py | 139 ------ slack_bolt/agent/async_agent.py | 138 ------ slack_bolt/kwargs_injection/args.py | 5 - slack_bolt/kwargs_injection/async_args.py | 5 - slack_bolt/kwargs_injection/async_utils.py | 22 - slack_bolt/kwargs_injection/utils.py | 22 - tests/scenario_tests/test_events_agent.py | 162 ------- .../scenario_tests_async/test_events_agent.py | 169 -------- tests/slack_bolt/agent/__init__.py | 0 tests/slack_bolt/agent/test_agent.py | 365 ---------------- tests/slack_bolt_async/agent/__init__.py | 0 .../agent/test_async_agent.py | 399 ------------------ 15 files changed, 2 insertions(+), 1435 deletions(-) delete mode 100644 slack_bolt/agent/__init__.py delete mode 100644 slack_bolt/agent/agent.py delete mode 100644 slack_bolt/agent/async_agent.py delete mode 100644 tests/scenario_tests/test_events_agent.py delete mode 100644 tests/scenario_tests_async/test_events_agent.py delete mode 100644 tests/slack_bolt/agent/__init__.py delete mode 100644 tests/slack_bolt/agent/test_agent.py delete mode 100644 tests/slack_bolt_async/agent/__init__.py delete mode 100644 tests/slack_bolt_async/agent/test_async_agent.py diff --git a/AGENTS.md b/AGENTS.md index 57f2fa588..892a858e7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -152,7 +152,7 @@ For FaaS environments (`process_before_response=True`), long-running handlers ex ### Kwargs Injection -Listeners receive arguments by parameter name. The framework inspects function signatures and injects matching args: `body`, `event`, `action`, `command`, `payload`, `context`, `client`, `ack`, `say`, `respond`, `logger`, `complete`, `fail`, `agent`, etc. Defined in `slack_bolt/kwargs_injection/args.py`. +Listeners receive arguments by parameter name. The framework inspects function signatures and injects matching args: `body`, `event`, `action`, `command`, `payload`, `context`, `client`, `ack`, `say`, `respond`, `logger`, `complete`, `fail`, etc. Defined in `slack_bolt/kwargs_injection/args.py`. ### Adapter System @@ -160,7 +160,7 @@ Each adapter in `slack_bolt/adapter/` converts between a web framework's request ### AI Agents & Assistants -`BoltAgent` (`slack_bolt/agent/`) provides `chat_stream()`, `set_status()`, and `set_suggested_prompts()` for AI-powered agents. `Assistant` middleware (`slack_bolt/middleware/assistant/`) handles assistant thread events. +`Assistant` middleware (`slack_bolt/middleware/assistant/`) handles assistant thread events. ## Key Development Patterns diff --git a/slack_bolt/__init__.py b/slack_bolt/__init__.py index dfe950bf2..d85453950 100644 --- a/slack_bolt/__init__.py +++ b/slack_bolt/__init__.py @@ -22,7 +22,6 @@ from .response import BoltResponse # AI Agents & Assistants -from .agent import BoltAgent from .middleware.assistant.assistant import ( Assistant, ) @@ -49,7 +48,6 @@ "CustomListenerMatcher", "BoltRequest", "BoltResponse", - "BoltAgent", "Assistant", "AssistantThreadContext", "AssistantThreadContextStore", diff --git a/slack_bolt/agent/__init__.py b/slack_bolt/agent/__init__.py deleted file mode 100644 index 4d751f27f..000000000 --- a/slack_bolt/agent/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from .agent import BoltAgent - -__all__ = [ - "BoltAgent", -] diff --git a/slack_bolt/agent/agent.py b/slack_bolt/agent/agent.py deleted file mode 100644 index 523b0e33c..000000000 --- a/slack_bolt/agent/agent.py +++ /dev/null @@ -1,139 +0,0 @@ -from typing import Dict, List, Optional, Sequence, Union - -from slack_sdk import WebClient -from slack_sdk.web import SlackResponse -from slack_sdk.web.chat_stream import ChatStream - - -class BoltAgent: - """Agent listener argument for building AI-powered Slack agents. - - Experimental: - This API is experimental and may change in future releases. - - @app.event("app_mention") - def handle_mention(agent): - stream = agent.chat_stream() - stream.append(markdown_text="Hello!") - stream.stop() - """ - - def __init__( - self, - *, - client: WebClient, - channel_id: Optional[str] = None, - thread_ts: Optional[str] = None, - ts: Optional[str] = None, - team_id: Optional[str] = None, - user_id: Optional[str] = None, - ): - self._client = client - self._channel_id = channel_id - self._thread_ts = thread_ts - self._ts = ts - self._team_id = team_id - self._user_id = user_id - - def chat_stream( - self, - *, - channel: Optional[str] = None, - thread_ts: Optional[str] = None, - recipient_team_id: Optional[str] = None, - recipient_user_id: Optional[str] = None, - **kwargs, - ) -> ChatStream: - """Creates a ChatStream with defaults from event context. - - Each call creates a new instance. Create multiple for parallel streams. - - Args: - channel: Channel ID. Defaults to the channel from the event context. - thread_ts: Thread timestamp. Defaults to the thread_ts from the event context. - recipient_team_id: Team ID of the recipient. Defaults to the team from the event context. - recipient_user_id: User ID of the recipient. Defaults to the user from the event context. - **kwargs: Additional arguments passed to ``WebClient.chat_stream()``. - - Returns: - A new ``ChatStream`` instance. - """ - provided = [arg for arg in (channel, thread_ts, recipient_team_id, recipient_user_id) if arg is not None] - if provided and len(provided) < 4: - raise ValueError( - "Either provide all of channel, thread_ts, recipient_team_id, and recipient_user_id, or none of them" - ) - # Argument validation is delegated to chat_stream() and the API - return self._client.chat_stream( - channel=channel or self._channel_id, # type: ignore[arg-type] - thread_ts=thread_ts or self._thread_ts or self._ts, # type: ignore[arg-type] - recipient_team_id=recipient_team_id or self._team_id, - recipient_user_id=recipient_user_id or self._user_id, - **kwargs, - ) - - def set_status( - self, - *, - status: str, - loading_messages: Optional[List[str]] = None, - channel_id: Optional[str] = None, - thread_ts: Optional[str] = None, - **kwargs, - ) -> SlackResponse: - """Sets the status of an assistant thread. - - Args: - status: The status text to display. - loading_messages: Optional list of loading messages to cycle through. - channel_id: Channel ID. Defaults to the channel from the event context. - thread_ts: Thread timestamp. Defaults to the thread_ts from the event context. - **kwargs: Additional arguments passed to ``WebClient.assistant_threads_setStatus()``. - - Returns: - ``SlackResponse`` from the API call. - """ - return self._client.assistant_threads_setStatus( - channel_id=channel_id or self._channel_id, # type: ignore[arg-type] - thread_ts=thread_ts or self._thread_ts or self._ts, # type: ignore[arg-type] - status=status, - loading_messages=loading_messages, - **kwargs, - ) - - def set_suggested_prompts( - self, - *, - prompts: Sequence[Union[str, Dict[str, str]]], - title: Optional[str] = None, - channel_id: Optional[str] = None, - thread_ts: Optional[str] = None, - **kwargs, - ) -> SlackResponse: - """Sets suggested prompts for an assistant thread. - - Args: - prompts: A sequence of prompts. Each prompt can be either a string - (used as both title and message) or a dict with 'title' and 'message' keys. - title: Optional title for the suggested prompts section. - channel_id: Channel ID. Defaults to the channel from the event context. - thread_ts: Thread timestamp. Defaults to the thread_ts from the event context. - **kwargs: Additional arguments passed to ``WebClient.assistant_threads_setSuggestedPrompts()``. - - Returns: - ``SlackResponse`` from the API call. - """ - prompts_arg: List[Dict[str, str]] = [] - for prompt in prompts: - if isinstance(prompt, str): - prompts_arg.append({"title": prompt, "message": prompt}) - else: - prompts_arg.append(prompt) - - return self._client.assistant_threads_setSuggestedPrompts( - channel_id=channel_id or self._channel_id, # type: ignore[arg-type] - thread_ts=thread_ts or self._thread_ts or self._ts, # type: ignore[arg-type] - prompts=prompts_arg, - title=title, - **kwargs, - ) diff --git a/slack_bolt/agent/async_agent.py b/slack_bolt/agent/async_agent.py deleted file mode 100644 index da4ec6c0a..000000000 --- a/slack_bolt/agent/async_agent.py +++ /dev/null @@ -1,138 +0,0 @@ -from typing import Dict, List, Optional, Sequence, Union - -from slack_sdk.web.async_client import AsyncSlackResponse, AsyncWebClient -from slack_sdk.web.async_chat_stream import AsyncChatStream - - -class AsyncBoltAgent: - """Async agent listener argument for building AI-powered Slack agents. - - Experimental: - This API is experimental and may change in future releases. - - @app.event("app_mention") - async def handle_mention(agent): - stream = await agent.chat_stream() - await stream.append(markdown_text="Hello!") - await stream.stop() - """ - - def __init__( - self, - *, - client: AsyncWebClient, - channel_id: Optional[str] = None, - thread_ts: Optional[str] = None, - ts: Optional[str] = None, - team_id: Optional[str] = None, - user_id: Optional[str] = None, - ): - self._client = client - self._channel_id = channel_id - self._thread_ts = thread_ts - self._ts = ts - self._team_id = team_id - self._user_id = user_id - - async def chat_stream( - self, - *, - channel: Optional[str] = None, - thread_ts: Optional[str] = None, - recipient_team_id: Optional[str] = None, - recipient_user_id: Optional[str] = None, - **kwargs, - ) -> AsyncChatStream: - """Creates an AsyncChatStream with defaults from event context. - - Each call creates a new instance. Create multiple for parallel streams. - - Args: - channel: Channel ID. Defaults to the channel from the event context. - thread_ts: Thread timestamp. Defaults to the thread_ts from the event context. - recipient_team_id: Team ID of the recipient. Defaults to the team from the event context. - recipient_user_id: User ID of the recipient. Defaults to the user from the event context. - **kwargs: Additional arguments passed to ``AsyncWebClient.chat_stream()``. - - Returns: - A new ``AsyncChatStream`` instance. - """ - provided = [arg for arg in (channel, thread_ts, recipient_team_id, recipient_user_id) if arg is not None] - if provided and len(provided) < 4: - raise ValueError( - "Either provide all of channel, thread_ts, recipient_team_id, and recipient_user_id, or none of them" - ) - # Argument validation is delegated to chat_stream() and the API - return await self._client.chat_stream( - channel=channel or self._channel_id, # type: ignore[arg-type] - thread_ts=thread_ts or self._thread_ts or self._ts, # type: ignore[arg-type] - recipient_team_id=recipient_team_id or self._team_id, - recipient_user_id=recipient_user_id or self._user_id, - **kwargs, - ) - - async def set_status( - self, - *, - status: str, - loading_messages: Optional[List[str]] = None, - channel_id: Optional[str] = None, - thread_ts: Optional[str] = None, - **kwargs, - ) -> AsyncSlackResponse: - """Sets the status of an assistant thread. - - Args: - status: The status text to display. - loading_messages: Optional list of loading messages to cycle through. - channel_id: Channel ID. Defaults to the channel from the event context. - thread_ts: Thread timestamp. Defaults to the thread_ts from the event context. - **kwargs: Additional arguments passed to ``AsyncWebClient.assistant_threads_setStatus()``. - - Returns: - ``AsyncSlackResponse`` from the API call. - """ - return await self._client.assistant_threads_setStatus( - channel_id=channel_id or self._channel_id, # type: ignore[arg-type] - thread_ts=thread_ts or self._thread_ts or self._ts, # type: ignore[arg-type] - status=status, - loading_messages=loading_messages, - **kwargs, - ) - - async def set_suggested_prompts( - self, - *, - prompts: Sequence[Union[str, Dict[str, str]]], - title: Optional[str] = None, - channel_id: Optional[str] = None, - thread_ts: Optional[str] = None, - **kwargs, - ) -> AsyncSlackResponse: - """Sets suggested prompts for an assistant thread. - - Args: - prompts: A sequence of prompts. Each prompt can be either a string - (used as both title and message) or a dict with 'title' and 'message' keys. - title: Optional title for the suggested prompts section. - channel_id: Channel ID. Defaults to the channel from the event context. - thread_ts: Thread timestamp. Defaults to the thread_ts from the event context. - **kwargs: Additional arguments passed to ``AsyncWebClient.assistant_threads_setSuggestedPrompts()``. - - Returns: - ``AsyncSlackResponse`` from the API call. - """ - prompts_arg: List[Dict[str, str]] = [] - for prompt in prompts: - if isinstance(prompt, str): - prompts_arg.append({"title": prompt, "message": prompt}) - else: - prompts_arg.append(prompt) - - return await self._client.assistant_threads_setSuggestedPrompts( - channel_id=channel_id or self._channel_id, # type: ignore[arg-type] - thread_ts=thread_ts or self._thread_ts or self._ts, # type: ignore[arg-type] - prompts=prompts_arg, - title=title, - **kwargs, - ) diff --git a/slack_bolt/kwargs_injection/args.py b/slack_bolt/kwargs_injection/args.py index dfb242fd1..4cd70176d 100644 --- a/slack_bolt/kwargs_injection/args.py +++ b/slack_bolt/kwargs_injection/args.py @@ -8,7 +8,6 @@ from slack_bolt.context.fail import Fail from slack_bolt.context.get_thread_context.get_thread_context import GetThreadContext from slack_bolt.context.respond import Respond -from slack_bolt.agent.agent import BoltAgent from slack_bolt.context.save_thread_context import SaveThreadContext from slack_bolt.context.say import Say from slack_bolt.context.say_stream import SayStream @@ -104,8 +103,6 @@ def handle_buttons(args): """`get_thread_context()` utility function for AI Agents & Assistants""" save_thread_context: Optional[SaveThreadContext] """`save_thread_context()` utility function for AI Agents & Assistants""" - agent: Optional[BoltAgent] - """`agent` listener argument for AI Agents & Assistants""" say_stream: Optional[SayStream] """`say_stream()` utility function for AI Agents & Assistants""" # middleware @@ -141,7 +138,6 @@ def __init__( set_suggested_prompts: Optional[SetSuggestedPrompts] = None, get_thread_context: Optional[GetThreadContext] = None, save_thread_context: Optional[SaveThreadContext] = None, - agent: Optional[BoltAgent] = None, say_stream: Optional[SayStream] = None, # As this method is not supposed to be invoked by bolt-python users, # the naming conflict with the built-in one affects @@ -176,7 +172,6 @@ def __init__( self.set_suggested_prompts = set_suggested_prompts self.get_thread_context = get_thread_context self.save_thread_context = save_thread_context - self.agent = agent self.say_stream = say_stream self.next: Callable[[], None] = next diff --git a/slack_bolt/kwargs_injection/async_args.py b/slack_bolt/kwargs_injection/async_args.py index 19719e900..2217cfe9f 100644 --- a/slack_bolt/kwargs_injection/async_args.py +++ b/slack_bolt/kwargs_injection/async_args.py @@ -1,7 +1,6 @@ from logging import Logger from typing import Callable, Awaitable, Dict, Any, Optional -from slack_bolt.agent.async_agent import AsyncBoltAgent from slack_bolt.context.ack.async_ack import AsyncAck from slack_bolt.context.async_context import AsyncBoltContext from slack_bolt.context.complete.async_complete import AsyncComplete @@ -103,8 +102,6 @@ async def handle_buttons(args): """`get_thread_context()` utility function for AI Agents & Assistants""" save_thread_context: Optional[AsyncSaveThreadContext] """`save_thread_context()` utility function for AI Agents & Assistants""" - agent: Optional[AsyncBoltAgent] - """`agent` listener argument for AI Agents & Assistants""" say_stream: Optional[AsyncSayStream] """`say_stream()` utility function for AI Agents & Assistants""" # middleware @@ -140,7 +137,6 @@ def __init__( set_suggested_prompts: Optional[AsyncSetSuggestedPrompts] = None, get_thread_context: Optional[AsyncGetThreadContext] = None, save_thread_context: Optional[AsyncSaveThreadContext] = None, - agent: Optional[AsyncBoltAgent] = None, say_stream: Optional[AsyncSayStream] = None, next: Callable[[], Awaitable[None]], **kwargs, # noqa @@ -172,7 +168,6 @@ def __init__( self.set_suggested_prompts = set_suggested_prompts self.get_thread_context = get_thread_context self.save_thread_context = save_thread_context - self.agent = agent self.say_stream = say_stream self.next: Callable[[], Awaitable[None]] = next diff --git a/slack_bolt/kwargs_injection/async_utils.py b/slack_bolt/kwargs_injection/async_utils.py index 534fb6133..246fd10c9 100644 --- a/slack_bolt/kwargs_injection/async_utils.py +++ b/slack_bolt/kwargs_injection/async_utils.py @@ -1,11 +1,9 @@ import inspect import logging -import warnings from typing import Callable, Dict, MutableSequence, Optional, Any from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse -from slack_bolt.warning import ExperimentalWarning from .async_args import AsyncArgs from slack_bolt.request.payload_utils import ( to_options, @@ -86,26 +84,6 @@ def build_async_required_kwargs( if k not in all_available_args: all_available_args[k] = v - # Defer agent creation to avoid constructing AsyncBoltAgent on every request - if "agent" in required_arg_names: - from slack_bolt.agent.async_agent import AsyncBoltAgent - - event = request.body.get("event", {}) - - all_available_args["agent"] = AsyncBoltAgent( - client=request.context.client, - channel_id=request.context.channel_id, - thread_ts=request.context.thread_ts or event.get("thread_ts"), - ts=event.get("ts"), - team_id=request.context.team_id, - user_id=request.context.user_id, - ) - warnings.warn( - "The agent listener argument is experimental and may change in future versions.", - category=ExperimentalWarning, - stacklevel=2, # Point to the caller, not this internal helper - ) - if len(required_arg_names) > 0: # To support instance/class methods in a class for listeners/middleware, # check if the first argument is either self or cls diff --git a/slack_bolt/kwargs_injection/utils.py b/slack_bolt/kwargs_injection/utils.py index 101e00099..218fbeb6e 100644 --- a/slack_bolt/kwargs_injection/utils.py +++ b/slack_bolt/kwargs_injection/utils.py @@ -1,11 +1,9 @@ import inspect import logging -import warnings from typing import Callable, Dict, MutableSequence, Optional, Any from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse -from slack_bolt.warning import ExperimentalWarning from .args import Args from slack_bolt.request.payload_utils import ( to_options, @@ -85,26 +83,6 @@ def build_required_kwargs( if k not in all_available_args: all_available_args[k] = v - # Defer agent creation to avoid constructing BoltAgent on every request - if "agent" in required_arg_names: - from slack_bolt.agent.agent import BoltAgent - - event = request.body.get("event", {}) - - all_available_args["agent"] = BoltAgent( - client=request.context.client, - channel_id=request.context.channel_id, - thread_ts=request.context.thread_ts or event.get("thread_ts"), - ts=event.get("ts"), - team_id=request.context.team_id, - user_id=request.context.user_id, - ) - warnings.warn( - "The agent listener argument is experimental and may change in future versions.", - category=ExperimentalWarning, - stacklevel=2, # Point to the caller, not this internal helper - ) - if len(required_arg_names) > 0: # To support instance/class methods in a class for listeners/middleware, # check if the first argument is either self or cls diff --git a/tests/scenario_tests/test_events_agent.py b/tests/scenario_tests/test_events_agent.py deleted file mode 100644 index 667739728..000000000 --- a/tests/scenario_tests/test_events_agent.py +++ /dev/null @@ -1,162 +0,0 @@ -import json -from time import sleep - -import pytest -from slack_sdk.web import WebClient - -from slack_bolt import App, BoltRequest, BoltContext, BoltAgent -from slack_bolt.agent.agent import BoltAgent as BoltAgentDirect -from slack_bolt.warning import ExperimentalWarning -from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, -) -from tests.utils import remove_os_env_temporarily, restore_os_env - - -class TestEventsAgent: - valid_token = "xoxb-valid" - mock_api_server_base_url = "http://localhost:8888" - web_client = WebClient( - token=valid_token, - base_url=mock_api_server_base_url, - ) - - def setup_method(self): - self.old_os_env = remove_os_env_temporarily() - setup_mock_web_api_server(self) - - def teardown_method(self): - cleanup_mock_web_api_server(self) - restore_os_env(self.old_os_env) - - def test_agent_injected_for_app_mention(self): - app = App(client=self.web_client) - - state = {"called": False} - - def assert_target_called(): - count = 0 - while state["called"] is False and count < 20: - sleep(0.1) - count += 1 - assert state["called"] is True - state["called"] = False - - @app.event("app_mention") - def handle_mention(agent: BoltAgent, context: BoltContext): - assert agent is not None - assert isinstance(agent, BoltAgentDirect) - assert context.channel_id == "C111" - state["called"] = True - - request = BoltRequest(body=app_mention_event_body, mode="socket_mode") - response = app.dispatch(request) - assert response.status == 200 - assert_target_called() - - def test_agent_available_in_action_listener(self): - app = App(client=self.web_client) - - state = {"called": False} - - def assert_target_called(): - count = 0 - while state["called"] is False and count < 20: - sleep(0.1) - count += 1 - assert state["called"] is True - state["called"] = False - - @app.action("test_action") - def handle_action(ack, agent: BoltAgent): - ack() - assert agent is not None - assert isinstance(agent, BoltAgentDirect) - state["called"] = True - - request = BoltRequest(body=json.dumps(action_event_body), mode="socket_mode") - response = app.dispatch(request) - assert response.status == 200 - assert_target_called() - - def test_agent_kwarg_emits_experimental_warning(self): - app = App(client=self.web_client) - - state = {"called": False} - - def assert_target_called(): - count = 0 - while state["called"] is False and count < 20: - sleep(0.1) - count += 1 - assert state["called"] is True - state["called"] = False - - @app.event("app_mention") - def handle_mention(agent: BoltAgent): - state["called"] = True - - request = BoltRequest(body=app_mention_event_body, mode="socket_mode") - with pytest.warns(ExperimentalWarning, match="agent listener argument is experimental"): - response = app.dispatch(request) - assert response.status == 200 - assert_target_called() - - -# ---- Test event bodies ---- - - -def build_payload(event: dict) -> dict: - return { - "token": "verification_token", - "team_id": "T111", - "enterprise_id": "E111", - "api_app_id": "A111", - "event": event, - "type": "event_callback", - "event_id": "Ev111", - "event_time": 1599616881, - "authorizations": [ - { - "enterprise_id": "E111", - "team_id": "T111", - "user_id": "W111", - "is_bot": True, - "is_enterprise_install": False, - } - ], - } - - -app_mention_event_body = build_payload( - { - "type": "app_mention", - "user": "W222", - "text": "<@W111> hello", - "ts": "1234567890.123456", - "channel": "C111", - "event_ts": "1234567890.123456", - } -) - -action_event_body = { - "type": "block_actions", - "user": {"id": "W222", "username": "test_user", "name": "test_user", "team_id": "T111"}, - "api_app_id": "A111", - "token": "verification_token", - "container": {"type": "message", "message_ts": "1234567890.123456", "channel_id": "C111", "is_ephemeral": False}, - "channel": {"id": "C111", "name": "test-channel"}, - "team": {"id": "T111", "domain": "test"}, - "enterprise": {"id": "E111", "name": "test"}, - "trigger_id": "111.222.xxx", - "actions": [ - { - "type": "button", - "block_id": "b", - "action_id": "test_action", - "text": {"type": "plain_text", "text": "Button"}, - "action_ts": "1234567890.123456", - } - ], -} diff --git a/tests/scenario_tests_async/test_events_agent.py b/tests/scenario_tests_async/test_events_agent.py deleted file mode 100644 index 1702cdb61..000000000 --- a/tests/scenario_tests_async/test_events_agent.py +++ /dev/null @@ -1,169 +0,0 @@ -import asyncio -import json - -import pytest -from slack_sdk.web.async_client import AsyncWebClient - -from slack_bolt.agent.async_agent import AsyncBoltAgent -from slack_bolt.app.async_app import AsyncApp -from slack_bolt.context.async_context import AsyncBoltContext -from slack_bolt.request.async_request import AsyncBoltRequest -from slack_bolt.warning import ExperimentalWarning -from tests.mock_web_api_server import ( - cleanup_mock_web_api_server_async, - setup_mock_web_api_server_async, -) -from tests.utils import remove_os_env_temporarily, restore_os_env - - -class TestAsyncEventsAgent: - valid_token = "xoxb-valid" - mock_api_server_base_url = "http://localhost:8888" - web_client = AsyncWebClient( - token=valid_token, - base_url=mock_api_server_base_url, - ) - - @pytest.fixture(scope="function", autouse=True) - def setup_teardown(self): - old_os_env = remove_os_env_temporarily() - setup_mock_web_api_server_async(self) - try: - yield - finally: - cleanup_mock_web_api_server_async(self) - restore_os_env(old_os_env) - - @pytest.mark.asyncio - async def test_agent_injected_for_app_mention(self): - app = AsyncApp(client=self.web_client) - - state = {"called": False} - - async def assert_target_called(): - count = 0 - while state["called"] is False and count < 20: - await asyncio.sleep(0.1) - count += 1 - assert state["called"] is True - state["called"] = False - - @app.event("app_mention") - async def handle_mention(agent: AsyncBoltAgent, context: AsyncBoltContext): - assert agent is not None - assert isinstance(agent, AsyncBoltAgent) - assert context.channel_id == "C111" - state["called"] = True - - request = AsyncBoltRequest(body=app_mention_event_body, mode="socket_mode") - response = await app.async_dispatch(request) - assert response.status == 200 - await assert_target_called() - - @pytest.mark.asyncio - async def test_agent_available_in_action_listener(self): - app = AsyncApp(client=self.web_client) - - state = {"called": False} - - async def assert_target_called(): - count = 0 - while state["called"] is False and count < 20: - await asyncio.sleep(0.1) - count += 1 - assert state["called"] is True - state["called"] = False - - @app.action("test_action") - async def handle_action(ack, agent: AsyncBoltAgent): - await ack() - assert agent is not None - assert isinstance(agent, AsyncBoltAgent) - state["called"] = True - - request = AsyncBoltRequest(body=json.dumps(action_event_body), mode="socket_mode") - response = await app.async_dispatch(request) - assert response.status == 200 - await assert_target_called() - - @pytest.mark.asyncio - async def test_agent_kwarg_emits_experimental_warning(self): - app = AsyncApp(client=self.web_client) - - state = {"called": False} - - async def assert_target_called(): - count = 0 - while state["called"] is False and count < 20: - await asyncio.sleep(0.1) - count += 1 - assert state["called"] is True - state["called"] = False - - @app.event("app_mention") - async def handle_mention(agent: AsyncBoltAgent): - state["called"] = True - - request = AsyncBoltRequest(body=app_mention_event_body, mode="socket_mode") - with pytest.warns(ExperimentalWarning, match="agent listener argument is experimental"): - response = await app.async_dispatch(request) - assert response.status == 200 - await assert_target_called() - - -# ---- Test event bodies ---- - - -def build_payload(event: dict) -> dict: - return { - "token": "verification_token", - "team_id": "T111", - "enterprise_id": "E111", - "api_app_id": "A111", - "event": event, - "type": "event_callback", - "event_id": "Ev111", - "event_time": 1599616881, - "authorizations": [ - { - "enterprise_id": "E111", - "team_id": "T111", - "user_id": "W111", - "is_bot": True, - "is_enterprise_install": False, - } - ], - } - - -app_mention_event_body = build_payload( - { - "type": "app_mention", - "user": "W222", - "text": "<@W111> hello", - "ts": "1234567890.123456", - "channel": "C111", - "event_ts": "1234567890.123456", - } -) - -action_event_body = { - "type": "block_actions", - "user": {"id": "W222", "username": "test_user", "name": "test_user", "team_id": "T111"}, - "api_app_id": "A111", - "token": "verification_token", - "container": {"type": "message", "message_ts": "1234567890.123456", "channel_id": "C111", "is_ephemeral": False}, - "channel": {"id": "C111", "name": "test-channel"}, - "team": {"id": "T111", "domain": "test"}, - "enterprise": {"id": "E111", "name": "test"}, - "trigger_id": "111.222.xxx", - "actions": [ - { - "type": "button", - "block_id": "b", - "action_id": "test_action", - "text": {"type": "plain_text", "text": "Button"}, - "action_ts": "1234567890.123456", - } - ], -} diff --git a/tests/slack_bolt/agent/__init__.py b/tests/slack_bolt/agent/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/slack_bolt/agent/test_agent.py b/tests/slack_bolt/agent/test_agent.py deleted file mode 100644 index 76ac7d17b..000000000 --- a/tests/slack_bolt/agent/test_agent.py +++ /dev/null @@ -1,365 +0,0 @@ -from unittest.mock import MagicMock - -import pytest -from slack_sdk.web import WebClient -from slack_sdk.web.chat_stream import ChatStream - -from slack_bolt.agent.agent import BoltAgent - - -class TestBoltAgent: - def test_chat_stream_uses_context_defaults(self): - """BoltAgent.chat_stream() passes context defaults to WebClient.chat_stream().""" - client = MagicMock(spec=WebClient) - client.chat_stream.return_value = MagicMock(spec=ChatStream) - - agent = BoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - stream = agent.chat_stream() - - client.chat_stream.assert_called_once_with( - channel="C111", - thread_ts="1234567890.123456", - recipient_team_id="T111", - recipient_user_id="W222", - ) - assert stream is not None - - def test_chat_stream_overrides_context_defaults(self): - """Explicit kwargs to chat_stream() override context defaults.""" - client = MagicMock(spec=WebClient) - client.chat_stream.return_value = MagicMock(spec=ChatStream) - - agent = BoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - stream = agent.chat_stream( - channel="C999", - thread_ts="9999999999.999999", - recipient_team_id="T999", - recipient_user_id="U999", - ) - - client.chat_stream.assert_called_once_with( - channel="C999", - thread_ts="9999999999.999999", - recipient_team_id="T999", - recipient_user_id="U999", - ) - assert stream is not None - - def test_chat_stream_rejects_partial_overrides(self): - """Passing only some of the four context args raises ValueError.""" - client = MagicMock(spec=WebClient) - agent = BoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - with pytest.raises(ValueError, match="Either provide all of"): - agent.chat_stream(channel="C999") - - def test_chat_stream_passes_extra_kwargs(self): - """Extra kwargs are forwarded to WebClient.chat_stream().""" - client = MagicMock(spec=WebClient) - client.chat_stream.return_value = MagicMock(spec=ChatStream) - - agent = BoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - agent.chat_stream(buffer_size=512) - - client.chat_stream.assert_called_once_with( - channel="C111", - thread_ts="1234567890.123456", - recipient_team_id="T111", - recipient_user_id="W222", - buffer_size=512, - ) - - def test_chat_stream_falls_back_to_ts(self): - """When thread_ts is not set, chat_stream() falls back to ts.""" - client = MagicMock(spec=WebClient) - client.chat_stream.return_value = MagicMock(spec=ChatStream) - - agent = BoltAgent( - client=client, - channel_id="C111", - team_id="T111", - ts="1111111111.111111", - user_id="W222", - ) - stream = agent.chat_stream() - - client.chat_stream.assert_called_once_with( - channel="C111", - thread_ts="1111111111.111111", - recipient_team_id="T111", - recipient_user_id="W222", - ) - assert stream is not None - - def test_chat_stream_prefers_thread_ts_over_ts(self): - """thread_ts takes priority over ts.""" - client = MagicMock(spec=WebClient) - client.chat_stream.return_value = MagicMock(spec=ChatStream) - - agent = BoltAgent( - client=client, - channel_id="C111", - team_id="T111", - thread_ts="1234567890.123456", - ts="1111111111.111111", - user_id="W222", - ) - stream = agent.chat_stream() - - client.chat_stream.assert_called_once_with( - channel="C111", - thread_ts="1234567890.123456", - recipient_team_id="T111", - recipient_user_id="W222", - ) - assert stream is not None - - def test_set_status_uses_context_defaults(self): - """BoltAgent.set_status() passes context defaults to WebClient.assistant_threads_setStatus().""" - client = MagicMock(spec=WebClient) - client.assistant_threads_setStatus.return_value = MagicMock() - - agent = BoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - agent.set_status(status="Thinking...") - - client.assistant_threads_setStatus.assert_called_once_with( - channel_id="C111", - thread_ts="1234567890.123456", - status="Thinking...", - loading_messages=None, - ) - - def test_set_status_with_loading_messages(self): - """BoltAgent.set_status() forwards loading_messages.""" - client = MagicMock(spec=WebClient) - client.assistant_threads_setStatus.return_value = MagicMock() - - agent = BoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - agent.set_status( - status="Thinking...", - loading_messages=["Sitting...", "Waiting..."], - ) - - client.assistant_threads_setStatus.assert_called_once_with( - channel_id="C111", - thread_ts="1234567890.123456", - status="Thinking...", - loading_messages=["Sitting...", "Waiting..."], - ) - - def test_set_status_overrides_context_defaults(self): - """Explicit channel_id/thread_ts override context defaults.""" - client = MagicMock(spec=WebClient) - client.assistant_threads_setStatus.return_value = MagicMock() - - agent = BoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - agent.set_status( - status="Thinking...", - channel_id="C999", - thread_ts="9999999999.999999", - ) - - client.assistant_threads_setStatus.assert_called_once_with( - channel_id="C999", - thread_ts="9999999999.999999", - status="Thinking...", - loading_messages=None, - ) - - def test_set_status_passes_extra_kwargs(self): - """Extra kwargs are forwarded to WebClient.assistant_threads_setStatus().""" - client = MagicMock(spec=WebClient) - client.assistant_threads_setStatus.return_value = MagicMock() - - agent = BoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - agent.set_status(status="Thinking...", token="xoxb-override") - - client.assistant_threads_setStatus.assert_called_once_with( - channel_id="C111", - thread_ts="1234567890.123456", - status="Thinking...", - loading_messages=None, - token="xoxb-override", - ) - - def test_set_status_requires_status(self): - """set_status() raises TypeError when status is not provided.""" - client = MagicMock(spec=WebClient) - agent = BoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - with pytest.raises(TypeError): - agent.set_status() - - def test_set_suggested_prompts_uses_context_defaults(self): - """BoltAgent.set_suggested_prompts() passes context defaults to WebClient.assistant_threads_setSuggestedPrompts().""" - client = MagicMock(spec=WebClient) - client.assistant_threads_setSuggestedPrompts.return_value = MagicMock() - - agent = BoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - agent.set_suggested_prompts(prompts=["What can you do?", "Help me write code"]) - - client.assistant_threads_setSuggestedPrompts.assert_called_once_with( - channel_id="C111", - thread_ts="1234567890.123456", - prompts=[ - {"title": "What can you do?", "message": "What can you do?"}, - {"title": "Help me write code", "message": "Help me write code"}, - ], - title=None, - ) - - def test_set_suggested_prompts_with_dict_prompts(self): - """BoltAgent.set_suggested_prompts() accepts dict prompts with title and message.""" - client = MagicMock(spec=WebClient) - client.assistant_threads_setSuggestedPrompts.return_value = MagicMock() - - agent = BoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - agent.set_suggested_prompts( - prompts=[ - {"title": "Short title", "message": "A much longer message for this prompt"}, - ], - title="Suggestions", - ) - - client.assistant_threads_setSuggestedPrompts.assert_called_once_with( - channel_id="C111", - thread_ts="1234567890.123456", - prompts=[ - {"title": "Short title", "message": "A much longer message for this prompt"}, - ], - title="Suggestions", - ) - - def test_set_suggested_prompts_overrides_context_defaults(self): - """Explicit channel_id/thread_ts override context defaults.""" - client = MagicMock(spec=WebClient) - client.assistant_threads_setSuggestedPrompts.return_value = MagicMock() - - agent = BoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - agent.set_suggested_prompts( - prompts=["Hello"], - channel_id="C999", - thread_ts="9999999999.999999", - ) - - client.assistant_threads_setSuggestedPrompts.assert_called_once_with( - channel_id="C999", - thread_ts="9999999999.999999", - prompts=[{"title": "Hello", "message": "Hello"}], - title=None, - ) - - def test_set_suggested_prompts_passes_extra_kwargs(self): - """Extra kwargs are forwarded to WebClient.assistant_threads_setSuggestedPrompts().""" - client = MagicMock(spec=WebClient) - client.assistant_threads_setSuggestedPrompts.return_value = MagicMock() - - agent = BoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - agent.set_suggested_prompts(prompts=["Hello"], token="xoxb-override") - - client.assistant_threads_setSuggestedPrompts.assert_called_once_with( - channel_id="C111", - thread_ts="1234567890.123456", - prompts=[{"title": "Hello", "message": "Hello"}], - title=None, - token="xoxb-override", - ) - - def test_set_suggested_prompts_requires_prompts(self): - """set_suggested_prompts() raises TypeError when prompts is not provided.""" - client = MagicMock(spec=WebClient) - agent = BoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - with pytest.raises(TypeError): - agent.set_suggested_prompts() - - def test_import_from_slack_bolt(self): - from slack_bolt import BoltAgent as ImportedBoltAgent - - assert ImportedBoltAgent is BoltAgent - - def test_import_from_agent_module(self): - from slack_bolt.agent import BoltAgent as ImportedBoltAgent - - assert ImportedBoltAgent is BoltAgent diff --git a/tests/slack_bolt_async/agent/__init__.py b/tests/slack_bolt_async/agent/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/slack_bolt_async/agent/test_async_agent.py b/tests/slack_bolt_async/agent/test_async_agent.py deleted file mode 100644 index 3ed8ef0b4..000000000 --- a/tests/slack_bolt_async/agent/test_async_agent.py +++ /dev/null @@ -1,399 +0,0 @@ -from unittest.mock import MagicMock - -import pytest -from slack_sdk.web.async_client import AsyncWebClient -from slack_sdk.web.async_chat_stream import AsyncChatStream - -from slack_bolt.agent.async_agent import AsyncBoltAgent - - -def _make_async_chat_stream_mock(): - mock_stream = MagicMock(spec=AsyncChatStream) - call_tracker = MagicMock() - - async def fake_chat_stream(**kwargs): - call_tracker(**kwargs) - return mock_stream - - return fake_chat_stream, call_tracker, mock_stream - - -def _make_async_api_mock(): - mock_response = MagicMock() - call_tracker = MagicMock() - - async def fake_api_call(**kwargs): - call_tracker(**kwargs) - return mock_response - - return fake_api_call, call_tracker, mock_response - - -class TestAsyncBoltAgent: - @pytest.mark.asyncio - async def test_chat_stream_uses_context_defaults(self): - """AsyncBoltAgent.chat_stream() passes context defaults to AsyncWebClient.chat_stream().""" - client = MagicMock(spec=AsyncWebClient) - client.chat_stream, call_tracker, _ = _make_async_chat_stream_mock() - - agent = AsyncBoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - stream = await agent.chat_stream() - - call_tracker.assert_called_once_with( - channel="C111", - thread_ts="1234567890.123456", - recipient_team_id="T111", - recipient_user_id="W222", - ) - assert stream is not None - - @pytest.mark.asyncio - async def test_chat_stream_overrides_context_defaults(self): - """Explicit kwargs to chat_stream() override context defaults.""" - client = MagicMock(spec=AsyncWebClient) - client.chat_stream, call_tracker, _ = _make_async_chat_stream_mock() - - agent = AsyncBoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - stream = await agent.chat_stream( - channel="C999", - thread_ts="9999999999.999999", - recipient_team_id="T999", - recipient_user_id="U999", - ) - - call_tracker.assert_called_once_with( - channel="C999", - thread_ts="9999999999.999999", - recipient_team_id="T999", - recipient_user_id="U999", - ) - assert stream is not None - - @pytest.mark.asyncio - async def test_chat_stream_rejects_partial_overrides(self): - """Passing only some of the four context args raises ValueError.""" - client = MagicMock(spec=AsyncWebClient) - agent = AsyncBoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - with pytest.raises(ValueError, match="Either provide all of"): - await agent.chat_stream(channel="C999") - - @pytest.mark.asyncio - async def test_chat_stream_passes_extra_kwargs(self): - """Extra kwargs are forwarded to AsyncWebClient.chat_stream().""" - client = MagicMock(spec=AsyncWebClient) - client.chat_stream, call_tracker, _ = _make_async_chat_stream_mock() - - agent = AsyncBoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - await agent.chat_stream(buffer_size=512) - - call_tracker.assert_called_once_with( - channel="C111", - thread_ts="1234567890.123456", - recipient_team_id="T111", - recipient_user_id="W222", - buffer_size=512, - ) - - @pytest.mark.asyncio - async def test_chat_stream_falls_back_to_ts(self): - """When thread_ts is not set, chat_stream() falls back to ts.""" - client = MagicMock(spec=AsyncWebClient) - client.chat_stream, call_tracker, _ = _make_async_chat_stream_mock() - - agent = AsyncBoltAgent( - client=client, - channel_id="C111", - team_id="T111", - ts="1111111111.111111", - user_id="W222", - ) - stream = await agent.chat_stream() - - call_tracker.assert_called_once_with( - channel="C111", - thread_ts="1111111111.111111", - recipient_team_id="T111", - recipient_user_id="W222", - ) - assert stream is not None - - @pytest.mark.asyncio - async def test_chat_stream_prefers_thread_ts_over_ts(self): - """thread_ts takes priority over ts.""" - client = MagicMock(spec=AsyncWebClient) - client.chat_stream, call_tracker, _ = _make_async_chat_stream_mock() - - agent = AsyncBoltAgent( - client=client, - channel_id="C111", - team_id="T111", - thread_ts="1234567890.123456", - ts="1111111111.111111", - user_id="W222", - ) - stream = await agent.chat_stream() - - call_tracker.assert_called_once_with( - channel="C111", - thread_ts="1234567890.123456", - recipient_team_id="T111", - recipient_user_id="W222", - ) - assert stream is not None - - @pytest.mark.asyncio - async def test_set_status_uses_context_defaults(self): - """AsyncBoltAgent.set_status() passes context defaults to AsyncWebClient.assistant_threads_setStatus().""" - client = MagicMock(spec=AsyncWebClient) - client.assistant_threads_setStatus, call_tracker, _ = _make_async_api_mock() - - agent = AsyncBoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - await agent.set_status(status="Thinking...") - - call_tracker.assert_called_once_with( - channel_id="C111", - thread_ts="1234567890.123456", - status="Thinking...", - loading_messages=None, - ) - - @pytest.mark.asyncio - async def test_set_status_with_loading_messages(self): - """AsyncBoltAgent.set_status() forwards loading_messages.""" - client = MagicMock(spec=AsyncWebClient) - client.assistant_threads_setStatus, call_tracker, _ = _make_async_api_mock() - - agent = AsyncBoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - await agent.set_status( - status="Thinking...", - loading_messages=["Sitting...", "Waiting..."], - ) - - call_tracker.assert_called_once_with( - channel_id="C111", - thread_ts="1234567890.123456", - status="Thinking...", - loading_messages=["Sitting...", "Waiting..."], - ) - - @pytest.mark.asyncio - async def test_set_status_overrides_context_defaults(self): - """Explicit channel_id/thread_ts override context defaults.""" - client = MagicMock(spec=AsyncWebClient) - client.assistant_threads_setStatus, call_tracker, _ = _make_async_api_mock() - - agent = AsyncBoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - await agent.set_status( - status="Thinking...", - channel_id="C999", - thread_ts="9999999999.999999", - ) - - call_tracker.assert_called_once_with( - channel_id="C999", - thread_ts="9999999999.999999", - status="Thinking...", - loading_messages=None, - ) - - @pytest.mark.asyncio - async def test_set_status_passes_extra_kwargs(self): - """Extra kwargs are forwarded to AsyncWebClient.assistant_threads_setStatus().""" - client = MagicMock(spec=AsyncWebClient) - client.assistant_threads_setStatus, call_tracker, _ = _make_async_api_mock() - - agent = AsyncBoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - await agent.set_status(status="Thinking...", token="xoxb-override") - - call_tracker.assert_called_once_with( - channel_id="C111", - thread_ts="1234567890.123456", - status="Thinking...", - loading_messages=None, - token="xoxb-override", - ) - - @pytest.mark.asyncio - async def test_set_status_requires_status(self): - """set_status() raises TypeError when status is not provided.""" - client = MagicMock(spec=AsyncWebClient) - agent = AsyncBoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - with pytest.raises(TypeError): - await agent.set_status() - - @pytest.mark.asyncio - async def test_set_suggested_prompts_uses_context_defaults(self): - """AsyncBoltAgent.set_suggested_prompts() passes context defaults to AsyncWebClient.assistant_threads_setSuggestedPrompts().""" - client = MagicMock(spec=AsyncWebClient) - client.assistant_threads_setSuggestedPrompts, call_tracker, _ = _make_async_api_mock() - - agent = AsyncBoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - await agent.set_suggested_prompts(prompts=["What can you do?", "Help me write code"]) - - call_tracker.assert_called_once_with( - channel_id="C111", - thread_ts="1234567890.123456", - prompts=[ - {"title": "What can you do?", "message": "What can you do?"}, - {"title": "Help me write code", "message": "Help me write code"}, - ], - title=None, - ) - - @pytest.mark.asyncio - async def test_set_suggested_prompts_with_dict_prompts(self): - """AsyncBoltAgent.set_suggested_prompts() accepts dict prompts with title and message.""" - client = MagicMock(spec=AsyncWebClient) - client.assistant_threads_setSuggestedPrompts, call_tracker, _ = _make_async_api_mock() - - agent = AsyncBoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - await agent.set_suggested_prompts( - prompts=[ - {"title": "Short title", "message": "A much longer message for this prompt"}, - ], - title="Suggestions", - ) - - call_tracker.assert_called_once_with( - channel_id="C111", - thread_ts="1234567890.123456", - prompts=[ - {"title": "Short title", "message": "A much longer message for this prompt"}, - ], - title="Suggestions", - ) - - @pytest.mark.asyncio - async def test_set_suggested_prompts_overrides_context_defaults(self): - """Explicit channel_id/thread_ts override context defaults.""" - client = MagicMock(spec=AsyncWebClient) - client.assistant_threads_setSuggestedPrompts, call_tracker, _ = _make_async_api_mock() - - agent = AsyncBoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - await agent.set_suggested_prompts( - prompts=["Hello"], - channel_id="C999", - thread_ts="9999999999.999999", - ) - - call_tracker.assert_called_once_with( - channel_id="C999", - thread_ts="9999999999.999999", - prompts=[{"title": "Hello", "message": "Hello"}], - title=None, - ) - - @pytest.mark.asyncio - async def test_set_suggested_prompts_passes_extra_kwargs(self): - """Extra kwargs are forwarded to AsyncWebClient.assistant_threads_setSuggestedPrompts().""" - client = MagicMock(spec=AsyncWebClient) - client.assistant_threads_setSuggestedPrompts, call_tracker, _ = _make_async_api_mock() - - agent = AsyncBoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - await agent.set_suggested_prompts(prompts=["Hello"], token="xoxb-override") - - call_tracker.assert_called_once_with( - channel_id="C111", - thread_ts="1234567890.123456", - prompts=[{"title": "Hello", "message": "Hello"}], - title=None, - token="xoxb-override", - ) - - @pytest.mark.asyncio - async def test_set_suggested_prompts_requires_prompts(self): - """set_suggested_prompts() raises TypeError when prompts is not provided.""" - client = MagicMock(spec=AsyncWebClient) - agent = AsyncBoltAgent( - client=client, - channel_id="C111", - thread_ts="1234567890.123456", - team_id="T111", - user_id="W222", - ) - with pytest.raises(TypeError): - await agent.set_suggested_prompts() - - @pytest.mark.asyncio - async def test_import_from_agent_module(self): - from slack_bolt.agent.async_agent import AsyncBoltAgent as ImportedAsyncBoltAgent - - assert ImportedAsyncBoltAgent is AsyncBoltAgent From 6e57716ad35e2e9ef229a1276c42890ae4b10428 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Mon, 23 Mar 2026 07:34:02 -0700 Subject: [PATCH 709/719] chore: replace sleep-based polling with Event synchronization in tests (#1467) --- tests/scenario_tests/test_events_assistant.py | 99 ++++++------- ...est_events_assistant_without_middleware.py | 59 ++++---- .../scenario_tests/test_events_say_stream.py | 72 ++++------ .../test_events_assistant.py | 133 ++++++++---------- ...est_events_assistant_without_middleware.py | 74 +++++----- .../test_events_say_stream.py | 71 ++++------ 6 files changed, 222 insertions(+), 286 deletions(-) diff --git a/tests/scenario_tests/test_events_assistant.py b/tests/scenario_tests/test_events_assistant.py index 5bc270d86..a970c9fa4 100644 --- a/tests/scenario_tests/test_events_assistant.py +++ b/tests/scenario_tests/test_events_assistant.py @@ -1,27 +1,16 @@ -import time -from time import sleep +from threading import Event from typing import Callable from slack_sdk.web import WebClient -from slack_bolt import App, BoltRequest, Assistant, Say, SetSuggestedPrompts, SetStatus, BoltContext +from slack_bolt import App, Assistant, BoltContext, BoltRequest, Say, SetStatus, SetSuggestedPrompts from slack_bolt.middleware import Middleware from slack_bolt.request import BoltRequest as BoltRequestType from slack_bolt.response import BoltResponse -from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, -) +from tests.mock_web_api_server import cleanup_mock_web_api_server, setup_mock_web_api_server from tests.utils import remove_os_env_temporarily, restore_os_env -def assert_target_called(called: dict, timeout: float = 0.5): - deadline = time.time() + timeout - while called["value"] is not True and time.time() < deadline: - time.sleep(0.1) - assert called["value"] is True - - class TestEventsAssistant: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" @@ -41,7 +30,7 @@ def teardown_method(self): def test_thread_started(self): app = App(client=self.web_client) assistant = Assistant() - called = {"value": False} + listener_called = Event() @assistant.thread_started def start_thread(say: Say, set_suggested_prompts: SetSuggestedPrompts, set_status: SetStatus, context: BoltContext): @@ -54,37 +43,37 @@ def start_thread(say: Say, set_suggested_prompts: SetSuggestedPrompts, set_statu set_suggested_prompts( prompts=[{"title": "What does SLACK stand for?", "message": "What does SLACK stand for?"}], title="foo" ) - called["value"] = True + listener_called.set() app.assistant(assistant) request = BoltRequest(body=thread_started_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(called) + assert listener_called.wait(timeout=0.1) is True def test_thread_context_changed(self): app = App(client=self.web_client) assistant = Assistant() - called = {"value": False} + listener_called = Event() @assistant.thread_context_changed def handle_thread_context_changed(context: BoltContext): assert context.channel_id == "D111" assert context.thread_ts == "1726133698.626339" - called["value"] = True + listener_called.set() app.assistant(assistant) request = BoltRequest(body=thread_context_changed_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(called) + assert listener_called.wait(timeout=0.1) is True def test_user_message(self): app = App(client=self.web_client) assistant = Assistant() - called = {"value": False} + listener_called = Event() @assistant.user_message def handle_user_message(say: Say, set_status: SetStatus, context: BoltContext): @@ -94,7 +83,7 @@ def handle_user_message(say: Say, set_status: SetStatus, context: BoltContext): try: set_status("is typing...") say("Here you are!") - called["value"] = True + listener_called.set() except Exception as e: say(f"Oops, something went wrong (error: {e})") @@ -103,12 +92,12 @@ def handle_user_message(say: Say, set_status: SetStatus, context: BoltContext): request = BoltRequest(body=user_message_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(called) + assert listener_called.wait(timeout=0.1) is True def test_user_message_with_assistant_thread(self): app = App(client=self.web_client) assistant = Assistant() - called = {"value": False} + listener_called = Event() @assistant.user_message def handle_user_message(say: Say, set_status: SetStatus, context: BoltContext): @@ -118,7 +107,7 @@ def handle_user_message(say: Say, set_status: SetStatus, context: BoltContext): try: set_status("is typing...") say("Here you are!") - called["value"] = True + listener_called.set() except Exception as e: say(f"Oops, something went wrong (error: {e})") @@ -127,77 +116,77 @@ def handle_user_message(say: Say, set_status: SetStatus, context: BoltContext): request = BoltRequest(body=user_message_event_body_with_assistant_thread, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(called) + assert listener_called.wait(timeout=0.1) is True def test_message_changed(self): app = App(client=self.web_client) assistant = Assistant() - called = {"value": False} + listener_called = Event() @assistant.user_message def handle_user_message(): - called["value"] = True + listener_called.set() @assistant.bot_message def handle_bot_message(): - called["value"] = True + listener_called.set() app.assistant(assistant) request = BoltRequest(body=message_changed_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert called["value"] is False + assert listener_called.wait(timeout=0.1) is False def test_channel_user_message_ignored(self): app = App(client=self.web_client) assistant = Assistant() - called = {"value": False} + listener_called = Event() @assistant.user_message def handle_user_message(): - called["value"] = True + listener_called.set() @assistant.bot_message def handle_bot_message(): - called["value"] = True + listener_called.set() app.assistant(assistant) request = BoltRequest(body=channel_user_message_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 404 - assert called["value"] is False + assert listener_called.wait(timeout=0.1) is False def test_channel_message_changed_ignored(self): app = App(client=self.web_client) assistant = Assistant() - called = {"value": False} + listener_called = Event() @assistant.user_message def handle_user_message(): - called["value"] = True + listener_called.set() @assistant.bot_message def handle_bot_message(): - called["value"] = True + listener_called.set() app.assistant(assistant) request = BoltRequest(body=channel_message_changed_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 404 - assert called["value"] is False + assert listener_called.wait(timeout=0.1) is False def test_assistant_with_custom_listener_middleware(self): app = App(client=self.web_client) assistant = Assistant() - handler_called = {"value": False} - middleware_called = {"value": False} + listener_called = Event() + middleware_called = Event() class TestMiddleware(Middleware): def process(self, *, req: BoltRequestType, resp: BoltResponse, next: Callable[[], BoltResponse]): - middleware_called["value"] = True + middleware_called.set() # Verify assistant utilities are available assert req.context.get("set_status") is not None assert req.context.get("set_title") is not None @@ -208,52 +197,52 @@ def process(self, *, req: BoltRequestType, resp: BoltResponse, next: Callable[[] @assistant.thread_started(middleware=[TestMiddleware()]) def start_thread(): - handler_called["value"] = True + listener_called.set() @assistant.user_message(middleware=[TestMiddleware()]) def handle_user_message(): - handler_called["value"] = True + listener_called.set() app.assistant(assistant) request = BoltRequest(body=thread_started_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(handler_called) - assert_target_called(middleware_called) + assert listener_called.wait(timeout=0.1) is True + assert middleware_called.wait(timeout=0.1) is True - handler_called = {"value": False} - middleware_called = {"value": False} + listener_called.clear() + middleware_called.clear() request = BoltRequest(body=user_message_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(handler_called) - assert_target_called(middleware_called) + assert listener_called.wait(timeout=0.1) is True + assert middleware_called.wait(timeout=0.1) is True def test_assistant_custom_middleware_can_short_circuit(self): app = App(client=self.web_client) assistant = Assistant() - handler_called = {"value": False} - middleware_called = {"value": False} + listener_called = Event() + middleware_called = Event() class BlockingMiddleware(Middleware): def process(self, *, req: BoltRequestType, resp: BoltResponse, next: Callable[[], BoltResponse]): - middleware_called["value"] = True + middleware_called.set() # Intentionally not calling next() to short-circuit return BoltResponse(status=200) @assistant.thread_started(middleware=[BlockingMiddleware()]) def start_thread(say: Say, context: BoltContext): - handler_called["value"] = True + listener_called.set() app.assistant(assistant) request = BoltRequest(body=thread_started_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(middleware_called) - assert handler_called["value"] is False + assert middleware_called.wait(timeout=0.1) is True + assert listener_called.wait(timeout=0.1) is False def build_payload(event: dict) -> dict: diff --git a/tests/scenario_tests/test_events_assistant_without_middleware.py b/tests/scenario_tests/test_events_assistant_without_middleware.py index 6a9381a33..c95f16f99 100644 --- a/tests/scenario_tests/test_events_assistant_without_middleware.py +++ b/tests/scenario_tests/test_events_assistant_without_middleware.py @@ -1,14 +1,11 @@ +from threading import Event + from slack_sdk.web import WebClient -from slack_bolt import App, BoltRequest, Say, SetStatus, SetTitle, SaveThreadContext, BoltContext +from slack_bolt import App, BoltContext, BoltRequest, SaveThreadContext, Say, SetStatus, SetSuggestedPrompts, SetTitle from slack_bolt.context.get_thread_context.get_thread_context import GetThreadContext -from slack_bolt.context.set_suggested_prompts.set_suggested_prompts import SetSuggestedPrompts -from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, -) +from tests.mock_web_api_server import cleanup_mock_web_api_server, setup_mock_web_api_server from tests.scenario_tests.test_events_assistant import ( - assert_target_called, channel_message_changed_event_body, channel_user_message_event_body, message_changed_event_body, @@ -38,7 +35,7 @@ def teardown_method(self): def test_thread_started(self): app = App(client=self.web_client) - called = {"value": False} + listener_called = Event() @app.event("assistant_thread_started") def handle_assistant_thread_started( @@ -60,16 +57,16 @@ def handle_assistant_thread_started( assert save_thread_context is not None say("Hi, how can I help you today?") set_suggested_prompts(prompts=[{"title": "What does SLACK stand for?", "message": "What does SLACK stand for?"}]) - called["value"] = True + listener_called.set() request = BoltRequest(body=thread_started_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(called) + assert listener_called.wait(timeout=0.1) is True def test_thread_context_changed(self): app = App(client=self.web_client) - called = {"value": False} + listener_called = Event() @app.event("assistant_thread_context_changed") def handle_assistant_thread_context_changed( @@ -89,16 +86,16 @@ def handle_assistant_thread_context_changed( assert set_suggested_prompts is not None assert get_thread_context is not None assert save_thread_context is not None - called["value"] = True + listener_called.set() request = BoltRequest(body=thread_context_changed_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(called) + assert listener_called.wait(timeout=0.1) is True def test_user_message(self): app = App(client=self.web_client) - called = {"value": False} + listener_called = Event() @app.message("") def handle_message( @@ -121,18 +118,18 @@ def handle_message( try: set_status("is typing...") say("Here you are!") - called["value"] = True + listener_called.set() except Exception as e: say(f"Oops, something went wrong (error: {e})") request = BoltRequest(body=user_message_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(called) + assert listener_called.wait(timeout=0.1) is True def test_user_message_with_assistant_thread(self): app = App(client=self.web_client) - called = {"value": False} + listener_called = Event() @app.message("") def handle_message( @@ -155,18 +152,18 @@ def handle_message( try: set_status("is typing...") say("Here you are!") - called["value"] = True + listener_called.set() except Exception as e: say(f"Oops, something went wrong (error: {e})") request = BoltRequest(body=user_message_event_body_with_assistant_thread, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(called) + assert listener_called.wait(timeout=0.1) is True def test_message_changed(self): app = App(client=self.web_client) - called = {"value": False} + listener_called = Event() @app.event("message") def handle_message_event( @@ -185,16 +182,16 @@ def handle_message_event( assert set_suggested_prompts is None assert get_thread_context is None assert save_thread_context is None - called["value"] = True + listener_called.set() request = BoltRequest(body=message_changed_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(called) + assert listener_called.wait(timeout=0.1) is True def test_channel_user_message(self): app = App(client=self.web_client) - called = {"value": False} + listener_called = Event() @app.event("message") def handle_message_event( @@ -213,16 +210,16 @@ def handle_message_event( assert set_suggested_prompts is None assert get_thread_context is None assert save_thread_context is None - called["value"] = True + listener_called.set() request = BoltRequest(body=channel_user_message_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(called) + assert listener_called.wait(timeout=0.1) is True def test_channel_message_changed(self): app = App(client=self.web_client) - called = {"value": False} + listener_called = Event() @app.event("message") def handle_message_event( @@ -241,17 +238,17 @@ def handle_message_event( assert set_suggested_prompts is None assert get_thread_context is None assert save_thread_context is None - called["value"] = True + listener_called.set() request = BoltRequest(body=channel_message_changed_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(called) + assert listener_called.wait(timeout=0.1) is True def test_assistant_events_agent_kwargs_disabled(self): app = App(client=self.web_client, attaching_agent_kwargs_enabled=False) - called = {"value": False} + listener_called = Event() @app.event("assistant_thread_started") def start_thread(context: BoltContext): @@ -260,9 +257,9 @@ def start_thread(context: BoltContext): assert context.get("set_suggested_prompts") is None assert context.get("get_thread_context") is None assert context.get("save_thread_context") is None - called["value"] = True + listener_called.set() request = BoltRequest(body=thread_started_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(called) + assert listener_called.wait(timeout=0.1) is True diff --git a/tests/scenario_tests/test_events_say_stream.py b/tests/scenario_tests/test_events_say_stream.py index 75b0c612c..e0ab66aab 100644 --- a/tests/scenario_tests/test_events_say_stream.py +++ b/tests/scenario_tests/test_events_say_stream.py @@ -1,33 +1,19 @@ import json -import time +from threading import Event from urllib.parse import quote from slack_sdk.web import WebClient -from slack_bolt import App, BoltRequest, BoltContext -from slack_bolt.context.say_stream.say_stream import SayStream -from slack_bolt.middleware.assistant import Assistant -from tests.mock_web_api_server import ( - setup_mock_web_api_server, - cleanup_mock_web_api_server, -) +from slack_bolt import App, Assistant, BoltContext, BoltRequest, SayStream +from tests.mock_web_api_server import cleanup_mock_web_api_server, setup_mock_web_api_server from tests.scenario_tests.test_app import app_mention_event_body -from tests.scenario_tests.test_events_assistant import ( - thread_started_event_body, - user_message_event_body as threaded_user_message_event_body, -) +from tests.scenario_tests.test_events_assistant import thread_started_event_body +from tests.scenario_tests.test_events_assistant import user_message_event_body as threaded_user_message_event_body from tests.scenario_tests.test_message_bot import bot_message_event_payload, user_message_event_payload from tests.scenario_tests.test_view_submission import body as view_submission_body from tests.utils import remove_os_env_temporarily, restore_os_env -def assert_target_called(called: dict, timeout: float = 1.0): - deadline = time.time() + timeout - while called["value"] is not True and time.time() < deadline: - time.sleep(0.1) - assert called["value"] is True - - class TestEventsSayStream: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" @@ -46,7 +32,7 @@ def teardown_method(self): def test_say_stream_injected_for_app_mention(self): app = App(client=self.web_client) - called = {"value": False} + listener_called = Event() @app.event("app_mention") def handle_mention(say_stream: SayStream, context: BoltContext): @@ -57,16 +43,16 @@ def handle_mention(say_stream: SayStream, context: BoltContext): assert say_stream.thread_ts == "1595926230.009600" assert say_stream.recipient_team_id == context.team_id assert say_stream.recipient_user_id == context.user_id - called["value"] = True + listener_called.set() request = BoltRequest(body=app_mention_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(called) + assert listener_called.wait(timeout=0.1) is True def test_say_stream_with_org_level_install(self): app = App(client=self.web_client) - called = {"value": False} + listener_called = Event() @app.event("app_mention") def handle_mention(say_stream: SayStream, context: BoltContext): @@ -75,16 +61,16 @@ def handle_mention(say_stream: SayStream, context: BoltContext): assert say_stream is not None assert isinstance(say_stream, SayStream) assert say_stream.recipient_team_id == "E111" - called["value"] = True + listener_called.set() request = BoltRequest(body=org_app_mention_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(called) + assert listener_called.wait(timeout=0.1) is True def test_say_stream_injected_for_threaded_message(self): app = App(client=self.web_client) - called = {"value": False} + listener_called = Event() @app.event("message") def handle_message(say_stream: SayStream, context: BoltContext): @@ -95,16 +81,16 @@ def handle_message(say_stream: SayStream, context: BoltContext): assert say_stream.thread_ts == "1726133698.626339" assert say_stream.recipient_team_id == context.team_id assert say_stream.recipient_user_id == context.user_id - called["value"] = True + listener_called.set() request = BoltRequest(body=threaded_user_message_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(called) + assert listener_called.wait(timeout=0.1) is True def test_say_stream_in_user_message(self): app = App(client=self.web_client) - called = {"value": False} + listener_called = Event() @app.message("") def handle_user_message(say_stream: SayStream, context: BoltContext): @@ -115,16 +101,16 @@ def handle_user_message(say_stream: SayStream, context: BoltContext): assert say_stream.thread_ts == "1610261659.001400" assert say_stream.recipient_team_id == context.team_id assert say_stream.recipient_user_id == context.user_id - called["value"] = True + listener_called.set() request = BoltRequest(body=user_message_event_payload, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(called) + assert listener_called.wait(timeout=0.1) is True def test_say_stream_in_bot_message(self): app = App(client=self.web_client) - called = {"value": False} + listener_called = Event() @app.message("") def handle_bot_message(say_stream: SayStream, context: BoltContext): @@ -135,17 +121,17 @@ def handle_bot_message(say_stream: SayStream, context: BoltContext): assert say_stream.thread_ts == "1610261539.000900" assert say_stream.recipient_team_id == context.team_id assert say_stream.recipient_user_id == context.user_id - called["value"] = True + listener_called.set() request = BoltRequest(body=bot_message_event_payload, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(called) + assert listener_called.wait(timeout=0.1) is True def test_say_stream_in_assistant_thread_started(self): app = App(client=self.web_client) assistant = Assistant() - called = {"value": False} + listener_called = Event() @assistant.thread_started def start_thread(say_stream: SayStream, context: BoltContext): @@ -156,19 +142,19 @@ def start_thread(say_stream: SayStream, context: BoltContext): assert say_stream.thread_ts == "1726133698.626339" assert say_stream.recipient_team_id == context.team_id assert say_stream.recipient_user_id == context.user_id - called["value"] = True + listener_called.set() app.assistant(assistant) request = BoltRequest(body=thread_started_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(called) + assert listener_called.wait(timeout=0.1) is True def test_say_stream_in_assistant_user_message(self): app = App(client=self.web_client) assistant = Assistant() - called = {"value": False} + listener_called = Event() @assistant.user_message def handle_user_message(say_stream: SayStream, context: BoltContext): @@ -179,32 +165,32 @@ def handle_user_message(say_stream: SayStream, context: BoltContext): assert say_stream.thread_ts == "1726133698.626339" assert say_stream.recipient_team_id == context.team_id assert say_stream.recipient_user_id == context.user_id - called["value"] = True + listener_called.set() app.assistant(assistant) request = BoltRequest(body=threaded_user_message_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 - assert_target_called(called) + assert listener_called.wait(timeout=0.1) is True def test_say_stream_is_none_for_view_submission(self): app = App(client=self.web_client, request_verification_enabled=False) - called = {"value": False} + listener_called = Event() @app.view("view-id") def handle_view(ack, say_stream, context: BoltContext): ack() assert say_stream is None assert context.say_stream is None - called["value"] = True + listener_called.set() request = BoltRequest( body=f"payload={quote(json.dumps(view_submission_body))}", ) response = app.dispatch(request) assert response.status == 200 - assert_target_called(called) + assert listener_called.wait(timeout=0.1) is True org_app_mention_event_body = { diff --git a/tests/scenario_tests_async/test_events_assistant.py b/tests/scenario_tests_async/test_events_assistant.py index 87b337536..9b2e43eb1 100644 --- a/tests/scenario_tests_async/test_events_assistant.py +++ b/tests/scenario_tests_async/test_events_assistant.py @@ -1,33 +1,24 @@ import asyncio -import time from typing import Awaitable, Callable, Optional import pytest from slack_sdk.web.async_client import AsyncWebClient -from slack_bolt.app.async_app import AsyncApp -from slack_bolt.context.async_context import AsyncBoltContext -from slack_bolt.context.say.async_say import AsyncSay -from slack_bolt.context.set_status.async_set_status import AsyncSetStatus -from slack_bolt.context.set_suggested_prompts.async_set_suggested_prompts import AsyncSetSuggestedPrompts -from slack_bolt.middleware.assistant.async_assistant import AsyncAssistant +from slack_bolt.async_app import ( + AsyncApp, + AsyncAssistant, + AsyncBoltContext, + AsyncBoltRequest, + AsyncSay, + AsyncSetStatus, + AsyncSetSuggestedPrompts, +) from slack_bolt.middleware.async_middleware import AsyncMiddleware -from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse -from tests.mock_web_api_server import ( - cleanup_mock_web_api_server_async, - setup_mock_web_api_server_async, -) +from tests.mock_web_api_server import cleanup_mock_web_api_server_async, setup_mock_web_api_server_async from tests.utils import remove_os_env_temporarily, restore_os_env -async def assert_target_called(called: dict, timeout: float = 0.5): - deadline = time.time() + timeout - while called["value"] is not True and time.time() < deadline: - await asyncio.sleep(0.1) - assert called["value"] is True - - class TestAsyncEventsAssistant: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" @@ -51,7 +42,7 @@ def setup_teardown(self): async def test_thread_started(self): app = AsyncApp(client=self.web_client) assistant = AsyncAssistant() - called = {"value": False} + listener_called = asyncio.Event() @assistant.thread_started async def start_thread( @@ -72,39 +63,39 @@ async def start_thread( prompts=[{"title": "What does SLACK stand for?", "message": "What does SLACK stand for?"}], title="foo", ) - called["value"] = True + listener_called.set() app.assistant(assistant) request = AsyncBoltRequest(body=thread_started_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called(called) + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True @pytest.mark.asyncio async def test_thread_context_changed(self): app = AsyncApp(client=self.web_client) assistant = AsyncAssistant() - called = {"value": False} + listener_called = asyncio.Event() @assistant.thread_context_changed async def handle_thread_context_changed(context: AsyncBoltContext): assert context.channel_id == "D111" assert context.thread_ts == "1726133698.626339" - called["value"] = True + listener_called.set() app.assistant(assistant) request = AsyncBoltRequest(body=thread_context_changed_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called(called) + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True @pytest.mark.asyncio async def test_user_message(self): app = AsyncApp(client=self.web_client) assistant = AsyncAssistant() - called = {"value": False} + listener_called = asyncio.Event() @assistant.user_message async def handle_user_message(say: AsyncSay, set_status: AsyncSetStatus, context: AsyncBoltContext): @@ -114,7 +105,7 @@ async def handle_user_message(say: AsyncSay, set_status: AsyncSetStatus, context try: await set_status("is typing...") await say("Here you are!") - called["value"] = True + listener_called.set() except Exception as e: await say(f"Oops, something went wrong (error: {e})") @@ -123,13 +114,13 @@ async def handle_user_message(say: AsyncSay, set_status: AsyncSetStatus, context request = AsyncBoltRequest(body=user_message_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called(called) + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True @pytest.mark.asyncio async def test_user_message_with_assistant_thread(self): app = AsyncApp(client=self.web_client) assistant = AsyncAssistant() - called = {"value": False} + listener_called = asyncio.Event() @assistant.user_message async def handle_user_message(say: AsyncSay, set_status: AsyncSetStatus, context: AsyncBoltContext): @@ -139,7 +130,7 @@ async def handle_user_message(say: AsyncSay, set_status: AsyncSetStatus, context try: await set_status("is typing...") await say("Here you are!") - called["value"] = True + listener_called.set() except Exception as e: await say(f"Oops, something went wrong (error: {e})") @@ -148,84 +139,78 @@ async def handle_user_message(say: AsyncSay, set_status: AsyncSetStatus, context request = AsyncBoltRequest(body=user_message_event_body_with_assistant_thread, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called(called) + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True @pytest.mark.asyncio async def test_message_changed(self): app = AsyncApp(client=self.web_client) assistant = AsyncAssistant() - called = {"value": False} + listener_called = asyncio.Event() @assistant.user_message async def handle_user_message(): - called["value"] = True + listener_called.set() @assistant.bot_message async def handle_bot_message(): - called["value"] = True + listener_called.set() app.assistant(assistant) request = AsyncBoltRequest(body=message_changed_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - assert called["value"] is False + await asyncio.sleep(0.1) + assert not listener_called.is_set() @pytest.mark.asyncio async def test_channel_user_message_ignored(self): app = AsyncApp(client=self.web_client) assistant = AsyncAssistant() - called = {"value": False} + listener_called = asyncio.Event() @assistant.user_message async def handle_user_message(): - called["value"] = True + listener_called.set() @assistant.bot_message async def handle_bot_message(): - called["value"] = True + listener_called.set() app.assistant(assistant) request = AsyncBoltRequest(body=channel_user_message_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 404 - assert called["value"] is False + await asyncio.sleep(0.1) + assert not listener_called.is_set() @pytest.mark.asyncio async def test_channel_message_changed_ignored(self): app = AsyncApp(client=self.web_client) assistant = AsyncAssistant() - called = {"value": False} + listener_called = asyncio.Event() @assistant.user_message async def handle_user_message(): - called["value"] = True + listener_called.set() @assistant.bot_message async def handle_bot_message(): - called["value"] = True + listener_called.set() app.assistant(assistant) request = AsyncBoltRequest(body=channel_message_changed_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 404 - assert called["value"] is False + await asyncio.sleep(0.1) + assert not listener_called.is_set() @pytest.mark.asyncio async def test_assistant_events_kwargs_disabled(self): app = AsyncApp(client=self.web_client, attaching_agent_kwargs_enabled=False) - - state = {"called": False} - - async def assert_target_called(): - count = 0 - while state["called"] is False and count < 20: - await asyncio.sleep(0.1) - count += 1 - assert state["called"] is True - state["called"] = False + listener_called = asyncio.Event() @app.event("assistant_thread_started") async def start_thread(context: AsyncBoltContext): @@ -234,27 +219,19 @@ async def start_thread(context: AsyncBoltContext): assert context.get("set_suggested_prompts") is None assert context.get("get_thread_context") is None assert context.get("save_thread_context") is None - state["called"] = True + listener_called.set() request = AsyncBoltRequest(body=thread_started_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called() + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True @pytest.mark.asyncio async def test_assistant_with_custom_listener_middleware(self): app = AsyncApp(client=self.web_client) assistant = AsyncAssistant() - - state = {"called": False, "middleware_called": False} - - async def assert_target_called(): - count = 0 - while state["called"] is False and count < 20: - await asyncio.sleep(0.1) - count += 1 - assert state["called"] is True - state["called"] = False + listener_called = asyncio.Event() + middleware_called = asyncio.Event() class TestAsyncMiddleware(AsyncMiddleware): async def async_process( @@ -264,7 +241,7 @@ async def async_process( resp: BoltResponse, next: Callable[[], Awaitable[BoltResponse]], ) -> Optional[BoltResponse]: - state["middleware_called"] = True + middleware_called.set() # Verify assistant utilities are available (set by _AsyncAssistantMiddleware before this) assert req.context.get("set_status") is not None assert req.context.get("set_title") is not None @@ -282,7 +259,7 @@ async def start_thread(say: AsyncSay, set_suggested_prompts: AsyncSetSuggestedPr await set_suggested_prompts( prompts=[{"title": "What does SLACK stand for?", "message": "What does SLACK stand for?"}] ) - state["called"] = True + listener_called.set() @assistant.user_message(middleware=[TestAsyncMiddleware()]) async def handle_user_message(say: AsyncSay, set_status: AsyncSetStatus, context: AsyncBoltContext): @@ -291,29 +268,30 @@ async def handle_user_message(say: AsyncSay, set_status: AsyncSetStatus, context assert say.thread_ts == context.thread_ts await set_status("is typing...") await say("Here you are!") - state["called"] = True + listener_called.set() app.assistant(assistant) request = AsyncBoltRequest(body=thread_started_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called() - assert state["middleware_called"] is True - state["middleware_called"] = False + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True + assert (await asyncio.wait_for(middleware_called.wait(), timeout=0.1)) is True + + listener_called.clear() + middleware_called.clear() request = AsyncBoltRequest(body=user_message_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called() - assert state["middleware_called"] is True + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True + assert (await asyncio.wait_for(middleware_called.wait(), timeout=0.1)) is True @pytest.mark.asyncio async def test_assistant_custom_middleware_can_short_circuit(self): app = AsyncApp(client=self.web_client) assistant = AsyncAssistant() - - state = {"handler_called": False} + listener_called = asyncio.Event() class BlockingAsyncMiddleware(AsyncMiddleware): async def async_process( @@ -328,14 +306,15 @@ async def async_process( @assistant.thread_started(middleware=[BlockingAsyncMiddleware()]) async def start_thread(say: AsyncSay, context: AsyncBoltContext): - state["handler_called"] = True + listener_called.set() app.assistant(assistant) request = AsyncBoltRequest(body=thread_started_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - assert state["handler_called"] is False + await asyncio.sleep(0.1) + assert not listener_called.is_set() def build_payload(event: dict) -> dict: diff --git a/tests/scenario_tests_async/test_events_assistant_without_middleware.py b/tests/scenario_tests_async/test_events_assistant_without_middleware.py index 916dfd467..4e82cb2c1 100644 --- a/tests/scenario_tests_async/test_events_assistant_without_middleware.py +++ b/tests/scenario_tests_async/test_events_assistant_without_middleware.py @@ -1,21 +1,21 @@ +import asyncio + import pytest from slack_sdk.web.async_client import AsyncWebClient -from slack_bolt.app.async_app import AsyncApp -from slack_bolt.context.async_context import AsyncBoltContext -from slack_bolt.context.say.async_say import AsyncSay -from slack_bolt.context.set_status.async_set_status import AsyncSetStatus -from slack_bolt.context.set_title.async_set_title import AsyncSetTitle -from slack_bolt.context.set_suggested_prompts.async_set_suggested_prompts import AsyncSetSuggestedPrompts -from slack_bolt.context.get_thread_context.async_get_thread_context import AsyncGetThreadContext -from slack_bolt.context.save_thread_context.async_save_thread_context import AsyncSaveThreadContext -from slack_bolt.request.async_request import AsyncBoltRequest -from tests.mock_web_api_server import ( - cleanup_mock_web_api_server_async, - setup_mock_web_api_server_async, +from slack_bolt.async_app import ( + AsyncApp, + AsyncBoltContext, + AsyncBoltRequest, + AsyncGetThreadContext, + AsyncSaveThreadContext, + AsyncSay, + AsyncSetStatus, + AsyncSetSuggestedPrompts, + AsyncSetTitle, ) +from tests.mock_web_api_server import cleanup_mock_web_api_server_async, setup_mock_web_api_server_async from tests.scenario_tests_async.test_events_assistant import ( - assert_target_called, channel_message_changed_event_body, channel_user_message_event_body, message_changed_event_body, @@ -49,7 +49,7 @@ def setup_teardown(self): @pytest.mark.asyncio async def test_thread_started(self): app = AsyncApp(client=self.web_client) - called = {"value": False} + listener_called = asyncio.Event() @app.event("assistant_thread_started") async def handle_assistant_thread_started( @@ -73,17 +73,17 @@ async def handle_assistant_thread_started( await set_suggested_prompts( prompts=[{"title": "What does SLACK stand for?", "message": "What does SLACK stand for?"}] ) - called["value"] = True + listener_called.set() request = AsyncBoltRequest(body=thread_started_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called(called) + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True @pytest.mark.asyncio async def test_thread_context_changed(self): app = AsyncApp(client=self.web_client) - called = {"value": False} + listener_called = asyncio.Event() @app.event("assistant_thread_context_changed") async def handle_assistant_thread_context_changed( @@ -103,17 +103,17 @@ async def handle_assistant_thread_context_changed( assert set_suggested_prompts is not None assert get_thread_context is not None assert save_thread_context is not None - called["value"] = True + listener_called.set() request = AsyncBoltRequest(body=thread_context_changed_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called(called) + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True @pytest.mark.asyncio async def test_user_message(self): app = AsyncApp(client=self.web_client) - called = {"value": False} + listener_called = asyncio.Event() @app.message("") async def handle_message( @@ -136,19 +136,19 @@ async def handle_message( try: await set_status("is typing...") await say("Here you are!") - called["value"] = True + listener_called.set() except Exception as e: await say(f"Oops, something went wrong (error: {e})") request = AsyncBoltRequest(body=user_message_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called(called) + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True @pytest.mark.asyncio async def test_user_message_with_assistant_thread(self): app = AsyncApp(client=self.web_client) - called = {"value": False} + listener_called = asyncio.Event() @app.message("") async def handle_message( @@ -171,19 +171,19 @@ async def handle_message( try: await set_status("is typing...") await say("Here you are!") - called["value"] = True + listener_called.set() except Exception as e: await say(f"Oops, something went wrong (error: {e})") request = AsyncBoltRequest(body=user_message_event_body_with_assistant_thread, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called(called) + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True @pytest.mark.asyncio async def test_message_changed(self): app = AsyncApp(client=self.web_client) - called = {"value": False} + listener_called = asyncio.Event() @app.event("message") async def handle_message_event( @@ -202,17 +202,17 @@ async def handle_message_event( assert set_suggested_prompts is None assert get_thread_context is None assert save_thread_context is None - called["value"] = True + listener_called.set() request = AsyncBoltRequest(body=message_changed_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called(called) + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True @pytest.mark.asyncio async def test_channel_user_message(self): app = AsyncApp(client=self.web_client) - called = {"value": False} + listener_called = asyncio.Event() @app.event("message") async def handle_message_event( @@ -231,17 +231,17 @@ async def handle_message_event( assert set_suggested_prompts is None assert get_thread_context is None assert save_thread_context is None - called["value"] = True + listener_called.set() request = AsyncBoltRequest(body=channel_user_message_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called(called) + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True @pytest.mark.asyncio async def test_channel_message_changed(self): app = AsyncApp(client=self.web_client) - called = {"value": False} + listener_called = asyncio.Event() @app.event("message") async def handle_message_event( @@ -260,18 +260,18 @@ async def handle_message_event( assert set_suggested_prompts is None assert get_thread_context is None assert save_thread_context is None - called["value"] = True + listener_called.set() request = AsyncBoltRequest(body=channel_message_changed_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called(called) + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True @pytest.mark.asyncio async def test_assistant_events_agent_kwargs_disabled(self): app = AsyncApp(client=self.web_client, attaching_agent_kwargs_enabled=False) - called = {"value": False} + listener_called = asyncio.Event() @app.event("assistant_thread_started") async def start_thread(context: AsyncBoltContext): @@ -280,9 +280,9 @@ async def start_thread(context: AsyncBoltContext): assert context.get("set_suggested_prompts") is None assert context.get("get_thread_context") is None assert context.get("save_thread_context") is None - called["value"] = True + listener_called.set() request = AsyncBoltRequest(body=thread_started_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called(called) + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True diff --git a/tests/scenario_tests_async/test_events_say_stream.py b/tests/scenario_tests_async/test_events_say_stream.py index c24bc7bfc..6abcfad88 100644 --- a/tests/scenario_tests_async/test_events_say_stream.py +++ b/tests/scenario_tests_async/test_events_say_stream.py @@ -1,35 +1,20 @@ import asyncio import json -import time from urllib.parse import quote import pytest from slack_sdk.web.async_client import AsyncWebClient -from slack_bolt.app.async_app import AsyncApp -from slack_bolt.async_app import AsyncAssistant -from slack_bolt.context.async_context import AsyncBoltContext -from slack_bolt.context.say_stream.async_say_stream import AsyncSayStream -from slack_bolt.request.async_request import AsyncBoltRequest -from tests.mock_web_api_server import ( - cleanup_mock_web_api_server_async, - setup_mock_web_api_server_async, -) +from slack_bolt.async_app import AsyncApp, AsyncAssistant, AsyncBoltContext, AsyncBoltRequest, AsyncSayStream +from tests.mock_web_api_server import cleanup_mock_web_api_server_async, setup_mock_web_api_server_async from tests.scenario_tests_async.test_app import app_mention_event_body +from tests.scenario_tests_async.test_events_assistant import thread_started_event_body from tests.scenario_tests_async.test_events_assistant import user_message_event_body as threaded_user_message_event_body -from tests.scenario_tests_async.test_events_assistant import thread_started_event_body, user_message_event_body from tests.scenario_tests_async.test_message_bot import bot_message_event_payload, user_message_event_payload from tests.scenario_tests_async.test_view_submission import body as view_submission_body from tests.utils import remove_os_env_temporarily, restore_os_env -async def assert_target_called(called: dict, timeout: float = 0.5): - deadline = time.time() + timeout - while called["value"] is not True and time.time() < deadline: - await asyncio.sleep(0.1) - assert called["value"] is True - - class TestAsyncEventsSayStream: valid_token = "xoxb-valid" mock_api_server_base_url = "http://localhost:8888" @@ -51,7 +36,7 @@ def setup_teardown(self): @pytest.mark.asyncio async def test_say_stream_injected_for_app_mention(self): app = AsyncApp(client=self.web_client) - called = {"value": False} + listener_called = asyncio.Event() @app.event("app_mention") async def handle_mention(say_stream: AsyncSayStream, context: AsyncBoltContext): @@ -62,17 +47,17 @@ async def handle_mention(say_stream: AsyncSayStream, context: AsyncBoltContext): assert say_stream.thread_ts == "1595926230.009600" assert say_stream.recipient_team_id == context.team_id assert say_stream.recipient_user_id == context.user_id - called["value"] = True + listener_called.set() request = AsyncBoltRequest(body=app_mention_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called(called) + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True @pytest.mark.asyncio async def test_say_stream_with_org_level_install(self): app = AsyncApp(client=self.web_client) - called = {"value": False} + listener_called = asyncio.Event() @app.event("app_mention") async def handle_mention(say_stream: AsyncSayStream, context: AsyncBoltContext): @@ -81,17 +66,17 @@ async def handle_mention(say_stream: AsyncSayStream, context: AsyncBoltContext): assert say_stream is not None assert isinstance(say_stream, AsyncSayStream) assert say_stream.recipient_team_id == "E111" - called["value"] = True + listener_called.set() request = AsyncBoltRequest(body=org_app_mention_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called(called) + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True @pytest.mark.asyncio async def test_say_stream_injected_for_threaded_message(self): app = AsyncApp(client=self.web_client) - called = {"value": False} + listener_called = asyncio.Event() @app.event("message") async def handle_message(say_stream: AsyncSayStream, context: AsyncBoltContext): @@ -102,17 +87,17 @@ async def handle_message(say_stream: AsyncSayStream, context: AsyncBoltContext): assert say_stream.thread_ts == "1726133698.626339" assert say_stream.recipient_team_id == context.team_id assert say_stream.recipient_user_id == context.user_id - called["value"] = True + listener_called.set() request = AsyncBoltRequest(body=threaded_user_message_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called(called) + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True @pytest.mark.asyncio async def test_say_stream_in_user_message(self): app = AsyncApp(client=self.web_client) - called = {"value": False} + listener_called = asyncio.Event() @app.message("") async def handle_user_message(say_stream: AsyncSayStream, context: AsyncBoltContext): @@ -123,17 +108,17 @@ async def handle_user_message(say_stream: AsyncSayStream, context: AsyncBoltCont assert say_stream.thread_ts == "1610261659.001400" assert say_stream.recipient_team_id == context.team_id assert say_stream.recipient_user_id == context.user_id - called["value"] = True + listener_called.set() request = AsyncBoltRequest(body=user_message_event_payload, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called(called) + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True @pytest.mark.asyncio async def test_say_stream_in_bot_message(self): app = AsyncApp(client=self.web_client) - called = {"value": False} + listener_called = asyncio.Event() @app.message("") async def handle_user_message(say_stream: AsyncSayStream, context: AsyncBoltContext): @@ -144,18 +129,18 @@ async def handle_user_message(say_stream: AsyncSayStream, context: AsyncBoltCont assert say_stream.thread_ts == "1610261539.000900" assert say_stream.recipient_team_id == context.team_id assert say_stream.recipient_user_id == context.user_id - called["value"] = True + listener_called.set() request = AsyncBoltRequest(body=bot_message_event_payload, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called(called) + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True @pytest.mark.asyncio async def test_say_stream_in_assistant_thread_started(self): app = AsyncApp(client=self.web_client) assistant = AsyncAssistant() - called = {"value": False} + listener_called = asyncio.Event() @assistant.thread_started async def start_thread(say_stream: AsyncSayStream, context: AsyncBoltContext): @@ -166,20 +151,20 @@ async def start_thread(say_stream: AsyncSayStream, context: AsyncBoltContext): assert say_stream.thread_ts == "1726133698.626339" assert say_stream.recipient_team_id == context.team_id assert say_stream.recipient_user_id == context.user_id - called["value"] = True + listener_called.set() app.assistant(assistant) request = AsyncBoltRequest(body=thread_started_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called(called) + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True @pytest.mark.asyncio async def test_say_stream_in_assistant_user_message(self): app = AsyncApp(client=self.web_client) assistant = AsyncAssistant() - called = {"value": False} + listener_called = asyncio.Event() @assistant.user_message async def handle_user_message(say_stream: AsyncSayStream, context: AsyncBoltContext): @@ -190,33 +175,33 @@ async def handle_user_message(say_stream: AsyncSayStream, context: AsyncBoltCont assert say_stream.thread_ts == "1726133698.626339" assert say_stream.recipient_team_id == context.team_id assert say_stream.recipient_user_id == context.user_id - called["value"] = True + listener_called.set() app.assistant(assistant) - request = AsyncBoltRequest(body=user_message_event_body, mode="socket_mode") + request = AsyncBoltRequest(body=threaded_user_message_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called(called) + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True @pytest.mark.asyncio async def test_say_stream_is_none_for_view_submission(self): app = AsyncApp(client=self.web_client, request_verification_enabled=False) - called = {"value": False} + listener_called = asyncio.Event() @app.view("view-id") async def handle_view(ack, say_stream, context: AsyncBoltContext): await ack() assert say_stream is None assert context.say_stream is None - called["value"] = True + listener_called.set() request = AsyncBoltRequest( body=f"payload={quote(json.dumps(view_submission_body))}", ) response = await app.async_dispatch(request) assert response.status == 200 - await assert_target_called(called) + assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True org_app_mention_event_body = { From 98a8f593c7b4cde4834338d5c0ce89686c7168cf Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Mon, 23 Mar 2026 09:07:40 -0700 Subject: [PATCH 710/719] chore: fix test warnings across test suite (#1468) --- pyproject.toml | 6 +----- tests/adapter_tests/django/conftest.py | 6 ++++++ tests/adapter_tests/django/test_django.py | 2 -- tests/adapter_tests/starlette/test_fastapi.py | 8 ++++---- tests/adapter_tests/starlette/test_starlette.py | 6 +++--- tests/adapter_tests_async/test_async_fastapi.py | 8 ++++---- tests/adapter_tests_async/test_async_starlette.py | 6 +++--- tests/scenario_tests/test_app.py | 10 +++++----- tests/scenario_tests/test_lazy.py | 4 ++-- tests/scenario_tests_async/test_app.py | 10 +++++----- tests/scenario_tests_async/test_lazy.py | 4 ++-- 11 files changed, 35 insertions(+), 35 deletions(-) create mode 100644 tests/adapter_tests/django/conftest.py diff --git a/pyproject.toml b/pyproject.toml index a5c12548b..88842d0d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,11 +46,7 @@ log_file = "logs/pytest.log" log_file_level = "DEBUG" log_format = "%(asctime)s %(levelname)s %(message)s" log_date_format = "%Y-%m-%d %H:%M:%S" -filterwarnings = [ - "ignore:\"@coroutine\" decorator is deprecated since Python 3.8, use \"async def\" instead:DeprecationWarning", - "ignore:The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.:DeprecationWarning", - "ignore:Unknown config option. asyncio_mode:pytest.PytestConfigWarning", # ignore warning when asyncio_mode is set but pytest-asyncio is not installed -] +filterwarnings = [] asyncio_mode = "auto" [tool.mypy] diff --git a/tests/adapter_tests/django/conftest.py b/tests/adapter_tests/django/conftest.py new file mode 100644 index 000000000..b2697fe2b --- /dev/null +++ b/tests/adapter_tests/django/conftest.py @@ -0,0 +1,6 @@ +import os + +import django + +os.environ["DJANGO_SETTINGS_MODULE"] = "tests.adapter_tests.django.test_django_settings" +django.setup() diff --git a/tests/adapter_tests/django/test_django.py b/tests/adapter_tests/django/test_django.py index cb14f966d..f31a46411 100644 --- a/tests/adapter_tests/django/test_django.py +++ b/tests/adapter_tests/django/test_django.py @@ -1,5 +1,4 @@ import json -import os from time import time from urllib.parse import quote @@ -29,7 +28,6 @@ class TestDjango(TestCase): base_url=mock_api_server_base_url, ) - os.environ["DJANGO_SETTINGS_MODULE"] = "tests.adapter_tests.django.test_django_settings" rf = RequestFactory() def setUp(self): diff --git a/tests/adapter_tests/starlette/test_fastapi.py b/tests/adapter_tests/starlette/test_fastapi.py index 64e633fe2..f91b9897e 100644 --- a/tests/adapter_tests/starlette/test_fastapi.py +++ b/tests/adapter_tests/starlette/test_fastapi.py @@ -94,7 +94,7 @@ async def endpoint(req: Request): client = TestClient(api) response = client.post( "/slack/events", - data=body, + content=body, headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 @@ -138,7 +138,7 @@ async def endpoint(req: Request): client = TestClient(api) response = client.post( "/slack/events", - data=body, + content=body, headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 @@ -182,7 +182,7 @@ async def endpoint(req: Request): client = TestClient(api) response = client.post( "/slack/events", - data=body, + content=body, headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 @@ -254,7 +254,7 @@ async def endpoint(req: Request, foo: str = Depends(get_foo)): client = TestClient(api) response = client.post( "/slack/events", - data=body, + content=body, headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 diff --git a/tests/adapter_tests/starlette/test_starlette.py b/tests/adapter_tests/starlette/test_starlette.py index 8c6154b3b..18066a9d2 100644 --- a/tests/adapter_tests/starlette/test_starlette.py +++ b/tests/adapter_tests/starlette/test_starlette.py @@ -97,7 +97,7 @@ async def endpoint(req: Request): client = TestClient(api) response = client.post( "/slack/events", - data=body, + content=body, headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 @@ -143,7 +143,7 @@ async def endpoint(req: Request): client = TestClient(api) response = client.post( "/slack/events", - data=body, + content=body, headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 @@ -189,7 +189,7 @@ async def endpoint(req: Request): client = TestClient(api) response = client.post( "/slack/events", - data=body, + content=body, headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 diff --git a/tests/adapter_tests_async/test_async_fastapi.py b/tests/adapter_tests_async/test_async_fastapi.py index ea9308842..e0175d3fa 100644 --- a/tests/adapter_tests_async/test_async_fastapi.py +++ b/tests/adapter_tests_async/test_async_fastapi.py @@ -94,7 +94,7 @@ async def endpoint(req: Request): client = TestClient(api) response = client.post( "/slack/events", - data=body, + content=body, headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 @@ -138,7 +138,7 @@ async def endpoint(req: Request): client = TestClient(api) response = client.post( "/slack/events", - data=body, + content=body, headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 @@ -182,7 +182,7 @@ async def endpoint(req: Request): client = TestClient(api) response = client.post( "/slack/events", - data=body, + content=body, headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 @@ -255,7 +255,7 @@ async def endpoint(req: Request, foo: str = Depends(get_foo)): client = TestClient(api) response = client.post( "/slack/events", - data=body, + content=body, headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 diff --git a/tests/adapter_tests_async/test_async_starlette.py b/tests/adapter_tests_async/test_async_starlette.py index 7e9a18a58..849c75168 100644 --- a/tests/adapter_tests_async/test_async_starlette.py +++ b/tests/adapter_tests_async/test_async_starlette.py @@ -97,7 +97,7 @@ async def endpoint(req: Request): client = TestClient(api) response = client.post( "/slack/events", - data=body, + content=body, headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 @@ -143,7 +143,7 @@ async def endpoint(req: Request): client = TestClient(api) response = client.post( "/slack/events", - data=body, + content=body, headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 @@ -189,7 +189,7 @@ async def endpoint(req: Request): client = TestClient(api) response = client.post( "/slack/events", - data=body, + content=body, headers=self.build_headers(timestamp, body), ) assert response.status_code == 200 diff --git a/tests/scenario_tests/test_app.py b/tests/scenario_tests/test_app.py index 9bbad6d9a..9fe6f423f 100644 --- a/tests/scenario_tests/test_app.py +++ b/tests/scenario_tests/test_app.py @@ -1,7 +1,7 @@ import logging import time from concurrent.futures import Executor -from ssl import SSLContext +import ssl import pytest from slack_sdk import WebClient @@ -236,12 +236,12 @@ def test_none_body_no_middleware(self): assert response.body == '{"error": "unhandled request"}' def test_proxy_ssl_for_respond(self): - ssl = SSLContext() + ssl_context = ssl.create_default_context() web_client = WebClient( token=self.valid_token, base_url=self.mock_api_server_base_url, proxy="http://proxy-host:9000/", - ssl=ssl, + ssl=ssl_context, ) app = App( signing_secret="valid", @@ -257,9 +257,9 @@ def test_proxy_ssl_for_respond(self): @app.event("app_mention") def handle(context: BoltContext, respond): assert context.respond.proxy == "http://proxy-host:9000/" - assert context.respond.ssl == ssl + assert context.respond.ssl == ssl_context assert respond.proxy == "http://proxy-host:9000/" - assert respond.ssl == ssl + assert respond.ssl == ssl_context result["called"] = True req = BoltRequest(body=app_mention_event_body, headers={}, mode="socket_mode") diff --git a/tests/scenario_tests/test_lazy.py b/tests/scenario_tests/test_lazy.py index d9e88b280..3b2aefbea 100644 --- a/tests/scenario_tests/test_lazy.py +++ b/tests/scenario_tests/test_lazy.py @@ -156,11 +156,11 @@ def async2(context, say): @app.middleware def set_ssl_context(context, next_): - from ssl import SSLContext + import ssl context["foo"] = "FOO" # This causes an error when starting lazy listener executions - context["ssl_context"] = SSLContext() + context["ssl_context"] = ssl.create_default_context() next_() # 2021-12-13 11:14:29 ERROR Failed to run a middleware middleware (error: cannot pickle 'SSLContext' object) diff --git a/tests/scenario_tests_async/test_app.py b/tests/scenario_tests_async/test_app.py index e27dbd3b3..6f3fb34f8 100644 --- a/tests/scenario_tests_async/test_app.py +++ b/tests/scenario_tests_async/test_app.py @@ -1,6 +1,6 @@ import asyncio import logging -from ssl import SSLContext +import ssl import pytest from slack_sdk import WebClient @@ -185,14 +185,14 @@ def test_installation_store_conflicts(self): @pytest.mark.asyncio async def test_proxy_ssl_for_respond(self): - ssl = SSLContext() + ssl_ctx = ssl.create_default_context() app = AsyncApp( signing_secret="valid", client=AsyncWebClient( token=self.valid_token, base_url=self.mock_api_server_base_url, proxy="http://proxy-host:9000/", - ssl=ssl, + ssl=ssl_ctx, ), authorize=my_authorize, ) @@ -202,9 +202,9 @@ async def test_proxy_ssl_for_respond(self): @app.event("app_mention") async def handle(context: AsyncBoltContext, respond): assert context.respond.proxy == "http://proxy-host:9000/" - assert context.respond.ssl == ssl + assert context.respond.ssl == ssl_ctx assert respond.proxy == "http://proxy-host:9000/" - assert respond.ssl == ssl + assert respond.ssl == ssl_ctx result["called"] = True req = AsyncBoltRequest(body=app_mention_event_body, headers={}, mode="socket_mode") diff --git a/tests/scenario_tests_async/test_lazy.py b/tests/scenario_tests_async/test_lazy.py index 7bf780e08..8c4182f45 100644 --- a/tests/scenario_tests_async/test_lazy.py +++ b/tests/scenario_tests_async/test_lazy.py @@ -138,11 +138,11 @@ async def async2(context, say): @app.middleware async def set_ssl_context(context, next_): - from ssl import SSLContext + import ssl context["foo"] = "FOO" # This causes an error when starting lazy listener executions - context["ssl_context"] = SSLContext() + context["ssl_context"] = ssl.create_default_context() await next_() # 2021-12-13 11:52:46 ERROR Failed to run a middleware function (error: cannot pickle 'SSLContext' object) From f11dbfbd06bf284a2ea4c65a4064f781c18fe5e0 Mon Sep 17 00:00:00 2001 From: Ale Mercado <104795114+srtaalej@users.noreply.github.com> Date: Mon, 23 Mar 2026 13:41:24 -0400 Subject: [PATCH 711/719] fix(assistant): get_thread_context calls store.find() for user_message events (#1453) Co-authored-by: William Bergamin --- .../async_get_thread_context.py | 10 +++---- .../get_thread_context/get_thread_context.py | 10 +++---- tests/scenario_tests/test_events_assistant.py | 25 ++++++++++++++++++ .../test_events_assistant.py | 26 +++++++++++++++++++ 4 files changed, 57 insertions(+), 14 deletions(-) diff --git a/slack_bolt/context/get_thread_context/async_get_thread_context.py b/slack_bolt/context/get_thread_context/async_get_thread_context.py index cb8683a10..03f7c6076 100644 --- a/slack_bolt/context/get_thread_context/async_get_thread_context.py +++ b/slack_bolt/context/get_thread_context/async_get_thread_context.py @@ -31,14 +31,10 @@ async def __call__(self) -> Optional[AssistantThreadContext]: if self.thread_context_loaded is True: return self._thread_context - if self.payload.get("assistant_thread") is not None: + thread = self.payload.get("assistant_thread") + if isinstance(thread, dict) and thread.get("context", {}).get("channel_id") is not None: # assistant_thread_started - thread = self.payload["assistant_thread"] - self._thread_context = ( - AssistantThreadContext(thread["context"]) - if thread.get("context", {}).get("channel_id") is not None - else None - ) + self._thread_context = AssistantThreadContext(thread["context"]) # for this event, the context will never be changed self.thread_context_loaded = True elif self.payload.get("channel") is not None and self.payload.get("thread_ts") is not None: diff --git a/slack_bolt/context/get_thread_context/get_thread_context.py b/slack_bolt/context/get_thread_context/get_thread_context.py index 0a77d2d9f..b9c9751e1 100644 --- a/slack_bolt/context/get_thread_context/get_thread_context.py +++ b/slack_bolt/context/get_thread_context/get_thread_context.py @@ -31,14 +31,10 @@ def __call__(self) -> Optional[AssistantThreadContext]: if self.thread_context_loaded is True: return self._thread_context - if self.payload.get("assistant_thread") is not None: + thread = self.payload.get("assistant_thread") + if isinstance(thread, dict) and thread.get("context", {}).get("channel_id") is not None: # assistant_thread_started - thread = self.payload["assistant_thread"] - self._thread_context = ( - AssistantThreadContext(thread["context"]) - if thread.get("context", {}).get("channel_id") is not None - else None - ) + self._thread_context = AssistantThreadContext(thread["context"]) # for this event, the context will never be changed self.thread_context_loaded = True elif self.payload.get("channel") is not None and self.payload.get("thread_ts") is not None: diff --git a/tests/scenario_tests/test_events_assistant.py b/tests/scenario_tests/test_events_assistant.py index a970c9fa4..a1c3f1343 100644 --- a/tests/scenario_tests/test_events_assistant.py +++ b/tests/scenario_tests/test_events_assistant.py @@ -133,6 +133,12 @@ def handle_bot_message(): app.assistant(assistant) + request = BoltRequest(body=user_message_event_body_with_action_token, mode="socket_mode") + response = app.dispatch(request) + assert response.status == 200 + assert listener_called.wait(timeout=0.1) is True + listener_called.clear() + request = BoltRequest(body=message_changed_event_body, mode="socket_mode") response = app.dispatch(request) assert response.status == 200 @@ -332,6 +338,25 @@ def build_payload(event: dict) -> dict: } ) +user_message_event_body_with_action_token = build_payload( + { + "user": "W222", + "type": "message", + "ts": "1726133700.887259", + "text": "When Slack was released?", + "team": "T111", + "user_team": "T111", + "source_team": "T222", + "user_profile": {}, + "thread_ts": "1726133698.626339", + "parent_user_id": "W222", + "channel": "D111", + "event_ts": "1726133700.887259", + "channel_type": "im", + "assistant_thread": {"action_token": "10647138185092.960436384805.afce3599"}, + } +) + message_changed_event_body = build_payload( { "type": "message", diff --git a/tests/scenario_tests_async/test_events_assistant.py b/tests/scenario_tests_async/test_events_assistant.py index 9b2e43eb1..9ccd80c11 100644 --- a/tests/scenario_tests_async/test_events_assistant.py +++ b/tests/scenario_tests_async/test_events_assistant.py @@ -157,6 +157,13 @@ async def handle_bot_message(): app.assistant(assistant) + request = AsyncBoltRequest(body=user_message_event_body_with_action_token, mode="socket_mode") + response = await app.async_dispatch(request) + assert response.status == 200 + await asyncio.sleep(0.1) + assert listener_called.is_set() + listener_called.clear() + request = AsyncBoltRequest(body=message_changed_event_body, mode="socket_mode") response = await app.async_dispatch(request) assert response.status == 200 @@ -405,6 +412,25 @@ def build_payload(event: dict) -> dict: ) +user_message_event_body_with_action_token = build_payload( + { + "user": "W222", + "type": "message", + "ts": "1726133700.887259", + "text": "When Slack was released?", + "team": "T111", + "user_team": "T111", + "source_team": "T222", + "user_profile": {}, + "thread_ts": "1726133698.626339", + "parent_user_id": "W222", + "channel": "D111", + "event_ts": "1726133700.887259", + "channel_type": "im", + "assistant_thread": {"action_token": "10647138185092.960436384805.afce3599"}, + } +) + message_changed_event_body = build_payload( { "type": "message", From 89088857d958c0ba34d036e90bc28db879c76ad5 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Thu, 26 Mar 2026 13:36:54 -0700 Subject: [PATCH 712/719] chore: improve type checking behavior (#1470) --- .github/workflows/ci-build.yml | 15 +++++++++++++-- slack_bolt/app/async_server.py | 11 +++++++---- slack_bolt/context/async_context.py | 7 +++++-- slack_bolt/context/context.py | 7 +++++-- .../listener/async_listener_error_handler.py | 7 ++++--- slack_bolt/listener/listener_error_handler.py | 7 ++++--- .../middleware/async_middleware_error_handler.py | 7 ++++--- slack_bolt/middleware/middleware_error_handler.py | 7 ++++--- slack_bolt/oauth/async_callback_options.py | 9 ++++++--- slack_bolt/oauth/callback_options.py | 9 ++++++--- 10 files changed, 58 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 6555a6531..6c4cd5a6a 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -44,8 +44,19 @@ jobs: uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.LATEST_SUPPORTED_PY }} - - name: Run mypy verification - run: ./scripts/run_mypy.sh + - name: Install synchronous dependencies + run: | + pip install -U pip + pip install -U . + pip install -r requirements/tools.txt + - name: Type check synchronous modules + run: mypy --config-file pyproject.toml --exclude "async_|/adapter/" + - name: Install async and adapter dependencies + run: | + pip install -r requirements/async.txt + pip install -r requirements/adapter.txt + - name: Type check all modules + run: mypy --config-file pyproject.toml unittest: name: Unit tests diff --git a/slack_bolt/app/async_server.py b/slack_bolt/app/async_server.py index 998cd5a4b..f21d35932 100644 --- a/slack_bolt/app/async_server.py +++ b/slack_bolt/app/async_server.py @@ -1,5 +1,5 @@ import logging -from typing import Optional +from typing import Optional, TYPE_CHECKING from aiohttp import web @@ -7,19 +7,22 @@ from slack_bolt.response import BoltResponse from slack_bolt.util.utils import get_boot_message +if TYPE_CHECKING: + from slack_bolt.app.async_app import AsyncApp + class AsyncSlackAppServer: port: int path: str host: str - bolt_app: "AsyncApp" # type: ignore[name-defined] + bolt_app: "AsyncApp" web_app: web.Application def __init__( self, port: int, path: str, - app: "AsyncApp", # type: ignore[name-defined] + app: "AsyncApp", host: Optional[str] = None, ): """Standalone AIOHTTP Web Server. @@ -34,7 +37,7 @@ def __init__( self.port = port self.path = path self.host = host if host is not None else "0.0.0.0" - self.bolt_app: "AsyncApp" = app # type: ignore[name-defined] + self.bolt_app: "AsyncApp" = app self.web_app = web.Application() self._bolt_oauth_flow = self.bolt_app.oauth_flow if self._bolt_oauth_flow: diff --git a/slack_bolt/context/async_context.py b/slack_bolt/context/async_context.py index 33f260d38..94b2b5cbe 100644 --- a/slack_bolt/context/async_context.py +++ b/slack_bolt/context/async_context.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Optional, TYPE_CHECKING from slack_sdk.web.async_client import AsyncWebClient @@ -16,6 +16,9 @@ from slack_bolt.context.set_title.async_set_title import AsyncSetTitle from slack_bolt.util.utils import create_copy +if TYPE_CHECKING: + from slack_bolt.listener.asyncio_runner import AsyncioListenerRunner + class AsyncBoltContext(BaseContext): """Context object associated with a request from Slack.""" @@ -42,7 +45,7 @@ def to_copyable(self) -> "AsyncBoltContext": # The return type is intentionally string to avoid circular imports @property - def listener_runner(self) -> "AsyncioListenerRunner": # type: ignore[name-defined] + def listener_runner(self) -> "AsyncioListenerRunner": """The properly configured listener_runner that is available for middleware/listeners.""" return self["listener_runner"] diff --git a/slack_bolt/context/context.py b/slack_bolt/context/context.py index 6184d5083..b101460a5 100644 --- a/slack_bolt/context/context.py +++ b/slack_bolt/context/context.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Optional, TYPE_CHECKING from slack_sdk import WebClient @@ -16,6 +16,9 @@ from slack_bolt.context.set_title import SetTitle from slack_bolt.util.utils import create_copy +if TYPE_CHECKING: + from slack_bolt.listener.thread_runner import ThreadListenerRunner + class BoltContext(BaseContext): """Context object associated with a request from Slack.""" @@ -43,7 +46,7 @@ def to_copyable(self) -> "BoltContext": # The return type is intentionally string to avoid circular imports @property - def listener_runner(self) -> "ThreadListenerRunner": # type: ignore[name-defined] + def listener_runner(self) -> "ThreadListenerRunner": """The properly configured listener_runner that is available for middleware/listeners.""" return self["listener_runner"] diff --git a/slack_bolt/listener/async_listener_error_handler.py b/slack_bolt/listener/async_listener_error_handler.py index 88f4b3510..b1a73458e 100644 --- a/slack_bolt/listener/async_listener_error_handler.py +++ b/slack_bolt/listener/async_listener_error_handler.py @@ -48,9 +48,10 @@ async def handle( ) returned_response = await self.func(**kwargs) if returned_response is not None and isinstance(returned_response, BoltResponse): - response.status = returned_response.status # type: ignore[union-attr] - response.headers = returned_response.headers # type: ignore[union-attr] - response.body = returned_response.body # type: ignore[union-attr] + assert response is not None, "response must be provided when returning a BoltResponse from an error handler" + response.status = returned_response.status + response.headers = returned_response.headers + response.body = returned_response.body class AsyncDefaultListenerErrorHandler(AsyncListenerErrorHandler): diff --git a/slack_bolt/listener/listener_error_handler.py b/slack_bolt/listener/listener_error_handler.py index 0ad98f738..7dd6d066b 100644 --- a/slack_bolt/listener/listener_error_handler.py +++ b/slack_bolt/listener/listener_error_handler.py @@ -48,9 +48,10 @@ def handle( ) returned_response = self.func(**kwargs) if returned_response is not None and isinstance(returned_response, BoltResponse): - response.status = returned_response.status # type: ignore[union-attr] - response.headers = returned_response.headers # type: ignore[union-attr] - response.body = returned_response.body # type: ignore[union-attr] + assert response is not None, "response must be provided when returning a BoltResponse from an error handler" + response.status = returned_response.status + response.headers = returned_response.headers + response.body = returned_response.body class DefaultListenerErrorHandler(ListenerErrorHandler): diff --git a/slack_bolt/middleware/async_middleware_error_handler.py b/slack_bolt/middleware/async_middleware_error_handler.py index 1957d3ab6..932b0770b 100644 --- a/slack_bolt/middleware/async_middleware_error_handler.py +++ b/slack_bolt/middleware/async_middleware_error_handler.py @@ -48,9 +48,10 @@ async def handle( ) returned_response = await self.func(**kwargs) if returned_response is not None and isinstance(returned_response, BoltResponse): - response.status = returned_response.status # type: ignore[union-attr] - response.headers = returned_response.headers # type: ignore[union-attr] - response.body = returned_response.body # type: ignore[union-attr] + assert response is not None, "response must be provided when returning a BoltResponse from an error handler" + response.status = returned_response.status + response.headers = returned_response.headers + response.body = returned_response.body class AsyncDefaultMiddlewareErrorHandler(AsyncMiddlewareErrorHandler): diff --git a/slack_bolt/middleware/middleware_error_handler.py b/slack_bolt/middleware/middleware_error_handler.py index fe57e400c..5919414bb 100644 --- a/slack_bolt/middleware/middleware_error_handler.py +++ b/slack_bolt/middleware/middleware_error_handler.py @@ -48,9 +48,10 @@ def handle( ) returned_response = self.func(**kwargs) if returned_response is not None and isinstance(returned_response, BoltResponse): - response.status = returned_response.status # type: ignore[union-attr] - response.headers = returned_response.headers # type: ignore[union-attr] - response.body = returned_response.body # type: ignore[union-attr] + assert response is not None, "response must be provided when returning a BoltResponse from an error handler" + response.status = returned_response.status + response.headers = returned_response.headers + response.body = returned_response.body class DefaultMiddlewareErrorHandler(MiddlewareErrorHandler): diff --git a/slack_bolt/oauth/async_callback_options.py b/slack_bolt/oauth/async_callback_options.py index 88518d7e8..e1c2b2e4c 100644 --- a/slack_bolt/oauth/async_callback_options.py +++ b/slack_bolt/oauth/async_callback_options.py @@ -1,6 +1,6 @@ import logging from logging import Logger -from typing import Optional, Callable, Awaitable +from typing import Optional, Callable, Awaitable, TYPE_CHECKING from slack_sdk.oauth import RedirectUriPageRenderer, OAuthStateUtils from slack_sdk.oauth.installation_store import Installation @@ -9,6 +9,9 @@ from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse +if TYPE_CHECKING: + from slack_bolt.oauth.async_oauth_settings import AsyncOAuthSettings + class AsyncSuccessArgs: def __init__( @@ -16,7 +19,7 @@ def __init__( *, request: AsyncBoltRequest, installation: Installation, - settings: "AsyncOAuthSettings", # type: ignore[name-defined] + settings: "AsyncOAuthSettings", default: "AsyncCallbackOptions", ): """The arguments for a success function. @@ -41,7 +44,7 @@ def __init__( reason: str, error: Optional[Exception] = None, suggested_status_code: int, - settings: "AsyncOAuthSettings", # type: ignore[name-defined] + settings: "AsyncOAuthSettings", default: "AsyncCallbackOptions", ): """The arguments for a failure function. diff --git a/slack_bolt/oauth/callback_options.py b/slack_bolt/oauth/callback_options.py index f267ed154..09584a365 100644 --- a/slack_bolt/oauth/callback_options.py +++ b/slack_bolt/oauth/callback_options.py @@ -1,6 +1,6 @@ import logging from logging import Logger -from typing import Optional, Callable +from typing import Optional, Callable, TYPE_CHECKING from slack_sdk.oauth import RedirectUriPageRenderer, OAuthStateUtils from slack_sdk.oauth.installation_store import Installation @@ -9,6 +9,9 @@ from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse +if TYPE_CHECKING: + from slack_bolt.oauth.oauth_settings import OAuthSettings + class SuccessArgs: def __init__( @@ -16,7 +19,7 @@ def __init__( *, request: BoltRequest, installation: Installation, - settings: "OAuthSettings", # type: ignore[name-defined] + settings: "OAuthSettings", default: "CallbackOptions", ): """The arguments for a success function. @@ -41,7 +44,7 @@ def __init__( reason: str, error: Optional[Exception] = None, suggested_status_code: int, - settings: "OAuthSettings", # type: ignore[name-defined] + settings: "OAuthSettings", default: "CallbackOptions", ): """The arguments for a failure function. From 9d0e0af36109393456b9663e539d9fa642d5711b Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Wed, 1 Apr 2026 14:55:30 -0400 Subject: [PATCH 713/719] refactor: rename AttachingAgentKwargs middleware to AttachingConversationKwargs (#1473) --- slack_bolt/app/app.py | 14 +++++++------- slack_bolt/app/async_app.py | 14 +++++++------- slack_bolt/kwargs_injection/args.py | 2 +- slack_bolt/middleware/__init__.py | 4 ++-- slack_bolt/middleware/assistant/assistant.py | 4 ++-- slack_bolt/middleware/assistant/async_assistant.py | 6 ++++-- slack_bolt/middleware/async_builtins.py | 4 ++-- .../middleware/attaching_agent_kwargs/__init__.py | 5 ----- .../attaching_conversation_kwargs/__init__.py | 5 +++++ .../async_attaching_conversation_kwargs.py} | 2 +- .../attaching_conversation_kwargs.py} | 2 +- .../test_events_assistant_without_middleware.py | 4 ++-- .../scenario_tests_async/test_events_assistant.py | 2 +- .../test_events_assistant_without_middleware.py | 4 ++-- .../__init__.py | 0 .../test_attaching_conversation_kwargs.py} | 12 ++++++------ .../__init__.py | 0 .../test_async_attaching_conversation_kwargs.py} | 14 ++++++++------ 18 files changed, 51 insertions(+), 47 deletions(-) delete mode 100644 slack_bolt/middleware/attaching_agent_kwargs/__init__.py create mode 100644 slack_bolt/middleware/attaching_conversation_kwargs/__init__.py rename slack_bolt/middleware/{attaching_agent_kwargs/async_attaching_agent_kwargs.py => attaching_conversation_kwargs/async_attaching_conversation_kwargs.py} (97%) rename slack_bolt/middleware/{attaching_agent_kwargs/attaching_agent_kwargs.py => attaching_conversation_kwargs/attaching_conversation_kwargs.py} (98%) rename tests/slack_bolt/middleware/{attaching_agent_kwargs => attaching_conversation_kwargs}/__init__.py (100%) rename tests/slack_bolt/middleware/{attaching_agent_kwargs/test_attaching_agent_kwargs.py => attaching_conversation_kwargs/test_attaching_conversation_kwargs.py} (88%) rename tests/slack_bolt_async/middleware/{attaching_agent_kwargs => attaching_conversation_kwargs}/__init__.py (100%) rename tests/slack_bolt_async/middleware/{attaching_agent_kwargs/test_async_attaching_agent_kwargs.py => attaching_conversation_kwargs/test_async_attaching_conversation_kwargs.py} (87%) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 566eb82d7..0af27913c 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -69,7 +69,7 @@ IgnoringSelfEvents, CustomMiddleware, AttachingFunctionToken, - AttachingAgentKwargs, + AttachingConversationKwargs, ) from slack_bolt.middleware.assistant import Assistant from slack_bolt.middleware.message_listener_matches import MessageListenerMatches @@ -133,7 +133,7 @@ def __init__( listener_executor: Optional[Executor] = None, # for AI Agents & Assistants assistant_thread_context_store: Optional[AssistantThreadContextStore] = None, - attaching_agent_kwargs_enabled: bool = True, + attaching_conversation_kwargs_enabled: bool = True, ): """Bolt App that provides functionalities to register middleware/listeners. @@ -354,7 +354,7 @@ def message_hello(message, say): listener_executor = ThreadPoolExecutor(max_workers=5) self._assistant_thread_context_store = assistant_thread_context_store - self._attaching_agent_kwargs_enabled = attaching_agent_kwargs_enabled + self._attaching_conversation_kwargs_enabled = attaching_conversation_kwargs_enabled self._process_before_response = process_before_response self._listener_runner = ThreadListenerRunner( @@ -844,8 +844,8 @@ def ask_for_introduction(event, say): def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.event(event, base_logger=self._base_logger) - if self._attaching_agent_kwargs_enabled: - middleware.insert(0, AttachingAgentKwargs(self._assistant_thread_context_store)) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AttachingConversationKwargs(self._assistant_thread_context_store)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) return __call__ @@ -903,8 +903,8 @@ def __call__(*args, **kwargs): primary_matcher = builtin_matchers.message_event( keyword=keyword, constraints=constraints, base_logger=self._base_logger ) - if self._attaching_agent_kwargs_enabled: - middleware.insert(0, AttachingAgentKwargs(self._assistant_thread_context_store)) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AttachingConversationKwargs(self._assistant_thread_context_store)) middleware.insert(0, MessageListenerMatches(keyword)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 9cd8c911f..cc94f9e15 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -86,7 +86,7 @@ AsyncIgnoringSelfEvents, AsyncUrlVerification, AsyncAttachingFunctionToken, - AsyncAttachingAgentKwargs, + AsyncAttachingConversationKwargs, ) from slack_bolt.middleware.async_custom_middleware import ( AsyncMiddleware, @@ -142,7 +142,7 @@ def __init__( verification_token: Optional[str] = None, # for AI Agents & Assistants assistant_thread_context_store: Optional[AsyncAssistantThreadContextStore] = None, - attaching_agent_kwargs_enabled: bool = True, + attaching_conversation_kwargs_enabled: bool = True, ): """Bolt App that provides functionalities to register middleware/listeners. @@ -363,7 +363,7 @@ async def message_hello(message, say): # async function self._async_listeners: List[AsyncListener] = [] self._assistant_thread_context_store = assistant_thread_context_store - self._attaching_agent_kwargs_enabled = attaching_agent_kwargs_enabled + self._attaching_conversation_kwargs_enabled = attaching_conversation_kwargs_enabled self._process_before_response = process_before_response self._async_listener_runner = AsyncioListenerRunner( @@ -872,8 +872,8 @@ async def ask_for_introduction(event, say): def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.event(event, True, base_logger=self._base_logger) - if self._attaching_agent_kwargs_enabled: - middleware.insert(0, AsyncAttachingAgentKwargs(self._assistant_thread_context_store)) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AsyncAttachingConversationKwargs(self._assistant_thread_context_store)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) return __call__ @@ -934,8 +934,8 @@ def __call__(*args, **kwargs): asyncio=True, base_logger=self._base_logger, ) - if self._attaching_agent_kwargs_enabled: - middleware.insert(0, AsyncAttachingAgentKwargs(self._assistant_thread_context_store)) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AsyncAttachingConversationKwargs(self._assistant_thread_context_store)) middleware.insert(0, AsyncMessageListenerMatches(keyword)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) diff --git a/slack_bolt/kwargs_injection/args.py b/slack_bolt/kwargs_injection/args.py index 4cd70176d..f2b4099d6 100644 --- a/slack_bolt/kwargs_injection/args.py +++ b/slack_bolt/kwargs_injection/args.py @@ -104,7 +104,7 @@ def handle_buttons(args): save_thread_context: Optional[SaveThreadContext] """`save_thread_context()` utility function for AI Agents & Assistants""" say_stream: Optional[SayStream] - """`say_stream()` utility function for AI Agents & Assistants""" + """`say_stream()` utility function for conversations, AI Agents & Assistants""" # middleware next: Callable[[], None] """`next()` utility function, which tells the middleware chain that it can continue with the next one""" diff --git a/slack_bolt/middleware/__init__.py b/slack_bolt/middleware/__init__.py index 7b51fb239..c28ffd78d 100644 --- a/slack_bolt/middleware/__init__.py +++ b/slack_bolt/middleware/__init__.py @@ -17,7 +17,7 @@ from .ssl_check import SslCheck from .url_verification import UrlVerification from .attaching_function_token import AttachingFunctionToken -from .attaching_agent_kwargs import AttachingAgentKwargs +from .attaching_conversation_kwargs import AttachingConversationKwargs builtin_middleware_classes = [ SslCheck, @@ -42,6 +42,6 @@ "SslCheck", "UrlVerification", "AttachingFunctionToken", - "AttachingAgentKwargs", + "AttachingConversationKwargs", "builtin_middleware_classes", ] diff --git a/slack_bolt/middleware/assistant/assistant.py b/slack_bolt/middleware/assistant/assistant.py index 9696e826e..ad842f94d 100644 --- a/slack_bolt/middleware/assistant/assistant.py +++ b/slack_bolt/middleware/assistant/assistant.py @@ -7,7 +7,7 @@ from slack_bolt.context.assistant.thread_context_store.store import AssistantThreadContextStore from slack_bolt.listener_matcher.builtins import build_listener_matcher -from slack_bolt.middleware.attaching_agent_kwargs import AttachingAgentKwargs +from slack_bolt.middleware.attaching_conversation_kwargs import AttachingConversationKwargs from slack_bolt.request.request import BoltRequest from slack_bolt.response.response import BoltResponse from slack_bolt.listener_matcher import CustomListenerMatcher @@ -272,7 +272,7 @@ def build_listener( return listener_or_functions elif isinstance(listener_or_functions, list): middleware = middleware if middleware else [] - middleware.insert(0, AttachingAgentKwargs(self.thread_context_store)) + middleware.insert(0, AttachingConversationKwargs(self.thread_context_store)) functions = listener_or_functions ack_function = functions.pop(0) diff --git a/slack_bolt/middleware/assistant/async_assistant.py b/slack_bolt/middleware/assistant/async_assistant.py index d841e2de0..588de8b41 100644 --- a/slack_bolt/middleware/assistant/async_assistant.py +++ b/slack_bolt/middleware/assistant/async_assistant.py @@ -8,7 +8,9 @@ from slack_bolt.listener.asyncio_runner import AsyncioListenerRunner from slack_bolt.listener_matcher.builtins import build_listener_matcher -from slack_bolt.middleware.attaching_agent_kwargs.async_attaching_agent_kwargs import AsyncAttachingAgentKwargs +from slack_bolt.middleware.attaching_conversation_kwargs.async_attaching_conversation_kwargs import ( + AsyncAttachingConversationKwargs, +) from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse from slack_bolt.error import BoltError @@ -301,7 +303,7 @@ def build_listener( return listener_or_functions elif isinstance(listener_or_functions, list): middleware = middleware if middleware else [] - middleware.insert(0, AsyncAttachingAgentKwargs(self.thread_context_store)) + middleware.insert(0, AsyncAttachingConversationKwargs(self.thread_context_store)) functions = listener_or_functions ack_function = functions.pop(0) diff --git a/slack_bolt/middleware/async_builtins.py b/slack_bolt/middleware/async_builtins.py index 755b55c20..8de07fb88 100644 --- a/slack_bolt/middleware/async_builtins.py +++ b/slack_bolt/middleware/async_builtins.py @@ -10,7 +10,7 @@ AsyncMessageListenerMatches, ) from .attaching_function_token.async_attaching_function_token import AsyncAttachingFunctionToken -from .attaching_agent_kwargs.async_attaching_agent_kwargs import AsyncAttachingAgentKwargs +from .attaching_conversation_kwargs.async_attaching_conversation_kwargs import AsyncAttachingConversationKwargs __all__ = [ "AsyncIgnoringSelfEvents", @@ -19,5 +19,5 @@ "AsyncUrlVerification", "AsyncMessageListenerMatches", "AsyncAttachingFunctionToken", - "AsyncAttachingAgentKwargs", + "AsyncAttachingConversationKwargs", ] diff --git a/slack_bolt/middleware/attaching_agent_kwargs/__init__.py b/slack_bolt/middleware/attaching_agent_kwargs/__init__.py deleted file mode 100644 index 98926fc14..000000000 --- a/slack_bolt/middleware/attaching_agent_kwargs/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from .attaching_agent_kwargs import AttachingAgentKwargs - -__all__ = [ - "AttachingAgentKwargs", -] diff --git a/slack_bolt/middleware/attaching_conversation_kwargs/__init__.py b/slack_bolt/middleware/attaching_conversation_kwargs/__init__.py new file mode 100644 index 000000000..ec72e0037 --- /dev/null +++ b/slack_bolt/middleware/attaching_conversation_kwargs/__init__.py @@ -0,0 +1,5 @@ +from .attaching_conversation_kwargs import AttachingConversationKwargs + +__all__ = [ + "AttachingConversationKwargs", +] diff --git a/slack_bolt/middleware/attaching_agent_kwargs/async_attaching_agent_kwargs.py b/slack_bolt/middleware/attaching_conversation_kwargs/async_attaching_conversation_kwargs.py similarity index 97% rename from slack_bolt/middleware/attaching_agent_kwargs/async_attaching_agent_kwargs.py rename to slack_bolt/middleware/attaching_conversation_kwargs/async_attaching_conversation_kwargs.py index 82f1a7671..315ec2a50 100644 --- a/slack_bolt/middleware/attaching_agent_kwargs/async_attaching_agent_kwargs.py +++ b/slack_bolt/middleware/attaching_conversation_kwargs/async_attaching_conversation_kwargs.py @@ -10,7 +10,7 @@ from slack_bolt.response import BoltResponse -class AsyncAttachingAgentKwargs(AsyncMiddleware): +class AsyncAttachingConversationKwargs(AsyncMiddleware): thread_context_store: Optional[AsyncAssistantThreadContextStore] diff --git a/slack_bolt/middleware/attaching_agent_kwargs/attaching_agent_kwargs.py b/slack_bolt/middleware/attaching_conversation_kwargs/attaching_conversation_kwargs.py similarity index 98% rename from slack_bolt/middleware/attaching_agent_kwargs/attaching_agent_kwargs.py rename to slack_bolt/middleware/attaching_conversation_kwargs/attaching_conversation_kwargs.py index 70f41d561..33847fd56 100644 --- a/slack_bolt/middleware/attaching_agent_kwargs/attaching_agent_kwargs.py +++ b/slack_bolt/middleware/attaching_conversation_kwargs/attaching_conversation_kwargs.py @@ -10,7 +10,7 @@ from slack_bolt.response.response import BoltResponse -class AttachingAgentKwargs(Middleware): +class AttachingConversationKwargs(Middleware): thread_context_store: Optional[AssistantThreadContextStore] diff --git a/tests/scenario_tests/test_events_assistant_without_middleware.py b/tests/scenario_tests/test_events_assistant_without_middleware.py index c95f16f99..18072c05e 100644 --- a/tests/scenario_tests/test_events_assistant_without_middleware.py +++ b/tests/scenario_tests/test_events_assistant_without_middleware.py @@ -245,8 +245,8 @@ def handle_message_event( assert response.status == 200 assert listener_called.wait(timeout=0.1) is True - def test_assistant_events_agent_kwargs_disabled(self): - app = App(client=self.web_client, attaching_agent_kwargs_enabled=False) + def test_assistant_events_conversation_kwargs_disabled(self): + app = App(client=self.web_client, attaching_conversation_kwargs_enabled=False) listener_called = Event() diff --git a/tests/scenario_tests_async/test_events_assistant.py b/tests/scenario_tests_async/test_events_assistant.py index 9ccd80c11..edc77ecf3 100644 --- a/tests/scenario_tests_async/test_events_assistant.py +++ b/tests/scenario_tests_async/test_events_assistant.py @@ -216,7 +216,7 @@ async def handle_bot_message(): @pytest.mark.asyncio async def test_assistant_events_kwargs_disabled(self): - app = AsyncApp(client=self.web_client, attaching_agent_kwargs_enabled=False) + app = AsyncApp(client=self.web_client, attaching_conversation_kwargs_enabled=False) listener_called = asyncio.Event() @app.event("assistant_thread_started") diff --git a/tests/scenario_tests_async/test_events_assistant_without_middleware.py b/tests/scenario_tests_async/test_events_assistant_without_middleware.py index 4e82cb2c1..d72b09b04 100644 --- a/tests/scenario_tests_async/test_events_assistant_without_middleware.py +++ b/tests/scenario_tests_async/test_events_assistant_without_middleware.py @@ -268,8 +268,8 @@ async def handle_message_event( assert (await asyncio.wait_for(listener_called.wait(), timeout=0.1)) is True @pytest.mark.asyncio - async def test_assistant_events_agent_kwargs_disabled(self): - app = AsyncApp(client=self.web_client, attaching_agent_kwargs_enabled=False) + async def test_assistant_events_conversation_kwargs_disabled(self): + app = AsyncApp(client=self.web_client, attaching_conversation_kwargs_enabled=False) listener_called = asyncio.Event() diff --git a/tests/slack_bolt/middleware/attaching_agent_kwargs/__init__.py b/tests/slack_bolt/middleware/attaching_conversation_kwargs/__init__.py similarity index 100% rename from tests/slack_bolt/middleware/attaching_agent_kwargs/__init__.py rename to tests/slack_bolt/middleware/attaching_conversation_kwargs/__init__.py diff --git a/tests/slack_bolt/middleware/attaching_agent_kwargs/test_attaching_agent_kwargs.py b/tests/slack_bolt/middleware/attaching_conversation_kwargs/test_attaching_conversation_kwargs.py similarity index 88% rename from tests/slack_bolt/middleware/attaching_agent_kwargs/test_attaching_agent_kwargs.py rename to tests/slack_bolt/middleware/attaching_conversation_kwargs/test_attaching_conversation_kwargs.py index 8e626fd0c..b7785eb50 100644 --- a/tests/slack_bolt/middleware/attaching_agent_kwargs/test_attaching_agent_kwargs.py +++ b/tests/slack_bolt/middleware/attaching_conversation_kwargs/test_attaching_conversation_kwargs.py @@ -1,6 +1,6 @@ from slack_sdk import WebClient -from slack_bolt.middleware.attaching_agent_kwargs import AttachingAgentKwargs +from slack_bolt.middleware.attaching_conversation_kwargs import AttachingConversationKwargs from slack_bolt.request import BoltRequest from slack_bolt.response import BoltResponse from tests.scenario_tests.test_events_assistant import ( @@ -17,9 +17,9 @@ def next(): ASSISTANT_KWARGS = ("say", "set_title", "set_suggested_prompts", "get_thread_context", "save_thread_context") -class TestAttachingAgentKwargs: +class TestAttachingConversationKwargs: def test_assistant_event_attaches_kwargs(self): - middleware = AttachingAgentKwargs() + middleware = AttachingConversationKwargs() req = BoltRequest(body=thread_started_event_body, mode="socket_mode") req.context["client"] = WebClient(token="xoxb-test") @@ -33,7 +33,7 @@ def test_assistant_event_attaches_kwargs(self): assert "set_status" in req.context def test_user_message_event_attaches_kwargs(self): - middleware = AttachingAgentKwargs() + middleware = AttachingConversationKwargs() req = BoltRequest(body=user_message_event_body, mode="socket_mode") req.context["client"] = WebClient(token="xoxb-test") @@ -47,7 +47,7 @@ def test_user_message_event_attaches_kwargs(self): assert "set_status" in req.context def test_non_assistant_event_does_not_attach_kwargs(self): - middleware = AttachingAgentKwargs() + middleware = AttachingConversationKwargs() req = BoltRequest(body=channel_user_message_event_body, mode="socket_mode") req.context["client"] = WebClient(token="xoxb-test") @@ -60,7 +60,7 @@ def test_non_assistant_event_does_not_attach_kwargs(self): assert "set_status" in req.context def test_non_event_does_not_attach_kwargs(self): - middleware = AttachingAgentKwargs() + middleware = AttachingConversationKwargs() req = BoltRequest(body="payload={}", headers={}) resp = middleware.process(req=req, resp=BoltResponse(status=404), next=next) diff --git a/tests/slack_bolt_async/middleware/attaching_agent_kwargs/__init__.py b/tests/slack_bolt_async/middleware/attaching_conversation_kwargs/__init__.py similarity index 100% rename from tests/slack_bolt_async/middleware/attaching_agent_kwargs/__init__.py rename to tests/slack_bolt_async/middleware/attaching_conversation_kwargs/__init__.py diff --git a/tests/slack_bolt_async/middleware/attaching_agent_kwargs/test_async_attaching_agent_kwargs.py b/tests/slack_bolt_async/middleware/attaching_conversation_kwargs/test_async_attaching_conversation_kwargs.py similarity index 87% rename from tests/slack_bolt_async/middleware/attaching_agent_kwargs/test_async_attaching_agent_kwargs.py rename to tests/slack_bolt_async/middleware/attaching_conversation_kwargs/test_async_attaching_conversation_kwargs.py index 61aa0b59e..a00b35cd3 100644 --- a/tests/slack_bolt_async/middleware/attaching_agent_kwargs/test_async_attaching_agent_kwargs.py +++ b/tests/slack_bolt_async/middleware/attaching_conversation_kwargs/test_async_attaching_conversation_kwargs.py @@ -1,7 +1,9 @@ import pytest from slack_sdk.web.async_client import AsyncWebClient -from slack_bolt.middleware.attaching_agent_kwargs.async_attaching_agent_kwargs import AsyncAttachingAgentKwargs +from slack_bolt.middleware.attaching_conversation_kwargs.async_attaching_conversation_kwargs import ( + AsyncAttachingConversationKwargs, +) from slack_bolt.request.async_request import AsyncBoltRequest from slack_bolt.response import BoltResponse from tests.scenario_tests_async.test_events_assistant import ( @@ -18,10 +20,10 @@ async def next(): ASSISTANT_KWARGS = ("say", "set_title", "set_suggested_prompts", "get_thread_context", "save_thread_context") -class TestAsyncAttachingAgentKwargs: +class TestAsyncAttachingConversationKwargs: @pytest.mark.asyncio async def test_assistant_event_attaches_kwargs(self): - middleware = AsyncAttachingAgentKwargs() + middleware = AsyncAttachingConversationKwargs() req = AsyncBoltRequest(body=thread_started_event_body, mode="socket_mode") req.context["client"] = AsyncWebClient(token="xoxb-test") @@ -36,7 +38,7 @@ async def test_assistant_event_attaches_kwargs(self): @pytest.mark.asyncio async def test_user_message_event_attaches_kwargs(self): - middleware = AsyncAttachingAgentKwargs() + middleware = AsyncAttachingConversationKwargs() req = AsyncBoltRequest(body=user_message_event_body, mode="socket_mode") req.context["client"] = AsyncWebClient(token="xoxb-test") @@ -51,7 +53,7 @@ async def test_user_message_event_attaches_kwargs(self): @pytest.mark.asyncio async def test_non_assistant_event_does_not_attach_kwargs(self): - middleware = AsyncAttachingAgentKwargs() + middleware = AsyncAttachingConversationKwargs() req = AsyncBoltRequest(body=channel_user_message_event_body, mode="socket_mode") req.context["client"] = AsyncWebClient(token="xoxb-test") @@ -65,7 +67,7 @@ async def test_non_assistant_event_does_not_attach_kwargs(self): @pytest.mark.asyncio async def test_non_event_does_not_attach_kwargs(self): - middleware = AsyncAttachingAgentKwargs() + middleware = AsyncAttachingConversationKwargs() req = AsyncBoltRequest(body="payload={}", headers={}) resp = await middleware.async_process(req=req, resp=BoltResponse(status=404), next=next) From 4dee16d96ca41a62af417e3345e2fa4e2d813a99 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 02:43:41 +0000 Subject: [PATCH 714/719] chore(deps): bump actions/download-artifact from 8.0.0 to 8.0.1 (#1474) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/pypi-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 7ec974574..dfc224c83 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -52,7 +52,7 @@ jobs: steps: - name: Retrieve dist folder - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: release-dist path: dist/ @@ -76,7 +76,7 @@ jobs: steps: - name: Retrieve dist folder - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: release-dist path: dist/ From 3f9d3761dba44a1c259055d56a046ba8e462a8c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 10:34:37 -0400 Subject: [PATCH 715/719] chore(deps): bump codecov/codecov-action from 5.5.2 to 6.0.0 (#1475) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 6c4cd5a6a..324ff7d80 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -126,7 +126,7 @@ jobs: pytest tests/scenario_tests_async/ --junitxml=reports/test_scenario_async.xml - name: Upload test results to Codecov if: ${{ !cancelled() }} - uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 + uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0 with: directory: ./reports/ fail_ci_if_error: true @@ -162,7 +162,7 @@ jobs: run: | pytest --cov=./slack_bolt/ --cov-report=xml - name: Upload coverage to Codecov - uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 + uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0 with: fail_ci_if_error: true report_type: coverage From 13a6dff9d6682593982604e587b7340dcc2e9d60 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 10:39:18 -0400 Subject: [PATCH 716/719] chore(deps): bump slackapi/slack-github-action from 2.1.1 to 3.0.1 (#1476) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 324ff7d80..6d504ea83 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -179,7 +179,7 @@ jobs: if: ${{ !success() && github.ref == 'refs/heads/main' && github.event_name != 'workflow_dispatch' }} steps: - name: Send notifications of failing tests - uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1 + uses: slackapi/slack-github-action@af78098f536edbc4de71162a307590698245be95 # v3.0.1 with: errors: true webhook: ${{ secrets.SLACK_REGRESSION_FAILURES_WEBHOOK_URL }} From dbe1590498a80903b5b5ce559b89c4640e84c775 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 10:46:04 -0400 Subject: [PATCH 717/719] chore(deps): bump dependabot/fetch-metadata from 2.5.0 to 3.0.0 (#1477) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 824d57701..9666057aa 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Collect metadata id: metadata - uses: dependabot/fetch-metadata@21025c705c08248db411dc16f3619e6b5f9ea21a # v2.5.0 + uses: dependabot/fetch-metadata@ffa630c65fa7e0ecfa0625b5ceda64399aea1b36 # v3.0.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" - name: Approve From 064ef2e83ad9035827e1267243ee56130e5b12fd Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Mon, 6 Apr 2026 17:36:31 -0400 Subject: [PATCH 718/719] chore: remove experiment around say_stream (#1471) Co-authored-by: Eden Zimbelman --- .../context/say_stream/async_say_stream.py | 14 +------------ slack_bolt/context/say_stream/say_stream.py | 14 +------------ slack_bolt/warning/__init__.py | 7 ------- tests/slack_bolt/context/test_say_stream.py | 20 ++++-------------- .../context/test_async_say_stream.py | 21 ++++--------------- 5 files changed, 10 insertions(+), 66 deletions(-) delete mode 100644 slack_bolt/warning/__init__.py diff --git a/slack_bolt/context/say_stream/async_say_stream.py b/slack_bolt/context/say_stream/async_say_stream.py index dc752d02a..af776891b 100644 --- a/slack_bolt/context/say_stream/async_say_stream.py +++ b/slack_bolt/context/say_stream/async_say_stream.py @@ -1,11 +1,8 @@ -import warnings from typing import Optional from slack_sdk.web.async_client import AsyncWebClient from slack_sdk.web.async_chat_stream import AsyncChatStream -from slack_bolt.warning import ExperimentalWarning - class AsyncSayStream: client: AsyncWebClient @@ -39,16 +36,7 @@ async def __call__( thread_ts: Optional[str] = None, **kwargs, ) -> AsyncChatStream: - """Starts a new chat stream with context. - - Warning: This is an experimental feature and may change in future versions. - """ - warnings.warn( - "say_stream is experimental and may change in future versions.", - category=ExperimentalWarning, - stacklevel=2, - ) - + """Starts a new chat stream with context.""" channel = channel or self.channel thread_ts = thread_ts or self.thread_ts if channel is None: diff --git a/slack_bolt/context/say_stream/say_stream.py b/slack_bolt/context/say_stream/say_stream.py index 1e1d7985f..b6a5ca797 100644 --- a/slack_bolt/context/say_stream/say_stream.py +++ b/slack_bolt/context/say_stream/say_stream.py @@ -1,11 +1,8 @@ -import warnings from typing import Optional from slack_sdk import WebClient from slack_sdk.web.chat_stream import ChatStream -from slack_bolt.warning import ExperimentalWarning - class SayStream: client: WebClient @@ -39,16 +36,7 @@ def __call__( thread_ts: Optional[str] = None, **kwargs, ) -> ChatStream: - """Starts a new chat stream with context. - - Warning: This is an experimental feature and may change in future versions. - """ - warnings.warn( - "say_stream is experimental and may change in future versions.", - category=ExperimentalWarning, - stacklevel=2, - ) - + """Starts a new chat stream with context.""" channel = channel or self.channel thread_ts = thread_ts or self.thread_ts if channel is None: diff --git a/slack_bolt/warning/__init__.py b/slack_bolt/warning/__init__.py deleted file mode 100644 index 4991f4cd9..000000000 --- a/slack_bolt/warning/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -"""Bolt specific warning types.""" - - -class ExperimentalWarning(FutureWarning): - """Warning for features that are still in experimental phase.""" - - pass diff --git a/tests/slack_bolt/context/test_say_stream.py b/tests/slack_bolt/context/test_say_stream.py index c8f4c3a31..29d244a65 100644 --- a/tests/slack_bolt/context/test_say_stream.py +++ b/tests/slack_bolt/context/test_say_stream.py @@ -2,7 +2,6 @@ from slack_sdk import WebClient from slack_bolt.context.say_stream.say_stream import SayStream -from slack_bolt.warning import ExperimentalWarning from tests.mock_web_api_server import cleanup_mock_web_api_server, setup_mock_web_api_server @@ -20,15 +19,13 @@ def teardown_method(self): def test_missing_channel_raises(self): say_stream = SayStream(client=self.web_client, channel=None, thread_ts="111.222") - with pytest.warns(ExperimentalWarning): - with pytest.raises(ValueError, match="channel"): - say_stream() + with pytest.raises(ValueError, match="channel"): + say_stream() def test_missing_thread_ts_raises(self): say_stream = SayStream(client=self.web_client, channel="C111", thread_ts=None) - with pytest.warns(ExperimentalWarning): - with pytest.raises(ValueError, match="thread_ts"): - say_stream() + with pytest.raises(ValueError, match="thread_ts"): + say_stream() def test_default_params(self): say_stream = SayStream( @@ -92,12 +89,3 @@ def test_buffer_size_overrides(self): "recipient_user_id": "U222", "task_display_mode": None, } - - def test_experimental_warning(self): - say_stream = SayStream( - client=self.web_client, - channel="C111", - thread_ts="111.222", - ) - with pytest.warns(ExperimentalWarning, match="say_stream is experimental"): - say_stream() diff --git a/tests/slack_bolt_async/context/test_async_say_stream.py b/tests/slack_bolt_async/context/test_async_say_stream.py index fbc4c5c7e..016549bd6 100644 --- a/tests/slack_bolt_async/context/test_async_say_stream.py +++ b/tests/slack_bolt_async/context/test_async_say_stream.py @@ -2,7 +2,6 @@ from slack_sdk.web.async_client import AsyncWebClient from slack_bolt.context.say_stream.async_say_stream import AsyncSayStream -from slack_bolt.warning import ExperimentalWarning from tests.mock_web_api_server import ( cleanup_mock_web_api_server, setup_mock_web_api_server, @@ -29,16 +28,14 @@ def setup_teardown(self): @pytest.mark.asyncio async def test_missing_channel_raises(self): say_stream = AsyncSayStream(client=self.web_client, channel=None, thread_ts="111.222") - with pytest.warns(ExperimentalWarning): - with pytest.raises(ValueError, match="channel"): - await say_stream() + with pytest.raises(ValueError, match="channel"): + await say_stream() @pytest.mark.asyncio async def test_missing_thread_ts_raises(self): say_stream = AsyncSayStream(client=self.web_client, channel="C111", thread_ts=None) - with pytest.warns(ExperimentalWarning): - with pytest.raises(ValueError, match="thread_ts"): - await say_stream() + with pytest.raises(ValueError, match="thread_ts"): + await say_stream() @pytest.mark.asyncio async def test_default_params(self): @@ -105,13 +102,3 @@ async def test_buffer_size_overrides(self): "recipient_user_id": "U222", "task_display_mode": None, } - - @pytest.mark.asyncio - async def test_experimental_warning(self): - say_stream = AsyncSayStream( - client=self.web_client, - channel="C111", - thread_ts="111.222", - ) - with pytest.warns(ExperimentalWarning, match="say_stream is experimental"): - await say_stream() From c64d69d2b64801602c849aa56e0ba2d4161e1f98 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Mon, 6 Apr 2026 15:49:13 -0700 Subject: [PATCH 719/719] chore(release): version 1.28.0 (#1480) --- docs/reference/app/app.html | 30 ++- docs/reference/app/async_app.html | 34 ++- docs/reference/app/async_server.html | 6 +- docs/reference/app/index.html | 30 ++- docs/reference/async_app.html | 229 ++++++++++++++---- .../authorization/authorize_result.html | 4 +- docs/reference/authorization/index.html | 4 +- .../assistant/assistant_utilities.html | 14 ++ .../assistant/async_assistant_utilities.html | 14 ++ .../thread_context_store/file/index.html | 2 +- docs/reference/context/async_context.html | 25 +- docs/reference/context/base_context.html | 1 + docs/reference/context/context.html | 25 +- .../async_get_thread_context.html | 10 +- .../get_thread_context.html | 10 +- .../context/get_thread_context/index.html | 10 +- docs/reference/context/index.html | 30 ++- .../context/say_stream/async_say_stream.html | 174 +++++++++++++ docs/reference/context/say_stream/index.html | 191 +++++++++++++++ .../context/say_stream/say_stream.html | 174 +++++++++++++ docs/reference/error/index.html | 2 +- docs/reference/index.html | 212 +++++++++++++--- docs/reference/kwargs_injection/args.html | 11 +- .../kwargs_injection/async_args.html | 11 +- .../kwargs_injection/async_utils.html | 5 +- docs/reference/kwargs_injection/index.html | 16 +- docs/reference/kwargs_injection/utils.html | 5 +- .../async_listener_error_handler.html | 7 +- .../listener/listener_error_handler.html | 7 +- docs/reference/logger/messages.html | 4 +- .../middleware/assistant/assistant.html | 43 ++-- .../middleware/assistant/async_assistant.html | 59 +++-- .../reference/middleware/assistant/index.html | 43 ++-- docs/reference/middleware/async_builtins.html | 82 +++++++ .../middleware/async_middleware.html | 1 + .../async_middleware_error_handler.html | 7 +- .../async_attaching_conversation_kwargs.html | 155 ++++++++++++ .../attaching_conversation_kwargs.html | 149 ++++++++++++ .../attaching_conversation_kwargs/index.html | 166 +++++++++++++ docs/reference/middleware/index.html | 82 +++++++ docs/reference/middleware/middleware.html | 1 + .../middleware/middleware_error_handler.html | 7 +- .../oauth/async_callback_options.html | 4 +- .../reference/oauth/async_oauth_settings.html | 2 +- docs/reference/oauth/callback_options.html | 4 +- docs/reference/oauth/oauth_settings.html | 2 +- docs/reference/request/internals.html | 75 +++--- slack_bolt/version.py | 2 +- 48 files changed, 1868 insertions(+), 313 deletions(-) create mode 100644 docs/reference/context/say_stream/async_say_stream.html create mode 100644 docs/reference/context/say_stream/index.html create mode 100644 docs/reference/context/say_stream/say_stream.html create mode 100644 docs/reference/middleware/attaching_conversation_kwargs/async_attaching_conversation_kwargs.html create mode 100644 docs/reference/middleware/attaching_conversation_kwargs/attaching_conversation_kwargs.html create mode 100644 docs/reference/middleware/attaching_conversation_kwargs/index.html diff --git a/docs/reference/app/app.html b/docs/reference/app/app.html index c91d020ef..bf0d5ee00 100644 --- a/docs/reference/app/app.html +++ b/docs/reference/app/app.html @@ -48,7 +48,7 @@

    Classes

    class App -(*,
    logger: logging.Logger | None = None,
    name: str | None = None,
    process_before_response: bool = False,
    raise_error_for_unhandled_request: bool = False,
    signing_secret: str | None = None,
    token: str | None = None,
    token_verification_enabled: bool = True,
    client: slack_sdk.web.client.WebClient | None = None,
    before_authorize: Middleware | Callable[..., Any] | None = None,
    authorize: Callable[..., AuthorizeResult] | None = None,
    user_facing_authorize_error_message: str | None = None,
    installation_store: slack_sdk.oauth.installation_store.installation_store.InstallationStore | None = None,
    installation_store_bot_only: bool | None = None,
    request_verification_enabled: bool = True,
    ignoring_self_events_enabled: bool = True,
    ignoring_self_assistant_message_events_enabled: bool = True,
    ssl_check_enabled: bool = True,
    url_verification_enabled: bool = True,
    attaching_function_token_enabled: bool = True,
    oauth_settings: OAuthSettings | None = None,
    oauth_flow: OAuthFlow | None = None,
    verification_token: str | None = None,
    listener_executor: concurrent.futures._base.Executor | None = None,
    assistant_thread_context_store: AssistantThreadContextStore | None = None)
    +(*,
    logger: logging.Logger | None = None,
    name: str | None = None,
    process_before_response: bool = False,
    raise_error_for_unhandled_request: bool = False,
    signing_secret: str | None = None,
    token: str | None = None,
    token_verification_enabled: bool = True,
    client: slack_sdk.web.client.WebClient | None = None,
    before_authorize: Middleware | Callable[..., Any] | None = None,
    authorize: Callable[..., AuthorizeResult] | None = None,
    user_facing_authorize_error_message: str | None = None,
    installation_store: slack_sdk.oauth.installation_store.installation_store.InstallationStore | None = None,
    installation_store_bot_only: bool | None = None,
    request_verification_enabled: bool = True,
    ignoring_self_events_enabled: bool = True,
    ignoring_self_assistant_message_events_enabled: bool = True,
    ssl_check_enabled: bool = True,
    url_verification_enabled: bool = True,
    attaching_function_token_enabled: bool = True,
    oauth_settings: OAuthSettings | None = None,
    oauth_flow: OAuthFlow | None = None,
    verification_token: str | None = None,
    listener_executor: concurrent.futures._base.Executor | None = None,
    assistant_thread_context_store: AssistantThreadContextStore | None = None,
    attaching_conversation_kwargs_enabled: bool = True)
    @@ -95,6 +95,7 @@

    Classes

    listener_executor: Optional[Executor] = None, # for AI Agents & Assistants assistant_thread_context_store: Optional[AssistantThreadContextStore] = None, + attaching_conversation_kwargs_enabled: bool = True, ): """Bolt App that provides functionalities to register middleware/listeners. @@ -315,6 +316,7 @@

    Classes

    listener_executor = ThreadPoolExecutor(max_workers=5) self._assistant_thread_context_store = assistant_thread_context_store + self._attaching_conversation_kwargs_enabled = attaching_conversation_kwargs_enabled self._process_before_response = process_before_response self._listener_runner = ThreadListenerRunner( @@ -799,10 +801,13 @@

    Classes

    middleware: A list of lister middleware functions. Only when all the middleware call `next()` method, the listener function can be invoked. """ + middleware = list(middleware) if middleware else [] def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.event(event, base_logger=self._base_logger) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AttachingConversationKwargs(self._assistant_thread_context_store)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) return __call__ @@ -860,6 +865,8 @@

    Classes

    primary_matcher = builtin_matchers.message_event( keyword=keyword, constraints=constraints, base_logger=self._base_logger ) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AttachingConversationKwargs(self._assistant_thread_context_store)) middleware.insert(0, MessageListenerMatches(keyword)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) @@ -1356,20 +1363,6 @@

    Classes

    # It is intended for apps that start lazy listeners from their custom global middleware. req.context["listener_runner"] = self.listener_runner - # For AI Agents & Assistants - if is_assistant_event(req.body): - assistant = AssistantUtilities( - payload=to_event(req.body), # type:ignore[arg-type] - context=req.context, - thread_context_store=self._assistant_thread_context_store, - ) - req.context["say"] = assistant.say - req.context["set_status"] = assistant.set_status - req.context["set_title"] = assistant.set_title - req.context["set_suggested_prompts"] = assistant.set_suggested_prompts - req.context["get_thread_context"] = assistant.get_thread_context - req.context["save_thread_context"] = assistant.save_thread_context - @staticmethod def _to_listener_functions( kwargs: dict, @@ -1415,7 +1408,7 @@

    Classes

    CustomListener( app_name=self.name, ack_function=functions.pop(0), - lazy_functions=functions, # type:ignore[arg-type] + lazy_functions=functions, # type: ignore[arg-type] matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, @@ -2203,10 +2196,13 @@

    Args

    middleware: A list of lister middleware functions. Only when all the middleware call `next()` method, the listener function can be invoked. """ + middleware = list(middleware) if middleware else [] def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.event(event, base_logger=self._base_logger) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AttachingConversationKwargs(self._assistant_thread_context_store)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) return __call__ @@ -2410,6 +2406,8 @@

    Args

    primary_matcher = builtin_matchers.message_event( keyword=keyword, constraints=constraints, base_logger=self._base_logger ) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AttachingConversationKwargs(self._assistant_thread_context_store)) middleware.insert(0, MessageListenerMatches(keyword)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) diff --git a/docs/reference/app/async_app.html b/docs/reference/app/async_app.html index 9cbc801d0..cf4c651cb 100644 --- a/docs/reference/app/async_app.html +++ b/docs/reference/app/async_app.html @@ -48,7 +48,7 @@

    Classes

    class AsyncApp -(*,
    logger: logging.Logger | None = None,
    name: str | None = None,
    process_before_response: bool = False,
    raise_error_for_unhandled_request: bool = False,
    signing_secret: str | None = None,
    token: str | None = None,
    client: slack_sdk.web.async_client.AsyncWebClient | None = None,
    before_authorize: AsyncMiddleware | Callable[..., Awaitable[Any]] | None = None,
    authorize: Callable[..., Awaitable[AuthorizeResult]] | None = None,
    user_facing_authorize_error_message: str | None = None,
    installation_store: slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore | None = None,
    installation_store_bot_only: bool | None = None,
    request_verification_enabled: bool = True,
    ignoring_self_events_enabled: bool = True,
    ignoring_self_assistant_message_events_enabled: bool = True,
    ssl_check_enabled: bool = True,
    url_verification_enabled: bool = True,
    attaching_function_token_enabled: bool = True,
    oauth_settings: AsyncOAuthSettings | None = None,
    oauth_flow: AsyncOAuthFlow | None = None,
    verification_token: str | None = None,
    assistant_thread_context_store: AsyncAssistantThreadContextStore | None = None)
    +(*,
    logger: logging.Logger | None = None,
    name: str | None = None,
    process_before_response: bool = False,
    raise_error_for_unhandled_request: bool = False,
    signing_secret: str | None = None,
    token: str | None = None,
    client: slack_sdk.web.async_client.AsyncWebClient | None = None,
    before_authorize: AsyncMiddleware | Callable[..., Awaitable[Any]] | None = None,
    authorize: Callable[..., Awaitable[AuthorizeResult]] | None = None,
    user_facing_authorize_error_message: str | None = None,
    installation_store: slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore | None = None,
    installation_store_bot_only: bool | None = None,
    request_verification_enabled: bool = True,
    ignoring_self_events_enabled: bool = True,
    ignoring_self_assistant_message_events_enabled: bool = True,
    ssl_check_enabled: bool = True,
    url_verification_enabled: bool = True,
    attaching_function_token_enabled: bool = True,
    oauth_settings: AsyncOAuthSettings | None = None,
    oauth_flow: AsyncOAuthFlow | None = None,
    verification_token: str | None = None,
    assistant_thread_context_store: AsyncAssistantThreadContextStore | None = None,
    attaching_conversation_kwargs_enabled: bool = True)
    @@ -92,6 +92,7 @@

    Classes

    verification_token: Optional[str] = None, # for AI Agents & Assistants assistant_thread_context_store: Optional[AsyncAssistantThreadContextStore] = None, + attaching_conversation_kwargs_enabled: bool = True, ): """Bolt App that provides functionalities to register middleware/listeners. @@ -312,6 +313,7 @@

    Classes

    self._async_listeners: List[AsyncListener] = [] self._assistant_thread_context_store = assistant_thread_context_store + self._attaching_conversation_kwargs_enabled = attaching_conversation_kwargs_enabled self._process_before_response = process_before_response self._async_listener_runner = AsyncioListenerRunner( @@ -565,7 +567,7 @@

    Classes

    self._framework_logger.debug(debug_checking_listener(listener_name)) if await listener.async_matches(req=req, resp=resp): # type: ignore[arg-type] # run all the middleware attached to this listener first - (middleware_resp, next_was_not_called) = await listener.run_async_middleware( + middleware_resp, next_was_not_called = await listener.run_async_middleware( req=req, resp=resp # type: ignore[arg-type] ) if next_was_not_called: @@ -815,10 +817,13 @@

    Classes

    middleware: A list of lister middleware functions. Only when all the middleware call `next()` method, the listener function can be invoked. """ + middleware = list(middleware) if middleware else [] def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.event(event, True, base_logger=self._base_logger) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AsyncAttachingConversationKwargs(self._assistant_thread_context_store)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) return __call__ @@ -879,6 +884,8 @@

    Classes

    asyncio=True, base_logger=self._base_logger, ) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AsyncAttachingConversationKwargs(self._assistant_thread_context_store)) middleware.insert(0, AsyncMessageListenerMatches(keyword)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) @@ -1380,20 +1387,6 @@

    Classes

    # It is intended for apps that start lazy listeners from their custom global middleware. req.context["listener_runner"] = self.listener_runner - # For AI Agents & Assistants - if is_assistant_event(req.body): - assistant = AsyncAssistantUtilities( - payload=to_event(req.body), # type:ignore[arg-type] - context=req.context, - thread_context_store=self._assistant_thread_context_store, - ) - req.context["say"] = assistant.say - req.context["set_status"] = assistant.set_status - req.context["set_title"] = assistant.set_title - req.context["set_suggested_prompts"] = assistant.set_suggested_prompts - req.context["get_thread_context"] = assistant.get_thread_context - req.context["save_thread_context"] = assistant.save_thread_context - @staticmethod def _to_listener_functions( kwargs: dict, @@ -1444,7 +1437,7 @@

    Classes

    AsyncCustomListener( app_name=self.name, ack_function=functions.pop(0), - lazy_functions=functions, # type:ignore[arg-type] + lazy_functions=functions, # type: ignore[arg-type] matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, @@ -1794,7 +1787,7 @@

    Args

    self._framework_logger.debug(debug_checking_listener(listener_name)) if await listener.async_matches(req=req, resp=resp): # type: ignore[arg-type] # run all the middleware attached to this listener first - (middleware_resp, next_was_not_called) = await listener.run_async_middleware( + middleware_resp, next_was_not_called = await listener.run_async_middleware( req=req, resp=resp # type: ignore[arg-type] ) if next_was_not_called: @@ -2243,10 +2236,13 @@

    Args

    middleware: A list of lister middleware functions. Only when all the middleware call `next()` method, the listener function can be invoked. """ + middleware = list(middleware) if middleware else [] def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.event(event, True, base_logger=self._base_logger) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AsyncAttachingConversationKwargs(self._assistant_thread_context_store)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) return __call__
    @@ -2454,6 +2450,8 @@

    Args

    asyncio=True, base_logger=self._base_logger, ) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AsyncAttachingConversationKwargs(self._assistant_thread_context_store)) middleware.insert(0, AsyncMessageListenerMatches(keyword)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) diff --git a/docs/reference/app/async_server.html b/docs/reference/app/async_server.html index b95b8a2b3..5eefe90dd 100644 --- a/docs/reference/app/async_server.html +++ b/docs/reference/app/async_server.html @@ -59,14 +59,14 @@

    Classes

    port: int path: str host: str - bolt_app: "AsyncApp" # type: ignore[name-defined] + bolt_app: "AsyncApp" web_app: web.Application def __init__( self, port: int, path: str, - app: "AsyncApp", # type: ignore[name-defined] + app: "AsyncApp", host: Optional[str] = None, ): """Standalone AIOHTTP Web Server. @@ -81,7 +81,7 @@

    Classes

    self.port = port self.path = path self.host = host if host is not None else "0.0.0.0" - self.bolt_app: "AsyncApp" = app # type: ignore[name-defined] + self.bolt_app: "AsyncApp" = app self.web_app = web.Application() self._bolt_oauth_flow = self.bolt_app.oauth_flow if self._bolt_oauth_flow: diff --git a/docs/reference/app/index.html b/docs/reference/app/index.html index 8821e5af9..32e006944 100644 --- a/docs/reference/app/index.html +++ b/docs/reference/app/index.html @@ -67,7 +67,7 @@

    Classes

    class App -(*,
    logger: logging.Logger | None = None,
    name: str | None = None,
    process_before_response: bool = False,
    raise_error_for_unhandled_request: bool = False,
    signing_secret: str | None = None,
    token: str | None = None,
    token_verification_enabled: bool = True,
    client: slack_sdk.web.client.WebClient | None = None,
    before_authorize: Middleware | Callable[..., Any] | None = None,
    authorize: Callable[..., AuthorizeResult] | None = None,
    user_facing_authorize_error_message: str | None = None,
    installation_store: slack_sdk.oauth.installation_store.installation_store.InstallationStore | None = None,
    installation_store_bot_only: bool | None = None,
    request_verification_enabled: bool = True,
    ignoring_self_events_enabled: bool = True,
    ignoring_self_assistant_message_events_enabled: bool = True,
    ssl_check_enabled: bool = True,
    url_verification_enabled: bool = True,
    attaching_function_token_enabled: bool = True,
    oauth_settings: OAuthSettings | None = None,
    oauth_flow: OAuthFlow | None = None,
    verification_token: str | None = None,
    listener_executor: concurrent.futures._base.Executor | None = None,
    assistant_thread_context_store: AssistantThreadContextStore | None = None)
    +(*,
    logger: logging.Logger | None = None,
    name: str | None = None,
    process_before_response: bool = False,
    raise_error_for_unhandled_request: bool = False,
    signing_secret: str | None = None,
    token: str | None = None,
    token_verification_enabled: bool = True,
    client: slack_sdk.web.client.WebClient | None = None,
    before_authorize: Middleware | Callable[..., Any] | None = None,
    authorize: Callable[..., AuthorizeResult] | None = None,
    user_facing_authorize_error_message: str | None = None,
    installation_store: slack_sdk.oauth.installation_store.installation_store.InstallationStore | None = None,
    installation_store_bot_only: bool | None = None,
    request_verification_enabled: bool = True,
    ignoring_self_events_enabled: bool = True,
    ignoring_self_assistant_message_events_enabled: bool = True,
    ssl_check_enabled: bool = True,
    url_verification_enabled: bool = True,
    attaching_function_token_enabled: bool = True,
    oauth_settings: OAuthSettings | None = None,
    oauth_flow: OAuthFlow | None = None,
    verification_token: str | None = None,
    listener_executor: concurrent.futures._base.Executor | None = None,
    assistant_thread_context_store: AssistantThreadContextStore | None = None,
    attaching_conversation_kwargs_enabled: bool = True)
    @@ -114,6 +114,7 @@

    Classes

    listener_executor: Optional[Executor] = None, # for AI Agents & Assistants assistant_thread_context_store: Optional[AssistantThreadContextStore] = None, + attaching_conversation_kwargs_enabled: bool = True, ): """Bolt App that provides functionalities to register middleware/listeners. @@ -334,6 +335,7 @@

    Classes

    listener_executor = ThreadPoolExecutor(max_workers=5) self._assistant_thread_context_store = assistant_thread_context_store + self._attaching_conversation_kwargs_enabled = attaching_conversation_kwargs_enabled self._process_before_response = process_before_response self._listener_runner = ThreadListenerRunner( @@ -818,10 +820,13 @@

    Classes

    middleware: A list of lister middleware functions. Only when all the middleware call `next()` method, the listener function can be invoked. """ + middleware = list(middleware) if middleware else [] def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.event(event, base_logger=self._base_logger) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AttachingConversationKwargs(self._assistant_thread_context_store)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) return __call__ @@ -879,6 +884,8 @@

    Classes

    primary_matcher = builtin_matchers.message_event( keyword=keyword, constraints=constraints, base_logger=self._base_logger ) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AttachingConversationKwargs(self._assistant_thread_context_store)) middleware.insert(0, MessageListenerMatches(keyword)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) @@ -1375,20 +1382,6 @@

    Classes

    # It is intended for apps that start lazy listeners from their custom global middleware. req.context["listener_runner"] = self.listener_runner - # For AI Agents & Assistants - if is_assistant_event(req.body): - assistant = AssistantUtilities( - payload=to_event(req.body), # type:ignore[arg-type] - context=req.context, - thread_context_store=self._assistant_thread_context_store, - ) - req.context["say"] = assistant.say - req.context["set_status"] = assistant.set_status - req.context["set_title"] = assistant.set_title - req.context["set_suggested_prompts"] = assistant.set_suggested_prompts - req.context["get_thread_context"] = assistant.get_thread_context - req.context["save_thread_context"] = assistant.save_thread_context - @staticmethod def _to_listener_functions( kwargs: dict, @@ -1434,7 +1427,7 @@

    Classes

    CustomListener( app_name=self.name, ack_function=functions.pop(0), - lazy_functions=functions, # type:ignore[arg-type] + lazy_functions=functions, # type: ignore[arg-type] matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, @@ -2222,10 +2215,13 @@

    Args

    middleware: A list of lister middleware functions. Only when all the middleware call `next()` method, the listener function can be invoked. """ + middleware = list(middleware) if middleware else [] def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.event(event, base_logger=self._base_logger) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AttachingConversationKwargs(self._assistant_thread_context_store)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) return __call__ @@ -2429,6 +2425,8 @@

    Args

    primary_matcher = builtin_matchers.message_event( keyword=keyword, constraints=constraints, base_logger=self._base_logger ) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AttachingConversationKwargs(self._assistant_thread_context_store)) middleware.insert(0, MessageListenerMatches(keyword)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) diff --git a/docs/reference/async_app.html b/docs/reference/async_app.html index 8fd975be9..3494ec289 100644 --- a/docs/reference/async_app.html +++ b/docs/reference/async_app.html @@ -139,7 +139,7 @@

    Class variables

    class AsyncApp -(*,
    logger: logging.Logger | None = None,
    name: str | None = None,
    process_before_response: bool = False,
    raise_error_for_unhandled_request: bool = False,
    signing_secret: str | None = None,
    token: str | None = None,
    client: slack_sdk.web.async_client.AsyncWebClient | None = None,
    before_authorize: AsyncMiddleware | Callable[..., Awaitable[Any]] | None = None,
    authorize: Callable[..., Awaitable[AuthorizeResult]] | None = None,
    user_facing_authorize_error_message: str | None = None,
    installation_store: slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore | None = None,
    installation_store_bot_only: bool | None = None,
    request_verification_enabled: bool = True,
    ignoring_self_events_enabled: bool = True,
    ignoring_self_assistant_message_events_enabled: bool = True,
    ssl_check_enabled: bool = True,
    url_verification_enabled: bool = True,
    attaching_function_token_enabled: bool = True,
    oauth_settings: AsyncOAuthSettings | None = None,
    oauth_flow: AsyncOAuthFlow | None = None,
    verification_token: str | None = None,
    assistant_thread_context_store: AsyncAssistantThreadContextStore | None = None)
    +(*,
    logger: logging.Logger | None = None,
    name: str | None = None,
    process_before_response: bool = False,
    raise_error_for_unhandled_request: bool = False,
    signing_secret: str | None = None,
    token: str | None = None,
    client: slack_sdk.web.async_client.AsyncWebClient | None = None,
    before_authorize: AsyncMiddleware | Callable[..., Awaitable[Any]] | None = None,
    authorize: Callable[..., Awaitable[AuthorizeResult]] | None = None,
    user_facing_authorize_error_message: str | None = None,
    installation_store: slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore | None = None,
    installation_store_bot_only: bool | None = None,
    request_verification_enabled: bool = True,
    ignoring_self_events_enabled: bool = True,
    ignoring_self_assistant_message_events_enabled: bool = True,
    ssl_check_enabled: bool = True,
    url_verification_enabled: bool = True,
    attaching_function_token_enabled: bool = True,
    oauth_settings: AsyncOAuthSettings | None = None,
    oauth_flow: AsyncOAuthFlow | None = None,
    verification_token: str | None = None,
    assistant_thread_context_store: AsyncAssistantThreadContextStore | None = None,
    attaching_conversation_kwargs_enabled: bool = True)
    @@ -183,6 +183,7 @@

    Class variables

    verification_token: Optional[str] = None, # for AI Agents & Assistants assistant_thread_context_store: Optional[AsyncAssistantThreadContextStore] = None, + attaching_conversation_kwargs_enabled: bool = True, ): """Bolt App that provides functionalities to register middleware/listeners. @@ -403,6 +404,7 @@

    Class variables

    self._async_listeners: List[AsyncListener] = [] self._assistant_thread_context_store = assistant_thread_context_store + self._attaching_conversation_kwargs_enabled = attaching_conversation_kwargs_enabled self._process_before_response = process_before_response self._async_listener_runner = AsyncioListenerRunner( @@ -656,7 +658,7 @@

    Class variables

    self._framework_logger.debug(debug_checking_listener(listener_name)) if await listener.async_matches(req=req, resp=resp): # type: ignore[arg-type] # run all the middleware attached to this listener first - (middleware_resp, next_was_not_called) = await listener.run_async_middleware( + middleware_resp, next_was_not_called = await listener.run_async_middleware( req=req, resp=resp # type: ignore[arg-type] ) if next_was_not_called: @@ -906,10 +908,13 @@

    Class variables

    middleware: A list of lister middleware functions. Only when all the middleware call `next()` method, the listener function can be invoked. """ + middleware = list(middleware) if middleware else [] def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.event(event, True, base_logger=self._base_logger) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AsyncAttachingConversationKwargs(self._assistant_thread_context_store)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) return __call__ @@ -970,6 +975,8 @@

    Class variables

    asyncio=True, base_logger=self._base_logger, ) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AsyncAttachingConversationKwargs(self._assistant_thread_context_store)) middleware.insert(0, AsyncMessageListenerMatches(keyword)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) @@ -1471,20 +1478,6 @@

    Class variables

    # It is intended for apps that start lazy listeners from their custom global middleware. req.context["listener_runner"] = self.listener_runner - # For AI Agents & Assistants - if is_assistant_event(req.body): - assistant = AsyncAssistantUtilities( - payload=to_event(req.body), # type:ignore[arg-type] - context=req.context, - thread_context_store=self._assistant_thread_context_store, - ) - req.context["say"] = assistant.say - req.context["set_status"] = assistant.set_status - req.context["set_title"] = assistant.set_title - req.context["set_suggested_prompts"] = assistant.set_suggested_prompts - req.context["get_thread_context"] = assistant.get_thread_context - req.context["save_thread_context"] = assistant.save_thread_context - @staticmethod def _to_listener_functions( kwargs: dict, @@ -1535,7 +1528,7 @@

    Class variables

    AsyncCustomListener( app_name=self.name, ack_function=functions.pop(0), - lazy_functions=functions, # type:ignore[arg-type] + lazy_functions=functions, # type: ignore[arg-type] matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, @@ -1885,7 +1878,7 @@

    Args

    self._framework_logger.debug(debug_checking_listener(listener_name)) if await listener.async_matches(req=req, resp=resp): # type: ignore[arg-type] # run all the middleware attached to this listener first - (middleware_resp, next_was_not_called) = await listener.run_async_middleware( + middleware_resp, next_was_not_called = await listener.run_async_middleware( req=req, resp=resp # type: ignore[arg-type] ) if next_was_not_called: @@ -2334,10 +2327,13 @@

    Args

    middleware: A list of lister middleware functions. Only when all the middleware call `next()` method, the listener function can be invoked. """ + middleware = list(middleware) if middleware else [] def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.event(event, True, base_logger=self._base_logger) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AsyncAttachingConversationKwargs(self._assistant_thread_context_store)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) return __call__ @@ -2545,6 +2541,8 @@

    Args

    asyncio=True, base_logger=self._base_logger, ) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AsyncAttachingConversationKwargs(self._assistant_thread_context_store)) middleware.insert(0, AsyncMessageListenerMatches(keyword)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) @@ -3285,7 +3283,7 @@

    Args

    func=is_assistant_thread_started_event, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -3294,7 +3292,7 @@

    Args

    self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -3331,7 +3329,7 @@

    Args

    func=is_user_message_event_in_assistant_thread, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -3340,7 +3338,7 @@

    Args

    self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -3377,7 +3375,7 @@

    Args

    func=is_bot_message_event_in_assistant_thread, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -3386,7 +3384,7 @@

    Args

    self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -3423,7 +3421,7 @@

    Args

    func=is_assistant_thread_context_changed_event, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -3432,7 +3430,7 @@

    Args

    self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -3460,14 +3458,14 @@

    Args

    primary_matcher: Union[Callable[..., bool], AsyncListenerMatcher], custom_matchers: Optional[Union[Callable[..., bool], AsyncListenerMatcher]], ): - return [primary_matcher] + (custom_matchers or []) # type:ignore[operator] + return [primary_matcher] + (custom_matchers or []) # type: ignore[operator] @staticmethod async def default_thread_context_changed(save_thread_context: AsyncSaveThreadContext, payload: dict): new_context: dict = payload["assistant_thread"]["context"] await save_thread_context(new_context) - async def async_process( # type:ignore[return] + async def async_process( # type: ignore[return] self, *, req: AsyncBoltRequest, @@ -3487,6 +3485,15 @@

    Args

    if listeners is not None: for listener in listeners: if listener is not None and await listener.async_matches(req=req, resp=resp): + middleware_resp, next_was_not_called = await listener.run_async_middleware(req=req, resp=resp) + if next_was_not_called: + if middleware_resp is not None: + return middleware_resp + # The listener middleware didn't call next(). + # Skip this listener and try the next one. + continue + if middleware_resp is not None: + resp = middleware_resp return await listener_runner.run( request=req, response=resp, @@ -3506,13 +3513,14 @@

    Args

    middleware: Optional[List[AsyncMiddleware]] = None, base_logger: Optional[Logger] = None, ) -> AsyncListener: - if isinstance(listener_or_functions, Callable): # type:ignore[arg-type] - listener_or_functions = [listener_or_functions] # type:ignore[list-item] + if isinstance(listener_or_functions, Callable): # type: ignore[arg-type] + listener_or_functions = [listener_or_functions] # type: ignore[list-item] if isinstance(listener_or_functions, AsyncListener): return listener_or_functions elif isinstance(listener_or_functions, list): middleware = middleware if middleware else [] + middleware.insert(0, AsyncAttachingConversationKwargs(self.thread_context_store)) functions = listener_or_functions ack_function = functions.pop(0) @@ -3524,7 +3532,7 @@

    Args

    else: listener_matchers.append( build_listener_matcher( - func=matcher, # type:ignore[arg-type] + func=matcher, # type: ignore[arg-type] asyncio=True, base_logger=base_logger, ) @@ -3599,7 +3607,7 @@

    Methods

    func=is_bot_message_event_in_assistant_thread, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -3608,7 +3616,7 @@

    Methods

    self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -3648,13 +3656,14 @@

    Methods

    middleware: Optional[List[AsyncMiddleware]] = None, base_logger: Optional[Logger] = None, ) -> AsyncListener: - if isinstance(listener_or_functions, Callable): # type:ignore[arg-type] - listener_or_functions = [listener_or_functions] # type:ignore[list-item] + if isinstance(listener_or_functions, Callable): # type: ignore[arg-type] + listener_or_functions = [listener_or_functions] # type: ignore[list-item] if isinstance(listener_or_functions, AsyncListener): return listener_or_functions elif isinstance(listener_or_functions, list): middleware = middleware if middleware else [] + middleware.insert(0, AsyncAttachingConversationKwargs(self.thread_context_store)) functions = listener_or_functions ack_function = functions.pop(0) @@ -3666,7 +3675,7 @@

    Methods

    else: listener_matchers.append( build_listener_matcher( - func=matcher, # type:ignore[arg-type] + func=matcher, # type: ignore[arg-type] asyncio=True, base_logger=base_logger, ) @@ -3707,7 +3716,7 @@

    Methods

    func=is_assistant_thread_context_changed_event, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -3716,7 +3725,7 @@

    Methods

    self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -3763,7 +3772,7 @@

    Methods

    func=is_assistant_thread_started_event, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -3772,7 +3781,7 @@

    Methods

    self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -3819,7 +3828,7 @@

    Methods

    func=is_user_message_event_in_assistant_thread, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -3828,7 +3837,7 @@

    Methods

    self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -3898,7 +3907,7 @@

    Inherited members

    # The return type is intentionally string to avoid circular imports @property - def listener_runner(self) -> "AsyncioListenerRunner": # type: ignore[name-defined] + def listener_runner(self) -> "AsyncioListenerRunner": """The properly configured listener_runner that is available for middleware/listeners.""" return self["listener_runner"] @@ -3967,7 +3976,7 @@

    Inherited members

    Callable `say()` function """ if "say" not in self: - self["say"] = AsyncSay(client=self.client, channel=self.channel_id, thread_ts=self.thread_ts) + self["say"] = AsyncSay(client=self.client, channel=self.channel_id) return self["say"] @property @@ -4060,6 +4069,10 @@

    Inherited members

    def get_thread_context(self) -> Optional[AsyncGetThreadContext]: return self.get("get_thread_context") + @property + def say_stream(self) -> Optional[AsyncSayStream]: + return self.get("say_stream") + @property def save_thread_context(self) -> Optional[AsyncSaveThreadContext]: return self.get("save_thread_context") @@ -4275,7 +4288,7 @@

    Returns

    Expand source code
    @property
    -def listener_runner(self) -> "AsyncioListenerRunner":  # type: ignore[name-defined]
    +def listener_runner(self) -> "AsyncioListenerRunner":
         """The properly configured listener_runner that is available for middleware/listeners."""
         return self["listener_runner"]
    @@ -4365,7 +4378,7 @@

    Returns

    Callable `say()` function """ if "say" not in self: - self["say"] = AsyncSay(client=self.client, channel=self.channel_id, thread_ts=self.thread_ts) + self["say"] = AsyncSay(client=self.client, channel=self.channel_id) return self["say"]

    say() function for this request.

    @@ -4383,6 +4396,18 @@

    Returns

    Returns

    Callable say() function

    +
    prop say_streamAsyncSayStream | None
    +
    +
    + +Expand source code + +
    @property
    +def say_stream(self) -> Optional[AsyncSayStream]:
    +    return self.get("say_stream")
    +
    +
    +
    prop set_statusAsyncSetStatus | None
    @@ -4742,14 +4767,10 @@

    Inherited members

    if self.thread_context_loaded is True: return self._thread_context - if self.payload.get("assistant_thread") is not None: + thread = self.payload.get("assistant_thread") + if isinstance(thread, dict) and thread.get("context", {}).get("channel_id") is not None: # assistant_thread_started - thread = self.payload["assistant_thread"] - self._thread_context = ( - AssistantThreadContext(thread["context"]) - if thread.get("context", {}).get("channel_id") is not None - else None - ) + self._thread_context = AssistantThreadContext(thread["context"]) # for this event, the context will never be changed self.thread_context_loaded = True elif self.payload.get("channel") is not None and self.payload.get("thread_ts") is not None: @@ -5231,6 +5252,97 @@

    Class variables

    +
    +class AsyncSayStream +(*,
    client: slack_sdk.web.async_client.AsyncWebClient,
    channel: str | None = None,
    recipient_team_id: str | None = None,
    recipient_user_id: str | None = None,
    thread_ts: str | None = None)
    +
    +
    +
    + +Expand source code + +
    class AsyncSayStream:
    +    client: AsyncWebClient
    +    channel: Optional[str]
    +    recipient_team_id: Optional[str]
    +    recipient_user_id: Optional[str]
    +    thread_ts: Optional[str]
    +
    +    def __init__(
    +        self,
    +        *,
    +        client: AsyncWebClient,
    +        channel: Optional[str] = None,
    +        recipient_team_id: Optional[str] = None,
    +        recipient_user_id: Optional[str] = None,
    +        thread_ts: Optional[str] = None,
    +    ):
    +        self.client = client
    +        self.channel = channel
    +        self.recipient_team_id = recipient_team_id
    +        self.recipient_user_id = recipient_user_id
    +        self.thread_ts = thread_ts
    +
    +    async def __call__(
    +        self,
    +        *,
    +        buffer_size: Optional[int] = None,
    +        channel: Optional[str] = None,
    +        recipient_team_id: Optional[str] = None,
    +        recipient_user_id: Optional[str] = None,
    +        thread_ts: Optional[str] = None,
    +        **kwargs,
    +    ) -> AsyncChatStream:
    +        """Starts a new chat stream with context."""
    +        channel = channel or self.channel
    +        thread_ts = thread_ts or self.thread_ts
    +        if channel is None:
    +            raise ValueError("say_stream without channel here is unsupported")
    +        if thread_ts is None:
    +            raise ValueError("say_stream without thread_ts here is unsupported")
    +
    +        if buffer_size is not None:
    +            return await self.client.chat_stream(
    +                buffer_size=buffer_size,
    +                channel=channel,
    +                recipient_team_id=recipient_team_id or self.recipient_team_id,
    +                recipient_user_id=recipient_user_id or self.recipient_user_id,
    +                thread_ts=thread_ts,
    +                **kwargs,
    +            )
    +        return await self.client.chat_stream(
    +            channel=channel,
    +            recipient_team_id=recipient_team_id or self.recipient_team_id,
    +            recipient_user_id=recipient_user_id or self.recipient_user_id,
    +            thread_ts=thread_ts,
    +            **kwargs,
    +        )
    +
    +
    +

    Class variables

    +
    +
    var channel : str | None
    +
    +

    The type of the None singleton.

    +
    +
    var client : slack_sdk.web.async_client.AsyncWebClient
    +
    +

    The type of the None singleton.

    +
    +
    var recipient_team_id : str | None
    +
    +

    The type of the None singleton.

    +
    +
    var recipient_user_id : str | None
    +
    +

    The type of the None singleton.

    +
    +
    var thread_ts : str | None
    +
    +

    The type of the None singleton.

    +
    +
    +
    class AsyncSetStatus (client: slack_sdk.web.async_client.AsyncWebClient,
    channel_id: str,
    thread_ts: str)
    @@ -5485,6 +5597,7 @@

    respond
  • save_thread_context
  • say
  • +
  • say_stream
  • set_status
  • set_suggested_prompts
  • set_title
  • @@ -5565,6 +5678,16 @@

    AsyncSayStream

    + + +
  • AsyncSetStatus

    • channel_id
    • diff --git a/docs/reference/authorization/authorize_result.html b/docs/reference/authorization/authorize_result.html index d53c5cd5c..6eac3724d 100644 --- a/docs/reference/authorization/authorize_result.html +++ b/docs/reference/authorization/authorize_result.html @@ -48,7 +48,7 @@

      Classes

      class AuthorizeResult -(*,
      enterprise_id: str | None,
      team_id: str | None,
      team: str | None = None,
      url: str | None = None,
      bot_user_id: str | None = None,
      bot_id: str | None = None,
      bot_token: str | None = None,
      bot_scopes: Sequence[str] | str | None = None,
      user_id: str | None = None,
      user: str | None = None,
      user_token: str | None = None,
      user_scopes: Sequence[str] | str | None = None)
      +(*,
      enterprise_id: str | None,
      team_id: str | None,
      team: str | None = None,
      url: str | None = None,
      bot_user_id: str | None = None,
      bot_id: str | None = None,
      bot_token: str | None = None,
      bot_scopes: str | Sequence[str] | None = None,
      user_id: str | None = None,
      user: str | None = None,
      user_token: str | None = None,
      user_scopes: str | Sequence[str] | None = None)
      @@ -246,7 +246,7 @@

      Class variables

      Static methods

      -def from_auth_test_response(*,
      bot_token: str | None = None,
      user_token: str | None = None,
      bot_scopes: Sequence[str] | str | None = None,
      user_scopes: Sequence[str] | str | None = None,
      auth_test_response: slack_sdk.web.slack_response.SlackResponse | AsyncSlackResponse,
      user_auth_test_response: slack_sdk.web.slack_response.SlackResponse | AsyncSlackResponse | None = None)
      +def from_auth_test_response(*,
      bot_token: str | None = None,
      user_token: str | None = None,
      bot_scopes: str | Sequence[str] | None = None,
      user_scopes: str | Sequence[str] | None = None,
      auth_test_response: slack_sdk.web.slack_response.SlackResponse | ForwardRef('AsyncSlackResponse'),
      user_auth_test_response: slack_sdk.web.slack_response.SlackResponse | ForwardRef('AsyncSlackResponse') | None = None)
      diff --git a/docs/reference/authorization/index.html b/docs/reference/authorization/index.html index 2fdd1f916..19de311df 100644 --- a/docs/reference/authorization/index.html +++ b/docs/reference/authorization/index.html @@ -75,7 +75,7 @@

      Classes

      class AuthorizeResult -(*,
      enterprise_id: str | None,
      team_id: str | None,
      team: str | None = None,
      url: str | None = None,
      bot_user_id: str | None = None,
      bot_id: str | None = None,
      bot_token: str | None = None,
      bot_scopes: Sequence[str] | str | None = None,
      user_id: str | None = None,
      user: str | None = None,
      user_token: str | None = None,
      user_scopes: Sequence[str] | str | None = None)
      +(*,
      enterprise_id: str | None,
      team_id: str | None,
      team: str | None = None,
      url: str | None = None,
      bot_user_id: str | None = None,
      bot_id: str | None = None,
      bot_token: str | None = None,
      bot_scopes: str | Sequence[str] | None = None,
      user_id: str | None = None,
      user: str | None = None,
      user_token: str | None = None,
      user_scopes: str | Sequence[str] | None = None)
      @@ -273,7 +273,7 @@

      Class variables

      Static methods

      -def from_auth_test_response(*,
      bot_token: str | None = None,
      user_token: str | None = None,
      bot_scopes: Sequence[str] | str | None = None,
      user_scopes: Sequence[str] | str | None = None,
      auth_test_response: slack_sdk.web.slack_response.SlackResponse | AsyncSlackResponse,
      user_auth_test_response: slack_sdk.web.slack_response.SlackResponse | AsyncSlackResponse | None = None)
      +def from_auth_test_response(*,
      bot_token: str | None = None,
      user_token: str | None = None,
      bot_scopes: str | Sequence[str] | None = None,
      user_scopes: str | Sequence[str] | None = None,
      auth_test_response: slack_sdk.web.slack_response.SlackResponse | ForwardRef('AsyncSlackResponse'),
      user_auth_test_response: slack_sdk.web.slack_response.SlackResponse | ForwardRef('AsyncSlackResponse') | None = None)
      diff --git a/docs/reference/context/assistant/assistant_utilities.html b/docs/reference/context/assistant/assistant_utilities.html index d446b3c02..40db52284 100644 --- a/docs/reference/context/assistant/assistant_utilities.html +++ b/docs/reference/context/assistant/assistant_utilities.html @@ -91,6 +91,13 @@

      Classes

      @property def set_status(self) -> SetStatus: + warnings.warn( + "AssistantUtilities.set_status is deprecated. " + "Use the set_status argument directly in your listener function " + "or access it via context.set_status instead.", + DeprecationWarning, + stacklevel=2, + ) return SetStatus(self.client, self.channel_id, self.thread_ts) @property @@ -205,6 +212,13 @@

      Instance variables

      @property
       def set_status(self) -> SetStatus:
      +    warnings.warn(
      +        "AssistantUtilities.set_status is deprecated. "
      +        "Use the set_status argument directly in your listener function "
      +        "or access it via context.set_status instead.",
      +        DeprecationWarning,
      +        stacklevel=2,
      +    )
           return SetStatus(self.client, self.channel_id, self.thread_ts)
      diff --git a/docs/reference/context/assistant/async_assistant_utilities.html b/docs/reference/context/assistant/async_assistant_utilities.html index fc3cbbe8b..fc77b80cb 100644 --- a/docs/reference/context/assistant/async_assistant_utilities.html +++ b/docs/reference/context/assistant/async_assistant_utilities.html @@ -91,6 +91,13 @@

      Classes

      @property def set_status(self) -> AsyncSetStatus: + warnings.warn( + "AsyncAssistantUtilities.set_status is deprecated. " + "Use the set_status argument directly in your listener function " + "or access it via context.set_status instead.", + DeprecationWarning, + stacklevel=2, + ) return AsyncSetStatus(self.client, self.channel_id, self.thread_ts) @property @@ -199,6 +206,13 @@

      Instance variables

      @property
       def set_status(self) -> AsyncSetStatus:
      +    warnings.warn(
      +        "AsyncAssistantUtilities.set_status is deprecated. "
      +        "Use the set_status argument directly in your listener function "
      +        "or access it via context.set_status instead.",
      +        DeprecationWarning,
      +        stacklevel=2,
      +    )
           return AsyncSetStatus(self.client, self.channel_id, self.thread_ts)
      diff --git a/docs/reference/context/assistant/thread_context_store/file/index.html b/docs/reference/context/assistant/thread_context_store/file/index.html index 4a5d944e1..cbb4e4db6 100644 --- a/docs/reference/context/assistant/thread_context_store/file/index.html +++ b/docs/reference/context/assistant/thread_context_store/file/index.html @@ -48,7 +48,7 @@

      Classes

      class FileAssistantThreadContextStore -(base_dir: str = '/Users/wbergamin/.bolt-app-assistant-thread-contexts') +(base_dir: str = '/Users/eden.zimbelman/.bolt-app-assistant-thread-contexts')
      diff --git a/docs/reference/context/async_context.html b/docs/reference/context/async_context.html index 9ce4ebd9e..8fc6d36bf 100644 --- a/docs/reference/context/async_context.html +++ b/docs/reference/context/async_context.html @@ -80,7 +80,7 @@

      Classes

      # The return type is intentionally string to avoid circular imports @property - def listener_runner(self) -> "AsyncioListenerRunner": # type: ignore[name-defined] + def listener_runner(self) -> "AsyncioListenerRunner": """The properly configured listener_runner that is available for middleware/listeners.""" return self["listener_runner"] @@ -149,7 +149,7 @@

      Classes

      Callable `say()` function """ if "say" not in self: - self["say"] = AsyncSay(client=self.client, channel=self.channel_id, thread_ts=self.thread_ts) + self["say"] = AsyncSay(client=self.client, channel=self.channel_id) return self["say"] @property @@ -242,6 +242,10 @@

      Classes

      def get_thread_context(self) -> Optional[AsyncGetThreadContext]: return self.get("get_thread_context") + @property + def say_stream(self) -> Optional[AsyncSayStream]: + return self.get("say_stream") + @property def save_thread_context(self) -> Optional[AsyncSaveThreadContext]: return self.get("save_thread_context")
      @@ -457,7 +461,7 @@

      Returns

      Expand source code
      @property
      -def listener_runner(self) -> "AsyncioListenerRunner":  # type: ignore[name-defined]
      +def listener_runner(self) -> "AsyncioListenerRunner":
           """The properly configured listener_runner that is available for middleware/listeners."""
           return self["listener_runner"]
      @@ -547,7 +551,7 @@

      Returns

      Callable `say()` function """ if "say" not in self: - self["say"] = AsyncSay(client=self.client, channel=self.channel_id, thread_ts=self.thread_ts) + self["say"] = AsyncSay(client=self.client, channel=self.channel_id) return self["say"]
  • say() function for this request.

    @@ -565,6 +569,18 @@

    Returns

    Returns

    Callable say() function

    +
    prop say_streamAsyncSayStream | None
    +
    +
    + +Expand source code + +
    @property
    +def say_stream(self) -> Optional[AsyncSayStream]:
    +    return self.get("say_stream")
    +
    +
    +
    prop set_statusAsyncSetStatus | None
    @@ -694,6 +710,7 @@

    respond
  • save_thread_context
  • say
  • +
  • say_stream
  • set_status
  • set_suggested_prompts
  • set_title
  • diff --git a/docs/reference/context/base_context.html b/docs/reference/context/base_context.html index 4a177f8dc..afe571163 100644 --- a/docs/reference/context/base_context.html +++ b/docs/reference/context/base_context.html @@ -89,6 +89,7 @@

    Classes

    "set_status", "set_title", "set_suggested_prompts", + "say_stream", ] # Note that these items are not copyable, so when you add new items to this list, # you must modify ThreadListenerRunner/AsyncioListenerRunner's _build_lazy_request method to pass the values. diff --git a/docs/reference/context/context.html b/docs/reference/context/context.html index 615432502..a7b531c20 100644 --- a/docs/reference/context/context.html +++ b/docs/reference/context/context.html @@ -81,7 +81,7 @@

    Classes

    # The return type is intentionally string to avoid circular imports @property - def listener_runner(self) -> "ThreadListenerRunner": # type: ignore[name-defined] + def listener_runner(self) -> "ThreadListenerRunner": """The properly configured listener_runner that is available for middleware/listeners.""" return self["listener_runner"] @@ -150,7 +150,7 @@

    Classes

    Callable `say()` function """ if "say" not in self: - self["say"] = Say(client=self.client, channel=self.channel_id, thread_ts=self.thread_ts) + self["say"] = Say(client=self.client, channel=self.channel_id) return self["say"] @property @@ -243,6 +243,10 @@

    Classes

    def get_thread_context(self) -> Optional[GetThreadContext]: return self.get("get_thread_context") + @property + def say_stream(self) -> Optional[SayStream]: + return self.get("say_stream") + @property def save_thread_context(self) -> Optional[SaveThreadContext]: return self.get("save_thread_context") @@ -458,7 +462,7 @@

    Returns

    Expand source code
    @property
    -def listener_runner(self) -> "ThreadListenerRunner":  # type: ignore[name-defined]
    +def listener_runner(self) -> "ThreadListenerRunner":
         """The properly configured listener_runner that is available for middleware/listeners."""
         return self["listener_runner"]
    @@ -548,7 +552,7 @@

    Returns

    Callable `say()` function """ if "say" not in self: - self["say"] = Say(client=self.client, channel=self.channel_id, thread_ts=self.thread_ts) + self["say"] = Say(client=self.client, channel=self.channel_id) return self["say"]

    say() function for this request.

    @@ -566,6 +570,18 @@

    Returns

    Returns

    Callable say() function

    +
    prop say_streamSayStream | None
    +
    +
    + +Expand source code + +
    @property
    +def say_stream(self) -> Optional[SayStream]:
    +    return self.get("say_stream")
    +
    +
    +
    prop set_statusSetStatus | None
    @@ -696,6 +712,7 @@

    respond
  • save_thread_context
  • say
  • +
  • say_stream
  • set_status
  • set_suggested_prompts
  • set_title
  • diff --git a/docs/reference/context/get_thread_context/async_get_thread_context.html b/docs/reference/context/get_thread_context/async_get_thread_context.html index 1c3fc4d6c..967581b50 100644 --- a/docs/reference/context/get_thread_context/async_get_thread_context.html +++ b/docs/reference/context/get_thread_context/async_get_thread_context.html @@ -82,14 +82,10 @@

    Classes

    if self.thread_context_loaded is True: return self._thread_context - if self.payload.get("assistant_thread") is not None: + thread = self.payload.get("assistant_thread") + if isinstance(thread, dict) and thread.get("context", {}).get("channel_id") is not None: # assistant_thread_started - thread = self.payload["assistant_thread"] - self._thread_context = ( - AssistantThreadContext(thread["context"]) - if thread.get("context", {}).get("channel_id") is not None - else None - ) + self._thread_context = AssistantThreadContext(thread["context"]) # for this event, the context will never be changed self.thread_context_loaded = True elif self.payload.get("channel") is not None and self.payload.get("thread_ts") is not None: diff --git a/docs/reference/context/get_thread_context/get_thread_context.html b/docs/reference/context/get_thread_context/get_thread_context.html index 4ac274368..cf2e17a86 100644 --- a/docs/reference/context/get_thread_context/get_thread_context.html +++ b/docs/reference/context/get_thread_context/get_thread_context.html @@ -82,14 +82,10 @@

    Classes

    if self.thread_context_loaded is True: return self._thread_context - if self.payload.get("assistant_thread") is not None: + thread = self.payload.get("assistant_thread") + if isinstance(thread, dict) and thread.get("context", {}).get("channel_id") is not None: # assistant_thread_started - thread = self.payload["assistant_thread"] - self._thread_context = ( - AssistantThreadContext(thread["context"]) - if thread.get("context", {}).get("channel_id") is not None - else None - ) + self._thread_context = AssistantThreadContext(thread["context"]) # for this event, the context will never be changed self.thread_context_loaded = True elif self.payload.get("channel") is not None and self.payload.get("thread_ts") is not None: diff --git a/docs/reference/context/get_thread_context/index.html b/docs/reference/context/get_thread_context/index.html index 13dcd1388..5f9e38e71 100644 --- a/docs/reference/context/get_thread_context/index.html +++ b/docs/reference/context/get_thread_context/index.html @@ -93,14 +93,10 @@

    Classes

    if self.thread_context_loaded is True: return self._thread_context - if self.payload.get("assistant_thread") is not None: + thread = self.payload.get("assistant_thread") + if isinstance(thread, dict) and thread.get("context", {}).get("channel_id") is not None: # assistant_thread_started - thread = self.payload["assistant_thread"] - self._thread_context = ( - AssistantThreadContext(thread["context"]) - if thread.get("context", {}).get("channel_id") is not None - else None - ) + self._thread_context = AssistantThreadContext(thread["context"]) # for this event, the context will never be changed self.thread_context_loaded = True elif self.payload.get("channel") is not None and self.payload.get("thread_ts") is not None: diff --git a/docs/reference/context/index.html b/docs/reference/context/index.html index c761aa47e..ebdfe8aa8 100644 --- a/docs/reference/context/index.html +++ b/docs/reference/context/index.html @@ -89,6 +89,10 @@

    Sub-modules

    +
    slack_bolt.context.say_stream
    +
    +
    +
    slack_bolt.context.set_status
    @@ -145,7 +149,7 @@

    Classes

    # The return type is intentionally string to avoid circular imports @property - def listener_runner(self) -> "ThreadListenerRunner": # type: ignore[name-defined] + def listener_runner(self) -> "ThreadListenerRunner": """The properly configured listener_runner that is available for middleware/listeners.""" return self["listener_runner"] @@ -214,7 +218,7 @@

    Classes

    Callable `say()` function """ if "say" not in self: - self["say"] = Say(client=self.client, channel=self.channel_id, thread_ts=self.thread_ts) + self["say"] = Say(client=self.client, channel=self.channel_id) return self["say"] @property @@ -307,6 +311,10 @@

    Classes

    def get_thread_context(self) -> Optional[GetThreadContext]: return self.get("get_thread_context") + @property + def say_stream(self) -> Optional[SayStream]: + return self.get("say_stream") + @property def save_thread_context(self) -> Optional[SaveThreadContext]: return self.get("save_thread_context") @@ -522,7 +530,7 @@

    Returns

    Expand source code
    @property
    -def listener_runner(self) -> "ThreadListenerRunner":  # type: ignore[name-defined]
    +def listener_runner(self) -> "ThreadListenerRunner":
         """The properly configured listener_runner that is available for middleware/listeners."""
         return self["listener_runner"]
    @@ -612,7 +620,7 @@

    Returns

    Callable `say()` function """ if "say" not in self: - self["say"] = Say(client=self.client, channel=self.channel_id, thread_ts=self.thread_ts) + self["say"] = Say(client=self.client, channel=self.channel_id) return self["say"]

    slack_bolt.context.say function for this request.

    @@ -630,6 +638,18 @@

    Returns

    Returns

    Callable slack_bolt.context.say function

    +
    prop say_streamSayStream | None
    +
    +
    + +Expand source code + +
    @property
    +def say_stream(self) -> Optional[SayStream]:
    +    return self.get("say_stream")
    +
    +
    +
    prop set_statusSetStatus | None
    @@ -759,6 +779,7 @@

    Inherited members

  • slack_bolt.context.respond
  • slack_bolt.context.save_thread_context
  • slack_bolt.context.say
  • +
  • slack_bolt.context.say_stream
  • slack_bolt.context.set_status
  • slack_bolt.context.set_suggested_prompts
  • slack_bolt.context.set_title
  • @@ -778,6 +799,7 @@

    respond
  • save_thread_context
  • say
  • +
  • say_stream
  • set_status
  • set_suggested_prompts
  • set_title
  • diff --git a/docs/reference/context/say_stream/async_say_stream.html b/docs/reference/context/say_stream/async_say_stream.html new file mode 100644 index 000000000..4010b284d --- /dev/null +++ b/docs/reference/context/say_stream/async_say_stream.html @@ -0,0 +1,174 @@ + + + + + + +slack_bolt.context.say_stream.async_say_stream API documentation + + + + + + + + + + + +
    +
    +
    +

    Module slack_bolt.context.say_stream.async_say_stream

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Classes

    +
    +
    +class AsyncSayStream +(*,
    client: slack_sdk.web.async_client.AsyncWebClient,
    channel: str | None = None,
    recipient_team_id: str | None = None,
    recipient_user_id: str | None = None,
    thread_ts: str | None = None)
    +
    +
    +
    + +Expand source code + +
    class AsyncSayStream:
    +    client: AsyncWebClient
    +    channel: Optional[str]
    +    recipient_team_id: Optional[str]
    +    recipient_user_id: Optional[str]
    +    thread_ts: Optional[str]
    +
    +    def __init__(
    +        self,
    +        *,
    +        client: AsyncWebClient,
    +        channel: Optional[str] = None,
    +        recipient_team_id: Optional[str] = None,
    +        recipient_user_id: Optional[str] = None,
    +        thread_ts: Optional[str] = None,
    +    ):
    +        self.client = client
    +        self.channel = channel
    +        self.recipient_team_id = recipient_team_id
    +        self.recipient_user_id = recipient_user_id
    +        self.thread_ts = thread_ts
    +
    +    async def __call__(
    +        self,
    +        *,
    +        buffer_size: Optional[int] = None,
    +        channel: Optional[str] = None,
    +        recipient_team_id: Optional[str] = None,
    +        recipient_user_id: Optional[str] = None,
    +        thread_ts: Optional[str] = None,
    +        **kwargs,
    +    ) -> AsyncChatStream:
    +        """Starts a new chat stream with context."""
    +        channel = channel or self.channel
    +        thread_ts = thread_ts or self.thread_ts
    +        if channel is None:
    +            raise ValueError("say_stream without channel here is unsupported")
    +        if thread_ts is None:
    +            raise ValueError("say_stream without thread_ts here is unsupported")
    +
    +        if buffer_size is not None:
    +            return await self.client.chat_stream(
    +                buffer_size=buffer_size,
    +                channel=channel,
    +                recipient_team_id=recipient_team_id or self.recipient_team_id,
    +                recipient_user_id=recipient_user_id or self.recipient_user_id,
    +                thread_ts=thread_ts,
    +                **kwargs,
    +            )
    +        return await self.client.chat_stream(
    +            channel=channel,
    +            recipient_team_id=recipient_team_id or self.recipient_team_id,
    +            recipient_user_id=recipient_user_id or self.recipient_user_id,
    +            thread_ts=thread_ts,
    +            **kwargs,
    +        )
    +
    +
    +

    Class variables

    +
    +
    var channel : str | None
    +
    +

    The type of the None singleton.

    +
    +
    var client : slack_sdk.web.async_client.AsyncWebClient
    +
    +

    The type of the None singleton.

    +
    +
    var recipient_team_id : str | None
    +
    +

    The type of the None singleton.

    +
    +
    var recipient_user_id : str | None
    +
    +

    The type of the None singleton.

    +
    +
    var thread_ts : str | None
    +
    +

    The type of the None singleton.

    +
    +
    +
    +
    +
    +
    + +
    + + + diff --git a/docs/reference/context/say_stream/index.html b/docs/reference/context/say_stream/index.html new file mode 100644 index 000000000..645942c72 --- /dev/null +++ b/docs/reference/context/say_stream/index.html @@ -0,0 +1,191 @@ + + + + + + +slack_bolt.context.say_stream API documentation + + + + + + + + + + + +
    +
    +
    +

    Module slack_bolt.context.say_stream

    +
    +
    +
    +
    +

    Sub-modules

    +
    +
    slack_bolt.context.say_stream.async_say_stream
    +
    +
    +
    +
    slack_bolt.context.say_stream.say_stream
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Classes

    +
    +
    +class SayStream +(*,
    client: slack_sdk.web.client.WebClient,
    channel: str | None = None,
    recipient_team_id: str | None = None,
    recipient_user_id: str | None = None,
    thread_ts: str | None = None)
    +
    +
    +
    + +Expand source code + +
    class SayStream:
    +    client: WebClient
    +    channel: Optional[str]
    +    recipient_team_id: Optional[str]
    +    recipient_user_id: Optional[str]
    +    thread_ts: Optional[str]
    +
    +    def __init__(
    +        self,
    +        *,
    +        client: WebClient,
    +        channel: Optional[str] = None,
    +        recipient_team_id: Optional[str] = None,
    +        recipient_user_id: Optional[str] = None,
    +        thread_ts: Optional[str] = None,
    +    ):
    +        self.client = client
    +        self.channel = channel
    +        self.recipient_team_id = recipient_team_id
    +        self.recipient_user_id = recipient_user_id
    +        self.thread_ts = thread_ts
    +
    +    def __call__(
    +        self,
    +        *,
    +        buffer_size: Optional[int] = None,
    +        channel: Optional[str] = None,
    +        recipient_team_id: Optional[str] = None,
    +        recipient_user_id: Optional[str] = None,
    +        thread_ts: Optional[str] = None,
    +        **kwargs,
    +    ) -> ChatStream:
    +        """Starts a new chat stream with context."""
    +        channel = channel or self.channel
    +        thread_ts = thread_ts or self.thread_ts
    +        if channel is None:
    +            raise ValueError("say_stream without channel here is unsupported")
    +        if thread_ts is None:
    +            raise ValueError("say_stream without thread_ts here is unsupported")
    +
    +        if buffer_size is not None:
    +            return self.client.chat_stream(
    +                buffer_size=buffer_size,
    +                channel=channel,
    +                recipient_team_id=recipient_team_id or self.recipient_team_id,
    +                recipient_user_id=recipient_user_id or self.recipient_user_id,
    +                thread_ts=thread_ts,
    +                **kwargs,
    +            )
    +        return self.client.chat_stream(
    +            channel=channel,
    +            recipient_team_id=recipient_team_id or self.recipient_team_id,
    +            recipient_user_id=recipient_user_id or self.recipient_user_id,
    +            thread_ts=thread_ts,
    +            **kwargs,
    +        )
    +
    +
    +

    Class variables

    +
    +
    var channel : str | None
    +
    +

    The type of the None singleton.

    +
    +
    var client : slack_sdk.web.client.WebClient
    +
    +

    The type of the None singleton.

    +
    +
    var recipient_team_id : str | None
    +
    +

    The type of the None singleton.

    +
    +
    var recipient_user_id : str | None
    +
    +

    The type of the None singleton.

    +
    +
    var thread_ts : str | None
    +
    +

    The type of the None singleton.

    +
    +
    +
    +
    +
    +
    + +
    + + + diff --git a/docs/reference/context/say_stream/say_stream.html b/docs/reference/context/say_stream/say_stream.html new file mode 100644 index 000000000..784a58bbe --- /dev/null +++ b/docs/reference/context/say_stream/say_stream.html @@ -0,0 +1,174 @@ + + + + + + +slack_bolt.context.say_stream.say_stream API documentation + + + + + + + + + + + +
    +
    +
    +

    Module slack_bolt.context.say_stream.say_stream

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Classes

    +
    +
    +class SayStream +(*,
    client: slack_sdk.web.client.WebClient,
    channel: str | None = None,
    recipient_team_id: str | None = None,
    recipient_user_id: str | None = None,
    thread_ts: str | None = None)
    +
    +
    +
    + +Expand source code + +
    class SayStream:
    +    client: WebClient
    +    channel: Optional[str]
    +    recipient_team_id: Optional[str]
    +    recipient_user_id: Optional[str]
    +    thread_ts: Optional[str]
    +
    +    def __init__(
    +        self,
    +        *,
    +        client: WebClient,
    +        channel: Optional[str] = None,
    +        recipient_team_id: Optional[str] = None,
    +        recipient_user_id: Optional[str] = None,
    +        thread_ts: Optional[str] = None,
    +    ):
    +        self.client = client
    +        self.channel = channel
    +        self.recipient_team_id = recipient_team_id
    +        self.recipient_user_id = recipient_user_id
    +        self.thread_ts = thread_ts
    +
    +    def __call__(
    +        self,
    +        *,
    +        buffer_size: Optional[int] = None,
    +        channel: Optional[str] = None,
    +        recipient_team_id: Optional[str] = None,
    +        recipient_user_id: Optional[str] = None,
    +        thread_ts: Optional[str] = None,
    +        **kwargs,
    +    ) -> ChatStream:
    +        """Starts a new chat stream with context."""
    +        channel = channel or self.channel
    +        thread_ts = thread_ts or self.thread_ts
    +        if channel is None:
    +            raise ValueError("say_stream without channel here is unsupported")
    +        if thread_ts is None:
    +            raise ValueError("say_stream without thread_ts here is unsupported")
    +
    +        if buffer_size is not None:
    +            return self.client.chat_stream(
    +                buffer_size=buffer_size,
    +                channel=channel,
    +                recipient_team_id=recipient_team_id or self.recipient_team_id,
    +                recipient_user_id=recipient_user_id or self.recipient_user_id,
    +                thread_ts=thread_ts,
    +                **kwargs,
    +            )
    +        return self.client.chat_stream(
    +            channel=channel,
    +            recipient_team_id=recipient_team_id or self.recipient_team_id,
    +            recipient_user_id=recipient_user_id or self.recipient_user_id,
    +            thread_ts=thread_ts,
    +            **kwargs,
    +        )
    +
    +
    +

    Class variables

    +
    +
    var channel : str | None
    +
    +

    The type of the None singleton.

    +
    +
    var client : slack_sdk.web.client.WebClient
    +
    +

    The type of the None singleton.

    +
    +
    var recipient_team_id : str | None
    +
    +

    The type of the None singleton.

    +
    +
    var recipient_user_id : str | None
    +
    +

    The type of the None singleton.

    +
    +
    var thread_ts : str | None
    +
    +

    The type of the None singleton.

    +
    +
    +
    +
    +
    +
    + +
    + + + diff --git a/docs/reference/error/index.html b/docs/reference/error/index.html index 9a9998e63..f57d690e9 100644 --- a/docs/reference/error/index.html +++ b/docs/reference/error/index.html @@ -72,7 +72,7 @@

    Subclasses

    class BoltUnhandledRequestError -(*,
    request: BoltRequest | AsyncBoltRequest,
    current_response: BoltResponse | None,
    last_global_middleware_name: str | None = None)
    +(*,
    request: ForwardRef('BoltRequest') | ForwardRef('AsyncBoltRequest'),
    current_response: ForwardRef('BoltResponse') | None,
    last_global_middleware_name: str | None = None)
    diff --git a/docs/reference/index.html b/docs/reference/index.html index 1c02a8aeb..b2d19719d 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -188,7 +188,7 @@

    Class variables

    class App -(*,
    logger: logging.Logger | None = None,
    name: str | None = None,
    process_before_response: bool = False,
    raise_error_for_unhandled_request: bool = False,
    signing_secret: str | None = None,
    token: str | None = None,
    token_verification_enabled: bool = True,
    client: slack_sdk.web.client.WebClient | None = None,
    before_authorize: Middleware | Callable[..., Any] | None = None,
    authorize: Callable[..., AuthorizeResult] | None = None,
    user_facing_authorize_error_message: str | None = None,
    installation_store: slack_sdk.oauth.installation_store.installation_store.InstallationStore | None = None,
    installation_store_bot_only: bool | None = None,
    request_verification_enabled: bool = True,
    ignoring_self_events_enabled: bool = True,
    ignoring_self_assistant_message_events_enabled: bool = True,
    ssl_check_enabled: bool = True,
    url_verification_enabled: bool = True,
    attaching_function_token_enabled: bool = True,
    oauth_settings: OAuthSettings | None = None,
    oauth_flow: OAuthFlow | None = None,
    verification_token: str | None = None,
    listener_executor: concurrent.futures._base.Executor | None = None,
    assistant_thread_context_store: AssistantThreadContextStore | None = None)
    +(*,
    logger: logging.Logger | None = None,
    name: str | None = None,
    process_before_response: bool = False,
    raise_error_for_unhandled_request: bool = False,
    signing_secret: str | None = None,
    token: str | None = None,
    token_verification_enabled: bool = True,
    client: slack_sdk.web.client.WebClient | None = None,
    before_authorize: Middleware | Callable[..., Any] | None = None,
    authorize: Callable[..., AuthorizeResult] | None = None,
    user_facing_authorize_error_message: str | None = None,
    installation_store: slack_sdk.oauth.installation_store.installation_store.InstallationStore | None = None,
    installation_store_bot_only: bool | None = None,
    request_verification_enabled: bool = True,
    ignoring_self_events_enabled: bool = True,
    ignoring_self_assistant_message_events_enabled: bool = True,
    ssl_check_enabled: bool = True,
    url_verification_enabled: bool = True,
    attaching_function_token_enabled: bool = True,
    oauth_settings: OAuthSettings | None = None,
    oauth_flow: OAuthFlow | None = None,
    verification_token: str | None = None,
    listener_executor: concurrent.futures._base.Executor | None = None,
    assistant_thread_context_store: AssistantThreadContextStore | None = None,
    attaching_conversation_kwargs_enabled: bool = True)
    @@ -235,6 +235,7 @@

    Class variables

    listener_executor: Optional[Executor] = None, # for AI Agents & Assistants assistant_thread_context_store: Optional[AssistantThreadContextStore] = None, + attaching_conversation_kwargs_enabled: bool = True, ): """Bolt App that provides functionalities to register middleware/listeners. @@ -455,6 +456,7 @@

    Class variables

    listener_executor = ThreadPoolExecutor(max_workers=5) self._assistant_thread_context_store = assistant_thread_context_store + self._attaching_conversation_kwargs_enabled = attaching_conversation_kwargs_enabled self._process_before_response = process_before_response self._listener_runner = ThreadListenerRunner( @@ -939,10 +941,13 @@

    Class variables

    middleware: A list of lister middleware functions. Only when all the middleware call `next()` method, the listener function can be invoked. """ + middleware = list(middleware) if middleware else [] def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.event(event, base_logger=self._base_logger) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AttachingConversationKwargs(self._assistant_thread_context_store)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) return __call__ @@ -1000,6 +1005,8 @@

    Class variables

    primary_matcher = builtin_matchers.message_event( keyword=keyword, constraints=constraints, base_logger=self._base_logger ) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AttachingConversationKwargs(self._assistant_thread_context_store)) middleware.insert(0, MessageListenerMatches(keyword)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) @@ -1496,20 +1503,6 @@

    Class variables

    # It is intended for apps that start lazy listeners from their custom global middleware. req.context["listener_runner"] = self.listener_runner - # For AI Agents & Assistants - if is_assistant_event(req.body): - assistant = AssistantUtilities( - payload=to_event(req.body), # type:ignore[arg-type] - context=req.context, - thread_context_store=self._assistant_thread_context_store, - ) - req.context["say"] = assistant.say - req.context["set_status"] = assistant.set_status - req.context["set_title"] = assistant.set_title - req.context["set_suggested_prompts"] = assistant.set_suggested_prompts - req.context["get_thread_context"] = assistant.get_thread_context - req.context["save_thread_context"] = assistant.save_thread_context - @staticmethod def _to_listener_functions( kwargs: dict, @@ -1555,7 +1548,7 @@

    Class variables

    CustomListener( app_name=self.name, ack_function=functions.pop(0), - lazy_functions=functions, # type:ignore[arg-type] + lazy_functions=functions, # type: ignore[arg-type] matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, @@ -2343,10 +2336,13 @@

    Args

    middleware: A list of lister middleware functions. Only when all the middleware call `next()` method, the listener function can be invoked. """ + middleware = list(middleware) if middleware else [] def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.event(event, base_logger=self._base_logger) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AttachingConversationKwargs(self._assistant_thread_context_store)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) return __call__ @@ -2550,6 +2546,8 @@

    Args

    primary_matcher = builtin_matchers.message_event( keyword=keyword, constraints=constraints, base_logger=self._base_logger ) + if self._attaching_conversation_kwargs_enabled: + middleware.insert(0, AttachingConversationKwargs(self._assistant_thread_context_store)) middleware.insert(0, MessageListenerMatches(keyword)) return self._register_listener(list(functions), primary_matcher, matchers, middleware, True) @@ -3179,7 +3177,7 @@

    Args

    class Args -(*,
    logger: logging.Logger,
    client: slack_sdk.web.client.WebClient,
    req: BoltRequest,
    resp: BoltResponse,
    context: BoltContext,
    body: Dict[str, Any],
    payload: Dict[str, Any],
    options: Dict[str, Any] | None = None,
    shortcut: Dict[str, Any] | None = None,
    action: Dict[str, Any] | None = None,
    view: Dict[str, Any] | None = None,
    command: Dict[str, Any] | None = None,
    event: Dict[str, Any] | None = None,
    message: Dict[str, Any] | None = None,
    ack: Ack,
    say: Say,
    respond: Respond,
    complete: Complete,
    fail: Fail,
    set_status: SetStatus | None = None,
    set_title: SetTitle | None = None,
    set_suggested_prompts: SetSuggestedPrompts | None = None,
    get_thread_context: GetThreadContext | None = None,
    save_thread_context: SaveThreadContext | None = None,
    next: Callable[[], None],
    **kwargs)
    +(*,
    logger: logging.Logger,
    client: slack_sdk.web.client.WebClient,
    req: BoltRequest,
    resp: BoltResponse,
    context: BoltContext,
    body: Dict[str, Any],
    payload: Dict[str, Any],
    options: Dict[str, Any] | None = None,
    shortcut: Dict[str, Any] | None = None,
    action: Dict[str, Any] | None = None,
    view: Dict[str, Any] | None = None,
    command: Dict[str, Any] | None = None,
    event: Dict[str, Any] | None = None,
    message: Dict[str, Any] | None = None,
    ack: Ack,
    say: Say,
    respond: Respond,
    complete: Complete,
    fail: Fail,
    set_status: SetStatus | None = None,
    set_title: SetTitle | None = None,
    set_suggested_prompts: SetSuggestedPrompts | None = None,
    get_thread_context: GetThreadContext | None = None,
    save_thread_context: SaveThreadContext | None = None,
    say_stream: SayStream | None = None,
    next: Callable[[], None],
    **kwargs)
    @@ -3270,6 +3268,8 @@

    Args

    """`get_thread_context()` utility function for AI Agents & Assistants""" save_thread_context: Optional[SaveThreadContext] """`save_thread_context()` utility function for AI Agents & Assistants""" + say_stream: Optional[SayStream] + """`say_stream()` utility function for conversations, AI Agents & Assistants""" # middleware next: Callable[[], None] """`next()` utility function, which tells the middleware chain that it can continue with the next one""" @@ -3303,6 +3303,7 @@

    Args

    set_suggested_prompts: Optional[SetSuggestedPrompts] = None, get_thread_context: Optional[GetThreadContext] = None, save_thread_context: Optional[SaveThreadContext] = None, + say_stream: Optional[SayStream] = None, # As this method is not supposed to be invoked by bolt-python users, # the naming conflict with the built-in one affects # only the internals of this method @@ -3336,6 +3337,7 @@

    Args

    self.set_suggested_prompts = set_suggested_prompts self.get_thread_context = get_thread_context self.save_thread_context = save_thread_context + self.say_stream = say_stream self.next: Callable[[], None] = next self.next_: Callable[[], None] = next @@ -3459,6 +3461,10 @@

    Class variables

    say() utility function, which calls chat.postMessage API with the associated channel ID

    +
    var say_streamSayStream | None
    +
    +

    say_stream() utility function for conversations, AI Agents & Assistants

    +
    var set_statusSetStatus | None

    set_status() utility function for AI Agents & Assistants

    @@ -3531,7 +3537,7 @@

    Class variables

    self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -3570,7 +3576,7 @@

    Class variables

    self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -3609,7 +3615,7 @@

    Class variables

    self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -3648,7 +3654,7 @@

    Class variables

    self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -3678,13 +3684,13 @@

    Class variables

    ): return [CustomListenerMatcher(app_name=self.app_name, func=primary_matcher)] + ( custom_matchers or [] - ) # type:ignore[operator] + ) # type: ignore[operator] @staticmethod def default_thread_context_changed(save_thread_context: SaveThreadContext, payload: dict): save_thread_context(payload["assistant_thread"]["context"]) - def process( # type:ignore[return] + def process( # type: ignore[return] self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse] ) -> Optional[BoltResponse]: if self._thread_context_changed_listeners is None: @@ -3700,6 +3706,15 @@

    Class variables

    if listeners is not None: for listener in listeners: if listener.matches(req=req, resp=resp): + middleware_resp, next_was_not_called = listener.run_middleware(req=req, resp=resp) + if next_was_not_called: + if middleware_resp is not None: + return middleware_resp + # The listener middleware didn't call next(). + # Skip this listener and try the next one. + continue + if middleware_resp is not None: + resp = middleware_resp return listener_runner.run( request=req, response=resp, @@ -3719,13 +3734,14 @@

    Class variables

    middleware: Optional[List[Middleware]] = None, base_logger: Optional[Logger] = None, ) -> Listener: - if isinstance(listener_or_functions, Callable): # type:ignore[arg-type] - listener_or_functions = [listener_or_functions] # type:ignore[list-item] + if isinstance(listener_or_functions, Callable): # type: ignore[arg-type] + listener_or_functions = [listener_or_functions] # type: ignore[list-item] if isinstance(listener_or_functions, Listener): return listener_or_functions elif isinstance(listener_or_functions, list): middleware = middleware if middleware else [] + middleware.insert(0, AttachingConversationKwargs(self.thread_context_store)) functions = listener_or_functions ack_function = functions.pop(0) @@ -3734,7 +3750,7 @@

    Class variables

    for matcher in matchers: if isinstance(matcher, ListenerMatcher): listener_matchers.append(matcher) - elif isinstance(matcher, Callable): # type:ignore[arg-type] + elif isinstance(matcher, Callable): # type: ignore[arg-type] listener_matchers.append( build_listener_matcher( func=matcher, @@ -3813,7 +3829,7 @@

    Methods

    self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -3853,13 +3869,14 @@

    Methods

    middleware: Optional[List[Middleware]] = None, base_logger: Optional[Logger] = None, ) -> Listener: - if isinstance(listener_or_functions, Callable): # type:ignore[arg-type] - listener_or_functions = [listener_or_functions] # type:ignore[list-item] + if isinstance(listener_or_functions, Callable): # type: ignore[arg-type] + listener_or_functions = [listener_or_functions] # type: ignore[list-item] if isinstance(listener_or_functions, Listener): return listener_or_functions elif isinstance(listener_or_functions, list): middleware = middleware if middleware else [] + middleware.insert(0, AttachingConversationKwargs(self.thread_context_store)) functions = listener_or_functions ack_function = functions.pop(0) @@ -3868,7 +3885,7 @@

    Methods

    for matcher in matchers: if isinstance(matcher, ListenerMatcher): listener_matchers.append(matcher) - elif isinstance(matcher, Callable): # type:ignore[arg-type] + elif isinstance(matcher, Callable): # type: ignore[arg-type] listener_matchers.append( build_listener_matcher( func=matcher, @@ -3914,7 +3931,7 @@

    Methods

    self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -3963,7 +3980,7 @@

    Methods

    self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -4012,7 +4029,7 @@

    Methods

    self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -4185,7 +4202,7 @@

    Methods

    # The return type is intentionally string to avoid circular imports @property - def listener_runner(self) -> "ThreadListenerRunner": # type: ignore[name-defined] + def listener_runner(self) -> "ThreadListenerRunner": """The properly configured listener_runner that is available for middleware/listeners.""" return self["listener_runner"] @@ -4254,7 +4271,7 @@

    Methods

    Callable `say()` function """ if "say" not in self: - self["say"] = Say(client=self.client, channel=self.channel_id, thread_ts=self.thread_ts) + self["say"] = Say(client=self.client, channel=self.channel_id) return self["say"] @property @@ -4347,6 +4364,10 @@

    Methods

    def get_thread_context(self) -> Optional[GetThreadContext]: return self.get("get_thread_context") + @property + def say_stream(self) -> Optional[SayStream]: + return self.get("say_stream") + @property def save_thread_context(self) -> Optional[SaveThreadContext]: return self.get("save_thread_context") @@ -4562,7 +4583,7 @@

    Returns

    Expand source code
    @property
    -def listener_runner(self) -> "ThreadListenerRunner":  # type: ignore[name-defined]
    +def listener_runner(self) -> "ThreadListenerRunner":
         """The properly configured listener_runner that is available for middleware/listeners."""
         return self["listener_runner"]
    @@ -4652,7 +4673,7 @@

    Returns

    Callable `say()` function """ if "say" not in self: - self["say"] = Say(client=self.client, channel=self.channel_id, thread_ts=self.thread_ts) + self["say"] = Say(client=self.client, channel=self.channel_id) return self["say"]

    say() function for this request.

    @@ -4670,6 +4691,18 @@

    Returns

    Returns

    Callable say() function

    +
    prop say_streamSayStream | None
    +
    +
    + +Expand source code + +
    @property
    +def say_stream(self) -> Optional[SayStream]:
    +    return self.get("say_stream")
    +
    +
    +
    prop set_statusSetStatus | None
    @@ -5304,7 +5337,7 @@

    Returns

    class FileAssistantThreadContextStore -(base_dir: str = '/Users/wbergamin/.bolt-app-assistant-thread-contexts') +(base_dir: str = '/Users/eden.zimbelman/.bolt-app-assistant-thread-contexts')
    @@ -5843,6 +5876,97 @@

    Class variables

    +
    +class SayStream +(*,
    client: slack_sdk.web.client.WebClient,
    channel: str | None = None,
    recipient_team_id: str | None = None,
    recipient_user_id: str | None = None,
    thread_ts: str | None = None)
    +
    +
    +
    + +Expand source code + +
    class SayStream:
    +    client: WebClient
    +    channel: Optional[str]
    +    recipient_team_id: Optional[str]
    +    recipient_user_id: Optional[str]
    +    thread_ts: Optional[str]
    +
    +    def __init__(
    +        self,
    +        *,
    +        client: WebClient,
    +        channel: Optional[str] = None,
    +        recipient_team_id: Optional[str] = None,
    +        recipient_user_id: Optional[str] = None,
    +        thread_ts: Optional[str] = None,
    +    ):
    +        self.client = client
    +        self.channel = channel
    +        self.recipient_team_id = recipient_team_id
    +        self.recipient_user_id = recipient_user_id
    +        self.thread_ts = thread_ts
    +
    +    def __call__(
    +        self,
    +        *,
    +        buffer_size: Optional[int] = None,
    +        channel: Optional[str] = None,
    +        recipient_team_id: Optional[str] = None,
    +        recipient_user_id: Optional[str] = None,
    +        thread_ts: Optional[str] = None,
    +        **kwargs,
    +    ) -> ChatStream:
    +        """Starts a new chat stream with context."""
    +        channel = channel or self.channel
    +        thread_ts = thread_ts or self.thread_ts
    +        if channel is None:
    +            raise ValueError("say_stream without channel here is unsupported")
    +        if thread_ts is None:
    +            raise ValueError("say_stream without thread_ts here is unsupported")
    +
    +        if buffer_size is not None:
    +            return self.client.chat_stream(
    +                buffer_size=buffer_size,
    +                channel=channel,
    +                recipient_team_id=recipient_team_id or self.recipient_team_id,
    +                recipient_user_id=recipient_user_id or self.recipient_user_id,
    +                thread_ts=thread_ts,
    +                **kwargs,
    +            )
    +        return self.client.chat_stream(
    +            channel=channel,
    +            recipient_team_id=recipient_team_id or self.recipient_team_id,
    +            recipient_user_id=recipient_user_id or self.recipient_user_id,
    +            thread_ts=thread_ts,
    +            **kwargs,
    +        )
    +
    +
    +

    Class variables

    +
    +
    var channel : str | None
    +
    +

    The type of the None singleton.

    +
    +
    var client : slack_sdk.web.client.WebClient
    +
    +

    The type of the None singleton.

    +
    +
    var recipient_team_id : str | None
    +
    +

    The type of the None singleton.

    +
    +
    var recipient_user_id : str | None
    +
    +

    The type of the None singleton.

    +
    +
    var thread_ts : str | None
    +
    +

    The type of the None singleton.

    +
    +
    +
    class SetStatus (client: slack_sdk.web.client.WebClient, channel_id: str, thread_ts: str) @@ -6110,6 +6234,7 @@

    Args

    response
  • save_thread_context
  • say
  • +
  • say_stream
  • set_status
  • set_suggested_prompts
  • set_title
  • @@ -6157,6 +6282,7 @@

    BoltC
  • respond
  • save_thread_context
  • say
  • +
  • say_stream
  • set_status
  • set_suggested_prompts
  • set_title
  • @@ -6262,6 +6388,16 @@

    Say

  • +

    SayStream

    + +
  • +
  • SetStatus

    • channel_id
    • diff --git a/docs/reference/kwargs_injection/args.html b/docs/reference/kwargs_injection/args.html index 4d03687d1..bbba71eb8 100644 --- a/docs/reference/kwargs_injection/args.html +++ b/docs/reference/kwargs_injection/args.html @@ -48,7 +48,7 @@

      Classes

      class Args -(*,
      logger: logging.Logger,
      client: slack_sdk.web.client.WebClient,
      req: BoltRequest,
      resp: BoltResponse,
      context: BoltContext,
      body: Dict[str, Any],
      payload: Dict[str, Any],
      options: Dict[str, Any] | None = None,
      shortcut: Dict[str, Any] | None = None,
      action: Dict[str, Any] | None = None,
      view: Dict[str, Any] | None = None,
      command: Dict[str, Any] | None = None,
      event: Dict[str, Any] | None = None,
      message: Dict[str, Any] | None = None,
      ack: Ack,
      say: Say,
      respond: Respond,
      complete: Complete,
      fail: Fail,
      set_status: SetStatus | None = None,
      set_title: SetTitle | None = None,
      set_suggested_prompts: SetSuggestedPrompts | None = None,
      get_thread_context: GetThreadContext | None = None,
      save_thread_context: SaveThreadContext | None = None,
      next: Callable[[], None],
      **kwargs)
      +(*,
      logger: logging.Logger,
      client: slack_sdk.web.client.WebClient,
      req: BoltRequest,
      resp: BoltResponse,
      context: BoltContext,
      body: Dict[str, Any],
      payload: Dict[str, Any],
      options: Dict[str, Any] | None = None,
      shortcut: Dict[str, Any] | None = None,
      action: Dict[str, Any] | None = None,
      view: Dict[str, Any] | None = None,
      command: Dict[str, Any] | None = None,
      event: Dict[str, Any] | None = None,
      message: Dict[str, Any] | None = None,
      ack: Ack,
      say: Say,
      respond: Respond,
      complete: Complete,
      fail: Fail,
      set_status: SetStatus | None = None,
      set_title: SetTitle | None = None,
      set_suggested_prompts: SetSuggestedPrompts | None = None,
      get_thread_context: GetThreadContext | None = None,
      save_thread_context: SaveThreadContext | None = None,
      say_stream: SayStream | None = None,
      next: Callable[[], None],
      **kwargs)
      @@ -139,6 +139,8 @@

      Classes

      """`get_thread_context()` utility function for AI Agents & Assistants""" save_thread_context: Optional[SaveThreadContext] """`save_thread_context()` utility function for AI Agents & Assistants""" + say_stream: Optional[SayStream] + """`say_stream()` utility function for conversations, AI Agents & Assistants""" # middleware next: Callable[[], None] """`next()` utility function, which tells the middleware chain that it can continue with the next one""" @@ -172,6 +174,7 @@

      Classes

      set_suggested_prompts: Optional[SetSuggestedPrompts] = None, get_thread_context: Optional[GetThreadContext] = None, save_thread_context: Optional[SaveThreadContext] = None, + say_stream: Optional[SayStream] = None, # As this method is not supposed to be invoked by bolt-python users, # the naming conflict with the built-in one affects # only the internals of this method @@ -205,6 +208,7 @@

      Classes

      self.set_suggested_prompts = set_suggested_prompts self.get_thread_context = get_thread_context self.save_thread_context = save_thread_context + self.say_stream = say_stream self.next: Callable[[], None] = next self.next_: Callable[[], None] = next
      @@ -328,6 +332,10 @@

      Class variables

      say() utility function, which calls chat.postMessage API with the associated channel ID

      +
      var say_streamSayStream | None
      +
      +

      say_stream() utility function for conversations, AI Agents & Assistants

      +
      var set_statusSetStatus | None

      set_status() utility function for AI Agents & Assistants

      @@ -391,6 +399,7 @@

      response
    • save_thread_context
    • say
    • +
    • say_stream
    • set_status
    • set_suggested_prompts
    • set_title
    • diff --git a/docs/reference/kwargs_injection/async_args.html b/docs/reference/kwargs_injection/async_args.html index 959f35a43..5b0e7b70e 100644 --- a/docs/reference/kwargs_injection/async_args.html +++ b/docs/reference/kwargs_injection/async_args.html @@ -48,7 +48,7 @@

      Classes

      class AsyncArgs -(*,
      logger: logging.Logger,
      client: slack_sdk.web.async_client.AsyncWebClient,
      req: AsyncBoltRequest,
      resp: BoltResponse,
      context: AsyncBoltContext,
      body: Dict[str, Any],
      payload: Dict[str, Any],
      options: Dict[str, Any] | None = None,
      shortcut: Dict[str, Any] | None = None,
      action: Dict[str, Any] | None = None,
      view: Dict[str, Any] | None = None,
      command: Dict[str, Any] | None = None,
      event: Dict[str, Any] | None = None,
      message: Dict[str, Any] | None = None,
      ack: AsyncAck,
      say: AsyncSay,
      respond: AsyncRespond,
      complete: AsyncComplete,
      fail: AsyncFail,
      set_status: AsyncSetStatus | None = None,
      set_title: AsyncSetTitle | None = None,
      set_suggested_prompts: AsyncSetSuggestedPrompts | None = None,
      get_thread_context: AsyncGetThreadContext | None = None,
      save_thread_context: AsyncSaveThreadContext | None = None,
      next: Callable[[], Awaitable[None]],
      **kwargs)
      +(*,
      logger: logging.Logger,
      client: slack_sdk.web.async_client.AsyncWebClient,
      req: AsyncBoltRequest,
      resp: BoltResponse,
      context: AsyncBoltContext,
      body: Dict[str, Any],
      payload: Dict[str, Any],
      options: Dict[str, Any] | None = None,
      shortcut: Dict[str, Any] | None = None,
      action: Dict[str, Any] | None = None,
      view: Dict[str, Any] | None = None,
      command: Dict[str, Any] | None = None,
      event: Dict[str, Any] | None = None,
      message: Dict[str, Any] | None = None,
      ack: AsyncAck,
      say: AsyncSay,
      respond: AsyncRespond,
      complete: AsyncComplete,
      fail: AsyncFail,
      set_status: AsyncSetStatus | None = None,
      set_title: AsyncSetTitle | None = None,
      set_suggested_prompts: AsyncSetSuggestedPrompts | None = None,
      get_thread_context: AsyncGetThreadContext | None = None,
      save_thread_context: AsyncSaveThreadContext | None = None,
      say_stream: AsyncSayStream | None = None,
      next: Callable[[], Awaitable[None]],
      **kwargs)
      @@ -139,6 +139,8 @@

      Classes

      """`get_thread_context()` utility function for AI Agents & Assistants""" save_thread_context: Optional[AsyncSaveThreadContext] """`save_thread_context()` utility function for AI Agents & Assistants""" + say_stream: Optional[AsyncSayStream] + """`say_stream()` utility function for AI Agents & Assistants""" # middleware next: Callable[[], Awaitable[None]] """`next()` utility function, which tells the middleware chain that it can continue with the next one""" @@ -172,6 +174,7 @@

      Classes

      set_suggested_prompts: Optional[AsyncSetSuggestedPrompts] = None, get_thread_context: Optional[AsyncGetThreadContext] = None, save_thread_context: Optional[AsyncSaveThreadContext] = None, + say_stream: Optional[AsyncSayStream] = None, next: Callable[[], Awaitable[None]], **kwargs, # noqa ): @@ -202,6 +205,7 @@

      Classes

      self.set_suggested_prompts = set_suggested_prompts self.get_thread_context = get_thread_context self.save_thread_context = save_thread_context + self.say_stream = say_stream self.next: Callable[[], Awaitable[None]] = next self.next_: Callable[[], Awaitable[None]] = next @@ -325,6 +329,10 @@

      Class variables

      say() utility function, which calls chat.postMessage API with the associated channel ID

      +
      var say_streamAsyncSayStream | None
      +
      +

      say_stream() utility function for AI Agents & Assistants

      +
      var set_statusAsyncSetStatus | None

      set_status() utility function for AI Agents & Assistants

      @@ -388,6 +396,7 @@

      response
    • save_thread_context
    • say
    • +
    • say_stream
    • set_status
    • set_suggested_prompts
    • set_title
    • diff --git a/docs/reference/kwargs_injection/async_utils.html b/docs/reference/kwargs_injection/async_utils.html index 80952518d..7af3a7679 100644 --- a/docs/reference/kwargs_injection/async_utils.html +++ b/docs/reference/kwargs_injection/async_utils.html @@ -63,7 +63,7 @@

      Functions

      error: Optional[Exception] = None, # for error handlers next_keys_required: bool = True, # False for listeners / middleware / error handlers ) -> Dict[str, Any]: - all_available_args = { + all_available_args: Dict[str, Any] = { "logger": logger, "client": request.context.client, "req": request, @@ -92,6 +92,7 @@

      Functions

      "set_suggested_prompts": request.context.set_suggested_prompts, "get_thread_context": request.context.get_thread_context, "save_thread_context": request.context.save_thread_context, + "say_stream": request.context.say_stream, # middleware "next": next_func, "next_": next_func, # for the middleware using Python's built-in `next()` function @@ -136,7 +137,7 @@

      Functions

      for name in required_arg_names: if name == "args": if isinstance(request, AsyncBoltRequest): - kwargs[name] = AsyncArgs(**all_available_args) # type: ignore[arg-type] + kwargs[name] = AsyncArgs(**all_available_args) else: logger.warning(f"Unknown Request object type detected ({type(request)})") diff --git a/docs/reference/kwargs_injection/index.html b/docs/reference/kwargs_injection/index.html index de7ef4a0a..cb17cea5d 100644 --- a/docs/reference/kwargs_injection/index.html +++ b/docs/reference/kwargs_injection/index.html @@ -85,7 +85,7 @@

      Functions

      error: Optional[Exception] = None, # for error handlers next_keys_required: bool = True, # False for listeners / middleware / error handlers ) -> Dict[str, Any]: - all_available_args = { + all_available_args: Dict[str, Any] = { "logger": logger, "client": request.context.client, "req": request, @@ -113,6 +113,7 @@

      Functions

      "set_title": request.context.set_title, "set_suggested_prompts": request.context.set_suggested_prompts, "save_thread_context": request.context.save_thread_context, + "say_stream": request.context.say_stream, # middleware "next": next_func, "next_": next_func, # for the middleware using Python's built-in `next()` function @@ -157,7 +158,7 @@

      Functions

      for name in required_arg_names: if name == "args": if isinstance(request, BoltRequest): - kwargs[name] = Args(**all_available_args) # type: ignore[arg-type] + kwargs[name] = Args(**all_available_args) else: logger.warning(f"Unknown Request object type detected ({type(request)})") @@ -175,7 +176,7 @@

      Classes

      class Args -(*,
      logger: logging.Logger,
      client: slack_sdk.web.client.WebClient,
      req: BoltRequest,
      resp: BoltResponse,
      context: BoltContext,
      body: Dict[str, Any],
      payload: Dict[str, Any],
      options: Dict[str, Any] | None = None,
      shortcut: Dict[str, Any] | None = None,
      action: Dict[str, Any] | None = None,
      view: Dict[str, Any] | None = None,
      command: Dict[str, Any] | None = None,
      event: Dict[str, Any] | None = None,
      message: Dict[str, Any] | None = None,
      ack: Ack,
      say: Say,
      respond: Respond,
      complete: Complete,
      fail: Fail,
      set_status: SetStatus | None = None,
      set_title: SetTitle | None = None,
      set_suggested_prompts: SetSuggestedPrompts | None = None,
      get_thread_context: GetThreadContext | None = None,
      save_thread_context: SaveThreadContext | None = None,
      next: Callable[[], None],
      **kwargs)
      +(*,
      logger: logging.Logger,
      client: slack_sdk.web.client.WebClient,
      req: BoltRequest,
      resp: BoltResponse,
      context: BoltContext,
      body: Dict[str, Any],
      payload: Dict[str, Any],
      options: Dict[str, Any] | None = None,
      shortcut: Dict[str, Any] | None = None,
      action: Dict[str, Any] | None = None,
      view: Dict[str, Any] | None = None,
      command: Dict[str, Any] | None = None,
      event: Dict[str, Any] | None = None,
      message: Dict[str, Any] | None = None,
      ack: Ack,
      say: Say,
      respond: Respond,
      complete: Complete,
      fail: Fail,
      set_status: SetStatus | None = None,
      set_title: SetTitle | None = None,
      set_suggested_prompts: SetSuggestedPrompts | None = None,
      get_thread_context: GetThreadContext | None = None,
      save_thread_context: SaveThreadContext | None = None,
      say_stream: SayStream | None = None,
      next: Callable[[], None],
      **kwargs)
      @@ -266,6 +267,8 @@

      Classes

      """`get_thread_context()` utility function for AI Agents & Assistants""" save_thread_context: Optional[SaveThreadContext] """`save_thread_context()` utility function for AI Agents & Assistants""" + say_stream: Optional[SayStream] + """`say_stream()` utility function for conversations, AI Agents & Assistants""" # middleware next: Callable[[], None] """`next()` utility function, which tells the middleware chain that it can continue with the next one""" @@ -299,6 +302,7 @@

      Classes

      set_suggested_prompts: Optional[SetSuggestedPrompts] = None, get_thread_context: Optional[GetThreadContext] = None, save_thread_context: Optional[SaveThreadContext] = None, + say_stream: Optional[SayStream] = None, # As this method is not supposed to be invoked by bolt-python users, # the naming conflict with the built-in one affects # only the internals of this method @@ -332,6 +336,7 @@

      Classes

      self.set_suggested_prompts = set_suggested_prompts self.get_thread_context = get_thread_context self.save_thread_context = save_thread_context + self.say_stream = say_stream self.next: Callable[[], None] = next self.next_: Callable[[], None] = next
      @@ -455,6 +460,10 @@

      Class variables

      say() utility function, which calls chat.postMessage API with the associated channel ID

      +
      var say_streamSayStream | None
      +
      +

      say_stream() utility function for conversations, AI Agents & Assistants

      +
      var set_statusSetStatus | None

      set_status() utility function for AI Agents & Assistants

      @@ -531,6 +540,7 @@

      response
    • save_thread_context
    • say
    • +
    • say_stream
    • set_status
    • set_suggested_prompts
    • set_title
    • diff --git a/docs/reference/kwargs_injection/utils.html b/docs/reference/kwargs_injection/utils.html index 2e6ecd001..0289fd410 100644 --- a/docs/reference/kwargs_injection/utils.html +++ b/docs/reference/kwargs_injection/utils.html @@ -63,7 +63,7 @@

      Functions

      error: Optional[Exception] = None, # for error handlers next_keys_required: bool = True, # False for listeners / middleware / error handlers ) -> Dict[str, Any]: - all_available_args = { + all_available_args: Dict[str, Any] = { "logger": logger, "client": request.context.client, "req": request, @@ -91,6 +91,7 @@

      Functions

      "set_title": request.context.set_title, "set_suggested_prompts": request.context.set_suggested_prompts, "save_thread_context": request.context.save_thread_context, + "say_stream": request.context.say_stream, # middleware "next": next_func, "next_": next_func, # for the middleware using Python's built-in `next()` function @@ -135,7 +136,7 @@

      Functions

      for name in required_arg_names: if name == "args": if isinstance(request, BoltRequest): - kwargs[name] = Args(**all_available_args) # type: ignore[arg-type] + kwargs[name] = Args(**all_available_args) else: logger.warning(f"Unknown Request object type detected ({type(request)})") diff --git a/docs/reference/listener/async_listener_error_handler.html b/docs/reference/listener/async_listener_error_handler.html index 1f3789c40..ebee4441a 100644 --- a/docs/reference/listener/async_listener_error_handler.html +++ b/docs/reference/listener/async_listener_error_handler.html @@ -77,9 +77,10 @@

      Classes

      ) returned_response = await self.func(**kwargs) if returned_response is not None and isinstance(returned_response, BoltResponse): - response.status = returned_response.status # type: ignore[union-attr] - response.headers = returned_response.headers # type: ignore[union-attr] - response.body = returned_response.body # type: ignore[union-attr] + assert response is not None, "response must be provided when returning a BoltResponse from an error handler" + response.status = returned_response.status + response.headers = returned_response.headers + response.body = returned_response.body

      Ancestors

      diff --git a/docs/reference/listener/listener_error_handler.html b/docs/reference/listener/listener_error_handler.html index c9f7c2ccd..e344b15cb 100644 --- a/docs/reference/listener/listener_error_handler.html +++ b/docs/reference/listener/listener_error_handler.html @@ -77,9 +77,10 @@

      Classes

      ) returned_response = self.func(**kwargs) if returned_response is not None and isinstance(returned_response, BoltResponse): - response.status = returned_response.status # type: ignore[union-attr] - response.headers = returned_response.headers # type: ignore[union-attr] - response.body = returned_response.body # type: ignore[union-attr] + assert response is not None, "response must be provided when returning a BoltResponse from an error handler" + response.status = returned_response.status + response.headers = returned_response.headers + response.body = returned_response.body

      Ancestors

      diff --git a/docs/reference/logger/messages.html b/docs/reference/logger/messages.html index e69b45fc9..1072e6479 100644 --- a/docs/reference/logger/messages.html +++ b/docs/reference/logger/messages.html @@ -409,7 +409,7 @@

      Functions

      -def warning_unhandled_by_global_middleware(name: str,
      req: BoltRequest | AsyncBoltRequest) ‑> str
      +def warning_unhandled_by_global_middleware(name: str,
      req: BoltRequest | ForwardRef('AsyncBoltRequest')) ‑> str
      @@ -427,7 +427,7 @@

      Functions

      -def warning_unhandled_request(req: BoltRequest | AsyncBoltRequest) ‑> str +def warning_unhandled_request(req: BoltRequest | ForwardRef('AsyncBoltRequest')) ‑> str
      diff --git a/docs/reference/middleware/assistant/assistant.html b/docs/reference/middleware/assistant/assistant.html index d1184c407..946416d62 100644 --- a/docs/reference/middleware/assistant/assistant.html +++ b/docs/reference/middleware/assistant/assistant.html @@ -96,7 +96,7 @@

      Classes

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -135,7 +135,7 @@

      Classes

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -174,7 +174,7 @@

      Classes

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -213,7 +213,7 @@

      Classes

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -243,13 +243,13 @@

      Classes

      ): return [CustomListenerMatcher(app_name=self.app_name, func=primary_matcher)] + ( custom_matchers or [] - ) # type:ignore[operator] + ) # type: ignore[operator] @staticmethod def default_thread_context_changed(save_thread_context: SaveThreadContext, payload: dict): save_thread_context(payload["assistant_thread"]["context"]) - def process( # type:ignore[return] + def process( # type: ignore[return] self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse] ) -> Optional[BoltResponse]: if self._thread_context_changed_listeners is None: @@ -265,6 +265,15 @@

      Classes

      if listeners is not None: for listener in listeners: if listener.matches(req=req, resp=resp): + middleware_resp, next_was_not_called = listener.run_middleware(req=req, resp=resp) + if next_was_not_called: + if middleware_resp is not None: + return middleware_resp + # The listener middleware didn't call next(). + # Skip this listener and try the next one. + continue + if middleware_resp is not None: + resp = middleware_resp return listener_runner.run( request=req, response=resp, @@ -284,13 +293,14 @@

      Classes

      middleware: Optional[List[Middleware]] = None, base_logger: Optional[Logger] = None, ) -> Listener: - if isinstance(listener_or_functions, Callable): # type:ignore[arg-type] - listener_or_functions = [listener_or_functions] # type:ignore[list-item] + if isinstance(listener_or_functions, Callable): # type: ignore[arg-type] + listener_or_functions = [listener_or_functions] # type: ignore[list-item] if isinstance(listener_or_functions, Listener): return listener_or_functions elif isinstance(listener_or_functions, list): middleware = middleware if middleware else [] + middleware.insert(0, AttachingConversationKwargs(self.thread_context_store)) functions = listener_or_functions ack_function = functions.pop(0) @@ -299,7 +309,7 @@

      Classes

      for matcher in matchers: if isinstance(matcher, ListenerMatcher): listener_matchers.append(matcher) - elif isinstance(matcher, Callable): # type:ignore[arg-type] + elif isinstance(matcher, Callable): # type: ignore[arg-type] listener_matchers.append( build_listener_matcher( func=matcher, @@ -378,7 +388,7 @@

      Methods

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -418,13 +428,14 @@

      Methods

      middleware: Optional[List[Middleware]] = None, base_logger: Optional[Logger] = None, ) -> Listener: - if isinstance(listener_or_functions, Callable): # type:ignore[arg-type] - listener_or_functions = [listener_or_functions] # type:ignore[list-item] + if isinstance(listener_or_functions, Callable): # type: ignore[arg-type] + listener_or_functions = [listener_or_functions] # type: ignore[list-item] if isinstance(listener_or_functions, Listener): return listener_or_functions elif isinstance(listener_or_functions, list): middleware = middleware if middleware else [] + middleware.insert(0, AttachingConversationKwargs(self.thread_context_store)) functions = listener_or_functions ack_function = functions.pop(0) @@ -433,7 +444,7 @@

      Methods

      for matcher in matchers: if isinstance(matcher, ListenerMatcher): listener_matchers.append(matcher) - elif isinstance(matcher, Callable): # type:ignore[arg-type] + elif isinstance(matcher, Callable): # type: ignore[arg-type] listener_matchers.append( build_listener_matcher( func=matcher, @@ -479,7 +490,7 @@

      Methods

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -528,7 +539,7 @@

      Methods

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -577,7 +588,7 @@

      Methods

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func diff --git a/docs/reference/middleware/assistant/async_assistant.html b/docs/reference/middleware/assistant/async_assistant.html index 2faf0e34b..748be2cbf 100644 --- a/docs/reference/middleware/assistant/async_assistant.html +++ b/docs/reference/middleware/assistant/async_assistant.html @@ -94,7 +94,7 @@

      Classes

      func=is_assistant_thread_started_event, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -103,7 +103,7 @@

      Classes

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -140,7 +140,7 @@

      Classes

      func=is_user_message_event_in_assistant_thread, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -149,7 +149,7 @@

      Classes

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -186,7 +186,7 @@

      Classes

      func=is_bot_message_event_in_assistant_thread, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -195,7 +195,7 @@

      Classes

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -232,7 +232,7 @@

      Classes

      func=is_assistant_thread_context_changed_event, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -241,7 +241,7 @@

      Classes

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -269,14 +269,14 @@

      Classes

      primary_matcher: Union[Callable[..., bool], AsyncListenerMatcher], custom_matchers: Optional[Union[Callable[..., bool], AsyncListenerMatcher]], ): - return [primary_matcher] + (custom_matchers or []) # type:ignore[operator] + return [primary_matcher] + (custom_matchers or []) # type: ignore[operator] @staticmethod async def default_thread_context_changed(save_thread_context: AsyncSaveThreadContext, payload: dict): new_context: dict = payload["assistant_thread"]["context"] await save_thread_context(new_context) - async def async_process( # type:ignore[return] + async def async_process( # type: ignore[return] self, *, req: AsyncBoltRequest, @@ -296,6 +296,15 @@

      Classes

      if listeners is not None: for listener in listeners: if listener is not None and await listener.async_matches(req=req, resp=resp): + middleware_resp, next_was_not_called = await listener.run_async_middleware(req=req, resp=resp) + if next_was_not_called: + if middleware_resp is not None: + return middleware_resp + # The listener middleware didn't call next(). + # Skip this listener and try the next one. + continue + if middleware_resp is not None: + resp = middleware_resp return await listener_runner.run( request=req, response=resp, @@ -315,13 +324,14 @@

      Classes

      middleware: Optional[List[AsyncMiddleware]] = None, base_logger: Optional[Logger] = None, ) -> AsyncListener: - if isinstance(listener_or_functions, Callable): # type:ignore[arg-type] - listener_or_functions = [listener_or_functions] # type:ignore[list-item] + if isinstance(listener_or_functions, Callable): # type: ignore[arg-type] + listener_or_functions = [listener_or_functions] # type: ignore[list-item] if isinstance(listener_or_functions, AsyncListener): return listener_or_functions elif isinstance(listener_or_functions, list): middleware = middleware if middleware else [] + middleware.insert(0, AsyncAttachingConversationKwargs(self.thread_context_store)) functions = listener_or_functions ack_function = functions.pop(0) @@ -333,7 +343,7 @@

      Classes

      else: listener_matchers.append( build_listener_matcher( - func=matcher, # type:ignore[arg-type] + func=matcher, # type: ignore[arg-type] asyncio=True, base_logger=base_logger, ) @@ -408,7 +418,7 @@

      Methods

      func=is_bot_message_event_in_assistant_thread, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -417,7 +427,7 @@

      Methods

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -457,13 +467,14 @@

      Methods

      middleware: Optional[List[AsyncMiddleware]] = None, base_logger: Optional[Logger] = None, ) -> AsyncListener: - if isinstance(listener_or_functions, Callable): # type:ignore[arg-type] - listener_or_functions = [listener_or_functions] # type:ignore[list-item] + if isinstance(listener_or_functions, Callable): # type: ignore[arg-type] + listener_or_functions = [listener_or_functions] # type: ignore[list-item] if isinstance(listener_or_functions, AsyncListener): return listener_or_functions elif isinstance(listener_or_functions, list): middleware = middleware if middleware else [] + middleware.insert(0, AsyncAttachingConversationKwargs(self.thread_context_store)) functions = listener_or_functions ack_function = functions.pop(0) @@ -475,7 +486,7 @@

      Methods

      else: listener_matchers.append( build_listener_matcher( - func=matcher, # type:ignore[arg-type] + func=matcher, # type: ignore[arg-type] asyncio=True, base_logger=base_logger, ) @@ -516,7 +527,7 @@

      Methods

      func=is_assistant_thread_context_changed_event, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -525,7 +536,7 @@

      Methods

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -572,7 +583,7 @@

      Methods

      func=is_assistant_thread_started_event, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -581,7 +592,7 @@

      Methods

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -628,7 +639,7 @@

      Methods

      func=is_user_message_event_in_assistant_thread, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -637,7 +648,7 @@

      Methods

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func diff --git a/docs/reference/middleware/assistant/index.html b/docs/reference/middleware/assistant/index.html index 92f405cad..e9fce8d64 100644 --- a/docs/reference/middleware/assistant/index.html +++ b/docs/reference/middleware/assistant/index.html @@ -107,7 +107,7 @@

      Classes

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -146,7 +146,7 @@

      Classes

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -185,7 +185,7 @@

      Classes

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -224,7 +224,7 @@

      Classes

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -254,13 +254,13 @@

      Classes

      ): return [CustomListenerMatcher(app_name=self.app_name, func=primary_matcher)] + ( custom_matchers or [] - ) # type:ignore[operator] + ) # type: ignore[operator] @staticmethod def default_thread_context_changed(save_thread_context: SaveThreadContext, payload: dict): save_thread_context(payload["assistant_thread"]["context"]) - def process( # type:ignore[return] + def process( # type: ignore[return] self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse] ) -> Optional[BoltResponse]: if self._thread_context_changed_listeners is None: @@ -276,6 +276,15 @@

      Classes

      if listeners is not None: for listener in listeners: if listener.matches(req=req, resp=resp): + middleware_resp, next_was_not_called = listener.run_middleware(req=req, resp=resp) + if next_was_not_called: + if middleware_resp is not None: + return middleware_resp + # The listener middleware didn't call next(). + # Skip this listener and try the next one. + continue + if middleware_resp is not None: + resp = middleware_resp return listener_runner.run( request=req, response=resp, @@ -295,13 +304,14 @@

      Classes

      middleware: Optional[List[Middleware]] = None, base_logger: Optional[Logger] = None, ) -> Listener: - if isinstance(listener_or_functions, Callable): # type:ignore[arg-type] - listener_or_functions = [listener_or_functions] # type:ignore[list-item] + if isinstance(listener_or_functions, Callable): # type: ignore[arg-type] + listener_or_functions = [listener_or_functions] # type: ignore[list-item] if isinstance(listener_or_functions, Listener): return listener_or_functions elif isinstance(listener_or_functions, list): middleware = middleware if middleware else [] + middleware.insert(0, AttachingConversationKwargs(self.thread_context_store)) functions = listener_or_functions ack_function = functions.pop(0) @@ -310,7 +320,7 @@

      Classes

      for matcher in matchers: if isinstance(matcher, ListenerMatcher): listener_matchers.append(matcher) - elif isinstance(matcher, Callable): # type:ignore[arg-type] + elif isinstance(matcher, Callable): # type: ignore[arg-type] listener_matchers.append( build_listener_matcher( func=matcher, @@ -389,7 +399,7 @@

      Methods

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -429,13 +439,14 @@

      Methods

      middleware: Optional[List[Middleware]] = None, base_logger: Optional[Logger] = None, ) -> Listener: - if isinstance(listener_or_functions, Callable): # type:ignore[arg-type] - listener_or_functions = [listener_or_functions] # type:ignore[list-item] + if isinstance(listener_or_functions, Callable): # type: ignore[arg-type] + listener_or_functions = [listener_or_functions] # type: ignore[list-item] if isinstance(listener_or_functions, Listener): return listener_or_functions elif isinstance(listener_or_functions, list): middleware = middleware if middleware else [] + middleware.insert(0, AttachingConversationKwargs(self.thread_context_store)) functions = listener_or_functions ack_function = functions.pop(0) @@ -444,7 +455,7 @@

      Methods

      for matcher in matchers: if isinstance(matcher, ListenerMatcher): listener_matchers.append(matcher) - elif isinstance(matcher, Callable): # type:ignore[arg-type] + elif isinstance(matcher, Callable): # type: ignore[arg-type] listener_matchers.append( build_listener_matcher( func=matcher, @@ -490,7 +501,7 @@

      Methods

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -539,7 +550,7 @@

      Methods

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -588,7 +599,7 @@

      Methods

      self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func diff --git a/docs/reference/middleware/async_builtins.html b/docs/reference/middleware/async_builtins.html index d32deff15..1ddea9222 100644 --- a/docs/reference/middleware/async_builtins.html +++ b/docs/reference/middleware/async_builtins.html @@ -46,6 +46,82 @@

      Module slack_bolt.middleware.async_builtins

      Classes

      +
      +class AsyncAttachingConversationKwargs +(thread_context_store: AsyncAssistantThreadContextStore | None = None) +
      +
      +
      + +Expand source code + +
      class AsyncAttachingConversationKwargs(AsyncMiddleware):
      +
      +    thread_context_store: Optional[AsyncAssistantThreadContextStore]
      +
      +    def __init__(self, thread_context_store: Optional[AsyncAssistantThreadContextStore] = None):
      +        self.thread_context_store = thread_context_store
      +
      +    async def async_process(
      +        self,
      +        *,
      +        req: AsyncBoltRequest,
      +        resp: BoltResponse,
      +        next: Callable[[], Awaitable[BoltResponse]],
      +    ) -> Optional[BoltResponse]:
      +        event = to_event(req.body)
      +        if event is not None:
      +            if is_assistant_event(req.body):
      +                assistant = AsyncAssistantUtilities(
      +                    payload=event,
      +                    context=req.context,
      +                    thread_context_store=self.thread_context_store,
      +                )
      +                req.context["say"] = assistant.say
      +                req.context["set_title"] = assistant.set_title
      +                req.context["set_suggested_prompts"] = assistant.set_suggested_prompts
      +                req.context["get_thread_context"] = assistant.get_thread_context
      +                req.context["save_thread_context"] = assistant.save_thread_context
      +
      +            # TODO: in the future we might want to introduce a "proper" extract_ts utility
      +            thread_ts = req.context.thread_ts or event.get("ts")
      +            if req.context.channel_id and thread_ts:
      +                req.context["set_status"] = AsyncSetStatus(
      +                    client=req.context.client,
      +                    channel_id=req.context.channel_id,
      +                    thread_ts=thread_ts,
      +                )
      +                req.context["say_stream"] = AsyncSayStream(
      +                    client=req.context.client,
      +                    channel=req.context.channel_id,
      +                    recipient_team_id=req.context.team_id or req.context.enterprise_id,
      +                    recipient_user_id=req.context.user_id,
      +                    thread_ts=thread_ts,
      +                )
      +        return await next()
      +
      +

      A middleware can process request data before other middleware and listener functions.

      +

      Ancestors

      + +

      Class variables

      +
      +
      var thread_context_storeAsyncAssistantThreadContextStore | None
      +
      +

      The type of the None singleton.

      +
      +
      +

      Inherited members

      + +
      class AsyncAttachingFunctionToken
      @@ -395,6 +471,12 @@

      Inherited members

    • Classes

      • +

        AsyncAttachingConversationKwargs

        + +
      • +
      • AsyncAttachingFunctionToken

      • diff --git a/docs/reference/middleware/async_middleware.html b/docs/reference/middleware/async_middleware.html index 33b4273e7..f7713b881 100644 --- a/docs/reference/middleware/async_middleware.html +++ b/docs/reference/middleware/async_middleware.html @@ -104,6 +104,7 @@

        Subclasses

        • AsyncAssistant
        • AsyncCustomMiddleware
        • +
        • AsyncAttachingConversationKwargs
        • AsyncAttachingFunctionToken
        • AsyncAuthorization
        • AsyncIgnoringSelfEvents
        • diff --git a/docs/reference/middleware/async_middleware_error_handler.html b/docs/reference/middleware/async_middleware_error_handler.html index e7cd8bb32..bf5b101f6 100644 --- a/docs/reference/middleware/async_middleware_error_handler.html +++ b/docs/reference/middleware/async_middleware_error_handler.html @@ -77,9 +77,10 @@

          Classes

          ) returned_response = await self.func(**kwargs) if returned_response is not None and isinstance(returned_response, BoltResponse): - response.status = returned_response.status # type: ignore[union-attr] - response.headers = returned_response.headers # type: ignore[union-attr] - response.body = returned_response.body # type: ignore[union-attr] + assert response is not None, "response must be provided when returning a BoltResponse from an error handler" + response.status = returned_response.status + response.headers = returned_response.headers + response.body = returned_response.body
    • Ancestors

      diff --git a/docs/reference/middleware/attaching_conversation_kwargs/async_attaching_conversation_kwargs.html b/docs/reference/middleware/attaching_conversation_kwargs/async_attaching_conversation_kwargs.html new file mode 100644 index 000000000..a0f5bdf85 --- /dev/null +++ b/docs/reference/middleware/attaching_conversation_kwargs/async_attaching_conversation_kwargs.html @@ -0,0 +1,155 @@ + + + + + + +slack_bolt.middleware.attaching_conversation_kwargs.async_attaching_conversation_kwargs API documentation + + + + + + + + + + + +
      +
      +
      +

      Module slack_bolt.middleware.attaching_conversation_kwargs.async_attaching_conversation_kwargs

      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +

      Classes

      +
      +
      +class AsyncAttachingConversationKwargs +(thread_context_store: AsyncAssistantThreadContextStore | None = None) +
      +
      +
      + +Expand source code + +
      class AsyncAttachingConversationKwargs(AsyncMiddleware):
      +
      +    thread_context_store: Optional[AsyncAssistantThreadContextStore]
      +
      +    def __init__(self, thread_context_store: Optional[AsyncAssistantThreadContextStore] = None):
      +        self.thread_context_store = thread_context_store
      +
      +    async def async_process(
      +        self,
      +        *,
      +        req: AsyncBoltRequest,
      +        resp: BoltResponse,
      +        next: Callable[[], Awaitable[BoltResponse]],
      +    ) -> Optional[BoltResponse]:
      +        event = to_event(req.body)
      +        if event is not None:
      +            if is_assistant_event(req.body):
      +                assistant = AsyncAssistantUtilities(
      +                    payload=event,
      +                    context=req.context,
      +                    thread_context_store=self.thread_context_store,
      +                )
      +                req.context["say"] = assistant.say
      +                req.context["set_title"] = assistant.set_title
      +                req.context["set_suggested_prompts"] = assistant.set_suggested_prompts
      +                req.context["get_thread_context"] = assistant.get_thread_context
      +                req.context["save_thread_context"] = assistant.save_thread_context
      +
      +            # TODO: in the future we might want to introduce a "proper" extract_ts utility
      +            thread_ts = req.context.thread_ts or event.get("ts")
      +            if req.context.channel_id and thread_ts:
      +                req.context["set_status"] = AsyncSetStatus(
      +                    client=req.context.client,
      +                    channel_id=req.context.channel_id,
      +                    thread_ts=thread_ts,
      +                )
      +                req.context["say_stream"] = AsyncSayStream(
      +                    client=req.context.client,
      +                    channel=req.context.channel_id,
      +                    recipient_team_id=req.context.team_id or req.context.enterprise_id,
      +                    recipient_user_id=req.context.user_id,
      +                    thread_ts=thread_ts,
      +                )
      +        return await next()
      +
      +

      A middleware can process request data before other middleware and listener functions.

      +

      Ancestors

      + +

      Class variables

      +
      +
      var thread_context_storeAsyncAssistantThreadContextStore | None
      +
      +

      The type of the None singleton.

      +
      +
      +

      Inherited members

      + +
      +
      +
      +
      + +
      + + + diff --git a/docs/reference/middleware/attaching_conversation_kwargs/attaching_conversation_kwargs.html b/docs/reference/middleware/attaching_conversation_kwargs/attaching_conversation_kwargs.html new file mode 100644 index 000000000..8a1911323 --- /dev/null +++ b/docs/reference/middleware/attaching_conversation_kwargs/attaching_conversation_kwargs.html @@ -0,0 +1,149 @@ + + + + + + +slack_bolt.middleware.attaching_conversation_kwargs.attaching_conversation_kwargs API documentation + + + + + + + + + + + +
      +
      +
      +

      Module slack_bolt.middleware.attaching_conversation_kwargs.attaching_conversation_kwargs

      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +

      Classes

      +
      +
      +class AttachingConversationKwargs +(thread_context_store: AssistantThreadContextStore | None = None) +
      +
      +
      + +Expand source code + +
      class AttachingConversationKwargs(Middleware):
      +
      +    thread_context_store: Optional[AssistantThreadContextStore]
      +
      +    def __init__(self, thread_context_store: Optional[AssistantThreadContextStore] = None):
      +        self.thread_context_store = thread_context_store
      +
      +    def process(self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse]) -> Optional[BoltResponse]:
      +        event = to_event(req.body)
      +        if event is not None:
      +            if is_assistant_event(req.body):
      +                assistant = AssistantUtilities(
      +                    payload=event,
      +                    context=req.context,
      +                    thread_context_store=self.thread_context_store,
      +                )
      +                req.context["say"] = assistant.say
      +                req.context["set_title"] = assistant.set_title
      +                req.context["set_suggested_prompts"] = assistant.set_suggested_prompts
      +                req.context["get_thread_context"] = assistant.get_thread_context
      +                req.context["save_thread_context"] = assistant.save_thread_context
      +
      +            # TODO: in the future we might want to introduce a "proper" extract_ts utility
      +            thread_ts = req.context.thread_ts or event.get("ts")
      +            if req.context.channel_id and thread_ts:
      +                req.context["set_status"] = SetStatus(
      +                    client=req.context.client,
      +                    channel_id=req.context.channel_id,
      +                    thread_ts=thread_ts,
      +                )
      +                req.context["say_stream"] = SayStream(
      +                    client=req.context.client,
      +                    channel=req.context.channel_id,
      +                    recipient_team_id=req.context.team_id or req.context.enterprise_id,
      +                    recipient_user_id=req.context.user_id,
      +                    thread_ts=thread_ts,
      +                )
      +        return next()
      +
      +

      A middleware can process request data before other middleware and listener functions.

      +

      Ancestors

      + +

      Class variables

      +
      +
      var thread_context_storeAssistantThreadContextStore | None
      +
      +

      The type of the None singleton.

      +
      +
      +

      Inherited members

      + +
      +
      +
      +
      + +
      + + + diff --git a/docs/reference/middleware/attaching_conversation_kwargs/index.html b/docs/reference/middleware/attaching_conversation_kwargs/index.html new file mode 100644 index 000000000..308a52712 --- /dev/null +++ b/docs/reference/middleware/attaching_conversation_kwargs/index.html @@ -0,0 +1,166 @@ + + + + + + +slack_bolt.middleware.attaching_conversation_kwargs API documentation + + + + + + + + + + + +
      +
      +
      +

      Module slack_bolt.middleware.attaching_conversation_kwargs

      +
      +
      +
      +
      +

      Sub-modules

      +
      +
      slack_bolt.middleware.attaching_conversation_kwargs.async_attaching_conversation_kwargs
      +
      +
      +
      +
      slack_bolt.middleware.attaching_conversation_kwargs.attaching_conversation_kwargs
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +

      Classes

      +
      +
      +class AttachingConversationKwargs +(thread_context_store: AssistantThreadContextStore | None = None) +
      +
      +
      + +Expand source code + +
      class AttachingConversationKwargs(Middleware):
      +
      +    thread_context_store: Optional[AssistantThreadContextStore]
      +
      +    def __init__(self, thread_context_store: Optional[AssistantThreadContextStore] = None):
      +        self.thread_context_store = thread_context_store
      +
      +    def process(self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse]) -> Optional[BoltResponse]:
      +        event = to_event(req.body)
      +        if event is not None:
      +            if is_assistant_event(req.body):
      +                assistant = AssistantUtilities(
      +                    payload=event,
      +                    context=req.context,
      +                    thread_context_store=self.thread_context_store,
      +                )
      +                req.context["say"] = assistant.say
      +                req.context["set_title"] = assistant.set_title
      +                req.context["set_suggested_prompts"] = assistant.set_suggested_prompts
      +                req.context["get_thread_context"] = assistant.get_thread_context
      +                req.context["save_thread_context"] = assistant.save_thread_context
      +
      +            # TODO: in the future we might want to introduce a "proper" extract_ts utility
      +            thread_ts = req.context.thread_ts or event.get("ts")
      +            if req.context.channel_id and thread_ts:
      +                req.context["set_status"] = SetStatus(
      +                    client=req.context.client,
      +                    channel_id=req.context.channel_id,
      +                    thread_ts=thread_ts,
      +                )
      +                req.context["say_stream"] = SayStream(
      +                    client=req.context.client,
      +                    channel=req.context.channel_id,
      +                    recipient_team_id=req.context.team_id or req.context.enterprise_id,
      +                    recipient_user_id=req.context.user_id,
      +                    thread_ts=thread_ts,
      +                )
      +        return next()
      +
      +

      A middleware can process request data before other middleware and listener functions.

      +

      Ancestors

      + +

      Class variables

      +
      +
      var thread_context_storeAssistantThreadContextStore | None
      +
      +

      The type of the None singleton.

      +
      +
      +

      Inherited members

      + +
      +
      +
      +
      + +
      + + + diff --git a/docs/reference/middleware/index.html b/docs/reference/middleware/index.html index 05d773415..ce2629224 100644 --- a/docs/reference/middleware/index.html +++ b/docs/reference/middleware/index.html @@ -65,6 +65,10 @@

      Sub-modules

      +
      slack_bolt.middleware.attaching_conversation_kwargs
      +
      +
      +
      slack_bolt.middleware.attaching_function_token
      @@ -114,6 +118,76 @@

      Sub-modules

      Classes

      +
      +class AttachingConversationKwargs +(thread_context_store: AssistantThreadContextStore | None = None) +
      +
      +
      + +Expand source code + +
      class AttachingConversationKwargs(Middleware):
      +
      +    thread_context_store: Optional[AssistantThreadContextStore]
      +
      +    def __init__(self, thread_context_store: Optional[AssistantThreadContextStore] = None):
      +        self.thread_context_store = thread_context_store
      +
      +    def process(self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse]) -> Optional[BoltResponse]:
      +        event = to_event(req.body)
      +        if event is not None:
      +            if is_assistant_event(req.body):
      +                assistant = AssistantUtilities(
      +                    payload=event,
      +                    context=req.context,
      +                    thread_context_store=self.thread_context_store,
      +                )
      +                req.context["say"] = assistant.say
      +                req.context["set_title"] = assistant.set_title
      +                req.context["set_suggested_prompts"] = assistant.set_suggested_prompts
      +                req.context["get_thread_context"] = assistant.get_thread_context
      +                req.context["save_thread_context"] = assistant.save_thread_context
      +
      +            # TODO: in the future we might want to introduce a "proper" extract_ts utility
      +            thread_ts = req.context.thread_ts or event.get("ts")
      +            if req.context.channel_id and thread_ts:
      +                req.context["set_status"] = SetStatus(
      +                    client=req.context.client,
      +                    channel_id=req.context.channel_id,
      +                    thread_ts=thread_ts,
      +                )
      +                req.context["say_stream"] = SayStream(
      +                    client=req.context.client,
      +                    channel=req.context.channel_id,
      +                    recipient_team_id=req.context.team_id or req.context.enterprise_id,
      +                    recipient_user_id=req.context.user_id,
      +                    thread_ts=thread_ts,
      +                )
      +        return next()
      +
      +

      A middleware can process request data before other middleware and listener functions.

      +

      Ancestors

      + +

      Class variables

      +
      +
      var thread_context_storeAssistantThreadContextStore | None
      +
      +

      The type of the None singleton.

      +
      +
      +

      Inherited members

      + +
      class AttachingFunctionToken
      @@ -385,6 +459,7 @@

      Inherited members

      Subclasses

      Ancestors

      diff --git a/docs/reference/oauth/async_callback_options.html b/docs/reference/oauth/async_callback_options.html index 822867ea8..d07f1aee5 100644 --- a/docs/reference/oauth/async_callback_options.html +++ b/docs/reference/oauth/async_callback_options.html @@ -101,7 +101,7 @@

      Class variables

      reason: str, error: Optional[Exception] = None, suggested_status_code: int, - settings: "AsyncOAuthSettings", # type: ignore[name-defined] + settings: "AsyncOAuthSettings", default: "AsyncCallbackOptions", ): """The arguments for a failure function. @@ -153,7 +153,7 @@

      Args

      *, request: AsyncBoltRequest, installation: Installation, - settings: "AsyncOAuthSettings", # type: ignore[name-defined] + settings: "AsyncOAuthSettings", default: "AsyncCallbackOptions", ): """The arguments for a success function. diff --git a/docs/reference/oauth/async_oauth_settings.html b/docs/reference/oauth/async_oauth_settings.html index 3b8c04edb..5e6a543c4 100644 --- a/docs/reference/oauth/async_oauth_settings.html +++ b/docs/reference/oauth/async_oauth_settings.html @@ -48,7 +48,7 @@

      Classes

      class AsyncOAuthSettings -(*,
      client_id: str | None = None,
      client_secret: str | None = None,
      scopes: Sequence[str] | str | None = None,
      user_scopes: Sequence[str] | str | None = None,
      redirect_uri: str | None = None,
      install_path: str = '/slack/install',
      install_page_rendering_enabled: bool = True,
      redirect_uri_path: str = '/slack/oauth_redirect',
      callback_options: AsyncCallbackOptions | None = None,
      success_url: str | None = None,
      failure_url: str | None = None,
      authorization_url: str | None = None,
      installation_store: slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore | None = None,
      installation_store_bot_only: bool = False,
      token_rotation_expiration_minutes: int = 120,
      user_token_resolution: str = 'authed_user',
      state_validation_enabled: bool = True,
      state_store: slack_sdk.oauth.state_store.async_state_store.AsyncOAuthStateStore | None = None,
      state_cookie_name: str = 'slack-app-oauth-state',
      state_expiration_seconds: int = 600,
      logger: logging.Logger = <Logger slack_bolt.oauth.async_oauth_settings (WARNING)>)
      +(*,
      client_id: str | None = None,
      client_secret: str | None = None,
      scopes: str | Sequence[str] | None = None,
      user_scopes: str | Sequence[str] | None = None,
      redirect_uri: str | None = None,
      install_path: str = '/slack/install',
      install_page_rendering_enabled: bool = True,
      redirect_uri_path: str = '/slack/oauth_redirect',
      callback_options: AsyncCallbackOptions | None = None,
      success_url: str | None = None,
      failure_url: str | None = None,
      authorization_url: str | None = None,
      installation_store: slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore | None = None,
      installation_store_bot_only: bool = False,
      token_rotation_expiration_minutes: int = 120,
      user_token_resolution: str = 'authed_user',
      state_validation_enabled: bool = True,
      state_store: slack_sdk.oauth.state_store.async_state_store.AsyncOAuthStateStore | None = None,
      state_cookie_name: str = 'slack-app-oauth-state',
      state_expiration_seconds: int = 600,
      logger: logging.Logger = <Logger slack_bolt.oauth.async_oauth_settings (WARNING)>)
      diff --git a/docs/reference/oauth/callback_options.html b/docs/reference/oauth/callback_options.html index 7ad3734b3..c6fc81286 100644 --- a/docs/reference/oauth/callback_options.html +++ b/docs/reference/oauth/callback_options.html @@ -181,7 +181,7 @@

      Inherited members

      reason: str, error: Optional[Exception] = None, suggested_status_code: int, - settings: "OAuthSettings", # type: ignore[name-defined] + settings: "OAuthSettings", default: "CallbackOptions", ): """The arguments for a failure function. @@ -233,7 +233,7 @@

      Args

      *, request: BoltRequest, installation: Installation, - settings: "OAuthSettings", # type: ignore[name-defined] + settings: "OAuthSettings", default: "CallbackOptions", ): """The arguments for a success function. diff --git a/docs/reference/oauth/oauth_settings.html b/docs/reference/oauth/oauth_settings.html index cd8def497..1eb2ab7dd 100644 --- a/docs/reference/oauth/oauth_settings.html +++ b/docs/reference/oauth/oauth_settings.html @@ -48,7 +48,7 @@

      Classes

      class OAuthSettings -(*,
      client_id: str | None = None,
      client_secret: str | None = None,
      scopes: Sequence[str] | str | None = None,
      user_scopes: Sequence[str] | str | None = None,
      redirect_uri: str | None = None,
      install_path: str = '/slack/install',
      install_page_rendering_enabled: bool = True,
      redirect_uri_path: str = '/slack/oauth_redirect',
      callback_options: CallbackOptions | None = None,
      success_url: str | None = None,
      failure_url: str | None = None,
      authorization_url: str | None = None,
      installation_store: slack_sdk.oauth.installation_store.installation_store.InstallationStore | None = None,
      installation_store_bot_only: bool = False,
      token_rotation_expiration_minutes: int = 120,
      user_token_resolution: str = 'authed_user',
      state_validation_enabled: bool = True,
      state_store: slack_sdk.oauth.state_store.state_store.OAuthStateStore | None = None,
      state_cookie_name: str = 'slack-app-oauth-state',
      state_expiration_seconds: int = 600,
      logger: logging.Logger = <Logger slack_bolt.oauth.oauth_settings (WARNING)>)
      +(*,
      client_id: str | None = None,
      client_secret: str | None = None,
      scopes: str | Sequence[str] | None = None,
      user_scopes: str | Sequence[str] | None = None,
      redirect_uri: str | None = None,
      install_path: str = '/slack/install',
      install_page_rendering_enabled: bool = True,
      redirect_uri_path: str = '/slack/oauth_redirect',
      callback_options: CallbackOptions | None = None,
      success_url: str | None = None,
      failure_url: str | None = None,
      authorization_url: str | None = None,
      installation_store: slack_sdk.oauth.installation_store.installation_store.InstallationStore | None = None,
      installation_store_bot_only: bool = False,
      token_rotation_expiration_minutes: int = 120,
      user_token_resolution: str = 'authed_user',
      state_validation_enabled: bool = True,
      state_store: slack_sdk.oauth.state_store.state_store.OAuthStateStore | None = None,
      state_cookie_name: str = 'slack-app-oauth-state',
      state_expiration_seconds: int = 600,
      logger: logging.Logger = <Logger slack_bolt.oauth.oauth_settings (WARNING)>)
      diff --git a/docs/reference/request/internals.html b/docs/reference/request/internals.html index bc13932ec..bd8319183 100644 --- a/docs/reference/request/internals.html +++ b/docs/reference/request/internals.html @@ -268,12 +268,12 @@

      Functions

      return channel.get("id") if "channel_id" in payload: return payload.get("channel_id") - if payload.get("event") is not None: + if isinstance(payload.get("event"), dict): return extract_channel_id(payload["event"]) - if payload.get("item") is not None: + if isinstance(payload.get("item"), dict): # reaction_added: body["event"]["item"] return extract_channel_id(payload["item"]) - if payload.get("assistant_thread") is not None: + if isinstance(payload.get("assistant_thread"), dict): # assistant_thread_started return extract_channel_id(payload["assistant_thread"]) return None @@ -317,10 +317,10 @@

      Functions

      return extract_enterprise_id(payload["authorizations"][0]) if "enterprise_id" in payload: return payload.get("enterprise_id") - if payload.get("team") is not None and "enterprise_id" in payload["team"]: + if isinstance(payload.get("team"), dict) and "enterprise_id" in payload["team"]: # In the case where the type is view_submission return payload["team"].get("enterprise_id") - if payload.get("event") is not None: + if isinstance(payload.get("event"), dict): return extract_enterprise_id(payload["event"]) return None
      @@ -337,7 +337,7 @@

      Functions

      def extract_function_bot_access_token(payload: Dict[str, Any]) -> Optional[str]:
           if payload.get("bot_access_token") is not None:
               return payload.get("bot_access_token")
      -    if payload.get("event") is not None:
      +    if isinstance(payload.get("event"), dict):
               return payload["event"].get("bot_access_token")
           return None
      @@ -354,9 +354,9 @@

      Functions

      def extract_function_execution_id(payload: Dict[str, Any]) -> Optional[str]:
           if payload.get("function_execution_id") is not None:
               return payload.get("function_execution_id")
      -    if payload.get("event") is not None:
      +    if isinstance(payload.get("event"), dict):
               return extract_function_execution_id(payload["event"])
      -    if payload.get("function_data") is not None:
      +    if isinstance(payload.get("function_data"), dict):
               return payload["function_data"].get("execution_id")
           return None
      @@ -371,9 +371,9 @@

      Functions

      Expand source code
      def extract_function_inputs(payload: Dict[str, Any]) -> Optional[Dict[str, Any]]:
      -    if payload.get("event") is not None:
      +    if isinstance(payload.get("event"), dict):
               return payload["event"].get("inputs")
      -    if payload.get("function_data") is not None:
      +    if isinstance(payload.get("function_data"), dict):
               return payload["function_data"].get("inputs")
           return None
      @@ -408,13 +408,13 @@

      Functions

      Expand source code
      def extract_team_id(payload: Dict[str, Any]) -> Optional[str]:
      -    app_installed_team_id = payload.get("view", {}).get("app_installed_team_id")
      -    if app_installed_team_id is not None:
      +    view = payload.get("view")
      +    if isinstance(view, dict) and view.get("app_installed_team_id") is not None:
               # view_submission payloads can have `view.app_installed_team_id` when a modal view that was opened
               # in a different workspace via some operations inside a Slack Connect channel.
               # Note that the same for enterprise_id does not exist. When you need to know the enterprise_id as well,
               # you have to run some query toward your InstallationStore to know the org where the team_id belongs to.
      -        return app_installed_team_id
      +        return view["app_installed_team_id"]
           if payload.get("team") is not None:
               # With org-wide installations, payload.team in interactivity payloads can be None
               # You need to extract either payload.user.team_id or payload.view.team_id as below
      @@ -429,12 +429,12 @@ 

      Functions

      return extract_team_id(payload["authorizations"][0]) if "team_id" in payload: return payload.get("team_id") - if payload.get("event") is not None: + if isinstance(payload.get("event"), dict): return extract_team_id(payload["event"]) - if payload.get("user") is not None: + if isinstance(payload.get("user"), dict): return payload["user"]["team_id"] - if payload.get("view") is not None: - return payload.get("view", {})["team_id"] + if isinstance(payload.get("view"), dict): + return payload["view"]["team_id"] return None
      @@ -448,30 +448,17 @@

      Functions

      Expand source code
      def extract_thread_ts(payload: Dict[str, Any]) -> Optional[str]:
      -    # This utility initially supports only the use cases for AI assistants, but it may be fine to add more patterns.
      -    # That said, note that thread_ts is always required for assistant threads, but it's not for channels.
      -    # Thus, blindly setting this thread_ts to say utility can break existing apps' behaviors.
      -    if is_assistant_event(payload):
      -        event = payload["event"]
      -        if (
      -            event.get("assistant_thread") is not None
      -            and event["assistant_thread"].get("channel_id") is not None
      -            and event["assistant_thread"].get("thread_ts") is not None
      -        ):
      -            # assistant_thread_started, assistant_thread_context_changed
      -            # "assistant_thread" property can exist for message event without channel_id and thread_ts
      -            # Thus, the above if check verifies these properties exist
      -            return event["assistant_thread"]["thread_ts"]
      -        elif event.get("channel") is not None:
      -            if event.get("thread_ts") is not None:
      -                # message in an assistant thread
      -                return event["thread_ts"]
      -            elif event.get("message", {}).get("thread_ts") is not None:
      -                # message_changed
      -                return event["message"]["thread_ts"]
      -            elif event.get("previous_message", {}).get("thread_ts") is not None:
      -                # message_deleted
      -                return event["previous_message"]["thread_ts"]
      +    thread_ts = payload.get("thread_ts")
      +    if thread_ts is not None:
      +        return thread_ts
      +    if isinstance(payload.get("event"), dict):
      +        return extract_thread_ts(payload["event"])
      +    if isinstance(payload.get("assistant_thread"), dict):
      +        return extract_thread_ts(payload["assistant_thread"])
      +    if isinstance(payload.get("message"), dict):
      +        return extract_thread_ts(payload["message"])
      +    if isinstance(payload.get("previous_message"), dict):
      +        return extract_thread_ts(payload["previous_message"])
           return None
      @@ -493,12 +480,12 @@

      Functions

      return user.get("id") if "user_id" in payload: return payload.get("user_id") - if payload.get("event") is not None: + if isinstance(payload.get("event"), dict): return extract_user_id(payload["event"]) - if payload.get("message") is not None: + if isinstance(payload.get("message"), dict): # message_changed: body["event"]["message"] return extract_user_id(payload["message"]) - if payload.get("previous_message") is not None: + if isinstance(payload.get("previous_message"), dict): # message_deleted: body["event"]["previous_message"] return extract_user_id(payload["previous_message"]) return None diff --git a/slack_bolt/version.py b/slack_bolt/version.py index 9b1349aea..ebda7dafb 100644 --- a/slack_bolt/version.py +++ b/slack_bolt/version.py @@ -1,3 +1,3 @@ """Check the latest version at https://pypi.org/project/slack-bolt/""" -__version__ = "1.27.0" +__version__ = "1.28.0"
  • kuHci1T>%df z)7rfOD08RAIw^p|X$YPYD&OAiE&#I&R~F2mh5~5fihTq4QGF2ZSwMaR$+KLA8lnmq zig0MYKjU5drS2L|RZuQz2pSOu-fRMX&%?tluA14B>);bGyR=-@3B+wTb#aT|;>=hp zo=o3^QlFwPh9VR2HHUVlT(d-UHOs7IAb@5VqheOo5>2=nfPw%dMI~a#81mb2$Q#x& zN4kTwK*DbuBvX&!1Uxp_rwP^7xCay?H#OE0t?ETsVth`yxh>*-u-CfIP43dUJ|IPi zc*h(P>e%Fdjs#qWn>+nlu1j0>=6WoKA3Z$I)PAD)Dap?l~T;oWh5Ii8l$J?+aH0)*`ZeI z>3?u9A^svifUTsZ0i|ug$VwH z-7T0KBY(90$ZUV}`PsJuIIksVV;xL$C8L#A1c0fhUtNJRuxH;Sy$D%o4vB{bW@cg0 zHGo8r=$FF-Y_qg<9plb@J3)X3)zDr!9ISd#KUL%L3(3dzG z=Dk+>0yi@p8j^1MY3v3-2Z=KC>`wR7Y^L2)yQG zpd6(<;L)nj3NuXL)I7z&0C|-+WB&sn`>l(C?mm=!cNl(0_)fV2K3pmx?9gE`TbMK_ zFYZS#)PiLc>uYmYFJHecsC5rStV(e@X7ls&tm~0kTc4g{lkV^Bp1x+qqOcYJk-+Iu zSD!g^1`Q@IUeJ;(42N*81)jsq8YOQ~DzD2(Utj#2wJEXR+^6hfgwB!>@42GrlcF_J z=#dH(f*MU`B}tNY7Dve+xYG2t5jfPDcP4GGCcL|t$tK^Srf3VofrSsMHrX^J z3_vJGllnEIs%&cTJ0twys{By>mUkKZPV$E)qpaG0;J{OJ!XSmXBfsJ}hiM=bpMH>^ z(;^TPMGxVFM3A%Q!n5j$uPJI9HmqY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eW;9;z%r9L4)fT*8I+(=geK_L}64{M-U=3razUrxuA%U!@hM#TNQ-a;;f2_U?{2 zTX(L@xH@94b2c#@MeXyMU``Cj;pl_Wz+XW0MYCVo>u@y|$n(>WAt2AE_D!dOH7!pb zd6O90_w01ak7)th3t-9?ddlt<+N-Q=412_z=)xY$qsMuM^JT%uFy>S!`}%qu#E$wQX+A5@bX!X5LrpI_6Bt z>zC;qv4z$PG0DF9?_S3cfBl!+{~{y&72WbLKk@%)BJlrZ0mc9S>HKra{clZ^HX)qL zS&oaWE#W6Z?ui>42VL))(iVJmt(8rT&jA-4$Wq7g z#Edd8Uc>}xiWkAmm$SCHS@!QF^hL!#VuF@YnPK0rKQk{MicFO;G}Wv^sK9xOepNAx zx>h4a40BQzA$0CT-PeD`!Y^n0b*<_!F7Ao0MqMT3i`I?J_z>|#aoeLnUAh?K%!!UZ z#M7e&l4f=@lvT58Aowwe^%f}>V~N=LDjbGkVZ5Isq{ON zi7;T!&{RoKIH7K!*D7c|K|PVZly2{jpxi}ESrvQm2b;wb=K@d3-%s9$B)H^klp1jzO$#8`PuBbh9CbN3GZ^OJpZeSDMGiH zR*q0x44xnVHZ=6zdU+)O3;tXbJJ(vdn0M%BDna$-43|ngT5f#S@s}(e_h{=pAnQ=Y zP!Eet;NIa z%+tZ!lri=xkownCT9m^+XC?@dec-R-sJK`;@vkcYce%*cvhC~NKS}(ZxS32dpU1Di t{QCbjru_O}zw?iW|NEQ&XE!(@#tNmzB}WIob1`4d5moI&X(W^D{{eD%=%@ey diff --git a/docs/static/img/favicon.ico b/docs/static/img/favicon.ico deleted file mode 100644 index e6e9a4aa71ffae29bbfaeacc2bb431272df45cc3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24499 zcmeHv2UJu^6Yh|cWDrFKBqLFRNCBOS;p-WUL`u;FG^vd#3+ z8~}3NUDJ6}p|Z_$0_rn#sj_BIsj5|PxvJb&^qXlmrU3>|YEZh$U zqlSM8m~t2_;2qE((I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`G%7fIBLTg)$FF7OdQ=EqBxc8v+EG9JbEDJfV(ft zq)$`d)$1!~?oUo5FYRH2&UUMIKK00ln+!^+;ql9-CX6+l+E)Ky+TuuPUmgB-hD&~K zDSek+nH=}9b%M&ufv$)4v7(Pr0V67zp-|*rym($`cCFHhR`jPy%>!iN2Vrfe8mRGU zG^P6Up92S<7Id1odf=894SfyXNMQoL-%A^I;Zn#lAoE1ryb{dN)TdJ!$904~Z(wjB zbZEFed%X3=-b`GZgwkD_Q65Ye*uxB6`63MB0(UJVJbg4$20sa%df{8%m!T(SrWF1` zMNqh=Yx<%@5k;8o9alld8wF2Dq*|S~;}#FAaL$-vDp(n&FY@l1Q8HVQO*CPcW)7}e z4!4pt%H5SSVF9!SIQqvmoL}+@OnLcM6TVdZQlWSC!|w5vxU-ruT|N1?y=$;i#riJIwu6KIpvqu`4h(kI#WfRiNKGwlz9y+%$cCQFQeh~Sn?9>2=atzB*s z!Wwkqsqg&qwPhq>6UV1T^%CM96a{V6g>9aQb5;aYVP}R8$H01V)cxXpu2&Jdg-a88 zEgZCMvLHHqHu&E86Z4Y|EKk%W_=hJoO0N)ey6(ug1cl-%hA^BK-~(BfHq^NmERM@a zviIJEx$-u28u6@tcaCS2y^sAPqd8~W#?(j0_arT>c;Jew@3>We41Yd&-!zr?L+_r4 z?uutb4Pg(A+gEG!C`Zsji#s^cxHP65xf0Fekuof&@cbUn2;~<#3_5pAoU_{P>`Ej3 zg#6>~=|x!uC4y~mCjod2?W$aPBaRpG=?7JX%^zC3E{I!M8OA-U7UPA}LGaWTJz0y9 zZ%4#Z?J85OJe`+#tQUt2V;CEsAtzphDc3XKE8cZY)uLJ5ePD0KV9QDd}<#88?~JbTJHc60~0js(+C(N;zrH242M1IM7E diff --git a/docs/static/img/slack-logo-on-white.png b/docs/static/img/slack-logo-on-white.png deleted file mode 100644 index 2a73996c6c402db042920a47e65a82be85e25e1c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 25811 zcme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@ zBPASS&3XT?Yb!*o%|2WU{lrBbL)A)@K`vT4sqR&r_i}E4=TXleeLP|L);6E3;n7!V*-G_;T*n!ACz-X-)C}F>M5E`1C%WjsMX_ Q{izOvV`#l%UB?^$2eLeXjsO4v diff --git a/docs/static/img/slack-logo.svg b/docs/static/img/slack-logo.svg deleted file mode 100644 index fb55f7245..000000000 --- a/docs/static/img/slack-logo.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/examples/getting_started/app.py b/examples/getting_started/app.py index 22cdf5f31..aa5223d51 100644 --- a/examples/getting_started/app.py +++ b/examples/getting_started/app.py @@ -10,7 +10,7 @@ # Listens to incoming messages that contain "hello" # To learn available listener method arguments, -# visit https://slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html +# visit https://docs.slack.dev/tools/bolt-python/reference/kwargs_injection/args.html @app.message("hello") def message_hello(message, say): # say() sends a message to the channel where the event was triggered diff --git a/scripts/generate_api_docs.sh b/scripts/generate_api_docs.sh index 68988f428..459476122 100755 --- a/scripts/generate_api_docs.sh +++ b/scripts/generate_api_docs.sh @@ -5,6 +5,6 @@ script_dir=`dirname $0` cd ${script_dir}/.. pip install -U pdoc3 -rm -rf docs/static/api-docs -pdoc slack_bolt --html -o docs/static/api-docs -open docs/static/api-docs/slack_bolt/index.html +rm -rf docs/reference +pdoc reference --html -o docs +open docs/reference/index.html From 974816eee7966adab9e14d890e0908922fa3a77a Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Wed, 13 Aug 2025 17:28:46 -0400 Subject: [PATCH 639/719] fix: make the function handler timeout 5 seconds (#1348) Co-authored-by: Eden Zimbelman --- slack_bolt/app/app.py | 6 ++- slack_bolt/app/async_app.py | 6 ++- slack_bolt/listener/async_listener.py | 4 ++ slack_bolt/listener/asyncio_runner.py | 2 +- slack_bolt/listener/custom_listener.py | 3 ++ slack_bolt/listener/listener.py | 1 + slack_bolt/listener/thread_runner.py | 2 +- tests/scenario_tests/test_function.py | 35 ++++++++++++++++- tests/scenario_tests_async/test_function.py | 43 ++++++++++++++++++++- 9 files changed, 95 insertions(+), 7 deletions(-) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index c117740a1..86909ed18 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -946,7 +946,9 @@ def reverse_string(ack: Ack, inputs: dict, complete: Complete, fail: Fail): def __call__(*args, **kwargs): functions = self._to_listener_functions(kwargs) if kwargs else list(args) primary_matcher = builtin_matchers.function_executed(callback_id=callback_id, base_logger=self._base_logger) - return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge) + return self._register_listener( + functions, primary_matcher, matchers, middleware, auto_acknowledge, acknowledgement_timeout=5 + ) return __call__ @@ -1422,6 +1424,7 @@ def _register_listener( matchers: Optional[Sequence[Callable[..., bool]]], middleware: Optional[Sequence[Union[Callable, Middleware]]], auto_acknowledgement: bool = False, + acknowledgement_timeout: int = 3, ) -> Optional[Callable[..., Optional[BoltResponse]]]: value_to_return = None if not isinstance(functions, list): @@ -1452,6 +1455,7 @@ def _register_listener( matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, + acknowledgement_timeout=acknowledgement_timeout, base_logger=self._base_logger, ) ) diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index c04326291..294fb8b0c 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -976,7 +976,9 @@ def __call__(*args, **kwargs): primary_matcher = builtin_matchers.function_executed( callback_id=callback_id, base_logger=self._base_logger, asyncio=True ) - return self._register_listener(functions, primary_matcher, matchers, middleware, auto_acknowledge) + return self._register_listener( + functions, primary_matcher, matchers, middleware, auto_acknowledge, acknowledgement_timeout=5 + ) return __call__ @@ -1456,6 +1458,7 @@ def _register_listener( matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]], middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]], auto_acknowledgement: bool = False, + acknowledgement_timeout: int = 3, ) -> Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]: value_to_return = None if not isinstance(functions, list): @@ -1491,6 +1494,7 @@ def _register_listener( matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, + acknowledgement_timeout=acknowledgement_timeout, base_logger=self._base_logger, ) ) diff --git a/slack_bolt/listener/async_listener.py b/slack_bolt/listener/async_listener.py index c8758daf2..ca069b097 100644 --- a/slack_bolt/listener/async_listener.py +++ b/slack_bolt/listener/async_listener.py @@ -15,6 +15,7 @@ class AsyncListener(metaclass=ABCMeta): ack_function: Callable[..., Awaitable[BoltResponse]] lazy_functions: Sequence[Callable[..., Awaitable[None]]] auto_acknowledgement: bool + acknowledgement_timeout: int async def async_matches( self, @@ -87,6 +88,7 @@ class AsyncCustomListener(AsyncListener): matchers: Sequence[AsyncListenerMatcher] middleware: Sequence[AsyncMiddleware] auto_acknowledgement: bool + acknowledgement_timeout: int arg_names: MutableSequence[str] logger: Logger @@ -99,6 +101,7 @@ def __init__( matchers: Sequence[AsyncListenerMatcher], middleware: Sequence[AsyncMiddleware], auto_acknowledgement: bool = False, + acknowledgement_timeout: int = 3, base_logger: Optional[Logger] = None, ): self.app_name = app_name @@ -107,6 +110,7 @@ def __init__( self.matchers = matchers self.middleware = middleware self.auto_acknowledgement = auto_acknowledgement + self.acknowledgement_timeout = acknowledgement_timeout self.arg_names = get_arg_names_of_callable(ack_function) self.logger = get_bolt_app_logger(app_name, self.ack_function, base_logger) diff --git a/slack_bolt/listener/asyncio_runner.py b/slack_bolt/listener/asyncio_runner.py index 56dc29cc1..98d3bf4f8 100644 --- a/slack_bolt/listener/asyncio_runner.py +++ b/slack_bolt/listener/asyncio_runner.py @@ -149,7 +149,7 @@ async def run_ack_function_asynchronously( self._start_lazy_function(lazy_func, request) # await for the completion of ack() in the async listener execution - while ack.response is None and time.time() - starting_time <= 3: + while ack.response is None and time.time() - starting_time <= listener.acknowledgement_timeout: await asyncio.sleep(0.01) if response is None and ack.response is None: diff --git a/slack_bolt/listener/custom_listener.py b/slack_bolt/listener/custom_listener.py index b785dab6d..e2977effa 100644 --- a/slack_bolt/listener/custom_listener.py +++ b/slack_bolt/listener/custom_listener.py @@ -18,6 +18,7 @@ class CustomListener(Listener): matchers: Sequence[ListenerMatcher] middleware: Sequence[Middleware] auto_acknowledgement: bool + acknowledgement_timeout: int = 3 arg_names: MutableSequence[str] logger: Logger @@ -30,6 +31,7 @@ def __init__( matchers: Sequence[ListenerMatcher], middleware: Sequence[Middleware], auto_acknowledgement: bool = False, + acknowledgement_timeout: int = 3, base_logger: Optional[Logger] = None, ): self.app_name = app_name @@ -38,6 +40,7 @@ def __init__( self.matchers = matchers self.middleware = middleware self.auto_acknowledgement = auto_acknowledgement + self.acknowledgement_timeout = acknowledgement_timeout self.arg_names = get_arg_names_of_callable(ack_function) self.logger = get_bolt_app_logger(app_name, self.ack_function, base_logger) diff --git a/slack_bolt/listener/listener.py b/slack_bolt/listener/listener.py index d938935df..51dadae56 100644 --- a/slack_bolt/listener/listener.py +++ b/slack_bolt/listener/listener.py @@ -13,6 +13,7 @@ class Listener(metaclass=ABCMeta): ack_function: Callable[..., BoltResponse] lazy_functions: Sequence[Callable[..., None]] auto_acknowledgement: bool + acknowledgement_timeout: int = 3 def matches( self, diff --git a/slack_bolt/listener/thread_runner.py b/slack_bolt/listener/thread_runner.py index c144daf1d..61e8d6129 100644 --- a/slack_bolt/listener/thread_runner.py +++ b/slack_bolt/listener/thread_runner.py @@ -160,7 +160,7 @@ def run_ack_function_asynchronously(): self._start_lazy_function(lazy_func, request) # await for the completion of ack() in the async listener execution - while ack.response is None and time.time() - starting_time <= 3: + while ack.response is None and time.time() - starting_time <= listener.acknowledgement_timeout: time.sleep(0.01) if response is None and ack.response is None: diff --git a/tests/scenario_tests/test_function.py b/tests/scenario_tests/test_function.py index 00f0efba8..41290de8f 100644 --- a/tests/scenario_tests/test_function.py +++ b/tests/scenario_tests/test_function.py @@ -1,6 +1,7 @@ import json import time import pytest +from unittest.mock import Mock from slack_sdk.signature import SignatureVerifier from slack_sdk.web import WebClient @@ -51,6 +52,10 @@ def build_request_from_body(self, message_body: dict) -> BoltRequest: timestamp, body = str(int(time.time())), json.dumps(message_body) return BoltRequest(body=body, headers=self.build_headers(timestamp, body)) + def setup_time_mocks(self, *, monkeypatch: pytest.MonkeyPatch, time_mock: Mock, sleep_mock: Mock): + monkeypatch.setattr(time, "time", time_mock) + monkeypatch.setattr(time, "sleep", sleep_mock) + def test_valid_callback_id_success(self): app = App( client=self.web_client, @@ -124,7 +129,7 @@ def test_auto_acknowledge_false_with_acknowledging(self): assert response.status == 200 assert_auth_test_count(self, 1) - def test_auto_acknowledge_false_without_acknowledging(self, caplog): + def test_auto_acknowledge_false_without_acknowledging(self, caplog, monkeypatch): app = App( client=self.web_client, signing_secret=self.signing_secret, @@ -132,12 +137,40 @@ def test_auto_acknowledge_false_without_acknowledging(self, caplog): app.function("reverse", auto_acknowledge=False)(just_no_ack) request = self.build_request_from_body(function_body) + self.setup_time_mocks( + monkeypatch=monkeypatch, + time_mock=Mock(side_effect=[current_time for current_time in range(100)]), + sleep_mock=Mock(), + ) response = app.dispatch(request) assert response.status == 404 assert_auth_test_count(self, 1) assert f"WARNING {just_no_ack.__name__} didn't call ack()" in caplog.text + def test_function_handler_timeout(self, monkeypatch): + app = App( + client=self.web_client, + signing_secret=self.signing_secret, + ) + app.function("reverse", auto_acknowledge=False)(just_no_ack) + request = self.build_request_from_body(function_body) + + sleep_mock = Mock() + self.setup_time_mocks( + monkeypatch=monkeypatch, + time_mock=Mock(side_effect=[current_time for current_time in range(100)]), + sleep_mock=sleep_mock, + ) + + response = app.dispatch(request) + + assert response.status == 404 + assert_auth_test_count(self, 1) + assert ( + sleep_mock.call_count == 5 + ), f"Expected handler to time out after calling time.sleep 5 times, but it was called {sleep_mock.call_count} times" + function_body = { "token": "verification_token", diff --git a/tests/scenario_tests_async/test_function.py b/tests/scenario_tests_async/test_function.py index a2c10950c..fc1299e55 100644 --- a/tests/scenario_tests_async/test_function.py +++ b/tests/scenario_tests_async/test_function.py @@ -3,6 +3,7 @@ import time import pytest +from unittest.mock import Mock, MagicMock from slack_sdk.signature import SignatureVerifier from slack_sdk.web.async_client import AsyncWebClient @@ -17,6 +18,10 @@ from tests.utils import remove_os_env_temporarily, restore_os_env +async def fake_sleep(seconds): + pass + + class TestAsyncFunction: signing_secret = "secret" valid_token = "xoxb-valid" @@ -56,6 +61,10 @@ def build_request_from_body(self, message_body: dict) -> AsyncBoltRequest: timestamp, body = str(int(time.time())), json.dumps(message_body) return AsyncBoltRequest(body=body, headers=self.build_headers(timestamp, body)) + def setup_time_mocks(self, *, monkeypatch: pytest.MonkeyPatch, time_mock: Mock, sleep_mock: MagicMock): + monkeypatch.setattr(time, "time", time_mock) + monkeypatch.setattr(asyncio, "sleep", sleep_mock) + @pytest.mark.asyncio async def test_mock_server_is_running(self): resp = await self.web_client.api_test() @@ -130,19 +139,49 @@ async def test_auto_acknowledge_false_with_acknowledging(self): await assert_auth_test_count_async(self, 1) @pytest.mark.asyncio - async def test_auto_acknowledge_false_without_acknowledging(self, caplog): + async def test_auto_acknowledge_false_without_acknowledging(self, caplog, monkeypatch): app = AsyncApp( client=self.web_client, signing_secret=self.signing_secret, ) app.function("reverse", auto_acknowledge=False)(just_no_ack) - request = self.build_request_from_body(function_body) + + self.setup_time_mocks( + monkeypatch=monkeypatch, + time_mock=Mock(side_effect=[current_time for current_time in range(100)]), + sleep_mock=MagicMock(side_effect=fake_sleep), + ) + response = await app.async_dispatch(request) assert response.status == 404 await assert_auth_test_count_async(self, 1) assert f"WARNING {just_no_ack.__name__} didn't call ack()" in caplog.text + @pytest.mark.asyncio + async def test_function_handler_timeout(self, monkeypatch): + app = AsyncApp( + client=self.web_client, + signing_secret=self.signing_secret, + ) + app.function("reverse", auto_acknowledge=False)(just_no_ack) + request = self.build_request_from_body(function_body) + + sleep_mock = MagicMock(side_effect=fake_sleep) + self.setup_time_mocks( + monkeypatch=monkeypatch, + time_mock=Mock(side_effect=[current_time for current_time in range(100)]), + sleep_mock=sleep_mock, + ) + + response = await app.async_dispatch(request) + + assert response.status == 404 + await assert_auth_test_count_async(self, 1) + assert ( + sleep_mock.call_count == 5 + ), f"Expected handler to time out after calling time.sleep 5 times, but it was called {sleep_mock.call_count} times" + function_body = { "token": "verification_token", From 76f70278403f1b0e283d2e9a7276a691d5e91c6f Mon Sep 17 00:00:00 2001 From: Luke Russell <31357343+lukegalbraithrussell@users.noreply.github.com> Date: Fri, 22 Aug 2025 12:03:31 -0700 Subject: [PATCH 640/719] Docs: adds updated bolt-py image to README (#1352) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c6b6a536c..10a44a0e5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -