Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TRANSLATIONS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Translation Status

Last updated: 2026-10-07 09:57:47
Last updated: 2026-10-09 09:28:47

Reference locale (en): **346 keys**

Expand Down
2 changes: 1 addition & 1 deletion backend/src/controllers/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ function assertLocalManifestShape(m: unknown): asserts m is LocalManifest {

// Install a template from an uploaded .zip file (local template)
export async function installLocalTemplateFromZip(
zipData: Uint8Array,
zipData: Uint8Array<ArrayBuffer>,
): Promise<Template> {
// Create a blob from the zip data for the ZipReader
const blob = new Blob([zipData]);
Expand Down
73 changes: 0 additions & 73 deletions backend/src/controllers/templates_new.ts

This file was deleted.

12 changes: 6 additions & 6 deletions backend/src/database/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { generateUUID } from "../utils/uuid.ts";
import { RESOURCE_ACTIONS } from "../types/index.ts";
import type { Action, Resource } from "../types/index.ts";

let db: DB;
let db: DB | undefined;

//
// Path helpers
Expand Down Expand Up @@ -772,7 +772,7 @@ function getNumberingSettings(): {
enabled: true,
};
try {
const rows = db.query(
const rows = getDatabase().query(
"SELECT key, value FROM settings WHERE key IN ('invoicePrefix','invoiceIncludeYear','invoiceNumberPadding','invoiceNumberPattern')",
);
const m = new Map<string, string>();
Expand All @@ -789,7 +789,7 @@ function getNumberingSettings(): {
cfg.pattern = (m.get("invoiceNumberPattern") || "").trim() || undefined;

try {
const raw = db.query(
const raw = getDatabase().query(
"SELECT value FROM settings WHERE key = 'invoiceNumberingEnabled' LIMIT 1",
);
if (raw.length > 0) {
Expand All @@ -807,11 +807,11 @@ function getNumberingSettings(): {
/** Find the highest existing sequential suffix matching `likePrefix%`, optionally scoped to a single customer. */
function findMaxSequence(likePrefix: string, customerId?: string): number {
const rows = customerId
? db.query(
? getDatabase().query(
"SELECT invoice_number FROM invoices WHERE invoice_number LIKE ? AND customer_id = ?",
[likePrefix + "%", customerId],
)
: db.query(
: getDatabase().query(
"SELECT invoice_number FROM invoices WHERE invoice_number LIKE ?",
[likePrefix + "%"],
);
Expand All @@ -829,7 +829,7 @@ function findMaxSequence(likePrefix: string, customerId?: string): number {
function getCustomerNumber(customerId?: string): number | null {
if (!customerId) return null;
try {
const rows = db.query(
const rows = getDatabase().query(
"SELECT customer_number FROM customers WHERE id = ?",
[customerId],
) as unknown[][];
Expand Down
2 changes: 1 addition & 1 deletion backend/src/routes/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ adminRoutes.post(
try {
const contentType = c.req.header("content-type") || "";

let zipData: Uint8Array;
let zipData: Uint8Array<ArrayBuffer>;

if (contentType.includes("multipart/form-data")) {
// Handle multipart form upload
Expand Down
4 changes: 2 additions & 2 deletions backend/src/utils/oidc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export async function exchangeAndVerify(

// ── ID token verification (RS256) ─────────────────────────────────────────

function b64urlToBytes(b64url: string): Uint8Array {
function b64urlToBytes(b64url: string): Uint8Array<ArrayBuffer> {
const b64 = b64url.replace(/-/g, "+").replace(/_/g, "/");
const padded = b64 + "=".repeat((4 - (b64.length % 4)) % 4);
const bin = atob(padded);
Expand Down Expand Up @@ -193,7 +193,7 @@ async function verifyIdToken(
const jwks = await getJwks(jwksUri);
const jwk = jwks.find(
(k) =>
k.kid === header.kid &&
(k as Record<string, unknown>).kid === header.kid &&
(k as Record<string, unknown>).use !== "enc" &&
((k as Record<string, unknown>).alg === "RS256" ||
(k as Record<string, unknown>).kty === "RSA"),
Expand Down
Loading