@devlider001/washlab-backend 1.0.8 → 1.0.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.
@@ -18,6 +18,9 @@ import type * as customers from "../customers.js";
18
18
  import type * as http from "../http.js";
19
19
  import type * as lib_audit from "../lib/audit.js";
20
20
  import type * as lib_auth from "../lib/auth.js";
21
+ import type * as lib_biometricComparison from "../lib/biometricComparison.js";
22
+ import type * as lib_biometricEncryption from "../lib/biometricEncryption.js";
23
+ import type * as lib_tokenHashing from "../lib/tokenHashing.js";
21
24
  import type * as lib_utils from "../lib/utils.js";
22
25
  import type * as loyalty from "../loyalty.js";
23
26
  import type * as notifications from "../notifications.js";
@@ -43,6 +46,9 @@ declare const fullApi: ApiFromModules<{
43
46
  http: typeof http;
44
47
  "lib/audit": typeof lib_audit;
45
48
  "lib/auth": typeof lib_auth;
49
+ "lib/biometricComparison": typeof lib_biometricComparison;
50
+ "lib/biometricEncryption": typeof lib_biometricEncryption;
51
+ "lib/tokenHashing": typeof lib_tokenHashing;
46
52
  "lib/utils": typeof lib_utils;
47
53
  loyalty: typeof loyalty;
48
54
  notifications: typeof notifications;
package/convex/admin.d.ts CHANGED
@@ -43,13 +43,13 @@ export declare const getBranches: import("convex/server").RegisteredQuery<"publi
43
43
  createdAt: number;
44
44
  isDeleted: boolean;
45
45
  isActive: boolean;
46
+ createdBy: import("convex/values").GenericId<"admins">;
46
47
  code: string;
47
48
  address: string;
48
49
  city: string;
49
50
  country: string;
50
51
  pricingPerKg: number;
51
52
  deliveryFee: number;
52
- createdBy: import("convex/values").GenericId<"admins">;
53
53
  }[];
54
54
  isDone: boolean;
55
55
  continueCursor: string;
@@ -68,13 +68,13 @@ export declare const getBranchByCode: import("convex/server").RegisteredQuery<"p
68
68
  createdAt: number;
69
69
  isDeleted: boolean;
70
70
  isActive: boolean;
71
+ createdBy: import("convex/values").GenericId<"admins">;
71
72
  code: string;
72
73
  address: string;
73
74
  city: string;
74
75
  country: string;
75
76
  pricingPerKg: number;
76
77
  deliveryFee: number;
77
- createdBy: import("convex/values").GenericId<"admins">;
78
78
  } | null>>;
