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.
@@ -224,7 +224,7 @@ var config
224
224
  SERVER_AUTH_TOKEN: null,
225
225
  LIVEQUERY_SERVER_URL: null,
226
226
  ENCRYPTED_KEY: null,
227
- VERSION: 'js' + "3.4.4-beta.1",
227
+ VERSION: 'js' + "3.5.0-alpha.2",
228
228
  APPLICATION_ID: null,
229
229
  JAVASCRIPT_KEY: null,
230
230
  MASTER_KEY: null,
@@ -111,9 +111,6 @@ if (typeof XMLHttpRequest !== 'undefined') {
111
111
  uri: string,
112
112
  type: string,
113
113
  };*/
114
- var base64Regex = new RegExp('([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))', 'i');
115
- var dataUriRegex = new RegExp("^data:([a-zA-Z]+\\/[-a-zA-Z0-9+.]+(;[a-z-]+=[a-zA-Z0-9+.-]+)?)?(;base64)?,(".concat(base64Regex.source, ")*$"), 'i');
116
-
117
114
  function b64Digit(number
118
115
  /*: number*/
119
116
  )
@@ -226,30 +223,14 @@ var ParseFile = /*#__PURE__*/function () {
226
223
  type: specifiedType
227
224
  };
228
225
  } else if (data && typeof data.base64 === 'string') {
229
- var _context, _context2, _context3; // Check if data URI or base64 string is valid
230
-
231
-
232
- var validationRegex = new RegExp(base64Regex.source + '|' + dataUriRegex.source, 'i');
233
-
234
- if (!validationRegex.test(data.base64)) {
235
- throw new Error('Cannot create a Parse.File without valid data URIs or base64 encoded data.');
236
- }
226
+ var _context, _context2, _context3;
237
227
 
238
228
  var base64 = (0, _slice.default)(_context = data.base64.split(',')).call(_context, -1)[0];
239
-
240
- 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
241
- // If <mediatype> is omitted, it defaults to text/plain;charset=US-ASCII.
242
- // As a shorthand, "text/plain" can be omitted but the charset parameter supplied.
243
-
244
-
245
- if (dataUriRegex.test(data.base64)) {
246
- _type = _type || 'text/plain';
247
- }
248
-
229
+ 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';
249
230
  this._source = {
250
231
  format: 'base64',
251
232
  base64: base64,
252
- type: _type
233
+ type: dataType
253
234
  };
254
235
  } else {
255
236
  throw new TypeError('Cannot create a Parse.File with that data.');
@@ -1266,6 +1266,10 @@ var ParseQuery = /*#__PURE__*/function () {
1266
1266
  findOptions.context = options.context;
1267
1267
  }
1268
1268
 
1269
+ if (options.hasOwnProperty('json')) {
1270
+ findOptions.json = options.json;
1271
+ }
1272
+
1269
1273
  var finished = false;
1270
1274
  var previousResults = [];
1271
1275
  return (0, _promiseUtils.continueWhile)(function () {
@@ -1335,6 +1339,7 @@ var ParseQuery = /*#__PURE__*/function () {
1335
1339
  * be used for this request.
1336
1340
  * <li>sessionToken: A valid session token, used for making a request on
1337
1341
  * behalf of a specific user.
1342
+ * <li>json: Return raw json without converting to Parse.Object
1338
1343
  * </ul>
1339
1344
  * @returns {Promise} A promise that will be fulfilled once the
1340
1345
  * iteration has completed.
@@ -650,6 +650,10 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
650
650
  signupOptions.installationId = options.installationId;
651
651
  }
652
652
 
653
+ if (options.hasOwnProperty('context') && Object.prototype.toString.call(options.context) === '[object Object]') {
654
+ signupOptions.context = options.context;
655
+ }
656
+
653
657
  var controller = _CoreManager.default.getUserController();
654
658
 
655
659
  return controller.signUp(this, attrs, signupOptions);
@@ -217,7 +217,7 @@ const config
217
217
  SERVER_AUTH_TOKEN: null,
218
218
  LIVEQUERY_SERVER_URL: null,
219
219
  ENCRYPTED_KEY: null,
220
- VERSION: 'js' + "3.4.4-beta.1",
220
+ VERSION: 'js' + "3.5.0-alpha.2",
221
221
  APPLICATION_ID: null,
222
222
  JAVASCRIPT_KEY: null,
223
223
  MASTER_KEY: null,
@@ -84,9 +84,6 @@ if (typeof XMLHttpRequest !== 'undefined') {
84
84
  uri: string,
85
85
  type: string,
86
86
  };*/
87
- const base64Regex = new RegExp('([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))', 'i');
88
- const dataUriRegex = new RegExp(`^data:([a-zA-Z]+\\/[-a-zA-Z0-9+.]+(;[a-z-]+=[a-zA-Z0-9+.-]+)?)?(;base64)?,(${base64Regex.source})*$`, 'i');
89
-
90
87
  function b64Digit(number
91
88
  /*: number*/
92
89
  )
@@ -206,26 +203,12 @@ class ParseFile {
206
203
  type: specifiedType
207
204
  };
208
205
  } else if (data && typeof data.base64 === 'string') {
209
- // Check if data URI or base64 string is valid
210
- const validationRegex = new RegExp(base64Regex.source + '|' + dataUriRegex.source, 'i');
211
-
212
- if (!validationRegex.test(data.base64)) {
213
- throw new Error('Cannot create a Parse.File without valid data URIs or base64 encoded data.');
214
- }
215
-
216
206
  const base64 = data.base64.split(',').slice(-1)[0];
217
- let type = specifiedType || data.base64.split(';').slice(0, 1)[0].split(':').slice(1, 2)[0] || ''; // https://tools.ietf.org/html/rfc2397
218
- // If <mediatype> is omitted, it defaults to text/plain;charset=US-ASCII.
219
- // As a shorthand, "text/plain" can be omitted but the charset parameter supplied.
220
-
221
- if (dataUriRegex.test(data.base64)) {
222
- type = type || 'text/plain';
223
- }
224
-
207
+ const dataType = specifiedType || data.base64.split(';').slice(0, 1)[0].split(':').slice(1, 2)[0] || 'text/plain';
225
208
  this._source = {
226
209
  format: 'base64',
227
210
  base64,
228
- type
211
+ type: dataType
229
212
  };
230
213
  } else {
231
214
  throw new TypeError('Cannot create a Parse.File with that data.');
@@ -1165,6 +1165,10 @@ class ParseQuery {
1165
1165
  findOptions.context = options.context;
1166
1166
  }
1167
1167
 
1168
+ if (options.hasOwnProperty('json')) {
1169
+ findOptions.json = options.json;
1170
+ }
1171
+
1168
1172
  let finished = false;
1169
1173
  let previousResults = [];
1170
1174
  return (0, _promiseUtils.continueWhile)(() => {
@@ -1198,6 +1202,7 @@ class ParseQuery {
1198
1202
  * be used for this request.
1199
1203
  * <li>sessionToken: A valid session token, used for making a request on
1200
1204
  * behalf of a specific user.
1205
+ * <li>json: Return raw json without converting to Parse.Object
1201
1206
  * </ul>
1202
1207
  * @returns {Promise} A promise that will be fulfilled once the
1203
1208
  * iteration has completed.
@@ -548,6 +548,10 @@ class ParseUser extends _ParseObject.default {
548
548
  signupOptions.installationId = options.installationId;
549
549
  }
550
550
 
551
+ if (options.hasOwnProperty('context') && Object.prototype.toString.call(options.context) === '[object Object]') {
552
+ signupOptions.context = options.context;
553
+ }
554
+
551
555
  const controller = _CoreManager.default.getUserController();
552
556
 
553
557
  return controller.signUp(this, attrs, signupOptions);
@@ -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' + "3.4.4-beta.1",
11
+ VERSION: 'js' + "3.5.0-alpha.2",
12
12
  APPLICATION_ID: null,
13
13
  JAVASCRIPT_KEY: null,
14
14
  MASTER_KEY: null,
@@ -51,9 +51,6 @@ if (typeof XMLHttpRequest !== 'undefined') {
51
51
  XHR = XMLHttpRequest;
52
52
  }
53
53
 
54
- var base64Regex = new RegExp('([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))', 'i');
55
- var dataUriRegex = new RegExp("^data:([a-zA-Z]+\\/[-a-zA-Z0-9+.]+(;[a-z-]+=[a-zA-Z0-9+.-]+)?)?(;base64)?,(" + base64Regex.source + ")*$", 'i');
56
-
57
54
  function b64Digit(number) {
58
55
  if (number < 26) {
59
56
  return String.fromCharCode(65 + number);
@@ -107,24 +104,12 @@ var ParseFile = function () {
107
104
  type: specifiedType
108
105
  };
109
106
  } else if (data && typeof data.base64 === 'string') {
110
- var validationRegex = new RegExp(base64Regex.source + '|' + dataUriRegex.source, 'i');
111
-
112
- if (!validationRegex.test(data.base64)) {
113
- throw new Error('Cannot create a Parse.File without valid data URIs or base64 encoded data.');
114
- }
115
-
116
107
  var base64 = data.base64.split(',').slice(-1)[0];
117
-
118
- var _type = specifiedType || data.base64.split(';').slice(0, 1)[0].split(':').slice(1, 2)[0] || '';
119
-
120
- if (dataUriRegex.test(data.base64)) {
121
- _type = _type || 'text/plain';
122
- }
123
-
108
+ var dataType = specifiedType || data.base64.split(';').slice(0, 1)[0].split(':').slice(1, 2)[0] || 'text/plain';
124
109
  this._source = {
125
110
  format: 'base64',
126
111
  base64: base64,
127
- type: _type
112
+ type: dataType
128
113
  };
129
114
  } else {
130
115
  throw new TypeError('Cannot create a Parse.File with that data.');
@@ -778,6 +778,10 @@ var ParseQuery = function () {
778
778
  findOptions.context = options.context;
779
779
  }
780
780
 
781
+ if (options.hasOwnProperty('json')) {
782
+ findOptions.json = options.json;
783
+ }
784
+
781
785
  var finished = false;
782
786
  var previousResults = [];
783
787
  return (0, _promiseUtils.continueWhile)(function () {
@@ -399,6 +399,10 @@ var ParseUser = function (_ParseObject) {
399
399
  signupOptions.installationId = options.installationId;
400
400
  }
401
401
 
402
+ if (options.hasOwnProperty('context') && Object.prototype.toString.call(options.context) === '[object Object]') {
403
+ signupOptions.context = options.context;
404
+ }
405
+
402
406
  var controller = _CoreManager.default.getUserController();
403
407
 
404
408
  return controller.signUp(this, attrs, signupOptions);
@@ -224,7 +224,7 @@ var config
224
224
  SERVER_AUTH_TOKEN: null,
225
225
  LIVEQUERY_SERVER_URL: null,
226
226
  ENCRYPTED_KEY: null,
227
- VERSION: 'js' + "3.4.4-beta.1",
227
+ VERSION: 'js' + "3.5.0-alpha.2",
228
228
  APPLICATION_ID: null,
229
229
  JAVASCRIPT_KEY: null,
230
230
  MASTER_KEY: null,
@@ -113,9 +113,6 @@ XHR = require('./Xhr.weapp');
113
113
  type: string,
114
114
  };*/
115
115
 
116
- var base64Regex = new RegExp('([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))', 'i');
117
- var dataUriRegex = new RegExp("^data:([a-zA-Z]+\\/[-a-zA-Z0-9+.]+(;[a-z-]+=[a-zA-Z0-9+.-]+)?)?(;base64)?,(".concat(base64Regex.source, ")*$"), 'i');
118
-
119
116
  function b64Digit(number
120
117
  /*: number*/
121
118
  )
@@ -228,30 +225,14 @@ var ParseFile = /*#__PURE__*/function () {
228
225
  type: specifiedType
229
226
  };
230
227
  } else if (data && typeof data.base64 === 'string') {
231
- var _context, _context2, _context3; // Check if data URI or base64 string is valid
232
-
233
-
234
- var validationRegex = new RegExp(base64Regex.source + '|' + dataUriRegex.source, 'i');
235
-
236
- if (!validationRegex.test(data.base64)) {
237
- throw new Error('Cannot create a Parse.File without valid data URIs or base64 encoded data.');
238
- }
228
+ var _context, _context2, _context3;
239
229
 
240
230
  var base64 = (0, _slice.default)(_context = data.base64.split(',')).call(_context, -1)[0];
241
-
242
- 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
243
- // If <mediatype> is omitted, it defaults to text/plain;charset=US-ASCII.
244
- // As a shorthand, "text/plain" can be omitted but the charset parameter supplied.
245
-
246
-
247
- if (dataUriRegex.test(data.base64)) {
248
- _type = _type || 'text/plain';
249
- }
250
-
231
+ 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';
251
232
  this._source = {
252
233
  format: 'base64',
253
234
  base64: base64,
254
- type: _type
235
+ type: dataType
255
236
  };
256
237
  } else {
257
238
  throw new TypeError('Cannot create a Parse.File with that data.');
@@ -1266,6 +1266,10 @@ var ParseQuery = /*#__PURE__*/function () {
1266
1266
  findOptions.context = options.context;
1267
1267
  }
1268
1268
 
1269
+ if (options.hasOwnProperty('json')) {
1270
+ findOptions.json = options.json;
1271
+ }
1272
+
1269
1273
  var finished = false;
1270
1274
  var previousResults = [];
1271
1275
  return (0, _promiseUtils.continueWhile)(function () {
@@ -1335,6 +1339,7 @@ var ParseQuery = /*#__PURE__*/function () {
1335
1339
  * be used for this request.
1336
1340
  * <li>sessionToken: A valid session token, used for making a request on
1337
1341
  * behalf of a specific user.
1342
+ * <li>json: Return raw json without converting to Parse.Object
1338
1343
  * </ul>
1339
1344
  * @returns {Promise} A promise that will be fulfilled once the
1340
1345
  * iteration has completed.
@@ -650,6 +650,10 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
650
650
  signupOptions.installationId = options.installationId;
651
651
  }
652
652
 
653
+ if (options.hasOwnProperty('context') && Object.prototype.toString.call(options.context) === '[object Object]') {
654
+ signupOptions.context = options.context;
655
+ }
656
+
653
657
  var controller = _CoreManager.default.getUserController();
654
658
 
655
659
  return controller.signUp(this, attrs, signupOptions);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parse",
3
- "version": "3.4.4-beta.1",
3
+ "version": "3.5.0-alpha.2",
4
4
  "description": "The Parse JavaScript SDK",
5
5
  "homepage": "https://parseplatform.org/",
6
6
  "keywords": [
@@ -73,7 +73,7 @@
73
73
  "gulp-rename": "2.0.0",
74
74
  "gulp-uglify": "3.0.2",
75
75
  "gulp-watch": "5.0.1",
76
- "husky": "4.3.5",
76
+ "husky": "4.3.8",
77
77
  "jasmine": "3.5.0",
78
78
  "jasmine-reporters": "2.3.2",
79
79
  "jasmine-spec-reporter": "6.0.0",