grm-shared-library 1.1.77 → 1.1.79

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.
@@ -11,22 +11,37 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ChangePasswordDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const swagger_1 = require("@nestjs/swagger");
14
15
  const password_regex_const_1 = require("../../common/constants/password-regex.const");
15
16
  const match_decorator_1 = require("../validators/match.decorator");
16
17
  class ChangePasswordDto {
17
18
  }
18
19
  exports.ChangePasswordDto = ChangePasswordDto;
19
20
  __decorate([
21
+ (0, swagger_1.ApiProperty)({
22
+ description: 'User ID (automatically set from authenticated user)',
23
+ example: 123
24
+ }),
20
25
  (0, class_validator_1.IsNumber)(),
21
26
  (0, class_validator_1.IsNotEmpty)(),
22
27
  __metadata("design:type", Number)
23
28
  ], ChangePasswordDto.prototype, "userId", void 0);
24
29
  __decorate([
30
+ (0, swagger_1.ApiProperty)({
31
+ description: 'Current password of the user',
32
+ example: 'CurrentPass123!'
33
+ }),
25
34
  (0, class_validator_1.IsString)(),
26
35
  (0, class_validator_1.IsNotEmpty)(),
27
36
  __metadata("design:type", String)
28
37
  ], ChangePasswordDto.prototype, "oldPassword", void 0);