79
79
  /**
80
80
  * Get single branch by ID
@@ -90,13 +90,13 @@ export declare const getBranch: import("convex/server").RegisteredQuery<"public"
90
90
  createdAt: number;
91
91
  isDeleted: boolean;
92
92
  isActive: boolean;
93
+ createdBy: import("convex/values").GenericId<"admins">;
93
94
  code: string;
94
95
  address: string;
95
96
  city: string;
96
97
  country: string;
97
98
  pricingPerKg: number;
98
99
  deliveryFee: number;
99
- createdBy: import("convex/values").GenericId<"admins">;
100
100
  } | null>>;
101
101
  /**
102
102
  * Get all attendants - Paginated
@@ -111,16 +111,36 @@ export declare const getAttendants: import("convex/server").RegisteredQuery<"pub
111
111
  page: {
112
112
  _id: import("convex/values").GenericId<"attendants">;
113
113
  _creationTime: number;
114
+ clerkUserId?: string | undefined;
114
115
  lastLoginAt?: number | undefined;
115
116
  passcode?: string | undefined;
117
+ enrollmentTokenHash?: string | undefined;
118
+ enrollmentTokenExpiresAt?: number | undefined;
119
+ enrolledAt?: number | undefined;
120
+ enrolledBy?: import("convex/values").GenericId<"admins"> | undefined;
121
+ biometricTemplateHash?: string | undefined;
122
+ biometricDataEncrypted?: string | undefined;
123
+ biometricCaptureMetadata?: {
124
+ deviceInfo?: string | undefined;
125
+ captureType: "face" | "hand";
126
+ anglesCaptured: string[];
127
+ captureQuality: number;
128
+ livenessPassed: boolean;
129
+ captureTimestamp: number;
130
+ } | undefined;
131
+ lastVerificationAt?: number | undefined;
132
+ lastVerificationSuccess?: boolean | undefined;
133
+ verificationTimeoutAt?: number | undefined;
116
134
  phoneNumber: string;
117
135
  email: string;
118
136
  name: string;
119
- clerkUserId: string;
120
137
  createdAt: number;
121
138
  isDeleted: boolean;
122
139
  branchId: import("convex/values").GenericId<"branches">;
123
140
  isActive: boolean;
141
+ enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
142
+ consecutiveFailures: number;
143
+ createdBy: import("convex/values").GenericId<"admins">;
124
144
  }[];
125
145
  isDone: boolean;
126
146
  continueCursor: string;
@@ -463,4 +483,50 @@ export declare const getOrderDetails: import("convex/server").RegisteredQuery<"p
463
483
  changedAt: number;
464
484
  }[];
465
485
  } | null>>;
486
+ /**
487
+ * Create attendant enrollment (Admin)
488
+ * Generates enrollment link for attendant to complete biometric setup
489
+ */
490
+ export declare const createAttendantEnrollment: import("convex/server").RegisteredMutation<"public", {
491
+ expiresInHours?: number | undefined;
492
+ phoneNumber: string;
493
+ email: string;
494
+ name: string;
495
+ branchId: import("convex/values").GenericId<"branches">;
496
+ }, Promise<{
497
+ attendantId: Id<"attendants">;
498
+ enrollmentToken: string;
499
+ enrollmentLink: string;
500
+ expiresAt: number;
501
+ }>>;
502
+ /**
503
+ * List attendant enrollments (Admin)
504
+ */
505
+ export declare const listAttendantEnrollments: import("convex/server").RegisteredQuery<"public", {
506
+ status?: "active" | "suspended" | "invited" | "enrolling" | "locked" | undefined;
507
+ branchId?: import("convex/values").GenericId<"branches"> | undefined;
508
+ }, Promise<{
509
+ id: import("convex/values").GenericId<"attendants">;
510
+ name: string;
511
+ email: string;
512
+ phoneNumber: string;
513
+ branchId: import("convex/values").GenericId<"branches">;
514
+ enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
515
+ enrolledAt: number | undefined;
516
+ enrollmentTokenExpiresAt: number | undefined;
517
+ lastVerificationAt: number | undefined;
518
+ consecutiveFailures: number;
519
+ createdAt: number;
520
+ }[]>>;
521
+ /**
522
+ * Resend enrollment link (Admin)
523
+ */
524
+ export declare const resendEnrollmentLink: import("convex/server").RegisteredMutation<"public", {
525
+ expiresInHours?: number | undefined;
526
+ attendantId: import("convex/values").GenericId<"attendants">;
527
+ }, Promise<{
528
+ enrollmentToken: string;
529
+ enrollmentLink: string;
530
+ expiresAt: number;
531
+ }>>;
466
532
  //# sourceMappingURL=admin.d.ts.map
@@ -11,16 +11,36 @@ export declare const getByBranch: import("convex/server").RegisteredQuery<"publi
11
11
  }, Promise<{
12
12
  _id: import("convex/values").GenericId<"attendants">;
13
13
  _creationTime: number;
14
+ clerkUserId?: string | undefined;
14
15
  lastLoginAt?: number | undefined;
15
16
  passcode?: string | undefined;
17
+ enrollmentTokenHash?: string | undefined;
18
+ enrollmentTokenExpiresAt?: number | undefined;
19
+ enrolledAt?: number | undefined;
20
+ enrolledBy?: import("convex/values").GenericId<"admins"> | undefined;
21
+ biometricTemplateHash?: string | undefined;
22
+ biometricDataEncrypted?: string | undefined;
23
+ biometricCaptureMetadata?: {
24
+ deviceInfo?: string | undefined;
25
+ captureType: "face" | "hand";
26
+ anglesCaptured: string[];
27
+ captureQuality: number;
28
+ livenessPassed: boolean;
29
+ captureTimestamp: number;
30
+ } | undefined;
31
+ lastVerificationAt?: number | undefined;
32
+ lastVerificationSuccess?: boolean | undefined;
33
+ verificationTimeoutAt?: number | undefined;
16
34
  phoneNumber: string;
17
35
  email: string;
18
36
  name: string;
19
- clerkUserId: string;
20
37
  createdAt: number;
21
38
  isDeleted: boolean;
22
39
  branchId: import("convex/values").GenericId<"branches">;
23
40
  isActive: boolean;
41
+ enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
42
+ consecutiveFailures: number;
43
+ createdBy: import("convex/values").GenericId<"admins">;
24
44
  }[]>>;
25
45
  /**
26
46
  * Get current attendant profile (from authenticated Clerk session)
@@ -33,16 +53,36 @@ export declare const getCurrentUser: import("convex/server").RegisteredQuery<"pu
33
53
  } | null;
34
54
  _id: import("convex/values").GenericId<"attendants">;
35
55
  _creationTime: number;
56
+ clerkUserId?: string | undefined;
36
57
  lastLoginAt?: number | undefined;
37
58
  passcode?: string | undefined;
59
+ enrollmentTokenHash?: string | undefined;
60
+ enrollmentTokenExpiresAt?: number | undefined;
61
+ enrolledAt?: number | undefined;
62
+ enrolledBy?: import("convex/values").GenericId<"admins"> | undefined;
63
+ biometricTemplateHash?: string | undefined;
64
+ biometricDataEncrypted?: string | undefined;
65
+ biometricCaptureMetadata?: {
66
+ deviceInfo?: string | undefined;
67
+ captureType: "face" | "hand";
68
+ anglesCaptured: string[];
69
+ captureQuality: number;
70
+ livenessPassed: boolean;
71
+ captureTimestamp: number;
72
+ } | undefined;
73
+ lastVerificationAt?: number | undefined;
74
+ lastVerificationSuccess?: boolean | undefined;
75
+ verificationTimeoutAt?: number | undefined;
38
76
  phoneNumber: string;
39
77
  email: string;
40
78
  name: string;
41
- clerkUserId: string;
42
79
  createdAt: number;
43
80
  isDeleted: boolean;
44
81
  branchId: import("convex/values").GenericId<"branches">;
45
82
  isActive: boolean;
83
+ enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
84
+ consecutiveFailures: number;
85
+ createdBy: import("convex/values").GenericId<"admins">;
46
86
  }>>;
47
87
  /**
48
88
  * Get current active attendance session
@@ -50,9 +90,9 @@ export declare const getCurrentUser: import("convex/server").RegisteredQuery<"pu
50
90
  export declare const getActiveSession: import("convex/server").RegisteredQuery<"public", {}, Promise<{
51
91
  _id: import("convex/values").GenericId<"attendanceLogs">;
52
92
  _creationTime: number;
93
+ deviceInfo?: string | undefined;
53
94
  clockOutAt?: number | undefined;
54
95
  deviceId?: string | undefined;
55
- deviceInfo?: string | undefined;
56
96
  isDeleted: boolean;
57
97
  branchId: import("convex/values").GenericId<"branches">;
58
98
  isActive: boolean;
@@ -71,9 +111,9 @@ export declare const getAttendanceHistory: import("convex/server").RegisteredQue
71
111
  page: {
72
112
  _id: import("convex/values").GenericId<"attendanceLogs">;
73
113
  _creationTime: number;
114
+ deviceInfo?: string | undefined;
74
115
  clockOutAt?: number | undefined;
75
116
  deviceId?: string | undefined;
76
- deviceInfo?: string | undefined;
77
117
  isDeleted: boolean;
78
118
  branchId: import("convex/values").GenericId<"branches">;
79
119
  isActive: boolean;
@@ -87,8 +127,8 @@ export declare const getAttendanceHistory: import("convex/server").RegisteredQue
87
127
  * Clock in attendant (start attendance session)
88
128
  */
89
129
  export declare const clockIn: import("convex/server").RegisteredMutation<"public", {
90
- deviceId?: string | undefined;
91
130
  deviceInfo?: string | undefined;
131
+ deviceId?: string | undefined;
92
132
  branchId: import("convex/values").GenericId<"branches">;
93
133
  }, Promise<import("convex/values").GenericId<"attendanceLogs">>>;
