|
@@ -126,10 +126,6 @@ export class SlackCtrl {
|
|
|
|
|
|
|
|
// register
|
|
// register
|
|
|
if (growiCommand.growiCommandType === 'register') {
|
|
if (growiCommand.growiCommandType === 'register') {
|
|
|
- // Send response immediately to avoid opelation_timeout error
|
|
|
|
|
- // See https://api.slack.com/apis/connections/events-api#the-events-api__responding-to-events
|
|
|
|
|
- res.send();
|
|
|
|
|
-
|
|
|
|
|
return this.registerService.process(growiCommand, authorizeResult, body as {[key:string]:string});
|
|
return this.registerService.process(growiCommand, authorizeResult, body as {[key:string]:string});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -142,10 +138,6 @@ export class SlackCtrl {
|
|
|
return 'GROWI Urls must be urls.';
|
|
return 'GROWI Urls must be urls.';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Send response immediately to avoid opelation_timeout error
|
|
|
|
|
- // See https://api.slack.com/apis/connections/events-api#the-events-api__responding-to-events
|
|
|
|
|
- res.send();
|
|
|
|
|
-
|
|
|
|
|
return this.unregisterService.process(growiCommand, authorizeResult, body as {[key:string]:string});
|
|
return this.unregisterService.process(growiCommand, authorizeResult, body as {[key:string]:string});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -178,7 +170,10 @@ export class SlackCtrl {
|
|
|
|
|
|
|
|
// Send response immediately to avoid opelation_timeout error
|
|
// Send response immediately to avoid opelation_timeout error
|
|
|
// See https://api.slack.com/apis/connections/events-api#the-events-api__responding-to-events
|
|
// See https://api.slack.com/apis/connections/events-api#the-events-api__responding-to-events
|
|
|
- res.send();
|
|
|
|
|
|
|
+ res.json({
|
|
|
|
|
+ response_type: 'ephemeral',
|
|
|
|
|
+ text: 'Processing your request ...',
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
const baseDate = new Date();
|
|
const baseDate = new Date();
|
|
|
|
|
|
|
@@ -259,10 +254,6 @@ export class SlackCtrl {
|
|
|
|
|
|
|
|
const { body, authorizeResult } = req;
|
|
const { body, authorizeResult } = req;
|
|
|
|
|
|
|
|
- // Send response immediately to avoid opelation_timeout error
|
|
|
|
|
- // See https://api.slack.com/apis/connections/events-api#the-events-api__responding-to-events
|
|
|
|
|
- res.send();
|
|
|
|
|
-
|
|
|
|
|
// pass
|
|
// pass
|
|
|
if (body.ssl_check != null) {
|
|
if (body.ssl_check != null) {
|
|
|
return;
|
|
return;
|
|
@@ -300,10 +291,18 @@ export class SlackCtrl {
|
|
|
|
|
|
|
|
// forward to GROWI server
|
|
// forward to GROWI server
|
|
|
if (callBackId === 'select_growi') {
|
|
if (callBackId === 'select_growi') {
|
|
|
|
|
+ // Send response immediately to avoid opelation_timeout error
|
|
|
|
|
+ // See https://api.slack.com/apis/connections/events-api#the-events-api__responding-to-events
|
|
|
|
|
+ res.send();
|
|
|
|
|
+
|
|
|
const selectedGrowiInformation = await this.selectGrowiService.handleSelectInteraction(installation, payload);
|
|
const selectedGrowiInformation = await this.selectGrowiService.handleSelectInteraction(installation, payload);
|
|
|
return this.sendCommand(selectedGrowiInformation.growiCommand, [selectedGrowiInformation.relation], selectedGrowiInformation.sendCommandBody);
|
|
return this.sendCommand(selectedGrowiInformation.growiCommand, [selectedGrowiInformation.relation], selectedGrowiInformation.sendCommandBody);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Send response immediately to avoid opelation_timeout error
|
|
|
|
|
+ // See https://api.slack.com/apis/connections/events-api#the-events-api__responding-to-events
|
|
|
|
|
+ res.send();
|
|
|
|
|
+
|
|
|
/*
|
|
/*
|
|
|
* forward to GROWI server
|
|
* forward to GROWI server
|
|
|
*/
|
|
*/
|