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.
@@ -56,6 +56,9 @@ function run(name /*: string*/, data /*: mixed*/, options /*: RequestOptions*/)
56
56
  if (options.sessionToken) {
57
57
  requestOptions.sessionToken = options.sessionToken;
58
58
  }
59
+ if (options.installationId) {
60
+ requestOptions.installationId = options.installationId;
61
+ }
59
62
  if (options.context && (0, _typeof2.default)(options.context) === 'object') {
60
63
  requestOptions.context = options.context;
61
64
  }
@@ -182,7 +182,7 @@ var config /*: Config & { [key: string]: mixed }*/ = {
182
182
  SERVER_AUTH_TOKEN: null,
183
183
  LIVEQUERY_SERVER_URL: null,
184
184
  ENCRYPTED_KEY: null,
185
- VERSION: 'js' + "4.2.0-alpha.2",
185
+ VERSION: 'js' + "4.2.0-alpha.4",
186
186
  APPLICATION_ID: null,
187
187
  JAVASCRIPT_KEY: null,
188
188
  MASTER_KEY: null,
@@ -880,6 +880,40 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
880
880
  return user.logIn(options);
881
881
  }
882
882
 
883
+ /**
884
+ * Logs in a user with a username (or email) and password, and authData. On success, this
885
+ * saves the session to disk, so you can retrieve the currently logged in
886
+ * user using <code>current</code>.
887
+ *
888
+ * @param {string} username The username (or email) to log in with.
889
+ * @param {string} password The password to log in with.
890
+ * @param {object} authData The authData to log in with.
891
+ * @param {object} options
892
+ * @static
893
+ * @returns {Promise} A promise that is fulfilled with the user when
894
+ * the login completes.
895
+ */
896
+ }, {
897
+ key: "logInWithAdditionalAuth",
898
+ value: function (username /*: string*/, password /*: string*/, authData /*: AuthData*/, options /*:: ?: FullOptions*/) {
899
+ if (typeof username !== 'string') {
900
+ return _promise.default.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Username must be a string.'));
901
+ }
902
+ if (typeof password !== 'string') {
903
+ return _promise.default.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Password must be a string.'));
904
+ }
905
+ if (Object.prototype.toString.call(authData) !== '[object Object]') {
906
+ return _promise.default.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Auth must be an object.'));
907
+ }
908
+ var user = new this();
909
+ user._finishFetch({
910
+ username: username,
911
+ password: password,
912
+ authData: authData
913
+ });
914
+ return user.logIn(options);
915
+ }
916
+
883
917
  /**
884
918
  * Logs in a user with an objectId. On success, this saves the session
885
919
  * to disk, so you can retrieve the currently logged in user using
@@ -1329,7 +1363,8 @@ var DefaultController = {
1329
1363
  var stateController = _CoreManager.default.getObjectStateController();
1330
1364
  var auth = {
1331
1365
  username: user.get('username'),
1332
- password: user.get('password')
1366
+ password: user.get('password'),
1367
+ authData: user.get('authData')
1333
1368
  };
1334
1369
  return RESTController.request(options.usePost ? 'POST' : 'GET', 'login', auth, options).then(function (response) {
1335
1370
  user._migrateId(response.objectId);
package/lib/node/Cloud.js CHANGED
@@ -56,6 +56,9 @@ function run(name /*: string*/, data /*: mixed*/, options /*: RequestOptions*/)
56
56
  if (options.sessionToken) {
57
57
  requestOptions.sessionToken = options.sessionToken;
58
58
  }
59
+ if (options.installationId) {
60
+ requestOptions.installationId = options.installationId;
61
+ }
59
62
  if (options.context && typeof options.context === 'object') {
60
63
  requestOptions.context = options.context;
61
64
  }
