add clients openapi registries

This commit is contained in:
miloschwartz
2025-04-20 17:00:45 -04:00
parent fa6fc9e80d
commit 490ddfcd88
6 changed files with 90 additions and 18 deletions

View File

@@ -15,6 +15,7 @@ import { NextFunction, Request, Response } from "express";
import createHttpError from "http-errors";
import { z } from "zod";
import { fromError } from "zod-validation-error";
import { OpenAPITags, registry } from "@server/openApi";
const listClientsParamsSchema = z
.object({
@@ -86,6 +87,18 @@ export type ListClientsResponse = {
pagination: { total: number; limit: number; offset: number };
};
registry.registerPath({
method: "get",
path: "/org/{orgId}/clients",
description: "List all clients for an organization.",
tags: [OpenAPITags.Client, OpenAPITags.Org],
request: {
query: listClientsSchema,
params: listClientsParamsSchema
},
responses: {}
});
export async function listClients(
req: Request,
res: Response,