Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
+1
-1
@@ -2,7 +2,7 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
const publishOutboxEventMock = vi.fn(async () => ({ id: "outbox_1" }));
|
||||
|
||||
vi.mock("@toolctrl/db/outbox", () => ({
|
||||
vi.mock("@hivegrid/db/outbox", () => ({
|
||||
publishOutboxEvent: (...args: unknown[]) => publishOutboxEventMock(...args),
|
||||
}));
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
const publishOutboxEventMock = vi.fn();
|
||||
|
||||
vi.mock("@toolctrl/db/outbox", () => ({
|
||||
vi.mock("@hivegrid/db/outbox", () => ({
|
||||
publishOutboxEvent: publishOutboxEventMock,
|
||||
}));
|
||||
|
||||
|
||||
+13
-6
@@ -1,6 +1,6 @@
|
||||
import { Event } from "@toolctrl/db/prisma-browser";
|
||||
import { publishOutboxEvent, type OutboxPublisherTransaction } from "@toolctrl/db/outbox";
|
||||
import { buildWorkflowTriggerOutboxEvent } from "@toolctrl/queue";
|
||||
import { Event } from "@hivegrid/db/prisma-browser";
|
||||
import { publishOutboxEvent, type OutboxPublisherTransaction } from "@hivegrid/db/outbox";
|
||||
import { buildWorkflowTriggerOutboxEvent } from "@hivegrid/queue";
|
||||
import NotificationService from "~/modules/notifications/services/.server/NotificationService";
|
||||
import { getBaseURL } from "~/utils/url.server";
|
||||
import { createEventWebhookAttempt, updateEventWebhookAttempt } from "../../db/eventWebhookAttempts.db.server";
|
||||
@@ -121,6 +121,13 @@ function assertNever(x: never): never {
|
||||
throw new Error("Unexpected event: " + x);
|
||||
}
|
||||
|
||||
function onboardingSessionUrl(data: unknown) {
|
||||
const sessionId = typeof data === "object" && data !== null && "session" in data && typeof (data as { session?: { id?: unknown } }).session?.id === "string"
|
||||
? (data as { session: { id: string } }).session.id
|
||||
: "";
|
||||
return sessionId ? `/onboarding/${sessionId}` : "/onboarding";
|
||||
}
|
||||
|
||||
async function onEvent(params: ICreateApplicationEvent & { description: string }) {
|
||||
eventsLogger.info({ op: "onEvent", event: params.event, tenantId: params.tenantId }, "Application event dispatched");
|
||||
const event = ApplicationEvents.find((f) => f.value === params.event);
|
||||
@@ -312,7 +319,7 @@ async function onEvent(params: ICreateApplicationEvent & { description: string }
|
||||
tenantId,
|
||||
notification: {
|
||||
message: params.description,
|
||||
action: { url: adminPath("onboarding/sessions", { mode: "host-aware" }) },
|
||||
action: { url: onboardingSessionUrl(params.data) },
|
||||
},
|
||||
});
|
||||
break;
|
||||
@@ -323,7 +330,7 @@ async function onEvent(params: ICreateApplicationEvent & { description: string }
|
||||
tenantId,
|
||||
notification: {
|
||||
message: params.description,
|
||||
action: { url: adminPath("onboarding/sessions", { mode: "host-aware" }) },
|
||||
action: { url: onboardingSessionUrl(params.data) },
|
||||
},
|
||||
});
|
||||
break;
|
||||
@@ -334,7 +341,7 @@ async function onEvent(params: ICreateApplicationEvent & { description: string }
|
||||
tenantId,
|
||||
notification: {
|
||||
message: params.description,
|
||||
action: { url: adminPath("onboarding/sessions", { mode: "host-aware" }) },
|
||||
action: { url: onboardingSessionUrl(params.data) },
|
||||
},
|
||||
});
|
||||
break;
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ vi.mock("~/utils/db.server", () => ({
|
||||
},
|
||||
}));
|
||||
|
||||
vi.mock("@toolctrl/db/outbox", () => ({
|
||||
vi.mock("@hivegrid/db/outbox", () => ({
|
||||
publishOutboxEvent: mocks.publishOutboxEvent,
|
||||
}));
|
||||
|
||||
|
||||
Reference in new issue
Block a user