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
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { afterEach, describe, expect, test, vi } from "vitest";
|
||||
import { buildRetryJobOptions, buildTransactionalMailJob, queueNames, type TypedQueue } from "@toolctrl/queue";
|
||||
import { buildRetryJobOptions, buildTransactionalMailJob, queueNames, type TypedQueue } from "@hivegrid/queue";
|
||||
import { sendEmailMailjet } from "./MailjetEmailService";
|
||||
|
||||
const runtimeQueue = {
|
||||
@@ -7,7 +7,7 @@ const runtimeQueue = {
|
||||
close: vi.fn(async () => undefined),
|
||||
};
|
||||
|
||||
vi.mock("@toolctrl/queue/runtime", () => ({
|
||||
vi.mock("@hivegrid/queue/runtime", () => ({
|
||||
createQueue: vi.fn(() => runtimeQueue),
|
||||
}));
|
||||
|
||||
|
||||
+9
-4
@@ -1,4 +1,4 @@
|
||||
import { MailProviderError, type MailProvider } from "@toolctrl/mail";
|
||||
import { MailProviderError, type MailAttachment, type MailProvider } from "@hivegrid/mail";
|
||||
import {
|
||||
buildTransactionalMailJob,
|
||||
enqueueJob,
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
resolveRedisConnectionOptionsFromProcessEnv,
|
||||
type RedisConnectionEnv,
|
||||
type TypedQueue,
|
||||
} from "@toolctrl/queue";
|
||||
} from "@hivegrid/queue";
|
||||
import { t as i18nT } from "i18next";
|
||||
|
||||
export type SendEmailMailjetDependencies = {
|
||||
@@ -29,6 +29,7 @@ export async function sendEmailMailjet(
|
||||
};
|
||||
tenantId?: string | null;
|
||||
priorityOverride?: "critical" | "high" | "normal" | "low";
|
||||
attachments?: readonly MailAttachment[];
|
||||
};
|
||||
},
|
||||
dependencies: SendEmailMailjetDependencies = {}
|
||||
@@ -43,6 +44,7 @@ export async function sendEmailMailjet(
|
||||
html: data.body,
|
||||
tenantId: data.tenantId,
|
||||
priorityOverride: data.priorityOverride,
|
||||
...(data.attachments && data.attachments.length > 0 ? { attachments: data.attachments } : {}),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -66,8 +68,8 @@ function createTransactionalQueueProviderFromEnv(env?: RedisConnectionEnv, alias
|
||||
return {
|
||||
id: "queue",
|
||||
async send(input) {
|
||||
const queueRuntimeModule = "@toolctrl/queue/runtime";
|
||||
const { createQueue } = (await import(/* @vite-ignore */ queueRuntimeModule)) as typeof import("@toolctrl/queue/runtime");
|
||||
const queueRuntimeModule = "@hivegrid/queue/runtime";
|
||||
const { createQueue } = (await import(/* @vite-ignore */ queueRuntimeModule)) as typeof import("@hivegrid/queue/runtime");
|
||||
const queue = createQueue(queueNames.email, { connection });
|
||||
try {
|
||||
return await createTransactionalQueueProvider(queue, alias, templateData).send(input);
|
||||
@@ -87,6 +89,9 @@ function createTransactionalQueueProvider(queue: TypedQueue<typeof queueNames.em
|
||||
subject: input.subject,
|
||||
html: input.html,
|
||||
templateData,
|
||||
// Forward attachments (e.g. AK-P16b booking .ics) — the payload already
|
||||
// supports them; only this provider hop was dropping the field.
|
||||
...(input.attachments && input.attachments.length > 0 ? { attachments: input.attachments } : {}),
|
||||
metadata: alias ? { alias } : undefined,
|
||||
});
|
||||
const job = await enqueueJob(queue, descriptor);
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { afterEach, describe, expect, test, vi } from "vitest";
|
||||
import { buildRetryJobOptions, buildTransactionalMailJob, queueNames, type TypedQueue } from "@toolctrl/queue";
|
||||
import { buildRetryJobOptions, buildTransactionalMailJob, queueNames, type TypedQueue } from "@hivegrid/queue";
|
||||
import { queueTransactionalEmail } from "./TransactionalEmailQueue.server";
|
||||
|
||||
const runtimeQueue = {
|
||||
@@ -21,7 +21,7 @@ function restoreRedisEnv() {
|
||||
}
|
||||
}
|
||||
|
||||
vi.mock("@toolctrl/queue/runtime", () => ({
|
||||
vi.mock("@hivegrid/queue/runtime", () => ({
|
||||
createQueue: vi.fn(() => runtimeQueue),
|
||||
}));
|
||||
|
||||
|
||||
+3
-3
@@ -6,7 +6,7 @@ import {
|
||||
resolveRedisConnectionOptionsFromProcessEnv,
|
||||
type RedisConnectionEnv,
|
||||
type TypedQueue,
|
||||
} from "@toolctrl/queue";
|
||||
} from "@hivegrid/queue";
|
||||
|
||||
export type QueueTransactionalEmailInput = {
|
||||
to: string;
|
||||
@@ -52,8 +52,8 @@ export async function queueTransactionalEmail(
|
||||
}
|
||||
|
||||
if (!queue && connection) {
|
||||
const queueRuntimeModule = "@toolctrl/queue/runtime";
|
||||
const { createQueue } = (await import(/* @vite-ignore */ queueRuntimeModule)) as typeof import("@toolctrl/queue/runtime");
|
||||
const queueRuntimeModule = "@hivegrid/queue/runtime";
|
||||
const { createQueue } = (await import(/* @vite-ignore */ queueRuntimeModule)) as typeof import("@hivegrid/queue/runtime");
|
||||
queue = createQueue(queueNames.email, {
|
||||
connection,
|
||||
});
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { loadWebConfig } from "@toolctrl/config";
|
||||
import { loadWebConfig } from "@hivegrid/config";
|
||||
import { getAppConfiguration, updateAppConfiguration } from "~/utils/db/appConfiguration.db.server";
|
||||
|
||||
export const MAILJET_PROVIDER_ID = "mailjet" as const;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { defaultBrandTokens } from "@toolctrl/brand";
|
||||
import { defaultBrandTokens } from "@hivegrid/brand";
|
||||
import EmailTemplates from "./EmailTemplates";
|
||||
import type { AppConfiguration } from "~/utils/db/appConfiguration.db.server";
|
||||
|
||||
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
import { resolveTransactionalBrandTokens } from "@toolctrl/brand";
|
||||
import { buildBrand, renderTransactionalEmail, type MailBrand } from "@toolctrl/mail";
|
||||
import { resolveTransactionalBrandTokens } from "@hivegrid/brand";
|
||||
import { buildBrand, renderTransactionalEmail, type MailBrand } from "@hivegrid/mail";
|
||||
import { AppConfiguration } from "~/utils/db/appConfiguration.db.server";
|
||||
|
||||
/**
|
||||
* Legacy template identifiers preserved for downstream call-sites.
|
||||
* The Stripe-19 / React-Email migration consolidates these onto the
|
||||
* The React-Email / React-Email migration consolidates these onto the
|
||||
* React-Email pipeline:
|
||||
*
|
||||
* - `welcome` -> React `welcome`
|
||||
|
||||
Reference in new issue
Block a user