connectfy-shared 0.0.113 → 0.0.115

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
@@ -11593,6 +11593,12 @@ var BaseRepository = class {
11593
11593
  }
11594
11594
  return await this.model.deleteMany({ _id: { $in: data._ids } }).exec();
11595
11595
  }
11596
+ async removeManyByQuery(query, opts) {
11597
+ if (opts?.lean) {
11598
+ return await this.model.deleteMany(query).lean().exec();
11599
+ }
11600
+ return await this.model.deleteMany(query).exec();
11601
+ }
11596
11602
  // ================================================
11597
11603
  // FINE ONE AND FIND MANY FUNCTIONS
11598
11604
  // ================================================
@@ -11663,6 +11669,12 @@ var BaseRepository = class {
11663
11669
  async count(query) {
11664
11670
  return await this.model.countDocuments(query).exec();
11665
11671
  }
11672
+ // ================================================
11673
+ // AGGREGATE FUNCTION
11674
+ // ================================================
11675
+ async aggregate(pipeline) {
11676
+ return await this.model.aggregate(pipeline).exec();
11677
+ }
11666
11678
  };
11667
11679
  // Annotate the CommonJS export names for ESM import in node:
11668
11680
  0 && (module.exports = {
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { RpcException, ClientKafka, ClientProxy, KafkaContext } from '@nestjs/microservices';
2
- import { PopulateOptions, Document, Model } from 'mongoose';
2
+ import { PopulateOptions, Document, Model, PipelineStage } from 'mongoose';
3
3
  import { ClsService } from 'nestjs-cls';
4
4
  import { ValidationArguments, ValidationOptions, IsIpVersion, IsNumberOptions } from 'class-validator';
5
5
  import { ClassConstructor } from 'class-transformer';
@@ -806,6 +806,7 @@ declare abstract class BaseRepository<TDocument extends Document, TInterface ext
806
806
  remove(data: BaseRemoveDto, opts?: IBaseRepositoryRemoveOptions): Promise<TInterface>;
807
807
  removeOne(query: Record<string, any>, opts?: IBaseRepositoryRemoveOptions): Promise<TInterface>;
808
808
  removeMany(data: BaseRemoveAllDto, opts?: IBaseRepositoryRemoveOptions): Promise<TInterface[]>;
809
+ removeManyByQuery(query: Record<string, any>, opts?: IBaseRepositoryRemoveOptions): Promise<TInterface[]>;
809
810
  findOne(params?: BaseFindDto, opts?: IBaseRepositoryOptions): Promise<TInterface | TDocument | null>;
810
811
  findOneById(_id: string, params?: BaseFindDto, opts?: IBaseRepositoryOptions): Promise<TInterface | TDocument | null>;
811
812
  findOneByUserId(userId: string, params?: BaseFindDto, opts?: IBaseRepositoryOptions): Promise<TInterface | TDocument | null>;
@@ -813,6 +814,7 @@ declare abstract class BaseRepository<TDocument extends Document, TInterface ext
813
814
  findAll(params?: BaseFindDto, opts?: IBaseRepositoryOptions): Promise<TInterface[] | TDocument[]>;
814
815
  existsByField(query: Record<string, any>): Promise<boolean>;
815
816
  count(query: Record<string, any>): Promise<number>;
817
+ aggregate<R = any>(pipeline: PipelineStage[]): Promise<R[]>;
816
818
  }
817
819
 
818
820
  export { AllExceptionsFilter, AvatarFormats, 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, FieldValidator, type FieldValidatorOptions, FileOwnerModule, FileUploadTopic, FriendshipRequestType, FriendshipStatus, GENDER, GOOGLE_AUTH_LOGIN_TYPE, HttpStatus, type IAccount, type IArrayFieldOptions, type IAvatar, type IBaseFieldOptions, type IBaseRepositoryInterface, type IBaseRepositoryOptions, type IBaseRepositoryRemoveOptions, type IBaseRepositoryUpdateOptions, type IBooleanFieldOptions, type ICountry, IDENTIFIER_TYPE, type IDateFieldOptions, type IDefaultAvatar, type IEmitWithContextClientParams, type IEnumFieldOptions, type IFindAllResponse, type IGeneralSettings, type ILoggedUser, type INotificationSettings, type INumberFieldOptions, type IObjectFieldOptions, type IPhoneNumber, type IPrivacySettings, type IRemoveAllResponse, type IResponse, type IReturnedUser, type ISendWithContextClientParams, type IStringFieldOptions, type ITimeZone, type IValidateMessageOptions, LANGUAGE, LOCAL_STORAGE_KEYS, MICROSERVICE_NAMES, MODULE_TO_TOPIC_MAP, NOTIFICATION_CONTENT_MODE, NOTIFICATION_SOUND_MODE, OS_TYPE, PHONE_NUMBER_ACTION, PRIVACY_SETTINGS_CHOICE, PROVIDER, PopulateOption, ProfilePhotoUpdateAction, REDIS_KEYS, REDUCER_PATH, RESOURCE, ROLE, SOCIAL_LINK_PLATFORM, STARTUP_PAGE, TAG_TYPES, THEME, TIME_DIFFERENCE_TYPE, TIME_FORMAT, TOKEN_TYPE, TWO_FACTOR_ACTION, USER_STATUS, VALIDATION_TYPE, accountDeletedMessage, arrayTransform, booleanTransform, changeEmailMessage, commitKafkaOffset, dateTransform, decryptPayload, deleteAccountMessage, emailNotFoundMessage, emitWithContext, encryptPayload, enumTransform, forgotPasswordMessage, getLang, googleSignInMessage, lowerCaseTranform, numberTransform, objectTransform, sendWithContext, shouldShowField, signupVerifyMessage, stringTransform, twoFactorVerifyMessage, upperCaseTranform, validationMessage, verifyYourselfMessage };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { RpcException, ClientKafka, ClientProxy, KafkaContext } from '@nestjs/microservices';
2
- import { PopulateOptions, Document, Model } from 'mongoose';
2
+ import { PopulateOptions, Document, Model, PipelineStage } from 'mongoose';
3
3
  import { ClsService } from 'nestjs-cls';
4
4
  import { ValidationArguments, ValidationOptions, IsIpVersion, IsNumberOptions } from 'class-validator';
5
5
  import { ClassConstructor } from 'class-transformer';
@@ -806,6 +806,7 @@ declare abstract class BaseRepository<TDocument extends Document, TInterface ext
806
806
  remove(data: BaseRemoveDto, opts?: IBaseRepositoryRemoveOptions): Promise<TInterface>;
807
807
  removeOne(query: Record<string, any>, opts?: IBaseRepositoryRemoveOptions): Promise<TInterface>;
808
808
  removeMany(data: BaseRemoveAllDto, opts?: IBaseRepositoryRemoveOptions): Promise<TInterface[]>;
809
+ removeManyByQuery(query: Record<string, any>, opts?: IBaseRepositoryRemoveOptions): Promise<TInterface[]>;
809
810
  findOne(params?: BaseFindDto, opts?: IBaseRepositoryOptions): Promise<TInterface | TDocument | null>;
810
811
  findOneById(_id: string, params?: BaseFindDto, opts?: IBaseRepositoryOptions): Promise<TInterface | TDocument | null>;
811
812
  findOneByUserId(userId: string, params?: BaseFindDto, opts?: IBaseRepositoryOptions): Promise<TInterface | TDocument | null>;
@@ -813,6 +814,7 @@ declare abstract class BaseRepository<TDocument extends Document, TInterface ext
813
814
  findAll(params?: BaseFindDto, opts?: IBaseRepositoryOptions): Promise<TInterface[] | TDocument[]>;
814
815
  existsByField(query: Record<string, any>): Promise<boolean>;
815
816
  count(query: Record<string, any>): Promise<number>;
817
+ aggregate<R = any>(pipeline: PipelineStage[]): Promise<R[]>;
816
818
  }