94
134
  /**
@@ -137,4 +177,135 @@ export declare const getAttendanceSummary: import("convex/server").RegisteredQue
137
177
  end: number;
138
178
  };
139
179
  }>>;
180
+ /**
181
+ * Verify enrollment token (public query - no auth required)
182
+ */
183
+ export declare const verifyEnrollmentToken: import("convex/server").RegisteredQuery<"public", {
184
+ token: string;
185
+ }, Promise<{
186
+ valid: boolean;
187
+ error: string;
188
+ attendant?: undefined;
189
+ expiresAt?: undefined;
190
+ } | {
191
+ valid: boolean;
192
+ attendant: {
193
+ id: import("convex/values").GenericId<"attendants">;
194
+ name: string;
195
+ email: string;
196
+ branchId: import("convex/values").GenericId<"branches">;
197
+ branchName: string;
198
+ };
199
+ expiresAt: number;
200
+ error?: undefined;
201
+ }>>;
202
+ /**
203
+ * Start biometric enrollment
204
+ */
205
+ export declare const startBiometricEnrollment: import("convex/server").RegisteredMutation<"public", {
206
+ method: "face" | "hand";
207
+ enrollmentToken: string;
208
+ }, Promise<{
209
+ sessionId: import("convex/values").GenericId<"biometricVerificationSessions">;
210
+ challenge: string;
211
+ expiresAt: number;
212
+ }>>;
213
+ /**
214
+ * Complete biometric enrollment
215
+ */
216
+ export declare const completeBiometricEnrollment: import("convex/server").RegisteredMutation<"public", {
217
+ challenge: string;
218
+ enrollmentToken: string;
219
+ biometricData: {
220
+ deviceInfo?: string | undefined;
221
+ captureType: "face" | "hand";
222
+ captureQuality: number;
223
+ angles: string[];
224
+ features: string;
225
+ measurements: string;
226
+ livenessData: string;
227
+ };
228
+ }, Promise<{
229
+ success: boolean;
230
+ attendantId: import("convex/values").GenericId<"attendants">;
231
+ enrolledAt: number;
232
+ }>>;
233
+ /**
234
+ * Find attendant by email (for login)
235
+ */
236
+ export declare const findByEmail: import("convex/server").RegisteredQuery<"public", {
237
+ email: string;
238
+ }, Promise<{
239
+ id: import("convex/values").GenericId<"attendants">;
240
+ name: string;
241
+ email: string;
242
+ branchId: import("convex/values").GenericId<"branches">;
243
+ } | null>>;
244
+ /**
245
+ * Start verification (for login or action)
246
+ * Changed to mutation to allow storing challenges
247
+ */
248
+ export declare const startVerification: import("convex/server").RegisteredMutation<"public", {
249
+ actionContext?: {
250
+ orderId?: import("convex/values").GenericId<"orders"> | undefined;
251
+ amount?: number | undefined;
252
+ actionType?: string | undefined;
253
+ } | undefined;
254
+ attendantId: import("convex/values").GenericId<"attendants">;
255
+ verificationType: "action" | "login" | "session_renewal";
256
+ }, Promise<{
257
+ challenge: string;
258
+ attendantId: import("convex/values").GenericId<"attendants">;
259
+ verificationType: "action" | "login" | "session_renewal";
260
+ requiresLiveness: boolean;
261
+ }>>;
262
+ /**
263
+ * Verify biometric (complete verification)
264
+ */
265
+ export declare const verifyBiometric: import("convex/server").RegisteredMutation<"public", {
266
+ actionContext?: {
267
+ orderId?: import("convex/values").GenericId<"orders"> | undefined;
268
+ amount?: number | undefined;
269
+ actionType?: string | undefined;
270
+ } | undefined;
271
+ useFallback?: boolean | undefined;
272
+ fallbackType?: "otp" | "admin_verification" | undefined;
273
+ fallbackCode?: string | undefined;
274
+ attendantId: import("convex/values").GenericId<"attendants">;
275
+ challenge: string;
276
+ verificationType: "action" | "login" | "session_renewal";
277
+ biometricData: {
278
+ deviceInfo?: string | undefined;
279
+ captureType: "face" | "hand";
280
+ captureQuality: number;
281
+ angles: string[];
282
+ features: string;
283
+ measurements: string;
284
+ livenessData: string;
285
+ };
286
+ }, Promise<{
287
+ success: boolean;
288
+ verificationId: import("convex/values").GenericId<"biometricVerifications">;
289
+ expiresAt: number;
290
+ fallbackUsed: "otp" | "admin_verification";
291
+ confidence?: undefined;
292
+ } | {
293
+ success: boolean;
294
+ verificationId: import("convex/values").GenericId<"biometricVerifications">;
295
+ confidence: number;
296
+ expiresAt: number;
297
+ fallbackUsed?: undefined;
298
+ }>>;
299
+ /**
300
+ * Check verification status
301
+ */
302
+ export declare const checkVerificationStatus: import("convex/server").RegisteredQuery<"public", {
303
+ attendantId: import("convex/values").GenericId<"attendants">;
304
+ }, Promise<{
305
+ isVerified: boolean;
306
+ expiresAt: number | undefined;
307
+ lastVerificationAt: number | undefined;
308
+ consecutiveFailures: number;
309
+ enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
310
+ }>>;
140
311
  //# sourceMappingURL=attendants.d.ts.map
