mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-17 09:49:55 +02:00
Fix imports
This commit is contained in:
@@ -25,21 +25,13 @@ import HttpCode from "@server/types/HttpCode";
|
|||||||
import createHttpError from "http-errors";
|
import createHttpError from "http-errors";
|
||||||
import logger from "@server/logger";
|
import logger from "@server/logger";
|
||||||
import { fromError } from "zod-validation-error";
|
import { fromError } from "zod-validation-error";
|
||||||
|
import { ListRemoteExitNodePreferenceLabelsResponse } from "@server/routers/remoteExitNode";
|
||||||
|
|
||||||
const paramsSchema = z.strictObject({
|
const paramsSchema = z.strictObject({
|
||||||
orgId: z.string().min(1),
|
orgId: z.string().min(1),
|
||||||
remoteExitNodeId: z.string().min(1)
|
remoteExitNodeId: z.string().min(1)
|
||||||
});
|
});
|
||||||
|
|
||||||
export type ListRemoteExitNodePreferenceLabelsResponse = {
|
|
||||||
labels: {
|
|
||||||
remoteExitNodePreferenceLabelId: number;
|
|
||||||
labelId: number;
|
|
||||||
name: string;
|
|
||||||
color: string;
|
|
||||||
}[];
|
|
||||||
};
|
|
||||||
|
|
||||||
export async function listRemoteExitNodePreferenceLabels(
|
export async function listRemoteExitNodePreferenceLabels(
|
||||||
req: Request,
|
req: Request,
|
||||||
res: Response,
|
res: Response,
|
||||||
|
|||||||
@@ -20,20 +20,13 @@ import HttpCode from "@server/types/HttpCode";
|
|||||||
import createHttpError from "http-errors";
|
import createHttpError from "http-errors";
|
||||||
import logger from "@server/logger";
|
import logger from "@server/logger";
|
||||||
import { fromError } from "zod-validation-error";
|
import { fromError } from "zod-validation-error";
|
||||||
|
import { ListRemoteExitNodeResourcesResponse } from "@server/routers/remoteExitNode/types";
|
||||||
|
|
||||||
const paramsSchema = z.strictObject({
|
const paramsSchema = z.strictObject({
|
||||||
orgId: z.string().min(1),
|
orgId: z.string().min(1),
|
||||||
remoteExitNodeId: z.string().min(1)
|
remoteExitNodeId: z.string().min(1)
|
||||||
});
|
});
|
||||||
|
|
||||||
export type ListRemoteExitNodeResourcesResponse = {
|
|
||||||
resources: {
|
|
||||||
remoteExitNodeResourceId: number;
|
|
||||||
remoteExitNodeId: string;
|
|
||||||
destination: string;
|
|
||||||
}[];
|
|
||||||
};
|
|
||||||
|
|
||||||
export async function listRemoteExitNodeResources(
|
export async function listRemoteExitNodeResources(
|
||||||
req: Request,
|
req: Request,
|
||||||
res: Response,
|
res: Response,
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import HttpCode from "@server/types/HttpCode";
|
|||||||
import createHttpError from "http-errors";
|
import createHttpError from "http-errors";
|
||||||
import logger from "@server/logger";
|
import logger from "@server/logger";
|
||||||
import { fromError } from "zod-validation-error";
|
import { fromError } from "zod-validation-error";
|
||||||
|
import { SetRemoteExitNodePreferenceLabelsResponse } from "@server/routers/remoteExitNode";
|
||||||
|
|
||||||
const paramsSchema = z.strictObject({
|
const paramsSchema = z.strictObject({
|
||||||
orgId: z.string().min(1),
|
orgId: z.string().min(1),
|
||||||
@@ -37,15 +38,6 @@ const bodySchema = z.strictObject({
|
|||||||
|
|
||||||
export type SetRemoteExitNodePreferenceLabelsBody = z.infer<typeof bodySchema>;
|
export type SetRemoteExitNodePreferenceLabelsBody = z.infer<typeof bodySchema>;
|
||||||
|
|
||||||
export type SetRemoteExitNodePreferenceLabelsResponse = {
|
|
||||||
labels: {
|
|
||||||
remoteExitNodePreferenceLabelId: number;
|
|
||||||
labelId: number;
|
|
||||||
name: string;
|
|
||||||
color: string;
|
|
||||||
}[];
|
|
||||||
};
|
|
||||||
|
|
||||||
export async function setRemoteExitNodePreferenceLabels(
|
export async function setRemoteExitNodePreferenceLabels(
|
||||||
req: Request,
|
req: Request,
|
||||||
res: Response,
|
res: Response,
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import logger from "@server/logger";
|
|||||||
import { fromError } from "zod-validation-error";
|
import { fromError } from "zod-validation-error";
|
||||||
import { sendToClientsBatch } from "#private/routers/ws";
|
import { sendToClientsBatch } from "#private/routers/ws";
|
||||||
import { canCompress } from "@server/lib/clientVersionChecks";
|
import { canCompress } from "@server/lib/clientVersionChecks";
|
||||||
|
import { SetRemoteExitNodeResourcesResponse } from "@server/routers/remoteExitNode";
|
||||||
|
|
||||||
const paramsSchema = z.strictObject({
|
const paramsSchema = z.strictObject({
|
||||||
orgId: z.string().min(1),
|
orgId: z.string().min(1),
|
||||||
@@ -45,14 +46,6 @@ const bodySchema = z.strictObject({
|
|||||||
|
|
||||||
export type SetRemoteExitNodeResourcesBody = z.infer<typeof bodySchema>;
|
export type SetRemoteExitNodeResourcesBody = z.infer<typeof bodySchema>;
|
||||||
|
|
||||||
export type SetRemoteExitNodeResourcesResponse = {
|
|
||||||
resources: {
|
|
||||||
remoteExitNodeResourceId: number;
|
|
||||||
remoteExitNodeId: string;
|
|
||||||
destination: string;
|
|
||||||
}[];
|
|
||||||
};
|
|
||||||
|
|
||||||
export async function setRemoteExitNodeResources(
|
export async function setRemoteExitNodeResources(
|
||||||
req: Request,
|
req: Request,
|
||||||
res: Response,
|
res: Response,
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from "./types";
|
||||||
@@ -43,3 +43,37 @@ export type GetRemoteExitNodeResponse = {
|
|||||||
online: boolean;
|
online: boolean;
|
||||||
type: string | null;
|
type: string | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type ListRemoteExitNodeResourcesResponse = {
|
||||||
|
resources: {
|
||||||
|
remoteExitNodeResourceId: number;
|
||||||
|
remoteExitNodeId: string;
|
||||||
|
destination: string;
|
||||||
|
}[];
|
||||||
|
};
|
||||||
|
|
||||||
|
export type SetRemoteExitNodeResourcesResponse = {
|
||||||
|
resources: {
|
||||||
|
remoteExitNodeResourceId: number;
|
||||||
|
remoteExitNodeId: string;
|
||||||
|
destination: string;
|
||||||
|
}[];
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ListRemoteExitNodePreferenceLabelsResponse = {
|
||||||
|
labels: {
|
||||||
|
remoteExitNodePreferenceLabelId: number;
|
||||||
|
labelId: number;
|
||||||
|
name: string;
|
||||||
|
color: string;
|
||||||
|
}[];
|
||||||
|
};
|
||||||
|
|
||||||
|
export type SetRemoteExitNodePreferenceLabelsResponse = {
|
||||||
|
labels: {
|
||||||
|
remoteExitNodePreferenceLabelId: number;
|
||||||
|
labelId: number;
|
||||||
|
name: string;
|
||||||
|
color: string;
|
||||||
|
}[];
|
||||||
|
};
|
||||||
|
|||||||
+4
-4
@@ -27,10 +27,10 @@ import type { TagValue } from "@app/components/multi-select/multi-select-content
|
|||||||
import { orgQueries } from "@app/lib/queries";
|
import { orgQueries } from "@app/lib/queries";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { useDebounce } from "use-debounce";
|
import { useDebounce } from "use-debounce";
|
||||||
import type { ListRemoteExitNodeResourcesResponse } from "@server/private/routers/remoteExitNode/listRemoteExitNodeResources";
|
import type { ListRemoteExitNodeResourcesResponse } from "@server/routers/remoteExitNode";
|
||||||
import type { SetRemoteExitNodeResourcesResponse } from "@server/private/routers/remoteExitNode/setRemoteExitNodeResources";
|
import type { SetRemoteExitNodeResourcesResponse } from "@server/routers/remoteExitNode";
|
||||||
import type { ListRemoteExitNodePreferenceLabelsResponse } from "@server/private/routers/remoteExitNode/listRemoteExitNodePreferenceLabels";
|
import type { ListRemoteExitNodePreferenceLabelsResponse } from "@server/routers/remoteExitNode";
|
||||||
import type { SetRemoteExitNodePreferenceLabelsResponse } from "@server/private/routers/remoteExitNode/setRemoteExitNodePreferenceLabels";
|
import type { SetRemoteExitNodePreferenceLabelsResponse } from "@server/routers/remoteExitNode";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
import { ExternalLink } from "lucide-react";
|
import { ExternalLink } from "lucide-react";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user