@blackcode_sa/metaestetics-api 1.7.9 → 1.7.11

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.
@@ -924,6 +924,11 @@ declare enum ClinicTag {
924
924
  HOLIDAY_HOURS = "holiday_hours"
925
925
  }
926
926
 
927
+ /**
928
+ * Type that allows a field to be either a URL string or a File object
929
+ */
930
+ type MediaResource = string | File | Blob;
931
+
927
932
  /**
928
933
  * Interface for clinic contact information
929
934
  */
@@ -1017,10 +1022,6 @@ interface DoctorInfo {
1017
1022
  rating: number;
1018
1023
  services: string[];
1019
1024
  }
1020
- /**
1021
- * Type that allows a field to be either a URL string or a File object
1022
- */
1023
- type MediaResource = string | File | Blob;
1024
1025
  /**
1025
1026
  * Interface for clinic
1026
1027
  */
@@ -924,6 +924,11 @@ declare enum ClinicTag {
924
924
  HOLIDAY_HOURS = "holiday_hours"
925
925
  }
926
926
 
927
+ /**
928
+ * Type that allows a field to be either a URL string or a File object
929
+ */
930
+ type MediaResource = string | File | Blob;
931
+
927
932
  /**
928
933
  * Interface for clinic contact information
929
934
  */
@@ -1017,10 +1022,6 @@ interface DoctorInfo {
1017
1022
  rating: number;
1018
1023
  services: string[];
1019
1024
  }
1020
- /**
1021
- * Type that allows a field to be either a URL string or a File object
1022
- */
1023
- type MediaResource = string | File | Blob;
1024
1025
  /**
1025
1026
  * Interface for clinic
1026
1027
  */
package/dist/index.d.mts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { z } from 'zod';
2
- import { Timestamp, FieldValue, Firestore, QueryDocumentSnapshot, DocumentSnapshot } from 'firebase/firestore';
2
+ import { Firestore, Timestamp, FieldValue, QueryDocumentSnapshot, DocumentSnapshot } from 'firebase/firestore';
3
3
  import { Timestamp as Timestamp$1 } from 'firebase-admin/firestore';
4
- import { FirebaseApp } from 'firebase/app';
5
4
  import { Auth, User as User$1 } from 'firebase/auth';
6
- import { Analytics } from 'firebase/analytics';
5
+ import { FirebaseApp } from 'firebase/app';
7
6
  import { FirebaseStorage } from 'firebase/storage';
7
+ import { Analytics } from 'firebase/analytics';
8
8
  import { Functions } from 'firebase/functions';
9
9
  import * as _firebase_firestore from '@firebase/firestore';
10
10
 
@@ -749,6 +749,102 @@ declare enum ClinicPhotoTag {
749
749
  OTHER = "other"
750
750
  }
751
751
 
752
+ declare class BaseService {
753
+ protected db: Firestore;
754
+ protected auth: Auth;
755
+ protected app: FirebaseApp;
756
+ protected storage: FirebaseStorage;
757
+ constructor(db: Firestore, auth: Auth, app: FirebaseApp);
758
+ /**
759
+ * Generiše jedinstveni ID za dokumente
760
+ * Format: xxxxxxxxxxxx-timestamp
761
+ * Gde je x random karakter (broj ili slovo)
762
+ */
763
+ protected generateId(): string;
764
+ }
765
+
766
+ /**
767
+ * Enum for media access levels
768
+ */
769
+ declare enum MediaAccessLevel {
770
+ PUBLIC = "public",
771
+ PRIVATE = "private",
772
+ CONFIDENTIAL = "confidential"
773
+ }
774
+ /**
775
+ * Type that allows a field to be either a URL string or a File object
776
+ */
777
+ type MediaResource = string | File | Blob;
778
+ /**
779
+ * Media file metadata interface
780
+ */
781
+ interface MediaMetadata {
782
+ id: string;
783
+ name: string;
784
+ url: string;
785
+ contentType: string;
786
+ size: number;
787
+ createdAt: Timestamp;
788
+ accessLevel: MediaAccessLevel;
789
+ ownerId: string;
790
+ collectionName: string;
791
+ path: string;
792
+ updatedAt?: Timestamp;
793
+ }
794
+ declare const MEDIA_METADATA_COLLECTION = "media_metadata";
795
+ declare class MediaService extends BaseService {
796
+ constructor(db: Firestore, auth: Auth, app: FirebaseApp);
797
+ /**
798
+ * Upload a media file, store its metadata, and return the metadata including the URL.
799
+ * @param file - The file to upload.
800
+ * @param ownerId - ID of the owner (user, patient, clinic, etc.).
801
+ * @param accessLevel - Access level (public, private, confidential).
802
+ * @param collectionName - The logical collection name this media belongs to (e.g., 'patient_profile_pictures', 'clinic_logos').
803
+ * @param originalFileName - Optional: the original name of the file, if not using file.name.
804
+ * @returns Promise with the media metadata.
805
+ */
806
+ uploadMedia(file: File | Blob, ownerId: string, accessLevel: MediaAccessLevel, collectionName: string, originalFileName?: string): Promise<MediaMetadata>;
807
+ /**
808
+ * Get media metadata from Firestore by its ID.
809
+ * @param mediaId - ID of the media.
810
+ * @returns Promise with the media metadata or null if not found.
811
+ */
812
+ getMediaMetadata(mediaId: string): Promise<MediaMetadata | null>;
813
+ /**
814
+ * Get media metadata from Firestore by its public URL.
815
+ * @param url - The public URL of the media file.
816
+ * @returns Promise with the media metadata or null if not found.
817
+ */
818
+ getMediaMetadataByUrl(url: string): Promise<MediaMetadata | null>;
819
+ /**
820
+ * Delete media from storage and remove metadata from Firestore.
821
+ * @param mediaId - ID of the media to delete.
822
+ */
823
+ deleteMedia(mediaId: string): Promise<void>;
824
+ /**
825
+ * Update media access level. This involves moving the file in Firebase Storage
826
+ * to a new path reflecting the new access level, and updating its metadata.
827
+ * @param mediaId - ID of the media to update.
828
+ * @param newAccessLevel - New access level.
829
+ * @returns Promise with the updated media metadata, or null if metadata not found.
830
+ */
831
+ updateMediaAccessLevel(mediaId: string, newAccessLevel: MediaAccessLevel): Promise<MediaMetadata | null>;
832
+ /**
833
+ * List all media for an owner, optionally filtered by collection and access level.
834
+ * @param ownerId - ID of the owner.
835
+ * @param collectionName - Optional: Filter by collection name.
836
+ * @param accessLevel - Optional: Filter by access level.
837
+ * @param count - Optional: Number of items to fetch.
838
+ * @param startAfterId - Optional: ID of the document to start after (for pagination).
839
+ */
840
+ listMedia(ownerId: string, collectionName?: string, accessLevel?: MediaAccessLevel, count?: number, startAfterId?: string): Promise<MediaMetadata[]>;
841
+ /**
842
+ * Get download URL for media. (Convenience, as URL is in metadata)
843
+ * @param mediaId - ID of the media.
844
+ */
845
+ getMediaDownloadUrl(mediaId: string): Promise<string | null>;
846
+ }
847
+
752
848
  declare const CLINIC_GROUPS_COLLECTION = "clinic_groups";
753
849
  declare const CLINIC_ADMINS_COLLECTION = "clinic_admins";
754
850
  declare const CLINICS_COLLECTION = "clinics";
@@ -988,10 +1084,6 @@ interface DoctorInfo {
988
1084
  rating: number;
989
1085
  services: string[];
990
1086
  }
991
- /**
992
- * Type that allows a field to be either a URL string or a File object
993
- */
994
- type MediaResource = string | File | Blob;
995
1087
  /**
996
1088
  * Interface for clinic
997
1089
  */
@@ -3928,20 +4020,6 @@ declare const updateFilledDocumentDataSchema: z.ZodObject<{
3928
4020
  values?: Record<string, any> | undefined;
3929
4021
  }>;
3930
4022
 
