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

Fix #1038 by making the AwsLambdaReceiver example TS compatible #1039

Merged
merged 1 commit into from
Aug 6, 2021
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
2 changes: 1 addition & 1 deletion examples/deploy-aws-lambda/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ app.message('goodbye', async ({ message, say }) => {

// Handle the Lambda function event
module.exports.handler = async (event, context, callback) => {
const handler = await app.start();
const handler = await awsLambdaReceiver.start();
return handler(event, context, callback);
}
1 change: 1 addition & 0 deletions src/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ export default class App {
public start(
...args: Parameters<HTTPReceiver['start'] | SocketModeReceiver['start']>
): ReturnType<HTTPReceiver['start']> {
// TODO: HTTPReceiver['start'] should be the actual receiver's return type
return this.receiver.start(...args) as ReturnType<HTTPReceiver['start']>;
}

Expand Down
3 changes: 2 additions & 1 deletion src/receivers/AwsLambdaReceiver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import AwsLambdaReceiver from './AwsLambdaReceiver';
import crypto from 'crypto';
import rewiremock from 'rewiremock';
import { WebClientOptions } from '@slack/web-api';
import { AwsHandler } from './AwsLambdaReceiver';

describe('AwsLambdaReceiver', function () {
beforeEach(function () {});
Expand Down Expand Up @@ -48,7 +49,7 @@ describe('AwsLambdaReceiver', function () {
const awsReceiver = new AwsLambdaReceiver({
signingSecret: 'my-secret',
});
const handler = await awsReceiver.start();
const handler: AwsHandler = await awsReceiver.start();
assert.isNotNull(handler);
});

Expand Down