Skip to content

Commit

Permalink
version 1.11.5
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Feb 25, 2022
1 parent d323034 commit a3858ea
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 34 deletions.
14 changes: 11 additions & 3 deletions docs/api-docs/slack_bolt/adapter/falcon/resource.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h1 class="title">Module <code>slack_bolt.adapter.falcon.resource</code></h1>
<pre><code class="python">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
Expand Down Expand Up @@ -78,7 +78,11 @@ <h1 class="title">Module <code>slack_bolt.adapter.falcon.resource</code></h1>
)

def _write_response(self, bolt_resp: BoltResponse, resp: Response):
resp.body = bolt_resp.body
if falcon_version.__version__.startswith(&#34;2.&#34;):
resp.body = bolt_resp.body
else:
resp.text = bolt_resp.body

status = HTTPStatus(bolt_resp.status)
resp.status = str(f&#34;{status.value} {status.phrase}&#34;)
resp.set_headers(bolt_resp.first_headers_without_set_cookie())
Expand Down Expand Up @@ -166,7 +170,11 @@ <h2 class="section-title" id="header-classes">Classes</h2>
)

def _write_response(self, bolt_resp: BoltResponse, resp: Response):
resp.body = bolt_resp.body
if falcon_version.__version__.startswith(&#34;2.&#34;):
resp.body = bolt_resp.body
else:
resp.text = bolt_resp.body

status = HTTPStatus(bolt_resp.status)
resp.status = str(f&#34;{status.value} {status.phrase}&#34;)
resp.set_headers(bolt_resp.first_headers_without_set_cookie())
Expand Down
72 changes: 51 additions & 21 deletions docs/api-docs/slack_bolt/app/async_app.html
Original file line number Diff line number Diff line change
Expand Up @@ -474,14 +474,18 @@ <h1 class="title">Module <code>slack_bolt.app.async_app</code></h1>
from .async_server import AsyncSlackAppServer

def server(
self, port: int = 3000, path: str = &#34;/slack/events&#34;
self,
port: int = 3000,
path: str = &#34;/slack/events&#34;,
host: Optional[str] = None,
) -&gt; AsyncSlackAppServer:
&#34;&#34;&#34;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)
&#34;&#34;&#34;
if (
self._server is None
Expand All @@ -492,6 +496,7 @@ <h1 class="title">Module <code>slack_bolt.app.async_app</code></h1>
port=port,
path=path,
app=self,
host=host,
)
return self._server

Expand All @@ -516,15 +521,18 @@ <h1 class="title">Module <code>slack_bolt.app.async_app</code></h1>
&#34;&#34;&#34;
return self.server(path=path).web_app

def start(self, port: int = 3000, path: str = &#34;/slack/events&#34;) -&gt; None:
def start(
self, port: int = 3000, path: str = &#34;/slack/events&#34;, host: Optional[str] = None
) -&gt; None:
&#34;&#34;&#34;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)
&#34;&#34;&#34;
self.server(port=port, path=path).start()
self.server(port=port, path=path, host=host).start()

# -------------------------
# main dispatcher
Expand Down Expand Up @@ -1866,14 +1874,18 @@ <h2 id="args">Args</h2>
from .async_server import AsyncSlackAppServer

def server(
self, port: int = 3000, path: str = &#34;/slack/events&#34;
self,
port: int = 3000,
path: str = &#34;/slack/events&#34;,
host: Optional[str] = None,
) -&gt; AsyncSlackAppServer:
&#34;&#34;&#34;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)
&#34;&#34;&#34;
if (
self._server is None
Expand All @@ -1884,6 +1896,7 @@ <h2 id="args">Args</h2>
port=port,
path=path,
app=self,
host=host,
)
return self._server

Expand All @@ -1908,15 +1921,18 @@ <h2 id="args">Args</h2>
&#34;&#34;&#34;
return self.server(path=path).web_app

def start(self, port: int = 3000, path: str = &#34;/slack/events&#34;) -&gt; None:
def start(
self, port: int = 3000, path: str = &#34;/slack/events&#34;, host: Optional[str] = None
) -&gt; None:
&#34;&#34;&#34;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)
&#34;&#34;&#34;
self.server(port=port, path=path).start()
self.server(port=port, path=path, host=host).start()

# -------------------------
# main dispatcher
Expand Down Expand Up @@ -3856,7 +3872,7 @@ <h2 id="args">Args</h2>
</details>
</dd>
<dt id="slack_bolt.app.async_app.AsyncApp.server"><code class="name flex">
<span>def <span class="ident">server</span></span>(<span>self, port: int = 3000, path: str = '/slack/events') ‑> <a title="slack_bolt.app.async_server.AsyncSlackAppServer" href="async_server.html#slack_bolt.app.async_server.AsyncSlackAppServer">AsyncSlackAppServer</a></span>
<span>def <span class="ident">server</span></span>(<span>self, port: int = 3000, path: str = '/slack/events', host: Optional[str] = None) ‑> <a title="slack_bolt.app.async_server.AsyncSlackAppServer" href="async_server.html#slack_bolt.app.async_server.AsyncSlackAppServer">AsyncSlackAppServer</a></span>
</code></dt>
<dd>
<div class="desc"><p>Configure a web server using AIOHTTP.
Expand All @@ -3865,21 +3881,28 @@ <h2 id="args">Args</h2>
<dl>
<dt><strong><code>port</code></strong></dt>
<dd>The port to listen on (Default: 3000)</dd>
</dl>
<p>path:The path to handle request from Slack (Default: <code>/slack/events</code>)</p></div>
<dt><strong><code>path</code></strong></dt>
<dd>The path to handle request from Slack (Default: <code>/slack/events</code>)</dd>
<dt><strong><code>host</code></strong></dt>
<dd>The hostname to serve the web endpoints. (Default: 0.0.0.0)</dd>
</dl></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def server(
self, port: int = 3000, path: str = &#34;/slack/events&#34;
self,
port: int = 3000,
path: str = &#34;/slack/events&#34;,
host: Optional[str] = None,
) -&gt; AsyncSlackAppServer:
&#34;&#34;&#34;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)
&#34;&#34;&#34;
if (
self._server is None
Expand All @@ -3890,6 +3913,7 @@ <h2 id="args">Args</h2>
port=port,
path=path,
app=self,
host=host,
)
return self._server</code></pre>
</details>
Expand Down Expand Up @@ -3981,7 +4005,7 @@ <h2 id="args">Args</h2>
</details>
</dd>
<dt id="slack_bolt.app.async_app.AsyncApp.start"><code class="name flex">
<span>def <span class="ident">start</span></span>(<span>self, port: int = 3000, path: str = '/slack/events') ‑> None</span>
<span>def <span class="ident">start</span></span>(<span>self, port: int = 3000, path: str = '/slack/events', host: Optional[str] = None) ‑> None</span>
</code></dt>
<dd>
<div class="desc"><p>Start a web server using AIOHTTP.
Expand All @@ -3990,21 +4014,27 @@ <h2 id="args">Args</h2>
<dl>
<dt><strong><code>port</code></strong></dt>
<dd>The port to listen on (Default: 3000)</dd>
</dl>
<p>path:The path to handle request from Slack (Default: <code>/slack/events</code>)</p></div>
<dt><strong><code>path</code></strong></dt>
<dd>The path to handle request from Slack (Default: <code>/slack/events</code>)</dd>
<dt><strong><code>host</code></strong></dt>
<dd>The hostname to serve the web endpoints. (Default: 0.0.0.0)</dd>
</dl></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def start(self, port: int = 3000, path: str = &#34;/slack/events&#34;) -&gt; None:
<pre><code class="python">def start(
self, port: int = 3000, path: str = &#34;/slack/events&#34;, host: Optional[str] = None
) -&gt; None:
&#34;&#34;&#34;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)
&#34;&#34;&#34;
self.server(port=port, path=path).start()</code></pre>
self.server(port=port, path=path, host=host).start()</code></pre>
</details>
</dd>
<dt id="slack_bolt.app.async_app.AsyncApp.step"><code class="name flex">
Expand Down
35 changes: 27 additions & 8 deletions docs/api-docs/slack_bolt/app/async_server.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ <h1 class="title">Module <code>slack_bolt.app.async_server</code></h1>
<span>Expand source code</span>
</summary>
<pre><code class="python">import logging
from typing import Optional

from aiohttp import web

Expand All @@ -38,6 +39,7 @@ <h1 class="title">Module <code>slack_bolt.app.async_server</code></h1>
class AsyncSlackAppServer:
port: int
path: str
host: str
bolt_app: &#34;AsyncApp&#34; # type:ignore
web_app: web.Application

Expand All @@ -46,6 +48,7 @@ <h1 class="title">Module <code>slack_bolt.app.async_server</code></h1>
port: int,
path: str,
app: &#34;AsyncApp&#34;, # type:ignore
host: Optional[str] = None,
):
&#34;&#34;&#34;Standalone AIOHTTP Web Server.
Refer to https://docs.aiohttp.org/en/stable/web.html for details of AIOHTTP.
Expand All @@ -54,9 +57,11 @@ <h1 class="title">Module <code>slack_bolt.app.async_server</code></h1>
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)
&#34;&#34;&#34;
self.port = port
self.path = path
self.host = host if host is not None else &#34;0.0.0.0&#34;
self.bolt_app: &#34;AsyncApp&#34; = app # type: ignore
self.web_app = web.Application()
self._bolt_oauth_flow = self.bolt_app.oauth_flow
Expand Down Expand Up @@ -100,14 +105,15 @@ <h1 class="title">Module <code>slack_bolt.app.async_server</code></h1>
bolt_resp: BoltResponse = await self.bolt_app.async_dispatch(bolt_req)
return await to_aiohttp_response(bolt_resp)

def start(self) -&gt; None:
def start(self, host: Optional[str] = None) -&gt; None:
&#34;&#34;&#34;Starts a new web server process.&#34;&#34;&#34;
if self.bolt_app.logger.level &gt; logging.INFO:
print(get_boot_message())
else:
self.bolt_app.logger.info(get_boot_message())

web.run_app(self.web_app, host=&#34;0.0.0.0&#34;, port=self.port)</code></pre>
_host = host if host is not None else self.host
web.run_app(self.web_app, host=_host, port=self.port)</code></pre>
</details>
</section>
<section>
Expand All @@ -121,7 +127,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
<dl>
<dt id="slack_bolt.app.async_server.AsyncSlackAppServer"><code class="flex name class">
<span>class <span class="ident">AsyncSlackAppServer</span></span>
<span>(</span><span>port: int, path: str, app: AsyncApp)</span>
<span>(</span><span>port: int, path: str, app: AsyncApp, host: Optional[str] = None)</span>
</code></dt>
<dd>
<div class="desc"><p>Standalone AIOHTTP Web Server.
Expand All @@ -134,6 +140,8 @@ <h2 id="args">Args</h2>
<dd>The path to receive incoming requests from Slack</dd>
<dt><strong><code>app</code></strong></dt>
<dd>The <code>AsyncApp</code> instance that is used for processing requests</dd>
<dt><strong><code>host</code></strong></dt>
<dd>The hostname to serve the web endpoints. (Default: 0.0.0.0)</dd>
</dl></div>
<details class="source">
<summary>
Expand All @@ -142,6 +150,7 @@ <h2 id="args">Args</h2>
<pre><code class="python">class AsyncSlackAppServer:
port: int
path: str
host: str
bolt_app: &#34;AsyncApp&#34; # type:ignore
web_app: web.Application

Expand All @@ -150,6 +159,7 @@ <h2 id="args">Args</h2>
port: int,
path: str,
app: &#34;AsyncApp&#34;, # type:ignore
host: Optional[str] = None,
):
&#34;&#34;&#34;Standalone AIOHTTP Web Server.
Refer to https://docs.aiohttp.org/en/stable/web.html for details of AIOHTTP.
Expand All @@ -158,9 +168,11 @@ <h2 id="args">Args</h2>
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)
&#34;&#34;&#34;
self.port = port
self.path = path
self.host = host if host is not None else &#34;0.0.0.0&#34;
self.bolt_app: &#34;AsyncApp&#34; = app # type: ignore
self.web_app = web.Application()
self._bolt_oauth_flow = self.bolt_app.oauth_flow
Expand Down Expand Up @@ -204,21 +216,26 @@ <h2 id="args">Args</h2>
bolt_resp: BoltResponse = await self.bolt_app.async_dispatch(bolt_req)
return await to_aiohttp_response(bolt_resp)

def start(self) -&gt; None:
def start(self, host: Optional[str] = None) -&gt; None:
&#34;&#34;&#34;Starts a new web server process.&#34;&#34;&#34;
if self.bolt_app.logger.level &gt; logging.INFO:
print(get_boot_message())
else:
self.bolt_app.logger.info(get_boot_message())

web.run_app(self.web_app, host=&#34;0.0.0.0&#34;, port=self.port)</code></pre>
_host = host if host is not None else self.host
web.run_app(self.web_app, host=_host, port=self.port)</code></pre>
</details>
<h3>Class variables</h3>
<dl>
<dt id="slack_bolt.app.async_server.AsyncSlackAppServer.bolt_app"><code class="name">var <span class="ident">bolt_app</span> : AsyncApp</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="slack_bolt.app.async_server.AsyncSlackAppServer.host"><code class="name">var <span class="ident">host</span> : str</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="slack_bolt.app.async_server.AsyncSlackAppServer.path"><code class="name">var <span class="ident">path</span> : str</code></dt>
<dd>
<div class="desc"></div>
Expand Down Expand Up @@ -279,22 +296,23 @@ <h3>Methods</h3>
</details>
</dd>
<dt id="slack_bolt.app.async_server.AsyncSlackAppServer.start"><code class="name flex">
<span>def <span class="ident">start</span></span>(<span>self) ‑> None</span>
<span>def <span class="ident">start</span></span>(<span>self, host: Optional[str] = None) ‑> None</span>
</code></dt>
<dd>
<div class="desc"><p>Starts a new web server process.</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def start(self) -&gt; None:
<pre><code class="python">def start(self, host: Optional[str] = None) -&gt; None:
&#34;&#34;&#34;Starts a new web server process.&#34;&#34;&#34;
if self.bolt_app.logger.level &gt; logging.INFO:
print(get_boot_message())
else:
self.bolt_app.logger.info(get_boot_message())

web.run_app(self.web_app, host=&#34;0.0.0.0&#34;, port=self.port)</code></pre>
_host = host if host is not None else self.host
web.run_app(self.web_app, host=_host, port=self.port)</code></pre>
</details>
</dd>
</dl>
Expand All @@ -321,6 +339,7 @@ <h4><code><a title="slack_bolt.app.async_server.AsyncSlackAppServer" href="#slac
<li><code><a title="slack_bolt.app.async_server.AsyncSlackAppServer.bolt_app" href="#slack_bolt.app.async_server.AsyncSlackAppServer.bolt_app">bolt_app</a></code></li>
<li><code><a title="slack_bolt.app.async_server.AsyncSlackAppServer.handle_get_requests" href="#slack_bolt.app.async_server.AsyncSlackAppServer.handle_get_requests">handle_get_requests</a></code></li>
<li><code><a title="slack_bolt.app.async_server.AsyncSlackAppServer.handle_post_requests" href="#slack_bolt.app.async_server.AsyncSlackAppServer.handle_post_requests">handle_post_requests</a></code></li>
<li><code><a title="slack_bolt.app.async_server.AsyncSlackAppServer.host" href="#slack_bolt.app.async_server.AsyncSlackAppServer.host">host</a></code></li>
<li><code><a title="slack_bolt.app.async_server.AsyncSlackAppServer.path" href="#slack_bolt.app.async_server.AsyncSlackAppServer.path">path</a></code></li>
<li><code><a title="slack_bolt.app.async_server.AsyncSlackAppServer.port" href="#slack_bolt.app.async_server.AsyncSlackAppServer.port">port</a></code></li>
<li><code><a title="slack_bolt.app.async_server.AsyncSlackAppServer.start" href="#slack_bolt.app.async_server.AsyncSlackAppServer.start">start</a></code></li>
Expand Down
Loading

0 comments on commit a3858ea

Please sign in to comment.