@umapi/contracts 1.0.24 → 1.0.25

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.
@@ -0,0 +1,10 @@
1
+ import { AuthMethod } from '../interfaces';
2
+ /**
3
+ * DTO для подтверждения нового идентификатора
4
+ */
5
+ export declare class ConfirmNewIdentifierRequestDto {
6
+ identifier: string;
7
+ method: AuthMethod;
8
+ code: string;
9
+ }
10
+ //# sourceMappingURL=confirm-new-identifier-request.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confirm-new-identifier-request.dto.d.ts","sourceRoot":"","sources":["../../src/dto/confirm-new-identifier-request.dto.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C;;GAEG;AACH,qBAAa,8BAA8B;IAmBvC,UAAU,EAAG,MAAM,CAAC;IAQpB,MAAM,EAAG,UAAU,CAAC;IAQpB,IAAI,EAAG,MAAM,CAAC;CACjB"}
@@ -0,0 +1,64 @@
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.ConfirmNewIdentifierRequestDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ const class_transformer_1 = require("class-transformer");
16
+ const interfaces_1 = require("../interfaces");
17
+ const phone_helper_1 = require("../helpers/phone.helper");
18
+ const phone_validator_1 = require("../validators/phone.validator");
19
+ /**
20
+ * DTO для подтверждения нового идентификатора
21
+ */
22
+ class ConfirmNewIdentifierRequestDto {
23
+ }
24
+ exports.ConfirmNewIdentifierRequestDto = ConfirmNewIdentifierRequestDto;
25
+ __decorate([
26
+ (0, swagger_1.ApiProperty)({
27
+ description: 'Идентификатор пользователя (телефон или email)',
28
+ required: true,
29
+ example: '+79991234567'
30
+ }),
31
+ (0, class_validator_1.IsNotEmpty)({ message: 'Идентификатор обязателен' }),
32
+ (0, class_validator_1.IsString)(),
33
+ (0, class_transformer_1.Transform)(({ value, obj }) => {
34
+ // Нормализуем телефон, если метод OTP_PHONE
35
+ if (obj.method === interfaces_1.AuthMethod.OTP_PHONE) {
36
+ return phone_helper_1.PhoneHelper.normalize(value) || value; // Если нормализация не удалась, возвращаем оригинал
37
+ }
38
+ return value;
39
+ }),
40
+ (0, class_validator_1.ValidateIf)(o => o.method === interfaces_1.AuthMethod.OTP_PHONE),
41
+ (0, phone_validator_1.IsValidPhone)({ message: 'Неверный формат номера телефона' }),
42
+ (0, class_validator_1.ValidateIf)(o => o.method === interfaces_1.AuthMethod.OTP_EMAIL),
43
+ (0, class_validator_1.IsEmail)({}, { message: 'Неверный формат email' }),
44
+ __metadata("design:type", String)
45
+ ], ConfirmNewIdentifierRequestDto.prototype, "identifier", void 0);
46
+ __decorate([
47
+ (0, swagger_1.ApiProperty)({
48
+ description: 'Метод аутентификации',
49
+ enum: interfaces_1.AuthMethod,
50
+ example: interfaces_1.AuthMethod.OTP_PHONE
51
+ }),
52
+ (0, class_validator_1.IsEnum)(interfaces_1.AuthMethod),
53
+ __metadata("design:type", String)
54
+ ], ConfirmNewIdentifierRequestDto.prototype, "method", void 0);
55
+ __decorate([
56
+ (0, swagger_1.ApiProperty)({
57
+ description: 'Код подтверждения',
58
+ example: '123456'
59
+ }),
60
+ (0, class_validator_1.IsNotEmpty)({ message: 'Код подтверждения обязателен' }),
61
+ (0, class_validator_1.IsString)(),
62
+ __metadata("design:type", String)
63
+ ], ConfirmNewIdentifierRequestDto.prototype, "code", void 0);
64
+ //# sourceMappingURL=confirm-new-identifier-request.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confirm-new-identifier-request.dto.js","sourceRoot":"","sources":["../../src/dto/confirm-new-identifier-request.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAAoF;AACpF,yDAA8C;AAC9C,8CAA2C;AAC3C,0DAAsD;AACtD,mEAA6D;AAE7D;;GAEG;AACH,MAAa,8BAA8B;CAoC1C;AApCD,wEAoCC;AAjBG;IAlBC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,gDAAgD;QAC7D,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,cAAc;KAC1B,CAAC;IACD,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,0BAA0B,EAAE,CAAC;IACnD,IAAA,0BAAQ,GAAE;IACV,IAAA,6BAAS,EAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;QAC1B,4CAA4C;QAC5C,IAAI,GAAG,CAAC,MAAM,KAAK,uBAAU,CAAC,SAAS,EAAE,CAAC;YACtC,OAAO,0BAAW,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,oDAAoD;QACtG,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC,CAAC;IACD,IAAA,4BAAU,EAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,uBAAU,CAAC,SAAS,CAAC;IAClD,IAAA,8BAAY,EAAC,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC;IAC5D,IAAA,4BAAU,EAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,uBAAU,CAAC,SAAS,CAAC;IAClD,IAAA,yBAAO,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC;;kEAC9B;AAQpB;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,sBAAsB;QACnC,IAAI,EAAE,uBAAU;QAChB,OAAO,EAAE,uBAAU,CAAC,SAAS;KAChC,CAAC;IACD,IAAA,wBAAM,EAAC,uBAAU,CAAC;;8DACC;AAQpB;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,mBAAmB;QAChC,OAAO,EAAE,QAAQ;KACpB,CAAC;IACD,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,8BAA8B,EAAE,CAAC;IACvD,IAAA,0BAAQ,GAAE;;4DACG"}
@@ -13,4 +13,5 @@ export { UserRequestDto } from './user-request.dto';
13
13
  export { UserResponseDto } from './user-response.dto';
