File tree Expand file tree Collapse file tree 2 files changed +17
-7
lines changed
Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -129,8 +129,8 @@ const smartapp = new SmartApp()
129129 .updated (() => { ... })
130130 .subscribedEventHandler ( ... );
131131
132- exports .handler = (event , context , callback ) => {
133- smartapp .handleLambdaCallback (event , context, callback );
132+ exports .handler = (event , context ) => {
133+ return smartapp .handleLambdaCallback (event , context);
134134};
135135```
136136There are also a few Glitch examples:
Original file line number Diff line number Diff line change @@ -354,12 +354,22 @@ class SmartApp {
354354 /**
355355 * Use with an AWS Lambda function. No signature verification is required.
356356 *
357- * @param {* } event
358- * @param {* } context
359- * @param {* } callback
357+ * @param {* } event Lambda invocation event
358+ * @param {* } context Lambda execution context
359+ * @param {* } callback optional callback function
360360 */
361- handleLambdaCallback ( event , context , callback ) {
362- this . _handleCallback ( event , responders . lambdaResponse ( callback , this . _log ) )
361+ async handleLambdaCallback ( event , context , callback ) {
362+ if ( callback ) {
363+ return this . _handleCallback ( event , responders . lambdaResponse ( callback , this . _log ) )
364+ }
365+
366+ const responder = responders . mockResponder ( this . _log )
367+ await this . _handleCallback ( event , responder )
368+ if ( responder . response . statusCode === 200 ) {
369+ return context . succeed ( responder . response )
370+ }
371+
372+ return context . fail ( responder . response )
363373 }
364374
365375 /**
You can’t perform that action at this time.
0 commit comments