diff --git a/docs/api-docs/slack_sdk/index.html b/docs/api-docs/slack_sdk/index.html index 741120cf..4b36a271 100644 --- a/docs/api-docs/slack_sdk/index.html +++ b/docs/api-docs/slack_sdk/index.html @@ -3651,7 +3651,7 @@

Note

channel: Optional[str] = None, initial_comment: Optional[str] = None, thread_ts: Optional[str] = None, - request_file_info: bool = True, + request_file_info: bool = True, # since v3.23, this flag is no longer necessary **kwargs, ) -> SlackResponse: """This wrapper method provides an easy way to upload files using the following endpoints: @@ -3748,15 +3748,10 @@

Note

channel_id=channel_to_share, initial_comment=initial_comment, thread_ts=thread_ts, - token=kwargs.get("token"), **kwargs, ) - if request_file_info is True: - _attach_full_file_metadata( - client=self, - token_as_arg=kwargs.get("token"), - completion=completion, - ) + if len(completion.get("files")) == 1: # type: ignore + completion.data["file"] = completion.get("files")[0] # type: ignore return completion def files_getUploadURLExternal( @@ -10641,7 +10636,7 @@

Methods

channel: Optional[str] = None, initial_comment: Optional[str] = None, thread_ts: Optional[str] = None, - request_file_info: bool = True, + request_file_info: bool = True, # since v3.23, this flag is no longer necessary **kwargs, ) -> SlackResponse: """This wrapper method provides an easy way to upload files using the following endpoints: @@ -10738,15 +10733,10 @@

Methods

channel_id=channel_to_share, initial_comment=initial_comment, thread_ts=thread_ts, - token=kwargs.get("token"), **kwargs, ) - if request_file_info is True: - _attach_full_file_metadata( - client=self, - token_as_arg=kwargs.get("token"), - completion=completion, - ) + if len(completion.get("files")) == 1: # type: ignore + completion.data["file"] = completion.get("files")[0] # type: ignore return completion diff --git a/docs/api-docs/slack_sdk/models/blocks/block_elements.html b/docs/api-docs/slack_sdk/models/blocks/block_elements.html index bb89ad0d..57e31939 100644 --- a/docs/api-docs/slack_sdk/models/blocks/block_elements.html +++ b/docs/api-docs/slack_sdk/models/blocks/block_elements.html @@ -31,7 +31,7 @@

Module slack_sdk.models.blocks.block_elements

