@umapi/contracts 1.0.2 → 1.0.4
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 -17
- package/dist/dto/index.d.ts.map +1 -1
- package/dist/dto/index.js +11 -63
- 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/interfaces/index.d.ts +37 -0
- package/dist/interfaces/index.d.ts.map +1 -1
- package/dist/interfaces/index.js +12 -0
- package/dist/interfaces/index.js.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,18 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
password: string;
|
|
7
|
-
name?: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* DTO для ответа с данными пользователя
|
|
11
|
-
*/
|
|
12
|
-
export declare class UserResponseDto {
|
|
13
|
-
id: string;
|
|
14
|
-
email: string;
|
|
15
|
-
name?: string;
|
|
16
|
-
createdAt: Date;
|
|
17
|
-
}
|
|
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';
|
|
18
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,66 +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.UserResponseDto = exports.CreateUserDto = void 0;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
exports.
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
/**
|
|
39
|
-
* DTO для ответа с данными пользователя
|
|
40
|
-
*/
|
|
41
|
-
class UserResponseDto {
|
|
42
|
-
}
|
|
43
|
-
exports.UserResponseDto = UserResponseDto;
|
|
44
|
-
__decorate([
|
|
45
|
-
(0, swagger_1.ApiProperty)({ description: 'ID пользователя', example: '123e4567-e89b-12d3-a456-426614174000' }),
|
|
46
|
-
(0, class_validator_1.IsString)(),
|
|
47
|
-
__metadata("design:type", String)
|
|
48
|
-
], UserResponseDto.prototype, "id", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
(0, swagger_1.ApiProperty)({ description: 'Адрес электронной почты пользователя', example: 'user@example.com' }),
|
|
51
|
-
(0, class_validator_1.IsEmail)(),
|
|
52
|
-
(0, class_validator_1.IsString)(),
|
|
53
|
-
__metadata("design:type", String)
|
|
54
|
-
], UserResponseDto.prototype, "email", void 0);
|
|
55
|
-
__decorate([
|
|
56
|
-
(0, swagger_1.ApiProperty)({ description: 'Имя пользователя', required: false, example: 'Иван Иванов' }),
|
|
57
|
-
(0, class_validator_1.IsOptional)(),
|
|
58
|
-
(0, class_validator_1.IsString)(),
|
|
59
|
-
__metadata("design:type", String)
|
|
60
|
-
], UserResponseDto.prototype, "name", void 0);
|
|
61
|
-
__decorate([
|
|
62
|
-
(0, swagger_1.ApiProperty)({ description: 'Дата создания пользователя', example: '2023-01-01T00:00:00.000Z' }),
|
|
63
|
-
__metadata("design:type", Date)
|
|
64
|
-
], UserResponseDto.prototype, "createdAt", void 0);
|
|
65
|
-
// Добавить больше 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; } });
|
|
66
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"}
|
|
@@ -31,4 +31,41 @@ export interface PaginatedResponse<T> extends BaseResponse<T[]> {
|
|
|
31
31
|
/** Метаданные пагинации */
|
|
32
32
|
meta: PaginationMeta;
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Аутентифицированный пользователь
|
|
36
|
+
*/
|
|
37
|
+
export interface AuthUser {
|
|
38
|
+
/** ID пользователя */
|
|
39
|
+
id: string;
|
|
40
|
+
/** Роли пользователя */
|
|
41
|
+
roles: string[];
|
|
42
|
+
/** Скопы пользователя */
|
|
43
|
+
scopes: string[];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Методы аутентификации
|
|
47
|
+
*/
|
|
48
|
+
export declare enum AuthMethod {
|
|
49
|
+
OTP_PHONE = "otp_phone",
|
|
50
|
+
OTP_EMAIL = "otp_email",
|
|
51
|
+
PASSWORD = "password",
|
|
52
|
+
OAUTH = "oauth",
|
|
53
|
+
PASSKEY = "passkey"
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Интерфейс провайдера аутентификации
|
|
57
|
+
*/
|
|
58
|
+
export interface AuthProvider {
|
|
59
|
+
/**
|
|
60
|
+
* Запрос аутентификации (например, отправка OTP)
|
|
61
|
+
* @param dto Данные запроса
|
|
62
|
+
*/
|
|
63
|
+
request(dto: any): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Верификация аутентификации
|
|
66
|
+
* @param dto Данные верификации
|
|
67
|
+
* @returns Аутентифицированный пользователь
|
|
68
|
+
*/
|
|
69
|
+
verify(dto: any): Promise<AuthUser>;
|
|
70
|
+
}
|
|
34
71
|
//# 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"}
|
|
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"}
|
package/dist/interfaces/index.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthMethod = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Методы аутентификации
|
|
6
|
+
*/
|
|
7
|
+
var AuthMethod;
|
|
8
|
+
(function (AuthMethod) {
|
|
9
|
+
AuthMethod["OTP_PHONE"] = "otp_phone";
|
|
10
|
+
AuthMethod["OTP_EMAIL"] = "otp_email";
|
|
11
|
+
AuthMethod["PASSWORD"] = "password";
|
|
12
|
+
AuthMethod["OAUTH"] = "oauth";
|
|
13
|
+
AuthMethod["PASSKEY"] = "passkey";
|
|
14
|
+
})(AuthMethod || (exports.AuthMethod = AuthMethod = {}));
|
|
3
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;AAgDA;;GAEG;AACH,IAAY,UAMX;AAND,WAAY,UAAU;IAClB,qCAAuB,CAAA;IACvB,qCAAuB,CAAA;IACvB,mCAAqB,CAAA;IACrB,6BAAe,CAAA;IACf,iCAAmB,CAAA;AACvB,CAAC,EANW,UAAU,0BAAV,UAAU,QAMrB"}
|