mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 22:27:48 +00:00
Fix rebase
This commit is contained in:
@@ -26,31 +26,31 @@ export const registerBddNockRouter = async (server: FastifyZodProvider) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// server.route({
|
server.route({
|
||||||
// method: "POST",
|
method: "POST",
|
||||||
// url: "/define",
|
url: "/define",
|
||||||
// schema: {
|
schema: {
|
||||||
// body: z.object({ definitions: z.unknown().array() }),
|
body: z.object({ definitions: z.unknown().array() }),
|
||||||
// response: {
|
response: {
|
||||||
// 200: z.object({ status: z.string() })
|
200: z.object({ status: z.string() })
|
||||||
// }
|
}
|
||||||
// },
|
},
|
||||||
// onRequest: verifyAuth([AuthMode.JWT]),
|
onRequest: verifyAuth([AuthMode.JWT]),
|
||||||
// handler: async (req) => {
|
handler: async (req) => {
|
||||||
// checkIfBddNockApiEnabled();
|
checkIfBddNockApiEnabled();
|
||||||
// const { body } = req;
|
const { body } = req;
|
||||||
// const { definitions } = body;
|
const { definitions } = body;
|
||||||
// logger.info(definitions, "Defining nock");
|
logger.info(definitions, "Defining nock");
|
||||||
// const processedDefinitions = definitions.map((definition: unknown) => {
|
const processedDefinitions = definitions.map((definition: unknown) => {
|
||||||
// const { path, ...rest } = definition as Definition;
|
const { path, ...rest } = definition as Definition;
|
||||||
// return {
|
return {
|
||||||
// ...rest,
|
...rest,
|
||||||
// path:
|
path:
|
||||||
// path !== undefined && typeof path === "string"
|
path !== undefined && typeof path === "string"
|
||||||
// ? path
|
? path
|
||||||
// : new RegExp((path as unknown as { regex: string }).regex ?? "")
|
: new RegExp((path as unknown as { regex: string }).regex ?? "")
|
||||||
// } as Definition;
|
} as Definition;
|
||||||
// });
|
});
|
||||||
|
|
||||||
const nock = await importNock();
|
const nock = await importNock();
|
||||||
nock.define(processedDefinitions);
|
nock.define(processedDefinitions);
|
||||||
|
|||||||
Reference in New Issue
Block a user