Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/three-turtles-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@slack/web-api": patch
---

fix(web-api): add channel_id to canvases.create method
13 changes: 7 additions & 6 deletions packages/web-api/src/types/request/canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,13 @@ export interface CanvasesAccessSetArguments extends CanvasID, Partial<ChannelIDs

// https://docs.slack.dev/reference/methods/canvases.create
export type CanvasesCreateArguments = OptionalArgument<
TokenOverridable & {
/** @description Title of the newly created canvas. */
title?: string;
/** @description Structure describing the type and contents of the Canvas being created. */
document_content?: DocumentContent;
}
TokenOverridable &
Partial<ChannelID> & {
/** @description Title of the newly created canvas. */
title?: string;
/** @description Structure describing the type and contents of the Canvas being created. */
document_content?: DocumentContent;
}
>;

// https://docs.slack.dev/reference/methods/canvases.sections.lookup
Expand Down
14 changes: 14 additions & 0 deletions packages/web-api/test/types/methods/canvas.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@ expectError(
// -- happy path
expectAssignable<Parameters<typeof web.canvases.create>>([]); // no arg ok
expectAssignable<Parameters<typeof web.canvases.create>>([{}]); // all optional args
expectAssignable<Parameters<typeof web.canvases.create>>([{ title: 'My canvas' }]); // with title
expectAssignable<Parameters<typeof web.canvases.create>>([
{
document_content: {
type: 'markdown',
markdown: '# Hello', // with document_content
},
},
]);
expectAssignable<Parameters<typeof web.canvases.create>>([
{
channel_id: 'C1234', // with channel_id
},
]);

// canvases.sections.lookup
// -- sad path
Expand Down