Просмотр исходного кода

fix(slack): tighten proxyUriForCurrentType return type to NonBlankString | undefined

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Yuki Takei 1 день назад
Родитель
Сommit
fae64a7ef6
1 измененных файлов с 7 добавлено и 3 удалено
  1. 7 3
      apps/app/src/server/service/slack-integration.ts

+ 7 - 3
apps/app/src/server/service/slack-integration.ts

@@ -1,4 +1,7 @@
-import { toNonBlankStringOrUndefined } from '@growi/core/dist/interfaces';
+import {
+  type NonBlankString,
+  toNonBlankStringOrUndefined,
+} from '@growi/core/dist/interfaces';
 import {
   type GrowiBotEvent,
   type GrowiCommand,
@@ -26,7 +29,8 @@ import { LinkSharedEventHandler } from './slack-event-handler/link-shared';
 
 const logger = loggerFactory('growi:service:SlackBotService');
 
-const OFFICIAL_SLACKBOT_PROXY_URI = 'https://slackbot-proxy.growi.org';
+const OFFICIAL_SLACKBOT_PROXY_URI =
+  'https://slackbot-proxy.growi.org' as NonBlankString;
 
 type S2sMessageForSlackIntegration = S2sMessage & { updatedAt: Date };
 
@@ -128,7 +132,7 @@ export class SlackIntegrationService implements S2sMessageHandlable {
     return true;
   }
 
-  get proxyUriForCurrentType(): string | undefined {
+  get proxyUriForCurrentType(): NonBlankString | undefined {
     const currentBotType = configManager.getConfig('slackbot:currentBotType');
 
     // TODO assert currentBotType is not null and CUSTOM_WITHOUT_PROXY