817
819
 
818
820
  export { AllExceptionsFilter, AvatarFormats, 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, FieldValidator, type FieldValidatorOptions, FileOwnerModule, FileUploadTopic, FriendshipRequestType, FriendshipStatus, GENDER, GOOGLE_AUTH_LOGIN_TYPE, HttpStatus, type IAccount, type IArrayFieldOptions, type IAvatar, type IBaseFieldOptions, type IBaseRepositoryInterface, type IBaseRepositoryOptions, type IBaseRepositoryRemoveOptions, type IBaseRepositoryUpdateOptions, type IBooleanFieldOptions, type ICountry, IDENTIFIER_TYPE, type IDateFieldOptions, type IDefaultAvatar, type IEmitWithContextClientParams, type IEnumFieldOptions, type IFindAllResponse, type IGeneralSettings, type ILoggedUser, type INotificationSettings, type INumberFieldOptions, type IObjectFieldOptions, type IPhoneNumber, type IPrivacySettings, type IRemoveAllResponse, type IResponse, type IReturnedUser, type ISendWithContextClientParams, type IStringFieldOptions, type ITimeZone, type IValidateMessageOptions, LANGUAGE, LOCAL_STORAGE_KEYS, MICROSERVICE_NAMES, MODULE_TO_TOPIC_MAP, NOTIFICATION_CONTENT_MODE, NOTIFICATION_SOUND_MODE, OS_TYPE, PHONE_NUMBER_ACTION, PRIVACY_SETTINGS_CHOICE, PROVIDER, PopulateOption, ProfilePhotoUpdateAction, REDIS_KEYS, REDUCER_PATH, RESOURCE, ROLE, SOCIAL_LINK_PLATFORM, STARTUP_PAGE, TAG_TYPES, THEME, TIME_DIFFERENCE_TYPE, TIME_FORMAT, TOKEN_TYPE, TWO_FACTOR_ACTION, USER_STATUS, VALIDATION_TYPE, accountDeletedMessage, arrayTransform, booleanTransform, changeEmailMessage, commitKafkaOffset, dateTransform, decryptPayload, deleteAccountMessage, emailNotFoundMessage, emitWithContext, encryptPayload, enumTransform, forgotPasswordMessage, getLang, googleSignInMessage, lowerCaseTranform, numberTransform, objectTransform, sendWithContext, shouldShowField, signupVerifyMessage, stringTransform, twoFactorVerifyMessage, upperCaseTranform, validationMessage, verifyYourselfMessage };
package/dist/index.mjs CHANGED
@@ -11540,6 +11540,12 @@ var BaseRepository = class {
11540
11540
  }
11541
11541
  return await this.model.deleteMany({ _id: { $in: data._ids } }).exec();
11542
11542
  }
11543
+ async removeManyByQuery(query, opts) {
11544
+ if (opts?.lean) {
11545
+ return await this.model.deleteMany(query).lean().exec();
11546
+ }
11547
+ return await this.model.deleteMany(query).exec();
11548
+ }
11543
11549
  // ================================================
11544
11550
  // FINE ONE AND FIND MANY FUNCTIONS
11545
11551
  // ================================================
@@ -11610,6 +11616,12 @@ var BaseRepository = class {
11610
11616
  async count(query) {
11611
11617
  return await this.model.countDocuments(query).exec();
11612
11618
  }
11619
+ // ================================================
11620
+ // AGGREGATE FUNCTION
11621
+ // ================================================
11622
+ async aggregate(pipeline) {
11623
+ return await this.model.aggregate(pipeline).exec();
11624
+ }
11613
11625
  };
11614
11626
  export {
11615
11627
  AllExceptionsFilter,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "connectfy-shared",
3
- "version": "0.0.113",
3
+ "version": "0.0.115",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {