parse 3.4.4-beta.1 → 3.5.0-alpha.2

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 v3.4.4-beta.1
2
+ * Parse JavaScript SDK v3.5.0-alpha.2
3
3
  *
4
4
  * The source tree of this library can be found at
5
5
  * https://github.com/ParsePlatform/Parse-SDK-JS
@@ -699,7 +699,7 @@ var config
699
699
  SERVER_AUTH_TOKEN: null,
700
700
  LIVEQUERY_SERVER_URL: null,
701
701
  ENCRYPTED_KEY: null,
702
- VERSION: 'js' + "3.4.4-beta.1",
702
+ VERSION: 'js' + "3.5.0-alpha.2",
703
703
  APPLICATION_ID: null,
704
704
  JAVASCRIPT_KEY: null,
705
705
  MASTER_KEY: null,
@@ -8471,9 +8471,6 @@ XHR = _dereq_('./Xhr.weapp');
8471
8471
  type: string,
8472
8472
  };*/
8473
8473
 
8474
- var base64Regex = new RegExp('([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))', 'i');
8475
- var dataUriRegex = new RegExp("^data:([a-zA-Z]+\\/[-a-zA-Z0-9+.]+(;[a-z-]+=[a-zA-Z0-9+.-]+)?)?(;base64)?,(".concat(base64Regex.source, ")*$"), 'i');
8476
-
8477
8474
  function b64Digit(number
8478
8475
  /*: number*/
8479
8476
  )
@@ -8586,30 +8583,14 @@ var ParseFile = /*#__PURE__*/function () {
8586
8583
  type: specifiedType
8587
8584
  };
8588
8585
  } else if (data && typeof data.base64 === 'string') {
8589
- var _context, _context2, _context3; // Check if data URI or base64 string is valid
8590
-
8591
-
8592
- var validationRegex = new RegExp(base64Regex.source + '|' + dataUriRegex.source, 'i');
8593
-
8594
- if (!validationRegex.test(data.base64)) {
8595
- throw new Error('Cannot create a Parse.File without valid data URIs or base64 encoded data.');
8596
- }
8586
+ var _context, _context2, _context3;
8597
8587
 
8598
8588
  var base64 = (0, _slice.default)(_context = data.base64.split(',')).call(_context, -1)[0];
8599
-
8600
- var _type = specifiedType || (0, _slice.default)(_context2 = (0, _slice.default)(_context3 = data.base64.split(';')).call(_context3, 0, 1)[0].split(':')).call(_context2, 1, 2)[0] || ''; // https://tools.ietf.org/html/rfc2397
8601
- // If <mediatype> is omitted, it defaults to text/plain;charset=US-ASCII.
8602
- // As a shorthand, "text/plain" can be omitted but the charset parameter supplied.
8603
-
8604
-
8605
- if (dataUriRegex.test(data.base64)) {
8606
- _type = _type || 'text/plain';
8607
- }
8608
-
8589
+ var dataType = specifiedType || (0, _slice.default)(_context2 = (0, _slice.default)(_context3 = data.base64.split(';')).call(_context3, 0, 1)[0].split(':')).call(_context2, 1, 2)[0] || 'text/plain';
8609
8590
  this._source = {
8610
8591
  format: 'base64',
8611
8592
  base64: base64,
8612
- type: _type
8593
+ type: dataType
8613
8594
  };
8614
8595
  } else {
8615
8596
  throw new TypeError('Cannot create a Parse.File with that data.');
@@ -15964,6 +15945,10 @@ var ParseQuery = /*#__PURE__*/function () {
15964
15945
  findOptions.context = options.context;
15965
15946
  }
15966
15947
 
15948
+ if (options.hasOwnProperty('json')) {
15949
+ findOptions.json = options.json;
15950
+ }
15951
+
15967
15952
  var finished = false;
15968
15953
  var previousResults = [];
15969
15954
  return (0, _promiseUtils.continueWhile)(function () {
@@ -16033,6 +16018,7 @@ var ParseQuery = /*#__PURE__*/function () {
16033
16018
  * be used for this request.
16034
16019
  * <li>sessionToken: A valid session token, used for making a request on
16035
16020
  * behalf of a specific user.
16021
+ * <li>json: Return raw json without converting to Parse.Object
16036
16022
  * </ul>
16037
16023
  * @returns {Promise} A promise that will be fulfilled once the
16038
16024
  * iteration has completed.
@@ -19777,6 +19763,10 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
19777
19763
  signupOptions.installationId = options.installationId;
19778
19764
  }
19779
19765
 
19766
+ if (options.hasOwnProperty('context') && Object.prototype.toString.call(options.context) === '[object Object]') {
19767
+ signupOptions.context = options.context;
19768
+ }
19769
+
19780
19770
  var controller = _CoreManager.default.getUserController();
19781
19771
 
19782
19772
  return controller.signUp(this, attrs, signupOptions);