Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Missing exported types (Channel, etc) #1747

Open
2 of 7 tasks
mlynch opened this issue Feb 12, 2024 · 7 comments
Open
2 of 7 tasks

Missing exported types (Channel, etc) #1747

mlynch opened this issue Feb 12, 2024 · 7 comments
Assignees
Labels
area:typescript issues that specifically impact using the package from typescript projects auto-triage-skip enhancement M-T: A feature request for new functionality pkg:types applies to `@slack/types` pkg:web-api applies to `@slack/web-api`

Comments

@mlynch
Copy link

mlynch commented Feb 12, 2024

(Describe your issue and goal here)

Packages:

Select all that apply:

  • @slack/web-api
  • @slack/rtm-api
  • @slack/webhooks
  • @slack/oauth
  • @slack/socket-mode
  • @slack/types
  • I don't know

I'm using @slack/web-api 7.0.1 (which is pulling in @slack/types@2.11.0). I've noticed many types returned in web api response objects are not exported, making it impossible/difficult to reference. For example, Channel is not exported, so storing a reference to the channels returned from client.conversations.list isn't clean:

  const channelsInfo = await client.conversations.list({
    types
  });

channelsInfo.channels is Channel[] but Channel is not properly exported.

There are many other examples of this in the library but I can't recall them at the moment.

@hello-ashleyintech
Copy link
Contributor

Hi, @mlynch! Thanks for submitting this issue! 🙇

Apologies for the inconveniences you're running into with types! It looks like we haven't released a new @slack/types package since Dec 20th of last year, so perhaps it's time to take a look at it once again and also do an audit to make sure that all the needed types are properly exported for use. I will assign myself to this and start working on it hopefully within the next few weeks or so! ✨

@hello-ashleyintech hello-ashleyintech added enhancement M-T: A feature request for new functionality pkg:web-api applies to `@slack/web-api` pkg:types applies to `@slack/types` and removed untriaged labels Feb 12, 2024
@hello-ashleyintech hello-ashleyintech self-assigned this Feb 12, 2024
@mlynch
Copy link
Author

mlynch commented Feb 26, 2024

Thanks @hello-ashleyintech. I'm also noticing another typing issue with @slack/types 2.11.0 and @slack/web-api 7.0.2. Basically many API calls that don't need to take any arguments now require this options argument. Passing an empty object seems to work but also breaks a lot of existing example code:

image

@hello-ashleyintech
Copy link
Contributor

hi, @mlynch! 🙌 I should be able to start work on this within the next few weeks. To help with these efforts, I wanted to see if you could provide the previous version of @slack/web-api (and consequently @slack/types) that you were using prior to upgrading to 7.0.1!

@filmaj
Copy link
Contributor

filmaj commented Mar 13, 2024

@mlynch the requirement for an options object argument - even empty - is indeed a new change in v7. We may be able to adjust that on a per-method basis for methods where it makes sense.

As for changes to response types, this is a more delicate task than adjusting arguments, as response shapes vary greatly depending on the Slack workspace operating against (the plan the workspace is on, the administration settings the workspace has set, and so on). If you have specific observations on what is missing or what could be improved (such as your Channel observation), then we will certainly take a look.

@mlynch
Copy link
Author

mlynch commented Mar 13, 2024

Makes sense. I think the issue was more the documentation and some examples were out of date, but I'm sure that was a work in progress

Copy link

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

Copy link

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.

@filmaj filmaj reopened this Apr 29, 2024
@filmaj filmaj added auto-triage-skip area:typescript issues that specifically impact using the package from typescript projects and removed auto-triage-stale labels Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:typescript issues that specifically impact using the package from typescript projects auto-triage-skip enhancement M-T: A feature request for new functionality pkg:types applies to `@slack/types` pkg:web-api applies to `@slack/web-api`
Projects
None yet
Development

No branches or pull requests

3 participants