Skip to content

Commit 9d91ef7

Browse files
authored
Merge branch 'master' into postgres-flaky-test
2 parents 2068fbb + 0b69700 commit 9d91ef7

18 files changed

+401
-89
lines changed

package.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "lib/index.js",
66
"repository": {
77
"type": "git",
8-
"url": "https://github.com/ParsePlatform/parse-server"
8+
"url": "https://github.com/parse-community/parse-server"
99
},
1010
"files": [
1111
"bin/",
@@ -19,7 +19,7 @@
1919
"license": "BSD-3-Clause",
2020
"dependencies": {
2121
"@parse/fs-files-adapter": "1.0.1",
22-
"@parse/push-adapter": "2.0.2",
22+
"@parse/push-adapter": "2.0.3",
2323
"@parse/s3-files-adapter": "1.2.1",
2424
"@parse/simple-mailgun-adapter": "1.0.1",
2525
"bcryptjs": "2.4.3",
@@ -30,19 +30,19 @@
3030
"intersect": "1.0.1",
3131
"lodash": "4.17.5",
3232
"lru-cache": "4.1.2",
33-
"mime": "2.2.0",
34-
"mongodb": "3.0.4",
33+
"mime": "2.2.2",
34+
"mongodb": "3.0.7",
3535
"multer": "1.3.0",
3636
"parse": "1.11.1",
37-
"pg-promise": "8.2.1",
37+
"pg-promise": "8.4.0",
3838
"redis": "2.8.0",
39-
"request": "2.83.0",
39+
"request": "2.85.0",
4040
"semver": "5.5.0",
4141
"tv4": "1.3.0",
4242
"uuid": "^3.1.0",
4343
"winston": "2.4.1",
4444
"winston-daily-rotate-file": "1.7.2",
45-
"ws": "5.0.0"
45+
"ws": "5.1.1"
4646
},
4747
"devDependencies": {
4848
"babel-cli": "6.26.0",
@@ -53,15 +53,15 @@
5353
"babel-preset-env": "1.6.1",
5454
"bcrypt-nodejs": "0.0.3",
5555
"cross-env": "5.1.4",
56-
"deep-diff": "0.3.8",
56+
"deep-diff": "1.0.0",
5757
"eslint": "^4.9.0",
5858
"eslint-plugin-flowtype": "^2.39.1",
59-
"flow-bin": "^0.67.1",
59+
"flow-bin": "^0.71.0",
6060
"gaze": "1.1.2",
6161
"jasmine": "3.1.0",
6262
"jasmine-spec-reporter": "^4.1.0",
6363
"mongodb-runner": "3.6.1",
64-
"nodemon": "1.17.1",
64+
"nodemon": "1.17.3",
6565
"nyc": "^11.0.2",
6666
"request-promise": "4.2.2"
6767
},
@@ -73,7 +73,8 @@
7373
"test": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 TESTING=1 jasmine",
7474
"coverage": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 TESTING=1 nyc jasmine",
7575
"start": "node ./bin/parse-server",
76-
"prepublish": "npm run build"
76+
"prepublish": "npm run build",
77+
"postinstall": "node -p 'require(\"./postinstall.js\")()'"
7778
},
7879
"engines": {
7980
"node": ">=6.11.4"
@@ -82,7 +83,7 @@
8283
"parse-server": "./bin/parse-server"
8384
},
8485
"optionalDependencies": {
85-
"bcrypt": "1.0.3",
86+
"bcrypt": "2.0.1",
8687
"uws": "^9.14.0"
8788
},
8889
"collective": {

postinstall.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
const pkg = require('./package.json');
2+
3+
const version = parseFloat(process.version.substr(1));
4+
const minimum = parseFloat(pkg.engines.node.match(/\d+/g).join('.'));
5+
6+
module.exports = function () {
7+
const openCollective = `
8+
1111111111
9+
1111111111111111
10+
1111111111111111111111
11+
11111111111111111111111111
12+
111111111111111 11111111
13+
1111111111111 111111
14+
1111111111111 111111111 111111
15+
111111111111 11111111111 111111
16+
1111111111111 11111111111 111111
17+
1111111111111 1111111111 111111
18+
1111111111111111111111111 1111111
19+
11111111 11111111
20+
111111 1111111111111111111
21+
11111 11111 111111111111111111
22+
11111 11111111111111111
23+
111111 111111111111111111
24+
11111111111111111111111111
25+
1111111111111111111111
26+
111111111111111111
27+
11111111111
28+
29+
30+
Thanks for installing parse 🙏
31+
Please consider donating to our open collective
32+
to help us maintain this package.
33+
34+
👉 https://opencollective.com/parse-server
35+
36+
`;
37+
process.stdout.write(openCollective);
38+
if (version >= minimum) {
39+
process.exit(0);
40+
}
41+
42+
const errorMessage = `
43+
⚠️ parse-server requires at least node@${minimum}!
44+
You have node@${version}
45+
46+
`;
47+
48+
process.stdout.write(errorMessage);
49+
process.exit(1);
50+
};

spec/InMemoryCache.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('InMemoryCache', function() {
2828
let value = cache.get(KEY);
2929
expect(value).toEqual(VALUE);
3030

31-
wait(BASE_TTL.ttl * 2).then(() => {
31+
wait(BASE_TTL.ttl * 10).then(() => {
3232
value = cache.get(KEY)
3333
expect(value).toEqual(null);
3434
done();

spec/ParseAPI.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,6 +1493,11 @@ describe('miscellaneous', function() {
14931493
});
14941494
});
14951495

1496+
it('purge empty class', (done) => {
1497+
const testSchema = new Parse.Schema('UnknownClass');
1498+
testSchema.purge().then(done).catch(done.fail);
1499+
});
1500+
14961501
it('should not update schema beforeSave #2672', (done) => {
14971502
Parse.Cloud.beforeSave('MyObject', (request, response) => {
14981503
if (request.object.get('secret')) {

spec/ParseLiveQueryServer.spec.js

Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -102,50 +102,47 @@ describe('ParseLiveQueryServer', function() {
102102
parseLiveQueryServer.server.close(done);
103103
});
104104

105-
it('can be initialized through ParseServer without liveQueryServerOptions', function(done) {
106-
const parseServer = ParseServer.start({
107-
appId: 'hello',
108-
masterKey: 'world',
109-
port: 22345,
110-
mountPath: '/1',
111-
serverURL: 'http://localhost:12345/1',
112-
liveQuery: {
113-
classNames: ['Yolo']
114-
},
115-
startLiveQueryServer: true,
116-
databaseAdapter: global.defaultConfiguration.databaseAdapter,
117-
filesAdapter: global.defaultConfiguration.filesAdapter,
105+
describe_only_db('mongo')('initialization', () => {
106+
it('can be initialized through ParseServer without liveQueryServerOptions', function(done) {
107+
const parseServer = ParseServer.start({
108+
appId: 'hello',
109+
masterKey: 'world',
110+
port: 22345,
111+
mountPath: '/1',
112+
serverURL: 'http://localhost:12345/1',
113+
liveQuery: {
114+
classNames: ['Yolo']
115+
},
116+
startLiveQueryServer: true
117+
});
118+
119+
expect(parseServer.liveQueryServer).not.toBeUndefined();
120+
expect(parseServer.liveQueryServer.server).toBe(parseServer.server);
121+
parseServer.server.close(() => done());
118122
});
119123

120-
expect(parseServer.liveQueryServer).not.toBeUndefined();
121-
expect(parseServer.liveQueryServer.server).toBe(parseServer.server);
122-
parseServer.server.close(() => done());
123-
});
124+
it('can be initialized through ParseServer with liveQueryServerOptions', function(done) {
125+
const parseServer = ParseServer.start({
126+
appId: 'hello',
127+
masterKey: 'world',
128+
port: 22346,
129+
mountPath: '/1',
130+
serverURL: 'http://localhost:12345/1',
131+
liveQuery: {
132+
classNames: ['Yolo']
133+
},
134+
liveQueryServerOptions: {
135+
port: 22347,
136+
}
137+
});
124138

125-
it('can be initialized through ParseServer with liveQueryServerOptions', function(done) {
126-
const parseServer = ParseServer.start({
127-
appId: 'hello',
128-
masterKey: 'world',
129-
port: 22346,
130-
mountPath: '/1',
131-
serverURL: 'http://localhost:12345/1',
132-
liveQuery: {
133-
classNames: ['Yolo']
134-
},
135-
liveQueryServerOptions: {
136-
port: 22347,
137-
},
138-
databaseAdapter: global.defaultConfiguration.databaseAdapter,
139-
filesAdapter: global.defaultConfiguration.filesAdapter,
139+
expect(parseServer.liveQueryServer).not.toBeUndefined();
140+
expect(parseServer.liveQueryServer.server).not.toBe(parseServer.server);
141+
parseServer.liveQueryServer.server.close();
142+
parseServer.server.close(() => done());
140143
});
141-
142-
expect(parseServer.liveQueryServer).not.toBeUndefined();
143-
expect(parseServer.liveQueryServer.server).not.toBe(parseServer.server);
144-
parseServer.liveQueryServer.server.close();
145-
parseServer.server.close(() => done());
146144
});
147145

148-
149146
it('can handle connect command', function() {
150147
const parseLiveQueryServer = new ParseLiveQueryServer(10, 10, {});
151148
const parseWebSocket = {

spec/ParseQuery.Aggregate.spec.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ const masterKeyOptions = {
1313
json: true
1414
}
1515

16+
const PointerObject = Parse.Object.extend({
17+
className: "PointerObject"
18+
});
19+
1620
const loadTestData = () => {
1721
const data1 = {score: 10, name: 'foo', sender: {group: 'A'}, views: 900, size: ['S', 'M']};
1822
const data2 = {score: 10, name: 'foo', sender: {group: 'A'}, views: 800, size: ['M', 'L']};
@@ -448,8 +452,8 @@ describe('Parse.Query Aggregate testing', () => {
448452
});
449453

450454
it('match pointer query', (done) => {
451-
const pointer1 = new TestObject();
452-
const pointer2 = new TestObject();
455+
const pointer1 = new PointerObject();
456+
const pointer2 = new PointerObject();
453457
const obj1 = new TestObject({ pointer: pointer1 });
454458
const obj2 = new TestObject({ pointer: pointer2 });
455459
const obj3 = new TestObject({ pointer: pointer1 });
@@ -618,8 +622,8 @@ describe('Parse.Query Aggregate testing', () => {
618622
});
619623

620624
it('distinct pointer', (done) => {
621-
const pointer1 = new TestObject();
622-
const pointer2 = new TestObject();
625+
const pointer1 = new PointerObject();
626+
const pointer2 = new PointerObject();
623627
const obj1 = new TestObject({ pointer: pointer1 });
624628
const obj2 = new TestObject({ pointer: pointer2 });
625629
const obj3 = new TestObject({ pointer: pointer1 });

0 commit comments

Comments
 (0)