Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+18
-8
@@ -46,15 +46,25 @@ export async function getConnectionForTenant(tenantId: string, connectionId: str
|
||||
}) as unknown as Promise<CalendarConnectionListRow | null>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the connection a Google push channel belongs to. The webhook entrypoint
|
||||
* has NO tenant context (Google calls a fixed URL), so this is a deliberate
|
||||
* cross-tenant lookup by the stored subscription id; the caller then scopes every
|
||||
* follow-up to the returned tenantId.
|
||||
*/
|
||||
export async function findConnectionByWebhookSubscription(subscriptionId: string): Promise<{ id: string; tenantId: string; userId: string } | null> {
|
||||
/** Exact full-row re-read after the narrow bootstrap resolver selected context. */
|
||||
export async function getGoogleWebhookConnection(input: {
|
||||
tenantId: string;
|
||||
userId: string;
|
||||
connectionId: string;
|
||||
channelId: string;
|
||||
channelToken: string;
|
||||
}): Promise<{ id: string; tenantId: string; userId: string } | null> {
|
||||
return db.calendarConnection.findFirst({
|
||||
where: { webhookSubscriptionId: subscriptionId, archivedAt: null },
|
||||
where: {
|
||||
id: input.connectionId,
|
||||
tenantId: input.tenantId,
|
||||
userId: input.userId,
|
||||
provider: "google",
|
||||
status: "active",
|
||||
archivedAt: null,
|
||||
webhookSubscriptionId: input.channelId,
|
||||
AND: { id: input.channelToken },
|
||||
},
|
||||
select: { id: true, tenantId: true, userId: true },
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user