3931
- declare class BaseService {
3932
- protected db: Firestore;
3933
- protected auth: Auth;
3934
- protected app: FirebaseApp;
3935
- protected storage: FirebaseStorage;
3936
- constructor(db: Firestore, auth: Auth, app: FirebaseApp);
3937
- /**
3938
- * Generiše jedinstveni ID za dokumente
3939
- * Format: xxxxxxxxxxxx-timestamp
3940
- * Gde je x random karakter (broj ili slovo)
3941
- */
3942
- protected generateId(): string;
3943
- }
3944
-
3945
4023
  /**
3946
4024
  * Servis za upravljanje kategorijama procedura.
3947
4025
  * Kategorije su prvi nivo organizacije nakon procedure family (aesthetics/surgery).
@@ -5013,17 +5091,17 @@ declare const searchAppointmentsSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
5013
5091
  patientId?: string | undefined;
5014
5092
  startDate?: any;
5015
5093
  endDate?: any;
5016
- practitionerId?: string | undefined;
5017
5094
  startAfter?: any;
5095
+ practitionerId?: string | undefined;
5018
5096
  clinicBranchId?: string | undefined;
5019
5097
  }, {
5020
5098
  status?: AppointmentStatus | [AppointmentStatus, ...AppointmentStatus[]] | undefined;
5021
5099
  patientId?: string | undefined;
5022
5100
  startDate?: any;
5023
5101
  endDate?: any;
5024
- practitionerId?: string | undefined;
5025
5102
  limit?: number | undefined;
5026
5103
  startAfter?: any;
5104
+ practitionerId?: string | undefined;
5027
5105
  clinicBranchId?: string | undefined;
5028
5106
  }>, {
5029
5107
  limit: number;
@@ -5031,17 +5109,17 @@ declare const searchAppointmentsSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
5031
5109
  patientId?: string | undefined;
5032
5110
  startDate?: any;
5033
5111
  endDate?: any;
5034
- practitionerId?: string | undefined;
5035
5112
  startAfter?: any;
5113
+ practitionerId?: string | undefined;
5036
5114
  clinicBranchId?: string | undefined;
5037
5115
  }, {
5038
5116
  status?: AppointmentStatus | [AppointmentStatus, ...AppointmentStatus[]] | undefined;
5039
5117
  patientId?: string | undefined;
5040
5118
  startDate?: any;
5041
5119
  endDate?: any;
5042
- practitionerId?: string | undefined;
5043
5120
  limit?: number | undefined;
5044
5121
  startAfter?: any;
5122
+ practitionerId?: string | undefined;
5045
5123
  clinicBranchId?: string | undefined;
5046
5124
  }>, {
5047
5125
  limit: number;
@@ -5049,17 +5127,17 @@ declare const searchAppointmentsSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
5049
5127
  patientId?: string | undefined;
5050
5128
  startDate?: any;
5051
5129
  endDate?: any;
5052
- practitionerId?: string | undefined;
5053
5130
  startAfter?: any;
5131
+ practitionerId?: string | undefined;
5054
5132
  clinicBranchId?: string | undefined;
5055
5133
  }, {
5056
5134
  status?: AppointmentStatus | [AppointmentStatus, ...AppointmentStatus[]] | undefined;
5057
5135
  patientId?: string | undefined;
5058
5136
  startDate?: any;
5059
5137
  endDate?: any;
5060
- practitionerId?: string | undefined;
5061
5138
  limit?: number | undefined;
5062
5139
  startAfter?: any;
5140
+ practitionerId?: string | undefined;
5063
5141
  clinicBranchId?: string | undefined;
5064
5142
  }>;
5065
5143
 
@@ -5539,83 +5617,6 @@ declare class ClinicGroupService extends BaseService {
5539
5617
  getActiveAdminTokens(groupId: string, adminId: string): Promise<AdminToken[]>;
5540
5618
  }
5541
5619
 
5542
- /**
5543
- * Enum for media access levels
5544
- */
5545
- declare enum MediaAccessLevel {
5546
- PUBLIC = "public",
5547
- PRIVATE = "private",
5548
- CONFIDENTIAL = "confidential"
5549
- }
5550
- /**
5551
- * Media file metadata interface
5552
- */
5553
- interface MediaMetadata {
5554
- id: string;
5555
- name: string;
5556
- url: string;
5557
- contentType: string;
5558
- size: number;
5559
- createdAt: Timestamp;
5560
- accessLevel: MediaAccessLevel;
5561
- ownerId: string;
5562
- collectionName: string;
5563
- path: string;
5564
- updatedAt?: Timestamp;
5565
- }
5566
- declare class MediaService extends BaseService {
5567
- constructor(db: Firestore, auth: Auth, app: FirebaseApp);
5568
- /**
5569
- * Upload a media file, store its metadata, and return the metadata including the URL.
5570
- * @param file - The file to upload.
5571
- * @param ownerId - ID of the owner (user, patient, clinic, etc.).
5572
- * @param accessLevel - Access level (public, private, confidential).
5573
- * @param collectionName - The logical collection name this media belongs to (e.g., 'patient_profile_pictures', 'clinic_logos').
5574
- * @param originalFileName - Optional: the original name of the file, if not using file.name.
5575
- * @returns Promise with the media metadata.
5576
- */
5577
- uploadMedia(file: File | Blob, ownerId: string, accessLevel: MediaAccessLevel, collectionName: string, originalFileName?: string): Promise<MediaMetadata>;
5578
- /**
5579
- * Get media metadata from Firestore by its ID.
5580
- * @param mediaId - ID of the media.
5581
- * @returns Promise with the media metadata or null if not found.
5582
- */
5583
- getMediaMetadata(mediaId: string): Promise<MediaMetadata | null>;
5584
- /**
5585
- * Get media metadata from Firestore by its public URL.
5586
- * @param url - The public URL of the media file.
5587
- * @returns Promise with the media metadata or null if not found.
5588
- */
5589
- getMediaMetadataByUrl(url: string): Promise<MediaMetadata | null>;
5590
- /**
5591
- * Delete media from storage and remove metadata from Firestore.
5592
- * @param mediaId - ID of the media to delete.
5593
- */
5594
- deleteMedia(mediaId: string): Promise<void>;
5595
- /**
5596
- * Update media access level. This involves moving the file in Firebase Storage
5597
- * to a new path reflecting the new access level, and updating its metadata.
5598
- * @param mediaId - ID of the media to update.
5599
- * @param newAccessLevel - New access level.
5600
- * @returns Promise with the updated media metadata, or null if metadata not found.
5601
- */
5602
- updateMediaAccessLevel(mediaId: string, newAccessLevel: MediaAccessLevel): Promise<MediaMetadata | null>;
5603
- /**
5604
- * List all media for an owner, optionally filtered by collection and access level.
5605
- * @param ownerId - ID of the owner.
5606
- * @param collectionName - Optional: Filter by collection name.
5607
- * @param accessLevel - Optional: Filter by access level.
5608
- * @param count - Optional: Number of items to fetch.
5609
- * @param startAfterId - Optional: ID of the document to start after (for pagination).
5610
- */
5611
- listMedia(ownerId: string, collectionName?: string, accessLevel?: MediaAccessLevel, count?: number, startAfterId?: string): Promise<MediaMetadata[]>;
5612
- /**
5613
- * Get download URL for media. (Convenience, as URL is in metadata)
5614
- * @param mediaId - ID of the media.
5615
- */
5616
- getMediaDownloadUrl(mediaId: string): Promise<string | null>;
5617
- }
5618
-
5619
5620
  declare class ClinicService extends BaseService {
5620
5621
  private clinicGroupService;
5621
5622
  private clinicAdminService;
@@ -6128,8 +6129,8 @@ declare class AuthService extends BaseService {
6128
6129
  signUpPractitioner(data: {
6129
6130
  email: string;
6130
6131
  password: string;
6131
- firstName: string;
6132
- lastName: string;
6132
+ firstName?: string;
6133
+ lastName?: string;
6133
6134
  token?: string;
6134
6135
  profileData?: Partial<CreatePractitionerData>;
6135
6136
  }): Promise<{
@@ -13128,8 +13129,8 @@ declare const createPractitionerTokenSchema: z.ZodObject<{
13128
13129
  declare const practitionerSignupSchema: z.ZodObject<{
13129
13130
  email: z.ZodString;
13130
13131
  password: z.ZodString;
13131
- firstName: z.ZodString;
13132
- lastName: z.ZodString;
13132
+ firstName: z.ZodOptional<z.ZodString>;
13133
+ lastName: z.ZodOptional<z.ZodString>;
13133
13134
  token: z.ZodOptional<z.ZodString>;
13134
13135
  profileData: z.ZodOptional<z.ZodObject<{
13135
13136
  basicInfo: z.ZodOptional<z.ZodObject<{
@@ -13167,10 +13168,10 @@ declare const practitionerSignupSchema: z.ZodObject<{
13167
13168
  certification?: any;
13168
13169
  }>>;
13169
13170
  }, "strip", z.ZodTypeAny, {
13170
- firstName: string;
13171
- lastName: string;
13172
13171
  email: string;
13173
13172
  password: string;
13173
+ firstName?: string | undefined;
13174
+ lastName?: string | undefined;
13174
13175
  token?: string | undefined;
13175
13176
  profileData?: {
13176
13177
  basicInfo?: {
@@ -13182,10 +13183,10 @@ declare const practitionerSignupSchema: z.ZodObject<{
13182
13183
  certification?: any;
13183
13184
  } | undefined;
13184
13185
  }, {
13185
- firstName: string;
13186
- lastName: string;
13187
13186
  email: string;
13188
13187
  password: string;
13188
+ firstName?: string | undefined;
13189
+ lastName?: string | undefined;
13189
13190
  token?: string | undefined;
13190
13191
  profileData?: {
13191
13192
  basicInfo?: {
@@ -14079,6 +14080,7 @@ declare const clinicGroupSchema: z.ZodObject<{
14079
14080
  featuredPhoto: string;
14080
14081
  description?: string | null | undefined;
14081
14082
  }[];
14083
+ ownerId: string | null;
14082
14084
  contactInfo: {
14083
14085
  email: string;
14084
14086
  phoneNumber: string;
@@ -14101,7 +14103,6 @@ declare const clinicGroupSchema: z.ZodObject<{
14101
14103
  phoneNumber?: string | null | undefined;
14102
14104
  title?: string | null | undefined;
14103
14105
  };
14104
- ownerId: string | null;
14105
14106
  subscriptionModel: SubscriptionModel;
14106
14107
  admins: string[];
14107
14108
  adminsInfo: {
@@ -14153,6 +14154,7 @@ declare const clinicGroupSchema: z.ZodObject<{
14153
14154
  featuredPhoto: string;
14154
14155
  description?: string | null | undefined;
14155
14156
  }[];
14157
+ ownerId: string | null;
14156
14158
  contactInfo: {
14157
14159
  email: string;
14158
14160
  phoneNumber: string;
@@ -14175,7 +14177,6 @@ declare const clinicGroupSchema: z.ZodObject<{
14175
14177
  phoneNumber?: string | null | undefined;
14176
14178
  title?: string | null | undefined;
14177
14179
  };
14178
- ownerId: string | null;
14179
14180
  subscriptionModel: SubscriptionModel;
14180
14181
  admins: string[];
14181
14182
  adminsInfo: {
@@ -15079,6 +15080,7 @@ declare const createClinicGroupSchema: z.ZodObject<{
15079
15080
  }, "strip", z.ZodTypeAny, {
15080
15081
  name: string;
15081
15082
  isActive: boolean;
15083
+ ownerId: string | null;
15082
15084
  contactInfo: {
15083
15085
  email: string;
15084
15086
  phoneNumber: string;
@@ -15101,7 +15103,6 @@ declare const createClinicGroupSchema: z.ZodObject<{
15101
15103
  phoneNumber?: string | null | undefined;
15102
15104
  title?: string | null | undefined;
15103
15105
  };
15104
- ownerId: string | null;
15105
15106
  subscriptionModel: SubscriptionModel;
15106
15107
  description?: string | undefined;
15107
15108
  logo?: string | File | Blob | null | undefined;
@@ -15113,6 +15114,7 @@ declare const createClinicGroupSchema: z.ZodObject<{
15113
15114
  }, {
15114
15115
  name: string;
15115
15116
  isActive: boolean;
15117
+ ownerId: string | null;
15116
15118
  contactInfo: {
15117
15119
  email: string;
15118
15120
  phoneNumber: string;
@@ -15135,7 +15137,6 @@ declare const createClinicGroupSchema: z.ZodObject<{
15135
15137
  phoneNumber?: string | null | undefined;
15136
15138
  title?: string | null | undefined;
15137
15139
  };
15138
- ownerId: string | null;
15139
15140
  description?: string | undefined;
15140
15141
  logo?: string | File | Blob | null | undefined;
15141
15142
  practiceType?: PracticeType | undefined;
@@ -15867,6 +15868,7 @@ declare const createDefaultClinicGroupSchema: z.ZodObject<{
15867
15868
  }, "strip", z.ZodTypeAny, {
15868
15869
  name: string;
15869
15870
  isActive: boolean;
15871
+ ownerId: string | null;
15870
15872
  contactInfo: {
15871
15873
  email: string;
15872
15874
  phoneNumber: string;
@@ -15889,7 +15891,6 @@ declare const createDefaultClinicGroupSchema: z.ZodObject<{
15889
15891
  phoneNumber?: string | null | undefined;
15890
15892
  title?: string | null | undefined;
15891
15893
  };
15892
- ownerId: string | null;
15893
15894
  subscriptionModel: SubscriptionModel;
15894
15895
  logo?: string | File | Blob | null | undefined;
15895
15896
  practiceType?: PracticeType | undefined;
@@ -15897,6 +15898,7 @@ declare const createDefaultClinicGroupSchema: z.ZodObject<{
15897
15898
  }, {
15898
15899
  name: string;
15899
15900
  isActive: boolean;
15901
+ ownerId: string | null;
15900
15902
  contactInfo: {
15901
15903
  email: string;
15902
15904
  phoneNumber: string;
@@ -15919,7 +15921,6 @@ declare const createDefaultClinicGroupSchema: z.ZodObject<{
15919
15921
  phoneNumber?: string | null | undefined;
15920
15922
  title?: string | null | undefined;
15921
15923
  };
15922
- ownerId: string | null;
15923
15924
  logo?: string | File | Blob | null | undefined;
15924
15925
  practiceType?: PracticeType | undefined;
15925
15926
  languages?: Language[] | undefined;
@@ -16787,6 +16788,7 @@ declare const updateClinicGroupSchema: z.ZodObject<{
16787
16788
  name?: string | undefined;
16788
16789
  isActive?: boolean | undefined;
16789
16790
  description?: string | undefined;
16791
+ ownerId?: string | null | undefined;
16790
16792
  contactInfo?: {
16791
16793
  email: string;
16792
16794
  phoneNumber: string;
@@ -16809,7 +16811,6 @@ declare const updateClinicGroupSchema: z.ZodObject<{
16809
16811
  phoneNumber?: string | null | undefined;
16810
16812
  title?: string | null | undefined;
16811
16813
  } | undefined;
16812
- ownerId?: string | null | undefined;
16813
16814
  logo?: string | File | Blob | null | undefined;
16814
16815
  practiceType?: PracticeType | undefined;
16815
16816
  languages?: Language[] | undefined;
@@ -16821,6 +16822,7 @@ declare const updateClinicGroupSchema: z.ZodObject<{
16821
16822
  name?: string | undefined;
16822
16823
  isActive?: boolean | undefined;
16823
16824
  description?: string | undefined;
16825
+ ownerId?: string | null | undefined;
16824
16826
  contactInfo?: {
16825
16827
  email: string;
16826
16828
  phoneNumber: string;
@@ -16843,7 +16845,6 @@ declare const updateClinicGroupSchema: z.ZodObject<{
16843
16845
  phoneNumber?: string | null | undefined;
16844
16846
  title?: string | null | undefined;
16845
16847
  } | undefined;
16846
- ownerId?: string | null | undefined;
16847
16848
  logo?: string | File | Blob | null | undefined;
16848
16849
  practiceType?: PracticeType | undefined;
16849
16850
  languages?: Language[] | undefined;
@@ -19404,4 +19405,4 @@ declare const createReviewSchema: z.ZodEffects<z.ZodObject<{
19404
19405
  } | undefined;
19405
19406
  }>;
19406
19407
 
19407
- export { APPOINTMENTS_COLLECTION, AUTH_ERRORS, type AddAllergyData, type AddBlockingConditionData, type AddContraindicationData, type AddMedicationData, type AddressData, type AdminInfo, type AdminToken, AdminTokenStatus, type Allergy, type AllergySubtype, AllergyType, type AllergyTypeWithSubtype, type Appointment, type AppointmentReminderNotification, AppointmentService, AppointmentStatus, AuthError, AuthService, type BaseDocumentElement, type BaseNotification, type BinaryChoiceElement, BlockingCondition, type Brand, BrandService, CALENDAR_COLLECTION, CLINICS_COLLECTION, CLINIC_ADMINS_COLLECTION, CLINIC_GROUPS_COLLECTION, type CalendarEvent, CalendarEventStatus, type CalendarEventTime, CalendarEventType, CalendarServiceV2, CalendarSyncStatus, type Category, CategoryService, CertificationLevel, CertificationSpecialty, type Clinic, type ClinicAdmin, ClinicAdminService, type ClinicAdminSignupData, type ClinicBranchSetupData, type ClinicContactInfo, type ClinicGroup, ClinicGroupService, type ClinicGroupSetupData, type ClinicInfo, type ClinicLocation, ClinicPhotoTag, type ClinicReview, type ClinicReviewInfo, ClinicService, ClinicTag, type ClinicTags, type ContactPerson, Contraindication, CosmeticAllergySubtype, type CreateAdminTokenData, type CreateAppointmentData, type CreateAppointmentHttpData, type CreateAppointmentParams, type CreateCalendarEventData, type CreateClinicAdminData, type CreateClinicData, type CreateClinicGroupData, type CreateDefaultClinicGroupData, type CreateDocumentTemplateData, type CreateDraftPractitionerData, type CreatePatientLocationInfoData, type CreatePatientMedicalInfoData, type CreatePatientProfileData, type CreatePatientSensitiveInfoData, type CreatePractitionerData, type CreatePractitionerTokenData, type CreateProcedureData, type CreateSyncedCalendarData, type CreateUserData, Currency, DOCTOR_FORMS_SUBCOLLECTION, DOCUMENTATION_TEMPLATES_COLLECTION, type DatePickerElement, type DateRange, type DigitalSignatureElement, type DoctorInfo, type DocumentElement, DocumentElementType, type DocumentTemplate, DocumentationTemplateService, type DynamicTextElement, DynamicVariable, type EmergencyContact, EnvironmentalAllergySubtype, FILLED_DOCUMENTS_COLLECTION, type FileUploadElement, type FilledDocument, FilledDocumentService, FilledDocumentStatus, FirebaseErrorCode, type FirebaseUser, FoodAllergySubtype, type GamificationInfo, Gender, type HeadingElement, HeadingLevel, Language, type ListElement, ListType, type LocationData, MedicationAllergySubtype, type MultipleChoiceElement, type Notification, NotificationService, NotificationStatus, NotificationType, PATIENTS_COLLECTION, PATIENT_APPOINTMENTS_COLLECTION, PATIENT_LOCATION_INFO_COLLECTION, PATIENT_MEDICAL_HISTORY_COLLECTION, PATIENT_MEDICAL_INFO_COLLECTION, PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONERS_COLLECTION, PROCEDURES_COLLECTION, type ParagraphElement, type PatientClinic, type PatientDoctor, PatientInstructionStatus, type PatientLocationInfo, type PatientMedicalInfo, type PatientProfile, type PatientProfileComplete, type PatientProfileInfo, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, PatientRequirementsService, type PatientSensitiveInfo, PatientService, PaymentStatus, type PostRequirementNotification, PracticeType, type Practitioner, type PractitionerBasicInfo, type PractitionerCertification, type PractitionerClinicProcedures, type PractitionerClinicWorkingHours, type PractitionerProfileInfo, type PractitionerReview, type PractitionerReviewInfo, PractitionerService, PractitionerStatus, type PractitionerToken, PractitionerTokenStatus, type PractitionerWorkingHours, type PreRequirementNotification, PricingMeasure, type Procedure, type ProcedureCategorization, ProcedureFamily, type ProcedureInfo, type ProcedureReview, type ProcedureReviewInfo, ProcedureService, type Product, ProductService, REGISTER_TOKENS_COLLECTION, REVIEWS_COLLECTION, type RatingScaleElement, type RequesterInfo, type Requirement, RequirementType, type Review, ReviewService, SYNCED_CALENDARS_COLLECTION, type SearchAppointmentsParams, type SearchCalendarEventsParams, SearchLocationEnum, type SearchPatientsParams, type SignatureElement, type SingleChoiceElement, type Subcategory, SubcategoryService, SubscriptionModel, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, type Technology, type TechnologyDocumentationTemplate, TechnologyService, type TextInputElement, type TimeSlot, TimeUnit, TreatmentBenefit, USER_ERRORS, USER_FORMS_SUBCOLLECTION, type UpdateAllergyData, type UpdateAppointmentData, type UpdateAppointmentParams, type UpdateBlockingConditionData, type UpdateCalendarEventData, type UpdateClinicAdminData, type UpdateClinicData, type UpdateClinicGroupData, type UpdateContraindicationData, type UpdateDocumentTemplateData, type UpdateMedicationData, type UpdatePatientLocationInfoData, type UpdatePatientMedicalInfoData, type UpdatePatientProfileData, type UpdatePatientSensitiveInfoData, type UpdatePractitionerData, type UpdateProcedureData, type UpdateSyncedCalendarData, type UpdateVitalStatsData, type User, UserRole, UserService, type ValidationSchema, type VitalStats, type WorkingHours, addAllergySchema, addBlockingConditionSchema, addContraindicationSchema, addMedicationSchema, addressDataSchema, adminInfoSchema, adminTokenSchema, allergySchema, allergySubtypeSchema, appointmentNotificationSchema, appointmentReminderNotificationSchema, baseNotificationSchema, blockingConditionSchema, calendarEventSchema, calendarEventTimeSchema, clinicAdminOptionsSchema, clinicAdminSchema, clinicAdminSignupSchema, clinicBranchSetupSchema, clinicContactInfoSchema, clinicGroupSchema, clinicGroupSetupSchema, clinicLocationSchema, clinicReviewInfoSchema, clinicReviewSchema, clinicSchema, clinicTagsSchema, contactPersonSchema, contraindicationSchema, createAdminTokenSchema, createAppointmentSchema, createCalendarEventSchema, createClinicAdminSchema, createClinicGroupSchema, createClinicReviewSchema, createClinicSchema, createDefaultClinicGroupSchema, createDocumentTemplateSchema, createDraftPractitionerSchema, createFilledDocumentDataSchema, createPatientLocationInfoSchema, createPatientMedicalInfoSchema, createPatientProfileSchema, createPatientSensitiveInfoSchema, createPractitionerReviewSchema, createPractitionerSchema, createPractitionerTokenSchema, createProcedureReviewSchema, createReviewSchema, createUserOptionsSchema, documentElementSchema, documentElementWithoutIdSchema, documentTemplateSchema, emailSchema, emergencyContactSchema, filledDocumentSchema, filledDocumentStatusSchema, gamificationSchema, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseInstance, initializeFirebase, locationDataSchema, medicationSchema, notificationSchema, passwordSchema, patientClinicSchema, patientDoctorSchema, patientLocationInfoSchema, patientMedicalInfoSchema, patientProfileInfoSchema, patientProfileSchema, patientSensitiveInfoSchema, postRequirementNotificationSchema, practitionerBasicInfoSchema, practitionerCertificationSchema, practitionerClinicWorkingHoursSchema, practitionerProfileInfoSchema, practitionerReviewInfoSchema, practitionerReviewSchema, practitionerSchema, practitionerSignupSchema, practitionerTokenSchema, practitionerWorkingHoursSchema, preRequirementNotificationSchema, procedureCategorizationSchema, procedureInfoSchema, procedureReviewInfoSchema, procedureReviewSchema, requesterInfoSchema, requirementInstructionDueNotificationSchema, reviewSchema, searchAppointmentsSchema, searchPatientsSchema, syncedCalendarEventSchema, timeSlotSchema, timestampSchema, updateAllergySchema, updateAppointmentSchema, updateBlockingConditionSchema, updateCalendarEventSchema, updateClinicAdminSchema, updateClinicGroupSchema, updateClinicSchema, updateContraindicationSchema, updateDocumentTemplateSchema, updateFilledDocumentDataSchema, updateMedicationSchema, updatePatientMedicalInfoSchema, updateVitalStatsSchema, userRoleSchema, userRolesSchema, userSchema, vitalStatsSchema, workingHoursSchema };
19408
+ export { APPOINTMENTS_COLLECTION, AUTH_ERRORS, type AddAllergyData, type AddBlockingConditionData, type AddContraindicationData, type AddMedicationData, type AddressData, type AdminInfo, type AdminToken, AdminTokenStatus, type Allergy, type AllergySubtype, AllergyType, type AllergyTypeWithSubtype, type Appointment, type AppointmentReminderNotification, AppointmentService, AppointmentStatus, AuthError, AuthService, type BaseDocumentElement, type BaseNotification, type BinaryChoiceElement, BlockingCondition, type Brand, BrandService, CALENDAR_COLLECTION, CLINICS_COLLECTION, CLINIC_ADMINS_COLLECTION, CLINIC_GROUPS_COLLECTION, type CalendarEvent, CalendarEventStatus, type CalendarEventTime, CalendarEventType, CalendarServiceV2, CalendarSyncStatus, type Category, CategoryService, CertificationLevel, CertificationSpecialty, type Clinic, type ClinicAdmin, ClinicAdminService, type ClinicAdminSignupData, type ClinicBranchSetupData, type ClinicContactInfo, type ClinicGroup, ClinicGroupService, type ClinicGroupSetupData, type ClinicInfo, type ClinicLocation, ClinicPhotoTag, type ClinicReview, type ClinicReviewInfo, ClinicService, ClinicTag, type ClinicTags, type ContactPerson, Contraindication, CosmeticAllergySubtype, type CreateAdminTokenData, type CreateAppointmentData, type CreateAppointmentHttpData, type CreateAppointmentParams, type CreateCalendarEventData, type CreateClinicAdminData, type CreateClinicData, type CreateClinicGroupData, type CreateDefaultClinicGroupData, type CreateDocumentTemplateData, type CreateDraftPractitionerData, type CreatePatientLocationInfoData, type CreatePatientMedicalInfoData, type CreatePatientProfileData, type CreatePatientSensitiveInfoData, type CreatePractitionerData, type CreatePractitionerTokenData, type CreateProcedureData, type CreateSyncedCalendarData, type CreateUserData, Currency, DOCTOR_FORMS_SUBCOLLECTION, DOCUMENTATION_TEMPLATES_COLLECTION, type DatePickerElement, type DateRange, type DigitalSignatureElement, type DoctorInfo, type DocumentElement, DocumentElementType, type DocumentTemplate, DocumentationTemplateService, type DynamicTextElement, DynamicVariable, type EmergencyContact, EnvironmentalAllergySubtype, FILLED_DOCUMENTS_COLLECTION, type FileUploadElement, type FilledDocument, FilledDocumentService, FilledDocumentStatus, FirebaseErrorCode, type FirebaseUser, FoodAllergySubtype, type GamificationInfo, Gender, type HeadingElement, HeadingLevel, Language, type ListElement, ListType, type LocationData, MEDIA_METADATA_COLLECTION, MediaAccessLevel, type MediaMetadata, type MediaResource, MediaService, MedicationAllergySubtype, type MultipleChoiceElement, type Notification, NotificationService, NotificationStatus, NotificationType, PATIENTS_COLLECTION, PATIENT_APPOINTMENTS_COLLECTION, PATIENT_LOCATION_INFO_COLLECTION, PATIENT_MEDICAL_HISTORY_COLLECTION, PATIENT_MEDICAL_INFO_COLLECTION, PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONERS_COLLECTION, PROCEDURES_COLLECTION, type ParagraphElement, type PatientClinic, type PatientDoctor, PatientInstructionStatus, type PatientLocationInfo, type PatientMedicalInfo, type PatientProfile, type PatientProfileComplete, type PatientProfileInfo, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, PatientRequirementsService, type PatientSensitiveInfo, PatientService, PaymentStatus, type PostRequirementNotification, PracticeType, type Practitioner, type PractitionerBasicInfo, type PractitionerCertification, type PractitionerClinicProcedures, type PractitionerClinicWorkingHours, type PractitionerProfileInfo, type PractitionerReview, type PractitionerReviewInfo, PractitionerService, PractitionerStatus, type PractitionerToken, PractitionerTokenStatus, type PractitionerWorkingHours, type PreRequirementNotification, PricingMeasure, type Procedure, type ProcedureCategorization, ProcedureFamily, type ProcedureInfo, type ProcedureReview, type ProcedureReviewInfo, ProcedureService, type Product, ProductService, REGISTER_TOKENS_COLLECTION, REVIEWS_COLLECTION, type RatingScaleElement, type RequesterInfo, type Requirement, RequirementType, type Review, ReviewService, SYNCED_CALENDARS_COLLECTION, type SearchAppointmentsParams, type SearchCalendarEventsParams, SearchLocationEnum, type SearchPatientsParams, type SignatureElement, type SingleChoiceElement, type Subcategory, SubcategoryService, SubscriptionModel, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, type Technology, type TechnologyDocumentationTemplate, TechnologyService, type TextInputElement, type TimeSlot, TimeUnit, TreatmentBenefit, USER_ERRORS, USER_FORMS_SUBCOLLECTION, type UpdateAllergyData, type UpdateAppointmentData, type UpdateAppointmentParams, type UpdateBlockingConditionData, type UpdateCalendarEventData, type UpdateClinicAdminData, type UpdateClinicData, type UpdateClinicGroupData, type UpdateContraindicationData, type UpdateDocumentTemplateData, type UpdateMedicationData, type UpdatePatientLocationInfoData, type UpdatePatientMedicalInfoData, type UpdatePatientProfileData, type UpdatePatientSensitiveInfoData, type UpdatePractitionerData, type UpdateProcedureData, type UpdateSyncedCalendarData, type UpdateVitalStatsData, type User, UserRole, UserService, type ValidationSchema, type VitalStats, type WorkingHours, addAllergySchema, addBlockingConditionSchema, addContraindicationSchema, addMedicationSchema, addressDataSchema, adminInfoSchema, adminTokenSchema, allergySchema, allergySubtypeSchema, appointmentNotificationSchema, appointmentReminderNotificationSchema, baseNotificationSchema, blockingConditionSchema, calendarEventSchema, calendarEventTimeSchema, clinicAdminOptionsSchema, clinicAdminSchema, clinicAdminSignupSchema, clinicBranchSetupSchema, clinicContactInfoSchema, clinicGroupSchema, clinicGroupSetupSchema, clinicLocationSchema, clinicReviewInfoSchema, clinicReviewSchema, clinicSchema, clinicTagsSchema, contactPersonSchema, contraindicationSchema, createAdminTokenSchema, createAppointmentSchema, createCalendarEventSchema, createClinicAdminSchema, createClinicGroupSchema, createClinicReviewSchema, createClinicSchema, createDefaultClinicGroupSchema, createDocumentTemplateSchema, createDraftPractitionerSchema, createFilledDocumentDataSchema, createPatientLocationInfoSchema, createPatientMedicalInfoSchema, createPatientProfileSchema, createPatientSensitiveInfoSchema, createPractitionerReviewSchema, createPractitionerSchema, createPractitionerTokenSchema, createProcedureReviewSchema, createReviewSchema, createUserOptionsSchema, documentElementSchema, documentElementWithoutIdSchema, documentTemplateSchema, emailSchema, emergencyContactSchema, filledDocumentSchema, filledDocumentStatusSchema, gamificationSchema, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseInstance, initializeFirebase, locationDataSchema, medicationSchema, notificationSchema, passwordSchema, patientClinicSchema, patientDoctorSchema, patientLocationInfoSchema, patientMedicalInfoSchema, patientProfileInfoSchema, patientProfileSchema, patientSensitiveInfoSchema, postRequirementNotificationSchema, practitionerBasicInfoSchema, practitionerCertificationSchema, practitionerClinicWorkingHoursSchema, practitionerProfileInfoSchema, practitionerReviewInfoSchema, practitionerReviewSchema, practitionerSchema, practitionerSignupSchema, practitionerTokenSchema, practitionerWorkingHoursSchema, preRequirementNotificationSchema, procedureCategorizationSchema, procedureInfoSchema, procedureReviewInfoSchema, procedureReviewSchema, requesterInfoSchema, requirementInstructionDueNotificationSchema, reviewSchema, searchAppointmentsSchema, searchPatientsSchema, syncedCalendarEventSchema, timeSlotSchema, timestampSchema, updateAllergySchema, updateAppointmentSchema, updateBlockingConditionSchema, updateCalendarEventSchema, updateClinicAdminSchema, updateClinicGroupSchema, updateClinicSchema, updateContraindicationSchema, updateDocumentTemplateSchema, updateFilledDocumentDataSchema, updateMedicationSchema, updatePatientMedicalInfoSchema, updateVitalStatsSchema, userRoleSchema, userRolesSchema, userSchema, vitalStatsSchema, workingHoursSchema };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { z } from 'zod';
2
- import { Timestamp, FieldValue, Firestore, QueryDocumentSnapshot, DocumentSnapshot } from 'firebase/firestore';
2
+ import { Firestore, Timestamp, FieldValue, QueryDocumentSnapshot, DocumentSnapshot } from 'firebase/firestore';
3
3
  import { Timestamp as Timestamp$1 } from 'firebase-admin/firestore';
4
- import { FirebaseApp } from 'firebase/app';
5
4
  import { Auth, User as User$1 } from 'firebase/auth';
6
- import { Analytics } from 'firebase/analytics';
5
+ import { FirebaseApp } from 'firebase/app';
7
6
  import { FirebaseStorage } from 'firebase/storage';
7
+ import { Analytics } from 'firebase/analytics';
8
8
  import { Functions } from 'firebase/functions';
9
9
  import * as _firebase_firestore from '@firebase/firestore';
10
10
 
@@ -749,6 +749,102 @@ declare enum ClinicPhotoTag {
749
749
  OTHER = "other"
750
750
  }
751
751
 
752
+ declare class BaseService {
753
+ protected db: Firestore;
754
+ protected auth: Auth;
755
+ protected app: FirebaseApp;
756
+ protected storage: FirebaseStorage;
757
+ constructor(db: Firestore, auth: Auth, app: FirebaseApp);
758
+ /**
759
+ * Generiše jedinstveni ID za dokumente
760
+ * Format: xxxxxxxxxxxx-timestamp
761
+ * Gde je x random karakter (broj ili slovo)
762
+ */
763
+ protected generateId(): string;
764
+ }
765
+
766
+ /**
767
+ * Enum for media access levels
768
+ */
769
+ declare enum MediaAccessLevel {
770
+ PUBLIC = "public",
771
+ PRIVATE = "private",
772
+ CONFIDENTIAL = "confidential"
773
+ }
774
+ /**
775
+ * Type that allows a field to be either a URL string or a File object
776
+ */
777
+ type MediaResource = string | File | Blob;
778
+ /**
779
+ * Media file metadata interface
780
+ */
781
+ interface MediaMetadata {
782
+ id: string;
783
+ name: string;
784
+ url: string;
785
+ contentType: string;
786
+ size: number;
787
+ createdAt: Timestamp;
788
+ accessLevel: MediaAccessLevel;
789
+ ownerId: string;
790
+ collectionName: string;
791
+ path: string;
792
+ updatedAt?: Timestamp;
793
+ }
794
+ declare const MEDIA_METADATA_COLLECTION = "media_metadata";
795
+ declare class MediaService extends BaseService {
796
+ constructor(db: Firestore, auth: Auth, app: FirebaseApp);
797
+ /**
798
+ * Upload a media file, store its metadata, and return the metadata including the URL.
799
+ * @param file - The file to upload.
800
+ * @param ownerId - ID of the owner (user, patient, clinic, etc.).
801
+ * @param accessLevel - Access level (public, private, confidential).
802
+ * @param collectionName - The logical collection name this media belongs to (e.g., 'patient_profile_pictures', 'clinic_logos').
803
+ * @param originalFileName - Optional: the original name of the file, if not using file.name.
804
+ * @returns Promise with the media metadata.
805
+ */
806
+ uploadMedia(file: File | Blob, ownerId: string, accessLevel: MediaAccessLevel, collectionName: string, originalFileName?: string): Promise<MediaMetadata>;
807
+ /**
808
+ * Get media metadata from Firestore by its ID.
809
+ * @param mediaId - ID of the media.
810
+ * @returns Promise with the media metadata or null if not found.
811
+ */
812
+ getMediaMetadata(mediaId: string): Promise<MediaMetadata | null>;
813
+ /**
814
+ * Get media metadata from Firestore by its public URL.
815
+ * @param url - The public URL of the media file.
816
+ * @returns Promise with the media metadata or null if not found.
817
+ */
818
+ getMediaMetadataByUrl(url: string): Promise<MediaMetadata | null>;
819
+ /**
820
+ * Delete media from storage and remove metadata from Firestore.
821
+ * @param mediaId - ID of the media to delete.
822
+ */
823
+ deleteMedia(mediaId: string): Promise<void>;
824
+ /**
825
+ * Update media access level. This involves moving the file in Firebase Storage
826
+ * to a new path reflecting the new access level, and updating its metadata.
827
+ * @param mediaId - ID of the media to update.
828
+ * @param newAccessLevel - New access level.
829
+ * @returns Promise with the updated media metadata, or null if metadata not found.
830
+ */
831
+ updateMediaAccessLevel(mediaId: string, newAccessLevel: MediaAccessLevel): Promise<MediaMetadata | null>;
832
+ /**
833
+ * List all media for an owner, optionally filtered by collection and access level.
834
+ * @param ownerId - ID of the owner.
835
+ * @param collectionName - Optional: Filter by collection name.
836
+ * @param accessLevel - Optional: Filter by access level.
837
+ * @param count - Optional: Number of items to fetch.
838
+ * @param startAfterId - Optional: ID of the document to start after (for pagination).
839
+ */
840
+ listMedia(ownerId: string, collectionName?: string, accessLevel?: MediaAccessLevel, count?: number, startAfterId?: string): Promise<MediaMetadata[]>;
841
+ /**
842
+ * Get download URL for media. (Convenience, as URL is in metadata)
843
+ * @param mediaId - ID of the media.
844
+ */
845
+ getMediaDownloadUrl(mediaId: string): Promise<string | null>;
846
+ }
847
+
752
848
  declare const CLINIC_GROUPS_COLLECTION = "clinic_groups";
753
849
  declare const CLINIC_ADMINS_COLLECTION = "clinic_admins";
754
850
  declare const CLINICS_COLLECTION = "clinics";
@@ -988,10 +1084,6 @@ interface DoctorInfo {
988
1084
  rating: number;
989
1085
  services: string[];
990
1086
  }
991
- /**
992
- * Type that allows a field to be either a URL string or a File object
993
- */
994
- type MediaResource = string | File | Blob;
995
1087
  /**
996
1088
  * Interface for clinic
997
1089
  */
@@ -3928,20 +4020,6 @@ declare const updateFilledDocumentDataSchema: z.ZodObject<{
3928
4020
  values?: Record<string, any> | undefined;
3929
4021
  }>;
3930
4022
 
3931
- declare class BaseService {
3932
- protected db: Firestore;
3933
- protected auth: Auth;
3934
- protected app: FirebaseApp;
3935
- protected storage: FirebaseStorage;
3936
- constructor(db: Firestore, auth: Auth, app: FirebaseApp);
3937
- /**
3938
- * Generiše jedinstveni ID za dokumente
3939
- * Format: xxxxxxxxxxxx-timestamp
3940
- * Gde je x random karakter (broj ili slovo)
3941
- */
3942
- protected generateId(): string;
3943
- }
3944
-
3945
4023
  /**
3946
4024
  * Servis za upravljanje kategorijama procedura.
3947
4025
  * Kategorije su prvi nivo organizacije nakon procedure family (aesthetics/surgery).
@@ -5013,17 +5091,17 @@ declare const searchAppointmentsSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
5013
5091
  patientId?: string | undefined;
5014
5092
  startDate?: any;
5015
5093
  endDate?: any;
5016
- practitionerId?: string | undefined;
5017
5094
  startAfter?: any;
5095
+ practitionerId?: string | undefined;
5018
5096
  clinicBranchId?: string | undefined;
5019
5097
  }, {
5020
5098
  status?: AppointmentStatus | [AppointmentStatus, ...AppointmentStatus[]] | undefined;
5021
5099
  patientId?: string | undefined;
5022
5100
  startDate?: any;
5023
5101
  endDate?: any;
5024
- practitionerId?: string | undefined;
5025
5102
  limit?: number | undefined;
5026
5103
  startAfter?: any;
5104
+ practitionerId?: string | undefined;
5027
5105
  clinicBranchId?: string | undefined;
5028
5106
  }>, {
5029
5107
  limit: number;
@@ -5031,17 +5109,17 @@ declare const searchAppointmentsSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
5031
5109
  patientId?: string | undefined;
5032
5110
  startDate?: any;
5033
5111
  endDate?: any;
5034
- practitionerId?: string | undefined;
5035
5112
  startAfter?: any;
5113
+ practitionerId?: string | undefined;
5036
5114
  clinicBranchId?: string | undefined;
5037
5115
  }, {
5038
5116
  status?: AppointmentStatus | [AppointmentStatus, ...AppointmentStatus[]] | undefined;
5039
5117
  patientId?: string | undefined;
5040
5118
  startDate?: any;
5041
5119
  endDate?: any;
5042
- practitionerId?: string | undefined;
5043
5120
  limit?: number | undefined;
5044
5121
  startAfter?: any;
5122
+ practitionerId?: string | undefined;
5045
5123
  clinicBranchId?: string | undefined;
5046
5124
  }>, {
5047
5125
  limit: number;
@@ -5049,17 +5127,17 @@ declare const searchAppointmentsSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
5049
5127
  patientId?: string | undefined;
5050
5128
  startDate?: any;
5051
5129
  endDate?: any;
5052
- practitionerId?: string | undefined;
5053
5130
  startAfter?: any;
5131
+ practitionerId?: string | undefined;
5054
5132
  clinicBranchId?: string | undefined;
5055
5133
  }, {
5056
5134
  status?: AppointmentStatus | [AppointmentStatus, ...AppointmentStatus[]] | undefined;
5057
5135
  patientId?: string | undefined;
5058
5136
  startDate?: any;
5059
5137
  endDate?: any;
5060
- practitionerId?: string | undefined;
5061
5138
  limit?: number | undefined;
5062
5139
  startAfter?: any;
5140
+ practitionerId?: string | undefined;
5063
5141
  clinicBranchId?: string | undefined;
5064
5142
  }>;
5065
5143
 
@@ -5539,83 +5617,6 @@ declare class ClinicGroupService extends BaseService {
5539
5617
  getActiveAdminTokens(groupId: string, adminId: string): Promise<AdminToken[]>;
5540
5618
  }
5541
5619
 
5542
- /**
5543
- * Enum for media access levels
5544
- */
5545
- declare enum MediaAccessLevel {
5546
- PUBLIC = "public",
5547
- PRIVATE = "private",
5548
- CONFIDENTIAL = "confidential"
5549
- }
5550
- /**
5551
- * Media file metadata interface
5552
- */
5553
- interface MediaMetadata {
5554
- id: string;
5555
- name: string;
5556
- url: string;
5557
- contentType: string;
5558
- size: number;
5559
- createdAt: Timestamp;
5560
- accessLevel: MediaAccessLevel;
5561
- ownerId: string;
5562
- collectionName: string;
5563
- path: string;
5564
- updatedAt?: Timestamp;
5565
- }
5566
- declare class MediaService extends BaseService {
5567
- constructor(db: Firestore, auth: Auth, app: FirebaseApp);
5568
- /**
5569
- * Upload a media file, store its metadata, and return the metadata including the URL.
5570
- * @param file - The file to upload.
5571
- * @param ownerId - ID of the owner (user, patient, clinic, etc.).
5572
- * @param accessLevel - Access level (public, private, confidential).
5573
- * @param collectionName - The logical collection name this media belongs to (e.g., 'patient_profile_pictures', 'clinic_logos').
5574
- * @param originalFileName - Optional: the original name of the file, if not using file.name.
5575
- * @returns Promise with the media metadata.
5576
- */
5577
- uploadMedia(file: File | Blob, ownerId: string, accessLevel: MediaAccessLevel, collectionName: string, originalFileName?: string): Promise<MediaMetadata>;
5578
- /**
5579
- * Get media metadata from Firestore by its ID.
5580
- * @param mediaId - ID of the media.
5581
- * @returns Promise with the media metadata or null if not found.
5582
- */
5583
- getMediaMetadata(mediaId: string): Promise<MediaMetadata | null>;
5584
- /**
5585
- * Get media metadata from Firestore by its public URL.
5586
- * @param url - The public URL of the media file.
5587
- * @returns Promise with the media metadata or null if not found.
5588
- */
5589
- getMediaMetadataByUrl(url: string): Promise<MediaMetadata | null>;
5590
- /**
5591
- * Delete media from storage and remove metadata from Firestore.
5592
- * @param mediaId - ID of the media to delete.
5593
- */
5594
- deleteMedia(mediaId: string): Promise<void>;
5595
- /**
5596
- * Update media access level. This involves moving the file in Firebase Storage
5597
- * to a new path reflecting the new access level, and updating its metadata.
5598
- * @param mediaId - ID of the media to update.
5599
- * @param newAccessLevel - New access level.
5600
- * @returns Promise with the updated media metadata, or null if metadata not found.
5601
- */
5602
- updateMediaAccessLevel(mediaId: string, newAccessLevel: MediaAccessLevel): Promise<MediaMetadata | null>;
5603
- /**
5604
- * List all media for an owner, optionally filtered by collection and access level.
5605
- * @param ownerId - ID of the owner.
5606
- * @param collectionName - Optional: Filter by collection name.
5607
- * @param accessLevel - Optional: Filter by access level.
5608
- * @param count - Optional: Number of items to fetch.
5609
- * @param startAfterId - Optional: ID of the document to start after (for pagination).
5610
- */
5611
- listMedia(ownerId: string, collectionName?: string, accessLevel?: MediaAccessLevel, count?: number, startAfterId?: string): Promise<MediaMetadata[]>;
5612
- /**
5613
- * Get download URL for media. (Convenience, as URL is in metadata)
5614
- * @param mediaId - ID of the media.
5615
- */
5616
- getMediaDownloadUrl(mediaId: string): Promise<string | null>;
5617
- }
5618
-
5619
5620
  declare class ClinicService extends BaseService {
5620
5621
  private clinicGroupService;
5621
5622
  private clinicAdminService;
@@ -6128,8 +6129,8 @@ declare class AuthService extends BaseService {
6128
6129
  signUpPractitioner(data: {
6129
6130
  email: string;
6130
6131
  password: string;
6131
- firstName: string;
6132
- lastName: string;
6132
+ firstName?: string;
6133
+ lastName?: string;
6133
6134
  token?: string;
6134
6135
  profileData?: Partial<CreatePractitionerData>;
6135
6136
  }): Promise<{
@@ -13128,8 +13129,8 @@ declare const createPractitionerTokenSchema: z.ZodObject<{
13128
13129
  declare const practitionerSignupSchema: z.ZodObject<{
13129
13130
  email: z.ZodString;
13130
13131
  password: z.ZodString;
13131
- firstName: z.ZodString;
13132
- lastName: z.ZodString;
13132
+ firstName: z.ZodOptional<z.ZodString>;
13133
+ lastName: z.ZodOptional<z.ZodString>;
13133
13134
  token: z.ZodOptional<z.ZodString>;
13134
13135
  profileData: z.ZodOptional<z.ZodObject<{
13135
13136
  basicInfo: z.ZodOptional<z.ZodObject<{
@@ -13167,10 +13168,10 @@ declare const practitionerSignupSchema: z.ZodObject<{
13167
13168
  certification?: any;
13168
13169
  }>>;
13169
13170
  }, "strip", z.ZodTypeAny, {
13170
- firstName: string;
13171
- lastName: string;
13172
13171
  email: string;
13173
13172
  password: string;
13173
+ firstName?: string | undefined;
13174
+ lastName?: string | undefined;
13174
13175
  token?: string | undefined;
13175
13176
  profileData?: {
13176
13177
  basicInfo?: {
@@ -13182,10 +13183,10 @@ declare const practitionerSignupSchema: z.ZodObject<{
13182
13183
  certification?: any;
13183
13184
  } | undefined;
13184
13185
  }, {
13185
- firstName: string;
13186
- lastName: string;
13187
13186
  email: string;
13188
13187
  password: string;
13188
+ firstName?: string | undefined;
13189
+ lastName?: string | undefined;
13189
13190
  token?: string | undefined;
13190
13191
  profileData?: {
13191
13192
  basicInfo?: {
@@ -14079,6 +14080,7 @@ declare const clinicGroupSchema: z.ZodObject<{
14079
14080
  featuredPhoto: string;
14080
14081
  description?: string | null | undefined;
14081
14082
  }[];
14083
+ ownerId: string | null;
14082
14084
  contactInfo: {
14083
14085
  email: string;
14084
14086
  phoneNumber: string;
@@ -14101,7 +14103,6 @@ declare const clinicGroupSchema: z.ZodObject<{
14101
14103
  phoneNumber?: string | null | undefined;
14102
14104
  title?: string | null | undefined;
14103
14105
  };
14104
- ownerId: string | null;
14105
14106
  subscriptionModel: SubscriptionModel;
14106
14107
  admins: string[];
14107
14108
  adminsInfo: {
@@ -14153,6 +14154,7 @@ declare const clinicGroupSchema: z.ZodObject<{
14153
14154
  featuredPhoto: string;
14154
14155
  description?: string | null | undefined;
14155
14156
  }[];
14157
+ ownerId: string | null;
14156
14158
  contactInfo: {
14157
14159
  email: string;
14158
14160
  phoneNumber: string;
@@ -14175,7 +14177,6 @@ declare const clinicGroupSchema: z.ZodObject<{
14175
14177
  phoneNumber?: string | null | undefined;
14176
14178
  title?: string | null | undefined;
14177
14179
  };
14178
- ownerId: string | null;
14179
14180
  subscriptionModel: SubscriptionModel;
14180
14181
  admins: string[];
14181
14182
  adminsInfo: {
@@ -15079,6 +15080,7 @@ declare const createClinicGroupSchema: z.ZodObject<{
15079
15080
  }, "strip", z.ZodTypeAny, {
15080
15081
  name: string;
15081
15082
  isActive: boolean;
15083
+ ownerId: string | null;
15082
15084
  contactInfo: {
15083
15085
  email: string;
15084
15086
  phoneNumber: string;
@@ -15101,7 +15103,6 @@ declare const createClinicGroupSchema: z.ZodObject<{
15101
15103
  phoneNumber?: string | null | undefined;
15102
15104
  title?: string | null | undefined;
15103
15105
  };
15104
- ownerId: string | null;
15105
15106
  subscriptionModel: SubscriptionModel;
15106
15107
  description?: string | undefined;
15107
15108
  logo?: string | File | Blob | null | undefined;
@@ -15113,6 +15114,7 @@ declare const createClinicGroupSchema: z.ZodObject<{
15113
15114
  }, {
15114
15115
  name: string;
15115
15116
  isActive: boolean;
15117
+ ownerId: string | null;
15116
15118
  contactInfo: {
15117
15119
  email: string;
15118
15120
  phoneNumber: string;
@@ -15135,7 +15137,6 @@ declare const createClinicGroupSchema: z.ZodObject<{
15135
15137
  phoneNumber?: string | null | undefined;
15136
15138
  title?: string | null | undefined;
15137
15139
  };
15138
- ownerId: string | null;
15139
15140
  description?: string | undefined;
15140
15141
  logo?: string | File | Blob | null | undefined;
15141
15142
  practiceType?: PracticeType | undefined;
@@ -15867,6 +15868,7 @@ declare const createDefaultClinicGroupSchema: z.ZodObject<{
15867
15868
  }, "strip", z.ZodTypeAny, {
15868
15869
  name: string;
15869
15870
  isActive: boolean;
15871
+ ownerId: string | null;
15870
15872
  contactInfo: {
15871
15873
  email: string;
15872
15874
  phoneNumber: string;
@@ -15889,7 +15891,6 @@ declare const createDefaultClinicGroupSchema: z.ZodObject<{
15889
15891
  phoneNumber?: string | null | undefined;
15890
15892
  title?: string | null | undefined;
15891
15893
  };
15892
- ownerId: string | null;
15893
15894
  subscriptionModel: SubscriptionModel;
15894
15895
  logo?: string | File | Blob | null | undefined;
15895
15896
  practiceType?: PracticeType | undefined;
@@ -15897,6 +15898,7 @@ declare const createDefaultClinicGroupSchema: z.ZodObject<{
15897
15898
  }, {
15898
15899
  name: string;
15899
15900
  isActive: boolean;
15901
+ ownerId: string | null;
15900
15902
  contactInfo: {
15901
15903
  email: string;
15902
15904
  phoneNumber: string;
@@ -15919,7 +15921,6 @@ declare const createDefaultClinicGroupSchema: z.ZodObject<{
15919
15921
  phoneNumber?: string | null | undefined;
15920
15922
  title?: string | null | undefined;
15921
15923
  };
15922
- ownerId: string | null;
15923
15924
  logo?: string | File | Blob | null | undefined;
15924
15925
  practiceType?: PracticeType | undefined;
15925
15926
  languages?: Language[] | undefined;
@@ -16787,6 +16788,7 @@ declare const updateClinicGroupSchema: z.ZodObject<{
16787
16788
  name?: string | undefined;
16788
16789
  isActive?: boolean | undefined;
16789
16790
  description?: string | undefined;
16791
+ ownerId?: string | null | undefined;
16790
16792
  contactInfo?: {
16791
16793
  email: string;
16792
16794
  phoneNumber: string;
@@ -16809,7 +16811,6 @@ declare const updateClinicGroupSchema: z.ZodObject<{
16809
16811
  phoneNumber?: string | null | undefined;
16810
16812
  title?: string | null | undefined;
16811
16813
  } | undefined;
16812
- ownerId?: string | null | undefined;
16813
16814
  logo?: string | File | Blob | null | undefined;
16814
16815
  practiceType?: PracticeType | undefined;
16815
16816
  languages?: Language[] | undefined;
@@ -16821,6 +16822,7 @@ declare const updateClinicGroupSchema: z.ZodObject<{
16821
16822
  name?: string | undefined;
16822
16823
  isActive?: boolean | undefined;
16823
16824
  description?: string | undefined;
16825
+ ownerId?: string | null | undefined;
16824
16826
  contactInfo?: {
16825
16827
  email: string;
16826
16828
  phoneNumber: string;
@@ -16843,7 +16845,6 @@ declare const updateClinicGroupSchema: z.ZodObject<{
16843
16845
  phoneNumber?: string | null | undefined;
16844
16846
  title?: string | null | undefined;
16845
16847
  } | undefined;
16846
- ownerId?: string | null | undefined;
16847
16848
  logo?: string | File | Blob | null | undefined;
16848
16849
  practiceType?: PracticeType | undefined;
16849
16850
  languages?: Language[] | undefined;
@@ -19404,4 +19405,4 @@ declare const createReviewSchema: z.ZodEffects<z.ZodObject<{
19404
19405
  } | undefined;
19405
19406
  }>;
19406
19407
 
19407
- export { APPOINTMENTS_COLLECTION, AUTH_ERRORS, type AddAllergyData, type AddBlockingConditionData, type AddContraindicationData, type AddMedicationData, type AddressData, type AdminInfo, type AdminToken, AdminTokenStatus, type Allergy, type AllergySubtype, AllergyType, type AllergyTypeWithSubtype, type Appointment, type AppointmentReminderNotification, AppointmentService, AppointmentStatus, AuthError, AuthService, type BaseDocumentElement, type BaseNotification, type BinaryChoiceElement, BlockingCondition, type Brand, BrandService, CALENDAR_COLLECTION, CLINICS_COLLECTION, CLINIC_ADMINS_COLLECTION, CLINIC_GROUPS_COLLECTION, type CalendarEvent, CalendarEventStatus, type CalendarEventTime, CalendarEventType, CalendarServiceV2, CalendarSyncStatus, type Category, CategoryService, CertificationLevel, CertificationSpecialty, type Clinic, type ClinicAdmin, ClinicAdminService, type ClinicAdminSignupData, type ClinicBranchSetupData, type ClinicContactInfo, type ClinicGroup, ClinicGroupService, type ClinicGroupSetupData, type ClinicInfo, type ClinicLocation, ClinicPhotoTag, type ClinicReview, type ClinicReviewInfo, ClinicService, ClinicTag, type ClinicTags, type ContactPerson, Contraindication, CosmeticAllergySubtype, type CreateAdminTokenData, type CreateAppointmentData, type CreateAppointmentHttpData, type CreateAppointmentParams, type CreateCalendarEventData, type CreateClinicAdminData, type CreateClinicData, type CreateClinicGroupData, type CreateDefaultClinicGroupData, type CreateDocumentTemplateData, type CreateDraftPractitionerData, type CreatePatientLocationInfoData, type CreatePatientMedicalInfoData, type CreatePatientProfileData, type CreatePatientSensitiveInfoData, type CreatePractitionerData, type CreatePractitionerTokenData, type CreateProcedureData, type CreateSyncedCalendarData, type CreateUserData, Currency, DOCTOR_FORMS_SUBCOLLECTION, DOCUMENTATION_TEMPLATES_COLLECTION, type DatePickerElement, type DateRange, type DigitalSignatureElement, type DoctorInfo, type DocumentElement, DocumentElementType, type DocumentTemplate, DocumentationTemplateService, type DynamicTextElement, DynamicVariable, type EmergencyContact, EnvironmentalAllergySubtype, FILLED_DOCUMENTS_COLLECTION, type FileUploadElement, type FilledDocument, FilledDocumentService, FilledDocumentStatus, FirebaseErrorCode, type FirebaseUser, FoodAllergySubtype, type GamificationInfo, Gender, type HeadingElement, HeadingLevel, Language, type ListElement, ListType, type LocationData, MedicationAllergySubtype, type MultipleChoiceElement, type Notification, NotificationService, NotificationStatus, NotificationType, PATIENTS_COLLECTION, PATIENT_APPOINTMENTS_COLLECTION, PATIENT_LOCATION_INFO_COLLECTION, PATIENT_MEDICAL_HISTORY_COLLECTION, PATIENT_MEDICAL_INFO_COLLECTION, PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONERS_COLLECTION, PROCEDURES_COLLECTION, type ParagraphElement, type PatientClinic, type PatientDoctor, PatientInstructionStatus, type PatientLocationInfo, type PatientMedicalInfo, type PatientProfile, type PatientProfileComplete, type PatientProfileInfo, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, PatientRequirementsService, type PatientSensitiveInfo, PatientService, PaymentStatus, type PostRequirementNotification, PracticeType, type Practitioner, type PractitionerBasicInfo, type PractitionerCertification, type PractitionerClinicProcedures, type PractitionerClinicWorkingHours, type PractitionerProfileInfo, type PractitionerReview, type PractitionerReviewInfo, PractitionerService, PractitionerStatus, type PractitionerToken, PractitionerTokenStatus, type PractitionerWorkingHours, type PreRequirementNotification, PricingMeasure, type Procedure, type ProcedureCategorization, ProcedureFamily, type ProcedureInfo, type ProcedureReview, type ProcedureReviewInfo, ProcedureService, type Product, ProductService, REGISTER_TOKENS_COLLECTION, REVIEWS_COLLECTION, type RatingScaleElement, type RequesterInfo, type Requirement, RequirementType, type Review, ReviewService, SYNCED_CALENDARS_COLLECTION, type SearchAppointmentsParams, type SearchCalendarEventsParams, SearchLocationEnum, type SearchPatientsParams, type SignatureElement, type SingleChoiceElement, type Subcategory, SubcategoryService, SubscriptionModel, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, type Technology, type TechnologyDocumentationTemplate, TechnologyService, type TextInputElement, type TimeSlot, TimeUnit, TreatmentBenefit, USER_ERRORS, USER_FORMS_SUBCOLLECTION, type UpdateAllergyData, type UpdateAppointmentData, type UpdateAppointmentParams, type UpdateBlockingConditionData, type UpdateCalendarEventData, type UpdateClinicAdminData, type UpdateClinicData, type UpdateClinicGroupData, type UpdateContraindicationData, type UpdateDocumentTemplateData, type UpdateMedicationData, type UpdatePatientLocationInfoData, type UpdatePatientMedicalInfoData, type UpdatePatientProfileData, type UpdatePatientSensitiveInfoData, type UpdatePractitionerData, type UpdateProcedureData, type UpdateSyncedCalendarData, type UpdateVitalStatsData, type User, UserRole, UserService, type ValidationSchema, type VitalStats, type WorkingHours, addAllergySchema, addBlockingConditionSchema, addContraindicationSchema, addMedicationSchema, addressDataSchema, adminInfoSchema, adminTokenSchema, allergySchema, allergySubtypeSchema, appointmentNotificationSchema, appointmentReminderNotificationSchema, baseNotificationSchema, blockingConditionSchema, calendarEventSchema, calendarEventTimeSchema, clinicAdminOptionsSchema, clinicAdminSchema, clinicAdminSignupSchema, clinicBranchSetupSchema, clinicContactInfoSchema, clinicGroupSchema, clinicGroupSetupSchema, clinicLocationSchema, clinicReviewInfoSchema, clinicReviewSchema, clinicSchema, clinicTagsSchema, contactPersonSchema, contraindicationSchema, createAdminTokenSchema, createAppointmentSchema, createCalendarEventSchema, createClinicAdminSchema, createClinicGroupSchema, createClinicReviewSchema, createClinicSchema, createDefaultClinicGroupSchema, createDocumentTemplateSchema, createDraftPractitionerSchema, createFilledDocumentDataSchema, createPatientLocationInfoSchema, createPatientMedicalInfoSchema, createPatientProfileSchema, createPatientSensitiveInfoSchema, createPractitionerReviewSchema, createPractitionerSchema, createPractitionerTokenSchema, createProcedureReviewSchema, createReviewSchema, createUserOptionsSchema, documentElementSchema, documentElementWithoutIdSchema, documentTemplateSchema, emailSchema, emergencyContactSchema, filledDocumentSchema, filledDocumentStatusSchema, gamificationSchema, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseInstance, initializeFirebase, locationDataSchema, medicationSchema, notificationSchema, passwordSchema, patientClinicSchema, patientDoctorSchema, patientLocationInfoSchema, patientMedicalInfoSchema, patientProfileInfoSchema, patientProfileSchema, patientSensitiveInfoSchema, postRequirementNotificationSchema, practitionerBasicInfoSchema, practitionerCertificationSchema, practitionerClinicWorkingHoursSchema, practitionerProfileInfoSchema, practitionerReviewInfoSchema, practitionerReviewSchema, practitionerSchema, practitionerSignupSchema, practitionerTokenSchema, practitionerWorkingHoursSchema, preRequirementNotificationSchema, procedureCategorizationSchema, procedureInfoSchema, procedureReviewInfoSchema, procedureReviewSchema, requesterInfoSchema, requirementInstructionDueNotificationSchema, reviewSchema, searchAppointmentsSchema, searchPatientsSchema, syncedCalendarEventSchema, timeSlotSchema, timestampSchema, updateAllergySchema, updateAppointmentSchema, updateBlockingConditionSchema, updateCalendarEventSchema, updateClinicAdminSchema, updateClinicGroupSchema, updateClinicSchema, updateContraindicationSchema, updateDocumentTemplateSchema, updateFilledDocumentDataSchema, updateMedicationSchema, updatePatientMedicalInfoSchema, updateVitalStatsSchema, userRoleSchema, userRolesSchema, userSchema, vitalStatsSchema, workingHoursSchema };
19408
+ export { APPOINTMENTS_COLLECTION, AUTH_ERRORS, type AddAllergyData, type AddBlockingConditionData, type AddContraindicationData, type AddMedicationData, type AddressData, type AdminInfo, type AdminToken, AdminTokenStatus, type Allergy, type AllergySubtype, AllergyType, type AllergyTypeWithSubtype, type Appointment, type AppointmentReminderNotification, AppointmentService, AppointmentStatus, AuthError, AuthService, type BaseDocumentElement, type BaseNotification, type BinaryChoiceElement, BlockingCondition, type Brand, BrandService, CALENDAR_COLLECTION, CLINICS_COLLECTION, CLINIC_ADMINS_COLLECTION, CLINIC_GROUPS_COLLECTION, type CalendarEvent, CalendarEventStatus, type CalendarEventTime, CalendarEventType, CalendarServiceV2, CalendarSyncStatus, type Category, CategoryService, CertificationLevel, CertificationSpecialty, type Clinic, type ClinicAdmin, ClinicAdminService, type ClinicAdminSignupData, type ClinicBranchSetupData, type ClinicContactInfo, type ClinicGroup, ClinicGroupService, type ClinicGroupSetupData, type ClinicInfo, type ClinicLocation, ClinicPhotoTag, type ClinicReview, type ClinicReviewInfo, ClinicService, ClinicTag, type ClinicTags, type ContactPerson, Contraindication, CosmeticAllergySubtype, type CreateAdminTokenData, type CreateAppointmentData, type CreateAppointmentHttpData, type CreateAppointmentParams, type CreateCalendarEventData, type CreateClinicAdminData, type CreateClinicData, type CreateClinicGroupData, type CreateDefaultClinicGroupData, type CreateDocumentTemplateData, type CreateDraftPractitionerData, type CreatePatientLocationInfoData, type CreatePatientMedicalInfoData, type CreatePatientProfileData, type CreatePatientSensitiveInfoData, type CreatePractitionerData, type CreatePractitionerTokenData, type CreateProcedureData, type CreateSyncedCalendarData, type CreateUserData, Currency, DOCTOR_FORMS_SUBCOLLECTION, DOCUMENTATION_TEMPLATES_COLLECTION, type DatePickerElement, type DateRange, type DigitalSignatureElement, type DoctorInfo, type DocumentElement, DocumentElementType, type DocumentTemplate, DocumentationTemplateService, type DynamicTextElement, DynamicVariable, type EmergencyContact, EnvironmentalAllergySubtype, FILLED_DOCUMENTS_COLLECTION, type FileUploadElement, type FilledDocument, FilledDocumentService, FilledDocumentStatus, FirebaseErrorCode, type FirebaseUser, FoodAllergySubtype, type GamificationInfo, Gender, type HeadingElement, HeadingLevel, Language, type ListElement, ListType, type LocationData, MEDIA_METADATA_COLLECTION, MediaAccessLevel, type MediaMetadata, type MediaResource, MediaService, MedicationAllergySubtype, type MultipleChoiceElement, type Notification, NotificationService, NotificationStatus, NotificationType, PATIENTS_COLLECTION, PATIENT_APPOINTMENTS_COLLECTION, PATIENT_LOCATION_INFO_COLLECTION, PATIENT_MEDICAL_HISTORY_COLLECTION, PATIENT_MEDICAL_INFO_COLLECTION, PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONERS_COLLECTION, PROCEDURES_COLLECTION, type ParagraphElement, type PatientClinic, type PatientDoctor, PatientInstructionStatus, type PatientLocationInfo, type PatientMedicalInfo, type PatientProfile, type PatientProfileComplete, type PatientProfileInfo, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, PatientRequirementsService, type PatientSensitiveInfo, PatientService, PaymentStatus, type PostRequirementNotification, PracticeType, type Practitioner, type PractitionerBasicInfo, type PractitionerCertification, type PractitionerClinicProcedures, type PractitionerClinicWorkingHours, type PractitionerProfileInfo, type PractitionerReview, type PractitionerReviewInfo, PractitionerService, PractitionerStatus, type PractitionerToken, PractitionerTokenStatus, type PractitionerWorkingHours, type PreRequirementNotification, PricingMeasure, type Procedure, type ProcedureCategorization, ProcedureFamily, type ProcedureInfo, type ProcedureReview, type ProcedureReviewInfo, ProcedureService, type Product, ProductService, REGISTER_TOKENS_COLLECTION, REVIEWS_COLLECTION, type RatingScaleElement, type RequesterInfo, type Requirement, RequirementType, type Review, ReviewService, SYNCED_CALENDARS_COLLECTION, type SearchAppointmentsParams, type SearchCalendarEventsParams, SearchLocationEnum, type SearchPatientsParams, type SignatureElement, type SingleChoiceElement, type Subcategory, SubcategoryService, SubscriptionModel, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, type Technology, type TechnologyDocumentationTemplate, TechnologyService, type TextInputElement, type TimeSlot, TimeUnit, TreatmentBenefit, USER_ERRORS, USER_FORMS_SUBCOLLECTION, type UpdateAllergyData, type UpdateAppointmentData, type UpdateAppointmentParams, type UpdateBlockingConditionData, type UpdateCalendarEventData, type UpdateClinicAdminData, type UpdateClinicData, type UpdateClinicGroupData, type UpdateContraindicationData, type UpdateDocumentTemplateData, type UpdateMedicationData, type UpdatePatientLocationInfoData, type UpdatePatientMedicalInfoData, type UpdatePatientProfileData, type UpdatePatientSensitiveInfoData, type UpdatePractitionerData, type UpdateProcedureData, type UpdateSyncedCalendarData, type UpdateVitalStatsData, type User, UserRole, UserService, type ValidationSchema, type VitalStats, type WorkingHours, addAllergySchema, addBlockingConditionSchema, addContraindicationSchema, addMedicationSchema, addressDataSchema, adminInfoSchema, adminTokenSchema, allergySchema, allergySubtypeSchema, appointmentNotificationSchema, appointmentReminderNotificationSchema, baseNotificationSchema, blockingConditionSchema, calendarEventSchema, calendarEventTimeSchema, clinicAdminOptionsSchema, clinicAdminSchema, clinicAdminSignupSchema, clinicBranchSetupSchema, clinicContactInfoSchema, clinicGroupSchema, clinicGroupSetupSchema, clinicLocationSchema, clinicReviewInfoSchema, clinicReviewSchema, clinicSchema, clinicTagsSchema, contactPersonSchema, contraindicationSchema, createAdminTokenSchema, createAppointmentSchema, createCalendarEventSchema, createClinicAdminSchema, createClinicGroupSchema, createClinicReviewSchema, createClinicSchema, createDefaultClinicGroupSchema, createDocumentTemplateSchema, createDraftPractitionerSchema, createFilledDocumentDataSchema, createPatientLocationInfoSchema, createPatientMedicalInfoSchema, createPatientProfileSchema, createPatientSensitiveInfoSchema, createPractitionerReviewSchema, createPractitionerSchema, createPractitionerTokenSchema, createProcedureReviewSchema, createReviewSchema, createUserOptionsSchema, documentElementSchema, documentElementWithoutIdSchema, documentTemplateSchema, emailSchema, emergencyContactSchema, filledDocumentSchema, filledDocumentStatusSchema, gamificationSchema, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseInstance, initializeFirebase, locationDataSchema, medicationSchema, notificationSchema, passwordSchema, patientClinicSchema, patientDoctorSchema, patientLocationInfoSchema, patientMedicalInfoSchema, patientProfileInfoSchema, patientProfileSchema, patientSensitiveInfoSchema, postRequirementNotificationSchema, practitionerBasicInfoSchema, practitionerCertificationSchema, practitionerClinicWorkingHoursSchema, practitionerProfileInfoSchema, practitionerReviewInfoSchema, practitionerReviewSchema, practitionerSchema, practitionerSignupSchema, practitionerTokenSchema, practitionerWorkingHoursSchema, preRequirementNotificationSchema, procedureCategorizationSchema, procedureInfoSchema, procedureReviewInfoSchema, procedureReviewSchema, requesterInfoSchema, requirementInstructionDueNotificationSchema, reviewSchema, searchAppointmentsSchema, searchPatientsSchema, syncedCalendarEventSchema, timeSlotSchema, timestampSchema, updateAllergySchema, updateAppointmentSchema, updateBlockingConditionSchema, updateCalendarEventSchema, updateClinicAdminSchema, updateClinicGroupSchema, updateClinicSchema, updateContraindicationSchema, updateDocumentTemplateSchema, updateFilledDocumentDataSchema, updateMedicationSchema, updatePatientMedicalInfoSchema, updateVitalStatsSchema, userRoleSchema, userRolesSchema, userSchema, vitalStatsSchema, workingHoursSchema };
package/dist/index.js CHANGED
@@ -73,6 +73,9 @@ __export(index_exports, {
73
73
  HeadingLevel: () => HeadingLevel,
74
74
  Language: () => Language,
75
75
  ListType: () => ListType,
76
+ MEDIA_METADATA_COLLECTION: () => MEDIA_METADATA_COLLECTION,
77
+ MediaAccessLevel: () => MediaAccessLevel,
78
+ MediaService: () => MediaService,
76
79
  MedicationAllergySubtype: () => MedicationAllergySubtype,
77
80
  NotificationService: () => NotificationService,
78
81
  NotificationStatus: () => NotificationStatus,
@@ -4183,8 +4186,8 @@ var createPractitionerTokenSchema = import_zod13.z.object({
4183
4186
  var practitionerSignupSchema = import_zod13.z.object({
4184
4187
  email: import_zod13.z.string().email(),
4185
4188
  password: import_zod13.z.string().min(8),
4186
- firstName: import_zod13.z.string().min(2).max(50),
4187
- lastName: import_zod13.z.string().min(2).max(50),
4189
+ firstName: import_zod13.z.string().min(2).max(50).optional(),
4190
+ lastName: import_zod13.z.string().min(2).max(50).optional(),
4188
4191
  token: import_zod13.z.string().optional(),
4189
4192
  profileData: import_zod13.z.object({
4190
4193
  basicInfo: import_zod13.z.object({
@@ -6477,6 +6480,12 @@ async function getClinicsByFilters(db, filters) {
6477
6480
  var import_firestore22 = require("firebase/firestore");
6478
6481
  var import_storage5 = require("firebase/storage");
6479
6482
  var import_firestore23 = require("firebase/firestore");
6483
+ var MediaAccessLevel = /* @__PURE__ */ ((MediaAccessLevel2) => {
6484
+ MediaAccessLevel2["PUBLIC"] = "public";
6485
+ MediaAccessLevel2["PRIVATE"] = "private";
6486
+ MediaAccessLevel2["CONFIDENTIAL"] = "confidential";
6487
+ return MediaAccessLevel2;
6488
+ })(MediaAccessLevel || {});
6480
6489
  var MEDIA_METADATA_COLLECTION = "media_metadata";
6481
6490
  var MediaService = class extends BaseService {
6482
6491
  constructor(db, auth, app) {
@@ -7919,8 +7928,8 @@ var AuthService = class extends BaseService {
7919
7928
  data.profileData = {};
7920
7929
  }
7921
7930
  const basicInfo = {
7922
- firstName: data.firstName,
7923
- lastName: data.lastName,
7931
+ firstName: data.firstName || "",
7932
+ lastName: data.lastName || "",
7924
7933
  email: data.email,
7925
7934
  phoneNumber: ((_a = data.profileData.basicInfo) == null ? void 0 : _a.phoneNumber) || "",
7926
7935
  profileImageUrl: ((_b = data.profileData.basicInfo) == null ? void 0 : _b.profileImageUrl) || "",
@@ -14998,6 +15007,9 @@ var RequirementType = /* @__PURE__ */ ((RequirementType2) => {
14998
15007
  HeadingLevel,
14999
15008
  Language,
15000
15009
  ListType,
15010
+ MEDIA_METADATA_COLLECTION,
15011
+ MediaAccessLevel,
15012
+ MediaService,
15001
15013
  MedicationAllergySubtype,
15002
15014
  NotificationService,
15003
15015
  NotificationStatus,
package/dist/index.mjs CHANGED
@@ -4076,8 +4076,8 @@ var createPractitionerTokenSchema = z13.object({
4076
4076
  var practitionerSignupSchema = z13.object({
4077
4077
  email: z13.string().email(),
4078
4078
  password: z13.string().min(8),
4079
- firstName: z13.string().min(2).max(50),
4080
- lastName: z13.string().min(2).max(50),
4079
+ firstName: z13.string().min(2).max(50).optional(),
4080
+ lastName: z13.string().min(2).max(50).optional(),
4081
4081
  token: z13.string().optional(),
4082
4082
  profileData: z13.object({
4083
4083
  basicInfo: z13.object({
@@ -6442,6 +6442,12 @@ import {
6442
6442
  deleteDoc as deleteDoc6,
6443
6443
  orderBy as orderBy3
6444
6444
  } from "firebase/firestore";
6445
+ var MediaAccessLevel = /* @__PURE__ */ ((MediaAccessLevel2) => {
6446
+ MediaAccessLevel2["PUBLIC"] = "public";
6447
+ MediaAccessLevel2["PRIVATE"] = "private";
6448
+ MediaAccessLevel2["CONFIDENTIAL"] = "confidential";
6449
+ return MediaAccessLevel2;
6450
+ })(MediaAccessLevel || {});
6445
6451
  var MEDIA_METADATA_COLLECTION = "media_metadata";
6446
6452
  var MediaService = class extends BaseService {
6447
6453
  constructor(db, auth, app) {
@@ -7884,8 +7890,8 @@ var AuthService = class extends BaseService {
7884
7890
  data.profileData = {};
7885
7891
  }
7886
7892
  const basicInfo = {
7887
- firstName: data.firstName,
7888
- lastName: data.lastName,
7893
+ firstName: data.firstName || "",
7894
+ lastName: data.lastName || "",
7889
7895
  email: data.email,
7890
7896
  phoneNumber: ((_a = data.profileData.basicInfo) == null ? void 0 : _a.phoneNumber) || "",
7891
7897
  profileImageUrl: ((_b = data.profileData.basicInfo) == null ? void 0 : _b.profileImageUrl) || "",
@@ -15180,6 +15186,9 @@ export {
15180
15186
  HeadingLevel,
15181
15187
  Language,
15182
15188
  ListType,
15189
+ MEDIA_METADATA_COLLECTION,
15190
+ MediaAccessLevel,
15191
+ MediaService,
15183
15192
  MedicationAllergySubtype,
15184
15193
  NotificationService,
15185
15194
  NotificationStatus,
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.9",
4
+ "version": "1.7.11",
5
5
  "description": "Firebase authentication service with anonymous upgrade support",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.mjs",
package/src/index.ts CHANGED
@@ -34,6 +34,7 @@ export { SyncedCalendarsService } from "./services/calendar/synced-calendars.ser
34
34
  export { ReviewService } from "./services/reviews/reviews.service";
35
35
  export { AppointmentService } from "./services/appointment/appointment.service";
36
36
  export { PatientRequirementsService } from "./services/patient/patientRequirements.service";
37
+ export { MediaService } from "./services/media/media.service";
37
38
 
38
39
  // Backoffice services
39
40
  export { BrandService } from "./backoffice/services/brand.service";
@@ -295,6 +296,13 @@ export {
295
296
  TimeUnit,
296
297
  } from "./backoffice/types/requirement.types";
297
298
 
299
+ // Media types
300
+ export type {
301
+ MediaMetadata,
302
+ MediaResource,
303
+ } from "./services/media/media.service";
304
+ export { MEDIA_METADATA_COLLECTION } from "./services/media/media.service";
305
+ export { MediaAccessLevel } from "./services/media/media.service";
298
306
  // Documentation Templates types
299
307
  export type {
300
308
  DocumentTemplate,
@@ -884,8 +884,8 @@ export class AuthService extends BaseService {
884
884
  async signUpPractitioner(data: {
885
885
  email: string;
886
886
  password: string;
887
- firstName: string;
888
- lastName: string;
887
+ firstName?: string;
888
+ lastName?: string;
889
889
  token?: string;
890
890
  profileData?: Partial<CreatePractitionerData>;
891
891
  }): Promise<{
@@ -996,8 +996,8 @@ export class AuthService extends BaseService {
996
996
 
997
997
  // We need to create a full PractitionerBasicInfo object
998
998
  const basicInfo: PractitionerBasicInfo = {
999
- firstName: data.firstName,
1000
- lastName: data.lastName,
999
+ firstName: data.firstName || "",
1000
+ lastName: data.lastName || "",
1001
1001
  email: data.email,
1002
1002
  phoneNumber: data.profileData.basicInfo?.phoneNumber || "",
1003
1003
  profileImageUrl: data.profileData.basicInfo?.profileImageUrl || "",
@@ -32,6 +32,11 @@ export enum MediaAccessLevel {
32
32
  CONFIDENTIAL = "confidential",
33
33
  }
34
34
 
35
+ /**
36
+ * Type that allows a field to be either a URL string or a File object
37
+ */
38
+ export type MediaResource = string | File | Blob;
39
+
35
40
  /**
36
41
  * Media file metadata interface
37
42
  */
@@ -49,7 +54,7 @@ export interface MediaMetadata {
49
54
  updatedAt?: Timestamp; // Firestore Timestamp of last update
50
55
  }
51
56
 
52
- const MEDIA_METADATA_COLLECTION = "media_metadata";
57
+ export const MEDIA_METADATA_COLLECTION = "media_metadata";
53
58
 
54
59
  export class MediaService extends BaseService {
55
60
  constructor(db: Firestore, auth: Auth, app: FirebaseApp) {
@@ -19,6 +19,7 @@ import {
19
19
  ClinicTag,
20
20
  ClinicPhotoTag,
21
21
  } from "./preferences.types";
22
+ import type { MediaResource } from "../../services/media/media.service";
22
23
 
23
24
  export * from "./preferences.types";
24
25
 
@@ -253,11 +254,6 @@ export interface DoctorInfo {
253
254
  // TODO: Add aggregated fields, like rating, reviews, services this doctor provides in this clinic and similar
254
255
  }
255
256
 
256
- /**
257
- * Type that allows a field to be either a URL string or a File object
258
- */
259
- export type MediaResource = string | File | Blob;
260
-
261
257
  /**
262
258
  * Interface for clinic
263
259
  */
@@ -196,8 +196,8 @@ export const createPractitionerTokenSchema = z.object({
196
196
  export const practitionerSignupSchema = z.object({
197
197
  email: z.string().email(),
198
198
  password: z.string().min(8),
199
- firstName: z.string().min(2).max(50),
200
- lastName: z.string().min(2).max(50),
199
+ firstName: z.string().min(2).max(50).optional(),
200
+ lastName: z.string().min(2).max(50).optional(),
201
201
  token: z.string().optional(),
202
202
  profileData: z
203
203
  .object({