mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 16:27:40 +00:00
Fix ts type check
This commit is contained in:
@@ -23,6 +23,14 @@ const SanitizedAccountSchema = z.union([
|
|||||||
SanitizedKubernetesAccountWithResourceSchema
|
SanitizedKubernetesAccountWithResourceSchema
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const ListPamAccountsResponseSchema = z.object({
|
||||||
|
accounts: SanitizedAccountSchema.array(),
|
||||||
|
folders: PamFoldersSchema.array(),
|
||||||
|
totalCount: z.number().default(0),
|
||||||
|
folderId: z.string().optional(),
|
||||||
|
folderPaths: z.record(z.string(), z.string())
|
||||||
|
});
|
||||||
|
|
||||||
export const registerPamAccountRouter = async (server: FastifyZodProvider) => {
|
export const registerPamAccountRouter = async (server: FastifyZodProvider) => {
|
||||||
server.route({
|
server.route({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
@@ -52,13 +60,7 @@ export const registerPamAccountRouter = async (server: FastifyZodProvider) => {
|
|||||||
.optional()
|
.optional()
|
||||||
}),
|
}),
|
||||||
response: {
|
response: {
|
||||||
200: z.object({
|
200: ListPamAccountsResponseSchema
|
||||||
accounts: SanitizedAccountSchema.array(),
|
|
||||||
folders: PamFoldersSchema.array(),
|
|
||||||
totalCount: z.number().default(0),
|
|
||||||
folderId: z.string().optional(),
|
|
||||||
folderPaths: z.record(z.string(), z.string())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onRequest: verifyAuth([AuthMode.JWT]),
|
onRequest: verifyAuth([AuthMode.JWT]),
|
||||||
@@ -95,7 +97,7 @@ export const registerPamAccountRouter = async (server: FastifyZodProvider) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return { accounts, folders, totalCount, folderId, folderPaths };
|
return { accounts, folders, totalCount, folderId, folderPaths } as z.infer<typeof ListPamAccountsResponseSchema>;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user