parse 5.1.0-alpha.4 → 5.1.0-alpha.6

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.
package/dist/parse.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Parse JavaScript SDK v5.1.0-alpha.4
2
+ * Parse JavaScript SDK v5.1.0-alpha.6
3
3
  *
4
4
  * The source tree of this library can be found at
5
5
  * https://github.com/ParsePlatform/Parse-SDK-JS
@@ -385,7 +385,7 @@ var _concat = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-sta
385
385
  /*:: import type ParseFile from './ParseFile';*/
386
386
  /*:: import type { FileSource } from './ParseFile';*/
387
387
  /*:: import type { Op } from './ParseOp';*/
388
- /*:: import type ParseObject from './ParseObject';*/
388
+ /*:: import type ParseObject, {SaveOptions} from './ParseObject';*/
389
389
  /*:: import type { QueryJSON } from './ParseQuery';*/
390
390
  /*:: import type ParseUser from './ParseUser';*/
391
391
  /*:: import type { AuthData } from './ParseUser';*/
@@ -451,6 +451,11 @@ var _concat = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-sta
451
451
  find: (className: string, params: QueryJSON, options: RequestOptions) => Promise,
452
452
  aggregate: (className: string, params: any, options: RequestOptions) => Promise,
453
453
  };*/
454
+ /*:: type EventuallyQueue = {
455
+ save: (object: ParseObject, serverOptions: SaveOptions) => Promise,
456
+ destroy: (object: ParseObject, serverOptions: RequestOptions) => Promise,
457
+ poll: (ms: number) => void
458
+ };*/
454
459
  /*:: type RESTController = {
455
460
  request: (method: string, path: string, data: mixed, options: RequestOptions) => Promise,
456
461
  ajax: (method: string, url: string, data: any, headers?: any, options: FullOptions) => Promise,
@@ -557,7 +562,7 @@ var config /*: Config & { [key: string]: mixed }*/ = {
557
562
  SERVER_AUTH_TOKEN: null,
558
563
  LIVEQUERY_SERVER_URL: null,
559
564
  ENCRYPTED_KEY: null,
560
- VERSION: 'js' + "5.1.0-alpha.4",
565
+ VERSION: 'js' + "5.1.0-alpha.6",
561
566
  APPLICATION_ID: null,
562
567
  JAVASCRIPT_KEY: null,
563
568
  MASTER_KEY: null,
@@ -682,6 +687,13 @@ var CoreManager = {
682
687
  getRESTController: function () /*: RESTController*/{
683
688
  return config['RESTController'];
684
689
  },
690
+ setEventuallyQueue: function (controller /*: EventuallyQueue*/) {
691
+ requireMethods('EventuallyQueue', ['poll', 'save', 'destroy'], controller);
692
+ config['EventuallyQueue'] = controller;
693
+ },
694
+ getEventuallyQueue: function () /*: EventuallyQueue*/{
695
+ return config['EventuallyQueue'];
696
+ },
685
697
  setSchemaController: function (controller /*: SchemaController*/) {
686
698
  requireMethods('SchemaController', ['get', 'create', 'update', 'delete', 'send', 'purge'], controller);
687
699
  config['SchemaController'] = controller;
@@ -4385,7 +4397,6 @@ var Parse /*: ParseType*/ = {
4385
4397
  CoreManager: _CoreManager.default,
4386
4398
  Config: _ParseConfig.default,
4387
4399
  Error: _ParseError.default,
4388
- EventuallyQueue: _EventuallyQueue.default,
4389
4400
  FacebookUtils: _FacebookUtils.default,
4390
4401
  File: _ParseFile.default,
4391
4402
  GeoPoint: _ParseGeoPoint.default,
@@ -4414,6 +4425,16 @@ var Parse /*: ParseType*/ = {
4414
4425
  IndexedDB: undefined,
4415
4426
  Hooks: undefined,
4416
4427
  Parse: undefined,
4428
+ /**
4429
+ * @member {EventuallyQueue} Parse.EventuallyQueue
4430
+ * @static
4431
+ */
4432
+ set EventuallyQueue(queue /*: EventuallyQueue*/) {
4433
+ _CoreManager.default.setEventuallyQueue(queue);
4434
+ },
4435
+ get EventuallyQueue() {
4436
+ return _CoreManager.default.getEventuallyQueue();
4437
+ },
4417
4438
  /**
4418
4439
  * Call this method first to set up your authentication tokens for Parse.
4419
4440
  *
@@ -4442,6 +4463,7 @@ var Parse /*: ParseType*/ = {
4442
4463
  _CoreManager.default.setIfNeeded('LocalDatastoreController', _LocalDatastoreController.default);
4443
4464
  _CoreManager.default.setIfNeeded('StorageController', _StorageController.default);
4444
4465
  _CoreManager.default.setIfNeeded('WebSocketController', _WebSocketController.default);
4466
+ _CoreManager.default.setIfNeeded('EventuallyQueue', _EventuallyQueue.default);
4445
4467
  Parse.IndexedDB = _CoreManager.default.setIfNeeded('IndexedDBStorageController', _IndexedDBStorageController.default);
4446
4468
  },
4447
4469
  /**
@@ -4634,7 +4656,7 @@ var Parse /*: ParseType*/ = {
4634
4656
  if (!this.LocalDatastore.isEnabled) {
4635
4657
  this.LocalDatastore.isEnabled = true;
4636
4658
  if (polling) {
4637
- _EventuallyQueue.default.poll(ms);
4659
+ _CoreManager.default.getEventuallyQueue().poll(ms);
4638
4660
  }
4639
4661
  }
4640
4662
  },
@@ -7865,7 +7887,6 @@ var _canBeSerialized = _interopRequireDefault(_dereq_("./canBeSerialized"));
7865
7887
  var _decode = _interopRequireDefault(_dereq_("./decode"));
7866
7888
  var _encode = _interopRequireDefault(_dereq_("./encode"));
7867
7889
  var _escape2 = _interopRequireDefault(_dereq_("./escape"));
7868
- var _EventuallyQueue = _interopRequireDefault(_dereq_("./EventuallyQueue"));
7869
7890
  var _ParseACL = _interopRequireDefault(_dereq_("./ParseACL"));
7870
7891
  var _parseDate = _interopRequireDefault(_dereq_("./parseDate"));
7871
7892
  var _ParseError = _interopRequireDefault(_dereq_("./ParseError"));
@@ -9297,9 +9318,9 @@ var ParseObject = /*#__PURE__*/function () {
9297
9318
  break;
9298
9319
  }
9299
9320
  _context4.next = 10;
9300
- return _EventuallyQueue.default.save(this, options);
9321
+ return _CoreManager.default.getEventuallyQueue().save(this, options);
9301
9322
  case 10:
9302
- _EventuallyQueue.default.poll();
9323
+ _CoreManager.default.getEventuallyQueue().poll();
9303
9324
  case 11:
9304
9325
  return _context4.abrupt("return", this);
9305
9326
  case 12:
@@ -9466,9 +9487,9 @@ var ParseObject = /*#__PURE__*/function () {
9466
9487
  break;
9467
9488
  }
9468
9489
  _context5.next = 10;
9469
- return _EventuallyQueue.default.destroy(this, options);
9490
+ return _CoreManager.default.getEventuallyQueue().destroy(this, options);
9470
9491
  case 10:
9471
- _EventuallyQueue.default.poll();
9492
+ _CoreManager.default.getEventuallyQueue().poll();
9472
9493
  case 11:
9473
9494
  return _context5.abrupt("return", this);
9474
9495
  case 12:
@@ -10867,7 +10888,7 @@ var DefaultController = {
10867
10888
  _CoreManager.default.setObjectController(DefaultController);
10868
10889
  var _default = ParseObject;
10869
10890
  exports.default = _default;
10870
- },{"./CoreManager":4,"./EventuallyQueue":7,"./LocalDatastoreUtils":16,"./ParseACL":20,"./ParseError":23,"./ParseFile":24,"./ParseOp":29,"./ParseQuery":31,"./ParseRelation":32,"./SingleInstanceStateController":39,"./UniqueInstanceStateController":44,"./canBeSerialized":47,"./decode":48,"./encode":49,"./escape":51,"./parseDate":53,"./promiseUtils":54,"./unique":55,"./unsavedChildren":56,"./uuid":57,"@babel/runtime-corejs3/core-js-stable/array/from":58,"@babel/runtime-corejs3/core-js-stable/array/is-array":59,"@babel/runtime-corejs3/core-js-stable/instance/concat":61,"@babel/runtime-corejs3/core-js-stable/instance/filter":64,"@babel/runtime-corejs3/core-js-stable/instance/find":66,"@babel/runtime-corejs3/core-js-stable/instance/for-each":67,"@babel/runtime-corejs3/core-js-stable/instance/includes":68,"@babel/runtime-corejs3/core-js-stable/instance/index-of":69,"@babel/runtime-corejs3/core-js-stable/instance/map":71,"@babel/runtime-corejs3/core-js-stable/instance/slice":73,"@babel/runtime-corejs3/core-js-stable/json/stringify":78,"@babel/runtime-corejs3/core-js-stable/object/create":82,"@babel/runtime-corejs3/core-js-stable/object/define-properties":83,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/core-js-stable/object/freeze":86,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor":87,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors":88,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols":89,"@babel/runtime-corejs3/core-js-stable/object/get-prototype-of":90,"@babel/runtime-corejs3/core-js-stable/object/keys":91,"@babel/runtime-corejs3/core-js-stable/promise":93,"@babel/runtime-corejs3/core-js-stable/symbol":98,"@babel/runtime-corejs3/core-js-stable/weak-map":99,"@babel/runtime-corejs3/core-js/get-iterator-method":100,"@babel/runtime-corejs3/helpers/asyncToGenerator":105,"@babel/runtime-corejs3/helpers/classCallCheck":106,"@babel/runtime-corejs3/helpers/createClass":108,"@babel/runtime-corejs3/helpers/defineProperty":109,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/toConsumableArray":125,"@babel/runtime-corejs3/helpers/typeof":128,"@babel/runtime-corejs3/regenerator":131}],29:[function(_dereq_,module,exports){
10891
+ },{"./CoreManager":4,"./LocalDatastoreUtils":16,"./ParseACL":20,"./ParseError":23,"./ParseFile":24,"./ParseOp":29,"./ParseQuery":31,"./ParseRelation":32,"./SingleInstanceStateController":39,"./UniqueInstanceStateController":44,"./canBeSerialized":47,"./decode":48,"./encode":49,"./escape":51,"./parseDate":53,"./promiseUtils":54,"./unique":55,"./unsavedChildren":56,"./uuid":57,"@babel/runtime-corejs3/core-js-stable/array/from":58,"@babel/runtime-corejs3/core-js-stable/array/is-array":59,"@babel/runtime-corejs3/core-js-stable/instance/concat":61,"@babel/runtime-corejs3/core-js-stable/instance/filter":64,"@babel/runtime-corejs3/core-js-stable/instance/find":66,"@babel/runtime-corejs3/core-js-stable/instance/for-each":67,"@babel/runtime-corejs3/core-js-stable/instance/includes":68,"@babel/runtime-corejs3/core-js-stable/instance/index-of":69,"@babel/runtime-corejs3/core-js-stable/instance/map":71,"@babel/runtime-corejs3/core-js-stable/instance/slice":73,"@babel/runtime-corejs3/core-js-stable/json/stringify":78,"@babel/runtime-corejs3/core-js-stable/object/create":82,"@babel/runtime-corejs3/core-js-stable/object/define-properties":83,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/core-js-stable/object/freeze":86,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor":87,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors":88,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols":89,"@babel/runtime-corejs3/core-js-stable/object/get-prototype-of":90,"@babel/runtime-corejs3/core-js-stable/object/keys":91,"@babel/runtime-corejs3/core-js-stable/promise":93,"@babel/runtime-corejs3/core-js-stable/symbol":98,"@babel/runtime-corejs3/core-js-stable/weak-map":99,"@babel/runtime-corejs3/core-js/get-iterator-method":100,"@babel/runtime-corejs3/helpers/asyncToGenerator":105,"@babel/runtime-corejs3/helpers/classCallCheck":106,"@babel/runtime-corejs3/helpers/createClass":108,"@babel/runtime-corejs3/helpers/defineProperty":109,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/toConsumableArray":125,"@babel/runtime-corejs3/helpers/typeof":128,"@babel/runtime-corejs3/regenerator":131}],29:[function(_dereq_,module,exports){
10871
10892
  "use strict";
10872
10893
 
10873
10894
  var _Reflect$construct = _dereq_("@babel/runtime-corejs3/core-js-stable/reflect/construct");
@@ -16827,6 +16848,7 @@ var _typeof2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/ty
16827
16848
  var _promise = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/promise"));
16828
16849
  var _stringify = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/json/stringify"));
16829
16850
  var _includes = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/includes"));
16851
+ var _indexOf = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
16830
16852
  var _forEach = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
16831
16853
  var _setTimeout2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/set-timeout"));
16832
16854
  var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
@@ -16951,11 +16973,14 @@ var RESTController = {
16951
16973
  var response;
16952
16974
  try {
16953
16975
  response = JSON.parse(xhr.responseText);
16976
+ var availableHeaders = typeof xhr.getAllResponseHeaders === 'function' ? xhr.getAllResponseHeaders() : "";
16954
16977
  headers = {};
16955
- if (typeof xhr.getResponseHeader === 'function' && xhr.getResponseHeader('access-control-expose-headers')) {
16978
+ if (typeof xhr.getResponseHeader === 'function' && (availableHeaders === null || availableHeaders === void 0 ? void 0 : (0, _indexOf.default)(availableHeaders).call(availableHeaders, 'access-control-expose-headers')) >= 0) {
16956
16979
  var responseHeaders = xhr.getResponseHeader('access-control-expose-headers').split(', ');
16957
16980
  (0, _forEach.default)(responseHeaders).call(responseHeaders, function (header) {
16958
- headers[header] = xhr.getResponseHeader(header.toLowerCase());
16981
+ if ((0, _indexOf.default)(availableHeaders).call(availableHeaders, header.toLowerCase()) >= 0) {
16982
+ headers[header] = xhr.getResponseHeader(header.toLowerCase());
16983
+ }
16959
16984
  });
16960
16985
  }
16961
16986
  } catch (e) {
@@ -17159,7 +17184,7 @@ var RESTController = {
17159
17184
  };
17160
17185
  module.exports = RESTController;
17161
17186
  }).call(this)}).call(this,_dereq_('_process'))
17162
- },{"./CoreManager":4,"./ParseError":23,"./promiseUtils":54,"./uuid":57,"@babel/runtime-corejs3/core-js-stable/instance/filter":64,"@babel/runtime-corejs3/core-js-stable/instance/for-each":67,"@babel/runtime-corejs3/core-js-stable/instance/includes":68,"@babel/runtime-corejs3/core-js-stable/json/stringify":78,"@babel/runtime-corejs3/core-js-stable/object/define-properties":83,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor":87,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors":88,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols":89,"@babel/runtime-corejs3/core-js-stable/object/keys":91,"@babel/runtime-corejs3/core-js-stable/promise":93,"@babel/runtime-corejs3/core-js-stable/set-timeout":96,"@babel/runtime-corejs3/helpers/defineProperty":109,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/typeof":128,"_process":132}],39:[function(_dereq_,module,exports){
17187
+ },{"./CoreManager":4,"./ParseError":23,"./promiseUtils":54,"./uuid":57,"@babel/runtime-corejs3/core-js-stable/instance/filter":64,"@babel/runtime-corejs3/core-js-stable/instance/for-each":67,"@babel/runtime-corejs3/core-js-stable/instance/includes":68,"@babel/runtime-corejs3/core-js-stable/instance/index-of":69,"@babel/runtime-corejs3/core-js-stable/json/stringify":78,"@babel/runtime-corejs3/core-js-stable/object/define-properties":83,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor":87,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors":88,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols":89,"@babel/runtime-corejs3/core-js-stable/object/keys":91,"@babel/runtime-corejs3/core-js-stable/promise":93,"@babel/runtime-corejs3/core-js-stable/set-timeout":96,"@babel/runtime-corejs3/helpers/defineProperty":109,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/typeof":128,"_process":132}],39:[function(_dereq_,module,exports){
17163
17188
  "use strict";
17164
17189
 
17165
17190
  var _typeof = _dereq_("@babel/runtime-corejs3/helpers/typeof");