Skip to content

Commit 0a0ae71

Browse files
committed
Merge branch 'upstream' into login-authData-from-prettier
# Conflicts: # jasmine.json # package-lock.json
2 parents 8ad13a3 + a1995ba commit 0a0ae71

Some content is hidden

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

66 files changed

+4744
-2103
lines changed

CHANGELOG.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,56 @@
11
# Parse-SDK-JS
22

33
### master
4-
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.19.0...master)
4+
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/3.1.0...master)
5+
- Add className argument to Parse Object subclass constructor ([#1315](https://github.com/parse-community/Parse-SDK-JS/pull/1315))
6+
7+
## 3.1.0
8+
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/3.0.0...3.1.0)
9+
10+
**Breaking Changes**
11+
`Parse.Push.send` will now return the pushStatusId instead of `{ result: true }`
12+
13+
**Features**
14+
- Add Server Health Check `Parse.getServerHealth()` ([#1307](https://github.com/parse-community/Parse-SDK-JS/pull/1307))
15+
- Allow saving with custom objectId `Parse.allowCustomObjectId = true` ([#1309](https://github.com/parse-community/Parse-SDK-JS/pull/1309))
16+
- `Parse.Push.send` now returns pushStatusId ([#1302](https://github.com/parse-community/Parse-SDK-JS/pull/1302))
17+
- Add `Parse.Push.getPushStatus` ([#1302](https://github.com/parse-community/Parse-SDK-JS/pull/1302))
18+
19+
**Improvements**
20+
- Add modifiers to `query.startsWith` ([#1306](https://github.com/parse-community/Parse-SDK-JS/pull/1306))
21+
- Add modifiers to `query.endsWith` ([#1306](https://github.com/parse-community/Parse-SDK-JS/pull/1306))
22+
23+
**Fixes**
24+
- EventuallyQueue now polls against `/health` endpoint, caused 403 forbidden side effect ([#1305](https://github.com/parse-community/Parse-SDK-JS/pull/1305))
25+
- Allow nested increment on undefined fields ([#1303](https://github.com/parse-community/Parse-SDK-JS/pull/1303))
26+
- Handle increment on nested fields any level deep ([#1301](https://github.com/parse-community/Parse-SDK-JS/pull/1301))
27+
28+
## 3.0.0
29+
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.19.0...3.0.0)
30+
31+
**Breaking Changes**
32+
For security purposes, logIn will default to `POST` instead of `GET` method. ([#1284](https://github.com/parse-community/Parse-SDK-JS/pull/1284))
33+
34+
If you need to use `GET` set the `usePost` option to false.
35+
36+
`Parse.User.logIn('username', 'password', { usePost: false })`
37+
38+
**Features**
39+
- Add EventuallyQueue API, object.saveEventually, object.destroyEventually ([#1291](https://github.com/parse-community/Parse-SDK-JS/pull/1291))
40+
- Add Parse.CLP Object to control ClassLevelPermissions ([#1145](https://github.com/parse-community/Parse-SDK-JS/pull/1145))
41+
- Add option `{ json: true }` on queries ([#1294](https://github.com/parse-community/Parse-SDK-JS/pull/1294))
42+
- Add IndexedDB Storage Controller ([#1297](https://github.com/parse-community/Parse-SDK-JS/pull/1297))
43+
- Parse.User.isCurrentAsync() for async storage ([#1298](https://github.com/parse-community/Parse-SDK-JS/pull/1298))
44+
45+
**Improvements**
46+
- Add useMasterKey option to Parse.File.destroy() ([#1285](https://github.com/parse-community/Parse-SDK-JS/pull/1285))
47+
- User management on React-Native ([#1298](https://github.com/parse-community/Parse-SDK-JS/pull/1298))
48+
49+
**Fixes**
50+
- Allow connect to LiveQuery with null fields ([#1282](https://github.com/parse-community/Parse-SDK-JS/pull/1282))
51+
- fromJSON: Return date if value is type `Date` ([#1293](https://github.com/parse-community/Parse-SDK-JS/pull/1293))
52+
- fromJSON: Allow keys to dirty, allows save fromJSON ([#1295](https://github.com/parse-community/Parse-SDK-JS/pull/1295))
53+
- Parse.Schema.addField accepts Pointer and Relation types ([#1281](https://github.com/parse-community/Parse-SDK-JS/pull/1281))
554

655
## 2.19.0
756
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.18.0...2.19.0)

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ const Parse = require('parse');
4444
import Parse from 'parse/dist/parse.min.js';
4545
```
4646

47+
For web worker or browser applications, indexedDB storage is available:
48+
49+
```js
50+
Parse.CoreManager.setStorageController(Parse.IndexedDB);
51+
```
52+
4753
For server-side applications or Node.js command line tools, include `'parse/node'`:
4854

4955
```js

integration/server.js

Lines changed: 0 additions & 54 deletions
This file was deleted.

integration/test/.eslintrc.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@
22
"env": {
33
"jasmine": true
44
},
5-
"globals": {},
5+
"globals": {
6+
"Child": true,
7+
"Container": true,
8+
"DiffObject": true,
9+
"Item": true,
10+
"Parse": true,
11+
"Parent": true,
12+
"reconfigureServer": true,
13+
"TestObject": true,
14+
"TestPoint": true
15+
},
616
"rules": {
717
"no-console": [0],
818
"no-var": "error"

integration/test/ArrayOperationsTest.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
'use strict';
22

33
const assert = require('assert');
4-
const clear = require('./clear');
54
const Parse = require('../../node');
65

76
describe('Array Operations', () => {
8-
beforeAll(done => {
9-
Parse.initialize('integration');
10-
Parse.CoreManager.set('SERVER_URL', 'http://localhost:1337/parse');
11-
Parse.Storage._clear();
12-
clear().then(done).catch(done.fail);
13-
});
14-
157
it('initializes a field', done => {
168
const object = new Parse.Object('TestObject');
179
object.set('strings', ['foo', 'bar', 'baz']);
@@ -375,7 +367,7 @@ describe('Array Operations', () => {
375367
});
376368
});
377369

378-
it('fails when combining remove with add unique', done => {
370+
it('fails when combining addUnique with remove', done => {
379371
const object = new Parse.Object('TestObject');
380372
object.set('strings', ['foo', 'bar']);
381373
object

integration/test/DirtyTest.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,9 @@
11
'use strict';
22

33
const assert = require('assert');
4-
const clear = require('./clear');
54
const Parse = require('../../node');
65

7-
const TestObject = Parse.Object.extend('TestObject');
8-
const Parent = Parse.Object.extend('Parent');
9-
const Child = Parse.Object.extend('Child');
10-
116
describe('Dirty Objects', () => {
12-
beforeEach(done => {
13-
Parse.initialize('integration');
14-
Parse.CoreManager.set('SERVER_URL', 'http://localhost:1337/parse');
15-
Parse.Storage._clear();
16-
clear()
17-
.then(() => {
18-
done();
19-
})
20-
.catch(done.fail);
21-
});
22-
237
it('tracks dirty arrays', done => {
248
const array = [1];
259
const object = new TestObject();

integration/test/IdempotencyTest.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22

3-
const clear = require('./clear');
43
const Parse = require('../../node');
54

65
const Item = Parse.Object.extend('IdempotencyItem');
@@ -21,14 +20,8 @@ function DuplicateXHR(requestId) {
2120
}
2221

2322
describe('Idempotency', () => {
24-
beforeEach(done => {
25-
Parse.initialize('integration', null, 'notsosecret');
26-
Parse.CoreManager.set('SERVER_URL', 'http://localhost:1337/parse');
27-
Parse.Storage._clear();
23+
beforeEach(() => {
2824
RESTController._setXHR(XHR);
29-
clear().then(() => {
30-
done();
31-
});
3225
});
3326

3427
it('handle duplicate cloud code function request', async () => {

integration/test/IncrementTest.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,9 @@
11
'use strict';
22

33
const assert = require('assert');
4-
const clear = require('./clear');
54
const Parse = require('../../node');
65

7-
const TestObject = Parse.Object.extend('TestObject');
8-
96
describe('Increment', () => {
10-
beforeEach(done => {
11-
Parse.initialize('integration');
12-
Parse.CoreManager.set('SERVER_URL', 'http://localhost:1337/parse');
13-
Parse.Storage._clear();
14-
clear()
15-
.then(() => {
16-
done();
17-
})
18-
.catch(done.fail);
19-
});
20-
217
it('can increment a field', done => {
228
const object = new TestObject();
239
object.set('score', 1);

integration/test/ParseACLTest.js

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,11 @@
11
'use strict';
22

33
const assert = require('assert');
4-
const clear = require('./clear');
54
const Parse = require('../../node');
65

7-
const TestObject = Parse.Object.extend('TestObject');
8-
96
describe('Parse.ACL', () => {
10-
beforeEach(done => {
11-
Parse.initialize('integration');
12-
Parse.CoreManager.set('SERVER_URL', 'http://localhost:1337/parse');
13-
Parse.Storage._clear();
7+
beforeEach(() => {
148
Parse.User.enableUnsafeCurrentUser();
15-
clear()
16-
.then(() => {
17-
Parse.User.logOut().then(
18-
() => {
19-
done();
20-
},
21-
() => {
22-
done();
23-
}
24-
);
25-
})
26-
.catch(done.fail);
279
});
2810

2911
it('acl must be valid', () => {
@@ -61,7 +43,7 @@ describe('Parse.ACL', () => {
6143
assert.equal(object.getACL().getPublicReadAccess(), false);
6244
assert.equal(object.getACL().getPublicWriteAccess(), false);
6345

64-
await await Parse.User.logOut();
46+
await Parse.User.logOut();
6547
try {
6648
const query = new Parse.Query(TestObject);
6749
await query.get(object.id);
@@ -214,7 +196,7 @@ describe('Parse.ACL', () => {
214196
object.getACL().setPublicReadAccess(true);
215197
await object.save();
216198

217-
Parse.User.logOut();
199+
await Parse.User.logOut();
218200
const o = await new Parse.Query(TestObject).get(object.id);
219201
assert(o);
220202
});
@@ -232,7 +214,7 @@ describe('Parse.ACL', () => {
232214
object.getACL().setPublicReadAccess(true);
233215
await object.save();
234216

235-
Parse.User.logOut();
217+
await Parse.User.logOut();
236218
const o = await new Parse.Query('AlsoUniqueObject').find();
237219

238220
assert(o.length > 0);
@@ -251,7 +233,7 @@ describe('Parse.ACL', () => {
251233
object.getACL().setPublicReadAccess(true);
252234
await object.save();
253235

254-
Parse.User.logOut();
236+
await Parse.User.logOut();
255237
object.set('score', 10);
256238
try {
257239
await object.save();
@@ -273,7 +255,7 @@ describe('Parse.ACL', () => {
273255
object.getACL().setPublicReadAccess(true);
274256
await object.save();
275257

276-
Parse.User.logOut();
258+
await Parse.User.logOut();
277259
try {
278260
await object.destroy();
279261
} catch (e) {

integration/test/ParseCloudTest.js

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,10 @@
11
'use strict';
22

33
const assert = require('assert');
4-
const clear = require('./clear');
54
const Parse = require('../../node');
65
const sleep = require('./sleep');
76

87
describe('Parse Cloud', () => {
9-
beforeAll(done => {
10-
Parse.initialize('integration', null, 'notsosecret');
11-
Parse.CoreManager.set('SERVER_URL', 'http://localhost:1337/parse');
12-
Parse.Storage._clear();
13-
clear().then(
14-
() => {
15-
done();
16-
},
17-
() => {
18-
done();
19-
}
20-
);
21-
});
22-
238
it('run function', done => {
249
const params = { key1: 'value2', key2: 'value1' };
2510
Parse.Cloud.run('bar', params)
@@ -117,8 +102,13 @@ describe('Parse Cloud', () => {
117102
let jobStatus = await Parse.Cloud.getJobStatus(jobStatusId);
118103
assert.equal(jobStatus.get('status'), 'running');
119104

120-
await sleep(2000);
121-
105+
const checkJobStatus = async () => {
106+
const result = await Parse.Cloud.getJobStatus(jobStatusId);
107+
return result && result.get('status') === 'succeeded';
108+
};
109+
while (!(await checkJobStatus())) {
110+
await sleep(100);
111+
}
122112
jobStatus = await Parse.Cloud.getJobStatus(jobStatusId);
123113
assert.equal(jobStatus.get('status'), 'succeeded');
124114
});

integration/test/ParseConfigTest.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
'use strict';
22

33
const assert = require('assert');
4-
const clear = require('./clear');
54
const Parse = require('../../node');
65

76
function testConfig() {
87
return Parse.Config.save({ internal: 'i', string: 's', number: 12 }, { internal: true });
98
}
109

1110
describe('Parse Config', () => {
12-
beforeEach(done => {
13-
Parse.initialize('integration', null, 'notsosecret');
14-
Parse.CoreManager.set('SERVER_URL', 'http://localhost:1337/parse');
15-
Parse.Storage._clear();
16-
clear().then(() => {
17-
done();
18-
});
19-
});
20-
2111
it('can create a config', async () => {
2212
const config = await testConfig();
2313

0 commit comments

Comments
 (0)