ovi-kit 1.2.2 → 1.2.3

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.d.ts CHANGED
@@ -26,6 +26,7 @@ export { ApiMeta } from './shared/decorators/api-meta.decorator';
26
26
  export { API_META_KEY } from './shared/decorators/api-meta.decorator';
27
27
  export type { ApiMetaOptions } from './shared/decorators/api-meta.decorator';
28
28
  export { CustomDate } from './shared/decorators/custom-date';
29
+ export { IsLuhn } from './shared/decorators/luhn';
29
30
  export { RedisService } from './shared/modules/redis/redis.service';
30
31
  export { CustomHttpService } from './shared/modules/http/http.service';
31
32
  export { RedisModule } from './shared/modules/redis/redis.module';
@@ -47,6 +48,7 @@ export type { PaymentType } from './shared/types/payment-type';
47
48
  export type { LeadSource } from './shared/types/lead-source';
48
49
  export type { PaymentProviderType } from './shared/types/payment-provider';
49
50
  export type { PaymentProviderSetting } from './shared/types/payment-provider-setting';
51
+ export type { CardType } from './shared/types/card';
50
52
  export { WEEKDAYS } from './shared/arrays/weekdays';
51
53
  export { CustomRpcException } from './shared/exceptions/custom-rpc.exception';
52
54
  export { RpcErrorCode } from './shared/enums/exception-codes';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.INTERNAL_SERVER_ERROR = exports.RpcErrorCode = exports.CustomRpcException = exports.WEEKDAYS = exports.SharedModule = exports.CustomHttpModule = exports.RedisModule = exports.CustomHttpService = exports.RedisService = exports.CustomDate = exports.API_META_KEY = exports.ApiMeta = exports.BaseEntity = exports.createRandomPassword = exports.getFiveMinutesLater = exports.uuid = exports.PasswordVo = exports.UserMinimalDataResponseDto = exports.GetByIdsDto = exports.CheckUserDto = exports.LoginDto = exports.BaseDto = exports.BaseResponseDto = exports.GetByIdDto = exports.GetByNameDto = exports.MetaDataDto = exports.PaginationResponseDto = exports.PaginationDto = exports.DeleteUserDto = exports.ForgotPasswordDto = exports.UserConfirmDto = exports.RevokeSessionDto = exports.ResetPasswordDto = exports.ResendOtpDto = exports.RecoveryPasswordDto = exports.MetaDto = void 0;
3
+ exports.INTERNAL_SERVER_ERROR = exports.RpcErrorCode = exports.CustomRpcException = exports.WEEKDAYS = exports.SharedModule = exports.CustomHttpModule = exports.RedisModule = exports.CustomHttpService = exports.RedisService = exports.IsLuhn = exports.CustomDate = exports.API_META_KEY = exports.ApiMeta = exports.BaseEntity = exports.createRandomPassword = exports.getFiveMinutesLater = exports.uuid = exports.PasswordVo = exports.UserMinimalDataResponseDto = exports.GetByIdsDto = exports.CheckUserDto = exports.LoginDto = exports.BaseDto = exports.BaseResponseDto = exports.GetByIdDto = exports.GetByNameDto = exports.MetaDataDto = exports.PaginationResponseDto = exports.PaginationDto = exports.DeleteUserDto = exports.ForgotPasswordDto = exports.UserConfirmDto = exports.RevokeSessionDto = exports.ResetPasswordDto = exports.ResendOtpDto = exports.RecoveryPasswordDto = exports.MetaDto = void 0;
4
4
  var meta_data_dto_1 = require("./shared/dto/meta-data.dto");
5
5
  Object.defineProperty(exports, "MetaDto", { enumerable: true, get: function () { return meta_data_dto_1.MetaDto; } });
6
6
  var recovery_password_dto_1 = require("./shared/dto/recovery-password.dto");
