@innvoid/getmarket-sdk 0.1.6 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,616 @@
1
+ import {
2
+ HEADER_INTERNAL_API_KEY,
3
+ getRequestContextFromHeaders
4
+ } from "./chunk-P2U3MT2E.js";
5
+
6
+ // src/middlewares/parseHeaders.ts
7
+ function parseHeaders(req, _res, next) {
8
+ req.context = getRequestContextFromHeaders(req.headers);
9
+ next();
10
+ }
11
+
12
+ // src/middlewares/internalAuth.ts
13
+ import fs from "fs";
14
+ import crypto from "crypto";
15
+
16
+ // src/middlewares/respond.ts
17
+ function sendOk(_req, res, data, statusCode = 200) {
18
+ return res.status(statusCode).json({ ok: true, data, requestId: res.locals?.requestId ?? null });
19
+ }
20
+ function sendError(_req, res, statusCode, code, message, details) {
21
+ return res.status(statusCode).json({
22
+ ok: false,
23
+ error: { code, message, ...details !== void 0 ? { details } : {} },
24
+ requestId: res.locals?.requestId ?? null
25
+ });
26
+ }
27
+
28
+ // src/middlewares/internalAuth.ts
29
+ function readSecretFile(path) {
30
+ if (!path) return null;
31
+ try {
32
+ const v = fs.readFileSync(path, "utf8").trim();
33
+ return v.length ? v : null;
34
+ } catch {
35
+ return null;
36
+ }
37
+ }
38
+ function splitKeys(v) {
39
+ if (!v) return [];
40
+ return v.split(",").map((s) => s.trim()).filter(Boolean);
41
+ }
42
+ function getExpectedKeys() {
43
+ const fileKey = readSecretFile(process.env.INTERNAL_API_KEY_FILE);
44
+ const envKey = (process.env.INTERNAL_API_KEY || "").trim();
45
+ const raw = fileKey || envKey;
46
+ return splitKeys(raw);
47
+ }
48
+ function extractToken(req) {
49
+ const apiKey = (req.header(HEADER_INTERNAL_API_KEY) || "").trim();
50
+ return apiKey || null;
51
+ }
52
+ function safeEquals(a, b) {
53
+ const aa = Buffer.from(a);
54
+ const bb = Buffer.from(b);
55
+ if (aa.length !== bb.length) return false;
56
+ return crypto.timingSafeEqual(aa, bb);
57
+ }
58
+ function internalAuth(req, res, next) {
59
+ const token = extractToken(req);
60
+ if (!token) {
61
+ return sendError(req, res, 401, "UNAUTHORIZED", `Missing internal api key (${HEADER_INTERNAL_API_KEY})`);
62
+ }
63
+ const expectedKeys = getExpectedKeys();
64
+ if (expectedKeys.length === 0) {
65
+ return sendError(
66
+ req,
67
+ res,
68
+ 500,
69
+ "MISCONFIGURED_INTERNAL_AUTH",
70
+ "Internal api key not configured (INTERNAL_API_KEY or INTERNAL_API_KEY_FILE)"
71
+ );
72
+ }
73
+ const ok = expectedKeys.some((k) => safeEquals(token, k));
74
+ if (!ok) {
75
+ return sendError(req, res, 403, "FORBIDDEN", "Invalid internal api key");
76
+ }
77
+ return next();
78
+ }
79
+
80
+ // src/middlewares/authorization.ts
81
+ function getAuth(req) {
82
+ return req.auth ?? {};
83
+ }
84
+ function normalizeCode(v) {
85
+ if (!v) return null;
86
+ if (typeof v === "string") return v;
87
+ if (typeof v === "object") return v.code || v.name || null;
88
+ return null;
89
+ }
90
+ function rolesSet(auth) {
91
+ const out = /* @__PURE__ */ new Set();
92
+ for (const r of auth.roles || []) {
93
+ const c = normalizeCode(r);
94
+ if (c) out.add(c);
95
+ }
96
+ return out;
97
+ }
98
+ function permsSet(list) {
99
+ const out = /* @__PURE__ */ new Set();
100
+ for (const p of list || []) {
101
+ const c = normalizeCode(p);
102
+ if (c) out.add(c);
103
+ }
104
+ return out;
105
+ }
106
+ function requireAuthContext() {
107
+ return (req, res, next) => {
108
+ if (!req.auth) {
109
+ return sendError(req, res, 401, "UNAUTHORIZED", "Missing auth context");
110
+ }
111
+ return next();
112
+ };
113
+ }
114
+ function isSysAdmin(auth, sysAdminRole) {
115
+ const have = rolesSet(auth);
116
+ return have.has(sysAdminRole);
117
+ }
118
+ function requirePermissions(perms, options) {
119
+ const sysAdminBypass = options?.sysAdminBypass !== false;
120
+ const sysAdminRole = options?.sysAdminRole || "SYS_ADMIN";
121
+ return (req, res, next) => {
122
+ const auth = getAuth(req);
123
+ if (sysAdminBypass && isSysAdmin(auth, sysAdminRole)) return next();
124
+ const allow = permsSet(auth.permissions);
125
+ const deny = permsSet(auth.denied_permissions);
126
+ for (const p of perms) {
127
+ if (deny.has(p)) {
128
+ return sendError(req, res, 403, "FORBIDDEN", `Denied permission: ${p}`, {
129
+ denied: p
130
+ });
131
+ }
132
+ }
133
+ const missing = perms.filter((p) => !allow.has(p));
134
+ if (missing.length) {
135
+ return sendError(req, res, 403, "FORBIDDEN", "Missing permissions", {
136
+ missing,
137
+ mode: "ALL"
138
+ });
139
+ }
140
+ return next();
141
+ };
142
+ }
143
+ function requireAnyPermission(perms, options) {
144
+ const sysAdminBypass = options?.sysAdminBypass !== false;
145
+ const sysAdminRole = options?.sysAdminRole || "SYS_ADMIN";
146
+ return (req, res, next) => {
147
+ const auth = getAuth(req);
148
+ if (sysAdminBypass && isSysAdmin(auth, sysAdminRole)) return next();
149
+ const allow = permsSet(auth.permissions);
150
+ const deny = permsSet(auth.denied_permissions);
151
+ for (const p of perms) {
152
+ if (deny.has(p)) {
153
+ return sendError(req, res, 403, "FORBIDDEN", `Denied permission: ${p}`, {
154
+ denied: p
155
+ });
156
+ }
157
+ }
158
+ const ok = perms.some((p) => allow.has(p));
159
+ if (!ok) {
160
+ return sendError(req, res, 403, "FORBIDDEN", "Permission denied", {
161
+ required: perms,
162
+ mode: "ANY"
163
+ });
164
+ }
165
+ return next();
166
+ };
167
+ }
168
+ function requireRoles(roles, options) {
169
+ const sysAdminBypass = options?.sysAdminBypass !== false;
170
+ const sysAdminRole = options?.sysAdminRole || "SYS_ADMIN";
171
+ return (req, res, next) => {
172
+ const auth = getAuth(req);
173
+ if (sysAdminBypass && isSysAdmin(auth, sysAdminRole)) return next();
174
+ const have = rolesSet(auth);
175
+ if (!roles.some((r) => have.has(r))) {
176
+ return sendError(req, res, 403, "FORBIDDEN", "Role not allowed", {
177
+ required: roles,
178
+ mode: "ANY"
179
+ });
180
+ }
181
+ return next();
182
+ };
183
+ }
184
+ function requireRolesOrAnyPermission(roles, perms, options) {
185
+ const sysAdminBypass = options?.sysAdminBypass !== false;
186
+ const sysAdminRole = options?.sysAdminRole || "SYS_ADMIN";
187
+ return (req, res, next) => {
188
+ const auth = getAuth(req);
189
+ if (sysAdminBypass && isSysAdmin(auth, sysAdminRole)) return next();
190
+ const haveRoles = rolesSet(auth);
191
+ const allow = permsSet(auth.permissions);
192
+ const deny = permsSet(auth.denied_permissions);
193
+ for (const p of perms) {
194
+ if (deny.has(p)) {
195
+ return sendError(req, res, 403, "FORBIDDEN", `Denied permission: ${p}`, {
196
+ denied: p
197
+ });
198
+ }
199
+ }
200
+ const okRole = roles.some((r) => haveRoles.has(r));
201
+ const okPerm = perms.some((p) => allow.has(p));
202
+ if (!okRole && !okPerm) {
203
+ return sendError(req, res, 403, "FORBIDDEN", "Access denied", {
204
+ roles,
205
+ permissions: perms,
206
+ mode: "ROLES_OR_PERMS_ANY"
207
+ });
208
+ }
209
+ return next();
210
+ };
211
+ }
212
+
213
+ // src/auth/jwt.ts
214
+ import fs2 from "fs";
215
+ import jwt from "jsonwebtoken";
216
+ function readFileIfExists(path) {
217
+ if (!path) return null;
218
+ try {
219
+ const v = fs2.readFileSync(path, "utf8").trim();
220
+ return v.length ? v : null;
221
+ } catch {
222
+ return null;
223
+ }
224
+ }
225
+ function readRs256PublicKey() {
226
+ const fromFile = readFileIfExists(process.env.JWT_PUBLIC_KEY_PATH);
227
+ if (fromFile) return fromFile;
228
+ const fromEnv = String(process.env.AUTH_JWT_PUBLIC_KEY || process.env.AUTH_RSA_PUBLIC_KEY || "").replace(/\\n/g, "\n").trim();
229
+ if (fromEnv) return fromEnv;
230
+ throw new Error("Missing RS256 public key (JWT_PUBLIC_KEY_PATH / AUTH_JWT_PUBLIC_KEY / AUTH_RSA_PUBLIC_KEY)");
231
+ }
232
+ function verifyBackendJwtRS256(raw) {
233
+ const publicKey = readRs256PublicKey();
234
+ const audience = process.env.JWT_AUDIENCE || process.env.AUTH_JWT_AUDIENCE || "getmarket.api";
235
+ const issuer = process.env.JWT_ISSUER || process.env.AUTH_JWT_ISSUER || "getmarket-auth";
236
+ return jwt.verify(raw, publicKey, {
237
+ algorithms: ["RS256"],
238
+ audience,
239
+ issuer
240
+ });
241
+ }
242
+
243
+ // src/auth/middleware.ts
244
+ function getBearerToken(req) {
245
+ const auth = String(req.headers?.authorization || "");
246
+ if (!auth.startsWith("Bearer ")) return null;
247
+ const token = auth.slice(7).trim();
248
+ return token.length ? token : null;
249
+ }
250
+ function normalizeUid(v) {
251
+ const s = String(v ?? "").trim();
252
+ return s.length ? s : null;
253
+ }
254
+ function createAuthMiddleware(opts) {
255
+ const { subject, allowFirebaseIdToken = false, requireSubject = true, hydrate } = opts;
256
+ return async (req, res, next) => {
257
+ const token = getBearerToken(req);
258
+ if (!token) {
259
+ return res.status(401).json({
260
+ ok: false,
261
+ code: "AUTH_MISSING_TOKEN",
262
+ message: "Missing Authorization Bearer token"
263
+ });
264
+ }
265
+ const headerCtx = req.context || {};
266
+ const company_uid = normalizeUid(headerCtx.company_uid);
267
+ const branch_uid = normalizeUid(headerCtx.branch_uid);
268
+ try {
269
+ const decoded = verifyBackendJwtRS256(token);
270
+ const baseCtx = {
271
+ tokenType: "backend",
272
+ subject,
273
+ company_uid: company_uid ?? void 0,
274
+ branch_uid: branch_uid ?? void 0,
275
+ roles: Array.isArray(decoded?.roles) ? decoded.roles : [],
276
+ permissions: Array.isArray(decoded?.permissions) ? decoded.permissions : [],
277
+ denied_permissions: Array.isArray(decoded?.denied_permissions) ? decoded.denied_permissions : [],
278
+ session: {
279
+ jti: decoded?.jti,
280
+ device_id: decoded?.device_id,
281
+ expires_at: decoded?.exp
282
+ }
283
+ };
284
+ const hydrated = await hydrate({ decoded, req, subject, company_uid, branch_uid });
285
+ Object.assign(baseCtx, hydrated);
286
+ if (requireSubject) {
287
+ if (subject === "employee" && !baseCtx.employee) {
288
+ return res.status(401).json({
289
+ ok: false,
290
+ code: "AUTH_EMPLOYEE_NOT_FOUND",
291
+ message: "Employee not resolved by hydrator"
292
+ });
293
+ }
294
+ if (subject === "customer" && !baseCtx.customer) {
295
+ return res.status(401).json({
296
+ ok: false,
297
+ code: "AUTH_CUSTOMER_NOT_FOUND",
298
+ message: "Customer not resolved by hydrator"
299
+ });
300
+ }
301
+ }
302
+ req.auth = baseCtx;
303
+ return next();
304
+ } catch {
305
+ if (!allowFirebaseIdToken) {
306
+ return res.status(401).json({
307
+ ok: false,
308
+ code: "AUTH_INVALID_TOKEN",
309
+ message: "Invalid or expired token"
310
+ });
311
+ }
312
+ try {
313
+ const { default: admin2 } = await import("firebase-admin");
314
+ const firebaseDecoded = await admin2.auth().verifyIdToken(token);
315
+ if (firebaseDecoded.email && firebaseDecoded.email_verified === false) {
316
+ return res.status(401).json({
317
+ ok: false,
318
+ code: "AUTH_EMAIL_NOT_VERIFIED",
319
+ message: "Email not verified"
320
+ });
321
+ }
322
+ req.auth = {
323
+ tokenType: "backend",
324
+ subject,
325
+ firebase: firebaseDecoded,
326
+ company_uid: company_uid ?? void 0,
327
+ branch_uid: branch_uid ?? void 0,
328
+ companies: [],
329
+ roles: [],
330
+ permissions: [],
331
+ denied_permissions: []
332
+ };
333
+ return next();
334
+ } catch {
335
+ return res.status(401).json({
336
+ ok: false,
337
+ code: "AUTH_INVALID_TOKEN",
338
+ message: "Invalid or expired token"
339
+ });
340
+ }
341
+ }
342
+ };
343
+ }
344
+
345
+ // src/auth/authentication.ts
346
+ import admin from "firebase-admin";
347
+ import jwt2 from "jsonwebtoken";
348
+ import fs3 from "fs";
349
+ function getBearerToken2(req) {
350
+ const auth = String(req.headers?.authorization || "");
351
+ if (!auth.startsWith("Bearer ")) return null;
352
+ const token = auth.slice(7).trim();
353
+ return token.length ? token : null;
354
+ }
355
+ function readPublicKey() {
356
+ const publicKeyPath = process.env.JWT_PUBLIC_KEY_PATH;
357
+ const publicKeyEnv = process.env.AUTH_JWT_PUBLIC_KEY || process.env.AUTH_RSA_PUBLIC_KEY || "";
358
+ if (publicKeyPath) {
359
+ const v = fs3.readFileSync(publicKeyPath, "utf8").trim();
360
+ if (v) return v;
361
+ }
362
+ const envKey = publicKeyEnv.replace(/\\n/g, "\n").trim();
363
+ if (envKey) return envKey;
364
+ throw new Error(
365
+ "Missing RS256 public key (JWT_PUBLIC_KEY_PATH / AUTH_JWT_PUBLIC_KEY / AUTH_RSA_PUBLIC_KEY)"
366
+ );
367
+ }
368
+ function verifyBackendJwtRS2562(raw) {
369
+ const publicKey = readPublicKey();
370
+ const audience = process.env.JWT_AUDIENCE || process.env.AUTH_JWT_AUDIENCE || "getmarket.api";
371
+ const issuer = process.env.JWT_ISSUER || process.env.AUTH_JWT_ISSUER || "getmarket-auth";
372
+ return jwt2.verify(raw, publicKey, {
373
+ algorithms: ["RS256"],
374
+ audience,
375
+ issuer
376
+ });
377
+ }
378
+ function normalizeUid2(v) {
379
+ const s = String(v ?? "").trim();
380
+ return s.length ? s : null;
381
+ }
382
+ function deriveCompanyBranch(decoded, companyUid, branchUid) {
383
+ const companiesFromToken = Array.isArray(decoded?.companies) ? decoded.companies : [];
384
+ const company = decoded?.company ?? (companyUid ? companiesFromToken.find((c) => c?.uid === companyUid) : null) ?? null;
385
+ const branch = decoded?.branch ?? (branchUid && company?.branches ? (company.branches || []).find((b) => b?.uid === branchUid) : null) ?? null;
386
+ return { companiesFromToken, company, branch };
387
+ }
388
+ function createAuthMiddleware2(opts) {
389
+ const { subject, allowFirebaseIdToken = false } = opts;
390
+ return async (req, res, next) => {
391
+ const token = getBearerToken2(req);
392
+ if (!token) {
393
+ return res.status(401).json({
394
+ ok: false,
395
+ code: "AUTH_MISSING_TOKEN",
396
+ message: "Missing Authorization Bearer token"
397
+ });
398
+ }
399
+ try {
400
+ const decoded = verifyBackendJwtRS2562(token);
401
+ const headerCtx = req.context || {};
402
+ const companyUid = normalizeUid2(headerCtx.company_uid);
403
+ const branchUid = normalizeUid2(headerCtx.branch_uid);
404
+ const { companiesFromToken, company, branch } = deriveCompanyBranch(decoded, companyUid, branchUid);
405
+ const ctx = {
406
+ tokenType: "backend",
407
+ subject,
408
+ company_uid: companyUid ?? void 0,
409
+ branch_uid: branchUid ?? void 0,
410
+ companies: companiesFromToken,
411
+ company,
412
+ branch,
413
+ roles: Array.isArray(decoded?.roles) ? decoded.roles : [],
414
+ permissions: Array.isArray(decoded?.permissions) ? decoded.permissions : [],
415
+ denied_permissions: Array.isArray(decoded?.denied_permissions) ? decoded.denied_permissions : [],
416
+ session: {
417
+ jti: decoded?.jti,
418
+ device_id: decoded?.device_id,
419
+ expires_at: decoded?.exp
420
+ }
421
+ };
422
+ if (subject === "employee") {
423
+ const employee = decoded?.employee ?? decoded?.user ?? null;
424
+ if (!employee) {
425
+ return res.status(401).json({
426
+ ok: false,
427
+ code: "AUTH_EMPLOYEE_NOT_FOUND",
428
+ message: "Employee not found in token"
429
+ });
430
+ }
431
+ ctx.employee = employee;
432
+ } else {
433
+ const customer = decoded?.customer ?? null;
434
+ if (!customer) {
435
+ return res.status(401).json({
436
+ ok: false,
437
+ code: "AUTH_CUSTOMER_NOT_FOUND",
438
+ message: "Customer not found in token"
439
+ });
440
+ }
441
+ ctx.customer = customer;
442
+ }
443
+ req.auth = ctx;
444
+ return next();
445
+ } catch {
446
+ if (!allowFirebaseIdToken) {
447
+ return res.status(401).json({
448
+ ok: false,
449
+ code: "AUTH_INVALID_TOKEN",
450
+ message: "Invalid or expired token"
451
+ });
452
+ }
453
+ try {
454
+ const firebaseDecoded = await admin.auth().verifyIdToken(token);
455
+ if (firebaseDecoded.email && firebaseDecoded.email_verified === false) {
456
+ return res.status(401).json({
457
+ ok: false,
458
+ code: "AUTH_EMAIL_NOT_VERIFIED",
459
+ message: "Email not verified"
460
+ });
461
+ }
462
+ const headerCtx = req.context || {};
463
+ const companyUid = normalizeUid2(headerCtx.company_uid);
464
+ const branchUid = normalizeUid2(headerCtx.branch_uid);
465
+ req.auth = {
466
+ tokenType: "backend",
467
+ subject,
468
+ firebase: firebaseDecoded,
469
+ company_uid: companyUid ?? void 0,
470
+ branch_uid: branchUid ?? void 0,
471
+ companies: [],
472
+ roles: [],
473
+ permissions: [],
474
+ denied_permissions: []
475
+ };
476
+ return next();
477
+ } catch {
478
+ return res.status(401).json({
479
+ ok: false,
480
+ code: "AUTH_INVALID_TOKEN",
481
+ message: "Invalid or expired token"
482
+ });
483
+ }
484
+ }
485
+ };
486
+ }
487
+ var authEmployeeRequired = createAuthMiddleware2({ subject: "employee", allowFirebaseIdToken: false });
488
+ var authCustomerRequired = createAuthMiddleware2({ subject: "customer", allowFirebaseIdToken: false });
489
+ var authEmployeeAllowFirebase = createAuthMiddleware2({ subject: "employee", allowFirebaseIdToken: true });
490
+ var authCustomerAllowFirebase = createAuthMiddleware2({ subject: "customer", allowFirebaseIdToken: true });
491
+
492
+ // src/middlewares/guards.ts
493
+ function normalizeRole(r) {
494
+ if (!r) return null;
495
+ if (typeof r === "string") return r;
496
+ return r.code || r.name || null;
497
+ }
498
+ function normalizePerm(p) {
499
+ if (!p) return null;
500
+ if (typeof p === "string") return p;
501
+ return p.code || p.name || null;
502
+ }
503
+ function isSysAdmin2(roles) {
504
+ if (!Array.isArray(roles)) return false;
505
+ return roles.some((r) => normalizeRole(r) === "SYS_ADMIN");
506
+ }
507
+ function getAuth2(req) {
508
+ return req.auth ?? {};
509
+ }
510
+ function permissionSets(auth) {
511
+ const allow = new Set(
512
+ (auth.permissions ?? []).map(normalizePerm).filter(Boolean)
513
+ );
514
+ const deny = new Set(
515
+ (auth.denied_permissions ?? []).map(normalizePerm).filter(Boolean)
516
+ );
517
+ return { allow, deny };
518
+ }
519
+ function allowSysAdminOrAnyPermission(...perms) {
520
+ const required = (perms ?? []).filter(Boolean);
521
+ return [
522
+ parseHeaders,
523
+ authEmployeeRequired,
524
+ (req, res, next) => {
525
+ const auth = getAuth2(req);
526
+ if (isSysAdmin2(auth.roles)) return next();
527
+ const { allow, deny } = permissionSets(auth);
528
+ for (const p of required) {
529
+ if (deny.has(p)) {
530
+ return sendError(req, res, 403, "FORBIDDEN", `Denied permission: ${p}`, {
531
+ denied: p
532
+ });
533
+ }
534
+ }
535
+ const ok = required.some((p) => allow.has(p));
536
+ if (!ok) {
537
+ return sendError(req, res, 403, "FORBIDDEN", "Missing permissions (ANY)", {
538
+ required
539
+ });
540
+ }
541
+ return next();
542
+ }
543
+ ];
544
+ }
545
+ function allowSysAdminOrPermissionsAll(...perms) {
546
+ const required = (perms ?? []).filter(Boolean);
547
+ return [
548
+ parseHeaders,
549
+ authEmployeeRequired,
550
+ (req, res, next) => {
551
+ const auth = getAuth2(req);
552
+ if (isSysAdmin2(auth.roles)) return next();
553
+ const { allow, deny } = permissionSets(auth);
554
+ for (const p of required) {
555
+ if (deny.has(p)) {
556
+ return sendError(req, res, 403, "FORBIDDEN", `Denied permission: ${p}`, {
557
+ denied: p
558
+ });
559
+ }
560
+ }
561
+ const missing = required.filter((p) => !allow.has(p));
562
+ if (missing.length) {
563
+ return sendError(req, res, 403, "FORBIDDEN", "Missing permissions (ALL)", {
564
+ required,
565
+ missing
566
+ });
567
+ }
568
+ return next();
569
+ }
570
+ ];
571
+ }
572
+ function allowSysAdminOrRoles(...roles) {
573
+ const required = (roles ?? []).filter(Boolean);
574
+ return [
575
+ parseHeaders,
576
+ authEmployeeRequired,
577
+ (req, res, next) => {
578
+ const auth = getAuth2(req);
579
+ if (isSysAdmin2(auth.roles)) return next();
580
+ const have = new Set(
581
+ (auth.roles ?? []).map(normalizeRole).filter(Boolean)
582
+ );
583
+ const ok = required.some((r) => have.has(r));
584
+ if (!ok) {
585
+ return sendError(req, res, 403, "FORBIDDEN", "Role not allowed", {
586
+ required
587
+ });
588
+ }
589
+ return next();
590
+ }
591
+ ];
592
+ }
593
+
594
+ export {
595
+ parseHeaders,
596
+ sendOk,
597
+ sendError,
598
+ internalAuth,
599
+ requireAuthContext,
600
+ requirePermissions,
601
+ requireAnyPermission,
602
+ requireRoles,
603
+ requireRolesOrAnyPermission,
604
+ readRs256PublicKey,
605
+ verifyBackendJwtRS256,
606
+ createAuthMiddleware,
607
+ createAuthMiddleware2,
608
+ authEmployeeRequired,
609
+ authCustomerRequired,
610
+ authEmployeeAllowFirebase,
611
+ authCustomerAllowFirebase,
612
+ allowSysAdminOrAnyPermission,
613
+ allowSysAdminOrPermissionsAll,
614
+ allowSysAdminOrRoles
615
+ };
616
+ //# sourceMappingURL=chunk-WKL4L67F.js.map