@blackcode_sa/metaestetics-api 1.14.10 → 1.14.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.
package/dist/index.js CHANGED
@@ -12880,6 +12880,11 @@ var PractitionerService = class extends BaseService {
12880
12880
  var UserService = class extends BaseService {
12881
12881
  constructor(db, auth, app, patientService, clinicAdminService, practitionerService) {
12882
12882
  super(db, auth, app);
12883
+ if (!this.auth.__userServiceId) {
12884
+ this.auth.__userServiceId = "user-service-" + Date.now();
12885
+ }
12886
+ console.log("[USER_SERVICE] Constructor - auth ID:", this.auth.__userServiceId);
12887
+ console.log("[USER_SERVICE] Constructor - auth.__authServiceId:", this.auth.__authServiceId || "NOT SET");
12883
12888
  if (!patientService) {
12884
12889
  patientService = new PatientService(db, auth, app);
12885
12890
  }
@@ -12908,6 +12913,7 @@ var UserService = class extends BaseService {
12908
12913
  async createUser(firebaseUser, roles = ["patient" /* PATIENT */], options) {
12909
12914
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
12910
12915
  console.log("[USER_SERVICE] ====== CREATE USER DEBUG ======");
12916
+ console.log(this.auth);
12911
12917
  console.log("[USER_SERVICE] Auth instance ID:", ((_a = this.auth) == null ? void 0 : _a.__debugId) || "no-id");
12912
12918
  console.log("[USER_SERVICE] Current auth state:", {
12913
12919
  currentUser: ((_c = (_b = this.auth) == null ? void 0 : _b.currentUser) == null ? void 0 : _c.uid) || "NULL",
@@ -15378,9 +15384,15 @@ var validatePractitionerProfileData = async (profileData) => {
15378
15384
  // src/services/auth/auth.service.ts
15379
15385
  var AuthService = class extends BaseService {
15380
15386
  constructor(db, auth, app, userService) {
15387
+ var _a;
15381
15388
  super(db, auth, app);
15382
15389
  this.googleProvider = new import_auth8.GoogleAuthProvider();
15383
15390
  this.userService = userService || new UserService(db, auth, app);
15391
+ if (!this.auth.__authServiceId) {
15392
+ this.auth.__authServiceId = "auth-service-" + Date.now();
15393
+ }
15394
+ console.log("[AUTH] AuthService constructor - auth ID:", this.auth.__authServiceId);
15395
+ console.log("[AUTH] AuthService constructor - userService.auth ID:", ((_a = this.userService.auth) == null ? void 0 : _a.__authServiceId) || "NOT SET");
15384
15396
  }
15385
15397
  /**
15386
15398
  * Waits for Firebase Auth state to settle after sign-in.
package/dist/index.mjs CHANGED
@@ -12903,6 +12903,11 @@ var PractitionerService = class extends BaseService {
12903
12903
  var UserService = class extends BaseService {
12904
12904
  constructor(db, auth, app, patientService, clinicAdminService, practitionerService) {
12905
12905
  super(db, auth, app);
12906
+ if (!this.auth.__userServiceId) {
12907
+ this.auth.__userServiceId = "user-service-" + Date.now();
12908
+ }
12909
+ console.log("[USER_SERVICE] Constructor - auth ID:", this.auth.__userServiceId);
12910
+ console.log("[USER_SERVICE] Constructor - auth.__authServiceId:", this.auth.__authServiceId || "NOT SET");
12906
12911
  if (!patientService) {
12907
12912
  patientService = new PatientService(db, auth, app);
12908
12913
  }
@@ -12931,6 +12936,7 @@ var UserService = class extends BaseService {
12931
12936
  async createUser(firebaseUser, roles = ["patient" /* PATIENT */], options) {
12932
12937
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
12933
12938
  console.log("[USER_SERVICE] ====== CREATE USER DEBUG ======");
12939
+ console.log(this.auth);
12934
12940
  console.log("[USER_SERVICE] Auth instance ID:", ((_a = this.auth) == null ? void 0 : _a.__debugId) || "no-id");
12935
12941
  console.log("[USER_SERVICE] Current auth state:", {
12936
12942
  currentUser: ((_c = (_b = this.auth) == null ? void 0 : _b.currentUser) == null ? void 0 : _c.uid) || "NULL",
@@ -15465,9 +15471,15 @@ var validatePractitionerProfileData = async (profileData) => {
15465
15471
  // src/services/auth/auth.service.ts
15466
15472
  var AuthService = class extends BaseService {
15467
15473
  constructor(db, auth, app, userService) {
15474
+ var _a;
15468
15475
  super(db, auth, app);
15469
15476
  this.googleProvider = new GoogleAuthProvider();
15470
15477
  this.userService = userService || new UserService(db, auth, app);
15478
+ if (!this.auth.__authServiceId) {
15479
+ this.auth.__authServiceId = "auth-service-" + Date.now();
15480
+ }
15481
+ console.log("[AUTH] AuthService constructor - auth ID:", this.auth.__authServiceId);
15482
+ console.log("[AUTH] AuthService constructor - userService.auth ID:", ((_a = this.userService.auth) == null ? void 0 : _a.__authServiceId) || "NOT SET");
15471
15483
  }
15472
15484
  /**
15473
15485
  * Waits for Firebase Auth state to settle after sign-in.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@blackcode_sa/metaestetics-api",
3
3
  "private": false,
4
- "version": "1.14.10",
4
+ "version": "1.14.11",
5
5
  "description": "Firebase authentication service with anonymous upgrade support",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.mjs",
@@ -90,6 +90,17 @@ export class AuthService extends BaseService {
90
90
  constructor(db: Firestore, auth: Auth, app: FirebaseApp, userService: UserService) {
91
91
  super(db, auth, app);
92
92
  this.userService = userService || new UserService(db, auth, app);
93
+
94
+ // DEBUG: Tag the auth instances to track them
95
+ // @ts-ignore
96
+ if (!this.auth.__authServiceId) {
97
+ // @ts-ignore
98
+ this.auth.__authServiceId = 'auth-service-' + Date.now();
99
+ }
100
+ // @ts-ignore
101
+ console.log('[AUTH] AuthService constructor - auth ID:', this.auth.__authServiceId);
102
+ // @ts-ignore
103
+ console.log('[AUTH] AuthService constructor - userService.auth ID:', (this.userService as any).auth?.__authServiceId || 'NOT SET');
93
104
  }
94
105
 
95
106
  /**
@@ -45,6 +45,17 @@ export class UserService extends BaseService {
45
45
  ) {
46
46
  super(db, auth, app);
47
47
 
48
+ // DEBUG: Tag the auth instance
49
+ // @ts-ignore
50
+ if (!this.auth.__userServiceId) {
51
+ // @ts-ignore
52
+ this.auth.__userServiceId = 'user-service-' + Date.now();
53
+ }
54
+ // @ts-ignore
55
+ console.log('[USER_SERVICE] Constructor - auth ID:', this.auth.__userServiceId);
56
+ // @ts-ignore
57
+ console.log('[USER_SERVICE] Constructor - auth.__authServiceId:', this.auth.__authServiceId || 'NOT SET');
58
+
48
59
  // Kreiramo servise samo ako nisu prosleđeni
49
60
  if (!patientService) {
50
61
  patientService = new PatientService(db, auth, app);
@@ -92,6 +103,7 @@ export class UserService extends BaseService {
92
103
  // DEBUG LOGGING - Check auth state before creating user document
93
104
  console.log('[USER_SERVICE] ====== CREATE USER DEBUG ======');
94
105
  // @ts-ignore - Debug: Check auth instance ID
106
+ console.log(this.auth)
95
107
  console.log('[USER_SERVICE] Auth instance ID:', (this.auth as any)?.__debugId || 'no-id');
96
108
  console.log('[USER_SERVICE] Current auth state:', {
97
109
  currentUser: this.auth?.currentUser?.uid || 'NULL',