connectfy-shared 0.0.90 → 0.0.91

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.cjs CHANGED
@@ -11381,7 +11381,7 @@ var BaseRepository = class {
11381
11381
  const ids = inserted.map((doc) => doc._id);
11382
11382
  const populated = await this.model.find({ _id: { $in: ids } }).populate(
11383
11383
  opts.populate
11384
- ).lean({ virtuals }).exec();
11384
+ ).lean({ virtuals, versionKey: false }).exec();
11385
11385
  return populated;
11386
11386
  }
11387
11387
  if (virtuals) {
@@ -11400,7 +11400,7 @@ var BaseRepository = class {
11400
11400
  new: opts?.new ?? true,
11401
11401
  runValidators: opts?.runValidators ?? true,
11402
11402
  populate: opts?.populate ?? [],
11403
- lean: opts?.lean ?? true ? { virtuals: true } : false
11403
+ lean: opts?.lean ?? true ? { virtuals: true, versionKey: false } : false
11404
11404
  };
11405
11405
  const updatedData = await this.model.findOneAndUpdate(
11406
11406
  query,
@@ -11457,17 +11457,17 @@ var BaseRepository = class {
11457
11457
  populate = []
11458
11458
  } = params;
11459
11459
  const virtuals = opts?.lean ?? true;
11460
- return await this.model.findOne(query).select(fields).sort(sort).populate(populate).lean({ virtuals }).exec();
11460
+ return await this.model.findOne(query).select(fields).sort(sort).populate(populate).lean({ virtuals, versionKey: false }).exec();
11461
11461
  }
11462
11462
  async findOneById(_id, params = {}, opts) {
11463
11463
  const { fields = "", sort = { createdAt: -1 }, populate = [] } = params;
11464
11464
  const virtuals = opts?.lean ?? true;
11465
- return await this.model.findOne({ _id }).select(fields).sort(sort).populate(populate).lean({ virtuals }).exec();
11465
+ return await this.model.findOne({ _id }).select(fields).sort(sort).populate(populate).lean({ virtuals, versionKey: false }).exec();
11466
11466
  }
11467
11467
  async findOneByUserId(userId, params = {}, opts) {
11468
11468
  const { fields = "", sort = { createdAt: -1 }, populate = [] } = params;
11469
11469
  const virtuals = opts?.lean ?? true;
11470
- return await this.model.findOne({ userId }).select(fields).sort(sort).populate(populate).lean({ virtuals }).exec();
11470
+ return await this.model.findOne({ userId }).select(fields).sort(sort).populate(populate).lean({ virtuals, versionKey: false }).exec();
11471
11471
  }
11472
11472
  async findMany(params = {}, opts) {
11473
11473
  const {
@@ -11479,7 +11479,7 @@ var BaseRepository = class {
11479
11479
  limit = 10
11480
11480
  } = params;
11481
11481
  const virtuals = opts?.lean ?? true;
11482
- return await this.model.find(query).select(fields).skip(skip).limit(limit).sort(sort).populate(populate).lean({ virtuals }).exec();
11482
+ return await this.model.find(query).select(fields).skip(skip).limit(limit).sort(sort).populate(populate).lean({ virtuals, versionKey: false }).exec();
11483
11483
  }
11484
11484
  async findAll(params = {}, opts) {
11485
11485
  const {
@@ -11489,7 +11489,7 @@ var BaseRepository = class {
11489
11489
  populate = []
11490
11490
  } = params;
11491
11491
  const virtuals = opts?.lean ?? true;
11492
- return await this.model.find(query).select(fields).sort(sort).populate(populate).lean({ virtuals }).exec();
11492
+ return await this.model.find(query).select(fields).sort(sort).populate(populate).lean({ virtuals, versionKey: false }).exec();
11493
11493
  }
11494
11494
  // ================================================
11495
11495
  // EXIST AND COUNT FUNCTIONS
package/dist/index.d.cts CHANGED
@@ -577,11 +577,26 @@ declare function decryptPayload(payload: string, base64Key: string): string;
577
577
  declare function sendWithContext<TResponse = any>({ client, endpoint, payload, }: ISendWithContextClientParams): Promise<TResponse>;
578
578
  declare function emitWithContext({ client, topic, payload, }: IEmitWithContextClientParams): rxjs.Observable<any>;
579
579
 
580
- interface ILoggedUser extends IUser {
580
+ interface ILoggedUser extends IReturnedUser {
581
581
  language: LANGUAGE;
582
582
  avatar: string | null;
583
583
  }
584
- interface IUser {
584
+ interface IReturnedUser {
585
+ _id: string;
586
+ username: string;
587
+ email: string;
588
+ phoneNumber: IPhoneNumber;
589
+ isTwoFactorEnabled: boolean;
590
+ timeZone: string | null;
591
+ location: string | null;
592
+ usesPasswordAuth: boolean;
593
+ usesOAuth: boolean;
594
+ hasPhoneNumber: boolean;
595
+ accountAgeInDays: number;
596
+ createdAt: Date;
597
+ updatedAt: Date;
598
+ }
599
+ interface IReturnedUser {
585
600
  _id: string;
586
601
  username: string;
587
602
  email: string;
@@ -754,4 +769,4 @@ declare abstract class BaseRepository<TDocument extends Document, TInterface ext
754
769
  count(query: Record<string, any>): Promise<number>;
755
770
  }
756
771
 
757
- export { AllExceptionsFilter, BROWSER_TYPE, BaseException, BaseFindDto, BaseRemoveAllDto, BaseRemoveDto, BaseRepository, CACHE_KEYS, CHECK_UNIQUE_FIELD, CLS_KEYS, COLLECTIONS, COUNTRIES, DATE_FORMAT, DELETE_REASON, DELETE_REASON_CODE, DEVICE_TYPE, EXPIRE_DATES, ExceptionMessages, FIELD_TRANSFORMER_REGISTRY, FIELD_TYPE, FIELD_VALIDATOR_REGISTRY, FORGOT_PASSWORD_IDENTIFIER_TYPE, FRIENDSHIP_STATUS, FieldValidator, type FieldValidatorOptions, GENDER, GOOGLE_AUTH_LOGIN_TYPE, HttpStatus, type IAccount, type IArrayFieldOptions, type IBaseFieldOptions, type IBaseRepositoryInterface, type IBaseRepositoryOptions, type IBaseRepositoryRemoveOptions, type IBaseRepositoryUpdateOptions, type IBooleanFieldOptions, type ICountry, IDENTIFIER_TYPE, type IDateFieldOptions, type IEmitWithContextClientParams, type IEnumFieldOptions, type IGeneralSettings, type ILoggedUser, type INotificationSettings, type INumberFieldOptions, type IObjectFieldOptions, type IPhoneNumber, type IPrivacySettings, type IRemoveAllResponse, type ISendWithContextClientParams, type IStringFieldOptions, type ITimeZone, type IUser, type IValidateMessageOptions, LANGUAGE, LOCAL_STORAGE_KEYS, MICROSERVICE_NAMES, NOTIFICATION_CONTENT_MODE, NOTIFICATION_SOUND_MODE, OS_TYPE, PHONE_NUMBER_ACTION, PRIVACY_SETTINGS_CHOICE, PROVIDER, PopulateOption, REDIS_KEYS, REDUCER_PATH, RESOURCE, ROLE, SOCIAL_LINK_PLATFORM, STARTUP_PAGE, TAG_TYPES, THEME, TIME_DIFFERENCE_TYPE, TIME_FORMAT, TOKEN_TYPE, USER_STATUS, VALIDATION_TYPE, accountDeletedMessage, arrayTransform, booleanTransform, changeEmailMessage, dateTransform, decryptPayload, deleteAccountMessage, emailNotFoundMessage, emitWithContext, encryptPayload, enumTransform, forgotPasswordMessage, getLang, googleSignInMessage, lowerCaseTranform, numberTransform, objectTransform, sendWithContext, signupVerifyMessage, stringTransform, upperCaseTranform, validationMessage, verifyYourselfMessage };
772
+ export { AllExceptionsFilter, BROWSER_TYPE, BaseException, BaseFindDto, BaseRemoveAllDto, BaseRemoveDto, BaseRepository, CACHE_KEYS, CHECK_UNIQUE_FIELD, CLS_KEYS, COLLECTIONS, COUNTRIES, DATE_FORMAT, DELETE_REASON, DELETE_REASON_CODE, DEVICE_TYPE, EXPIRE_DATES, ExceptionMessages, FIELD_TRANSFORMER_REGISTRY, FIELD_TYPE, FIELD_VALIDATOR_REGISTRY, FORGOT_PASSWORD_IDENTIFIER_TYPE, FRIENDSHIP_STATUS, FieldValidator, type FieldValidatorOptions, GENDER, GOOGLE_AUTH_LOGIN_TYPE, HttpStatus, type IAccount, type IArrayFieldOptions, type IBaseFieldOptions, type IBaseRepositoryInterface, type IBaseRepositoryOptions, type IBaseRepositoryRemoveOptions, type IBaseRepositoryUpdateOptions, type IBooleanFieldOptions, type ICountry, IDENTIFIER_TYPE, type IDateFieldOptions, type IEmitWithContextClientParams, type IEnumFieldOptions, type IGeneralSettings, type ILoggedUser, type INotificationSettings, type INumberFieldOptions, type IObjectFieldOptions, type IPhoneNumber, type IPrivacySettings, type IRemoveAllResponse, type IReturnedUser, type ISendWithContextClientParams, type IStringFieldOptions, type ITimeZone, type IValidateMessageOptions, LANGUAGE, LOCAL_STORAGE_KEYS, MICROSERVICE_NAMES, NOTIFICATION_CONTENT_MODE, NOTIFICATION_SOUND_MODE, OS_TYPE, PHONE_NUMBER_ACTION, PRIVACY_SETTINGS_CHOICE, PROVIDER, PopulateOption, REDIS_KEYS, REDUCER_PATH, RESOURCE, ROLE, SOCIAL_LINK_PLATFORM, STARTUP_PAGE, TAG_TYPES, THEME, TIME_DIFFERENCE_TYPE, TIME_FORMAT, TOKEN_TYPE, USER_STATUS, VALIDATION_TYPE, accountDeletedMessage, arrayTransform, booleanTransform, changeEmailMessage, dateTransform, decryptPayload, deleteAccountMessage, emailNotFoundMessage, emitWithContext, encryptPayload, enumTransform, forgotPasswordMessage, getLang, googleSignInMessage, lowerCaseTranform, numberTransform, objectTransform, sendWithContext, signupVerifyMessage, stringTransform, upperCaseTranform, validationMessage, verifyYourselfMessage };
package/dist/index.d.ts CHANGED
@@ -577,11 +577,26 @@ declare function decryptPayload(payload: string, base64Key: string): string;
577
577
  declare function sendWithContext<TResponse = any>({ client, endpoint, payload, }: ISendWithContextClientParams): Promise<TResponse>;
578
578
  declare function emitWithContext({ client, topic, payload, }: IEmitWithContextClientParams): rxjs.Observable<any>;
579
579
 
580
- interface ILoggedUser extends IUser {
580
+ interface ILoggedUser extends IReturnedUser {
581
581
  language: LANGUAGE;
582
582
  avatar: string | null;
583
583
  }
584
- interface IUser {
584
+ interface IReturnedUser {
585
+ _id: string;
586
+ username: string;
587
+ email: string;
588
+ phoneNumber: IPhoneNumber;
589
+ isTwoFactorEnabled: boolean;
590
+ timeZone: string | null;
591
+ location: string | null;
592
+ usesPasswordAuth: boolean;
593
+ usesOAuth: boolean;
594
+ hasPhoneNumber: boolean;
595
+ accountAgeInDays: number;
596
+ createdAt: Date;
597
+ updatedAt: Date;
598
+ }
599
+ interface IReturnedUser {
585
600
  _id: string;
586
601
  username: string;
587
602
  email: string;
@@ -754,4 +769,4 @@ declare abstract class BaseRepository<TDocument extends Document, TInterface ext
754
769
  count(query: Record<string, any>): Promise<number>;
755
770
  }
756
771
 
757
- export { AllExceptionsFilter, BROWSER_TYPE, BaseException, BaseFindDto, BaseRemoveAllDto, BaseRemoveDto, BaseRepository, CACHE_KEYS, CHECK_UNIQUE_FIELD, CLS_KEYS, COLLECTIONS, COUNTRIES, DATE_FORMAT, DELETE_REASON, DELETE_REASON_CODE, DEVICE_TYPE, EXPIRE_DATES, ExceptionMessages, FIELD_TRANSFORMER_REGISTRY, FIELD_TYPE, FIELD_VALIDATOR_REGISTRY, FORGOT_PASSWORD_IDENTIFIER_TYPE, FRIENDSHIP_STATUS, FieldValidator, type FieldValidatorOptions, GENDER, GOOGLE_AUTH_LOGIN_TYPE, HttpStatus, type IAccount, type IArrayFieldOptions, type IBaseFieldOptions, type IBaseRepositoryInterface, type IBaseRepositoryOptions, type IBaseRepositoryRemoveOptions, type IBaseRepositoryUpdateOptions, type IBooleanFieldOptions, type ICountry, IDENTIFIER_TYPE, type IDateFieldOptions, type IEmitWithContextClientParams, type IEnumFieldOptions, type IGeneralSettings, type ILoggedUser, type INotificationSettings, type INumberFieldOptions, type IObjectFieldOptions, type IPhoneNumber, type IPrivacySettings, type IRemoveAllResponse, type ISendWithContextClientParams, type IStringFieldOptions, type ITimeZone, type IUser, type IValidateMessageOptions, LANGUAGE, LOCAL_STORAGE_KEYS, MICROSERVICE_NAMES, NOTIFICATION_CONTENT_MODE, NOTIFICATION_SOUND_MODE, OS_TYPE, PHONE_NUMBER_ACTION, PRIVACY_SETTINGS_CHOICE, PROVIDER, PopulateOption, REDIS_KEYS, REDUCER_PATH, RESOURCE, ROLE, SOCIAL_LINK_PLATFORM, STARTUP_PAGE, TAG_TYPES, THEME, TIME_DIFFERENCE_TYPE, TIME_FORMAT, TOKEN_TYPE, USER_STATUS, VALIDATION_TYPE, accountDeletedMessage, arrayTransform, booleanTransform, changeEmailMessage, dateTransform, decryptPayload, deleteAccountMessage, emailNotFoundMessage, emitWithContext, encryptPayload, enumTransform, forgotPasswordMessage, getLang, googleSignInMessage, lowerCaseTranform, numberTransform, objectTransform, sendWithContext, signupVerifyMessage, stringTransform, upperCaseTranform, validationMessage, verifyYourselfMessage };
772
+ export { AllExceptionsFilter, BROWSER_TYPE, BaseException, BaseFindDto, BaseRemoveAllDto, BaseRemoveDto, BaseRepository, CACHE_KEYS, CHECK_UNIQUE_FIELD, CLS_KEYS, COLLECTIONS, COUNTRIES, DATE_FORMAT, DELETE_REASON, DELETE_REASON_CODE, DEVICE_TYPE, EXPIRE_DATES, ExceptionMessages, FIELD_TRANSFORMER_REGISTRY, FIELD_TYPE, FIELD_VALIDATOR_REGISTRY, FORGOT_PASSWORD_IDENTIFIER_TYPE, FRIENDSHIP_STATUS, FieldValidator, type FieldValidatorOptions, GENDER, GOOGLE_AUTH_LOGIN_TYPE, HttpStatus, type IAccount, type IArrayFieldOptions, type IBaseFieldOptions, type IBaseRepositoryInterface, type IBaseRepositoryOptions, type IBaseRepositoryRemoveOptions, type IBaseRepositoryUpdateOptions, type IBooleanFieldOptions, type ICountry, IDENTIFIER_TYPE, type IDateFieldOptions, type IEmitWithContextClientParams, type IEnumFieldOptions, type IGeneralSettings, type ILoggedUser, type INotificationSettings, type INumberFieldOptions, type IObjectFieldOptions, type IPhoneNumber, type IPrivacySettings, type IRemoveAllResponse, type IReturnedUser, type ISendWithContextClientParams, type IStringFieldOptions, type ITimeZone, type IValidateMessageOptions, LANGUAGE, LOCAL_STORAGE_KEYS, MICROSERVICE_NAMES, NOTIFICATION_CONTENT_MODE, NOTIFICATION_SOUND_MODE, OS_TYPE, PHONE_NUMBER_ACTION, PRIVACY_SETTINGS_CHOICE, PROVIDER, PopulateOption, REDIS_KEYS, REDUCER_PATH, RESOURCE, ROLE, SOCIAL_LINK_PLATFORM, STARTUP_PAGE, TAG_TYPES, THEME, TIME_DIFFERENCE_TYPE, TIME_FORMAT, TOKEN_TYPE, USER_STATUS, VALIDATION_TYPE, accountDeletedMessage, arrayTransform, booleanTransform, changeEmailMessage, dateTransform, decryptPayload, deleteAccountMessage, emailNotFoundMessage, emitWithContext, encryptPayload, enumTransform, forgotPasswordMessage, getLang, googleSignInMessage, lowerCaseTranform, numberTransform, objectTransform, sendWithContext, signupVerifyMessage, stringTransform, upperCaseTranform, validationMessage, verifyYourselfMessage };
package/dist/index.mjs CHANGED
@@ -11338,7 +11338,7 @@ var BaseRepository = class {
11338
11338
  const ids = inserted.map((doc) => doc._id);
11339
11339
  const populated = await this.model.find({ _id: { $in: ids } }).populate(
11340
11340
  opts.populate
11341
- ).lean({ virtuals }).exec();
11341
+ ).lean({ virtuals, versionKey: false }).exec();
11342
11342
  return populated;
11343
11343
  }
11344
11344
  if (virtuals) {
@@ -11357,7 +11357,7 @@ var BaseRepository = class {
11357
11357
  new: opts?.new ?? true,
11358
11358
  runValidators: opts?.runValidators ?? true,
11359
11359
  populate: opts?.populate ?? [],
11360
- lean: opts?.lean ?? true ? { virtuals: true } : false
11360
+ lean: opts?.lean ?? true ? { virtuals: true, versionKey: false } : false
11361
11361
  };
11362
11362
  const updatedData = await this.model.findOneAndUpdate(
11363
11363
  query,
@@ -11414,17 +11414,17 @@ var BaseRepository = class {
11414
11414
  populate = []
11415
11415
  } = params;
11416
11416
  const virtuals = opts?.lean ?? true;
11417
- return await this.model.findOne(query).select(fields).sort(sort).populate(populate).lean({ virtuals }).exec();
11417
+ return await this.model.findOne(query).select(fields).sort(sort).populate(populate).lean({ virtuals, versionKey: false }).exec();
11418
11418
  }
11419
11419
  async findOneById(_id, params = {}, opts) {
11420
11420
  const { fields = "", sort = { createdAt: -1 }, populate = [] } = params;
11421
11421
  const virtuals = opts?.lean ?? true;
11422
- return await this.model.findOne({ _id }).select(fields).sort(sort).populate(populate).lean({ virtuals }).exec();
11422
+ return await this.model.findOne({ _id }).select(fields).sort(sort).populate(populate).lean({ virtuals, versionKey: false }).exec();
11423
11423
  }
11424
11424
  async findOneByUserId(userId, params = {}, opts) {
11425
11425
  const { fields = "", sort = { createdAt: -1 }, populate = [] } = params;
11426
11426
  const virtuals = opts?.lean ?? true;
11427
- return await this.model.findOne({ userId }).select(fields).sort(sort).populate(populate).lean({ virtuals }).exec();
11427
+ return await this.model.findOne({ userId }).select(fields).sort(sort).populate(populate).lean({ virtuals, versionKey: false }).exec();
11428
11428
  }
11429
11429
  async findMany(params = {}, opts) {
11430
11430
  const {
@@ -11436,7 +11436,7 @@ var BaseRepository = class {
11436
11436
  limit = 10
11437
11437
  } = params;
11438
11438
  const virtuals = opts?.lean ?? true;
11439
- return await this.model.find(query).select(fields).skip(skip).limit(limit).sort(sort).populate(populate).lean({ virtuals }).exec();
11439
+ return await this.model.find(query).select(fields).skip(skip).limit(limit).sort(sort).populate(populate).lean({ virtuals, versionKey: false }).exec();
11440
11440
  }
11441
11441
  async findAll(params = {}, opts) {
11442
11442
  const {
@@ -11446,7 +11446,7 @@ var BaseRepository = class {
11446
11446
  populate = []
11447
11447
  } = params;
11448
11448
  const virtuals = opts?.lean ?? true;
11449
- return await this.model.find(query).select(fields).sort(sort).populate(populate).lean({ virtuals }).exec();
11449
+ return await this.model.find(query).select(fields).sort(sort).populate(populate).lean({ virtuals, versionKey: false }).exec();
11450
11450
  }
11451
11451
  // ================================================
11452
11452
  // EXIST AND COUNT FUNCTIONS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "connectfy-shared",
3
- "version": "0.0.90",
3
+ "version": "0.0.91",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {