Tonne of debugging - getting ready for the production builds

This commit is contained in:
2026-02-16 10:44:18 -07:00
parent a77306fac2
commit 7895ce683e
1367 changed files with 404191 additions and 2005 deletions

View File

@@ -0,0 +1,3 @@
declare const router: import("express-serve-static-core").Router;
export { router as mapSettingsRouter };
//# sourceMappingURL=settings.routes.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"settings.routes.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/settings/settings.routes.ts"],"names":[],"mappings":"AAUA,QAAA,MAAM,MAAM,4CAAW,CAAC;AA+BxB,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,CAAC"}

View File

@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapSettingsRouter = void 0;
const express_1 = require("express");
const client_1 = require("@prisma/client");
const settings_service_1 = require("./settings.service");
const settings_schemas_1 = require("./settings.schemas");
const validate_1 = require("../../../middleware/validate");
const auth_middleware_1 = require("../../../middleware/auth.middleware");
const rbac_middleware_1 = require("../../../middleware/rbac.middleware");
const MAP_ADMIN_ROLES = [client_1.UserRole.SUPER_ADMIN, client_1.UserRole.MAP_ADMIN];
const router = (0, express_1.Router)();
exports.mapSettingsRouter = router;
// GET /api/map/settings — public (needed for map center/zoom)
router.get('/', async (_req, res, next) => {
try {
const settings = await settings_service_1.mapSettingsService.get();
res.json(settings);
}
catch (err) {
next(err);
}
});
// PUT /api/map/settings — admin only
router.put('/', auth_middleware_1.authenticate, (0, rbac_middleware_1.requireRole)(...MAP_ADMIN_ROLES), (0, validate_1.validate)(settings_schemas_1.updateMapSettingsSchema), async (req, res, next) => {
try {
const settings = await settings_service_1.mapSettingsService.update(req.body);
res.json(settings);
}
catch (err) {
next(err);
}
});
//# sourceMappingURL=settings.routes.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"settings.routes.js","sourceRoot":"","sources":["../../../../src/modules/map/settings/settings.routes.ts"],"names":[],"mappings":";;;AAAA,qCAAkE;AAClE,2CAA0C;AAC1C,yDAAwD;AACxD,yDAA6D;AAC7D,2DAAwD;AACxD,yEAAmE;AACnE,yEAAkE;AAElE,MAAM,eAAe,GAAe,CAAC,iBAAQ,CAAC,WAAW,EAAE,iBAAQ,CAAC,SAAS,CAAC,CAAC;AAE/E,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;AA+BL,mCAAiB;AA7BpC,8DAA8D;AAC9D,MAAM,CAAC,GAAG,CACR,GAAG,EACH,KAAK,EAAE,IAAa,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACzD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,qCAAkB,CAAC,GAAG,EAAE,CAAC;QAChD,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC;AAEF,qCAAqC;AACrC,MAAM,CAAC,GAAG,CACR,GAAG,EACH,8BAAY,EACZ,IAAA,6BAAW,EAAC,GAAG,eAAe,CAAC,EAC/B,IAAA,mBAAQ,EAAC,0CAAuB,CAAC,EACjC,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACxD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,qCAAkB,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC3D,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC"}

View File

@@ -0,0 +1,43 @@
import { z } from 'zod';
export declare const updateMapSettingsSchema: z.ZodObject<{
latitude: z.ZodOptional<z.ZodNumber>;
longitude: z.ZodOptional<z.ZodNumber>;
zoom: z.ZodOptional<z.ZodNumber>;
walkSheetTitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
walkSheetSubtitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
walkSheetFooter: z.ZodOptional<z.ZodNullable<z.ZodString>>;
qrCode1Url: z.ZodUnion<[z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodLiteral<"">]>;
qrCode1Label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
qrCode2Url: z.ZodUnion<[z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodLiteral<"">]>;
qrCode2Label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
qrCode3Url: z.ZodUnion<[z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodLiteral<"">]>;
qrCode3Label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
latitude?: number | undefined;
longitude?: number | undefined;
zoom?: number | undefined;
walkSheetTitle?: string | null | undefined;
walkSheetSubtitle?: string | null | undefined;
walkSheetFooter?: string | null | undefined;
qrCode1Url?: string | null | undefined;
qrCode1Label?: string | null | undefined;
qrCode2Url?: string | null | undefined;
qrCode2Label?: string | null | undefined;
qrCode3Url?: string | null | undefined;
qrCode3Label?: string | null | undefined;
}, {
latitude?: number | undefined;
longitude?: number | undefined;
zoom?: number | undefined;
walkSheetTitle?: string | null | undefined;
walkSheetSubtitle?: string | null | undefined;
walkSheetFooter?: string | null | undefined;
qrCode1Url?: string | null | undefined;
qrCode1Label?: string | null | undefined;
qrCode2Url?: string | null | undefined;
qrCode2Label?: string | null | undefined;
qrCode3Url?: string | null | undefined;
qrCode3Label?: string | null | undefined;
}>;
export type UpdateMapSettingsInput = z.infer<typeof updateMapSettingsSchema>;
//# sourceMappingURL=settings.schemas.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"settings.schemas.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/settings/settings.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAalC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}

View File

