Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. π« Status page with uptime monitoring & API monitoring as code π« openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
787 B Β· 31 lines
TypeScript
1234567891011121314151617181920212223242526272829303132import { PreviewImportInput, RunImportInput, previewImport, runImport,} from "@openstatus/services/import";
import { toServiceCtx, toTRPCError } from "../service-adapter";import { createTRPCRouter, protectedProcedure } from "../trpc";
export const importRouter = createTRPCRouter({ preview: protectedProcedure .input(PreviewImportInput) .mutation(async ({ ctx, input }) => { try { return await previewImport({ ctx: toServiceCtx(ctx), input }); } catch (err) { toTRPCError(err); } }),
run: protectedProcedure .input(RunImportInput) .mutation(async ({ ctx, input }) => { try { return await runImport({ ctx: toServiceCtx(ctx), input }); } catch (err) { toTRPCError(err); } }),});