Yuki Takei 4 лет назад
Родитель
Сommit
515cdb4a83

+ 1 - 1
packages/app/src/server/crowi/index.js

@@ -693,4 +693,4 @@ Crowi.prototype.setupSlackBotService = async function() {
   }
 };
 
-module.exports = Crowi;
+export default Crowi;

+ 11 - 4
packages/app/src/server/service/mail.ts

@@ -8,6 +8,13 @@ import { S2sMessageHandlable } from './s2s-messaging/handlable';
 
 const logger = loggerFactory('growi:service:mail');
 
+type MailConfig = {
+  to?: string,
+  from?: string,
+  text?: string,
+  subject?: string,
+}
+
 class MailService implements S2sMessageHandlable {
 
   appService!: any;
@@ -16,7 +23,7 @@ class MailService implements S2sMessageHandlable {
 
   s2sMessagingService!: any;
 
-  mailConfig: any = {};
+  mailConfig: MailConfig = {};
 
   mailer: any = {};
 
@@ -106,7 +113,7 @@ class MailService implements S2sMessageHandlable {
     logger.debug('mailer initialized');
   }
 
-  createSMTPClient(option) {
+  createSMTPClient(option?) {
     const { configManager } = this;
 
     logger.debug('createSMTPClient option', option);
@@ -141,7 +148,7 @@ class MailService implements S2sMessageHandlable {
     return client;
   }
 
-  createSESClient(option) {
+  createSESClient(option?) {
     const { configManager } = this;
 
     if (!option) {
@@ -167,7 +174,7 @@ class MailService implements S2sMessageHandlable {
   setupMailConfig(overrideConfig) {
     const c = overrideConfig;
 
-    let mc = {};
+    let mc: MailConfig = {};
     mc = this.mailConfig;
 
     mc.to = c.to;

+ 7 - 4
packages/app/src/server/service/slackbot.ts

@@ -261,7 +261,8 @@ class SlackBotService implements S2sMessageHandlable {
     //     },
     //   ],
     // };
-    const actionBlocks = {
+    // eslint-disable-next-line @typescript-eslint/no-explicit-any
+    const actionBlocks: any = {
       type: 'actions',
       elements: [
         {
@@ -428,7 +429,8 @@ class SlackBotService implements S2sMessageHandlable {
       // get messages
       result = await this.togetterGetMessages(client, payload, channel, path, latest, oldest);
       // clean messages
-      const cleanedContents = await this.togetterCleanMessages(result.messages);
+      // eslint-disable-next-line @typescript-eslint/no-explicit-any
+      const cleanedContents = await this.togetterCleanMessages((result as any).messages);
 
       const contentsBody = cleanedContents.join('');
       // create and send url message
@@ -496,8 +498,9 @@ class SlackBotService implements S2sMessageHandlable {
   }
 
   async togetterCleanMessages(messages) {
-    const cleanedContents = [];
-    let lastMessage = {};
+    const cleanedContents: string[] = [];
+    // eslint-disable-next-line @typescript-eslint/no-explicit-any
+    let lastMessage: any = {};
     const grwTzoffset = this.crowi.appService.getTzoffset() * 60;
     messages
       .sort((a, b) => {