add remove invitation to integration api

This commit is contained in:
miloschwartz
2025-12-16 17:16:53 -05:00
parent 7f7f6eeaea
commit 6072ee93fa
4 changed files with 22 additions and 0 deletions

View File

@@ -1035,6 +1035,7 @@
"updateOrgUser": "Update Org User", "updateOrgUser": "Update Org User",
"createOrgUser": "Create Org User", "createOrgUser": "Create Org User",
"actionUpdateOrg": "Update Organization", "actionUpdateOrg": "Update Organization",
"actionRemoveInvitation": "Remove Invitation",
"actionUpdateUser": "Update User", "actionUpdateUser": "Update User",
"actionGetUser": "Get User", "actionGetUser": "Get User",
"actionGetOrgUser": "Get Organization User", "actionGetOrgUser": "Get Organization User",

View File

@@ -352,6 +352,14 @@ authenticated.post(
user.inviteUser user.inviteUser
); );
authenticated.delete(
"/org/:orgId/invitations/:inviteId",
verifyApiKeyOrgAccess,
verifyApiKeyHasAction(ActionsEnum.removeInvitation),
logActionAudit(ActionsEnum.removeInvitation),
user.removeInvitation
);
authenticated.get( authenticated.get(
"/resource/:resourceId/roles", "/resource/:resourceId/roles",
verifyApiKeyResourceAccess, verifyApiKeyResourceAccess,

View File

@@ -8,12 +8,24 @@ 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 { OpenAPITags, registry } from "@server/openApi";
const removeInvitationParamsSchema = z.strictObject({ const removeInvitationParamsSchema = z.strictObject({
orgId: z.string(), orgId: z.string(),
inviteId: z.string() inviteId: z.string()
}); });
registry.registerPath({
method: "delete",
path: "/org/{orgId}/invitations/{inviteId}",
description: "Remove an open invitation from an organization",
tags: [OpenAPITags.Org],
request: {
params: removeInvitationParamsSchema
},
responses: {}
});
export async function removeInvitation( export async function removeInvitation(
req: Request, req: Request,
res: Response, res: Response,

View File

@@ -27,6 +27,7 @@ function getActionsCategories(root: boolean) {
[t("actionUpdateOrg")]: "updateOrg", [t("actionUpdateOrg")]: "updateOrg",
[t("actionGetOrgUser")]: "getOrgUser", [t("actionGetOrgUser")]: "getOrgUser",
[t("actionInviteUser")]: "inviteUser", [t("actionInviteUser")]: "inviteUser",
[t("actionRemoveInvitation")]: "removeInvitation",
[t("actionListInvitations")]: "listInvitations", [t("actionListInvitations")]: "listInvitations",
[t("actionRemoveUser")]: "removeUser", [t("actionRemoveUser")]: "removeUser",
[t("actionListUsers")]: "listUsers", [t("actionListUsers")]: "listUsers",