feat(interactions): add launchActivity method (#10646)

* feat(interactions): add launchActivity method

* chore: suggestion

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>

* chore: suggestion

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>

* fix: overload and add tests

* chore: wording

* chore: wording

* chore: spacing

---------

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Naiyar
2025-01-24 15:11:18 +06:00
committed by GitHub
parent 3d85d96f08
commit a3fa1a8dcd
2 changed files with 81 additions and 0 deletions

View File

@@ -131,4 +131,19 @@ describe('Interaction with_response overloads.', () => {
}),
);
});
test('Launch activity returns undefined.', () => {
assertType<Promise<undefined>>(api.interactions.launchActivity(SNOWFLAKE, TOKEN, { with_response: false }));
assertType<Promise<undefined>>(api.interactions.launchActivity(SNOWFLAKE, TOKEN));
});
test('Launch activity returns RESTPostAPIInteractionCallbackWithResponseResult.', () =>
assertType<Promise<RESTPostAPIInteractionCallbackWithResponseResult>>(
api.interactions.launchActivity(SNOWFLAKE, TOKEN, { with_response: true }),
));
test('Launch activity returns either RESTPostAPIInteractionCallbackWithResponseResult or undefined.', () =>
assertType<Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>>(
api.interactions.launchActivity(SNOWFLAKE, TOKEN, { with_response: boolValue }),
));
});