Skip to content

Commit c790f6f

Browse files
committed
chore(deps): Update most dependencies.
1 parent 561ae44 commit c790f6f

13 files changed

Lines changed: 6391 additions & 4242 deletions

File tree

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 6315 additions & 4176 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -39,116 +39,116 @@
3939
"test:serve:debug:compiled": "cross-env NODE_ENV=test APP_SETTINGS=config/settings.test.js PORT=7357 APP_NAME=local LOGLEVEL=silly run-s build test:dropdbs test:rimraf serve:test:debug:compiled",
4040
"test:ci": "run-p test:serve test:run",
4141
"update-top-100": "node -r ts-node/register src/scripts/update-top-100.ts",
42-
"snyk-protect": "snyk protect",
43-
"prepare": "npm run snyk-protect"
42+
"snyk-protect": "snyk protect"
4443
},
4544
"engines": {
4645
"node": "12.x"
4746
},
4847
"mod-project-name": "vpdb",
4948
"dependencies": {
50-
"@koa/cors": "3.0.0",
49+
"@koa/cors": "3.1.0",
5150
"@slack/client": "5.0.2",
5251
"acl": "0.4.11",
53-
"adm-zip": "0.4.13",
52+
"adm-zip": "0.4.16",
5453
"archiver": "3.1.1",
5554
"axios": "0.19.0",
5655
"base64-stream": "1.0.0",
57-
"bluebird": "3.7.1",
56+
"bluebird": "3.7.2",
5857
"buffer-indexof": "1.1.1",
59-
"bull": "3.12.0",
58+
"bull": "3.18.1",
6059
"busboy": "0.3.1",
6160
"bytes": "3.1.0",
6261
"chalk": "2.4.2",
6362
"diff": "4.0.1",
64-
"elastic-apm-node": "3.1.0",
63+
"elastic-apm-node": "3.8.0",
6564
"ent": "2.2.0",
6665
"es6-promise-pool": "2.5.0",
6766
"fluent-ffmpeg": "2.1.2",
6867
"gltf-pipeline": "github:freezy/gltf-pipeline#hotfix/dedupe",
6968
"gm": "1.23.1",
7069
"google-auth-library": "5.3.0",
71-
"handlebars": "^4.5.3",
70+
"handlebars": "4.7.6",
7271
"has-ansi": "4.0.0",
73-
"ioredis": "4.14.1",
72+
"ioredis": "4.19.2",
7473
"jwt-simple": "0.5.6",
75-
"koa": "2.11.0",
76-
"koa-bodyparser": "4.2.1",
74+
"koa": "2.13.0",
75+
"koa-bodyparser": "4.3.0",
7776
"koa-json": "2.0.2",
7877
"koa-response-time": "2.1.0",
7978
"koa-router": "7.4.0",
80-
"koa-send": "5.0.0",
81-
"lodash": "4.17.15",
82-
"mongo-sanitize": "1.0.1",
79+
"koa-send": "5.0.1",
80+
"lodash": "4.17.20",
81+
"microtime": "3.0.0",
82+
"mongo-sanitize": "1.1.0",
8383
"mongoose": "5.7.8",
8484
"mongoose-paginate": "5.0.3",
8585
"mongoose-unique-validator": "2.0.3",
8686
"natives": "1.1.6",
8787
"nodegit": "^0.26.2",
88-
"nodemailer": "6.3.1",
89-
"optipng": "2.1.0",
88+
"nodemailer": "6.4.15",
89+
"optipng": "2.2.0",
9090
"passthrough-counter": "1.0.0",
9191
"path-to-regexp": "3.1.0",
92-
"pngquant": "3.0.0",
93-
"project-name-generator": "2.1.7",
92+
"pngquant": "3.1.0",
93+
"project-name-generator": "2.1.9",
9494
"randomstring": "1.1.5",
9595
"raygun": "0.10.1",
9696
"redis": "2.8.0",
97-
"rollbar": "2.14.2",
97+
"rollbar": "2.19.4",
9898
"sax": "1.2.4",
99-
"sharp": "0.23.2",
99+
"sharp": "^0.26.2",
100100
"shortid32": "0.1.1",
101-
"snyk": "1.244.0",
102-
"sqreen": "1.37.0",
101+
"snyk": "1.425.3",
102+
"sqreen": "1.55.1",
103103
"strip-ansi": "5.2.0",
104104
"ua-parser-js": "0.7.20",
105-
"uglify-js": "3.6.8",
105+
"uglify-js": "3.11.5",
106106
"unrar": "0.2.0",
107107
"unzipper": "^0.10.5",
108108
"validator": "11.1.0",
109-
"vpx-toolbox": "1.2.0",
110-
"winston": "3.2.1",
111-
"winston-daily-rotate-file": "4.2.1",
109+
"vpx-js": "1.3.4",
110+
"winston": "3.3.3",
111+
"winston-daily-rotate-file": "4.5.0",
112112
"xmlbuilder": "13.0.2"
113113
},
114114
"devDependencies": {
115-
"@types/adm-zip": "0.4.32",
116-
"@types/archiver": "3.0.0",
117-
"@types/bluebird": "3.5.28",
118-
"@types/bull": "3.10.6",
115+
"@types/adm-zip": "0.4.33",
116+
"@types/archiver": "3.1.1",
117+
"@types/bluebird": "3.5.33",
118+
"@types/bull": "3.14.4",
119119
"@types/busboy": "0.2.3",
120-
"@types/bytes": "3.0.0",
120+
"@types/bytes": "3.1.0",
121121
"@types/cheerio": "0.22.13",
122122
"@types/diff": "4.0.2",
123-
"@types/ent": "2.2.1",
123+
"@types/ent": "2.2.3",
124124
"@types/expect.js": "0.3.29",
125125
"@types/faker": "4.1.7",
126-
"@types/fluent-ffmpeg": "2.1.11",
127-
"@types/gm": "1.18.6",
126+
"@types/fluent-ffmpeg": "2.1.16",
127+
"@types/gm": "1.18.9",
128128
"@types/has-ansi": "3.0.0",
129-
"@types/ioredis": "4.0.18",
129+
"@types/ioredis": "4.17.7",
130130
"@types/jwt-simple": "0.5.33",
131-
"@types/koa": "2.0.51",
131+
"@types/koa": "2.11.6",
132132
"@types/koa-bodyparser": "4.3.0",
133133
"@types/koa-json": "2.0.18",
134-
"@types/koa-router": "7.0.42",
134+
"@types/koa-router": "7.4.1",
135135
"@types/koa-send": "4.1.2",
136-
"@types/lodash": "4.14.145",
136+
"@types/lodash": "4.14.165",
137137
"@types/mocha": "5.2.7",
138138
"@types/mongo-sanitize": "1.0.1",
139-
"@types/mongoose": "5.5.29",
139+
"@types/mongoose": "5.10.0",
140140
"@types/mongoose-paginate": "5.0.8",
141-
"@types/mongoose-unique-validator": "1.0.3",
141+
"@types/mongoose-unique-validator": "1.0.4",
142142
"@types/node": "12.12.6",
143143
"@types/nodegit": "0.24.13",
144-
"@types/nodemailer": "6.2.2",
144+
"@types/nodemailer": "6.4.0",
145145
"@types/randomstring": "1.1.6",
146-
"@types/redis": "2.8.14",
147-
"@types/sax": "1.2.0",
146+
"@types/redis": "2.8.28",
147+
"@types/sax": "1.2.1",
148148
"@types/sharp": "0.23.0",
149149
"@types/strip-ansi": "5.2.1",
150150
"@types/ua-parser-js": "0.7.33",
151-
"@types/uglify-js": "3.0.4",
151+
"@types/uglify-js": "3.11.1",
152152
"@types/unzipper": "^0.10.0",
153153
"@types/validator": "10.11.3",
154154
"@types/yargs": "13.0.3",
@@ -157,7 +157,7 @@
157157
"cross-env": "6.0.3",
158158
"expect.js": "0.3.1",
159159
"faker": "4.1.0",
160-
"fast-glob": "3.1.0",
160+
"fast-glob": "3.2.4",
161161
"form-data": "2.5.1",
162162
"json-stable-stringify": "1.0.1",
163163
"mocha": "5.2.0",

src/app/builds/build.api.cache.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,4 @@ describe('The build cache', () => {
7979
});
8080
});
8181

