parse 4.2.0-alpha.2 → 4.2.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Parse JavaScript SDK v4.2.0-alpha.2
2
+ * Parse JavaScript SDK v4.2.0-alpha.4
3
3
  *
4
4
  * The source tree of this library can be found at
5
5
  * https://github.com/ParsePlatform/Parse-SDK-JS
@@ -264,6 +264,9 @@ function run(name /*: string*/, data /*: mixed*/, options /*: RequestOptions*/)
264
264
  if (options.sessionToken) {
265
265
  requestOptions.sessionToken = options.sessionToken;
266
266
  }
267
+ if (options.installationId) {
268
+ requestOptions.installationId = options.installationId;
269
+ }
267
270
  if (options.context && (0, _typeof2.default)(options.context) === 'object') {
268
271
  requestOptions.context = options.context;
269
272
  }
@@ -530,7 +533,7 @@ var config /*: Config & { [key: string]: mixed }*/ = {
530
533
  SERVER_AUTH_TOKEN: null,
531
534
  LIVEQUERY_SERVER_URL: null,
532
535
  ENCRYPTED_KEY: null,
533
- VERSION: 'js' + "4.2.0-alpha.2",
536
+ VERSION: 'js' + "4.2.0-alpha.4",
534
537
  APPLICATION_ID: null,
535
538
  JAVASCRIPT_KEY: null,
536
539
  MASTER_KEY: null,
@@ -15777,6 +15780,40 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
15777
15780
  return user.logIn(options);
15778
15781
  }
15779
15782
 
15783
+ /**
15784
+ * Logs in a user with a username (or email) and password, and authData. On success, this
15785
+ * saves the session to disk, so you can retrieve the currently logged in
15786
+ * user using <code>current</code>.
15787
+ *
15788
+ * @param {string} username The username (or email) to log in with.
15789
+ * @param {string} password The password to log in with.
15790
+ * @param {object} authData The authData to log in with.
15791
+ * @param {object} options
15792
+ * @static
15793
+ * @returns {Promise} A promise that is fulfilled with the user when
15794
+ * the login completes.
15795
+ */
15796
+ }, {
15797
+ key: "logInWithAdditionalAuth",
15798
+ value: function (username /*: string*/, password /*: string*/, authData /*: AuthData*/, options /*:: ?: FullOptions*/) {
15799
+ if (typeof username !== 'string') {
15800
+ return _promise.default.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Username must be a string.'));
15801
+ }
15802
+ if (typeof password !== 'string') {
15803
+ return _promise.default.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Password must be a string.'));
15804
+ }
15805
+ if (Object.prototype.toString.call(authData) !== '[object Object]') {
15806
+ return _promise.default.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Auth must be an object.'));
15807
+ }
15808
+ var user = new this();
15809
+ user._finishFetch({
15810
+ username: username,
15811
+ password: password,
15812
+ authData: authData
15813
+ });
15814
+ return user.logIn(options);
15815
+ }
15816
+
15780
15817
  /**
15781
15818
  * Logs in a user with an objectId. On success, this saves the session
15782
15819
  * to disk, so you can retrieve the currently logged in user using
@@ -16226,7 +16263,8 @@ var DefaultController = {
16226
16263
  var stateController = _CoreManager.default.getObjectStateController();
16227
16264
  var auth = {
16228
16265
  username: user.get('username'),
16229
- password: user.get('password')
16266
+ password: user.get('password'),
16267
+ authData: user.get('authData')
16230
16268
  };
16231
16269
  return RESTController.request(options.usePost ? 'POST' : 'GET', 'login', auth, options).then(function (response) {
16232
16270
  user._migrateId(response.objectId);