mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-30 04:32:53 +00:00
Only support alerts and newt sync on saas
This commit is contained in:
@@ -15,6 +15,7 @@ import * as orgIdp from "#private/routers/orgIdp";
|
||||
import * as org from "#private/routers/org";
|
||||
import * as logs from "#private/routers/auditLogs";
|
||||
import * as alertEvents from "#private/routers/alertEvents";
|
||||
import * as certificates from "#private/routers/certificates";
|
||||
|
||||
import {
|
||||
verifyApiKeyHasAction,
|
||||
@@ -37,30 +38,36 @@ import {
|
||||
} from "@server/routers/integration";
|
||||
import { logActionAudit } from "#private/middlewares";
|
||||
import { tierMatrix } from "@server/lib/billing/tierMatrix";
|
||||
import { build } from "@server/build";
|
||||
|
||||
export const unauthenticated = ua;
|
||||
export const authenticated = a;
|
||||
|
||||
authenticated.post(
|
||||
"/org/:orgId/site/:siteId/trigger-alert",
|
||||
verifyApiKeyIsRoot,
|
||||
verifyApiKeyHasAction(ActionsEnum.triggerSiteAlert),
|
||||
alertEvents.triggerSiteAlert
|
||||
);
|
||||
if (build == "saas") {
|
||||
authenticated.post(
|
||||
"/org/:orgId/site/:siteId/trigger-alert",
|
||||
verifyApiKeyIsRoot,
|
||||
alertEvents.triggerSiteAlert
|
||||
);
|
||||
|
||||
authenticated.post(
|
||||
"/org/:orgId/resource/:resourceId/trigger-alert",
|
||||
verifyApiKeyIsRoot,
|
||||
verifyApiKeyHasAction(ActionsEnum.triggerResourceAlert),
|
||||
alertEvents.triggerResourceAlert
|
||||
);
|
||||
authenticated.post(
|
||||
"/org/:orgId/resource/:resourceId/trigger-alert",
|
||||
verifyApiKeyIsRoot,
|
||||
alertEvents.triggerResourceAlert
|
||||
);
|
||||
|
||||
authenticated.post(
|
||||
"/org/:orgId/health-check/:healthCheckId/trigger-alert",
|
||||
verifyApiKeyIsRoot,
|
||||
verifyApiKeyHasAction(ActionsEnum.triggerHealthCheckAlert),
|
||||
alertEvents.triggerHealthCheckAlert
|
||||
);
|
||||
authenticated.post(
|
||||
"/org/:orgId/health-check/:healthCheckId/trigger-alert",
|
||||
verifyApiKeyIsRoot,
|
||||
alertEvents.triggerHealthCheckAlert
|
||||
);
|
||||
|
||||
authenticated.post(
|
||||
"/cert/sync-to-newts",
|
||||
verifyApiKeyIsRoot,
|
||||
certificates.syncCertToNewts
|
||||
);
|
||||
}
|
||||
|
||||
authenticated.post(
|
||||
`/org/:orgId/send-usage-notification`,
|
||||
|
||||
Reference in New Issue
Block a user