@vynelix/nestjs-multi-auth 0.0.2
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/README.md +760 -0
- package/bin/cli.js +152 -0
- package/dist/auth/auth-type.enum.d.ts +22 -0
- package/dist/auth/auth-type.enum.js +32 -0
- package/dist/auth/auth-type.enum.js.map +1 -0
- package/dist/auth/auth.controller.d.ts +70 -0
- package/dist/auth/auth.controller.js +434 -0
- package/dist/auth/auth.controller.js.map +1 -0
- package/dist/auth/auth.module.d.ts +9 -0
- package/dist/auth/auth.module.js +193 -0
- package/dist/auth/auth.module.js.map +1 -0
- package/dist/auth/auth.service.d.ts +180 -0
- package/dist/auth/auth.service.js +695 -0
- package/dist/auth/auth.service.js.map +1 -0
- package/dist/auth/core/auth-mapper.d.ts +6 -0
- package/dist/auth/core/auth-mapper.js +17 -0
- package/dist/auth/core/auth-mapper.js.map +1 -0
- package/dist/auth/core/jwt.strategy.d.ts +13 -0
- package/dist/auth/core/jwt.strategy.js +59 -0
- package/dist/auth/core/jwt.strategy.js.map +1 -0
- package/dist/auth/core/registration.d.ts +3 -0
- package/dist/auth/core/registration.js +60 -0
- package/dist/auth/core/registration.js.map +1 -0
- package/dist/auth/current-user-interface.d.ts +4 -0
- package/dist/auth/current-user-interface.js +4 -0
- package/dist/auth/current-user-interface.js.map +1 -0
- package/dist/auth/current-user.decorator.d.ts +2 -0
- package/dist/auth/current-user.decorator.js +16 -0
- package/dist/auth/current-user.decorator.js.map +1 -0
- package/dist/auth/decorator/current-user.decorator.d.ts +2 -0
- package/dist/auth/decorator/current-user.decorator.js +13 -0
- package/dist/auth/decorator/current-user.decorator.js.map +1 -0
- package/dist/auth/decorator/email-or-phone.decorator.d.ts +2 -0
- package/dist/auth/decorator/email-or-phone.decorator.js +26 -0
- package/dist/auth/decorator/email-or-phone.decorator.js.map +1 -0
- package/dist/auth/decorator/optional.decorator.d.ts +2 -0
- package/dist/auth/decorator/optional.decorator.js +9 -0
- package/dist/auth/decorator/optional.decorator.js.map +1 -0
- package/dist/auth/decorator/public.decorator.d.ts +2 -0
- package/dist/auth/decorator/public.decorator.js +9 -0
- package/dist/auth/decorator/public.decorator.js.map +1 -0
- package/dist/auth/dto/auth-response.dto.d.ts +17 -0
- package/dist/auth/dto/auth-response.dto.js +83 -0
- package/dist/auth/dto/auth-response.dto.js.map +1 -0
- package/dist/auth/dto/identifier-response.dto.d.ts +8 -0
- package/dist/auth/dto/identifier-response.dto.js +46 -0
- package/dist/auth/dto/identifier-response.dto.js.map +1 -0
- package/dist/auth/dto/login.dto.d.ts +11 -0
- package/dist/auth/dto/login.dto.js +68 -0
- package/dist/auth/dto/login.dto.js.map +1 -0
- package/dist/auth/dto/mfa.dto.d.ts +8 -0
- package/dist/auth/dto/mfa.dto.js +51 -0
- package/dist/auth/dto/mfa.dto.js.map +1 -0
- package/dist/auth/dto/oauth-provider-response.dto.d.ts +5 -0
- package/dist/auth/dto/oauth-provider-response.dto.js +30 -0
- package/dist/auth/dto/oauth-provider-response.dto.js.map +1 -0
- package/dist/auth/dto/refresh-token.dto.d.ts +3 -0
- package/dist/auth/dto/refresh-token.dto.js +28 -0
- package/dist/auth/dto/refresh-token.dto.js.map +1 -0
- package/dist/auth/dto/requests/forgot-password.dto.d.ts +5 -0
- package/dist/auth/dto/requests/forgot-password.dto.js +36 -0
- package/dist/auth/dto/requests/forgot-password.dto.js.map +1 -0
- package/dist/auth/dto/requests/login.dto.d.ts +11 -0
- package/dist/auth/dto/requests/login.dto.js +68 -0
- package/dist/auth/dto/requests/login.dto.js.map +1 -0
- package/dist/auth/dto/requests/magic-link.dto.d.ts +6 -0
- package/dist/auth/dto/requests/magic-link.dto.js +33 -0
- package/dist/auth/dto/requests/magic-link.dto.js.map +1 -0
- package/dist/auth/dto/requests/mfa.dto.d.ts +8 -0
- package/dist/auth/dto/requests/mfa.dto.js +51 -0
- package/dist/auth/dto/requests/mfa.dto.js.map +1 -0
- package/dist/auth/dto/requests/refresh-token.dto.d.ts +3 -0
- package/dist/auth/dto/requests/refresh-token.dto.js +29 -0
- package/dist/auth/dto/requests/refresh-token.dto.js.map +1 -0
- package/dist/auth/dto/requests/reset-password.dto.d.ts +5 -0
- package/dist/auth/dto/requests/reset-password.dto.js +36 -0
- package/dist/auth/dto/requests/reset-password.dto.js.map +1 -0
- package/dist/auth/dto/requests/secure-account.dto.d.ts +3 -0
- package/dist/auth/dto/requests/secure-account.dto.js +24 -0
- package/dist/auth/dto/requests/secure-account.dto.js.map +1 -0
- package/dist/auth/dto/requests/signup.dto.d.ts +13 -0
- package/dist/auth/dto/requests/signup.dto.js +70 -0
- package/dist/auth/dto/requests/signup.dto.js.map +1 -0
- package/dist/auth/dto/requests/update-password.dto.d.ts +4 -0
- package/dist/auth/dto/requests/update-password.dto.js +30 -0
- package/dist/auth/dto/requests/update-password.dto.js.map +1 -0
- package/dist/auth/dto/requests/verify.dto.d.ts +7 -0
- package/dist/auth/dto/requests/verify.dto.js +48 -0
- package/dist/auth/dto/requests/verify.dto.js.map +1 -0
- package/dist/auth/dto/responses/auth-response.dto.d.ts +17 -0
- package/dist/auth/dto/responses/auth-response.dto.js +83 -0
- package/dist/auth/dto/responses/auth-response.dto.js.map +1 -0
- package/dist/auth/dto/responses/identifier-response.dto.d.ts +10 -0
- package/dist/auth/dto/responses/identifier-response.dto.js +56 -0
- package/dist/auth/dto/responses/identifier-response.dto.js.map +1 -0
- package/dist/auth/dto/responses/oauth-provider-response.dto.d.ts +10 -0
- package/dist/auth/dto/responses/oauth-provider-response.dto.js +55 -0
- package/dist/auth/dto/responses/oauth-provider-response.dto.js.map +1 -0
- package/dist/auth/dto/signup.dto.d.ts +13 -0
- package/dist/auth/dto/signup.dto.js +70 -0
- package/dist/auth/dto/signup.dto.js.map +1 -0
- package/dist/auth/dto/verify.dto.d.ts +7 -0
- package/dist/auth/dto/verify.dto.js +48 -0
- package/dist/auth/dto/verify.dto.js.map +1 -0
- package/dist/auth/entities/auth-identify.entity.d.ts +33 -0
- package/dist/auth/entities/auth-identify.entity.js +73 -0
- package/dist/auth/entities/auth-identify.entity.js.map +1 -0
- package/dist/auth/entities/auth.entity.d.ts +45 -0
- package/dist/auth/entities/auth.entity.js +129 -0
- package/dist/auth/entities/auth.entity.js.map +1 -0
- package/dist/auth/entities/base.entity.d.ts +6 -0
- package/dist/auth/entities/base.entity.js +41 -0
- package/dist/auth/entities/base.entity.js.map +1 -0
- package/dist/auth/entities/mfa-method.entity.d.ts +23 -0
- package/dist/auth/entities/mfa-method.entity.js +69 -0
- package/dist/auth/entities/mfa-method.entity.js.map +1 -0
- package/dist/auth/entities/oauth-provider.entity.d.ts +38 -0
- package/dist/auth/entities/oauth-provider.entity.js +88 -0
- package/dist/auth/entities/oauth-provider.entity.js.map +1 -0
- package/dist/auth/entities/otp-token.entity.d.ts +22 -0
- package/dist/auth/entities/otp-token.entity.js +61 -0
- package/dist/auth/entities/otp-token.entity.js.map +1 -0
- package/dist/auth/entities/session.entity.d.ts +19 -0
- package/dist/auth/entities/session.entity.js +65 -0
- package/dist/auth/entities/session.entity.js.map +1 -0
- package/dist/auth/enums/auth-type.enum.d.ts +23 -0
- package/dist/auth/enums/auth-type.enum.js +34 -0
- package/dist/auth/enums/auth-type.enum.js.map +1 -0
- package/dist/auth/guards/jwt-auth.guard.d.ts +10 -0
- package/dist/auth/guards/jwt-auth.guard.js +68 -0
- package/dist/auth/guards/jwt-auth.guard.js.map +1 -0
- package/dist/auth/guards/optional-auth.guard.d.ts +8 -0
- package/dist/auth/guards/optional-auth.guard.js +45 -0
- package/dist/auth/guards/optional-auth.guard.js.map +1 -0
- package/dist/auth/guards/ws-jwt-auth.guard.d.ts +0 -0
- package/dist/auth/guards/ws-jwt-auth.guard.js +31 -0
- package/dist/auth/guards/ws-jwt-auth.guard.js.map +1 -0
- package/dist/auth/interfaces/auth-module-async-options.interface.d.ts +7 -0
- package/dist/auth/interfaces/auth-module-async-options.interface.js +3 -0
- package/dist/auth/interfaces/auth-module-async-options.interface.js.map +1 -0
- package/dist/auth/interfaces/auth-module-options.interface.d.ts +132 -0
- package/dist/auth/interfaces/auth-module-options.interface.js +5 -0
- package/dist/auth/interfaces/auth-module-options.interface.js.map +1 -0
- package/dist/auth/interfaces/auth-notification-provider.interface.d.ts +29 -0
- package/dist/auth/interfaces/auth-notification-provider.interface.js +5 -0
- package/dist/auth/interfaces/auth-notification-provider.interface.js.map +1 -0
- package/dist/auth/interfaces/auth-user-service.interface.d.ts +13 -0
- package/dist/auth/interfaces/auth-user-service.interface.js +7 -0
- package/dist/auth/interfaces/auth-user-service.interface.js.map +1 -0
- package/dist/auth/interfaces/current-user-interface.d.ts +4 -0
- package/dist/auth/interfaces/current-user-interface.js +4 -0
- package/dist/auth/interfaces/current-user-interface.js.map +1 -0
- package/dist/auth/interfaces/current-user.decorator.d.ts +2 -0
- package/dist/auth/interfaces/current-user.decorator.js +16 -0
- package/dist/auth/interfaces/current-user.decorator.js.map +1 -0
- package/dist/auth/interfaces/jwt-payload-interface.d.ts +4 -0
- package/dist/auth/interfaces/jwt-payload-interface.js +3 -0
- package/dist/auth/interfaces/jwt-payload-interface.js.map +1 -0
- package/dist/auth/interfaces/oauth-strategy.interface.d.ts +14 -0
- package/dist/auth/interfaces/oauth-strategy.interface.js +3 -0
- package/dist/auth/interfaces/oauth-strategy.interface.js.map +1 -0
- package/dist/auth/jwt-payload-interface.d.ts +4 -0
- package/dist/auth/jwt-payload-interface.js +3 -0
- package/dist/auth/jwt-payload-interface.js.map +1 -0
- package/dist/auth/jwt.strategy.d.ts +13 -0
- package/dist/auth/jwt.strategy.js +60 -0
- package/dist/auth/jwt.strategy.js.map +1 -0
- package/dist/auth/strategies/company.strategy.d.ts +0 -0
- package/dist/auth/strategies/company.strategy.js +1 -0
- package/dist/auth/strategies/company.strategy.js.map +1 -0
- package/dist/auth/strategies/google.strategy.d.ts +7 -0
- package/dist/auth/strategies/google.strategy.js +23 -0
- package/dist/auth/strategies/google.strategy.js.map +1 -0
- package/dist/auth/strategies/local-auth.strategy.d.ts +24 -0
- package/dist/auth/strategies/local-auth.strategy.js +244 -0
- package/dist/auth/strategies/local-auth.strategy.js.map +1 -0
- package/dist/auth/strategies/oauth/apple.strategy.d.ts +27 -0
- package/dist/auth/strategies/oauth/apple.strategy.js +176 -0
- package/dist/auth/strategies/oauth/apple.strategy.js.map +1 -0
- package/dist/auth/strategies/oauth/facebook.strategy.d.ts +24 -0
- package/dist/auth/strategies/oauth/facebook.strategy.js +150 -0
- package/dist/auth/strategies/oauth/facebook.strategy.js.map +1 -0
- package/dist/auth/strategies/oauth/google.strategy.d.ts +25 -0
- package/dist/auth/strategies/oauth/google.strategy.js +225 -0
- package/dist/auth/strategies/oauth/google.strategy.js.map +1 -0
- package/dist/auth/strategies/oauth/oauth-strategy.interface.d.ts +14 -0
- package/dist/auth/strategies/oauth/oauth-strategy.interface.js +3 -0
- package/dist/auth/strategies/oauth/oauth-strategy.interface.js.map +1 -0
- package/dist/auth/strategies/oauth/oauth.strategy.d.ts +25 -0
- package/dist/auth/strategies/oauth/oauth.strategy.js +70 -0
- package/dist/auth/strategies/oauth/oauth.strategy.js.map +1 -0
- package/dist/auth/strategies/otp.strategy.d.ts +7 -0
- package/dist/auth/strategies/otp.strategy.js +23 -0
- package/dist/auth/strategies/otp.strategy.js.map +1 -0
- package/dist/auth/strategies/password.strategy.d.ts +14 -0
- package/dist/auth/strategies/password.strategy.js +130 -0
- package/dist/auth/strategies/password.strategy.js.map +1 -0
- package/dist/auth/utils/duration.util.d.ts +8 -0
- package/dist/auth/utils/duration.util.js +29 -0
- package/dist/auth/utils/duration.util.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations/auth-entities.d.ts +7 -0
- package/dist/migrations/auth-entities.js +18 -0
- package/dist/migrations/auth-entities.js.map +1 -0
- package/dist/migrations/auth-schema.initializer.d.ts +9 -0
- package/dist/migrations/auth-schema.initializer.js +36 -0
- package/dist/migrations/auth-schema.initializer.js.map +1 -0
- package/dist/migrations/auth.migration.v1.d.ts +12 -0
- package/dist/migrations/auth.migration.v1.js +157 -0
- package/dist/migrations/auth.migration.v1.js.map +1 -0
- package/dist/migrations/auth.migration.v2.d.ts +8 -0
- package/dist/migrations/auth.migration.v2.js +39 -0
- package/dist/migrations/auth.migration.v2.js.map +1 -0
- package/dist/migrations/auth.migrations.d.ts +2 -0
- package/dist/migrations/auth.migrations.js +8 -0
- package/dist/migrations/auth.migrations.js.map +1 -0
- package/dist/migrations/migration.runner.d.ts +9 -0
- package/dist/migrations/migration.runner.js +67 -0
- package/dist/migrations/migration.runner.js.map +1 -0
- package/dist/migrations/migration.service.d.ts +9 -0
- package/dist/migrations/migration.service.js +71 -0
- package/dist/migrations/migration.service.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,70 @@
|
|
|
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.SignupDto = void 0;
|
|
13
|
+
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
const auth_type_enum_1 = require("../../enums/auth-type.enum");
|
|
17
|
+
class SignupDto {
|
|
18
|
+
}
|
|
19
|
+
exports.SignupDto = SignupDto;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, swagger_1.ApiProperty)({
|
|
22
|
+
enum: auth_type_enum_1.AuthStrategy,
|
|
23
|
+
example: auth_type_enum_1.AuthStrategy.LOCAL,
|
|
24
|
+
description: 'Authentication method chosen by the user',
|
|
25
|
+
type: () => auth_type_enum_1.AuthStrategy,
|
|
26
|
+
}),
|
|
27
|
+
(0, class_validator_1.IsEnum)(auth_type_enum_1.AuthStrategy),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], SignupDto.prototype, "method", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, swagger_1.ApiProperty)({
|
|
32
|
+
enum: auth_type_enum_1.OAuthProviderType,
|
|
33
|
+
example: auth_type_enum_1.OAuthProviderType.GOOGLE,
|
|
34
|
+
description: 'OAuth provider (required if method is OAUTH)',
|
|
35
|
+
required: false,
|
|
36
|
+
}),
|
|
37
|
+
(0, class_validator_1.IsEnum)(auth_type_enum_1.OAuthProviderType),
|
|
38
|
+
(0, class_validator_1.IsOptional)(),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], SignupDto.prototype, "provider", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, swagger_1.ApiProperty)({ example: '+2347035742844', required: false }),
|
|
43
|
+
(0, class_validator_1.IsPhoneNumber)('NG'),
|
|
44
|
+
(0, class_validator_1.IsOptional)(),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], SignupDto.prototype, "phone", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, swagger_1.ApiProperty)({ example: 'john_doe', required: false }),
|
|
49
|
+
(0, class_validator_1.IsOptional)(),
|
|
50
|
+
(0, class_validator_1.IsString)(),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], SignupDto.prototype, "username", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, swagger_1.ApiProperty)({ example: 'john@example.com', required: false }),
|
|
55
|
+
(0, class_validator_1.IsOptional)(),
|
|
56
|
+
(0, class_validator_1.IsEmail)(),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], SignupDto.prototype, "email", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, swagger_1.ApiProperty)({ example: 'securePassword123', required: false }),
|
|
61
|
+
(0, class_validator_1.IsOptional)(),
|
|
62
|
+
(0, class_validator_1.MinLength)(6),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], SignupDto.prototype, "password", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, class_validator_1.IsOptional)(),
|
|
67
|
+
(0, class_validator_1.IsString)(),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], SignupDto.prototype, "token", void 0);
|
|
70
|
+
//# sourceMappingURL=signup.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signup.dto.js","sourceRoot":"","sources":["../../../../src/auth/dto/requests/signup.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sDAAsD;AACtD,6CAA8C;AAC9C,qDAOyB;AACzB,+DAA6E;AAE7E,MAAa,SAAS;CA+CrB;AA/CD,8BA+CC;AAvCC;IAPC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,6BAAY;QAClB,OAAO,EAAE,6BAAY,CAAC,KAAK;QAC3B,WAAW,EAAE,0CAA0C;QACvD,IAAI,EAAE,GAAG,EAAE,CAAC,6BAAY;KACzB,CAAC;IACD,IAAA,wBAAM,EAAC,6BAAY,CAAC;;yCACA;AAUrB;IARC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,kCAAiB;QACvB,OAAO,EAAE,kCAAiB,CAAC,MAAM;QACjC,WAAW,EAAE,8CAA8C;QAC3D,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,wBAAM,EAAC,kCAAiB,CAAC;IACzB,IAAA,4BAAU,GAAE;;2CACgB;AAM7B;IAHC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC3D,IAAA,+BAAa,EAAC,IAAI,CAAC;IACnB,IAAA,4BAAU,GAAE;;wCACE;AAKf;IAHC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACrD,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;2CACO;AAKlB;IAHC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC7D,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;;wCACK;AAKf;IAHC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC9D,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,CAAC,CAAC;;2CACK;AAOlB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;wCACI"}
|
|
@@ -0,0 +1,30 @@
|
|
|
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.UpdatePasswordDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class UpdatePasswordDto {
|
|
16
|
+
}
|
|
17
|
+
exports.UpdatePasswordDto = UpdatePasswordDto;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, swagger_1.ApiProperty)({ example: 'oldPassword123' }),
|
|
20
|
+
(0, class_validator_1.IsString)(),
|
|
21
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], UpdatePasswordDto.prototype, "currentPassword", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, swagger_1.ApiProperty)({ example: 'newPassword456' }),
|
|
26
|
+
(0, class_validator_1.IsString)(),
|
|
27
|
+
(0, class_validator_1.MinLength)(6),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], UpdatePasswordDto.prototype, "newPassword", void 0);
|
|
30
|
+
//# sourceMappingURL=update-password.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-password.dto.js","sourceRoot":"","sources":["../../../../src/auth/dto/requests/update-password.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAAkE;AAElE,MAAa,iBAAiB;CAU7B;AAVD,8CAUC;AANC;IAHC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC1C,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0DACW;AAKxB;IAHC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC1C,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,CAAC,CAAC;;sDACO"}
|
|
@@ -0,0 +1,48 @@
|
|
|
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.ResendVerificationDto = exports.VerifyDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
class VerifyDto {
|
|
16
|
+
}
|
|
17
|
+
exports.VerifyDto = VerifyDto;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, swagger_1.ApiProperty)({
|
|
20
|
+
description: 'The unique identity ID (UID) being verified',
|
|
21
|
+
example: 'uuid-string',
|
|
22
|
+
}),
|
|
23
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
24
|
+
(0, class_validator_1.IsUUID)(),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], VerifyDto.prototype, "uid", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, swagger_1.ApiProperty)({
|
|
29
|
+
description: 'The verification code sent via email or phone',
|
|
30
|
+
example: '123456',
|
|
31
|
+
}),
|
|
32
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
33
|
+
(0, class_validator_1.IsString)(),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], VerifyDto.prototype, "code", void 0);
|
|
36
|
+
class ResendVerificationDto {
|
|
37
|
+
}
|
|
38
|
+
exports.ResendVerificationDto = ResendVerificationDto;
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, swagger_1.ApiProperty)({
|
|
41
|
+
description: 'The unique identity ID (UID) to resend the code for',
|
|
42
|
+
example: 'uuid-string',
|
|
43
|
+
}),
|
|
44
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
45
|
+
(0, class_validator_1.IsUUID)(),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], ResendVerificationDto.prototype, "uid", void 0);
|
|
48
|
+
//# sourceMappingURL=verify.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.dto.js","sourceRoot":"","sources":["../../../../src/auth/dto/requests/verify.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA+D;AAC/D,6CAA8C;AAE9C,MAAa,SAAS;CAgBrB;AAhBD,8BAgBC;AATG;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,6CAA6C;QAC1D,OAAO,EAAE,aAAa;KACzB,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;sCACG;AAQZ;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,+CAA+C;QAC5D,OAAO,EAAE,QAAQ;KACpB,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;uCACE;AAGjB,MAAa,qBAAqB;CAQjC;AARD,sDAQC;AADG;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,qDAAqD;QAClE,OAAO,EAAE,aAAa;KACzB,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;kDACG"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AuthStrategy } from '../../enums/auth-type.enum';
|
|
2
|
+
import { AuthIdentifierDto } from './identifier-response.dto';
|
|
3
|
+
import { OAuthProviderResponseDto } from './oauth-provider-response.dto';
|
|
4
|
+
export declare class AuthResponseDto {
|
|
5
|
+
id: string;
|
|
6
|
+
uid: string;
|
|
7
|
+
strategy: AuthStrategy;
|
|
8
|
+
isPrimary: boolean;
|
|
9
|
+
isVerified: boolean;
|
|
10
|
+
isActive: boolean;
|
|
11
|
+
meta?: Record<string, any>;
|
|
12
|
+
lastUsedAt?: Date;
|
|
13
|
+
identifiers?: AuthIdentifierDto[];
|
|
14
|
+
oauthProviders?: OAuthProviderResponseDto[];
|
|
15
|
+
createdAt: Date;
|
|
16
|
+
updatedAt: Date;
|
|
17
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
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.AuthResponseDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const auth_type_enum_1 = require("../../enums/auth-type.enum");
|
|
15
|
+
const class_transformer_1 = require("class-transformer");
|
|
16
|
+
const identifier_response_dto_1 = require("./identifier-response.dto");
|
|
17
|
+
const oauth_provider_response_dto_1 = require("./oauth-provider-response.dto");
|
|
18
|
+
class AuthResponseDto {
|
|
19
|
+
}
|
|
20
|
+
exports.AuthResponseDto = AuthResponseDto;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_transformer_1.Expose)(),
|
|
23
|
+
(0, swagger_1.ApiProperty)(),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], AuthResponseDto.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_transformer_1.Expose)(),
|
|
28
|
+
(0, swagger_1.ApiProperty)(),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], AuthResponseDto.prototype, "uid", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_transformer_1.Expose)(),
|
|
33
|
+
(0, swagger_1.ApiProperty)({ enum: auth_type_enum_1.AuthStrategy }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], AuthResponseDto.prototype, "strategy", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, class_transformer_1.Expose)(),
|
|
38
|
+
(0, swagger_1.ApiProperty)(),
|
|
39
|
+
__metadata("design:type", Boolean)
|
|
40
|
+
], AuthResponseDto.prototype, "isPrimary", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, class_transformer_1.Expose)(),
|
|
43
|
+
(0, swagger_1.ApiProperty)(),
|
|
44
|
+
__metadata("design:type", Boolean)
|
|
45
|
+
], AuthResponseDto.prototype, "isVerified", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, class_transformer_1.Expose)(),
|
|
48
|
+
(0, swagger_1.ApiProperty)(),
|
|
49
|
+
__metadata("design:type", Boolean)
|
|
50
|
+
], AuthResponseDto.prototype, "isActive", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, class_transformer_1.Expose)(),
|
|
53
|
+
(0, swagger_1.ApiProperty)({ required: false }),
|
|
54
|
+
__metadata("design:type", Object)
|
|
55
|
+
], AuthResponseDto.prototype, "meta", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, class_transformer_1.Expose)(),
|
|
58
|
+
(0, swagger_1.ApiProperty)({ required: false }),
|
|
59
|
+
__metadata("design:type", Date)
|
|
60
|
+
], AuthResponseDto.prototype, "lastUsedAt", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, class_transformer_1.Expose)(),
|
|
63
|
+
(0, swagger_1.ApiProperty)({ required: false }),
|
|
64
|
+
(0, class_transformer_1.Type)(() => identifier_response_dto_1.AuthIdentifierDto),
|
|
65
|
+
__metadata("design:type", Array)
|
|
66
|
+
], AuthResponseDto.prototype, "identifiers", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, class_transformer_1.Expose)(),
|
|
69
|
+
(0, class_transformer_1.Type)(() => oauth_provider_response_dto_1.OAuthProviderResponseDto),
|
|
70
|
+
(0, swagger_1.ApiProperty)({ type: oauth_provider_response_dto_1.OAuthProviderResponseDto, required: false }),
|
|
71
|
+
__metadata("design:type", Array)
|
|
72
|
+
], AuthResponseDto.prototype, "oauthProviders", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, class_transformer_1.Expose)(),
|
|
75
|
+
(0, swagger_1.ApiProperty)(),
|
|
76
|
+
__metadata("design:type", Date)
|
|
77
|
+
], AuthResponseDto.prototype, "createdAt", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, class_transformer_1.Expose)(),
|
|
80
|
+
(0, swagger_1.ApiProperty)(),
|
|
81
|
+
__metadata("design:type", Date)
|
|
82
|
+
], AuthResponseDto.prototype, "updatedAt", void 0);
|
|
83
|
+
//# sourceMappingURL=auth-response.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-response.dto.js","sourceRoot":"","sources":["../../../../src/auth/dto/responses/auth-response.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,+DAA0D;AAC1D,yDAAiD;AACjD,uEAA8D;AAC9D,+EAAyE;AAEzE,MAAa,eAAe;CAkD3B;AAlDD,0CAkDC;AA/CG;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;2CACH;AAIX;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;4CACF;AAIZ;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,6BAAY,EAAE,CAAC;;iDACb;AAIvB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;kDACK;AAInB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;mDACM;AAIpB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;iDACI;AAIlB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;6CACN;AAI3B;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;8BACpB,IAAI;mDAAC;AAKlB;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAChC,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,2CAAiB,CAAC;;oDACI;AAKlC;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,sDAAwB,CAAC;IACpC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,sDAAwB,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;uDACrB;AAI5C;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,GAAE;8BACH,IAAI;kDAAC;AAIhB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,GAAE;8BACH,IAAI;kDAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
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.AuthIdentifierDto = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
class AuthIdentifierDto {
|
|
16
|
+
}
|
|
17
|
+
exports.AuthIdentifierDto = AuthIdentifierDto;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_transformer_1.Expose)(),
|
|
20
|
+
(0, swagger_1.ApiProperty)(),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], AuthIdentifierDto.prototype, "id", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_transformer_1.Expose)(),
|
|
25
|
+
(0, swagger_1.ApiProperty)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], AuthIdentifierDto.prototype, "type", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_transformer_1.Expose)(),
|
|
30
|
+
(0, swagger_1.ApiProperty)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], AuthIdentifierDto.prototype, "value", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_transformer_1.Expose)(),
|
|
35
|
+
(0, swagger_1.ApiProperty)(),
|
|
36
|
+
__metadata("design:type", Boolean)
|
|
37
|
+
], AuthIdentifierDto.prototype, "isVerified", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_transformer_1.Expose)(),
|
|
40
|
+
(0, swagger_1.ApiProperty)(),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], AuthIdentifierDto.prototype, "source", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, class_transformer_1.Expose)(),
|
|
45
|
+
(0, swagger_1.ApiProperty)(),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], AuthIdentifierDto.prototype, "verifiedBy", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, class_transformer_1.Expose)(),
|
|
50
|
+
__metadata("design:type", Date)
|
|
51
|
+
], AuthIdentifierDto.prototype, "createdAt", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, class_transformer_1.Expose)(),
|
|
54
|
+
__metadata("design:type", Date)
|
|
55
|
+
], AuthIdentifierDto.prototype, "updatedAt", void 0);
|
|
56
|
+
//# sourceMappingURL=identifier-response.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifier-response.dto.js","sourceRoot":"","sources":["../../../../src/auth/dto/responses/identifier-response.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA2C;AAC3C,6CAA8C;AAE9C,MAAa,iBAAiB;CA8B7B;AA9BD,8CA8BC;AA3BC;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;6CACH;AAIX;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;+CACD;AAIb;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;gDACA;AAId;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;qDACM;AAIpB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;iDACC;AAIf;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;qDACK;AAGnB;IADC,IAAA,0BAAM,GAAE;8BACE,IAAI;oDAAC;AAGhB;IADC,IAAA,0BAAM,GAAE;8BACE,IAAI;oDAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OAuthProviderType } from '../../enums/auth-type.enum';
|
|
2
|
+
export declare class OAuthProviderResponseDto {
|
|
3
|
+
provider: OAuthProviderType;
|
|
4
|
+
providerUserId: string;
|
|
5
|
+
expiresAt?: Date;
|
|
6
|
+
displayName?: string;
|
|
7
|
+
avatarUrl?: string;
|
|
8
|
+
emailVerified?: boolean;
|
|
9
|
+
rawProfile?: Record<string, any>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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.OAuthProviderResponseDto = void 0;
|
|
13
|
+
// oauth-provider-response.dto.ts
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
16
|
+
const auth_type_enum_1 = require("../../enums/auth-type.enum");
|
|
17
|
+
class OAuthProviderResponseDto {
|
|
18
|
+
}
|
|
19
|
+
exports.OAuthProviderResponseDto = OAuthProviderResponseDto;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_transformer_1.Expose)(),
|
|
22
|
+
(0, swagger_1.ApiProperty)({ enum: auth_type_enum_1.OAuthProviderType }),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], OAuthProviderResponseDto.prototype, "provider", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_transformer_1.Expose)(),
|
|
27
|
+
(0, swagger_1.ApiProperty)(),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], OAuthProviderResponseDto.prototype, "providerUserId", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_transformer_1.Expose)(),
|
|
32
|
+
(0, swagger_1.ApiProperty)(),
|
|
33
|
+
__metadata("design:type", Date)
|
|
34
|
+
], OAuthProviderResponseDto.prototype, "expiresAt", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_transformer_1.Expose)(),
|
|
37
|
+
(0, swagger_1.ApiProperty)(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], OAuthProviderResponseDto.prototype, "displayName", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_transformer_1.Expose)(),
|
|
42
|
+
(0, swagger_1.ApiProperty)(),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], OAuthProviderResponseDto.prototype, "avatarUrl", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_transformer_1.Expose)(),
|
|
47
|
+
(0, swagger_1.ApiProperty)(),
|
|
48
|
+
__metadata("design:type", Boolean)
|
|
49
|
+
], OAuthProviderResponseDto.prototype, "emailVerified", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, class_transformer_1.Expose)(),
|
|
52
|
+
(0, swagger_1.ApiProperty)(),
|
|
53
|
+
__metadata("design:type", Object)
|
|
54
|
+
], OAuthProviderResponseDto.prototype, "rawProfile", void 0);
|
|
55
|
+
//# sourceMappingURL=oauth-provider-response.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-provider-response.dto.js","sourceRoot":"","sources":["../../../../src/auth/dto/responses/oauth-provider-response.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iCAAiC;AACjC,yDAA2C;AAC3C,6CAA8C;AAC9C,+DAA+D;AAE/D,MAAa,wBAAwB;CA4BpC;AA5BD,4DA4BC;AAzBC;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,kCAAiB,EAAE,CAAC;;0DACb;AAI5B;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;gEACS;AAIvB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,GAAE;8BACF,IAAI;2DAAC;AAIjB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;6DACO;AAIrB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;2DACK;AAInB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;+DACU;AAIxB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;4DACmB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AuthStrategy, OAuthProviderType } from '../enums/auth-type.enum';
|
|
2
|
+
export declare class SignupDto {
|
|
3
|
+
method: AuthStrategy;
|
|
4
|
+
provider?: OAuthProviderType;
|
|
5
|
+
phone?: string;
|
|
6
|
+
username?: string;
|
|
7
|
+
email?: string;
|
|
8
|
+
password?: string;
|
|
9
|
+
/**
|
|
10
|
+
* For OAuth / OTP verification
|
|
11
|
+
*/
|
|
12
|
+
token?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
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.SignupDto = void 0;
|
|
13
|
+
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
const auth_type_enum_1 = require("../enums/auth-type.enum");
|
|
17
|
+
class SignupDto {
|
|
18
|
+
}
|
|
19
|
+
exports.SignupDto = SignupDto;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, swagger_1.ApiProperty)({
|
|
22
|
+
enum: auth_type_enum_1.AuthStrategy,
|
|
23
|
+
example: auth_type_enum_1.AuthStrategy.LOCAL,
|
|
24
|
+
description: 'Authentication method chosen by the user',
|
|
25
|
+
type: () => auth_type_enum_1.AuthStrategy,
|
|
26
|
+
}),
|
|
27
|
+
(0, class_validator_1.IsEnum)(auth_type_enum_1.AuthStrategy),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], SignupDto.prototype, "method", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, swagger_1.ApiProperty)({
|
|
32
|
+
enum: auth_type_enum_1.OAuthProviderType,
|
|
33
|
+
example: auth_type_enum_1.OAuthProviderType.GOOGLE,
|
|
34
|
+
description: 'OAuth provider (required if method is OAUTH)',
|
|
35
|
+
required: false,
|
|
36
|
+
}),
|
|
37
|
+
(0, class_validator_1.IsEnum)(auth_type_enum_1.OAuthProviderType),
|
|
38
|
+
(0, class_validator_1.IsOptional)(),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], SignupDto.prototype, "provider", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, swagger_1.ApiProperty)({ example: '+2347035742844', required: false }),
|
|
43
|
+
(0, class_validator_1.IsPhoneNumber)('NG'),
|
|
44
|
+
(0, class_validator_1.IsOptional)(),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], SignupDto.prototype, "phone", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, swagger_1.ApiProperty)({ example: 'john_doe', required: false }),
|
|
49
|
+
(0, class_validator_1.IsOptional)(),
|
|
50
|
+
(0, class_validator_1.IsString)(),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], SignupDto.prototype, "username", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, swagger_1.ApiProperty)({ example: 'john@example.com', required: false }),
|
|
55
|
+
(0, class_validator_1.IsOptional)(),
|
|
56
|
+
(0, class_validator_1.IsEmail)(),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], SignupDto.prototype, "email", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, swagger_1.ApiProperty)({ example: 'securePassword123', required: false }),
|
|
61
|
+
(0, class_validator_1.IsOptional)(),
|
|
62
|
+
(0, class_validator_1.MinLength)(6),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], SignupDto.prototype, "password", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, class_validator_1.IsOptional)(),
|
|
67
|
+
(0, class_validator_1.IsString)(),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], SignupDto.prototype, "token", void 0);
|
|
70
|
+
//# sourceMappingURL=signup.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signup.dto.js","sourceRoot":"","sources":["../../../src/auth/dto/signup.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sDAAsD;AACtD,6CAA8C;AAC9C,qDAOyB;AACzB,4DAA0E;AAE1E,MAAa,SAAS;CA+CrB;AA/CD,8BA+CC;AAvCC;IAPC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,6BAAY;QAClB,OAAO,EAAE,6BAAY,CAAC,KAAK;QAC3B,WAAW,EAAE,0CAA0C;QACvD,IAAI,EAAE,GAAG,EAAE,CAAC,6BAAY;KACzB,CAAC;IACD,IAAA,wBAAM,EAAC,6BAAY,CAAC;;yCACA;AAUrB;IARC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,kCAAiB;QACvB,OAAO,EAAE,kCAAiB,CAAC,MAAM;QACjC,WAAW,EAAE,8CAA8C;QAC3D,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,wBAAM,EAAC,kCAAiB,CAAC;IACzB,IAAA,4BAAU,GAAE;;2CACgB;AAM7B;IAHC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC3D,IAAA,+BAAa,EAAC,IAAI,CAAC;IACnB,IAAA,4BAAU,GAAE;;wCACE;AAKf;IAHC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACrD,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;2CACO;AAKlB;IAHC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC7D,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;;wCACK;AAKf;IAHC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC9D,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,CAAC,CAAC;;2CACK;AAOlB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;wCACI"}
|
|
@@ -0,0 +1,48 @@
|
|
|
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.ResendVerificationDto = exports.VerifyDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
class VerifyDto {
|
|
16
|
+
}
|
|
17
|
+
exports.VerifyDto = VerifyDto;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, swagger_1.ApiProperty)({
|
|
20
|
+
description: 'The unique identity ID (UID) being verified',
|
|
21
|
+
example: 'uuid-string',
|
|
22
|
+
}),
|
|
23
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
24
|
+
(0, class_validator_1.IsUUID)(),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], VerifyDto.prototype, "uid", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, swagger_1.ApiProperty)({
|
|
29
|
+
description: 'The verification code sent via email or phone',
|
|
30
|
+
example: '123456',
|
|
31
|
+
}),
|
|
32
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
33
|
+
(0, class_validator_1.IsString)(),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], VerifyDto.prototype, "code", void 0);
|
|
36
|
+
class ResendVerificationDto {
|
|
37
|
+
}
|
|
38
|
+
exports.ResendVerificationDto = ResendVerificationDto;
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, swagger_1.ApiProperty)({
|
|
41
|
+
description: 'The unique identity ID (UID) to resend the code for',
|
|
42
|
+
example: 'uuid-string',
|
|
43
|
+
}),
|
|
44
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
45
|
+
(0, class_validator_1.IsUUID)(),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], ResendVerificationDto.prototype, "uid", void 0);
|
|
48
|
+
//# sourceMappingURL=verify.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.dto.js","sourceRoot":"","sources":["../../../src/auth/dto/verify.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA+D;AAC/D,6CAA8C;AAE9C,MAAa,SAAS;CAgBrB;AAhBD,8BAgBC;AATG;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,6CAA6C;QAC1D,OAAO,EAAE,aAAa;KACzB,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;sCACG;AAQZ;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,+CAA+C;QAC5D,OAAO,EAAE,QAAQ;KACpB,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;uCACE;AAGjB,MAAa,qBAAqB;CAQjC;AARD,sDAQC;AADG;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,qDAAqD;QAClE,OAAO,EAAE,aAAa;KACzB,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;kDACG"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Auth } from './auth.entity';
|
|
2
|
+
import { BaseEntity } from './base.entity';
|
|
3
|
+
export declare enum IdentifierType {
|
|
4
|
+
EMAIL = "EMAIL",
|
|
5
|
+
PHONE = "PHONE",
|
|
6
|
+
USERNAME = "USERNAME"
|
|
7
|
+
}
|
|
8
|
+
export declare enum IdentifierSource {
|
|
9
|
+
APPLE = "APPLE",
|
|
10
|
+
FACEBOOK = "FACEBOOK",
|
|
11
|
+
GOOGLE = "GOOGLE",
|
|
12
|
+
LOCAL = "LOCAL"
|
|
13
|
+
}
|
|
14
|
+
export declare class AuthIdentifier extends BaseEntity {
|
|
15
|
+
auth: Auth;
|
|
16
|
+
type: IdentifierType;
|
|
17
|
+
value: string;
|
|
18
|
+
isVerified: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Who issued this identifier
|
|
21
|
+
*/
|
|
22
|
+
source: IdentifierSource;
|
|
23
|
+
/**
|
|
24
|
+
* Optional: how it was verified
|
|
25
|
+
*/
|
|
26
|
+
verifiedBy?: 'OTP' | 'PROVIDER' | 'ADMIN';
|
|
27
|
+
toMap(): {
|
|
28
|
+
id: string;
|
|
29
|
+
type: IdentifierType;
|
|
30
|
+
value: string;
|
|
31
|
+
isVerified: boolean;
|
|
32
|
+
};
|
|
33
|
+
}
|