14552ccf907e907c011405860c9c02fcb631918d8ac99d4bc380ca18af8c4fa5.json 241 KB

1
  1. {"ast":null,"code":"\"use strict\";\n\nvar _asyncToGenerator = require(\"F:/workspace/202226701027/huinongbao-app/node_modules/@babel/runtime/helpers/asyncToGenerator.js\").default;\nvar _WeakMap = require(\"@babel/runtime-corejs3/core-js-stable/weak-map\");\nvar _Object$defineProperty2 = require(\"@babel/runtime-corejs3/core-js-stable/object/define-property\");\nvar _Object$getOwnPropertyDescriptor = require(\"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs3/helpers/interopRequireDefault\");\n_Object$defineProperty2(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs3/helpers/defineProperty\"));\nvar _indexOf = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/instance/index-of\"));\nvar _freeze = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/object/freeze\"));\nvar _keys = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/object/keys\"));\nvar _forEach = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/instance/for-each\"));\nvar _stringify = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/json/stringify\"));\nvar _includes = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/instance/includes\"));\nvar _getPrototypeOf = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/object/get-prototype-of\"));\nvar _concat = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/instance/concat\"));\nvar _isArray = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/array/is-array\"));\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/promise\"));\nvar _create = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/object/create\"));\nvar _defineProperty3 = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/object/define-property\"));\nvar _find = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/instance/find\"));\nvar _map = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/instance/map\"));\nvar _CoreManager = _interopRequireDefault(require(\"./CoreManager\"));\nvar _canBeSerialized = _interopRequireDefault(require(\"./canBeSerialized\"));\nvar _decode = _interopRequireDefault(require(\"./decode\"));\nvar _encode = _interopRequireDefault(require(\"./encode\"));\nvar _escape = _interopRequireDefault(require(\"./escape\"));\nvar _ParseACL = _interopRequireDefault(require(\"./ParseACL\"));\nvar _parseDate = _interopRequireDefault(require(\"./parseDate\"));\nvar _ParseError = _interopRequireDefault(require(\"./ParseError\"));\nvar _ParseFile = _interopRequireDefault(require(\"./ParseFile\"));\nvar _promiseUtils = require(\"./promiseUtils\");\nvar _LocalDatastoreUtils = require(\"./LocalDatastoreUtils\");\nvar _uuid = _interopRequireDefault(require(\"./uuid\"));\nvar _ParseOp = require(\"./ParseOp\");\nvar _ParseRelation = _interopRequireDefault(require(\"./ParseRelation\"));\nvar SingleInstanceStateController = _interopRequireWildcard(require(\"./SingleInstanceStateController\"));\nvar _unique = _interopRequireDefault(require(\"./unique\"));\nvar UniqueInstanceStateController = _interopRequireWildcard(require(\"./UniqueInstanceStateController\"));\nvar _unsavedChildren = _interopRequireDefault(require(\"./unsavedChildren\"));\nfunction _getRequireWildcardCache(e) {\n if (\"function\" != typeof _WeakMap) return null;\n var r = new _WeakMap(),\n t = new _WeakMap();\n return (_getRequireWildcardCache = function (e) {\n return e ? t : r;\n })(e);\n}\nfunction _interopRequireWildcard(e, r) {\n if (!r && e && e.__esModule) return e;\n if (null === e || \"object\" != typeof e && \"function\" != typeof e) return {\n default: e\n };\n var t = _getRequireWildcardCache(r);\n if (t && t.has(e)) return t.get(e);\n var n = {\n __proto__: null\n };\n for (var u in e) if (\"default\" !== u && {}.hasOwnProperty.call(e, u)) {\n var i = _Object$defineProperty2 && _Object$getOwnPropertyDescriptor ? _Object$getOwnPropertyDescriptor(e, u) : null;\n i && (i.get || i.set) ? _Object$defineProperty2(n, u, i) : n[u] = e[u];\n }\n return n.default = e, t && t.set(e, n), n;\n}\n// Mapping of class names to constructors, so we can populate objects from the\n// server with appropriate subclasses of ParseObject\nconst classMap = {};\n\n// Global counter for generating unique Ids for non-single-instance objects\nlet objectCount = 0;\n// On web clients, objects are single-instance: any two objects with the same Id\n// will have the same attributes. However, this may be dangerous default\n// behavior in a server scenario\nlet singleInstance = !_CoreManager.default.get('IS_NODE');\nif (singleInstance) {\n _CoreManager.default.setObjectStateController(SingleInstanceStateController);\n} else {\n _CoreManager.default.setObjectStateController(UniqueInstanceStateController);\n}\nfunction getServerUrlPath() {\n let serverUrl = _CoreManager.default.get('SERVER_URL');\n if (serverUrl[serverUrl.length - 1] !== '/') {\n serverUrl += '/';\n }\n const url = serverUrl.replace(/https?:\\/\\//, '');\n return url.substr((0, _indexOf.default)(url).call(url, '/'));\n}\n\n/**\n * Creates a new model with defined attributes.\n *\n * <p>You won't normally call this method directly. It is recommended that\n * you use a subclass of <code>Parse.Object</code> instead, created by calling\n * <code>extend</code>.</p>\n *\n * <p>However, if you don't want to use a subclass, or aren't sure which\n * subclass is appropriate, you can use this form:<pre>\n * var object = new Parse.Object(\"ClassName\");\n * </pre>\n * That is basically equivalent to:<pre>\n * var MyClass = Parse.Object.extend(\"ClassName\");\n * var object = new MyClass();\n * </pre></p>\n *\n * @alias Parse.Object\n */\nclass ParseObject {\n /**\n * @param {string} className The class name for the object\n * @param {object} attributes The initial set of data to store in the object.\n * @param {object} options The options for this object instance.\n * @param {boolean} [options.ignoreValidation] Set to `true` ignore any attribute validation errors.\n */\n constructor(className, attributes, options) {\n /**\n * The ID of this object, unique within its class.\n *\n * @property {string} id\n */\n (0, _defineProperty2.default)(this, \"id\", void 0);\n (0, _defineProperty2.default)(this, \"_localId\", void 0);\n (0, _defineProperty2.default)(this, \"_objCount\", void 0);\n (0, _defineProperty2.default)(this, \"className\", void 0);\n // Enable legacy initializers\n if (typeof this.initialize === 'function') {\n this.initialize.apply(this, arguments);\n }\n let toSet = null;\n this._objCount = objectCount++;\n if (typeof className === 'string') {\n this.className = className;\n if (attributes && typeof attributes === 'object') {\n toSet = attributes;\n }\n } else if (className && typeof className === 'object') {\n this.className = className.className;\n toSet = {};\n for (const attr in className) {\n if (attr !== 'className') {\n toSet[attr] = className[attr];\n }\n }\n if (attributes && typeof attributes === 'object') {\n options = attributes;\n }\n }\n if (toSet && !this.set(toSet, options)) {\n throw new Error(\"Can't create an invalid Parse Object\");\n }\n }\n /* Prototype getters / setters */\n\n get attributes() {\n const stateController = _CoreManager.default.getObjectStateController();\n return (0, _freeze.default)(stateController.estimateAttributes(this._getStateIdentifier()));\n }\n\n /**\n * The first time this object was saved on the server.\n *\n * @property {Date} createdAt\n * @returns {Date}\n */\n get createdAt() {\n return this._getServerData().createdAt;\n }\n\n /**\n * The last time this object was updated on the server.\n *\n * @property {Date} updatedAt\n * @returns {Date}\n */\n get updatedAt() {\n return this._getServerData().updatedAt;\n }\n\n /* Private methods */\n\n /**\n * Returns a local or server Id used uniquely identify this object\n *\n * @returns {string}\n */\n _getId() {\n if (typeof this.id === 'string') {\n return this.id;\n }\n if (typeof this._localId === 'string') {\n return this._localId;\n }\n const localId = 'local' + (0, _uuid.default)();\n this._localId = localId;\n return localId;\n }\n\n /**\n * Returns a unique identifier used to pull data from the State Controller.\n *\n * @returns {Parse.Object|object}\n */\n _getStateIdentifier() {\n if (singleInstance) {\n let id = this.id;\n if (!id) {\n id = this._getId();\n }\n return {\n id: id,\n className: this.className\n };\n } else {\n return this;\n }\n }\n _getServerData() {\n const stateController = _CoreManager.default.getObjectStateController();\n return stateController.getServerData(this._getStateIdentifier());\n }\n _clearServerData() {\n const serverData = this._getServerData();\n const unset = {};\n for (const attr in serverData) {\n unset[attr] = undefined;\n }\n const stateController = _CoreManager.default.getObjectStateController();\n stateController.setServerData(this._getStateIdentifier(), unset);\n }\n _getPendingOps() {\n const stateController = _CoreManager.default.getObjectStateController();\n return stateController.getPendingOps(this._getStateIdentifier());\n }\n\n /**\n * @param {Array<string>} [keysToClear] - if specified, only ops matching\n * these fields will be cleared\n */\n _clearPendingOps(keysToClear) {\n const pending = this._getPendingOps();\n const latest = pending[pending.length - 1];\n const keys = keysToClear || (0, _keys.default)(latest);\n (0, _forEach.default)(keys).call(keys, key => {\n delete latest[key];\n });\n }\n _getDirtyObjectAttributes() {\n const attributes = this.attributes;\n const stateController = _CoreManager.default.getObjectStateController();\n const objectCache = stateController.getObjectCache(this._getStateIdentifier());\n const dirty = {};\n for (const attr in attributes) {\n const val = attributes[attr];\n if (val && typeof val === 'object' && !(val instanceof ParseObject) && !(val instanceof _ParseFile.default) && !(val instanceof _ParseRelation.default)) {\n // Due to the way browsers construct maps, the key order will not change\n // unless the object is changed\n try {\n const json = (0, _encode.default)(val, false, true);\n const stringified = (0, _stringify.default)(json);\n if (objectCache[attr] !== stringified) {\n dirty[attr] = val;\n }\n } catch (e) {\n // Error occurred, possibly by a nested unsaved pointer in a mutable container\n // No matter how it happened, it indicates a change in the attribute\n dirty[attr] = val;\n }\n }\n }\n return dirty;\n }\n _toFullJSON(seen, offline) {\n const json = this.toJSON(seen, offline);\n json.__type = 'Object';\n json.className = this.className;\n return json;\n }\n _getSaveJSON() {\n const pending = this._getPendingOps();\n const dirtyObjects = this._getDirtyObjectAttributes();\n const json = {};\n for (var attr in dirtyObjects) {\n let isDotNotation = false;\n for (let i = 0; i < pending.length; i += 1) {\n for (const field in pending[i]) {\n // Dot notation operations are handled later\n if ((0, _includes.default)(field).call(field, '.')) {\n const fieldName = field.split('.')[0];\n if (fieldName === attr) {\n isDotNotation = true;\n break;\n }\n }\n }\n }\n if (!isDotNotation) {\n json[attr] = new _ParseOp.SetOp(dirtyObjects[attr]).toJSON();\n }\n }\n for (attr in pending[0]) {\n json[attr] = pending[0][attr].toJSON();\n }\n return json;\n }\n _getSaveParams() {\n let method = this.id ? 'PUT' : 'POST';\n const body = this._getSaveJSON();\n let path = 'classes/' + this.className;\n if (_CoreManager.default.get('ALLOW_CUSTOM_OBJECT_ID')) {\n if (!this.createdAt) {\n method = 'POST';\n body.objectId = this.id;\n } else {\n method = 'PUT';\n path += '/' + this.id;\n }\n } else if (this.id) {\n path += '/' + this.id;\n } else if (this.className === '_User') {\n path = 'users';\n }\n return {\n method,\n body,\n path\n };\n }\n _finishFetch(serverData) {\n if (!this.id && serverData.objectId) {\n this.id = serverData.objectId;\n }\n const stateController = _CoreManager.default.getObjectStateController();\n stateController.initializeState(this._getStateIdentifier());\n const decoded = {};\n for (const attr in serverData) {\n if (attr === 'ACL') {\n decoded[attr] = new _ParseACL.default(serverData[attr]);\n } else if (attr !== 'objectId') {\n decoded[attr] = (0, _decode.default)(serverData[attr]);\n if (decoded[attr] instanceof _ParseRelation.default) {\n decoded[attr]._ensureParentAndKey(this, attr);\n }\n }\n }\n if (decoded.createdAt && typeof decoded.createdAt === 'string') {\n decoded.createdAt = (0, _parseDate.default)(decoded.createdAt);\n }\n if (decoded.updatedAt && typeof decoded.updatedAt === 'string') {\n decoded.updatedAt = (0, _parseDate.default)(decoded.updatedAt);\n }\n if (!decoded.updatedAt && decoded.createdAt) {\n decoded.updatedAt = decoded.createdAt;\n }\n stateController.commitServerChanges(this._getStateIdentifier(), decoded);\n }\n _setExisted(existed) {\n const stateController = _CoreManager.default.getObjectStateController();\n const state = stateController.getState(this._getStateIdentifier());\n if (state) {\n state.existed = existed;\n }\n }\n _migrateId(serverId) {\n if (this._localId && serverId) {\n if (singleInstance) {\n const stateController = _CoreManager.default.getObjectStateController();\n const oldState = stateController.removeState(this._getStateIdentifier());\n this.id = serverId;\n delete this._localId;\n if (oldState) {\n stateController.initializeState(this._getStateIdentifier(), oldState);\n }\n } else {\n this.id = serverId;\n delete this._localId;\n }\n }\n }\n _handleSaveResponse(response, status) {\n const changes = {};\n const stateController = _CoreManager.default.getObjectStateController();\n const pending = stateController.popPendingState(this._getStateIdentifier());\n for (var attr in pending) {\n if (pending[attr] instanceof _ParseOp.RelationOp) {\n changes[attr] = pending[attr].applyTo(undefined, this, attr);\n } else if (!(attr in response)) {\n // Only SetOps and UnsetOps should not come back with results\n changes[attr] = pending[attr].applyTo(undefined);\n }\n }\n for (attr in response) {\n if ((attr === 'createdAt' || attr === 'updatedAt') && typeof response[attr] === 'string') {\n changes[attr] = (0, _parseDate.default)(response[attr]);\n } else if (attr === 'ACL') {\n changes[attr] = new _ParseACL.default(response[attr]);\n } else if (attr !== 'objectId') {\n const val = (0, _decode.default)(response[attr]);\n if (val && (0, _getPrototypeOf.default)(val) === Object.prototype) {\n changes[attr] = {\n ...this.attributes[attr],\n ...val\n };\n } else {\n changes[attr] = val;\n }\n if (changes[attr] instanceof _ParseOp.UnsetOp) {\n changes[attr] = undefined;\n }\n }\n }\n if (changes.createdAt && !changes.updatedAt) {\n changes.updatedAt = changes.createdAt;\n }\n this._migrateId(response.objectId);\n if (status !== 201) {\n this._setExisted(true);\n }\n stateController.commitServerChanges(this._getStateIdentifier(), changes);\n }\n _handleSaveError() {\n const stateController = _CoreManager.default.getObjectStateController();\n stateController.mergeFirstPendingState(this._getStateIdentifier());\n }\n static _getClassMap() {\n return classMap;\n }\n\n /* Public methods */\n\n initialize() {\n // NOOP\n }\n\n /**\n * Returns a JSON version of the object suitable for saving to Parse.\n *\n * @param seen\n * @param offline\n * @returns {object}\n */\n toJSON(seen, offline) {\n const seenEntry = this.id ? this.className + ':' + this.id : this;\n seen = seen || [seenEntry];\n const json = {};\n const attrs = this.attributes;\n for (const attr in attrs) {\n if ((attr === 'createdAt' || attr === 'updatedAt') && attrs[attr].toJSON) {\n json[attr] = attrs[attr].toJSON();\n } else {\n json[attr] = (0, _encode.default)(attrs[attr], false, false, seen, offline);\n }\n }\n const pending = this._getPendingOps();\n for (const attr in pending[0]) {\n if ((0, _indexOf.default)(attr).call(attr, '.') < 0) {\n json[attr] = pending[0][attr].toJSON(offline);\n }\n }\n if (this.id) {\n json.objectId = this.id;\n }\n return json;\n }\n\n /**\n * Determines whether this ParseObject is equal to another ParseObject\n *\n * @param {object} other - An other object ot compare\n * @returns {boolean}\n */\n equals(other) {\n if (this === other) {\n return true;\n }\n return other instanceof ParseObject && this.className === other.className && this.id === other.id && typeof this.id !== 'undefined';\n }\n\n /**\n * Returns true if this object has been modified since its last\n * save/refresh. If an attribute is specified, it returns true only if that\n * particular attribute has been modified since the last save/refresh.\n *\n * @param {string} attr An attribute name (optional).\n * @returns {boolean}\n */\n dirty(attr) {\n if (!this.id) {\n return true;\n }\n const pendingOps = this._getPendingOps();\n const dirtyObjects = this._getDirtyObjectAttributes();\n if (attr) {\n if (dirtyObjects.hasOwnProperty(attr)) {\n return true;\n }\n for (let i = 0; i < pendingOps.length; i++) {\n if (pendingOps[i].hasOwnProperty(attr)) {\n return true;\n }\n }\n return false;\n }\n if ((0, _keys.default)(pendingOps[0]).length !== 0) {\n return true;\n }\n if ((0, _keys.default)(dirtyObjects).length !== 0) {\n return true;\n }\n return false;\n }\n\n /**\n * Returns an array of keys that have been modified since last save/refresh\n *\n * @returns {string[]}\n */\n dirtyKeys() {\n const pendingOps = this._getPendingOps();\n const keys = {};\n for (let i = 0; i < pendingOps.length; i++) {\n for (const attr in pendingOps[i]) {\n keys[attr] = true;\n }\n }\n const dirtyObjects = this._getDirtyObjectAttributes();\n for (const attr in dirtyObjects) {\n keys[attr] = true;\n }\n return (0, _keys.default)(keys);\n }\n\n /**\n * Returns true if the object has been fetched.\n *\n * @returns {boolean}\n */\n isDataAvailable() {\n const serverData = this._getServerData();\n return !!(0, _keys.default)(serverData).length;\n }\n\n /**\n * Gets a Pointer referencing this Object.\n *\n * @returns {Pointer}\n */\n toPointer() {\n if (!this.id) {\n throw new Error('Cannot create a pointer to an unsaved ParseObject');\n }\n return {\n __type: 'Pointer',\n className: this.className,\n objectId: this.id\n };\n }\n\n /**\n * Gets a Pointer referencing this Object.\n *\n * @returns {Pointer}\n */\n toOfflinePointer() {\n if (!this._localId) {\n throw new Error('Cannot create a offline pointer to a saved ParseObject');\n }\n return {\n __type: 'Object',\n className: this.className,\n _localId: this._localId\n };\n }\n\n /**\n * Gets the value of an attribute.\n *\n * @param {string} attr The string name of an attribute.\n * @returns {*}\n */\n get(attr) {\n return this.attributes[attr];\n }\n\n /**\n * Gets a relation on the given class for the attribute.\n *\n * @param {string} attr The attribute to get the relation for.\n * @returns {Parse.Relation}\n */\n relation(attr) {\n const value = this.get(attr);\n if (value) {\n if (!(value instanceof _ParseRelation.default)) {\n throw new Error('Called relation() on non-relation field ' + attr);\n }\n value._ensureParentAndKey(this, attr);\n return value;\n }\n return new _ParseRelation.default(this, attr);\n }\n\n /**\n * Gets the HTML-escaped value of an attribute.\n *\n * @param {string} attr The string name of an attribute.\n * @returns {string}\n */\n escape(attr) {\n let val = this.attributes[attr];\n if (val == null) {\n return '';\n }\n if (typeof val !== 'string') {\n if (typeof val.toString !== 'function') {\n return '';\n }\n val = val.toString();\n }\n return (0, _escape.default)(val);\n }\n\n /**\n * Returns <code>true</code> if the attribute contains a value that is not\n * null or undefined.\n *\n * @param {string} attr The string name of the attribute.\n * @returns {boolean}\n */\n has(attr) {\n const attributes = this.attributes;\n if (attributes.hasOwnProperty(attr)) {\n return attributes[attr] != null;\n }\n return false;\n }\n\n /**\n * Sets a hash of model attributes on the object.\n *\n * <p>You can call it with an object containing keys and values, with one\n * key and value, or dot notation. For example:<pre>\n * gameTurn.set({\n * player: player1,\n * diceRoll: 2\n * }, {\n * error: function(gameTurnAgain, error) {\n * // The set failed validation.\n * }\n * });\n *\n * game.set(\"currentPlayer\", player2, {\n * error: function(gameTurnAgain, error) {\n * // The set failed validation.\n * }\n * });\n *\n * game.set(\"finished\", true);</pre></p>\n *\n * game.set(\"player.score\", 10);</pre></p>\n *\n * @param {(string|object)} key The key to set.\n * @param {(string|object)} value The value to give it.\n * @param {object} options A set of options for the set.\n * The only supported option is <code>error</code>.\n * @returns {(ParseObject|boolean)} true if the set succeeded.\n */\n set(key, value, options) {\n let changes = {};\n const newOps = {};\n if (key && typeof key === 'object') {\n changes = key;\n options = value;\n } else if (typeof key === 'string') {\n changes[key] = value;\n } else {\n return this;\n }\n options = options || {};\n let readonly = [];\n if (typeof this.constructor.readOnlyAttributes === 'function') {\n readonly = (0, _concat.default)(readonly).call(readonly, this.constructor.readOnlyAttributes());\n }\n for (const k in changes) {\n if (k === 'createdAt' || k === 'updatedAt') {\n // This property is read-only, but for legacy reasons we silently\n // ignore it\n continue;\n }\n if ((0, _indexOf.default)(readonly).call(readonly, k) > -1) {\n throw new Error('Cannot modify readonly attribute: ' + k);\n }\n if (options.unset) {\n newOps[k] = new _ParseOp.UnsetOp();\n } else if (changes[k] instanceof _ParseOp.Op) {\n newOps[k] = changes[k];\n } else if (changes[k] && typeof changes[k] === 'object' && typeof changes[k].__op === 'string') {\n newOps[k] = (0, _ParseOp.opFromJSON)(changes[k]);\n } else if (k === 'objectId' || k === 'id') {\n if (typeof changes[k] === 'string') {\n this.id = changes[k];\n }\n } else if (k === 'ACL' && typeof changes[k] === 'object' && !(changes[k] instanceof _ParseACL.default)) {\n newOps[k] = new _ParseOp.SetOp(new _ParseACL.default(changes[k]));\n } else if (changes[k] instanceof _ParseRelation.default) {\n const relation = new _ParseRelation.default(this, k);\n relation.targetClassName = changes[k].targetClassName;\n newOps[k] = new _ParseOp.SetOp(relation);\n } else {\n newOps[k] = new _ParseOp.SetOp(changes[k]);\n }\n }\n const currentAttributes = this.attributes;\n\n // Calculate new values\n const newValues = {};\n for (const attr in newOps) {\n if (newOps[attr] instanceof _ParseOp.RelationOp) {\n newValues[attr] = newOps[attr].applyTo(currentAttributes[attr], this, attr);\n } else if (!(newOps[attr] instanceof _ParseOp.UnsetOp)) {\n newValues[attr] = newOps[attr].applyTo(currentAttributes[attr]);\n }\n }\n\n // Validate changes\n if (!options.ignoreValidation) {\n const validation = this.validate(newValues);\n if (validation) {\n if (typeof options.error === 'function') {\n options.error(this, validation);\n }\n return false;\n }\n }\n\n // Consolidate Ops\n const pendingOps = this._getPendingOps();\n const last = pendingOps.length - 1;\n const stateController = _CoreManager.default.getObjectStateController();\n for (const attr in newOps) {\n const nextOp = newOps[attr].mergeWith(pendingOps[last][attr]);\n stateController.setPendingOp(this._getStateIdentifier(), attr, nextOp);\n }\n return this;\n }\n\n /**\n * Remove an attribute from the model. This is a noop if the attribute doesn't\n * exist.\n *\n * @param {string} attr The string name of an attribute.\n * @param options\n * @returns {(ParseObject | boolean)}\n */\n unset(attr, options) {\n options = options || {};\n options.unset = true;\n return this.set(attr, null, options);\n }\n\n /**\n * Atomically increments the value of the given attribute the next time the\n * object is saved. If no amount is specified, 1 is used by default.\n *\n * @param attr {String} The key.\n * @param amount {Number} The amount to increment by (optional).\n * @returns {(ParseObject|boolean)}\n */\n increment(attr, amount) {\n if (typeof amount === 'undefined') {\n amount = 1;\n }\n if (typeof amount !== 'number') {\n throw new Error('Cannot increment by a non-numeric amount.');\n }\n return this.set(attr, new _ParseOp.IncrementOp(amount));\n }\n\n /**\n * Atomically decrements the value of the given attribute the next time the\n * object is saved. If no amount is specified, 1 is used by default.\n *\n * @param attr {String} The key.\n * @param amount {Number} The amount to decrement by (optional).\n * @returns {(ParseObject | boolean)}\n */\n decrement(attr, amount) {\n if (typeof amount === 'undefined') {\n amount = 1;\n }\n if (typeof amount !== 'number') {\n throw new Error('Cannot decrement by a non-numeric amount.');\n }\n return this.set(attr, new _ParseOp.IncrementOp(amount * -1));\n }\n\n /**\n * Atomically add an object to the end of the array associated with a given\n * key.\n *\n * @param attr {String} The key.\n * @param item {} The item to add.\n * @returns {(ParseObject | boolean)}\n */\n add(attr, item) {\n return this.set(attr, new _ParseOp.AddOp([item]));\n }\n\n /**\n * Atomically add the objects to the end of the array associated with a given\n * key.\n *\n * @param attr {String} The key.\n * @param items {Object[]} The items to add.\n * @returns {(ParseObject | boolean)}\n */\n addAll(attr, items) {\n return this.set(attr, new _ParseOp.AddOp(items));\n }\n\n /**\n * Atomically add an object to the array associated with a given key, only\n * if it is not already present in the array. The position of the insert is\n * not guaranteed.\n *\n * @param attr {String} The key.\n * @param item {} The object to add.\n * @returns {(ParseObject | boolean)}\n */\n addUnique(attr, item) {\n return this.set(attr, new _ParseOp.AddUniqueOp([item]));\n }\n\n /**\n * Atomically add the objects to the array associated with a given key, only\n * if it is not already present in the array. The position of the insert is\n * not guaranteed.\n *\n * @param attr {String} The key.\n * @param items {Object[]} The objects to add.\n * @returns {(ParseObject | boolean)}\n */\n addAllUnique(attr, items) {\n return this.set(attr, new _ParseOp.AddUniqueOp(items));\n }\n\n /**\n * Atomically remove all instances of an object from the array associated\n * with a given key.\n *\n * @param attr {String} The key.\n * @param item {} The object to remove.\n * @returns {(ParseObject | boolean)}\n */\n remove(attr, item) {\n return this.set(attr, new _ParseOp.RemoveOp([item]));\n }\n\n /**\n * Atomically remove all instances of the objects from the array associated\n * with a given key.\n *\n * @param attr {String} The key.\n * @param items {Object[]} The object to remove.\n * @returns {(ParseObject | boolean)}\n */\n removeAll(attr, items) {\n return this.set(attr, new _ParseOp.RemoveOp(items));\n }\n\n /**\n * Returns an instance of a subclass of Parse.Op describing what kind of\n * modification has been performed on this field since the last time it was\n * saved. For example, after calling object.increment(\"x\"), calling\n * object.op(\"x\") would return an instance of Parse.Op.Increment.\n *\n * @param attr {String} The key.\n * @returns {Parse.Op | undefined} The operation, or undefined if none.\n */\n op(attr) {\n const pending = this._getPendingOps();\n for (let i = pending.length; i--;) {\n if (pending[i][attr]) {\n return pending[i][attr];\n }\n }\n }\n\n /**\n * Creates a new model with identical attributes to this one.\n *\n * @returns {Parse.Object}\n */\n clone() {\n const clone = new this.constructor(this.className);\n let attributes = this.attributes;\n if (typeof this.constructor.readOnlyAttributes === 'function') {\n const readonly = this.constructor.readOnlyAttributes() || [];\n // Attributes are frozen, so we have to rebuild an object,\n // rather than delete readonly keys\n const copy = {};\n for (const a in attributes) {\n if ((0, _indexOf.default)(readonly).call(readonly, a) < 0) {\n copy[a] = attributes[a];\n }\n }\n attributes = copy;\n }\n if (clone.set) {\n clone.set(attributes);\n }\n return clone;\n }\n\n /**\n * Creates a new instance of this object. Not to be confused with clone()\n *\n * @returns {Parse.Object}\n */\n newInstance() {\n const clone = new this.constructor(this.className);\n clone.id = this.id;\n if (singleInstance) {\n // Just return an object with the right id\n return clone;\n }\n const stateController = _CoreManager.default.getObjectStateController();\n if (stateController) {\n stateController.duplicateState(this._getStateIdentifier(), clone._getStateIdentifier());\n }\n return clone;\n }\n\n /**\n * Returns true if this object has never been saved to Parse.\n *\n * @returns {boolean}\n */\n isNew() {\n return !this.id;\n }\n\n /**\n * Returns true if this object was created by the Parse server when the\n * object might have already been there (e.g. in the case of a Facebook\n * login)\n *\n * @returns {boolean}\n */\n existed() {\n if (!this.id) {\n return false;\n }\n const stateController = _CoreManager.default.getObjectStateController();\n const state = stateController.getState(this._getStateIdentifier());\n if (state) {\n return state.existed;\n }\n return false;\n }\n\n /**\n * Returns true if this object exists on the Server\n *\n * @param {object} options\n * Valid options are:<ul>\n * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to\n * be used for this request.\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * </ul>\n * @returns {Promise<boolean>} A boolean promise that is fulfilled if object exists.\n */\n exists(options) {\n var _this = this;\n return _asyncToGenerator(function* () {\n if (!_this.id) {\n return false;\n }\n try {\n const ParseQuery = _CoreManager.default.getParseQuery();\n const query = new ParseQuery(_this.className);\n yield query.get(_this.id, options);\n return true;\n } catch (e) {\n if (e.code === _ParseError.default.OBJECT_NOT_FOUND) {\n return false;\n }\n throw e;\n }\n })();\n }\n\n /**\n * Checks if the model is currently in a valid state.\n *\n * @returns {boolean}\n */\n isValid() {\n return !this.validate(this.attributes);\n }\n\n /**\n * You should not call this function directly unless you subclass\n * <code>Parse.Object</code>, in which case you can override this method\n * to provide additional validation on <code>set</code> and\n * <code>save</code>. Your implementation should return\n *\n * @param {object} attrs The current data to validate.\n * @returns {Parse.Error|boolean} False if the data is valid. An error object otherwise.\n * @see Parse.Object#set\n */\n validate(attrs) {\n if (attrs.hasOwnProperty('ACL') && !(attrs.ACL instanceof _ParseACL.default)) {\n return new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'ACL must be a Parse ACL.');\n }\n for (const key in attrs) {\n if (!/^[A-Za-z][0-9A-Za-z_.]*$/.test(key)) {\n return new _ParseError.default(_ParseError.default.INVALID_KEY_NAME);\n }\n }\n return false;\n }\n\n /**\n * Returns the ACL for this object.\n *\n * @returns {Parse.ACL|null} An instance of Parse.ACL.\n * @see Parse.Object#get\n */\n getACL() {\n const acl = this.get('ACL');\n if (acl instanceof _ParseACL.default) {\n return acl;\n }\n return null;\n }\n\n /**\n * Sets the ACL to be used for this object.\n *\n * @param {Parse.ACL} acl An instance of Parse.ACL.\n * @param {object} options\n * @returns {(ParseObject | boolean)} Whether the set passed validation.\n * @see Parse.Object#set\n */\n setACL(acl, options) {\n return this.set('ACL', acl, options);\n }\n\n /**\n * Clears any (or specific) changes to this object made since the last call to save()\n *\n * @param {string} [keys] - specify which fields to revert\n */\n revert() {\n let keysToRevert;\n for (var _len = arguments.length, keys = new Array(_len), _key = 0; _key < _len; _key++) {\n keys[_key] = arguments[_key];\n }\n if (keys.length) {\n keysToRevert = [];\n for (const key of keys) {\n if (typeof key === 'string') {\n keysToRevert.push(key);\n } else {\n throw new Error('Parse.Object#revert expects either no, or a list of string, arguments.');\n }\n }\n }\n this._clearPendingOps(keysToRevert);\n }\n\n /**\n * Clears all attributes on a model\n *\n * @returns {(ParseObject | boolean)}\n */\n clear() {\n const attributes = this.attributes;\n const erasable = {};\n let readonly = ['createdAt', 'updatedAt'];\n if (typeof this.constructor.readOnlyAttributes === 'function') {\n readonly = (0, _concat.default)(readonly).call(readonly, this.constructor.readOnlyAttributes());\n }\n for (const attr in attributes) {\n if ((0, _indexOf.default)(readonly).call(readonly, attr) < 0) {\n erasable[attr] = true;\n }\n }\n return this.set(erasable, {\n unset: true\n });\n }\n\n /**\n * Fetch the model from the server. If the server's representation of the\n * model differs from its current attributes, they will be overriden.\n *\n * @param {object} options\n * Valid options are:<ul>\n * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to\n * be used for this request.\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * <li>include: The name(s) of the key(s) to include. Can be a string, an array of strings,\n * or an array of array of strings.\n * <li>context: A dictionary that is accessible in Cloud Code `beforeFind` trigger.\n * </ul>\n * @returns {Promise} A promise that is fulfilled when the fetch\n * completes.\n */\n fetch(options) {\n options = options || {};\n const fetchOptions = {};\n if (options.hasOwnProperty('useMasterKey')) {\n fetchOptions.useMasterKey = options.useMasterKey;\n }\n if (options.hasOwnProperty('sessionToken')) {\n fetchOptions.sessionToken = options.sessionToken;\n }\n if (options.hasOwnProperty('context') && typeof options.context === 'object') {\n fetchOptions.context = options.context;\n }\n if (options.hasOwnProperty('include')) {\n fetchOptions.include = [];\n if ((0, _isArray.default)(options.include)) {\n var _context;\n (0, _forEach.default)(_context = options.include).call(_context, key => {\n if ((0, _isArray.default)(key)) {\n var _context2;\n fetchOptions.include = (0, _concat.default)(_context2 = fetchOptions.include).call(_context2, key);\n } else {\n fetchOptions.include.push(key);\n }\n });\n } else {\n fetchOptions.include.push(options.include);\n }\n }\n const controller = _CoreManager.default.getObjectController();\n return controller.fetch(this, true, fetchOptions);\n }\n\n /**\n * Fetch the model from the server. If the server's representation of the\n * model differs from its current attributes, they will be overriden.\n *\n * Includes nested Parse.Objects for the provided key. You can use dot\n * notation to specify which fields in the included object are also fetched.\n *\n * @param {string | Array<string | Array<string>>} keys The name(s) of the key(s) to include.\n * @param {object} options\n * Valid options are:<ul>\n * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to\n * be used for this request.\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * </ul>\n * @returns {Promise} A promise that is fulfilled when the fetch\n * completes.\n */\n fetchWithInclude(keys, options) {\n options = options || {};\n options.include = keys;\n return this.fetch(options);\n }\n\n /**\n * Saves this object to the server at some unspecified time in the future,\n * even if Parse is currently inaccessible.\n *\n * Use this when you may not have a solid network connection, and don't need to know when the save completes.\n * If there is some problem with the object such that it can't be saved, it will be silently discarded.\n *\n * Objects saved with this method will be stored locally in an on-disk cache until they can be delivered to Parse.\n * They will be sent immediately if possible. Otherwise, they will be sent the next time a network connection is\n * available. Objects saved this way will persist even after the app is closed, in which case they will be sent the\n * next time the app is opened.\n *\n * @param {object} [options]\n * Used to pass option parameters to method if arg1 and arg2 were both passed as strings.\n * Valid options are:\n * <ul>\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * <li>cascadeSave: If `false`, nested objects will not be saved (default is `true`).\n * <li>context: A dictionary that is accessible in Cloud Code `beforeSave` and `afterSave` triggers.\n * </ul>\n * @returns {Promise} A promise that is fulfilled when the save\n * completes.\n */\n saveEventually(options) {\n var _this2 = this;\n return _asyncToGenerator(function* () {\n try {\n yield _this2.save(null, options);\n } catch (e) {\n if (e.code === _ParseError.default.CONNECTION_FAILED) {\n yield _CoreManager.default.getEventuallyQueue().save(_this2, options);\n _CoreManager.default.getEventuallyQueue().poll();\n }\n }\n return _this2;\n })();\n }\n\n /**\n * Set a hash of model attributes, and save the model to the server.\n * updatedAt will be updated when the request returns.\n * You can either call it as:<pre>\n * object.save();</pre>\n * or<pre>\n * object.save(attrs);</pre>\n * or<pre>\n * object.save(null, options);</pre>\n * or<pre>\n * object.save(attrs, options);</pre>\n * or<pre>\n * object.save(key, value);</pre>\n * or<pre>\n * object.save(key, value, options);</pre>\n *\n * Example 1: <pre>\n * gameTurn.save({\n * player: \"Jake Cutter\",\n * diceRoll: 2\n * }).then(function(gameTurnAgain) {\n * // The save was successful.\n * }, function(error) {\n * // The save failed. Error is an instance of Parse.Error.\n * });</pre>\n *\n * Example 2: <pre>\n * gameTurn.save(\"player\", \"Jake Cutter\");</pre>\n *\n * @param {string | object | null} [arg1]\n * Valid options are:<ul>\n * <li>`Object` - Key/value pairs to update on the object.</li>\n * <li>`String` Key - Key of attribute to update (requires arg2 to also be string)</li>\n * <li>`null` - Passing null for arg1 allows you to save the object with options passed in arg2.</li>\n * </ul>\n * @param {string | object} [arg2]\n * <ul>\n * <li>`String` Value - If arg1 was passed as a key, arg2 is the value that should be set on that key.</li>\n * <li>`Object` Options - Valid options are:\n * <ul>\n * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to\n * be used for this request.\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * <li>cascadeSave: If `false`, nested objects will not be saved (default is `true`).\n * <li>context: A dictionary that is accessible in Cloud Code `beforeSave` and `afterSave` triggers.\n * </ul>\n * </li>\n * </ul>\n * @param {object} [arg3]\n * Used to pass option parameters to method if arg1 and arg2 were both passed as strings.\n * Valid options are:\n * <ul>\n * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to\n * be used for this request.\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * <li>cascadeSave: If `false`, nested objects will not be saved (default is `true`).\n * <li>context: A dictionary that is accessible in Cloud Code `beforeSave` and `afterSave` triggers.\n * </ul>\n * @returns {Promise} A promise that is fulfilled when the save\n * completes.\n */\n save(arg1, arg2, arg3) {\n let attrs;\n let options;\n if (typeof arg1 === 'object' || typeof arg1 === 'undefined') {\n attrs = arg1;\n if (typeof arg2 === 'object') {\n options = arg2;\n }\n } else {\n attrs = {};\n attrs[arg1] = arg2;\n options = arg3;\n }\n options = options || {};\n if (attrs) {\n let validationError;\n options.error = (_, validation) => {\n validationError = validation;\n };\n const success = this.set(attrs, options);\n if (!success) {\n return _promise.default.reject(validationError);\n }\n }\n const saveOptions = {};\n if (options.hasOwnProperty('useMasterKey')) {\n saveOptions.useMasterKey = !!options.useMasterKey;\n }\n if (options.hasOwnProperty('sessionToken') && typeof options.sessionToken === 'string') {\n saveOptions.sessionToken = options.sessionToken;\n }\n if (options.hasOwnProperty('installationId') && typeof options.installationId === 'string') {\n saveOptions.installationId = options.installationId;\n }\n if (options.hasOwnProperty('context') && typeof options.context === 'object') {\n saveOptions.context = options.context;\n }\n const controller = _CoreManager.default.getObjectController();\n const unsaved = options.cascadeSave !== false ? (0, _unsavedChildren.default)(this) : null;\n return controller.save(unsaved, saveOptions).then(() => {\n return controller.save(this, saveOptions);\n });\n }\n\n /**\n * Deletes this object from the server at some unspecified time in the future,\n * even if Parse is currently inaccessible.\n *\n * Use this when you may not have a solid network connection,\n * and don't need to know when the delete completes. If there is some problem with the object\n * such that it can't be deleted, the request will be silently discarded.\n *\n * Delete instructions made with this method will be stored locally in an on-disk cache until they can be transmitted\n * to Parse. They will be sent immediately if possible. Otherwise, they will be sent the next time a network connection\n * is available. Delete requests will persist even after the app is closed, in which case they will be sent the\n * next time the app is opened.\n *\n * @param {object} [options]\n * Valid options are:<ul>\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * <li>context: A dictionary that is accessible in Cloud Code `beforeDelete` and `afterDelete` triggers.\n * </ul>\n * @returns {Promise} A promise that is fulfilled when the destroy\n * completes.\n */\n destroyEventually(options) {\n var _this3 = this;\n return _asyncToGenerator(function* () {\n try {\n yield _this3.destroy(options);\n } catch (e) {\n if (e.code === _ParseError.default.CONNECTION_FAILED) {\n yield _CoreManager.default.getEventuallyQueue().destroy(_this3, options);\n _CoreManager.default.getEventuallyQueue().poll();\n }\n }\n return _this3;\n })();\n }\n\n /**\n * Destroy this model on the server if it was already persisted.\n *\n * @param {object} options\n * Valid options are:<ul>\n * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to\n * be used for this request.\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * <li>context: A dictionary that is accessible in Cloud Code `beforeDelete` and `afterDelete` triggers.\n * </ul>\n * @returns {Promise} A promise that is fulfilled when the destroy\n * completes.\n */\n destroy(options) {\n options = options || {};\n const destroyOptions = {};\n if (options.hasOwnProperty('useMasterKey')) {\n destroyOptions.useMasterKey = options.useMasterKey;\n }\n if (options.hasOwnProperty('sessionToken')) {\n destroyOptions.sessionToken = options.sessionToken;\n }\n if (options.hasOwnProperty('context') && typeof options.context === 'object') {\n destroyOptions.context = options.context;\n }\n if (!this.id) {\n return _promise.default.resolve();\n }\n return _CoreManager.default.getObjectController().destroy(this, destroyOptions);\n }\n\n /**\n * Asynchronously stores the object and every object it points to in the local datastore,\n * recursively, using a default pin name: _default.\n *\n * If those other objects have not been fetched from Parse, they will not be stored.\n * However, if they have changed data, all the changes will be retained.\n *\n * <pre>\n * await object.pin();\n * </pre>\n *\n * To retrieve object:\n * <code>query.fromLocalDatastore()</code> or <code>query.fromPin()</code>\n *\n * @returns {Promise} A promise that is fulfilled when the pin completes.\n */\n pin() {\n return ParseObject.pinAllWithName(_LocalDatastoreUtils.DEFAULT_PIN, [this]);\n }\n\n /**\n * Asynchronously removes the object and every object it points to in the local datastore,\n * recursively, using a default pin name: _default.\n *\n * <pre>\n * await object.unPin();\n * </pre>\n *\n * @returns {Promise} A promise that is fulfilled when the unPin completes.\n */\n unPin() {\n return ParseObject.unPinAllWithName(_LocalDatastoreUtils.DEFAULT_PIN, [this]);\n }\n\n /**\n * Asynchronously returns if the object is pinned\n *\n * <pre>\n * const isPinned = await object.isPinned();\n * </pre>\n *\n * @returns {Promise<boolean>} A boolean promise that is fulfilled if object is pinned.\n */\n isPinned() {\n var _this4 = this;\n return _asyncToGenerator(function* () {\n const localDatastore = _CoreManager.default.getLocalDatastore();\n if (!localDatastore.isEnabled) {\n return _promise.default.reject('Parse.enableLocalDatastore() must be called first');\n }\n const objectKey = localDatastore.getKeyForObject(_this4);\n const pin = yield localDatastore.fromPinWithName(objectKey);\n return pin.length > 0;\n })();\n }\n\n /**\n * Asynchronously stores the objects and every object they point to in the local datastore, recursively.\n *\n * If those other objects have not been fetched from Parse, they will not be stored.\n * However, if they have changed data, all the changes will be retained.\n *\n * <pre>\n * await object.pinWithName(name);\n * </pre>\n *\n * To retrieve object:\n * <code>query.fromLocalDatastore()</code> or <code>query.fromPinWithName(name)</code>\n *\n * @param {string} name Name of Pin.\n * @returns {Promise} A promise that is fulfilled when the pin completes.\n */\n pinWithName(name) {\n return ParseObject.pinAllWithName(name, [this]);\n }\n\n /**\n * Asynchronously removes the object and every object it points to in the local datastore, recursively.\n *\n * <pre>\n * await object.unPinWithName(name);\n * </pre>\n *\n * @param {string} name Name of Pin.\n * @returns {Promise} A promise that is fulfilled when the unPin completes.\n */\n unPinWithName(name) {\n return ParseObject.unPinAllWithName(name, [this]);\n }\n\n /**\n * Asynchronously loads data from the local datastore into this object.\n *\n * <pre>\n * await object.fetchFromLocalDatastore();\n * </pre>\n *\n * You can create an unfetched pointer with <code>Parse.Object.createWithoutData()</code>\n * and then call <code>fetchFromLocalDatastore()</code> on it.\n *\n * @returns {Promise} A promise that is fulfilled when the fetch completes.\n */\n fetchFromLocalDatastore() {\n var _this5 = this;\n return _asyncToGenerator(function* () {\n const localDatastore = _CoreManager.default.getLocalDatastore();\n if (!localDatastore.isEnabled) {\n throw new Error('Parse.enableLocalDatastore() must be called first');\n }\n const objectKey = localDatastore.getKeyForObject(_this5);\n const pinned = yield localDatastore._serializeObject(objectKey);\n if (!pinned) {\n throw new Error('Cannot fetch an unsaved ParseObject');\n }\n const result = ParseObject.fromJSON(pinned);\n _this5._finishFetch(result.toJSON());\n return _this5;\n })();\n }\n\n /* Static methods */\n\n static _clearAllState() {\n const stateController = _CoreManager.default.getObjectStateController();\n stateController.clearAllState();\n }\n\n /**\n * Fetches the given list of Parse.Object.\n * If any error is encountered, stops and calls the error handler.\n *\n * <pre>\n * Parse.Object.fetchAll([object1, object2, ...])\n * .then((list) => {\n * // All the objects were fetched.\n * }, (error) => {\n * // An error occurred while fetching one of the objects.\n * });\n * </pre>\n *\n * @param {Array} list A list of <code>Parse.Object</code>.\n * @param {object} options\n * Valid options are:<ul>\n * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to\n * be used for this request.\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * <li>include: The name(s) of the key(s) to include. Can be a string, an array of strings,\n * or an array of array of strings.\n * </ul>\n * @static\n * @returns {Parse.Object[]}\n */\n static fetchAll(list) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const queryOptions = {};\n if (options.hasOwnProperty('useMasterKey')) {\n queryOptions.useMasterKey = options.useMasterKey;\n }\n if (options.hasOwnProperty('sessionToken')) {\n queryOptions.sessionToken = options.sessionToken;\n }\n if (options.hasOwnProperty('include')) {\n queryOptions.include = ParseObject.handleIncludeOptions(options);\n }\n return _CoreManager.default.getObjectController().fetch(list, true, queryOptions);\n }\n\n /**\n * Fetches the given list of Parse.Object.\n *\n * Includes nested Parse.Objects for the provided key. You can use dot\n * notation to specify which fields in the included object are also fetched.\n *\n * If any error is encountered, stops and calls the error handler.\n *\n * <pre>\n * Parse.Object.fetchAllWithInclude([object1, object2, ...], [pointer1, pointer2, ...])\n * .then((list) => {\n * // All the objects were fetched.\n * }, (error) => {\n * // An error occurred while fetching one of the objects.\n * });\n * </pre>\n *\n * @param {Array} list A list of <code>Parse.Object</code>.\n * @param {string | Array<string | Array<string>>} keys The name(s) of the key(s) to include.\n * @param {object} options\n * Valid options are:<ul>\n * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to\n * be used for this request.\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * </ul>\n * @static\n * @returns {Parse.Object[]}\n */\n static fetchAllWithInclude(list, keys, options) {\n options = options || {};\n options.include = keys;\n return ParseObject.fetchAll(list, options);\n }\n\n /**\n * Fetches the given list of Parse.Object if needed.\n * If any error is encountered, stops and calls the error handler.\n *\n * Includes nested Parse.Objects for the provided key. You can use dot\n * notation to specify which fields in the included object are also fetched.\n *\n * If any error is encountered, stops and calls the error handler.\n *\n * <pre>\n * Parse.Object.fetchAllIfNeededWithInclude([object1, object2, ...], [pointer1, pointer2, ...])\n * .then((list) => {\n * // All the objects were fetched.\n * }, (error) => {\n * // An error occurred while fetching one of the objects.\n * });\n * </pre>\n *\n * @param {Array} list A list of <code>Parse.Object</code>.\n * @param {string | Array<string | Array<string>>} keys The name(s) of the key(s) to include.\n * @param {object} options\n * Valid options are:<ul>\n * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to\n * be used for this request.\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * </ul>\n * @static\n * @returns {Parse.Object[]}\n */\n static fetchAllIfNeededWithInclude(list, keys, options) {\n options = options || {};\n options.include = keys;\n return ParseObject.fetchAllIfNeeded(list, options);\n }\n\n /**\n * Fetches the given list of Parse.Object if needed.\n * If any error is encountered, stops and calls the error handler.\n *\n * <pre>\n * Parse.Object.fetchAllIfNeeded([object1, ...])\n * .then((list) => {\n * // Objects were fetched and updated.\n * }, (error) => {\n * // An error occurred while fetching one of the objects.\n * });\n * </pre>\n *\n * @param {Array} list A list of <code>Parse.Object</code>.\n * @param {object} options\n * @static\n * @returns {Parse.Object[]}\n */\n static fetchAllIfNeeded(list, options) {\n options = options || {};\n const queryOptions = {};\n if (options.hasOwnProperty('useMasterKey')) {\n queryOptions.useMasterKey = options.useMasterKey;\n }\n if (options.hasOwnProperty('sessionToken')) {\n queryOptions.sessionToken = options.sessionToken;\n }\n if (options.hasOwnProperty('include')) {\n queryOptions.include = ParseObject.handleIncludeOptions(options);\n }\n return _CoreManager.default.getObjectController().fetch(list, false, queryOptions);\n }\n static handleIncludeOptions(options) {\n let include = [];\n if ((0, _isArray.default)(options.include)) {\n var _context3;\n (0, _forEach.default)(_context3 = options.include).call(_context3, key => {\n if ((0, _isArray.default)(key)) {\n include = (0, _concat.default)(include).call(include, key);\n } else {\n include.push(key);\n }\n });\n } else {\n include.push(options.include);\n }\n return include;\n }\n\n /**\n * Destroy the given list of models on the server if it was already persisted.\n *\n * <p>Unlike saveAll, if an error occurs while deleting an individual model,\n * this method will continue trying to delete the rest of the models if\n * possible, except in the case of a fatal error like a connection error.\n *\n * <p>In particular, the Parse.Error object returned in the case of error may\n * be one of two types:\n *\n * <ul>\n * <li>A Parse.Error.AGGREGATE_ERROR. This object's \"errors\" property is an\n * array of other Parse.Error objects. Each error object in this array\n * has an \"object\" property that references the object that could not be\n * deleted (for instance, because that object could not be found).</li>\n * <li>A non-aggregate Parse.Error. This indicates a serious error that\n * caused the delete operation to be aborted partway through (for\n * instance, a connection failure in the middle of the delete).</li>\n * </ul>\n *\n * <pre>\n * Parse.Object.destroyAll([object1, object2, ...])\n * .then((list) => {\n * // All the objects were deleted.\n * }, (error) => {\n * // An error occurred while deleting one or more of the objects.\n * // If this is an aggregate error, then we can inspect each error\n * // object individually to determine the reason why a particular\n * // object was not deleted.\n * if (error.code === Parse.Error.AGGREGATE_ERROR) {\n * for (var i = 0; i < error.errors.length; i++) {\n * console.log(\"Couldn't delete \" + error.errors[i].object.id +\n * \"due to \" + error.errors[i].message);\n * }\n * } else {\n * console.log(\"Delete aborted because of \" + error.message);\n * }\n * });\n * </pre>\n *\n * @param {Array} list A list of <code>Parse.Object</code>.\n * @param {object} options\n * @static\n * @returns {Promise} A promise that is fulfilled when the destroyAll\n * completes.\n */\n static destroyAll(list) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const destroyOptions = {};\n if (options.hasOwnProperty('useMasterKey')) {\n destroyOptions.useMasterKey = options.useMasterKey;\n }\n if (options.hasOwnProperty('sessionToken')) {\n destroyOptions.sessionToken = options.sessionToken;\n }\n if (options.hasOwnProperty('batchSize') && typeof options.batchSize === 'number') {\n destroyOptions.batchSize = options.batchSize;\n }\n if (options.hasOwnProperty('context') && typeof options.context === 'object') {\n destroyOptions.context = options.context;\n }\n return _CoreManager.default.getObjectController().destroy(list, destroyOptions);\n }\n\n /**\n * Saves the given list of Parse.Object.\n * If any error is encountered, stops and calls the error handler.\n *\n * <pre>\n * Parse.Object.saveAll([object1, object2, ...])\n * .then((list) => {\n * // All the objects were saved.\n * }, (error) => {\n * // An error occurred while saving one of the objects.\n * });\n * </pre>\n *\n * @param {Array} list A list of <code>Parse.Object</code>.\n * @param {object} options\n * @static\n * @returns {Parse.Object[]}\n */\n static saveAll(list) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const saveOptions = {};\n if (options.hasOwnProperty('useMasterKey')) {\n saveOptions.useMasterKey = options.useMasterKey;\n }\n if (options.hasOwnProperty('sessionToken')) {\n saveOptions.sessionToken = options.sessionToken;\n }\n if (options.hasOwnProperty('batchSize') && typeof options.batchSize === 'number') {\n saveOptions.batchSize = options.batchSize;\n }\n if (options.hasOwnProperty('context') && typeof options.context === 'object') {\n saveOptions.context = options.context;\n }\n return _CoreManager.default.getObjectController().save(list, saveOptions);\n }\n\n /**\n * Creates a reference to a subclass of Parse.Object with the given id. This\n * does not exist on Parse.Object, only on subclasses.\n *\n * <p>A shortcut for: <pre>\n * var Foo = Parse.Object.extend(\"Foo\");\n * var pointerToFoo = new Foo();\n * pointerToFoo.id = \"myObjectId\";\n * </pre>\n *\n * @param {string} id The ID of the object to create a reference to.\n * @static\n * @returns {Parse.Object} A Parse.Object reference.\n */\n static createWithoutData(id) {\n const obj = new this();\n obj.id = id;\n return obj;\n }\n\n /**\n * Creates a new instance of a Parse Object from a JSON representation.\n *\n * @param {object} json The JSON map of the Object's data\n * @param {boolean} override In single instance mode, all old server data\n * is overwritten if this is set to true\n * @param {boolean} dirty Whether the Parse.Object should set JSON keys to dirty\n * @static\n * @returns {Parse.Object} A Parse.Object reference\n */\n static fromJSON(json, override, dirty) {\n if (!json.className) {\n throw new Error('Cannot create an object without a className');\n }\n const constructor = classMap[json.className];\n const o = constructor ? new constructor(json.className) : new ParseObject(json.className);\n const otherAttributes = {};\n for (const attr in json) {\n if (attr !== 'className' && attr !== '__type') {\n otherAttributes[attr] = json[attr];\n if (dirty) {\n o.set(attr, json[attr]);\n }\n }\n }\n if (override) {\n // id needs to be set before clearServerData can work\n if (otherAttributes.objectId) {\n o.id = otherAttributes.objectId;\n }\n let preserved = null;\n if (typeof o._preserveFieldsOnFetch === 'function') {\n preserved = o._preserveFieldsOnFetch();\n }\n o._clearServerData();\n if (preserved) {\n o._finishFetch(preserved);\n }\n }\n o._finishFetch(otherAttributes);\n if (json.objectId) {\n o._setExisted(true);\n }\n return o;\n }\n\n /**\n * Registers a subclass of Parse.Object with a specific class name.\n * When objects of that class are retrieved from a query, they will be\n * instantiated with this subclass.\n * This is only necessary when using ES6 subclassing.\n *\n * @param {string} className The class name of the subclass\n * @param {Function} constructor The subclass\n */\n static registerSubclass(className, constructor) {\n if (typeof className !== 'string') {\n throw new TypeError('The first argument must be a valid class name.');\n }\n if (typeof constructor === 'undefined') {\n throw new TypeError('You must supply a subclass constructor.');\n }\n if (typeof constructor !== 'function') {\n throw new TypeError('You must register the subclass constructor. ' + 'Did you attempt to register an instance of the subclass?');\n }\n classMap[className] = constructor;\n if (!constructor.className) {\n constructor.className = className;\n }\n }\n\n /**\n * Unegisters a subclass of Parse.Object with a specific class name.\n *\n * @param {string} className The class name of the subclass\n */\n static unregisterSubclass(className) {\n if (typeof className !== 'string') {\n throw new TypeError('The first argument must be a valid class name.');\n }\n delete classMap[className];\n }\n\n /**\n * Creates a new subclass of Parse.Object for the given Parse class name.\n *\n * <p>Every extension of a Parse class will inherit from the most recent\n * previous extension of that class. When a Parse.Object is automatically\n * created by parsing JSON, it will use the most recent extension of that\n * class.</p>\n *\n * <p>You should call either:<pre>\n * var MyClass = Parse.Object.extend(\"MyClass\", {\n * <i>Instance methods</i>,\n * initialize: function(attrs, options) {\n * this.someInstanceProperty = [],\n * <i>Other instance properties</i>\n * }\n * }, {\n * <i>Class properties</i>\n * });</pre>\n * or, for Backbone compatibility:<pre>\n * var MyClass = Parse.Object.extend({\n * className: \"MyClass\",\n * <i>Instance methods</i>,\n * initialize: function(attrs, options) {\n * this.someInstanceProperty = [],\n * <i>Other instance properties</i>\n * }\n * }, {\n * <i>Class properties</i>\n * });</pre></p>\n *\n * @param {string} className The name of the Parse class backing this model.\n * @param {object} [protoProps] Instance properties to add to instances of the\n * class returned from this method.\n * @param {object} [classProps] Class properties to add the class returned from\n * this method.\n * @returns {Parse.Object} A new subclass of Parse.Object.\n */\n static extend(className, protoProps, classProps) {\n if (typeof className !== 'string') {\n if (className && typeof className.className === 'string') {\n return ParseObject.extend(className.className, className, protoProps);\n } else {\n throw new Error(\"Parse.Object.extend's first argument should be the className.\");\n }\n }\n let adjustedClassName = className;\n if (adjustedClassName === 'User' && _CoreManager.default.get('PERFORM_USER_REWRITE')) {\n adjustedClassName = '_User';\n }\n let parentProto = ParseObject.prototype;\n if (this.hasOwnProperty('__super__') && this.__super__) {\n parentProto = this.prototype;\n }\n let ParseObjectSubclass = function (attributes, options) {\n this.className = adjustedClassName;\n this._objCount = objectCount++;\n // Enable legacy initializers\n if (typeof this.initialize === 'function') {\n this.initialize.apply(this, arguments);\n }\n if (this._initializers) {\n for (const initializer of this._initializers) {\n initializer.apply(this, arguments);\n }\n }\n if (attributes && typeof attributes === 'object') {\n if (!this.set(attributes || {}, options)) {\n throw new Error(\"Can't create an invalid Parse Object\");\n }\n }\n };\n if (classMap[adjustedClassName]) {\n ParseObjectSubclass = classMap[adjustedClassName];\n } else {\n ParseObjectSubclass.extend = function (name, protoProps, classProps) {\n if (typeof name === 'string') {\n return ParseObject.extend.call(ParseObjectSubclass, name, protoProps, classProps);\n }\n return ParseObject.extend.call(ParseObjectSubclass, adjustedClassName, name, protoProps);\n };\n ParseObjectSubclass.createWithoutData = ParseObject.createWithoutData;\n ParseObjectSubclass.className = adjustedClassName;\n ParseObjectSubclass.__super__ = parentProto;\n ParseObjectSubclass.prototype = (0, _create.default)(parentProto, {\n constructor: {\n value: ParseObjectSubclass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n }\n if (protoProps) {\n for (const prop in protoProps) {\n if (prop === 'initialize') {\n (0, _defineProperty3.default)(ParseObjectSubclass.prototype, '_initializers', {\n value: [...(ParseObjectSubclass.prototype._initializers || []), protoProps[prop]],\n enumerable: false,\n writable: true,\n configurable: true\n });\n continue;\n }\n if (prop !== 'className') {\n (0, _defineProperty3.default)(ParseObjectSubclass.prototype, prop, {\n value: protoProps[prop],\n enumerable: false,\n writable: true,\n configurable: true\n });\n }\n }\n }\n if (classProps) {\n for (const prop in classProps) {\n if (prop !== 'className') {\n (0, _defineProperty3.default)(ParseObjectSubclass, prop, {\n value: classProps[prop],\n enumerable: false,\n writable: true,\n configurable: true\n });\n }\n }\n }\n classMap[adjustedClassName] = ParseObjectSubclass;\n return ParseObjectSubclass;\n }\n\n /**\n * Enable single instance objects, where any local objects with the same Id\n * share the same attributes, and stay synchronized with each other.\n * This is disabled by default in server environments, since it can lead to\n * security issues.\n *\n * @static\n */\n static enableSingleInstance() {\n singleInstance = true;\n _CoreManager.default.setObjectStateController(SingleInstanceStateController);\n }\n\n /**\n * Disable single instance objects, where any local objects with the same Id\n * share the same attributes, and stay synchronized with each other.\n * When disabled, you can have two instances of the same object in memory\n * without them sharing attributes.\n *\n * @static\n */\n static disableSingleInstance() {\n singleInstance = false;\n _CoreManager.default.setObjectStateController(UniqueInstanceStateController);\n }\n\n /**\n * Asynchronously stores the objects and every object they point to in the local datastore,\n * recursively, using a default pin name: _default.\n *\n * If those other objects have not been fetched from Parse, they will not be stored.\n * However, if they have changed data, all the changes will be retained.\n *\n * <pre>\n * await Parse.Object.pinAll([...]);\n * </pre>\n *\n * To retrieve object:\n * <code>query.fromLocalDatastore()</code> or <code>query.fromPin()</code>\n *\n * @param {Array} objects A list of <code>Parse.Object</code>.\n * @returns {Promise} A promise that is fulfilled when the pin completes.\n * @static\n */\n static pinAll(objects) {\n const localDatastore = _CoreManager.default.getLocalDatastore();\n if (!localDatastore.isEnabled) {\n return _promise.default.reject('Parse.enableLocalDatastore() must be called first');\n }\n return ParseObject.pinAllWithName(_LocalDatastoreUtils.DEFAULT_PIN, objects);\n }\n\n /**\n * Asynchronously stores the objects and every object they point to in the local datastore, recursively.\n *\n * If those other objects have not been fetched from Parse, they will not be stored.\n * However, if they have changed data, all the changes will be retained.\n *\n * <pre>\n * await Parse.Object.pinAllWithName(name, [obj1, obj2, ...]);\n * </pre>\n *\n * To retrieve object:\n * <code>query.fromLocalDatastore()</code> or <code>query.fromPinWithName(name)</code>\n *\n * @param {string} name Name of Pin.\n * @param {Array} objects A list of <code>Parse.Object</code>.\n * @returns {Promise} A promise that is fulfilled when the pin completes.\n * @static\n */\n static pinAllWithName(name, objects) {\n const localDatastore = _CoreManager.default.getLocalDatastore();\n if (!localDatastore.isEnabled) {\n return _promise.default.reject('Parse.enableLocalDatastore() must be called first');\n }\n return localDatastore._handlePinAllWithName(name, objects);\n }\n\n /**\n * Asynchronously removes the objects and every object they point to in the local datastore,\n * recursively, using a default pin name: _default.\n *\n * <pre>\n * await Parse.Object.unPinAll([...]);\n * </pre>\n *\n * @param {Array} objects A list of <code>Parse.Object</code>.\n * @returns {Promise} A promise that is fulfilled when the unPin completes.\n * @static\n */\n static unPinAll(objects) {\n const localDatastore = _CoreManager.default.getLocalDatastore();\n if (!localDatastore.isEnabled) {\n return _promise.default.reject('Parse.enableLocalDatastore() must be called first');\n }\n return ParseObject.unPinAllWithName(_LocalDatastoreUtils.DEFAULT_PIN, objects);\n }\n\n /**\n * Asynchronously removes the objects and every object they point to in the local datastore, recursively.\n *\n * <pre>\n * await Parse.Object.unPinAllWithName(name, [obj1, obj2, ...]);\n * </pre>\n *\n * @param {string} name Name of Pin.\n * @param {Array} objects A list of <code>Parse.Object</code>.\n * @returns {Promise} A promise that is fulfilled when the unPin completes.\n * @static\n */\n static unPinAllWithName(name, objects) {\n const localDatastore = _CoreManager.default.getLocalDatastore();\n if (!localDatastore.isEnabled) {\n return _promise.default.reject('Parse.enableLocalDatastore() must be called first');\n }\n return localDatastore._handleUnPinAllWithName(name, objects);\n }\n\n /**\n * Asynchronously removes all objects in the local datastore using a default pin name: _default.\n *\n * <pre>\n * await Parse.Object.unPinAllObjects();\n * </pre>\n *\n * @returns {Promise} A promise that is fulfilled when the unPin completes.\n * @static\n */\n static unPinAllObjects() {\n const localDatastore = _CoreManager.default.getLocalDatastore();\n if (!localDatastore.isEnabled) {\n return _promise.default.reject('Parse.enableLocalDatastore() must be called first');\n }\n return localDatastore.unPinWithName(_LocalDatastoreUtils.DEFAULT_PIN);\n }\n\n /**\n * Asynchronously removes all objects with the specified pin name.\n * Deletes the pin name also.\n *\n * <pre>\n * await Parse.Object.unPinAllObjectsWithName(name);\n * </pre>\n *\n * @param {string} name Name of Pin.\n * @returns {Promise} A promise that is fulfilled when the unPin completes.\n * @static\n */\n static unPinAllObjectsWithName(name) {\n const localDatastore = _CoreManager.default.getLocalDatastore();\n if (!localDatastore.isEnabled) {\n return _promise.default.reject('Parse.enableLocalDatastore() must be called first');\n }\n return localDatastore.unPinWithName(_LocalDatastoreUtils.PIN_PREFIX + name);\n }\n}\nconst DefaultController = {\n fetch(target, forceFetch, options) {\n const localDatastore = _CoreManager.default.getLocalDatastore();\n if ((0, _isArray.default)(target)) {\n if (target.length < 1) {\n return _promise.default.resolve([]);\n }\n const objs = [];\n const ids = [];\n let className = null;\n const results = [];\n let error = null;\n (0, _forEach.default)(target).call(target, el => {\n if (error) {\n return;\n }\n if (!className) {\n className = el.className;\n }\n if (className !== el.className) {\n error = new _ParseError.default(_ParseError.default.INVALID_CLASS_NAME, 'All objects should be of the same class');\n }\n if (!el.id) {\n error = new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'All objects must have an ID');\n }\n if (forceFetch || !el.isDataAvailable()) {\n ids.push(el.id);\n objs.push(el);\n }\n results.push(el);\n });\n if (error) {\n return _promise.default.reject(error);\n }\n const ParseQuery = _CoreManager.default.getParseQuery();\n const query = new ParseQuery(className);\n query.containedIn('objectId', ids);\n if (options && options.include) {\n query.include(options.include);\n }\n query._limit = ids.length;\n return (0, _find.default)(query).call(query, options).then( /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (objects) {\n const idMap = {};\n (0, _forEach.default)(objects).call(objects, o => {\n idMap[o.id] = o;\n });\n for (let i = 0; i < objs.length; i++) {\n const obj = objs[i];\n if (!obj || !obj.id || !idMap[obj.id]) {\n if (forceFetch) {\n return _promise.default.reject(new _ParseError.default(_ParseError.default.OBJECT_NOT_FOUND, 'All objects must exist on the server.'));\n }\n }\n }\n if (!singleInstance) {\n // If single instance objects are disabled, we need to replace the\n for (let i = 0; i < results.length; i++) {\n const obj = results[i];\n if (obj && obj.id && idMap[obj.id]) {\n const id = obj.id;\n obj._finishFetch(idMap[id].toJSON());\n results[i] = idMap[id];\n }\n }\n }\n for (const object of results) {\n yield localDatastore._updateObjectIfPinned(object);\n }\n return _promise.default.resolve(results);\n });\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }());\n } else if (target instanceof ParseObject) {\n if (!target.id) {\n return _promise.default.reject(new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'Object does not have an ID'));\n }\n const RESTController = _CoreManager.default.getRESTController();\n const params = {};\n if (options && options.include) {\n params.include = options.include.join();\n }\n return RESTController.request('GET', 'classes/' + target.className + '/' + target._getId(), params, options).then( /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator(function* (response) {\n target._clearPendingOps();\n target._clearServerData();\n target._finishFetch(response);\n yield localDatastore._updateObjectIfPinned(target);\n return target;\n });\n return function (_x2) {\n return _ref2.apply(this, arguments);\n };\n }());\n }\n return _promise.default.resolve(undefined);\n },\n destroy(target, options) {\n return _asyncToGenerator(function* () {\n const batchSize = options && options.batchSize ? options.batchSize : _CoreManager.default.get('REQUEST_BATCH_SIZE');\n const localDatastore = _CoreManager.default.getLocalDatastore();\n const RESTController = _CoreManager.default.getRESTController();\n if ((0, _isArray.default)(target)) {\n if (target.length < 1) {\n return _promise.default.resolve([]);\n }\n const batches = [[]];\n (0, _forEach.default)(target).call(target, obj => {\n if (!obj.id) {\n return;\n }\n batches[batches.length - 1].push(obj);\n if (batches[batches.length - 1].length >= batchSize) {\n batches.push([]);\n }\n });\n if (batches[batches.length - 1].length === 0) {\n // If the last batch is empty, remove it\n batches.pop();\n }\n let deleteCompleted = _promise.default.resolve();\n const errors = [];\n (0, _forEach.default)(batches).call(batches, batch => {\n deleteCompleted = deleteCompleted.then(() => {\n return RESTController.request('POST', 'batch', {\n requests: (0, _map.default)(batch).call(batch, obj => {\n return {\n method: 'DELETE',\n path: getServerUrlPath() + 'classes/' + obj.className + '/' + obj._getId(),\n body: {}\n };\n })\n }, options).then(results => {\n for (let i = 0; i < results.length; i++) {\n if (results[i] && results[i].hasOwnProperty('error')) {\n const err = new _ParseError.default(results[i].error.code, results[i].error.error);\n err.object = batch[i];\n errors.push(err);\n }\n }\n });\n });\n });\n return deleteCompleted.then( /*#__PURE__*/_asyncToGenerator(function* () {\n if (errors.length) {\n const aggregate = new _ParseError.default(_ParseError.default.AGGREGATE_ERROR);\n aggregate.errors = errors;\n return _promise.default.reject(aggregate);\n }\n for (const object of target) {\n yield localDatastore._destroyObjectIfPinned(object);\n }\n return _promise.default.resolve(target);\n }));\n } else if (target instanceof ParseObject) {\n return RESTController.request('DELETE', 'classes/' + target.className + '/' + target._getId(), {}, options).then( /*#__PURE__*/_asyncToGenerator(function* () {\n yield localDatastore._destroyObjectIfPinned(target);\n return _promise.default.resolve(target);\n }));\n }\n return _promise.default.resolve(target);\n })();\n },\n save(target, options) {\n const batchSize = options && options.batchSize ? options.batchSize : _CoreManager.default.get('REQUEST_BATCH_SIZE');\n const localDatastore = _CoreManager.default.getLocalDatastore();\n const mapIdForPin = {};\n const RESTController = _CoreManager.default.getRESTController();\n const stateController = _CoreManager.default.getObjectStateController();\n const allowCustomObjectId = _CoreManager.default.get('ALLOW_CUSTOM_OBJECT_ID');\n options = options || {};\n options.returnStatus = options.returnStatus || true;\n if ((0, _isArray.default)(target)) {\n if (target.length < 1) {\n return _promise.default.resolve([]);\n }\n let unsaved = (0, _concat.default)(target).call(target);\n for (let i = 0; i < target.length; i++) {\n const target_i = target[i];\n if (target_i instanceof ParseObject) {\n unsaved = (0, _concat.default)(unsaved).call(unsaved, (0, _unsavedChildren.default)(target_i, true));\n }\n }\n unsaved = (0, _unique.default)(unsaved);\n const filesSaved = [];\n let pending = [];\n (0, _forEach.default)(unsaved).call(unsaved, el => {\n if (el instanceof _ParseFile.default) {\n filesSaved.push(el.save(options));\n } else if (el instanceof ParseObject) {\n pending.push(el);\n }\n });\n return _promise.default.all(filesSaved).then(() => {\n let objectError = null;\n return (0, _promiseUtils.continueWhile)(() => {\n return pending.length > 0;\n }, () => {\n const batch = [];\n const nextPending = [];\n (0, _forEach.default)(pending).call(pending, el => {\n if (allowCustomObjectId && Object.prototype.hasOwnProperty.call(el, 'id') && !el.id) {\n throw new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'objectId must not be empty or null');\n }\n if (batch.length < batchSize && (0, _canBeSerialized.default)(el)) {\n batch.push(el);\n } else {\n nextPending.push(el);\n }\n });\n pending = nextPending;\n if (batch.length < 1) {\n return _promise.default.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Tried to save a batch with a cycle.'));\n }\n\n // Queue up tasks for each object in the batch.\n // When every task is ready, the API request will execute\n const batchReturned = (0, _promiseUtils.resolvingPromise)();\n const batchReady = [];\n const batchTasks = [];\n (0, _forEach.default)(batch).call(batch, (obj, index) => {\n const ready = (0, _promiseUtils.resolvingPromise)();\n batchReady.push(ready);\n stateController.pushPendingState(obj._getStateIdentifier());\n batchTasks.push(stateController.enqueueTask(obj._getStateIdentifier(), function () {\n ready.resolve();\n return batchReturned.then(responses => {\n if (responses[index].hasOwnProperty('success')) {\n const objectId = responses[index].success.objectId;\n const status = responses[index]._status;\n delete responses[index]._status;\n delete responses[index]._headers;\n delete responses[index]._xhr;\n mapIdForPin[objectId] = obj._localId;\n obj._handleSaveResponse(responses[index].success, status);\n } else {\n if (!objectError && responses[index].hasOwnProperty('error')) {\n const serverError = responses[index].error;\n objectError = new _ParseError.default(serverError.code, serverError.error);\n // Cancel the rest of the save\n pending = [];\n }\n obj._handleSaveError();\n }\n });\n }));\n });\n (0, _promiseUtils.when)(batchReady).then(() => {\n // Kick off the batch request\n return RESTController.request('POST', 'batch', {\n requests: (0, _map.default)(batch).call(batch, obj => {\n const params = obj._getSaveParams();\n params.path = getServerUrlPath() + params.path;\n return params;\n })\n }, options);\n }).then(batchReturned.resolve, error => {\n batchReturned.reject(new _ParseError.default(_ParseError.default.INCORRECT_TYPE, error.message));\n });\n return (0, _promiseUtils.when)(batchTasks);\n }).then( /*#__PURE__*/_asyncToGenerator(function* () {\n if (objectError) {\n return _promise.default.reject(objectError);\n }\n for (const object of target) {\n // Make sure that it is a ParseObject before updating it into the localDataStore\n if (object instanceof ParseObject) {\n yield localDatastore._updateLocalIdForObject(mapIdForPin[object.id], object);\n yield localDatastore._updateObjectIfPinned(object);\n }\n }\n return _promise.default.resolve(target);\n }));\n });\n } else if (target instanceof ParseObject) {\n if (allowCustomObjectId && Object.prototype.hasOwnProperty.call(target, 'id') && !target.id) {\n throw new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'objectId must not be empty or null');\n }\n // generate _localId in case if cascadeSave=false\n target._getId();\n const localId = target._localId;\n // copying target lets guarantee the pointer isn't modified elsewhere\n const targetCopy = target;\n const task = function () {\n const params = targetCopy._getSaveParams();\n return RESTController.request(params.method, params.path, params.body, options).then(response => {\n const status = response._status;\n delete response._status;\n delete response._headers;\n delete response._xhr;\n targetCopy._handleSaveResponse(response, status);\n }, error => {\n targetCopy._handleSaveError();\n return _promise.default.reject(error);\n });\n };\n stateController.pushPendingState(target._getStateIdentifier());\n return stateController.enqueueTask(target._getStateIdentifier(), task).then( /*#__PURE__*/_asyncToGenerator(function* () {\n yield localDatastore._updateLocalIdForObject(localId, target);\n yield localDatastore._updateObjectIfPinned(target);\n return target;\n }), error => {\n return _promise.default.reject(error);\n });\n }\n return _promise.default.resolve(undefined);\n }\n};\n_CoreManager.default.setParseObject(ParseObject);\n_CoreManager.default.setObjectController(DefaultController);\nvar _default = exports.default = ParseObject;","map":{"version":3,"names":["_asyncToGenerator","require","default","_WeakMap","_Object$defineProperty2","_Object$getOwnPropertyDescriptor","_interopRequireDefault","exports","value","_defineProperty2","_indexOf","_freeze","_keys","_forEach","_stringify","_includes","_getPrototypeOf","_concat","_isArray","_promise","_create","_defineProperty3","_find","_map","_CoreManager","_canBeSerialized","_decode","_encode","_escape","_ParseACL","_parseDate","_ParseError","_ParseFile","_promiseUtils","_LocalDatastoreUtils","_uuid","_ParseOp","_ParseRelation","SingleInstanceStateController","_interopRequireWildcard","_unique","UniqueInstanceStateController","_unsavedChildren","_getRequireWildcardCache","e","r","t","__esModule","has","get","n","__proto__","u","hasOwnProperty","call","i","set","classMap","objectCount","singleInstance","setObjectStateController","getServerUrlPath","serverUrl","length","url","replace","substr","ParseObject","constructor","className","attributes","options","initialize","apply","arguments","toSet","_objCount","attr","Error","stateController","getObjectStateController","estimateAttributes","_getStateIdentifier","createdAt","_getServerData","updatedAt","_getId","id","_localId","localId","getServerData","_clearServerData","serverData","unset","undefined","setServerData","_getPendingOps","getPendingOps","_clearPendingOps","keysToClear","pending","latest","keys","key","_getDirtyObjectAttributes","objectCache","getObjectCache","dirty","val","json","stringified","_toFullJSON","seen","offline","toJSON","__type","_getSaveJSON","dirtyObjects","isDotNotation","field","fieldName","split","SetOp","_getSaveParams","method","body","path","objectId","_finishFetch","initializeState","decoded","_ensureParentAndKey","commitServerChanges","_setExisted","existed","state","getState","_migrateId","serverId","oldState","removeState","_handleSaveResponse","response","status","changes","popPendingState","RelationOp","applyTo","Object","prototype","UnsetOp","_handleSaveError","mergeFirstPendingState","_getClassMap","seenEntry","attrs","equals","other","pendingOps","dirtyKeys","isDataAvailable","toPointer","toOfflinePointer","relation","escape","toString","newOps","readonly","readOnlyAttributes","k","Op","__op","opFromJSON","targetClassName","currentAttributes","newValues","ignoreValidation","validation","validate","error","last","nextOp","mergeWith","setPendingOp","increment","amount","IncrementOp","decrement","add","item","AddOp","addAll","items","addUnique","AddUniqueOp","addAllUnique","remove","RemoveOp","removeAll","op","clone","copy","a","newInstance","duplicateState","isNew","exists","_this","ParseQuery","getParseQuery","query","code","OBJECT_NOT_FOUND","isValid","ACL","OTHER_CAUSE","test","INVALID_KEY_NAME","getACL","acl","setACL","revert","keysToRevert","_len","Array","_key","push","clear","erasable","fetch","fetchOptions","useMasterKey","sessionToken","context","include","_context","_context2","controller","getObjectController","fetchWithInclude","saveEventually","_this2","save","CONNECTION_FAILED","getEventuallyQueue","poll","arg1","arg2","arg3","validationError","_","success","reject","saveOptions","installationId","unsaved","cascadeSave","then","destroyEventually","_this3","destroy","destroyOptions","resolve","pin","pinAllWithName","DEFAULT_PIN","unPin","unPinAllWithName","isPinned","_this4","localDatastore","getLocalDatastore","isEnabled","objectKey","getKeyForObject","fromPinWithName","pinWithName","name","unPinWithName","fetchFromLocalDatastore","_this5","pinned","_serializeObject","result","fromJSON","_clearAllState","clearAllState","fetchAll","list","queryOptions","handleIncludeOptions","fetchAllWithInclude","fetchAllIfNeededWithInclude","fetchAllIfNeeded","_context3","destroyAll","batchSize","saveAll","createWithoutData","obj","override","o","otherAttributes","preserved","_preserveFieldsOnFetch","registerSubclass","TypeError","unregisterSubclass","extend","protoProps","classProps","adjustedClassName","parentProto","__super__","ParseObjectSubclass","_initializers","initializer","enumerable","writable","configurable","prop","enableSingleInstance","disableSingleInstance","pinAll","objects","_handlePinAllWithName","unPinAll","_handleUnPinAllWithName","unPinAllObjects","unPinAllObjectsWithName","PIN_PREFIX","DefaultController","target","forceFetch","objs","ids","results","el","INVALID_CLASS_NAME","MISSING_OBJECT_ID","containedIn","_limit","_ref","idMap","object","_updateObjectIfPinned","_x","RESTController","getRESTController","params","join","request","_ref2","_x2","batches","pop","deleteCompleted","errors","batch","requests","err","aggregate","AGGREGATE_ERROR","_destroyObjectIfPinned","mapIdForPin","allowCustomObjectId","returnStatus","target_i","filesSaved","all","objectError","continueWhile","nextPending","batchReturned","resolvingPromise","batchReady","batchTasks","index","ready","pushPendingState","enqueueTask","responses","_status","_headers","_xhr","serverError","when","INCORRECT_TYPE","message","_updateLocalIdForObject","targetCopy","task","setParseObject","setObjectController","_default"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/parse/lib/browser/ParseObject.js"],"sourcesContent":["\"use strict\";\n\nvar _WeakMap = require(\"@babel/runtime-corejs3/core-js-stable/weak-map\");\nvar _Object$defineProperty2 = require(\"@babel/runtime-corejs3/core-js-stable/object/define-property\");\nvar _Object$getOwnPropertyDescriptor = require(\"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs3/helpers/interopRequireDefault\");\n_Object$defineProperty2(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs3/helpers/defineProperty\"));\nvar _indexOf = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/instance/index-of\"));\nvar _freeze = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/object/freeze\"));\nvar _keys = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/object/keys\"));\nvar _forEach = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/instance/for-each\"));\nvar _stringify = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/json/stringify\"));\nvar _includes = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/instance/includes\"));\nvar _getPrototypeOf = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/object/get-prototype-of\"));\nvar _concat = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/instance/concat\"));\nvar _isArray = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/array/is-array\"));\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/promise\"));\nvar _create = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/object/create\"));\nvar _defineProperty3 = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/object/define-property\"));\nvar _find = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/instance/find\"));\nvar _map = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/instance/map\"));\nvar _CoreManager = _interopRequireDefault(require(\"./CoreManager\"));\nvar _canBeSerialized = _interopRequireDefault(require(\"./canBeSerialized\"));\nvar _decode = _interopRequireDefault(require(\"./decode\"));\nvar _encode = _interopRequireDefault(require(\"./encode\"));\nvar _escape = _interopRequireDefault(require(\"./escape\"));\nvar _ParseACL = _interopRequireDefault(require(\"./ParseACL\"));\nvar _parseDate = _interopRequireDefault(require(\"./parseDate\"));\nvar _ParseError = _interopRequireDefault(require(\"./ParseError\"));\nvar _ParseFile = _interopRequireDefault(require(\"./ParseFile\"));\nvar _promiseUtils = require(\"./promiseUtils\");\nvar _LocalDatastoreUtils = require(\"./LocalDatastoreUtils\");\nvar _uuid = _interopRequireDefault(require(\"./uuid\"));\nvar _ParseOp = require(\"./ParseOp\");\nvar _ParseRelation = _interopRequireDefault(require(\"./ParseRelation\"));\nvar SingleInstanceStateController = _interopRequireWildcard(require(\"./SingleInstanceStateController\"));\nvar _unique = _interopRequireDefault(require(\"./unique\"));\nvar UniqueInstanceStateController = _interopRequireWildcard(require(\"./UniqueInstanceStateController\"));\nvar _unsavedChildren = _interopRequireDefault(require(\"./unsavedChildren\"));\nfunction _getRequireWildcardCache(e) {\n if (\"function\" != typeof _WeakMap) return null;\n var r = new _WeakMap(),\n t = new _WeakMap();\n return (_getRequireWildcardCache = function (e) {\n return e ? t : r;\n })(e);\n}\nfunction _interopRequireWildcard(e, r) {\n if (!r && e && e.__esModule) return e;\n if (null === e || \"object\" != typeof e && \"function\" != typeof e) return {\n default: e\n };\n var t = _getRequireWildcardCache(r);\n if (t && t.has(e)) return t.get(e);\n var n = {\n __proto__: null\n };\n for (var u in e) if (\"default\" !== u && {}.hasOwnProperty.call(e, u)) {\n var i = _Object$defineProperty2 && _Object$getOwnPropertyDescriptor ? _Object$getOwnPropertyDescriptor(e, u) : null;\n i && (i.get || i.set) ? _Object$defineProperty2(n, u, i) : n[u] = e[u];\n }\n return n.default = e, t && t.set(e, n), n;\n}\n// Mapping of class names to constructors, so we can populate objects from the\n// server with appropriate subclasses of ParseObject\nconst classMap = {};\n\n// Global counter for generating unique Ids for non-single-instance objects\nlet objectCount = 0;\n// On web clients, objects are single-instance: any two objects with the same Id\n// will have the same attributes. However, this may be dangerous default\n// behavior in a server scenario\nlet singleInstance = !_CoreManager.default.get('IS_NODE');\nif (singleInstance) {\n _CoreManager.default.setObjectStateController(SingleInstanceStateController);\n} else {\n _CoreManager.default.setObjectStateController(UniqueInstanceStateController);\n}\nfunction getServerUrlPath() {\n let serverUrl = _CoreManager.default.get('SERVER_URL');\n if (serverUrl[serverUrl.length - 1] !== '/') {\n serverUrl += '/';\n }\n const url = serverUrl.replace(/https?:\\/\\//, '');\n return url.substr((0, _indexOf.default)(url).call(url, '/'));\n}\n\n/**\n * Creates a new model with defined attributes.\n *\n * <p>You won't normally call this method directly. It is recommended that\n * you use a subclass of <code>Parse.Object</code> instead, created by calling\n * <code>extend</code>.</p>\n *\n * <p>However, if you don't want to use a subclass, or aren't sure which\n * subclass is appropriate, you can use this form:<pre>\n * var object = new Parse.Object(\"ClassName\");\n * </pre>\n * That is basically equivalent to:<pre>\n * var MyClass = Parse.Object.extend(\"ClassName\");\n * var object = new MyClass();\n * </pre></p>\n *\n * @alias Parse.Object\n */\nclass ParseObject {\n /**\n * @param {string} className The class name for the object\n * @param {object} attributes The initial set of data to store in the object.\n * @param {object} options The options for this object instance.\n * @param {boolean} [options.ignoreValidation] Set to `true` ignore any attribute validation errors.\n */\n constructor(className, attributes, options) {\n /**\n * The ID of this object, unique within its class.\n *\n * @property {string} id\n */\n (0, _defineProperty2.default)(this, \"id\", void 0);\n (0, _defineProperty2.default)(this, \"_localId\", void 0);\n (0, _defineProperty2.default)(this, \"_objCount\", void 0);\n (0, _defineProperty2.default)(this, \"className\", void 0);\n // Enable legacy initializers\n if (typeof this.initialize === 'function') {\n this.initialize.apply(this, arguments);\n }\n let toSet = null;\n this._objCount = objectCount++;\n if (typeof className === 'string') {\n this.className = className;\n if (attributes && typeof attributes === 'object') {\n toSet = attributes;\n }\n } else if (className && typeof className === 'object') {\n this.className = className.className;\n toSet = {};\n for (const attr in className) {\n if (attr !== 'className') {\n toSet[attr] = className[attr];\n }\n }\n if (attributes && typeof attributes === 'object') {\n options = attributes;\n }\n }\n if (toSet && !this.set(toSet, options)) {\n throw new Error(\"Can't create an invalid Parse Object\");\n }\n }\n /* Prototype getters / setters */\n\n get attributes() {\n const stateController = _CoreManager.default.getObjectStateController();\n return (0, _freeze.default)(stateController.estimateAttributes(this._getStateIdentifier()));\n }\n\n /**\n * The first time this object was saved on the server.\n *\n * @property {Date} createdAt\n * @returns {Date}\n */\n get createdAt() {\n return this._getServerData().createdAt;\n }\n\n /**\n * The last time this object was updated on the server.\n *\n * @property {Date} updatedAt\n * @returns {Date}\n */\n get updatedAt() {\n return this._getServerData().updatedAt;\n }\n\n /* Private methods */\n\n /**\n * Returns a local or server Id used uniquely identify this object\n *\n * @returns {string}\n */\n _getId() {\n if (typeof this.id === 'string') {\n return this.id;\n }\n if (typeof this._localId === 'string') {\n return this._localId;\n }\n const localId = 'local' + (0, _uuid.default)();\n this._localId = localId;\n return localId;\n }\n\n /**\n * Returns a unique identifier used to pull data from the State Controller.\n *\n * @returns {Parse.Object|object}\n */\n _getStateIdentifier() {\n if (singleInstance) {\n let id = this.id;\n if (!id) {\n id = this._getId();\n }\n return {\n id: id,\n className: this.className\n };\n } else {\n return this;\n }\n }\n _getServerData() {\n const stateController = _CoreManager.default.getObjectStateController();\n return stateController.getServerData(this._getStateIdentifier());\n }\n _clearServerData() {\n const serverData = this._getServerData();\n const unset = {};\n for (const attr in serverData) {\n unset[attr] = undefined;\n }\n const stateController = _CoreManager.default.getObjectStateController();\n stateController.setServerData(this._getStateIdentifier(), unset);\n }\n _getPendingOps() {\n const stateController = _CoreManager.default.getObjectStateController();\n return stateController.getPendingOps(this._getStateIdentifier());\n }\n\n /**\n * @param {Array<string>} [keysToClear] - if specified, only ops matching\n * these fields will be cleared\n */\n _clearPendingOps(keysToClear) {\n const pending = this._getPendingOps();\n const latest = pending[pending.length - 1];\n const keys = keysToClear || (0, _keys.default)(latest);\n (0, _forEach.default)(keys).call(keys, key => {\n delete latest[key];\n });\n }\n _getDirtyObjectAttributes() {\n const attributes = this.attributes;\n const stateController = _CoreManager.default.getObjectStateController();\n const objectCache = stateController.getObjectCache(this._getStateIdentifier());\n const dirty = {};\n for (const attr in attributes) {\n const val = attributes[attr];\n if (val && typeof val === 'object' && !(val instanceof ParseObject) && !(val instanceof _ParseFile.default) && !(val instanceof _ParseRelation.default)) {\n // Due to the way browsers construct maps, the key order will not change\n // unless the object is changed\n try {\n const json = (0, _encode.default)(val, false, true);\n const stringified = (0, _stringify.default)(json);\n if (objectCache[attr] !== stringified) {\n dirty[attr] = val;\n }\n } catch (e) {\n // Error occurred, possibly by a nested unsaved pointer in a mutable container\n // No matter how it happened, it indicates a change in the attribute\n dirty[attr] = val;\n }\n }\n }\n return dirty;\n }\n _toFullJSON(seen, offline) {\n const json = this.toJSON(seen, offline);\n json.__type = 'Object';\n json.className = this.className;\n return json;\n }\n _getSaveJSON() {\n const pending = this._getPendingOps();\n const dirtyObjects = this._getDirtyObjectAttributes();\n const json = {};\n for (var attr in dirtyObjects) {\n let isDotNotation = false;\n for (let i = 0; i < pending.length; i += 1) {\n for (const field in pending[i]) {\n // Dot notation operations are handled later\n if ((0, _includes.default)(field).call(field, '.')) {\n const fieldName = field.split('.')[0];\n if (fieldName === attr) {\n isDotNotation = true;\n break;\n }\n }\n }\n }\n if (!isDotNotation) {\n json[attr] = new _ParseOp.SetOp(dirtyObjects[attr]).toJSON();\n }\n }\n for (attr in pending[0]) {\n json[attr] = pending[0][attr].toJSON();\n }\n return json;\n }\n _getSaveParams() {\n let method = this.id ? 'PUT' : 'POST';\n const body = this._getSaveJSON();\n let path = 'classes/' + this.className;\n if (_CoreManager.default.get('ALLOW_CUSTOM_OBJECT_ID')) {\n if (!this.createdAt) {\n method = 'POST';\n body.objectId = this.id;\n } else {\n method = 'PUT';\n path += '/' + this.id;\n }\n } else if (this.id) {\n path += '/' + this.id;\n } else if (this.className === '_User') {\n path = 'users';\n }\n return {\n method,\n body,\n path\n };\n }\n _finishFetch(serverData) {\n if (!this.id && serverData.objectId) {\n this.id = serverData.objectId;\n }\n const stateController = _CoreManager.default.getObjectStateController();\n stateController.initializeState(this._getStateIdentifier());\n const decoded = {};\n for (const attr in serverData) {\n if (attr === 'ACL') {\n decoded[attr] = new _ParseACL.default(serverData[attr]);\n } else if (attr !== 'objectId') {\n decoded[attr] = (0, _decode.default)(serverData[attr]);\n if (decoded[attr] instanceof _ParseRelation.default) {\n decoded[attr]._ensureParentAndKey(this, attr);\n }\n }\n }\n if (decoded.createdAt && typeof decoded.createdAt === 'string') {\n decoded.createdAt = (0, _parseDate.default)(decoded.createdAt);\n }\n if (decoded.updatedAt && typeof decoded.updatedAt === 'string') {\n decoded.updatedAt = (0, _parseDate.default)(decoded.updatedAt);\n }\n if (!decoded.updatedAt && decoded.createdAt) {\n decoded.updatedAt = decoded.createdAt;\n }\n stateController.commitServerChanges(this._getStateIdentifier(), decoded);\n }\n _setExisted(existed) {\n const stateController = _CoreManager.default.getObjectStateController();\n const state = stateController.getState(this._getStateIdentifier());\n if (state) {\n state.existed = existed;\n }\n }\n _migrateId(serverId) {\n if (this._localId && serverId) {\n if (singleInstance) {\n const stateController = _CoreManager.default.getObjectStateController();\n const oldState = stateController.removeState(this._getStateIdentifier());\n this.id = serverId;\n delete this._localId;\n if (oldState) {\n stateController.initializeState(this._getStateIdentifier(), oldState);\n }\n } else {\n this.id = serverId;\n delete this._localId;\n }\n }\n }\n _handleSaveResponse(response, status) {\n const changes = {};\n const stateController = _CoreManager.default.getObjectStateController();\n const pending = stateController.popPendingState(this._getStateIdentifier());\n for (var attr in pending) {\n if (pending[attr] instanceof _ParseOp.RelationOp) {\n changes[attr] = pending[attr].applyTo(undefined, this, attr);\n } else if (!(attr in response)) {\n // Only SetOps and UnsetOps should not come back with results\n changes[attr] = pending[attr].applyTo(undefined);\n }\n }\n for (attr in response) {\n if ((attr === 'createdAt' || attr === 'updatedAt') && typeof response[attr] === 'string') {\n changes[attr] = (0, _parseDate.default)(response[attr]);\n } else if (attr === 'ACL') {\n changes[attr] = new _ParseACL.default(response[attr]);\n } else if (attr !== 'objectId') {\n const val = (0, _decode.default)(response[attr]);\n if (val && (0, _getPrototypeOf.default)(val) === Object.prototype) {\n changes[attr] = {\n ...this.attributes[attr],\n ...val\n };\n } else {\n changes[attr] = val;\n }\n if (changes[attr] instanceof _ParseOp.UnsetOp) {\n changes[attr] = undefined;\n }\n }\n }\n if (changes.createdAt && !changes.updatedAt) {\n changes.updatedAt = changes.createdAt;\n }\n this._migrateId(response.objectId);\n if (status !== 201) {\n this._setExisted(true);\n }\n stateController.commitServerChanges(this._getStateIdentifier(), changes);\n }\n _handleSaveError() {\n const stateController = _CoreManager.default.getObjectStateController();\n stateController.mergeFirstPendingState(this._getStateIdentifier());\n }\n static _getClassMap() {\n return classMap;\n }\n\n /* Public methods */\n\n initialize() {\n // NOOP\n }\n\n /**\n * Returns a JSON version of the object suitable for saving to Parse.\n *\n * @param seen\n * @param offline\n * @returns {object}\n */\n toJSON(seen, offline) {\n const seenEntry = this.id ? this.className + ':' + this.id : this;\n seen = seen || [seenEntry];\n const json = {};\n const attrs = this.attributes;\n for (const attr in attrs) {\n if ((attr === 'createdAt' || attr === 'updatedAt') && attrs[attr].toJSON) {\n json[attr] = attrs[attr].toJSON();\n } else {\n json[attr] = (0, _encode.default)(attrs[attr], false, false, seen, offline);\n }\n }\n const pending = this._getPendingOps();\n for (const attr in pending[0]) {\n if ((0, _indexOf.default)(attr).call(attr, '.') < 0) {\n json[attr] = pending[0][attr].toJSON(offline);\n }\n }\n if (this.id) {\n json.objectId = this.id;\n }\n return json;\n }\n\n /**\n * Determines whether this ParseObject is equal to another ParseObject\n *\n * @param {object} other - An other object ot compare\n * @returns {boolean}\n */\n equals(other) {\n if (this === other) {\n return true;\n }\n return other instanceof ParseObject && this.className === other.className && this.id === other.id && typeof this.id !== 'undefined';\n }\n\n /**\n * Returns true if this object has been modified since its last\n * save/refresh. If an attribute is specified, it returns true only if that\n * particular attribute has been modified since the last save/refresh.\n *\n * @param {string} attr An attribute name (optional).\n * @returns {boolean}\n */\n dirty(attr) {\n if (!this.id) {\n return true;\n }\n const pendingOps = this._getPendingOps();\n const dirtyObjects = this._getDirtyObjectAttributes();\n if (attr) {\n if (dirtyObjects.hasOwnProperty(attr)) {\n return true;\n }\n for (let i = 0; i < pendingOps.length; i++) {\n if (pendingOps[i].hasOwnProperty(attr)) {\n return true;\n }\n }\n return false;\n }\n if ((0, _keys.default)(pendingOps[0]).length !== 0) {\n return true;\n }\n if ((0, _keys.default)(dirtyObjects).length !== 0) {\n return true;\n }\n return false;\n }\n\n /**\n * Returns an array of keys that have been modified since last save/refresh\n *\n * @returns {string[]}\n */\n dirtyKeys() {\n const pendingOps = this._getPendingOps();\n const keys = {};\n for (let i = 0; i < pendingOps.length; i++) {\n for (const attr in pendingOps[i]) {\n keys[attr] = true;\n }\n }\n const dirtyObjects = this._getDirtyObjectAttributes();\n for (const attr in dirtyObjects) {\n keys[attr] = true;\n }\n return (0, _keys.default)(keys);\n }\n\n /**\n * Returns true if the object has been fetched.\n *\n * @returns {boolean}\n */\n isDataAvailable() {\n const serverData = this._getServerData();\n return !!(0, _keys.default)(serverData).length;\n }\n\n /**\n * Gets a Pointer referencing this Object.\n *\n * @returns {Pointer}\n */\n toPointer() {\n if (!this.id) {\n throw new Error('Cannot create a pointer to an unsaved ParseObject');\n }\n return {\n __type: 'Pointer',\n className: this.className,\n objectId: this.id\n };\n }\n\n /**\n * Gets a Pointer referencing this Object.\n *\n * @returns {Pointer}\n */\n toOfflinePointer() {\n if (!this._localId) {\n throw new Error('Cannot create a offline pointer to a saved ParseObject');\n }\n return {\n __type: 'Object',\n className: this.className,\n _localId: this._localId\n };\n }\n\n /**\n * Gets the value of an attribute.\n *\n * @param {string} attr The string name of an attribute.\n * @returns {*}\n */\n get(attr) {\n return this.attributes[attr];\n }\n\n /**\n * Gets a relation on the given class for the attribute.\n *\n * @param {string} attr The attribute to get the relation for.\n * @returns {Parse.Relation}\n */\n relation(attr) {\n const value = this.get(attr);\n if (value) {\n if (!(value instanceof _ParseRelation.default)) {\n throw new Error('Called relation() on non-relation field ' + attr);\n }\n value._ensureParentAndKey(this, attr);\n return value;\n }\n return new _ParseRelation.default(this, attr);\n }\n\n /**\n * Gets the HTML-escaped value of an attribute.\n *\n * @param {string} attr The string name of an attribute.\n * @returns {string}\n */\n escape(attr) {\n let val = this.attributes[attr];\n if (val == null) {\n return '';\n }\n if (typeof val !== 'string') {\n if (typeof val.toString !== 'function') {\n return '';\n }\n val = val.toString();\n }\n return (0, _escape.default)(val);\n }\n\n /**\n * Returns <code>true</code> if the attribute contains a value that is not\n * null or undefined.\n *\n * @param {string} attr The string name of the attribute.\n * @returns {boolean}\n */\n has(attr) {\n const attributes = this.attributes;\n if (attributes.hasOwnProperty(attr)) {\n return attributes[attr] != null;\n }\n return false;\n }\n\n /**\n * Sets a hash of model attributes on the object.\n *\n * <p>You can call it with an object containing keys and values, with one\n * key and value, or dot notation. For example:<pre>\n * gameTurn.set({\n * player: player1,\n * diceRoll: 2\n * }, {\n * error: function(gameTurnAgain, error) {\n * // The set failed validation.\n * }\n * });\n *\n * game.set(\"currentPlayer\", player2, {\n * error: function(gameTurnAgain, error) {\n * // The set failed validation.\n * }\n * });\n *\n * game.set(\"finished\", true);</pre></p>\n *\n * game.set(\"player.score\", 10);</pre></p>\n *\n * @param {(string|object)} key The key to set.\n * @param {(string|object)} value The value to give it.\n * @param {object} options A set of options for the set.\n * The only supported option is <code>error</code>.\n * @returns {(ParseObject|boolean)} true if the set succeeded.\n */\n set(key, value, options) {\n let changes = {};\n const newOps = {};\n if (key && typeof key === 'object') {\n changes = key;\n options = value;\n } else if (typeof key === 'string') {\n changes[key] = value;\n } else {\n return this;\n }\n options = options || {};\n let readonly = [];\n if (typeof this.constructor.readOnlyAttributes === 'function') {\n readonly = (0, _concat.default)(readonly).call(readonly, this.constructor.readOnlyAttributes());\n }\n for (const k in changes) {\n if (k === 'createdAt' || k === 'updatedAt') {\n // This property is read-only, but for legacy reasons we silently\n // ignore it\n continue;\n }\n if ((0, _indexOf.default)(readonly).call(readonly, k) > -1) {\n throw new Error('Cannot modify readonly attribute: ' + k);\n }\n if (options.unset) {\n newOps[k] = new _ParseOp.UnsetOp();\n } else if (changes[k] instanceof _ParseOp.Op) {\n newOps[k] = changes[k];\n } else if (changes[k] && typeof changes[k] === 'object' && typeof changes[k].__op === 'string') {\n newOps[k] = (0, _ParseOp.opFromJSON)(changes[k]);\n } else if (k === 'objectId' || k === 'id') {\n if (typeof changes[k] === 'string') {\n this.id = changes[k];\n }\n } else if (k === 'ACL' && typeof changes[k] === 'object' && !(changes[k] instanceof _ParseACL.default)) {\n newOps[k] = new _ParseOp.SetOp(new _ParseACL.default(changes[k]));\n } else if (changes[k] instanceof _ParseRelation.default) {\n const relation = new _ParseRelation.default(this, k);\n relation.targetClassName = changes[k].targetClassName;\n newOps[k] = new _ParseOp.SetOp(relation);\n } else {\n newOps[k] = new _ParseOp.SetOp(changes[k]);\n }\n }\n const currentAttributes = this.attributes;\n\n // Calculate new values\n const newValues = {};\n for (const attr in newOps) {\n if (newOps[attr] instanceof _ParseOp.RelationOp) {\n newValues[attr] = newOps[attr].applyTo(currentAttributes[attr], this, attr);\n } else if (!(newOps[attr] instanceof _ParseOp.UnsetOp)) {\n newValues[attr] = newOps[attr].applyTo(currentAttributes[attr]);\n }\n }\n\n // Validate changes\n if (!options.ignoreValidation) {\n const validation = this.validate(newValues);\n if (validation) {\n if (typeof options.error === 'function') {\n options.error(this, validation);\n }\n return false;\n }\n }\n\n // Consolidate Ops\n const pendingOps = this._getPendingOps();\n const last = pendingOps.length - 1;\n const stateController = _CoreManager.default.getObjectStateController();\n for (const attr in newOps) {\n const nextOp = newOps[attr].mergeWith(pendingOps[last][attr]);\n stateController.setPendingOp(this._getStateIdentifier(), attr, nextOp);\n }\n return this;\n }\n\n /**\n * Remove an attribute from the model. This is a noop if the attribute doesn't\n * exist.\n *\n * @param {string} attr The string name of an attribute.\n * @param options\n * @returns {(ParseObject | boolean)}\n */\n unset(attr, options) {\n options = options || {};\n options.unset = true;\n return this.set(attr, null, options);\n }\n\n /**\n * Atomically increments the value of the given attribute the next time the\n * object is saved. If no amount is specified, 1 is used by default.\n *\n * @param attr {String} The key.\n * @param amount {Number} The amount to increment by (optional).\n * @returns {(ParseObject|boolean)}\n */\n increment(attr, amount) {\n if (typeof amount === 'undefined') {\n amount = 1;\n }\n if (typeof amount !== 'number') {\n throw new Error('Cannot increment by a non-numeric amount.');\n }\n return this.set(attr, new _ParseOp.IncrementOp(amount));\n }\n\n /**\n * Atomically decrements the value of the given attribute the next time the\n * object is saved. If no amount is specified, 1 is used by default.\n *\n * @param attr {String} The key.\n * @param amount {Number} The amount to decrement by (optional).\n * @returns {(ParseObject | boolean)}\n */\n decrement(attr, amount) {\n if (typeof amount === 'undefined') {\n amount = 1;\n }\n if (typeof amount !== 'number') {\n throw new Error('Cannot decrement by a non-numeric amount.');\n }\n return this.set(attr, new _ParseOp.IncrementOp(amount * -1));\n }\n\n /**\n * Atomically add an object to the end of the array associated with a given\n * key.\n *\n * @param attr {String} The key.\n * @param item {} The item to add.\n * @returns {(ParseObject | boolean)}\n */\n add(attr, item) {\n return this.set(attr, new _ParseOp.AddOp([item]));\n }\n\n /**\n * Atomically add the objects to the end of the array associated with a given\n * key.\n *\n * @param attr {String} The key.\n * @param items {Object[]} The items to add.\n * @returns {(ParseObject | boolean)}\n */\n addAll(attr, items) {\n return this.set(attr, new _ParseOp.AddOp(items));\n }\n\n /**\n * Atomically add an object to the array associated with a given key, only\n * if it is not already present in the array. The position of the insert is\n * not guaranteed.\n *\n * @param attr {String} The key.\n * @param item {} The object to add.\n * @returns {(ParseObject | boolean)}\n */\n addUnique(attr, item) {\n return this.set(attr, new _ParseOp.AddUniqueOp([item]));\n }\n\n /**\n * Atomically add the objects to the array associated with a given key, only\n * if it is not already present in the array. The position of the insert is\n * not guaranteed.\n *\n * @param attr {String} The key.\n * @param items {Object[]} The objects to add.\n * @returns {(ParseObject | boolean)}\n */\n addAllUnique(attr, items) {\n return this.set(attr, new _ParseOp.AddUniqueOp(items));\n }\n\n /**\n * Atomically remove all instances of an object from the array associated\n * with a given key.\n *\n * @param attr {String} The key.\n * @param item {} The object to remove.\n * @returns {(ParseObject | boolean)}\n */\n remove(attr, item) {\n return this.set(attr, new _ParseOp.RemoveOp([item]));\n }\n\n /**\n * Atomically remove all instances of the objects from the array associated\n * with a given key.\n *\n * @param attr {String} The key.\n * @param items {Object[]} The object to remove.\n * @returns {(ParseObject | boolean)}\n */\n removeAll(attr, items) {\n return this.set(attr, new _ParseOp.RemoveOp(items));\n }\n\n /**\n * Returns an instance of a subclass of Parse.Op describing what kind of\n * modification has been performed on this field since the last time it was\n * saved. For example, after calling object.increment(\"x\"), calling\n * object.op(\"x\") would return an instance of Parse.Op.Increment.\n *\n * @param attr {String} The key.\n * @returns {Parse.Op | undefined} The operation, or undefined if none.\n */\n op(attr) {\n const pending = this._getPendingOps();\n for (let i = pending.length; i--;) {\n if (pending[i][attr]) {\n return pending[i][attr];\n }\n }\n }\n\n /**\n * Creates a new model with identical attributes to this one.\n *\n * @returns {Parse.Object}\n */\n clone() {\n const clone = new this.constructor(this.className);\n let attributes = this.attributes;\n if (typeof this.constructor.readOnlyAttributes === 'function') {\n const readonly = this.constructor.readOnlyAttributes() || [];\n // Attributes are frozen, so we have to rebuild an object,\n // rather than delete readonly keys\n const copy = {};\n for (const a in attributes) {\n if ((0, _indexOf.default)(readonly).call(readonly, a) < 0) {\n copy[a] = attributes[a];\n }\n }\n attributes = copy;\n }\n if (clone.set) {\n clone.set(attributes);\n }\n return clone;\n }\n\n /**\n * Creates a new instance of this object. Not to be confused with clone()\n *\n * @returns {Parse.Object}\n */\n newInstance() {\n const clone = new this.constructor(this.className);\n clone.id = this.id;\n if (singleInstance) {\n // Just return an object with the right id\n return clone;\n }\n const stateController = _CoreManager.default.getObjectStateController();\n if (stateController) {\n stateController.duplicateState(this._getStateIdentifier(), clone._getStateIdentifier());\n }\n return clone;\n }\n\n /**\n * Returns true if this object has never been saved to Parse.\n *\n * @returns {boolean}\n */\n isNew() {\n return !this.id;\n }\n\n /**\n * Returns true if this object was created by the Parse server when the\n * object might have already been there (e.g. in the case of a Facebook\n * login)\n *\n * @returns {boolean}\n */\n existed() {\n if (!this.id) {\n return false;\n }\n const stateController = _CoreManager.default.getObjectStateController();\n const state = stateController.getState(this._getStateIdentifier());\n if (state) {\n return state.existed;\n }\n return false;\n }\n\n /**\n * Returns true if this object exists on the Server\n *\n * @param {object} options\n * Valid options are:<ul>\n * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to\n * be used for this request.\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * </ul>\n * @returns {Promise<boolean>} A boolean promise that is fulfilled if object exists.\n */\n async exists(options) {\n if (!this.id) {\n return false;\n }\n try {\n const ParseQuery = _CoreManager.default.getParseQuery();\n const query = new ParseQuery(this.className);\n await query.get(this.id, options);\n return true;\n } catch (e) {\n if (e.code === _ParseError.default.OBJECT_NOT_FOUND) {\n return false;\n }\n throw e;\n }\n }\n\n /**\n * Checks if the model is currently in a valid state.\n *\n * @returns {boolean}\n */\n isValid() {\n return !this.validate(this.attributes);\n }\n\n /**\n * You should not call this function directly unless you subclass\n * <code>Parse.Object</code>, in which case you can override this method\n * to provide additional validation on <code>set</code> and\n * <code>save</code>. Your implementation should return\n *\n * @param {object} attrs The current data to validate.\n * @returns {Parse.Error|boolean} False if the data is valid. An error object otherwise.\n * @see Parse.Object#set\n */\n validate(attrs) {\n if (attrs.hasOwnProperty('ACL') && !(attrs.ACL instanceof _ParseACL.default)) {\n return new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'ACL must be a Parse ACL.');\n }\n for (const key in attrs) {\n if (!/^[A-Za-z][0-9A-Za-z_.]*$/.test(key)) {\n return new _ParseError.default(_ParseError.default.INVALID_KEY_NAME);\n }\n }\n return false;\n }\n\n /**\n * Returns the ACL for this object.\n *\n * @returns {Parse.ACL|null} An instance of Parse.ACL.\n * @see Parse.Object#get\n */\n getACL() {\n const acl = this.get('ACL');\n if (acl instanceof _ParseACL.default) {\n return acl;\n }\n return null;\n }\n\n /**\n * Sets the ACL to be used for this object.\n *\n * @param {Parse.ACL} acl An instance of Parse.ACL.\n * @param {object} options\n * @returns {(ParseObject | boolean)} Whether the set passed validation.\n * @see Parse.Object#set\n */\n setACL(acl, options) {\n return this.set('ACL', acl, options);\n }\n\n /**\n * Clears any (or specific) changes to this object made since the last call to save()\n *\n * @param {string} [keys] - specify which fields to revert\n */\n revert() {\n let keysToRevert;\n for (var _len = arguments.length, keys = new Array(_len), _key = 0; _key < _len; _key++) {\n keys[_key] = arguments[_key];\n }\n if (keys.length) {\n keysToRevert = [];\n for (const key of keys) {\n if (typeof key === 'string') {\n keysToRevert.push(key);\n } else {\n throw new Error('Parse.Object#revert expects either no, or a list of string, arguments.');\n }\n }\n }\n this._clearPendingOps(keysToRevert);\n }\n\n /**\n * Clears all attributes on a model\n *\n * @returns {(ParseObject | boolean)}\n */\n clear() {\n const attributes = this.attributes;\n const erasable = {};\n let readonly = ['createdAt', 'updatedAt'];\n if (typeof this.constructor.readOnlyAttributes === 'function') {\n readonly = (0, _concat.default)(readonly).call(readonly, this.constructor.readOnlyAttributes());\n }\n for (const attr in attributes) {\n if ((0, _indexOf.default)(readonly).call(readonly, attr) < 0) {\n erasable[attr] = true;\n }\n }\n return this.set(erasable, {\n unset: true\n });\n }\n\n /**\n * Fetch the model from the server. If the server's representation of the\n * model differs from its current attributes, they will be overriden.\n *\n * @param {object} options\n * Valid options are:<ul>\n * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to\n * be used for this request.\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * <li>include: The name(s) of the key(s) to include. Can be a string, an array of strings,\n * or an array of array of strings.\n * <li>context: A dictionary that is accessible in Cloud Code `beforeFind` trigger.\n * </ul>\n * @returns {Promise} A promise that is fulfilled when the fetch\n * completes.\n */\n fetch(options) {\n options = options || {};\n const fetchOptions = {};\n if (options.hasOwnProperty('useMasterKey')) {\n fetchOptions.useMasterKey = options.useMasterKey;\n }\n if (options.hasOwnProperty('sessionToken')) {\n fetchOptions.sessionToken = options.sessionToken;\n }\n if (options.hasOwnProperty('context') && typeof options.context === 'object') {\n fetchOptions.context = options.context;\n }\n if (options.hasOwnProperty('include')) {\n fetchOptions.include = [];\n if ((0, _isArray.default)(options.include)) {\n var _context;\n (0, _forEach.default)(_context = options.include).call(_context, key => {\n if ((0, _isArray.default)(key)) {\n var _context2;\n fetchOptions.include = (0, _concat.default)(_context2 = fetchOptions.include).call(_context2, key);\n } else {\n fetchOptions.include.push(key);\n }\n });\n } else {\n fetchOptions.include.push(options.include);\n }\n }\n const controller = _CoreManager.default.getObjectController();\n return controller.fetch(this, true, fetchOptions);\n }\n\n /**\n * Fetch the model from the server. If the server's representation of the\n * model differs from its current attributes, they will be overriden.\n *\n * Includes nested Parse.Objects for the provided key. You can use dot\n * notation to specify which fields in the included object are also fetched.\n *\n * @param {string | Array<string | Array<string>>} keys The name(s) of the key(s) to include.\n * @param {object} options\n * Valid options are:<ul>\n * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to\n * be used for this request.\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * </ul>\n * @returns {Promise} A promise that is fulfilled when the fetch\n * completes.\n */\n fetchWithInclude(keys, options) {\n options = options || {};\n options.include = keys;\n return this.fetch(options);\n }\n\n /**\n * Saves this object to the server at some unspecified time in the future,\n * even if Parse is currently inaccessible.\n *\n * Use this when you may not have a solid network connection, and don't need to know when the save completes.\n * If there is some problem with the object such that it can't be saved, it will be silently discarded.\n *\n * Objects saved with this method will be stored locally in an on-disk cache until they can be delivered to Parse.\n * They will be sent immediately if possible. Otherwise, they will be sent the next time a network connection is\n * available. Objects saved this way will persist even after the app is closed, in which case they will be sent the\n * next time the app is opened.\n *\n * @param {object} [options]\n * Used to pass option parameters to method if arg1 and arg2 were both passed as strings.\n * Valid options are:\n * <ul>\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * <li>cascadeSave: If `false`, nested objects will not be saved (default is `true`).\n * <li>context: A dictionary that is accessible in Cloud Code `beforeSave` and `afterSave` triggers.\n * </ul>\n * @returns {Promise} A promise that is fulfilled when the save\n * completes.\n */\n async saveEventually(options) {\n try {\n await this.save(null, options);\n } catch (e) {\n if (e.code === _ParseError.default.CONNECTION_FAILED) {\n await _CoreManager.default.getEventuallyQueue().save(this, options);\n _CoreManager.default.getEventuallyQueue().poll();\n }\n }\n return this;\n }\n\n /**\n * Set a hash of model attributes, and save the model to the server.\n * updatedAt will be updated when the request returns.\n * You can either call it as:<pre>\n * object.save();</pre>\n * or<pre>\n * object.save(attrs);</pre>\n * or<pre>\n * object.save(null, options);</pre>\n * or<pre>\n * object.save(attrs, options);</pre>\n * or<pre>\n * object.save(key, value);</pre>\n * or<pre>\n * object.save(key, value, options);</pre>\n *\n * Example 1: <pre>\n * gameTurn.save({\n * player: \"Jake Cutter\",\n * diceRoll: 2\n * }).then(function(gameTurnAgain) {\n * // The save was successful.\n * }, function(error) {\n * // The save failed. Error is an instance of Parse.Error.\n * });</pre>\n *\n * Example 2: <pre>\n * gameTurn.save(\"player\", \"Jake Cutter\");</pre>\n *\n * @param {string | object | null} [arg1]\n * Valid options are:<ul>\n * <li>`Object` - Key/value pairs to update on the object.</li>\n * <li>`String` Key - Key of attribute to update (requires arg2 to also be string)</li>\n * <li>`null` - Passing null for arg1 allows you to save the object with options passed in arg2.</li>\n * </ul>\n * @param {string | object} [arg2]\n * <ul>\n * <li>`String` Value - If arg1 was passed as a key, arg2 is the value that should be set on that key.</li>\n * <li>`Object` Options - Valid options are:\n * <ul>\n * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to\n * be used for this request.\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * <li>cascadeSave: If `false`, nested objects will not be saved (default is `true`).\n * <li>context: A dictionary that is accessible in Cloud Code `beforeSave` and `afterSave` triggers.\n * </ul>\n * </li>\n * </ul>\n * @param {object} [arg3]\n * Used to pass option parameters to method if arg1 and arg2 were both passed as strings.\n * Valid options are:\n * <ul>\n * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to\n * be used for this request.\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * <li>cascadeSave: If `false`, nested objects will not be saved (default is `true`).\n * <li>context: A dictionary that is accessible in Cloud Code `beforeSave` and `afterSave` triggers.\n * </ul>\n * @returns {Promise} A promise that is fulfilled when the save\n * completes.\n */\n save(arg1, arg2, arg3) {\n let attrs;\n let options;\n if (typeof arg1 === 'object' || typeof arg1 === 'undefined') {\n attrs = arg1;\n if (typeof arg2 === 'object') {\n options = arg2;\n }\n } else {\n attrs = {};\n attrs[arg1] = arg2;\n options = arg3;\n }\n options = options || {};\n if (attrs) {\n let validationError;\n options.error = (_, validation) => {\n validationError = validation;\n };\n const success = this.set(attrs, options);\n if (!success) {\n return _promise.default.reject(validationError);\n }\n }\n const saveOptions = {};\n if (options.hasOwnProperty('useMasterKey')) {\n saveOptions.useMasterKey = !!options.useMasterKey;\n }\n if (options.hasOwnProperty('sessionToken') && typeof options.sessionToken === 'string') {\n saveOptions.sessionToken = options.sessionToken;\n }\n if (options.hasOwnProperty('installationId') && typeof options.installationId === 'string') {\n saveOptions.installationId = options.installationId;\n }\n if (options.hasOwnProperty('context') && typeof options.context === 'object') {\n saveOptions.context = options.context;\n }\n const controller = _CoreManager.default.getObjectController();\n const unsaved = options.cascadeSave !== false ? (0, _unsavedChildren.default)(this) : null;\n return controller.save(unsaved, saveOptions).then(() => {\n return controller.save(this, saveOptions);\n });\n }\n\n /**\n * Deletes this object from the server at some unspecified time in the future,\n * even if Parse is currently inaccessible.\n *\n * Use this when you may not have a solid network connection,\n * and don't need to know when the delete completes. If there is some problem with the object\n * such that it can't be deleted, the request will be silently discarded.\n *\n * Delete instructions made with this method will be stored locally in an on-disk cache until they can be transmitted\n * to Parse. They will be sent immediately if possible. Otherwise, they will be sent the next time a network connection\n * is available. Delete requests will persist even after the app is closed, in which case they will be sent the\n * next time the app is opened.\n *\n * @param {object} [options]\n * Valid options are:<ul>\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * <li>context: A dictionary that is accessible in Cloud Code `beforeDelete` and `afterDelete` triggers.\n * </ul>\n * @returns {Promise} A promise that is fulfilled when the destroy\n * completes.\n */\n async destroyEventually(options) {\n try {\n await this.destroy(options);\n } catch (e) {\n if (e.code === _ParseError.default.CONNECTION_FAILED) {\n await _CoreManager.default.getEventuallyQueue().destroy(this, options);\n _CoreManager.default.getEventuallyQueue().poll();\n }\n }\n return this;\n }\n\n /**\n * Destroy this model on the server if it was already persisted.\n *\n * @param {object} options\n * Valid options are:<ul>\n * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to\n * be used for this request.\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * <li>context: A dictionary that is accessible in Cloud Code `beforeDelete` and `afterDelete` triggers.\n * </ul>\n * @returns {Promise} A promise that is fulfilled when the destroy\n * completes.\n */\n destroy(options) {\n options = options || {};\n const destroyOptions = {};\n if (options.hasOwnProperty('useMasterKey')) {\n destroyOptions.useMasterKey = options.useMasterKey;\n }\n if (options.hasOwnProperty('sessionToken')) {\n destroyOptions.sessionToken = options.sessionToken;\n }\n if (options.hasOwnProperty('context') && typeof options.context === 'object') {\n destroyOptions.context = options.context;\n }\n if (!this.id) {\n return _promise.default.resolve();\n }\n return _CoreManager.default.getObjectController().destroy(this, destroyOptions);\n }\n\n /**\n * Asynchronously stores the object and every object it points to in the local datastore,\n * recursively, using a default pin name: _default.\n *\n * If those other objects have not been fetched from Parse, they will not be stored.\n * However, if they have changed data, all the changes will be retained.\n *\n * <pre>\n * await object.pin();\n * </pre>\n *\n * To retrieve object:\n * <code>query.fromLocalDatastore()</code> or <code>query.fromPin()</code>\n *\n * @returns {Promise} A promise that is fulfilled when the pin completes.\n */\n pin() {\n return ParseObject.pinAllWithName(_LocalDatastoreUtils.DEFAULT_PIN, [this]);\n }\n\n /**\n * Asynchronously removes the object and every object it points to in the local datastore,\n * recursively, using a default pin name: _default.\n *\n * <pre>\n * await object.unPin();\n * </pre>\n *\n * @returns {Promise} A promise that is fulfilled when the unPin completes.\n */\n unPin() {\n return ParseObject.unPinAllWithName(_LocalDatastoreUtils.DEFAULT_PIN, [this]);\n }\n\n /**\n * Asynchronously returns if the object is pinned\n *\n * <pre>\n * const isPinned = await object.isPinned();\n * </pre>\n *\n * @returns {Promise<boolean>} A boolean promise that is fulfilled if object is pinned.\n */\n async isPinned() {\n const localDatastore = _CoreManager.default.getLocalDatastore();\n if (!localDatastore.isEnabled) {\n return _promise.default.reject('Parse.enableLocalDatastore() must be called first');\n }\n const objectKey = localDatastore.getKeyForObject(this);\n const pin = await localDatastore.fromPinWithName(objectKey);\n return pin.length > 0;\n }\n\n /**\n * Asynchronously stores the objects and every object they point to in the local datastore, recursively.\n *\n * If those other objects have not been fetched from Parse, they will not be stored.\n * However, if they have changed data, all the changes will be retained.\n *\n * <pre>\n * await object.pinWithName(name);\n * </pre>\n *\n * To retrieve object:\n * <code>query.fromLocalDatastore()</code> or <code>query.fromPinWithName(name)</code>\n *\n * @param {string} name Name of Pin.\n * @returns {Promise} A promise that is fulfilled when the pin completes.\n */\n pinWithName(name) {\n return ParseObject.pinAllWithName(name, [this]);\n }\n\n /**\n * Asynchronously removes the object and every object it points to in the local datastore, recursively.\n *\n * <pre>\n * await object.unPinWithName(name);\n * </pre>\n *\n * @param {string} name Name of Pin.\n * @returns {Promise} A promise that is fulfilled when the unPin completes.\n */\n unPinWithName(name) {\n return ParseObject.unPinAllWithName(name, [this]);\n }\n\n /**\n * Asynchronously loads data from the local datastore into this object.\n *\n * <pre>\n * await object.fetchFromLocalDatastore();\n * </pre>\n *\n * You can create an unfetched pointer with <code>Parse.Object.createWithoutData()</code>\n * and then call <code>fetchFromLocalDatastore()</code> on it.\n *\n * @returns {Promise} A promise that is fulfilled when the fetch completes.\n */\n async fetchFromLocalDatastore() {\n const localDatastore = _CoreManager.default.getLocalDatastore();\n if (!localDatastore.isEnabled) {\n throw new Error('Parse.enableLocalDatastore() must be called first');\n }\n const objectKey = localDatastore.getKeyForObject(this);\n const pinned = await localDatastore._serializeObject(objectKey);\n if (!pinned) {\n throw new Error('Cannot fetch an unsaved ParseObject');\n }\n const result = ParseObject.fromJSON(pinned);\n this._finishFetch(result.toJSON());\n return this;\n }\n\n /* Static methods */\n\n static _clearAllState() {\n const stateController = _CoreManager.default.getObjectStateController();\n stateController.clearAllState();\n }\n\n /**\n * Fetches the given list of Parse.Object.\n * If any error is encountered, stops and calls the error handler.\n *\n * <pre>\n * Parse.Object.fetchAll([object1, object2, ...])\n * .then((list) => {\n * // All the objects were fetched.\n * }, (error) => {\n * // An error occurred while fetching one of the objects.\n * });\n * </pre>\n *\n * @param {Array} list A list of <code>Parse.Object</code>.\n * @param {object} options\n * Valid options are:<ul>\n * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to\n * be used for this request.\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * <li>include: The name(s) of the key(s) to include. Can be a string, an array of strings,\n * or an array of array of strings.\n * </ul>\n * @static\n * @returns {Parse.Object[]}\n */\n static fetchAll(list) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const queryOptions = {};\n if (options.hasOwnProperty('useMasterKey')) {\n queryOptions.useMasterKey = options.useMasterKey;\n }\n if (options.hasOwnProperty('sessionToken')) {\n queryOptions.sessionToken = options.sessionToken;\n }\n if (options.hasOwnProperty('include')) {\n queryOptions.include = ParseObject.handleIncludeOptions(options);\n }\n return _CoreManager.default.getObjectController().fetch(list, true, queryOptions);\n }\n\n /**\n * Fetches the given list of Parse.Object.\n *\n * Includes nested Parse.Objects for the provided key. You can use dot\n * notation to specify which fields in the included object are also fetched.\n *\n * If any error is encountered, stops and calls the error handler.\n *\n * <pre>\n * Parse.Object.fetchAllWithInclude([object1, object2, ...], [pointer1, pointer2, ...])\n * .then((list) => {\n * // All the objects were fetched.\n * }, (error) => {\n * // An error occurred while fetching one of the objects.\n * });\n * </pre>\n *\n * @param {Array} list A list of <code>Parse.Object</code>.\n * @param {string | Array<string | Array<string>>} keys The name(s) of the key(s) to include.\n * @param {object} options\n * Valid options are:<ul>\n * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to\n * be used for this request.\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * </ul>\n * @static\n * @returns {Parse.Object[]}\n */\n static fetchAllWithInclude(list, keys, options) {\n options = options || {};\n options.include = keys;\n return ParseObject.fetchAll(list, options);\n }\n\n /**\n * Fetches the given list of Parse.Object if needed.\n * If any error is encountered, stops and calls the error handler.\n *\n * Includes nested Parse.Objects for the provided key. You can use dot\n * notation to specify which fields in the included object are also fetched.\n *\n * If any error is encountered, stops and calls the error handler.\n *\n * <pre>\n * Parse.Object.fetchAllIfNeededWithInclude([object1, object2, ...], [pointer1, pointer2, ...])\n * .then((list) => {\n * // All the objects were fetched.\n * }, (error) => {\n * // An error occurred while fetching one of the objects.\n * });\n * </pre>\n *\n * @param {Array} list A list of <code>Parse.Object</code>.\n * @param {string | Array<string | Array<string>>} keys The name(s) of the key(s) to include.\n * @param {object} options\n * Valid options are:<ul>\n * <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to\n * be used for this request.\n * <li>sessionToken: A valid session token, used for making a request on\n * behalf of a specific user.\n * </ul>\n * @static\n * @returns {Parse.Object[]}\n */\n static fetchAllIfNeededWithInclude(list, keys, options) {\n options = options || {};\n options.include = keys;\n return ParseObject.fetchAllIfNeeded(list, options);\n }\n\n /**\n * Fetches the given list of Parse.Object if needed.\n * If any error is encountered, stops and calls the error handler.\n *\n * <pre>\n * Parse.Object.fetchAllIfNeeded([object1, ...])\n * .then((list) => {\n * // Objects were fetched and updated.\n * }, (error) => {\n * // An error occurred while fetching one of the objects.\n * });\n * </pre>\n *\n * @param {Array} list A list of <code>Parse.Object</code>.\n * @param {object} options\n * @static\n * @returns {Parse.Object[]}\n */\n static fetchAllIfNeeded(list, options) {\n options = options || {};\n const queryOptions = {};\n if (options.hasOwnProperty('useMasterKey')) {\n queryOptions.useMasterKey = options.useMasterKey;\n }\n if (options.hasOwnProperty('sessionToken')) {\n queryOptions.sessionToken = options.sessionToken;\n }\n if (options.hasOwnProperty('include')) {\n queryOptions.include = ParseObject.handleIncludeOptions(options);\n }\n return _CoreManager.default.getObjectController().fetch(list, false, queryOptions);\n }\n static handleIncludeOptions(options) {\n let include = [];\n if ((0, _isArray.default)(options.include)) {\n var _context3;\n (0, _forEach.default)(_context3 = options.include).call(_context3, key => {\n if ((0, _isArray.default)(key)) {\n include = (0, _concat.default)(include).call(include, key);\n } else {\n include.push(key);\n }\n });\n } else {\n include.push(options.include);\n }\n return include;\n }\n\n /**\n * Destroy the given list of models on the server if it was already persisted.\n *\n * <p>Unlike saveAll, if an error occurs while deleting an individual model,\n * this method will continue trying to delete the rest of the models if\n * possible, except in the case of a fatal error like a connection error.\n *\n * <p>In particular, the Parse.Error object returned in the case of error may\n * be one of two types:\n *\n * <ul>\n * <li>A Parse.Error.AGGREGATE_ERROR. This object's \"errors\" property is an\n * array of other Parse.Error objects. Each error object in this array\n * has an \"object\" property that references the object that could not be\n * deleted (for instance, because that object could not be found).</li>\n * <li>A non-aggregate Parse.Error. This indicates a serious error that\n * caused the delete operation to be aborted partway through (for\n * instance, a connection failure in the middle of the delete).</li>\n * </ul>\n *\n * <pre>\n * Parse.Object.destroyAll([object1, object2, ...])\n * .then((list) => {\n * // All the objects were deleted.\n * }, (error) => {\n * // An error occurred while deleting one or more of the objects.\n * // If this is an aggregate error, then we can inspect each error\n * // object individually to determine the reason why a particular\n * // object was not deleted.\n * if (error.code === Parse.Error.AGGREGATE_ERROR) {\n * for (var i = 0; i < error.errors.length; i++) {\n * console.log(\"Couldn't delete \" + error.errors[i].object.id +\n * \"due to \" + error.errors[i].message);\n * }\n * } else {\n * console.log(\"Delete aborted because of \" + error.message);\n * }\n * });\n * </pre>\n *\n * @param {Array} list A list of <code>Parse.Object</code>.\n * @param {object} options\n * @static\n * @returns {Promise} A promise that is fulfilled when the destroyAll\n * completes.\n */\n static destroyAll(list) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const destroyOptions = {};\n if (options.hasOwnProperty('useMasterKey')) {\n destroyOptions.useMasterKey = options.useMasterKey;\n }\n if (options.hasOwnProperty('sessionToken')) {\n destroyOptions.sessionToken = options.sessionToken;\n }\n if (options.hasOwnProperty('batchSize') && typeof options.batchSize === 'number') {\n destroyOptions.batchSize = options.batchSize;\n }\n if (options.hasOwnProperty('context') && typeof options.context === 'object') {\n destroyOptions.context = options.context;\n }\n return _CoreManager.default.getObjectController().destroy(list, destroyOptions);\n }\n\n /**\n * Saves the given list of Parse.Object.\n * If any error is encountered, stops and calls the error handler.\n *\n * <pre>\n * Parse.Object.saveAll([object1, object2, ...])\n * .then((list) => {\n * // All the objects were saved.\n * }, (error) => {\n * // An error occurred while saving one of the objects.\n * });\n * </pre>\n *\n * @param {Array} list A list of <code>Parse.Object</code>.\n * @param {object} options\n * @static\n * @returns {Parse.Object[]}\n */\n static saveAll(list) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const saveOptions = {};\n if (options.hasOwnProperty('useMasterKey')) {\n saveOptions.useMasterKey = options.useMasterKey;\n }\n if (options.hasOwnProperty('sessionToken')) {\n saveOptions.sessionToken = options.sessionToken;\n }\n if (options.hasOwnProperty('batchSize') && typeof options.batchSize === 'number') {\n saveOptions.batchSize = options.batchSize;\n }\n if (options.hasOwnProperty('context') && typeof options.context === 'object') {\n saveOptions.context = options.context;\n }\n return _CoreManager.default.getObjectController().save(list, saveOptions);\n }\n\n /**\n * Creates a reference to a subclass of Parse.Object with the given id. This\n * does not exist on Parse.Object, only on subclasses.\n *\n * <p>A shortcut for: <pre>\n * var Foo = Parse.Object.extend(\"Foo\");\n * var pointerToFoo = new Foo();\n * pointerToFoo.id = \"myObjectId\";\n * </pre>\n *\n * @param {string} id The ID of the object to create a reference to.\n * @static\n * @returns {Parse.Object} A Parse.Object reference.\n */\n static createWithoutData(id) {\n const obj = new this();\n obj.id = id;\n return obj;\n }\n\n /**\n * Creates a new instance of a Parse Object from a JSON representation.\n *\n * @param {object} json The JSON map of the Object's data\n * @param {boolean} override In single instance mode, all old server data\n * is overwritten if this is set to true\n * @param {boolean} dirty Whether the Parse.Object should set JSON keys to dirty\n * @static\n * @returns {Parse.Object} A Parse.Object reference\n */\n static fromJSON(json, override, dirty) {\n if (!json.className) {\n throw new Error('Cannot create an object without a className');\n }\n const constructor = classMap[json.className];\n const o = constructor ? new constructor(json.className) : new ParseObject(json.className);\n const otherAttributes = {};\n for (const attr in json) {\n if (attr !== 'className' && attr !== '__type') {\n otherAttributes[attr] = json[attr];\n if (dirty) {\n o.set(attr, json[attr]);\n }\n }\n }\n if (override) {\n // id needs to be set before clearServerData can work\n if (otherAttributes.objectId) {\n o.id = otherAttributes.objectId;\n }\n let preserved = null;\n if (typeof o._preserveFieldsOnFetch === 'function') {\n preserved = o._preserveFieldsOnFetch();\n }\n o._clearServerData();\n if (preserved) {\n o._finishFetch(preserved);\n }\n }\n o._finishFetch(otherAttributes);\n if (json.objectId) {\n o._setExisted(true);\n }\n return o;\n }\n\n /**\n * Registers a subclass of Parse.Object with a specific class name.\n * When objects of that class are retrieved from a query, they will be\n * instantiated with this subclass.\n * This is only necessary when using ES6 subclassing.\n *\n * @param {string} className The class name of the subclass\n * @param {Function} constructor The subclass\n */\n static registerSubclass(className, constructor) {\n if (typeof className !== 'string') {\n throw new TypeError('The first argument must be a valid class name.');\n }\n if (typeof constructor === 'undefined') {\n throw new TypeError('You must supply a subclass constructor.');\n }\n if (typeof constructor !== 'function') {\n throw new TypeError('You must register the subclass constructor. ' + 'Did you attempt to register an instance of the subclass?');\n }\n classMap[className] = constructor;\n if (!constructor.className) {\n constructor.className = className;\n }\n }\n\n /**\n * Unegisters a subclass of Parse.Object with a specific class name.\n *\n * @param {string} className The class name of the subclass\n */\n static unregisterSubclass(className) {\n if (typeof className !== 'string') {\n throw new TypeError('The first argument must be a valid class name.');\n }\n delete classMap[className];\n }\n\n /**\n * Creates a new subclass of Parse.Object for the given Parse class name.\n *\n * <p>Every extension of a Parse class will inherit from the most recent\n * previous extension of that class. When a Parse.Object is automatically\n * created by parsing JSON, it will use the most recent extension of that\n * class.</p>\n *\n * <p>You should call either:<pre>\n * var MyClass = Parse.Object.extend(\"MyClass\", {\n * <i>Instance methods</i>,\n * initialize: function(attrs, options) {\n * this.someInstanceProperty = [],\n * <i>Other instance properties</i>\n * }\n * }, {\n * <i>Class properties</i>\n * });</pre>\n * or, for Backbone compatibility:<pre>\n * var MyClass = Parse.Object.extend({\n * className: \"MyClass\",\n * <i>Instance methods</i>,\n * initialize: function(attrs, options) {\n * this.someInstanceProperty = [],\n * <i>Other instance properties</i>\n * }\n * }, {\n * <i>Class properties</i>\n * });</pre></p>\n *\n * @param {string} className The name of the Parse class backing this model.\n * @param {object} [protoProps] Instance properties to add to instances of the\n * class returned from this method.\n * @param {object} [classProps] Class properties to add the class returned from\n * this method.\n * @returns {Parse.Object} A new subclass of Parse.Object.\n */\n static extend(className, protoProps, classProps) {\n if (typeof className !== 'string') {\n if (className && typeof className.className === 'string') {\n return ParseObject.extend(className.className, className, protoProps);\n } else {\n throw new Error(\"Parse.Object.extend's first argument should be the className.\");\n }\n }\n let adjustedClassName = className;\n if (adjustedClassName === 'User' && _CoreManager.default.get('PERFORM_USER_REWRITE')) {\n adjustedClassName = '_User';\n }\n let parentProto = ParseObject.prototype;\n if (this.hasOwnProperty('__super__') && this.__super__) {\n parentProto = this.prototype;\n }\n let ParseObjectSubclass = function (attributes, options) {\n this.className = adjustedClassName;\n this._objCount = objectCount++;\n // Enable legacy initializers\n if (typeof this.initialize === 'function') {\n this.initialize.apply(this, arguments);\n }\n if (this._initializers) {\n for (const initializer of this._initializers) {\n initializer.apply(this, arguments);\n }\n }\n if (attributes && typeof attributes === 'object') {\n if (!this.set(attributes || {}, options)) {\n throw new Error(\"Can't create an invalid Parse Object\");\n }\n }\n };\n if (classMap[adjustedClassName]) {\n ParseObjectSubclass = classMap[adjustedClassName];\n } else {\n ParseObjectSubclass.extend = function (name, protoProps, classProps) {\n if (typeof name === 'string') {\n return ParseObject.extend.call(ParseObjectSubclass, name, protoProps, classProps);\n }\n return ParseObject.extend.call(ParseObjectSubclass, adjustedClassName, name, protoProps);\n };\n ParseObjectSubclass.createWithoutData = ParseObject.createWithoutData;\n ParseObjectSubclass.className = adjustedClassName;\n ParseObjectSubclass.__super__ = parentProto;\n ParseObjectSubclass.prototype = (0, _create.default)(parentProto, {\n constructor: {\n value: ParseObjectSubclass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n }\n if (protoProps) {\n for (const prop in protoProps) {\n if (prop === 'initialize') {\n (0, _defineProperty3.default)(ParseObjectSubclass.prototype, '_initializers', {\n value: [...(ParseObjectSubclass.prototype._initializers || []), protoProps[prop]],\n enumerable: false,\n writable: true,\n configurable: true\n });\n continue;\n }\n if (prop !== 'className') {\n (0, _defineProperty3.default)(ParseObjectSubclass.prototype, prop, {\n value: protoProps[prop],\n enumerable: false,\n writable: true,\n configurable: true\n });\n }\n }\n }\n if (classProps) {\n for (const prop in classProps) {\n if (prop !== 'className') {\n (0, _defineProperty3.default)(ParseObjectSubclass, prop, {\n value: classProps[prop],\n enumerable: false,\n writable: true,\n configurable: true\n });\n }\n }\n }\n classMap[adjustedClassName] = ParseObjectSubclass;\n return ParseObjectSubclass;\n }\n\n /**\n * Enable single instance objects, where any local objects with the same Id\n * share the same attributes, and stay synchronized with each other.\n * This is disabled by default in server environments, since it can lead to\n * security issues.\n *\n * @static\n */\n static enableSingleInstance() {\n singleInstance = true;\n _CoreManager.default.setObjectStateController(SingleInstanceStateController);\n }\n\n /**\n * Disable single instance objects, where any local objects with the same Id\n * share the same attributes, and stay synchronized with each other.\n * When disabled, you can have two instances of the same object in memory\n * without them sharing attributes.\n *\n * @static\n */\n static disableSingleInstance() {\n singleInstance = false;\n _CoreManager.default.setObjectStateController(UniqueInstanceStateController);\n }\n\n /**\n * Asynchronously stores the objects and every object they point to in the local datastore,\n * recursively, using a default pin name: _default.\n *\n * If those other objects have not been fetched from Parse, they will not be stored.\n * However, if they have changed data, all the changes will be retained.\n *\n * <pre>\n * await Parse.Object.pinAll([...]);\n * </pre>\n *\n * To retrieve object:\n * <code>query.fromLocalDatastore()</code> or <code>query.fromPin()</code>\n *\n * @param {Array} objects A list of <code>Parse.Object</code>.\n * @returns {Promise} A promise that is fulfilled when the pin completes.\n * @static\n */\n static pinAll(objects) {\n const localDatastore = _CoreManager.default.getLocalDatastore();\n if (!localDatastore.isEnabled) {\n return _promise.default.reject('Parse.enableLocalDatastore() must be called first');\n }\n return ParseObject.pinAllWithName(_LocalDatastoreUtils.DEFAULT_PIN, objects);\n }\n\n /**\n * Asynchronously stores the objects and every object they point to in the local datastore, recursively.\n *\n * If those other objects have not been fetched from Parse, they will not be stored.\n * However, if they have changed data, all the changes will be retained.\n *\n * <pre>\n * await Parse.Object.pinAllWithName(name, [obj1, obj2, ...]);\n * </pre>\n *\n * To retrieve object:\n * <code>query.fromLocalDatastore()</code> or <code>query.fromPinWithName(name)</code>\n *\n * @param {string} name Name of Pin.\n * @param {Array} objects A list of <code>Parse.Object</code>.\n * @returns {Promise} A promise that is fulfilled when the pin completes.\n * @static\n */\n static pinAllWithName(name, objects) {\n const localDatastore = _CoreManager.default.getLocalDatastore();\n if (!localDatastore.isEnabled) {\n return _promise.default.reject('Parse.enableLocalDatastore() must be called first');\n }\n return localDatastore._handlePinAllWithName(name, objects);\n }\n\n /**\n * Asynchronously removes the objects and every object they point to in the local datastore,\n * recursively, using a default pin name: _default.\n *\n * <pre>\n * await Parse.Object.unPinAll([...]);\n * </pre>\n *\n * @param {Array} objects A list of <code>Parse.Object</code>.\n * @returns {Promise} A promise that is fulfilled when the unPin completes.\n * @static\n */\n static unPinAll(objects) {\n const localDatastore = _CoreManager.default.getLocalDatastore();\n if (!localDatastore.isEnabled) {\n return _promise.default.reject('Parse.enableLocalDatastore() must be called first');\n }\n return ParseObject.unPinAllWithName(_LocalDatastoreUtils.DEFAULT_PIN, objects);\n }\n\n /**\n * Asynchronously removes the objects and every object they point to in the local datastore, recursively.\n *\n * <pre>\n * await Parse.Object.unPinAllWithName(name, [obj1, obj2, ...]);\n * </pre>\n *\n * @param {string} name Name of Pin.\n * @param {Array} objects A list of <code>Parse.Object</code>.\n * @returns {Promise} A promise that is fulfilled when the unPin completes.\n * @static\n */\n static unPinAllWithName(name, objects) {\n const localDatastore = _CoreManager.default.getLocalDatastore();\n if (!localDatastore.isEnabled) {\n return _promise.default.reject('Parse.enableLocalDatastore() must be called first');\n }\n return localDatastore._handleUnPinAllWithName(name, objects);\n }\n\n /**\n * Asynchronously removes all objects in the local datastore using a default pin name: _default.\n *\n * <pre>\n * await Parse.Object.unPinAllObjects();\n * </pre>\n *\n * @returns {Promise} A promise that is fulfilled when the unPin completes.\n * @static\n */\n static unPinAllObjects() {\n const localDatastore = _CoreManager.default.getLocalDatastore();\n if (!localDatastore.isEnabled) {\n return _promise.default.reject('Parse.enableLocalDatastore() must be called first');\n }\n return localDatastore.unPinWithName(_LocalDatastoreUtils.DEFAULT_PIN);\n }\n\n /**\n * Asynchronously removes all objects with the specified pin name.\n * Deletes the pin name also.\n *\n * <pre>\n * await Parse.Object.unPinAllObjectsWithName(name);\n * </pre>\n *\n * @param {string} name Name of Pin.\n * @returns {Promise} A promise that is fulfilled when the unPin completes.\n * @static\n */\n static unPinAllObjectsWithName(name) {\n const localDatastore = _CoreManager.default.getLocalDatastore();\n if (!localDatastore.isEnabled) {\n return _promise.default.reject('Parse.enableLocalDatastore() must be called first');\n }\n return localDatastore.unPinWithName(_LocalDatastoreUtils.PIN_PREFIX + name);\n }\n}\nconst DefaultController = {\n fetch(target, forceFetch, options) {\n const localDatastore = _CoreManager.default.getLocalDatastore();\n if ((0, _isArray.default)(target)) {\n if (target.length < 1) {\n return _promise.default.resolve([]);\n }\n const objs = [];\n const ids = [];\n let className = null;\n const results = [];\n let error = null;\n (0, _forEach.default)(target).call(target, el => {\n if (error) {\n return;\n }\n if (!className) {\n className = el.className;\n }\n if (className !== el.className) {\n error = new _ParseError.default(_ParseError.default.INVALID_CLASS_NAME, 'All objects should be of the same class');\n }\n if (!el.id) {\n error = new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'All objects must have an ID');\n }\n if (forceFetch || !el.isDataAvailable()) {\n ids.push(el.id);\n objs.push(el);\n }\n results.push(el);\n });\n if (error) {\n return _promise.default.reject(error);\n }\n const ParseQuery = _CoreManager.default.getParseQuery();\n const query = new ParseQuery(className);\n query.containedIn('objectId', ids);\n if (options && options.include) {\n query.include(options.include);\n }\n query._limit = ids.length;\n return (0, _find.default)(query).call(query, options).then(async objects => {\n const idMap = {};\n (0, _forEach.default)(objects).call(objects, o => {\n idMap[o.id] = o;\n });\n for (let i = 0; i < objs.length; i++) {\n const obj = objs[i];\n if (!obj || !obj.id || !idMap[obj.id]) {\n if (forceFetch) {\n return _promise.default.reject(new _ParseError.default(_ParseError.default.OBJECT_NOT_FOUND, 'All objects must exist on the server.'));\n }\n }\n }\n if (!singleInstance) {\n // If single instance objects are disabled, we need to replace the\n for (let i = 0; i < results.length; i++) {\n const obj = results[i];\n if (obj && obj.id && idMap[obj.id]) {\n const id = obj.id;\n obj._finishFetch(idMap[id].toJSON());\n results[i] = idMap[id];\n }\n }\n }\n for (const object of results) {\n await localDatastore._updateObjectIfPinned(object);\n }\n return _promise.default.resolve(results);\n });\n } else if (target instanceof ParseObject) {\n if (!target.id) {\n return _promise.default.reject(new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'Object does not have an ID'));\n }\n const RESTController = _CoreManager.default.getRESTController();\n const params = {};\n if (options && options.include) {\n params.include = options.include.join();\n }\n return RESTController.request('GET', 'classes/' + target.className + '/' + target._getId(), params, options).then(async response => {\n target._clearPendingOps();\n target._clearServerData();\n target._finishFetch(response);\n await localDatastore._updateObjectIfPinned(target);\n return target;\n });\n }\n return _promise.default.resolve(undefined);\n },\n async destroy(target, options) {\n const batchSize = options && options.batchSize ? options.batchSize : _CoreManager.default.get('REQUEST_BATCH_SIZE');\n const localDatastore = _CoreManager.default.getLocalDatastore();\n const RESTController = _CoreManager.default.getRESTController();\n if ((0, _isArray.default)(target)) {\n if (target.length < 1) {\n return _promise.default.resolve([]);\n }\n const batches = [[]];\n (0, _forEach.default)(target).call(target, obj => {\n if (!obj.id) {\n return;\n }\n batches[batches.length - 1].push(obj);\n if (batches[batches.length - 1].length >= batchSize) {\n batches.push([]);\n }\n });\n if (batches[batches.length - 1].length === 0) {\n // If the last batch is empty, remove it\n batches.pop();\n }\n let deleteCompleted = _promise.default.resolve();\n const errors = [];\n (0, _forEach.default)(batches).call(batches, batch => {\n deleteCompleted = deleteCompleted.then(() => {\n return RESTController.request('POST', 'batch', {\n requests: (0, _map.default)(batch).call(batch, obj => {\n return {\n method: 'DELETE',\n path: getServerUrlPath() + 'classes/' + obj.className + '/' + obj._getId(),\n body: {}\n };\n })\n }, options).then(results => {\n for (let i = 0; i < results.length; i++) {\n if (results[i] && results[i].hasOwnProperty('error')) {\n const err = new _ParseError.default(results[i].error.code, results[i].error.error);\n err.object = batch[i];\n errors.push(err);\n }\n }\n });\n });\n });\n return deleteCompleted.then(async () => {\n if (errors.length) {\n const aggregate = new _ParseError.default(_ParseError.default.AGGREGATE_ERROR);\n aggregate.errors = errors;\n return _promise.default.reject(aggregate);\n }\n for (const object of target) {\n await localDatastore._destroyObjectIfPinned(object);\n }\n return _promise.default.resolve(target);\n });\n } else if (target instanceof ParseObject) {\n return RESTController.request('DELETE', 'classes/' + target.className + '/' + target._getId(), {}, options).then(async () => {\n await localDatastore._destroyObjectIfPinned(target);\n return _promise.default.resolve(target);\n });\n }\n return _promise.default.resolve(target);\n },\n save(target, options) {\n const batchSize = options && options.batchSize ? options.batchSize : _CoreManager.default.get('REQUEST_BATCH_SIZE');\n const localDatastore = _CoreManager.default.getLocalDatastore();\n const mapIdForPin = {};\n const RESTController = _CoreManager.default.getRESTController();\n const stateController = _CoreManager.default.getObjectStateController();\n const allowCustomObjectId = _CoreManager.default.get('ALLOW_CUSTOM_OBJECT_ID');\n options = options || {};\n options.returnStatus = options.returnStatus || true;\n if ((0, _isArray.default)(target)) {\n if (target.length < 1) {\n return _promise.default.resolve([]);\n }\n let unsaved = (0, _concat.default)(target).call(target);\n for (let i = 0; i < target.length; i++) {\n const target_i = target[i];\n if (target_i instanceof ParseObject) {\n unsaved = (0, _concat.default)(unsaved).call(unsaved, (0, _unsavedChildren.default)(target_i, true));\n }\n }\n unsaved = (0, _unique.default)(unsaved);\n const filesSaved = [];\n let pending = [];\n (0, _forEach.default)(unsaved).call(unsaved, el => {\n if (el instanceof _ParseFile.default) {\n filesSaved.push(el.save(options));\n } else if (el instanceof ParseObject) {\n pending.push(el);\n }\n });\n return _promise.default.all(filesSaved).then(() => {\n let objectError = null;\n return (0, _promiseUtils.continueWhile)(() => {\n return pending.length > 0;\n }, () => {\n const batch = [];\n const nextPending = [];\n (0, _forEach.default)(pending).call(pending, el => {\n if (allowCustomObjectId && Object.prototype.hasOwnProperty.call(el, 'id') && !el.id) {\n throw new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'objectId must not be empty or null');\n }\n if (batch.length < batchSize && (0, _canBeSerialized.default)(el)) {\n batch.push(el);\n } else {\n nextPending.push(el);\n }\n });\n pending = nextPending;\n if (batch.length < 1) {\n return _promise.default.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Tried to save a batch with a cycle.'));\n }\n\n // Queue up tasks for each object in the batch.\n // When every task is ready, the API request will execute\n const batchReturned = (0, _promiseUtils.resolvingPromise)();\n const batchReady = [];\n const batchTasks = [];\n (0, _forEach.default)(batch).call(batch, (obj, index) => {\n const ready = (0, _promiseUtils.resolvingPromise)();\n batchReady.push(ready);\n stateController.pushPendingState(obj._getStateIdentifier());\n batchTasks.push(stateController.enqueueTask(obj._getStateIdentifier(), function () {\n ready.resolve();\n return batchReturned.then(responses => {\n if (responses[index].hasOwnProperty('success')) {\n const objectId = responses[index].success.objectId;\n const status = responses[index]._status;\n delete responses[index]._status;\n delete responses[index]._headers;\n delete responses[index]._xhr;\n mapIdForPin[objectId] = obj._localId;\n obj._handleSaveResponse(responses[index].success, status);\n } else {\n if (!objectError && responses[index].hasOwnProperty('error')) {\n const serverError = responses[index].error;\n objectError = new _ParseError.default(serverError.code, serverError.error);\n // Cancel the rest of the save\n pending = [];\n }\n obj._handleSaveError();\n }\n });\n }));\n });\n (0, _promiseUtils.when)(batchReady).then(() => {\n // Kick off the batch request\n return RESTController.request('POST', 'batch', {\n requests: (0, _map.default)(batch).call(batch, obj => {\n const params = obj._getSaveParams();\n params.path = getServerUrlPath() + params.path;\n return params;\n })\n }, options);\n }).then(batchReturned.resolve, error => {\n batchReturned.reject(new _ParseError.default(_ParseError.default.INCORRECT_TYPE, error.message));\n });\n return (0, _promiseUtils.when)(batchTasks);\n }).then(async () => {\n if (objectError) {\n return _promise.default.reject(objectError);\n }\n for (const object of target) {\n // Make sure that it is a ParseObject before updating it into the localDataStore\n if (object instanceof ParseObject) {\n await localDatastore._updateLocalIdForObject(mapIdForPin[object.id], object);\n await localDatastore._updateObjectIfPinned(object);\n }\n }\n return _promise.default.resolve(target);\n });\n });\n } else if (target instanceof ParseObject) {\n if (allowCustomObjectId && Object.prototype.hasOwnProperty.call(target, 'id') && !target.id) {\n throw new _ParseError.default(_ParseError.default.MISSING_OBJECT_ID, 'objectId must not be empty or null');\n }\n // generate _localId in case if cascadeSave=false\n target._getId();\n const localId = target._localId;\n // copying target lets guarantee the pointer isn't modified elsewhere\n const targetCopy = target;\n const task = function () {\n const params = targetCopy._getSaveParams();\n return RESTController.request(params.method, params.path, params.body, options).then(response => {\n const status = response._status;\n delete response._status;\n delete response._headers;\n delete response._xhr;\n targetCopy._handleSaveResponse(response, status);\n }, error => {\n targetCopy._handleSaveError();\n return _promise.default.reject(error);\n });\n };\n stateController.pushPendingState(target._getStateIdentifier());\n return stateController.enqueueTask(target._getStateIdentifier(), task).then(async () => {\n await localDatastore._updateLocalIdForObject(localId, target);\n await localDatastore._updateObjectIfPinned(target);\n return target;\n }, error => {\n return _promise.default.reject(error);\n });\n }\n return _promise.default.resolve(undefined);\n }\n};\n_CoreManager.default.setParseObject(ParseObject);\n_CoreManager.default.setObjectController(DefaultController);\nvar _default = exports.default = ParseObject;"],"mappings":"AAAA,YAAY;;AAAC,IAAAA,iBAAA,GAAAC,OAAA,qGAAAC,OAAA;AAEb,IAAIC,QAAQ,GAAGF,OAAO,CAAC,gDAAgD,CAAC;AACxE,IAAIG,uBAAuB,GAAGH,OAAO,CAAC,8DAA8D,CAAC;AACrG,IAAII,gCAAgC,GAAGJ,OAAO,CAAC,0EAA0E,CAAC;AAC1H,IAAIK,sBAAsB,GAAGL,OAAO,CAAC,sDAAsD,CAAC;AAC5FG,uBAAuB,CAACG,OAAO,EAAE,YAAY,EAAE;EAC7CC,KAAK,EAAE;AACT,CAAC,CAAC;AACFD,OAAO,CAACL,OAAO,GAAG,KAAK,CAAC;AACxB,IAAIO,gBAAgB,GAAGH,sBAAsB,CAACL,OAAO,CAAC,+CAA+C,CAAC,CAAC;AACvG,IAAIS,QAAQ,GAAGJ,sBAAsB,CAACL,OAAO,CAAC,yDAAyD,CAAC,CAAC;AACzG,IAAIU,OAAO,GAAGL,sBAAsB,CAACL,OAAO,CAAC,qDAAqD,CAAC,CAAC;AACpG,IAAIW,KAAK,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