@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateMapSettingsSchema = void 0;
const zod_1 = require("zod");
exports.updateMapSettingsSchema = zod_1.z.object({
latitude: zod_1.z.number().min(-90).max(90).optional(),
longitude: zod_1.z.number().min(-180).max(180).optional(),
zoom: zod_1.z.number().int().min(2).max(19).optional(),
walkSheetTitle: zod_1.z.string().nullable().optional(),
walkSheetSubtitle: zod_1.z.string().nullable().optional(),
walkSheetFooter: zod_1.z.string().nullable().optional(),
qrCode1Url: zod_1.z.string().url().nullable().optional().or(zod_1.z.literal('')),
qrCode1Label: zod_1.z.string().nullable().optional(),
qrCode2Url: zod_1.z.string().url().nullable().optional().or(zod_1.z.literal('')),
qrCode2Label: zod_1.z.string().nullable().optional(),
qrCode3Url: zod_1.z.string().url().nullable().optional().or(zod_1.z.literal('')),
qrCode3Label: zod_1.z.string().nullable().optional(),
});
//# sourceMappingURL=settings.schemas.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"settings.schemas.js","sourceRoot":"","sources":["../../../../src/modules/map/settings/settings.schemas.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IAChD,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACnD,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IAChD,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAChD,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACnD,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACjD,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,OAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACpE,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC9C,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,OAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACpE,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC9C,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,OAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACpE,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC/C,CAAC,CAAC"}

View File

@@ -0,0 +1,40 @@
import type { UpdateMapSettingsInput } from './settings.schemas';
export declare const mapSettingsService: {
get(): Promise<{
id: string;
createdAt: Date;
updatedAt: Date;
latitude: import("@prisma/client/runtime/library").Decimal | null;
longitude: import("@prisma/client/runtime/library").Decimal | null;
createdBy: string | null;
zoom: number | null;
walkSheetTitle: string | null;
walkSheetSubtitle: string | null;
walkSheetFooter: string | null;
qrCode1Url: string | null;
qrCode1Label: string | null;
qrCode2Url: string | null;
qrCode2Label: string | null;
qrCode3Url: string | null;
qrCode3Label: string | null;
}>;
update(data: UpdateMapSettingsInput): Promise<{
id: string;
createdAt: Date;
updatedAt: Date;
latitude: import("@prisma/client/runtime/library").Decimal | null;
longitude: import("@prisma/client/runtime/library").Decimal | null;
createdBy: string | null;
zoom: number | null;
walkSheetTitle: string | null;
walkSheetSubtitle: string | null;
walkSheetFooter: string | null;
qrCode1Url: string | null;
qrCode1Label: string | null;
qrCode2Url: string | null;
qrCode2Label: string | null;
qrCode3Url: string | null;
qrCode3Label: string | null;
}>;
};
//# sourceMappingURL=settings.service.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"settings.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/settings/settings.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;iBAeV,sBAAsB;;;;;;;;;;;;;;;;;;CAiB1C,CAAC"}

View File

@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapSettingsService = void 0;
const database_1 = require("../../../config/database");
exports.mapSettingsService = {
async get() {
let settings = await database_1.prisma.mapSettings.findFirst();
if (!settings) {
settings = await database_1.prisma.mapSettings.create({
data: {
latitude: 45.4215,
longitude: -75.6972,
zoom: 12,
},
});
}
return settings;
},
async update(data) {
const existing = await database_1.prisma.mapSettings.findFirst();
if (existing) {
return database_1.prisma.mapSettings.update({
where: { id: existing.id },
data,
});
}
return database_1.prisma.mapSettings.create({
data: {
latitude: data.latitude ?? 45.4215,
longitude: data.longitude ?? -75.6972,
zoom: data.zoom ?? 12,
...data,
},
});
},
};
//# sourceMappingURL=settings.service.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"settings.service.js","sourceRoot":"","sources":["../../../../src/modules/map/settings/settings.service.ts"],"names":[],"mappings":";;;AAAA,uDAAkD;AAGrC,QAAA,kBAAkB,GAAG;IAChC,KAAK,CAAC,GAAG;QACP,IAAI,QAAQ,GAAG,MAAM,iBAAM,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC;QACpD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,QAAQ,GAAG,MAAM,iBAAM,CAAC,WAAW,CAAC,MAAM,CAAC;gBACzC,IAAI,EAAE;oBACJ,QAAQ,EAAE,OAAO;oBACjB,SAAS,EAAE,CAAC,OAAO;oBACnB,IAAI,EAAE,EAAE;iBACT;aACF,CAAC,CAAC;QACL,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAA4B;QACvC,MAAM,QAAQ,GAAG,MAAM,iBAAM,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC;QACtD,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,iBAAM,CAAC,WAAW,CAAC,MAAM,CAAC;gBAC/B,KAAK,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE;gBAC1B,IAAI;aACL,CAAC,CAAC;QACL,CAAC;QACD,OAAO,iBAAM,CAAC,WAAW,CAAC,MAAM,CAAC;YAC/B,IAAI,EAAE;gBACJ,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,OAAO;gBAClC,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO;gBACrC,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE;gBACrB,GAAG,IAAI;aACR;SACF,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}