parse 5.1.0-alpha.8 → 5.1.0-beta.1

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.
Files changed (106) hide show
  1. package/README.md +1 -1
  2. package/dist/parse.js +675 -374
  3. package/dist/parse.min.js +2 -2
  4. package/dist/parse.weapp.js +1603 -438
  5. package/dist/parse.weapp.min.js +2 -2
  6. package/lib/browser/CoreManager.js +48 -183
  7. package/lib/browser/EventuallyQueue.js +1 -1
  8. package/lib/browser/InstallationController.js +134 -23
  9. package/lib/browser/ObjectStateMutations.js +3 -2
  10. package/lib/browser/Parse.js +2 -2
  11. package/lib/browser/ParseACL.js +21 -11
  12. package/lib/browser/ParseFile.js +4 -0
  13. package/lib/browser/ParseGeoPoint.js +12 -8
  14. package/lib/browser/ParseHooks.js +2 -0
  15. package/lib/browser/ParseInstallation.js +274 -13
  16. package/lib/browser/ParseObject.js +74 -68
  17. package/lib/browser/ParseOp.js +21 -7
  18. package/lib/browser/ParseQuery.js +1 -0
  19. package/lib/browser/ParseRelation.js +12 -7
  20. package/lib/browser/ParseRole.js +2 -0
  21. package/lib/browser/ParseSession.js +1 -1
  22. package/lib/browser/ParseUser.js +1 -0
  23. package/lib/browser/SingleInstanceStateController.js +2 -4
  24. package/lib/browser/arrayContainsObject.js +4 -3
  25. package/lib/browser/canBeSerialized.js +6 -4
  26. package/lib/browser/decode.js +8 -5
  27. package/lib/browser/encode.js +6 -4
  28. package/lib/browser/equals.js +4 -3
  29. package/lib/browser/unique.js +3 -2
  30. package/lib/browser/unsavedChildren.js +4 -2
  31. package/lib/browser/uuid.js +11 -5
  32. package/lib/node/CoreManager.js +48 -183
  33. package/lib/node/EventuallyQueue.js +1 -1
  34. package/lib/node/InstallationController.js +65 -21
  35. package/lib/node/ObjectStateMutations.js +3 -2
  36. package/lib/node/Parse.js +2 -2
  37. package/lib/node/ParseACL.js +21 -11
  38. package/lib/node/ParseFile.js +4 -0
  39. package/lib/node/ParseGeoPoint.js +11 -11
  40. package/lib/node/ParseHooks.js +2 -0
  41. package/lib/node/ParseInstallation.js +207 -7
  42. package/lib/node/ParseObject.js +68 -66
  43. package/lib/node/ParseOp.js +21 -7
  44. package/lib/node/ParseQuery.js +1 -0
  45. package/lib/node/ParseRelation.js +14 -8
  46. package/lib/node/ParseRole.js +2 -0
  47. package/lib/node/ParseSession.js +1 -1
  48. package/lib/node/ParseUser.js +1 -0
  49. package/lib/node/SingleInstanceStateController.js +2 -8
  50. package/lib/node/arrayContainsObject.js +4 -3
  51. package/lib/node/canBeSerialized.js +6 -4
  52. package/lib/node/decode.js +9 -5
  53. package/lib/node/encode.js +7 -4
  54. package/lib/node/equals.js +4 -3
  55. package/lib/node/unique.js +3 -2
  56. package/lib/node/unsavedChildren.js +4 -2
  57. package/lib/node/uuid.js +10 -8
  58. package/lib/react-native/CoreManager.js +39 -9
  59. package/lib/react-native/InstallationController.js +77 -9
  60. package/lib/react-native/ObjectStateMutations.js +3 -2
  61. package/lib/react-native/Parse.js +2 -2
  62. package/lib/react-native/ParseACL.js +19 -11
  63. package/lib/react-native/ParseGeoPoint.js +5 -3
  64. package/lib/react-native/ParseInstallation.js +115 -10
  65. package/lib/react-native/ParseObject.js +8 -6
  66. package/lib/react-native/ParseOp.js +20 -6
  67. package/lib/react-native/ParseQuery.js +1 -0
  68. package/lib/react-native/ParseRelation.js +10 -7
  69. package/lib/react-native/ParseRole.js +2 -0
  70. package/lib/react-native/ParseUser.js +1 -0
  71. package/lib/react-native/SingleInstanceStateController.js +0 -2
  72. package/lib/react-native/arrayContainsObject.js +3 -2
  73. package/lib/react-native/canBeSerialized.js +5 -3
  74. package/lib/react-native/decode.js +7 -5
  75. package/lib/react-native/encode.js +6 -4
  76. package/lib/react-native/equals.js +4 -3
  77. package/lib/react-native/unique.js +3 -2
  78. package/lib/react-native/unsavedChildren.js +3 -2
  79. package/lib/react-native/uuid.js +9 -4
  80. package/lib/weapp/CoreManager.js +48 -183
  81. package/lib/weapp/EventuallyQueue.js +1 -1
  82. package/lib/weapp/InstallationController.js +134 -23
  83. package/lib/weapp/ObjectStateMutations.js +3 -2
  84. package/lib/weapp/Parse.js +2 -2
  85. package/lib/weapp/ParseACL.js +21 -11
  86. package/lib/weapp/ParseFile.js +4 -0
  87. package/lib/weapp/ParseGeoPoint.js +12 -8
  88. package/lib/weapp/ParseHooks.js +2 -0
  89. package/lib/weapp/ParseInstallation.js +274 -13
  90. package/lib/weapp/ParseObject.js +74 -68
  91. package/lib/weapp/ParseOp.js +21 -7
  92. package/lib/weapp/ParseQuery.js +1 -0
  93. package/lib/weapp/ParseRelation.js +12 -7
  94. package/lib/weapp/ParseRole.js +2 -0
  95. package/lib/weapp/ParseSession.js +1 -1
  96. package/lib/weapp/ParseUser.js +1 -0
  97. package/lib/weapp/SingleInstanceStateController.js +2 -4
  98. package/lib/weapp/arrayContainsObject.js +4 -3
  99. package/lib/weapp/canBeSerialized.js +6 -4
  100. package/lib/weapp/decode.js +8 -5
  101. package/lib/weapp/encode.js +6 -4
  102. package/lib/weapp/equals.js +4 -3
  103. package/lib/weapp/unique.js +3 -2
  104. package/lib/weapp/unsavedChildren.js +4 -2
  105. package/lib/weapp/uuid.js +12 -5
  106. package/package.json +4 -1
package/dist/parse.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Parse JavaScript SDK v5.1.0-alpha.8
2
+ * Parse JavaScript SDK v5.1.0-beta.1
3
3
  *
4
4
  * The source tree of this library can be found at
5
5
  * https://github.com/ParsePlatform/Parse-SDK-JS
