Skip to content

Commit b150699

Browse files
Update uuid to the latest version 🚀 (#6659)
* fix(package): update uuid to version 8.0.0 * chore(package): update lockfile package-lock.json * remove deprecated uuid/v4 * use uuidv4 as default Co-authored-by: greenkeeper[bot] <23040076+greenkeeper[bot]@users.noreply.github.com> Co-authored-by: Diamond Lewis <[email protected]>
1 parent 4d1bd93 commit b150699

File tree

4 files changed

+29
-16
lines changed

4 files changed

+29
-16
lines changed

‎package-lock.json

Lines changed: 14 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"semver": "7.3.2",
5353
"subscriptions-transport-ws": "0.9.16",
5454
"tv4": "1.3.0",
55-
"uuid": "3.4.0",
55+
"uuid": "8.0.0",
5656
"winston": "3.2.1",
5757
"winston-daily-rotate-file": "4.4.2",
5858
"ws": "7.2.5"
@@ -122,7 +122,9 @@
122122
"url": "https://opencollective.com/parse-server",
123123
"logo": "https://opencollective.com/parse-server/logo.txt?reverse=true&variant=binary"
124124
},
125-
"publishConfig": { "registry": "https://npm.pkg.github.com/" },
125+
"publishConfig": {
126+
"registry": "https://npm.pkg.github.com/"
127+
},
126128
"funding": {
127129
"type": "opencollective",
128130
"url": "https://opencollective.com/parse-server"

‎spec/ParseGraphQLServer.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const {
2929
const { ParseServer } = require('../');
3030
const { ParseGraphQLServer } = require('../lib/GraphQL/ParseGraphQLServer');
3131
const ReadPreference = require('mongodb').ReadPreference;
32-
const uuidv4 = require('uuid/v4');
32+
const { v4: uuidv4 } = require('uuid');
3333

3434
function handleError(e) {
3535
if (

‎src/LiveQuery/ParseLiveQueryServer.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { matchesQuery, queryHash } from './QueryTools';
99
import { ParsePubSub } from './ParsePubSub';
1010
import SchemaController from '../Controllers/SchemaController';
1111
import _ from 'lodash';
12-
import uuid from 'uuid';
12+
import { v4 as uuidv4 } from 'uuid';
1313
import { runLiveQueryEventHandlers } from '../triggers';
1414
import { getAuthForSessionToken, Auth } from '../Auth';
1515
import { getCacheController } from '../Controllers';
@@ -60,7 +60,7 @@ class ParseLiveQueryServer {
6060
// Initialize websocket server
6161
this.parseWebSocketServer = new ParseWebSocketServer(
6262
server,
63-
parseWebsocket => this._onConnect(parseWebsocket),
63+
(parseWebsocket) => this._onConnect(parseWebsocket),
6464
config
6565
);
6666

@@ -165,13 +165,13 @@ class ParseLiveQueryServer {
165165
// Check ACL
166166
return this._matchesACL(acl, client, requestId);
167167
})
168-
.then(isMatched => {
168+
.then((isMatched) => {
169169
if (!isMatched) {
170170
return null;
171171
}
172172
client.pushDelete(requestId, deletedParseObject);
173173
})
174-
.catch(error => {
174+
.catch((error) => {
175175
logger.error('Matching ACL error : ', error);
176176
});
177177
}
@@ -298,7 +298,7 @@ class ParseLiveQueryServer {
298298
originalParseObject
299299
);
300300
},
301-
error => {
301+
(error) => {
302302
logger.error('Matching ACL error : ', error);
303303
}
304304
);
@@ -308,7 +308,7 @@ class ParseLiveQueryServer {
308308
}
309309

310310
_onConnect(parseWebsocket: any): void {
311-
parseWebsocket.on('message', request => {
311+
parseWebsocket.on('message', (request) => {
312312
if (typeof request === 'string') {
313313
try {
314314
request = JSON.parse(request);
@@ -426,10 +426,10 @@ class ParseLiveQueryServer {
426426
cacheController: this.cacheController,
427427
sessionToken: sessionToken,
428428
})
429-
.then(auth => {
429+
.then((auth) => {
430430
return { auth, userId: auth && auth.user && auth.user.id };
431431
})
432-
.catch(error => {
432+
.catch((error) => {
433433
// There was an error with the session token
434434
const result = {};
435435
if (error && error.code === Parse.Error.INVALID_SESSION_TOKEN) {
@@ -523,7 +523,7 @@ class ParseLiveQueryServer {
523523
return Promise.resolve()
524524
.then(async () => {
525525
// Resolve false right away if the acl doesn't have any roles
526-
const acl_has_roles = Object.keys(acl.permissionsById).some(key =>
526+
const acl_has_roles = Object.keys(acl.permissionsById).some((key) =>
527527
key.startsWith('role:')
528528
);
529529
if (!acl_has_roles) {
@@ -581,7 +581,7 @@ class ParseLiveQueryServer {
581581
return;
582582
}
583583
const hasMasterKey = this._hasMasterKey(request, this.keyPairs);
584-
const clientId = uuid();
584+
const clientId = uuidv4();
585585
const client = new Client(
586586
clientId,
587587
parseWebsocket,

0 commit comments

Comments
 (0)