@umapi/contracts 1.0.3 → 1.0.5
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/dto/create-user.dto.d.ts +9 -0
- package/dist/dto/create-user.dto.d.ts.map +1 -0
- package/dist/dto/create-user.dto.js +38 -0
- package/dist/dto/create-user.dto.js.map +1 -0
- package/dist/dto/index.d.ts +5 -42
- package/dist/dto/index.d.ts.map +1 -1
- package/dist/dto/index.js +11 -131
- package/dist/dto/index.js.map +1 -1
- package/dist/dto/request-otp.dto.d.ts +10 -0
- package/dist/dto/request-otp.dto.d.ts.map +1 -0
- package/dist/dto/request-otp.dto.js +39 -0
- package/dist/dto/request-otp.dto.js.map +1 -0
- package/dist/dto/tokens.dto.d.ts +8 -0
- package/dist/dto/tokens.dto.d.ts.map +1 -0
- package/dist/dto/tokens.dto.js +31 -0
- package/dist/dto/tokens.dto.js.map +1 -0
- package/dist/dto/user-response.dto.d.ts +10 -0
- package/dist/dto/user-response.dto.d.ts.map +1 -0
- package/dist/dto/user-response.dto.js +42 -0
- package/dist/dto/user-response.dto.js.map +1 -0
- package/dist/dto/verify-otp.dto.d.ts +11 -0
- package/dist/dto/verify-otp.dto.d.ts.map +1 -0
- package/dist/dto/verify-otp.dto.js +44 -0
- package/dist/dto/verify-otp.dto.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/interfaces/index.d.ts +11 -0
- package/dist/interfaces/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-user.dto.d.ts","sourceRoot":"","sources":["../../src/dto/create-user.dto.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,qBAAa,aAAa;IAItB,KAAK,EAAG,MAAM,CAAC;IAIf,QAAQ,EAAG,MAAM,CAAC;IAKlB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
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.CreateUserDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/**
|
|
16
|
+
* DTO для создания пользователя
|
|
17
|
+
*/
|
|
18
|
+
class CreateUserDto {
|
|
19
|
+
}
|
|
20
|
+
exports.CreateUserDto = CreateUserDto;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, swagger_1.ApiProperty)({ description: 'Адрес электронной почты пользователя', example: 'user@example.com' }),
|
|
23
|
+
(0, class_validator_1.IsEmail)(),
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], CreateUserDto.prototype, "email", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, swagger_1.ApiProperty)({ description: 'Пароль пользователя', example: 'password123' }),
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], CreateUserDto.prototype, "password", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, swagger_1.ApiProperty)({ description: 'Имя пользователя', required: false, example: 'Иван Иванов' }),
|
|
34
|
+
(0, class_validator_1.IsOptional)(),
|
|
35
|
+
(0, class_validator_1.IsString)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], CreateUserDto.prototype, "name", void 0);
|
|
38
|
+
//# sourceMappingURL=create-user.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-user.dto.js","sourceRoot":"","sources":["../../src/dto/create-user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAAgE;AAEhE;;GAEG;AACH,MAAa,aAAa;CAczB;AAdD,sCAcC;AAVG;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,sCAAsC,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;IACjG,IAAA,yBAAO,GAAE;IACT,IAAA,0BAAQ,GAAE;;4CACI;AAIf;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;IAC3E,IAAA,0BAAQ,GAAE;;+CACO;AAKlB;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;IACzF,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;2CACG"}
|
package/dist/dto/index.d.ts
CHANGED
|
@@ -1,43 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
email: string;
|
|
7
|
-
password: string;
|
|
8
|
-
name?: string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* DTO для ответа с данными пользователя
|
|
12
|
-
*/
|
|
13
|
-
export declare class UserResponseDto {
|
|
14
|
-
id: string;
|
|
15
|
-
email: string;
|
|
16
|
-
name?: string;
|
|
17
|
-
createdAt: Date;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* DTO для запроса OTP
|
|
21
|
-
*/
|
|
22
|
-
export declare class RequestOtpDto {
|
|
23
|
-
method: AuthMethod;
|
|
24
|
-
phone?: string;
|
|
25
|
-
email?: string;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* DTO для верификации OTP
|
|
29
|
-
*/
|
|
30
|
-
export declare class VerifyOtpDto {
|
|
31
|
-
method: AuthMethod;
|
|
32
|
-
phone?: string;
|
|
33
|
-
email?: string;
|
|
34
|
-
code: string;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* DTO для токенов
|
|
38
|
-
*/
|
|
39
|
-
export declare class TokensDto {
|
|
40
|
-
accessToken: string;
|
|
41
|
-
refreshToken: string;
|
|
42
|
-
}
|
|
1
|
+
export { CreateUserDto } from './create-user.dto';
|
|
2
|
+
export { RequestOtpDto } from './request-otp.dto';
|
|
3
|
+
export { TokensDto } from './tokens.dto';
|
|
4
|
+
export { UserResponseDto } from './user-response.dto';
|
|
5
|
+
export { VerifyOtpDto } from './verify-otp.dto';
|
|
43
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/dto/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dto/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dto/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/dto/index.js
CHANGED
|
@@ -1,134 +1,14 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
(0, swagger_1.ApiProperty)({ description: 'Адрес электронной почты пользователя', example: 'user@example.com' }),
|
|
24
|
-
(0, class_validator_1.IsEmail)(),
|
|
25
|
-
(0, class_validator_1.IsString)(),
|
|
26
|
-
__metadata("design:type", String)
|
|
27
|
-
], CreateUserDto.prototype, "email", void 0);
|
|
28
|
-
__decorate([
|
|
29
|
-
(0, swagger_1.ApiProperty)({ description: 'Пароль пользователя', example: 'password123' }),
|
|
30
|
-
(0, class_validator_1.IsString)(),
|
|
31
|
-
__metadata("design:type", String)
|
|
32
|
-
], CreateUserDto.prototype, "password", void 0);
|
|
33
|
-
__decorate([
|
|
34
|
-
(0, swagger_1.ApiProperty)({ description: 'Имя пользователя', required: false, example: 'Иван Иванов' }),
|
|
35
|
-
(0, class_validator_1.IsOptional)(),
|
|
36
|
-
(0, class_validator_1.IsString)(),
|
|
37
|
-
__metadata("design:type", String)
|
|
38
|
-
], CreateUserDto.prototype, "name", void 0);
|
|
39
|
-
/**
|
|
40
|
-
* DTO для ответа с данными пользователя
|
|
41
|
-
*/
|
|
42
|
-
class UserResponseDto {
|
|
43
|
-
}
|
|
44
|
-
exports.UserResponseDto = UserResponseDto;
|
|
45
|
-
__decorate([
|
|
46
|
-
(0, swagger_1.ApiProperty)({ description: 'ID пользователя', example: '123e4567-e89b-12d3-a456-426614174000' }),
|
|
47
|
-
(0, class_validator_1.IsString)(),
|
|
48
|
-
__metadata("design:type", String)
|
|
49
|
-
], UserResponseDto.prototype, "id", void 0);
|
|
50
|
-
__decorate([
|
|
51
|
-
(0, swagger_1.ApiProperty)({ description: 'Адрес электронной почты пользователя', example: 'user@example.com' }),
|
|
52
|
-
(0, class_validator_1.IsEmail)(),
|
|
53
|
-
(0, class_validator_1.IsString)(),
|
|
54
|
-
__metadata("design:type", String)
|
|
55
|
-
], UserResponseDto.prototype, "email", void 0);
|
|
56
|
-
__decorate([
|
|
57
|
-
(0, swagger_1.ApiProperty)({ description: 'Имя пользователя', required: false, example: 'Иван Иванов' }),
|
|
58
|
-
(0, class_validator_1.IsOptional)(),
|
|
59
|
-
(0, class_validator_1.IsString)(),
|
|
60
|
-
__metadata("design:type", String)
|
|
61
|
-
], UserResponseDto.prototype, "name", void 0);
|
|
62
|
-
__decorate([
|
|
63
|
-
(0, swagger_1.ApiProperty)({ description: 'Дата создания пользователя', example: '2023-01-01T00:00:00.000Z' }),
|
|
64
|
-
__metadata("design:type", Date)
|
|
65
|
-
], UserResponseDto.prototype, "createdAt", void 0);
|
|
66
|
-
/**
|
|
67
|
-
* DTO для запроса OTP
|
|
68
|
-
*/
|
|
69
|
-
class RequestOtpDto {
|
|
70
|
-
}
|
|
71
|
-
exports.RequestOtpDto = RequestOtpDto;
|
|
72
|
-
__decorate([
|
|
73
|
-
(0, swagger_1.ApiProperty)({ description: 'Метод аутентификации', enum: interfaces_1.AuthMethod, example: interfaces_1.AuthMethod.OTP_PHONE }),
|
|
74
|
-
(0, class_validator_1.IsEnum)(interfaces_1.AuthMethod),
|
|
75
|
-
__metadata("design:type", String)
|
|
76
|
-
], RequestOtpDto.prototype, "method", void 0);
|
|
77
|
-
__decorate([
|
|
78
|
-
(0, swagger_1.ApiProperty)({ description: 'Номер телефона', required: false, example: '+79991234567' }),
|
|
79
|
-
(0, class_validator_1.IsOptional)(),
|
|
80
|
-
(0, class_validator_1.IsString)(),
|
|
81
|
-
__metadata("design:type", String)
|
|
82
|
-
], RequestOtpDto.prototype, "phone", void 0);
|
|
83
|
-
__decorate([
|
|
84
|
-
(0, swagger_1.ApiProperty)({ description: 'Адрес электронной почты', required: false, example: 'user@example.com' }),
|
|
85
|
-
(0, class_validator_1.IsOptional)(),
|
|
86
|
-
(0, class_validator_1.IsEmail)(),
|
|
87
|
-
__metadata("design:type", String)
|
|
88
|
-
], RequestOtpDto.prototype, "email", void 0);
|
|
89
|
-
/**
|
|
90
|
-
* DTO для верификации OTP
|
|
91
|
-
*/
|
|
92
|
-
class VerifyOtpDto {
|
|
93
|
-
}
|
|
94
|
-
exports.VerifyOtpDto = VerifyOtpDto;
|
|
95
|
-
__decorate([
|
|
96
|
-
(0, swagger_1.ApiProperty)({ description: 'Метод аутентификации', enum: interfaces_1.AuthMethod, example: interfaces_1.AuthMethod.OTP_PHONE }),
|
|
97
|
-
(0, class_validator_1.IsEnum)(interfaces_1.AuthMethod),
|
|
98
|
-
__metadata("design:type", String)
|
|
99
|
-
], VerifyOtpDto.prototype, "method", void 0);
|
|
100
|
-
__decorate([
|
|
101
|
-
(0, swagger_1.ApiProperty)({ description: 'Номер телефона', required: false, example: '+79991234567' }),
|
|
102
|
-
(0, class_validator_1.IsOptional)(),
|
|
103
|
-
(0, class_validator_1.IsString)(),
|
|
104
|
-
__metadata("design:type", String)
|
|
105
|
-
], VerifyOtpDto.prototype, "phone", void 0);
|
|
106
|
-
__decorate([
|
|
107
|
-
(0, swagger_1.ApiProperty)({ description: 'Адрес электронной почты', required: false, example: 'user@example.com' }),
|
|
108
|
-
(0, class_validator_1.IsOptional)(),
|
|
109
|
-
(0, class_validator_1.IsEmail)(),
|
|
110
|
-
__metadata("design:type", String)
|
|
111
|
-
], VerifyOtpDto.prototype, "email", void 0);
|
|
112
|
-
__decorate([
|
|
113
|
-
(0, swagger_1.ApiProperty)({ description: 'OTP код', example: '123456' }),
|
|
114
|
-
(0, class_validator_1.IsString)(),
|
|
115
|
-
__metadata("design:type", String)
|
|
116
|
-
], VerifyOtpDto.prototype, "code", void 0);
|
|
117
|
-
/**
|
|
118
|
-
* DTO для токенов
|
|
119
|
-
*/
|
|
120
|
-
class TokensDto {
|
|
121
|
-
}
|
|
122
|
-
exports.TokensDto = TokensDto;
|
|
123
|
-
__decorate([
|
|
124
|
-
(0, swagger_1.ApiProperty)({ description: 'Access токен' }),
|
|
125
|
-
(0, class_validator_1.IsString)(),
|
|
126
|
-
__metadata("design:type", String)
|
|
127
|
-
], TokensDto.prototype, "accessToken", void 0);
|
|
128
|
-
__decorate([
|
|
129
|
-
(0, swagger_1.ApiProperty)({ description: 'Refresh токен' }),
|
|
130
|
-
(0, class_validator_1.IsString)(),
|
|
131
|
-
__metadata("design:type", String)
|
|
132
|
-
], TokensDto.prototype, "refreshToken", void 0);
|
|
133
|
-
// Добавить больше DTO по мере необходимости для конкретных сервисов
|
|
3
|
+
exports.VerifyOtpDto = exports.UserResponseDto = exports.TokensDto = exports.RequestOtpDto = exports.CreateUserDto = void 0;
|
|
4
|
+
var create_user_dto_1 = require("./create-user.dto");
|
|
5
|
+
Object.defineProperty(exports, "CreateUserDto", { enumerable: true, get: function () { return create_user_dto_1.CreateUserDto; } });
|
|
6
|
+
var request_otp_dto_1 = require("./request-otp.dto");
|
|
7
|
+
Object.defineProperty(exports, "RequestOtpDto", { enumerable: true, get: function () { return request_otp_dto_1.RequestOtpDto; } });
|
|
8
|
+
var tokens_dto_1 = require("./tokens.dto");
|
|
9
|
+
Object.defineProperty(exports, "TokensDto", { enumerable: true, get: function () { return tokens_dto_1.TokensDto; } });
|
|
10
|
+
var user_response_dto_1 = require("./user-response.dto");
|
|
11
|
+
Object.defineProperty(exports, "UserResponseDto", { enumerable: true, get: function () { return user_response_dto_1.UserResponseDto; } });
|
|
12
|
+
var verify_otp_dto_1 = require("./verify-otp.dto");
|
|
13
|
+
Object.defineProperty(exports, "VerifyOtpDto", { enumerable: true, get: function () { return verify_otp_dto_1.VerifyOtpDto; } });
|
|
134
14
|
//# sourceMappingURL=index.js.map
|
package/dist/dto/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dto/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dto/index.ts"],"names":[],"mappings":";;;AAAA,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,yDAAsD;AAA7C,oHAAA,eAAe,OAAA;AACxB,mDAAgD;AAAvC,8GAAA,YAAY,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-otp.dto.d.ts","sourceRoot":"","sources":["../../src/dto/request-otp.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;GAEG;AACH,qBAAa,aAAa;IAGtB,MAAM,EAAG,UAAU,CAAC;IAKpB,KAAK,CAAC,EAAE,MAAM,CAAC;IAKf,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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.RequestOtpDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const interfaces_1 = require("../interfaces");
|
|
16
|
+
/**
|
|
17
|
+
* DTO для запроса OTP
|
|
18
|
+
*/
|
|
19
|
+
class RequestOtpDto {
|
|
20
|
+
}
|
|
21
|
+
exports.RequestOtpDto = RequestOtpDto;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, swagger_1.ApiProperty)({ description: 'Метод аутентификации', enum: interfaces_1.AuthMethod, example: interfaces_1.AuthMethod.OTP_PHONE }),
|
|
24
|
+
(0, class_validator_1.IsEnum)(interfaces_1.AuthMethod),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], RequestOtpDto.prototype, "method", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, swagger_1.ApiProperty)({ description: 'Номер телефона', required: false, example: '+79991234567' }),
|
|
29
|
+
(0, class_validator_1.IsOptional)(),
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], RequestOtpDto.prototype, "phone", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, swagger_1.ApiProperty)({ description: 'Адрес электронной почты', required: false, example: 'user@example.com' }),
|
|
35
|
+
(0, class_validator_1.IsOptional)(),
|
|
36
|
+
(0, class_validator_1.IsEmail)(),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], RequestOtpDto.prototype, "email", void 0);
|
|
39
|
+
//# sourceMappingURL=request-otp.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-otp.dto.js","sourceRoot":"","sources":["../../src/dto/request-otp.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAAwE;AACxE,8CAA2C;AAE3C;;GAEG;AACH,MAAa,aAAa;CAczB;AAdD,sCAcC;AAXG;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,IAAI,EAAE,uBAAU,EAAE,OAAO,EAAE,uBAAU,CAAC,SAAS,EAAE,CAAC;IACrG,IAAA,wBAAM,EAAC,uBAAU,CAAC;;6CACC;AAKpB;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;IACxF,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;4CACI;AAKf;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;IACrG,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;;4CACK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.dto.d.ts","sourceRoot":"","sources":["../../src/dto/tokens.dto.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,qBAAa,SAAS;IAGlB,WAAW,EAAG,MAAM,CAAC;IAIrB,YAAY,EAAG,MAAM,CAAC;CACzB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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.TokensDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/**
|
|
16
|
+
* DTO для токенов
|
|
17
|
+
*/
|
|
18
|
+
class TokensDto {
|
|
19
|
+
}
|
|
20
|
+
exports.TokensDto = TokensDto;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, swagger_1.ApiProperty)({ description: 'Access токен' }),
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], TokensDto.prototype, "accessToken", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, swagger_1.ApiProperty)({ description: 'Refresh токен' }),
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], TokensDto.prototype, "refreshToken", void 0);
|
|
31
|
+
//# sourceMappingURL=tokens.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.dto.js","sourceRoot":"","sources":["../../src/dto/tokens.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAA2C;AAE3C;;GAEG;AACH,MAAa,SAAS;CAQrB;AARD,8BAQC;AALG;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;IAC5C,IAAA,0BAAQ,GAAE;;8CACU;AAIrB;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;IAC7C,IAAA,0BAAQ,GAAE;;+CACW"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-response.dto.d.ts","sourceRoot":"","sources":["../../src/dto/user-response.dto.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,qBAAa,eAAe;IAGxB,EAAE,EAAG,MAAM,CAAC;IAKZ,KAAK,EAAG,MAAM,CAAC;IAKf,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,SAAS,EAAG,IAAI,CAAC;CACpB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
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.UserResponseDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/**
|
|
16
|
+
* DTO для ответа с данными пользователя
|
|
17
|
+
*/
|
|
18
|
+
class UserResponseDto {
|
|
19
|
+
}
|
|
20
|
+
exports.UserResponseDto = UserResponseDto;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, swagger_1.ApiProperty)({ description: 'ID пользователя', example: '123e4567-e89b-12d3-a456-426614174000' }),
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], UserResponseDto.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, swagger_1.ApiProperty)({ description: 'Адрес электронной почты пользователя', example: 'user@example.com' }),
|
|
28
|
+
(0, class_validator_1.IsEmail)(),
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], UserResponseDto.prototype, "email", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, swagger_1.ApiProperty)({ description: 'Имя пользователя', required: false, example: 'Иван Иванов' }),
|
|
34
|
+
(0, class_validator_1.IsOptional)(),
|
|
35
|
+
(0, class_validator_1.IsString)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], UserResponseDto.prototype, "name", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, swagger_1.ApiProperty)({ description: 'Дата создания пользователя', example: '2023-01-01T00:00:00.000Z' }),
|
|
40
|
+
__metadata("design:type", Date)
|
|
41
|
+
], UserResponseDto.prototype, "createdAt", void 0);
|
|
42
|
+
//# sourceMappingURL=user-response.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-response.dto.js","sourceRoot":"","sources":["../../src/dto/user-response.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAAgE;AAEhE;;GAEG;AACH,MAAa,eAAe;CAiB3B;AAjBD,0CAiBC;AAdG;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,OAAO,EAAE,sCAAsC,EAAE,CAAC;IAChG,IAAA,0BAAQ,GAAE;;2CACC;AAKZ;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,sCAAsC,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;IACjG,IAAA,yBAAO,GAAE;IACT,IAAA,0BAAQ,GAAE;;8CACI;AAKf;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;IACzF,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;6CACG;AAGd;IADC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,OAAO,EAAE,0BAA0B,EAAE,CAAC;8BACpF,IAAI;kDAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-otp.dto.d.ts","sourceRoot":"","sources":["../../src/dto/verify-otp.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;GAEG;AACH,qBAAa,YAAY;IAGrB,MAAM,EAAG,UAAU,CAAC;IAKpB,KAAK,CAAC,EAAE,MAAM,CAAC;IAKf,KAAK,CAAC,EAAE,MAAM,CAAC;IAIf,IAAI,EAAG,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
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.VerifyOtpDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const interfaces_1 = require("../interfaces");
|
|
16
|
+
/**
|
|
17
|
+
* DTO для верификации OTP
|
|
18
|
+
*/
|
|
19
|
+
class VerifyOtpDto {
|
|
20
|
+
}
|
|
21
|
+
exports.VerifyOtpDto = VerifyOtpDto;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, swagger_1.ApiProperty)({ description: 'Метод аутентификации', enum: interfaces_1.AuthMethod, example: interfaces_1.AuthMethod.OTP_PHONE }),
|
|
24
|
+
(0, class_validator_1.IsEnum)(interfaces_1.AuthMethod),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], VerifyOtpDto.prototype, "method", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, swagger_1.ApiProperty)({ description: 'Номер телефона', required: false, example: '+79991234567' }),
|
|
29
|
+
(0, class_validator_1.IsOptional)(),
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], VerifyOtpDto.prototype, "phone", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, swagger_1.ApiProperty)({ description: 'Адрес электронной почты', required: false, example: 'user@example.com' }),
|
|
35
|
+
(0, class_validator_1.IsOptional)(),
|
|
36
|
+
(0, class_validator_1.IsEmail)(),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], VerifyOtpDto.prototype, "email", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, swagger_1.ApiProperty)({ description: 'OTP код', example: '123456' }),
|
|
41
|
+
(0, class_validator_1.IsString)(),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], VerifyOtpDto.prototype, "code", void 0);
|
|
44
|
+
//# sourceMappingURL=verify-otp.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-otp.dto.js","sourceRoot":"","sources":["../../src/dto/verify-otp.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAAwE;AACxE,8CAA2C;AAE3C;;GAEG;AACH,MAAa,YAAY;CAkBxB;AAlBD,oCAkBC;AAfG;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,IAAI,EAAE,uBAAU,EAAE,OAAO,EAAE,uBAAU,CAAC,SAAS,EAAE,CAAC;IACrG,IAAA,wBAAM,EAAC,uBAAU,CAAC;;4CACC;AAKpB;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;IACxF,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;2CACI;AAKf;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;IACrG,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;;2CACK;AAIf;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IAC1D,IAAA,0BAAQ,GAAE;;0CACG"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
export * from './dto';
|
|
2
2
|
export * from './interfaces';
|
|
3
|
+
/**
|
|
4
|
+
* Ответ сервиса
|
|
5
|
+
*/
|
|
6
|
+
export type ServiceResponse<T> = {
|
|
7
|
+
success: true;
|
|
8
|
+
data: T;
|
|
9
|
+
} | {
|
|
10
|
+
success: false;
|
|
11
|
+
error: import('./interfaces').ServiceError;
|
|
12
|
+
};
|
|
3
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,OAAO,cAAc,EAAE,YAAY,CAAA;CAAE,CAAC"}
|
|
@@ -68,4 +68,15 @@ export interface AuthProvider {
|
|
|
68
68
|
*/
|
|
69
69
|
verify(dto: any): Promise<AuthUser>;
|
|
70
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Доменная ошибка сервиса
|
|
73
|
+
*/
|
|
74
|
+
export interface ServiceError {
|
|
75
|
+
/** Код ошибки */
|
|
76
|
+
code: string;
|
|
77
|
+
/** Сообщение ошибки */
|
|
78
|
+
message: string;
|
|
79
|
+
/** Дополнительные детали (опционально) */
|
|
80
|
+
details?: unknown;
|
|
81
|
+
}
|
|
71
82
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,GAAG;IACjC,0BAA0B;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,kCAAkC;IAClC,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,UAAU,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC,CAAE,SAAQ,YAAY,CAAC,CAAC,EAAE,CAAC;IAC3D,2BAA2B;IAC3B,IAAI,EAAE,cAAc,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACrB,sBAAsB;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,wBAAwB;IACxB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,yBAAyB;IACzB,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;GAEG;AACH,oBAAY,UAAU;IAClB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,OAAO,YAAY;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;;OAGG;IACH,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjC;;;;OAIG;IACH,MAAM,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACvC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,GAAG;IACjC,0BAA0B;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,kCAAkC;IAClC,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,UAAU,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC,CAAE,SAAQ,YAAY,CAAC,CAAC,EAAE,CAAC;IAC3D,2BAA2B;IAC3B,IAAI,EAAE,cAAc,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACrB,sBAAsB;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,wBAAwB;IACxB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,yBAAyB;IACzB,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;GAEG;AACH,oBAAY,UAAU;IAClB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,OAAO,YAAY;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;;OAGG;IACH,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjC;;;;OAIG;IACH,MAAM,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB"}
|