feat: enhance Docker configuration and update environment variables

- Updated .dockerignore to include additional files and directories for better Docker build context management.
- Modified compose.yaml to add BASE_URL and change BUCKET_NAME to improve environment configuration.
- Refactored Dockerfile to implement a multi-stage build for optimized image size and performance.
- Updated package.json to include a new script for production Prisma generation.
- Adjusted tsconfig files to refine project structure and exclude unnecessary directories.
- Removed delta.mdx.txt file from OpenAI instructions to streamline the service.
- Updated package-lock.json and package.json to upgrade Prisma and related dependencies for improved functionality.
This commit is contained in:
2024-12-05 18:37:34 +07:00
parent ac2014079f
commit 2033d0ec26
12 changed files with 294 additions and 64 deletions

View File

@@ -1,2 +1,9 @@
node_modules node_modules
epess-database/node_modules epess-database/node_modules
npm-debug.log
Dockerfile
.dockerignore
.git
.gitignore
README.md
epess-database/prisma/**/*.js

View File

@@ -1,23 +1,49 @@
FROM node:22.6.0-alpine AS node_base # Use multi-stage build for optimization
FROM node:22.6.0-alpine AS dependencies
# Set the working directory
WORKDIR /app WORKDIR /app
# Enable legacy peer deps # Copy only package files first to leverage Docker cache
RUN npm config set legacy-peer-deps true COPY package*.json ./
COPY epess-database/prisma ./prisma
COPY . . # Enable legacy peer deps and install dependencies in one layer
RUN npm config set legacy-peer-deps true && \
npm ci --only=production && \
npm install --save-dev typescript @types/node @swc/core @swc/cli && \
npx prisma generate
# Install the dependencies # Second stage for build
RUN npm install FROM node:22.6.0-alpine AS builder
WORKDIR /app
# Set legacy peer deps and copy only necessary files
COPY --from=dependencies /app/node_modules ./node_modules
COPY --from=dependencies /app/prisma ./prisma
COPY package*.json tsconfig*.json ./
COPY nest-cli.json ./
COPY src ./src
# Generate the Prisma client # Generate Prisma client and build
RUN npm run prisma:generate RUN npm config set legacy-peer-deps true && \
npm run build
# Final stage
FROM node:22.6.0-alpine AS runner
WORKDIR /app
# Copy only necessary files with minimal layers
COPY --from=dependencies /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/package*.json ./
# Expose the port # Expose the port
EXPOSE 3000 EXPOSE 3000
# Start the application # Use non-root user for security
USER node
CMD ["npm", "run", "start:dev"] # Pause to allow manual inspection (for debugging)
# CMD ["sh", "-c", "echo 'Paused. Press Ctrl+C to continue...'; sleep infinity"]
CMD ["npm", "run", "start:prod"]

View File

