Skip to content

Commit

Permalink
Fix issues in runtime-integration-restify
Browse files Browse the repository at this point in the history
  • Loading branch information
ceciliaavila committed Nov 13, 2024
1 parent 69e15dc commit 0f398a3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 19 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@
"botbuilder": "4.1.6",
"botbuilder-dialogs-adaptive-runtime": "4.1.6",
"botbuilder-dialogs-adaptive-runtime-core": "4.1.6",
"eslint-plugin-only-warn": "^1.1.0",
"restify": "^11.1.0",
"zod": "^3.23.8"
},
"scripts": {
"build": "tsc -b",
"clean": "rimraf _ts3.4 lib tsconfig.tsbuildinfo",
"depcheck": "depcheck --config ../../.depcheckrc",
"lint": "eslint .",
"lint": "eslint . --config ../../eslint.config.cjs",
"postbuild": "downlevel-dts lib _ts3.4/lib --checksum"
},
"files": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ async function resolveOptions(options: Partial<Options>, configuration: Configur
export async function start(
applicationRoot: string,
settingsDirectory: string,
options: Partial<Options> = {}
options: Partial<Options> = {},
): Promise<void> {
const [services, configuration] = await getRuntimeServices(applicationRoot, settingsDirectory);

Expand Down Expand Up @@ -104,7 +104,7 @@ export async function makeServer(
configuration: Configuration,
applicationRoot: string,
options: Partial<Options> = {},
server = restify.createServer()
server = restify.createServer(),
): Promise<restify.Server> {
server.use(restify.plugins.acceptParser(server.acceptable));
server.use(restify.plugins.queryParser());
Expand All @@ -125,12 +125,11 @@ export async function makeServer(
}

if (res && !res.headersSent) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const statusCode = typeof (err as any)?.statusCode === 'number' ? (err as any).statusCode : 500;

res.status(statusCode);
res.json({
message: err instanceof Error ? err.message : err ?? 'Internal server error',
message: err instanceof Error ? err.message : (err ?? 'Internal server error'),
});
}
};
Expand All @@ -155,8 +154,8 @@ export async function makeServer(
name: z.string(),
enabled: z.boolean().optional(),
route: z.string(),
})
)
}),
),
) ?? [];

adapters
Expand Down Expand Up @@ -187,7 +186,7 @@ export async function makeServer(
res.setHeader('Content-Type', contentType);
}
},
})
}),
);

server.on('upgrade', async (req, socket, head) => {
Expand Down

0 comments on commit 0f398a3

Please sign in to comment.