@@ -55,6 +55,8 @@ var api_meta_decorator_2 = require("./shared/decorators/api-meta.decorator");
55
55
  Object.defineProperty(exports, "API_META_KEY", { enumerable: true, get: function () { return api_meta_decorator_2.API_META_KEY; } });
56
56
  var custom_date_1 = require("./shared/decorators/custom-date");
57
57
  Object.defineProperty(exports, "CustomDate", { enumerable: true, get: function () { return custom_date_1.CustomDate; } });
58
+ var luhn_1 = require("./shared/decorators/luhn");
59
+ Object.defineProperty(exports, "IsLuhn", { enumerable: true, get: function () { return luhn_1.IsLuhn; } });
58
60
  var redis_service_1 = require("./shared/modules/redis/redis.service");
59
61
  Object.defineProperty(exports, "RedisService", { enumerable: true, get: function () { return redis_service_1.RedisService; } });
60
62
  var http_service_1 = require("./shared/modules/http/http.service");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,4DAAqD;AAA5C,wGAAA,OAAO,OAAA;AAChB,4EAAyE;AAAhE,4HAAA,mBAAmB,OAAA;AAC5B,8DAA2D;AAAlD,8GAAA,YAAY,OAAA;AACrB,sEAAmE;AAA1D,sHAAA,gBAAgB,OAAA;AACzB,sEAAmE;AAA1D,sHAAA,gBAAgB,OAAA;AACzB,kEAA+D;AAAtD,kHAAA,cAAc,OAAA;AACvB,wEAAqE;AAA5D,wHAAA,iBAAiB,OAAA;AAC1B,gEAA6D;AAApD,gHAAA,aAAa,OAAA;AACtB,8DAA4D;AAAnD,+GAAA,aAAa,OAAA;AACtB,8DAAoE;AAA3D,uHAAA,qBAAqB,OAAA;AAC9B,4DAAyD;AAAhD,4GAAA,WAAW,OAAA;AACpB,gEAA4D;AAAnD,+GAAA,YAAY,OAAA;AACrB,4DAAwD;AAA/C,2GAAA,UAAU,OAAA;AACnB,oEAAiE;AAAxD,oHAAA,eAAe,OAAA;AACxB,kDAAgD;AAAvC,mGAAA,OAAO,OAAA;AAChB,oDAAkD;AAAzC,qGAAA,QAAQ,OAAA;AACjB,8DAA2D;AAAlD,8GAAA,YAAY,OAAA;AACrB,8DAA0D;AAAjD,6GAAA,WAAW,OAAA;AACpB,oGAA4F;AAAnF,+IAAA,0BAA0B,OAAA;AAGnC,4DAA6D;AAApD,sGAAA,UAAU,OAAA;AAGnB,4CAA2C;AAAlC,4FAAA,IAAI,OAAA;AACb,gFAA4E;AAAnE,6HAAA,mBAAmB,OAAA;AAC5B,gFAA6E;AAApE,8HAAA,oBAAoB,OAAA;AAE7B,6DAA2D;AAAlD,yGAAA,UAAU,OAAA;AAGnB,6EAAiE;AAAxD,6GAAA,OAAO,OAAA;AAChB,6EAAsE;AAA7D,kHAAA,YAAY,OAAA;AAErB,+DAA6D;AAApD,yGAAA,UAAU,OAAA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0BAA0B,OAAA;AAGnC,4DAA6D;AAApD,sGAAA,UAAU,OAAA;AAGnB,4CAA2C;AAAlC,4FAAA,IAAI,OAAA;AACb,gFAA4E;AAAnE,6HAAA,mBAAmB,OAAA;AAC5B,gFAA6E;AAApE,8HAAA,oBAAoB,OAAA;AAE7B,6DAA2D;AAAlD,yGAAA,UAAU,OAAA;AAGnB,6EAAiE;AAAxD,6GAAA,OAAO,OAAA;AAChB,6EAAsE;AAA7D,kHAAA,YAAY,OAAA;AAErB,+DAA6D;AAApD,yGAAA,UAAU,OAAA;AACnB,iDAAkD;AAAzC,8FAAA,MAAM,OAAA;AAGf,sEAAoE;AAA3D,6GAAA,YAAY,OAAA;AACrB,mEAAuE;AAA9D,iHAAA,iBAAiB,OAAA;AAG1B,oEAAkE;AAAzD,2GAAA,WAAW,OAAA;AACpB,iEAAqE;AAA5D,+GAAA,gBAAgB,OAAA;AACzB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AAsBrB,qDAAoD;AAA3C,oGAAA,QAAQ,OAAA;AAGjB,iFAA8E;AAArE,0HAAA,kBAAkB,OAAA;AAG3B,kEAA8D;AAArD,+GAAA,YAAY,OAAA;AAGrB,gGAAwF;AAA/E,qIAAA,qBAAqB,OAAA"}
@@ -0,0 +1,6 @@
1
+ import { ValidationOptions, ValidatorConstraintInterface, ValidationArguments } from 'class-validator';
2
+ export declare class IsLuhnConstraint implements ValidatorConstraintInterface {
3
+ validate(value: any, _args: ValidationArguments): boolean;
4
+ defaultMessage(_args: ValidationArguments): string;
5
+ }
6
+ export declare function IsLuhn(validationOptions?: ValidationOptions): (object: object, propertyName: string) => void;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.IsLuhnConstraint = void 0;
10
+ exports.IsLuhn = IsLuhn;
11
+ const class_validator_1 = require("class-validator");
12
+ function luhnValidateRaw(numStr) {
13
+ const cleaned = numStr.replace(/[\s-]+/g, '');
14
+ if (!/^\d+$/.test(cleaned))
15
+ return false;
16
+ let sum = 0;
17
+ let shouldDouble = false;
18
+ for (let i = cleaned.length - 1; i >= 0; i--) {
19
+ let digit = parseInt(cleaned[i], 10);
20
+ if (shouldDouble) {
21
+ digit *= 2;
22
+ if (digit > 9)
23
+ digit -= 9;
24
+ }
25
+ sum += digit;
26
+ shouldDouble = !shouldDouble;
27
+ }
28
+ return sum % 10 === 0;
29
+ }
30
+ let IsLuhnConstraint = class IsLuhnConstraint {
31
+ validate(value, _args) {
32
+ if (typeof value !== 'string')
33
+ return false;
34
+ return luhnValidateRaw(value);
35
+ }
36
+ defaultMessage(_args) {
37
+ return 'Field must be a valid number according to Luhn algorithm';
38
+ }
39
+ };
40
+ exports.IsLuhnConstraint = IsLuhnConstraint;
41
+ exports.IsLuhnConstraint = IsLuhnConstraint = __decorate([
42
+ (0, class_validator_1.ValidatorConstraint)({ async: false })
43
+ ], IsLuhnConstraint);
44
+ function IsLuhn(validationOptions) {
45
+ return function (object, propertyName) {
46
+ (0, class_validator_1.registerDecorator)({
47
+ target: object.constructor,
48
+ propertyName: propertyName,
49
+ options: validationOptions,
50
+ constraints: [],
51
+ validator: IsLuhnConstraint,
52
+ });
53
+ };
54
+ }
55
+ //# sourceMappingURL=luhn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"luhn.js","sourceRoot":"","sources":["../../../src/shared/decorators/luhn.ts"],"names":[],"mappings":";;;;;;;;;AA2CA,wBAUC;AApDD,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B,MAAM,EAAE,MAAM,CAAC,WAAW;YAC1B,YAAY,EAAE,YAAY;YAC1B,OAAO,EAAE,iBAAiB;YAC1B,WAAW,EAAE,EAAE;YACf,SAAS,EAAE,gBAAgB;SAC5B,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
1
+ export type CardType = 'humo' | 'uzcard';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.js","sourceRoot":"","sources":["../../../src/shared/types/card.ts"],"names":[],"mappings":""}