@@ -179,7 +179,7 @@ const config /*: Config & { [key: string]: mixed }*/ = {
179
179
  SERVER_AUTH_TOKEN: null,
180
180
  LIVEQUERY_SERVER_URL: null,
181
181
  ENCRYPTED_KEY: null,
182
- VERSION: 'js' + "4.2.0-alpha.2",
182
+ VERSION: 'js' + "4.2.0-alpha.4",
183
183
  APPLICATION_ID: null,
184
184
  JAVASCRIPT_KEY: null,
185
185
  MASTER_KEY: null,
@@ -638,6 +638,38 @@ class ParseUser extends _ParseObject.default {
638
638
  return user.logIn(options);
639
639
  }
640
640
 
641
+ /**
642
+ * Logs in a user with a username (or email) and password, and authData. On success, this
643
+ * saves the session to disk, so you can retrieve the currently logged in
644
+ * user using <code>current</code>.
645
+ *
646
+ * @param {string} username The username (or email) to log in with.
647
+ * @param {string} password The password to log in with.
648
+ * @param {object} authData The authData to log in with.
649
+ * @param {object} options
650
+ * @static
651
+ * @returns {Promise} A promise that is fulfilled with the user when
652
+ * the login completes.
653
+ */
654
+ static logInWithAdditionalAuth(username /*: string*/, password /*: string*/, authData /*: AuthData*/, options /*:: ?: FullOptions*/) {
655
+ if (typeof username !== 'string') {
656
+ return Promise.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Username must be a string.'));
657
+ }
658
+ if (typeof password !== 'string') {
659
+ return Promise.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Password must be a string.'));
660
+ }
661
+ if (Object.prototype.toString.call(authData) !== '[object Object]') {
662
+ return Promise.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Auth must be an object.'));
663
+ }
664
+ const user = new this();
665
+ user._finishFetch({
666
+ username: username,
667
+ password: password,
668
+ authData
669
+ });
670
+ return user.logIn(options);
671
+ }
672
+
641
673
  /**
642
674
  * Logs in a user with an objectId. On success, this saves the session
643
675
  * to disk, so you can retrieve the currently logged in user using
@@ -1049,7 +1081,8 @@ const DefaultController = {
1049
1081
  const stateController = _CoreManager.default.getObjectStateController();
1050
1082
  const auth = {
1051
1083
  username: user.get('username'),
1052
- password: user.get('password')
1084
+ password: user.get('password'),
1085
+ authData: user.get('authData')
1053
1086
  };
1054
1087
  return RESTController.request(options.usePost ? 'POST' : 'GET', 'login', auth, options).then(response => {
1055
1088
  user._migrateId(response.objectId);
@@ -24,6 +24,9 @@ function run(name, data, options) {
24
24
  if (options.sessionToken) {
25
25
  requestOptions.sessionToken = options.sessionToken;
26
26
  }
27
+ if (options.installationId) {
28
+ requestOptions.installationId = options.installationId;
29
+ }
27
30
  if (options.context && typeof options.context === 'object') {
28
31
  requestOptions.context = options.context;
29
32
  }
@@ -8,7 +8,7 @@ var config = {
8
8
  SERVER_AUTH_TOKEN: null,
9
9
  LIVEQUERY_SERVER_URL: null,
10
10
  ENCRYPTED_KEY: null,
11
- VERSION: 'js' + "4.2.0-alpha.2",
11
+ VERSION: 'js' + "4.2.0-alpha.4",
12
12
  APPLICATION_ID: null,
13
13
  JAVASCRIPT_KEY: null,
14
14
  MASTER_KEY: null,
@@ -500,6 +500,26 @@ var ParseUser = function (_ParseObject) {
500
500
  });
501
501
  return user.logIn(options);
502
502
  }
503
+ }, {
504
+ key: "logInWithAdditionalAuth",
505
+ value: function (username, password, authData, options) {
506
+ if (typeof username !== 'string') {
507
+ return Promise.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Username must be a string.'));
508
+ }
509
+ if (typeof password !== 'string') {
510
+ return Promise.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Password must be a string.'));
511
+ }
512
+ if (Object.prototype.toString.call(authData) !== '[object Object]') {
513
+ return Promise.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Auth must be an object.'));
514
+ }
515
+ var user = new this();
516
+ user._finishFetch({
517
+ username: username,
518
+ password: password,
519
+ authData: authData
520
+ });
521
+ return user.logIn(options);
522
+ }
503
523
  }, {
504
524
  key: "loginAs",
505
525
  value: function (userId) {
@@ -788,7 +808,8 @@ var DefaultController = {
788
808
  var stateController = _CoreManager.default.getObjectStateController();
789
809
  var auth = {
790
810
  username: user.get('username'),
791
- password: user.get('password')
811
+ password: user.get('password'),
812
+ authData: user.get('authData')
792
813
  };
793
814
  return RESTController.request(options.usePost ? 'POST' : 'GET', 'login', auth, options).then(function (response) {
794
815
  user._migrateId(response.objectId);
@@ -56,6 +56,9 @@ function run(name /*: string*/, data /*: mixed*/, options /*: RequestOptions*/)
56
56
  if (options.sessionToken) {
57
57
  requestOptions.sessionToken = options.sessionToken;
58
58
  }
