From cefaaf0530951549bd87bd4d9a546bc872df03b1 Mon Sep 17 00:00:00 2001 From: Dustin Healy <54083382+dustinhealy@users.noreply.github.com> Date: Tue, 9 Jun 2026 11:57:00 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix:=20align=20revokeCapability?= =?UTF-8?q?=20type=20annotation=20with=20implementation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rebase auto-merge of systemGrant.ts kept dev's outer type annotation (`revokeCapability: ... => Promise`) but our implementation returns `Promise<{ deletedCount: number }>` (added during the bot-review loop to let the audit emitter distinguish a real revoke from a no-op against a nonexistent grant). The mismatch surfaced as TS2719 on the methods record return at line 520. Updated the type annotation to match the impl. The caller at packages/api/src/admin/grants.ts:444 reads `revokeResult.deletedCount` to gate the audit emit, so the wider return type is what the rest of the code already assumes. --- packages/data-schemas/src/methods/systemGrant.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/data-schemas/src/methods/systemGrant.ts b/packages/data-schemas/src/methods/systemGrant.ts index cb60997018..9071f0a404 100644 --- a/packages/data-schemas/src/methods/systemGrant.ts +++ b/packages/data-schemas/src/methods/systemGrant.ts @@ -77,7 +77,7 @@ export function createSystemGrantMethods(mongoose: typeof import('mongoose')): { tenantId?: string; }, session?: ClientSession, - ) => Promise; + ) => Promise<{ deletedCount: number }>; hasCapabilityForPrincipals: ({ principals, capability,