Skip to content

Commit bb2409a

Browse files
committed
Merge remote-tracking branch 'upstream/master' into add-idempotency
2 parents 401e584 + 1cc3211 commit bb2409a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2519
-1260
lines changed

.prettierrc

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
semi: true
22
trailingComma: "es5"
33
singleQuote: true
4+
arrowParens: "avoid"

package-lock.json

+2,175-1,012
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,42 @@
2020
"license": "BSD-3-Clause",
2121
"dependencies": {
2222
"@apollographql/graphql-playground-html": "1.6.26",
23-
"@graphql-tools/stitch": "^6.0.1",
24-
"@graphql-tools/utils": "^6.0.1",
23+
"@graphql-tools/stitch": "6.0.10",
24+
"@graphql-tools/utils": "6.0.10",
2525
"@parse/fs-files-adapter": "1.0.1",
2626
"@parse/push-adapter": "3.2.0",
2727
"@parse/s3-files-adapter": "1.4.0",
2828
"@parse/simple-mailgun-adapter": "1.1.0",
29-
"apollo-server-express": "2.14.1",
29+
"apollo-server-express": "2.15.0",
3030
"bcryptjs": "2.4.3",
3131
"body-parser": "1.19.0",
3232
"commander": "5.1.0",
3333
"cors": "2.8.5",
3434
"deepcopy": "2.0.0",
3535
"express": "4.17.1",
36-
"follow-redirects": "1.11.0",
36+
"follow-redirects": "1.12.1",
3737
"graphql": "15.1.0",
3838
"graphql-list-fields": "2.0.2",
39-
"graphql-relay": "^0.6.0",
39+
"graphql-relay": "0.6.0",
4040
"graphql-upload": "11.0.0",
4141
"intersect": "1.0.1",
4242
"jsonwebtoken": "8.5.1",
43-
"jwks-rsa": "1.8.0",
43+
"jwks-rsa": "1.8.1",
4444
"ldapjs": "2.0.0",
4545
"lodash": "4.17.16",
4646
"lru-cache": "5.1.1",
4747
"mime": "2.4.6",
4848
"mongodb": "3.5.9",
4949
"parse": "2.14.0",
50-
"pg-promise": "10.5.6",
51-
"pluralize": "^8.0.0",
50+
"pg-promise": "10.5.7",
51+
"pluralize": "8.0.0",
5252
"redis": "3.0.2",
5353
"semver": "7.3.2",
5454
"subscriptions-transport-ws": "0.9.16",
5555
"tv4": "1.3.0",
5656
"uuid": "8.1.0",
5757
"winston": "3.2.1",
58-
"winston-daily-rotate-file": "4.4.2",
58+
"winston-daily-rotate-file": "4.5.0",
5959
"ws": "7.3.0"
6060
},
6161
"devDependencies": {
@@ -80,7 +80,7 @@
8080
"eslint-plugin-flowtype": "5.1.3",
8181
"flow-bin": "0.119.1",
8282
"form-data": "3.0.0",
83-
"graphql-tag": "^2.10.1",
83+
"graphql-tag": "2.10.1",
8484
"husky": "4.2.5",
8585
"jasmine": "3.5.0",
8686
"jsdoc": "3.6.3",
@@ -114,7 +114,7 @@
114114
"parse-server": "./bin/parse-server"
115115
},
116116
"optionalDependencies": {
117-
"bcrypt": "4.0.1"
117+
"@node-rs/bcrypt": "0.3.0"
118118
},
119119
"collective": {
120120
"type": "opencollective",

spec/CloudCode.spec.js

+54
Original file line numberDiff line numberDiff line change
@@ -2968,4 +2968,58 @@ describe('afterLogin hook', () => {
29682968
obj.set("obj2", obj2);
29692969
await obj.save(null, { context: { a: 'a' } });
29702970
});
2971+
2972+
it('should have access to context as saveAll argument', async () => {
2973+
Parse.Cloud.beforeSave('TestObject', (req) => {
2974+
expect(req.context.a).toEqual('a');
2975+
});
2976+
Parse.Cloud.afterSave('TestObject', (req) => {
2977+
expect(req.context.a).toEqual('a');
2978+
});
2979+
const obj1 = new TestObject();
2980+
const obj2 = new TestObject();
2981+
await Parse.Object.saveAll([obj1, obj2], { context: { a: 'a' }});
2982+
});
2983+
2984+
it('should have access to context as destroyAll argument', async () => {
2985+
Parse.Cloud.beforeDelete('TestObject', (req) => {
2986+
expect(req.context.a).toEqual('a');
2987+
});
2988+
Parse.Cloud.afterDelete('TestObject', (req) => {
2989+
expect(req.context.a).toEqual('a');
2990+
});
2991+
const obj1 = new TestObject();
2992+
const obj2 = new TestObject();
2993+
await Parse.Object.saveAll([obj1, obj2]);
2994+
await Parse.Object.destroyAll([obj1, obj2], { context: { a: 'a' } });
2995+
});
2996+
2997+
it('should have access to context as destroy a object', async () => {
2998+
Parse.Cloud.beforeDelete('TestObject', (req) => {
2999+
expect(req.context.a).toEqual('a');
3000+
});
3001+
Parse.Cloud.afterDelete('TestObject', (req) => {
3002+
expect(req.context.a).toEqual('a');
3003+
});
3004+
const obj = new TestObject();
3005+
await obj.save();
3006+
await obj.destroy({ context: { a: 'a' } });
3007+
});
3008+
3009+
it('should have access to context in beforeFind hook', async () => {
3010+
Parse.Cloud.beforeFind('TestObject', (req) => {
3011+
expect(req.context.a).toEqual('a');
3012+
});
3013+
const query = new Parse.Query('TestObject');
3014+
return query.find({ context: { a: 'a' } });
3015+
});
3016+
3017+
it('should have access to context when cloud function is called.', async () => {
3018+
Parse.Cloud.define('contextTest', async (req) => {
3019+
expect(req.context.a).toEqual('a');
3020+
return {};
3021+
});
3022+
3023+
await Parse.Cloud.run('contextTest', {}, { context: { a: 'a' } });
3024+
});
29713025
});

spec/support/CustomAuth.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module.exports = {
2-
validateAppId: function() {
2+
validateAppId: function () {
33
return Promise.resolve();
44
},
5-
validateAuthData: function(authData) {
5+
validateAuthData: function (authData) {
66
if (authData.token == 'my-token') {
77
return Promise.resolve();
88
}

spec/support/CustomAuthFunction.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
module.exports = function(validAuthData) {
1+
module.exports = function (validAuthData) {
22
return {
3-
validateAppId: function() {
3+
validateAppId: function () {
44
return Promise.resolve();
55
},
6-
validateAuthData: function(authData) {
6+
validateAuthData: function (authData) {
77
if (authData.token == validAuthData.token) {
88
return Promise.resolve();
99
}

spec/support/CustomMiddleware.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = function(req, res, next) {
1+
module.exports = function (req, res, next) {
22
res.set('X-Yolo', '1');
33
next();
44
};

0 commit comments

Comments
 (0)