14
14
  export { BindIdentifierRequestDto } from './bind-identifier-request.dto';
15
15
  export { BindIdentifierResponseDto } from './bind-identifier-response.dto';
16
+ export { ConfirmNewIdentifierRequestDto } from './confirm-new-identifier-request.dto';
16
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dto/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACz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3E,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC"}
package/dist/dto/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BindIdentifierResponseDto = exports.BindIdentifierRequestDto = exports.UserResponseDto = exports.UserRequestDto = exports.TokensResponseDto = exports.ServiceResponseSuccessDto = exports.ServiceResponseErrorDto = exports.RefreshTokensResponseDto = exports.RefreshTokenRequestDto = exports.OtpVerifyRequestDto = exports.OtpResponseDto = exports.OtpRequestDto = exports.HealthResponseDto = exports.HealthResponseServiceDto = exports.AppInfoServiceResponseDto = exports.AppInfoResponseDto = void 0;
3
+ exports.ConfirmNewIdentifierRequestDto = exports.BindIdentifierResponseDto = exports.BindIdentifierRequestDto = exports.UserResponseDto = exports.UserRequestDto = exports.TokensResponseDto = exports.ServiceResponseSuccessDto = exports.ServiceResponseErrorDto = exports.RefreshTokensResponseDto = exports.RefreshTokenRequestDto = exports.OtpVerifyRequestDto = exports.OtpResponseDto = exports.OtpRequestDto = exports.HealthResponseDto = exports.HealthResponseServiceDto = exports.AppInfoServiceResponseDto = exports.AppInfoResponseDto = void 0;
4
4
  var app_info_response_dto_1 = require("./app-info-response.dto");
5
5
  Object.defineProperty(exports, "AppInfoResponseDto", { enumerable: true, get: function () { return app_info_response_dto_1.AppInfoResponseDto; } });
6
6
  var app_info_service_response_dto_1 = require("./app-info-service-response.dto");
@@ -32,4 +32,6 @@ var bind_identifier_request_dto_1 = require("./bind-identifier-request.dto");
32
32
  Object.defineProperty(exports, "BindIdentifierRequestDto", { enumerable: true, get: function () { return bind_identifier_request_dto_1.BindIdentifierRequestDto; } });
