Upgrade Server Deps (#12328)

* upgrade uuid

* upgrade gulp-imagemin

* upgrade bcrypt

* upgrade validator.js

* fix uuid import

* upgrade got

* upgrade sinon

* upgrade passport-google-oauth2

* fix unit test
This commit is contained in:
Matteo Pagliazzi
2020-06-22 11:51:52 +02:00
committed by GitHub
parent fa7448c41d
commit ba16fa6854
7 changed files with 762 additions and 329 deletions

1053
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -15,7 +15,7 @@
"apidoc": "^0.17.5",
"apn": "^2.2.0",
"apple-auth": "^1.0.6",
"bcrypt": "^3.0.8",
"bcrypt": "^5.0.0",
"body-parser": "^1.18.3",
"compression": "^1.7.4",
"cookie-session": "^1.4.0",
@@ -30,10 +30,10 @@
"express-basic-auth": "^1.1.5",
"express-validator": "^5.2.0",
"glob": "^7.1.6",
"got": "^10.7.0",
"got": "^11.3.0",
"gulp": "^4.0.0",
"gulp-babel": "^8.0.0",
"gulp-imagemin": "^6.2.0",
"gulp-imagemin": "^7.1.0",
"gulp-nodemon": "^2.5.0",
"gulp.spritesmith": "^6.9.0",
"habitica-markdown": "^2.0.2",
@@ -55,6 +55,7 @@
"on-headers": "^1.0.2",
"passport": "^0.4.1",
"passport-facebook": "^3.0.0",
"passport-google-oauth2": "^0.2.0",
"passport-google-oauth20": "1.0.0",
"paypal-ipn": "3.0.0",
"paypal-rest-sdk": "^1.8.1",
@@ -67,8 +68,8 @@
"superagent": "^5.2.2",
"universal-analytics": "^0.4.17",
"useragent": "^2.1.9",
"uuid": "^3.4.0",
"validator": "^11.0.0",
"uuid": "^8.1.0",
"validator": "^13.1.1",
"vinyl-buffer": "^1.0.1",
"winston": "^3.3.0",
"winston-loggly-bulk": "^3.1.0",
@@ -108,13 +109,13 @@
"axios": "^0.19.2",
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"chalk": "^3.0.0",
"chalk": "^4.1.0",
"expect.js": "^0.3.1",
"istanbul": "^1.1.0-alpha.1",
"mocha": "^5.1.1",
"monk": "^7.3.0",
"require-again": "^2.0.0",
"sinon": "^7.2.4",
"sinon": "^9.0.2",
"sinon-chai": "^3.5.0",
"sinon-stub-promise": "^4.0.0"
},

View File

@@ -1,5 +1,3 @@
import uuid from 'uuid';
import {
generateGroup,
} from '../../../../../helpers/api-unit.helper';
@@ -7,6 +5,8 @@ import { model as User } from '../../../../../../website/server/models/user';
import { model as Group } from '../../../../../../website/server/models/group';
import amzLib from '../../../../../../website/server/libs/payments/amazon';
import payments from '../../../../../../website/server/libs/payments/payments';
import common from '../../../../../../website/common';
describe('#upgradeGroupPlan', () => {
let spy; let data; let user; let group; let
@@ -41,7 +41,7 @@ describe('#upgradeGroupPlan', () => {
spy.resolves([]);
uuidString = 'uuid-v4';
sinon.stub(uuid, 'v4').returns(uuidString);
sinon.stub(common, 'uuid').returns(uuidString);
data.groupId = group._id;
data.sub.quantity = 3;
@@ -49,7 +49,7 @@ describe('#upgradeGroupPlan', () => {
afterEach(() => {
amzLib.authorizeOnBillingAgreement.restore();
uuid.v4.restore();
common.uuid.restore();
});
it('charges for a new member', async () => {

View File

@@ -1,5 +1,5 @@
import express from 'express';
import uuid from 'uuid';
import { v4 as uuid } from 'uuid';
import bodyParser from 'body-parser';
const app = express();
@@ -30,7 +30,7 @@ app.post('/webhooks/:id', (req, res) => {
// See http://stackoverflow.com/a/37054753/2601552
const sockets = {};
server.on('connection', socket => {
const id = uuid.v4();
const id = uuid();
sockets[id] = socket;
socket.once('close', () => {

View File

@@ -1,4 +1,4 @@
import uuid from 'uuid';
import { v4 as uuid } from 'uuid';
// TODO remove this file completely
export default uuid.v4;
export default uuid;

View File

@@ -1,7 +1,7 @@
// Currently this holds helpers for challenge api,
// but we should break this up into submodules as it expands
import omit from 'lodash/omit';
import uuid from 'uuid';
import { v4 as uuid } from 'uuid';
import { model as Challenge } from '../../models/challenge';
import {
model as Group,

View File

@@ -2,7 +2,6 @@ import amazonPayments from 'amazon-payments';
import nconf from 'nconf';
import moment from 'moment';
import cc from 'coupon-code';
import uuid from 'uuid';
import util from 'util';
import common from '../../../common';
@@ -356,7 +355,7 @@ api.chargeForAdditionalGroupMember = async function chargeForAdditionalGroupMemb
return this.authorizeOnBillingAgreement({
AmazonBillingAgreementId: group.purchased.plan.customerId,
AuthorizationReferenceId: uuid.v4().substring(0, 32),
AuthorizationReferenceId: common.uuid().substring(0, 32),
AuthorizationAmount: {
CurrencyCode: this.constants.CURRENCY_CODE,
Amount: priceForNewMember,
@@ -366,7 +365,7 @@ api.chargeForAdditionalGroupMember = async function chargeForAdditionalGroupMemb
CaptureNow: true,
SellerNote: this.constants.SELLER_NOTE_GROUP_NEW_MEMBER,
SellerOrderAttributes: {
SellerOrderId: uuid.v4(),
SellerOrderId: common.uuid(),
StoreName: this.constants.STORE_NAME,
},
});