@blackcode_sa/metaestetics-api 1.7.18 → 1.7.20

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.
@@ -775,7 +775,7 @@ interface PractitionerBasicInfo {
775
775
  phoneNumber: string;
776
776
  dateOfBirth: Timestamp | Date;
777
777
  gender: "male" | "female" | "other";
778
- profileImageUrl?: string;
778
+ profileImageUrl?: MediaResource;
779
779
  bio?: string;
780
780
  languages: string[];
781
781
  }
@@ -775,7 +775,7 @@ interface PractitionerBasicInfo {
775
775
  phoneNumber: string;
776
776
  dateOfBirth: Timestamp | Date;
777
777
  gender: "male" | "female" | "other";
778
- profileImageUrl?: string;
778
+ profileImageUrl?: MediaResource;
779
779
  bio?: string;
780
780
  languages: string[];
781
781
  }
@@ -6378,7 +6378,7 @@ var BookingAdmin = class {
6378
6378
  };
6379
6379
  const practitionerInfo = {
6380
6380
  id: practitionerSnap.id,
6381
- practitionerPhoto: practitionerData.basicInfo.profileImageUrl || null,
6381
+ practitionerPhoto: typeof practitionerData.basicInfo.profileImageUrl === "string" ? practitionerData.basicInfo.profileImageUrl : null,
6382
6382
  name: `${practitionerData.basicInfo.firstName} ${practitionerData.basicInfo.lastName}`,
6383
6383
  email: practitionerData.basicInfo.email,
6384
6384
  phone: practitionerData.basicInfo.phoneNumber || null,
@@ -6321,7 +6321,7 @@ var BookingAdmin = class {
6321
6321
  };
6322
6322
  const practitionerInfo = {
6323
6323
  id: practitionerSnap.id,
6324
- practitionerPhoto: practitionerData.basicInfo.profileImageUrl || null,
6324
+ practitionerPhoto: typeof practitionerData.basicInfo.profileImageUrl === "string" ? practitionerData.basicInfo.profileImageUrl : null,
6325
6325
  name: `${practitionerData.basicInfo.firstName} ${practitionerData.basicInfo.lastName}`,
6326
6326
  email: practitionerData.basicInfo.email,
6327
6327
  phone: practitionerData.basicInfo.phoneNumber || null,
@@ -4868,6 +4868,11 @@ declare enum Currency {
4868
4868
  AUD = "AUD"
4869
4869
  }
4870
4870
 
4871
+ /**
4872
+ * Type that allows a field to be either a URL string or a File object
4873
+ */
4874
+ type MediaResource = string | File | Blob;
4875
+
4871
4876
  /**
4872
4877
  * Aggregated summary information for a procedure.
4873
4878
  * Used in arrays within Clinic and Practitioner documents for quick display.
@@ -4938,7 +4943,7 @@ interface PractitionerBasicInfo {
4938
4943
  phoneNumber: string;
4939
4944
  dateOfBirth: Timestamp | Date;
4940
4945
  gender: "male" | "female" | "other";
4941
- profileImageUrl?: string;
4946
+ profileImageUrl?: MediaResource;
4942
4947
  bio?: string;
4943
4948
  languages: string[];
4944
4949
  }
@@ -4868,6 +4868,11 @@ declare enum Currency {
4868
4868
  AUD = "AUD"
4869
4869
  }
4870
4870
 
4871
+ /**
4872
+ * Type that allows a field to be either a URL string or a File object
4873
+ */
4874
+ type MediaResource = string | File | Blob;
4875
+
4871
4876
  /**
4872
4877
  * Aggregated summary information for a procedure.
4873
4878
  * Used in arrays within Clinic and Practitioner documents for quick display.
@@ -4938,7 +4943,7 @@ interface PractitionerBasicInfo {
4938
4943
  phoneNumber: string;
4939
4944
  dateOfBirth: Timestamp | Date;
4940
4945
  gender: "male" | "female" | "other";
4941
- profileImageUrl?: string;
4946
+ profileImageUrl?: MediaResource;
4942
4947
  bio?: string;
4943
4948
  languages: string[];
4944
4949
  }
package/dist/index.d.mts CHANGED
@@ -1246,7 +1246,7 @@ interface PractitionerBasicInfo {
1246
1246
  phoneNumber: string;
1247
1247
  dateOfBirth: Timestamp | Date;
1248
1248
  gender: "male" | "female" | "other";
1249
- profileImageUrl?: string;
1249
+ profileImageUrl?: MediaResource;
1250
1250
  bio?: string;
1251
1251
  languages: string[];
1252
1252
  }
@@ -5860,9 +5860,24 @@ declare class ClinicAdminService extends BaseService {
5860
5860
 
5861
5861
  declare class PractitionerService extends BaseService {
5862
5862
  private clinicService?;
5863
+ private mediaService;
5863
5864
  constructor(db: Firestore, auth: Auth, app: FirebaseApp, clinicService?: ClinicService);
5864
5865
  private getClinicService;
5865
5866
  setClinicService(clinicService: ClinicService): void;
5867
+ /**
5868
+ * Handles profile photo upload for practitioners
5869
+ * @param profilePhoto - MediaResource (File, Blob, or URL string)
5870
+ * @param practitionerId - ID of the practitioner
5871
+ * @returns URL string of the uploaded or existing photo
5872
+ */
5873
+ private handleProfilePhotoUpload;
5874
+ /**
5875
+ * Processes BasicPractitionerInfo to handle profile photo uploads
5876
+ * @param basicInfo - The basic info containing potential MediaResource profile photo
5877
+ * @param practitionerId - ID of the practitioner
5878
+ * @returns Processed basic info with URL string for profileImageUrl
5879
+ */
5880
+ private processBasicInfo;
5866
5881
  /**
5867
5882
  * Creates a new practitioner
5868
5883
  */
@@ -6804,46 +6819,34 @@ declare class FilledDocumentService extends BaseService {
6804
6819
  lastDoc: QueryDocumentSnapshot<FilledDocument> | null;
6805
6820
  }>;
6806
6821
  /**
6807
- * Upload a file and associate it with a filled document field.
6808
- * @param appointmentId - ID of the appointment.
6809
- * @param formId - ID of the filled document.
6810
- * @param isUserForm - Boolean indicating if it's a user form or doctor form.
6811
- * @param file - The file to upload.
6812
- * @param fieldId - The ID of the field in the document to associate with this file.
6813
- * @param accessLevel - Access level for the file, defaults to PRIVATE.
6814
- * @returns The updated filled document with file information.
6822
+ * Upload a file for a filled document field without updating the document.
6823
+ * This method only handles the upload and returns the file value to be used by the UI.
6824
+ *
6825
+ * @param appointmentId - ID of the appointment
6826
+ * @param formId - ID of the filled document
6827
+ * @param isUserForm - Boolean indicating if it's a user form or doctor form
6828
+ * @param file - The file to upload
6829
+ * @returns The file value object to be stored in the document
6815
6830
  */
6816
- uploadFileForFilledDocument(appointmentId: string, formId: string, isUserForm: boolean, file: File | Blob, fieldId: string, accessLevel?: MediaAccessLevel): Promise<FilledDocument>;
6831
+ uploadFileForFilledDocument(appointmentId: string, formId: string, isUserForm: boolean, file: File | Blob): Promise<FilledDocumentFileValue>;
6817
6832
  /**
6818
- * Upload a signature image for a filled document field.
6833
+ * Upload a signature image for a filled document.
6819
6834
  * This is a specialized version of uploadFileForFilledDocument specifically for signatures.
6820
- * @param appointmentId - ID of the appointment.
6821
- * @param formId - ID of the filled document.
6822
- * @param isUserForm - Boolean indicating if it's a user form or doctor form.
6823
- * @param signatureBlob - The signature image as a Blob.
6824
- * @param fieldId - The ID of the signature field in the document.
6825
- * @returns The updated filled document with signature information.
6826
- */
6827
- uploadSignatureForFilledDocument(appointmentId: string, formId: string, isUserForm: boolean, signatureBlob: Blob, fieldId: string): Promise<FilledDocument>;
6828
- /**
6829
- * Remove a file from a filled document field.
6830
- * This will both update the document and delete the media file.
6831
- * @param appointmentId - ID of the appointment.
6832
- * @param formId - ID of the filled document.
6833
- * @param isUserForm - Boolean indicating if it's a user form or doctor form.
6834
- * @param fieldId - The ID of the field containing the file.
6835
- * @returns The updated filled document with the file removed.
6835
+ *
6836
+ * @param appointmentId - ID of the appointment
6837
+ * @param formId - ID of the filled document
6838
+ * @param isUserForm - Boolean indicating if it's a user form or doctor form
6839
+ * @param signatureBlob - The signature image as a Blob
6840
+ * @returns The file value object to be stored in the document
6836
6841
  */
6837
- removeFileFromFilledDocument(appointmentId: string, formId: string, isUserForm: boolean, fieldId: string): Promise<FilledDocument>;
6842
+ uploadSignatureForFilledDocument(appointmentId: string, formId: string, isUserForm: boolean, signatureBlob: Blob): Promise<FilledDocumentFileValue>;
6838
6843
  /**
6839
- * Get the download URL for a file in a filled document.
6840
- * @param appointmentId - ID of the appointment.
6841
- * @param formId - ID of the filled document.
6842
- * @param isUserForm - Boolean indicating if it's a user form or doctor form.
6843
- * @param fieldId - The ID of the field containing the file.
6844
- * @returns The download URL for the file, or null if not found.
6844
+ * Delete a file using its mediaId.
6845
+ *
6846
+ * @param mediaId - ID of the media to delete
6847
+ * @returns Promise resolving when the deletion is complete
6845
6848
  */
6846
- getFileUrlFromFilledDocument(appointmentId: string, formId: string, isUserForm: boolean, fieldId: string): Promise<string | null>;
6849
+ deleteFile(mediaId: string): Promise<void>;
6847
6850
  }
6848
6851
 
6849
6852
  /**
@@ -10829,7 +10832,7 @@ declare const practitionerBasicInfoSchema: z.ZodObject<{
10829
10832
  phoneNumber: z.ZodString;
10830
10833
  dateOfBirth: z.ZodUnion<[z.ZodType<Timestamp, z.ZodTypeDef, Timestamp>, z.ZodDate]>;
10831
10834
  gender: z.ZodEnum<["male", "female", "other"]>;
10832
- profileImageUrl: z.ZodOptional<z.ZodString>;
10835
+ profileImageUrl: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<File, z.ZodTypeDef, File>, z.ZodType<Blob, z.ZodTypeDef, Blob>]>>;
10833
10836
  bio: z.ZodOptional<z.ZodString>;
10834
10837
  languages: z.ZodArray<z.ZodString, "many">;
10835
10838
  }, "strip", z.ZodTypeAny, {
@@ -10841,7 +10844,7 @@ declare const practitionerBasicInfoSchema: z.ZodObject<{
10841
10844
  phoneNumber: string;
10842
10845
  languages: string[];
10843
10846
  title: string;
10844
- profileImageUrl?: string | undefined;
10847
+ profileImageUrl?: string | File | Blob | undefined;
10845
10848
  bio?: string | undefined;
10846
10849
  }, {
10847
10850
  firstName: string;
@@ -10852,7 +10855,7 @@ declare const practitionerBasicInfoSchema: z.ZodObject<{
10852
10855
  phoneNumber: string;
10853
10856
  languages: string[];
10854
10857
  title: string;
10855
- profileImageUrl?: string | undefined;
10858
+ profileImageUrl?: string | File | Blob | undefined;
10856
10859
  bio?: string | undefined;
10857
10860
  }>;
10858
10861
  /**
@@ -11251,7 +11254,7 @@ declare const practitionerSchema: z.ZodObject<{
11251
11254
  phoneNumber: z.ZodString;
11252
11255
  dateOfBirth: z.ZodUnion<[z.ZodType<Timestamp, z.ZodTypeDef, Timestamp>, z.ZodDate]>;
11253
11256
  gender: z.ZodEnum<["male", "female", "other"]>;
11254
- profileImageUrl: z.ZodOptional<z.ZodString>;
11257
+ profileImageUrl: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<File, z.ZodTypeDef, File>, z.ZodType<Blob, z.ZodTypeDef, Blob>]>>;
11255
11258
  bio: z.ZodOptional<z.ZodString>;
11256
11259
  languages: z.ZodArray<z.ZodString, "many">;
11257
11260
  }, "strip", z.ZodTypeAny, {
@@ -11263,7 +11266,7 @@ declare const practitionerSchema: z.ZodObject<{
11263
11266
  phoneNumber: string;
11264
11267
  languages: string[];
11265
11268
  title: string;
11266
- profileImageUrl?: string | undefined;
11269
+ profileImageUrl?: string | File | Blob | undefined;
11267
11270
  bio?: string | undefined;
11268
11271
  }, {
11269
11272
  firstName: string;
@@ -11274,7 +11277,7 @@ declare const practitionerSchema: z.ZodObject<{
11274
11277
  phoneNumber: string;
11275
11278
  languages: string[];
11276
11279
  title: string;
11277
- profileImageUrl?: string | undefined;
11280
+ profileImageUrl?: string | File | Blob | undefined;
11278
11281
  bio?: string | undefined;
11279
11282
  }>;
11280
11283
  certification: z.ZodObject<{
@@ -11698,7 +11701,7 @@ declare const practitionerSchema: z.ZodObject<{
11698
11701
  phoneNumber: string;
11699
11702
  languages: string[];
11700
11703
  title: string;
11701
- profileImageUrl?: string | undefined;
11704
+ profileImageUrl?: string | File | Blob | undefined;
11702
11705
  bio?: string | undefined;
11703
11706
  };
11704
11707
  certification: {
@@ -11814,7 +11817,7 @@ declare const practitionerSchema: z.ZodObject<{
11814
11817
  phoneNumber: string;
11815
11818
  languages: string[];
11816
11819
  title: string;
11817
- profileImageUrl?: string | undefined;
11820
+ profileImageUrl?: string | File | Blob | undefined;
11818
11821
  bio?: string | undefined;
11819
11822
  };
11820
11823
  certification: {
@@ -11928,7 +11931,7 @@ declare const createPractitionerSchema: z.ZodObject<{
11928
11931
  phoneNumber: z.ZodString;
11929
11932
  dateOfBirth: z.ZodUnion<[z.ZodType<Timestamp, z.ZodTypeDef, Timestamp>, z.ZodDate]>;
11930
11933
  gender: z.ZodEnum<["male", "female", "other"]>;
11931
- profileImageUrl: z.ZodOptional<z.ZodString>;
11934
+ profileImageUrl: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<File, z.ZodTypeDef, File>, z.ZodType<Blob, z.ZodTypeDef, Blob>]>>;
11932
11935
  bio: z.ZodOptional<z.ZodString>;
11933
11936
  languages: z.ZodArray<z.ZodString, "many">;
11934
11937
  }, "strip", z.ZodTypeAny, {
@@ -11940,7 +11943,7 @@ declare const createPractitionerSchema: z.ZodObject<{
11940
11943
  phoneNumber: string;
11941
11944
  languages: string[];
11942
11945
  title: string;
11943
- profileImageUrl?: string | undefined;
11946
+ profileImageUrl?: string | File | Blob | undefined;
11944
11947
  bio?: string | undefined;
11945
11948
  }, {
11946
11949
  firstName: string;
@@ -11951,7 +11954,7 @@ declare const createPractitionerSchema: z.ZodObject<{
11951
11954
  phoneNumber: string;
11952
11955
  languages: string[];
11953
11956
  title: string;
11954
- profileImageUrl?: string | undefined;
11957
+ profileImageUrl?: string | File | Blob | undefined;
11955
11958
  bio?: string | undefined;
11956
11959
  }>;
11957
11960
  certification: z.ZodObject<{
@@ -12340,7 +12343,7 @@ declare const createPractitionerSchema: z.ZodObject<{
12340
12343
  phoneNumber: string;
12341
12344
  languages: string[];
12342
12345
  title: string;
12343
- profileImageUrl?: string | undefined;
12346
+ profileImageUrl?: string | File | Blob | undefined;
12344
12347
  bio?: string | undefined;
12345
12348
  };
12346
12349
  certification: {
@@ -12442,7 +12445,7 @@ declare const createPractitionerSchema: z.ZodObject<{
12442
12445
  phoneNumber: string;
12443
12446
  languages: string[];
12444
12447
  title: string;
12445
- profileImageUrl?: string | undefined;
12448
+ profileImageUrl?: string | File | Blob | undefined;
12446
12449
  bio?: string | undefined;
12447
12450
  };
12448
12451
  certification: {
@@ -12545,7 +12548,7 @@ declare const createDraftPractitionerSchema: z.ZodObject<{
12545
12548
  phoneNumber: z.ZodString;
12546
12549
  dateOfBirth: z.ZodUnion<[z.ZodType<Timestamp, z.ZodTypeDef, Timestamp>, z.ZodDate]>;
12547
12550
  gender: z.ZodEnum<["male", "female", "other"]>;
12548
- profileImageUrl: z.ZodOptional<z.ZodString>;
12551
+ profileImageUrl: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<File, z.ZodTypeDef, File>, z.ZodType<Blob, z.ZodTypeDef, Blob>]>>;
12549
12552
  bio: z.ZodOptional<z.ZodString>;
12550
12553
  languages: z.ZodArray<z.ZodString, "many">;
12551
12554
  }, "strip", z.ZodTypeAny, {
@@ -12557,7 +12560,7 @@ declare const createDraftPractitionerSchema: z.ZodObject<{
12557
12560
  phoneNumber: string;
12558
12561
  languages: string[];
12559
12562
  title: string;
12560
- profileImageUrl?: string | undefined;
12563
+ profileImageUrl?: string | File | Blob | undefined;
12561
12564
  bio?: string | undefined;
12562
12565
  }, {
12563
12566
  firstName: string;
@@ -12568,7 +12571,7 @@ declare const createDraftPractitionerSchema: z.ZodObject<{
12568
12571
  phoneNumber: string;
12569
12572
  languages: string[];
12570
12573
  title: string;
12571
- profileImageUrl?: string | undefined;
12574
+ profileImageUrl?: string | File | Blob | undefined;
12572
12575
  bio?: string | undefined;
12573
12576
  }>;
12574
12577
  certification: z.ZodObject<{
@@ -12955,7 +12958,7 @@ declare const createDraftPractitionerSchema: z.ZodObject<{
12955
12958
  phoneNumber: string;
12956
12959
  languages: string[];
12957
12960
  title: string;
12958
- profileImageUrl?: string | undefined;
12961
+ profileImageUrl?: string | File | Blob | undefined;
12959
12962
  bio?: string | undefined;
12960
12963
  };
12961
12964
  certification: {
@@ -13054,7 +13057,7 @@ declare const createDraftPractitionerSchema: z.ZodObject<{
13054
13057
  phoneNumber: string;
13055
13058
  languages: string[];
13056
13059
  title: string;
13057
- profileImageUrl?: string | undefined;
13060
+ profileImageUrl?: string | File | Blob | undefined;
13058
13061
  bio?: string | undefined;
13059
13062
  };
13060
13063
  certification: {
@@ -13216,18 +13219,18 @@ declare const practitionerSignupSchema: z.ZodObject<{
13216
13219
  profileData: z.ZodOptional<z.ZodObject<{
13217
13220
  basicInfo: z.ZodOptional<z.ZodObject<{
13218
13221
  phoneNumber: z.ZodOptional<z.ZodString>;
13219
- profileImageUrl: z.ZodOptional<z.ZodString>;
13222
+ profileImageUrl: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<File, z.ZodTypeDef, File>, z.ZodType<Blob, z.ZodTypeDef, Blob>]>>;
13220
13223
  gender: z.ZodOptional<z.ZodEnum<["male", "female", "other"]>>;
13221
13224
  bio: z.ZodOptional<z.ZodString>;
13222
13225
  }, "strip", z.ZodTypeAny, {
13223
13226
  gender?: "male" | "female" | "other" | undefined;
13224
13227
  phoneNumber?: string | undefined;
13225
- profileImageUrl?: string | undefined;
13228
+ profileImageUrl?: string | File | Blob | undefined;
13226
13229
  bio?: string | undefined;
13227
13230
  }, {
13228
13231
  gender?: "male" | "female" | "other" | undefined;
13229
13232
  phoneNumber?: string | undefined;
13230
- profileImageUrl?: string | undefined;
13233
+ profileImageUrl?: string | File | Blob | undefined;
13231
13234
  bio?: string | undefined;
13232
13235
  }>>;
13233
13236
  certification: z.ZodOptional<z.ZodAny>;
@@ -13235,7 +13238,7 @@ declare const practitionerSignupSchema: z.ZodObject<{
13235
13238
  basicInfo?: {
13236
13239
  gender?: "male" | "female" | "other" | undefined;
13237
13240
  phoneNumber?: string | undefined;
13238
- profileImageUrl?: string | undefined;
13241
+ profileImageUrl?: string | File | Blob | undefined;
13239
13242
  bio?: string | undefined;
13240
13243
  } | undefined;
13241
13244
  certification?: any;
@@ -13243,7 +13246,7 @@ declare const practitionerSignupSchema: z.ZodObject<{
13243
13246
  basicInfo?: {
13244
13247
  gender?: "male" | "female" | "other" | undefined;
13245
13248
  phoneNumber?: string | undefined;
13246
- profileImageUrl?: string | undefined;
13249
+ profileImageUrl?: string | File | Blob | undefined;
13247
13250
  bio?: string | undefined;
13248
13251
  } | undefined;
13249
13252
  certification?: any;
@@ -13258,7 +13261,7 @@ declare const practitionerSignupSchema: z.ZodObject<{
13258
13261
  basicInfo?: {
13259
13262
  gender?: "male" | "female" | "other" | undefined;
13260
13263
  phoneNumber?: string | undefined;
13261
- profileImageUrl?: string | undefined;
13264
+ profileImageUrl?: string | File | Blob | undefined;
13262
13265
  bio?: string | undefined;
13263
13266
  } | undefined;
13264
13267
  certification?: any;
@@ -13273,7 +13276,7 @@ declare const practitionerSignupSchema: z.ZodObject<{
13273
13276
  basicInfo?: {
13274
13277
  gender?: "male" | "female" | "other" | undefined;
13275
13278
  phoneNumber?: string | undefined;
13276
- profileImageUrl?: string | undefined;
13279
+ profileImageUrl?: string | File | Blob | undefined;
13277
13280
  bio?: string | undefined;
13278
13281
  } | undefined;
13279
13282
  certification?: any;