59
+ if (options.installationId) {
60
+ requestOptions.installationId = options.installationId;
61
+ }
59
62
  if (options.context && (0, _typeof2.default)(options.context) === 'object') {
60
63
  requestOptions.context = options.context;
61
64
  }
@@ -182,7 +182,7 @@ var config /*: Config & { [key: string]: mixed }*/ = {
182
182
  SERVER_AUTH_TOKEN: null,
183
183
  LIVEQUERY_SERVER_URL: null,
184
184
  ENCRYPTED_KEY: null,
185
- VERSION: 'js' + "4.2.0-alpha.2",
185
+ VERSION: 'js' + "4.2.0-alpha.4",
186
186
  APPLICATION_ID: null,
187
187
  JAVASCRIPT_KEY: null,
188
188
  MASTER_KEY: null,
@@ -880,6 +880,40 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
880
880
  return user.logIn(options);
881
881
  }
882
882
 
883
+ /**
884
+ * Logs in a user with a username (or email) and password, and authData. On success, this
885
+ * saves the session to disk, so you can retrieve the currently logged in
886
+ * user using <code>current</code>.
887
+ *
888
+ * @param {string} username The username (or email) to log in with.
889
+ * @param {string} password The password to log in with.
890
+ * @param {object} authData The authData to log in with.
891
+ * @param {object} options
892
+ * @static
893
+ * @returns {Promise} A promise that is fulfilled with the user when
894
+ * the login completes.
895
+ */
896
+ }, {
897
+ key: "logInWithAdditionalAuth",
898
+ value: function (username /*: string*/, password /*: string*/, authData /*: AuthData*/, options /*:: ?: FullOptions*/) {
899
+ if (typeof username !== 'string') {
900
+ return _promise.default.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Username must be a string.'));
901
+ }
902
+ if (typeof password !== 'string') {
903
+ return _promise.default.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Password must be a string.'));
904
+ }
905
+ if (Object.prototype.toString.call(authData) !== '[object Object]') {
906
+ return _promise.default.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Auth must be an object.'));
907
+ }
908
+ var user = new this();
909
+ user._finishFetch({
910
+ username: username,
911
+ password: password,
912
+ authData: authData
913
+ });
914
+ return user.logIn(options);
915
+ }
916
+
883
917
  /**
884
918
  * Logs in a user with an objectId. On success, this saves the session
885
919
  * to disk, so you can retrieve the currently logged in user using
@@ -1329,7 +1363,8 @@ var DefaultController = {
1329
1363
  var stateController = _CoreManager.default.getObjectStateController();
1330
1364
  var auth = {
1331
1365
  username: user.get('username'),
1332
- password: user.get('password')
1366
+ password: user.get('password'),
1367
+ authData: user.get('authData')
1333
1368
  };
1334
1369
  return RESTController.request(options.usePost ? 'POST' : 'GET', 'login', auth, options).then(function (response) {
1335
1370
  user._migrateId(response.objectId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parse",
3
- "version": "4.2.0-alpha.2",
3
+ "version": "4.2.0-alpha.4",
4
4
  "description": "Parse JavaScript SDK",
5
5
  "homepage": "https://parseplatform.org",
6
6
  "keywords": [