Skip to content

Commit

Permalink
downgrade slackbot-proxy ts.ed version back to 6
Browse files Browse the repository at this point in the history
  • Loading branch information
arafubeatbox committed Dec 30, 2024
1 parent 19d0905 commit a5c2b7d
Show file tree
Hide file tree
Showing 11 changed files with 471 additions and 320 deletions.
18 changes: 9 additions & 9 deletions apps/slackbot-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
"@growi/slack": "workspace:^",
"@slack/oauth": "^2.0.1",
"@slack/web-api": "^6.2.4",
"@tsed/common": "=7.85.1",
"@tsed/di": "=7.85.1",
"@tsed/common": "=6.43.0",
"@tsed/di": "=6.43.0",
"@tsed/logger": "=6.7.8",
"@tsed/platform-express": "=7.85.1",
"@tsed/schema": "=7.85.1",
"@tsed/swagger": "=7.85.1",
"@tsed/typeorm": "=7.85.1",
"@tsed/platform-express": "=6.43.0",
"@tsed/schema": "=6.43.0",
"@tsed/swagger": "=6.43.0",
"@tsed/typeorm": "=6.43.0",
"axios": "^0.24.0",
"body-parser": "^1.20.3",
"browser-bunyan": "^1.6.3",
Expand Down Expand Up @@ -71,9 +71,9 @@
},
"devDependencies": {
"@popperjs/core": "^2.11.8",
"@tsed/core": "=7.85.1",
"@tsed/exceptions": "=7.85.1",
"@tsed/json-mapper": "=7.85.1",
"@tsed/core": "=6.43.0",
"@tsed/exceptions": "=6.43.0",
"@tsed/json-mapper": "=6.43.0",
"@types/bunyan": "^1.8.11",
"bootstrap": "=5.3.2",
"browser-bunyan": "^1.6.3",
Expand Down
11 changes: 4 additions & 7 deletions apps/slackbot-proxy/src/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ import '@tsed/platform-express'; // !! DO NOT MODIFY !!
import '@tsed/swagger';
import '@tsed/typeorm'; // !! DO NOT MODIFY !! -- https://github.com/tsedio/tsed/issues/1332#issuecomment-837840612

import Http from 'http';

import { createTerminus } from '@godaddy/terminus';
/* eslint-disable @typescript-eslint/consistent-type-imports */
import { PlatformApplication } from '@tsed/common';
import { HttpServer, PlatformApplication } from '@tsed/common';
import { Configuration, Inject, InjectorService } from '@tsed/di';
/* eslint-enable @typescript-eslint/consistent-type-imports */
import bodyParser from 'body-parser';
Expand Down Expand Up @@ -132,9 +130,6 @@ export class Server {
@Inject()
injector: InjectorService;

@Inject(Http.Server)
server: Http.Server;

$beforeInit(): Promise<any> | void {

Check warning on line 133 in apps/slackbot-proxy/src/Server.ts

View workflow job for this annotation

GitHub Actions / ci-slackbot-proxy-lint (20.x)

Unexpected any. Specify a different type
const serverUri = process.env.SERVER_URI;

Expand Down Expand Up @@ -162,8 +157,10 @@ export class Server {
}

$beforeListen(): void {
const server = this.injector.get<HttpServer>(HttpServer);

// init terminus
createTerminus(this.server, {
createTerminus(server, {
onSignal: async() => {
logger.info('server is starting cleanup');
const connectionManager = getConnectionManager();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ErrorCode } from '@slack/web-api';
import {
MiddlewareMethods, Middleware, Next, Req, Res,
IMiddleware, Middleware, Next, Req, Res,
} from '@tsed/common';


Expand All @@ -11,7 +11,7 @@ export type WebclientRes = Res & {


@Middleware()
export class AddWebclientResponseToRes implements MiddlewareMethods {
export class AddWebclientResponseToRes implements IMiddleware {

use(@Req() req: Req, @Res() res: WebclientRes, @Next() next: Next): void {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { RequestFromSlack } from '@growi/slack';
import {
type MiddlewareMethods, Middleware, Next, Req, Res,
type IMiddleware, Middleware, Next, Req, Res,
} from '@tsed/common';

@Middleware()
export class AddSigningSecretToReq implements MiddlewareMethods {
export class AddSigningSecretToReq implements IMiddleware {

use(@Req() req: Req & RequestFromSlack, @Res() res: Res, @Next() next: Next): void {
req.slackSigningSecret = process.env.SLACK_SIGNING_SECRET;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AuthorizeResult, InstallationQuery } from '@slack/oauth';
import {
MiddlewareMethods, Inject, Middleware, Next, Req, Res,
IMiddleware, Inject, Middleware, Next, Req, Res,
} from '@tsed/common';
import Logger from 'bunyan';
import createError from 'http-errors';
Expand Down Expand Up @@ -40,7 +40,7 @@ const getCommonMiddleware = (query:InstallationQuery<boolean>, installerService:
};
};
@Middleware()
export class AuthorizeCommandMiddleware implements MiddlewareMethods {
export class AuthorizeCommandMiddleware implements IMiddleware {

private logger: Logger;

Expand Down Expand Up @@ -69,7 +69,7 @@ export class AuthorizeCommandMiddleware implements MiddlewareMethods {
}

@Middleware()
export class AuthorizeInteractionMiddleware implements MiddlewareMethods {
export class AuthorizeInteractionMiddleware implements IMiddleware {

private logger: Logger;

Expand Down Expand Up @@ -105,7 +105,7 @@ export class AuthorizeInteractionMiddleware implements MiddlewareMethods {

}
@Middleware()
export class AuthorizeEventsMiddleware implements MiddlewareMethods {
export class AuthorizeEventsMiddleware implements IMiddleware {

private logger: Logger;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
MiddlewareMethods, Inject, Middleware, Next, Req, Res,
IMiddleware, Inject, Middleware, Next, Req, Res,
} from '@tsed/common';

import { SlackOauthReq } from '~/interfaces/slack-to-growi/slack-oauth-req';
Expand All @@ -8,7 +8,7 @@ import { ViewInteractionPayloadDelegator } from '~/services/growi-uri-injector/V


@Middleware()
export class ExtractGrowiUriFromReq implements MiddlewareMethods {
export class ExtractGrowiUriFromReq implements IMiddleware {

@Inject()
viewInteractionPayloadDelegator: ViewInteractionPayloadDelegator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { generateWebClient } from '@growi/slack/dist/utils/webclient-factory';
import {
MiddlewareMethods, Middleware, Req,
IMiddleware, Middleware, Req,
} from '@tsed/common';
import Logger from 'bunyan';

Expand All @@ -14,7 +14,7 @@ const logger: Logger = loggerFactory('slackbot-proxy:middlewares:JoinToConversat
* This middleware should be processed after AuthorizeCommandMiddleware or AuthorizeInteractionMiddleware
*/
@Middleware()
export class JoinToConversationMiddleware implements MiddlewareMethods {
export class JoinToConversationMiddleware implements IMiddleware {

async use(@Req() req: SlackOauthReq): Promise<void> {
const { body, authorizeResult } = req;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { RequestFromSlack } from '@growi/slack';
import {
type MiddlewareMethods, Middleware, Next, Req,
type IMiddleware, Middleware, Next, Req,
} from '@tsed/common';


@Middleware()
export class ParseInteractionPayloadMiddleare implements MiddlewareMethods {
export class ParseInteractionPayloadMiddleare implements IMiddleware {

use(@Req() req: RequestFromSlack, @Next() next: Next): void {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {
MiddlewareMethods, Middleware, Req, Res, Next,
IMiddleware, Middleware, Req, Res, Next,
} from '@tsed/common';

import { SlackOauthReq } from '~/interfaces/slack-to-growi/slack-oauth-req';


@Middleware()
export class UrlVerificationMiddleware implements MiddlewareMethods {
export class UrlVerificationMiddleware implements IMiddleware {

async use(@Req() req: SlackOauthReq, @Res() res: Res, @Next() next: Next): Promise<void> {

Expand Down
3 changes: 3 additions & 0 deletions apps/slackbot-proxy/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"~/*": ["./src/*"],
"@tsed/core": ["./node_modules/@tsed/core"],
"@tsed/schema": ["./node_modules/@tsed/schema"],
"@tsed/exceptions": ["./node_modules/@tsed/exceptions"],
"@tsed/common": ["./node_modules/@tsed/common"],
"@tsed/di": ["./node_modules/@tsed/di"],
},

/* TODO: remove below flags for strict checking */
Expand Down
Loading

0 comments on commit a5c2b7d

Please sign in to comment.