Skip to content

Commit

Permalink
Merge pull request #738 from dhis2/next
Browse files Browse the repository at this point in the history
chore(release): release
  • Loading branch information
Birkbjo committed Aug 4, 2023
2 parents 506dacf + 54907ed commit c6bfa3e
Show file tree
Hide file tree
Showing 26 changed files with 1,521 additions and 1,053 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
# [2.33.0](https://github.com/dhis2/app-hub/compare/v2.32.2...v2.33.0) (2023-08-01)


### Bug Fixes

* add docs for slack arguments ([de11f5b](https://github.com/dhis2/app-hub/commit/de11f5bb899f6ecf616c9b81076961c95b7e62f5))
* debug log ([5188baf](https://github.com/dhis2/app-hub/commit/5188baf7dfb569e989e590b5d46b633fc02243aa))
* **slackmessager:** update review now link ([4b9875d](https://github.com/dhis2/app-hub/commit/4b9875dba49b60370ff86023244121da8da9e121))
* slackwebhookmessager rename ([d86ba80](https://github.com/dhis2/app-hub/commit/d86ba80fc6fbc4d6e317b4ca4371c52056a45f1b))


### Features

* **notifications:** add slack webhook for new apps ([2f222ee](https://github.com/dhis2/app-hub/commit/2f222ee7a89c3259889d956444cbd2ba91aaa8f6))

## [2.32.2](https://github.com/dhis2/app-hub/compare/v2.32.1...v2.32.2) (2023-05-16)


### Bug Fixes

* **addappmedia:** fix adding media after knex upgrade ([2e8ff4c](https://github.com/dhis2/app-hub/commit/2e8ff4ca545763b575c8893d5ed804e77bb2d53a))
* **dependencies:** upgrade to knex@2 ([39f43ac](https://github.com/dhis2/app-hub/commit/39f43acfef3b7011c580662fbc22ba4aed6ef56f))
* **deps:** update hapi-sentry ([192e56e](https://github.com/dhis2/app-hub/commit/192e56e76453dd3ad31dc335b131b7a423745665))
* **deps:** update jwt deps ([cc6cef4](https://github.com/dhis2/app-hub/commit/cc6cef46f95ea40fdab550f95171da25c71906ee))
* upgrade hapi deps ([1a3a6b6](https://github.com/dhis2/app-hub/commit/1a3a6b60f2f7d0b08eb87d10f8771a37a08b9f6f))

## [2.32.1](https://github.com/dhis2/app-hub/compare/v2.32.0...v2.32.1) (2023-04-18)


Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "client",
"version": "2.32.1",
"version": "2.33.0",
"description": "The App Hub Client",
"repository": "https://github.com/dhis2/app-hub",
"author": "Birk Johansson <birk@dhis2.org>",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true
},
"version": "2.32.1"
"version": "2.33.0"
}
1 change: 1 addition & 0 deletions server/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
extends: [config.eslint],

parserOptions: {
ecmaVersion: 2020,
ecmaFeatures: {
globalReturn: true,
experimentalObjectRestSpread: true,
Expand Down
36 changes: 20 additions & 16 deletions server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "server",
"version": "2.32.1",
"version": "2.33.0",
"description": "The App Hub Server",
"main": "src/main.js",
"repository": "https://github.com/dhis2/app-hub",
Expand All @@ -19,13 +19,17 @@
"db:reload": "yarn db:reset && yarn db:seed",
"generate:migration": "knex migrate:make"
},
"engines": {
"node": ">=14.0.0"
},
"dependencies": {
"@hapi/boom": "^9.1.4",
"@hapi/bounce": "^2.0.0",
"@hapi/hapi": "^20.1.5",
"@hapi/inert": "^6.0.4",
"@hapi/vision": "^6.1.0",
"@hapipal/schmervice": "^2.0.0",
"@hapi/boom": "^10.0.1",
"@hapi/bounce": "^3.0.1",
"@hapi/hapi": "^21.3.0",
"@hapi/inert": "^7.1.0",
"@hapi/vision": "^7.0.1",
"@hapipal/schmervice": "^2.1.0",
"@slack/webhook": "^6.1.0",
"adm-zip": "^0.5.5",
"auth0": "^2.36.1",
"aws-sdk": "^2.981.0",
Expand All @@ -34,14 +38,14 @@
"debug": "^4.1.1",
"dotenv": "^10.0.0",
"hapi-api-version": "^2.3.1",
"hapi-auth-jwt2": "^10.2.0",
"hapi-pino": "8",
"hapi-sentry": "^3.2.0",
"hapi-swagger": "^14.2.4",
"hapi-auth-jwt2": "^10.4.0",
"hapi-pino": "^12.0.0",
"hapi-sentry": "^4.0.0-0",
"hapi-swagger": "^16.0.1",
"joi": "^17.4.2",
"jsonwebtoken": "^8.5.1",
"jwks-rsa": "^2.0.4",
"knex": "^0.95.10",
"jsonwebtoken": "^9.0.0",
"jwks-rsa": "^3.0.1",
"knex": "^2.4.2",
"nodemailer": "^6.6.3",
"pg": "^8.7.1",
"punycode": "^2.1.1",
Expand All @@ -56,10 +60,10 @@
"eslint-config-hapi": "^12.0.0",
"eslint-plugin-hapi": "^4.1.0",
"form-data": "^4.0.0",
"mock-knex": "^0.4.10",
"mock-knex": "^0.4.12",
"mock-local-storage": "^1.1.17",
"nodemon": "^2.0.12",
"request-promise": "^4.2.6",
"pino-pretty": "^10.0.0",
"sinon": "^11.1.2",
"stream-to-promise": "^3.0.0"
}
Expand Down
26 changes: 7 additions & 19 deletions server/src/data/addAppMedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,14 @@ const { MediaTypes } = require('../enums')
const paramSchema = joi
.object()
.keys({
appId: joi
.string()
.uuid()
.required(),
userId: joi
.string()
.uuid()
.required(),
appId: joi.string().uuid().required(),
userId: joi.string().uuid().required(),
mediaType: joi
.number()
.required()
.valid(...MediaTypes),
fileName: joi
.string()
.required()
.max(255),
mime: joi
.string()
.required()
.max(255),
fileName: joi.string().required().max(255),
mime: joi.string().required().max(255),
})
.options({ allowUnknown: true })

Expand Down Expand Up @@ -66,7 +54,7 @@ const addAppMedia = async (params, knex) => {
.where('mime', mime)

if (!mimeTypes || mimeTypes.length === 0) {
const [id] = await knex('mime_type')
const [{ id }] = await knex('mime_type')
.insert({
mime,
})
Expand All @@ -90,7 +78,7 @@ const addAppMedia = async (params, knex) => {
created_by_user_id: userId,
}

const [mediaId] = await knex('media')
const [{ id: mediaId }] = await knex('media')
.insert(mediaToInsert)
.returning('id')

Expand All @@ -102,7 +90,7 @@ const addAppMedia = async (params, knex) => {
media_id: mediaId,
}

const [id] = await knex('app_media')
const [{ id }] = await knex('app_media')
.insert(insertData)
.returning('id')

Expand Down
27 changes: 6 additions & 21 deletions server/src/data/addAppVersionToChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,11 @@ const joi = require('joi')
const paramSchema = joi
.object()
.keys({
appVersionId: joi
.string()
.uuid()
.required(),
createdByUserId: joi
.string()
.uuid()
.required(),
channelName: joi
.string()
.required()
.max(50),
minDhisVersion: joi
.string()
.required()
.min(1),
maxDhisVersion: joi
.string()
.required()
.allow(''),
appVersionId: joi.string().uuid().required(),
createdByUserId: joi.string().uuid().required(),
channelName: joi.string().required().max(50),
minDhisVersion: joi.string().required().min(1),
maxDhisVersion: joi.string().required().allow(''),
})
.options({ allowUnknown: true })

Expand Down Expand Up @@ -62,7 +47,7 @@ const addAppVersionToChannel = async (params, knex) => {
.select('id')
.where({ name: channelName })

const [id] = await knex('app_channel')
const [{ id }] = await knex('app_channel')
.insert({
app_version_id: appVersionId,
channel_id: channel.id,
Expand Down
21 changes: 5 additions & 16 deletions server/src/data/addMedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,13 @@ const { MediaTypes } = require('../enums')
const paramSchema = joi
.object()
.keys({
userId: joi
.string()
.uuid()
.required(),
userId: joi.string().uuid().required(),
mediaType: joi
.number()
.required()
.valid(...MediaTypes),
fileName: joi
.string()
.required()
.max(255),
mime: joi
.string()
.required()
.max(255),
fileName: joi.string().required().max(255),
mime: joi.string().required().max(255),
})
.options({ allowUnknown: true })

Expand Down Expand Up @@ -60,7 +51,7 @@ const addMedia = async (params, knex) => {
.where('mime', mime)

if (!mediaTypes || mediaTypes.length === 0) {
const [id] = await knex('media_type')
const [{ id }] = await knex('media_type')
.insert({
mime,
})
Expand All @@ -83,9 +74,7 @@ const addMedia = async (params, knex) => {
created_by_user_id: userId,
}

const [id] = await knex('media')
.insert(insertData)
.returning('id')
const [{ id }] = await knex('media').insert(insertData).returning('id')

return { id }
} catch (err) {
Expand Down
4 changes: 2 additions & 2 deletions server/src/data/createApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const createApp = async (params, knex) => {
//generate a new uuid to insert

try {
const [id] = await knex('app')
const [result] = await knex('app')
.insert({
created_at: knex.fn.now(),
created_by_user_id: userId,
Expand All @@ -57,7 +57,7 @@ const createApp = async (params, knex) => {
})
.returning('id')

return { id }
return result
} catch (err) {
throw new Error(`Could not insert app to database. ${err.message}`)
}
Expand Down
2 changes: 1 addition & 1 deletion server/src/data/createAppStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const createAppStatus = async (params, knex) => {
throw new Error(`Invalid appId, app does not exist.`)
}

const [id] = await knex('app_status')
const [{ id }] = await knex('app_status')
.insert({
created_at: knex.fn.now(),
created_by_user_id: userId,
Expand Down
22 changes: 5 additions & 17 deletions server/src/data/createAppVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,10 @@ const appExists = require('./appExists')
const paramsSchema = joi
.object()
.keys({
userId: joi
.string()
.uuid()
.required(),
appId: joi
.string()
.uuid()
.required(),
demoUrl: joi
.string()
.uri()
.allow('', null),
sourceUrl: joi
.string()
.uri()
.allow('', null),
userId: joi.string().uuid().required(),
appId: joi.string().uuid().required(),
demoUrl: joi.string().uri().allow('', null),
sourceUrl: joi.string().uri().allow('', null),
version: joi.string().allow(''),
})
.options({ allowUnknown: true })
Expand Down Expand Up @@ -61,7 +49,7 @@ const createAppVersion = async (params, knex) => {
throw new Error(`Invalid appId, app does not exist.`)
}

const [id] = await knex('app_version')
const [{ id }] = await knex('app_version')
.insert({
app_id: appId,
created_at: knex.fn.now(),
Expand Down
2 changes: 1 addition & 1 deletion server/src/data/createLocalizedAppVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const createLocalizedAppVersion = async (params, knex) => {
//TODO: add validation of params with joi
const { userId, appVersionId, description, name, languageCode } = params
try {
const [id] = await knex('app_version_localised')
const [{ id }] = await knex('app_version_localised')
.insert({
app_version_id: appVersionId,
created_at: knex.fn.now(),
Expand Down
7 changes: 2 additions & 5 deletions server/src/data/createOrganisation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ const { ensureUniqueSlug } = require('../services/organisation')

const paramsSchema = joi.object().keys({
userId: joi.string().uuid(),
name: joi
.string()
.min(1)
.max(100),
name: joi.string().min(1).max(100),
})

/**
Expand Down Expand Up @@ -43,7 +40,7 @@ const createOrganisation = async (params, knex) => {
const slug = await ensureUniqueSlug(originalSlug, knex)

try {
const [id] = await knex('organisation')
const [{ id }] = await knex('organisation')
.insert({
created_at: knex.fn.now(),
created_by_user_id: userId,
Expand Down
7 changes: 2 additions & 5 deletions server/src/data/createUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ const joi = require('joi')
const paramsSchema = joi
.object()
.keys({
email: joi
.string()
.email()
.required(),
email: joi.string().email().required(),
name: joi.string(),
})
.options({ allowUnknown: true })
Expand Down Expand Up @@ -42,7 +39,7 @@ const createUser = async (params, knex) => {
const { email, name } = params

try {
const [id] = await knex
const [{ id }] = await knex
.insert({
email,
name,
Expand Down
Loading

0 comments on commit c6bfa3e

Please sign in to comment.