Skip to content

Commit 2c26f03

Browse files
authored
Merge branch 'master' into fixSelectExclude
2 parents 57abc4e + 181fbf9 commit 2c26f03

File tree

10 files changed

+330
-166
lines changed

10 files changed

+330
-166
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ ___
130130
- Fix file upload issue for S3 compatible storage (Linode, DigitalOcean) by avoiding empty tags property when creating a file (Ali Oguzhan Yildiz) [#7300](https://github.com/parse-community/parse-server/pull/7300)
131131
- Add building Docker image as CI check (Manuel Trezza) [#7332](https://github.com/parse-community/parse-server/pull/7332)
132132
- Add NPM package-lock version check to CI (Manuel Trezza) [#7333](https://github.com/parse-community/parse-server/pull/7333)
133+
- Fix incorrect LiveQuery events triggered for multiple subscriptions on the same class with different events [#7341](https://github.com/parse-community/parse-server/pull/7341)
133134
- Fix select and excludeKey queries to properly accept JSON string arrays. Also allow nested fields in exclude (Corey Baker) [#7242](https://github.com/parse-community/parse-server/pull/7242)
134135

135136
___

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@graphql-tools/utils": "6.2.4",
2626
"@parse/fs-files-adapter": "1.2.0",
2727
"@parse/push-adapter": "3.4.0",
28-
"apollo-server-express": "2.21.0",
28+
"apollo-server-express": "2.22.2",
2929
"bcryptjs": "2.4.3",
3030
"body-parser": "1.19.0",
3131
"commander": "5.1.0",
@@ -46,7 +46,7 @@
4646
"lru-cache": "5.1.1",
4747
"mime": "2.5.2",
4848
"mongodb": "3.6.6",
49-
"mustache": "4.1.0",
49+
"mustache": "4.2.0",
5050
"parse": "3.1.0",
5151
"pg-monitor": "1.4.1",
5252
"pg-promise": "10.9.2",

resources/ci/ciCheck.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ async function checkMongoDbVersions() {
3939
'~4.7.0', // Development release according to MongoDB support
4040

4141
'4.4.5', // Temporarily disabled because not yet available for download via mongodb-runner
42+
'4.0.24', // Temporarily disabled because not yet available for download via mongodb-runner
4243
],
4344
}).check();
4445
}

spec/CloudCode.Validator.spec.js

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,117 @@ describe('cloud validator', () => {
355355
});
356356
});
357357

358+
it('set params not-required options data', done => {
359+
Parse.Cloud.define(
360+
'hello',
361+
req => {
362+
expect(req.params.data).toBe('abc');
363+
return 'Hello world!';
364+
},
365+
{
366+
fields: {
367+
data: {
368+
type: String,
369+
required: false,
370+
options: s => {
371+
return s.length >= 4 && s.length <= 50;
372+
},
373+
error: 'Validation failed. Expected length of data to be between 4 and 50.',
374+
},
375+
},
376+
}
377+
);
378+
Parse.Cloud.run('hello', { data: 'abc' })
379+
.then(() => {
380+
fail('function should have failed.');
381+
})
382+
.catch(error => {
383+
expect(error.code).toEqual(Parse.Error.VALIDATION_ERROR);
384+
expect(error.message).toEqual(
385+
'Validation failed. Expected length of data to be between 4 and 50.'
386+
);
387+
done();
388+
});
389+
});
390+
391+
it('set params not-required type', done => {
392+
Parse.Cloud.define(
393+
'hello',
394+
req => {
395+
expect(req.params.data).toBe(null);
396+
return 'Hello world!';
397+
},
398+
{
399+
fields: {
400+
data: {
401+
type: String,
402+
required: false,
403+
},
404+
},
405+
}
406+
);
407+
Parse.Cloud.run('hello', { data: null })
408+
.then(() => {
409+
fail('function should have failed.');
410+
})
411+
.catch(error => {
412+
expect(error.code).toEqual(Parse.Error.VALIDATION_ERROR);
413+
expect(error.message).toEqual('Validation failed. Invalid type for data. Expected: string');
414+
done();
415+
});
416+
});
417+
418+
it('set params not-required options', done => {
419+
Parse.Cloud.define(
420+
'hello',
421+
() => {
422+
return 'Hello world!';
423+
},
424+
{
425+
fields: {
426+
data: {
427+
type: String,
428+
required: false,
429+
options: s => {
430+
return s.length >= 4 && s.length <= 50;
431+
},
432+
},
433+
},
434+
}
435+
);
436+
Parse.Cloud.run('hello', {})
437+
.then(() => {
438+
done();
439+
})
440+
.catch(() => {
441+
fail('function should not have failed.');
442+
});
443+
});
444+
445+
it('set params not-required no-options', done => {
446+
Parse.Cloud.define(
447+
'hello',
448+
() => {
449+
return 'Hello world!';
450+
},
451+
{
452+
fields: {
453+
data: {
454+
type: String,
455+
required: false,
456+
},
457+
},
458+
}
459+
);
460+
Parse.Cloud.run('hello', {})
461+
.then(() => {
462+
done();
463+
})
464+
.catch(() => {
465+
fail('function should not have failed.');
466+
});
467+
});
468+
358469
it('set params option', done => {
359470
Parse.Cloud.define(
360471
'hello',

0 commit comments

Comments
 (0)