diff --git a/.circleci/config.yml b/.circleci/config.yml index 841d3910..59cd7236 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -83,7 +83,7 @@ workflows: branches: only: - dev - - fix/template + - fix/schema - "build-qa": context: org-global diff --git a/README.md b/README.md index 99e51234..7ecd2b8b 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,13 @@ # Topcoder Challenge API This microservice provides access and interaction with all sorts of Challenge data. + ## Devlopment status + [![Total alerts](https://img.shields.io/lgtm/alerts/g/topcoder-platform/challenge-api.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/topcoder-platform/challenge-api/alerts/)[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/topcoder-platform/challenge-api.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/topcoder-platform/challenge-api/context:javascript) ### Deployment status + Dev: [![CircleCI](https://circleci.com/gh/topcoder-platform/challenge-api/tree/develop.svg?style=svg)](https://circleci.com/gh/topcoder-platform/challenge-api/tree/develop) Prod: [![CircleCI](https://circleci.com/gh/topcoder-platform/challenge-api/tree/master.svg?style=svg)](https://circleci.com/gh/topcoder-platform/challenge-api/tree/master) ## Swagger definition @@ -12,6 +15,7 @@ Dev: [![CircleCI](https://circleci.com/gh/topcoder-platform/challenge-api/tree/d - [Swagger](https://api.topcoder.com/v5/challenges/docs/) ## Intended use + - Production API ## Related repos @@ -23,8 +27,8 @@ Dev: [![CircleCI](https://circleci.com/gh/topcoder-platform/challenge-api/tree/d - [Frontend App](https://github.com/topcoder-platform/challenge-engine-ui) ## Prerequisites + - [NodeJS](https://nodejs.org/en/) (v10) -- [DynamoDB](https://aws.amazon.com/dynamodb/) - [AWS S3](https://aws.amazon.com/s3/) - [Elasticsearch v6](https://www.elastic.co/) - [Docker](https://www.docker.com/) @@ -74,6 +78,7 @@ The following parameters can be set in config files or in env variables: You can find sample `.env` files inside the `/docs` directory. ## Available commands + 1. Drop/delete tables: `npm run drop-tables` 2. Creating tables: `npm run create-tables` 3. Seed/Insert data to tables: `npm run seed-tables` @@ -87,11 +92,12 @@ You can find sample `.env` files inside the `/docs` directory. 11. Initialize the local environments: `npm run local:init` 12. Reset the local environments: `npm run local:reset` - ### Notes + - The seed data are located in `src/scripts/seed` ## Local Deployment + 0. Make sure to use Node v10+ by command `node -v`. We recommend using [NVM](https://github.com/nvm-sh/nvm) to quickly switch to the right version: ```bash @@ -104,31 +110,33 @@ You can find sample `.env` files inside the `/docs` directory. yarn install ``` -2. ⚙ Local config - In the `challenge-api` root directory create `.env` file with the next environment variables. Values for **Auth0 config** should be shared with you on the forum.
- ```bash - # Auth0 config - AUTH0_URL= - AUTH0_PROXY_SERVER_URL= - AUTH0_AUDIENCE= - AUTH0_CLIENT_ID= - AUTH0_CLIENT_SECRET= +2. ⚙ Local config + In the `challenge-api` root directory create `.env` file with the next environment variables. Values for **Auth0 config** should be shared with you on the forum.
- # Locally deployed services (via docker-compose) - IS_LOCAL_DB=true - DYNAMODB_URL=http://localhost:8000 - ``` + ```bash + # Auth0 config + AUTH0_URL= + AUTH0_PROXY_SERVER_URL= + AUTH0_AUDIENCE= + AUTH0_CLIENT_ID= + AUTH0_CLIENT_SECRET= + + # Locally deployed services (via docker-compose) + IS_LOCAL_DB=true + DYNAMODB_URL=http://localhost:8000 + ``` - - Values from this file would be automatically used by many `npm` commands. - - ⚠️ Never commit this file or its copy to the repository! + - Values from this file would be automatically used by many `npm` commands. + - ⚠️ Never commit this file or its copy to the repository! 3. 🚢 Start docker-compose with services which are required to start Topcoder Challenges API locally ```bash npm run services:up ``` - + 4. ♻ Update following two parts: + - https://github.com/topcoder-platform/challenge-api/blob/develop/src/models/Challenge.js#L116 `throughput: 'ON_DEMAND',` should be updated to `throughput:{ read: 4, write: 2 },` - https://github.com/topcoder-platform/challenge-api/blob/develop/config/default.js#L27-L28 @@ -147,15 +155,17 @@ You can find sample `.env` files inside the `/docs` directory. ``` This command will do 3 things: - - create Elasticsearch indexes (drop if exists) - - Initialize the database by cleaning all the records. - - Import the data to the local database and index it to ElasticSearch + +- create Elasticsearch indexes (drop if exists) +- Initialize the database by cleaning all the records. +- Import the data to the local database and index it to ElasticSearch 7. 🚀 Start Topcoder Challenge API ```bash npm start ``` + The Topcoder Challenge API will be served on `http://localhost:3000` ## Production deployment @@ -180,6 +190,7 @@ The following test parameters can be set in config file or in env variables: - S3_ENDPOINT: endpoint of AWS S3 API, for unit and e2e test only; default to `localhost:9000` ### Prepare + - Start Local services in docker. - Create DynamoDB tables. - Initialize ES index. @@ -188,6 +199,7 @@ The following test parameters can be set in config file or in env variables: Seeding db data is not needed. ### Running unit tests + To run unit tests alone ```bash @@ -201,6 +213,7 @@ npm run test:cov ``` ### Running integration tests + To run integration tests alone ```bash @@ -214,6 +227,7 @@ npm run e2e:cov ``` ## Verification + Refer to the verification document `Verification.md` ## Notes diff --git a/package.json b/package.json index 0f56204a..7bb22c6c 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,8 @@ "dependencies": { "@grpc/grpc-js": "^1.8.12", "@opensearch-project/opensearch": "^2.2.0", - "@topcoder-framework/domain-challenge": "^0.10.13", - "@topcoder-framework/lib-common": "^0.10.13", + "@topcoder-framework/domain-challenge": "^0.10.14", + "@topcoder-framework/lib-common": "^0.10.14", "aws-sdk": "^2.1145.0", "axios": "^0.19.0", "axios-retry": "^3.4.0", @@ -53,7 +53,6 @@ "cors": "^2.7.1", "deep-equal": "^2.2.0", "dotenv": "^8.2.0", - "dynamoose": "^1.11.1", "elasticsearch": "^16.7.3", "express": "^4.15.4", "express-fileupload": "^1.1.6", diff --git a/src/common/challenge-helper.js b/src/common/challenge-helper.js index 7fcb248d..ce13b8f3 100644 --- a/src/common/challenge-helper.js +++ b/src/common/challenge-helper.js @@ -365,7 +365,7 @@ class ChallengeHelper { } }); }); - if (overview && overview.totalPrizesInCents) { + if (overview && !_.isUndefined(overview.totalPrizesInCents)) { overview.totalPrizes = overview.totalPrizesInCents / 100; delete overview.totalPrizesInCents; } diff --git a/src/common/helper.js b/src/common/helper.js index 9c18e4fd..33044085 100644 --- a/src/common/helper.js +++ b/src/common/helper.js @@ -5,7 +5,6 @@ const Joi = require("joi"); const _ = require("lodash"); const querystring = require("querystring"); const constants = require("../../app-constants"); -const models = require("../models"); const errors = require("./errors"); const util = require("util"); const AWS = require("aws-sdk"); @@ -184,155 +183,6 @@ function checkIfExists(source, term) { return false; } -/** - * Get Data by model id - * @param {String} modelName The dynamoose model name - * @param {String} id The id value - * @returns {Promise} - */ -async function getById(modelName, id) { - return new Promise((resolve, reject) => { - models[modelName] - .query("id") - .eq(id) - .exec((err, result) => { - if (err) { - return reject(err); - } - if (result.length > 0) { - return resolve(result[0]); - } else { - return reject(new errors.NotFoundError(`${modelName} with id: ${id} doesn't exist`)); - } - }); - }); -} - -/** - * Get Data by model ids - * @param {String} modelName The dynamoose model name - * @param {Array} ids The ids - * @returns {Promise} the found entities - */ -async function getByIds(modelName, ids) { - const entities = []; - const theIds = ids || []; - for (const id of theIds) { - entities.push(await getById(modelName, id)); - } - return entities; -} - -/** - * Validate the data to ensure no duplication - * @param {Object} modelName The dynamoose model name - * @param {String} name The attribute name of dynamoose model - * @param {String} value The attribute value to be validated - * @returns {Promise} - */ -async function validateDuplicate(modelName, name, value) { - const list = await scan(modelName); - for (let i = 0; i < list.length; i++) { - if (list[i][name] && String(list[i][name]).toLowerCase() === String(value).toLowerCase()) { - throw new errors.ConflictError(`${modelName} with ${name}: ${value} already exist`); - } - } -} - -/** - * Create item in database - * @param {Object} modelName The dynamoose model name - * @param {Object} data The create data object - * @returns {Promise} - */ -async function create(modelName, data) { - return new Promise((resolve, reject) => { - const dbItem = new models[modelName](data); - dbItem.save((err) => { - if (err) { - return reject(err); - } else { - return resolve(dbItem); - } - }); - }); -} - -/** - * Update item in database - * @param {Object} dbItem The Dynamo database item - * @param {Object} data The updated data object - * @returns {Promise} - */ -async function update(dbItem, data) { - Object.keys(data).forEach((key) => { - dbItem[key] = data[key]; - }); - return new Promise((resolve, reject) => { - dbItem.save((err) => { - if (err) { - return reject(err); - } else { - return resolve(dbItem); - } - }); - }); -} - -/** - * Get data collection by scan parameters - * @param {Object} modelName The dynamoose model name - * @param {Object} scanParams The scan parameters object - * @returns {Promise} - */ -async function scan(modelName, scanParams) { - return new Promise((resolve, reject) => { - models[modelName].scan(scanParams).exec((err, result) => { - if (err) { - return reject(err); - } else { - return resolve(result.count === 0 ? [] : result); - } - }); - }); -} - -/** - * Get all data collection (avoid default page limit of DynamoDB) by scan parameters - * @param {Object} modelName The dynamoose model name - * @param {Object} scanParams The scan parameters object - * @returns {Array} - */ -async function scanAll(modelName, scanParams) { - let results = await models[modelName].scan(scanParams).exec(); - let lastKey = results.lastKey; - while (!_.isUndefined(results.lastKey)) { - const newResult = await models[modelName].scan(scanParams).startAt(lastKey).exec(); - results = [...results, ...newResult]; - lastKey = newResult.lastKey; - } - return results; -} - -/** - * Test whether the given value is partially match the filter. - * @param {String} filter the filter - * @param {String} value the value to test - * @returns {Boolean} the match result - */ -function partialMatch(filter, value) { - if (filter) { - if (value) { - const filtered = xss(filter); - return _.toLower(value).includes(_.toLower(filtered)); - } else { - return false; - } - } else { - return true; - } -} - /** * Download file from S3 * @param {String} bucket the bucket name @@ -1322,14 +1172,6 @@ module.exports = { setResHeaders, checkIfExists, toString, - getById, - getByIds, - create, - update, - scan, - scanAll, - validateDuplicate, - partialMatch, downloadFromFileStack, downloadFromS3, deleteFromS3, diff --git a/src/models/Attachment.js b/src/models/Attachment.js deleted file mode 100644 index fa89cb74..00000000 --- a/src/models/Attachment.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * This defines Attachment model. - */ - -const dynamoose = require("dynamoose"); - -const Schema = dynamoose.Schema; - -const schema = new Schema( - { - id: { - type: String, - hashKey: true, - required: true, - }, - url: { - type: String, - required: true, - }, - fileSize: { - type: Number, - required: true, - }, - name: { - type: String, - required: true, - }, - challengeId: { - type: String, - required: true, - }, - description: { - type: String, - }, - }, - { - throughput: { read: 4, write: 2 }, - } -); - -module.exports = schema; diff --git a/src/models/AuditLog.js b/src/models/AuditLog.js deleted file mode 100644 index 48e884a4..00000000 --- a/src/models/AuditLog.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * This defines AuditLog model. - */ - -const dynamoose = require("dynamoose"); - -const Schema = dynamoose.Schema; - -const schema = new Schema( - { - id: { - type: String, - hashKey: true, - required: true, - }, - challengeId: { - type: String, - required: true, - }, - fieldName: { - type: String, - required: true, - }, - oldValue: { - type: String, - required: true, - }, - newValue: { - type: String, - required: true, - }, - created: { - type: Date, - required: true, - }, - createdBy: { - type: String, - required: true, - }, - memberId: { - type: String, - }, - }, - { - throughput: { read: 4, write: 2 }, - } -); - -module.exports = schema; diff --git a/src/models/Challenge.js b/src/models/Challenge.js deleted file mode 100644 index 326d2dce..00000000 --- a/src/models/Challenge.js +++ /dev/null @@ -1,147 +0,0 @@ -/** - * This defines Challenge model. - */ - -const dynamoose = require("dynamoose"); - -const Schema = dynamoose.Schema; - -const schema = new Schema( - { - id: { - type: String, - hashKey: true, - required: true, - }, - legacyId: { - type: Number, - required: false, - }, - typeId: { - type: String, - required: true, - }, - trackId: { - type: String, - required: true, - }, - legacy: { - type: Object, - required: false, - }, - billing: { - type: Object, - required: false, - }, - name: { - type: String, - required: true, - }, - description: { - type: String, - required: false, - }, - privateDescription: { - type: String, - required: false, - }, - descriptionFormat: { - type: String, - default: "HTML", - required: true, - }, - metadata: { - type: [Object], - required: false, - }, - task: { - type: Object, - required: false, - }, - timelineTemplateId: { - type: String, - required: false, - }, - phases: { - type: Array, - required: false, - }, - events: { - type: [Object], - required: false, - }, - terms: { - type: Array, - required: false, - }, - prizeSets: { - type: [Object], - required: false, - }, - // tag names - tags: { - type: Array, - required: false, - }, - projectId: { - type: Number, - required: false, - }, - startDate: { - type: Date, - required: false, - }, - endDate: { - type: Date, - required: false, - }, - status: { - type: String, - required: true, - }, - attachments: { - type: Array, - required: false, - }, - // group names - groups: { - type: Array, - required: false, - }, - // winners - winners: { - type: Array, - required: false, - }, - discussions: { - type: [Object], - required: false, - }, - overview: { - type: Object, - }, - created: { - type: Date, - required: true, - }, - createdBy: { - type: String, - required: true, - }, - updated: { - type: Date, - required: false, - }, - updatedBy: { - type: String, - required: false, - }, - }, - { - // throughput: { read: 4, write: 2 }, - throughput: "ON_DEMAND", - useDocumentTypes: true, - } -); - -module.exports = schema; diff --git a/src/models/ChallengeTimelineTemplate.js b/src/models/ChallengeTimelineTemplate.js deleted file mode 100644 index 7637b489..00000000 --- a/src/models/ChallengeTimelineTemplate.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This defines ChallengeType-TimelineTemplate mapping model. - */ - -const dynamoose = require("dynamoose"); - -const Schema = dynamoose.Schema; - -const schema = new Schema( - { - id: { - type: String, - hashKey: true, - required: true, - }, - trackId: { - type: String, - required: true, - }, - typeId: { - type: String, - required: true, - }, - timelineTemplateId: { - type: String, - required: true, - }, - isDefault: { - type: Boolean, - required: false, - }, - }, - { - throughput: { read: 4, write: 2 }, - } -); - -module.exports = schema; diff --git a/src/models/ChallengeTrack.js b/src/models/ChallengeTrack.js deleted file mode 100644 index 7decc695..00000000 --- a/src/models/ChallengeTrack.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This defines ChallengeTrack model. - */ - -const dynamoose = require("dynamoose"); - -const Schema = dynamoose.Schema; - -const schema = new Schema( - { - id: { - type: String, - hashKey: true, - required: true, - }, - name: { - type: String, - required: true, - }, - description: { - type: String, - required: false, - }, - isActive: { - type: Boolean, - required: true, - }, - abbreviation: { - type: String, - required: true, - }, - }, - { - throughput: { read: 4, write: 2 }, - } -); - -module.exports = schema; diff --git a/src/models/ChallengeType.js b/src/models/ChallengeType.js deleted file mode 100644 index 16917e0b..00000000 --- a/src/models/ChallengeType.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This defines ChallengeType model. - */ - -const dynamoose = require("dynamoose"); - -const Schema = dynamoose.Schema; - -const schema = new Schema( - { - id: { - type: String, - hashKey: true, - required: true, - }, - name: { - type: String, - required: true, - }, - description: { - type: String, - required: false, - }, - isActive: { - type: Boolean, - required: true, - }, - isTask: { - type: Boolean, - default: false, - }, - abbreviation: { - type: String, - required: true, - }, - }, - { - throughput: { read: 4, write: 2 }, - } -); - -module.exports = schema; diff --git a/src/models/Phase.js b/src/models/Phase.js deleted file mode 100644 index c0974ba3..00000000 --- a/src/models/Phase.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * This defines Phase model. - */ - -const dynamoose = require("dynamoose"); - -const Schema = dynamoose.Schema; - -const schema = new Schema( - { - id: { - type: String, - hashKey: true, - required: true, - }, - name: { - type: String, - required: true, - }, - description: { - type: String, - required: false, - }, - isOpen: { - type: Boolean, - required: true, - }, - duration: { - type: Number, - required: true, - }, - }, - { - throughput: "ON_DEMAND", - // throughput: { read: 4, write: 2 } - } -); - -module.exports = schema; diff --git a/src/models/TimelineTemplate.js b/src/models/TimelineTemplate.js deleted file mode 100644 index 157297ef..00000000 --- a/src/models/TimelineTemplate.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This defines TimelineTemplate model. - */ - -const dynamoose = require("dynamoose"); - -const Schema = dynamoose.Schema; - -const schema = new Schema( - { - id: { - type: String, - hashKey: true, - required: true, - }, - name: { - type: String, - required: true, - }, - description: { - type: String, - required: false, - }, - isActive: { - type: Boolean, - required: true, - }, - phases: { - type: Array, - required: true, - }, - }, - { - throughput: { read: 4, write: 2 }, - } -); - -module.exports = schema; diff --git a/src/models/index.js b/src/models/index.js deleted file mode 100644 index 489c0527..00000000 --- a/src/models/index.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Initialize and export all model schemas. - */ - -const config = require("config"); -const dynamoose = require("dynamoose"); - -const awsConfigs = config.AMAZON.IS_LOCAL_DB - ? { - accessKeyId: config.AMAZON.AWS_ACCESS_KEY_ID, - secretAccessKey: config.AMAZON.AWS_SECRET_ACCESS_KEY, - region: config.AMAZON.AWS_REGION, - } - : { - region: config.AMAZON.AWS_REGION, - }; - -dynamoose.AWS.config.update(awsConfigs); - -if (config.AMAZON.IS_LOCAL_DB) { - dynamoose.local(config.AMAZON.DYNAMODB_URL); -} - -// console.log(config.AMAZON.IS_LOCAL_DB, config.AMAZON.AWS_ACCESS_KEY_ID, config.AMAZON.AWS_SECRET_ACCESS_KEY) -// console.log(JSON.stringify(dynamoose.AWS.config)) - -dynamoose.setDefaults({ - create: false, - update: false, - waitForActive: false, -}); - -module.exports = { - Challenge: dynamoose.model("Challenge", require("./Challenge")), - ChallengeType: dynamoose.model("ChallengeType", require("./ChallengeType")), - ChallengeTrack: dynamoose.model( - "ChallengeTrack", - require("./ChallengeTrack") - ), - ChallengeTimelineTemplate: dynamoose.model( - "ChallengeTimelineTemplate", - require("./ChallengeTimelineTemplate") - ), - AuditLog: dynamoose.model("AuditLog", require("./AuditLog")), - Phase: dynamoose.model("Phase", require("./Phase")), - TimelineTemplate: dynamoose.model( - "TimelineTemplate", - require("./TimelineTemplate") - ), - Attachment: dynamoose.model("Attachment", require("./Attachment")), -}; diff --git a/src/services/ChallengeService.js b/src/services/ChallengeService.js index bd94144c..f593b684 100644 --- a/src/services/ChallengeService.js +++ b/src/services/ChallengeService.js @@ -42,7 +42,6 @@ const { convertToISOString, } = require("../common/challenge-helper"); const deepEqual = require("deep-equal"); -const { cloneDeep } = require("lodash"); const challengeDomain = new ChallengeDomain(GRPC_CHALLENGE_SERVER_HOST, GRPC_CHALLENGE_SERVER_PORT); @@ -1253,20 +1252,6 @@ async function getChallenge(currentUser, id, checkIfExists) { } await helper.ensureUserCanViewChallenge(currentUser, challenge); - // // FIXME: Temporarily hard coded as the migrad - // // populate type property based on the typeId - // if (challenge.typeId) { - // try { - // const type = await helper.getById('ChallengeType', challenge.typeId) - // challenge.type = type.name - // } catch (e) { - // challenge.typeId = '45415132-79fa-4d13-a9ac-71f50020dc10' // TODO Fix HardCode - // const type = await helper.getById('ChallengeType', challenge.typeId) - // challenge.type = type.name - // } - // } - // delete challenge.typeId - // Remove privateDescription for unregistered users if (currentUser) { if (!currentUser.isMachine && !hasAdminRole(currentUser)) { @@ -1424,6 +1409,7 @@ async function validateWinners(winners, challengeId) { */ async function updateChallenge(currentUser, challengeId, data) { const challenge = await challengeDomain.lookup(getLookupCriteria("id", challengeId)); + convertPrizeSetValuesToDollars(challenge.prizeSets, challenge.overview); const projectId = _.get(challenge, "projectId"); @@ -1436,7 +1422,7 @@ async function updateChallenge(currentUser, challengeId, data) { // Make sure the user cannot change the direct project ID if (data.legacy) { - data.legacy = _.assign({},challenge.legacy, data.legacy) + data.legacy = _.assign({}, challenge.legacy, data.legacy); _.set(data, "legacy.directProjectId", challenge.legacy.directProjectId); } @@ -1562,17 +1548,22 @@ async function updateChallenge(currentUser, challengeId, data) { } } - if (_.includes([ - constants.challengeStatuses.Cancelled, - constants.challengeStatuses.CancelledRequirementsInfeasible, - constants.challengeStatuses.CancelledPaymentFailed, - constants.challengeStatuses.CancelledFailedReview, - constants.challengeStatuses.CancelledFailedScreening, - constants.challengeStatuses.CancelledZeroSubmissions, - constants.challengeStatuses.CancelledWinnerUnresponsive, - constants.challengeStatuses.CancelledClientRequest, - constants.challengeStatuses.CancelledZeroRegistrations, - ], data.status)) { + if ( + _.includes( + [ + constants.challengeStatuses.Cancelled, + constants.challengeStatuses.CancelledRequirementsInfeasible, + constants.challengeStatuses.CancelledPaymentFailed, + constants.challengeStatuses.CancelledFailedReview, + constants.challengeStatuses.CancelledFailedScreening, + constants.challengeStatuses.CancelledZeroSubmissions, + constants.challengeStatuses.CancelledWinnerUnresponsive, + constants.challengeStatuses.CancelledClientRequest, + constants.challengeStatuses.CancelledZeroRegistrations, + ], + data.status + ) + ) { isChallengeBeingCancelled = true; } @@ -1641,7 +1632,7 @@ async function updateChallenge(currentUser, challengeId, data) { timelineTemplateChanged = true; } - if (data.prizeSets && data.prizeSets.length > 0) { + if (data.prizeSets) { if ( isDifferentPrizeSets(data.prizeSets, challenge.prizeSets) && finalStatus === constants.challengeStatuses.Completed @@ -1651,17 +1642,10 @@ async function updateChallenge(currentUser, challengeId, data) { ); } const prizeSetsGroup = _.groupBy(data.prizeSets, "type"); - if ( - !prizeSetsGroup[constants.prizeSetTypes.ChallengePrizes] && - _.get(challenge, "overview.totalPrizes") - ) { - // remove the totalPrizes if challenge prizes are empty - data.overview = challenge.overview = _.omit(challenge.overview, ["totalPrizes"]); - } else { + if (prizeSetsGroup[constants.prizeSetTypes.ChallengePrizes]) { const totalPrizes = helper.sumOfPrizes( prizeSetsGroup[constants.prizeSetTypes.ChallengePrizes][0].prizes ); - _.assign(challenge, { overview: { totalPrizes } }); _.assign(data, { overview: { totalPrizes } }); } } @@ -1669,8 +1653,9 @@ async function updateChallenge(currentUser, challengeId, data) { let phasesUpdated = false; if ( ((data.phases && data.phases.length > 0) || - isChallengeBeingActivated || - timelineTemplateChanged) && !isChallengeBeingCancelled + isChallengeBeingActivated || + timelineTemplateChanged) && + !isChallengeBeingCancelled ) { if ( challenge.status === constants.challengeStatuses.Completed || @@ -1804,7 +1789,7 @@ async function updateChallenge(currentUser, challengeId, data) { } try { - const updateInput = sanitizeRepeatedFieldsInUpdateRequest(_.omit(data, ['cancelReason'])); + const updateInput = sanitizeRepeatedFieldsInUpdateRequest(_.omit(data, ["cancelReason"])); if (!_.isEmpty(updateInput)) { const grpcMetadata = new GrpcMetadata(); @@ -1917,7 +1902,10 @@ updateChallenge.schema = { .valid(_.values(constants.reviewTypes)) .insensitive() .default(constants.reviewTypes.Internal), - confidentialityType: Joi.string().allow(null,'').empty(null,'').default(config.DEFAULT_CONFIDENTIALITY_TYPE), + confidentialityType: Joi.string() + .allow(null, "") + .empty(null, "") + .default(config.DEFAULT_CONFIDENTIALITY_TYPE), directProjectId: Joi.number(), forumId: Joi.number().integer(), isTask: Joi.boolean(), @@ -2218,12 +2206,16 @@ async function deleteChallenge(currentUser, challengeId) { }); const challenge = _.first(items); if (!challenge) { - throw new errors.NotFoundError(`Challenge with id: ${challengeId} doesn't exist or is not in New status`); + throw new errors.NotFoundError( + `Challenge with id: ${challengeId} doesn't exist or is not in New status` + ); } // ensure user can modify challenge await helper.ensureUserCanModifyChallenge(currentUser, challenge); // delete DB record - const { items: deletedItems } = await challengeDomain.delete(getLookupCriteria("id", challengeId)); + const { items: deletedItems } = await challengeDomain.delete( + getLookupCriteria("id", challengeId) + ); if (!_.find(deletedItems, { id: challengeId })) { throw new errors.Internal(`There was an error deleting the challenge with id: ${challengeId}`); } diff --git a/src/services/TimelineTemplateService.js b/src/services/TimelineTemplateService.js index ecb56894..a58b5a97 100644 --- a/src/services/TimelineTemplateService.js +++ b/src/services/TimelineTemplateService.js @@ -60,9 +60,6 @@ searchTimelineTemplates.schema = { * @returns {Object} the created timeline template */ async function createTimelineTemplate(timelineTemplate) { - // await helper.validateDuplicate('TimelineTemplate', 'name', timelineTemplate.name) - // await phaseHelper.validatePhases(timelineTemplate.phases) - const scanCriteria = getScanCriteria({ name: timelineTemplate.name, }); diff --git a/yarn.lock b/yarn.lock index 938144b1..7d7fd30d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,19 +2,19 @@ # yarn lockfile v1 -"@babel/code-frame@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" - integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== +"@babel/code-frame@^7.18.6", "@babel/code-frame@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.21.4.tgz#d0fa9e4413aca81f2b23b9442797bda1826edb39" + integrity sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g== dependencies: "@babel/highlight" "^7.18.6" -"@babel/generator@^7.21.3", "@babel/generator@^7.4.0": - version "7.21.3" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.21.3.tgz#232359d0874b392df04045d72ce2fd9bb5045fce" - integrity sha512-QS3iR1GYC/YGUnW7IdggFeN5c1poPUurnGttOV/bZgPGV+izC/D8HnD6DLwod0fsatNyVn1G3EVWMYIF0nHbeA== +"@babel/generator@^7.21.4", "@babel/generator@^7.4.0": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.21.4.tgz#64a94b7448989f421f919d5239ef553b37bb26bc" + integrity sha512-NieM3pVIYW2SwGzKoqfPrQsf4xGs9M9AIG3ThppsSRmO+m7eQhmI6amajKMUeIO37wFfsvnvcxQFx6x6iqxDnA== dependencies: - "@babel/types" "^7.21.3" + "@babel/types" "^7.21.4" "@jridgewell/gen-mapping" "^0.3.2" "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" @@ -65,10 +65,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.20.7", "@babel/parser@^7.21.3", "@babel/parser@^7.4.3": - version "7.21.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.3.tgz#1d285d67a19162ff9daa358d4cb41d50c06220b3" - integrity sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ== +"@babel/parser@^7.20.7", "@babel/parser@^7.21.4", "@babel/parser@^7.4.3": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.4.tgz#94003fdfc520bbe2875d4ae557b43ddb6d880f17" + integrity sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw== "@babel/runtime@^7.15.4": version "7.21.0" @@ -87,25 +87,25 @@ "@babel/types" "^7.20.7" "@babel/traverse@^7.4.3": - version "7.21.3" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.21.3.tgz#4747c5e7903d224be71f90788b06798331896f67" - integrity sha512-XLyopNeaTancVitYZe2MlUEvgKb6YVVPXzofHgqHijCImG33b/uTurMS488ht/Hbsb2XK3U2BnSTxKVNGV3nGQ== + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.21.4.tgz#a836aca7b116634e97a6ed99976236b3282c9d36" + integrity sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q== dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.21.3" + "@babel/code-frame" "^7.21.4" + "@babel/generator" "^7.21.4" "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-function-name" "^7.21.0" "@babel/helper-hoist-variables" "^7.18.6" "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.21.3" - "@babel/types" "^7.21.3" + "@babel/parser" "^7.21.4" + "@babel/types" "^7.21.4" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.18.6", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.3", "@babel/types@^7.4.0": - version "7.21.3" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.3.tgz#4865a5357ce40f64e3400b0f3b737dc6d4f64d05" - integrity sha512-sBGdETxC+/M4o/zKC0sl6sjWv62WFR/uzxrJ6uYyMLZOUlPnwzw0tKgVHOXxaAd5l2g8pEDM5RZ495GPQI77kg== +"@babel/types@^7.18.6", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.4", "@babel/types@^7.4.0": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.4.tgz#2d5d6bb7908699b3b416409ffd3b5daa25b030d4" + integrity sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA== dependencies: "@babel/helper-string-parser" "^7.19.4" "@babel/helper-validator-identifier" "^7.19.1" @@ -245,35 +245,35 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== -"@topcoder-framework/client-relational@^0.10.13": - version "0.10.13" - resolved "https://topcoder-409275337247.d.codeartifact.us-east-1.amazonaws.com:443/npm/topcoder-framework/@topcoder-framework/client-relational/-/client-relational-0.10.13.tgz#84293cd265328d5f770c28ffd690fbb434ac936b" - integrity sha512-p4ygOE0K2xrz/wmTSS5/3DX2lEH/bmiWsW+sL8RVstAhilWSQmdyJb49sI/QzbFqhHGS/aQnkKPt8gaNtIaVWQ== +"@topcoder-framework/client-relational@^0.10.14": + version "0.10.14" + resolved "https://topcoder-409275337247.d.codeartifact.us-east-1.amazonaws.com:443/npm/topcoder-framework/@topcoder-framework/client-relational/-/client-relational-0.10.14.tgz#679a07e1efafe5c54ef7e071437b4a1ec0591143" + integrity sha512-SeS9qw20DpYWSGiSghChu/jJij4NBOwf0RHwUOU5hoojOxNO8edisjv1Tfs7e2p7QO6XPt6XBjJUHn/xZwKtmw== dependencies: "@grpc/grpc-js" "^1.8.0" - "@topcoder-framework/lib-common" "^0.10.13" - topcoder-interface "github:topcoder-platform/plat-interface-definition#v0.0.46" + "@topcoder-framework/lib-common" "^0.10.14" + topcoder-interface "github:topcoder-platform/plat-interface-definition#v0.0.47" tslib "^2.4.1" -"@topcoder-framework/domain-challenge@^0.10.13": - version "0.10.13" - resolved "https://topcoder-409275337247.d.codeartifact.us-east-1.amazonaws.com:443/npm/topcoder-framework/@topcoder-framework/domain-challenge/-/domain-challenge-0.10.13.tgz#dede4cd01054e56eb4e4486eeb99cfd9ab4d75f1" - integrity sha512-srkncIcHaD1aGYD6DSHGzZDORjPZkTN9qNgZSNNYXx3Q6pNc4z3dUQqv79bEv472af4zkXmemMcmHqPTRilVtQ== +"@topcoder-framework/domain-challenge@^0.10.14": + version "0.10.14" + resolved "https://topcoder-409275337247.d.codeartifact.us-east-1.amazonaws.com:443/npm/topcoder-framework/@topcoder-framework/domain-challenge/-/domain-challenge-0.10.14.tgz#bede94b891c75b27ec361706eefe3910ea71852c" + integrity sha512-X+iFxUTD8dsuX4jJU8ZerRrgQE67Bfi8USytYKK2gXDzHITd+pDfaQ+l4NU2AU9lO5plUJbr/DGG/ZWFWIlikw== dependencies: "@grpc/grpc-js" "^1.8.0" - "@topcoder-framework/client-relational" "^0.10.13" - "@topcoder-framework/lib-common" "^0.10.13" - topcoder-interface "github:topcoder-platform/plat-interface-definition#v0.0.46" + "@topcoder-framework/client-relational" "^0.10.14" + "@topcoder-framework/lib-common" "^0.10.14" + topcoder-interface "github:topcoder-platform/plat-interface-definition#v0.0.47" tslib "^2.4.1" -"@topcoder-framework/lib-common@^0.10.13": - version "0.10.13" - resolved "https://topcoder-409275337247.d.codeartifact.us-east-1.amazonaws.com:443/npm/topcoder-framework/@topcoder-framework/lib-common/-/lib-common-0.10.13.tgz#69a0c70d601cc37821ece1b13d300dbe8e6ddc10" - integrity sha512-LXaoLQma+7cs7ly6McXmhO3YWNF27MzqiR3fgtlefVU1XbfVfWhSfDLitTUSw08PMgv+VC6nTfyo0t4202ZVcg== +"@topcoder-framework/lib-common@^0.10.14": + version "0.10.14" + resolved "https://topcoder-409275337247.d.codeartifact.us-east-1.amazonaws.com:443/npm/topcoder-framework/@topcoder-framework/lib-common/-/lib-common-0.10.14.tgz#30476d42d5d3f7de2c1054d375c2afc16e5d63e3" + integrity sha512-+maM4vvx4iJU40FjlZvkHRbOI5C73GkFQrj8UYBX2tsKFYdVe7x/DZ51cV/ehBv0NIDZIBKMj1OSgpVYF9RCBg== dependencies: "@grpc/grpc-js" "^1.8.0" rimraf "^3.0.2" - topcoder-interface "github:topcoder-platform/plat-interface-definition#v0.0.46" + topcoder-interface "github:topcoder-platform/plat-interface-definition#v0.0.47" tslib "^2.4.1" "@types/body-parser@*": @@ -346,14 +346,9 @@ integrity sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA== "@types/node@*", "@types/node@>=12.12.47", "@types/node@>=13.7.0": - version "18.15.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.6.tgz#af98ef4a36e7ac5f2d03040f3109fcce972bf6cb" - integrity sha512-YErOafCZpK4g+Rp3Q/PBgZNAsWKGunQTm9FA3/Pbcm0VCriTEzcrutQ/SxSc0rytAp0NoFWue669jmKhEtd0sA== - -"@types/node@11.11.0": - version "11.11.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.0.tgz#070e9ce7c90e727aca0e0c14e470f9a93ffe9390" - integrity sha512-D5Rt+HXgEywr3RQJcGlZUCTCx1qVbCZpVk3/tOOA6spLNZdGm8BU+zRgdRYDoF1pO3RuXLxADzMrF903JlQXqg== + version "18.15.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.11.tgz#b3b790f09cb1696cffcec605de025b088fa4225f" + integrity sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q== "@types/qs@*": version "6.9.7" @@ -550,25 +545,10 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== -aws-sdk@2.395.0: - version "2.395.0" - resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.395.0.tgz#637e5fa06d69bfb923b17bde24a8bd2a74dedab3" - integrity sha512-ldTTjctniZT4E2lq2z3D8Y2u+vpkp+laoEnDkXgjKXTKbiJ0QEtfWsUdx/IQ7awCt8stoxyqZK47DJOxIbRNoA== - dependencies: - buffer "4.9.1" - events "1.1.1" - ieee754 "1.1.8" - jmespath "0.15.0" - querystring "0.2.0" - sax "1.2.1" - url "0.10.3" - uuid "3.3.2" - xml2js "0.4.19" - aws-sdk@^2.1145.0: - version "2.1342.0" - resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1342.0.tgz#2ddb60e7480b6f3a3b1ec5cfba4c6beed7cfc024" - integrity sha512-RknStRPY+ohgOhuuDYEkAWuBcU9841EjtelZn4J2VubhaS7ZFQ2lmiYqm4P5Tw8Kwq6GuUqISBB8RCp8cO2qfA== + version "2.1351.0" + resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1351.0.tgz#d691555150791b0957c4b9715cd15a901a86e013" + integrity sha512-/Hj9lmxFO2eBipUGY2CL5rNhoZO4PrXOYQ6C+nQ0ffzp+bmYc0nzKwO7xrGreVIefrVbbikQyItiDL3PmBRnGw== dependencies: buffer "4.9.2" events "1.1.1" @@ -715,15 +695,6 @@ buffer-equal-constant-time@1.0.1: resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" integrity sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA== -buffer@4.9.1: - version "4.9.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" - integrity sha512-DNK4ruAqtyHaN8Zne7PkBTO+dD1Lr0YfTduMqlIyjvQIoztBkUxrvL+hKeLW8NXFKHOq/2upkxuoS9znQ9bW9A== - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - isarray "^1.0.0" - buffer@4.9.2: version "4.9.2" resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.2.tgz#230ead344002988644841ab0244af8c44bbe3ef8" @@ -1068,13 +1039,6 @@ debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: dependencies: ms "2.1.2" -debug@4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" - integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== - dependencies: - ms "^2.1.1" - debug@=3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" @@ -1101,11 +1065,6 @@ deep-eql@^4.1.2: dependencies: type-detect "^4.0.0" -deep-equal@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" - integrity sha512-bHtC0iYvWhyaTzvV3CZgPeZQqCOBGyGsVV7v4eevpdkLHfiSrXUdBG+qAuSz4RI70sszvjQ1QSZ98An1yNwpSw== - deep-equal@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-2.2.0.tgz#5caeace9c781028b9ff459f33b779346637c43e6" @@ -1176,19 +1135,6 @@ dtrace-provider@~0.8: dependencies: nan "^2.14.0" -dynamoose@^1.11.1: - version "1.11.1" - resolved "https://registry.yarnpkg.com/dynamoose/-/dynamoose-1.11.1.tgz#6b9a0356b5a9a9dda8a042ee5e8caf60ba659705" - integrity sha512-73T0GOeSh2FQDdK5V+cN9yowFU4uVt2OsOvknCB4Xdb+nSL/hBaecPY/meJaWZApVx73Hl1DcBSCGp/VWMvfRA== - dependencies: - "@types/node" "11.11.0" - aws-sdk "2.395.0" - debug "4.1.1" - deep-equal "1.0.1" - hooks "0.3.2" - object-path "0.11.4" - q "1.5.1" - ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" @@ -1780,11 +1726,6 @@ hoek@6.x.x: resolved "https://registry.yarnpkg.com/hoek/-/hoek-6.1.3.tgz#73b7d33952e01fe27a38b0457294b79dd8da242c" integrity sha512-YXXAAhmF9zpQbC7LEcREFtXfGq5K1fmd+4PHkBq8NUqmzW3G+Dq10bI/i0KucLRwss3YYFQ0fSfoxBZYiGUqtQ== -hooks@0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/hooks/-/hooks-0.3.2.tgz#a31f060c2026cea6cf1ca3eb178430e718e1c4a3" - integrity sha512-TqeFzUf12rSzcbm5lUls81jimUC8TmXZ4ANPxxeeMou09hrjBcHYhAQ0WgyN5YqNCXOzz7L6xVNl/+ctFuSeOw== - hosted-git-info@^2.1.4: version "2.8.9" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" @@ -1866,11 +1807,6 @@ ieee754@1.1.13: resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== -ieee754@1.1.8: - version "1.1.8" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" - integrity sha512-/aoyv2Nt7mGLnCAWzE0C1WH9Xd8ZsqR0f4Pjwxputi1JNm01+InyAYQotF4N+ulEIjbEsJo22NOHr+U/XEZ1Pw== - ieee754@^1.1.4: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" @@ -1977,7 +1913,7 @@ is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== -is-core-module@^2.9.0: +is-core-module@^2.11.0: version "2.11.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== @@ -2213,11 +2149,6 @@ istanbul-reports@^2.2.4: dependencies: html-escaper "^2.0.0" -jmespath@0.15.0: - version "0.15.0" - resolved "https://registry.yarnpkg.com/jmespath/-/jmespath-0.15.0.tgz#a3f222a9aae9f966f5d27c796510e28091764217" - integrity sha512-+kHj8HXArPfpPEKGLZ+kB5ONRTCiGQXo8RQYL0hH8t6pWXUBBK5KkkQmTNOwKK4LEsd0yTsgtjJVm4UBSZea4w== - jmespath@0.16.0: version "0.16.0" resolved "https://registry.yarnpkg.com/jmespath/-/jmespath-0.16.0.tgz#b15b0a85dfd4d930d43e69ed605943c802785076" @@ -2789,11 +2720,6 @@ object-keys@^1.0.11, object-keys@^1.1.1: resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== -object-path@0.11.4: - version "0.11.4" - resolved "https://registry.yarnpkg.com/object-path/-/object-path-0.11.4.tgz#370ae752fbf37de3ea70a861c23bba8915691949" - integrity sha512-ICbQN+aw/eAASDtaC7+SJXSAruz7fvvNjxMFfS3mTdvZaaiuuw81XXYu+9CSJeUVrS3YpRhTr862YGywMQUOWg== - object.assign@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" @@ -2957,9 +2883,9 @@ precond@0.2: integrity sha512-QCYG84SgGyGzqJ/vlMsxeXd/pgL/I94ixdNFyh1PusWmTCyVfPJjZ1K1jvHtsbfnXQs2TSkEP2fR7QiMZAnKFQ== prettier@^2.8.1: - version "2.8.6" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.6.tgz#5c174b29befd507f14b83e3c19f83fdc0e974b71" - integrity sha512-mtuzdiBbHwPEgl7NxWlqOkithPyp4VN93V7VeHVWBF+ad3I5avc0RVDT4oImXQy9H/AqxA2NSQH8pSxHW6FYbQ== + version "2.8.7" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.7.tgz#bb79fc8729308549d28fe3a98fce73d2c0656450" + integrity sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw== process-nextick-args@~2.0.0: version "2.0.1" @@ -2967,9 +2893,9 @@ process-nextick-args@~2.0.0: integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== protobufjs@^7.0.0: - version "7.2.2" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.2.2.tgz#2af401d8c547b9476fb37ffc65782cf302342ca3" - integrity sha512-++PrQIjrom+bFDPpfmqXfAGSQs40116JRrqqyf53dymUMvvb5d/LMRyicRoF1AUKoXVS1/IgJXlEgcpr4gTF3Q== + version "7.2.3" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.2.3.tgz#01af019e40d9c6133c49acbb3ff9e30f4f0f70b2" + integrity sha512-TtpvOqwB5Gdz/PQmOjgsrGH1nHjAQVCN7JG4A6r1sXRWESL5rNMAiRcBQlCAdKxZcAbstExQePYG8xof/JVRgg== dependencies: "@protobufjs/aspromise" "^1.1.2" "@protobufjs/base64" "^1.1.2" @@ -3022,11 +2948,6 @@ punycode@2.x.x, punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== -q@1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" - integrity sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw== - qs@6.11.0: version "6.11.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" @@ -3204,11 +3125,11 @@ resolve-from@^4.0.0: integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== resolve@^1.10.0: - version "1.22.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" - integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== + version "1.22.2" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f" + integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== dependencies: - is-core-module "^2.9.0" + is-core-module "^2.11.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" @@ -3612,9 +3533,9 @@ supports-preserve-symlinks-flag@^1.0.0: integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== swagger-ui-dist@>=4.11.0: - version "4.18.1" - resolved "https://registry.yarnpkg.com/swagger-ui-dist/-/swagger-ui-dist-4.18.1.tgz#da77cee1531af3f989b3da9dd8cddc5b9fa5715d" - integrity sha512-n7AT4wzKIPpHy/BGflJOepGMrbY/7Cd5yVd9ptVczaJGAKScbVJrZxFbAE2ZSZa8KmqdQ0+pOs3/5mWY5tSMZQ== + version "4.18.2" + resolved "https://registry.yarnpkg.com/swagger-ui-dist/-/swagger-ui-dist-4.18.2.tgz#323308f1c1d87a7c22ce3e273c31835eb680a71b" + integrity sha512-oVBoBl9Dg+VJw8uRWDxlyUyHoNEDC0c1ysT6+Boy6CTgr2rUcLcfPon4RvxgS2/taNW6O0+US+Z/dlAsWFjOAQ== swagger-ui-express@^4.1.3: version "4.6.2" @@ -3677,9 +3598,9 @@ topcoder-bus-api-wrapper@topcoder-platform/tc-bus-api-wrapper.git: superagent "^3.8.3" tc-core-library-js appirio-tech/tc-core-library-js.git#v2.6.4 -"topcoder-interface@github:topcoder-platform/plat-interface-definition#v0.0.46": +"topcoder-interface@github:topcoder-platform/plat-interface-definition#v0.0.47": version "1.0.0" - resolved "https://codeload.github.com/topcoder-platform/plat-interface-definition/tar.gz/8ed5b7686125a17209c85c33f69c92476625e3c1" + resolved "https://codeload.github.com/topcoder-platform/plat-interface-definition/tar.gz/b12d3846d7d358adb89c02f8c8f57bfe0232b1b9" topo@3.x.x: version "3.0.3" @@ -3803,11 +3724,6 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== -uuid@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" - integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== - uuid@8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.0.0.tgz#bc6ccf91b5ff0ac07bbcdbf1c7c4e150db4dbb6c"