@@ -7,11 +7,10 @@ services:
pull_policy: always pull_policy: always
ports: ports:
- '8888:3069' - '8888:3069'
volumes:
- ./src:/app/src
environment: environment:
- NODE_ENV=development - NODE_ENV=development
- DISABLE_AUTH=false - DISABLE_AUTH=false
- BASE_URL=epess.org
# - CENTER_BASE_URL=http://localhost:3000 # - CENTER_BASE_URL=http://localhost:3000
- CENTER_BASE_URL=https://center.epess.org - CENTER_BASE_URL=https://center.epess.org
- DATABASE_URL=postgresql://your_username:your_password@10.0.27.1:5432/epess - DATABASE_URL=postgresql://your_username:your_password@10.0.27.1:5432/epess
@@ -23,10 +22,10 @@ services:
- SWAGGER_PATH=/swagger - SWAGGER_PATH=/swagger
- API_PATH=/v1 - API_PATH=/v1
- MINIO_ENDPOINT=objects.epess.org - MINIO_ENDPOINT=objects.epess.org
- MINIO_BUCKET_NAME=epess - BUCKET_NAME=epess
- MINIO_ACCESS_KEY=71dNgJtzkelXtG3R6IVt - MINIO_ACCESS_KEY=71dNgJtzkelXtG3R6IVt
- MINIO_SECRET_KEY=53LmFiDCZxvflJIOsVF9cf0aqkIjNU2oOWtLzGsf - MINIO_SECRET_KEY=53LmFiDCZxvflJIOsVF9cf0aqkIjNU2oOWtLzGsf
- RECORDING_BUCKET_NAME=epess-recordings - MINIO_REGION=default
- PAYOS_CLIENT_ID=e31f27d7-611a-468d-8d46-db21574a8fae - PAYOS_CLIENT_ID=e31f27d7-611a-468d-8d46-db21574a8fae
- PAYOS_API_KEY=a31d1fa1-a1b9-4e91-9948-6e46e94ce27e - PAYOS_API_KEY=a31d1fa1-a1b9-4e91-9948-6e46e94ce27e
- PAYOS_CHECKSUM_KEY=0b82fe148ab98083d471997df5cdd08f3c383013f8bc85e87d7ab1ab4433614e - PAYOS_CHECKSUM_KEY=0b82fe148ab98083d471997df5cdd08f3c383013f8bc85e87d7ab1ab4433614e

View File

@@ -22,6 +22,10 @@
{ {
"include": "**/*.pem", "include": "**/*.pem",
"outDir": "./dist/src/" "outDir": "./dist/src/"
},
{
"include": "**/*.mdx",
"outDir": "./dist/src/OpenAI/Instructions"
} }
] ]
} }

258
package-lock.json generated
View File

