auth is working yipa
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -20,6 +20,10 @@ Thumbs.db
|
||||
/dist
|
||||
/node_modules
|
||||
|
||||
./srcs/requirement/api_back/node_modules
|
||||
./srcs/requirement/api_back/dist
|
||||
./srcs/requirement/api_front/node_modules
|
||||
./srcs/requirement/api_front/public/build
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
|
||||
4
Makefile
4
Makefile
@@ -36,6 +36,10 @@ down:
|
||||
docker compose -f ${DOCKERCOMPOSEPATH} -v down
|
||||
|
||||
destroy:
|
||||
# rm -rf ./srcs/requirements/nestjs/api_back/node_modules/
|
||||
# rm -rf ./srcs/requirements/nestjs/api_back/dist
|
||||
# rm -rf ./srcs/requirements/svelte/api_front/node_modules/
|
||||
# rm -rf ./srcs/requirements/svelte/api_front/public/build
|
||||
docker compose -f ${DOCKERCOMPOSEPATH} down -v --rmi all --remove-orphans 2> /dev/null
|
||||
docker ps -aq | xargs --no-run-if-empty docker rm -f 2> /dev/null
|
||||
docker images -aq | xargs --no-run-if-empty docker rmi -f 2> /dev/null
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
FROM node:19-alpine AS development
|
||||
FROM node:alpine AS development
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY --chown=node:node ./api_back/package*.json ./
|
||||
|
||||
RUN npm ci
|
||||
RUN npm i
|
||||
|
||||
COPY --chown=node:node ./api_back/ ./
|
||||
|
||||
|
||||
@@ -6,10 +6,8 @@ export declare class AuthenticationController {
|
||||
private authService;
|
||||
private userService;
|
||||
constructor(authService: AuthenticationService, userService: UsersService);
|
||||
login(response: Response): {
|
||||
msg: string;
|
||||
};
|
||||
redirect(response: Response, request: any): Promise<any>;
|
||||
login(response: Response): void;
|
||||
redirect(response: Response, request: any): Promise<void>;
|
||||
status(): string;
|
||||
logout(request: any): {
|
||||
msg: string;
|
||||
|
||||
@@ -25,11 +25,12 @@ let AuthenticationController = class AuthenticationController {
|
||||
}
|
||||
login(response) {
|
||||
console.log('ON EST DANS LOGIN AUTH CONTROLLER');
|
||||
return { msg: 'You are now logged in' };
|
||||
return;
|
||||
}
|
||||
async redirect(response, request) {
|
||||
console.log('ON EST DANS REDIRECT AUTH CONTROLLER' + request.user);
|
||||
return request.user;
|
||||
console.log('On redirige');
|
||||
return response.status(200).redirect('http://transcendance:8080');
|
||||
}
|
||||
status() {
|
||||
return 'status';
|
||||
@@ -55,7 +56,6 @@ let AuthenticationController = class AuthenticationController {
|
||||
};
|
||||
__decorate([
|
||||
(0, common_1.Get)(),
|
||||
(0, common_1.Options)(),
|
||||
(0, common_1.UseGuards)(_42guards_1.FortyTwoAuthGuard),
|
||||
__param(0, (0, common_1.Res)()),
|
||||
__metadata("design:type", Function),
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"authentication.controller.js","sourceRoot":"","sources":["../../../src/auth/42/authentication.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAkH;AAClH,iDAAyE;AACzE,qEAAiE;AAEjE,4CAAyC;AACzC,6DAAuD;AAGhD,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAEpC,YAAoB,WAAkC,EAC3C,WAAyB;QADhB,gBAAW,GAAX,WAAW,CAAuB;QAC3C,gBAAW,GAAX,WAAW,CAAc;IAC9B,CAAC;IASP,KAAK,CAAQ,QAAmB;QAC/B,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;QACjD,OAAO,EAAC,GAAG,EAAG,uBAAuB,EAAC,CAAC;IACxC,CAAC;IASK,AAAN,KAAK,CAAC,QAAQ,CAAQ,QAAmB,EAAS,OAAO;QACxD,OAAO,CAAC,GAAG,CAAC,sCAAsC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QACnE,OAAO,OAAO,CAAC,IAAI,CAAC;IACrB,CAAC;IASD,MAAM;QACL,OAAO,QAAQ,CAAC;IACjB,CAAC;IAOD,MAAM,CAAQ,OAAO;QACpB,OAA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FL,IAAA,YAAG,EAAC,UAAU,CAAC;IACf,IAAA,kBAAS,EAAC,6BAAiB,CAAC;IACb,WAAA,IAAA,YAAG,GAAE,CAAA;IAAuB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;wDAIhD;AAOD;IAAC,IAAA,YAAG,EAAC,QAAQ,CAAC;IACb,IAAA,kBAAS,EAAC,6BAAiB,CAAC;;;;sDAG5B;AAMD;IAAC,IAAA,YAAG,EAAC,QAAQ,CAAC;IACN,WAAA,IAAA,YAAG,GAAE,CAAA;;;;sDAIZ;AAIK;IAFL,IAAA,aAAI,EAAC,cAAc,CAAC;IACpB,IAAA,kBAAS,EAAC,6BAAiB,CAAC;IACb,WAAA,IAAA,YAAG,GAAE,CAAA;IAAW,WAAA,IAAA,YAAG,GAAE,CAAA;;;;wDAIpC;AAIK;IAFL,IAAA,aAAI,EAAC,aAAa,CAAC;IACnB,IAAA,kBAAS,EAAC,6BAAiB,CAAC;IACf,WAAA,IAAA,YAAG,GAAE,CAAA;IAAW,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAe,mBAAQ;;sDAQ1D;AAtEW,wBAAwB;IADpC,IAAA,mBAAU,EAAC,MAAM,CAAC;qCAGe,8CAAqB;QAC9B,4BAAY;GAHxB,wBAAwB,CAuEpC;AAvEY,4DAAwB"}
|
||||
@@ -1,3 +0,0 @@
|
||||
export declare const jwt_constants: {
|
||||
secret: string;
|
||||
};
|
||||
@@ -1,7 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.jwt_constants = void 0;
|
||||
exports.jwt_constants = {
|
||||
secret: process.env.JWT_SECRET,
|
||||
};
|
||||
//# sourceMappingURL=constant.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"constant.js","sourceRoot":"","sources":["../../../src/auth/42/constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG;IAC1B,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;CAChC,CAAC"}
|
||||
@@ -1,3 +0,0 @@
|
||||
export declare class TwoFaDto {
|
||||
readonly twoFaCode: string;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TwoFaDto = void 0;
|
||||
const class_validator_1 = require("class-validator");
|
||||
class TwoFaDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, class_validator_1.IsString)(),
|
||||
__metadata("design:type", String)
|
||||
], TwoFaDto.prototype, "twoFaCode", void 0);
|
||||
exports.TwoFaDto = TwoFaDto;
|
||||
//# sourceMappingURL=2faDto.dto.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"2faDto.dto.js","sourceRoot":"","sources":["../../../../src/auth/42/dto/2faDto.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA2C;AAE3C,MAAa,QAAQ;CAGpB;AAFA;IAAC,IAAA,0BAAQ,GAAE;;2CACgB;AAF5B,4BAGC"}
|
||||
@@ -1,6 +0,0 @@
|
||||
import { ExecutionContext } from "@nestjs/common";
|
||||
declare const FortyTwoAuthGuard_base: import("@nestjs/passport").Type<import("@nestjs/passport").IAuthGuard>;
|
||||
export declare class FortyTwoAuthGuard extends FortyTwoAuthGuard_base {
|
||||
canActivate(context: ExecutionContext): Promise<any>;
|
||||
}
|
||||
export {};
|
||||
@@ -1,24 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FortyTwoAuthGuard = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const passport_1 = require("@nestjs/passport");
|
||||
let FortyTwoAuthGuard = class FortyTwoAuthGuard extends (0, passport_1.AuthGuard)('42') {
|
||||
async canActivate(context) {
|
||||
const activate = (await super.canActivate(context));
|
||||
const request = context.switchToHttp().getRequest();
|
||||
await super.logIn(request);
|
||||
return activate;
|
||||
}
|
||||
};
|
||||
FortyTwoAuthGuard = __decorate([
|
||||
(0, common_1.Injectable)()
|
||||
], FortyTwoAuthGuard);
|
||||
exports.FortyTwoAuthGuard = FortyTwoAuthGuard;
|
||||
//# sourceMappingURL=42guards%20copy.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"42guards copy.js","sourceRoot":"","sources":["../../../../src/auth/42/guards/42guards copy.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA2E;AAC3E,+CAA6C;AAGtC,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,IAAA,oBAAS,EAAC,IAAI,CAAC;IACrD,KAAK,CAAC,WAAW,CAAC,OAAyB;QAC1C,MAAM,QAAQ,GAAG,CAAC,MAAM,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAY,CAAC;QAC/D,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;QACpD,MAAM,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3B,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD,CAAA;AAPY,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;GACA,iBAAiB,CAO7B;AAPY,8CAAiB"}
|
||||
@@ -1,6 +0,0 @@
|
||||
import { ExecutionContext } from "@nestjs/common";
|
||||
declare const FortyTwoAuthGuard_base: import("@nestjs/passport").Type<import("@nestjs/passport").IAuthGuard>;
|
||||
export declare class FortyTwoAuthGuard extends FortyTwoAuthGuard_base {
|
||||
canActivate(context: ExecutionContext): Promise<any>;
|
||||
}
|
||||
export {};
|
||||
@@ -1,24 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FortyTwoAuthGuard = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const passport_1 = require("@nestjs/passport");
|
||||
let FortyTwoAuthGuard = class FortyTwoAuthGuard extends (0, passport_1.AuthGuard)('42') {
|
||||
async canActivate(context) {
|
||||
const activate = (await super.canActivate(context));
|
||||
const request = context.switchToHttp().getRequest();
|
||||
await super.logIn(request);
|
||||
return activate;
|
||||
}
|
||||
};
|
||||
FortyTwoAuthGuard = __decorate([
|
||||
(0, common_1.Injectable)()
|
||||
], FortyTwoAuthGuard);
|
||||
exports.FortyTwoAuthGuard = FortyTwoAuthGuard;
|
||||
//# sourceMappingURL=guards.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"guards.js","sourceRoot":"","sources":["../../../../src/auth/42/guards/guards.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA2E;AAC3E,+CAA6C;AAGtC,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,IAAA,oBAAS,EAAC,IAAI,CAAC;IACrD,KAAK,CAAC,WAAW,CAAC,OAAyB;QAC1C,MAAM,QAAQ,GAAG,CAAC,MAAM,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAY,CAAC;QAC/D,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;QACpD,MAAM,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3B,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD,CAAA;AAPY,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;GACA,iBAAiB,CAO7B;AAPY,8CAAiB"}
|
||||
@@ -1,4 +0,0 @@
|
||||
declare const JwtAuthGuard_base: import("@nestjs/passport").Type<import("@nestjs/passport").IAuthGuard>;
|
||||
export declare class JwtAuthGuard extends JwtAuthGuard_base {
|
||||
}
|
||||
export {};
|
||||
@@ -1,18 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.JwtAuthGuard = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const passport_1 = require("@nestjs/passport");
|
||||
let JwtAuthGuard = class JwtAuthGuard extends (0, passport_1.AuthGuard)('jwt') {
|
||||
};
|
||||
JwtAuthGuard = __decorate([
|
||||
(0, common_1.Injectable)()
|
||||
], JwtAuthGuard);
|
||||
exports.JwtAuthGuard = JwtAuthGuard;
|
||||
//# sourceMappingURL=jwtGuards.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"jwtGuards.js","sourceRoot":"","sources":["../../../../src/auth/42/guards/jwtGuards.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA2E;AAC3E,+CAA6C;AAGtC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,IAAA,oBAAS,EAAC,KAAK,CAAC;CAAG,CAAA;AAAxC,YAAY;IADxB,IAAA,mBAAU,GAAE;GACA,YAAY,CAA4B;AAAxC,oCAAY"}
|
||||
@@ -1,13 +0,0 @@
|
||||
import { Strategy as PassportJwtStrategy } from "passport-jwt";
|
||||
import { AuthenticationService } from "../authentication.service";
|
||||
declare const JwtStrategy_base: new (...args: any[]) => PassportJwtStrategy;
|
||||
export declare class JwtStrategy extends JwtStrategy_base {
|
||||
private readonly authenticationService;
|
||||
constructor(authenticationService: AuthenticationService);
|
||||
validate(payload: any): Promise<{
|
||||
fourtyTwoId: any;
|
||||
username: any;
|
||||
image_url: any;
|
||||
}>;
|
||||
}
|
||||
export {};
|
||||
@@ -1,39 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.JwtStrategy = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const passport_1 = require("@nestjs/passport");
|
||||
const passport_jwt_1 = require("passport-jwt");
|
||||
const authentication_service_1 = require("../authentication.service");
|
||||
let JwtStrategy = class JwtStrategy extends (0, passport_1.PassportStrategy)(passport_jwt_1.Strategy, "jwt") {
|
||||
constructor(authenticationService) {
|
||||
super({
|
||||
jwtFromRequest: passport_jwt_1.ExtractJwt.fromAuthHeaderAsBearerToken(),
|
||||
ignoreExpiration: false,
|
||||
secretOrKey: process.env.JWT_SECRET,
|
||||
});
|
||||
this.authenticationService = authenticationService;
|
||||
}
|
||||
async validate(payload) {
|
||||
console.log("Validate inside jwtStrategy.ts");
|
||||
const user = await this.authenticationService.findUser(payload.fourtyTwoId);
|
||||
if (!user)
|
||||
throw new common_1.UnauthorizedException('You must be logged in to continue.');
|
||||
return { fourtyTwoId: payload.fourtyTwoId, username: payload.username, image_url: payload.image_url };
|
||||
}
|
||||
};
|
||||
JwtStrategy = __decorate([
|
||||
(0, common_1.Injectable)(),
|
||||
__metadata("design:paramtypes", [authentication_service_1.AuthenticationService])
|
||||
], JwtStrategy);
|
||||
exports.JwtStrategy = JwtStrategy;
|
||||
//# sourceMappingURL=jwtStrategy.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"jwtStrategy.js","sourceRoot":"","sources":["../../../../src/auth/42/strategy/jwtStrategy.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAmE;AACnE,+CAAoD;AACpD,+CAA2E;AAC3E,sEAAkE;AAI3D,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,IAAA,2BAAgB,EAAC,uBAAmB,EAAE,KAAK,CAAC;IAC5E,YAA6B,qBAA4C;QAExE,KAAK,CAAC;YACL,cAAc,EAAE,yBAAU,CAAC,2BAA2B,EAAE;YACxD,gBAAgB,EAAE,KAAK;YACvB,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;SACnC,CAAC,CAAC;QANyB,0BAAqB,GAArB,qBAAqB,CAAuB;IAOzE,CAAC;IACD,KAAK,CAAC,QAAQ,CAAC,OAAY;QAC1B,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;QAC9C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAC5E,IAAI,CAAC,IAAI;YACR,MAAM,IAAI,8BAAqB,CAAC,oCAAoC,CAAC,CAAC;QACvE,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;IACvG,CAAC;CACD,CAAA;AAhBY,WAAW;IADvB,IAAA,mBAAU,GAAE;qCAEwC,8CAAqB;GAD7D,WAAW,CAgBvB;AAhBY,kCAAW"}
|
||||
@@ -1,9 +0,0 @@
|
||||
import { Profile } from "passport-42/lib";
|
||||
import { AuthenticationService } from "../authentication.service";
|
||||
declare const FortyTwoStrategy_base: new (...args: any[]) => any;
|
||||
export declare class FortyTwoStrategy extends FortyTwoStrategy_base {
|
||||
private authenticationService;
|
||||
constructor(authenticationService: AuthenticationService);
|
||||
validate(accessToken: string, refreshToken: string, profile: Profile, callbackURL: string): Promise<import("../../../users/entities/user.entity").User>;
|
||||
}
|
||||
export {};
|
||||
@@ -1,42 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FortyTwoStrategy = void 0;
|
||||
const lib_1 = require("passport-42/lib");
|
||||
const passport_1 = require("@nestjs/passport");
|
||||
const common_1 = require("@nestjs/common");
|
||||
const authentication_service_1 = require("../authentication.service");
|
||||
let FortyTwoStrategy = class FortyTwoStrategy extends (0, passport_1.PassportStrategy)(lib_1.Strategy, "42") {
|
||||
constructor(authenticationService) {
|
||||
super({
|
||||
clientID: process.env.FORTYTWO_CLIENT_ID,
|
||||
clientSecret: process.env.FORTYTWO_CLIENT_SECRET,
|
||||
callbackURL: process.env.FORTYTWO_CALLBACK_URL,
|
||||
scope: ["public"],
|
||||
});
|
||||
this.authenticationService = authenticationService;
|
||||
}
|
||||
async validate(accessToken, refreshToken, profile, callbackURL) {
|
||||
console.log("Validate inside strategy.ts");
|
||||
console.log(profile.id, profile.username, profile.phoneNumbers[0].value, profile.emails[0].value, profile.photos[0].value);
|
||||
const userDTO = { fourtyTwoId: profile.id, username: profile.username, email: profile.emails[0].value, image_url: profile.photos[0].value };
|
||||
const user = await this.authenticationService.validateUser(userDTO);
|
||||
if (!user)
|
||||
throw new common_1.UnauthorizedException();
|
||||
return user;
|
||||
}
|
||||
};
|
||||
FortyTwoStrategy = __decorate([
|
||||
(0, common_1.Injectable)(),
|
||||
__metadata("design:paramtypes", [authentication_service_1.AuthenticationService])
|
||||
], FortyTwoStrategy);
|
||||
exports.FortyTwoStrategy = FortyTwoStrategy;
|
||||
//# sourceMappingURL=strategy.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"strategy.js","sourceRoot":"","sources":["../../../../src/auth/42/strategy/strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAoD;AACpD,+CAAoD;AACpD,2CAAmE;AACnE,sEAAkE;AAI3D,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,IAAA,2BAAgB,EAAC,cAAQ,EAAE,IAAI,CAAC;IACrE,YAAoB,qBAA4C;QAChE,KAAK,CAAC;YACJ,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB;YACxC,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB;YAChD,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB;YAC9C,KAAK,EAAE,CAAC,QAAQ,CAAC;SAClB,CAAC,CAAC;QANiB,0BAAqB,GAArB,qBAAqB,CAAuB;IAO/D,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,WAAmB,EAAE,YAAoB,EAAE,OAAgB,EAAE,WAAmB;QAChG,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAC3H,MAAM,OAAO,GAAoB,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QAC7J,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACpE,IAAI,CAAC,IAAI;YACR,MAAM,IAAI,8BAAqB,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC;IACX,CAAC;CACF,CAAA;AAnBY,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;qCAE+B,8CAAqB;GADpD,gBAAgB,CAmB5B;AAnBY,4CAAgB"}
|
||||
@@ -1,2 +0,0 @@
|
||||
export declare class AuthenticationController {
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AuthenticationController = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
let AuthenticationController = class AuthenticationController {
|
||||
};
|
||||
AuthenticationController = __decorate([
|
||||
(0, common_1.Controller)('/')
|
||||
], AuthenticationController);
|
||||
exports.AuthenticationController = AuthenticationController;
|
||||
//# sourceMappingURL=authentication.controller.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"authentication.controller.js","sourceRoot":"","sources":["../../src/auth/authentication.controller.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAGrC,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;CAGpC,CAAA;AAHY,wBAAwB;IADpC,IAAA,mBAAU,EAAC,GAAG,CAAC;GACH,wBAAwB,CAGpC;AAHY,4DAAwB"}
|
||||
@@ -1,2 +0,0 @@
|
||||
export declare class AuthenticationModule {
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AuthenticationModule = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const users_module_1 = require("../users/users.module");
|
||||
const authentication_service_1 = require("./authentication.service");
|
||||
let AuthenticationModule = class AuthenticationModule {
|
||||
};
|
||||
AuthenticationModule = __decorate([
|
||||
(0, common_1.Module)({
|
||||
imports: [users_module_1.UsersModule],
|
||||
providers: [authentication_service_1.AuthenticationService],
|
||||
})
|
||||
], AuthenticationModule);
|
||||
exports.AuthenticationModule = AuthenticationModule;
|
||||
//# sourceMappingURL=authentication.module.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"authentication.module.js","sourceRoot":"","sources":["../../src/auth/authentication.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,wDAAqD;AACrD,qEAAiE;AAM1D,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAAG,CAAA;AAAvB,oBAAoB;IAJhC,IAAA,eAAM,EAAC;QACL,OAAO,EAAE,CAAC,0BAAW,CAAC;QACtB,SAAS,EAAE,CAAC,8CAAqB,CAAC;KACpC,CAAC;GACW,oBAAoB,CAAG;AAAvB,oDAAoB"}
|
||||
@@ -1,2 +0,0 @@
|
||||
export declare class AuthenticationService {
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AuthenticationService = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
let AuthenticationService = class AuthenticationService {
|
||||
};
|
||||
AuthenticationService = __decorate([
|
||||
(0, common_1.Injectable)()
|
||||
], AuthenticationService);
|
||||
exports.AuthenticationService = AuthenticationService;
|
||||
//# sourceMappingURL=authentication.service.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"authentication.service.js","sourceRoot":"","sources":["../../src/auth/authentication.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAGrC,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAAG,CAAA;AAAxB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;GACA,qBAAqB,CAAG;AAAxB,sDAAqB"}
|
||||
@@ -1,2 +0,0 @@
|
||||
export declare class AuthenticationController {
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AuthenticationController = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
let AuthenticationController = class AuthenticationController {
|
||||
};
|
||||
AuthenticationController = __decorate([
|
||||
(0, common_1.Controller)('authentication')
|
||||
], AuthenticationController);
|
||||
exports.AuthenticationController = AuthenticationController;
|
||||
//# sourceMappingURL=authentication.controller.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"authentication.controller.js","sourceRoot":"","sources":["../../../src/auth/authentication/authentication.controller.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAGrC,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;CAAG,CAAA;AAA3B,wBAAwB;IADpC,IAAA,mBAAU,EAAC,gBAAgB,CAAC;GAChB,wBAAwB,CAAG;AAA3B,4DAAwB"}
|
||||
@@ -1,2 +0,0 @@
|
||||
export declare class AuthenticationModule {
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AuthenticationModule = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
let AuthenticationModule = class AuthenticationModule {
|
||||
};
|
||||
AuthenticationModule = __decorate([
|
||||
(0, common_1.Module)({})
|
||||
], AuthenticationModule);
|
||||
exports.AuthenticationModule = AuthenticationModule;
|
||||
//# sourceMappingURL=authentication.module.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"authentication.module.js","sourceRoot":"","sources":["../../../src/auth/authentication/authentication.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AAGjC,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAAG,CAAA;AAAvB,oBAAoB;IADhC,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,oBAAoB,CAAG;AAAvB,oDAAoB"}
|
||||
@@ -1,2 +0,0 @@
|
||||
export declare class AuthenticationService {
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AuthenticationService = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
let AuthenticationService = class AuthenticationService {
|
||||
};
|
||||
AuthenticationService = __decorate([
|
||||
(0, common_1.Injectable)()
|
||||
], AuthenticationService);
|
||||
exports.AuthenticationService = AuthenticationService;
|
||||
//# sourceMappingURL=authentication.service.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"authentication.service.js","sourceRoot":"","sources":["../../src/authentication/authentication.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAGrC,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAAG,CAAA;AAAxB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;GACA,qBAAqB,CAAG;AAAxB,sDAAqB"}
|
||||
@@ -1,6 +0,0 @@
|
||||
export declare const constants: {
|
||||
secret: string;
|
||||
};
|
||||
export declare const jwt_constants: {
|
||||
secret: string;
|
||||
};
|
||||
@@ -1,10 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.jwt_constants = exports.constants = void 0;
|
||||
exports.constants = {
|
||||
secret: process.env.COOKIE_SECRET,
|
||||
};
|
||||
exports.jwt_constants = {
|
||||
secret: process.env.JWT_SECRET,
|
||||
};
|
||||
//# sourceMappingURL=constant.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"constant.js","sourceRoot":"","sources":["../../src/conf/constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG;IACtB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa;CACnC,CAAC;AAEW,QAAA,aAAa,GAAG;IAC1B,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;CAChC,CAAC"}
|
||||
@@ -1,3 +0,0 @@
|
||||
export declare const constants: {
|
||||
secret: string;
|
||||
};
|
||||
@@ -1,7 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.constants = void 0;
|
||||
exports.constants = {
|
||||
secret: process.env.COOKIE_SECRET,
|
||||
};
|
||||
//# sourceMappingURL=constant.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"constant.js","sourceRoot":"","sources":["../src/constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG;IACtB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa;CACnC,CAAC"}
|
||||
@@ -1,2 +0,0 @@
|
||||
export declare class Module {
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var Module_1;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Module = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
Object.defineProperty(exports, "Module", { enumerable: true, get: function () { return common_1.Module; } });
|
||||
let Module = Module_1 = class Module {
|
||||
};
|
||||
Module = Module_1 = __decorate([
|
||||
(0, common_1.Module)({})
|
||||
], Module);
|
||||
exports.Module = Module;
|
||||
//# sourceMappingURL=.module.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":".module.js","sourceRoot":"","sources":["../../src/friendship/.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAwC;AAG3B,uFAHJ,eAAM,OAGI;AAAZ,IAAM,MAAM,cAAZ,MAAM,MAAM;CAAG,CAAA;AAAT,MAAM;IADlB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,MAAM,CAAG;AAAT,wBAAM"}
|
||||
@@ -1,6 +0,0 @@
|
||||
import { FriendshipStatus } from '../entities/friendship.entity';
|
||||
export declare class CreateFriendshipDto {
|
||||
readonly requesterId: string;
|
||||
readonly addresseeId: string;
|
||||
readonly status: FriendshipStatus;
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CreateFriendshipDto = void 0;
|
||||
const class_validator_1 = require("class-validator");
|
||||
const friendship_entity_1 = require("../entities/friendship.entity");
|
||||
class CreateFriendshipDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, class_validator_1.IsInt)(),
|
||||
__metadata("design:type", String)
|
||||
], CreateFriendshipDto.prototype, "requesterId", void 0);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsInt)(),
|
||||
__metadata("design:type", String)
|
||||
], CreateFriendshipDto.prototype, "addresseeId", void 0);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsEnum)(friendship_entity_1.FriendshipStatus),
|
||||
__metadata("design:type", String)
|
||||
], CreateFriendshipDto.prototype, "status", void 0);
|
||||
exports.CreateFriendshipDto = CreateFriendshipDto;
|
||||
//# sourceMappingURL=create-friendship.dto%20copy.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"create-friendship.dto copy.js","sourceRoot":"","sources":["../../../src/friendship/dto/create-friendship.dto copy.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmE;AACnE,qEAAiE;AAEjE,MAAa,mBAAmB;CAO/B;AANA;IAAC,IAAA,uBAAK,GAAE;;wDACqB;AAC7B;IAAC,IAAA,uBAAK,GAAE;;wDACqB;AAC7B;IAAC,IAAA,wBAAM,EAAC,oCAAgB,CAAC;;mDACS;AANnC,kDAOC"}
|
||||
@@ -1,6 +0,0 @@
|
||||
export declare class CreateUsersDto {
|
||||
readonly name: string;
|
||||
readonly username: string;
|
||||
readonly password: string;
|
||||
readonly email: string;
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CreateUsersDto = void 0;
|
||||
const class_validator_1 = require("class-validator");
|
||||
class CreateUsersDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, class_validator_1.IsString)(),
|
||||
__metadata("design:type", String)
|
||||
], CreateUsersDto.prototype, "name", void 0);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsString)(),
|
||||
__metadata("design:type", String)
|
||||
], CreateUsersDto.prototype, "username", void 0);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsString)(),
|
||||
__metadata("design:type", String)
|
||||
], CreateUsersDto.prototype, "password", void 0);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsEmail)(),
|
||||
__metadata("design:type", String)
|
||||
], CreateUsersDto.prototype, "email", void 0);
|
||||
exports.CreateUsersDto = CreateUsersDto;
|
||||
//# sourceMappingURL=create-users.dto.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"create-users.dto.js","sourceRoot":"","sources":["../../../src/friendship/dto/create-users.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAoD;AAEpD,MAAa,cAAc;CAS1B;AARA;IAAC,IAAA,0BAAQ,GAAE;;4CACW;AACtB;IAAC,IAAA,0BAAQ,GAAE;;gDACe;AAC1B;IAAC,IAAA,0BAAQ,GAAE;;gDACe;AAC1B;IAAC,IAAA,yBAAO,GAAE;;6CACa;AARxB,wCASC"}
|
||||
@@ -6,7 +6,7 @@ export declare class FriendshipController {
|
||||
constructor(friendshipService: FriendshipService);
|
||||
findEmpty(req: any): Promise<import("./entities/friendship.entity").Friendship[]>;
|
||||
findOneFriend(relationshipId: string, req: any): Promise<import("./entities/friendship.entity").Friendship[]>;
|
||||
create(createFriendshipDto: CreateFriendshipDto, req: any): Promise<import("./entities/friendship.entity").Friendship> | HttpException;
|
||||
create(createFriendshipDto: CreateFriendshipDto, req: any): HttpException | Promise<import("./entities/friendship.entity").Friendship>;
|
||||
update(relationshipId: string, status: string, req: any): Promise<import("./entities/friendship.entity").Friendship>;
|
||||
remove(relationshipId: string): Promise<import("./entities/friendship.entity").Friendship>;
|
||||
findAllBlocked(req: any): Promise<import("./entities/friendship.entity").Friendship[]>;
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
export declare class FriendshipsModule {
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FriendshipsModule = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const typeorm_1 = require("@nestjs/typeorm");
|
||||
const friendship_service_1 = require("./friendship.service");
|
||||
let FriendshipsModule = class FriendshipsModule {
|
||||
};
|
||||
FriendshipsModule = __decorate([
|
||||
(0, common_1.Module)({
|
||||
imports: [typeorm_1.TypeOrmModule.forFeature([Friendship, User])],
|
||||
providers: [friendship_service_1.FriendshipService]
|
||||
})
|
||||
], FriendshipsModule);
|
||||
exports.FriendshipsModule = FriendshipsModule;
|
||||
//# sourceMappingURL=friendship.module.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"friendship.module.js","sourceRoot":"","sources":["../../src/friendship/friendship.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,6DAAyD;AAOlD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAAG,CAAA;AAApB,iBAAiB;IAL7B,IAAA,eAAM,EAAC;QACP,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;QAEtD,SAAS,EAAE,CAAC,sCAAiB,CAAC;KAC/B,CAAC;GACW,iBAAiB,CAAG;AAApB,8CAAiB"}
|
||||
@@ -1,2 +0,0 @@
|
||||
export declare class FriendshipController {
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FriendshipController = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
let FriendshipController = class FriendshipController {
|
||||
};
|
||||
FriendshipController = __decorate([
|
||||
(0, common_1.Controller)('friendship')
|
||||
], FriendshipController);
|
||||
exports.FriendshipController = FriendshipController;
|
||||
//# sourceMappingURL=friendship.controller.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"friendship.controller.js","sourceRoot":"","sources":["../../../src/friendship/friendship/friendship.controller.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAGrC,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAAG,CAAA;AAAvB,oBAAoB;IADhC,IAAA,mBAAU,EAAC,YAAY,CAAC;GACZ,oBAAoB,CAAG;AAAvB,oDAAoB"}
|
||||
@@ -1,2 +0,0 @@
|
||||
export declare class FriendshipService {
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FriendshipService = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
let FriendshipService = class FriendshipService {
|
||||
};
|
||||
FriendshipService = __decorate([
|
||||
(0, common_1.Injectable)()
|
||||
], FriendshipService);
|
||||
exports.FriendshipService = FriendshipService;
|
||||
//# sourceMappingURL=friendship.service.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"friendship.service.js","sourceRoot":"","sources":["../../../src/friendship/friendship/friendship.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAGrC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAAG,CAAA;AAApB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;GACA,iBAAiB,CAAG;AAApB,8CAAiB"}
|
||||
@@ -1,2 +0,0 @@
|
||||
export declare class FriendshipstatusesController {
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FriendshipstatusesController = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
let FriendshipstatusesController = class FriendshipstatusesController {
|
||||
};
|
||||
FriendshipstatusesController = __decorate([
|
||||
(0, common_1.Controller)('friendshipstatuses')
|
||||
], FriendshipstatusesController);
|
||||
exports.FriendshipstatusesController = FriendshipstatusesController;
|
||||
//# sourceMappingURL=friendshipstatuses.controller.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"friendshipstatuses.controller.js","sourceRoot":"","sources":["../../../src/friendship/friendshipstatuses/friendshipstatuses.controller.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAGrC,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;CAAG,CAAA;AAA/B,4BAA4B;IADxC,IAAA,mBAAU,EAAC,oBAAoB,CAAC;GACpB,4BAA4B,CAAG;AAA/B,oEAA4B"}
|
||||
@@ -1,2 +0,0 @@
|
||||
export declare class FriendshipstatusesModule {
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FriendshipstatusesModule = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const friendshipstatuses_controller_1 = require("./friendshipstatuses.controller");
|
||||
let FriendshipstatusesModule = class FriendshipstatusesModule {
|
||||
};
|
||||
FriendshipstatusesModule = __decorate([
|
||||
(0, common_1.Module)({
|
||||
controllers: [friendshipstatuses_controller_1.FriendshipstatusesController]
|
||||
})
|
||||
], FriendshipstatusesModule);
|
||||
exports.FriendshipstatusesModule = FriendshipstatusesModule;
|
||||
//# sourceMappingURL=friendshipstatuses.module.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"friendshipstatuses.module.js","sourceRoot":"","sources":["../../../src/friendship/friendshipstatuses/friendshipstatuses.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,mFAA+E;AAKxE,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;CAAG,CAAA;AAA3B,wBAAwB;IAHpC,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,4DAA4B,CAAC;KAC5C,CAAC;GACW,wBAAwB,CAAG;AAA3B,4DAAwB"}
|
||||
@@ -8,7 +8,7 @@ const passport = require("passport");
|
||||
const redis = require("redis");
|
||||
const connectRedis = require("connect-redis");
|
||||
async function bootstrap() {
|
||||
const app = await core_1.NestFactory.create(app_module_1.AppModule);
|
||||
const app = await core_1.NestFactory.create(app_module_1.AppModule, { cors: true });
|
||||
const port = process.env.PORT || 3001;
|
||||
const client = redis.createClient({
|
||||
socket: { host: process.env.REDIS_HOST, port: parseInt(process.env.REDIS_PORT) },
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;AAAA,uCAA2C;AAC3C,2CAAgD;AAChD,6CAAyC;AACzC,2CAA2C;AAC3C,qCAAqC;AACrC,+BAA+B;AAC/B,8CAA8C;AAE9C,KAAK,UAAU,SAAS;IACvB,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,sBAAS,CAAC,CAAC;IAOhD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC;IACtC,MAAM,MAAM,GAAG,KAAK,CAAC,YAAY,CAChC;QACC,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;QAChF,UAAU,EAAE,IAAI;KAChB,CACD,CAAC;IACF,MAAM,CAAC,OAAO,EAAE,CAAC;IACjB,MAAM,UAAU,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;QACzB,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAIH,GAAG,CAAC,cAAc,CACjB,IAAI,uBAAc,CAAC;QAElB,SAAS,EAAE,IAAI;QAEf,oBAAoB,EAAE,IAAI;QAE1B,SAAS,EAAE,IAAI;QACf,gBAAgB,EAAE;YACjB,wBAAwB,EAAE,IAAI;SAC9B;KACD,CAAC,CACF,CAAC;IACF,GAAG,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC9B,GAAG,CAAC,GAAG,CACN,OAAO,CAAC;QACP,MAAM,EAAE;YACP,MAAM,EAAE,O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C,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;QACzB,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAIH,GAAG,CAAC,cAAc,CACjB,IAAI,uBAAc,CAAC;QAElB,SAAS,EAAE,IAAI;QAEf,oBAAoB,EAAE,IAAI;QAE1B,SAAS,EAAE,IAAI;QACf,gBAAgB,EAAE;YACjB,wBAAwB,EAAE,IAAI;SAC9B;KACD,CAAC,CACF,CAAC;IACF,GAAG,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC9B,GAAG,CAAC,GAAG,CACN,OAAO,CAAC;QACP,MAAM,EAAE;YACP,MAAM,EAAE,OAAO,GAAG,EAAE;SACpB;QACD,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa;QACjC,MAAM,EAAE,KAAK;QACb,iBAAiB,EAAE,KAAK;QACxB,KAAK,EAAE,IAAI,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;KACjC,CAAC,CACF,CAAC;IACF,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IAC/B,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IAC5B,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7E,CAAC;AACD,SAAS,EAAE,CAAC"}
|
||||
@@ -1,2 +0,0 @@
|
||||
export declare class RedisModule {
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.RedisModule = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const Redis = require("redis");
|
||||
let RedisModule = class RedisModule {
|
||||
};
|
||||
RedisModule = __decorate([
|
||||
(0, common_1.Module)({
|
||||
providers: [
|
||||
{
|
||||
provide: 'REDIS',
|
||||
useValue: Redis.createClient({ port: 6379, host: process.env.REDIS_HOST }),
|
||||
},
|
||||
],
|
||||
exports: ['REDIS'],
|
||||
})
|
||||
], RedisModule);
|
||||
exports.RedisModule = RedisModule;
|
||||
//# sourceMappingURL=redis.module.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"redis.module.js","sourceRoot":"","sources":["../../src/redis/redis.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+BAA+B;AAWxB,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,WAAW;IATvB,IAAA,eAAM,EAAC;QACP,SAAS,EAAE;YACV;gBACC,OAAO,EAAE,OAAO;gBAChB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC;aAC1E;SACD;QACD,OAAO,EAAE,CAAC,OAAO,CAAC;KAClB,CAAC;GACW,WAAW,CAAG;AAAd,kCAAW"}
|
||||
@@ -1,2 +0,0 @@
|
||||
import { Routes } from "@nestjs/core";
|
||||
export declare const routesForUsers: Routes;
|
||||
@@ -1,18 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.routesForUsers = void 0;
|
||||
const friendships_module_1 = require("../friendship/friendships.module");
|
||||
const users_module_1 = require("../users/users.module");
|
||||
exports.routesForUsers = [
|
||||
{
|
||||
path: '/users',
|
||||
module: users_module_1.UsersModule,
|
||||
children: [
|
||||
{
|
||||
path: '/:userId/mycontacts',
|
||||
module: friendships_module_1.FriendshipsModule,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
//# sourceMappingURL=routes.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../src/routes/routes.ts"],"names":[],"mappings":";;;AACA,yEAAsE;AACtE,wDAAqD;AAExC,QAAA,cAAc,GAAW;IACrC;QACC,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,0BAAW;QACnB,QAAQ,EAAE;YACT;gBACC,IAAI,EAAE,qBAAqB;gBAC3B,MAAM,EAAE,sCAAiB;aACzB;SACD;KACD;CACD,CAAC"}
|
||||
@@ -1,2 +0,0 @@
|
||||
export declare class AuthenticationController {
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AuthenticationController = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
let AuthenticationController = class AuthenticationController {
|
||||
};
|
||||
AuthenticationController = __decorate([
|
||||
(0, common_1.Controller)('authentication')
|
||||
], AuthenticationController);
|
||||
exports.AuthenticationController = AuthenticationController;
|
||||
//# sourceMappingURL=authentication.controller.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"authentication.controller.js","sourceRoot":"","sources":["../../../../src/src/auth/authentication/authentication.controller.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAGrC,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;CAAG,CAAA;AAA3B,wBAAwB;IADpC,IAAA,mBAAU,EAAC,gBAAgB,CAAC;GAChB,wBAAwB,CAAG;AAA3B,4DAAwB"}
|
||||
@@ -1,2 +0,0 @@
|
||||
export declare class UpdateUsersDto {
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.UpdateUsersDto = void 0;
|
||||
class UpdateUsersDto {
|
||||
}
|
||||
exports.UpdateUsersDto = UpdateUsersDto;
|
||||
//# sourceMappingURL=update-users.dto.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"update-users.dto.js","sourceRoot":"","sources":["../../../../src/src/users/dto/update-users.dto.ts"],"names":[],"mappings":";;;AAAA,MAAa,cAAc;CAAG;AAA9B,wCAA8B"}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +0,0 @@
|
||||
export declare class CreatUsersDto {
|
||||
userId: string;
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CreatUsersDto = void 0;
|
||||
class CreatUsersDto {
|
||||
}
|
||||
exports.CreatUsersDto = CreatUsersDto;
|
||||
//# sourceMappingURL=creat-users.dto.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"creat-users.dto.js","sourceRoot":"","sources":["../../../src/users/dto/creat-users.dto.ts"],"names":[],"mappings":";;;AAAA,MAAa,aAAa;CAIzB;AAJD,sCAIC"}
|
||||
@@ -1 +0,0 @@
|
||||
//# sourceMappingURL=create-friendship.dto.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"create-friendship.dto.js","sourceRoot":"","sources":["../../../src/users/dto/create-friendship.dto.ts"],"names":[],"mappings":""}
|
||||
@@ -1,6 +0,0 @@
|
||||
export declare class FriendshipStatus {
|
||||
requesterId: number;
|
||||
addresseeId: number;
|
||||
dateOfInvitation: Date;
|
||||
specifierId: number;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
export declare class FriendshipStatus {
|
||||
requesterId: number;
|
||||
addresseeId: number;
|
||||
dateOfInvitation: Date;
|
||||
specifierId: number;
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
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;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FriendshipStatus = void 0;
|
||||
const typeorm_1 = require("typeorm");
|
||||
const friendship_entity_1 = require("./friendship.entity");
|
||||
const user_entity_1 = require("./user.entity");
|
||||
(0, typeorm_1.Entity)('friendshipStatus');
|
||||
class FriendshipStatus {
|
||||
}
|
||||
__decorate([
|
||||
(0, typeorm_1.PrimaryColumn)(),
|
||||
(0, typeorm_1.ManyToOne)(() => friendship_entity_1.Friendship, (friendship) => friendship.requesterId),
|
||||
__metadata("design:type", Number)
|
||||
], FriendshipStatus.prototype, "requesterId", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.PrimaryColumn)(),
|
||||
(0, typeorm_1.ManyToOne)(() => friendship_entity_1.Friendship, (friendship) => friendship.addresseeId),
|
||||
__metadata("design:type", Number)
|
||||
], FriendshipStatus.prototype, "addresseeId", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.PrimaryColumn)(),
|
||||
(0, typeorm_1.CreateDateColumn)(),
|
||||
__metadata("design:type", Date)
|
||||
], FriendshipStatus.prototype, "dateOfInvitation", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)(),
|
||||
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, (user) => user.requesterId),
|
||||
__metadata("design:type", Number)
|
||||
], FriendshipStatus.prototype, "specifierId", void 0);
|
||||
exports.FriendshipStatus = FriendshipStatus;
|
||||
//# sourceMappingURL=friendship-status.entity.js.map
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user