slackapi / deno-slack-sdk

SDK for building Run on Slack apps using Deno
https://api.slack.com/automation
MIT License
155 stars 27 forks source link

[FEATURE] slack function argument types are `any` when adding step to workflow #269

Open rsata opened 7 months ago

rsata commented 7 months ago

The deno-slack versions

"deno-slack-sdk/": "https://deno.land/x/deno_slack_sdk@2.5.0/",
"deno-slack-api/": "https://deno.land/x/deno_slack_api@2.1.2/"

Deno runtime version

deno 1.39.1 (release, aarch64-apple-darwin)
v8 12.0.267.8
typescript 5.3.3

OS info

ProductName:        macOS
ProductVersion:     13.3.1
ProductVersionExtra:    (a)
BuildVersion:       22E772610a
Darwin Kernel Version 22.4.0: Mon Mar  6 20:59:58 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6020

Describe the bug

When adding a slack function step to a workflow, the types for the arguments of that function are any. For example, for Schema.slack.functions.ReplyInThread I would have expected to see the types from https://github.com/slackapi/deno-slack-sdk/blob/5413c437e61f661e85a947eb3995c4c4870d7e57/src/schema/slack/types/custom/message_context.ts

Screenshot 2024-01-24 at 12 19 43 PM

Steps to reproduce

  1. add step to workflow that uses a slack function
  2. observe types

This should tell me that message_context is the wrong type but it does not

someWorkflow.addStep(
  Schema.slack.functions.ReplyInThread,
  {
    message_context: "this is an invalid message_context",
    message: 'hi',
  },
);

Expected result

Have the correct types

Actual result

Type any

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

filmaj commented 7 months ago

Thanks for filing. Indeed this is a known issue with the SDK. We do not have plans on addressing this at this time (it is quite a complex feature!) but we would happily accept contributions to address this feature gap.