@@ -41,7 +41,7 @@
"@pothos/plugin-simple-objects": "^4.1.0", "@pothos/plugin-simple-objects": "^4.1.0",
"@pothos/plugin-smart-subscriptions": "^4.1.0", "@pothos/plugin-smart-subscriptions": "^4.1.0",
"@pothos/plugin-zod": "^4.1.0", "@pothos/plugin-zod": "^4.1.0",
"@prisma/client": "^5.21.1", "@prisma/client": "^6.0.1",
"@smatch-corp/nestjs-pothos": "^0.3.0", "@smatch-corp/nestjs-pothos": "^0.3.0",
"@smatch-corp/nestjs-pothos-apollo-driver": "^0.1.0", "@smatch-corp/nestjs-pothos-apollo-driver": "^0.1.0",
"apollo-server-express": "^3.13.0", "apollo-server-express": "^3.13.0",
@@ -102,7 +102,7 @@
"globals": "^15.10.0", "globals": "^15.10.0",
"jest": "^29.5.0", "jest": "^29.5.0",
"prettier": "^3.0.0", "prettier": "^3.0.0",
"prisma": "^5.21.1", "prisma": "^6.0.1",
"source-map-support": "^0.5.21", "source-map-support": "^0.5.21",
"supertest": "^7.0.0", "supertest": "^7.0.0",
"ts-jest": "^29.1.0", "ts-jest": "^29.1.0",
@@ -111,6 +111,9 @@
"tsconfig-paths": "^4.2.0", "tsconfig-paths": "^4.2.0",
"typescript": "^5.6.3", "typescript": "^5.6.3",
"ws": "^8.18.0" "ws": "^8.18.0"
},
"optionalDependencies": {
"@css-inline/css-inline-linux-x64-musl": "^0.14.3"
} }
}, },
"node_modules/@ampproject/remapping": { "node_modules/@ampproject/remapping": {
@@ -1861,6 +1864,134 @@
"@css-inline/css-inline-win32-x64-msvc": "0.14.1" "@css-inline/css-inline-win32-x64-msvc": "0.14.1"
} }
}, },
"node_modules/@css-inline/css-inline-android-arm-eabi": {
"version": "0.14.1",
"resolved": "https://registry.npmjs.org/@css-inline/css-inline-android-arm-eabi/-/css-inline-android-arm-eabi-0.14.1.tgz",
"integrity": "sha512-LNUR8TY4ldfYi0mi/d4UNuHJ+3o8yLQH9r2Nt6i4qeg1i7xswfL3n/LDLRXvGjBYqeEYNlhlBQzbPwMX1qrU6A==",
"cpu": [
"arm"
],
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@css-inline/css-inline-android-arm64": {
"version": "0.14.1",
"resolved": "https://registry.npmjs.org/@css-inline/css-inline-android-arm64/-/css-inline-android-arm64-0.14.1.tgz",
"integrity": "sha512-tH5us0NYGoTNBHOUHVV7j9KfJ4DtFOeTLA3cM0XNoMtArNu2pmaaBMFJPqECzavfXkLc7x5Z22UPZYjoyHfvCA==",
"cpu": [
"arm64"
],
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@css-inline/css-inline-darwin-arm64": {
"version": "0.14.1",
"resolved": "https://registry.npmjs.org/@css-inline/css-inline-darwin-arm64/-/css-inline-darwin-arm64-0.14.1.tgz",
"integrity": "sha512-QE5W1YRIfRayFrtrcK/wqEaxNaqLULPI0gZB4ArbFRd3d56IycvgBasDTHPre5qL2cXCO3VyPx+80XyHOaVkag==",
"cpu": [
"arm64"
],
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@css-inline/css-inline-darwin-x64": {
"version": "0.14.1",
"resolved": "https://registry.npmjs.org/@css-inline/css-inline-darwin-x64/-/css-inline-darwin-x64-0.14.1.tgz",
"integrity": "sha512-mAvv2sN8awNFsbvBzlFkZPbCNZ6GCWY5/YcIz7V5dPYw+bHHRbjnlkNTEZq5BsDxErVrMIGvz05PGgzuNvZvdQ==",
"cpu": [
"x64"
],
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@css-inline/css-inline-linux-arm-gnueabihf": {
"version": "0.14.1",
"resolved": "https://registry.npmjs.org/@css-inline/css-inline-linux-arm-gnueabihf/-/css-inline-linux-arm-gnueabihf-0.14.1.tgz",
"integrity": "sha512-AWC44xL0X7BgKvrWEqfSqkT2tJA5kwSGrAGT+m0gt11wnTYySvQ6YpX0fTY9i3ppYGu4bEdXFjyK2uY1DTQMHA==",
"cpu": [
"arm"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@css-inline/css-inline-linux-arm64-gnu": {
"version": "0.14.1",
"resolved": "https://registry.npmjs.org/@css-inline/css-inline-linux-arm64-gnu/-/css-inline-linux-arm64-gnu-0.14.1.tgz",
"integrity": "sha512-drj0ciiJgdP3xKXvNAt4W+FH4KKMs8vB5iKLJ3HcH07sNZj58Sx++2GxFRS1el3p+GFp9OoYA6dgouJsGEqt0Q==",
"cpu": [
"arm64"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@css-inline/css-inline-linux-x64-gnu": {
"version": "0.14.1",
"resolved": "https://registry.npmjs.org/@css-inline/css-inline-linux-x64-gnu/-/css-inline-linux-x64-gnu-0.14.1.tgz",
"integrity": "sha512-yubbEye+daDY/4vXnyASAxH88s256pPati1DfVoZpU1V0+KP0BZ1dByZOU1ktExurbPH3gZOWisAnBE9xon0Uw==",
"cpu": [
"x64"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@css-inline/css-inline-linux-x64-musl": {
"version": "0.14.3",
"resolved": "https://registry.npmjs.org/@css-inline/css-inline-linux-x64-musl/-/css-inline-linux-x64-musl-0.14.3.tgz",
"integrity": "sha512-xUP5lAPEj5FdJurG2whVC0+cnLiEpPdacj6yqrbpIbScrimMRopEfb84AvfYQnplKXXtqUB1apEjwLREbyfRGA==",
"cpu": [
"x64"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@css-inline/css-inline-win32-x64-msvc": { "node_modules/@css-inline/css-inline-win32-x64-msvc": {
"version": "0.14.1", "version": "0.14.1",
"resolved": "https://registry.npmjs.org/@css-inline/css-inline-win32-x64-msvc/-/css-inline-win32-x64-msvc-0.14.1.tgz", "resolved": "https://registry.npmjs.org/@css-inline/css-inline-win32-x64-msvc/-/css-inline-win32-x64-msvc-0.14.1.tgz",
@@ -1877,6 +2008,38 @@
"node": ">= 10" "node": ">= 10"
} }
}, },
"node_modules/@css-inline/css-inline/node_modules/@css-inline/css-inline-linux-arm64-musl": {
"version": "0.14.1",
"resolved": "https://registry.npmjs.org/@css-inline/css-inline-linux-arm64-musl/-/css-inline-linux-arm64-musl-0.14.1.tgz",
"integrity": "sha512-FzknI+st8eA8YQSdEJU9ykcM0LZjjigBuynVF5/p7hiMm9OMP8aNhWbhZ8LKJpKbZrQsxSGS4g9Vnr6n6FiSdQ==",
"cpu": [
"arm64"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@css-inline/css-inline/node_modules/@css-inline/css-inline-linux-x64-musl": {
"version": "0.14.1",
"resolved": "https://registry.npmjs.org/@css-inline/css-inline-linux-x64-musl/-/css-inline-linux-x64-musl-0.14.1.tgz",
"integrity": "sha512-6CRAZzoy1dMLPC/tns2rTt1ZwPo0nL/jYBEIAsYTCWhfAnNnpoLKVh5Nm+fSU3OOwTTqU87UkGrFJhObD/wobQ==",
"cpu": [
"x64"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@faker-js/faker": { "node_modules/@faker-js/faker": {
"version": "9.2.0", "version": "9.2.0",
"resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-9.2.0.tgz", "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-9.2.0.tgz",
@@ -4790,13 +4953,13 @@
} }
}, },
"node_modules/@prisma/client": { "node_modules/@prisma/client": {
"version": "5.22.0", "version": "6.0.1",
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.22.0.tgz", "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.0.1.tgz",
"integrity": "sha512-M0SVXfyHnQREBKxCgyo7sffrKttwE6R8PMq330MIUF0pTwjUhLbW84pFDlf06B27XyCR++VtjugEnIHdr07SVA==", "integrity": "sha512-60w7kL6bUxz7M6Gs/V+OWMhwy94FshpngVmOY05TmGD0Lhk+Ac0ZgtjlL6Wll9TD4G03t4Sq1wZekNVy+Xdlbg==",
"hasInstallScript": true, "hasInstallScript": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"engines": { "engines": {
"node": ">=16.13" "node": ">=18.18"
}, },
"peerDependencies": { "peerDependencies": {
"prisma": "*" "prisma": "*"
@@ -4814,49 +4977,49 @@
"license": "Apache-2.0" "license": "Apache-2.0"
}, },
"node_modules/@prisma/engines": { "node_modules/@prisma/engines": {
"version": "5.22.0", "version": "6.0.1",
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.22.0.tgz", "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-6.0.1.tgz",
"integrity": "sha512-UNjfslWhAt06kVL3CjkuYpHAWSO6L4kDCVPegV6itt7nD1kSJavd3vhgAEhjglLJJKEdJ7oIqDJ+yHk6qO8gPA==", "integrity": "sha512-4hxzI+YQIR2uuDyVsDooFZGu5AtixbvM2psp+iayDZ4hRrAHo/YwgA17N23UWq7G6gRu18NvuNMb48qjP3DPQw==",
"dev": true, "dev": true,
"hasInstallScript": true, "hasInstallScript": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@prisma/debug": "5.22.0", "@prisma/debug": "6.0.1",
"@prisma/engines-version": "5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2", "@prisma/engines-version": "5.23.0-27.5dbef10bdbfb579e07d35cc85fb1518d357cb99e",
"@prisma/fetch-engine": "5.22.0", "@prisma/fetch-engine": "6.0.1",
"@prisma/get-platform": "5.22.0" "@prisma/get-platform": "6.0.1"
} }
}, },
"node_modules/@prisma/engines-version": { "node_modules/@prisma/engines-version": {
"version": "5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2", "version": "5.23.0-27.5dbef10bdbfb579e07d35cc85fb1518d357cb99e",
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2.tgz", "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.23.0-27.5dbef10bdbfb579e07d35cc85fb1518d357cb99e.tgz",
"integrity": "sha512-2PTmxFR2yHW/eB3uqWtcgRcgAbG1rwG9ZriSvQw+nnb7c4uCr3RAcGMb6/zfE88SKlC1Nj2ziUvc96Z379mHgQ==", "integrity": "sha512-JmIds0Q2/vsOmnuTJYxY4LE+sajqjYKhLtdOT6y4imojqv5d/aeVEfbBGC74t8Be1uSp0OP8lxIj2OqoKbLsfQ==",
"dev": true, "dev": true,
"license": "Apache-2.0" "license": "Apache-2.0"
}, },
"node_modules/@prisma/engines/node_modules/@prisma/debug": { "node_modules/@prisma/engines/node_modules/@prisma/debug": {
"version": "5.22.0", "version": "6.0.1",
"resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.22.0.tgz", "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.0.1.tgz",
"integrity": "sha512-AUt44v3YJeggO2ZU5BkXI7M4hu9BF2zzH2iF2V5pyXT/lRTyWiElZ7It+bRH1EshoMRxHgpYg4VB6rCM+mG5jQ==", "integrity": "sha512-jQylgSOf7ibTVxqBacnAlVGvek6fQxJIYCQOeX2KexsfypNzXjJQSS2o5s+Mjj2Np93iSOQUaw6TvPj8syhG4w==",
"dev": true, "dev": true,
"license": "Apache-2.0" "license": "Apache-2.0"
}, },
"node_modules/@prisma/fetch-engine": { "node_modules/@prisma/fetch-engine": {
"version": "5.22.0", "version": "6.0.1",
"resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.22.0.tgz", "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-6.0.1.tgz",
"integrity": "sha512-bkrD/Mc2fSvkQBV5EpoFcZ87AvOgDxbG99488a5cexp5Ccny+UM6MAe/UFkUC0wLYD9+9befNOqGiIJhhq+HbA==", "integrity": "sha512-T36bWFVGeGYYSyYOj9d+O9G3sBC+pAyMC+jc45iSL63/Haq1GrYjQPgPMxrEj9m739taXrupoysRedQ+VyvM/Q==",
"dev": true, "dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@prisma/debug": "5.22.0", "@prisma/debug": "6.0.1",
"@prisma/engines-version": "5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2", "@prisma/engines-version": "5.23.0-27.5dbef10bdbfb579e07d35cc85fb1518d357cb99e",
"@prisma/get-platform": "5.22.0" "@prisma/get-platform": "6.0.1"
} }
}, },
"node_modules/@prisma/fetch-engine/node_modules/@prisma/debug": { "node_modules/@prisma/fetch-engine/node_modules/@prisma/debug": {
"version": "5.22.0", "version": "6.0.1",
"resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.22.0.tgz", "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.0.1.tgz",
"integrity": "sha512-AUt44v3YJeggO2ZU5BkXI7M4hu9BF2zzH2iF2V5pyXT/lRTyWiElZ7It+bRH1EshoMRxHgpYg4VB6rCM+mG5jQ==", "integrity": "sha512-jQylgSOf7ibTVxqBacnAlVGvek6fQxJIYCQOeX2KexsfypNzXjJQSS2o5s+Mjj2Np93iSOQUaw6TvPj8syhG4w==",
"dev": true, "dev": true,
"license": "Apache-2.0" "license": "Apache-2.0"
}, },
@@ -4870,19 +5033,19 @@
} }
}, },
"node_modules/@prisma/get-platform": { "node_modules/@prisma/get-platform": {
"version": "5.22.0", "version": "6.0.1",
"resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.22.0.tgz", "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.0.1.tgz",
"integrity": "sha512-pHhpQdr1UPFpt+zFfnPazhulaZYCUqeIcPpJViYoq9R+D/yw4fjE+CtnsnKzPYm0ddUbeXUzjGVGIRVgPDCk4Q==", "integrity": "sha512-zspC9vlxAqx4E6epMPMLLBMED2VD8axDe8sPnquZ8GOsn6tiacWK0oxrGK4UAHYzYUVuMVUApJbdXB2dFpLhvg==",
"dev": true, "dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@prisma/debug": "5.22.0" "@prisma/debug": "6.0.1"
} }
}, },
"node_modules/@prisma/get-platform/node_modules/@prisma/debug": { "node_modules/@prisma/get-platform/node_modules/@prisma/debug": {
"version": "5.22.0", "version": "6.0.1",
"resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.22.0.tgz", "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.0.1.tgz",
"integrity": "sha512-AUt44v3YJeggO2ZU5BkXI7M4hu9BF2zzH2iF2V5pyXT/lRTyWiElZ7It+bRH1EshoMRxHgpYg4VB6rCM+mG5jQ==", "integrity": "sha512-jQylgSOf7ibTVxqBacnAlVGvek6fQxJIYCQOeX2KexsfypNzXjJQSS2o5s+Mjj2Np93iSOQUaw6TvPj8syhG4w==",
"dev": true, "dev": true,
"license": "Apache-2.0" "license": "Apache-2.0"
}, },
@@ -10002,6 +10165,21 @@
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
"license": "ISC" "license": "ISC"
}, },
"node_modules/fsevents": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/function-bind": { "node_modules/function-bind": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
@@ -14824,20 +15002,20 @@
} }
}, },
"node_modules/prisma": { "node_modules/prisma": {
"version": "5.22.0", "version": "6.0.1",
"resolved": "https://registry.npmjs.org/prisma/-/prisma-5.22.0.tgz", "resolved": "https://registry.npmjs.org/prisma/-/prisma-6.0.1.tgz",
"integrity": "sha512-vtpjW3XuYCSnMsNVBjLMNkTj6OZbudcPPTPYHqX0CJfpcdWciI1dM8uHETwmDxxiqEwCIE6WvXucWUetJgfu/A==", "integrity": "sha512-CaMNFHkf+DDq8zq3X/JJsQ4Koy7dyWwwtOKibkT/Am9j/tDxcfbg7+lB1Dzhx18G/+RQCMgjPYB61bhRqteNBQ==",
"dev": true, "dev": true,
"hasInstallScript": true, "hasInstallScript": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@prisma/engines": "5.22.0" "@prisma/engines": "6.0.1"
}, },
"bin": { "bin": {
"prisma": "build/index.js" "prisma": "build/index.js"
}, },
"engines": { "engines": {
"node": ">=16.13" "node": ">=18.18"
}, },
"optionalDependencies": { "optionalDependencies": {
"fsevents": "2.3.3" "fsevents": "2.3.3"

View File

@@ -13,6 +13,7 @@
"start:debug": "nest start --debug --watch", "start:debug": "nest start --debug --watch",
"start:prod": "node dist/main", "start:prod": "node dist/main",
"prisma:generate": "npx prisma generate --schema=./epess-database/prisma/schema.prisma", "prisma:generate": "npx prisma generate --schema=./epess-database/prisma/schema.prisma",
"prisma:generate:prod": "npx prisma generate",
"prisma:migrate": "npx prisma migrate dev --schema=./epess-database/prisma/schema.prisma", "prisma:migrate": "npx prisma migrate dev --schema=./epess-database/prisma/schema.prisma",
"prisma:push": "npx prisma db push --schema=./epess-database/prisma/schema.prisma", "prisma:push": "npx prisma db push --schema=./epess-database/prisma/schema.prisma",
"prisma:reset": "npx prisma migrate reset --schema=./epess-database/prisma/schema.prisma", "prisma:reset": "npx prisma migrate reset --schema=./epess-database/prisma/schema.prisma",
@@ -61,7 +62,7 @@
"@pothos/plugin-simple-objects": "^4.1.0", "@pothos/plugin-simple-objects": "^4.1.0",
"@pothos/plugin-smart-subscriptions": "^4.1.0", "@pothos/plugin-smart-subscriptions": "^4.1.0",
"@pothos/plugin-zod": "^4.1.0", "@pothos/plugin-zod": "^4.1.0",
"@prisma/client": "^5.21.1", "@prisma/client": "^6.0.1",
"@smatch-corp/nestjs-pothos": "^0.3.0", "@smatch-corp/nestjs-pothos": "^0.3.0",
"@smatch-corp/nestjs-pothos-apollo-driver": "^0.1.0", "@smatch-corp/nestjs-pothos-apollo-driver": "^0.1.0",
"apollo-server-express": "^3.13.0", "apollo-server-express": "^3.13.0",
@@ -122,7 +123,7 @@
"globals": "^15.10.0", "globals": "^15.10.0",
"jest": "^29.5.0", "jest": "^29.5.0",
"prettier": "^3.0.0", "prettier": "^3.0.0",
"prisma": "^5.21.1", "prisma": "^6.0.1",
"source-map-support": "^0.5.21", "source-map-support": "^0.5.21",
"supertest": "^7.0.0", "supertest": "^7.0.0",
"ts-jest": "^29.1.0", "ts-jest": "^29.1.0",
@@ -132,6 +133,9 @@
"typescript": "^5.6.3", "typescript": "^5.6.3",
"ws": "^8.18.0" "ws": "^8.18.0"
}, },
"optionalDependencies": {
"@css-inline/css-inline-linux-x64-musl": "^0.14.3"
},
"jest": { "jest": {
"moduleFileExtensions": ["js", "json", "ts"], "moduleFileExtensions": ["js", "json", "ts"],
"rootDir": "src", "rootDir": "src",

View File

@@ -125,7 +125,7 @@ export class MinioService {
} }
listRecords(roomId: string) { listRecords(roomId: string) {
return this.minioClient.listObjects(this.configService.get('BUCKET_NAME') ?? 'epess', `records/${roomId}`) return this.minioClient.listObjects(this.configService.get('BUCKET_NAME') ?? 'epess', `epess/records/${roomId}`)
} }
// export document to docx format by get all pages and convert to docx // export document to docx format by get all pages and convert to docx
async exportDocument(id: string) { async exportDocument(id: string) {

View File

@@ -5,7 +5,7 @@ import { z } from 'zod'
import { zodResponseFormat } from 'openai/helpers/zod' import { zodResponseFormat } from 'openai/helpers/zod'
import { readFileSync } from 'fs' import { readFileSync } from 'fs'
const DELTA_INSTRUCTIONS = readFileSync('./src/OpenAI/Instructions/delta.mdx.txt', 'utf8') const DELTA_INSTRUCTIONS = ''
@Injectable() @Injectable()
export class OpenaiService { export class OpenaiService {

View File

@@ -1,4 +1,15 @@
{ {
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"exclude": ["node_modules", "test", "dist", "**/*spec.ts"] "exclude": [
"node_modules",
"test",
"dist",
"**/*spec.ts",
"epess-database",
"codegen.ts",
],
"compilerOptions": {
"rootDir": "./src",
"allowJs": true
}
} }

View File

@@ -10,6 +10,7 @@
"sourceMap": true, "sourceMap": true,
"outDir": "./dist", "outDir": "./dist",
"baseUrl": "./", "baseUrl": "./",
"rootDir": "./src",
"incremental": true, "incremental": true,
"skipLibCheck": true, "skipLibCheck": true,
"strictNullChecks": true, "strictNullChecks": true,