From acb5e01dc58942961a2bbe39a4c4f3fc51bb02a5 Mon Sep 17 00:00:00 2001 From: kanth Date: Fri, 14 Jun 2024 22:55:16 +0530 Subject: [PATCH] fix: PRO-2395 fix imports in backend --- backend/Dockerfile | 2 +- backend/src/plugins/sequelizePlugin.ts | 10 +++++----- backend/src/routes/index.ts | 2 +- backend/src/routes/metadata.ts | 2 +- backend/src/server.ts | 6 +++--- backend/src/utils/common.ts | 1 - docker-compose.yml | 9 +++++++-- 7 files changed, 18 insertions(+), 14 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 52f00d8..6202c81 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -16,7 +16,7 @@ FROM node:18-alpine AS runner WORKDIR /usr/app ARG APP_ENV COPY --from=builder /app/build ./build -COPY ./src/migrations ./build/migrations +COPY ./migrations ./build/migrations COPY package.json ./ COPY --from=builder /app/config.json.default /usr/app/config.json RUN touch database.sqlite diff --git a/backend/src/plugins/sequelizePlugin.ts b/backend/src/plugins/sequelizePlugin.ts index 0649525..4dcd264 100644 --- a/backend/src/plugins/sequelizePlugin.ts +++ b/backend/src/plugins/sequelizePlugin.ts @@ -2,11 +2,11 @@ import fp from "fastify-plugin"; import { FastifyPluginAsync } from "fastify"; import { Sequelize } from 'sequelize'; import dotenv from 'dotenv'; -import { initializeAPIKeyModel } from '../models/api-key'; // Assuming path correctness -import { initializeSponsorshipPolicyModel } from '../models/sponsorship-policy'; -import { initializeArkaConfigModel } from "../models/arka-config"; -import { APIKeyRepository } from "../repository/api-key-repository"; -import { ArkaConfigRepository } from "../repository/arka-config-repository"; +import { initializeAPIKeyModel } from '../models/api-key.js'; +import { initializeSponsorshipPolicyModel } from '../models/sponsorship-policy.js'; +import { initializeArkaConfigModel } from "../models/arka-config.js"; +import { APIKeyRepository } from "../repository/api-key-repository.js"; +import { ArkaConfigRepository } from "../repository/arka-config-repository.js"; const pg = await import('pg'); const Client = pg.default.Client; diff --git a/backend/src/routes/index.ts b/backend/src/routes/index.ts index 1c452c2..e80de18 100644 --- a/backend/src/routes/index.ts +++ b/backend/src/routes/index.ts @@ -11,7 +11,7 @@ import ErrorMessage from "../constants/ErrorMessage.js"; import ReturnCode from "../constants/ReturnCode.js"; import { decode } from "../utils/crypto.js"; import { printRequest, getNetworkConfig } from "../utils/common.js"; -import { APIKey } from "models/api-key.js"; +import { APIKey } from "../models/api-key.js"; const SUPPORTED_ENTRYPOINTS = { 'EPV_06' : "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", diff --git a/backend/src/routes/metadata.ts b/backend/src/routes/metadata.ts index 9ee7aef..93072fc 100644 --- a/backend/src/routes/metadata.ts +++ b/backend/src/routes/metadata.ts @@ -7,7 +7,7 @@ import ReturnCode from "../constants/ReturnCode.js"; import ErrorMessage from "../constants/ErrorMessage.js"; import { decode } from "../utils/crypto.js"; import { PAYMASTER_ADDRESS } from "../constants/Pimlico.js"; -import { APIKey } from "../models/api-key"; +import { APIKey } from "../models/api-key.js"; import * as EtherspotAbi from "../abi/EtherspotAbi.js"; const metadataRoutes: FastifyPluginAsync = async (server) => { diff --git a/backend/src/server.ts b/backend/src/server.ts index 6d6ebbe..975a133 100644 --- a/backend/src/server.ts +++ b/backend/src/server.ts @@ -17,10 +17,10 @@ import PimlicoAbi from './abi/PimlicoAbi.js'; import PythOracleAbi from './abi/PythOracleAbi.js'; import { getNetworkConfig } from './utils/common.js'; import { checkDeposit } from './utils/monitorTokenPaymaster.js'; -import { APIKey } from 'models/api-key.js'; +import { APIKey } from './models/api-key.js'; import { APIKeyRepository } from './repository/api-key-repository.js'; -import { ArkaConfig } from 'models/arka-config.js'; -import { ArkaConfigRepository } from 'repository/arka-config-repository.js'; +import { ArkaConfig } from './models/arka-config.js'; +import { ArkaConfigRepository } from './repository/arka-config-repository.js'; let server: FastifyInstance; diff --git a/backend/src/utils/common.ts b/backend/src/utils/common.ts index c093fd9..c4fc745 100644 --- a/backend/src/utils/common.ts +++ b/backend/src/utils/common.ts @@ -2,7 +2,6 @@ import { FastifyBaseLogger, FastifyRequest } from "fastify"; import { BigNumber, ethers } from "ethers"; import SupportedNetworks from "../../config.json" assert { type: "json" }; import { EtherscanResponse, getEtherscanFeeResponse } from "./interface.js"; -import { APIKey } from "models/api-key"; export function printRequest(methodName: string, request: FastifyRequest, log: FastifyBaseLogger) { log.info(methodName, "called: "); diff --git a/docker-compose.yml b/docker-compose.yml index 4b58bce..832910f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,13 +20,18 @@ services: - API_PORT=5050 - UNSAFE_MODE=false - SUPPORTED_NETWORKS= - - CRON_PRIVATE_KEY= + - CRON_PRIVATE_KEY="" - DEFAULT_INDEXER_ENDPOINT=http://localhost:3003 - - FEE_MARKUP= + - FEE_MARKUP=0 - MULTI_TOKEN_MARKUP=1150000 + - ADMIN_WALLET_ADDRESS="" - ETHERSCAN_GAS_ORACLES= - DEFAULT_API_KEY= - WEBHOOK_URL= + - DATABASE_URL="postgresql://arkauser:paymaster@localhost:5432/arkadev" + - DATABASE_SCHEMA_NAME=arka + - DATABASE_SSL_ENABLED=false + - DATABASE_SSL_REJECT_UNAUTHORIZED=false build: context: ./backend dockerfile: Dockerfile