mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-09 11:22:25 +00:00
💄 Gave a relooking to the blueprint table
This commit is contained in:
@@ -9,6 +9,7 @@ import logger from "@server/logger";
|
||||
import { fromZodError } from "zod-validation-error";
|
||||
import { OpenAPITags, registry } from "@server/openApi";
|
||||
import { warn } from "console";
|
||||
import { BlueprintData } from "./types";
|
||||
|
||||
const listBluePrintsParamsSchema = z
|
||||
.object({
|
||||
@@ -50,16 +51,18 @@ async function queryBlueprints(orgId: string, limit: number, offset: number) {
|
||||
return res;
|
||||
}
|
||||
|
||||
type BlueprintData = Omit<
|
||||
Awaited<ReturnType<typeof queryBlueprints>>[number],
|
||||
"source" | "createdAt"
|
||||
> & {
|
||||
source: "API" | "UI" | "NEWT";
|
||||
createdAt: Date;
|
||||
};
|
||||
|
||||
export type ListBlueprintsResponse = {
|
||||
blueprints: NonNullable<BlueprintData[]>;
|
||||
blueprints: NonNullable<
|
||||
Pick<
|
||||
BlueprintData,
|
||||
| "blueprintId"
|
||||
| "name"
|
||||
| "source"
|
||||
| "succeeded"
|
||||
| "orgId"
|
||||
| "createdAt"
|
||||
>[]
|
||||
>;
|
||||
pagination: { total: number; limit: number; offset: number };
|
||||
};
|
||||
|
||||
|
||||
8
server/routers/blueprints/types.ts
Normal file
8
server/routers/blueprints/types.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import type { Blueprint } from "@server/db";
|
||||
|
||||
export type BlueprintSource = "API" | "UI" | "NEWT";
|
||||
|
||||
export type BlueprintData = Omit<Blueprint, "source" | "createdAt"> & {
|
||||
source: BlueprintSource;
|
||||
createdAt: Date;
|
||||
};
|
||||
Reference in New Issue
Block a user