connectfy-shared 0.0.110 → 0.0.112

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
@@ -9513,6 +9513,7 @@ __export(index_exports, {
9513
9513
  numberTransform: () => numberTransform,
9514
9514
  objectTransform: () => objectTransform,
9515
9515
  sendWithContext: () => sendWithContext,
9516
+ shouldShowField: () => shouldShowField,
9516
9517
  signupVerifyMessage: () => signupVerifyMessage,
9517
9518
  stringTransform: () => stringTransform,
9518
9519
  twoFactorVerifyMessage: () => twoFactorVerifyMessage,
@@ -11483,6 +11484,14 @@ async function commitKafkaOffset(context) {
11483
11484
  }
11484
11485
  }
11485
11486
 
11487
+ // src/functions/server/privacy-settings.helper.ts
11488
+ function shouldShowField(setting, isFriend, isOwnProfile) {
11489
+ if (isOwnProfile) return true;
11490
+ if (!setting || setting === "EVERYONE" /* EVERYONE */) return true;
11491
+ if (setting === "MY_FRIENDS" /* MY_FRIENDS */) return isFriend;
11492
+ return false;
11493
+ }
11494
+
11486
11495
  // src/repo/server/base.repository.ts
11487
11496
  var BaseRepository = class {
11488
11497
  constructor(model) {
@@ -11727,6 +11736,7 @@ var BaseRepository = class {
11727
11736
  numberTransform,
11728
11737
  objectTransform,
11729
11738
  sendWithContext,
11739
+ shouldShowField,
11730
11740
  signupVerifyMessage,
11731
11741
  stringTransform,
11732
11742
  twoFactorVerifyMessage,
package/dist/index.d.cts CHANGED
@@ -608,6 +608,8 @@ declare function emitWithContext({ client, topic, payload, }: IEmitWithContextCl
608
608
 
609
609
  declare function commitKafkaOffset(context: KafkaContext): Promise<void>;
610
610
 
611
+ declare function shouldShowField(setting: PRIVACY_SETTINGS_CHOICE | undefined, isFriend: boolean, isOwnProfile: boolean): boolean;
612
+
611
613
  interface ILoggedUser extends IReturnedUser {
612
614
  language: LANGUAGE;
613
615
  avatar: IAvatar | null;
@@ -809,4 +811,4 @@ declare abstract class BaseRepository<TDocument extends Document, TInterface ext
809
811
  count(query: Record<string, any>): Promise<number>;
810
812
  }
811
813
 
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 };
814
+ 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, shouldShowField, signupVerifyMessage, stringTransform, twoFactorVerifyMessage, upperCaseTranform, validationMessage, verifyYourselfMessage };
package/dist/index.d.ts CHANGED
@@ -608,6 +608,8 @@ declare function emitWithContext({ client, topic, payload, }: IEmitWithContextCl
608
608
 
609
609
  declare function commitKafkaOffset(context: KafkaContext): Promise<void>;
610
610
 
611
+ declare function shouldShowField(setting: PRIVACY_SETTINGS_CHOICE | undefined, isFriend: boolean, isOwnProfile: boolean): boolean;
612
+
611
613
  interface ILoggedUser extends IReturnedUser {
612
614
  language: LANGUAGE;
613
615
  avatar: IAvatar | null;
@@ -809,4 +811,4 @@ declare abstract class BaseRepository<TDocument extends Document, TInterface ext
809
811
  count(query: Record<string, any>): Promise<number>;
810
812
  }
811
813
 
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 };
814
+ 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, shouldShowField, signupVerifyMessage, stringTransform, twoFactorVerifyMessage, upperCaseTranform, validationMessage, verifyYourselfMessage };
package/dist/index.mjs CHANGED
@@ -11432,6 +11432,14 @@ async function commitKafkaOffset(context) {
11432
11432
  }
11433
11433
  }
11434
11434
 
11435
+ // src/functions/server/privacy-settings.helper.ts
11436
+ function shouldShowField(setting, isFriend, isOwnProfile) {
11437
+ if (isOwnProfile) return true;
11438
+ if (!setting || setting === "EVERYONE" /* EVERYONE */) return true;
11439
+ if (setting === "MY_FRIENDS" /* MY_FRIENDS */) return isFriend;
11440
+ return false;
11441
+ }
11442
+
11435
11443
  // src/repo/server/base.repository.ts
11436
11444
  var BaseRepository = class {
11437
11445
  constructor(model) {
@@ -11675,6 +11683,7 @@ export {
11675
11683
  numberTransform,
11676
11684
  objectTransform,
11677
11685
  sendWithContext,
11686
+ shouldShowField,
11678
11687
  signupVerifyMessage,
11679
11688
  stringTransform,
11680
11689
  twoFactorVerifyMessage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "connectfy-shared",
3
- "version": "0.0.110",
3
+ "version": "0.0.112",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {