mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-19 10:42:57 +02:00
Fix typo
This commit is contained in:
@@ -4,7 +4,7 @@ export enum LimitId {
|
|||||||
EGRESS_DATA_MB = "egressDataMb",
|
EGRESS_DATA_MB = "egressDataMb",
|
||||||
DOMAINS = "domains",
|
DOMAINS = "domains",
|
||||||
REMOTE_EXIT_NODES = "remoteExitNodes",
|
REMOTE_EXIT_NODES = "remoteExitNodes",
|
||||||
ORGINIZATIONS = "organizations",
|
ORGANIZATIONS = "organizations",
|
||||||
TIER1 = "tier1"
|
TIER1 = "tier1"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ export async function getFeatureDisplayName(
|
|||||||
return "Domains";
|
return "Domains";
|
||||||
case LimitId.REMOTE_EXIT_NODES:
|
case LimitId.REMOTE_EXIT_NODES:
|
||||||
return "Remote Exit Nodes";
|
return "Remote Exit Nodes";
|
||||||
case LimitId.ORGINIZATIONS:
|
case LimitId.ORGANIZATIONS:
|
||||||
return "Organizations";
|
return "Organizations";
|
||||||
case LimitId.TIER1:
|
case LimitId.TIER1:
|
||||||
return "Home Lab";
|
return "Home Lab";
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export const freeLimitSet: LimitSet = {
|
|||||||
[LimitId.USERS]: { value: 5, description: "Basic limit" },
|
[LimitId.USERS]: { value: 5, description: "Basic limit" },
|
||||||
[LimitId.DOMAINS]: { value: 5, description: "Basic limit" },
|
[LimitId.DOMAINS]: { value: 5, description: "Basic limit" },
|
||||||
[LimitId.REMOTE_EXIT_NODES]: { value: 1, description: "Basic limit" },
|
[LimitId.REMOTE_EXIT_NODES]: { value: 1, description: "Basic limit" },
|
||||||
[LimitId.ORGINIZATIONS]: { value: 1, description: "Basic limit" }
|
[LimitId.ORGANIZATIONS]: { value: 1, description: "Basic limit" }
|
||||||
};
|
};
|
||||||
|
|
||||||
export const tier1LimitSet: LimitSet = {
|
export const tier1LimitSet: LimitSet = {
|
||||||
@@ -20,7 +20,7 @@ export const tier1LimitSet: LimitSet = {
|
|||||||
[LimitId.SITES]: { value: 10, description: "Home limit" },
|
[LimitId.SITES]: { value: 10, description: "Home limit" },
|
||||||
[LimitId.DOMAINS]: { value: 10, description: "Home limit" },
|
[LimitId.DOMAINS]: { value: 10, description: "Home limit" },
|
||||||
[LimitId.REMOTE_EXIT_NODES]: { value: 1, description: "Home limit" },
|
[LimitId.REMOTE_EXIT_NODES]: { value: 1, description: "Home limit" },
|
||||||
[LimitId.ORGINIZATIONS]: { value: 1, description: "Home limit" }
|
[LimitId.ORGANIZATIONS]: { value: 1, description: "Home limit" }
|
||||||
};
|
};
|
||||||
|
|
||||||
export const tier2LimitSet: LimitSet = {
|
export const tier2LimitSet: LimitSet = {
|
||||||
@@ -40,7 +40,7 @@ export const tier2LimitSet: LimitSet = {
|
|||||||
value: 3,
|
value: 3,
|
||||||
description: "Team limit"
|
description: "Team limit"
|
||||||
},
|
},
|
||||||
[LimitId.ORGINIZATIONS]: {
|
[LimitId.ORGANIZATIONS]: {
|
||||||
value: 1,
|
value: 1,
|
||||||
description: "Team limit"
|
description: "Team limit"
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@ export const tier3LimitSet: LimitSet = {
|
|||||||
value: 20,
|
value: 20,
|
||||||
description: "Business limit"
|
description: "Business limit"
|
||||||
},
|
},
|
||||||
[LimitId.ORGINIZATIONS]: {
|
[LimitId.ORGANIZATIONS]: {
|
||||||
value: 5,
|
value: 5,
|
||||||
description: "Business limit"
|
description: "Business limit"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ export async function deleteOrgById(
|
|||||||
.where(inArray(domains.domainId, domainIdsToDelete));
|
.where(inArray(domains.domainId, domainIdsToDelete));
|
||||||
}
|
}
|
||||||
|
|
||||||
await usageService.add(orgId, LimitId.ORGINIZATIONS, -1, trx); // here we are decreasing the org count BEFORE deleting the org because we need to still be able to get the org to get the billing org inside of here
|
await usageService.add(orgId, LimitId.ORGANIZATIONS, -1, trx); // here we are decreasing the org count BEFORE deleting the org because we need to still be able to get the org to get the billing org inside of here
|
||||||
|
|
||||||
await trx.delete(orgs).where(eq(orgs.orgId, orgId));
|
await trx.delete(orgs).where(eq(orgs.orgId, orgId));
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ export async function getOrgUsage(
|
|||||||
);
|
);
|
||||||
const organizations = await usageService.getUsage(
|
const organizations = await usageService.getUsage(
|
||||||
orgId,
|
orgId,
|
||||||
LimitId.ORGINIZATIONS
|
LimitId.ORGANIZATIONS
|
||||||
);
|
);
|
||||||
// const egressData = await usageService.getUsage(
|
// const egressData = await usageService.getUsage(
|
||||||
// orgId,
|
// orgId,
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ export async function createOrg(
|
|||||||
if (build == "saas" && billingOrgIdForNewOrg) {
|
if (build == "saas" && billingOrgIdForNewOrg) {
|
||||||
const usage = await usageService.getUsage(
|
const usage = await usageService.getUsage(
|
||||||
billingOrgIdForNewOrg,
|
billingOrgIdForNewOrg,
|
||||||
LimitId.ORGINIZATIONS
|
LimitId.ORGANIZATIONS
|
||||||
);
|
);
|
||||||
if (!usage) {
|
if (!usage) {
|
||||||
return next(
|
return next(
|
||||||
@@ -214,7 +214,7 @@ export async function createOrg(
|
|||||||
}
|
}
|
||||||
const rejectOrgs = await usageService.checkLimitSet(
|
const rejectOrgs = await usageService.checkLimitSet(
|
||||||
billingOrgIdForNewOrg,
|
billingOrgIdForNewOrg,
|
||||||
LimitId.ORGINIZATIONS,
|
LimitId.ORGANIZATIONS,
|
||||||
{
|
{
|
||||||
...usage,
|
...usage,
|
||||||
instantaneousValue: (usage.instantaneousValue || 0) + 1
|
instantaneousValue: (usage.instantaneousValue || 0) + 1
|
||||||
@@ -431,7 +431,7 @@ export async function createOrg(
|
|||||||
if (numOrgs) {
|
if (numOrgs) {
|
||||||
usageService.updateCount(
|
usageService.updateCount(
|
||||||
billingOrgIdForNewOrg || orgId,
|
billingOrgIdForNewOrg || orgId,
|
||||||
LimitId.ORGINIZATIONS,
|
LimitId.ORGANIZATIONS,
|
||||||
numOrgs
|
numOrgs
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -165,28 +165,28 @@ const tierLimits: Record<
|
|||||||
sites: freeLimitSet[LimitId.SITES]?.value ?? 0,
|
sites: freeLimitSet[LimitId.SITES]?.value ?? 0,
|
||||||
domains: freeLimitSet[LimitId.DOMAINS]?.value ?? 0,
|
domains: freeLimitSet[LimitId.DOMAINS]?.value ?? 0,
|
||||||
remoteNodes: freeLimitSet[LimitId.REMOTE_EXIT_NODES]?.value ?? 0,
|
remoteNodes: freeLimitSet[LimitId.REMOTE_EXIT_NODES]?.value ?? 0,
|
||||||
organizations: freeLimitSet[LimitId.ORGINIZATIONS]?.value ?? 0
|
organizations: freeLimitSet[LimitId.ORGANIZATIONS]?.value ?? 0
|
||||||
},
|
},
|
||||||
tier1: {
|
tier1: {
|
||||||
users: tier1LimitSet[LimitId.USERS]?.value ?? 0,
|
users: tier1LimitSet[LimitId.USERS]?.value ?? 0,
|
||||||
sites: tier1LimitSet[LimitId.SITES]?.value ?? 0,
|
sites: tier1LimitSet[LimitId.SITES]?.value ?? 0,
|
||||||
domains: tier1LimitSet[LimitId.DOMAINS]?.value ?? 0,
|
domains: tier1LimitSet[LimitId.DOMAINS]?.value ?? 0,
|
||||||
remoteNodes: tier1LimitSet[LimitId.REMOTE_EXIT_NODES]?.value ?? 0,
|
remoteNodes: tier1LimitSet[LimitId.REMOTE_EXIT_NODES]?.value ?? 0,
|
||||||
organizations: tier1LimitSet[LimitId.ORGINIZATIONS]?.value ?? 0
|
organizations: tier1LimitSet[LimitId.ORGANIZATIONS]?.value ?? 0
|
||||||
},
|
},
|
||||||
tier2: {
|
tier2: {
|
||||||
users: tier2LimitSet[LimitId.USERS]?.value ?? 0,
|
users: tier2LimitSet[LimitId.USERS]?.value ?? 0,
|
||||||
sites: tier2LimitSet[LimitId.SITES]?.value ?? 0,
|
sites: tier2LimitSet[LimitId.SITES]?.value ?? 0,
|
||||||
domains: tier2LimitSet[LimitId.DOMAINS]?.value ?? 0,
|
domains: tier2LimitSet[LimitId.DOMAINS]?.value ?? 0,
|
||||||
remoteNodes: tier2LimitSet[LimitId.REMOTE_EXIT_NODES]?.value ?? 0,
|
remoteNodes: tier2LimitSet[LimitId.REMOTE_EXIT_NODES]?.value ?? 0,
|
||||||
organizations: tier2LimitSet[LimitId.ORGINIZATIONS]?.value ?? 0
|
organizations: tier2LimitSet[LimitId.ORGANIZATIONS]?.value ?? 0
|
||||||
},
|
},
|
||||||
tier3: {
|
tier3: {
|
||||||
users: tier3LimitSet[LimitId.USERS]?.value ?? 0,
|
users: tier3LimitSet[LimitId.USERS]?.value ?? 0,
|
||||||
sites: tier3LimitSet[LimitId.SITES]?.value ?? 0,
|
sites: tier3LimitSet[LimitId.SITES]?.value ?? 0,
|
||||||
domains: tier3LimitSet[LimitId.DOMAINS]?.value ?? 0,
|
domains: tier3LimitSet[LimitId.DOMAINS]?.value ?? 0,
|
||||||
remoteNodes: tier3LimitSet[LimitId.REMOTE_EXIT_NODES]?.value ?? 0,
|
remoteNodes: tier3LimitSet[LimitId.REMOTE_EXIT_NODES]?.value ?? 0,
|
||||||
organizations: tier3LimitSet[LimitId.ORGINIZATIONS]?.value ?? 0
|
organizations: tier3LimitSet[LimitId.ORGANIZATIONS]?.value ?? 0
|
||||||
},
|
},
|
||||||
enterprise: {
|
enterprise: {
|
||||||
users: 0, // Custom for enterprise
|
users: 0, // Custom for enterprise
|
||||||
|
|||||||
Reference in New Issue
Block a user