chore: update dependencies in pnpm-lock.yaml and package.json, including zod to version 4.3.6, @dokploy/trpc-openapi to version 0.0.13, and @trpc packages to version 11.10.0; refactor loading state handling in application components

This commit is contained in:
Mauricio Siu
2026-02-23 23:50:55 -06:00
parent df648eccf6
commit 7c534d62b6
180 changed files with 717 additions and 828 deletions

View File

@@ -21,7 +21,6 @@ import {
updatePostgresById,
} from "@dokploy/server";
import { TRPCError } from "@trpc/server";
import { observable } from "@trpc/server/observable";
import { eq } from "drizzle-orm";
import { z } from "zod";
import { createTRPCRouter, protectedProcedure } from "@/server/api/trpc";
@@ -239,8 +238,9 @@ export const postgresRouter = createTRPCRouter({
},
})
.input(apiDeployPostgres)
.subscription(async ({ input, ctx }) => {
.subscription(async function* ({ input, ctx, signal }) {
const postgres = await findPostgresById(input.postgresId);
if (
postgres.environment.project.organizationId !==
ctx.session.activeOrganizationId
@@ -250,11 +250,25 @@ export const postgresRouter = createTRPCRouter({
message: "You are not authorized to deploy this Postgres",
});
}
return observable<string>((emit) => {
deployPostgres(input.postgresId, (log) => {
emit.next(log);
});
const queue: string[] = [];
const done = false;
deployPostgres(input.postgresId, (log) => {
queue.push(log);
});
while (!done || queue.length > 0) {
if (queue.length > 0) {
yield queue.shift()!;
} else {
await new Promise((r) => setTimeout(r, 50));
}
if (signal?.aborted) {
return;
}
}
}),
changeStatus: protectedProcedure