@@ -118,6 +118,53 @@ export declare const getOrders: import("convex/server").RegisteredQuery<"public"
118
118
  isDone: boolean;
119
119
  continueCursor: string;
120
120
  }>>;
121
+ /**
122
+ * Get active orders for customer (not cancelled or completed)
123
+ * Returns orders that are still in progress
124
+ */
125
+ export declare const getActiveOrders: import("convex/server").RegisteredQuery<"public", {}, Promise<{
126
+ _id: import("convex/values").GenericId<"orders">;
127
+ _creationTime: number;
128
+ createdBy?: import("convex/values").GenericId<"attendants"> | undefined;
129
+ customerEmail?: string | undefined;
130
+ estimatedWeight?: number | undefined;
131
+ actualWeight?: number | undefined;
132
+ itemCount?: number | undefined;
133
+ estimatedLoads?: number | undefined;
134
+ whitesSeparate?: boolean | undefined;
135
+ bagCardNumber?: string | undefined;
136
+ notes?: string | undefined;
137
+ deliveryAddress?: string | undefined;
138
+ deliveryPhoneNumber?: string | undefined;
139
+ deliveryHall?: string | undefined;
140
+ deliveryRoom?: string | undefined;
141
+ paymentMethod?: "mobile_money" | "card" | "cash" | undefined;
142
+ paymentId?: import("convex/values").GenericId<"payments"> | undefined;
143
+ fulfilledBy?: import("convex/values").GenericId<"attendants"> | undefined;
144
+ status: "pending" | "in_progress" | "ready_for_pickup" | "delivered" | "completed" | "cancelled";
145
+ createdAt: number;
146
+ isDeleted: boolean;
147
+ branchId: import("convex/values").GenericId<"branches">;
148
+ deliveryFee: number;
149
+ customerId: import("convex/values").GenericId<"users">;
150
+ customerPhoneNumber: string;
151
+ orderNumber: string;
152
+ orderType: "walk_in" | "online";
153
+ serviceType: "wash_only" | "wash_and_dry" | "dry_only";
154
+ isDelivery: boolean;
155
+ basePrice: number;
156
+ totalPrice: number;
157
+ finalPrice: number;
158
+ paymentStatus: "pending" | "paid" | "failed" | "refunded";
159
+ updatedAt: number;
160
+ statusHistory: {
161
+ notes?: string | undefined;
162
+ changedBy?: import("convex/values").GenericId<"attendants"> | undefined;
163
+ changedByAdmin?: import("convex/values").GenericId<"admins"> | undefined;
164
+ status: string;
165
+ changedAt: number;
166
+ }[];
167
+ }[]>>;
121
168
  /**
122
169
  * Get customer loyalty points balance
123
170
  * Returns zero points if customer not found
@@ -57,16 +57,36 @@ export declare function getCurrentCustomer(ctx: QueryCtx | MutationCtx): Promise
57
57
  export declare function getCurrentAttendant(ctx: QueryCtx | MutationCtx): Promise<{
58
58
  _id: import("convex/values").GenericId<"attendants">;
59
59
  _creationTime: number;
60
+ clerkUserId?: string | undefined;
60
61
  lastLoginAt?: number | undefined;
61
62
  passcode?: string | undefined;
63
+ enrollmentTokenHash?: string | undefined;
64
+ enrollmentTokenExpiresAt?: number | undefined;
65
+ enrolledAt?: number | undefined;
66
+ enrolledBy?: import("convex/values").GenericId<"admins"> | undefined;
67
+ biometricTemplateHash?: string | undefined;
68
+ biometricDataEncrypted?: string | undefined;
69
+ biometricCaptureMetadata?: {
70
+ deviceInfo?: string | undefined;
71
+ captureType: "face" | "hand";
72
+ anglesCaptured: string[];
73
+ captureQuality: number;
74
+ livenessPassed: boolean;
75
+ captureTimestamp: number;
76
+ } | undefined;
77
+ lastVerificationAt?: number | undefined;
78
+ lastVerificationSuccess?: boolean | undefined;
79
+ verificationTimeoutAt?: number | undefined;
62
80
  phoneNumber: string;
63
81
  email: string;
64
82
  name: string;
65
- clerkUserId: string;
66
83
  createdAt: number;
67
84
  isDeleted: boolean;
68
85
  branchId: import("convex/values").GenericId<"branches">;
69
86
  isActive: boolean;
87
+ enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
88
+ consecutiveFailures: number;
89
+ createdBy: import("convex/values").GenericId<"admins">;
70
90
  }>;
71
91
  /**
72
92
  * Get current admin from Clerk identity
@@ -105,15 +125,35 @@ export declare function getSuperAdmin(ctx: QueryCtx | MutationCtx): Promise<{
105
125
  export declare function verifyAttendantBranch(ctx: QueryCtx | MutationCtx, attendantId: Id<"attendants">, branchId: Id<"branches">): Promise<{
106
126
  _id: import("convex/values").GenericId<"attendants">;
107
127
  _creationTime: number;
128
+ clerkUserId?: string | undefined;
108
129
  lastLoginAt?: number | undefined;
109
130
  passcode?: string | undefined;
131
+ enrollmentTokenHash?: string | undefined;
132
+ enrollmentTokenExpiresAt?: number | undefined;
133
+ enrolledAt?: number | undefined;
134
+ enrolledBy?: import("convex/values").GenericId<"admins"> | undefined;
135
+ biometricTemplateHash?: string | undefined;
136
+ biometricDataEncrypted?: string | undefined;
137
+ biometricCaptureMetadata?: {
138
+ deviceInfo?: string | undefined;
139
+ captureType: "face" | "hand";
140
+ anglesCaptured: string[];
141
+ captureQuality: number;
142
+ livenessPassed: boolean;
143
+ captureTimestamp: number;
144
+ } | undefined;
145
+ lastVerificationAt?: number | undefined;
146
+ lastVerificationSuccess?: boolean | undefined;
147
+ verificationTimeoutAt?: number | undefined;
110
148
  phoneNumber: string;
111
149
  email: string;
112
150
  name: string;
113
- clerkUserId: string;
114
151
  createdAt: number;
115
152
  isDeleted: boolean;
116
153
  branchId: import("convex/values").GenericId<"branches">;
117
154
  isActive: boolean;
155
+ enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
156
+ consecutiveFailures: number;
157
+ createdBy: import("convex/values").GenericId<"admins">;
118
158
  }>;
119
159
  //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Biometric Comparison Utilities
3
+ *
4
+ * Provides functions to compare live biometric data with stored templates.
5
+ */
6
+ export interface BiometricData {
7
+ landmarks: number[][];
8
+ angles: {
9
+ headLeft?: number;
10
+ headRight?: number;
11
+ headUp?: number;
12
+ headDown?: number;
13
+ handLeft?: number;
14
+ handRight?: number;
15
+ handUp?: number;
16
+ handDown?: number;
17
+ };
18
+ features: number[];
19
+ }
20
+ /**
21
+ * Compare two biometric templates and return confidence score (0-1)
22
+ */
23
+ export declare function compareBiometricData(live: BiometricData, stored: BiometricData): number;
24
+ /**
25
+ * Compare biometric templates (wrapper for stored vs live comparison)
26
+ */
27
+ export declare function compareBiometricTemplates(storedTemplate: BiometricData, liveData: {
28
+ features: number[];
29
+ measurements: any;
30
+ angles: string[];
31
+ }, options: {
32
+ captureQuality: number;
33
+ type: "face" | "hand";
34
+ }): Promise<{
35
+ confidence: number;
36
+ match: boolean;
37
+ }>;
38
+ //# sourceMappingURL=biometricComparison.d.ts.map
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Biometric Data Encryption Utilities
3
+ *
4
+ * Provides encryption and decryption for biometric templates.
5
+ * Uses base64 encoding for now (placeholder for proper encryption).
6
+ *
7
+ * NOTE: In Convex, we use base64 encoding for now.
8
+ * For production, implement proper encryption using environment variables
9
+ * or an external encryption service.
10
+ */
11
+ export interface BiometricData {
12
+ landmarks: number[][];
13
+ angles: {
14
+ headLeft?: number;
15
+ headRight?: number;
16
+ headUp?: number;
17
+ headDown?: number;
18
+ handLeft?: number;
19
+ handRight?: number;
20
+ handUp?: number;
21
+ handDown?: number;
22
+ };
23
+ features: number[];
24
+ }
25
+ /**
26
+ * Encrypt biometric data
27
+ * Returns encrypted data, IV, and auth tag as base64 strings
28
+ *
29
+ * IMPORTANT: In production, use proper encryption library or service
30
+ * This is a placeholder that should be replaced with actual encryption
31
+ */
32
+ export declare function encryptBiometricData(data: BiometricData): {
33
+ encryptedData: string;
34
+ iv: string;
35
+ authTag: string;
36
+ };
37
+ /**
38
+ * Decrypt biometric data
39
+ *
40
+ * IMPORTANT: In production, use proper decryption library or service
41
+ * This is a placeholder that should be replaced with actual decryption
42
+ */
43
+ export declare function decryptBiometricData(encryptedData: string, iv: string, authTag: string): BiometricData;
44
+ /**
45
+ * Hash biometric template for quick comparison
46
+ * Uses Web Crypto API (available in Convex V8 runtime)
47
+ */
48
+ export declare function hashBiometricTemplate(data: BiometricData): Promise<string>;
49
+ //# sourceMappingURL=biometricEncryption.d.ts.map
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Token Hashing Utilities
3
+ *
4
+ * Provides secure token hashing and verification.
5
+ * Used for enrollment tokens, session tokens, and OTP codes.
6
+ *
7
+ * Uses Web Crypto API (available in Convex V8 runtime)
8
+ */
9
+ /**
10
+ * Hash a token using SHA-256 (for enrollment tokens and challenges)
11
+ * Uses Web Crypto API which is available in Convex V8 runtime
12
+ */
13
+ export declare function hashToken(token: string): Promise<string>;
14
+ /**
15
+ * Verify a token against its hash
16
+ */
17
+ export declare function verifyToken(token: string, hash: string): Promise<boolean>;
18
+ /**
19
+ * Generate a secure random token
20
+ */
21
+ export declare function generateSecureToken(length?: number): string;
22
+ /**
23
+ * Generate a challenge string for biometric verification
24
+ */
25
+ export declare function generateChallenge(): string;
26
+ //# sourceMappingURL=tokenHashing.d.ts.map
@@ -76,6 +76,8 @@ export declare const getAllNotifications: import("convex/server").RegisteredQuer
76
76
  };
77
77
  }, Promise<{
78
78
  page: {
79
+ isRead: boolean;
80
+ readAt: number | undefined;
79
81
  _id: import("convex/values").GenericId<"notifications">;
80
82
  _creationTime: number;
81
83
  branchId?: import("convex/values").GenericId<"branches"> | undefined;
@@ -83,7 +85,6 @@ export declare const getAllNotifications: import("convex/server").RegisteredQuer
83
85
  entityId?: string | undefined;
84
86
  actionUrl?: string | undefined;
85
87
  actionLabel?: string | undefined;
86
- readAt?: number | undefined;
87
88
  senderId?: string | undefined;
88
89
  senderType?: "admin" | "attendant" | "system" | undefined;
89
90
  expiresAt?: number | undefined;
@@ -97,7 +98,6 @@ export declare const getAllNotifications: import("convex/server").RegisteredQuer
97
98
  title: string;
98
99
  message: string;
99
100
  priority: "low" | "normal" | "high" | "urgent";
100
- isRead: boolean;
101
101
  }[];
102
102
  isDone: boolean;
103
103
  continueCursor: string;