33
33
  var bind_identifier_response_dto_1 = require("./bind-identifier-response.dto");
34
34
  Object.defineProperty(exports, "BindIdentifierResponseDto", { enumerable: true, get: function () { return bind_identifier_response_dto_1.BindIdentifierResponseDto; } });
35
+ var confirm_new_identifier_request_dto_1 = require("./confirm-new-identifier-request.dto");
36
+ Object.defineProperty(exports, "ConfirmNewIdentifierRequestDto", { enumerable: true, get: function () { return confirm_new_identifier_request_dto_1.ConfirmNewIdentifierRequestDto; } });
35
37
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dto/index.ts"],"names":[],"mappings":";;;AAAA,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAC3B,iFAA4E;AAAnE,0IAAA,yBAAyB,OAAA;AAClC,6EAAyE;AAAhE,uIAAA,wBAAwB,OAAA;AACjC,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,uDAAoD;AAA3C,kHAAA,cAAc,OAAA;AACvB,mEAA+D;AAAtD,6HAAA,mBAAmB,OAAA;AAC5B,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAC/B,6EAAyE;AAAhE,uIAAA,wBAAwB,OAAA;AACjC,+DAA6G;AAAnF,+HAAA,uBAAuB,OAAA;AAAE,iIAAA,yBAAyB,OAAA;AAC5E,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,uDAAoD;AAA3C,kHAAA,cAAc,OAAA;AACvB,yDAAsD;AAA7C,oHAAA,eAAe,OAAA;AACxB,6EAAyE;AAAhE,uIAAA,wBAAwB,OAAA;AACjC,+EAA2E;AAAlE,yIAAA,yBAAyB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dto/index.ts"],"names":[],"mappings":";;;AAAA,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAC3B,iFAA4E;AAAnE,0IAAA,yBAAyB,OAAA;AAClC,6EAAyE;AAAhE,uIAAA,wBAAwB,OAAA;AACjC,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,uDAAoD;AAA3C,kHAAA,cAAc,OAAA;AACvB,mEAA+D;AAAtD,6HAAA,mBAAmB,OAAA;AAC5B,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAC/B,6EAAyE;AAAhE,uIAAA,wBAAwB,OAAA;AACjC,+DAA6G;AAAnF,+HAAA,uBAAuB,OAAA;AAAE,iIAAA,yBAAyB,OAAA;AAC5E,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,uDAAoD;AAA3C,kHAAA,cAAc,OAAA;AACvB,yDAAsD;AAA7C,oHAAA,eAAe,OAAA;AACxB,6EAAyE;AAAhE,uIAAA,wBAAwB,OAAA;AACjC,+EAA2E;AAAlE,yIAAA,yBAAyB,OAAA;AAClC,2FAAsF;AAA7E,oJAAA,8BAA8B,OAAA"}
package/dist/index.d.ts CHANGED
@@ -3,4 +3,5 @@ export * from './interfaces';
3
3
  export * from './helpers/phone.helper';
4
4
  export * from './dto/bind-identifier-request.dto';
5
5
  export * from './dto/bind-identifier-response.dto';
6
+ export * from './dto/confirm-new-identifier-request.dto';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,0CAA0C,CAAC"}
package/dist/index.js CHANGED
@@ -20,4 +20,5 @@ __exportStar(require("./interfaces"), exports);
20
20
  __exportStar(require("./helpers/phone.helper"), exports);
21
21
  __exportStar(require("./dto/bind-identifier-request.dto"), exports);
22
22
  __exportStar(require("./dto/bind-identifier-response.dto"), exports);
23
+ __exportStar(require("./dto/confirm-new-identifier-request.dto"), exports);
23
24
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0BAA0B;AAC1B,wCAAsB;AACtB,+CAA6B;AAC7B,yDAAuC;AACvC,oEAAkD;AAClD,qEAAmD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0BAA0B;AAC1B,wCAAsB;AACtB,+CAA6B;AAC7B,yDAAuC;AACvC,oEAAkD;AAClD,qEAAmD;AACnD,2EAAyD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umapi/contracts",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "description": "Shared contracts for UMAPI microservices",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",