Compare commits
3 Commits
467970f0ce
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c643dd73d2 | ||
|
|
f619640575 | ||
|
|
11706fa6d8 |
11
.claude/settings.local.json
Normal file
11
.claude/settings.local.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"allow": [
|
||||||
|
"Bash(mv:*)",
|
||||||
|
"Bash(npx prisma generate)",
|
||||||
|
"Bash(pnpm install:*)"
|
||||||
|
],
|
||||||
|
"deny": [],
|
||||||
|
"ask": []
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,14 +2,14 @@ FROM node:24-alpine AS builder
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package.json prisma.config.cjs ./
|
COPY package.json ./
|
||||||
|
|
||||||
RUN npm install -g pnpm
|
RUN npm install -g pnpm
|
||||||
|
|
||||||
RUN pnpm install
|
RUN pnpm install
|
||||||
|
|
||||||
COPY prisma ./prisma/
|
COPY prisma ./prisma/
|
||||||
RUN npx prisma generate
|
RUN npx prisma@6.17.0 generate
|
||||||
|
|
||||||
COPY nest-cli.json tsconfig.json tsconfig.build.json ./
|
COPY nest-cli.json tsconfig.json tsconfig.build.json ./
|
||||||
|
|
||||||
@@ -24,12 +24,12 @@ WORKDIR /app
|
|||||||
|
|
||||||
RUN npm install -g pnpm
|
RUN npm install -g pnpm
|
||||||
|
|
||||||
COPY package.json prisma.config.cjs ./
|
COPY package.json ./
|
||||||
|
|
||||||
RUN pnpm install --prod
|
RUN pnpm install --prod
|
||||||
|
|
||||||
COPY prisma ./prisma/
|
COPY prisma ./prisma/
|
||||||
RUN npx prisma generate
|
RUN npx prisma@6.17.0 generate
|
||||||
|
|
||||||
COPY --from=builder /app/dist ./dist
|
COPY --from=builder /app/dist ./dist
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
"@nestjs/core": "11.0.1",
|
"@nestjs/core": "11.0.1",
|
||||||
"@nestjs/passport": "11.0.5",
|
"@nestjs/passport": "11.0.5",
|
||||||
"@nestjs/platform-express": "11.0.1",
|
"@nestjs/platform-express": "11.0.1",
|
||||||
"@prisma/client": "7.0.1",
|
"@prisma/client": "6.17.0",
|
||||||
"axios": "1.12.0",
|
"axios": "1.12.0",
|
||||||
"bcrypt": "6.0.0",
|
"bcrypt": "6.0.0",
|
||||||
"class-transformer": "0.5.1",
|
"class-transformer": "0.5.1",
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
"globals": "16.0.0",
|
"globals": "16.0.0",
|
||||||
"jest": "30.0.0",
|
"jest": "30.0.0",
|
||||||
"prettier": "3.4.2",
|
"prettier": "3.4.2",
|
||||||
"prisma": "7.0.1",
|
"prisma": "6.17.0",
|
||||||
"source-map-support": "0.5.21",
|
"source-map-support": "0.5.21",
|
||||||
"supertest": "7.0.0",
|
"supertest": "7.0.0",
|
||||||
"ts-jest": "29.2.5",
|
"ts-jest": "29.2.5",
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
schema: 'prisma/schema.prisma',
|
|
||||||
datasource: {
|
|
||||||
url: process.env.DATABASE_URL,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -6,6 +6,7 @@ generator client {
|
|||||||
|
|
||||||
datasource db {
|
datasource db {
|
||||||
provider = "postgresql"
|
provider = "postgresql"
|
||||||
|
url = env("DATABASE_URL")
|
||||||
}
|
}
|
||||||
|
|
||||||
enum video_situation {
|
enum video_situation {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Type } from 'class-transformer';
|
import { Type } from 'class-transformer';
|
||||||
import {
|
import {
|
||||||
IsArray,
|
IsArray,
|
||||||
|
IsIn,
|
||||||
IsNumber,
|
IsNumber,
|
||||||
IsOptional,
|
IsOptional,
|
||||||
IsString,
|
IsString,
|
||||||
@@ -51,6 +52,9 @@ export class CreateVideoDto {
|
|||||||
description?: string;
|
description?: string;
|
||||||
|
|
||||||
@IsString()
|
@IsString()
|
||||||
|
@IsIn(['automatic', 'low', 'medium', 'high'], {
|
||||||
|
message: 'Qualidade deve ser "low", "medium" ou "high"',
|
||||||
|
})
|
||||||
@MaxLength(244)
|
@MaxLength(244)
|
||||||
qualidade: string;
|
qualidade: string;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import axios from 'axios';
|
import axios, { isAxiosError } from 'axios';
|
||||||
import isEmpty from 'lodash/isEmpty';
|
import isEmpty from 'lodash/isEmpty';
|
||||||
|
|
||||||
import { Injectable } from '@nestjs/common';
|
import { BadRequestException, Injectable } from '@nestjs/common';
|
||||||
import { plainToInstance } from 'class-transformer';
|
import { plainToInstance } from 'class-transformer';
|
||||||
|
|
||||||
import { Prisma, videos, video_situation } from 'generated/prisma';
|
import { Prisma, videos, video_situation } from 'generated/prisma';
|
||||||
@@ -237,9 +237,18 @@ export class VideosService {
|
|||||||
qualidade: qualidade === 'automatic' ? 'medium' : qualidade,
|
qualidade: qualidade === 'automatic' ? 'medium' : qualidade,
|
||||||
};
|
};
|
||||||
|
|
||||||
await axios.get(`${N8N_REMOTE_SERVER}/webhook/download-video`, {
|
try {
|
||||||
params,
|
await axios.get(`${N8N_REMOTE_SERVER}/webhook/download-video`, {
|
||||||
});
|
params,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
if (isAxiosError(error)) {
|
||||||
|
console.error(error.response?.data);
|
||||||
|
throw new BadRequestException(error.response?.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new BadRequestException('Usuário ou senha inválidos');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async update(id: number, data: Prisma.videosUpdateInput): Promise<videos> {
|
async update(id: number, data: Prisma.videosUpdateInput): Promise<videos> {
|
||||||
|
|||||||
Reference in New Issue
Block a user