Skip to content

Commit 0b3a4a1

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 7857020 + ab1dddd commit 0b3a4a1

19 files changed

+445
-185
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ ___
114114
- Added Deprecation Policy to govern the introduction of breaking changes in a phased pattern that is more predictable for developers (Manuel Trezza) [#7199](https://github.com/parse-community/parse-server/pull/7199)
115115
- Add REST API endpoint `/loginAs` to create session of any user with master key; allows to impersonate another user. (GormanFletcher) [#7406](https://github.com/parse-community/parse-server/pull/7406)
116116
- Add official support for MongoDB 5.0 (Manuel Trezza) [#7469](https://github.com/parse-community/parse-server/pull/7469)
117+
- Added Parse Server Configuration `enforcePrivateUsers`, which will remove public access by default on new Parse.Users (dblythy) [#7319](https://github.com/parse-community/parse-server/pull/7319)
117118

118119
### Other Changes
119120
- Support native mongodb syntax in aggregation pipelines (Raschid JF Rafeally) [#7339](https://github.com/parse-community/parse-server/pull/7339)
@@ -153,9 +154,13 @@ ___
153154
- Refactor: uniform issue templates across repos (Manuel Trezza) [#7528](https://github.com/parse-community/parse-server/pull/7528)
154155
- ci: bump ci environment (Manuel Trezza) [#7539](https://github.com/parse-community/parse-server/pull/7539)
155156
- CI now pushes docker images to Docker Hub (Corey Baker) [#7548](https://github.com/parse-community/parse-server/pull/7548)
157+
- Allow afterFind and afterLiveQueryEvent to set unsaved pointers and keys (dblythy) [#7310](https://github.com/parse-community/parse-server/pull/7310)
156158
- Allow setting descending sort to full text queries (dblythy) [#7496](https://github.com/parse-community/parse-server/pull/7496)
157159
- Allow cloud string for ES modules (Daniel Blyth) [#7560](https://github.com/parse-community/parse-server/pull/7560)
158160
- docs: Introduce deprecation ID for reference in comments and online search (Manuel Trezza) [#7562](https://github.com/parse-community/parse-server/pull/7562)
161+
- refactor: deprecate `Parse.Cloud.httpRequest`; it is recommended to use a HTTP library instead. (Daniel Blyth) [#7595](https://github.com/parse-community/parse-server/pull/7595)
162+
- refactor: Modernize HTTPRequest tests (brandongregoryscott) [#7604](https://github.com/parse-community/parse-server/pull/7604)
163+
- Allow liveQuery on Session class (Daniel Blyth) [#7554](https://github.com/parse-community/parse-server/pull/7554)
159164

160165
## 4.10.4
161166
[Full Changelog](https://github.com/parse-community/parse-server/compare/4.10.3...4.10.4)

DEPRECATIONS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The following is a list of deprecations, according to the [Deprecation Policy](h
66
|--------|-------------------------------------------------|----------------------------------------------------------------------|---------------------------------|---------------------------------|-----------------------|-------|
77
| DEPPS1 | Native MongoDB syntax in aggregation pipeline | [#7338](https://github.com/parse-community/parse-server/issues/7338) | 5.0.0 (2022) | 6.0.0 (2023) | deprecated | - |
88
| DEPPS2 | Config option `directAccess` defaults to `true` | [#6636](https://github.com/parse-community/parse-server/pull/6636) | 5.0.0 (2022) | 6.0.0 (2023) | deprecated | - |
9+
| DEPPS3 | Config option `enforcePrivateUsers` defaults to `true` | [#7319](https://github.com/parse-community/parse-server/pull/7319) | 5.0.0 (2022) | 6.0.0 (2023) | deprecated | - |
10+
| DEPPS4 | Remove convenience method for http request `Parse.Cloud.httpRequest` | [#7589](https://github.com/parse-community/parse-server/pull/7589) | 5.0.0 (2022) | 6.0.0 (2023) | deprecated | - |
911

1012
[i_deprecation]: ## "The version and date of the deprecation."
1113
[i_removal]: ## "The version and date of the planned removal."

package-lock.json

Lines changed: 6 additions & 6 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
@@ -35,7 +35,7 @@
3535
"follow-redirects": "1.14.1",
3636
"graphql": "15.5.3",
3737
"graphql-list-fields": "2.0.2",
38-
"graphql-relay": "0.8.0",
38+
"graphql-relay": "0.9.0",
3939
"graphql-tag": "2.12.5",
4040
"graphql-upload": "11.0.0",
4141
"intersect": "1.0.1",
@@ -58,7 +58,7 @@
5858
"uuid": "8.3.2",
5959
"winston": "3.3.3",
6060
"winston-daily-rotate-file": "4.5.5",
61-
"ws": "8.2.1"
61+
"ws": "8.2.2"
6262
},
6363
"devDependencies": {
6464
"@actions/core": "1.2.6",

spec/CloudCode.spec.js

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,6 +1554,25 @@ describe('Cloud Code', () => {
15541554
obj.save().then(done, done.fail);
15551555
});
15561556

1557+
it('can deprecate Parse.Cloud.httpRequest', async () => {
1558+
const logger = require('../lib/logger').logger;
1559+
spyOn(logger, 'warn').and.callFake(() => {});
1560+
Parse.Cloud.define('hello', () => {
1561+
return 'Hello world!';
1562+
});
1563+
await Parse.Cloud.httpRequest({
1564+
method: 'POST',
1565+
url: 'http://localhost:8378/1/functions/hello',
1566+
headers: {
1567+
'X-Parse-Application-Id': Parse.applicationId,
1568+
'X-Parse-REST-API-Key': 'rest',
1569+
},
1570+
});
1571+
expect(logger.warn).toHaveBeenCalledWith(
1572+
'DeprecationWarning: Parse.Cloud.httpRequest is deprecated and will be removed in a future version. Use a http request library instead.'
1573+
);
1574+
});
1575+
15571576
describe('cloud jobs', () => {
15581577
it('should define a job', done => {
15591578
expect(() => {
@@ -2391,6 +2410,53 @@ describe('afterFind hooks', () => {
23912410
});
23922411
});
23932412

2413+
it('can set a pointer object in afterFind', async () => {
2414+
const obj = new Parse.Object('MyObject');
2415+
await obj.save();
2416+
Parse.Cloud.afterFind('MyObject', async ({ objects }) => {
2417+
const otherObject = new Parse.Object('Test');
2418+
otherObject.set('foo', 'bar');
2419+
await otherObject.save();
2420+
objects[0].set('Pointer', otherObject);
2421+
objects[0].set('xyz', 'yolo');
2422+
expect(objects[0].get('Pointer').get('foo')).toBe('bar');
2423+
});
2424+
const query = new Parse.Query('MyObject');
2425+
query.equalTo('objectId', obj.id);
2426+
const obj2 = await query.first();
2427+
expect(obj2.get('xyz')).toBe('yolo');
2428+
const pointer = obj2.get('Pointer');
2429+
expect(pointer.get('foo')).toBe('bar');
2430+
});
2431+
2432+
it('can set invalid object in afterFind', async () => {
2433+
const obj = new Parse.Object('MyObject');
2434+
await obj.save();
2435+
Parse.Cloud.afterFind('MyObject', () => [{}]);
2436+
const query = new Parse.Query('MyObject');
2437+
query.equalTo('objectId', obj.id);
2438+
const obj2 = await query.first();
2439+
expect(obj2).toBeDefined();
2440+
expect(obj2.toJSON()).toEqual({});
2441+
expect(obj2.id).toBeUndefined();
2442+
});
2443+
2444+
it('can return a unsaved object in afterFind', async () => {
2445+
const obj = new Parse.Object('MyObject');
2446+
await obj.save();
2447+
Parse.Cloud.afterFind('MyObject', async () => {
2448+
const otherObject = new Parse.Object('Test');
2449+
otherObject.set('foo', 'bar');
2450+
return [otherObject];
2451+
});
2452+
const query = new Parse.Query('MyObject');
2453+
const obj2 = await query.first();
2454+
expect(obj2.get('foo')).toEqual('bar');
2455+
expect(obj2.id).toBeUndefined();
2456+
await obj2.save();
2457+
expect(obj2.id).toBeDefined();
2458+
});
2459+
23942460
it('should have request headers', done => {
23952461
Parse.Cloud.afterFind('MyObject', req => {
23962462
expect(req.headers).toBeDefined();

0 commit comments

Comments
 (0)