@@ -378,181 +378,16 @@ _Object$defineProperty(exports, "__esModule", {
378
378
  exports.default = void 0;
379
379
  var _forEach = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
380
380
  var _concat = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/concat"));
381
- /*
382
- * @flow
383
- */
384
- /*:: import type { AttributeMap, ObjectCache, OpsMap, State } from './ObjectStateMutations';*/
385
- /*:: import type ParseFile from './ParseFile';*/
386
- /*:: import type { FileSource } from './ParseFile';*/
387
- /*:: import type { Op } from './ParseOp';*/
388
- /*:: import type ParseObject, {SaveOptions} from './ParseObject';*/
389
- /*:: import type { QueryJSON } from './ParseQuery';*/
390
- /*:: import type ParseUser from './ParseUser';*/
391
- /*:: import type { AuthData } from './ParseUser';*/
392
- /*:: import type { PushData } from './Push';*/
393
- /*:: import type { RequestOptions, FullOptions } from './RESTController';*/
394
- /*:: type AnalyticsController = {
395
- track: (name: string, dimensions: { [key: string]: string }) => Promise,
396
- };*/
397
- /*:: type CloudController = {
398
- run: (name: string, data: mixed, options: RequestOptions) => Promise,
399
- getJobsData: (options: RequestOptions) => Promise,
400
- startJob: (name: string, data: mixed, options: RequestOptions) => Promise,
401
- };*/
402
- /*:: type ConfigController = {
403
- current: () => Promise,
404
- get: () => Promise,
405
- save: (attrs: { [key: string]: any }) => Promise,
406
- };*/
407
- /*:: type CryptoController = {
408
- encrypt: (obj: any, secretKey: string) => string,
409
- decrypt: (encryptedText: string, secretKey: any) => string,
410
- };*/
411
- /*:: type FileController = {
412
- saveFile: (name: string, source: FileSource, options: FullOptions) => Promise,
413
- saveBase64: (name: string, source: FileSource, options: FullOptions) => Promise,
414
- download: (uri: string) => Promise,
415
- };*/
416
- /*:: type InstallationController = {
417
- currentInstallationId: () => Promise,
418
- };*/
419
- /*:: type ObjectController = {
420
- fetch: (
421
- object: ParseObject | Array<ParseObject>,
422
- forceFetch: boolean,
423
- options: RequestOptions
424
- ) => Promise,
425
- save: (object: ParseObject | Array<ParseObject | ParseFile>, options: RequestOptions) => Promise,
426
- destroy: (object: ParseObject | Array<ParseObject>, options: RequestOptions) => Promise,
427
- };*/
428
- /*:: type ObjectStateController = {
429
- getState: (obj: any) => ?State,
430
- initializeState: (obj: any, initial?: State) => State,
431
- removeState: (obj: any) => ?State,
432
- getServerData: (obj: any) => AttributeMap,
433
- setServerData: (obj: any, attributes: AttributeMap) => void,
434
- getPendingOps: (obj: any) => Array<OpsMap>,
435
- setPendingOp: (obj: any, attr: string, op: ?Op) => void,
436
- pushPendingState: (obj: any) => void,
437
- popPendingState: (obj: any) => OpsMap,
438
- mergeFirstPendingState: (obj: any) => void,
439
- getObjectCache: (obj: any) => ObjectCache,
440
- estimateAttribute: (obj: any, attr: string) => mixed,
441
- estimateAttributes: (obj: any) => AttributeMap,
442
- commitServerChanges: (obj: any, changes: AttributeMap) => void,
443
- enqueueTask: (obj: any, task: () => Promise) => Promise,
444
- clearAllState: () => void,
445
- duplicateState: (source: any, dest: any) => void,
446
- };*/
447
- /*:: type PushController = {
448
- send: (data: PushData) => Promise,
449
- };*/
450
- /*:: type QueryController = {
451
- find: (className: string, params: QueryJSON, options: RequestOptions) => Promise,
452
- aggregate: (className: string, params: any, options: RequestOptions) => Promise,
453
- };*/
454
- /*:: type EventuallyQueue = {
455
- save: (object: ParseObject, serverOptions: SaveOptions) => Promise,
456
- destroy: (object: ParseObject, serverOptions: RequestOptions) => Promise,
457
- poll: (ms: number) => void
458
- };*/
459
- /*:: type RESTController = {
460
- request: (method: string, path: string, data: mixed, options: RequestOptions) => Promise,
461
- ajax: (method: string, url: string, data: any, headers?: any, options: FullOptions) => Promise,
462
- };*/
463
- /*:: type SchemaController = {
464
- purge: (className: string) => Promise,
465
- get: (className: string, options: RequestOptions) => Promise,
466
- delete: (className: string, options: RequestOptions) => Promise,
467
- create: (className: string, params: any, options: RequestOptions) => Promise,
468
- update: (className: string, params: any, options: RequestOptions) => Promise,
469
- send(className: string, method: string, params: any, options: RequestOptions): Promise,
470
- };*/
471
- /*:: type SessionController = {
472
- getSession: (token: RequestOptions) => Promise,
473
- };*/
474
- /*:: type StorageController =
475
- | {
476
- async: 0,
477
- getItem: (path: string) => ?string,
478
- setItem: (path: string, value: string) => void,
479
- removeItem: (path: string) => void,
480
- getItemAsync?: (path: string) => Promise,
481
- setItemAsync?: (path: string, value: string) => Promise,
482
- removeItemAsync?: (path: string) => Promise,
483
- clear: () => void,
484
- }
485
- | {
486
- async: 1,
487
- getItem?: (path: string) => ?string,
488
- setItem?: (path: string, value: string) => void,
489
- removeItem?: (path: string) => void,
490
- getItemAsync: (path: string) => Promise,
491
- setItemAsync: (path: string, value: string) => Promise,
492
- removeItemAsync: (path: string) => Promise,
493
- clear: () => void,
494
- };*/
495
- /*:: type LocalDatastoreController = {
496
- fromPinWithName: (name: string) => ?any,
497
- pinWithName: (name: string, objects: any) => void,
498
- unPinWithName: (name: string) => void,
499
- getAllContents: () => ?any,
500
- clear: () => void,
501
- };*/
502
- /*:: type UserController = {
503
- setCurrentUser: (user: ParseUser) => Promise,
504
- currentUser: () => ?ParseUser,
505
- currentUserAsync: () => Promise,
506
- signUp: (user: ParseUser, attrs: AttributeMap, options: RequestOptions) => Promise,
507
- logIn: (user: ParseUser, options: RequestOptions) => Promise,
508
- become: (options: RequestOptions) => Promise,
509
- hydrate: (userJSON: AttributeMap) => Promise,
510
- logOut: (options: RequestOptions) => Promise,
511
- me: (options: RequestOptions) => Promise,
512
- requestPasswordReset: (email: string, options: RequestOptions) => Promise,
513
- updateUserOnDisk: (user: ParseUser) => Promise,
514
- upgradeToRevocableSession: (user: ParseUser, options: RequestOptions) => Promise,
515
- linkWith: (user: ParseUser, authData: AuthData) => Promise,
516
- removeUserFromDisk: () => Promise,
517
- verifyPassword: (username: string, password: string, options: RequestOptions) => Promise,
518
- requestEmailVerification: (email: string, options: RequestOptions) => Promise,
519
- };*/
520
- /*:: type HooksController = {
521
- get: (type: string, functionName?: string, triggerName?: string) => Promise,
522
- create: (hook: mixed) => Promise,
523
- delete: (hook: mixed) => Promise,
524
- update: (hook: mixed) => Promise,
525
- send: (method: string, path: string, body?: mixed) => Promise,
526
- };*/
527
- /*:: type WebSocketController = {
381
+ /** Based on https://github.com/react-native-async-storage/async-storage/blob/main/packages/default-storage-backend/src/types.ts */
382
+ /*:: export type WebSocketController = {
528
383
  onopen: () => void,
529
384
  onmessage: (message: any) => void,
530
- onclose: () => void,
385
+ onclose: (arg?: any) => void,
531
386
  onerror: (error: any) => void,
532
387
  send: (data: any) => void,
533
388
  close: () => void,
534
389
  };*/
535
- /*:: type Config = {
536
- AnalyticsController?: AnalyticsController,
537
- CloudController?: CloudController,
538
- ConfigController?: ConfigController,
539
- FileController?: FileController,
540
- InstallationController?: InstallationController,
541
- ObjectController?: ObjectController,
542
- ObjectStateController?: ObjectStateController,
543
- PushController?: PushController,
544
- QueryController?: QueryController,
545
- RESTController?: RESTController,
546
- SchemaController?: SchemaController,
547
- SessionController?: SessionController,
548
- StorageController?: StorageController,
549
- LocalDatastoreController?: LocalDatastoreController,
550
- UserController?: UserController,
551
- HooksController?: HooksController,
552
- WebSocketController?: WebSocketController,
553
- };*/
554
- var config /*: Config & { [key: string]: mixed }*/ = {
555
- // Defaults
390
+ var config /*: Config & { [key: string]: any }*/ = {
556
391
  IS_NODE: typeof process !== 'undefined' && !!process.versions && !!process.versions.node && !process.versions.electron,
557
392
  REQUEST_ATTEMPT_LIMIT: 5,
558
393
  REQUEST_BATCH_SIZE: 20,
@@ -562,7 +397,7 @@ var config /*: Config & { [key: string]: mixed }*/ = {
562
397
  SERVER_AUTH_TOKEN: null,
563
398
  LIVEQUERY_SERVER_URL: null,
564
399
  ENCRYPTED_KEY: null,
565
- VERSION: 'js' + "5.1.0-alpha.8",
400
+ VERSION: 'js' + "5.1.0-beta.1",
566
401
  APPLICATION_ID: null,
567
402
  JAVASCRIPT_KEY: null,
568
403
  MASTER_KEY: null,
@@ -636,11 +471,18 @@ var CoreManager = {
636
471
  requireMethods('FileController', ['saveFile', 'saveBase64'], controller);
637
472
  config['FileController'] = controller;
638
473
  },
474
+ setEventuallyQueue: function (controller /*: EventuallyQueue*/) {
475
+ requireMethods('EventuallyQueue', ['poll', 'save', 'destroy'], controller);
476
+ config['EventuallyQueue'] = controller;
477
+ },
478
+ getEventuallyQueue: function () /*: EventuallyQueue*/{
479
+ return config['EventuallyQueue'];
480
+ },
639
481
  getFileController: function () /*: FileController*/{
640
482
  return config['FileController'];
641
483
  },
642
484
  setInstallationController: function (controller /*: InstallationController*/) {
643
- requireMethods('InstallationController', ['currentInstallationId'], controller);
485
+ requireMethods('InstallationController', ['currentInstallationId', 'currentInstallation', 'updateInstallationOnDisk'], controller);
644
486
  config['InstallationController'] = controller;
645
487
  },
646
488
  getInstallationController: function () /*: InstallationController*/{
@@ -687,13 +529,6 @@ var CoreManager = {
687
529
  getRESTController: function () /*: RESTController*/{
688
530
  return config['RESTController'];
689
531
  },
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
- },
697
532
  setSchemaController: function (controller /*: SchemaController*/) {
698
533
  requireMethods('SchemaController', ['get', 'create', 'update', 'delete', 'send', 'purge'], controller);
699
534
  config['SchemaController'] = controller;
@@ -732,16 +567,16 @@ var CoreManager = {
732
567
  getStorageController: function () /*: StorageController*/{
733
568
  return config['StorageController'];
734
569
  },
735
- setAsyncStorage: function (storage /*: any*/) {
570
+ setAsyncStorage: function (storage /*: AsyncStorageType*/) {
736
571
  config['AsyncStorage'] = storage;
737
572
  },
738
573
  getAsyncStorage: function () {
739
574
  return config['AsyncStorage'];
740
575
  },
741
- setWebSocketController: function (controller /*: WebSocketController*/) {
576
+ setWebSocketController: function (controller /*: new (url: string | URL, protocols?: string | string[] | undefined) => WebSocketController*/) {
742
577
  config['WebSocketController'] = controller;
743
578
  },
744
- getWebSocketController: function () /*: WebSocketController*/{
579
+ getWebSocketController: function () /*: new (url: string | URL, protocols?: string | string[] | undefined) => WebSocketController*/{
745
580
  return config['WebSocketController'];
746
581
  },
747
582
  setUserController: function (controller /*: UserController*/) {
@@ -751,11 +586,11 @@ var CoreManager = {
751
586
  getUserController: function () /*: UserController*/{
752
587
  return config['UserController'];
753
588
  },
754
- setLiveQueryController: function (controller /*: any*/) {
589
+ setLiveQueryController: function (controller /*: LiveQueryControllerType*/) {
755
590
  requireMethods('LiveQueryController', ['setDefaultLiveQueryClient', 'getDefaultLiveQueryClient', '_clearCachedDefaultClient'], controller);
756
591
  config['LiveQueryController'] = controller;
757
592
  },
758
- getLiveQueryController: function () /*: any*/{
593
+ getLiveQueryController: function () /*: LiveQueryControllerType*/{
759
594
  return config['LiveQueryController'];
760
595
  },
761
596
  setHooksController: function (controller /*: HooksController*/) {
@@ -764,6 +599,36 @@ var CoreManager = {
764
599
  },
765
600
  getHooksController: function () /*: HooksController*/{
766
601
  return config['HooksController'];
602
+ },
603
+ setParseOp: function (op /*: typeof ParseOp*/) {
604
+ config['ParseOp'] = op;
605
+ },
606
+ getParseOp: function () {
607
+ return config['ParseOp'];
608
+ },
609
+ setParseObject: function (object /*: typeof ParseObject*/) {
610
+ config['ParseObject'] = object;
611
+ },
612
+ getParseObject: function () /*: ParseObject*/{
613
+ return config['ParseObject'];
614
+ },
615
+ setParseQuery: function (query /*: typeof ParseQuery*/) {
616
+ config['ParseQuery'] = query;
617
+ },
618
+ getParseQuery: function () /*: ParseQuery*/{
619
+ return config['ParseQuery'];
620
+ },
621
+ setParseRole: function (role /*: typeof ParseRole*/) {
622
+ config['ParseRole'] = role;
623
+ },
624
+ getParseRole: function () /*: ParseRole*/{
625
+ return config['ParseRole'];
626
+ },
627
+ setParseUser: function (user /*: typeof ParseUser*/) {
628
+ config['ParseUser'] = user;
629
+ },
630
+ getParseUser: function () /*: ParseUser*/{
631
+ return config['ParseUser'];
767
632
  }
768
633
  };
769
634
  module.exports = CoreManager;
@@ -1261,7 +1126,7 @@ var EventuallyQueue = {
1261
1126
  */
1262
1127
  poll: function () {
1263
1128
  var _this7 = this;
1264
- var ms /*: number*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2000;
1129
+ var ms /*:: ?: number*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2000;
1265
1130
  if (polling) {
1266
1131
  return;
1267
1132
  }
@@ -1637,42 +1502,153 @@ if (typeof window !== 'undefined' && window.indexedDB) {
1637
1502
  },{"@babel/runtime-corejs3/core-js-stable/instance/keys":70,"idb-keyval":623}],10:[function(_dereq_,module,exports){
1638
1503
  "use strict";
1639
1504
 
1505
+ var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
1640
1506
  var _interopRequireDefault = _dereq_("@babel/runtime-corejs3/helpers/interopRequireDefault");
1641
- var _promise = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/promise"));
1507
+ _Object$defineProperty(exports, "__esModule", {
1508
+ value: true
1509
+ });
1510
+ exports.default = void 0;
1511
+ var _regenerator = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/regenerator"));
1512
+ var _stringify = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/json/stringify"));
1513
+ var _asyncToGenerator2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/asyncToGenerator"));
1514
+ var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
1642
1515
  var _Storage = _interopRequireDefault(_dereq_("./Storage"));
1643
- /**
1644
- * @flow
1645
- */
1646
-
1647
- var uuidv4 = _dereq_('./uuid');
1648
- var iidCache = null;
1516
+ var _ParseInstallation = _interopRequireDefault(_dereq_("./ParseInstallation"));
1517
+ var _uuid = _interopRequireDefault(_dereq_("./uuid"));
1518
+ var CURRENT_INSTALLATION_KEY = 'currentInstallation';
1519
+ var CURRENT_INSTALLATION_ID_KEY = 'currentInstallationId';
1520
+ var iidCache /*: string | null*/ = null;
1521
+ var currentInstallationCache = null;
1522
+ var currentInstallationCacheMatchesDisk = false;
1649
1523
  var InstallationController = {
1524
+ updateInstallationOnDisk: function (installation /*: ParseInstallation*/) /*: Promise<void>*/{
1525
+ var _this = this;
1526
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
1527
+ var path;
1528
+ return _regenerator.default.wrap(function (_context) {
1529
+ while (1) switch (_context.prev = _context.next) {
1530
+ case 0:
1531
+ path = _Storage.default.generatePath(CURRENT_INSTALLATION_KEY);
1532
+ _context.next = 3;
1533
+ return _Storage.default.setItemAsync(path, (0, _stringify.default)(installation.toJSON()));
1534
+ case 3:
1535
+ _this._setCurrentInstallationCache(installation);
1536
+ case 4:
1537
+ case "end":
1538
+ return _context.stop();
1539
+ }
1540
+ }, _callee);
1541
+ }))();
1542
+ },
1650
1543
  currentInstallationId: function () /*: Promise<string>*/{
1651
- if (typeof iidCache === 'string') {
1652
- return _promise.default.resolve(iidCache);
1653
- }
1654
- var path = _Storage.default.generatePath('installationId');
1655
- return _Storage.default.getItemAsync(path).then(function (iid) {
1656
- if (!iid) {
1657
- iid = uuidv4();
1658
- return _Storage.default.setItemAsync(path, iid).then(function () {
1659
- iidCache = iid;
1660
- return iid;
1661
- });
1662
- }
1663
- iidCache = iid;
1664
- return iid;
1665
- });
1544
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
1545
+ var path, iid;
1546
+ return _regenerator.default.wrap(function (_context2) {
1547
+ while (1) switch (_context2.prev = _context2.next) {
1548
+ case 0:
1549
+ if (!(typeof iidCache === 'string')) {
1550
+ _context2.next = 2;
1551
+ break;
1552
+ }
1553
+ return _context2.abrupt("return", iidCache);
1554
+ case 2:
1555
+ path = _Storage.default.generatePath(CURRENT_INSTALLATION_ID_KEY);
1556
+ _context2.next = 5;
1557
+ return _Storage.default.getItemAsync(path);
1558
+ case 5:
1559
+ iid = _context2.sent;
1560
+ if (iid) {
1561
+ _context2.next = 9;
1562
+ break;
1563
+ }
1564
+ iid = (0, _uuid.default)();
1565
+ return _context2.abrupt("return", _Storage.default.setItemAsync(path, iid).then(function () {
1566
+ iidCache = iid;
1567
+ return iid;
1568
+ }));
1569
+ case 9:
1570
+ iidCache = iid;
1571
+ return _context2.abrupt("return", iid);
1572
+ case 11:
1573
+ case "end":
1574
+ return _context2.stop();
1575
+ }
1576
+ }, _callee2);
1577
+ }))();
1578
+ },
1579
+ currentInstallation: function () /*: Promise<ParseInstallation | null>*/{
1580
+ var _this2 = this;
1581
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
1582
+ var path, installationData, current, installationId, installation;
1583
+ return _regenerator.default.wrap(function (_context3) {
1584
+ while (1) switch (_context3.prev = _context3.next) {
1585
+ case 0:
1586
+ if (!currentInstallationCache) {
1587
+ _context3.next = 2;
1588
+ break;
1589
+ }
1590
+ return _context3.abrupt("return", currentInstallationCache);
1591
+ case 2:
1592
+ if (!currentInstallationCacheMatchesDisk) {
1593
+ _context3.next = 4;
1594
+ break;
1595
+ }
1596
+ return _context3.abrupt("return", null);
1597
+ case 4:
1598
+ path = _Storage.default.generatePath(CURRENT_INSTALLATION_KEY);
1599
+ _context3.next = 7;
1600
+ return _Storage.default.getItemAsync(path);
1601
+ case 7:
1602
+ installationData = _context3.sent;
1603
+ currentInstallationCacheMatchesDisk = true;
1604
+ if (!installationData) {
1605
+ _context3.next = 15;
1606
+ break;
1607
+ }
1608
+ installationData = JSON.parse(installationData);
1609
+ installationData.className = '_Installation';
1610
+ current = _ParseInstallation.default.fromJSON(installationData);
1611
+ currentInstallationCache = current;
1612
+ return _context3.abrupt("return", current);
1613
+ case 15:
1614
+ _context3.next = 17;
1615
+ return _this2.currentInstallationId();
1616
+ case 17:
1617
+ installationId = _context3.sent;
1618
+ installation = new _ParseInstallation.default();
1619
+ installation.set('deviceType', _ParseInstallation.default.DEVICE_TYPES.WEB);
1620
+ installation.set('installationId', installationId);
1621
+ installation.set('parseVersion', _CoreManager.default.get('VERSION'));
1622
+ currentInstallationCache = installation;
1623
+ _context3.next = 25;
1624
+ return _Storage.default.setItemAsync(path, (0, _stringify.default)(installation.toJSON()));
1625
+ case 25:
1626
+ return _context3.abrupt("return", installation);
1627
+ case 26:
1628
+ case "end":
1629
+ return _context3.stop();
1630
+ }
1631
+ }, _callee3);
1632
+ }))();
1666
1633
  },
1667
1634
  _clearCache: function () {
1668
1635
  iidCache = null;
1636
+ currentInstallationCache = null;
1637
+ currentInstallationCacheMatchesDisk = false;
1669
1638
  },
1670
1639
  _setInstallationIdCache: function (iid /*: string*/) {
1671
1640
  iidCache = iid;
1641
+ },
1642
+ _setCurrentInstallationCache: function (installation /*: ParseInstallation*/) {
1643
+ var matchesDisk /*: boolean*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1644
+ currentInstallationCache = installation;
1645
+ currentInstallationCacheMatchesDisk = matchesDisk;
1672
1646
  }
1673
1647
  };
1674
1648
  module.exports = InstallationController;
1675
- },{"./Storage":40,"./uuid":57,"@babel/runtime-corejs3/core-js-stable/promise":93,"@babel/runtime-corejs3/helpers/interopRequireDefault":113}],11:[function(_dereq_,module,exports){
1649
+ var _default = InstallationController;
1650
+ exports.default = _default;
1651
+ },{"./CoreManager":4,"./ParseInstallation":26,"./Storage":40,"./uuid":57,"@babel/runtime-corejs3/core-js-stable/json/stringify":78,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/helpers/asyncToGenerator":105,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/regenerator":131}],11:[function(_dereq_,module,exports){
1676
1652
  "use strict";
1677
1653
 
1678
1654
  var _sliceInstanceProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/instance/slice");
@@ -3476,8 +3452,8 @@ var _defineProperty2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/he
3476
3452
  var _includes = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/includes"));
3477
3453
  var _stringify = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/json/stringify"));
3478
3454
  var _encode = _interopRequireDefault(_dereq_("./encode"));
3455
+ var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
3479
3456
  var _ParseFile = _interopRequireDefault(_dereq_("./ParseFile"));
3480
- var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
3481
3457
  var _ParseRelation = _interopRequireDefault(_dereq_("./ParseRelation"));
3482
3458
  var _TaskQueue = _interopRequireDefault(_dereq_("./TaskQueue"));
3483
3459
  var _ParseOp = _dereq_("./ParseOp");
@@ -3631,16 +3607,17 @@ function nestedSet(obj, key, value) {
3631
3607
  }
3632
3608
  }
3633
3609
  function commitServerChanges(serverData /*: AttributeMap*/, objectCache /*: ObjectCache*/, changes /*: AttributeMap*/) {
3610
+ var ParseObject = _CoreManager.default.getParseObject();
3634
3611
  for (var _attr3 in changes) {
3635
3612
  var val = changes[_attr3];
3636
3613
  nestedSet(serverData, _attr3, val);
3637
- if (val && (0, _typeof2.default)(val) === 'object' && !(val instanceof _ParseObject.default) && !(val instanceof _ParseFile.default) && !(val instanceof _ParseRelation.default)) {
3614
+ if (val && (0, _typeof2.default)(val) === 'object' && !(val instanceof ParseObject) && !(val instanceof _ParseFile.default) && !(val instanceof _ParseRelation.default)) {
3638
3615
  var json = (0, _encode.default)(val, false, true);
3639
3616
  objectCache[_attr3] = (0, _stringify.default)(json);
3640
3617
  }
3641
3618
  }
3642
3619
  }
3643
- },{"./ParseFile":24,"./ParseObject":28,"./ParseOp":29,"./ParseRelation":32,"./TaskQueue":43,"./encode":49,"@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/helpers/defineProperty":109,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/typeof":128}],18:[function(_dereq_,module,exports){
3620
+ },{"./CoreManager":4,"./ParseFile":24,"./ParseOp":29,"./ParseRelation":32,"./TaskQueue":43,"./encode":49,"@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/helpers/defineProperty":109,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/typeof":128}],18:[function(_dereq_,module,exports){
3644
3621
  "use strict";
3645
3622
 
3646
3623
  var _sliceInstanceProperty2 = _dereq_("@babel/runtime-corejs3/core-js-stable/instance/slice");
@@ -4460,10 +4437,11 @@ var Parse /*: ParseType*/ = {
4460
4437
  _CoreManager.default.setIfNeeded('EventEmitter', _EventEmitter.default);
4461
4438
  _CoreManager.default.setIfNeeded('LiveQuery', new _ParseLiveQuery.default());
4462
4439
  _CoreManager.default.setIfNeeded('CryptoController', _CryptoController.default);
4440
+ _CoreManager.default.setIfNeeded('EventuallyQueue', _EventuallyQueue.default);
4441
+ _CoreManager.default.setIfNeeded('InstallationController', _InstallationController.default);
4463
4442
  _CoreManager.default.setIfNeeded('LocalDatastoreController', _LocalDatastoreController.default);
4464
4443
  _CoreManager.default.setIfNeeded('StorageController', _StorageController.default);
4465
4444
  _CoreManager.default.setIfNeeded('WebSocketController', _WebSocketController.default);
4466
- _CoreManager.default.setIfNeeded('EventuallyQueue', _EventuallyQueue.default);
4467
4445
  Parse.IndexedDB = _CoreManager.default.setIfNeeded('IndexedDBStorageController', _IndexedDBStorageController.default);
4468
4446
  },
4469
4447
  /**
@@ -4706,7 +4684,6 @@ var Parse /*: ParseType*/ = {
4706
4684
  return this.encryptedUser;
4707
4685
  }
4708
4686
  };
4709
- _CoreManager.default.setInstallationController(_InstallationController.default);
4710
4687
  _CoreManager.default.setRESTController(_RESTController.default);
4711
4688
  // For legacy requires, of the form `var Parse = require('parse').Parse`
4712
4689
  Parse.Parse = Parse;
@@ -4728,11 +4705,12 @@ var _typeof2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/ty
4728
4705
  var _classCallCheck2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/classCallCheck"));
4729
4706
  var _createClass2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/createClass"));
4730
4707
  var _defineProperty2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/defineProperty"));
4731
- var _ParseRole = _interopRequireDefault(_dereq_("./ParseRole"));
4732
- var _ParseUser = _interopRequireDefault(_dereq_("./ParseUser"));
4708
+ var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
4733
4709
  /**
4734
4710
  * @flow
4735
4711
  */
4712
+ /*:: import type ParseRole from './ParseRole';*/
4713
+ /*:: import type ParseUser from './ParseUser';*/
4736
4714
  /*:: type PermissionsMap = { [permission: string]: boolean };*/
4737
4715
  /*:: type ByIdMap = { [userId: string]: PermissionsMap };*/
4738
4716
  var PUBLIC_KEY = '*';
@@ -4760,7 +4738,8 @@ var ParseACL = /*#__PURE__*/function () {
4760
4738
  (0, _defineProperty2.default)(this, "permissionsById", void 0);
4761
4739
  this.permissionsById = {};
4762
4740
  if (arg1 && (0, _typeof2.default)(arg1) === 'object') {
4763
- if (arg1 instanceof _ParseUser.default) {
4741
+ var _ParseUser = _CoreManager.default.getParseUser();
4742
+ if (arg1 instanceof _ParseUser) {
4764
4743
  this.setReadAccess(arg1, true);
4765
4744
  this.setWriteAccess(arg1, true);
4766
4745
  } else {
@@ -4832,9 +4811,11 @@ var ParseACL = /*#__PURE__*/function () {
4832
4811
  }, {
4833
4812
  key: "_setAccess",
4834
4813
  value: function (accessType /*: string*/, userId /*: ParseUser | ParseRole | string*/, allowed /*: boolean*/) {
4835
- if (userId instanceof _ParseUser.default) {
4814
+ var ParseRole = _CoreManager.default.getParseRole();
4815
+ var ParseUser = _CoreManager.default.getParseUser();
4816
+ if (userId instanceof ParseUser) {
4836
4817
  userId = userId.id;
4837
- } else if (userId instanceof _ParseRole.default) {
4818
+ } else if (userId instanceof ParseRole) {
4838
4819
  var name = userId.getName();
4839
4820
  if (!name) {
4840
4821
  throw new TypeError('Role must have a name');
@@ -4869,12 +4850,14 @@ var ParseACL = /*#__PURE__*/function () {
4869
4850
  }, {
4870
4851
  key: "_getAccess",
4871
4852
  value: function (accessType /*: string*/, userId /*: ParseUser | ParseRole | string*/) /*: boolean*/{
4872
- if (userId instanceof _ParseUser.default) {
4853
+ var ParseRole = _CoreManager.default.getParseRole();
4854
+ var ParseUser = _CoreManager.default.getParseUser();
4855
+ if (userId instanceof ParseUser) {
4873
4856
  userId = userId.id;
4874
4857
  if (!userId) {
4875
4858
  throw new Error('Cannot get access for a ParseUser without an ID');
4876
4859
  }
4877
- } else if (userId instanceof _ParseRole.default) {
4860
+ } else if (userId instanceof ParseRole) {
4878
4861
  var name = userId.getName();
4879
4862
  if (!name) {
4880
4863
  throw new TypeError('Role must have a name');
@@ -4998,7 +4981,8 @@ var ParseACL = /*#__PURE__*/function () {
4998
4981
  }, {
4999
4982
  key: "getRoleReadAccess",
5000
4983
  value: function (role /*: ParseRole | string*/) /*: boolean*/{
5001
- if (role instanceof _ParseRole.default) {
4984
+ var ParseRole = _CoreManager.default.getParseRole();
4985
+ if (role instanceof ParseRole) {
5002
4986
  // Normalize to the String name
5003
4987
  role = role.getName();
5004
4988
  }
@@ -5020,7 +5004,8 @@ var ParseACL = /*#__PURE__*/function () {
5020
5004
  }, {
5021
5005
  key: "getRoleWriteAccess",
5022
5006
  value: function (role /*: ParseRole | string*/) /*: boolean*/{
5023
- if (role instanceof _ParseRole.default) {
5007
+ var ParseRole = _CoreManager.default.getParseRole();
5008
+ if (role instanceof ParseRole) {
5024
5009
  // Normalize to the String name
5025
5010
  role = role.getName();
5026
5011
  }
@@ -5041,7 +5026,8 @@ var ParseACL = /*#__PURE__*/function () {
5041
5026
  }, {
5042
5027
  key: "setRoleReadAccess",
5043
5028
  value: function (role /*: ParseRole | string*/, allowed /*: boolean*/) {
5044
- if (role instanceof _ParseRole.default) {
5029
+ var ParseRole = _CoreManager.default.getParseRole();
5030
+ if (role instanceof ParseRole) {
5045
5031
  // Normalize to the String name
5046
5032
  role = role.getName();
5047
5033
  }
@@ -5062,7 +5048,8 @@ var ParseACL = /*#__PURE__*/function () {
5062
5048
  }, {
5063
5049
  key: "setRoleWriteAccess",
5064
5050
  value: function (role /*: ParseRole | string*/, allowed /*: boolean*/) {
5065
- if (role instanceof _ParseRole.default) {
5051
+ var ParseRole = _CoreManager.default.getParseRole();
5052
+ if (role instanceof ParseRole) {
5066
5053
  // Normalize to the String name
5067
5054
  role = role.getName();
5068
5055
  }
@@ -5076,7 +5063,7 @@ var ParseACL = /*#__PURE__*/function () {
5076
5063
  }();
5077
5064
  var _default = ParseACL;
5078
5065
  exports.default = _default;
5079
- },{"./ParseRole":33,"./ParseUser":36,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/core-js-stable/object/keys":91,"@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/typeof":128}],21:[function(_dereq_,module,exports){
5066
+ },{"./CoreManager":4,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/core-js-stable/object/keys":91,"@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/typeof":128}],21:[function(_dereq_,module,exports){
5080
5067
  "use strict";
5081
5068
 
5082
5069
  var _sliceInstanceProperty2 = _dereq_("@babel/runtime-corejs3/core-js-stable/instance/slice");
@@ -6760,6 +6747,10 @@ if (typeof XMLHttpRequest !== 'undefined') {
6760
6747
  /*:: type Base64 = { base64: string };*/
6761
6748
  /*:: type Uri = { uri: string };*/
6762
6749
  /*:: type FileData = Array<number> | Base64 | Blob | Uri;*/
6750
+ /*:: export type FileSaveOptions = FullOptions & {
6751
+ metadata?: { [key: string]: any },
6752
+ tags?: { [key: string]: any },
6753
+ };*/
6763
6754
  /*:: export type FileSource =
6764
6755
  | {
6765
6756
  format: 'file',
@@ -7362,13 +7353,11 @@ _Object$defineProperty(exports, "__esModule", {
7362
7353
  });
7363
7354
  exports.default = void 0;
7364
7355
  var _isArray = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/array/is-array"));
7356
+ var _promise = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/promise"));
7365
7357
  var _typeof2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/typeof"));
7366
7358
  var _classCallCheck2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/classCallCheck"));
7367
7359
  var _createClass2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/createClass"));
7368
7360
  var _defineProperty2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/defineProperty"));
7369
- /**
7370
- * @flow
7371
- */
7372
7361
  /**
7373
7362
  * Creates a new GeoPoint with any of the following forms:<br>
7374
7363
  * <pre>
@@ -7471,7 +7460,7 @@ var ParseGeoPoint = /*#__PURE__*/function () {
7471
7460
  }
7472
7461
  }, {
7473
7462
  key: "equals",
7474
- value: function (other /*: mixed*/) /*: boolean*/{
7463
+ value: function (other /*: any*/) /*: boolean*/{
7475
7464
  return other instanceof ParseGeoPoint && this.latitude === other.latitude && this.longitude === other.longitude;
7476
7465
  }
7477
7466
 
@@ -7547,14 +7536,20 @@ var ParseGeoPoint = /*#__PURE__*/function () {
7547
7536
  /**
7548
7537
  * Creates a GeoPoint with the user's current location, if available.
7549
7538
  *
7539
+ * @param {object} options The options.
7540
+ * @param {boolean} [options.enableHighAccuracy=false] A boolean value that indicates the application would like to receive the best possible results. If true and if the device is able to provide a more accurate position, it will do so. Note that this can result in slower response times or increased power consumption (with a GPS chip on a mobile device for example). On the other hand, if false, the device can take the liberty to save resources by responding more quickly and/or using less power. Default: false.
7541
+ * @param {number} [options.timeout=Infinity] A positive long value representing the maximum length of time (in milliseconds) the device is allowed to take in order to return a position. The default value is Infinity, meaning that getCurrentPosition() won't return until the position is available.
7542
+ * @param {number} [options.maximumAge=0] A positive long value indicating the maximum age in milliseconds of a possible cached position that is acceptable to return. If set to 0, it means that the device cannot use a cached position and must attempt to retrieve the real current position. If set to Infinity the device must return a cached position regardless of its age. Default: 0.
7550
7543
  * @static
7551
- * @returns {Parse.GeoPoint} User's current location
7544
+ * @returns {Promise<Parse.GeoPoint>} User's current location
7552
7545
  */
7553
7546
  }, {
7554
7547
  key: "current",
7555
- value: function () {
7556
- return navigator.geolocation.getCurrentPosition(function (location) {
7557
- return new ParseGeoPoint(location.coords.latitude, location.coords.longitude);
7548
+ value: function (options) /*: Promise<ParseGeoPoint>*/{
7549
+ return new _promise.default(function (resolve, reject) {
7550
+ navigator.geolocation.getCurrentPosition(function (location) {
7551
+ resolve(new ParseGeoPoint(location.coords.latitude, location.coords.longitude));
7552
+ }, reject, options);
7558
7553
  });
7559
7554
  }
7560
7555
  }]);
@@ -7562,7 +7557,7 @@ var ParseGeoPoint = /*#__PURE__*/function () {
7562
7557
  }();
7563
7558
  var _default = ParseGeoPoint;
7564
7559
  exports.default = _default;
7565
- },{"@babel/runtime-corejs3/core-js-stable/array/is-array":59,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@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/typeof":128}],26:[function(_dereq_,module,exports){
7560
+ },{"@babel/runtime-corejs3/core-js-stable/array/is-array":59,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/core-js-stable/promise":93,"@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/typeof":128}],26:[function(_dereq_,module,exports){
7566
7561
  "use strict";
7567
7562
 
7568
7563
  var _Reflect$construct = _dereq_("@babel/runtime-corejs3/core-js-stable/reflect/construct");
@@ -7572,12 +7567,16 @@ _Object$defineProperty(exports, "__esModule", {
7572
7567
  value: true
7573
7568
  });
7574
7569
  exports.default = void 0;
7570
+ var _regenerator = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/regenerator"));
7571
+ var _asyncToGenerator2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/asyncToGenerator"));
7575
7572
  var _typeof2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/typeof"));
7576
- var _createClass2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/createClass"));
7577
7573
  var _classCallCheck2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/classCallCheck"));
7574
+ var _createClass2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/createClass"));
7575
+ var _get2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/get"));
7578
7576
  var _inherits2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/inherits"));
7579
7577
  var _possibleConstructorReturn2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
7580
7578
  var _getPrototypeOf2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/getPrototypeOf"));
7579
+ var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
7581
7580
  var _ParseObject2 = _interopRequireDefault(_dereq_("./ParseObject"));
7582
7581
  function _createSuper(Derived) {
7583
7582
  var hasNativeReflectConstruct = _isNativeReflectConstruct();
@@ -7603,29 +7602,286 @@ function _isNativeReflectConstruct() {
7603
7602
  } catch (e) {
7604
7603
  return false;
7605
7604
  }
7606
- } /**
7607
- * @flow
7605
+ }
7606
+ var DEVICE_TYPES /*: DeviceInterface*/ = {
7607
+ IOS: 'ios',
7608
+ MACOS: 'macos',
7609
+ TVOS: 'tvos',
7610
+ FCM: 'fcm',
7611
+ ANDROID: 'android',
7612
+ WEB: 'web'
7613
+ };
7614
+
7615
+ /**
7616
+ * Parse.Installation is a local representation of installation data that can be saved and retrieved from the Parse cloud.
7617
+ * This class is a subclass of a Parse.Object, and retains the same functionality of a Parse.Object, but also extends it with installation-specific features.
7618
+ *
7619
+ * <p>A valid Parse.Installation can only be instantiated via <code>Parse.Installation.currentInstallation()</code>
7620
+ *
7621
+ * Parse.Installation objects which have a valid <code>deviceToken</code> and are saved to the Parse cloud can be used to target push notifications.
7622
+ * </p>
7623
+ *
7624
+ * @alias Parse.Installation
7625
+ */
7626
+ var ParseInstallation = /*#__PURE__*/function (_ParseObject) {
7627
+ (0, _inherits2.default)(ParseInstallation, _ParseObject);
7628
+ var _super = _createSuper(ParseInstallation);
7629
+ /**
7630
+ * @param {object} attributes The initial set of data to store in the object.
7608
7631
  */
7609
- /*:: import type { AttributeMap } from './ObjectStateMutations';*/
7610
- var Installation = /*#__PURE__*/function (_ParseObject) {
7611
- (0, _inherits2.default)(Installation, _ParseObject);
7612
- var _super = _createSuper(Installation);
7613
- function Installation(attributes /*: ?AttributeMap*/) {
7632
+ function ParseInstallation(attributes /*:: ?: AttributeMap*/) {
7614
7633
  var _this;
7615
- (0, _classCallCheck2.default)(this, Installation);
7634
+ (0, _classCallCheck2.default)(this, ParseInstallation);
7616
7635
  _this = _super.call(this, '_Installation');
7617
7636
  if (attributes && (0, _typeof2.default)(attributes) === 'object') {
7618
- if (!_this.set(attributes || {})) {
7637
+ if (!_this.set(attributes)) {
7619
7638
  throw new Error("Can't create an invalid Installation");
7620
7639
  }
7621
7640
  }
7622
7641
  return _this;
7623
7642
  }
7624
- return (0, _createClass2.default)(Installation);
7643
+
7644
+ /**
7645
+ * A unique identifier for this installation’s client application. In iOS, this is the Bundle Identifier.
7646
+ *
7647
+ * @property {string} appIdentifier
7648
+ * @static
7649
+ */
7650
+ (0, _createClass2.default)(ParseInstallation, [{
7651
+ key: "appIdentifier",
7652
+ get: function () {
7653
+ return this.get('appIdentifier');
7654
+ }
7655
+
7656
+ /**
7657
+ * The version string of the client application to which this installation belongs.
7658
+ *
7659
+ * @property {string} appVersion
7660
+ * @static
7661
+ */
7662
+ }, {
7663
+ key: "appVersion",
7664
+ get: function () {
7665
+ return this.get('appVersion');
7666
+ }
7667
+
7668
+ /**
7669
+ * The display name of the client application to which this installation belongs.
7670
+ *
7671
+ * @property {string} appName
7672
+ * @static
7673
+ */
7674
+ }, {
7675
+ key: "appName",
7676
+ get: function () {
7677
+ return this.get('appName');
7678
+ }
7679
+
7680
+ /**
7681
+ * The current value of the icon badge for iOS apps.
7682
+ * Changes to this value on the server will be used
7683
+ * for future badge-increment push notifications.
7684
+ *
7685
+ * @property {number} badge
7686
+ * @static
7687
+ */
7688
+ }, {
7689
+ key: "badge",
7690
+ get: function () {
7691
+ return this.get('badge');
7692
+ }
7693
+
7694
+ /**
7695
+ * An array of the channels to which a device is currently subscribed.
7696
+ *
7697
+ * @property {string[]} channels
7698
+ * @static
7699
+ */
7700
+ }, {
7701
+ key: "channels",
7702
+ get: function () {
7703
+ return this.get('channels');
7704
+ }
7705
+
7706
+ /**
7707
+ * Token used to deliver push notifications to the device.
7708
+ *
7709
+ * @property {string} deviceToken
7710
+ * @static
7711
+ */
7712
+ }, {
7713
+ key: "deviceToken",
7714
+ get: function () {
7715
+ return this.get('deviceToken');
7716
+ }
7717
+
7718
+ /**
7719
+ * The type of device, “ios”, “android”, “web”, etc.
7720
+ *
7721
+ * @property {string} deviceType
7722
+ * @static
7723
+ */
7724
+ }, {
7725
+ key: "deviceType",
7726
+ get: function () {
7727
+ return this.get('deviceType');
7728
+ }
7729
+
7730
+ /**
7731
+ * Gets the GCM sender identifier for this installation
7732
+ *
7733
+ * @property {string} GCMSenderId
7734
+ * @static
7735
+ */
7736
+ }, {
7737
+ key: "GCMSenderId",
7738
+ get: function () {
7739
+ return this.get('GCMSenderId');
7740
+ }
7741
+
7742
+ /**
7743
+ * Universally Unique Identifier (UUID) for the device used by Parse. It must be unique across all of an app’s installations.
7744
+ *
7745
+ * @property {string} installationId
7746
+ * @static
7747
+ */
7748
+ }, {
7749
+ key: "installationId",
7750
+ get: function () {
7751
+ return this.get('installationId');
7752
+ }
7753
+
7754
+ /**
7755
+ * Gets the local identifier for this installation
7756
+ *
7757
+ * @property {string} localeIdentifier
7758
+ * @static
7759
+ */
7760
+ }, {
7761
+ key: "localeIdentifier",
7762
+ get: function () {
7763
+ return this.get('localeIdentifier');
7764
+ }
7765
+
7766
+ /**
7767
+ * Gets the parse server version for this installation
7768
+ *
7769
+ * @property {string} parseVersion
7770
+ * @static
7771
+ */
7772
+ }, {
7773
+ key: "parseVersion",
7774
+ get: function () {
7775
+ return this.get('parseVersion');
7776
+ }
7777
+
7778
+ /**
7779
+ * This field is reserved for directing Parse to the push delivery network to be used.
7780
+ *
7781
+ * @property {string} pushType
7782
+ * @static
7783
+ */
7784
+ }, {
7785
+ key: "pushType",
7786
+ get: function () {
7787
+ return this.get('pushType');
7788
+ }
7789
+
7790
+ /**
7791
+ * Gets the time zone for this installation
7792
+ *
7793
+ * @property {string} timeZone
7794
+ * @static
7795
+ */
7796
+ }, {
7797
+ key: "timeZone",
7798
+ get: function () {
7799
+ return this.get('timeZone');
7800
+ }
7801
+
7802
+ /**
7803
+ * Returns the device types for used for Push Notifications.
7804
+ *
7805
+ * <pre>
7806
+ * Parse.Installation.DEVICE_TYPES.IOS
7807
+ * Parse.Installation.DEVICE_TYPES.MACOS
7808
+ * Parse.Installation.DEVICE_TYPES.TVOS
7809
+ * Parse.Installation.DEVICE_TYPES.FCM
7810
+ * Parse.Installation.DEVICE_TYPES.ANDROID
7811
+ * Parse.Installation.DEVICE_TYPES.WEB
7812
+ * </pre
7813
+ *
7814
+ * @property {object} DEVICE_TYPES
7815
+ * @static
7816
+ */
7817
+ }, {
7818
+ key: "save",
7819
+ value:
7820
+ /**
7821
+ * Wrap the default save behavior with functionality to save to local storage.
7822
+ *
7823
+ * @param {...any} args
7824
+ * @returns {Promise}
7825
+ */
7826
+ function () {
7827
+ var _save = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
7828
+ var _len,
7829
+ args,
7830
+ _key,
7831
+ _args = arguments;
7832
+ return _regenerator.default.wrap(function (_context) {
7833
+ while (1) switch (_context.prev = _context.next) {
7834
+ case 0:
7835
+ for (_len = _args.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
7836
+ args[_key] = _args[_key];
7837
+ }
7838
+ _context.next = 3;
7839
+ return (0, _get2.default)((0, _getPrototypeOf2.default)(ParseInstallation.prototype), "save", this).apply(this, args);
7840
+ case 3:
7841
+ _context.next = 5;
7842
+ return _CoreManager.default.getInstallationController().updateInstallationOnDisk(this);
7843
+ case 5:
7844
+ return _context.abrupt("return", this);
7845
+ case 6:
7846
+ case "end":
7847
+ return _context.stop();
7848
+ }
7849
+ }, _callee, this);
7850
+ }));
7851
+ function save() {
7852
+ return _save.apply(this, arguments);
7853
+ }
7854
+ return save;
7855
+ }()
7856
+ /**
7857
+ * Get the current Parse.Installation from disk. If doesn't exists, create an new installation.
7858
+ *
7859
+ * <pre>
7860
+ * const installation = await Parse.Installation.currentInstallation();
7861
+ * installation.set('deviceToken', '123');
7862
+ * await installation.save();
7863
+ * </pre>
7864
+ *
7865
+ * @returns {Promise} A promise that resolves to the local installation object.
7866
+ */
7867
+ }], [{
7868
+ key: "DEVICE_TYPES",
7869
+ get: function () /*: DeviceInterface*/{
7870
+ return DEVICE_TYPES;
7871
+ }
7872
+ }, {
7873
+ key: "currentInstallation",
7874
+ value: function () /*: Promise<ParseInstallation>*/{
7875
+ return _CoreManager.default.getInstallationController().currentInstallation();
7876
+ }
7877
+ }]);
7878
+ return ParseInstallation;
7625
7879
  }(_ParseObject2.default);
7626
- exports.default = Installation;
7627
- _ParseObject2.default.registerSubclass('_Installation', Installation);
7628
- },{"./ParseObject":28,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/core-js-stable/reflect/construct":94,"@babel/runtime-corejs3/helpers/classCallCheck":106,"@babel/runtime-corejs3/helpers/createClass":108,"@babel/runtime-corejs3/helpers/getPrototypeOf":111,"@babel/runtime-corejs3/helpers/inherits":112,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/possibleConstructorReturn":120,"@babel/runtime-corejs3/helpers/typeof":128}],27:[function(_dereq_,module,exports){
7880
+ _ParseObject2.default.registerSubclass('_Installation', ParseInstallation);
7881
+ module.exports = ParseInstallation;
7882
+ var _default = ParseInstallation;
7883
+ exports.default = _default;
7884
+ },{"./CoreManager":4,"./ParseObject":28,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/core-js-stable/reflect/construct":94,"@babel/runtime-corejs3/helpers/asyncToGenerator":105,"@babel/runtime-corejs3/helpers/classCallCheck":106,"@babel/runtime-corejs3/helpers/createClass":108,"@babel/runtime-corejs3/helpers/get":110,"@babel/runtime-corejs3/helpers/getPrototypeOf":111,"@babel/runtime-corejs3/helpers/inherits":112,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/possibleConstructorReturn":120,"@babel/runtime-corejs3/helpers/typeof":128,"@babel/runtime-corejs3/regenerator":131}],27:[function(_dereq_,module,exports){
7629
7885
  "use strict";
7630
7886
 
7631
7887
  var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
@@ -7893,8 +8149,8 @@ var _ParseError = _interopRequireDefault(_dereq_("./ParseError"));
7893
8149
  var _ParseFile = _interopRequireDefault(_dereq_("./ParseFile"));
7894
8150
  var _promiseUtils = _dereq_("./promiseUtils");
7895
8151
  var _LocalDatastoreUtils = _dereq_("./LocalDatastoreUtils");
8152
+ var _uuid = _interopRequireDefault(_dereq_("./uuid"));
7896
8153
  var _ParseOp = _dereq_("./ParseOp");
7897
- var _ParseQuery = _interopRequireDefault(_dereq_("./ParseQuery"));
7898
8154
  var _ParseRelation = _interopRequireDefault(_dereq_("./ParseRelation"));
7899
8155
  var SingleInstanceStateController = _interopRequireWildcard(_dereq_("./SingleInstanceStateController"));
7900
8156
  var _unique = _interopRequireDefault(_dereq_("./unique"));
@@ -8024,25 +8280,17 @@ function _objectSpread(target) {
8024
8280
  });
8025
8281
  }
8026
8282
  return target;
8027
- } /**
8028
- * @flow
8029
- */
8030
- /*:: import type { AttributeMap, OpsMap } from './ObjectStateMutations';*/
8031
- /*:: import type { RequestOptions, FullOptions } from './RESTController';*/
8032
- var uuidv4 = _dereq_('./uuid');
8283
+ }
8033
8284
  /*:: export type Pointer = {
8034
8285
  __type: string,
8035
8286
  className: string,
8036
- objectId: string,
8037
- };*/
8038
- /*:: type SaveParams = {
8039
- method: string,
8040
- path: string,
8041
- body: AttributeMap,
8287
+ objectId?: string,
8288
+ _localId?: string,
8042
8289
  };*/
8043
8290
  /*:: export type SaveOptions = FullOptions & {
8044
8291
  cascadeSave?: boolean,
8045
8292
  context?: AttributeMap,
8293
+ batchSize?: number,
8046
8294
  };*/
8047
8295
  // Mapping of class names to constructors, so we can populate objects from the
8048
8296
  // server with appropriate subclasses of ParseObject
@@ -8092,7 +8340,7 @@ var ParseObject = /*#__PURE__*/function () {
8092
8340
  * @param {object} attributes The initial set of data to store in the object.
8093
8341
  * @param {object} options The options for this object instance.
8094
8342
  */
8095
- function ParseObject(className /*: ?string | { className: string, [attr: string]: mixed }*/, attributes /*:: ?: { [attr: string]: mixed }*/, options /*:: ?: { ignoreValidation: boolean }*/) {
8343
+ function ParseObject(className /*:: ?: string | { className: string, [attr: string]: any }*/, attributes /*:: ?: { [attr: string]: any }*/, options /*:: ?: { ignoreValidation: boolean }*/) {
8096
8344
  (0, _classCallCheck2.default)(this, ParseObject);
8097
8345
  /**
8098
8346
  * The ID of this object, unique within its class.
@@ -8147,7 +8395,7 @@ var ParseObject = /*#__PURE__*/function () {
8147
8395
  */
8148
8396
  }, {
8149
8397
  key: "createdAt",
8150
- get: function () /*: ?Date*/{
8398
+ get: function () /*: Date | undefined*/{
8151
8399
  return this._getServerData().createdAt;
8152
8400
  }
8153
8401
 
@@ -8159,7 +8407,7 @@ var ParseObject = /*#__PURE__*/function () {
8159
8407
  */
8160
8408
  }, {
8161
8409
  key: "updatedAt",
8162
- get: function () /*: ?Date*/{
8410
+ get: function () /*: Date | undefined*/{
8163
8411
  return this._getServerData().updatedAt;
8164
8412
  }
8165
8413
 
@@ -8179,7 +8427,7 @@ var ParseObject = /*#__PURE__*/function () {
8179
8427
  if (typeof this._localId === 'string') {
8180
8428
  return this._localId;
8181
8429
  }
8182
- var localId = 'local' + uuidv4();
8430
+ var localId = 'local' + (0, _uuid.default)();
8183
8431
  this._localId = localId;
8184
8432
  return localId;
8185
8433
  }
@@ -8273,7 +8521,7 @@ var ParseObject = /*#__PURE__*/function () {
8273
8521
  }, {
8274
8522
  key: "_toFullJSON",
8275
8523
  value: function (seen /*:: ?: Array<any>*/, offline /*:: ?: boolean*/) /*: AttributeMap*/{
8276
- var json /*: { [key: string]: mixed }*/ = this.toJSON(seen, offline);
8524
+ var json /*: { [key: string]: any }*/ = this.toJSON(seen, offline);
8277
8525
  json.__type = 'Object';
8278
8526
  json.className = this.className;
8279
8527
  return json;
@@ -8340,7 +8588,13 @@ var ParseObject = /*#__PURE__*/function () {
8340
8588
  }
8341
8589
  var stateController = _CoreManager.default.getObjectStateController();
8342
8590
  stateController.initializeState(this._getStateIdentifier());
8343
- var decoded = {};
8591
+ var decoded
8592
+ /*: Partial<{
8593
+ createdAt?: Date,
8594
+ updatedAt?: Date,
8595
+ ACL?: any,
8596
+ [key: string]: any,
8597
+ }>*/ = {};
8344
8598
  for (var _attr4 in serverData) {
8345
8599
  if (_attr4 === 'ACL') {
8346
8600
  decoded[_attr4] = new _ParseACL.default(serverData[_attr4]);
@@ -8392,7 +8646,12 @@ var ParseObject = /*#__PURE__*/function () {
8392
8646
  }, {
8393
8647
  key: "_handleSaveResponse",
8394
8648
  value: function (response /*: AttributeMap*/, status /*: number*/) {
8395
- var changes = {};
8649
+ var changes
8650
+ /*: Partial<{
8651
+ createdAt: string,
8652
+ updatedAt: string,
8653
+ [key: string]: any
8654
+ }>*/ = {};
8396
8655
  var stateController = _CoreManager.default.getObjectStateController();
8397
8656
  var pending = stateController.popPendingState(this._getStateIdentifier());
8398
8657
  for (var attr in pending) {
@@ -8455,7 +8714,7 @@ var ParseObject = /*#__PURE__*/function () {
8455
8714
  value: function (seen /*: Array<any> | void*/, offline /*:: ?: boolean*/) /*: AttributeMap*/{
8456
8715
  var seenEntry = this.id ? this.className + ':' + this.id : this;
8457
8716
  seen = seen || [seenEntry];
8458
- var json = {};
8717
+ var json /*: AttributeMap*/ = {};
8459
8718
  var attrs = this.attributes;
8460
8719
  for (var _attr5 in attrs) {
8461
8720
  if ((_attr5 === 'createdAt' || _attr5 === 'updatedAt') && attrs[_attr5].toJSON) {
@@ -8478,7 +8737,7 @@ var ParseObject = /*#__PURE__*/function () {
8478
8737
  */
8479
8738
  }, {
8480
8739
  key: "equals",
8481
- value: function (other /*: mixed*/) /*: boolean*/{
8740
+ value: function (other /*: any*/) /*: boolean*/{
8482
8741
  if (this === other) {
8483
8742
  return true;
8484
8743
  }
@@ -8599,7 +8858,7 @@ var ParseObject = /*#__PURE__*/function () {
8599
8858
  */
8600
8859
  }, {
8601
8860
  key: "get",
8602
- value: function (attr /*: string*/) /*: mixed*/{
8861
+ value: function (attr /*: string*/) /*: any*/{
8603
8862
  return this.attributes[attr];
8604
8863
  }
8605
8864
 
@@ -8694,7 +8953,7 @@ var ParseObject = /*#__PURE__*/function () {
8694
8953
  */
8695
8954
  }, {
8696
8955
  key: "set",
8697
- value: function (key /*: mixed*/, value /*: mixed*/, options /*:: ?: mixed*/) /*: ParseObject | boolean*/{
8956
+ value: function (key /*: any*/, value /*:: ?: any*/, options /*:: ?: any*/) /*: ParseObject | boolean*/{
8698
8957
  var changes = {};
8699
8958
  var newOps = {};
8700
8959
  if (key && (0, _typeof2.default)(key) === 'object') {
@@ -8783,7 +9042,7 @@ var ParseObject = /*#__PURE__*/function () {
8783
9042
  */
8784
9043
  }, {
8785
9044
  key: "unset",
8786
- value: function (attr /*: string*/, options /*:: ?: { [opt: string]: mixed }*/) /*: ParseObject | boolean*/{
9045
+ value: function (attr /*: string*/, options /*:: ?: { [opt: string]: any }*/) /*: ParseObject | boolean*/{
8787
9046
  options = options || {};
8788
9047
  options.unset = true;
8789
9048
  return this.set(attr, null, options);
@@ -8839,7 +9098,7 @@ var ParseObject = /*#__PURE__*/function () {
8839
9098
  */
8840
9099
  }, {
8841
9100
  key: "add",
8842
- value: function (attr /*: string*/, item /*: mixed*/) /*: ParseObject | boolean*/{
9101
+ value: function (attr /*: string*/, item /*: any*/) /*: ParseObject | boolean*/{
8843
9102
  return this.set(attr, new _ParseOp.AddOp([item]));
8844
9103
  }
8845
9104
 
@@ -8853,7 +9112,7 @@ var ParseObject = /*#__PURE__*/function () {
8853
9112
  */
8854
9113
  }, {
8855
9114
  key: "addAll",
8856
- value: function (attr /*: string*/, items /*: Array<mixed>*/) /*: ParseObject | boolean*/{
9115
+ value: function (attr /*: string*/, items /*: Array<any>*/) /*: ParseObject | boolean*/{
8857
9116
  return this.set(attr, new _ParseOp.AddOp(items));
8858
9117
  }
8859
9118
 
@@ -8868,7 +9127,7 @@ var ParseObject = /*#__PURE__*/function () {
8868
9127
  */
8869
9128
  }, {
8870
9129
  key: "addUnique",
8871
- value: function (attr /*: string*/, item /*: mixed*/) /*: ParseObject | boolean*/{
9130
+ value: function (attr /*: string*/, item /*: any*/) /*: ParseObject | boolean*/{
8872
9131
  return this.set(attr, new _ParseOp.AddUniqueOp([item]));
8873
9132
  }
8874
9133
 
@@ -8883,7 +9142,7 @@ var ParseObject = /*#__PURE__*/function () {
8883
9142
  */
8884
9143
  }, {
8885
9144
  key: "addAllUnique",
8886
- value: function (attr /*: string*/, items /*: Array<mixed>*/) /*: ParseObject | boolean*/{
9145
+ value: function (attr /*: string*/, items /*: Array<any>*/) /*: ParseObject | boolean*/{
8887
9146
  return this.set(attr, new _ParseOp.AddUniqueOp(items));
8888
9147
  }
8889
9148
 
@@ -8897,7 +9156,7 @@ var ParseObject = /*#__PURE__*/function () {
8897
9156
  */
8898
9157
  }, {
8899
9158
  key: "remove",
8900
- value: function (attr /*: string*/, item /*: mixed*/) /*: ParseObject | boolean*/{
9159
+ value: function (attr /*: string*/, item /*: any*/) /*: ParseObject | boolean*/{
8901
9160
  return this.set(attr, new _ParseOp.RemoveOp([item]));
8902
9161
  }
8903
9162
 
@@ -8911,7 +9170,7 @@ var ParseObject = /*#__PURE__*/function () {
8911
9170
  */
8912
9171
  }, {
8913
9172
  key: "removeAll",
8914
- value: function (attr /*: string*/, items /*: Array<mixed>*/) /*: ParseObject | boolean*/{
9173
+ value: function (attr /*: string*/, items /*: Array<any>*/) /*: ParseObject | boolean*/{
8915
9174
  return this.set(attr, new _ParseOp.RemoveOp(items));
8916
9175
  }
8917
9176
 
@@ -8926,7 +9185,7 @@ var ParseObject = /*#__PURE__*/function () {
8926
9185
  */
8927
9186
  }, {
8928
9187
  key: "op",
8929
- value: function (attr /*: string*/) /*: ?Op*/{
9188
+ value: function (attr /*: string*/) /*: Op | undefined*/{
8930
9189
  var pending = this._getPendingOps();
8931
9190
  for (var i = pending.length; i--;) {
8932
9191
  if (pending[i][attr]) {
@@ -9032,7 +9291,7 @@ var ParseObject = /*#__PURE__*/function () {
9032
9291
  key: "exists",
9033
9292
  value: function () {
9034
9293
  var _exists = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(options /*:: ?: RequestOptions*/) {
9035
- var query;
9294
+ var ParseQuery, query;
9036
9295
  return _regenerator.default.wrap(function (_context) {
9037
9296
  while (1) switch (_context.prev = _context.next) {
9038
9297
  case 0:
@@ -9043,26 +9302,27 @@ var ParseObject = /*#__PURE__*/function () {
9043
9302
  return _context.abrupt("return", false);
9044
9303
  case 2:
9045
9304
  _context.prev = 2;
9046
- query = new _ParseQuery.default(this.className);
9047
- _context.next = 6;
9305
+ ParseQuery = _CoreManager.default.getParseQuery();
9306
+ query = new ParseQuery(this.className);
9307
+ _context.next = 7;
9048
9308
  return query.get(this.id, options);
9049
- case 6:
9309
+ case 7:
9050
9310
  return _context.abrupt("return", true);
9051
- case 9:
9052
- _context.prev = 9;
9311
+ case 10:
9312
+ _context.prev = 10;
9053
9313
  _context.t0 = _context["catch"](2);
9054
9314
  if (!(_context.t0.code === _ParseError.default.OBJECT_NOT_FOUND)) {
9055
- _context.next = 13;
9315
+ _context.next = 14;
9056
9316
  break;
9057
9317
  }
9058
9318
  return _context.abrupt("return", false);
9059
- case 13:
9060
- throw _context.t0;
9061
9319
  case 14:
9320
+ throw _context.t0;
9321
+ case 15:
9062
9322
  case "end":
9063
9323
  return _context.stop();
9064
9324
  }
9065
- }, _callee, this, [[2, 9]]);
9325
+ }, _callee, this, [[2, 10]]);
9066
9326
  }));
9067
9327
  function exists() {
9068
9328
  return _exists.apply(this, arguments);
@@ -9112,7 +9372,7 @@ var ParseObject = /*#__PURE__*/function () {
9112
9372
  */
9113
9373
  }, {
9114
9374
  key: "getACL",
9115
- value: function () /*: ?ParseACL*/{
9375
+ value: function () /*: ParseACL | null*/{
9116
9376
  var acl = this.get('ACL');
9117
9377
  if (acl instanceof _ParseACL.default) {
9118
9378
  return acl;
@@ -9130,7 +9390,7 @@ var ParseObject = /*#__PURE__*/function () {
9130
9390
  */
9131
9391
  }, {
9132
9392
  key: "setACL",
9133
- value: function (acl /*: ParseACL*/, options /*:: ?: mixed*/) /*: ParseObject | boolean*/{
9393
+ value: function (acl /*: ParseACL*/, options /*:: ?: any*/) /*: ParseObject | boolean*/{
9134
9394
  return this.set('ACL', acl, options);
9135
9395
  }
9136
9396
 
@@ -9211,9 +9471,9 @@ var ParseObject = /*#__PURE__*/function () {
9211
9471
  */
9212
9472
  }, {
9213
9473
  key: "fetch",
9214
- value: function (options /*: RequestOptions*/) /*: Promise*/{
9474
+ value: function (options /*: FetchOptions*/) /*: Promise<any>*/{
9215
9475
  options = options || {};
9216
- var fetchOptions = {};
9476
+ var fetchOptions /*: FetchOptions*/ = {};
9217
9477
  if (options.hasOwnProperty('useMasterKey')) {
9218
9478
  fetchOptions.useMasterKey = options.useMasterKey;
9219
9479
  }
@@ -9263,7 +9523,7 @@ var ParseObject = /*#__PURE__*/function () {
9263
9523
  */
9264
9524
  }, {
9265
9525
  key: "fetchWithInclude",
9266
- value: function (keys /*: String | Array<string | Array<string>>*/, options /*: RequestOptions*/) /*: Promise*/{
9526
+ value: function (keys /*: String | Array<string | Array<string>>*/, options /*: RequestOptions*/) /*: Promise<any>*/{
9267
9527
  options = options || {};
9268
9528
  options.include = keys;
9269
9529
  return this.fetch(options);
@@ -9395,7 +9655,7 @@ var ParseObject = /*#__PURE__*/function () {
9395
9655
  */
9396
9656
  }, {
9397
9657
  key: "save",
9398
- value: function (arg1 /*: ?string | { [attr: string]: mixed }*/, arg2 /*: SaveOptions | mixed*/, arg3 /*:: ?: SaveOptions*/) /*: Promise*/{
9658
+ value: function (arg1 /*: undefined | string | { [attr: string]: any } | null*/, arg2 /*: SaveOptions | any*/, arg3 /*:: ?: SaveOptions*/) /*: Promise<this>*/{
9399
9659
  var _this = this;
9400
9660
  var attrs;
9401
9661
  var options;
@@ -9420,7 +9680,7 @@ var ParseObject = /*#__PURE__*/function () {
9420
9680
  return _promise.default.reject(validationError);
9421
9681
  }
9422
9682
  }
9423
- var saveOptions = {};
9683
+ var saveOptions /*: SaveOptions*/ = {};
9424
9684
  if (options.hasOwnProperty('useMasterKey')) {
9425
9685
  saveOptions.useMasterKey = !!options.useMasterKey;
9426
9686
  }
@@ -9515,9 +9775,9 @@ var ParseObject = /*#__PURE__*/function () {
9515
9775
  */
9516
9776
  }, {
9517
9777
  key: "destroy",
9518
- value: function (options /*: RequestOptions*/) /*: Promise*/{
9778
+ value: function (options /*: RequestOptions*/) /*: Promise<void | ParseObject>*/{
9519
9779
  options = options || {};
9520
- var destroyOptions = {};
9780
+ var destroyOptions /*: RequestOptions*/ = {};
9521
9781
  if (options.hasOwnProperty('useMasterKey')) {
9522
9782
  destroyOptions.useMasterKey = options.useMasterKey;
9523
9783
  }
@@ -9744,7 +10004,7 @@ var ParseObject = /*#__PURE__*/function () {
9744
10004
  key: "fetchAll",
9745
10005
  value: function (list /*: Array<ParseObject>*/) {
9746
10006
  var options /*: RequestOptions*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
9747
- var queryOptions = {};
10007
+ var queryOptions /*: RequestOptions*/ = {};
9748
10008
  if (options.hasOwnProperty('useMasterKey')) {
9749
10009
  queryOptions.useMasterKey = options.useMasterKey;
9750
10010
  }
@@ -9852,9 +10112,9 @@ var ParseObject = /*#__PURE__*/function () {
9852
10112
  */
9853
10113
  }, {
9854
10114
  key: "fetchAllIfNeeded",
9855
- value: function (list /*: Array<ParseObject>*/, options) {
10115
+ value: function (list /*: Array<ParseObject>*/, options /*: FetchOptions*/) {
9856
10116
  options = options || {};
9857
- var queryOptions = {};
10117
+ var queryOptions /*: FetchOptions*/ = {};
9858
10118
  if (options.hasOwnProperty('useMasterKey')) {
9859
10119
  queryOptions.useMasterKey = options.useMasterKey;
9860
10120
  }
@@ -9868,7 +10128,7 @@ var ParseObject = /*#__PURE__*/function () {
9868
10128
  }
9869
10129
  }, {
9870
10130
  key: "handleIncludeOptions",
9871
- value: function (options) {
10131
+ value: function (options /*: { include?: string | string[] }*/) {
9872
10132
  var include = [];
9873
10133
  if ((0, _isArray.default)(options.include)) {
9874
10134
  var _context8;
@@ -9934,8 +10194,8 @@ var ParseObject = /*#__PURE__*/function () {
9934
10194
  }, {
9935
10195
  key: "destroyAll",
9936
10196
  value: function (list /*: Array<ParseObject>*/) {
9937
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
9938
- var destroyOptions = {};
10197
+ var options /*: SaveOptions*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
10198
+ var destroyOptions /*: SaveOptions*/ = {};
9939
10199
  if (options.hasOwnProperty('useMasterKey')) {
9940
10200
  destroyOptions.useMasterKey = options.useMasterKey;
9941
10201
  }
@@ -9972,8 +10232,8 @@ var ParseObject = /*#__PURE__*/function () {
9972
10232
  }, {
9973
10233
  key: "saveAll",
9974
10234
  value: function (list /*: Array<ParseObject>*/) {
9975
- var options /*: RequestOptions*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
9976
- var saveOptions = {};
10235
+ var options /*: SaveOptions*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
10236
+ var saveOptions /*: SaveOptions*/ = {};
9977
10237
  if (options.hasOwnProperty('useMasterKey')) {
9978
10238
  saveOptions.useMasterKey = options.useMasterKey;
9979
10239
  }
@@ -10005,7 +10265,7 @@ var ParseObject = /*#__PURE__*/function () {
10005
10265
  */
10006
10266
  }, {
10007
10267
  key: "createWithoutData",
10008
- value: function (id /*: string*/) {
10268
+ value: function (id /*: string*/) /*: ParseObject*/{
10009
10269
  var obj = new this();
10010
10270
  obj.id = id;
10011
10271
  return obj;
@@ -10023,13 +10283,13 @@ var ParseObject = /*#__PURE__*/function () {
10023
10283
  */
10024
10284
  }, {
10025
10285
  key: "fromJSON",
10026
- value: function (json /*: any*/, override /*:: ?: boolean*/, dirty /*:: ?: boolean*/) {
10286
+ value: function (json /*: any*/, override /*:: ?: boolean*/, dirty /*:: ?: boolean*/) /*: ParseObject*/{
10027
10287
  if (!json.className) {
10028
10288
  throw new Error('Cannot create an object without a className');
10029
10289
  }
10030
10290
  var constructor = classMap[json.className];
10031
10291
  var o = constructor ? new constructor(json.className) : new ParseObject(json.className);
10032
- var otherAttributes = {};
10292
+ var otherAttributes /*: AttributeMap*/ = {};
10033
10293
  for (var _attr11 in json) {
10034
10294
  if (_attr11 !== 'className' && _attr11 !== '__type') {
10035
10295
  otherAttributes[_attr11] = json[_attr11];
@@ -10416,7 +10676,7 @@ var ParseObject = /*#__PURE__*/function () {
10416
10676
  return ParseObject;
10417
10677
  }();
10418
10678
  var DefaultController = {
10419
- fetch: function (target /*: ParseObject | Array<ParseObject>*/, forceFetch /*: boolean*/, options /*: RequestOptions*/) /*: Promise<Array<void> | ParseObject>*/{
10679
+ fetch: function (target /*: ParseObject | Array<ParseObject>*/, forceFetch /*: boolean*/, options /*: RequestOptions*/) /*: Promise<Array<ParseObject | undefined> | ParseObject | undefined>*/{
10420
10680
  var localDatastore = _CoreManager.default.getLocalDatastore();
10421
10681
  if ((0, _isArray.default)(target)) {
10422
10682
  if (target.length < 1) {
@@ -10449,7 +10709,8 @@ var DefaultController = {
10449
10709
  if (error) {
10450
10710
  return _promise.default.reject(error);
10451
10711
  }
10452
- var query = new _ParseQuery.default(className);
10712
+ var ParseQuery = _CoreManager.default.getParseQuery();
10713
+ var query = new ParseQuery(className);
10453
10714
  query.containedIn('objectId', ids);
10454
10715
  if (options && options.include) {
10455
10716
  query.include(options.include);
@@ -10527,7 +10788,7 @@ var DefaultController = {
10527
10788
  return _promise.default.reject(new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'Object does not have an ID'));
10528
10789
  }
10529
10790
  var RESTController = _CoreManager.default.getRESTController();
10530
- var params = {};
10791
+ var params /*: RequestOptions*/ = {};
10531
10792
  if (options && options.include) {
10532
10793
  params.include = options.include.join();
10533
10794
  }
@@ -10554,9 +10815,9 @@ var DefaultController = {
10554
10815
  };
10555
10816
  }());
10556
10817
  }
10557
- return _promise.default.resolve();
10818
+ return _promise.default.resolve(undefined);
10558
10819
  },
10559
- destroy: function (target /*: ParseObject | Array<ParseObject>*/, options /*: RequestOptions*/) /*: Promise<Array<void> | ParseObject>*/{
10820
+ destroy: function (target /*: ParseObject | Array<ParseObject>*/, options /*: RequestOptions*/) /*: Promise<ParseObject | Array<ParseObject>>*/{
10560
10821
  return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
10561
10822
  var batchSize, localDatastore, RESTController, batches, deleteCompleted, errors;
10562
10823
  return _regenerator.default.wrap(function (_context14) {
@@ -10686,7 +10947,7 @@ var DefaultController = {
10686
10947
  }, _callee10);
10687
10948
  }))();
10688
10949
  },
10689
- save: function (target /*: ParseObject | Array<ParseObject | ParseFile>*/, options /*: RequestOptions*/) {
10950
+ save: function (target /*: ParseObject | Array<ParseObject | ParseFile>*/, options /*: RequestOptions*/) /*: Promise<ParseObject | Array<ParseObject> | ParseFile>*/{
10690
10951
  var batchSize = options && options.batchSize ? options.batchSize : _CoreManager.default.get('REQUEST_BATCH_SIZE');
10691
10952
  var localDatastore = _CoreManager.default.getLocalDatastore();
10692
10953
  var mapIdForPin = {};
@@ -10881,10 +11142,11 @@ var DefaultController = {
10881
11142
  return _promise.default.resolve();
10882
11143
  }
10883
11144
  };
11145
+ _CoreManager.default.setParseObject(ParseObject);
10884
11146
  _CoreManager.default.setObjectController(DefaultController);
10885
11147
  var _default = ParseObject;
10886
11148
  exports.default = _default;
10887
- },{"./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){
11149
+ },{"./CoreManager":4,"./LocalDatastoreUtils":16,"./ParseACL":20,"./ParseError":23,"./ParseFile":24,"./ParseOp":29,"./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){
10888
11150
  "use strict";
10889
11151
 
10890
11152
  var _Reflect$construct = _dereq_("@babel/runtime-corejs3/core-js-stable/reflect/construct");
@@ -10911,7 +11173,7 @@ var _map = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable
10911
11173
  var _arrayContainsObject = _interopRequireDefault(_dereq_("./arrayContainsObject"));
10912
11174
  var _decode = _interopRequireDefault(_dereq_("./decode"));
10913
11175
  var _encode = _interopRequireDefault(_dereq_("./encode"));
10914
- var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
11176
+ var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
10915
11177
  var _ParseRelation = _interopRequireDefault(_dereq_("./ParseRelation"));
10916
11178
  var _unique = _interopRequireDefault(_dereq_("./unique"));
10917
11179
  function _createSuper(Derived) {
@@ -10940,7 +11202,7 @@ function _isNativeReflectConstruct() {
10940
11202
  }
10941
11203
  } /**
10942
11204
  * @flow
10943
- */
11205
+ */ /*:: import type ParseObject from './ParseObject';*/
10944
11206
  function opFromJSON(json /*: { [key: string]: any }*/) /*: ?Op*/{
10945
11207
  if (!json || !json.__op) {
10946
11208
  return null;
@@ -11189,9 +11451,10 @@ var AddUniqueOp = /*#__PURE__*/function (_Op5) {
11189
11451
  }
11190
11452
  if ((0, _isArray.default)(value)) {
11191
11453
  var _context;
11454
+ var ParseObject = _CoreManager.default.getParseObject();
11192
11455
  var toAdd = [];
11193
11456
  (0, _forEach.default)(_context = this._value).call(_context, function (v) {
11194
- if (v instanceof _ParseObject.default) {
11457
+ if (v instanceof ParseObject) {
11195
11458
  if (!(0, _arrayContainsObject.default)(value, v)) {
11196
11459
  toAdd.push(v);
11197
11460
  }
@@ -11252,6 +11515,7 @@ var RemoveOp = /*#__PURE__*/function (_Op6) {
11252
11515
  return [];
11253
11516
  }
11254
11517
  if ((0, _isArray.default)(value)) {
11518
+ var ParseObject = _CoreManager.default.getParseObject();
11255
11519
  // var i = value.indexOf(this._value);
11256
11520
  var removed = (0, _concat.default)(value).call(value, []);
11257
11521
  for (var i = 0; i < this._value.length; i++) {
@@ -11260,9 +11524,9 @@ var RemoveOp = /*#__PURE__*/function (_Op6) {
11260
11524
  (0, _splice.default)(removed).call(removed, index, 1);
11261
11525
  index = (0, _indexOf.default)(removed).call(removed, this._value[i]);
11262
11526
  }
11263
- if (this._value[i] instanceof _ParseObject.default && this._value[i].id) {
11527
+ if (this._value[i] instanceof ParseObject && this._value[i].id) {
11264
11528
  for (var j = 0; j < removed.length; j++) {
11265
- if (removed[j] instanceof _ParseObject.default && this._value[i].id === removed[j].id) {
11529
+ if (removed[j] instanceof ParseObject && this._value[i].id === removed[j].id) {
11266
11530
  (0, _splice.default)(removed).call(removed, j, 1);
11267
11531
  j--;
11268
11532
  }
@@ -11287,9 +11551,10 @@ var RemoveOp = /*#__PURE__*/function (_Op6) {
11287
11551
  }
11288
11552
  if (previous instanceof RemoveOp) {
11289
11553
  var _context2;
11554
+ var ParseObject = _CoreManager.default.getParseObject();
11290
11555
  var uniques = (0, _concat.default)(_context2 = previous._value).call(_context2, []);
11291
11556
  for (var i = 0; i < this._value.length; i++) {
11292
- if (this._value[i] instanceof _ParseObject.default) {
11557
+ if (this._value[i] instanceof ParseObject) {
11293
11558
  if (!(0, _arrayContainsObject.default)(uniques, this._value[i])) {
11294
11559
  uniques.push(this._value[i]);
11295
11560
  }
@@ -11465,7 +11730,18 @@ var RelationOp = /*#__PURE__*/function (_Op7) {
11465
11730
  return RelationOp;
11466
11731
  }(Op);
11467
11732
  exports.RelationOp = RelationOp;
11468
- },{"./ParseObject":28,"./ParseRelation":32,"./arrayContainsObject":46,"./decode":48,"./encode":49,"./unique":55,"@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/for-each":67,"@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/splice":75,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/core-js-stable/reflect/construct":94,"@babel/runtime-corejs3/helpers/assertThisInitialized":104,"@babel/runtime-corejs3/helpers/classCallCheck":106,"@babel/runtime-corejs3/helpers/createClass":108,"@babel/runtime-corejs3/helpers/defineProperty":109,"@babel/runtime-corejs3/helpers/getPrototypeOf":111,"@babel/runtime-corejs3/helpers/inherits":112,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/possibleConstructorReturn":120}],30:[function(_dereq_,module,exports){
11733
+ _CoreManager.default.setParseOp({
11734
+ Op: Op,
11735
+ opFromJSON: opFromJSON,
11736
+ SetOp: SetOp,
11737
+ UnsetOp: UnsetOp,
11738
+ IncrementOp: IncrementOp,
11739
+ AddOp: AddOp,
11740
+ RelationOp: RelationOp,
11741
+ RemoveOp: RemoveOp,
11742
+ AddUniqueOp: AddUniqueOp
11743
+ });
11744
+ },{"./CoreManager":4,"./ParseRelation":32,"./arrayContainsObject":46,"./decode":48,"./encode":49,"./unique":55,"@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/for-each":67,"@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/splice":75,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/core-js-stable/reflect/construct":94,"@babel/runtime-corejs3/helpers/assertThisInitialized":104,"@babel/runtime-corejs3/helpers/classCallCheck":106,"@babel/runtime-corejs3/helpers/createClass":108,"@babel/runtime-corejs3/helpers/defineProperty":109,"@babel/runtime-corejs3/helpers/getPrototypeOf":111,"@babel/runtime-corejs3/helpers/inherits":112,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/possibleConstructorReturn":120}],30:[function(_dereq_,module,exports){
11469
11745
  "use strict";
11470
11746
 
11471
11747
  var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
@@ -14064,6 +14340,7 @@ var DefaultController = {
14064
14340
  return RESTController.request('GET', 'aggregate/' + className, params, options);
14065
14341
  }
14066
14342
  };
14343
+ _CoreManager.default.setParseQuery(ParseQuery);
14067
14344
  _CoreManager.default.setQueryController(DefaultController);
14068
14345
  var _default = ParseQuery;
14069
14346
  exports.default = _default;
@@ -14080,12 +14357,12 @@ var _isArray = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-st
14080
14357
  var _classCallCheck2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/classCallCheck"));
14081
14358
  var _createClass2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/createClass"));
14082
14359
  var _defineProperty2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/defineProperty"));
14083
- var _ParseOp = _dereq_("./ParseOp");
14084
- var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
14085
- var _ParseQuery = _interopRequireDefault(_dereq_("./ParseQuery"));
14360
+ var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
14086
14361
  /**
14087
14362
  * @flow
14088
14363
  */
14364
+ /*:: import type ParseObject from './ParseObject';*/
14365
+ /*:: import type ParseQuery from './ParseQuery';*/
14089
14366
  /**
14090
14367
  * Creates a new Relation for the given parent object and key. This
14091
14368
  * constructor should rarely be used directly, but rather created by
@@ -14152,7 +14429,9 @@ var ParseRelation = /*#__PURE__*/function () {
14152
14429
  if (!(0, _isArray.default)(objects)) {
14153
14430
  objects = [objects];
14154
14431
  }
14155
- var change = new _ParseOp.RelationOp(objects, []);
14432
+ var _CoreManager$getParse = _CoreManager.default.getParseOp(),
14433
+ RelationOp = _CoreManager$getParse.RelationOp;
14434
+ var change = new RelationOp(objects, []);
14156
14435
  var parent = this.parent;
14157
14436
  if (!parent) {
14158
14437
  throw new Error('Cannot add to a Relation without a parent');
@@ -14176,7 +14455,9 @@ var ParseRelation = /*#__PURE__*/function () {
14176
14455
  if (!(0, _isArray.default)(objects)) {
14177
14456
  objects = [objects];
14178
14457
  }
14179
- var change = new _ParseOp.RelationOp([], objects);
14458
+ var _CoreManager$getParse2 = _CoreManager.default.getParseOp(),
14459
+ RelationOp = _CoreManager$getParse2.RelationOp;
14460
+ var change = new RelationOp([], objects);
14180
14461
  if (!this.parent) {
14181
14462
  throw new Error('Cannot remove from a Relation without a parent');
14182
14463
  }
@@ -14215,11 +14496,12 @@ var ParseRelation = /*#__PURE__*/function () {
14215
14496
  if (!parent) {
14216
14497
  throw new Error('Cannot construct a query for a Relation without a parent');
14217
14498
  }
14499
+ var ParseQuery = _CoreManager.default.getParseQuery();
14218
14500
  if (!this.targetClassName) {
14219
- query = new _ParseQuery.default(parent.className);
14501
+ query = new ParseQuery(parent.className);
14220
14502
  query._extraOptions.redirectClassNameForKey = this.key;
14221
14503
  } else {
14222
- query = new _ParseQuery.default(this.targetClassName);
14504
+ query = new ParseQuery(this.targetClassName);
14223
14505
  }
14224
14506
  query._addCondition('$relatedTo', 'object', {
14225
14507
  __type: 'Pointer',
@@ -14234,7 +14516,7 @@ var ParseRelation = /*#__PURE__*/function () {
14234
14516
  }();
14235
14517
  var _default = ParseRelation;
14236
14518
  exports.default = _default;
14237
- },{"./ParseObject":28,"./ParseOp":29,"./ParseQuery":31,"@babel/runtime-corejs3/core-js-stable/array/is-array":59,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/helpers/classCallCheck":106,"@babel/runtime-corejs3/helpers/createClass":108,"@babel/runtime-corejs3/helpers/defineProperty":109,"@babel/runtime-corejs3/helpers/interopRequireDefault":113}],33:[function(_dereq_,module,exports){
14519
+ },{"./CoreManager":4,"@babel/runtime-corejs3/core-js-stable/array/is-array":59,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/helpers/classCallCheck":106,"@babel/runtime-corejs3/helpers/createClass":108,"@babel/runtime-corejs3/helpers/defineProperty":109,"@babel/runtime-corejs3/helpers/interopRequireDefault":113}],33:[function(_dereq_,module,exports){
14238
14520
  "use strict";
14239
14521
 
14240
14522
  var _Reflect$construct = _dereq_("@babel/runtime-corejs3/core-js-stable/reflect/construct");
@@ -14250,6 +14532,7 @@ var _get2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/get")
14250
14532
  var _inherits2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/inherits"));
14251
14533
  var _possibleConstructorReturn2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
14252
14534
  var _getPrototypeOf2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/getPrototypeOf"));
14535
+ var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
14253
14536
  var _ParseACL = _interopRequireDefault(_dereq_("./ParseACL"));
14254
14537
  var _ParseError = _interopRequireDefault(_dereq_("./ParseError"));
14255
14538
  var _ParseObject2 = _interopRequireDefault(_dereq_("./ParseObject"));
@@ -14423,10 +14706,11 @@ var ParseRole = /*#__PURE__*/function (_ParseObject) {
14423
14706
  }]);
14424
14707
  return ParseRole;
14425
14708
  }(_ParseObject2.default);
14709
+ _CoreManager.default.setParseRole(ParseRole);
14426
14710
  _ParseObject2.default.registerSubclass('_Role', ParseRole);
14427
14711
  var _default = ParseRole;
14428
14712
  exports.default = _default;
14429
- },{"./ParseACL":20,"./ParseError":23,"./ParseObject":28,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/core-js-stable/reflect/construct":94,"@babel/runtime-corejs3/helpers/classCallCheck":106,"@babel/runtime-corejs3/helpers/createClass":108,"@babel/runtime-corejs3/helpers/get":110,"@babel/runtime-corejs3/helpers/getPrototypeOf":111,"@babel/runtime-corejs3/helpers/inherits":112,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/possibleConstructorReturn":120}],34:[function(_dereq_,module,exports){
14713
+ },{"./CoreManager":4,"./ParseACL":20,"./ParseError":23,"./ParseObject":28,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/core-js-stable/reflect/construct":94,"@babel/runtime-corejs3/helpers/classCallCheck":106,"@babel/runtime-corejs3/helpers/createClass":108,"@babel/runtime-corejs3/helpers/get":110,"@babel/runtime-corejs3/helpers/getPrototypeOf":111,"@babel/runtime-corejs3/helpers/inherits":112,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/possibleConstructorReturn":120}],34:[function(_dereq_,module,exports){
14430
14714
  "use strict";
14431
14715
 
14432
14716
  var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
@@ -15068,7 +15352,7 @@ var ParseSession = /*#__PURE__*/function (_ParseObject) {
15068
15352
  value: function (options /*: FullOptions*/) {
15069
15353
  options = options || {};
15070
15354
  var controller = _CoreManager.default.getSessionController();
15071
- var sessionOptions = {};
15355
+ var sessionOptions /*: FullOptions*/ = {};
15072
15356
  if (options.hasOwnProperty('useMasterKey')) {
15073
15357
  sessionOptions.useMasterKey = options.useMasterKey;
15074
15358
  }
@@ -16692,6 +16976,7 @@ var DefaultController = {
16692
16976
  }, options);
16693
16977
  }
16694
16978
  };
16979
+ _CoreManager.default.setParseUser(ParseUser);
16695
16980
  _CoreManager.default.setUserController(DefaultController);
16696
16981
  var _default = ParseUser;
16697
16982
  exports.default = _default;
@@ -17187,7 +17472,6 @@ var _typeof = _dereq_("@babel/runtime-corejs3/helpers/typeof");
17187
17472
  var _WeakMap = _dereq_("@babel/runtime-corejs3/core-js-stable/weak-map");
17188
17473
  var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
17189
17474
  var _Object$getOwnPropertyDescriptor = _dereq_("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
17190
- var _interopRequireDefault = _dereq_("@babel/runtime-corejs3/helpers/interopRequireDefault");
17191
17475
  _Object$defineProperty(exports, "__esModule", {
17192
17476
  value: true
17193
17477
  });
@@ -17209,7 +17493,6 @@ exports.removeState = removeState;
17209
17493
  exports.setPendingOp = setPendingOp;
17210
17494
  exports.setServerData = setServerData;
17211
17495
  var ObjectStateMutations = _interopRequireWildcard(_dereq_("./ObjectStateMutations"));
17212
- var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
17213
17496
  function _getRequireWildcardCache(nodeInterop) {
17214
17497
  if (typeof _WeakMap !== "function") return null;
17215
17498
  var cacheBabelInterop = new _WeakMap();
@@ -17333,12 +17616,12 @@ function getObjectCache(obj /*: ObjectIdentifier*/) /*: ObjectCache*/{
17333
17616
  }
17334
17617
  return {};
17335
17618
  }
17336
- function estimateAttribute(obj /*: ParseObject*/, attr /*: string*/) /*: mixed*/{
17619
+ function estimateAttribute(obj /*: ObjectIdentifier*/, attr /*: string*/) /*: mixed*/{
17337
17620
  var serverData = getServerData(obj);
17338
17621
  var pendingOps = getPendingOps(obj);
17339
17622
  return ObjectStateMutations.estimateAttribute(serverData, pendingOps, obj, attr);
17340
17623
  }
17341
- function estimateAttributes(obj /*: ParseObject*/) /*: AttributeMap*/{
17624
+ function estimateAttributes(obj /*: ObjectIdentifier*/) /*: AttributeMap*/{
17342
17625
  var serverData = getServerData(obj);
17343
17626
  var pendingOps = getPendingOps(obj);
17344
17627
  return ObjectStateMutations.estimateAttributes(serverData, pendingOps, obj);
@@ -17357,7 +17640,7 @@ function clearAllState() {
17357
17640
  function duplicateState(source /*: { id: string }*/, dest /*: { id: string }*/) {
17358
17641
  dest.id = source.id;
17359
17642
  }
17360
- },{"./ObjectStateMutations":17,"./ParseObject":28,"@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/weak-map":99,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/typeof":128}],40:[function(_dereq_,module,exports){
17643
+ },{"./ObjectStateMutations":17,"@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/weak-map":99,"@babel/runtime-corejs3/helpers/typeof":128}],40:[function(_dereq_,module,exports){
17361
17644
  "use strict";
17362
17645
 
17363
17646
  var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
@@ -17764,23 +18047,24 @@ _Object$defineProperty(exports, "__esModule", {
17764
18047
  });
17765
18048
  exports.default = arrayContainsObject;
17766
18049
  var _indexOf = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
17767
- var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
18050
+ var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
17768
18051
  /**
17769
18052
  * @flow
17770
18053
  */
17771
-
18054
+ /*:: import type ParseObject from './ParseObject';*/
17772
18055
  function arrayContainsObject(array /*: Array<any>*/, object /*: ParseObject*/) /*: boolean*/{
17773
18056
  if ((0, _indexOf.default)(array).call(array, object) > -1) {
17774
18057
  return true;
17775
18058
  }
18059
+ var ParseObject = _CoreManager.default.getParseObject();
17776
18060
  for (var i = 0; i < array.length; i++) {
17777
- if (array[i] instanceof _ParseObject.default && array[i].className === object.className && array[i]._getId() === object._getId()) {
18061
+ if (array[i] instanceof ParseObject && array[i].className === object.className && array[i]._getId() === object._getId()) {
17778
18062
  return true;
17779
18063
  }
17780
18064
  }
17781
18065
  return false;
17782
18066
  }
17783
- },{"./ParseObject":28,"@babel/runtime-corejs3/core-js-stable/instance/index-of":69,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/helpers/interopRequireDefault":113}],47:[function(_dereq_,module,exports){
18067
+ },{"./CoreManager":4,"@babel/runtime-corejs3/core-js-stable/instance/index-of":69,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/helpers/interopRequireDefault":113}],47:[function(_dereq_,module,exports){
17784
18068
  "use strict";
17785
18069
 
17786
18070
  var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
@@ -17791,15 +18075,16 @@ _Object$defineProperty(exports, "__esModule", {
17791
18075
  exports.default = canBeSerialized;
17792
18076
  var _isArray = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/array/is-array"));
17793
18077
  var _typeof2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/typeof"));
18078
+ var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
17794
18079
  var _ParseFile = _interopRequireDefault(_dereq_("./ParseFile"));
17795
- var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
17796
18080
  var _ParseRelation = _interopRequireDefault(_dereq_("./ParseRelation"));
17797
18081
  /**
17798
18082
  * @flow
17799
18083
  */
17800
-
18084
+ /*:: import type ParseObject from './ParseObject';*/
17801
18085
  function canBeSerialized(obj /*: ParseObject*/) /*: boolean*/{
17802
- if (!(obj instanceof _ParseObject.default)) {
18086
+ var ParseObject = _CoreManager.default.getParseObject();
18087
+ if (!(obj instanceof ParseObject)) {
17803
18088
  return true;
17804
18089
  }
17805
18090
  var attributes = obj.attributes;
@@ -17818,7 +18103,8 @@ function canBeSerializedHelper(value /*: any*/) /*: boolean*/{
17818
18103
  if (value instanceof _ParseRelation.default) {
17819
18104
  return true;
17820
18105
  }
17821
- if (value instanceof _ParseObject.default) {
18106
+ var ParseObject = _CoreManager.default.getParseObject();
18107
+ if (value instanceof ParseObject) {
17822
18108
  return !!value.id;
17823
18109
  }
17824
18110
  if (value instanceof _ParseFile.default) {
@@ -17842,7 +18128,7 @@ function canBeSerializedHelper(value /*: any*/) /*: boolean*/{
17842
18128
  }
17843
18129
  return true;
17844
18130
  }
17845
- },{"./ParseFile":24,"./ParseObject":28,"./ParseRelation":32,"@babel/runtime-corejs3/core-js-stable/array/is-array":59,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/typeof":128}],48:[function(_dereq_,module,exports){
18131
+ },{"./CoreManager":4,"./ParseFile":24,"./ParseRelation":32,"@babel/runtime-corejs3/core-js-stable/array/is-array":59,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/typeof":128}],48:[function(_dereq_,module,exports){
17846
18132
  "use strict";
17847
18133
 
17848
18134
  var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
@@ -17854,16 +18140,16 @@ exports.default = decode;
17854
18140
  var _isArray = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/array/is-array"));
17855
18141
  var _forEach = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
17856
18142
  var _typeof2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/typeof"));
18143
+ var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
17857
18144
  var _ParseACL = _interopRequireDefault(_dereq_("./ParseACL"));
17858
18145
  var _ParseFile = _interopRequireDefault(_dereq_("./ParseFile"));
17859
18146
  var _ParseGeoPoint = _interopRequireDefault(_dereq_("./ParseGeoPoint"));
17860
18147
  var _ParsePolygon = _interopRequireDefault(_dereq_("./ParsePolygon"));
17861
- var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
17862
- var _ParseOp = _dereq_("./ParseOp");
17863
18148
  var _ParseRelation = _interopRequireDefault(_dereq_("./ParseRelation"));
17864
18149
  /**
17865
18150
  * @flow
17866
18151
  */
18152
+
17867
18153
  // eslint-disable-line no-unused-vars
17868
18154
 
17869
18155
  function decode(value /*: any*/) /*: any*/{
@@ -17878,13 +18164,16 @@ function decode(value /*: any*/) /*: any*/{
17878
18164
  return dup;
17879
18165
  }
17880
18166
  if (typeof value.__op === 'string') {
17881
- return (0, _ParseOp.opFromJSON)(value);
18167
+ var _CoreManager$getParse = _CoreManager.default.getParseOp(),
18168
+ opFromJSON = _CoreManager$getParse.opFromJSON;
18169
+ return opFromJSON(value);
17882
18170
  }
18171
+ var ParseObject = _CoreManager.default.getParseObject();
17883
18172
  if (value.__type === 'Pointer' && value.className) {
17884
- return _ParseObject.default.fromJSON(value);
18173
+ return ParseObject.fromJSON(value);
17885
18174
  }
17886
18175
  if (value.__type === 'Object' && value.className) {
17887
- return _ParseObject.default.fromJSON(value);
18176
+ return ParseObject.fromJSON(value);
17888
18177
  }
17889
18178
  if (value.__type === 'Relation') {
17890
18179
  // The parent and key fields will be populated by the parent
@@ -17913,7 +18202,7 @@ function decode(value /*: any*/) /*: any*/{
17913
18202
  }
17914
18203
  return copy;
17915
18204
  }
17916
- },{"./ParseACL":20,"./ParseFile":24,"./ParseGeoPoint":25,"./ParseObject":28,"./ParseOp":29,"./ParsePolygon":30,"./ParseRelation":32,"@babel/runtime-corejs3/core-js-stable/array/is-array":59,"@babel/runtime-corejs3/core-js-stable/instance/for-each":67,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/typeof":128}],49:[function(_dereq_,module,exports){
18205
+ },{"./CoreManager":4,"./ParseACL":20,"./ParseFile":24,"./ParseGeoPoint":25,"./ParsePolygon":30,"./ParseRelation":32,"@babel/runtime-corejs3/core-js-stable/array/is-array":59,"@babel/runtime-corejs3/core-js-stable/instance/for-each":67,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/typeof":128}],49:[function(_dereq_,module,exports){
17917
18206
  "use strict";
17918
18207
 
17919
18208
  var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
@@ -17929,19 +18218,19 @@ var _startsWith = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js
17929
18218
  var _concat = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/concat"));
17930
18219
  var _isArray = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/array/is-array"));
17931
18220
  var _map = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/map"));
18221
+ var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
17932
18222
  var _ParseACL = _interopRequireDefault(_dereq_("./ParseACL"));
17933
18223
  var _ParseFile = _interopRequireDefault(_dereq_("./ParseFile"));
17934
18224
  var _ParseGeoPoint = _interopRequireDefault(_dereq_("./ParseGeoPoint"));
17935
18225
  var _ParsePolygon = _interopRequireDefault(_dereq_("./ParsePolygon"));
17936
- var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
17937
- var _ParseOp = _dereq_("./ParseOp");
17938
18226
  var _ParseRelation = _interopRequireDefault(_dereq_("./ParseRelation"));
17939
18227
  /**
17940
18228
  * @flow
17941
18229
  */
17942
18230
 
17943
18231
  function encode(value /*: mixed*/, disallowObjects /*: boolean*/, forcePointers /*: boolean*/, seen /*: Array<mixed>*/, offline /*: boolean*/) /*: any*/{
17944
- if (value instanceof _ParseObject.default) {
18232
+ var ParseObject = _CoreManager.default.getParseObject();
18233
+ if (value instanceof ParseObject) {
17945
18234
  if (disallowObjects) {
17946
18235
  throw new Error('Parse Objects not allowed here');
17947
18236
  }
@@ -17956,7 +18245,9 @@ function encode(value /*: mixed*/, disallowObjects /*: boolean*/, forcePointers
17956
18245
  seen = (0, _concat.default)(seen).call(seen, seenEntry);
17957
18246
  return value._toFullJSON(seen, offline);
17958
18247
  }
17959
- if (value instanceof _ParseOp.Op || value instanceof _ParseACL.default || value instanceof _ParseGeoPoint.default || value instanceof _ParsePolygon.default || value instanceof _ParseRelation.default) {
18248
+ var _CoreManager$getParse = _CoreManager.default.getParseOp(),
18249
+ Op = _CoreManager$getParse.Op;
18250
+ if (value instanceof Op || value instanceof _ParseACL.default || value instanceof _ParseGeoPoint.default || value instanceof _ParsePolygon.default || value instanceof _ParseRelation.default) {
17960
18251
  return value.toJSON();
17961
18252
  }
17962
18253
  if (value instanceof _ParseFile.default) {
@@ -17994,7 +18285,7 @@ function encode(value /*: mixed*/, disallowObjects /*: boolean*/, forcePointers
17994
18285
  function _default(value /*: mixed*/, disallowObjects /*:: ?: boolean*/, forcePointers /*:: ?: boolean*/, seen /*:: ?: Array<mixed>*/, offline /*:: ?: boolean*/) /*: any*/{
17995
18286
  return encode(value, !!disallowObjects, !!forcePointers, seen || [], offline);
17996
18287
  }
17997
- },{"./ParseACL":20,"./ParseFile":24,"./ParseGeoPoint":25,"./ParseObject":28,"./ParseOp":29,"./ParsePolygon":30,"./ParseRelation":32,"@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/index-of":69,"@babel/runtime-corejs3/core-js-stable/instance/map":71,"@babel/runtime-corejs3/core-js-stable/instance/starts-with":76,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/core-js-stable/object/keys":91,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/typeof":128}],50:[function(_dereq_,module,exports){
18288
+ },{"./CoreManager":4,"./ParseACL":20,"./ParseFile":24,"./ParseGeoPoint":25,"./ParsePolygon":30,"./ParseRelation":32,"@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/index-of":69,"@babel/runtime-corejs3/core-js-stable/instance/map":71,"@babel/runtime-corejs3/core-js-stable/instance/starts-with":76,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/core-js-stable/object/keys":91,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/typeof":128}],50:[function(_dereq_,module,exports){
17998
18289
  "use strict";
17999
18290
 
18000
18291
  var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
@@ -18006,10 +18297,10 @@ exports.default = equals;
18006
18297
  var _isArray = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/array/is-array"));
18007
18298
  var _keys = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/object/keys"));
18008
18299
  var _typeof2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/typeof"));
18300
+ var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
18009
18301
  var _ParseACL = _interopRequireDefault(_dereq_("./ParseACL"));
18010
18302
  var _ParseFile = _interopRequireDefault(_dereq_("./ParseFile"));
18011
18303
  var _ParseGeoPoint = _interopRequireDefault(_dereq_("./ParseGeoPoint"));
18012
- var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
18013
18304
  function equals(a, b) {
18014
18305
  var toString = Object.prototype.toString;
18015
18306
  if (toString.call(a) === '[object Date]' || toString.call(b) === '[object Date]') {
@@ -18038,10 +18329,11 @@ function equals(a, b) {
18038
18329
  }
18039
18330
  return true;
18040
18331
  }
18041
- if (a instanceof _ParseACL.default || a instanceof _ParseFile.default || a instanceof _ParseGeoPoint.default || a instanceof _ParseObject.default) {
18332
+ var ParseObject = _CoreManager.default.getParseObject();
18333
+ if (a instanceof _ParseACL.default || a instanceof _ParseFile.default || a instanceof _ParseGeoPoint.default || a instanceof ParseObject) {
18042
18334
  return a.equals(b);
18043
18335
  }
18044
- if (b instanceof _ParseObject.default) {
18336
+ if (b instanceof ParseObject) {
18045
18337
  if (a.__type === 'Object' || a.__type === 'Pointer') {
18046
18338
  return a.objectId === b.id && a.className === b.className;
18047
18339
  }
@@ -18056,7 +18348,7 @@ function equals(a, b) {
18056
18348
  }
18057
18349
  return true;
18058
18350
  }
18059
- },{"./ParseACL":20,"./ParseFile":24,"./ParseGeoPoint":25,"./ParseObject":28,"@babel/runtime-corejs3/core-js-stable/array/is-array":59,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/core-js-stable/object/keys":91,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/typeof":128}],51:[function(_dereq_,module,exports){
18351
+ },{"./CoreManager":4,"./ParseACL":20,"./ParseFile":24,"./ParseGeoPoint":25,"@babel/runtime-corejs3/core-js-stable/array/is-array":59,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/core-js-stable/object/keys":91,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/typeof":128}],51:[function(_dereq_,module,exports){
18060
18352
  "use strict";
18061
18353
 
18062
18354
  var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
@@ -18221,7 +18513,7 @@ exports.default = unique;
18221
18513
  var _forEach = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
18222
18514
  var _indexOf = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
18223
18515
  var _arrayContainsObject = _interopRequireDefault(_dereq_("./arrayContainsObject"));
18224
- var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
18516
+ var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
18225
18517
  /**
18226
18518
  * @flow
18227
18519
  */
@@ -18229,7 +18521,8 @@ var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
18229
18521
  function unique /*:: <T>*/(arr /*: Array<T>*/) /*: Array<T>*/{
18230
18522
  var uniques = [];
18231
18523
  (0, _forEach.default)(arr).call(arr, function (value) {
18232
- if (value instanceof _ParseObject.default) {
18524
+ var ParseObject = _CoreManager.default.getParseObject();
18525
+ if (value instanceof ParseObject) {
18233
18526
  if (!(0, _arrayContainsObject.default)(uniques, value)) {
18234
18527
  uniques.push(value);
18235
18528
  }
@@ -18241,7 +18534,7 @@ function unique /*:: <T>*/(arr /*: Array<T>*/) /*: Array<T>*/{
18241
18534
  });
18242
18535
  return uniques;
18243
18536
  }
18244
- },{"./ParseObject":28,"./arrayContainsObject":46,"@babel/runtime-corejs3/core-js-stable/instance/for-each":67,"@babel/runtime-corejs3/core-js-stable/instance/index-of":69,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/helpers/interopRequireDefault":113}],56:[function(_dereq_,module,exports){
18537
+ },{"./CoreManager":4,"./arrayContainsObject":46,"@babel/runtime-corejs3/core-js-stable/instance/for-each":67,"@babel/runtime-corejs3/core-js-stable/instance/index-of":69,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/helpers/interopRequireDefault":113}],56:[function(_dereq_,module,exports){
18245
18538
  "use strict";
18246
18539
 
18247
18540
  var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
@@ -18255,12 +18548,13 @@ var _indexOf = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-st
18255
18548
  var _isArray = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/array/is-array"));
18256
18549
  var _forEach = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
18257
18550
  var _typeof2 = _interopRequireDefault(_dereq_("@babel/runtime-corejs3/helpers/typeof"));
18551
+ var _CoreManager = _interopRequireDefault(_dereq_("./CoreManager"));
18258
18552
  var _ParseFile = _interopRequireDefault(_dereq_("./ParseFile"));
18259
- var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
18260
18553
  var _ParseRelation = _interopRequireDefault(_dereq_("./ParseRelation"));
18261
18554
  /**
18262
18555
  * @flow
18263
18556
  */
18557
+ /*:: import type ParseObject from './ParseObject';*/
18264
18558
  /*:: type EncounterMap = {
18265
18559
  objects: { [identifier: string]: ParseObject | boolean },
18266
18560
  files: Array<ParseFile>,
@@ -18295,7 +18589,8 @@ function unsavedChildren(obj /*: ParseObject*/, allowDeepUnsaved /*:: ?: boolean
18295
18589
  return (0, _concat.default)(unsaved).call(unsaved, encountered.files);
18296
18590
  }
18297
18591
  function traverse(obj /*: ParseObject*/, encountered /*: EncounterMap*/, shouldThrow /*: boolean*/, allowDeepUnsaved /*: boolean*/) {
18298
- if (obj instanceof _ParseObject.default) {
18592
+ var ParseObject = _CoreManager.default.getParseObject();
18593
+ if (obj instanceof ParseObject) {
18299
18594
  if (!obj.id && shouldThrow) {
18300
18595
  throw new Error('Cannot create a pointer to an unsaved Object.');
18301
18596
  }
@@ -18334,15 +18629,21 @@ function traverse(obj /*: ParseObject*/, encountered /*: EncounterMap*/, shouldT
18334
18629
  }
18335
18630
  }
18336
18631
  }
18337
- },{"./ParseFile":24,"./ParseObject":28,"./ParseRelation":32,"@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/for-each":67,"@babel/runtime-corejs3/core-js-stable/instance/index-of":69,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/typeof":128}],57:[function(_dereq_,module,exports){
18632
+ },{"./CoreManager":4,"./ParseFile":24,"./ParseRelation":32,"@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/for-each":67,"@babel/runtime-corejs3/core-js-stable/instance/index-of":69,"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"@babel/runtime-corejs3/helpers/interopRequireDefault":113,"@babel/runtime-corejs3/helpers/typeof":128}],57:[function(_dereq_,module,exports){
18338
18633
  "use strict";
18339
18634
 
18340
- var uuid = null;
18341
- var _require = _dereq_('uuid'),
18342
- v4 = _require.v4;
18343
- uuid = v4;
18635
+ var _Object$defineProperty = _dereq_("@babel/runtime-corejs3/core-js-stable/object/define-property");
18636
+ _Object$defineProperty(exports, "__esModule", {
18637
+ value: true
18638
+ });
18639
+ exports.default = void 0;
18640
+ var _uuid = _dereq_("uuid");
18641
+ var uuid /*: () => string*/ = null;
18642
+ uuid = _uuid.v4;
18344
18643
  module.exports = uuid;
18345
- },{"uuid":624}],58:[function(_dereq_,module,exports){
18644
+ var _default = uuid;
18645
+ exports.default = _default;
18646
+ },{"@babel/runtime-corejs3/core-js-stable/object/define-property":84,"uuid":624}],58:[function(_dereq_,module,exports){
18346
18647
  module.exports = _dereq_("core-js-pure/stable/array/from");
18347
18648
  },{"core-js-pure/stable/array/from":560}],59:[function(_dereq_,module,exports){
18348
18649
  module.exports = _dereq_("core-js-pure/stable/array/is-array");