82-
});
82+
});

src/app/common/mongoose/game.reference.plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function gameReferencePlugin(schema: Schema, options: GameReferenceOption
6767
* @param {Array<any> | object} query Input query
6868
* @return {Promise<Array<any> | object>} Output query
6969
*/
70-
schema.statics.applyRestrictions = async function<T>(this: ModelProperties, ctx: Context, query: T): Promise<T> {
70+
schema.statics.applyRestrictions = async function<T>(ctx: Context, query: T): Promise<T> {
7171

7272
const reference = modelReferenceMap[this.modelName];
7373
const resource = modelResourceMap[this.modelName];
@@ -109,7 +109,7 @@ export function gameReferencePlugin(schema: Schema, options: GameReferenceOption
109109
* @param {Array<any> | object} query Query to append
110110
* @return {Promise<Array<any> | object | null>} Updated query on restriction, same without restriction and null if not logged.
111111
*/
112-
schema.statics.applyRestrictionsForGame = async function<T>(this: ModelProperties, ctx: Context, game: GameDocument, query: T): Promise<T | null> {
112+
schema.statics.applyRestrictionsForGame = async function<T>(ctx: Context, game: GameDocument, query: T): Promise<T | null> {
113113

114114
const reference = modelReferenceMap[this.modelName];
115115
const resource = modelResourceMap[this.modelName];

src/app/common/mongoose/metrics.plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export function metricsPlugin<T>(schema: Schema, options: MetricsOptions = {}) {
117117
* @param {string} counterName Name of the counter, e.g. "views"
118118
* @param {number} [value=1] How much to increment. Use a negative value for decrement
119119
*/
120-
schema.statics.incrementCounter = async function(this: ModelProperties, entityId: string, counterName: string, value: number = 1): Promise<void> {
120+
schema.statics.incrementCounter = async function(entityId: string, counterName: string, value: number = 1): Promise<void> {
121121
// update cache
122122
await apiCache.incrementCounter(this.modelName.toLowerCase(), entityId, counterName, value);
123123
// update db

src/app/common/visualpinball.table.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import { isUndefined, times } from 'lodash';
2121

2222
import { createHash } from 'crypto';
23-
import { OleCompoundDoc, Storage } from 'vpx-toolbox';
23+
import { BinaryReader, OleCompoundDoc, Storage } from 'vpx-js';
2424
import { TableBlock } from '../releases/release.tableblock';
2525
import { logger } from './logger';
2626
import { RequestState } from './typings/context';
@@ -115,7 +115,7 @@ class VisualPinballTable {
115115
* @returns {Promise<OleCompoundDoc>}
116116
*/
117117
public async readDoc(filename: string): Promise<OleCompoundDoc> {
118-
return await OleCompoundDoc.load(filename);
118+
return await OleCompoundDoc.load(new BinaryReader(filename));
119119
}
120120

121121
/**

src/app/files/metadata/vpt.metadata.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
import { mapKeys, omit } from 'lodash';
2020

21-
import { Table } from 'vpx-toolbox';
21+
import { BinaryReader, Table } from 'vpx-js';
2222
import { RequestState } from '../../common/typings/context';
2323
import { File } from '../file';
2424
import { FileDocument } from '../file.document';
@@ -33,9 +33,9 @@ export class VptMetadata extends Metadata {
3333
}
3434

3535
public async getMetadata(requestState: RequestState, file: FileDocument, path: string, variation?: FileVariation): Promise<{ [p: string]: any }> {
36-
const table = await Table.load(path, { gameDataOnly: true, tableInfoOnly: true });
36+
const table = await Table.load(new BinaryReader(path), { tableDataOnly: true, tableInfoOnly: true, loadTableScript: true });
3737
const script = await table.getTableScript();
38-
const props = mapKeys(table.tableInfo, key => {
38+
const props = mapKeys(table.info, key => {
3939
switch (key) {
4040
case 'TableName': return 'table_name';
4141
case 'AuthorName': return 'author_name';

src/app/files/processor/vpt.gltf.processor.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1818
*/
1919

20-
import { Table } from 'vpx-toolbox';
20+
import { BinaryReader, Table, TableExporter, ThreeTextureLoader } from 'vpx-js';
2121
import { logger } from '../../common/logger';
2222
import { RequestState } from '../../common/typings/context';
2323
import { FileDocument } from '../file.document';
@@ -40,13 +40,14 @@ export class VptGltfProcessor implements CreationProcessor<FileVariation> {
4040
public async process(requestState: RequestState, file: FileDocument, src: string, dest: string, variation?: FileVariation): Promise<string> {
4141

4242
logger.info(requestState, '[VptGltfProcessor.process]: Parsing VPX file at %s', src);
43-
const vpt = await Table.load(src);
43+
const vpt = await Table.load(new BinaryReader(src));
4444
logger.info(requestState, '[VptGltfProcessor.process]: VPX file parsed, exporting to GLB at %s.', dest);
4545

46-
const glb = await vpt.exportGlb({
46+
const exporter = new TableExporter(vpt);
47+
const glb = await exporter.exportGlb({
4748

4849
// texture and material
49-
applyTextures: process.env.NODE_ENV !== 'test', // gltf loader in tests can't handle textures
50+
applyTextures: (process.env.NODE_ENV !== 'test') ? new ThreeTextureLoader() : undefined, // gltf loader in tests can't handle textures
5051
applyMaterials: true,
5152
optimizeTextures: true,
5253
gltfOptions: {

src/app/releases/release.schema.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import { compact, flatten, isArray, map, uniq } from 'lodash';
2121
import {
22+
FilterQuery,
2223
GameReferenceModel,
2324
MetricsModel,
2425
ModeratedDocument,
@@ -162,7 +163,7 @@ releaseSchema.pre('remove', async function(this: ReleaseDocument) {
162163

163164
for (const fileId of fileIds) {
164165
await state.models.TableBlock.updateOne(
165-
{ _files: fileId },
166+
{ _files: fileId } as FilterQuery<ReleaseDocument>,
166167
{ $pull: { _files: fileId } },
167168
{ multi: true },
168169
);

0 commit comments

Comments
 (0)