Skip to content

Commit 82edbd7

Browse files
authored
refactor: Bump uuid from 11.1.0 to 13.0.0 (#10370)
1 parent 1cea69a commit 82edbd7

File tree

5 files changed

+64
-15
lines changed

5 files changed

+64
-15
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"redis": "5.11.0",
5858
"semver": "7.7.2",
5959
"tv4": "1.3.0",
60-
"uuid": "11.1.0",
60+
"uuid": "13.0.0",
6161
"winston": "3.19.0",
6262
"winston-daily-rotate-file": "5.0.0",
6363
"ws": "8.20.0"

spec/Idempotency.spec.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ const Definitions = require('../lib/Options/Definitions');
44
const request = require('../lib/request');
55
const rest = require('../lib/rest');
66
const auth = require('../lib/Auth');
7-
const uuid = require('uuid');
7+
let uuidv4;
88

99
describe('Idempotency', () => {
10+
beforeAll(async () => {
11+
({ v4: uuidv4 } = await import('uuid'));
12+
});
1013
// Parameters
1114
/** Enable TTL expiration simulated by removing entry instead of waiting for MongoDB TTL monitor which
1215
runs only every 60s, so it can take up to 119s until entry removal - ain't nobody got time for that */
@@ -231,7 +234,7 @@ describe('Idempotency', () => {
231234
headers: {
232235
'X-Parse-Application-Id': Parse.applicationId,
233236
'X-Parse-Master-Key': Parse.masterKey,
234-
'X-Parse-Request-Id': uuid.v4(),
237+
'X-Parse-Request-Id': uuidv4(),
235238
},
236239
};
237240
return request(params);

spec/MongoStorageAdapter.spec.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const request = require('../lib/request');
77
const Config = require('../lib/Config');
88
const TestUtils = require('../lib/TestUtils');
99
const Utils = require('../lib/Utils');
10+
let uuidv4;
1011

1112
const fakeClient = {
1213
s: { options: { dbName: null } },
@@ -16,6 +17,9 @@ const fakeClient = {
1617
// These tests are specific to the mongo storage adapter + mongo storage format
1718
// and will eventually be moved into their own repo
1819
describe_only_db('mongo')('MongoStorageAdapter', () => {
20+
beforeAll(async () => {
21+
({ v4: uuidv4 } = await import('uuid'));
22+
});
1923
beforeEach(async () => {
2024
await new MongoStorageAdapter({ uri: databaseURI }).deleteAllClasses();
2125
Config.get(Parse.applicationId).schemaCache.clear();
@@ -308,9 +312,8 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
308312
});
309313

310314
it('upserts with $setOnInsert', async () => {
311-
const uuid = require('uuid');
312-
const uuid1 = uuid.v4();
313-
const uuid2 = uuid.v4();
315+
const uuid1 = uuidv4();
316+
const uuid2 = uuidv4();
314317
const schema = {
315318
className: 'MyClass',
316319
fields: {

spec/ParseGraphQLServer.spec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const {
3030
const { ParseServer } = require('../');
3131
const { ParseGraphQLServer } = require('../lib/GraphQL/ParseGraphQLServer');
3232
const { ReadPreference, Collection } = require('mongodb');
33-
const { v4: uuidv4 } = require('uuid');
33+
let uuidv4;
3434

3535
function handleError(e) {
3636
if (e && e.networkError && e.networkError.result && e.networkError.result.errors) {
@@ -45,6 +45,9 @@ describe('ParseGraphQLServer', () => {
4545
let parseGraphQLServer;
4646
let loggerErrorSpy;
4747

48+
beforeAll(async () => {
49+
({ v4: uuidv4 } = await import('uuid'));
50+
});
4851

4952
beforeEach(async () => {
5053
parseServer = await global.reconfigureServer({

0 commit comments

Comments
 (0)