Module slack_sdk.models.blocks.block_elementsSubclasses
  • NumberInputElement
  • PlainTextInputElement
  • RadioButtonsElement
  • +
  • RichTextInputElement
  • SelectElement
  • StaticMultiSelectElement
  • StaticSelectElement
  • @@ -4402,6 +4442,83 @@

    Inherited members

    +
    +class RichTextInputElement +(*, action_id: Optional[str] = None, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, initial_value: Optional[Dict[str, Any]] = None, dispatch_action_config: Union[dict, DispatchActionConfig, ForwardRef(None)] = None, focus_on_load: Optional[bool] = None, **others: dict) +
    +
    +

    Block Elements are things that exists inside of your Blocks. +https://api.slack.com/reference/block-kit/block-elements

    +

    InteractiveElement that is usable in input blocks

    +

    We generally recommend using the concrete subclasses for better supports of available properties.

    +
    + +Expand source code + +
    class RichTextInputElement(InputInteractiveElement):
    +    type = "rich_text_input"
    +
    +    @property
    +    def attributes(self) -> Set[str]:
    +        return super().attributes.union(
    +            {
    +                "initial_value",
    +                "dispatch_action_config",
    +            }
    +        )
    +
    +    def __init__(
    +        self,
    +        *,
    +        action_id: Optional[str] = None,
    +        placeholder: Optional[Union[str, dict, TextObject]] = None,
    +        initial_value: Optional[Dict[str, Any]] = None,  # TODO: Add rich_text block class and its element classes
    +        dispatch_action_config: Optional[Union[dict, DispatchActionConfig]] = None,
    +        focus_on_load: Optional[bool] = None,
    +        **others: dict,
    +    ):
    +        super().__init__(
    +            type=self.type,
    +            action_id=action_id,
    +            placeholder=TextObject.parse(placeholder, PlainTextObject.type),
    +            focus_on_load=focus_on_load,
    +        )
    +        show_unknown_key_warning(self, others)
    +
    +        self.initial_value = initial_value
    +        self.dispatch_action_config = dispatch_action_config
    +
    +

    Ancestors

    + +

    Class variables

    +
    +
    var type
    +
    +
    +
    +
    +

    Inherited members

    + +
    class SelectElement (*, action_id: Optional[str] = None, placeholder: Optional[str] = None, options: Optional[Sequence[Option]] = None, option_groups: Optional[Sequence[OptionGroup]] = None, initial_option: Optional[Option] = None, confirm: Union[dict, ConfirmObject, ForwardRef(None)] = None, focus_on_load: Optional[bool] = None, **others: dict) @@ -5610,6 +5727,12 @@

  • +

    RichTextInputElement

    + +
  • +
  • SelectElement

    • option_groups_max_length
    • diff --git a/docs/api-docs/slack_sdk/models/blocks/index.html b/docs/api-docs/slack_sdk/models/blocks/index.html index abe02024..7cb16559 100644 --- a/docs/api-docs/slack_sdk/models/blocks/index.html +++ b/docs/api-docs/slack_sdk/models/blocks/index.html @@ -67,6 +67,7 @@

      Module slack_sdk.models.blocks

      from .block_elements import InteractiveElement from .block_elements import LinkButtonElement from .block_elements import OverflowMenuElement +from .block_elements import RichTextInputElement from .block_elements import PlainTextInputElement from .block_elements import EmailInputElement from .block_elements import UrlInputElement @@ -116,6 +117,7 @@

      Module slack_sdk.models.blocks

      "InteractiveElement", "LinkButtonElement", "OverflowMenuElement", + "RichTextInputElement", "PlainTextInputElement", "EmailInputElement", "UrlInputElement", @@ -3362,6 +3364,7 @@

      Subclasses

    • NumberInputElement
    • PlainTextInputElement
    • RadioButtonsElement
    • +
    • RichTextInputElement
    • SelectElement
    • StaticMultiSelectElement
    • StaticSelectElement
    • @@ -4890,6 +4893,83 @@

      Inherited members

    +
    +class RichTextInputElement +(*, action_id: Optional[str] = None, placeholder: Union[str, dict, TextObject, ForwardRef(None)] = None, initial_value: Optional[Dict[str, Any]] = None, dispatch_action_config: Union[dict, DispatchActionConfig, ForwardRef(None)] = None, focus_on_load: Optional[bool] = None, **others: dict) +
    +
    +

    Block Elements are things that exists inside of your Blocks. +https://api.slack.com/reference/block-kit/block-elements

    +

    InteractiveElement that is usable in input blocks

    +

    We generally recommend using the concrete subclasses for better supports of available properties.

    +
    + +Expand source code + +
    class RichTextInputElement(InputInteractiveElement):
    +    type = "rich_text_input"
    +
    +    @property
    +    def attributes(self) -> Set[str]:
    +        return super().attributes.union(
    +            {
    +                "initial_value",
    +                "dispatch_action_config",
    +            }
    +        )
    +
    +    def __init__(
    +        self,
    +        *,
    +        action_id: Optional[str] = None,
    +        placeholder: Optional[Union[str, dict, TextObject]] = None,
    +        initial_value: Optional[Dict[str, Any]] = None,  # TODO: Add rich_text block class and its element classes
    +        dispatch_action_config: Optional[Union[dict, DispatchActionConfig]] = None,
    +        focus_on_load: Optional[bool] = None,
    +        **others: dict,
    +    ):
    +        super().__init__(
    +            type=self.type,
    +            action_id=action_id,
    +            placeholder=TextObject.parse(placeholder, PlainTextObject.type),
    +            focus_on_load=focus_on_load,
    +        )
    +        show_unknown_key_warning(self, others)
    +
    +        self.initial_value = initial_value
    +        self.dispatch_action_config = dispatch_action_config
    +
    +

    Ancestors

    + +

    Class variables

    +
    +
    var type
    +
    +
    +
    +
    +

    Inherited members

    + +
    class SectionBlock (*, block_id: Optional[str] = None, text: Union[str, dict, TextObject, ForwardRef(None)] = None, fields: Optional[Sequence[Union[str, dict, TextObject]]] = None, accessory: Union[dict, BlockElement, ForwardRef(None)] = None, **others: dict) @@ -6623,6 +6703,12 @@

    RichTextInputElement

    + +
  • +
  • SectionBlock

    • attributes
    • diff --git a/docs/api-docs/slack_sdk/version.html b/docs/api-docs/slack_sdk/version.html index e28a0274..cbf138b0 100644 --- a/docs/api-docs/slack_sdk/version.html +++ b/docs/api-docs/slack_sdk/version.html @@ -28,7 +28,7 @@

      Module slack_sdk.version

      Expand source code
      """Check the latest version at https://pypi.org/project/slack-sdk/"""
      -__version__ = "3.22.0"
      +__version__ = "3.23.0"
      diff --git a/docs/api-docs/slack_sdk/web/async_client.html b/docs/api-docs/slack_sdk/web/async_client.html index 651240fc..952f4031 100644 --- a/docs/api-docs/slack_sdk/web/async_client.html +++ b/docs/api-docs/slack_sdk/web/async_client.html @@ -53,7 +53,6 @@

      Module slack_sdk.web.async_client

      _remove_none_values, _to_v2_file_upload_item, _upload_file_via_v2_url, - _attach_full_file_metadata_async, _validate_for_legacy_client, _print_files_upload_v2_suggestion, ) @@ -3451,7 +3450,7 @@

      Module slack_sdk.web.async_client

      channel: Optional[str] = None, initial_comment: Optional[str] = None, thread_ts: Optional[str] = None, - request_file_info: bool = True, + request_file_info: bool = True, # since v3.23, this flag is no longer necessary **kwargs, ) -> AsyncSlackResponse: """This wrapper method provides an easy way to upload files using the following endpoints: @@ -3548,15 +3547,10 @@

      Module slack_sdk.web.async_client

      channel_id=channel_to_share, initial_comment=initial_comment, thread_ts=thread_ts, - token=kwargs.get("token"), **kwargs, ) - if request_file_info is True: - await _attach_full_file_metadata_async( - client=self, - token_as_arg=kwargs.get("token"), - completion=completion, - ) + if len(completion.get("files")) == 1: # type: ignore + completion.data["file"] = completion.get("files")[0] # type: ignore return completion async def files_getUploadURLExternal( @@ -8503,7 +8497,7 @@

      Note

      channel: Optional[str] = None, initial_comment: Optional[str] = None, thread_ts: Optional[str] = None, - request_file_info: bool = True, + request_file_info: bool = True, # since v3.23, this flag is no longer necessary **kwargs, ) -> AsyncSlackResponse: """This wrapper method provides an easy way to upload files using the following endpoints: @@ -8600,15 +8594,10 @@

      Note

      channel_id=channel_to_share, initial_comment=initial_comment, thread_ts=thread_ts, - token=kwargs.get("token"), **kwargs, ) - if request_file_info is True: - await _attach_full_file_metadata_async( - client=self, - token_as_arg=kwargs.get("token"), - completion=completion, - ) + if len(completion.get("files")) == 1: # type: ignore + completion.data["file"] = completion.get("files")[0] # type: ignore return completion async def files_getUploadURLExternal( @@ -15493,7 +15482,7 @@

      Methods

      channel: Optional[str] = None, initial_comment: Optional[str] = None, thread_ts: Optional[str] = None, - request_file_info: bool = True, + request_file_info: bool = True, # since v3.23, this flag is no longer necessary **kwargs, ) -> AsyncSlackResponse: """This wrapper method provides an easy way to upload files using the following endpoints: @@ -15590,15 +15579,10 @@

      Methods

      channel_id=channel_to_share, initial_comment=initial_comment, thread_ts=thread_ts, - token=kwargs.get("token"), **kwargs, ) - if request_file_info is True: - await _attach_full_file_metadata_async( - client=self, - token_as_arg=kwargs.get("token"), - completion=completion, - ) + if len(completion.get("files")) == 1: # type: ignore + completion.data["file"] = completion.get("files")[0] # type: ignore return completion
      diff --git a/docs/api-docs/slack_sdk/web/client.html b/docs/api-docs/slack_sdk/web/client.html index 141014e4..c3ade57b 100644 --- a/docs/api-docs/slack_sdk/web/client.html +++ b/docs/api-docs/slack_sdk/web/client.html @@ -44,7 +44,6 @@

      Module slack_sdk.web.client

      _remove_none_values, _to_v2_file_upload_item, _upload_file_via_v2_url, - _attach_full_file_metadata, _validate_for_legacy_client, _print_files_upload_v2_suggestion, ) @@ -3442,7 +3441,7 @@

      Module slack_sdk.web.client

      channel: Optional[str] = None, initial_comment: Optional[str] = None, thread_ts: Optional[str] = None, - request_file_info: bool = True, + request_file_info: bool = True, # since v3.23, this flag is no longer necessary **kwargs, ) -> SlackResponse: """This wrapper method provides an easy way to upload files using the following endpoints: @@ -3539,15 +3538,10 @@

      Module slack_sdk.web.client

      channel_id=channel_to_share, initial_comment=initial_comment, thread_ts=thread_ts, - token=kwargs.get("token"), **kwargs, ) - if request_file_info is True: - _attach_full_file_metadata( - client=self, - token_as_arg=kwargs.get("token"), - completion=completion, - ) + if len(completion.get("files")) == 1: # type: ignore + completion.data["file"] = completion.get("files")[0] # type: ignore return completion def files_getUploadURLExternal( @@ -8494,7 +8488,7 @@

      Note

      channel: Optional[str] = None, initial_comment: Optional[str] = None, thread_ts: Optional[str] = None, - request_file_info: bool = True, + request_file_info: bool = True, # since v3.23, this flag is no longer necessary **kwargs, ) -> SlackResponse: """This wrapper method provides an easy way to upload files using the following endpoints: @@ -8591,15 +8585,10 @@

      Note

      channel_id=channel_to_share, initial_comment=initial_comment, thread_ts=thread_ts, - token=kwargs.get("token"), **kwargs, ) - if request_file_info is True: - _attach_full_file_metadata( - client=self, - token_as_arg=kwargs.get("token"), - completion=completion, - ) + if len(completion.get("files")) == 1: # type: ignore + completion.data["file"] = completion.get("files")[0] # type: ignore return completion def files_getUploadURLExternal( @@ -15484,7 +15473,7 @@

      Methods

      channel: Optional[str] = None, initial_comment: Optional[str] = None, thread_ts: Optional[str] = None, - request_file_info: bool = True, + request_file_info: bool = True, # since v3.23, this flag is no longer necessary **kwargs, ) -> SlackResponse: """This wrapper method provides an easy way to upload files using the following endpoints: @@ -15581,15 +15570,10 @@

      Methods

      channel_id=channel_to_share, initial_comment=initial_comment, thread_ts=thread_ts, - token=kwargs.get("token"), **kwargs, ) - if request_file_info is True: - _attach_full_file_metadata( - client=self, - token_as_arg=kwargs.get("token"), - completion=completion, - ) + if len(completion.get("files")) == 1: # type: ignore + completion.data["file"] = completion.get("files")[0] # type: ignore return completion
      diff --git a/docs/api-docs/slack_sdk/web/index.html b/docs/api-docs/slack_sdk/web/index.html index f4dc9596..1a494fb9 100644 --- a/docs/api-docs/slack_sdk/web/index.html +++ b/docs/api-docs/slack_sdk/web/index.html @@ -3862,7 +3862,7 @@

      Note

      channel: Optional[str] = None, initial_comment: Optional[str] = None, thread_ts: Optional[str] = None, - request_file_info: bool = True, + request_file_info: bool = True, # since v3.23, this flag is no longer necessary **kwargs, ) -> SlackResponse: """This wrapper method provides an easy way to upload files using the following endpoints: @@ -3959,15 +3959,10 @@

      Note

      channel_id=channel_to_share, initial_comment=initial_comment, thread_ts=thread_ts, - token=kwargs.get("token"), **kwargs, ) - if request_file_info is True: - _attach_full_file_metadata( - client=self, - token_as_arg=kwargs.get("token"), - completion=completion, - ) + if len(completion.get("files")) == 1: # type: ignore + completion.data["file"] = completion.get("files")[0] # type: ignore return completion def files_getUploadURLExternal( @@ -10852,7 +10847,7 @@

      Methods

      channel: Optional[str] = None, initial_comment: Optional[str] = None, thread_ts: Optional[str] = None, - request_file_info: bool = True, + request_file_info: bool = True, # since v3.23, this flag is no longer necessary **kwargs, ) -> SlackResponse: """This wrapper method provides an easy way to upload files using the following endpoints: @@ -10949,15 +10944,10 @@

      Methods

      channel_id=channel_to_share, initial_comment=initial_comment, thread_ts=thread_ts, - token=kwargs.get("token"), **kwargs, ) - if request_file_info is True: - _attach_full_file_metadata( - client=self, - token_as_arg=kwargs.get("token"), - completion=completion, - ) + if len(completion.get("files")) == 1: # type: ignore + completion.data["file"] = completion.get("files")[0] # type: ignore return completion diff --git a/docs/api-docs/slack_sdk/web/internal_utils.html b/docs/api-docs/slack_sdk/web/internal_utils.html index 451b75ec..3fbe8fde 100644 --- a/docs/api-docs/slack_sdk/web/internal_utils.html +++ b/docs/api-docs/slack_sdk/web/internal_utils.html @@ -435,40 +435,6 @@

      Module slack_sdk.web.internal_utils

      raise SlackRequestError(message) -def _attach_full_file_metadata( - client, # type: ignore - token_as_arg: Optional[str], - completion: Union["SlackResponse", Future], # noqa: F821 -) -> None: - _validate_for_legacy_client(completion) - _completion: Any = completion # just for satisfying pytype - # fetch all the file metadata for backward-compatibility - for f in _completion.get("files"): - full_info = client.files_info( - file=f.get("id"), - token=token_as_arg, - ) - f.update(full_info["file"]) - if len(_completion.get("files")) == 1: - _completion.data["file"] = _completion.get("files")[0] - - -async def _attach_full_file_metadata_async( - client, # type: ignore - token_as_arg: Optional[str], - completion: "SlackResponse", # noqa: F821 -) -> None: - # fetch all the file metadata for backward-compatibility - for f in completion.get("files"): - full_info = await client.files_info( - file=f.get("id"), - token=token_as_arg, - ) - f.update(full_info["file"]) - if len(completion.get("files")) == 1: - completion.data["file"] = completion.get("files")[0] - - def _print_files_upload_v2_suggestion(): message = ( "client.files_upload() may cause some issues like timeouts for relatively large files. " diff --git a/docs/api-docs/slack_sdk/web/legacy_client.html b/docs/api-docs/slack_sdk/web/legacy_client.html index 97c894c7..00827a9c 100644 --- a/docs/api-docs/slack_sdk/web/legacy_client.html +++ b/docs/api-docs/slack_sdk/web/legacy_client.html @@ -54,7 +54,6 @@

      Module slack_sdk.web.legacy_client

      _remove_none_values, _to_v2_file_upload_item, _upload_file_via_v2_url, - _attach_full_file_metadata, _validate_for_legacy_client, _print_files_upload_v2_suggestion, ) @@ -3452,7 +3451,7 @@

      Module slack_sdk.web.legacy_client

      channel: Optional[str] = None, initial_comment: Optional[str] = None, thread_ts: Optional[str] = None, - request_file_info: bool = True, + request_file_info: bool = True, # since v3.23, this flag is no longer necessary **kwargs, ) -> Union[Future, SlackResponse]: """This wrapper method provides an easy way to upload files using the following endpoints: @@ -3549,15 +3548,10 @@

      Module slack_sdk.web.legacy_client

      channel_id=channel_to_share, initial_comment=initial_comment, thread_ts=thread_ts, - token=kwargs.get("token"), **kwargs, ) - if request_file_info is True: - _attach_full_file_metadata( - client=self, - token_as_arg=kwargs.get("token"), - completion=completion, - ) + if len(completion.get("files")) == 1: # type: ignore + completion.data["file"] = completion.get("files")[0] # type: ignore return completion def files_getUploadURLExternal( @@ -8504,7 +8498,7 @@

      Note

      channel: Optional[str] = None, initial_comment: Optional[str] = None, thread_ts: Optional[str] = None, - request_file_info: bool = True, + request_file_info: bool = True, # since v3.23, this flag is no longer necessary **kwargs, ) -> Union[Future, SlackResponse]: """This wrapper method provides an easy way to upload files using the following endpoints: @@ -8601,15 +8595,10 @@

      Note

      channel_id=channel_to_share, initial_comment=initial_comment, thread_ts=thread_ts, - token=kwargs.get("token"), **kwargs, ) - if request_file_info is True: - _attach_full_file_metadata( - client=self, - token_as_arg=kwargs.get("token"), - completion=completion, - ) + if len(completion.get("files")) == 1: # type: ignore + completion.data["file"] = completion.get("files")[0] # type: ignore return completion def files_getUploadURLExternal( @@ -15494,7 +15483,7 @@

      Methods

      channel: Optional[str] = None, initial_comment: Optional[str] = None, thread_ts: Optional[str] = None, - request_file_info: bool = True, + request_file_info: bool = True, # since v3.23, this flag is no longer necessary **kwargs, ) -> Union[Future, SlackResponse]: """This wrapper method provides an easy way to upload files using the following endpoints: @@ -15591,15 +15580,10 @@

      Methods

      channel_id=channel_to_share, initial_comment=initial_comment, thread_ts=thread_ts, - token=kwargs.get("token"), **kwargs, ) - if request_file_info is True: - _attach_full_file_metadata( - client=self, - token_as_arg=kwargs.get("token"), - completion=completion, - ) + if len(completion.get("files")) == 1: # type: ignore + completion.data["file"] = completion.get("files")[0] # type: ignore return completion diff --git a/slack_sdk/version.py b/slack_sdk/version.py index 2b32757a..db0f5d09 100644 --- a/slack_sdk/version.py +++ b/slack_sdk/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-sdk/""" -__version__ = "3.22.0" +__version__ = "3.23.0"