Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependencies update #181

Merged
merged 7 commits into from
Nov 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,380 changes: 2,406 additions & 2,974 deletions package-lock.json

Large diffs are not rendered by default.

33 changes: 16 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,38 @@
"license": "ISC",
"dependencies": {
"axios": "^0.21.1",
"bcrypt": "^5.0.0",
"body-parser": "^1.18.3",
"bcrypt": "^5.1.0",
"body-parser": "^1.20.1",
"boom": "^7.2.0",
"compression": "^1.7.4",
"dotenv": "^6.1.0",
"express": "^4.17.2",
"express-winston": "^3.1.0",
"dotenv": "^16.0.3",
"express": "^4.18.2",
"express-winston": "^4.2.0",
"fast-csv": "^4.3.6",
"joi": "^14.3.1",
"jsonwebtoken": "^8.5.1",
"mathjs": "^9.2.0",
"mathjs": "^11.3.2",
"moment": "^2.29.4",
"multer": "^1.4.5-lts.1",
"node-pg-migrate": "^6.2.2",
"pg": "^8.6.0",
"pg-promise": "^10.10.2",
"pg": "^8.8.0",
"pg-promise": "^10.12.1",
"swagger-ui-express": "^4.5.0",
"uuid": "^3.3.2",
"winston": "^3.2.1",
"xlsx": "^0.18.4"
"uuid": "^9.0.0",
"winston": "^3.8.2",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@pact-foundation/pact": "^9.2.0",
"@types/boom": "^7.2.0",
"@types/express": "^4.16.0",
"@types/express": "^4.17.14",
"@types/jest": "^29.1.1",
"@types/multer": "^1.3.7",
"@types/supertest": "^2.0.8",
"@types/swagger-ui-express": "^3.0.1",
"@typescript-eslint/eslint-plugin": "^4.3.0",
"@typescript-eslint/parser": "^4.3.0",
"eslint": "^7.10.0",
"jest": "^29.1.2",
"@typescript-eslint/eslint-plugin": "^5.42.0",
"@typescript-eslint/parser": "^5.42.0",
"eslint": "^8.26.0",
"jest": "^29.2.2",
"supertest": "^4.0.2",
"ts-jest": "^29.0.3",
"ts-node": "10.9.1",
Expand Down
4 changes: 2 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import { logger } from "./logger"
import { Router } from "./server/router"
import * as swaggerUi from "swagger-ui-express"
import * as http from "http"
import { v4 as uuidv4 } from "uuid"
import { config } from "./server/config"
import { StatusCode } from "./server/utils/status-code"
import { NextFunction, Request, Response } from "express"
import { PgError } from "./server/errors/pgError"
import * as uuid from "uuid"
// eslint-disable-next-line @typescript-eslint/no-var-requires
const swaggerDocument = require("../openapi.json")

Expand Down Expand Up @@ -61,7 +61,7 @@ export class App {
const { payload: { message } } = error.output
return res.status(error.output.statusCode).json({ message })
}
const errorId = uuid()
const errorId = uuidv4()
logger.error(`Unexpected error: ${error}, errorId: ${errorId}`)
return res.status(StatusCode.InternalError).json({ message: `Unexpected error occurred: ${errorId}` })

Expand Down
4 changes: 2 additions & 2 deletions src/server/controllers/api-tokens/create-token-controller.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Response, NextFunction } from "express"
import { db } from "../../../db/db"
import * as uuid from "uuid"
import { v4 as uuidv4 } from "uuid"
import { createNewApiToken } from "../../queries/api-tokens"
import { IGetUserAuthInfoRequest } from "../../middleware/request.model"
import { StatusCode } from "../../utils/status-code"

