Skip to content

Commit 3ca33ed

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 5907021 + e0a4da2 commit 3ca33ed

Some content is hidden

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

57 files changed

+4154
-1471
lines changed

CHANGELOG.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,34 @@
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.0.0...master)
5+
6+
## 3.0.0
7+
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.19.0...3.0.0)
8+
9+
**Breaking Changes**
10+
For security purposes, logIn will default to `POST` instead of `GET` method. ([#1284](https://github.com/parse-community/Parse-SDK-JS/pull/1284))
11+
12+
If you need to use `GET` set the `usePost` option to false.
13+
14+
`Parse.User.logIn('username', 'password', { usePost: false })`
15+
16+
**Features**
17+
- Add EventuallyQueue API, object.saveEventually, object.destroyEventually ([#1291](https://github.com/parse-community/Parse-SDK-JS/pull/1291))
18+
- Add Parse.CLP Object to control ClassLevelPermissions ([#1145](https://github.com/parse-community/Parse-SDK-JS/pull/1145))
19+
- Add option `{ json: true }` on queries ([#1294](https://github.com/parse-community/Parse-SDK-JS/pull/1294))
20+
- Add IndexedDB Storage Controller ([#1297](https://github.com/parse-community/Parse-SDK-JS/pull/1297))
21+
- Parse.User.isCurrentAsync() for async storage ([#1298](https://github.com/parse-community/Parse-SDK-JS/pull/1298))
22+
23+
**Improvements**
24+
- Add useMasterKey option to Parse.File.destroy() ([#1285](https://github.com/parse-community/Parse-SDK-JS/pull/1285))
25+
- User management on React-Native ([#1298](https://github.com/parse-community/Parse-SDK-JS/pull/1298))
26+
27+
**Fixes**
28+
- Allow connect to LiveQuery with null fields ([#1282](https://github.com/parse-community/Parse-SDK-JS/pull/1282))
29+
- fromJSON: Return date if value is type `Date` ([#1293](https://github.com/parse-community/Parse-SDK-JS/pull/1293))
30+
- fromJSON: Allow keys to dirty, allows save fromJSON ([#1295](https://github.com/parse-community/Parse-SDK-JS/pull/1295))
31+
- Parse.Schema.addField accepts Pointer and Relation types ([#1281](https://github.com/parse-community/Parse-SDK-JS/pull/1281))
532

633
## 2.19.0
734
[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: 0 additions & 15 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)

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)