From 492ff606b91071f359b96660cffd60bfa2742895 Mon Sep 17 00:00:00 2001 From: Manoj K Date: Sun, 9 Jul 2023 15:46:11 -0700 Subject: [PATCH] fix: link service and node version in server docker --- .env | 4 ++-- docker-compose.yaml | 2 +- engine-server/Dockerfile | 4 ++-- .../20230709192037_link_identifier/migration.sql | 3 --- engine-server/src/modules/link/link.service.ts | 7 ++++++- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.env b/.env index 850b6215..e385aa94 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ -ENGINE_VERSION=0.1.4-alpha +ENGINE_VERSION=0.1.5-alpha # POSTGRES POSTGRES_USER=docker @@ -26,7 +26,7 @@ JWT_ACCESS_SECRET=nestjsPrismaAccessSecret JWT_REFRESH_SECRET=nestjsPrismaRefreshSecret FRONTEND_HOST=http://localhost:8000 -PUBLIC_FRONTEND_HOST=https://app.poozle.dev +PUBLIC_FRONTEND_HOST=http://localhost:8000 BACKEND_HOST=http://localhost:3000 BACKEND_URL=http://server:3000 diff --git a/docker-compose.yaml b/docker-compose.yaml index ab49368a..8e0fe3de 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,7 +2,7 @@ version: "3.8" services: db: - image: "postgres:latest" + image: "postgres:14-bullseye" environment: POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} diff --git a/engine-server/Dockerfile b/engine-server/Dockerfile index 1275f20d..c3b81d9f 100644 --- a/engine-server/Dockerfile +++ b/engine-server/Dockerfile @@ -1,4 +1,4 @@ -FROM node:16-alpine AS builder +FROM node:18-alpine AS builder # Create app directory WORKDIR /app @@ -15,7 +15,7 @@ COPY . . RUN npm run build -FROM node:16-alpine +FROM node:18-alpine COPY --from=builder /app/node_modules ./node_modules COPY --from=builder /app/package*.json ./ diff --git a/engine-server/prisma/migrations/20230709192037_link_identifier/migration.sql b/engine-server/prisma/migrations/20230709192037_link_identifier/migration.sql index 7e857f98..c81a06ca 100644 --- a/engine-server/prisma/migrations/20230709192037_link_identifier/migration.sql +++ b/engine-server/prisma/migrations/20230709192037_link_identifier/migration.sql @@ -4,9 +4,6 @@ - Added the required column `linkIdentifier` to the `Link` table without a default value. This is not possible if the table is not empty. */ --- AlterEnum -ALTER TYPE "IntegrationType" ADD VALUE 'DOCS'; - -- DropIndex DROP INDEX "IntegrationAccount_integrationAccountName_workspaceId_key"; diff --git a/engine-server/src/modules/link/link.service.ts b/engine-server/src/modules/link/link.service.ts index 9d5b570a..9a651888 100644 --- a/engine-server/src/modules/link/link.service.ts +++ b/engine-server/src/modules/link/link.service.ts @@ -38,6 +38,7 @@ export class LinkService { }, }); + const differenceSeconds = differenceInSeconds( new Date(), new Date(link.createdAt), @@ -65,7 +66,7 @@ export class LinkService { integrationDefinitions = [integrationDefinition]; } - return { + const response = { expired: differenceSeconds < link.expiresIn ? false : true, ...link, integrationAccounts: link.IntegrationAccount.map( @@ -76,6 +77,10 @@ export class LinkService { ), integrationDefinitions, }; + + delete response["IntegrationAccount"]; + + return response } async getLinksForWorkspace(workspaceIdQueryRequest: WorkspaceIdQueryRequest) {