export const createTokenController = async (req: IGetUserAuthInfoRequest, res: Response, next: NextFunction) => {
const { description } = req.body
const { userId } = req.user
const newToken = `at-${uuid()}`
const newToken = `at-${uuidv4()}`
try {
await db.query(createNewApiToken(newToken, description, userId))
return res.status(StatusCode.Created).send({ token: newToken })
Expand Down
6 changes: 3 additions & 3 deletions src/server/routes/test-data-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { wrapAsync } from "../errors/error-handler"
import { Request, Response } from "express"
import { bodySchemaValidator } from "../schema-validator/schema-validator-middleware"
import { testDataSchema } from "../schema-validator/test-data-schema"
import { States } from "../../tests/contract/states.model"
import { States } from "../../tests/integration/helper/state.model"
import { db } from "../../db/db"
import { createNewProject } from "../queries/projects"
import { createNewScenario } from "../queries/scenario"
Expand All @@ -13,7 +13,7 @@ import { createUserInDB } from "../controllers/users/create-new-user-controller"
import { getUser } from "../queries/auth"
import { generateToken } from "../controllers/auth/helper/token-generator"
import { createNewApiToken } from "../queries/api-tokens"
import * as uuid from "uuid"
import { v4 as uuidv4 } from "uuid"
import { ReportStatus } from "../queries/items.model"
import { StatusCode } from "../utils/status-code"
import { AllowedRoles } from "../middleware/authorization-middleware"
Expand Down Expand Up @@ -90,7 +90,7 @@ export class TestDataSetup {
.post(
wrapAsync(async (req: Request, res: Response) => {
await db.any({ text: "TRUNCATE jtl.api_tokens CASCADE" })
const TOKEN = `at-${uuid()}`
const TOKEN = `at-${uuidv4()}`
await createUserInDB("test-user", "test0000", AllowedRoles.Admin)
const { id } = await db.one(getUser("test-user"))
await db.any(createNewApiToken(TOKEN, "test-token", id))
Expand Down
76 changes: 0 additions & 76 deletions src/tests/contract/pact.spec.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/tests/contract/states.model.ts

This file was deleted.

9 changes: 9 additions & 0 deletions src/tests/integration/helper/state.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export enum States {
ExistingProject = "EXISTING_PROJECT",
ExistingScenario = "EXISTING_SCENARIO",
ExistingTestItem = "EXISTING_TEST_ITEM",
EmptyDb = "EMPTY_DB",
ExistingLogin = "EXISTING_LOGIN",
ExistingApiKey = "EXISTING_API_KEY",
NoUsers = "NO_USERS"
}
2 changes: 1 addition & 1 deletion src/tests/integration/init.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { routes } from "./helper/routes"
import { stateSetup, userSetup } from "./helper/state"
import * as request from "supertest"
import { States } from "../contract/states.model"
import { States } from "./helper/state.model"
import { StatusCode } from "../../server/utils/status-code"

describe("init", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/tests/integration/items.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as request from "supertest"
import { stateSetup, userSetup, apiTokenSetup } from "./helper/state"
import { States } from "../contract/states.model"
import { States } from "./helper/state.model"
import { ItemStatus } from "../../server/queries/items.model"
import * as path from "path"
import { StatusCode } from "../../server/utils/status-code"
Expand Down
2 changes: 1 addition & 1 deletion src/tests/integration/project.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as request from "supertest"
import { States } from "../contract/states.model"
import { States } from "./helper/state.model"
import { stateSetup, userSetup } from "./helper/state"
import { StatusCode } from "../../server/utils/status-code"

Expand Down
2 changes: 1 addition & 1 deletion src/tests/integration/scenario.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as request from "supertest"
import { States } from "../contract/states.model"
import { stateSetup, userSetup } from "./helper/state"
import { StatusCode } from "../../server/utils/status-code"
import { States } from "./helper/state.model"

describe("Scenario", () => {
let credentials
Expand Down
4 changes: 2 additions & 2 deletions src/tests/integration/users.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as request from "supertest"
import { userSetup } from "./helper/state"
import { routes } from "./helper/routes"
import * as uuid from "uuid"
import { v4 as uuidv4 } from "uuid"
import { StatusCode } from "../../server/utils/status-code"
import { AllowedRoles } from "../../server/middleware/authorization-middleware"

Expand Down Expand Up @@ -80,7 +80,7 @@ describe("Users", () => {
})
it("should return 404 when deleting unexisting user", async () => {
await request(__server__)
.delete(routes.users + `/${uuid()}`)
.delete(routes.users + `/${uuidv4()}`)
.set(__tokenHeaderKey__, credentials.token)
.send()
.expect(StatusCode.NotFound)
Expand Down