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
@@ -1,4 +1,4 @@
|
||||
import { Event } from "@toolctrl/db/prisma-browser";
|
||||
import { Event } from "@hivegrid/db/prisma-browser";
|
||||
import { FiltersDto } from "~/application/dtos/data/FiltersDto";
|
||||
import { PaginationResultDto } from "~/application/dtos/data/PaginationResultDto";
|
||||
import { db } from "~/utils/db.server";
|
||||
|
||||
-3
@@ -1,11 +1,8 @@
|
||||
import { ApiKeyEntityPermissionDto } from "~/application/dtos/apiKeys/ApiKeyEntityPermissionDto";
|
||||
|
||||
export type ApiKeyCreatedDto = {
|
||||
id: string;
|
||||
alias: string;
|
||||
expires: Date | null;
|
||||
active: boolean;
|
||||
entities: ApiKeyEntityPermissionDto[];
|
||||
user: {
|
||||
id: string;
|
||||
email: string;
|
||||
|
||||
-3
@@ -1,11 +1,8 @@
|
||||
import { ApiKeyEntityPermissionDto } from "~/application/dtos/apiKeys/ApiKeyEntityPermissionDto";
|
||||
|
||||
export type ApiKeyDeletedDto = {
|
||||
id: string;
|
||||
alias: string;
|
||||
expires: Date | null;
|
||||
active: boolean;
|
||||
entities: ApiKeyEntityPermissionDto[];
|
||||
user: {
|
||||
id: string;
|
||||
email: string;
|
||||
|
||||
-4
@@ -1,18 +1,14 @@
|
||||
import { ApiKeyEntityPermissionDto } from "~/application/dtos/apiKeys/ApiKeyEntityPermissionDto";
|
||||
|
||||
export type ApiKeyUpdatedDto = {
|
||||
id: string;
|
||||
new: {
|
||||
alias: string;
|
||||
expires: Date | null;
|
||||
active: boolean;
|
||||
entities: ApiKeyEntityPermissionDto[];
|
||||
};
|
||||
old: {
|
||||
alias: string;
|
||||
expires: Date | null;
|
||||
active: boolean;
|
||||
entities: ApiKeyEntityPermissionDto[];
|
||||
};
|
||||
user: {
|
||||
id: string;
|
||||
|
||||
+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,
|
||||
}));
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import { UserPreferencesUpdatedDto } from "../dtos/UserPreferencesUpdatedDto";
|
||||
import { UserProfileDeletedDto } from "../dtos/UserProfileDeletedDto";
|
||||
import { UserProfileUpdatedDto } from "../dtos/UserProfileUpdatedDto";
|
||||
import { ApplicationEvent, getApplicationEventNameKey, isApplicationEvent } from "../types/ApplicationEvent";
|
||||
import { Event } from "@toolctrl/db/prisma-browser";
|
||||
import { Event } from "@hivegrid/db/prisma-browser";
|
||||
import { RowTasksCreatedDto } from "../dtos/RowTasksCreatedDto";
|
||||
import { RowTasksUpdatedDto } from "../dtos/RowTasksUpdatedDto";
|
||||
import { RowTasksDeletedDto } from "../dtos/RowTasksDeletedDto";
|
||||
|
||||
Reference in new issue
Block a user