connectfy-shared 0.0.106 → 0.0.108
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 +86 -57
- package/dist/index.d.cts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.mjs +85 -57
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -9498,6 +9498,7 @@ __export(index_exports, {
|
|
|
9498
9498
|
arrayTransform: () => arrayTransform,
|
|
9499
9499
|
booleanTransform: () => booleanTransform,
|
|
9500
9500
|
changeEmailMessage: () => changeEmailMessage,
|
|
9501
|
+
commitKafkaOffset: () => commitKafkaOffset,
|
|
9501
9502
|
dateTransform: () => dateTransform,
|
|
9502
9503
|
decryptPayload: () => decryptPayload,
|
|
9503
9504
|
deleteAccountMessage: () => deleteAccountMessage,
|
|
@@ -9854,63 +9855,63 @@ var FRIENDSHIP_STATUS = /* @__PURE__ */ ((FRIENDSHIP_STATUS2) => {
|
|
|
9854
9855
|
FRIENDSHIP_STATUS2["ACCEPTED"] = "ACCEPTED";
|
|
9855
9856
|
return FRIENDSHIP_STATUS2;
|
|
9856
9857
|
})(FRIENDSHIP_STATUS || {});
|
|
9857
|
-
var HttpStatus = /* @__PURE__ */ ((
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
|
|
9863
|
-
|
|
9864
|
-
|
|
9865
|
-
|
|
9866
|
-
|
|
9867
|
-
|
|
9868
|
-
|
|
9869
|
-
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
|
|
9873
|
-
|
|
9874
|
-
|
|
9875
|
-
|
|
9876
|
-
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
|
|
9880
|
-
|
|
9881
|
-
|
|
9882
|
-
|
|
9883
|
-
|
|
9884
|
-
|
|
9885
|
-
|
|
9886
|
-
|
|
9887
|
-
|
|
9888
|
-
|
|
9889
|
-
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
|
|
9893
|
-
|
|
9894
|
-
|
|
9895
|
-
|
|
9896
|
-
|
|
9897
|
-
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
|
|
9902
|
-
|
|
9903
|
-
|
|
9904
|
-
|
|
9905
|
-
|
|
9906
|
-
|
|
9907
|
-
|
|
9908
|
-
|
|
9909
|
-
|
|
9910
|
-
|
|
9911
|
-
|
|
9912
|
-
|
|
9913
|
-
return
|
|
9858
|
+
var HttpStatus = /* @__PURE__ */ ((HttpStatus4) => {
|
|
9859
|
+
HttpStatus4[HttpStatus4["CONTINUE"] = 100] = "CONTINUE";
|
|
9860
|
+
HttpStatus4[HttpStatus4["SWITCHING_PROTOCOLS"] = 101] = "SWITCHING_PROTOCOLS";
|
|
9861
|
+
HttpStatus4[HttpStatus4["PROCESSING"] = 102] = "PROCESSING";
|
|
9862
|
+
HttpStatus4[HttpStatus4["EARLYHINTS"] = 103] = "EARLYHINTS";
|
|
9863
|
+
HttpStatus4[HttpStatus4["OK"] = 200] = "OK";
|
|
9864
|
+
HttpStatus4[HttpStatus4["CREATED"] = 201] = "CREATED";
|
|
9865
|
+
HttpStatus4[HttpStatus4["ACCEPTED"] = 202] = "ACCEPTED";
|
|
9866
|
+
HttpStatus4[HttpStatus4["NON_AUTHORITATIVE_INFORMATION"] = 203] = "NON_AUTHORITATIVE_INFORMATION";
|
|
9867
|
+
HttpStatus4[HttpStatus4["NO_CONTENT"] = 204] = "NO_CONTENT";
|
|
9868
|
+
HttpStatus4[HttpStatus4["RESET_CONTENT"] = 205] = "RESET_CONTENT";
|
|
9869
|
+
HttpStatus4[HttpStatus4["PARTIAL_CONTENT"] = 206] = "PARTIAL_CONTENT";
|
|
9870
|
+
HttpStatus4[HttpStatus4["MULTI_STATUS"] = 207] = "MULTI_STATUS";
|
|
9871
|
+
HttpStatus4[HttpStatus4["ALREADY_REPORTED"] = 208] = "ALREADY_REPORTED";
|
|
9872
|
+
HttpStatus4[HttpStatus4["CONTENT_DIFFERENT"] = 210] = "CONTENT_DIFFERENT";
|
|
9873
|
+
HttpStatus4[HttpStatus4["AMBIGUOUS"] = 300] = "AMBIGUOUS";
|
|
9874
|
+
HttpStatus4[HttpStatus4["MOVED_PERMANENTLY"] = 301] = "MOVED_PERMANENTLY";
|
|
9875
|
+
HttpStatus4[HttpStatus4["FOUND"] = 302] = "FOUND";
|
|
9876
|
+
HttpStatus4[HttpStatus4["SEE_OTHER"] = 303] = "SEE_OTHER";
|
|
9877
|
+
HttpStatus4[HttpStatus4["NOT_MODIFIED"] = 304] = "NOT_MODIFIED";
|
|
9878
|
+
HttpStatus4[HttpStatus4["TEMPORARY_REDIRECT"] = 307] = "TEMPORARY_REDIRECT";
|
|
9879
|
+
HttpStatus4[HttpStatus4["PERMANENT_REDIRECT"] = 308] = "PERMANENT_REDIRECT";
|
|
9880
|
+
HttpStatus4[HttpStatus4["BAD_REQUEST"] = 400] = "BAD_REQUEST";
|
|
9881
|
+
HttpStatus4[HttpStatus4["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
|
|
9882
|
+
HttpStatus4[HttpStatus4["PAYMENT_REQUIRED"] = 402] = "PAYMENT_REQUIRED";
|
|
9883
|
+
HttpStatus4[HttpStatus4["FORBIDDEN"] = 403] = "FORBIDDEN";
|
|
9884
|
+
HttpStatus4[HttpStatus4["NOT_FOUND"] = 404] = "NOT_FOUND";
|
|
9885
|
+
HttpStatus4[HttpStatus4["METHOD_NOT_ALLOWED"] = 405] = "METHOD_NOT_ALLOWED";
|
|
9886
|
+
HttpStatus4[HttpStatus4["NOT_ACCEPTABLE"] = 406] = "NOT_ACCEPTABLE";
|
|
9887
|
+
HttpStatus4[HttpStatus4["PROXY_AUTHENTICATION_REQUIRED"] = 407] = "PROXY_AUTHENTICATION_REQUIRED";
|
|
9888
|
+
HttpStatus4[HttpStatus4["REQUEST_TIMEOUT"] = 408] = "REQUEST_TIMEOUT";
|
|
9889
|
+
HttpStatus4[HttpStatus4["CONFLICT"] = 409] = "CONFLICT";
|
|
9890
|
+
HttpStatus4[HttpStatus4["GONE"] = 410] = "GONE";
|
|
9891
|
+
HttpStatus4[HttpStatus4["LENGTH_REQUIRED"] = 411] = "LENGTH_REQUIRED";
|
|
9892
|
+
HttpStatus4[HttpStatus4["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
|
|
9893
|
+
HttpStatus4[HttpStatus4["PAYLOAD_TOO_LARGE"] = 413] = "PAYLOAD_TOO_LARGE";
|
|
9894
|
+
HttpStatus4[HttpStatus4["URI_TOO_LONG"] = 414] = "URI_TOO_LONG";
|
|
9895
|
+
HttpStatus4[HttpStatus4["UNSUPPORTED_MEDIA_TYPE"] = 415] = "UNSUPPORTED_MEDIA_TYPE";
|
|
9896
|
+
HttpStatus4[HttpStatus4["REQUESTED_RANGE_NOT_SATISFIABLE"] = 416] = "REQUESTED_RANGE_NOT_SATISFIABLE";
|
|
9897
|
+
HttpStatus4[HttpStatus4["EXPECTATION_FAILED"] = 417] = "EXPECTATION_FAILED";
|
|
9898
|
+
HttpStatus4[HttpStatus4["I_AM_A_TEAPOT"] = 418] = "I_AM_A_TEAPOT";
|
|
9899
|
+
HttpStatus4[HttpStatus4["MISDIRECTED"] = 421] = "MISDIRECTED";
|
|
9900
|
+
HttpStatus4[HttpStatus4["UNPROCESSABLE_ENTITY"] = 422] = "UNPROCESSABLE_ENTITY";
|
|
9901
|
+
HttpStatus4[HttpStatus4["LOCKED"] = 423] = "LOCKED";
|
|
9902
|
+
HttpStatus4[HttpStatus4["FAILED_DEPENDENCY"] = 424] = "FAILED_DEPENDENCY";
|
|
9903
|
+
HttpStatus4[HttpStatus4["PRECONDITION_REQUIRED"] = 428] = "PRECONDITION_REQUIRED";
|
|
9904
|
+
HttpStatus4[HttpStatus4["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
|
|
9905
|
+
HttpStatus4[HttpStatus4["UNRECOVERABLE_ERROR"] = 456] = "UNRECOVERABLE_ERROR";
|
|
9906
|
+
HttpStatus4[HttpStatus4["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
|
|
9907
|
+
HttpStatus4[HttpStatus4["NOT_IMPLEMENTED"] = 501] = "NOT_IMPLEMENTED";
|
|
9908
|
+
HttpStatus4[HttpStatus4["BAD_GATEWAY"] = 502] = "BAD_GATEWAY";
|
|
9909
|
+
HttpStatus4[HttpStatus4["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
|
|
9910
|
+
HttpStatus4[HttpStatus4["GATEWAY_TIMEOUT"] = 504] = "GATEWAY_TIMEOUT";
|
|
9911
|
+
HttpStatus4[HttpStatus4["HTTP_VERSION_NOT_SUPPORTED"] = 505] = "HTTP_VERSION_NOT_SUPPORTED";
|
|
9912
|
+
HttpStatus4[HttpStatus4["INSUFFICIENT_STORAGE"] = 507] = "INSUFFICIENT_STORAGE";
|
|
9913
|
+
HttpStatus4[HttpStatus4["LOOP_DETECTED"] = 508] = "LOOP_DETECTED";
|
|
9914
|
+
return HttpStatus4;
|
|
9914
9915
|
})(HttpStatus || {});
|
|
9915
9916
|
var REDIS_KEYS = /* @__PURE__ */ ((REDIS_KEYS2) => {
|
|
9916
9917
|
REDIS_KEYS2["REDIS_CLIENT"] = "REDIS_CLIENT";
|
|
@@ -9972,6 +9973,10 @@ var COLLECTIONS = {
|
|
|
9972
9973
|
PRIVACY: "privacy_settings",
|
|
9973
9974
|
NOTIFICATION: "notification_settings"
|
|
9974
9975
|
}
|
|
9976
|
+
},
|
|
9977
|
+
RELATIONSHIP: {
|
|
9978
|
+
FRIENDSHIPS: "friendships",
|
|
9979
|
+
BLOCKS_LIST: "blocks_list"
|
|
9975
9980
|
}
|
|
9976
9981
|
};
|
|
9977
9982
|
var EXPIRE_DATES = {
|
|
@@ -11447,6 +11452,29 @@ function emitWithContext({
|
|
|
11447
11452
|
return client.emit(topic, enrichedPayload);
|
|
11448
11453
|
}
|
|
11449
11454
|
|
|
11455
|
+
// src/functions/server/kafka-commit.helper.ts
|
|
11456
|
+
var import_common4 = require("@nestjs/common");
|
|
11457
|
+
async function commitKafkaOffset(context) {
|
|
11458
|
+
const topic = context.getTopic();
|
|
11459
|
+
const partition = context.getPartition();
|
|
11460
|
+
const originalMessage = context.getMessage();
|
|
11461
|
+
const offset = originalMessage.offset;
|
|
11462
|
+
console.log(
|
|
11463
|
+
`Committing offset ${offset} for topic ${topic}, partition ${partition}`
|
|
11464
|
+
);
|
|
11465
|
+
try {
|
|
11466
|
+
await context.getConsumer().commitOffsets([
|
|
11467
|
+
{ topic, partition, offset: (Number(offset) + 1).toString() }
|
|
11468
|
+
]);
|
|
11469
|
+
console.log("\u2705 Offset committed successfully");
|
|
11470
|
+
} catch (error) {
|
|
11471
|
+
throw new BaseException(
|
|
11472
|
+
"\u274C Failed to commit Kafka offset",
|
|
11473
|
+
import_common4.HttpStatus.INTERNAL_SERVER_ERROR
|
|
11474
|
+
);
|
|
11475
|
+
}
|
|
11476
|
+
}
|
|
11477
|
+
|
|
11450
11478
|
// src/repo/server/base.repository.ts
|
|
11451
11479
|
var BaseRepository = class {
|
|
11452
11480
|
constructor(model) {
|
|
@@ -11676,6 +11704,7 @@ var BaseRepository = class {
|
|
|
11676
11704
|
arrayTransform,
|
|
11677
11705
|
booleanTransform,
|
|
11678
11706
|
changeEmailMessage,
|
|
11707
|
+
commitKafkaOffset,
|
|
11679
11708
|
dateTransform,
|
|
11680
11709
|
decryptPayload,
|
|
11681
11710
|
deleteAccountMessage,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RpcException, ClientKafka, ClientProxy } from '@nestjs/microservices';
|
|
1
|
+
import { RpcException, ClientKafka, ClientProxy, KafkaContext } from '@nestjs/microservices';
|
|
2
2
|
import { PopulateOptions, Document, Model } from 'mongoose';
|
|
3
3
|
import { ClsService } from 'nestjs-cls';
|
|
4
4
|
import { ValidationArguments, ValidationOptions, IsIpVersion, IsNumberOptions } from 'class-validator';
|
|
@@ -447,6 +447,10 @@ declare const COLLECTIONS: {
|
|
|
447
447
|
NOTIFICATION: string;
|
|
448
448
|
};
|
|
449
449
|
};
|
|
450
|
+
RELATIONSHIP: {
|
|
451
|
+
FRIENDSHIPS: string;
|
|
452
|
+
BLOCKS_LIST: string;
|
|
453
|
+
};
|
|
450
454
|
};
|
|
451
455
|
declare const EXPIRE_DATES: {
|
|
452
456
|
JWT: {
|
|
@@ -600,6 +604,8 @@ declare function decryptPayload(payload: string, base64Key: string): string;
|
|
|
600
604
|
declare function sendWithContext<TResponse = any>({ client, endpoint, payload, }: ISendWithContextClientParams): Promise<TResponse>;
|
|
601
605
|
declare function emitWithContext({ client, topic, payload, }: IEmitWithContextClientParams): rxjs.Observable<any>;
|
|
602
606
|
|
|
607
|
+
declare function commitKafkaOffset(context: KafkaContext): Promise<void>;
|
|
608
|
+
|
|
603
609
|
interface ILoggedUser extends IReturnedUser {
|
|
604
610
|
language: LANGUAGE;
|
|
605
611
|
avatar: IAvatar | null;
|
|
@@ -801,4 +807,4 @@ declare abstract class BaseRepository<TDocument extends Document, TInterface ext
|
|
|
801
807
|
count(query: Record<string, any>): Promise<number>;
|
|
802
808
|
}
|
|
803
809
|
|
|
804
|
-
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, FRIENDSHIP_STATUS, FieldValidator, type FieldValidatorOptions, FileOwnerModule, FileUploadTopic, 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, dateTransform, decryptPayload, deleteAccountMessage, emailNotFoundMessage, emitWithContext, encryptPayload, enumTransform, forgotPasswordMessage, getLang, googleSignInMessage, lowerCaseTranform, numberTransform, objectTransform, sendWithContext, signupVerifyMessage, stringTransform, twoFactorVerifyMessage, upperCaseTranform, validationMessage, verifyYourselfMessage };
|
|
810
|
+
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, FRIENDSHIP_STATUS, FieldValidator, type FieldValidatorOptions, FileOwnerModule, FileUploadTopic, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RpcException, ClientKafka, ClientProxy } from '@nestjs/microservices';
|
|
1
|
+
import { RpcException, ClientKafka, ClientProxy, KafkaContext } from '@nestjs/microservices';
|
|
2
2
|
import { PopulateOptions, Document, Model } from 'mongoose';
|
|
3
3
|
import { ClsService } from 'nestjs-cls';
|
|
4
4
|
import { ValidationArguments, ValidationOptions, IsIpVersion, IsNumberOptions } from 'class-validator';
|
|
@@ -447,6 +447,10 @@ declare const COLLECTIONS: {
|
|
|
447
447
|
NOTIFICATION: string;
|
|
448
448
|
};
|
|
449
449
|
};
|
|
450
|
+
RELATIONSHIP: {
|
|
451
|
+
FRIENDSHIPS: string;
|
|
452
|
+
BLOCKS_LIST: string;
|
|
453
|
+
};
|
|
450
454
|
};
|
|
451
455
|
declare const EXPIRE_DATES: {
|
|
452
456
|
JWT: {
|
|
@@ -600,6 +604,8 @@ declare function decryptPayload(payload: string, base64Key: string): string;
|
|
|
600
604
|
declare function sendWithContext<TResponse = any>({ client, endpoint, payload, }: ISendWithContextClientParams): Promise<TResponse>;
|
|
601
605
|
declare function emitWithContext({ client, topic, payload, }: IEmitWithContextClientParams): rxjs.Observable<any>;
|
|
602
606
|
|
|
607
|
+
declare function commitKafkaOffset(context: KafkaContext): Promise<void>;
|
|
608
|
+
|
|
603
609
|
interface ILoggedUser extends IReturnedUser {
|
|
604
610
|
language: LANGUAGE;
|
|
605
611
|
avatar: IAvatar | null;
|
|
@@ -801,4 +807,4 @@ declare abstract class BaseRepository<TDocument extends Document, TInterface ext
|
|
|
801
807
|
count(query: Record<string, any>): Promise<number>;
|
|
802
808
|
}
|
|
803
809
|
|
|
804
|
-
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, FRIENDSHIP_STATUS, FieldValidator, type FieldValidatorOptions, FileOwnerModule, FileUploadTopic, 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, dateTransform, decryptPayload, deleteAccountMessage, emailNotFoundMessage, emitWithContext, encryptPayload, enumTransform, forgotPasswordMessage, getLang, googleSignInMessage, lowerCaseTranform, numberTransform, objectTransform, sendWithContext, signupVerifyMessage, stringTransform, twoFactorVerifyMessage, upperCaseTranform, validationMessage, verifyYourselfMessage };
|
|
810
|
+
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, FRIENDSHIP_STATUS, FieldValidator, type FieldValidatorOptions, FileOwnerModule, FileUploadTopic, 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 };
|
package/dist/index.mjs
CHANGED
|
@@ -9762,63 +9762,63 @@ var FRIENDSHIP_STATUS = /* @__PURE__ */ ((FRIENDSHIP_STATUS2) => {
|
|
|
9762
9762
|
FRIENDSHIP_STATUS2["ACCEPTED"] = "ACCEPTED";
|
|
9763
9763
|
return FRIENDSHIP_STATUS2;
|
|
9764
9764
|
})(FRIENDSHIP_STATUS || {});
|
|
9765
|
-
var HttpStatus = /* @__PURE__ */ ((
|
|
9766
|
-
|
|
9767
|
-
|
|
9768
|
-
|
|
9769
|
-
|
|
9770
|
-
|
|
9771
|
-
|
|
9772
|
-
|
|
9773
|
-
|
|
9774
|
-
|
|
9775
|
-
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
|
|
9786
|
-
|
|
9787
|
-
|
|
9788
|
-
|
|
9789
|
-
|
|
9790
|
-
|
|
9791
|
-
|
|
9792
|
-
|
|
9793
|
-
|
|
9794
|
-
|
|
9795
|
-
|
|
9796
|
-
|
|
9797
|
-
|
|
9798
|
-
|
|
9799
|
-
|
|
9800
|
-
|
|
9801
|
-
|
|
9802
|
-
|
|
9803
|
-
|
|
9804
|
-
|
|
9805
|
-
|
|
9806
|
-
|
|
9807
|
-
|
|
9808
|
-
|
|
9809
|
-
|
|
9810
|
-
|
|
9811
|
-
|
|
9812
|
-
|
|
9813
|
-
|
|
9814
|
-
|
|
9815
|
-
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
|
-
|
|
9821
|
-
return
|
|
9765
|
+
var HttpStatus = /* @__PURE__ */ ((HttpStatus4) => {
|
|
9766
|
+
HttpStatus4[HttpStatus4["CONTINUE"] = 100] = "CONTINUE";
|
|
9767
|
+
HttpStatus4[HttpStatus4["SWITCHING_PROTOCOLS"] = 101] = "SWITCHING_PROTOCOLS";
|
|
9768
|
+
HttpStatus4[HttpStatus4["PROCESSING"] = 102] = "PROCESSING";
|
|
9769
|
+
HttpStatus4[HttpStatus4["EARLYHINTS"] = 103] = "EARLYHINTS";
|
|
9770
|
+
HttpStatus4[HttpStatus4["OK"] = 200] = "OK";
|
|
9771
|
+
HttpStatus4[HttpStatus4["CREATED"] = 201] = "CREATED";
|
|
9772
|
+
HttpStatus4[HttpStatus4["ACCEPTED"] = 202] = "ACCEPTED";
|
|
9773
|
+
HttpStatus4[HttpStatus4["NON_AUTHORITATIVE_INFORMATION"] = 203] = "NON_AUTHORITATIVE_INFORMATION";
|
|
9774
|
+
HttpStatus4[HttpStatus4["NO_CONTENT"] = 204] = "NO_CONTENT";
|
|
9775
|
+
HttpStatus4[HttpStatus4["RESET_CONTENT"] = 205] = "RESET_CONTENT";
|
|
9776
|
+
HttpStatus4[HttpStatus4["PARTIAL_CONTENT"] = 206] = "PARTIAL_CONTENT";
|
|
9777
|
+
HttpStatus4[HttpStatus4["MULTI_STATUS"] = 207] = "MULTI_STATUS";
|
|
9778
|
+
HttpStatus4[HttpStatus4["ALREADY_REPORTED"] = 208] = "ALREADY_REPORTED";
|
|
9779
|
+
HttpStatus4[HttpStatus4["CONTENT_DIFFERENT"] = 210] = "CONTENT_DIFFERENT";
|
|
9780
|
+
HttpStatus4[HttpStatus4["AMBIGUOUS"] = 300] = "AMBIGUOUS";
|
|
9781
|
+
HttpStatus4[HttpStatus4["MOVED_PERMANENTLY"] = 301] = "MOVED_PERMANENTLY";
|
|
9782
|
+
HttpStatus4[HttpStatus4["FOUND"] = 302] = "FOUND";
|
|
9783
|
+
HttpStatus4[HttpStatus4["SEE_OTHER"] = 303] = "SEE_OTHER";
|
|
9784
|
+
HttpStatus4[HttpStatus4["NOT_MODIFIED"] = 304] = "NOT_MODIFIED";
|
|
9785
|
+
HttpStatus4[HttpStatus4["TEMPORARY_REDIRECT"] = 307] = "TEMPORARY_REDIRECT";
|
|
9786
|
+
HttpStatus4[HttpStatus4["PERMANENT_REDIRECT"] = 308] = "PERMANENT_REDIRECT";
|
|
9787
|
+
HttpStatus4[HttpStatus4["BAD_REQUEST"] = 400] = "BAD_REQUEST";
|
|
9788
|
+
HttpStatus4[HttpStatus4["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
|
|
9789
|
+
HttpStatus4[HttpStatus4["PAYMENT_REQUIRED"] = 402] = "PAYMENT_REQUIRED";
|
|
9790
|
+
HttpStatus4[HttpStatus4["FORBIDDEN"] = 403] = "FORBIDDEN";
|
|
9791
|
+
HttpStatus4[HttpStatus4["NOT_FOUND"] = 404] = "NOT_FOUND";
|
|
9792
|
+
HttpStatus4[HttpStatus4["METHOD_NOT_ALLOWED"] = 405] = "METHOD_NOT_ALLOWED";
|
|
9793
|
+
HttpStatus4[HttpStatus4["NOT_ACCEPTABLE"] = 406] = "NOT_ACCEPTABLE";
|
|
9794
|
+
HttpStatus4[HttpStatus4["PROXY_AUTHENTICATION_REQUIRED"] = 407] = "PROXY_AUTHENTICATION_REQUIRED";
|
|
9795
|
+
HttpStatus4[HttpStatus4["REQUEST_TIMEOUT"] = 408] = "REQUEST_TIMEOUT";
|
|
9796
|
+
HttpStatus4[HttpStatus4["CONFLICT"] = 409] = "CONFLICT";
|
|
9797
|
+
HttpStatus4[HttpStatus4["GONE"] = 410] = "GONE";
|
|
9798
|
+
HttpStatus4[HttpStatus4["LENGTH_REQUIRED"] = 411] = "LENGTH_REQUIRED";
|
|
9799
|
+
HttpStatus4[HttpStatus4["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
|
|
9800
|
+
HttpStatus4[HttpStatus4["PAYLOAD_TOO_LARGE"] = 413] = "PAYLOAD_TOO_LARGE";
|
|
9801
|
+
HttpStatus4[HttpStatus4["URI_TOO_LONG"] = 414] = "URI_TOO_LONG";
|
|
9802
|
+
HttpStatus4[HttpStatus4["UNSUPPORTED_MEDIA_TYPE"] = 415] = "UNSUPPORTED_MEDIA_TYPE";
|
|
9803
|
+
HttpStatus4[HttpStatus4["REQUESTED_RANGE_NOT_SATISFIABLE"] = 416] = "REQUESTED_RANGE_NOT_SATISFIABLE";
|
|
9804
|
+
HttpStatus4[HttpStatus4["EXPECTATION_FAILED"] = 417] = "EXPECTATION_FAILED";
|
|
9805
|
+
HttpStatus4[HttpStatus4["I_AM_A_TEAPOT"] = 418] = "I_AM_A_TEAPOT";
|
|
9806
|
+
HttpStatus4[HttpStatus4["MISDIRECTED"] = 421] = "MISDIRECTED";
|
|
9807
|
+
HttpStatus4[HttpStatus4["UNPROCESSABLE_ENTITY"] = 422] = "UNPROCESSABLE_ENTITY";
|
|
9808
|
+
HttpStatus4[HttpStatus4["LOCKED"] = 423] = "LOCKED";
|
|
9809
|
+
HttpStatus4[HttpStatus4["FAILED_DEPENDENCY"] = 424] = "FAILED_DEPENDENCY";
|
|
9810
|
+
HttpStatus4[HttpStatus4["PRECONDITION_REQUIRED"] = 428] = "PRECONDITION_REQUIRED";
|
|
9811
|
+
HttpStatus4[HttpStatus4["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
|
|
9812
|
+
HttpStatus4[HttpStatus4["UNRECOVERABLE_ERROR"] = 456] = "UNRECOVERABLE_ERROR";
|
|
9813
|
+
HttpStatus4[HttpStatus4["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
|
|
9814
|
+
HttpStatus4[HttpStatus4["NOT_IMPLEMENTED"] = 501] = "NOT_IMPLEMENTED";
|
|
9815
|
+
HttpStatus4[HttpStatus4["BAD_GATEWAY"] = 502] = "BAD_GATEWAY";
|
|
9816
|
+
HttpStatus4[HttpStatus4["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
|
|
9817
|
+
HttpStatus4[HttpStatus4["GATEWAY_TIMEOUT"] = 504] = "GATEWAY_TIMEOUT";
|
|
9818
|
+
HttpStatus4[HttpStatus4["HTTP_VERSION_NOT_SUPPORTED"] = 505] = "HTTP_VERSION_NOT_SUPPORTED";
|
|
9819
|
+
HttpStatus4[HttpStatus4["INSUFFICIENT_STORAGE"] = 507] = "INSUFFICIENT_STORAGE";
|
|
9820
|
+
HttpStatus4[HttpStatus4["LOOP_DETECTED"] = 508] = "LOOP_DETECTED";
|
|
9821
|
+
return HttpStatus4;
|
|
9822
9822
|
})(HttpStatus || {});
|
|
9823
9823
|
var REDIS_KEYS = /* @__PURE__ */ ((REDIS_KEYS2) => {
|
|
9824
9824
|
REDIS_KEYS2["REDIS_CLIENT"] = "REDIS_CLIENT";
|
|
@@ -9880,6 +9880,10 @@ var COLLECTIONS = {
|
|
|
9880
9880
|
PRIVACY: "privacy_settings",
|
|
9881
9881
|
NOTIFICATION: "notification_settings"
|
|
9882
9882
|
}
|
|
9883
|
+
},
|
|
9884
|
+
RELATIONSHIP: {
|
|
9885
|
+
FRIENDSHIPS: "friendships",
|
|
9886
|
+
BLOCKS_LIST: "blocks_list"
|
|
9883
9887
|
}
|
|
9884
9888
|
};
|
|
9885
9889
|
var EXPIRE_DATES = {
|
|
@@ -11397,6 +11401,29 @@ function emitWithContext({
|
|
|
11397
11401
|
return client.emit(topic, enrichedPayload);
|
|
11398
11402
|
}
|
|
11399
11403
|
|
|
11404
|
+
// src/functions/server/kafka-commit.helper.ts
|
|
11405
|
+
import { HttpStatus as HttpStatus3 } from "@nestjs/common";
|
|
11406
|
+
async function commitKafkaOffset(context) {
|
|
11407
|
+
const topic = context.getTopic();
|
|
11408
|
+
const partition = context.getPartition();
|
|
11409
|
+
const originalMessage = context.getMessage();
|
|
11410
|
+
const offset = originalMessage.offset;
|
|
11411
|
+
console.log(
|
|
11412
|
+
`Committing offset ${offset} for topic ${topic}, partition ${partition}`
|
|
11413
|
+
);
|
|
11414
|
+
try {
|
|
11415
|
+
await context.getConsumer().commitOffsets([
|
|
11416
|
+
{ topic, partition, offset: (Number(offset) + 1).toString() }
|
|
11417
|
+
]);
|
|
11418
|
+
console.log("\u2705 Offset committed successfully");
|
|
11419
|
+
} catch (error) {
|
|
11420
|
+
throw new BaseException(
|
|
11421
|
+
"\u274C Failed to commit Kafka offset",
|
|
11422
|
+
HttpStatus3.INTERNAL_SERVER_ERROR
|
|
11423
|
+
);
|
|
11424
|
+
}
|
|
11425
|
+
}
|
|
11426
|
+
|
|
11400
11427
|
// src/repo/server/base.repository.ts
|
|
11401
11428
|
var BaseRepository = class {
|
|
11402
11429
|
constructor(model) {
|
|
@@ -11625,6 +11652,7 @@ export {
|
|
|
11625
11652
|
arrayTransform,
|
|
11626
11653
|
booleanTransform,
|
|
11627
11654
|
changeEmailMessage,
|
|
11655
|
+
commitKafkaOffset,
|
|
11628
11656
|
dateTransform,
|
|
11629
11657
|
decryptPayload,
|
|
11630
11658
|
deleteAccountMessage,
|