Skip to content

updated master #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 114 commits into from
Jan 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
d3d554f
Update eslint-plugin-flowtype to the latest version 🚀 (#886)
greenkeeper[bot] Aug 9, 2019
b41f9bd
Update core-js to the latest version 🚀 (#887)
greenkeeper[bot] Aug 12, 2019
2c5f8a1
Update ws to the latest version 🚀 (#888)
greenkeeper[bot] Aug 12, 2019
1772e57
Add Cloud Code guide to README (#890)
dplewis Aug 14, 2019
ddefce3
Update babel-plugin-minify-dead-code-elimination to the latest versio…
greenkeeper[bot] Aug 15, 2019
862c2f5
Update uuid to the latest version 🚀 (#894)
greenkeeper[bot] Aug 19, 2019
3af83ea
fix become for subclass (#897)
kzmeyao Aug 21, 2019
f9a397b
Support object.exists() (#898)
dplewis Aug 22, 2019
ae5d64a
Support fetchAllIfNeededWithInclude (#900)
dplewis Aug 23, 2019
1f2e5b3
Update babel-eslint to the latest version 🚀 (#902)
greenkeeper[bot] Aug 25, 2019
6dc7ea3
⚡️ Release v2.7.0 (#903)
douglasmuraoka Aug 28, 2019
533f5ad
Update eslint to the latest version 🚀 (#904)
greenkeeper[bot] Aug 30, 2019
c6e28b5
Update cross-env to the latest version 🚀 (#905)
greenkeeper[bot] Sep 2, 2019
074f651
Update eslint-plugin-flowtype to the latest version 🚀 (#906)
greenkeeper[bot] Sep 3, 2019
2fc8da0
Add support to get parse config with master key (#907)
mtrezza Sep 5, 2019
b37d687
Add master-key-only option when saving config parameter (#910)
mtrezza Sep 6, 2019
8bd9152
Update @babel/runtime-corejs3 to the latest version 🚀 (#914)
greenkeeper[bot] Sep 6, 2019
5da963e
Update babel7 to the latest version 🚀 (#915)
greenkeeper[bot] Sep 6, 2019
719e98f
⚡️ Release v2.7.1 (#912)
dplewis Sep 7, 2019
82de635
(Docs) Query.limit remove maximum value. (#919)
dplewis Sep 10, 2019
3826fb0
Update eslint to the latest version 🚀 (#923)
greenkeeper[bot] Sep 14, 2019
c7f4af8
Update cross-env to the latest version 🚀 (#927)
greenkeeper[bot] Sep 17, 2019
c48eb69
Update codecov to the latest version 🚀 (#928)
greenkeeper[bot] Sep 20, 2019
3cfcd4e
Update codecov to the latest version 🚀 (#929)
greenkeeper[bot] Sep 20, 2019
28b233f
Update jasmine to the latest version 🚀 (#931)
greenkeeper[bot] Sep 21, 2019
21c88cb
Update @babel/runtime-corejs3 to the latest version 🚀 (#932)
greenkeeper[bot] Sep 23, 2019
68bb901
Update babel7 to the latest version 🚀 (#933)
greenkeeper[bot] Sep 23, 2019
f665ef9
Update eslint to the latest version 🚀 (#935)
greenkeeper[bot] Sep 29, 2019
7fae640
Update eslint to the latest version 🚀 (#937)
greenkeeper[bot] Oct 1, 2019
e202006
Update cross-env to the latest version 🚀 (#938)
greenkeeper[bot] Oct 1, 2019
fee4976
Update cross-env to the latest version 🚀 (#940)
greenkeeper[bot] Oct 2, 2019
5ee76a9
Update @babel/runtime-corejs3 to the latest version 🚀 (#944)
greenkeeper[bot] Oct 8, 2019
d0dbdff
Update babel7 to the latest version 🚀 (#945)
greenkeeper[bot] Oct 8, 2019
18fd502
Fix require EventEmitter (#946)
KarlosQ Oct 9, 2019
55e5bd2
Support compiling on Windows (#947)
dplewis Oct 10, 2019
1e3bb91
Fix deleteIndex and deleteField in ParseSchema (#949)
JeffGuKang Oct 10, 2019
cd76082
Update babel7 to the latest version 🚀 (#950)
greenkeeper[bot] Oct 10, 2019
6f8327c
Support ParseFile upload cancel (#948)
dplewis Oct 11, 2019
23be6cd
Update core-js to the latest version 🚀 (#952)
greenkeeper[bot] Oct 13, 2019
3a255bf
Update core-js to the latest version 🚀 (#953)
greenkeeper[bot] Oct 13, 2019
8ee9c14
Update core-js to the latest version 🚀 (#954)
greenkeeper[bot] Oct 14, 2019
dc26b15
Generate _localId as UUID (#956)
dplewis Oct 15, 2019
892636c
Support Parse.File getData cancel (#951)
dplewis Oct 15, 2019
b8b75ef
⚡️ Release v2.8.0 (#957)
dplewis Oct 15, 2019
7c5b0d9
Fix: Remove options from Parse.Schema (#959)
dplewis Oct 15, 2019
41db1dc
Set Class Level Permission via Parse.Schema (#960)
dplewis Oct 16, 2019
7ff9f92
Parse.Schema required fields and defaultValues (#961)
dplewis Oct 16, 2019
38286f2
Missing documentation for Custom Auth (#963)
dplewis Oct 18, 2019
c327a34
Update ws to the latest version 🚀 (#964)
greenkeeper[bot] Oct 19, 2019
e1a89a8
Update core-js to the latest version 🚀 (#965)
greenkeeper[bot] Oct 21, 2019
0bdc4b5
Update core-js to the latest version 🚀 (#969)
greenkeeper[bot] Oct 25, 2019
68dd423
Update eslint to the latest version 🚀 (#970)
greenkeeper[bot] Oct 25, 2019
103f05e
User subclass for loginWith, hydrate, me (#968)
dplewis Oct 26, 2019
aa3d6e6
Can unlink without provider (cloud code) (#971)
dplewis Oct 27, 2019
450bbf7
Generate installationId as UUID (#972)
dplewis Oct 28, 2019
d7a2a67
Update core-js to the latest version 🚀 (#973)
greenkeeper[bot] Oct 28, 2019
bcd8646
Update core-js to the latest version 🚀 (#975)
greenkeeper[bot] Oct 31, 2019
ebc1081
Add installationId to LiveQuery (#977)
dplewis Nov 4, 2019
276a736
Add response object to live query (#979)
dplewis Nov 5, 2019
33d8e30
Update @babel/runtime-corejs3 to the latest version 🚀 (#980)
greenkeeper[bot] Nov 5, 2019
6551ef6
Update babel7 to the latest version 🚀 (#981)
greenkeeper[bot] Nov 5, 2019
1bdcd0a
Update @babel/runtime-corejs3 to the latest version 🚀 (#982)
greenkeeper[bot] Nov 5, 2019
5245daa
Update babel7 to the latest version 🚀 (#983)
greenkeeper[bot] Nov 5, 2019
d42cd14
Properly store User Subclass in Storage (#978)
dplewis Nov 5, 2019
fe5e21a
Reuse StorageController for LDS (#984)
dplewis Nov 6, 2019
a107989
Add test case to Issue Template (#986)
dplewis Nov 6, 2019
569b12a
Update core-js to the latest version 🚀 (#988)
greenkeeper[bot] Nov 6, 2019
d3ab1ce
Support query.map, query.filter, query.reduce (#987)
dplewis Nov 6, 2019
570d6b3
Update @babel/runtime-corejs3 to the latest version 🚀 (#989)
greenkeeper[bot] Nov 6, 2019
f66a297
Update babel7 to the latest version 🚀 (#990)
greenkeeper[bot] Nov 7, 2019
6227aa9
⚡️ Release v2.9.0 (#991)
dplewis Nov 7, 2019
5030a13
README fix links
dplewis Nov 7, 2019
1779a72
Update core-js to the latest version 🚀 (#993)
greenkeeper[bot] Nov 12, 2019
7c918ee
Update eslint-plugin-flowtype to the latest version 🚀 (#994)
greenkeeper[bot] Nov 12, 2019
8a0ac96
Update eslint-plugin-flowtype to the latest version 🚀 (#995)
greenkeeper[bot] Nov 12, 2019
3a66086
Update eslint-plugin-flowtype to the latest version 🚀 (#996)
greenkeeper[bot] Nov 12, 2019
6ef0a4b
Fix #992 (#999)
dplewis Nov 14, 2019
a9c3000
⚡️ Release v2.9.1 (#1000)
dplewis Nov 14, 2019
209f35b
LDS: query.fromNetwork() (#1002)
dplewis Nov 20, 2019
bd861bf
Update core-js to the latest version 🚀 (#1005)
greenkeeper[bot] Nov 21, 2019
7f8dfa5
Update eslint to the latest version 🚀 (#1006)
greenkeeper[bot] Nov 22, 2019
566f29a
Update @babel/runtime-corejs3 to the latest version 🚀 (#1008)
greenkeeper[bot] Nov 22, 2019
728c43e
Support query.cancel() (#1003)
dplewis Nov 23, 2019
f140227
Update babel7 to the latest version 🚀 (#1009)
greenkeeper[bot] Nov 23, 2019
d110617
Merge pull request from GHSA-wvh7-5p38-2qfc
dplewis Nov 23, 2019
61e4522
Update eslint-plugin-flowtype to the latest version 🚀 (#1010)
greenkeeper[bot] Nov 24, 2019
a145e78
Update eslint-plugin-flowtype to the latest version 🚀 (#1011)
greenkeeper[bot] Nov 24, 2019
97a0350
Update eslint to the latest version 🚀 (#1012)
greenkeeper[bot] Nov 25, 2019
be59db6
Update eslint to the latest version 🚀 (#1015)
greenkeeper[bot] Nov 30, 2019
fc0edb5
Update core-js to the latest version 🚀 (#1013)
greenkeeper[bot] Dec 2, 2019
fa7d39e
Update core-js to the latest version 🚀 (#1016)
greenkeeper[bot] Dec 2, 2019
028273b
Update core-js to the latest version 🚀 (#1017)
greenkeeper[bot] Dec 2, 2019
3316ac9
Fix https://github.com/parse-community/Parse-SDK-JS/issues/992 (#1018)
dplewis Dec 2, 2019
e203056
Support custom request headers (#1019)
dplewis Dec 3, 2019
db341e4
⚡️ Release v2.10.0 (#1020)
dplewis Dec 3, 2019
813c6e6
Update @babel/runtime-corejs3 to the latest version 🚀 (#1023)
greenkeeper[bot] Dec 6, 2019
bcdbd32
Update babel7 to the latest version 🚀 (#1024)
greenkeeper[bot] Dec 6, 2019
97e3059
Update gulp-rename to the latest version 🚀 (#1022)
greenkeeper[bot] Dec 7, 2019
67183d6
Update @babel/runtime-corejs3 to the latest version 🚀 (#1025)
greenkeeper[bot] Dec 8, 2019
df19ad9
Update babel7 to the latest version 🚀 (#1026)
greenkeeper[bot] Dec 8, 2019
272c4a8
Update core-js to the latest version 🚀 (#1028)
greenkeeper[bot] Dec 8, 2019
bdbd385
Improve file upload progress (#1029)
dplewis Dec 10, 2019
e974daf
Support query.cancel() on Node (#1030)
dplewis Dec 11, 2019
5625eb1
User signup with installationId (#1031)
dplewis Dec 11, 2019
9bacf08
Update core-js to the latest version 🚀 (#1032)
greenkeeper[bot] Dec 12, 2019
1ce1b6b
Update ws to the latest version 🚀 (#1033)
greenkeeper[bot] Dec 14, 2019
54a8417
Fixes logo don't being added to /out (#1035)
ivnnv Dec 17, 2019
6b4e02c
Update core-js to the latest version 🚀 (#1037)
greenkeeper[bot] Dec 19, 2019
9d73eb7
Update @babel/runtime-corejs3 to the latest version 🚀 (#1038)
greenkeeper[bot] Dec 19, 2019
27aba6f
Update babel7 to the latest version 🚀 (#1039)
greenkeeper[bot] Dec 22, 2019
fc840f6
Update eslint to the latest version 🚀 (#1041)
greenkeeper[bot] Dec 22, 2019
684b9e1
Encrypted Current User in browser (#1036)
macarthuror Dec 24, 2019
ecd7ced
⚡️ Release v2.11.0 (#1043)
dplewis Dec 24, 2019
6dc6e5c
Update core-js to the latest version 🚀 (#1044)
greenkeeper[bot] Dec 26, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/---report-an-issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ You may also search through existing issues before opening a new one: https://gi

<!--- What is happening instead. --->

### Test Case

To accurately reproduce your issue. Add your test cases [here](https://github.com/parse-community/Parse-SDK-JS/tree/master/integration/test) and read the [Contributing Guide](https://github.com/parse-community/Parse-SDK-JS/blob/master/CONTRIBUTING.md) to run the tests.

### Environment Setup

- **Server**
Expand Down
File renamed without changes
97 changes: 96 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,102 @@
# Parse-SDK-JS

### master
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.6.0...master)
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.11.0...master)

## 2.11.0
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.10.0...2.11.0)

**New Features**
- Support encrypting current user ([#1036](https://github.com/parse-community/Parse-SDK-JS/pull/1036))
- File Upload Progress on Wechat ([#1029](https://github.com/parse-community/Parse-SDK-JS/pull/1029))

**Improvements**
- Support query.cancel() on Node ([#1030](https://github.com/parse-community/Parse-SDK-JS/pull/1030))

**Fixes**
- File Upload Progress on browser ([#1029](https://github.com/parse-community/Parse-SDK-JS/pull/1029))
- User signup with installationId ([#1031](https://github.com/parse-community/Parse-SDK-JS/pull/1031))

## 2.10.0
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.9.1...2.10.0)

**New Features**
- Add query.fromNetwork() ([#1002](https://github.com/parse-community/Parse-SDK-JS/pull/1002))
- Add query.cancel() (browser only) ([#1003](https://github.com/parse-community/Parse-SDK-JS/pull/1003))
- Support custom request headers ([#1019](https://github.com/parse-community/Parse-SDK-JS/pull/1019))

**Fixes**
- To subclass Parse.User: `Parse.Object.registerSubclass('_User', CustomUser);`

**Security**
Address Security Advisory of possible leak of sensitive user info. ([#d110617](https://github.com/parse-community/Parse-SDK-JS/commit/d1106174571b699f972929dd7cbb8e45b5283cbb)), big thanks to [Colin Ulin](https://github.com/pocketcolin) for identifying the problem, following the vulnerability disclosure guidelines

## 2.9.1
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.9.0...2.9.1)

**Fixes**
- Storing user to disk ([#992](https://github.com/parse-community/Parse-SDK-JS/issues/992)) ([#999](https://github.com/parse-community/Parse-SDK-JS/pull/999))

## 2.9.0
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.8.0...2.9.0)

**Deprecation**
`_linkWith` and `_logInWith` are deprecated. Replace with `linkWith` and `logInWith` respectively. ([#963](https://github.com/parse-community/Parse-SDK-JS/pull/963))

**New Features**
- Set Class Level Permission via Parse.Schema ([#960](https://github.com/parse-community/Parse-SDK-JS/pull/960))
- Set required fields and default values via Parse.Schema ([#961](https://github.com/parse-community/Parse-SDK-JS/pull/961))
- Add installationId to LiveQuery ([#977](https://github.com/parse-community/Parse-SDK-JS/pull/977))
- Add response object to LiveQuery ([#979](https://github.com/parse-community/Parse-SDK-JS/pull/979))
- Support query.map, query.filter, query.reduce ([#987](https://github.com/parse-community/Parse-SDK-JS/pull/987))

**Fixes**
- Can unlink without provider in cloud code ([#971](https://github.com/parse-community/Parse-SDK-JS/pull/971))
- Properly store User Subclass in Storage ([#978](https://github.com/parse-community/Parse-SDK-JS/pull/978))

**Improvements**
- User subclass support for logInWith, hydrate, me, current ([#968](https://github.com/parse-community/Parse-SDK-JS/pull/968))
- Remove unused options from Parse.Schema ([#959](https://github.com/parse-community/Parse-SDK-JS/pull/959))
- Documentation for linking users and custom auth ([#963](https://github.com/parse-community/Parse-SDK-JS/pull/963))
- Generate installationId as uuid v4 ([#972](https://github.com/parse-community/Parse-SDK-JS/pull/972))
- Reuse StorageController for LDS ([#984](https://github.com/parse-community/Parse-SDK-JS/pull/984))

## 2.8.0
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.7.1...2.8.0)

**New Features**
- Parse.File save cancel ([#948](https://github.com/parse-community/Parse-SDK-JS/pull/948))
- Parse.File getData cancel ([#951](https://github.com/parse-community/Parse-SDK-JS/pull/951))

**Fixes**
- React Native Emitter module ([#946](https://github.com/parse-community/Parse-SDK-JS/pull/946))
- Parse.Schema deleteIndex, deleteField returns Parse.Schema ([#949](https://github.com/parse-community/Parse-SDK-JS/pull/949))

**Improvements**
- Compiling on Windows ([#947](https://github.com/parse-community/Parse-SDK-JS/pull/947))
- Generate _localId as UUID ([#956](https://github.com/parse-community/Parse-SDK-JS/pull/956))

## 2.7.1
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.7.0...2.7.1)

**New Features**
- Support for `ParseConfig.save` with `masterKeyOnlyFlags` option ([#910](https://github.com/parse-community/Parse-SDK-JS/pull/910)) (Requires Parse-Server 3.8.0+)
- Support for `ParseConfig.get` with `useMasterKey` option ([#907](https://github.com/parse-community/Parse-SDK-JS/pull/907))

## 2.7.0
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.6.0...2.7.0)

**New Features**
- Support for `ParseObject.fetchAllIfNeededWithInclude` ([#900](https://github.com/parse-community/Parse-SDK-JS/pull/900))
- Support for `ParseObject.exists` ([#898](https://github.com/parse-community/Parse-SDK-JS/pull/898))
- Support for `ParseObject.save` with `cascadeSave` option ([#881](https://github.com/parse-community/Parse-SDK-JS/pull/881))

**Fixes**
- `ParseUser.become` should return subclass ([#897](https://github.com/parse-community/Parse-SDK-JS/pull/897))
- Ensure LiveQuery subscribes before returning subscription ([#878](https://github.com/parse-community/Parse-SDK-JS/pull/878))

**Improvements**
- Remove deprecated `@babel/polyfill` ([#877](https://github.com/parse-community/Parse-SDK-JS/pull/877))

## 2.6.0
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.5.1...2.6.0)
Expand Down
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The Parse JS SDK is built for three platforms:
- nodejs
- react-native

When developing the SDK you can use `npm run watch` in order to rebuild your changes upon each saves.
When developing the SDK you can use `npm run watch` in order to rebuild your changes upon each save.

By default, the watch command will rebuild the SDK for the browser platform. The following commands will rebuild changes for a specific platform.

Expand All @@ -44,7 +44,7 @@ By default, the watch command will rebuild the SDK for the browser platform. The

### Testing the code

The SDK is tested through two lenses. unit tests are run with jest and integrationt tests with jasmine.
The SDK is tested through two lenses. unit tests are run with jest and integration tests with jasmine.

Two different frameworks are used as the integration tests leverage a stateful server, with the data saved into the database, and Jest is running many tests in parallel, which makes it incompatible with our integration tests.

Expand All @@ -54,12 +54,11 @@ Those tests are located in [/src/__tests__](/src/__tests__) and are responsible

To run unit tests, run `npm test`. If you have the vscode Jest plugin extension (as recommended), you can run your tests by clicking the *Debug* lens that appears near by the test.


#### Integration tests

Those tests are located in [/integration/test](/integration/test) and are responsible for ensuring a proper communication with parse-server. With the integration tests, we ensure all communications between the SDK and the server are behaving accordingly.

To run the integtation tests, you will need a valid mongodb running on your local machine. You can get easily mongodb running with `mongodb-runner` (see [Recommended setup](#recommended-setup)).
To run the integration tests, you will need a valid mongodb running on your local machine. You can get easily mongodb running with `mongodb-runner` (see [Recommended setup](#recommended-setup)).

Use `npm run integration` in order to run the integration tests. If you have the vscode Jasmine extension installed (as recommended), you can run your tests by clicking the *Run* or the *Debug* lens that appears near by the test.

Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<p align="center">
<img alt="Parse Platform" src="Assets/logo large.png" width="200">
</a>
<img alt="Parse Platform" src="Assets/img/logo_large.png" width="200">
</p>

<h2 align="center">Parse SDK for JavaScript</h2>
Expand All @@ -26,7 +25,7 @@
</p>
<br>

For more information on Parse and its features, see [the website](https://parseplatform.org), [the JavaScript guide](https://docs.parseplatform.org/js/guide/) or [API Reference](https://parseplatform.org/Parse-SDK-JS/api/).
For more information on Parse and its features, see [the website](https://parseplatform.org), [the JavaScript guide](https://docs.parseplatform.org/js/guide/), [the Cloud Code guide](https://docs.parseplatform.org/cloudcode/guide/) or [API Reference](https://parseplatform.org/Parse-SDK-JS/api/).

## Getting Started

Expand Down Expand Up @@ -80,6 +79,10 @@ With Parse SDK 2.0.0, gone are the backbone style callbacks and Parse.Promises.

We have curated a [migration guide](2.0.0.md) that should help you migrate your code.

## 3rd Party Authentications

Parse Server supports many [3rd Party Authenications][3rd-party-auth]. It is possible to [linkWith][link-with] any 3rd Party Authentication by creating a [custom authentication module][custom-auth-module].

## Want to ride the bleeding edge?

We recommend using the most recent tagged build published to npm for production. However, you can test not-yet-released versions of the Parse-SDK-JS by referencing specific branches in your `package.json`. For example, to use the master branch:
Expand Down Expand Up @@ -116,6 +119,8 @@ of patent rights can be found in the PATENTS file in the same directory.
-----
As of April 5, 2017, Parse, LLC has transferred this code to the parse-community organization, and will no longer be contributing to or distributing this code.

[types-parse]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/parse

[open-collective-link]: https://opencollective.com/parse-server
[3rd-party-auth]: http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication
[custom-auth-module]: https://docs.parseplatform.org/js/guide/#custom-authentication-module
[link-with]: https://docs.parseplatform.org/js/guide/#linking-users
[open-collective-link]: https://opencollective.com/parse-server
[types-parse]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/parse
51 changes: 51 additions & 0 deletions build_releases.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
const pkg = require('./package.json');
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');

const rmDir = function(dirPath) {
if(fs.existsSync(dirPath)) {
const files = fs.readdirSync(dirPath);
files.forEach(function(file) {
const curPath = path.join(dirPath, file);
if(fs.lstatSync(curPath).isDirectory()) {
rmDir(curPath);
} else {
fs.unlinkSync(curPath);
}
});
fs.rmdirSync(dirPath);
}
};

const exec = function(cmd) {
execSync(cmd, { stdio: 'inherit' });
};

console.log(`Building JavaScript SDK v${pkg.version}...\n`)

console.log('Cleaning up old builds...\n');

rmDir(path.join(__dirname, 'dist'));
rmDir(path.join(__dirname, 'lib'));

const crossEnv = 'npm run cross-env';
const gulp = 'npm run gulp';

console.log('Browser Release:');
exec(`${crossEnv} PARSE_BUILD=browser ${gulp} compile`);

console.log('Weapp Release:');
exec(`${crossEnv} PARSE_BUILD=weapp ${gulp} compile`);

console.log('Node.js Release:');
exec(`${crossEnv} PARSE_BUILD=node ${gulp} compile`);

console.log('React Native Release:');
exec(`${crossEnv} PARSE_BUILD=react-native ${gulp} compile`);

console.log('Bundling and minifying for CDN distribution:');
exec(`${gulp} browserify`);
exec(`${gulp} browserify-weapp`);
exec(`${gulp} minify`);
exec(`${gulp} minify-weapp`);
21 changes: 0 additions & 21 deletions build_releases.sh

This file was deleted.

57 changes: 57 additions & 0 deletions integration/test/ParseConfigTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
'use strict';

const assert = require('assert');
const clear = require('./clear');
const Parse = require('../../node');

function testConfig() {
return Parse.Config.save(
{ internal: "i", string: "s", number: 12 },
{ internal: true }
);
}

describe('Parse Config', () => {
beforeEach((done) => {
Parse.initialize('integration', null, 'notsosecret');
Parse.CoreManager.set('SERVER_URL', 'http://localhost:1337/parse');
Parse.Storage._clear();
clear().then(() => {
done();
});
});

it('can create a config', async () => {
const config = await testConfig();

assert.notStrictEqual(config, undefined);
assert.strictEqual(config.get('string'), 's');
assert.strictEqual(config.get('internal'), 'i');
assert.strictEqual(config.get('number'), 12);
});

it('can get a config', async () => {
await testConfig();

const config = await Parse.Config.get();
assert.notStrictEqual(config, undefined);
assert.strictEqual(config.get('string'), 's');
assert.strictEqual(config.get('number'), 12);
});

it('can get internal config parameter with masterkey', async () => {
await testConfig();

const config = await Parse.Config.get({ useMasterKey: true });
assert.equal(config.get('internal'), 'i');
assert.equal(config.get('string'), 's');
});

it('cannot get internal config parameter without masterkey', async () => {
await testConfig();

const config = await Parse.Config.get();
assert.equal(config.get('internal'), undefined);
assert.equal(config.get('string'), 's');
});
});
10 changes: 10 additions & 0 deletions integration/test/ParseFileTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ describe('Parse.File', () => {
assert.equal(file2.url(), result.get('file2').url());
});

it('can cancel save file with uri', async () => {
const parseLogo = 'https://raw.githubusercontent.com/parse-community/parse-server/master/.github/parse-server-logo.png';
const file = new Parse.File('parse-server-logo', { uri: parseLogo });
file.save().then(() => {
assert.equal(file.name(), undefined);
assert.equal(file.url(), undefined);
});
file.cancel();
});

it('can not get data from unsaved file', async () => {
const file = new Parse.File('parse-server-logo', [61, 170, 236, 120]);
file._data = null;
Expand Down
8 changes: 6 additions & 2 deletions integration/test/ParseLiveQueryTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ describe('Parse LiveQuery', () => {
it('can subscribe to query', async (done) => {
const object = new TestObject();
await object.save();
const installationId = await Parse.CoreManager.getInstallationController().currentInstallationId();

const query = new Parse.Query(TestObject);
query.equalTo('objectId', object.id);
const subscription = await query.subscribe();

subscription.on('update', object => {
subscription.on('update', (object, original, response) => {
assert.equal(object.get('foo'), 'bar');
assert.equal(response.installationId, installationId);
done();
})
object.set({ foo: 'bar' });
Expand All @@ -36,6 +38,7 @@ describe('Parse LiveQuery', () => {
it('can subscribe to query with client', async (done) => {
const object = new TestObject();
await object.save();
const installationId = await Parse.CoreManager.getInstallationController().currentInstallationId();

const query = new Parse.Query(TestObject);
query.equalTo('objectId', object.id);
Expand All @@ -45,8 +48,9 @@ describe('Parse LiveQuery', () => {
}
const subscription = client.subscribe(query);

subscription.on('update', object => {
subscription.on('update', (object, original, response) => {
assert.equal(object.get('foo'), 'bar');
assert.equal(response.installationId, installationId);
done();
});
await subscription.subscribePromise;
Expand Down
4 changes: 2 additions & 2 deletions integration/test/ParseLocalDatastoreTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -2688,6 +2688,7 @@ describe('Parse LocalDatastore', () => {
beforeEach((done) => {
Parse.initialize('integration', null, 'notsosecret');
Parse.CoreManager.set('SERVER_URL', 'http://localhost:1337/parse');
Parse.CoreManager.getInstallationController()._setInstallationIdCache('1234');
Parse.enableLocalDatastore();
Parse.User.enableUnsafeCurrentUser();
Parse.Storage._clear();
Expand All @@ -2697,8 +2698,7 @@ describe('Parse LocalDatastore', () => {
});

const controllers = [
{ name: 'Default', file: '../../lib/node/LocalDatastoreController.default' },
{ name: 'Browser', file: '../../lib/node/LocalDatastoreController.browser' },
{ name: 'Default', file: '../../lib/node/LocalDatastoreController' },
{ name: 'React-Native', file: '../../lib/node/LocalDatastoreController.react-native' },
];

Expand Down
Loading