29
38
  __decorate([
39
+ (0, swagger_1.ApiProperty)({
40
+ description: 'New password for the user account',
41
+ example: 'NewSecurePass123!',
42
+ minLength: 8,
43
+ pattern: password_regex_const_1.PASSWORD_REGEX.source
44
+ }),
30
45
  (0, class_validator_1.IsString)(),
31
46
  (0, class_validator_1.IsNotEmpty)(),
32
47
  (0, class_validator_1.MinLength)(8),
@@ -34,6 +49,12 @@ __decorate([
34
49
  __metadata("design:type", String)
35
50
  ], ChangePasswordDto.prototype, "newPassword", void 0);
36
51
  __decorate([
52
+ (0, swagger_1.ApiProperty)({
53
+ description: 'Confirmation of the new password (must match newPassword)',
54
+ example: 'NewSecurePass123!',
55
+ minLength: 8,
56
+ pattern: password_regex_const_1.PASSWORD_REGEX.source
57
+ }),
37
58
  (0, class_validator_1.IsString)(),
38
59
  (0, class_validator_1.IsNotEmpty)(),
39
60
  (0, class_validator_1.MinLength)(8),
@@ -1 +1 @@
1
- {"version":3,"file":"change-password.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/change-password.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAqF;AACrF,sFAAqG;AACrG,mEAAsD;AAEtD,MAAa,iBAAiB;CAqB7B;AArBD,8CAqBC;AAlBG;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;iDACG;AAIhB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;sDACQ;AAMrB;IAJC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,CAAC,CAAC;IACZ,IAAA,yBAAO,EAAC,qCAAc,EAAE,EAAE,OAAO,EAAE,6CAAsB,EAAE,CAAC;;sDACxC;AAOrB;IALC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,CAAC,CAAC;IACZ,IAAA,yBAAO,EAAC,qCAAc,EAAE,EAAE,OAAO,EAAE,6CAAsB,EAAE,CAAC;IAC5D,IAAA,uBAAK,EAAC,aAAa,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;;6DAChC"}
1
+ {"version":3,"file":"change-password.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/change-password.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAqF;AACrF,6CAA8C;AAC9C,sFAAqG;AACrG,mEAAsD;AAEtD,MAAa,iBAAiB;CAyC7B;AAzCD,8CAyCC;AAlCG;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,qDAAqD;QAClE,OAAO,EAAE,GAAG;KACf,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;iDACG;AAQhB;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,8BAA8B;QAC3C,OAAO,EAAE,iBAAiB;KAC7B,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;sDACQ;AAYrB;IAVC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,mCAAmC;QAChD,OAAO,EAAE,mBAAmB;QAC5B,SAAS,EAAE,CAAC;QACZ,OAAO,EAAE,qCAAc,CAAC,MAAM;KACjC,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,CAAC,CAAC;IACZ,IAAA,yBAAO,EAAC,qCAAc,EAAE,EAAE,OAAO,EAAE,6CAAsB,EAAE,CAAC;;sDACxC;AAarB;IAXC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,2DAA2D;QACxE,OAAO,EAAE,mBAAmB;QAC5B,SAAS,EAAE,CAAC;QACZ,OAAO,EAAE,qCAAc,CAAC,MAAM;KACjC,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,CAAC,CAAC;IACZ,IAAA,yBAAO,EAAC,qCAAc,EAAE,EAAE,OAAO,EAAE,6CAAsB,EAAE,CAAC;IAC5D,IAAA,uBAAK,EAAC,aAAa,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;;6DAChC"}
@@ -11,10 +11,16 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ForgotPasswordDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const swagger_1 = require("@nestjs/swagger");
14
15
  class ForgotPasswordDto {
15
16
  }
16
17
  exports.ForgotPasswordDto = ForgotPasswordDto;
17
18
  __decorate([
19
+ (0, swagger_1.ApiProperty)({
20
+ description: 'Email address of the user requesting password reset',
21
+ example: 'user@example.com',
22
+ format: 'email'
23
+ }),
18
24
  (0, class_validator_1.IsEmail)(),
19
25
  (0, class_validator_1.IsNotEmpty)(),
20
26
  __metadata("design:type", String)
@@ -1 +1 @@
1
- {"version":3,"file":"forgot-password.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/forgot-password.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAsD;AAEtD,MAAa,iBAAiB;CAI7B;AAJD,8CAIC;AADG;IAFC,IAAA,yBAAO,GAAE;IACT,IAAA,4BAAU,GAAE;;gDACE"}
1
+ {"version":3,"file":"forgot-password.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/forgot-password.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAsD;AACtD,6CAA8C;AAE9C,MAAa,iBAAiB;CAS7B;AATD,8CASC;AADG;IAPC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,qDAAqD;QAClE,OAAO,EAAE,kBAAkB;QAC3B,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,IAAA,yBAAO,GAAE;IACT,IAAA,4BAAU,GAAE;;gDACE"}
@@ -11,30 +11,53 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.RegisterMobileUserDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const swagger_1 = require("@nestjs/swagger");
14
15
  class RegisterMobileUserDto {
15
16
  }
16
17
  exports.RegisterMobileUserDto = RegisterMobileUserDto;
17
18
  __decorate([
19
+ (0, swagger_1.ApiProperty)({
20
+ description: 'Full name of the mobile user',
21
+ example: 'John Doe'
22
+ }),
18
23
  (0, class_validator_1.IsString)(),
19
24
  (0, class_validator_1.IsNotEmpty)(),
20
25
  __metadata("design:type", String)
21
26
  ], RegisterMobileUserDto.prototype, "name", void 0);
22
27
  __decorate([
28
+ (0, swagger_1.ApiProperty)({
29
+ description: 'Email address of the mobile user',
30
+ example: 'john.doe@example.com',
31
+ format: 'email'
32
+ }),
23
33
  (0, class_validator_1.IsEmail)(),
24
34
  (0, class_validator_1.IsNotEmpty)(),
25
35
  __metadata("design:type", String)
26
36
  ], RegisterMobileUserDto.prototype, "email", void 0);
27
37
  __decorate([
38
+ (0, swagger_1.ApiProperty)({
39
+ description: 'Phone number with country code',
40
+ example: '+1234567890',
41
+ format: 'phone'
42
+ }),
28
43
  (0, class_validator_1.IsString)(),
29
44
  (0, class_validator_1.IsNotEmpty)(),
30
45
  __metadata("design:type", String)
31
46
  ], RegisterMobileUserDto.prototype, "phoneNumber", void 0);
32
47
  __decorate([
48
+ (0, swagger_1.ApiProperty)({
49
+ description: 'ID of the control centre the user belongs to',
50
+ example: 123
51
+ }),
33
52
  (0, class_validator_1.IsNumber)(),
34
53
  (0, class_validator_1.IsNotEmpty)(),
35
54
  __metadata("design:type", Number)
36
55
  ], RegisterMobileUserDto.prototype, "controlCentreId", void 0);
37
56
  __decorate([
57
+ (0, swagger_1.ApiProperty)({
58
+ description: 'ID of the organization the user belongs to',
59
+ example: 456
60
+ }),
38
61
  (0, class_validator_1.IsNumber)(),
39
62
  (0, class_validator_1.IsNotEmpty)(),
40
63
  __metadata("design:type", Number)
@@ -1 +1 @@
1
- {"version":3,"file":"register-mobile-user.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/register-mobile-user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA0E;AAE1E,MAAa,qBAAqB;CAoBjC;AApBD,sDAoBC;AAjBG;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;mDACC;AAId;IAFC,IAAA,yBAAO,GAAE;IACT,IAAA,4BAAU,GAAE;;oDACE;AAIf;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0DACQ;AAIrB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;8DACY;AAIzB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;6DACW"}
1
+ {"version":3,"file":"register-mobile-user.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/register-mobile-user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA0E;AAC1E,6CAA8C;AAE9C,MAAa,qBAAqB;CA0CjC;AA1CD,sDA0CC;AAnCG;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,8BAA8B;QAC3C,OAAO,EAAE,UAAU;KACtB,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;mDACC;AASd;IAPC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,kCAAkC;QAC/C,OAAO,EAAE,sBAAsB;QAC/B,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,IAAA,yBAAO,GAAE;IACT,IAAA,4BAAU,GAAE;;oDACE;AASf;IAPC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,gCAAgC;QAC7C,OAAO,EAAE,aAAa;QACtB,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0DACQ;AAQrB;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,8CAA8C;QAC3D,OAAO,EAAE,GAAG;KACf,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;8DACY;AAQzB;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,4CAA4C;QACzD,OAAO,EAAE,GAAG;KACf,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;6DACW"}
@@ -11,16 +11,26 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ResendOTPDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const swagger_1 = require("@nestjs/swagger");
14
15
  const otp_action_1 = require("../enums/otp-action");
15
16
  class ResendOTPDto {
16
17
  }
17
18
  exports.ResendOTPDto = ResendOTPDto;
18
19
  __decorate([
20
+ (0, swagger_1.ApiProperty)({
21
+ description: 'Action for which OTP is being requested',
22
+ enum: otp_action_1.OtpAction,
23
+ example: otp_action_1.OtpAction.LOGIN
24
+ }),
19
25
  (0, class_validator_1.IsEnum)(otp_action_1.OtpAction),
20
26
  (0, class_validator_1.IsNotEmpty)(),
21
27
  __metadata("design:type", String)
22
28
  ], ResendOTPDto.prototype, "action", void 0);
23
29
  __decorate([
30
+ (0, swagger_1.ApiProperty)({
31
+ description: 'Verification token from previous request',
32
+ example: 'abc123def456'
33
+ }),
24
34
  (0, class_validator_1.IsString)(),
25
35
  (0, class_validator_1.IsNotEmpty)(),
26
36
  __metadata("design:type", String)
@@ -1 +1 @@
1
- {"version":3,"file":"resend-otp.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/resend-otp.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA+D;AAC/D,oDAAgD;AAEhD,MAAa,YAAY;CAQxB;AARD,oCAQC;AALG;IAFC,IAAA,wBAAM,EAAC,sBAAS,CAAC;IACjB,IAAA,4BAAU,GAAE;;4CACM;AAInB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;uDACc"}
1
+ {"version":3,"file":"resend-otp.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/resend-otp.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA+D;AAC/D,6CAA8C;AAC9C,oDAAgD;AAEhD,MAAa,YAAY;CAiBxB;AAjBD,oCAiBC;AATG;IAPC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,yCAAyC;QACtD,IAAI,EAAE,sBAAS;QACf,OAAO,EAAE,sBAAS,CAAC,KAAK;KAC3B,CAAC;IACD,IAAA,wBAAM,EAAC,sBAAS,CAAC;IACjB,IAAA,4BAAU,GAAE;;4CACM;AAQnB;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,0CAA0C;QACvD,OAAO,EAAE,cAAc;KAC1B,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;uDACc"}
@@ -11,17 +11,28 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ResetPasswordDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const swagger_1 = require("@nestjs/swagger");
14
15
  const match_decorator_1 = require("../validators/match.decorator");
15
16
  const password_regex_const_1 = require("../../common/constants/password-regex.const");
16
17
  class ResetPasswordDto {
17
18
  }
18
19
  exports.ResetPasswordDto = ResetPasswordDto;
19
20
  __decorate([
21
+ (0, swagger_1.ApiProperty)({
22
+ description: 'Verification token received in password reset email',
23
+ example: 'abc123def456ghi789'
24
+ }),
20
25
  (0, class_validator_1.IsString)(),
21
26
  (0, class_validator_1.IsNotEmpty)(),
22
27
  __metadata("design:type", String)
23
28
  ], ResetPasswordDto.prototype, "verificationToken", void 0);
24
29
  __decorate([
30
+ (0, swagger_1.ApiProperty)({
31
+ description: 'New password for the user account',
32
+ example: 'NewSecurePass123!',
33
+ minLength: 8,
34
+ pattern: password_regex_const_1.PASSWORD_REGEX.source
35
+ }),
25
36
  (0, class_validator_1.IsString)(),
26
37
  (0, class_validator_1.IsNotEmpty)(),
27
38
  (0, class_validator_1.MinLength)(8),
@@ -29,6 +40,12 @@ __decorate([
29
40
  __metadata("design:type", String)
30
41
  ], ResetPasswordDto.prototype, "password", void 0);
31
42
  __decorate([
43
+ (0, swagger_1.ApiProperty)({
44
+ description: 'Confirmation of the new password (must match password)',
45
+ example: 'NewSecurePass123!',
46
+ minLength: 8,
47
+ pattern: password_regex_const_1.PASSWORD_REGEX.source
48
+ }),
32
49
  (0, class_validator_1.IsString)(),
33
50
  (0, class_validator_1.IsNotEmpty)(),
34
51
  (0, class_validator_1.MinLength)(8),
@@ -1 +1 @@
1
- {"version":3,"file":"reset-password.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/reset-password.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAKyB;AACzB,mEAAsD;AACtD,sFAAqG;AAErG,MAAa,gBAAgB;CAiB5B;AAjBD,4CAiBC;AAdG;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;2DACc;AAM3B;IAJC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,CAAC,CAAC;IACZ,IAAA,yBAAO,EAAC,qCAAc,EAAE,EAAE,OAAO,EAAE,6CAAsB,EAAE,CAAC;;kDAC3C;AAOlB;IALC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,CAAC,CAAC;IACZ,IAAA,yBAAO,EAAC,qCAAc,EAAE,EAAE,OAAO,EAAE,6CAAsB,EAAE,CAAC;IAC5D,IAAA,uBAAK,EAAC,UAAU,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;;yDAChC"}
1
+ {"version":3,"file":"reset-password.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/reset-password.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAKyB;AACzB,6CAA8C;AAC9C,mEAAsD;AACtD,sFAAqG;AAErG,MAAa,gBAAgB;CAiC5B;AAjCD,4CAiCC;AA1BG;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,qDAAqD;QAClE,OAAO,EAAE,oBAAoB;KAChC,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;2DACc;AAY3B;IAVC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,mCAAmC;QAChD,OAAO,EAAE,mBAAmB;QAC5B,SAAS,EAAE,CAAC;QACZ,OAAO,EAAE,qCAAc,CAAC,MAAM;KACjC,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,CAAC,CAAC;IACZ,IAAA,yBAAO,EAAC,qCAAc,EAAE,EAAE,OAAO,EAAE,6CAAsB,EAAE,CAAC;;kDAC3C;AAalB;IAXC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,wDAAwD;QACrE,OAAO,EAAE,mBAAmB;QAC5B,SAAS,EAAE,CAAC;QACZ,OAAO,EAAE,qCAAc,CAAC,MAAM;KACjC,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,CAAC,CAAC;IACZ,IAAA,yBAAO,EAAC,qCAAc,EAAE,EAAE,OAAO,EAAE,6CAAsB,EAAE,CAAC;IAC5D,IAAA,uBAAK,EAAC,UAAU,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;;yDAChC"}
@@ -8,21 +8,36 @@ var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
10
  import { IsNotEmpty, IsNumber, IsString, Matches, MinLength } from "class-validator";
11
+ import { ApiProperty } from "@nestjs/swagger";
11
12
  import { PASSWORD_ERROR_MESSAGE, PASSWORD_REGEX } from "../../common/constants/password-regex.const";
12
13
  import { Match } from "../validators/match.decorator";
13
14
  export class ChangePasswordDto {
14
15
  }
15
16
  __decorate([
17
+ ApiProperty({
18
+ description: 'User ID (automatically set from authenticated user)',
19
+ example: 123
20
+ }),
16
21
  IsNumber(),
17
22
  IsNotEmpty(),
18
23
  __metadata("design:type", Number)
19
24
  ], ChangePasswordDto.prototype, "userId", void 0);
20
25
  __decorate([
26
+ ApiProperty({
27
+ description: 'Current password of the user',
28
+ example: 'CurrentPass123!'
29
+ }),
21
30
  IsString(),
22
31
  IsNotEmpty(),
23
32
  __metadata("design:type", String)
24
33
  ], ChangePasswordDto.prototype, "oldPassword", void 0);
25
34
  __decorate([
35
+ ApiProperty({
36
+ description: 'New password for the user account',
37
+ example: 'NewSecurePass123!',
38
+ minLength: 8,
39
+ pattern: PASSWORD_REGEX.source
40
+ }),
26
41
  IsString(),
27
42
  IsNotEmpty(),
28
43
  MinLength(8),
@@ -30,6 +45,12 @@ __decorate([
30
45
  __metadata("design:type", String)
31
46
  ], ChangePasswordDto.prototype, "newPassword", void 0);
32
47
  __decorate([
48
+ ApiProperty({
49
+ description: 'Confirmation of the new password (must match newPassword)',
50
+ example: 'NewSecurePass123!',
51
+ minLength: 8,
52
+ pattern: PASSWORD_REGEX.source
53
+ }),
33
54
  IsString(),
34
55
  IsNotEmpty(),
35
56
  MinLength(8),
@@ -1 +1 @@
1
- {"version":3,"file":"change-password.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/change-password.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AACrG,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAEtD,MAAM,OAAO,iBAAiB;CAqB7B;AAlBG;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;iDACG;AAIhB;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;sDACQ;AAMrB;IAJC,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,SAAS,CAAC,CAAC,CAAC;IACZ,OAAO,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC;;sDACxC;AAOrB;IALC,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,SAAS,CAAC,CAAC,CAAC;IACZ,OAAO,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC;IAC5D,KAAK,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;;6DAChC"}
1
+ {"version":3,"file":"change-password.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/change-password.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AACrG,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAEtD,MAAM,OAAO,iBAAiB;CAyC7B;AAlCG;IANC,WAAW,CAAC;QACT,WAAW,EAAE,qDAAqD;QAClE,OAAO,EAAE,GAAG;KACf,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;;iDACG;AAQhB;IANC,WAAW,CAAC;QACT,WAAW,EAAE,8BAA8B;QAC3C,OAAO,EAAE,iBAAiB;KAC7B,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;;sDACQ;AAYrB;IAVC,WAAW,CAAC;QACT,WAAW,EAAE,mCAAmC;QAChD,OAAO,EAAE,mBAAmB;QAC5B,SAAS,EAAE,CAAC;QACZ,OAAO,EAAE,cAAc,CAAC,MAAM;KACjC,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,SAAS,CAAC,CAAC,CAAC;IACZ,OAAO,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC;;sDACxC;AAarB;IAXC,WAAW,CAAC;QACT,WAAW,EAAE,2DAA2D;QACxE,OAAO,EAAE,mBAAmB;QAC5B,SAAS,EAAE,CAAC;QACZ,OAAO,EAAE,cAAc,CAAC,MAAM;KACjC,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,SAAS,CAAC,CAAC,CAAC;IACZ,OAAO,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC;IAC5D,KAAK,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;;6DAChC"}
@@ -8,9 +8,15 @@ var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
10
  import { IsEmail, IsNotEmpty } from "class-validator";
11
+ import { ApiProperty } from "@nestjs/swagger";
11
12
  export class ForgotPasswordDto {
12
13
  }
13
14
  __decorate([
15
+ ApiProperty({
16
+ description: 'Email address of the user requesting password reset',
17
+ example: 'user@example.com',
18
+ format: 'email'
19
+ }),
14
20
  IsEmail(),
15
21
  IsNotEmpty(),
16
22
  __metadata("design:type", String)
@@ -1 +1 @@
1
- {"version":3,"file":"forgot-password.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/forgot-password.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,OAAO,iBAAiB;CAI7B;AADG;IAFC,OAAO,EAAE;IACT,UAAU,EAAE;;gDACE"}
1
+ {"version":3,"file":"forgot-password.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/forgot-password.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,OAAO,iBAAiB;CAS7B;AADG;IAPC,WAAW,CAAC;QACT,WAAW,EAAE,qDAAqD;QAClE,OAAO,EAAE,kBAAkB;QAC3B,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,OAAO,EAAE;IACT,UAAU,EAAE;;gDACE"}
@@ -8,29 +8,52 @@ var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
10
  import { IsEmail, IsNotEmpty, IsNumber, IsString } from "class-validator";
11
+ import { ApiProperty } from "@nestjs/swagger";
11
12
  export class RegisterMobileUserDto {
12
13
  }
13
14
  __decorate([
15
+ ApiProperty({
16
+ description: 'Full name of the mobile user',
17
+ example: 'John Doe'
18
+ }),
14
19
  IsString(),
15
20
  IsNotEmpty(),
16
21
  __metadata("design:type", String)
17
22
  ], RegisterMobileUserDto.prototype, "name", void 0);
18
23
  __decorate([
24
+ ApiProperty({
25
+ description: 'Email address of the mobile user',
26
+ example: 'john.doe@example.com',
27
+ format: 'email'
28
+ }),
19
29
  IsEmail(),
20
30
  IsNotEmpty(),
21
31
  __metadata("design:type", String)
22
32
  ], RegisterMobileUserDto.prototype, "email", void 0);
23
33
  __decorate([
34
+ ApiProperty({
35
+ description: 'Phone number with country code',
36
+ example: '+1234567890',
37
+ format: 'phone'
38
+ }),
24
39
  IsString(),
25
40
  IsNotEmpty(),
26
41
  __metadata("design:type", String)
27
42
  ], RegisterMobileUserDto.prototype, "phoneNumber", void 0);
28
43
  __decorate([
44
+ ApiProperty({
45
+ description: 'ID of the control centre the user belongs to',
46
+ example: 123
47
+ }),
29
48
  IsNumber(),
30
49
  IsNotEmpty(),
31
50
  __metadata("design:type", Number)
32
51
  ], RegisterMobileUserDto.prototype, "controlCentreId", void 0);
33
52
  __decorate([
53
+ ApiProperty({
54
+ description: 'ID of the organization the user belongs to',
55
+ example: 456
56
+ }),
34
57
  IsNumber(),
35
58
  IsNotEmpty(),
36
59
  __metadata("design:type", Number)
@@ -1 +1 @@
1
- {"version":3,"file":"register-mobile-user.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/register-mobile-user.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE1E,MAAM,OAAO,qBAAqB;CAoBjC;AAjBG;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;mDACC;AAId;IAFC,OAAO,EAAE;IACT,UAAU,EAAE;;oDACE;AAIf;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;0DACQ;AAIrB;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;8DACY;AAIzB;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;6DACW"}
1
+ {"version":3,"file":"register-mobile-user.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/register-mobile-user.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,OAAO,qBAAqB;CA0CjC;AAnCG;IANC,WAAW,CAAC;QACT,WAAW,EAAE,8BAA8B;QAC3C,OAAO,EAAE,UAAU;KACtB,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;;mDACC;AASd;IAPC,WAAW,CAAC;QACT,WAAW,EAAE,kCAAkC;QAC/C,OAAO,EAAE,sBAAsB;QAC/B,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,OAAO,EAAE;IACT,UAAU,EAAE;;oDACE;AASf;IAPC,WAAW,CAAC;QACT,WAAW,EAAE,gCAAgC;QAC7C,OAAO,EAAE,aAAa;QACtB,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;;0DACQ;AAQrB;IANC,WAAW,CAAC;QACT,WAAW,EAAE,8CAA8C;QAC3D,OAAO,EAAE,GAAG;KACf,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;;8DACY;AAQzB;IANC,WAAW,CAAC;QACT,WAAW,EAAE,4CAA4C;QACzD,OAAO,EAAE,GAAG;KACf,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;;6DACW"}
@@ -8,15 +8,25 @@ var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
10
  import { IsEnum, IsNotEmpty, IsString } from "class-validator";
11
+ import { ApiProperty } from "@nestjs/swagger";
11
12
  import { OtpAction } from "../enums/otp-action";
12
13
  export class ResendOTPDto {
13
14
  }
14
15
  __decorate([
16
+ ApiProperty({
17
+ description: 'Action for which OTP is being requested',
18
+ enum: OtpAction,
19
+ example: OtpAction.LOGIN
20
+ }),
15
21
  IsEnum(OtpAction),
16
22
  IsNotEmpty(),
17
23
  __metadata("design:type", String)
18
24
  ], ResendOTPDto.prototype, "action", void 0);
19
25
  __decorate([
26
+ ApiProperty({
27
+ description: 'Verification token from previous request',
28
+ example: 'abc123def456'
29
+ }),
20
30
  IsString(),
21
31
  IsNotEmpty(),
22
32
  __metadata("design:type", String)
@@ -1 +1 @@
1
- {"version":3,"file":"resend-otp.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/resend-otp.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,MAAM,OAAO,YAAY;CAQxB;AALG;IAFC,MAAM,CAAC,SAAS,CAAC;IACjB,UAAU,EAAE;;4CACM;AAInB;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;uDACc"}
1
+ {"version":3,"file":"resend-otp.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/resend-otp.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,MAAM,OAAO,YAAY;CAiBxB;AATG;IAPC,WAAW,CAAC;QACT,WAAW,EAAE,yCAAyC;QACtD,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,SAAS,CAAC,KAAK;KAC3B,CAAC;IACD,MAAM,CAAC,SAAS,CAAC;IACjB,UAAU,EAAE;;4CACM;AAQnB;IANC,WAAW,CAAC;QACT,WAAW,EAAE,0CAA0C;QACvD,OAAO,EAAE,cAAc;KAC1B,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;;uDACc"}
@@ -8,16 +8,27 @@ var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
10
  import { IsNotEmpty, IsString, Matches, MinLength } from "class-validator";
11
+ import { ApiProperty } from "@nestjs/swagger";
11
12
  import { Match } from "../validators/match.decorator";
12
13
  import { PASSWORD_ERROR_MESSAGE, PASSWORD_REGEX } from "../../common/constants/password-regex.const";
13
14
  export class ResetPasswordDto {
14
15
  }
15
16
  __decorate([
17
+ ApiProperty({
18
+ description: 'Verification token received in password reset email',
19
+ example: 'abc123def456ghi789'
20
+ }),
16
21
  IsString(),
17
22
  IsNotEmpty(),
18
23
  __metadata("design:type", String)
19
24
  ], ResetPasswordDto.prototype, "verificationToken", void 0);
20
25
  __decorate([
26
+ ApiProperty({
27
+ description: 'New password for the user account',
28
+ example: 'NewSecurePass123!',
29
+ minLength: 8,
30
+ pattern: PASSWORD_REGEX.source
31
+ }),
21
32
  IsString(),
22
33
  IsNotEmpty(),
23
34
  MinLength(8),
@@ -25,6 +36,12 @@ __decorate([
25
36
  __metadata("design:type", String)
26
37
  ], ResetPasswordDto.prototype, "password", void 0);
27
38
  __decorate([
39
+ ApiProperty({
40
+ description: 'Confirmation of the new password (must match password)',
41
+ example: 'NewSecurePass123!',
42
+ minLength: 8,
43
+ pattern: PASSWORD_REGEX.source
44
+ }),
28
45
  IsString(),
29
46
  IsNotEmpty(),
30
47
  MinLength(8),
@@ -1 +1 @@
1
- {"version":3,"file":"reset-password.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/reset-password.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACH,UAAU,EACV,QAAQ,EACR,OAAO,EACP,SAAS,EACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAErG,MAAM,OAAO,gBAAgB;CAiB5B;AAdG;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;2DACc;AAM3B;IAJC,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,SAAS,CAAC,CAAC,CAAC;IACZ,OAAO,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC;;kDAC3C;AAOlB;IALC,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,SAAS,CAAC,CAAC,CAAC;IACZ,OAAO,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC;IAC5D,KAAK,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;;yDAChC"}
1
+ {"version":3,"file":"reset-password.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/reset-password.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACH,UAAU,EACV,QAAQ,EACR,OAAO,EACP,SAAS,EACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAErG,MAAM,OAAO,gBAAgB;CAiC5B;AA1BG;IANC,WAAW,CAAC;QACT,WAAW,EAAE,qDAAqD;QAClE,OAAO,EAAE,oBAAoB;KAChC,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;;2DACc;AAY3B;IAVC,WAAW,CAAC;QACT,WAAW,EAAE,mCAAmC;QAChD,OAAO,EAAE,mBAAmB;QAC5B,SAAS,EAAE,CAAC;QACZ,OAAO,EAAE,cAAc,CAAC,MAAM;KACjC,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,SAAS,CAAC,CAAC,CAAC;IACZ,OAAO,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC;;kDAC3C;AAalB;IAXC,WAAW,CAAC;QACT,WAAW,EAAE,wDAAwD;QACrE,OAAO,EAAE,mBAAmB;QAC5B,SAAS,EAAE,CAAC;QACZ,OAAO,EAAE,cAAc,CAAC,MAAM;KACjC,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,SAAS,CAAC,CAAC,CAAC;IACZ,OAAO,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC;IAC5D,KAAK,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;;yDAChC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grm-shared-library",
3
- "version": "1.1.77",
3
+ "version": "1.1.79",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",