mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-11 21:26:37 +00:00
Separate types & fix #private import
This commit is contained in:
@@ -720,4 +720,5 @@ export type OrgDomains = InferSelectModel<typeof orgDomains>;
|
|||||||
export type SiteResource = InferSelectModel<typeof siteResources>;
|
export type SiteResource = InferSelectModel<typeof siteResources>;
|
||||||
export type SetupToken = InferSelectModel<typeof setupTokens>;
|
export type SetupToken = InferSelectModel<typeof setupTokens>;
|
||||||
export type HostMeta = InferSelectModel<typeof hostMeta>;
|
export type HostMeta = InferSelectModel<typeof hostMeta>;
|
||||||
export type TargetHealthCheck = InferSelectModel<typeof targetHealthCheck>;
|
export type TargetHealthCheck = InferSelectModel<typeof targetHealthCheck>;
|
||||||
|
export type IdpOidcConfig = InferSelectModel<typeof idpOidcConfig>;
|
||||||
@@ -759,4 +759,5 @@ export type SiteResource = InferSelectModel<typeof siteResources>;
|
|||||||
export type OrgDomains = InferSelectModel<typeof orgDomains>;
|
export type OrgDomains = InferSelectModel<typeof orgDomains>;
|
||||||
export type SetupToken = InferSelectModel<typeof setupTokens>;
|
export type SetupToken = InferSelectModel<typeof setupTokens>;
|
||||||
export type HostMeta = InferSelectModel<typeof hostMeta>;
|
export type HostMeta = InferSelectModel<typeof hostMeta>;
|
||||||
export type TargetHealthCheck = InferSelectModel<typeof targetHealthCheck>;
|
export type TargetHealthCheck = InferSelectModel<typeof targetHealthCheck>;
|
||||||
|
export type IdpOidcConfig = InferSelectModel<typeof idpOidcConfig>;
|
||||||
@@ -15,8 +15,7 @@ import {
|
|||||||
} from "@server/db";
|
} from "@server/db";
|
||||||
import { eq } from "drizzle-orm";
|
import { eq } from "drizzle-orm";
|
||||||
import { defaultRoleAllowedActions } from "@server/routers/role";
|
import { defaultRoleAllowedActions } from "@server/routers/role";
|
||||||
import { FeatureId, limitsService, sandboxLimitSet } from "@server/lib/billing";
|
import { FeatureId, limitsService, sandboxLimitSet, createCustomer } from "@server/lib/billing";
|
||||||
import { createCustomer } from "@server/private/lib/billing/createCustomer";
|
|
||||||
import { usageService } from "@server/lib/billing/usageService";
|
import { usageService } from "@server/lib/billing/usageService";
|
||||||
|
|
||||||
export async function createUserAccountOrg(
|
export async function createUserAccountOrg(
|
||||||
|
|||||||
@@ -1,3 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of a proprietary work.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2025 Fossorial, Inc.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This file is licensed under the Fossorial Commercial License.
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
* Unauthorized use, copying, modification, or distribution is strictly prohibited.
|
||||||
|
*
|
||||||
|
* This file is not licensed under the AGPLv3.
|
||||||
|
*/
|
||||||
|
|
||||||
import { rateLimitService } from "#private/lib/rateLimit";
|
import { rateLimitService } from "#private/lib/rateLimit";
|
||||||
import { cleanup as wsCleanup } from "#private/routers/ws";
|
import { cleanup as wsCleanup } from "#private/routers/ws";
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import logger from "@server/logger";
|
import logger from "@server/logger";
|
||||||
import redisManager from "@server/private/lib/redis";
|
import redisManager from "#private/lib/redis";
|
||||||
import { build } from "@server/build";
|
import { build } from "@server/build";
|
||||||
|
|
||||||
// Rate limiting configuration
|
// Rate limiting configuration
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import { sha256 } from "@oslojs/crypto/sha2";
|
|||||||
import { serializeSessionCookie } from "@server/auth/sessions/app";
|
import { serializeSessionCookie } from "@server/auth/sessions/app";
|
||||||
import { decrypt } from "@server/lib/crypto";
|
import { decrypt } from "@server/lib/crypto";
|
||||||
import config from "@server/lib/config";
|
import config from "@server/lib/config";
|
||||||
|
import { TransferSessionResponse } from "@server/routers/auth/types";
|
||||||
|
|
||||||
const bodySchema = z.object({
|
const bodySchema = z.object({
|
||||||
token: z.string()
|
token: z.string()
|
||||||
@@ -33,11 +34,6 @@ const bodySchema = z.object({
|
|||||||
|
|
||||||
export type TransferSessionBodySchema = z.infer<typeof bodySchema>;
|
export type TransferSessionBodySchema = z.infer<typeof bodySchema>;
|
||||||
|
|
||||||
export type TransferSessionResponse = {
|
|
||||||
valid: boolean;
|
|
||||||
cookie?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export async function transferSession(
|
export async function transferSession(
|
||||||
req: Request,
|
req: Request,
|
||||||
res: Response,
|
res: Response,
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ import createHttpError from "http-errors";
|
|||||||
import logger from "@server/logger";
|
import logger from "@server/logger";
|
||||||
import { fromZodError } from "zod-validation-error";
|
import { fromZodError } from "zod-validation-error";
|
||||||
import { OpenAPITags, registry } from "@server/openApi";
|
import { OpenAPITags, registry } from "@server/openApi";
|
||||||
|
import { GetOrgSubscriptionResponse } from "@server/routers/billing/types";
|
||||||
|
|
||||||
// Import tables for billing
|
// Import tables for billing
|
||||||
import {
|
import {
|
||||||
customers,
|
customers,
|
||||||
@@ -37,11 +39,6 @@ const getOrgSchema = z
|
|||||||
})
|
})
|
||||||
.strict();
|
.strict();
|
||||||
|
|
||||||
export type GetOrgSubscriptionResponse = {
|
|
||||||
subscription: Subscription | null;
|
|
||||||
items: SubscriptionItem[];
|
|
||||||
};
|
|
||||||
|
|
||||||
registry.registerPath({
|
registry.registerPath({
|
||||||
method: "get",
|
method: "get",
|
||||||
path: "/org/{orgId}/billing/subscription",
|
path: "/org/{orgId}/billing/subscription",
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import { OpenAPITags, registry } from "@server/openApi";
|
|||||||
import { Limit, limits, Usage, usage } from "@server/db";
|
import { Limit, limits, Usage, usage } from "@server/db";
|
||||||
import { usageService } from "@server/lib/billing/usageService";
|
import { usageService } from "@server/lib/billing/usageService";
|
||||||
import { FeatureId } from "@server/lib/billing";
|
import { FeatureId } from "@server/lib/billing";
|
||||||
|
import { GetOrgUsageResponse } from "@server/routers/billing/types";
|
||||||
|
|
||||||
const getOrgSchema = z
|
const getOrgSchema = z
|
||||||
.object({
|
.object({
|
||||||
@@ -32,11 +33,6 @@ const getOrgSchema = z
|
|||||||
})
|
})
|
||||||
.strict();
|
.strict();
|
||||||
|
|
||||||
export type GetOrgUsageResponse = {
|
|
||||||
usage: Usage[];
|
|
||||||
limits: Limit[];
|
|
||||||
};
|
|
||||||
|
|
||||||
registry.registerPath({
|
registry.registerPath({
|
||||||
method: "get",
|
method: "get",
|
||||||
path: "/org/{orgId}/billing/usage",
|
path: "/org/{orgId}/billing/usage",
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import createHttpError from "http-errors";
|
|||||||
import logger from "@server/logger";
|
import logger from "@server/logger";
|
||||||
import { fromZodError } from "zod-validation-error";
|
import { fromZodError } from "zod-validation-error";
|
||||||
import { getOrgTierData } from "#private/lib/billing";
|
import { getOrgTierData } from "#private/lib/billing";
|
||||||
|
import { GetOrgTierResponse } from "@server/routers/billing/types";
|
||||||
|
|
||||||
const getOrgSchema = z
|
const getOrgSchema = z
|
||||||
.object({
|
.object({
|
||||||
@@ -26,11 +27,6 @@ const getOrgSchema = z
|
|||||||
})
|
})
|
||||||
.strict();
|
.strict();
|
||||||
|
|
||||||
export type GetOrgTierResponse = {
|
|
||||||
tier: string | null;
|
|
||||||
active: boolean;
|
|
||||||
};
|
|
||||||
|
|
||||||
export async function getOrgTier(
|
export async function getOrgTier(
|
||||||
req: Request,
|
req: Request,
|
||||||
res: Response,
|
res: Response,
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ 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 { registry } from "@server/openApi";
|
import { registry } from "@server/openApi";
|
||||||
|
import { GetCertificateResponse } from "@server/routers/certificates/types";
|
||||||
|
|
||||||
const getCertificateSchema = z
|
const getCertificateSchema = z
|
||||||
.object({
|
.object({
|
||||||
@@ -96,20 +97,6 @@ async function query(domainId: string, domain: string) {
|
|||||||
return existing.length > 0 ? existing[0] : null;
|
return existing.length > 0 ? existing[0] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type GetCertificateResponse = {
|
|
||||||
certId: number;
|
|
||||||
domain: string;
|
|
||||||
domainId: string;
|
|
||||||
wildcard: boolean;
|
|
||||||
status: string; // pending, requested, valid, expired, failed
|
|
||||||
expiresAt: string | null;
|
|
||||||
lastRenewalAttempt: Date | null;
|
|
||||||
createdAt: string;
|
|
||||||
updatedAt: string;
|
|
||||||
errorMessage?: string | null;
|
|
||||||
renewalCount: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
registry.registerPath({
|
registry.registerPath({
|
||||||
method: "get",
|
method: "get",
|
||||||
path: "/org/{orgId}/certificate/{domainId}/{domain}",
|
path: "/org/{orgId}/certificate/{domainId}/{domain}",
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import { fromError } from "zod-validation-error";
|
|||||||
import { OpenAPITags, registry } from "@server/openApi";
|
import { OpenAPITags, registry } from "@server/openApi";
|
||||||
import { db, domainNamespaces, resources } from "@server/db";
|
import { db, domainNamespaces, resources } from "@server/db";
|
||||||
import { inArray } from "drizzle-orm";
|
import { inArray } from "drizzle-orm";
|
||||||
|
import { CheckDomainAvailabilityResponse } from "@server/routers/domain/types";
|
||||||
|
|
||||||
const paramsSchema = z.object({}).strict();
|
const paramsSchema = z.object({}).strict();
|
||||||
|
|
||||||
@@ -30,15 +31,6 @@ const querySchema = z
|
|||||||
})
|
})
|
||||||
.strict();
|
.strict();
|
||||||
|
|
||||||
export type CheckDomainAvailabilityResponse = {
|
|
||||||
available: boolean;
|
|
||||||
options: {
|
|
||||||
domainNamespaceId: string;
|
|
||||||
domainId: string;
|
|
||||||
fullDomain: string;
|
|
||||||
}[];
|
|
||||||
};
|
|
||||||
|
|
||||||
registry.registerPath({
|
registry.registerPath({
|
||||||
method: "get",
|
method: "get",
|
||||||
path: "/domain/check-namespace-availability",
|
path: "/domain/check-namespace-availability",
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import { createCertificate } from "#private/routers/certificates/createCertifica
|
|||||||
import { getOrgTierData } from "#private/lib/billing";
|
import { getOrgTierData } from "#private/lib/billing";
|
||||||
import { TierId } from "@server/lib/billing/tiers";
|
import { TierId } from "@server/lib/billing/tiers";
|
||||||
import { build } from "@server/build";
|
import { build } from "@server/build";
|
||||||
|
import { CreateLoginPageResponse } from "@server/routers/loginPage/types";
|
||||||
|
|
||||||
const paramsSchema = z
|
const paramsSchema = z
|
||||||
.object({
|
.object({
|
||||||
@@ -49,8 +50,6 @@ const bodySchema = z
|
|||||||
|
|
||||||
export type CreateLoginPageBody = z.infer<typeof bodySchema>;
|
export type CreateLoginPageBody = z.infer<typeof bodySchema>;
|
||||||
|
|
||||||
export type CreateLoginPageResponse = LoginPage;
|
|
||||||
|
|
||||||
export async function createLoginPage(
|
export async function createLoginPage(
|
||||||
req: Request,
|
req: Request,
|
||||||
res: Response,
|
res: Response,
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ 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 { eq, and } from "drizzle-orm";
|
import { eq, and } from "drizzle-orm";
|
||||||
|
import { DeleteLoginPageResponse } from "@server/routers/loginPage/types";
|
||||||
|
|
||||||
const paramsSchema = z
|
const paramsSchema = z
|
||||||
.object({
|
.object({
|
||||||
@@ -28,8 +29,6 @@ const paramsSchema = z
|
|||||||
})
|
})
|
||||||
.strict();
|
.strict();
|
||||||
|
|
||||||
export type DeleteLoginPageResponse = LoginPage;
|
|
||||||
|
|
||||||
export async function deleteLoginPage(
|
export async function deleteLoginPage(
|
||||||
req: Request,
|
req: Request,
|
||||||
res: Response,
|
res: Response,
|
||||||
|
|||||||
@@ -20,6 +20,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 { GetLoginPageResponse } from "@server/routers/loginPage/types";
|
||||||
|
|
||||||
const paramsSchema = z
|
const paramsSchema = z
|
||||||
.object({
|
.object({
|
||||||
@@ -40,10 +41,6 @@ async function query(orgId: string) {
|
|||||||
return res?.loginPage;
|
return res?.loginPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type GetLoginPageResponse = NonNullable<
|
|
||||||
Awaited<ReturnType<typeof query>>
|
|
||||||
>;
|
|
||||||
|
|
||||||
export async function getLoginPage(
|
export async function getLoginPage(
|
||||||
req: Request,
|
req: Request,
|
||||||
res: Response,
|
res: Response,
|
||||||
|
|||||||
@@ -20,6 +20,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 { LoadLoginPageResponse } from "@server/routers/loginPage/types";
|
||||||
|
|
||||||
const querySchema = z.object({
|
const querySchema = z.object({
|
||||||
resourceId: z.coerce.number().int().positive().optional(),
|
resourceId: z.coerce.number().int().positive().optional(),
|
||||||
@@ -70,10 +71,6 @@ async function query(orgId: string | undefined, fullDomain: string) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export type LoadLoginPageResponse = NonNullable<
|
|
||||||
Awaited<ReturnType<typeof query>>
|
|
||||||
> & { orgId: string };
|
|
||||||
|
|
||||||
export async function loadLoginPage(
|
export async function loadLoginPage(
|
||||||
req: Request,
|
req: Request,
|
||||||
res: Response,
|
res: Response,
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import { createCertificate } from "#private/routers/certificates/createCertifica
|
|||||||
import { getOrgTierData } from "#private/lib/billing";
|
import { getOrgTierData } from "#private/lib/billing";
|
||||||
import { TierId } from "@server/lib/billing/tiers";
|
import { TierId } from "@server/lib/billing/tiers";
|
||||||
import { build } from "@server/build";
|
import { build } from "@server/build";
|
||||||
|
import { UpdateLoginPageResponse } from "@server/routers/loginPage/types";
|
||||||
|
|
||||||
const paramsSchema = z
|
const paramsSchema = z
|
||||||
.object({
|
.object({
|
||||||
@@ -55,8 +56,6 @@ const bodySchema = z
|
|||||||
|
|
||||||
export type UpdateLoginPageBody = z.infer<typeof bodySchema>;
|
export type UpdateLoginPageBody = z.infer<typeof bodySchema>;
|
||||||
|
|
||||||
export type UpdateLoginPageResponse = LoginPage;
|
|
||||||
|
|
||||||
export async function updateLoginPage(
|
export async function updateLoginPage(
|
||||||
req: Request,
|
req: Request,
|
||||||
res: Response,
|
res: Response,
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import config from "@server/lib/config";
|
|||||||
import { build } from "@server/build";
|
import { build } from "@server/build";
|
||||||
import { getOrgTierData } from "#private/lib/billing";
|
import { getOrgTierData } from "#private/lib/billing";
|
||||||
import { TierId } from "@server/lib/billing/tiers";
|
import { TierId } from "@server/lib/billing/tiers";
|
||||||
|
import { CreateOrgIdpResponse } from "@server/routers/orgIdp/types";
|
||||||
|
|
||||||
const paramsSchema = z.object({ orgId: z.string().nonempty() }).strict();
|
const paramsSchema = z.object({ orgId: z.string().nonempty() }).strict();
|
||||||
|
|
||||||
@@ -47,11 +48,6 @@ const bodySchema = z
|
|||||||
})
|
})
|
||||||
.strict();
|
.strict();
|
||||||
|
|
||||||
export type CreateOrgIdpResponse = {
|
|
||||||
idpId: number;
|
|
||||||
redirectUrl: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
// registry.registerPath({
|
// registry.registerPath({
|
||||||
// method: "put",
|
// method: "put",
|
||||||
// path: "/idp/oidc",
|
// path: "/idp/oidc",
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import { OpenAPITags, registry } from "@server/openApi";
|
|||||||
import config from "@server/lib/config";
|
import config from "@server/lib/config";
|
||||||
import { decrypt } from "@server/lib/crypto";
|
import { decrypt } from "@server/lib/crypto";
|
||||||
import { generateOidcRedirectUrl } from "@server/lib/idp/generateRedirectUrl";
|
import { generateOidcRedirectUrl } from "@server/lib/idp/generateRedirectUrl";
|
||||||
|
import { GetOrgIdpResponse } from "@server/routers/orgIdp/types";
|
||||||
|
|
||||||
const paramsSchema = z
|
const paramsSchema = z
|
||||||
.object({
|
.object({
|
||||||
@@ -47,10 +48,6 @@ async function query(idpId: number, orgId: string) {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type GetOrgIdpResponse = NonNullable<
|
|
||||||
Awaited<ReturnType<typeof query>>
|
|
||||||
> & { redirectUrl: string };
|
|
||||||
|
|
||||||
// registry.registerPath({
|
// registry.registerPath({
|
||||||
// method: "get",
|
// method: "get",
|
||||||
// path: "/idp/{idpId}",
|
// path: "/idp/{idpId}",
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import { eq, sql } from "drizzle-orm";
|
|||||||
import logger from "@server/logger";
|
import logger from "@server/logger";
|
||||||
import { fromError } from "zod-validation-error";
|
import { fromError } from "zod-validation-error";
|
||||||
import { OpenAPITags, registry } from "@server/openApi";
|
import { OpenAPITags, registry } from "@server/openApi";
|
||||||
|
import { ListOrgIdpsResponse } from "@server/routers/orgIdp/types";
|
||||||
|
|
||||||
const querySchema = z
|
const querySchema = z
|
||||||
.object({
|
.object({
|
||||||
@@ -65,15 +66,6 @@ async function query(orgId: string, limit: number, offset: number) {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ListOrgIdpsResponse = {
|
|
||||||
idps: Awaited<ReturnType<typeof query>>;
|
|
||||||
pagination: {
|
|
||||||
total: number;
|
|
||||||
limit: number;
|
|
||||||
offset: number;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
// registry.registerPath({
|
// registry.registerPath({
|
||||||
// method: "get",
|
// method: "get",
|
||||||
// path: "/idp",
|
// path: "/idp",
|
||||||
|
|||||||
@@ -29,17 +29,12 @@ import { and, eq } from "drizzle-orm";
|
|||||||
import { getNextAvailableSubnet } from "@server/lib/exitNodes";
|
import { getNextAvailableSubnet } from "@server/lib/exitNodes";
|
||||||
import { usageService } from "@server/lib/billing/usageService";
|
import { usageService } from "@server/lib/billing/usageService";
|
||||||
import { FeatureId } from "@server/lib/billing";
|
import { FeatureId } from "@server/lib/billing";
|
||||||
|
import { CreateRemoteExitNodeResponse } from "@server/routers/remoteExitNode/types";
|
||||||
|
|
||||||
export const paramsSchema = z.object({
|
export const paramsSchema = z.object({
|
||||||
orgId: z.string()
|
orgId: z.string()
|
||||||
});
|
});
|
||||||
|
|
||||||
export type CreateRemoteExitNodeResponse = {
|
|
||||||
token: string;
|
|
||||||
remoteExitNodeId: string;
|
|
||||||
secret: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
const bodySchema = z
|
const bodySchema = z
|
||||||
.object({
|
.object({
|
||||||
remoteExitNodeId: z.string().length(15),
|
remoteExitNodeId: z.string().length(15),
|
||||||
|
|||||||
@@ -21,6 +21,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 { GetRemoteExitNodeResponse } from "@server/routers/remoteExitNode/types";
|
||||||
|
|
||||||
const getRemoteExitNodeSchema = z
|
const getRemoteExitNodeSchema = z
|
||||||
.object({
|
.object({
|
||||||
@@ -52,8 +53,6 @@ async function query(remoteExitNodeId: string) {
|
|||||||
return remoteExitNode;
|
return remoteExitNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type GetRemoteExitNodeResponse = Awaited<ReturnType<typeof query>>;
|
|
||||||
|
|
||||||
export async function getRemoteExitNode(
|
export async function getRemoteExitNode(
|
||||||
req: Request,
|
req: Request,
|
||||||
res: Response,
|
res: Response,
|
||||||
|
|||||||
@@ -35,8 +35,6 @@ export const remoteExitNodeGetTokenBodySchema = z.object({
|
|||||||
token: z.string().optional()
|
token: z.string().optional()
|
||||||
});
|
});
|
||||||
|
|
||||||
export type RemoteExitNodeGetTokenBody = z.infer<typeof remoteExitNodeGetTokenBodySchema>;
|
|
||||||
|
|
||||||
export async function getRemoteExitNodeToken(
|
export async function getRemoteExitNodeToken(
|
||||||
req: Request,
|
req: Request,
|
||||||
res: Response,
|
res: Response,
|
||||||
|
|||||||
@@ -21,6 +21,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 { ListRemoteExitNodesResponse } from "@server/routers/remoteExitNode/types";
|
||||||
|
|
||||||
const listRemoteExitNodesParamsSchema = z
|
const listRemoteExitNodesParamsSchema = z
|
||||||
.object({
|
.object({
|
||||||
@@ -43,7 +44,7 @@ const listRemoteExitNodesSchema = z.object({
|
|||||||
.pipe(z.number().int().nonnegative())
|
.pipe(z.number().int().nonnegative())
|
||||||
});
|
});
|
||||||
|
|
||||||
function queryRemoteExitNodes(orgId: string) {
|
export function queryRemoteExitNodes(orgId: string) {
|
||||||
return db
|
return db
|
||||||
.select({
|
.select({
|
||||||
remoteExitNodeId: remoteExitNodes.remoteExitNodeId,
|
remoteExitNodeId: remoteExitNodes.remoteExitNodeId,
|
||||||
@@ -65,11 +66,6 @@ function queryRemoteExitNodes(orgId: string) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ListRemoteExitNodesResponse = {
|
|
||||||
remoteExitNodes: Awaited<ReturnType<typeof queryRemoteExitNodes>>;
|
|
||||||
pagination: { total: number; limit: number; offset: number };
|
|
||||||
};
|
|
||||||
|
|
||||||
export async function listRemoteExitNodes(
|
export async function listRemoteExitNodes(
|
||||||
req: Request,
|
req: Request,
|
||||||
res: Response,
|
res: Response,
|
||||||
|
|||||||
@@ -19,11 +19,7 @@ import logger from "@server/logger";
|
|||||||
import { generateId } from "@server/auth/sessions/app";
|
import { generateId } from "@server/auth/sessions/app";
|
||||||
import { fromError } from "zod-validation-error";
|
import { fromError } from "zod-validation-error";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
import { PickRemoteExitNodeDefaultsResponse } from "@server/routers/remoteExitNode/types";
|
||||||
export type PickRemoteExitNodeDefaultsResponse = {
|
|
||||||
remoteExitNodeId: string;
|
|
||||||
secret: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
const paramsSchema = z
|
const paramsSchema = z
|
||||||
.object({
|
.object({
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { NextFunction, Request, Response } from "express";
|
import { NextFunction, Request, Response } from "express";
|
||||||
import { db, exitNodes, exitNodeOrgs } from "@server/db";
|
import { db } from "@server/db";
|
||||||
import HttpCode from "@server/types/HttpCode";
|
import HttpCode from "@server/types/HttpCode";
|
||||||
import { remoteExitNodes } from "@server/db";
|
import { remoteExitNodes } from "@server/db";
|
||||||
import createHttpError from "http-errors";
|
import createHttpError from "http-errors";
|
||||||
@@ -24,11 +24,7 @@ import { hashPassword } from "@server/auth/password";
|
|||||||
import logger from "@server/logger";
|
import logger from "@server/logger";
|
||||||
import z from "zod";
|
import z from "zod";
|
||||||
import { fromError } from "zod-validation-error";
|
import { fromError } from "zod-validation-error";
|
||||||
|
import { QuickStartRemoteExitNodeResponse } from "@server/routers/remoteExitNode/types";
|
||||||
export type QuickStartRemoteExitNodeResponse = {
|
|
||||||
remoteExitNodeId: string;
|
|
||||||
secret: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
const INSTALLER_KEY = "af4e4785-7e09-11f0-b93a-74563c4e2a7e";
|
const INSTALLER_KEY = "af4e4785-7e09-11f0-b93a-74563c4e2a7e";
|
||||||
|
|
||||||
|
|||||||
4
server/routers/auth/types.ts
Normal file
4
server/routers/auth/types.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export type TransferSessionResponse = {
|
||||||
|
valid: boolean;
|
||||||
|
cookie?: string;
|
||||||
|
};
|
||||||
17
server/routers/billing/types.ts
Normal file
17
server/routers/billing/types.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import { Limit, Subscription, SubscriptionItem, Usage } from "@server/db";
|
||||||
|
|
||||||
|
export type GetOrgSubscriptionResponse = {
|
||||||
|
subscription: Subscription | null;
|
||||||
|
items: SubscriptionItem[];
|
||||||
|
};
|
||||||
|
|
||||||
|
export type GetOrgUsageResponse = {
|
||||||
|
usage: Usage[];
|
||||||
|
limits: Limit[];
|
||||||
|
};
|
||||||
|
|
||||||
|
export type GetOrgTierResponse = {
|
||||||
|
tier: string | null;
|
||||||
|
active: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
13
server/routers/certificates/types.ts
Normal file
13
server/routers/certificates/types.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
export type GetCertificateResponse = {
|
||||||
|
certId: number;
|
||||||
|
domain: string;
|
||||||
|
domainId: string;
|
||||||
|
wildcard: boolean;
|
||||||
|
status: string; // pending, requested, valid, expired, failed
|
||||||
|
expiresAt: string | null;
|
||||||
|
lastRenewalAttempt: Date | null;
|
||||||
|
createdAt: string;
|
||||||
|
updatedAt: string;
|
||||||
|
errorMessage?: string | null;
|
||||||
|
renewalCount: number;
|
||||||
|
}
|
||||||
8
server/routers/domain/types.ts
Normal file
8
server/routers/domain/types.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export type CheckDomainAvailabilityResponse = {
|
||||||
|
available: boolean;
|
||||||
|
options: {
|
||||||
|
domainNamespaceId: string;
|
||||||
|
domainId: string;
|
||||||
|
fullDomain: string;
|
||||||
|
}[];
|
||||||
|
};
|
||||||
11
server/routers/loginPage/types.ts
Normal file
11
server/routers/loginPage/types.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { LoginPage } from "@server/db";
|
||||||
|
|
||||||
|
export type CreateLoginPageResponse = LoginPage;
|
||||||
|
|
||||||
|
export type DeleteLoginPageResponse = LoginPage;
|
||||||
|
|
||||||
|
export type GetLoginPageResponse = LoginPage;
|
||||||
|
|
||||||
|
export type UpdateLoginPageResponse = LoginPage;
|
||||||
|
|
||||||
|
export type LoadLoginPageResponse = LoginPage & { orgId: string };
|
||||||
27
server/routers/orgIdp/types.ts
Normal file
27
server/routers/orgIdp/types.ts
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import { Idp, IdpOidcConfig } from "@server/db";
|
||||||
|
|
||||||
|
export type CreateOrgIdpResponse = {
|
||||||
|
idpId: number;
|
||||||
|
redirectUrl: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type GetOrgIdpResponse = {
|
||||||
|
idp: Idp,
|
||||||
|
idpOidcConfig: IdpOidcConfig | null,
|
||||||
|
redirectUrl: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ListOrgIdpsResponse = {
|
||||||
|
idps: {
|
||||||
|
idpId: number;
|
||||||
|
orgId: string;
|
||||||
|
name: string;
|
||||||
|
type: string;
|
||||||
|
variant: string;
|
||||||
|
}[],
|
||||||
|
pagination: {
|
||||||
|
total: number;
|
||||||
|
limit: number;
|
||||||
|
offset: number;
|
||||||
|
};
|
||||||
|
};
|
||||||
34
server/routers/remoteExitNode/types.ts
Normal file
34
server/routers/remoteExitNode/types.ts
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import { RemoteExitNode } from "@server/db";
|
||||||
|
|
||||||
|
export type CreateRemoteExitNodeResponse = {
|
||||||
|
token: string;
|
||||||
|
remoteExitNodeId: string;
|
||||||
|
secret: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type PickRemoteExitNodeDefaultsResponse = {
|
||||||
|
remoteExitNodeId: string;
|
||||||
|
secret: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type QuickStartRemoteExitNodeResponse = {
|
||||||
|
remoteExitNodeId: string;
|
||||||
|
secret: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ListRemoteExitNodesResponse = {
|
||||||
|
remoteExitNodes: {
|
||||||
|
remoteExitNodeId: string;
|
||||||
|
dateCreated: string;
|
||||||
|
version: string | null;
|
||||||
|
exitNodeId: number | null;
|
||||||
|
name: string;
|
||||||
|
address: string;
|
||||||
|
endpoint: string;
|
||||||
|
online: boolean;
|
||||||
|
type: string | null;
|
||||||
|
}[];
|
||||||
|
pagination: { total: number; limit: number; offset: number };
|
||||||
|
};
|
||||||
|
|
||||||
|
export type GetRemoteExitNodeResponse = { remoteExitNodeId: string; dateCreated: string; version: string | null; exitNodeId: number | null; name: string; address: string; endpoint: string; online: boolean; type: string | null; }
|
||||||
@@ -10,7 +10,7 @@ import { redirect } from "next/navigation";
|
|||||||
import { cache } from "react";
|
import { cache } from "react";
|
||||||
import SetLastOrgCookie from "@app/components/SetLastOrgCookie";
|
import SetLastOrgCookie from "@app/components/SetLastOrgCookie";
|
||||||
import PrivateSubscriptionStatusProvider from "@app/providers/SubscriptionStatusProvider";
|
import PrivateSubscriptionStatusProvider from "@app/providers/SubscriptionStatusProvider";
|
||||||
import { GetOrgSubscriptionResponse } from "#private/routers/billing/getOrgSubscription";
|
import { GetOrgSubscriptionResponse } from "@server/routers/billing/types";
|
||||||
import { pullEnv } from "@app/lib/pullEnv";
|
import { pullEnv } from "@app/lib/pullEnv";
|
||||||
import { build } from "@server/build";
|
import { build } from "@server/build";
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import { InfoPopup } from "@/components/ui/info-popup";
|
|||||||
import {
|
import {
|
||||||
GetOrgSubscriptionResponse,
|
GetOrgSubscriptionResponse,
|
||||||
GetOrgUsageResponse
|
GetOrgUsageResponse
|
||||||
} from "#private/routers/billing";
|
} from "@server/routers/billing/types";
|
||||||
import { useTranslations } from "use-intl";
|
import { useTranslations } from "use-intl";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { cache } from "react";
|
|||||||
import {
|
import {
|
||||||
GetOrgSubscriptionResponse,
|
GetOrgSubscriptionResponse,
|
||||||
GetOrgTierResponse
|
GetOrgTierResponse
|
||||||
} from "#private/routers/billing";
|
} from "@server/routers/billing/types";
|
||||||
import { TierId } from "@server/lib/billing/tiers";
|
import { TierId } from "@server/lib/billing/tiers";
|
||||||
import { build } from "@server/build";
|
import { build } from "@server/build";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { internal } from "@app/lib/api";
|
import { internal } from "@app/lib/api";
|
||||||
import { GetRemoteExitNodeResponse } from "#private/routers/remoteExitNode";
|
import { GetRemoteExitNodeResponse } from "@server/routers/remoteExitNode/types";
|
||||||
import { AxiosResponse } from "axios";
|
import { AxiosResponse } from "axios";
|
||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
import { authCookieHeader } from "@app/lib/api/cookies";
|
import { authCookieHeader } from "@app/lib/api/cookies";
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import { useEnvContext } from "@app/hooks/useEnvContext";
|
|||||||
import {
|
import {
|
||||||
QuickStartRemoteExitNodeResponse,
|
QuickStartRemoteExitNodeResponse,
|
||||||
PickRemoteExitNodeDefaultsResponse
|
PickRemoteExitNodeDefaultsResponse
|
||||||
} from "#private/routers/remoteExitNode";
|
} from "@server/routers/remoteExitNode/types";
|
||||||
import { toast } from "@app/hooks/useToast";
|
import { toast } from "@app/hooks/useToast";
|
||||||
import { AxiosResponse } from "axios";
|
import { AxiosResponse } from "axios";
|
||||||
import { useParams, useRouter, useSearchParams } from "next/navigation";
|
import { useParams, useRouter, useSearchParams } from "next/navigation";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { internal } from "@app/lib/api";
|
import { internal } from "@app/lib/api";
|
||||||
import { authCookieHeader } from "@app/lib/api/cookies";
|
import { authCookieHeader } from "@app/lib/api/cookies";
|
||||||
import { ListRemoteExitNodesResponse } from "#private/routers/remoteExitNode";
|
import { ListRemoteExitNodesResponse } from "@server/routers/remoteExitNode/types";
|
||||||
import { AxiosResponse } from "axios";
|
import { AxiosResponse } from "axios";
|
||||||
import ExitNodesTable, { RemoteExitNodeRow } from "./ExitNodesTable";
|
import ExitNodesTable, { RemoteExitNodeRow } from "./ExitNodesTable";
|
||||||
import SettingsSectionTitle from "@app/components/SettingsSectionTitle";
|
import SettingsSectionTitle from "@app/components/SettingsSectionTitle";
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ import {
|
|||||||
CreateSiteResponse,
|
CreateSiteResponse,
|
||||||
PickSiteDefaultsResponse
|
PickSiteDefaultsResponse
|
||||||
} from "@server/routers/site";
|
} from "@server/routers/site";
|
||||||
import { ListRemoteExitNodesResponse } from "#private/routers/remoteExitNode";
|
import { ListRemoteExitNodesResponse } from "@server/routers/remoteExitNode/types";
|
||||||
import { toast } from "@app/hooks/useToast";
|
import { toast } from "@app/hooks/useToast";
|
||||||
import { AxiosResponse } from "axios";
|
import { AxiosResponse } from "axios";
|
||||||
import { useParams, useRouter } from "next/navigation";
|
import { useParams, useRouter } from "next/navigation";
|
||||||
|
|||||||
@@ -6,13 +6,12 @@ import { verifySession } from "@app/lib/auth/verifySession";
|
|||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
import { pullEnv } from "@app/lib/pullEnv";
|
import { pullEnv } from "@app/lib/pullEnv";
|
||||||
import { LoginFormIDP } from "@app/components/LoginForm";
|
import { LoginFormIDP } from "@app/components/LoginForm";
|
||||||
import { ListOrgIdpsResponse } from "#private/routers/orgIdp";
|
import { ListOrgIdpsResponse } from "@server/routers/orgIdp/types";
|
||||||
import { build } from "@server/build";
|
import { build } from "@server/build";
|
||||||
import { headers } from "next/headers";
|
import { headers } from "next/headers";
|
||||||
import {
|
import {
|
||||||
GetLoginPageResponse,
|
|
||||||
LoadLoginPageResponse
|
LoadLoginPageResponse
|
||||||
} from "#private/routers/loginPage";
|
} from "@server/routers/loginPage/types";
|
||||||
import IdpLoginButtons from "@app/components/private/IdpLoginButtons";
|
import IdpLoginButtons from "@app/components/private/IdpLoginButtons";
|
||||||
import {
|
import {
|
||||||
Card,
|
Card,
|
||||||
@@ -26,7 +25,7 @@ import Link from "next/link";
|
|||||||
import { getTranslations } from "next-intl/server";
|
import { getTranslations } from "next-intl/server";
|
||||||
import { GetSessionTransferTokenRenponse } from "#private/routers/auth/getSessionTransferToken";
|
import { GetSessionTransferTokenRenponse } from "#private/routers/auth/getSessionTransferToken";
|
||||||
import ValidateSessionTransferToken from "@app/components/private/ValidateSessionTransferToken";
|
import ValidateSessionTransferToken from "@app/components/private/ValidateSessionTransferToken";
|
||||||
import { GetOrgTierResponse } from "#private/routers/billing";
|
import { GetOrgTierResponse } from "@server/routers/billing/types";
|
||||||
import { TierId } from "@server/lib/billing/tiers";
|
import { TierId } from "@server/lib/billing/tiers";
|
||||||
|
|
||||||
export const dynamic = "force-dynamic";
|
export const dynamic = "force-dynamic";
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { AxiosResponse } from "axios";
|
|||||||
import { GetIdpResponse } from "@server/routers/idp";
|
import { GetIdpResponse } from "@server/routers/idp";
|
||||||
import { getTranslations } from "next-intl/server";
|
import { getTranslations } from "next-intl/server";
|
||||||
import { pullEnv } from "@app/lib/pullEnv";
|
import { pullEnv } from "@app/lib/pullEnv";
|
||||||
import { LoadLoginPageResponse } from "#private/routers/loginPage";
|
import { LoadLoginPageResponse } from "@server/routers/loginPage/types";
|
||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
|
|
||||||
export const dynamic = "force-dynamic";
|
export const dynamic = "force-dynamic";
|
||||||
|
|||||||
@@ -15,12 +15,12 @@ import AccessToken from "@app/components/AccessToken";
|
|||||||
import { pullEnv } from "@app/lib/pullEnv";
|
import { pullEnv } from "@app/lib/pullEnv";
|
||||||
import { LoginFormIDP } from "@app/components/LoginForm";
|
import { LoginFormIDP } from "@app/components/LoginForm";
|
||||||
import { ListIdpsResponse } from "@server/routers/idp";
|
import { ListIdpsResponse } from "@server/routers/idp";
|
||||||
import { ListOrgIdpsResponse } from "#private/routers/orgIdp";
|
import { ListOrgIdpsResponse } from "@server/routers/orgIdp/types";
|
||||||
import AutoLoginHandler from "@app/components/AutoLoginHandler";
|
import AutoLoginHandler from "@app/components/AutoLoginHandler";
|
||||||
import { build } from "@server/build";
|
import { build } from "@server/build";
|
||||||
import { headers } from "next/headers";
|
import { headers } from "next/headers";
|
||||||
import { GetLoginPageResponse } from "#private/routers/loginPage";
|
import { GetLoginPageResponse } from "@server/routers/loginPage/types";
|
||||||
import { GetOrgTierResponse } from "#private/routers/billing";
|
import { GetOrgTierResponse } from "@server/routers/billing/types";
|
||||||
import { TierId } from "@server/lib/billing/tiers";
|
import { TierId } from "@server/lib/billing/tiers";
|
||||||
|
|
||||||
export const dynamic = "force-dynamic";
|
export const dynamic = "force-dynamic";
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import { createApiClient, formatAxiosError } from "@/lib/api";
|
|||||||
import { useEnvContext } from "@/hooks/useEnvContext";
|
import { useEnvContext } from "@/hooks/useEnvContext";
|
||||||
import { toast } from "@/hooks/useToast";
|
import { toast } from "@/hooks/useToast";
|
||||||
import { ListDomainsResponse } from "@server/routers/domain/listDomains";
|
import { ListDomainsResponse } from "@server/routers/domain/listDomains";
|
||||||
import { CheckDomainAvailabilityResponse } from "#private/routers/domain/checkDomainNamespaceAvailability";
|
import { CheckDomainAvailabilityResponse } from "@server/routers/domain/types";
|
||||||
import { AxiosResponse } from "axios";
|
import { AxiosResponse } from "axios";
|
||||||
import { cn } from "@/lib/cn";
|
import { cn } from "@/lib/cn";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import {
|
|||||||
SettingsSectionForm
|
SettingsSectionForm
|
||||||
} from "@app/components/Settings";
|
} from "@app/components/Settings";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
import { GetLoginPageResponse } from "#private/routers/loginPage";
|
import { GetLoginPageResponse } from "@server/routers/loginPage/types";
|
||||||
import { ListDomainsResponse } from "@server/routers/domain";
|
import { ListDomainsResponse } from "@server/routers/domain";
|
||||||
import { DomainRow } from "@app/components/DomainsTable";
|
import { DomainRow } from "@app/components/DomainsTable";
|
||||||
import { toUnicode } from "punycode";
|
import { toUnicode } from "punycode";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { useEffect, useState } from "react";
|
|||||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||||
import { AlertCircle } from "lucide-react";
|
import { AlertCircle } from "lucide-react";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
import { TransferSessionResponse } from "#private/routers/auth/transferSession";
|
import { TransferSessionResponse } from "@server/routers/auth/types";
|
||||||
|
|
||||||
type ValidateSessionTransferTokenParams = {
|
type ValidateSessionTransferTokenParams = {
|
||||||
token: string;
|
token: string;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { GetRemoteExitNodeResponse } from "#private/routers/remoteExitNode";
|
import { GetRemoteExitNodeResponse } from "@server/routers/remoteExitNode/types";
|
||||||
import { createContext } from "react";
|
import { createContext } from "react";
|
||||||
|
|
||||||
type RemoteExitNodeContextType = {
|
type RemoteExitNodeContextType = {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { GetOrgSubscriptionResponse } from "#private/routers/billing";
|
import { GetOrgSubscriptionResponse } from "@server/routers/billing/types";
|
||||||
import { createContext } from "react";
|
import { createContext } from "react";
|
||||||
|
|
||||||
type SubscriptionStatusContextType = {
|
type SubscriptionStatusContextType = {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { useState, useCallback, useEffect } from "react";
|
import { useState, useCallback, useEffect } from "react";
|
||||||
import { AxiosResponse } from "axios";
|
import { AxiosResponse } from "axios";
|
||||||
import { GetCertificateResponse } from "#private/routers/certificates";
|
import { GetCertificateResponse } from "@server/routers/certificates/types";
|
||||||
import { createApiClient } from "@app/lib/api";
|
import { createApiClient } from "@app/lib/api";
|
||||||
import { useEnvContext } from "@app/hooks/useEnvContext";
|
import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import RemoteExitNodeContext from "@app/contexts/remoteExitNodeContext";
|
import RemoteExitNodeContext from "@app/contexts/remoteExitNodeContext";
|
||||||
import { GetRemoteExitNodeResponse } from "#private/routers/remoteExitNode";
|
import { GetRemoteExitNodeResponse } from "@server/routers/remoteExitNode/types";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import SubscriptionStatusContext from "@app/contexts/subscriptionStatusContext";
|
import SubscriptionStatusContext from "@app/contexts/subscriptionStatusContext";
|
||||||
import { getTierPriceSet } from "@server/lib/billing/tiers";
|
import { getTierPriceSet } from "@server/lib/billing/tiers";
|
||||||
import { GetOrgSubscriptionResponse } from "#private/routers/billing";
|
import { GetOrgSubscriptionResponse } from "@server/routers/billing/types";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
interface ProviderProps {
|
interface ProviderProps {
|
||||||
|
|||||||
Reference in New Issue
Block a user