mirror of
https://github.com/bitwarden/browser
synced 2026-02-07 20:24:01 +00:00
update router imports from @koa/router
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import http from "node:http";
|
||||
import net from "node:net";
|
||||
|
||||
import * as koaRouter from "@koa/router";
|
||||
import { Router } from "@koa/router";
|
||||
import { OptionValues } from "commander";
|
||||
import * as koa from "koa";
|
||||
import * as koaBodyParser from "koa-bodyparser";
|
||||
@@ -29,7 +29,7 @@ export class ServeCommand {
|
||||
);
|
||||
|
||||
const server = new koa();
|
||||
const router = new koaRouter();
|
||||
const router = new Router();
|
||||
process.env.BW_SERVE = "true";
|
||||
process.env.BW_NOINTERACTION = "true";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// FIXME: Update this file to be type safe and remove this and next line
|
||||
// @ts-strict-ignore
|
||||
import * as koaMulter from "@koa/multer";
|
||||
import * as koaRouter from "@koa/router";
|
||||
import { Router } from "@koa/router";
|
||||
import * as koa from "koa";
|
||||
import { firstValueFrom, map } from "rxjs";
|
||||
|
||||
@@ -218,7 +218,7 @@ export class OssServeConfigurator {
|
||||
);
|
||||
}
|
||||
|
||||
async configureRouter(router: koaRouter) {
|
||||
async configureRouter(router: Router) {
|
||||
router.get("/generate", async (ctx, next) => {
|
||||
const response = await this.generateCommand.run(ctx.request.query);
|
||||
this.processResponse(ctx.response, response);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as koaRouter from "@koa/router";
|
||||
import { Router } from "@koa/router";
|
||||
|
||||
import { OssServeConfigurator } from "@bitwarden/cli/oss-serve-configurator";
|
||||
|
||||
@@ -16,7 +16,7 @@ export class BitServeConfigurator extends OssServeConfigurator {
|
||||
super(serviceContainer);
|
||||
}
|
||||
|
||||
override async configureRouter(router: koaRouter): Promise<void> {
|
||||
override async configureRouter(router: Router): Promise<void> {
|
||||
// Register OSS endpoints
|
||||
await super.configureRouter(router);
|
||||
|
||||
@@ -24,7 +24,7 @@ export class BitServeConfigurator extends OssServeConfigurator {
|
||||
this.serveDeviceApprovals(router);
|
||||
}
|
||||
|
||||
private serveDeviceApprovals(router: koaRouter) {
|
||||
private serveDeviceApprovals(router: Router) {
|
||||
router.get("/device-approval/:organizationId", async (ctx, next) => {
|
||||
if (await this.errorIfLocked(ctx.response)) {
|
||||
await next();
|
||||
|
||||
Reference in New Issue
Block a user