Skip to content

Commit 65e502d

Browse files
committed
Update API docs
1 parent 60c69fc commit 65e502d

File tree

95 files changed

+1350
-4094
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+1350
-4094
lines changed

docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_handler.html

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ <h1 class="title">Module <code>slack_bolt.adapter.aws_lambda.chalice_handler</co
4949
def __init__(self, app: App, chalice: Chalice, lambda_client: Optional[BaseClient] = None): # type: ignore
5050
self.app = app
5151
self.chalice = chalice
52-
self.logger = get_bolt_app_logger(
53-
app.name, ChaliceSlackRequestHandler, app.logger
54-
)
52+
self.logger = get_bolt_app_logger(app.name, ChaliceSlackRequestHandler, app.logger)
5553

5654
if getenv(&#34;AWS_CHALICE_CLI_MODE&#34;) == &#34;true&#34; and lambda_client is None:
5755
try:
@@ -92,10 +90,7 @@ <h1 class="title">Module <code>slack_bolt.adapter.aws_lambda.chalice_handler</co
9290
bolt_req: BoltRequest = to_bolt_request(request, body)
9391
query = bolt_req.query
9492
is_callback = query is not None and (
95-
(
96-
_first_value(query, &#34;code&#34;) is not None
97-
and _first_value(query, &#34;state&#34;) is not None
98-
)
93+
(_first_value(query, &#34;code&#34;) is not None and _first_value(query, &#34;state&#34;) is not None)
9994
or _first_value(query, &#34;error&#34;) is not None
10095
)
10196
if is_callback:
@@ -223,9 +218,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
223218
def __init__(self, app: App, chalice: Chalice, lambda_client: Optional[BaseClient] = None): # type: ignore
224219
self.app = app
225220
self.chalice = chalice
226-
self.logger = get_bolt_app_logger(
227-
app.name, ChaliceSlackRequestHandler, app.logger
228-
)
221+
self.logger = get_bolt_app_logger(app.name, ChaliceSlackRequestHandler, app.logger)
229222

230223
if getenv(&#34;AWS_CHALICE_CLI_MODE&#34;) == &#34;true&#34; and lambda_client is None:
231224
try:
@@ -266,10 +259,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
266259
bolt_req: BoltRequest = to_bolt_request(request, body)
267260
query = bolt_req.query
268261
is_callback = query is not None and (
269-
(
270-
_first_value(query, &#34;code&#34;) is not None
271-
and _first_value(query, &#34;state&#34;) is not None
272-
)
262+
(_first_value(query, &#34;code&#34;) is not None and _first_value(query, &#34;state&#34;) is not None)
273263
or _first_value(query, &#34;error&#34;) is not None
274264
)
275265
if is_callback:
@@ -340,10 +330,7 @@ <h3>Methods</h3>
340330
bolt_req: BoltRequest = to_bolt_request(request, body)
341331
query = bolt_req.query
342332
is_callback = query is not None and (
343-
(
344-
_first_value(query, &#34;code&#34;) is not None
345-
and _first_value(query, &#34;state&#34;) is not None
346-
)
333+
(_first_value(query, &#34;code&#34;) is not None and _first_value(query, &#34;state&#34;) is not None)
347334
or _first_value(query, &#34;error&#34;) is not None
348335
)
349336
if is_callback:

docs/api-docs/slack_bolt/adapter/aws_lambda/chalice_lazy_listener_runner.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ <h1 class="title">Module <code>slack_bolt.adapter.aws_lambda.chalice_lazy_listen
4848

4949
chalice_request: dict = request.context[&#34;chalice_request&#34;]
5050
request.headers[&#34;x-slack-bolt-lazy-only&#34;] = [&#34;1&#34;]
51-
request.headers[&#34;x-slack-bolt-lazy-function-name&#34;] = [
52-
request.lazy_function_name
53-
]
51+
request.headers[&#34;x-slack-bolt-lazy-function-name&#34;] = [request.lazy_function_name]
5452
payload = {
5553
&#34;method&#34;: &#34;NONE&#34;,
5654
&#34;headers&#34;: {k: v[0] for k, v in request.headers.items()},
@@ -99,9 +97,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
9997

10098
chalice_request: dict = request.context[&#34;chalice_request&#34;]
10199
request.headers[&#34;x-slack-bolt-lazy-only&#34;] = [&#34;1&#34;]
102-
request.headers[&#34;x-slack-bolt-lazy-function-name&#34;] = [
103-
request.lazy_function_name
104-
]
100+
request.headers[&#34;x-slack-bolt-lazy-function-name&#34;] = [request.lazy_function_name]
105101
payload = {
106102
&#34;method&#34;: &#34;NONE&#34;,
107103
&#34;headers&#34;: {k: v[0] for k, v in request.headers.items()},

docs/api-docs/slack_bolt/adapter/aws_lambda/handler.html

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ <h1 class="title">Module <code>slack_bolt.adapter.aws_lambda.handler</code></h1>
4343
def __init__(self, app: App): # type: ignore
4444
self.app = app
4545
self.logger = get_bolt_app_logger(app.name, SlackRequestHandler, app.logger)
46-
self.app.listener_runner.lazy_listener_runner = LambdaLazyListenerRunner(
47-
self.logger
48-
)
46+
self.app.listener_runner.lazy_listener_runner = LambdaLazyListenerRunner(self.logger)
4947
if self.app.oauth_flow is not None:
5048
self.app.oauth_flow.settings.redirect_uri_page_renderer.install_path = &#34;?&#34;
5149

@@ -72,10 +70,7 @@ <h1 class="title">Module <code>slack_bolt.adapter.aws_lambda.handler</code></h1>
7270
bolt_req: BoltRequest = to_bolt_request(event)
7371
query = bolt_req.query
7472
is_callback = query is not None and (
75-
(
76-
_first_value(query, &#34;code&#34;) is not None
77-
and _first_value(query, &#34;state&#34;) is not None
78-
)
73+
(_first_value(query, &#34;code&#34;) is not None and _first_value(query, &#34;state&#34;) is not None)
7974
or _first_value(query, &#34;error&#34;) is not None
8075
)
8176
if is_callback:
@@ -89,6 +84,7 @@ <h1 class="title">Module <code>slack_bolt.adapter.aws_lambda.handler</code></h1>
8984
# https://docs.aws.amazon.com/lambda/latest/dg/python-context.html
9085
aws_lambda_function_name = context.function_name
9186
bolt_req.context[&#34;aws_lambda_function_name&#34;] = aws_lambda_function_name
87+
bolt_req.context[&#34;aws_lambda_invoked_function_arn&#34;] = context.invoked_function_arn
9288
bolt_req.context[&#34;lambda_request&#34;] = event
9389
bolt_resp = self.app.dispatch(bolt_req)
9490
aws_response = to_aws_response(bolt_resp)
@@ -229,9 +225,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
229225
def __init__(self, app: App): # type: ignore
230226
self.app = app
231227
self.logger = get_bolt_app_logger(app.name, SlackRequestHandler, app.logger)
232-
self.app.listener_runner.lazy_listener_runner = LambdaLazyListenerRunner(
233-
self.logger
234-
)
228+
self.app.listener_runner.lazy_listener_runner = LambdaLazyListenerRunner(self.logger)
235229
if self.app.oauth_flow is not None:
236230
self.app.oauth_flow.settings.redirect_uri_page_renderer.install_path = &#34;?&#34;
237231

@@ -258,10 +252,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
258252
bolt_req: BoltRequest = to_bolt_request(event)
259253
query = bolt_req.query
260254
is_callback = query is not None and (
261-
(
262-
_first_value(query, &#34;code&#34;) is not None
263-
and _first_value(query, &#34;state&#34;) is not None
264-
)
255+
(_first_value(query, &#34;code&#34;) is not None and _first_value(query, &#34;state&#34;) is not None)
265256
or _first_value(query, &#34;error&#34;) is not None
266257
)
267258
if is_callback:
@@ -275,6 +266,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
275266
# https://docs.aws.amazon.com/lambda/latest/dg/python-context.html
276267
aws_lambda_function_name = context.function_name
277268
bolt_req.context[&#34;aws_lambda_function_name&#34;] = aws_lambda_function_name
269+
bolt_req.context[&#34;aws_lambda_invoked_function_arn&#34;] = context.invoked_function_arn
278270
bolt_req.context[&#34;lambda_request&#34;] = event
279271
bolt_resp = self.app.dispatch(bolt_req)
280272
aws_response = to_aws_response(bolt_resp)
@@ -334,10 +326,7 @@ <h3>Methods</h3>
334326
bolt_req: BoltRequest = to_bolt_request(event)
335327
query = bolt_req.query
336328
is_callback = query is not None and (
337-
(
338-
_first_value(query, &#34;code&#34;) is not None
339-
and _first_value(query, &#34;state&#34;) is not None
340-
)
329+
(_first_value(query, &#34;code&#34;) is not None and _first_value(query, &#34;state&#34;) is not None)
341330
or _first_value(query, &#34;error&#34;) is not None
342331
)
343332
if is_callback:
@@ -351,6 +340,7 @@ <h3>Methods</h3>
351340
# https://docs.aws.amazon.com/lambda/latest/dg/python-context.html
352341
aws_lambda_function_name = context.function_name
353342
bolt_req.context[&#34;aws_lambda_function_name&#34;] = aws_lambda_function_name
343+
bolt_req.context[&#34;aws_lambda_invoked_function_arn&#34;] = context.invoked_function_arn
354344
bolt_req.context[&#34;lambda_request&#34;] = event
355345
bolt_resp = self.app.dispatch(bolt_req)
356346
aws_response = to_aws_response(bolt_resp)

docs/api-docs/slack_bolt/adapter/aws_lambda/index.html

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
8787
def __init__(self, app: App): # type: ignore
8888
self.app = app
8989
self.logger = get_bolt_app_logger(app.name, SlackRequestHandler, app.logger)
90-
self.app.listener_runner.lazy_listener_runner = LambdaLazyListenerRunner(
91-
self.logger
92-
)
90+
self.app.listener_runner.lazy_listener_runner = LambdaLazyListenerRunner(self.logger)
9391
if self.app.oauth_flow is not None:
9492
self.app.oauth_flow.settings.redirect_uri_page_renderer.install_path = &#34;?&#34;
9593

@@ -116,10 +114,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
116114
bolt_req: BoltRequest = to_bolt_request(event)
117115
query = bolt_req.query
118116
is_callback = query is not None and (
119-
(
120-
_first_value(query, &#34;code&#34;) is not None
121-
and _first_value(query, &#34;state&#34;) is not None
122-
)
117+
(_first_value(query, &#34;code&#34;) is not None and _first_value(query, &#34;state&#34;) is not None)
123118
or _first_value(query, &#34;error&#34;) is not None
124119
)
125120
if is_callback:
@@ -133,6 +128,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
133128
# https://docs.aws.amazon.com/lambda/latest/dg/python-context.html
134129
aws_lambda_function_name = context.function_name
135130
bolt_req.context[&#34;aws_lambda_function_name&#34;] = aws_lambda_function_name
131+
bolt_req.context[&#34;aws_lambda_invoked_function_arn&#34;] = context.invoked_function_arn
136132
bolt_req.context[&#34;lambda_request&#34;] = event
137133
bolt_resp = self.app.dispatch(bolt_req)
138134
aws_response = to_aws_response(bolt_resp)
@@ -192,10 +188,7 @@ <h3>Methods</h3>
192188
bolt_req: BoltRequest = to_bolt_request(event)
193189
query = bolt_req.query
194190
is_callback = query is not None and (
195-
(
196-
_first_value(query, &#34;code&#34;) is not None
197-
and _first_value(query, &#34;state&#34;) is not None
198-
)
191+
(_first_value(query, &#34;code&#34;) is not None and _first_value(query, &#34;state&#34;) is not None)
199192
or _first_value(query, &#34;error&#34;) is not None
200193
)
201194
if is_callback:
@@ -209,6 +202,7 @@ <h3>Methods</h3>
209202
# https://docs.aws.amazon.com/lambda/latest/dg/python-context.html
210203
aws_lambda_function_name = context.function_name
211204
bolt_req.context[&#34;aws_lambda_function_name&#34;] = aws_lambda_function_name
205+
bolt_req.context[&#34;aws_lambda_invoked_function_arn&#34;] = context.invoked_function_arn
212206
bolt_req.context[&#34;lambda_request&#34;] = event
213207
bolt_resp = self.app.dispatch(bolt_req)
214208
aws_response = to_aws_response(bolt_resp)

docs/api-docs/slack_bolt/adapter/aws_lambda/lambda_s3_oauth_flow.html

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -58,26 +58,18 @@ <h1 class="title">Module <code>slack_bolt.adapter.aws_lambda.lambda_s3_oauth_flo
5858
client_id=os.environ[&#34;SLACK_CLIENT_ID&#34;],
5959
client_secret=os.environ[&#34;SLACK_CLIENT_SECRET&#34;],
6060
)
61-
oauth_state_bucket_name = (
62-
oauth_state_bucket_name or os.environ[&#34;SLACK_STATE_S3_BUCKET_NAME&#34;]
63-
)
64-
installation_bucket_name = (
65-
installation_bucket_name or os.environ[&#34;SLACK_INSTALLATION_S3_BUCKET_NAME&#34;]
66-
)
61+
oauth_state_bucket_name = oauth_state_bucket_name or os.environ[&#34;SLACK_STATE_S3_BUCKET_NAME&#34;]
62+
installation_bucket_name = installation_bucket_name or os.environ[&#34;SLACK_INSTALLATION_S3_BUCKET_NAME&#34;]
6763
self.s3_client = boto3.client(&#34;s3&#34;)
68-
if settings.state_store is None or not isinstance(
69-
settings.state_store, AmazonS3OAuthStateStore
70-
):
64+
if settings.state_store is None or not isinstance(settings.state_store, AmazonS3OAuthStateStore):
7165
settings.state_store = AmazonS3OAuthStateStore(
7266
logger=logger,
7367
s3_client=self.s3_client,
7468
bucket_name=oauth_state_bucket_name,
7569
expiration_seconds=settings.state_expiration_seconds,
7670
)
7771

78-
if settings.installation_store is None or not isinstance(
79-
settings.installation_store, AmazonS3InstallationStore
80-
):
72+
if settings.installation_store is None or not isinstance(settings.installation_store, AmazonS3InstallationStore):
8173
settings.installation_store = AmazonS3InstallationStore(
8274
logger=logger,
8375
s3_client=self.s3_client,
@@ -155,26 +147,18 @@ <h2 id="args">Args</h2>
155147
client_id=os.environ[&#34;SLACK_CLIENT_ID&#34;],
156148
client_secret=os.environ[&#34;SLACK_CLIENT_SECRET&#34;],
157149
)
158-
oauth_state_bucket_name = (
159-
oauth_state_bucket_name or os.environ[&#34;SLACK_STATE_S3_BUCKET_NAME&#34;]
160-
)
161-
installation_bucket_name = (
162-
installation_bucket_name or os.environ[&#34;SLACK_INSTALLATION_S3_BUCKET_NAME&#34;]
163-
)
150+
oauth_state_bucket_name = oauth_state_bucket_name or os.environ[&#34;SLACK_STATE_S3_BUCKET_NAME&#34;]
151+
installation_bucket_name = installation_bucket_name or os.environ[&#34;SLACK_INSTALLATION_S3_BUCKET_NAME&#34;]
164152
self.s3_client = boto3.client(&#34;s3&#34;)
165-
if settings.state_store is None or not isinstance(
166-
settings.state_store, AmazonS3OAuthStateStore
167-
):
153+
if settings.state_store is None or not isinstance(settings.state_store, AmazonS3OAuthStateStore):
168154
settings.state_store = AmazonS3OAuthStateStore(
169155
logger=logger,
170156
s3_client=self.s3_client,
171157
bucket_name=oauth_state_bucket_name,
172158
expiration_seconds=settings.state_expiration_seconds,
173159
)
174160

175-
if settings.installation_store is None or not isinstance(
176-
settings.installation_store, AmazonS3InstallationStore
177-
):
161+
if settings.installation_store is None or not isinstance(settings.installation_store, AmazonS3InstallationStore):
178162
settings.installation_store = AmazonS3InstallationStore(
179163
logger=logger,
180164
s3_client=self.s3_client,

docs/api-docs/slack_bolt/adapter/aws_lambda/lazy_listener_runner.html

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@ <h1 class="title">Module <code>slack_bolt.adapter.aws_lambda.lazy_listener_runne
4848
event: dict = request.context[&#34;lambda_request&#34;]
4949
headers = event[&#34;headers&#34;]
5050
headers[&#34;x-slack-bolt-lazy-only&#34;] = &#34;1&#34; # not an array
51-
headers[
52-
&#34;x-slack-bolt-lazy-function-name&#34;
53-
] = request.lazy_function_name # not an array
51+
headers[&#34;x-slack-bolt-lazy-function-name&#34;] = request.lazy_function_name # not an array
5452
event[&#34;method&#34;] = &#34;NONE&#34;
5553
invocation = self.lambda_client.invoke(
56-
FunctionName=request.context[&#34;aws_lambda_function_name&#34;],
54+
FunctionName=request.context[&#34;aws_lambda_invoked_function_arn&#34;],
5755
InvocationType=&#34;Event&#34;,
5856
Payload=json.dumps(event),
5957
)
@@ -91,12 +89,10 @@ <h2 class="section-title" id="header-classes">Classes</h2>
9189
event: dict = request.context[&#34;lambda_request&#34;]
9290
headers = event[&#34;headers&#34;]
9391
headers[&#34;x-slack-bolt-lazy-only&#34;] = &#34;1&#34; # not an array
94-
headers[
95-
&#34;x-slack-bolt-lazy-function-name&#34;
96-
] = request.lazy_function_name # not an array
92+
headers[&#34;x-slack-bolt-lazy-function-name&#34;] = request.lazy_function_name # not an array
9793
event[&#34;method&#34;] = &#34;NONE&#34;
9894
invocation = self.lambda_client.invoke(
99-
FunctionName=request.context[&#34;aws_lambda_function_name&#34;],
95+
FunctionName=request.context[&#34;aws_lambda_invoked_function_arn&#34;],
10096
InvocationType=&#34;Event&#34;,
10197
Payload=json.dumps(event),
10298
)

docs/api-docs/slack_bolt/adapter/aws_lambda/local_lambda_client.html

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ <h1 class="title">Module <code>slack_bolt.adapter.aws_lambda.local_lambda_client
4747
Payload: str = &#34;{}&#34;,
4848
) -&gt; InvokeResponse:
4949
scoped = self._config.scope(self._config.chalice_stage, FunctionName)
50-
lambda_context = LambdaContext(
51-
FunctionName, memory_size=scoped.lambda_memory_size
52-
)
50+
lambda_context = LambdaContext(FunctionName, memory_size=scoped.lambda_memory_size)
5351

5452
with self._patched_env_vars(scoped.environment_variables):
5553
response = self._app(json.loads(Payload), lambda_context)
@@ -89,9 +87,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
8987
Payload: str = &#34;{}&#34;,
9088
) -&gt; InvokeResponse:
9189
scoped = self._config.scope(self._config.chalice_stage, FunctionName)
92-
lambda_context = LambdaContext(
93-
FunctionName, memory_size=scoped.lambda_memory_size
94-
)
90+
lambda_context = LambdaContext(FunctionName, memory_size=scoped.lambda_memory_size)
9591

9692
with self._patched_env_vars(scoped.environment_variables):
9793
response = self._app(json.loads(Payload), lambda_context)
@@ -119,9 +115,7 @@ <h3>Methods</h3>
119115
Payload: str = &#34;{}&#34;,
120116
) -&gt; InvokeResponse:
121117
scoped = self._config.scope(self._config.chalice_stage, FunctionName)
122-
lambda_context = LambdaContext(
123-
FunctionName, memory_size=scoped.lambda_memory_size
124-
)
118+
lambda_context = LambdaContext(FunctionName, memory_size=scoped.lambda_memory_size)
125119

126120
with self._patched_env_vars(scoped.environment_variables):
127121
response = self._app(json.loads(Payload), lambda_context)

0 commit comments

Comments
 (0)