|
@@ -101,7 +101,7 @@ module.exports = (crowi) => {
|
|
|
slackBotTokenEnvVars: crowi.configManager.getConfigFromEnvVars('crowi', 'slackbot:token'),
|
|
slackBotTokenEnvVars: crowi.configManager.getConfigFromEnvVars('crowi', 'slackbot:token'),
|
|
|
slackSigningSecret: crowi.configManager.getConfig('crowi', 'slackbot:signingSecret'),
|
|
slackSigningSecret: crowi.configManager.getConfig('crowi', 'slackbot:signingSecret'),
|
|
|
slackBotToken: crowi.configManager.getConfig('crowi', 'slackbot:token'),
|
|
slackBotToken: crowi.configManager.getConfig('crowi', 'slackbot:token'),
|
|
|
- isBoltSetup: crowi.boltService.isBoltSetup,
|
|
|
|
|
|
|
+ isSetupSlackBot: crowi.slackService.isSetupSlackBot,
|
|
|
},
|
|
},
|
|
|
// TODO imple when creating with proxy
|
|
// TODO imple when creating with proxy
|
|
|
customBotWithProxySettings: {
|
|
customBotWithProxySettings: {
|
|
@@ -142,9 +142,9 @@ module.exports = (crowi) => {
|
|
|
try {
|
|
try {
|
|
|
await updateSlackBotSettings(requestParams);
|
|
await updateSlackBotSettings(requestParams);
|
|
|
|
|
|
|
|
- // initialize bolt service
|
|
|
|
|
- crowi.boltService.initialize();
|
|
|
|
|
- crowi.boltService.publishUpdatedMessage();
|
|
|
|
|
|
|
+ // initialize slack service
|
|
|
|
|
+ crowi.slackService.initialize();
|
|
|
|
|
+ crowi.slackService.publishUpdatedMessage();
|
|
|
|
|
|
|
|
const slackIntegrationSettingsParams = {
|
|
const slackIntegrationSettingsParams = {
|
|
|
currentBotType: crowi.configManager.getConfig('crowi', 'slackbot:currentBotType'),
|
|
currentBotType: crowi.configManager.getConfig('crowi', 'slackbot:currentBotType'),
|
|
@@ -190,9 +190,9 @@ module.exports = (crowi) => {
|
|
|
try {
|
|
try {
|
|
|
await updateSlackBotSettings(requestParams);
|
|
await updateSlackBotSettings(requestParams);
|
|
|
|
|
|
|
|
- // initialize bolt service
|
|
|
|
|
- crowi.boltService.initialize();
|
|
|
|
|
- crowi.boltService.publishUpdatedMessage();
|
|
|
|
|
|
|
+ // initialize slack service
|
|
|
|
|
+ crowi.slackService.initialize();
|
|
|
|
|
+ crowi.slackService.publishUpdatedMessage();
|
|
|
|
|
|
|
|
// TODO Impl to delete AccessToken both of Proxy and GROWI when botType changes.
|
|
// TODO Impl to delete AccessToken both of Proxy and GROWI when botType changes.
|
|
|
const customBotWithoutProxySettingParams = {
|
|
const customBotWithoutProxySettingParams = {
|
|
@@ -262,9 +262,9 @@ module.exports = (crowi) => {
|
|
|
const accessToken = generateAccessToken(req.user);
|
|
const accessToken = generateAccessToken(req.user);
|
|
|
await updateSlackBotSettings({ 'slackbot:access-token': accessToken });
|
|
await updateSlackBotSettings({ 'slackbot:access-token': accessToken });
|
|
|
|
|
|
|
|
- // initialize bolt service
|
|
|
|
|
- crowi.boltService.initialize();
|
|
|
|
|
- crowi.boltService.publishUpdatedMessage();
|
|
|
|
|
|
|
+ // initialize slack service
|
|
|
|
|
+ crowi.slackService.initialize();
|
|
|
|
|
+ crowi.slackService.publishUpdatedMessage();
|
|
|
|
|
|
|
|
return res.apiv3({ accessToken });
|
|
return res.apiv3({ accessToken });
|
|
|
}
|
|
}
|
|
@@ -293,9 +293,9 @@ module.exports = (crowi) => {
|
|
|
try {
|
|
try {
|
|
|
await updateSlackBotSettings({ 'slackbot:access-token': null });
|
|
await updateSlackBotSettings({ 'slackbot:access-token': null });
|
|
|
|
|
|
|
|
- // initialize bolt service
|
|
|
|
|
- crowi.boltService.initialize();
|
|
|
|
|
- crowi.boltService.publishUpdatedMessage();
|
|
|
|
|
|
|
+ // initialize slack service
|
|
|
|
|
+ crowi.slackService.initialize();
|
|
|
|
|
+ crowi.slackService.publishUpdatedMessage();
|
|
|
|
|
|
|
|
return res.apiv3({});
|
|
return res.apiv3({});
|
|
|
}
|
|
}
|