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

Add support for functions.* (complete) methods #1702

Merged
merged 8 commits into from
Dec 7, 2023
Merged

Conversation

misscoded
Copy link
Contributor

Summary

Adds support for the following functions.* methods:

functions.completeError
functions.completeSuccess

Requirements (place an x in each [ ])

@misscoded misscoded added semver:minor enhancement M-T: A feature request for new functionality pkg:web-api applies to `@slack/web-api` labels Dec 5, 2023
@misscoded misscoded self-assigned this Dec 5, 2023
@seratch seratch added this to the [email protected] milestone Dec 5, 2023

export interface FunctionsCompleteSuccessArguments extends WebAPICallOptions, TokenOverridable {
function_execution_id: string;
outputs?: Record<string, unknown>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this paramter is required (our work-in-progress document says so too)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're probably right. I'll retest to be doubly certain and remove optionality upon confirmation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although, to be fair, outputs may not be passed on so it's odd to require them!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if i remember correctly, an empty outputs object might be required even when the function does not have any required output_parameters in its definition.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meaning the server-side can return an error code to such a request

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, on the deno side, outputs is a required property (see this code).

Copy link
Contributor

@filmaj filmaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tackling this! Yep, Kaz is right, outputs is required when marking a function as complete.


export interface FunctionsCompleteSuccessArguments extends WebAPICallOptions, TokenOverridable {
function_execution_id: string;
outputs?: Record<string, unknown>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, on the deno side, outputs is a required property (see this code).

Copy link
Contributor

@filmaj filmaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link
Member

@seratch seratch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this; now this looks good to me 👍

@misscoded misscoded merged commit 4f39371 into main Dec 7, 2023
15 checks passed
@seratch seratch deleted the feat-functions branch December 7, 2023 00:19
zimeg pushed a commit to zimeg/node-slack-sdk that referenced this pull request Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement M-T: A feature request for new functionality pkg:web-api applies to `@slack/web-api` semver:minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants