ovi-kit 1.0.0
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/.prettierrc +4 -0
- package/README.md +93 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/shared/constants/internal-error-message.const.d.ts +1 -0
- package/dist/shared/constants/internal-error-message.const.js +5 -0
- package/dist/shared/constants/internal-error-message.const.js.map +1 -0
- package/dist/shared/constants/redis-keys.const.d.ts +2 -0
- package/dist/shared/constants/redis-keys.const.js +6 -0
- package/dist/shared/constants/redis-keys.const.js.map +1 -0
- package/dist/shared/decorators/api-meta.decorator.d.ts +8 -0
- package/dist/shared/decorators/api-meta.decorator.js +8 -0
- package/dist/shared/decorators/api-meta.decorator.js.map +1 -0
- package/dist/shared/dto/base-dto.d.ts +3 -0
- package/dist/shared/dto/base-dto.js +8 -0
- package/dist/shared/dto/base-dto.js.map +1 -0
- package/dist/shared/dto/base-response.dto.d.ts +5 -0
- package/dist/shared/dto/base-response.dto.js +36 -0
- package/dist/shared/dto/base-response.dto.js.map +1 -0
- package/dist/shared/dto/get-by-id.dto.d.ts +8 -0
- package/dist/shared/dto/get-by-id.dto.js +34 -0
- package/dist/shared/dto/get-by-id.dto.js.map +1 -0
- package/dist/shared/dto/get-by-name.dto.d.ts +8 -0
- package/dist/shared/dto/get-by-name.dto.js +34 -0
- package/dist/shared/dto/get-by-name.dto.js.map +1 -0
- package/dist/shared/dto/meta-data.dto.d.ts +18 -0
- package/dist/shared/dto/meta-data.dto.js +100 -0
- package/dist/shared/dto/meta-data.dto.js.map +1 -0
- package/dist/shared/dto/pagination.dto.d.ts +24 -0
- package/dist/shared/dto/pagination.dto.js +70 -0
- package/dist/shared/dto/pagination.dto.js.map +1 -0
- package/dist/shared/entities/base.entity.d.ts +11 -0
- package/dist/shared/entities/base.entity.js +60 -0
- package/dist/shared/entities/base.entity.js.map +1 -0
- package/dist/shared/enums/exception-codes.d.ts +19 -0
- package/dist/shared/enums/exception-codes.js +24 -0
- package/dist/shared/enums/exception-codes.js.map +1 -0
- package/dist/shared/enums/micro-service-base-url.d.ts +3 -0
- package/dist/shared/enums/micro-service-base-url.js +8 -0
- package/dist/shared/enums/micro-service-base-url.js.map +1 -0
- package/dist/shared/exceptions/custom-rpc.exception.d.ts +7 -0
- package/dist/shared/exceptions/custom-rpc.exception.js +16 -0
- package/dist/shared/exceptions/custom-rpc.exception.js.map +1 -0
- package/dist/shared/modules/http/http.module.d.ts +2 -0
- package/dist/shared/modules/http/http.module.js +24 -0
- package/dist/shared/modules/http/http.module.js.map +1 -0
- package/dist/shared/modules/http/http.service.d.ts +14 -0
- package/dist/shared/modules/http/http.service.js +89 -0
- package/dist/shared/modules/http/http.service.js.map +1 -0
- package/dist/shared/modules/redis/redis.module.d.ts +4 -0
- package/dist/shared/modules/redis/redis.module.js +49 -0
- package/dist/shared/modules/redis/redis.module.js.map +1 -0
- package/dist/shared/modules/redis/redis.service.d.ts +11 -0
- package/dist/shared/modules/redis/redis.service.js +52 -0
- package/dist/shared/modules/redis/redis.service.js.map +1 -0
- package/dist/shared/types/config.d.ts +56 -0
- package/dist/shared/types/config.js +3 -0
- package/dist/shared/types/config.js.map +1 -0
- package/dist/shared/types/format-files.d.ts +1 -0
- package/dist/shared/types/format-files.js +3 -0
- package/dist/shared/types/format-files.js.map +1 -0
- package/dist/shared/types/meta-data.d.ts +17 -0
- package/dist/shared/types/meta-data.js +3 -0
- package/dist/shared/types/meta-data.js.map +1 -0
- package/dist/shared/types/method-info.d.ts +8 -0
- package/dist/shared/types/method-info.js +3 -0
- package/dist/shared/types/method-info.js.map +1 -0
- package/dist/shared/utils/create-random-password.d.ts +1 -0
- package/dist/shared/utils/create-random-password.js +7 -0
- package/dist/shared/utils/create-random-password.js.map +1 -0
- package/dist/shared/utils/get-five-minutes-later.d.ts +1 -0
- package/dist/shared/utils/get-five-minutes-later.js +7 -0
- package/dist/shared/utils/get-five-minutes-later.js.map +1 -0
- package/dist/shared/utils/uuid.d.ts +1 -0
- package/dist/shared/utils/uuid.js +8 -0
- package/dist/shared/utils/uuid.js.map +1 -0
- package/dist/shared/value-objects/password.d.ts +9 -0
- package/dist/shared/value-objects/password.js +65 -0
- package/dist/shared/value-objects/password.js.map +1 -0
- package/dist/shared.module.d.ts +4 -0
- package/dist/shared.module.js +39 -0
- package/dist/shared.module.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/eslint.config.mjs +34 -0
- package/nest-cli.json +8 -0
- package/package.json +81 -0
- package/tsconfig.build.json +4 -0
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.BaseEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
class BaseEntity extends typeorm_1.BaseEntity {
|
|
15
|
+
id;
|
|
16
|
+
created_at;
|
|
17
|
+
updated_at;
|
|
18
|
+
deleted_at;
|
|
19
|
+
created_by;
|
|
20
|
+
updated_by;
|
|
21
|
+
deleted_by;
|
|
22
|
+
is_deleted;
|
|
23
|
+
}
|
|
24
|
+
exports.BaseEntity = BaseEntity;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], BaseEntity.prototype, "id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', default: () => 'CURRENT_TIMESTAMP' }),
|
|
31
|
+
__metadata("design:type", Date)
|
|
32
|
+
], BaseEntity.prototype, "created_at", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', default: () => 'CURRENT_TIMESTAMP' }),
|
|
35
|
+
__metadata("design:type", Date)
|
|
36
|
+
], BaseEntity.prototype, "updated_at", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
39
|
+
__metadata("design:type", Date)
|
|
40
|
+
], BaseEntity.prototype, "deleted_at", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ type: 'varchar', default: 'system' }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], BaseEntity.prototype, "created_by", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({
|
|
47
|
+
type: 'varchar',
|
|
48
|
+
default: 'system',
|
|
49
|
+
}),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], BaseEntity.prototype, "updated_by", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], BaseEntity.prototype, "deleted_by", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ default: false }),
|
|
58
|
+
__metadata("design:type", Boolean)
|
|
59
|
+
], BaseEntity.prototype, "is_deleted", void 0);
|
|
60
|
+
//# sourceMappingURL=base.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.entity.js","sourceRoot":"","sources":["../../../src/shared/entities/base.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,qCAIiB;AAEjB,MAAsB,UAAW,SAAQ,oBAAiB;IAExD,EAAE,CAAS;IAGX,UAAU,CAAO;IAGjB,UAAU,CAAO;IAGjB,UAAU,CAAO;IAGjB,UAAU,CAAS;IAMnB,UAAU,CAAS;IAGnB,UAAU,CAAS;IAGnB,UAAU,CAAU;CACrB;AA3BD,gCA2BC;AAzBC;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;sCACpB;AAGX;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,EAAE,CAAC;8BACxD,IAAI;8CAAC;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,EAAE,CAAC;8BACxD,IAAI;8CAAC;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACpC,IAAI;8CAAC;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;;8CAC5B;AAMnB;IAJC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,QAAQ;KAClB,CAAC;;8CACiB;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACzB;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;8CACP"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare enum RpcErrorCode {
|
|
2
|
+
ParseError = -32700,
|
|
3
|
+
InvalidRequest = -32600,
|
|
4
|
+
MethodNotFound = -32601,
|
|
5
|
+
InvalidParams = -32602,
|
|
6
|
+
InternalError = -32603,
|
|
7
|
+
Unauthorized = -32001,
|
|
8
|
+
Forbidden = -32002,
|
|
9
|
+
NotFound = -32004,
|
|
10
|
+
Conflict = -32009,
|
|
11
|
+
ValidationError = -32010,
|
|
12
|
+
RateLimited = -32029,
|
|
13
|
+
Timeout = -32098,
|
|
14
|
+
Unknown = -32099,
|
|
15
|
+
PatientAlreadyExist = -32011,
|
|
16
|
+
OtpExpired = -32012,
|
|
17
|
+
PatientIsNotVerified = -32013,
|
|
18
|
+
PatientIsAlreadyVerified = -32014
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RpcErrorCode = void 0;
|
|
4
|
+
var RpcErrorCode;
|
|
5
|
+
(function (RpcErrorCode) {
|
|
6
|
+
RpcErrorCode[RpcErrorCode["ParseError"] = -32700] = "ParseError";
|
|
7
|
+
RpcErrorCode[RpcErrorCode["InvalidRequest"] = -32600] = "InvalidRequest";
|
|
8
|
+
RpcErrorCode[RpcErrorCode["MethodNotFound"] = -32601] = "MethodNotFound";
|
|
9
|
+
RpcErrorCode[RpcErrorCode["InvalidParams"] = -32602] = "InvalidParams";
|
|
10
|
+
RpcErrorCode[RpcErrorCode["InternalError"] = -32603] = "InternalError";
|
|
11
|
+
RpcErrorCode[RpcErrorCode["Unauthorized"] = -32001] = "Unauthorized";
|
|
12
|
+
RpcErrorCode[RpcErrorCode["Forbidden"] = -32002] = "Forbidden";
|
|
13
|
+
RpcErrorCode[RpcErrorCode["NotFound"] = -32004] = "NotFound";
|
|
14
|
+
RpcErrorCode[RpcErrorCode["Conflict"] = -32009] = "Conflict";
|
|
15
|
+
RpcErrorCode[RpcErrorCode["ValidationError"] = -32010] = "ValidationError";
|
|
16
|
+
RpcErrorCode[RpcErrorCode["RateLimited"] = -32029] = "RateLimited";
|
|
17
|
+
RpcErrorCode[RpcErrorCode["Timeout"] = -32098] = "Timeout";
|
|
18
|
+
RpcErrorCode[RpcErrorCode["Unknown"] = -32099] = "Unknown";
|
|
19
|
+
RpcErrorCode[RpcErrorCode["PatientAlreadyExist"] = -32011] = "PatientAlreadyExist";
|
|
20
|
+
RpcErrorCode[RpcErrorCode["OtpExpired"] = -32012] = "OtpExpired";
|
|
21
|
+
RpcErrorCode[RpcErrorCode["PatientIsNotVerified"] = -32013] = "PatientIsNotVerified";
|
|
22
|
+
RpcErrorCode[RpcErrorCode["PatientIsAlreadyVerified"] = -32014] = "PatientIsAlreadyVerified";
|
|
23
|
+
})(RpcErrorCode || (exports.RpcErrorCode = RpcErrorCode = {}));
|
|
24
|
+
//# sourceMappingURL=exception-codes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exception-codes.js","sourceRoot":"","sources":["../../../src/shared/enums/exception-codes.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAuBX;AAvBD,WAAY,YAAY;IAEtB,gEAAmB,CAAA;IACnB,wEAAuB,CAAA;IACvB,wEAAuB,CAAA;IACvB,sEAAsB,CAAA;IACtB,sEAAsB,CAAA;IAGtB,oEAAqB,CAAA;IACrB,8DAAkB,CAAA;IAClB,4DAAiB,CAAA;IACjB,4DAAiB,CAAA;IACjB,0EAAwB,CAAA;IACxB,kEAAoB,CAAA;IACpB,0DAAgB,CAAA;IAChB,0DAAgB,CAAA;IAGhB,kFAA4B,CAAA;IAC5B,gEAAmB,CAAA;IACnB,oFAA6B,CAAA;IAC7B,4FAAiC,CAAA;AACnC,CAAC,EAvBW,YAAY,4BAAZ,YAAY,QAuBvB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MicroserviceBaseUrl = void 0;
|
|
4
|
+
var MicroserviceBaseUrl;
|
|
5
|
+
(function (MicroserviceBaseUrl) {
|
|
6
|
+
MicroserviceBaseUrl["CoreService"] = "http://core-service.business-apps.svc.cluster.local";
|
|
7
|
+
})(MicroserviceBaseUrl || (exports.MicroserviceBaseUrl = MicroserviceBaseUrl = {}));
|
|
8
|
+
//# sourceMappingURL=micro-service-base-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"micro-service-base-url.js","sourceRoot":"","sources":["../../../src/shared/enums/micro-service-base-url.ts"],"names":[],"mappings":";;;AAAA,IAAY,mBAEX;AAFD,WAAY,mBAAmB;IAC7B,0FAAmE,CAAA;AACrE,CAAC,EAFW,mBAAmB,mCAAnB,mBAAmB,QAE9B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RpcErrorCode } from 'src/shared/enums/exception-codes';
|
|
2
|
+
export declare class CustomRpcException extends Error {
|
|
3
|
+
readonly code: RpcErrorCode;
|
|
4
|
+
readonly message: string;
|
|
5
|
+
readonly data?: any | undefined;
|
|
6
|
+
constructor(code: RpcErrorCode, message: string, data?: any | undefined);
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomRpcException = void 0;
|
|
4
|
+
class CustomRpcException extends Error {
|
|
5
|
+
code;
|
|
6
|
+
message;
|
|
7
|
+
data;
|
|
8
|
+
constructor(code, message, data) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.code = code;
|
|
11
|
+
this.message = message;
|
|
12
|
+
this.data = data;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.CustomRpcException = CustomRpcException;
|
|
16
|
+
//# sourceMappingURL=custom-rpc.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-rpc.exception.js","sourceRoot":"","sources":["../../../src/shared/exceptions/custom-rpc.exception.ts"],"names":[],"mappings":";;;AAEA,MAAa,kBAAmB,SAAQ,KAAK;IAEzB;IACA;IACA;IAHlB,YACkB,IAAkB,EAClB,OAAe,EACf,IAAU;QAE1B,KAAK,CAAC,OAAO,CAAC,CAAC;QAJC,SAAI,GAAJ,IAAI,CAAc;QAClB,YAAO,GAAP,OAAO,CAAQ;QACf,SAAI,GAAJ,IAAI,CAAM;IAG5B,CAAC;CACF;AARD,gDAQC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
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.CustomHttpModule = void 0;
|
|
10
|
+
const axios_1 = require("@nestjs/axios");
|
|
11
|
+
const common_1 = require("@nestjs/common");
|
|
12
|
+
const redis_module_1 = require("../redis/redis.module");
|
|
13
|
+
const http_service_1 = require("./http.service");
|
|
14
|
+
let CustomHttpModule = class CustomHttpModule {
|
|
15
|
+
};
|
|
16
|
+
exports.CustomHttpModule = CustomHttpModule;
|
|
17
|
+
exports.CustomHttpModule = CustomHttpModule = __decorate([
|
|
18
|
+
(0, common_1.Module)({
|
|
19
|
+
imports: [axios_1.HttpModule, redis_module_1.RedisModule.forRootAsync()],
|
|
20
|
+
providers: [http_service_1.CustomHttpService],
|
|
21
|
+
exports: [http_service_1.CustomHttpService],
|
|
22
|
+
})
|
|
23
|
+
], CustomHttpModule);
|
|
24
|
+
//# sourceMappingURL=http.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.module.js","sourceRoot":"","sources":["../../../../src/shared/modules/http/http.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yCAA2C;AAC3C,2CAAwC;AACxC,wDAAoD;AACpD,iDAAmD;AAO5C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAAG,CAAA;AAAnB,4CAAgB;2BAAhB,gBAAgB;IAL5B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,kBAAU,EAAE,0BAAW,CAAC,YAAY,EAAE,CAAC;QACjD,SAAS,EAAE,CAAC,gCAAiB,CAAC;QAC9B,OAAO,EAAE,CAAC,gCAAiB,CAAC;KAC7B,CAAC;GACW,gBAAgB,CAAG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HttpService } from '@nestjs/axios';
|
|
2
|
+
import { RedisService } from '../redis/redis.service';
|
|
3
|
+
import { MetaData } from 'src/shared/types/meta-data';
|
|
4
|
+
export declare class CustomHttpService {
|
|
5
|
+
private readonly http;
|
|
6
|
+
private readonly redis;
|
|
7
|
+
private readonly logger;
|
|
8
|
+
constructor(http: HttpService, redis: RedisService);
|
|
9
|
+
send<T>(methodName: string, body: {
|
|
10
|
+
params: any;
|
|
11
|
+
meta: MetaData;
|
|
12
|
+
}, ignoreError?: boolean): Promise<T | undefined>;
|
|
13
|
+
private getMethodInfo;
|
|
14
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var CustomHttpService_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.CustomHttpService = void 0;
|
|
14
|
+
const axios_1 = require("@nestjs/axios");
|
|
15
|
+
const common_1 = require("@nestjs/common");
|
|
16
|
+
const redis_service_1 = require("../redis/redis.service");
|
|
17
|
+
const micro_service_base_url_1 = require("../../enums/micro-service-base-url");
|
|
18
|
+
const custom_rpc_exception_1 = require("../../exceptions/custom-rpc.exception");
|
|
19
|
+
const exception_codes_1 = require("../../enums/exception-codes");
|
|
20
|
+
const internal_error_message_const_1 = require("../../constants/internal-error-message.const");
|
|
21
|
+
let CustomHttpService = CustomHttpService_1 = class CustomHttpService {
|
|
22
|
+
http;
|
|
23
|
+
redis;
|
|
24
|
+
logger = new common_1.Logger(CustomHttpService_1.name);
|
|
25
|
+
constructor(http, redis) {
|
|
26
|
+
this.http = http;
|
|
27
|
+
this.redis = redis;
|
|
28
|
+
}
|
|
29
|
+
async send(methodName, body, ignoreError = false) {
|
|
30
|
+
const method = await this.getMethodInfo(methodName, body.meta);
|
|
31
|
+
const url = `${method.service_base_url}${method.path}`;
|
|
32
|
+
try {
|
|
33
|
+
const response = await this.http.axiosRef.post(url, body);
|
|
34
|
+
return response.data.result;
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
this.logger.error('Error while send', err);
|
|
38
|
+
if (ignoreError) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (err.response?.data?.error) {
|
|
42
|
+
const rpcError = err.response.data.error;
|
|
43
|
+
throw new custom_rpc_exception_1.CustomRpcException(rpcError.code, rpcError.message, rpcError.data);
|
|
44
|
+
}
|
|
45
|
+
if (err instanceof custom_rpc_exception_1.CustomRpcException) {
|
|
46
|
+
throw err;
|
|
47
|
+
}
|
|
48
|
+
throw new custom_rpc_exception_1.CustomRpcException(exception_codes_1.RpcErrorCode.InternalError, internal_error_message_const_1.INTERNAL_SERVER_ERROR);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async getMethodInfo(name, meta) {
|
|
52
|
+
try {
|
|
53
|
+
const methodInfoInRedis = await this.redis.getMethodInfo(name);
|
|
54
|
+
if (methodInfoInRedis) {
|
|
55
|
+
return methodInfoInRedis;
|
|
56
|
+
}
|
|
57
|
+
const response = await this.http.axiosRef.post(`${micro_service_base_url_1.MicroserviceBaseUrl.CoreService}/v1/methods/by-name`, {
|
|
58
|
+
params: {
|
|
59
|
+
method_name: name,
|
|
60
|
+
},
|
|
61
|
+
meta,
|
|
62
|
+
});
|
|
63
|
+
const methodInfo = response.data?.result;
|
|
64
|
+
if (!methodInfo) {
|
|
65
|
+
throw new custom_rpc_exception_1.CustomRpcException(exception_codes_1.RpcErrorCode.InternalError, 'Method info not found');
|
|
66
|
+
}
|
|
67
|
+
await this.redis.setMethod(name, methodInfo);
|
|
68
|
+
return methodInfo;
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
this.logger.error(`Error while getting method info for ${name}:`, err);
|
|
72
|
+
if (err.response?.data?.error) {
|
|
73
|
+
const rpcError = err.response.data.error;
|
|
74
|
+
throw new custom_rpc_exception_1.CustomRpcException(rpcError.code, rpcError.message, rpcError.data);
|
|
75
|
+
}
|
|
76
|
+
if (err instanceof custom_rpc_exception_1.CustomRpcException) {
|
|
77
|
+
throw err;
|
|
78
|
+
}
|
|
79
|
+
throw new custom_rpc_exception_1.CustomRpcException(exception_codes_1.RpcErrorCode.InternalError, internal_error_message_const_1.INTERNAL_SERVER_ERROR);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
exports.CustomHttpService = CustomHttpService;
|
|
84
|
+
exports.CustomHttpService = CustomHttpService = CustomHttpService_1 = __decorate([
|
|
85
|
+
(0, common_1.Injectable)(),
|
|
86
|
+
__metadata("design:paramtypes", [axios_1.HttpService,
|
|
87
|
+
redis_service_1.RedisService])
|
|
88
|
+
], CustomHttpService);
|
|
89
|
+
//# sourceMappingURL=http.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.service.js","sourceRoot":"","sources":["../../../../src/shared/modules/http/http.service.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
var RedisModule_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.RedisModule = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const ioredis_1 = __importDefault(require("ioredis"));
|
|
16
|
+
const redis_service_1 = require("./redis.service");
|
|
17
|
+
const config_1 = require("@nestjs/config");
|
|
18
|
+
let RedisModule = RedisModule_1 = class RedisModule {
|
|
19
|
+
static forRootAsync() {
|
|
20
|
+
return {
|
|
21
|
+
module: RedisModule_1,
|
|
22
|
+
imports: [config_1.ConfigModule],
|
|
23
|
+
providers: [
|
|
24
|
+
{
|
|
25
|
+
provide: 'REDIS_CLIENT',
|
|
26
|
+
useFactory: (configService) => {
|
|
27
|
+
const host = configService.get('REDIS_HOST');
|
|
28
|
+
const port = configService.get('REDIS_PORT', { infer: true });
|
|
29
|
+
const password = configService.get('REDIS_PASSWORD');
|
|
30
|
+
console.log(host, 'check host for redis');
|
|
31
|
+
return new ioredis_1.default({
|
|
32
|
+
host,
|
|
33
|
+
port,
|
|
34
|
+
password,
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
inject: [config_1.ConfigService],
|
|
38
|
+
},
|
|
39
|
+
redis_service_1.RedisService,
|
|
40
|
+
],
|
|
41
|
+
exports: ['REDIS_CLIENT', redis_service_1.RedisService],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.RedisModule = RedisModule;
|
|
46
|
+
exports.RedisModule = RedisModule = RedisModule_1 = __decorate([
|
|
47
|
+
(0, common_1.Module)({})
|
|
48
|
+
], RedisModule);
|
|
49
|
+
//# sourceMappingURL=redis.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis.module.js","sourceRoot":"","sources":["../../../../src/shared/modules/redis/redis.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAGA,2CAAuD;AACvD,sDAA4B;AAC5B,mDAA+C;AAC/C,2CAA6D;AAGtD,IAAM,WAAW,mBAAjB,MAAM,WAAW;IACtB,MAAM,CAAC,YAAY;QACjB,OAAO;YACL,MAAM,EAAE,aAAW;YACnB,OAAO,EAAE,CAAC,qBAAY,CAAC;YACvB,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,cAAc;oBACvB,UAAU,EAAE,CAAC,aAA4B,EAAE,EAAE;wBAC3C,MAAM,IAAI,GAAG,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;wBAC7C,MAAM,IAAI,GAAG,aAAa,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;wBAC9D,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;wBACrD,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC;wBAC1C,OAAO,IAAI,iBAAK,CAAC;4BACf,IAAI;4BACJ,IAAI;4BACJ,QAAQ;yBACT,CAAC,CAAC;oBACL,CAAC;oBACD,MAAM,EAAE,CAAC,sBAAa,CAAC;iBACxB;gBACD,4BAAY;aACb;YACD,OAAO,EAAE,CAAC,cAAc,EAAE,4BAAY,CAAC;SACxC,CAAC;IACJ,CAAC;CACF,CAAA;AA1BY,kCAAW;sBAAX,WAAW;IADvB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,WAAW,CA0BvB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Redis from 'ioredis';
|
|
2
|
+
import { MethodInfo } from 'src/shared/types/method-info';
|
|
3
|
+
export declare class RedisService {
|
|
4
|
+
private readonly redis;
|
|
5
|
+
private readonly logger;
|
|
6
|
+
constructor(redis: Redis);
|
|
7
|
+
set(key: string, params: any, ttlInSec: number): Promise<void>;
|
|
8
|
+
get<T>(key: string): Promise<T | null>;
|
|
9
|
+
setMethod(methodName: string, methodInfo: MethodInfo, ttl?: number): Promise<void>;
|
|
10
|
+
getMethodInfo(methodName: string): Promise<MethodInfo | null>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
17
|
+
var RedisService_1;
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.RedisService = void 0;
|
|
20
|
+
const common_1 = require("@nestjs/common");
|
|
21
|
+
const ioredis_1 = __importDefault(require("ioredis"));
|
|
22
|
+
const redis_keys_const_1 = require("../../constants/redis-keys.const");
|
|
23
|
+
let RedisService = RedisService_1 = class RedisService {
|
|
24
|
+
redis;
|
|
25
|
+
logger = new common_1.Logger(RedisService_1.name);
|
|
26
|
+
constructor(redis) {
|
|
27
|
+
this.redis = redis;
|
|
28
|
+
}
|
|
29
|
+
async set(key, params, ttlInSec) {
|
|
30
|
+
await this.redis.set(key, JSON.stringify(params), 'EX', ttlInSec);
|
|
31
|
+
}
|
|
32
|
+
async get(key) {
|
|
33
|
+
const result = await this.redis.get(key);
|
|
34
|
+
if (!result) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
return JSON.parse(result);
|
|
38
|
+
}
|
|
39
|
+
async setMethod(methodName, methodInfo, ttl = 120) {
|
|
40
|
+
await this.set(redis_keys_const_1.METHOD_KEY_FOR_REDIS + methodName, methodInfo, ttl);
|
|
41
|
+
}
|
|
42
|
+
async getMethodInfo(methodName) {
|
|
43
|
+
return await this.get(redis_keys_const_1.METHOD_KEY_FOR_REDIS + methodName);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.RedisService = RedisService;
|
|
47
|
+
exports.RedisService = RedisService = RedisService_1 = __decorate([
|
|
48
|
+
(0, common_1.Injectable)(),
|
|
49
|
+
__param(0, (0, common_1.Inject)('REDIS_CLIENT')),
|
|
50
|
+
__metadata("design:paramtypes", [ioredis_1.default])
|
|
51
|
+
], RedisService);
|
|
52
|
+
//# sourceMappingURL=redis.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis.service.js","sourceRoot":"","sources":["../../../../src/shared/modules/redis/redis.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,2CAA4D;AAC5D,sDAA4B;AAC5B,uEAA6E;AAItE,IAAM,YAAY,oBAAlB,MAAM,YAAY;IAG8B;IAFpC,MAAM,GAAG,IAAI,eAAM,CAAC,cAAY,CAAC,IAAI,CAAC,CAAC;IAExD,YAAqD,KAAY;QAAZ,UAAK,GAAL,KAAK,CAAO;IAAG,CAAC;IAErE,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,MAAW,EAAE,QAAgB;QAClD,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;IACpE,CAAC;IAED,KAAK,CAAC,GAAG,CAAI,GAAW;QACtB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEzC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAM,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,SAAS,CACb,UAAkB,EAClB,UAAsB,EACtB,MAAc,GAAG;QAEjB,MAAM,IAAI,CAAC,GAAG,CAAC,uCAAoB,GAAG,UAAU,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC;IACrE,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,UAAkB;QACpC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAa,uCAAoB,GAAG,UAAU,CAAC,CAAC;IACvE,CAAC;CACF,CAAA;AA9BY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;IAIE,WAAA,IAAA,eAAM,EAAC,cAAc,CAAC,CAAA;qCAAyB,iBAAK;GAHtD,YAAY,CA8BxB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { FormatFiles } from './format-files';
|
|
2
|
+
export interface GeneralConfig {
|
|
3
|
+
id: string;
|
|
4
|
+
created_at: Date;
|
|
5
|
+
updated_at: Date;
|
|
6
|
+
file_deleted_period_day_is_temporary: number;
|
|
7
|
+
file_max_size_in_kilobytes: number;
|
|
8
|
+
file_allowed_formats: FormatFiles[];
|
|
9
|
+
delete_user_account_url: string;
|
|
10
|
+
available_languages: IAvailableLanguages[];
|
|
11
|
+
available_countries: IAvailableCountries[];
|
|
12
|
+
onboarding_data: IOnboardingData[];
|
|
13
|
+
social_auth: ISocialAuth[];
|
|
14
|
+
document_links: IDocumentLinks;
|
|
15
|
+
app_config: IAppConfig;
|
|
16
|
+
}
|
|
17
|
+
export interface IAvailableLanguages {
|
|
18
|
+
title: string;
|
|
19
|
+
iso_code: string;
|
|
20
|
+
icon_url: string;
|
|
21
|
+
}
|
|
22
|
+
export interface IAvailableCountries {
|
|
23
|
+
title: string;
|
|
24
|
+
iso_code: string;
|
|
25
|
+
icon_url: string;
|
|
26
|
+
phone_prefix: string;
|
|
27
|
+
phone_mask: string;
|
|
28
|
+
}
|
|
29
|
+
export interface IOnboardingData {
|
|
30
|
+
title_ru: string;
|
|
31
|
+
title_uz: string;
|
|
32
|
+
title_en: string;
|
|
33
|
+
subtitle_ru: string;
|
|
34
|
+
subtitle_uz: string;
|
|
35
|
+
subtitle_en: string;
|
|
36
|
+
image_url: string;
|
|
37
|
+
}
|
|
38
|
+
export interface IDocumentLinks {
|
|
39
|
+
privacy: string;
|
|
40
|
+
offer: string;
|
|
41
|
+
}
|
|
42
|
+
export interface ISocialAuth {
|
|
43
|
+
title: string;
|
|
44
|
+
logo: string;
|
|
45
|
+
}
|
|
46
|
+
export interface IAppConfig {
|
|
47
|
+
icon_url: string;
|
|
48
|
+
}
|
|
49
|
+
export interface IDictionary {
|
|
50
|
+
ru: Record<string, any>;
|
|
51
|
+
uz: Record<string, any>;
|
|
52
|
+
en: Record<string, any>;
|
|
53
|
+
}
|
|
54
|
+
export interface IAppConfig {
|
|
55
|
+
icon_url: string;
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/shared/types/config.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type FormatFiles = 'png' | 'svg' | 'jpg' | 'jpeg' | 'webp' | 'pdf' | 'xls' | 'xlsx' | 'doc' | 'docx' | 'ppt' | 'pptx' | 'heic';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-files.js","sourceRoot":"","sources":["../../../src/shared/types/format-files.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface MetaData {
|
|
2
|
+
id: string;
|
|
3
|
+
lang: string;
|
|
4
|
+
initiator: string;
|
|
5
|
+
initiatorId: string | undefined;
|
|
6
|
+
initiatorRole: string;
|
|
7
|
+
initiatorName: string;
|
|
8
|
+
ip: string | undefined;
|
|
9
|
+
device?: string;
|
|
10
|
+
mac?: string;
|
|
11
|
+
sessionSecret?: string;
|
|
12
|
+
reqTime: Date;
|
|
13
|
+
tenantId?: string | null;
|
|
14
|
+
method: string;
|
|
15
|
+
appVersion: string | null | undefined;
|
|
16
|
+
appMobile: string | null | undefined;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta-data.js","sourceRoot":"","sources":["../../../src/shared/types/meta-data.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"method-info.js","sourceRoot":"","sources":["../../../src/shared/types/method-info.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createRandomPassword(): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createRandomPassword = createRandomPassword;
|
|
4
|
+
function createRandomPassword() {
|
|
5
|
+
return Math.random().toString(36).slice(-8);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=create-random-password.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-random-password.js","sourceRoot":"","sources":["../../../src/shared/utils/create-random-password.ts"],"names":[],"mappings":";;AAAA,oDAEC;AAFD,SAAgB,oBAAoB;IAClC,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getFiveMinutesLater(): Date;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFiveMinutesLater = getFiveMinutesLater;
|
|
4
|
+
function getFiveMinutesLater() {
|
|
5
|
+
return new Date(Date.now() + 5 * 60 * 1000);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=get-five-minutes-later.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-five-minutes-later.js","sourceRoot":"","sources":["../../../src/shared/utils/get-five-minutes-later.ts"],"names":[],"mappings":";;AAAA,kDAEC;AAFD,SAAgB,mBAAmB;IACjC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function uuid(): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uuid.js","sourceRoot":"","sources":["../../../src/shared/utils/uuid.ts"],"names":[],"mappings":";;AAEA,oBAEC;AAJD,+BAAoC;AAEpC,SAAgB,IAAI;IAClB,OAAO,IAAA,SAAM,GAAE,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class PasswordVo {
|
|
2
|
+
private readonly hash;
|
|
3
|
+
private constructor();
|
|
4
|
+
static create(password: string): Promise<PasswordVo>;
|
|
5
|
+
static createRandom(): Promise<PasswordVo>;
|
|
6
|
+
static fromHash(hash: string): PasswordVo;
|
|
7
|
+
compare(plainTextPassword: string): Promise<boolean>;
|
|
8
|
+
get getHash(): string;
|
|
9
|
+
}
|