From 805967a85a821ea9949b972d173ca100f00b84f7 Mon Sep 17 00:00:00 2001 From: Joshua Oosthuizen Date: Tue, 1 Dec 2026 00:54:25 +0200 Subject: [PATCH] events 3.9.0: SVG logos in PDFs (svg-to-pdfkit), the Accounts logo copied for PDFs Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 6 +- apps/events/CHANGELOG.md | 10 +-- apps/events/WHATS-NEW.md | 4 +- apps/events/backend/package.json | 1 + apps/events/backend/src/utils/certificates.js | 9 +-- apps/events/backend/src/utils/logoCopy.js | 64 +++++++++++++---- apps/events/backend/src/utils/pdfDocs.js | 4 +- apps/events/backend/tests/logoCopy.test.ts | 71 ++++++++++++++++--- docs/VERSIONS.md | 6 +- package-lock.json | 12 +++- 10 files changed, 143 insertions(+), 44 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 377ce62..0f8b1db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,14 +9,14 @@ The church's details from Accounts on every site, section backgrounds, one colou - **Events 3.9.0:** the Accounts profile's name, logo, icon, colours and contact details win over Events' own settings while Accounts is connected (pages, emails, WhatsApp, PDFs), and Settings - shows them read-only with a link to Accounts. The logo from Accounts is copied for PDFs (PNG and - JPEG). Fixes Events keeping its old church after a demo scenario load. + shows them read-only with a link to Accounts. The logo from Accounts is copied for PDFs, and SVG logos + are drawn in PDFs (`svg-to-pdfkit`, new dependency). Fixes Events keeping its old church after a demo scenario load. - **Website 1.9.0:** a background for each homepage section in the church's colours; "More info" instead of "Register" for events without registration; the shared colour field in Church details. - **Accounts 1.10.0:** the shared colour field in Church profile. - **`@crosscode/ui` 0.4.0:** `ColourField` and `isHexColour`. -- Checked: Events backend tests (825), Website backend tests (149), typecheck and lint of every +- Checked: Events backend tests (828), Website backend tests (149), typecheck and lint of every changed app. ## contracts@1.24.0 - 2026-11-30 diff --git a/apps/events/CHANGELOG.md b/apps/events/CHANGELOG.md index a845848..538665b 100644 --- a/apps/events/CHANGELOG.md +++ b/apps/events/CHANGELOG.md @@ -7,8 +7,9 @@ and this project follows [Semantic Versioning](https://semver.org/). ## [3.9.0] - 2026-12-01 -No migration, no new settings or environment variables. Works with any Accounts; nothing changes -on a site without Accounts. +No migration, no new settings or environment variables. One new dependency: `svg-to-pdfkit` +0.1.8 (MIT, pure JavaScript; draws SVG logos in PDFs). Works with any Accounts; nothing changes on +a site without Accounts. ### Fixed @@ -27,8 +28,9 @@ on a site without Accounts. - **PDFs with the church's logo from Accounts.** Tickets, invoices, receipts, certificates and privacy exports could only draw a logo uploaded here. The logo from Accounts is copied into `uploads/accounts` (once per address, when the profile arrives or the first PDF needs it; old - copies removed; 2 MB at most; `utils/logoCopy.js`). Only PNG and JPEG can be drawn in a PDF; an - SVG logo (the demo churches') isn't copied and the PDFs show the church's name, as before. + copies removed; 2 MB at most; `utils/logoCopy.js`). PNG and JPEG are drawn as pictures and SVG + (the demo churches' logos, and an SVG uploaded here) as shapes with `svg-to-pdfkit` + (`drawLogo`); an SVG never opens a file or address it names. WebP and GIF show the name only. - A logo address on another `localhost` port (Accounts in development) is no longer rewritten to the API's address; only this site's own uploads are (`resolveToApiOrigin`). diff --git a/apps/events/WHATS-NEW.md b/apps/events/WHATS-NEW.md index 5ab27b0..4282220 100644 --- a/apps/events/WHATS-NEW.md +++ b/apps/events/WHATS-NEW.md @@ -21,8 +21,8 @@ developer log is CHANGELOG.md. A tagged version without a section here shows "No - In **Site settings → Organisation and Branding**, those details are shown but can't be changed there any more; a link takes you to your church profile in Accounts. Your tagline and secondary colour are still set in Events. -- **Tickets, invoices and certificates show your church's logo from Accounts** when it's a PNG or - JPEG picture. +- **Tickets, invoices and certificates show your church's logo from Accounts** (PNG, JPEG or + SVG). ## 3.8.0 diff --git a/apps/events/backend/package.json b/apps/events/backend/package.json index abd5422..980ed05 100644 --- a/apps/events/backend/package.json +++ b/apps/events/backend/package.json @@ -45,6 +45,7 @@ "pg-boss": "^11.1.2", "qrcode": "^1.5.4", "raw-body": "^3.0.0", + "svg-to-pdfkit": "0.1.8", "swagger-ui-dist": "^5.34.0", "tsx": "^4.23.15", "typescript": "^5.9.3", diff --git a/apps/events/backend/src/utils/certificates.js b/apps/events/backend/src/utils/certificates.js index c335f1a..53b1046 100644 --- a/apps/events/backend/src/utils/certificates.js +++ b/apps/events/backend/src/utils/certificates.js @@ -16,6 +16,7 @@ const fs = require('fs'); const path = require('path'); const PDFDocument = require('pdfkit'); const QRCode = require('qrcode'); +const { drawLogo } = require('./logoCopy'); const prisma = require('../config/db'); const { activeSessions, completionMet, normalizeCertificateConfig, attendanceBySession, groupTickets, TIMEZONE } = require('./sessions'); @@ -189,7 +190,7 @@ function drawTemplate(doc, template, ctx) { doc.rect(0, 0, 28, H).fill(color); doc.rect(28, 0, 6, H).fill(lighten(color, 0.6)); const x = 90; - safeImage(doc, logo, x, 70, { fit: [120, 50] }); + drawLogo(doc, logo, x, 70, { fit: [120, 50] }); doc.font('Helvetica').fontSize(11).fillColor(color).text(branding.name.toUpperCase(), x, 150, { characterSpacing: 2 }); doc.font('Helvetica-Bold').fontSize(36).fillColor('#0f172a').text(title, x, 175, { width: W - x - 80 }); doc.font('Helvetica').fontSize(13).fillColor('#64748b').text('Presented to', x, 260); @@ -202,7 +203,7 @@ function drawTemplate(doc, template, ctx) { if (template === 'church') { doc.rect(0, 0, W, H).fill(lighten(color, 0.94)); doc.rect(30, 30, W - 60, H - 60).lineWidth(1).strokeColor(lighten(color, 0.4)).stroke(); - const hasLogo = safeImage(doc, logo, W / 2 - 50, 55, { fit: [100, 70], align: 'center' }); + const hasLogo = drawLogo(doc, logo, W / 2 - 50, 55, { fit: [100, 70], align: 'center' }); const top = hasLogo ? 150 : 115; doc.font('Times-Italic').fontSize(14).fillColor(color).text(branding.name, 0, top, { width: W, align: 'center' }); doc.font('Times-Bold').fontSize(34).fillColor('#1e293b').text(title, 60, top + 26, { width: W - 120, align: 'center' }); @@ -228,7 +229,7 @@ function drawTemplate(doc, template, ctx) { const y = top ? 48 + rnd() * 50 : 110 + rnd() * (H - 260); doc.circle(x, y, 3 + rnd() * 5).fill(bright[i % bright.length]); } - safeImage(doc, logo, W / 2 - 40, 100, { fit: [80, 50], align: 'center' }); + drawLogo(doc, logo, W / 2 - 40, 100, { fit: [80, 50], align: 'center' }); doc.font('Helvetica-Bold').fontSize(38).fillColor(color).text(title, 100, 165, { width: W - 200, align: 'center' }); doc.font('Helvetica-Bold').fontSize(15).fillColor('#f59e0b').text('Well done,', 0, 230, { width: W, align: 'center' }); doc.font('Helvetica-Bold').fontSize(36).fillColor('#1e293b').text(cert.name, 100, 250, { width: W - 200, align: 'center' }); @@ -244,7 +245,7 @@ function drawTemplate(doc, template, ctx) { for (const [cx, cy] of [[34, 34], [W - 34, 34], [34, H - 34], [W - 34, H - 34]]) { doc.circle(cx, cy, 6).fill(color); } - safeImage(doc, logo, W / 2 - 45, 70, { fit: [90, 55], align: 'center' }); + drawLogo(doc, logo, W / 2 - 45, 70, { fit: [90, 55], align: 'center' }); doc.font('Times-Bold').fontSize(38).fillColor('#1e293b').text(title.toUpperCase(), 60, 150, { width: W - 120, align: 'center', characterSpacing: 1.5 }); doc.font('Times-Italic').fontSize(14).fillColor('#64748b').text('This certificate is proudly presented to', 0, 212, { width: W, align: 'center' }); doc.font('Times-BoldItalic').fontSize(34).fillColor(color).text(cert.name, 60, 236, { width: W - 120, align: 'center' }); diff --git a/apps/events/backend/src/utils/logoCopy.js b/apps/events/backend/src/utils/logoCopy.js index 270f36a..0a0fa07 100644 --- a/apps/events/backend/src/utils/logoCopy.js +++ b/apps/events/backend/src/utils/logoCopy.js @@ -1,23 +1,27 @@ // The logo for PDFs (tickets, invoices, receipts, certificates, privacy exports). PDFs need a file // on disk. A logo uploaded here already is one; the church's logo from its Accounts profile is an -// address on another site, so a copy is kept in uploads/accounts (one per address, made the first -// time it's needed and when Accounts says the church changed; older copies are removed). +// address on another site, so a copy is kept in uploads/accounts (one per address, made when the +// profile arrives or the first PDF needs it; older copies are removed). // -// Only PNG and JPEG can be drawn into a PDF, so another kind of logo (SVG, WebP) isn't copied and -// the PDFs show the church's name without it, as before. +// PNG and JPEG are drawn as pictures; SVG (the demo churches' logos, and many churches') is drawn +// as shapes with svg-to-pdfkit (`drawLogo`). Anything else (WebP, GIF) isn't copied, and the PDFs +// show the church's name without a logo. const crypto = require('crypto'); const fs = require('fs'); const path = require('path'); +const SVGtoPDF = require('svg-to-pdfkit'); const { UPLOADS_DIR, uploadsDir } = require('./uploads'); const MAX_BYTES = 2 * 1024 * 1024; const TIMEOUT_MS = 5000; -const KINDS = { png: 'png', jpeg: 'jpg' }; +const EXT = { png: 'png', jpeg: 'jpg', svg: 'svg' }; -/** PNG or JPEG by its first bytes (never by what the server says it is), else null. */ -function rasterKind(buf) { +/** PNG, JPEG or SVG by the file's own bytes (never by what a server says it is), else null. */ +function logoKind(buf) { if (buf.length >= 8 && buf.subarray(0, 8).equals(Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]))) return 'png'; if (buf.length >= 3 && buf[0] === 0xff && buf[1] === 0xd8 && buf[2] === 0xff) return 'jpeg'; + const head = buf.subarray(0, 4096).toString('utf8').replace(/^/, '').trimStart(); + if (head.startsWith('<') && /]/i.test(head)) return 'svg'; return null; } @@ -35,7 +39,7 @@ function fetchable(url) { function existingCopy(url) { const base = nameFor(url); - for (const ext of Object.values(KINDS)) { + for (const ext of Object.values(EXT)) { const p = path.join(UPLOADS_DIR, 'accounts', `${base}.${ext}`); if (fs.existsSync(p)) return p; } @@ -53,11 +57,11 @@ async function download(url) { if (Number(res.headers.get('content-length') || 0) > MAX_BYTES) throw new Error('is larger than 2 MB'); const buf = Buffer.from(await res.arrayBuffer()); if (buf.length > MAX_BYTES) throw new Error('is larger than 2 MB'); - const kind = rasterKind(buf); - if (!kind) return null; // SVG, WebP…: not drawable in a PDF + const kind = logoKind(buf); + if (!kind) return null; // WebP, GIF…: not drawable in a PDF const dir = uploadsDir('accounts'); const base = nameFor(url); - const file = path.join(dir, `${base}.${KINDS[kind]}`); + const file = path.join(dir, `${base}.${EXT[kind]}`); fs.writeFileSync(file, buf); // The church changed its logo: the copies of the old ones go. for (const f of fs.readdirSync(dir)) if (f.startsWith('logo-') && !f.startsWith(`${base}.`)) fs.rmSync(path.join(dir, f), { force: true }); @@ -65,15 +69,19 @@ async function download(url) { } /** - * The logo as a file a PDF can draw, or null. `logoUrl` is the logo_url setting: a path on this - * site (/uploads/…) or the church's logo address from Accounts. Never throws. + * The logo as a file a PDF can draw (`drawLogo`), or null. `logoUrl` is the logo_url setting: a + * path on this site (/uploads/…) or the church's logo address from Accounts. Never throws. */ async function pdfLogoPath(logoUrl) { const url = String(logoUrl || '').trim(); if (!url) return null; if (!/^https?:\/\//i.test(url)) { const p = path.join(UPLOADS_DIR, '..', url.replace(/^\//, '')); - return fs.existsSync(p) && rasterKind(fs.readFileSync(p).subarray(0, 8)) ? p : null; + try { + return fs.existsSync(p) && logoKind(fs.readFileSync(p)) ? p : null; + } catch { + return null; + } } if (!fetchable(url)) return null; const have = existingCopy(url); @@ -95,9 +103,35 @@ async function pdfLogoPath(logoUrl) { return pending.get(url); } +/** + * Draws the logo `file` (from pdfLogoPath) at x, y within `fit` [w, h], as doc.image does; centred + * in that box with `align: 'center'`. True when drawn. Never throws. + */ +function drawLogo(doc, file, x, y, { fit, align } = {}) { + if (!file) return false; + try { + if (file.toLowerCase().endsWith('.svg')) { + const [width, height] = fit || [100, 50]; + SVGtoPDF(doc, fs.readFileSync(file, 'utf8'), x, y, { + width, + height, + preserveAspectRatio: align === 'center' ? 'xMidYMid meet' : 'xMinYMid meet', + // Only pictures inside the SVG itself: never a file or address it names. + imageCallback: (link) => (/^data:image\/(png|jpe?g);base64,/i.test(String(link).trim()) ? String(link).replace(/\s+/g, '') : ''), + warningCallback: () => {}, + }); + } else { + doc.image(file, x, y, { fit, ...(align ? { align } : {}) }); + } + return true; + } catch { + return false; + } +} + /** Tests: forget the addresses that gave nothing. */ function resetLogoCopies() { misses.clear(); } -module.exports = { pdfLogoPath, resetLogoCopies, rasterKind }; +module.exports = { pdfLogoPath, drawLogo, resetLogoCopies, logoKind }; diff --git a/apps/events/backend/src/utils/pdfDocs.js b/apps/events/backend/src/utils/pdfDocs.js index 218a5a6..bbb097a 100644 --- a/apps/events/backend/src/utils/pdfDocs.js +++ b/apps/events/backend/src/utils/pdfDocs.js @@ -193,7 +193,7 @@ async function generateReceiptPdf(payment) { const bannerH = 150; doc.rect(0, 0, pageWidth, bannerH).fill(org.brandColor); if (org.logoPath) { - try { doc.image(org.logoPath, marginX, 28, { fit: [36, 36] }); } catch {} + require('./logoCopy').drawLogo(doc, org.logoPath, marginX, 28, { fit: [36, 36] }); } doc.fillColor('#ffffff').font('Helvetica-Bold').fontSize(13).text(org.name, marginX + (org.logoPath ? 46 : 0), 38, { width: 260 }); doc.font('Helvetica-Bold').fontSize(26).text('Payment Receipt', marginX, 68, { width: 320 }); @@ -298,7 +298,7 @@ async function generateInvoicePdf(registration, { paymentUrl = null, totalDue = doc.rect(0, 0, sidebarW, pageHeight).fill('#111827'); let sy = 40; if (org.logoPath) { - try { doc.image(org.logoPath, 28, sy, { fit: [32, 32] }); sy += 0; } catch {} + require('./logoCopy').drawLogo(doc, org.logoPath, 28, sy, { fit: [32, 32] }); } doc.font('Helvetica-Bold').fontSize(12).fillColor('#ffffff').text(org.name, org.logoPath ? 68 : 28, sy + 8, { width: sidebarW - (org.logoPath ? 96 : 56) }); sy += 60; diff --git a/apps/events/backend/tests/logoCopy.test.ts b/apps/events/backend/tests/logoCopy.test.ts index 6f5c33a..f5b78e7 100644 --- a/apps/events/backend/tests/logoCopy.test.ts +++ b/apps/events/backend/tests/logoCopy.test.ts @@ -1,15 +1,22 @@ // The logo for PDFs: an uploaded one is used as it is; the church's logo from Accounts (an address -// on another site) is copied into uploads/accounts once, and only when it's a PNG or JPEG. +// on another site) is copied into uploads/accounts once, when it's a PNG, JPEG or SVG; drawLogo +// draws either kind into a PDF. import fs from 'fs'; import path from 'path'; /* eslint-disable @typescript-eslint/no-require-imports -- CommonJS */ -const { pdfLogoPath, resetLogoCopies } = require('../src/utils/logoCopy') as { pdfLogoPath(u: string): Promise; resetLogoCopies(): void }; +const { pdfLogoPath, drawLogo, resetLogoCopies } = require('../src/utils/logoCopy') as { + pdfLogoPath(u: string): Promise; + drawLogo(doc: unknown, file: string | null, x: number, y: number, o?: { fit?: [number, number]; align?: string }): boolean; + resetLogoCopies(): void; +}; +const PDFDocument = require('pdfkit'); const { UPLOADS_DIR } = require('../src/utils/uploads') as { UPLOADS_DIR: string }; /* eslint-enable @typescript-eslint/no-require-imports */ const PNG = Buffer.concat([Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]), Buffer.alloc(32)]); -const SVG = Buffer.from(''); +const SVG = Buffer.from('\n'); +const WEBP = Buffer.concat([Buffer.from('RIFF'), Buffer.alloc(4), Buffer.from('WEBPVP8 ')]); const COPIES = path.join(UPLOADS_DIR, 'accounts'); const realFetch = global.fetch; let served: Record = {}; @@ -36,6 +43,17 @@ beforeEach(() => { }); afterEach(() => { jest.restoreAllMocks(); }); +function pdfOf(draw: (doc: unknown) => void): Promise { + return new Promise((resolve) => { + const doc = new PDFDocument({ compress: false }); + const parts: Buffer[] = []; + doc.on('data', (b: Buffer) => parts.push(b)); + doc.on('end', () => resolve(Buffer.concat(parts).toString('latin1'))); + draw(doc); + doc.end(); + }); +} + test("the church's PNG logo from Accounts is copied once, and used from the copy after", async () => { served['https://accounts.hope.test/logo.png'] = PNG; const p = await pdfLogoPath('https://accounts.hope.test/logo.png'); @@ -55,20 +73,53 @@ test('a new logo replaces the copy of the old one', async () => { expect(fs.readdirSync(COPIES)).toHaveLength(1); }); -test("an SVG logo or one that can't be fetched gives none (the PDF shows the name), and isn't fetched again at once", async () => { +test("an SVG logo (the demo churches') is copied too", async () => { served['https://accounts.hope.test/logo.svg'] = SVG; + const p = await pdfLogoPath('https://accounts.hope.test/logo.svg'); + expect(p?.endsWith('.svg')).toBe(true); +}); + +test("a logo a PDF can't draw, or one that can't be fetched, gives none (the PDF shows the name), and isn't fetched again at once", async () => { + served['https://accounts.hope.test/logo.webp'] = WEBP; served['https://accounts.hope.test/gone.png'] = 404; - expect(await pdfLogoPath('https://accounts.hope.test/logo.svg')).toBeNull(); + expect(await pdfLogoPath('https://accounts.hope.test/logo.webp')).toBeNull(); expect(await pdfLogoPath('https://accounts.hope.test/gone.png')).toBeNull(); - expect(await pdfLogoPath('https://accounts.hope.test/logo.svg')).toBeNull(); + expect(await pdfLogoPath('https://accounts.hope.test/logo.webp')).toBeNull(); expect(fetched).toHaveLength(2); }); +test('drawLogo draws an SVG logo as shapes in its colours, and never opens a file the SVG names', async () => { + fs.mkdirSync(COPIES, { recursive: true }); + const file = path.join(COPIES, 'logo-test.svg'); + fs.writeFileSync(file, SVG); + let drawn = false; + const pdf = await pdfOf((doc) => { drawn = drawLogo(doc, file, 40, 40, { fit: [60, 60], align: 'center' }); }); + expect(drawn).toBe(true); + expect(pdf).toMatch(/0\.12156\d* 0\.30588\d* 0\.47450\d* scn/); // #1f4e79 + + const picture = path.join(COPIES, 'logo-test.png'); + fs.writeFileSync(picture, PNG); + const sneaky = path.join(COPIES, 'logo-sneaky.svg'); + const href = picture.split(path.sep).join('/'); + fs.writeFileSync(sneaky, ``); + const out = await pdfOf((doc) => { drawLogo(doc, sneaky, 0, 0, { fit: [10, 10] }); }); + expect(out).not.toContain('/Subtype /Image'); +}); + +test("drawLogo gives false, without throwing, for a file it can't draw", async () => { + fs.mkdirSync(COPIES, { recursive: true }); + const bad = path.join(COPIES, 'logo-bad.png'); + fs.writeFileSync(bad, 'not a picture'); + let drawn = true; + await pdfOf((doc) => { drawn = drawLogo(doc, bad, 0, 0, { fit: [10, 10] }); }); + expect(drawn).toBe(false); + expect(drawLogo({}, null, 0, 0)).toBe(false); +}); + test('a logo uploaded here is used as it is; nothing for no logo', async () => { - const dir = path.join(UPLOADS_DIR, 'accounts'); - fs.mkdirSync(dir, { recursive: true }); - fs.writeFileSync(path.join(dir, 'own.png'), PNG); - expect(await pdfLogoPath('/uploads/accounts/own.png')).toBe(path.join(dir, 'own.png')); + fs.mkdirSync(COPIES, { recursive: true }); + fs.writeFileSync(path.join(COPIES, 'own.png'), PNG); + expect(await pdfLogoPath('/uploads/accounts/own.png')).toBe(path.join(COPIES, 'own.png')); expect(await pdfLogoPath('')).toBeNull(); expect(await pdfLogoPath('/uploads/accounts/missing.png')).toBeNull(); expect(fetched).toHaveLength(0); diff --git a/docs/VERSIONS.md b/docs/VERSIONS.md index 76f3794..5d45aa6 100644 --- a/docs/VERSIONS.md +++ b/docs/VERSIONS.md @@ -42,11 +42,11 @@ need their own tags until something outside this repo depends on them. - **Events 3.9.0 + Website 1.9.0 + Accounts 1.10.0 + `@crosscode/ui` 0.4.0 (2026-12-01):** Events takes the church's name, logo, icon, colours and contact details from the Accounts profile (pages, emails, WhatsApp, PDFs; Settings shows them read-only), so a change in Accounts or a - demo scenario load shows on Events as on the Website; the Accounts logo is copied for PDFs (PNG - and JPEG). The Website gets a background per homepage section in the church's colours, and + demo scenario load shows on Events as on the Website; the Accounts logo is copied for PDFs, and SVG + logos are drawn in them (`svg-to-pdfkit`). The Website gets a background per homepage section in the church's colours, and "More info" instead of "Register" for events without registration. Accounts' Church profile and the Website's Church details use one colour field (`ColourField`, like Events' picker). No - migrations, no contracts change, works with any Accounts. Checked: Events backend tests (825), + migrations, no contracts change, works with any Accounts. Checked: Events backend tests (828), Website backend tests (149), typecheck and lint of every changed app. Not deployed. - **Hub 2.26.1 + contracts 1.24.0 (2026-11-30):** Cross Code's devotionals can be scheduled up to diff --git a/package-lock.json b/package-lock.json index 7fbb486..e3d6607 100644 --- a/package-lock.json +++ b/package-lock.json @@ -160,6 +160,7 @@ "pg-boss": "^11.1.2", "qrcode": "^1.5.4", "raw-body": "^3.0.0", + "svg-to-pdfkit": "0.1.8", "swagger-ui-dist": "^5.34.0", "tsx": "^4.23.15", "typescript": "^5.9.3", @@ -21285,6 +21286,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/svg-to-pdfkit": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/svg-to-pdfkit/-/svg-to-pdfkit-0.1.8.tgz", + "integrity": "sha512-QItiGZBy5TstGy+q8mjQTMGRlDDOARXLxH+sgVm1n/LYeo0zFcQlcCh8m4zi8QxctrxB9Kue/lStc/RD5iLadQ==", + "license": "MIT", + "dependencies": { + "pdfkit": ">=0.8.1" + } + }, "node_modules/swagger-ui-dist": { "version": "5.34.0", "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.34.0.tgz", @@ -23192,7 +23202,7 @@ }, "packages/contracts": { "name": "@crosscode/contracts", - "version": "1.23.0", + "version": "1.24.0", "license": "UNLICENSED", "dependencies": { "zod": "^4.6.7"