@blackcode_sa/metaestetics-api 1.7.25 → 1.7.26

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.
package/dist/index.js CHANGED
@@ -523,7 +523,7 @@ var appointmentMediaItemSchema = import_zod2.z.object({
523
523
  url: import_zod2.z.string().url("Media URL must be a valid URL"),
524
524
  fileName: import_zod2.z.string().optional(),
525
525
  uploadedAt: import_zod2.z.any().refine(
526
- (val) => val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
526
+ (val) => val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
527
527
  "uploadedAt must be a valid timestamp or Date object"
528
528
  ),
529
529
  uploadedBy: import_zod2.z.string().min(MIN_STRING_LENGTH, "Uploaded by user ID is required"),
@@ -557,11 +557,11 @@ var linkedFormInfoSchema = import_zod2.z.object({
557
557
  status: filledDocumentStatusSchema,
558
558
  path: import_zod2.z.string().min(MIN_STRING_LENGTH, "Form path is required"),
559
559
  submittedAt: import_zod2.z.any().refine(
560
- (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
560
+ (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
561
561
  "submittedAt must be a valid timestamp or Date object"
562
562
  ).optional(),
563
563
  completedAt: import_zod2.z.any().refine(
564
- (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
564
+ (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
565
565
  "completedAt must be a valid timestamp or Date object"
566
566
  ).optional()
567
567
  });
@@ -570,14 +570,14 @@ var patientReviewInfoSchema = import_zod2.z.object({
570
570
  rating: import_zod2.z.number().min(1).max(5, "Rating must be between 1 and 5"),
571
571
  comment: import_zod2.z.string().max(MAX_STRING_LENGTH_LONG, "Comment too long").optional(),
572
572
  reviewedAt: import_zod2.z.any().refine(
573
- (val) => val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
573
+ (val) => val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
574
574
  "reviewedAt must be a valid timestamp or Date object"
575
575
  )
576
576
  });
577
577
  var finalizedDetailsSchema = import_zod2.z.object({
578
578
  by: import_zod2.z.string().min(MIN_STRING_LENGTH, "Finalized by user ID is required"),
579
579
  at: import_zod2.z.any().refine(
580
- (val) => val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
580
+ (val) => val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
581
581
  "Finalized at must be a valid timestamp or Date object"
582
582
  ),
583
583
  notes: import_zod2.z.string().max(MAX_STRING_LENGTH_LONG, "Finalization notes too long").optional()
@@ -588,11 +588,11 @@ var createAppointmentSchema = import_zod2.z.object({
588
588
  patientId: import_zod2.z.string().min(MIN_STRING_LENGTH, "Patient ID is required"),
589
589
  procedureId: import_zod2.z.string().min(MIN_STRING_LENGTH, "Procedure ID is required"),
590
590
  appointmentStartTime: import_zod2.z.any().refine(
591
- (val) => val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
591
+ (val) => val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
592
592
  "Appointment start time must be a valid timestamp or Date object"
593
593
  ),
594
594
  appointmentEndTime: import_zod2.z.any().refine(
595
- (val) => val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
595
+ (val) => val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
596
596
  "Appointment end time must be a valid timestamp or Date object"
597
597
  ),
598
598
  cost: import_zod2.z.number().min(0, "Cost must be a non-negative number"),
@@ -622,11 +622,11 @@ var updateAppointmentSchema = import_zod2.z.object({
622
622
  linkedFormIds: import_zod2.z.union([import_zod2.z.array(import_zod2.z.string()), import_zod2.z.any()]).optional(),
623
623
  pendingUserFormsIds: import_zod2.z.union([import_zod2.z.array(import_zod2.z.string()), import_zod2.z.any()]).optional(),
624
624
  appointmentStartTime: import_zod2.z.any().refine(
625
- (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
625
+ (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
626
626
  "Appointment start time must be a valid timestamp or Date object"
627
627
  ).optional(),
628
628
  appointmentEndTime: import_zod2.z.any().refine(
629
- (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
629
+ (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
630
630
  "Appointment end time must be a valid timestamp or Date object"
631
631
  ).optional(),
632
632
  calendarEventId: import_zod2.z.string().min(MIN_STRING_LENGTH).optional(),
@@ -670,11 +670,11 @@ var searchAppointmentsSchema = import_zod2.z.object({
670
670
  practitionerId: import_zod2.z.string().optional(),
671
671
  clinicBranchId: import_zod2.z.string().optional(),
672
672
  startDate: import_zod2.z.any().refine(
673
- (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
673
+ (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
674
674
  "Start date must be a valid timestamp or Date object"
675
675
  ).optional(),
676
676
  endDate: import_zod2.z.any().refine(
677
- (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
677
+ (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
678
678
  "End date must be a valid timestamp or Date object"
679
679
  ).optional(),
680
680
  status: import_zod2.z.union([
package/dist/index.mjs CHANGED
@@ -281,7 +281,7 @@ var appointmentMediaItemSchema = z2.object({
281
281
  url: z2.string().url("Media URL must be a valid URL"),
282
282
  fileName: z2.string().optional(),
283
283
  uploadedAt: z2.any().refine(
284
- (val) => val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
284
+ (val) => val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
285
285
  "uploadedAt must be a valid timestamp or Date object"
286
286
  ),
287
287
  uploadedBy: z2.string().min(MIN_STRING_LENGTH, "Uploaded by user ID is required"),
@@ -315,11 +315,11 @@ var linkedFormInfoSchema = z2.object({
315
315
  status: filledDocumentStatusSchema,
316
316
  path: z2.string().min(MIN_STRING_LENGTH, "Form path is required"),
317
317
  submittedAt: z2.any().refine(
318
- (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
318
+ (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
319
319
  "submittedAt must be a valid timestamp or Date object"
320
320
  ).optional(),
321
321
  completedAt: z2.any().refine(
322
- (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
322
+ (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
323
323
  "completedAt must be a valid timestamp or Date object"
324
324
  ).optional()
325
325
  });
@@ -328,14 +328,14 @@ var patientReviewInfoSchema = z2.object({
328
328
  rating: z2.number().min(1).max(5, "Rating must be between 1 and 5"),
329
329
  comment: z2.string().max(MAX_STRING_LENGTH_LONG, "Comment too long").optional(),
330
330
  reviewedAt: z2.any().refine(
331
- (val) => val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
331
+ (val) => val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
332
332
  "reviewedAt must be a valid timestamp or Date object"
333
333
  )
334
334
  });
335
335
  var finalizedDetailsSchema = z2.object({
336
336
  by: z2.string().min(MIN_STRING_LENGTH, "Finalized by user ID is required"),
337
337
  at: z2.any().refine(
338
- (val) => val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
338
+ (val) => val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
339
339
  "Finalized at must be a valid timestamp or Date object"
340
340
  ),
341
341
  notes: z2.string().max(MAX_STRING_LENGTH_LONG, "Finalization notes too long").optional()
@@ -346,11 +346,11 @@ var createAppointmentSchema = z2.object({
346
346
  patientId: z2.string().min(MIN_STRING_LENGTH, "Patient ID is required"),
347
347
  procedureId: z2.string().min(MIN_STRING_LENGTH, "Procedure ID is required"),
348
348
  appointmentStartTime: z2.any().refine(
349
- (val) => val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
349
+ (val) => val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
350
350
  "Appointment start time must be a valid timestamp or Date object"
351
351
  ),
352
352
  appointmentEndTime: z2.any().refine(
353
- (val) => val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
353
+ (val) => val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
354
354
  "Appointment end time must be a valid timestamp or Date object"
355
355
  ),
356
356
  cost: z2.number().min(0, "Cost must be a non-negative number"),
@@ -380,11 +380,11 @@ var updateAppointmentSchema = z2.object({
380
380
  linkedFormIds: z2.union([z2.array(z2.string()), z2.any()]).optional(),
381
381
  pendingUserFormsIds: z2.union([z2.array(z2.string()), z2.any()]).optional(),
382
382
  appointmentStartTime: z2.any().refine(
383
- (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
383
+ (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
384
384
  "Appointment start time must be a valid timestamp or Date object"
385
385
  ).optional(),
386
386
  appointmentEndTime: z2.any().refine(
387
- (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
387
+ (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
388
388
  "Appointment end time must be a valid timestamp or Date object"
389
389
  ).optional(),
390
390
  calendarEventId: z2.string().min(MIN_STRING_LENGTH).optional(),
@@ -428,11 +428,11 @@ var searchAppointmentsSchema = z2.object({
428
428
  practitionerId: z2.string().optional(),
429
429
  clinicBranchId: z2.string().optional(),
430
430
  startDate: z2.any().refine(
431
- (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
431
+ (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
432
432
  "Start date must be a valid timestamp or Date object"
433
433
  ).optional(),
434
434
  endDate: z2.any().refine(
435
- (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || typeof val === "number",
435
+ (val) => val === void 0 || val instanceof Date || (val == null ? void 0 : val._seconds) !== void 0 || (val == null ? void 0 : val.seconds) !== void 0 || typeof val === "number" || typeof val === "string" || val && typeof val.toMillis === "function",
436
436
  "End date must be a valid timestamp or Date object"
437
437
  ).optional(),
438
438
  status: z2.union([
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@blackcode_sa/metaestetics-api",
3
3
  "private": false,
4
- "version": "1.7.25",
4
+ "version": "1.7.26",
5
5
  "description": "Firebase authentication service with anonymous upgrade support",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.mjs",
@@ -30,7 +30,10 @@ export const appointmentMediaItemSchema = z.object({
30
30
  (val) =>
31
31
  val instanceof Date ||
32
32
  val?._seconds !== undefined ||
33
- typeof val === "number",
33
+ val?.seconds !== undefined ||
34
+ typeof val === "number" ||
35
+ typeof val === "string" ||
36
+ (val && typeof val.toMillis === "function"),
34
37
  "uploadedAt must be a valid timestamp or Date object"
35
38
  ),
36
39
  uploadedBy: z
@@ -80,7 +83,10 @@ export const linkedFormInfoSchema = z.object({
80
83
  val === undefined ||
81
84
  val instanceof Date ||
82
85
  val?._seconds !== undefined ||
83
- typeof val === "number",
86
+ val?.seconds !== undefined ||
87
+ typeof val === "number" ||
88
+ typeof val === "string" ||
89
+ (val && typeof val.toMillis === "function"),
84
90
  "submittedAt must be a valid timestamp or Date object"
85
91
  )
86
92
  .optional(),
@@ -91,7 +97,10 @@ export const linkedFormInfoSchema = z.object({
91
97
  val === undefined ||
92
98
  val instanceof Date ||
93
99
  val?._seconds !== undefined ||
94
- typeof val === "number",
100
+ val?.seconds !== undefined ||
101
+ typeof val === "number" ||
102
+ typeof val === "string" ||
103
+ (val && typeof val.toMillis === "function"),
95
104
  "completedAt must be a valid timestamp or Date object"
96
105
  )
97
106
  .optional(),
@@ -110,7 +119,10 @@ export const patientReviewInfoSchema = z.object({
110
119
  (val) =>
111
120
  val instanceof Date ||
112
121
  val?._seconds !== undefined ||
113
- typeof val === "number",
122
+ val?.seconds !== undefined ||
123
+ typeof val === "number" ||
124
+ typeof val === "string" ||
125
+ (val && typeof val.toMillis === "function"),
114
126
  "reviewedAt must be a valid timestamp or Date object"
115
127
  ),
116
128
  });
@@ -123,7 +135,10 @@ export const finalizedDetailsSchema = z.object({
123
135
  (val) =>
124
136
  val instanceof Date ||
125
137
  val?._seconds !== undefined ||
126
- typeof val === "number",
138
+ val?.seconds !== undefined ||
139
+ typeof val === "number" ||
140
+ typeof val === "string" ||
141
+ (val && typeof val.toMillis === "function"),
127
142
  "Finalized at must be a valid timestamp or Date object"
128
143
  ),
129
144
  notes: z
@@ -153,7 +168,10 @@ export const createAppointmentSchema = z
153
168
  (val) =>
154
169
  val instanceof Date ||
155
170
  val?._seconds !== undefined ||
156
- typeof val === "number",
171
+ val?.seconds !== undefined ||
172
+ typeof val === "number" ||
173
+ typeof val === "string" ||
174
+ (val && typeof val.toMillis === "function"),
157
175
  "Appointment start time must be a valid timestamp or Date object"
158
176
  ),
159
177
  appointmentEndTime: z
@@ -162,7 +180,10 @@ export const createAppointmentSchema = z
162
180
  (val) =>
163
181
  val instanceof Date ||
164
182
  val?._seconds !== undefined ||
165
- typeof val === "number",
183
+ val?.seconds !== undefined ||
184
+ typeof val === "number" ||
185
+ typeof val === "string" ||
186
+ (val && typeof val.toMillis === "function"),
166
187
  "Appointment end time must be a valid timestamp or Date object"
167
188
  ),
168
189
  cost: z.number().min(0, "Cost must be a non-negative number"),
@@ -228,7 +249,10 @@ export const updateAppointmentSchema = z
228
249
  val === undefined ||
229
250
  val instanceof Date ||
230
251
  val?._seconds !== undefined ||
231
- typeof val === "number",
252
+ val?.seconds !== undefined ||
253
+ typeof val === "number" ||
254
+ typeof val === "string" ||
255
+ (val && typeof val.toMillis === "function"),
232
256
  "Appointment start time must be a valid timestamp or Date object"
233
257
  )
234
258
  .optional(),
@@ -239,7 +263,10 @@ export const updateAppointmentSchema = z
239
263
  val === undefined ||
240
264
  val instanceof Date ||
241
265
  val?._seconds !== undefined ||
242
- typeof val === "number",
266
+ val?.seconds !== undefined ||
267
+ typeof val === "number" ||
268
+ typeof val === "string" ||
269
+ (val && typeof val.toMillis === "function"),
243
270
  "Appointment end time must be a valid timestamp or Date object"
244
271
  )
245
272
  .optional(),
@@ -311,7 +338,10 @@ export const searchAppointmentsSchema = z
311
338
  val === undefined ||
312
339
  val instanceof Date ||
313
340
  val?._seconds !== undefined ||
314
- typeof val === "number",
341
+ val?.seconds !== undefined ||
342
+ typeof val === "number" ||
343
+ typeof val === "string" ||
344
+ (val && typeof val.toMillis === "function"),
315
345
  "Start date must be a valid timestamp or Date object"
316
346
  )
317
347
  .optional(),
@@ -322,7 +352,10 @@ export const searchAppointmentsSchema = z
322
352
  val === undefined ||
323
353
  val instanceof Date ||
324
354
  val?._seconds !== undefined ||
325
- typeof val === "number",
355
+ val?.seconds !== undefined ||
356
+ typeof val === "number" ||
357
+ typeof val === "string" ||
358
+ (val && typeof val.toMillis === "function"),
326
359
  "End date must be a valid timestamp or Date object"
327
360
  )
328
361
  .optional(),