Skip to content

Commit

Permalink
[Snyk] Upgrade swagger-jsdoc from 4.0.0 to 5.0.1 (#1075)
Browse files Browse the repository at this point in the history
* fix: upgrade swagger-jsdoc from 4.0.0 to 4.3.2

Snyk has created this PR to upgrade swagger-jsdoc from 4.0.0 to 4.3.2.

See this package in npm:
https://www.npmjs.com/package/swagger-jsdoc

See this project in Snyk:
https://app.snyk.io/org/open-government-products/project/0376d738-3c6b-42e2-92b1-64ef46f36225?utm_source=github&utm_medium=upgrade-pr

* chore(backend): upgrade swagger-jsdoc to v5.0.1

It appears that v4.3.2 was a mistake in publishing and really should've
been v5.0.0 instead (see ref).

Hence, upgrade to the latest v5.x version which is v5.0.1 instead.

Ref: https://github.com/Surnet/swagger-jsdoc/releases/tag/v4.3.2

* fix(swagger-jsdoc): use the 'paths' prop instead of 'path'

Support for the 'path' prop has been removed in v5.0.0 (see ref).
Migrate to the 'paths' prop instead, which is its direct replacement.

Ref 1: https://github.com/Surnet/swagger-jsdoc/releases/tag/v5.0.0
Ref 2: https://github.com/Surnet/swagger-jsdoc/blob/v4.3.1/lib/helpers/specification.js#L55

Co-authored-by: Zhao Wei Liew <zhaoweiliew@gmail.com>
  • Loading branch information
snyk-bot and zwliew authored Apr 12, 2021
1 parent a9c9d3d commit 58ea8ab
Show file tree
Hide file tree
Showing 17 changed files with 123 additions and 120 deletions.
99 changes: 51 additions & 48 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"sequelize-typescript": "^1.1.0",
"source-map-support": "^0.5.16",
"starkbank-ecdsa": "^1.1.2",
"swagger-jsdoc": "^4.0.0",
"swagger-jsdoc": "^5.0.1",
"swagger-ui-express": "^4.1.4",
"telegraf": "^3.38.0",
"threads": "^1.4.0",
Expand Down
8 changes: 4 additions & 4 deletions backend/src/core/routes/auth.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const verifyOtpValidator = {

/**
* @swagger
* path:
* paths:
* /auth/otp:
* post:
* tags:
Expand Down Expand Up @@ -64,7 +64,7 @@ router.post('/otp', celebrate(getOtpValidator), AuthMiddleware.getOtp)

/**
* @swagger
* path:
* paths:
* /auth/login:
* post:
* summary: Verify user otp
Expand Down Expand Up @@ -103,7 +103,7 @@ router.post('/login', celebrate(verifyOtpValidator), AuthMiddleware.verifyOtp)

/**
* @swagger
* path:
* paths:
* /auth/userinfo:
* get:
* summary: get logged in user info
Expand All @@ -125,7 +125,7 @@ router.get('/userinfo', AuthMiddleware.getUser)

/**
* @swagger
* path:
* paths:
* /auth/logout:
* get:
* summary: logs user out
Expand Down
4 changes: 2 additions & 2 deletions backend/src/core/routes/campaign.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const createCampaignValidator = {

/**
* @swagger
* path:
* paths:
* /campaigns:
* get:
* tags:
Expand Down Expand Up @@ -78,7 +78,7 @@ router.get(

/**
* @swagger
* path:
* paths:
* /campaigns:
* post:
* summary: Create a new campaign
Expand Down
2 changes: 1 addition & 1 deletion backend/src/core/routes/protected.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const protectVerifyValidator = {

/**
* @swagger
* path:
* paths:
* /protect/{id}:
* post:
* description: Verify password hash and return encrypted payload
Expand Down
12 changes: 6 additions & 6 deletions backend/src/core/routes/settings.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const updateAnnouncementVersionValidator = {

/**
* @swagger
* path:
* paths:
* /settings:
* get:
* summary: Retrieve stored settings for user
Expand Down Expand Up @@ -67,7 +67,7 @@ router.get('/', SettingsMiddleware.getUserSettings)

/**
* @swagger
* path:
* paths:
* /settings/regen:
* post:
* summary: Regenerates api key
Expand All @@ -90,7 +90,7 @@ router.post('/regen', SettingsMiddleware.regenerateApiKey)

/**
* @swagger
* path:
* paths:
* /settings/credentials:
* delete:
* summary: Deletes stored credential for user
Expand Down Expand Up @@ -121,7 +121,7 @@ router.delete(

/**
* @swagger
* path:
* paths:
* /settings/{channelType}/credentials:
* get:
* summary: Retrieve channel specific credentials for user
Expand Down Expand Up @@ -153,7 +153,7 @@ router.get(

/**
* @swagger
* path:
* paths:
* /settings/demo:
* put:
* tags:
Expand Down Expand Up @@ -193,7 +193,7 @@ router.put(

/**
* @swagger
* path:
* paths:
* /settings/announcement-version:
* put:
* tags:
Expand Down
2 changes: 1 addition & 1 deletion backend/src/core/routes/stats.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const router = Router()

/**
* @swagger
* path:
* paths:
* /stats:
* get:
* summary: Get count of total messages sent
Expand Down
2 changes: 1 addition & 1 deletion backend/src/core/routes/unsubscriber.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const findOrCreateUnsubscribeValidator = {

/**
* @swagger
* path:
* paths:
* /unsubscribe/{campaignId}/{recipient}:
* put:
* summary: Add an unsubscriber
Expand Down
2 changes: 1 addition & 1 deletion backend/src/email/routes/email-callback.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { EmailCallbackMiddleware } from '@email/middlewares'
const router = Router()
/**
* @swagger
* path:
* paths:
* /callback/email:
* post:
* summary: Update status of email message
Expand Down
Loading

0 comments on commit 58ea8ab

Please sign in to comment.