connectfy-shared 0.0.111 → 0.0.113

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
@@ -9463,6 +9463,7 @@ __export(index_exports, {
9463
9463
  FieldValidator: () => FieldValidator,
9464
9464
  FileOwnerModule: () => FileOwnerModule,
9465
9465
  FileUploadTopic: () => FileUploadTopic,
9466
+ FriendshipRequestType: () => FriendshipRequestType,
9466
9467
  FriendshipStatus: () => FriendshipStatus,
9467
9468
  GENDER: () => GENDER,
9468
9469
  GOOGLE_AUTH_LOGIN_TYPE: () => GOOGLE_AUTH_LOGIN_TYPE,
@@ -9513,6 +9514,7 @@ __export(index_exports, {
9513
9514
  numberTransform: () => numberTransform,
9514
9515
  objectTransform: () => objectTransform,
9515
9516
  sendWithContext: () => sendWithContext,
9517
+ shouldShowField: () => shouldShowField,
9516
9518
  signupVerifyMessage: () => signupVerifyMessage,
9517
9519
  stringTransform: () => stringTransform,
9518
9520
  twoFactorVerifyMessage: () => twoFactorVerifyMessage,
@@ -9941,6 +9943,11 @@ var AvatarFormats = /* @__PURE__ */ ((AvatarFormats2) => {
9941
9943
  AvatarFormats2["Micah"] = "micah";
9942
9944
  return AvatarFormats2;
9943
9945
  })(AvatarFormats || {});
9946
+ var FriendshipRequestType = /* @__PURE__ */ ((FriendshipRequestType2) => {
9947
+ FriendshipRequestType2["Received"] = "Received";
9948
+ FriendshipRequestType2["Sent"] = "Sent";
9949
+ return FriendshipRequestType2;
9950
+ })(FriendshipRequestType || {});
9944
9951
 
9945
9952
  // src/constants/server/constants.ts
9946
9953
  var MICROSERVICE_NAMES = {
@@ -11483,6 +11490,14 @@ async function commitKafkaOffset(context) {
11483
11490
  }
11484
11491
  }
11485
11492
 
11493
+ // src/functions/server/privacy-settings.helper.ts
11494
+ function shouldShowField(setting, isFriend, isOwnProfile) {
11495
+ if (isOwnProfile) return true;
11496
+ if (!setting || setting === "EVERYONE" /* EVERYONE */) return true;
11497
+ if (setting === "MY_FRIENDS" /* MY_FRIENDS */) return isFriend;
11498
+ return false;
11499
+ }
11500
+
11486
11501
  // src/repo/server/base.repository.ts
11487
11502
  var BaseRepository = class {
11488
11503
  constructor(model) {
@@ -11677,6 +11692,7 @@ var BaseRepository = class {
11677
11692
  FieldValidator,
11678
11693
  FileOwnerModule,
11679
11694
  FileUploadTopic,
11695
+ FriendshipRequestType,
11680
11696
  FriendshipStatus,
11681
11697
  GENDER,
11682
11698
  GOOGLE_AUTH_LOGIN_TYPE,
@@ -11727,6 +11743,7 @@ var BaseRepository = class {
11727
11743
  numberTransform,
11728
11744
  objectTransform,
11729
11745
  sendWithContext,
11746
+ shouldShowField,
11730
11747
  signupVerifyMessage,
11731
11748
  stringTransform,
11732
11749
  twoFactorVerifyMessage,
package/dist/index.d.cts CHANGED
@@ -380,6 +380,10 @@ declare enum AvatarFormats {
380
380
  ToonHead = "toon-head",
381
381
  Micah = "micah"
382
382
  }
383
+ declare enum FriendshipRequestType {
384
+ Received = "Received",
385
+ Sent = "Sent"
386
+ }
383
387
 
384
388
  interface ICountry {
385
389
  key: string;
@@ -608,6 +612,8 @@ declare function emitWithContext({ client, topic, payload, }: IEmitWithContextCl
608
612
 
609
613
  declare function commitKafkaOffset(context: KafkaContext): Promise<void>;
610
614
 
615
+ declare function shouldShowField(setting: PRIVACY_SETTINGS_CHOICE | undefined, isFriend: boolean, isOwnProfile: boolean): boolean;
616
+
611
617
  interface ILoggedUser extends IReturnedUser {
612
618
  language: LANGUAGE;
613
619
  avatar: IAvatar | null;
@@ -809,4 +815,4 @@ declare abstract class BaseRepository<TDocument extends Document, TInterface ext
809
815
  count(query: Record<string, any>): Promise<number>;
810
816
  }
811
817
 
812
- 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, 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, signupVerifyMessage, stringTransform, twoFactorVerifyMessage, upperCaseTranform, validationMessage, verifyYourselfMessage };
818
+ 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
@@ -380,6 +380,10 @@ declare enum AvatarFormats {
380
380
  ToonHead = "toon-head",
381
381
  Micah = "micah"
382
382
  }
383
+ declare enum FriendshipRequestType {
384
+ Received = "Received",
385
+ Sent = "Sent"
386
+ }
383
387
 
384
388
  interface ICountry {
385
389
  key: string;
@@ -608,6 +612,8 @@ declare function emitWithContext({ client, topic, payload, }: IEmitWithContextCl
608
612
 
609
613
  declare function commitKafkaOffset(context: KafkaContext): Promise<void>;
610
614
 
615
+ declare function shouldShowField(setting: PRIVACY_SETTINGS_CHOICE | undefined, isFriend: boolean, isOwnProfile: boolean): boolean;
616
+
611
617
  interface ILoggedUser extends IReturnedUser {
612
618
  language: LANGUAGE;
613
619
  avatar: IAvatar | null;
@@ -809,4 +815,4 @@ declare abstract class BaseRepository<TDocument extends Document, TInterface ext
809
815
  count(query: Record<string, any>): Promise<number>;
810
816
  }
811
817
 
812
- 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, 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, signupVerifyMessage, stringTransform, twoFactorVerifyMessage, upperCaseTranform, validationMessage, verifyYourselfMessage };
818
+ 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
@@ -9848,6 +9848,11 @@ var AvatarFormats = /* @__PURE__ */ ((AvatarFormats2) => {
9848
9848
  AvatarFormats2["Micah"] = "micah";
9849
9849
  return AvatarFormats2;
9850
9850
  })(AvatarFormats || {});
9851
+ var FriendshipRequestType = /* @__PURE__ */ ((FriendshipRequestType2) => {
9852
+ FriendshipRequestType2["Received"] = "Received";
9853
+ FriendshipRequestType2["Sent"] = "Sent";
9854
+ return FriendshipRequestType2;
9855
+ })(FriendshipRequestType || {});
9851
9856
 
9852
9857
  // src/constants/server/constants.ts
9853
9858
  var MICROSERVICE_NAMES = {
@@ -11432,6 +11437,14 @@ async function commitKafkaOffset(context) {
11432
11437
  }
11433
11438
  }
11434
11439
 
11440
+ // src/functions/server/privacy-settings.helper.ts
11441
+ function shouldShowField(setting, isFriend, isOwnProfile) {
11442
+ if (isOwnProfile) return true;
11443
+ if (!setting || setting === "EVERYONE" /* EVERYONE */) return true;
11444
+ if (setting === "MY_FRIENDS" /* MY_FRIENDS */) return isFriend;
11445
+ return false;
11446
+ }
11447
+
11435
11448
  // src/repo/server/base.repository.ts
11436
11449
  var BaseRepository = class {
11437
11450
  constructor(model) {
@@ -11625,6 +11638,7 @@ export {
11625
11638
  FieldValidator,
11626
11639
  FileOwnerModule,
11627
11640
  FileUploadTopic,
11641
+ FriendshipRequestType,
11628
11642
  FriendshipStatus,
11629
11643
  GENDER,
11630
11644
  GOOGLE_AUTH_LOGIN_TYPE,
@@ -11675,6 +11689,7 @@ export {
11675
11689
  numberTransform,
11676
11690
  objectTransform,
11677
11691
  sendWithContext,
11692
+ shouldShowField,
11678
11693
  signupVerifyMessage,
11679
11694
  stringTransform,
11680
11695
  twoFactorVerifyMessage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "connectfy-shared",
3
- "version": "0.0.111",
3
+ "version": "0.0.113",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {