connectfy-shared 0.0.106 → 0.0.107
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 +82 -57
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.mjs +81 -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";
|
|
@@ -11447,6 +11448,29 @@ function emitWithContext({
|
|
|
11447
11448
|
return client.emit(topic, enrichedPayload);
|
|
11448
11449
|
}
|
|
11449
11450
|
|
|
11451
|
+
// src/functions/server/kafka-commit.helper.ts
|
|
11452
|
+
var import_common4 = require("@nestjs/common");
|
|
11453
|
+
async function commitKafkaOffset(context) {
|
|
11454
|
+
const topic = context.getTopic();
|
|
11455
|
+
const partition = context.getPartition();
|
|
11456
|
+
const originalMessage = context.getMessage();
|
|
11457
|
+
const offset = originalMessage.offset;
|
|
11458
|
+
console.log(
|
|
11459
|
+
`Committing offset ${offset} for topic ${topic}, partition ${partition}`
|
|
11460
|
+
);
|
|
11461
|
+
try {
|
|
11462
|
+
await context.getConsumer().commitOffsets([
|
|
11463
|
+
{ topic, partition, offset: (Number(offset) + 1).toString() }
|
|
11464
|
+
]);
|
|
11465
|
+
console.log("\u2705 Offset committed successfully");
|
|
11466
|
+
} catch (error) {
|
|
11467
|
+
throw new BaseException(
|
|
11468
|
+
"\u274C Failed to commit Kafka offset",
|
|
11469
|
+
import_common4.HttpStatus.INTERNAL_SERVER_ERROR
|
|
11470
|
+
);
|
|
11471
|
+
}
|
|
11472
|
+
}
|
|
11473
|
+
|
|
11450
11474
|
// src/repo/server/base.repository.ts
|
|
11451
11475
|
var BaseRepository = class {
|
|
11452
11476
|
constructor(model) {
|
|
@@ -11676,6 +11700,7 @@ var BaseRepository = class {
|
|
|
11676
11700
|
arrayTransform,
|
|
11677
11701
|
booleanTransform,
|
|
11678
11702
|
changeEmailMessage,
|
|
11703
|
+
commitKafkaOffset,
|
|
11679
11704
|
dateTransform,
|
|
11680
11705
|
decryptPayload,
|
|
11681
11706
|
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';
|
|
@@ -600,6 +600,8 @@ declare function decryptPayload(payload: string, base64Key: string): string;
|
|
|
600
600
|
declare function sendWithContext<TResponse = any>({ client, endpoint, payload, }: ISendWithContextClientParams): Promise<TResponse>;
|
|
601
601
|
declare function emitWithContext({ client, topic, payload, }: IEmitWithContextClientParams): rxjs.Observable<any>;
|
|
602
602
|
|
|
603
|
+
declare function commitKafkaOffset(context: KafkaContext): Promise<void>;
|
|
604
|
+
|
|
603
605
|
interface ILoggedUser extends IReturnedUser {
|
|
604
606
|
language: LANGUAGE;
|
|
605
607
|
avatar: IAvatar | null;
|
|
@@ -801,4 +803,4 @@ declare abstract class BaseRepository<TDocument extends Document, TInterface ext
|
|
|
801
803
|
count(query: Record<string, any>): Promise<number>;
|
|
802
804
|
}
|
|
803
805
|
|
|
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 };
|
|
806
|
+
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';
|
|
@@ -600,6 +600,8 @@ declare function decryptPayload(payload: string, base64Key: string): string;
|
|
|
600
600
|
declare function sendWithContext<TResponse = any>({ client, endpoint, payload, }: ISendWithContextClientParams): Promise<TResponse>;
|
|
601
601
|
declare function emitWithContext({ client, topic, payload, }: IEmitWithContextClientParams): rxjs.Observable<any>;
|
|
602
602
|
|
|
603
|
+
declare function commitKafkaOffset(context: KafkaContext): Promise<void>;
|
|
604
|
+
|
|
603
605
|
interface ILoggedUser extends IReturnedUser {
|
|
604
606
|
language: LANGUAGE;
|
|
605
607
|
avatar: IAvatar | null;
|
|
@@ -801,4 +803,4 @@ declare abstract class BaseRepository<TDocument extends Document, TInterface ext
|
|
|
801
803
|
count(query: Record<string, any>): Promise<number>;
|
|
802
804
|
}
|
|
803
805
|
|
|
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 };
|
|
806
|
+
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";
|
|
@@ -11397,6 +11397,29 @@ function emitWithContext({
|
|
|
11397
11397
|
return client.emit(topic, enrichedPayload);
|
|
11398
11398
|
}
|
|
11399
11399
|
|
|
11400
|
+
// src/functions/server/kafka-commit.helper.ts
|
|
11401
|
+
import { HttpStatus as HttpStatus3 } from "@nestjs/common";
|
|
11402
|
+
async function commitKafkaOffset(context) {
|
|
11403
|
+
const topic = context.getTopic();
|
|
11404
|
+
const partition = context.getPartition();
|
|
11405
|
+
const originalMessage = context.getMessage();
|
|
11406
|
+
const offset = originalMessage.offset;
|
|
11407
|
+
console.log(
|
|
11408
|
+
`Committing offset ${offset} for topic ${topic}, partition ${partition}`
|
|
11409
|
+
);
|
|
11410
|
+
try {
|
|
11411
|
+
await context.getConsumer().commitOffsets([
|
|
11412
|
+
{ topic, partition, offset: (Number(offset) + 1).toString() }
|
|
11413
|
+
]);
|
|
11414
|
+
console.log("\u2705 Offset committed successfully");
|
|
11415
|
+
} catch (error) {
|
|
11416
|
+
throw new BaseException(
|
|
11417
|
+
"\u274C Failed to commit Kafka offset",
|
|
11418
|
+
HttpStatus3.INTERNAL_SERVER_ERROR
|
|
11419
|
+
);
|
|
11420
|
+
}
|
|
11421
|
+
}
|
|
11422
|
+
|
|
11400
11423
|
// src/repo/server/base.repository.ts
|
|
11401
11424
|
var BaseRepository = class {
|
|
11402
11425
|
constructor(model) {
|
|
@@ -11625,6 +11648,7 @@ export {
|
|
|
11625
11648
|
arrayTransform,
|
|
11626
11649
|
booleanTransform,
|
|
11627
11650
|
changeEmailMessage,
|
|
11651
|
+
commitKafkaOffset,
|
|
11628
11652
|
dateTransform,
|
|
11629
11653
|
decryptPayload,
|
|
11630
11654
|
deleteAccountMessage,
|