-
Couldn't load subscription status.
- Fork 680
Open
Labels
area:typescriptissues that specifically impact using the package from typescript projectsissues that specifically impact using the package from typescript projectsauto-triage-skipbugM-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documentedM-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documentedpkg:typesapplies to `@slack/types`applies to `@slack/types`
Description
Packages:
Select all that apply:
-
@slack/web-api -
@slack/rtm-api -
@slack/webhooks -
@slack/oauth -
@slack/socket-mode -
@slack/types - I don't know
Reproducible in:
The Slack SDK version
2.14.0
Node.js runtime version
N/A; I'm running Deno:
$ deno --version
# deno 2.2.2 (stable, release, aarch64-apple-darwin)
# v8 13.4.114.9-rusty
# typescript 5.7.3OS info
$ sw_vers && uname -v
# ProductName: macOS
# ProductVersion: 14.7.4
# BuildVersion: 23H420
# Darwin Kernel Version 23.6.0: Thu Dec 19 20:47:53 PST 2024; root:xnu-10063.141.1.703.2~1/RELEASE_ARM64_T6030Steps to reproduce:
Example source code:
import { PlainTextElement, WorkflowButton } from "@slack/types";
export function getAWorkflowButton(triggerUrl: string): WorkflowButton {
return {
type: "workflow_button",
text: {
type: "plain_text",
text: "I am a workflow button",
} as PlainTextElement,
action_id: "action_12345",
workflow: {
trigger: { url: triggerUrl },
},
};
}Expected result:
deno check passes.
Actual result:
deno check fails with an unknown property error for action_id even though the documented API for a workflow button specifies action_id as a required field:
Check file:///Volumes/<REDACTED>/foo.ts
TS2353 [ERROR]: Object literal may only specify known properties, and 'action_id' does not exist in type 'WorkflowButton'.
action_id: "action_12345",
~~~~~~~~~
at file:///Volumes/<REDACTED>/foo.ts:10:5
error: Type checking failed.
Suspected issue
I believe the exported WorkflowButton type from block-elements.ts is missing extending the Actionable interface.
| export interface WorkflowButton extends Confirmable { |
node-slack-sdk/packages/types/src/block-kit/extensions.ts
Lines 8 to 18 in 02f9b87
| export interface Action { | |
| type: string; | |
| /** | |
| * @description: An identifier for this action. You can use this when you receive an interaction payload to | |
| * {@link https://api.slack.com/interactivity/handling#payloads identify the source of the action}. Should be unique | |
| * among all other `action_id`s in the containing block. Maximum length for this field is 255 characters. | |
| */ | |
| action_id?: string; | |
| } | |
| export interface Actionable extends Action {} |
Spot-checking a handful of other interactive components (eg. Button, Checkboxes, NumberInput, etc.) show that they all extend the Actionable interface:
| export interface Button extends Actionable, Confirmable { |
| export interface Datepicker extends Actionable, Confirmable, Focusable, Placeholdable { |
| export interface NumberInput extends Actionable, Dispatchable, Focusable, Placeholdable { |
Metadata
Metadata
Assignees
Labels
area:typescriptissues that specifically impact using the package from typescript projectsissues that specifically impact using the package from typescript projectsauto-triage-skipbugM-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documentedM-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documentedpkg:typesapplies to `@slack/types`applies to `@slack/types`