{"ast":null,"code":"\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs3/core-js-stable/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs3/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _indexOf = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/instance/index-of\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs3/helpers/defineProperty\"));\nvar _CoreManager = _interopRequireDefault(require(\"./CoreManager\"));\nvar _ParseObject = _interopRequireDefault(require(\"./ParseObject\"));\nvar _ParseCLP = _interopRequireDefault(require(\"./ParseCLP\"));\nconst FIELD_TYPES = ['String', 'Number', 'Boolean', 'Bytes', 'Date', 'File', 'GeoPoint', 'Polygon', 'Array', 'Object', 'Pointer', 'Relation'];\n/**\n * A Parse.Schema object is for handling schema data from Parse.\n *
All the schemas methods require MasterKey.\n *\n * When adding fields, you may set required and default values. (Requires Parse Server 3.7.0+)\n *\n *
\n * const options = { required: true, defaultValue: 'hello world' };\n * const schema = new Parse.Schema('MyClass');\n * schema.addString('field', options);\n * schema.addIndex('index_name', { 'field': 1 });\n * schema.save();\n *\n * \n *\n * @alias Parse.Schema\n */\nclass ParseSchema {\n /**\n * @param {string} className Parse Class string.\n */\n constructor(className) {\n (0, _defineProperty2.default)(this, \"className\", void 0);\n (0, _defineProperty2.default)(this, \"_fields\", void 0);\n (0, _defineProperty2.default)(this, \"_indexes\", void 0);\n (0, _defineProperty2.default)(this, \"_clp\", void 0);\n if (typeof className === 'string') {\n if (className === 'User' && _CoreManager.default.get('PERFORM_USER_REWRITE')) {\n this.className = '_User';\n } else {\n this.className = className;\n }\n }\n this._fields = {};\n this._indexes = {};\n }\n\n /**\n * Static method to get all schemas\n *\n * @returns {Promise} A promise that is resolved with the result when\n * the query completes.\n */\n static all() {\n const controller = _CoreManager.default.getSchemaController();\n return controller.get('').then(response => {\n if (response.results.length === 0) {\n throw new Error('Schema not found.');\n }\n return response.results;\n });\n }\n\n /**\n * Get the Schema from Parse\n *\n * @returns {Promise} A promise that is resolved with the result when\n * the query completes.\n */\n get() {\n this.assertClassName();\n const controller = _CoreManager.default.getSchemaController();\n return controller.get(this.className).then(response => {\n if (!response) {\n throw new Error('Schema not found.');\n }\n return response;\n });\n }\n\n /**\n * Create a new Schema on Parse\n *\n * @returns {Promise} A promise that is resolved with the result when\n * the query completes.\n */\n save() {\n this.assertClassName();\n const controller = _CoreManager.default.getSchemaController();\n const params = {\n className: this.className,\n fields: this._fields,\n indexes: this._indexes,\n classLevelPermissions: this._clp\n };\n return controller.create(this.className, params);\n }\n\n /**\n * Update a Schema on Parse\n *\n * @returns {Promise} A promise that is resolved with the result when\n * the query completes.\n */\n update() {\n this.assertClassName();\n const controller = _CoreManager.default.getSchemaController();\n const params = {\n className: this.className,\n fields: this._fields,\n indexes: this._indexes,\n classLevelPermissions: this._clp\n };\n this._fields = {};\n this._indexes = {};\n return controller.update(this.className, params);\n }\n\n /**\n * Removing a Schema from Parse\n * Can only be used on Schema without objects\n *\n * @returns {Promise} A promise that is resolved with the result when\n * the query completes.\n */\n delete() {\n this.assertClassName();\n const controller = _CoreManager.default.getSchemaController();\n return controller.delete(this.className);\n }\n\n /**\n * Removes all objects from a Schema (class) in Parse.\n * EXERCISE CAUTION, running this will delete all objects for this schema and cannot be reversed\n *\n * @returns {Promise} A promise that is resolved with the result when\n * the query completes.\n */\n purge() {\n this.assertClassName();\n const controller = _CoreManager.default.getSchemaController();\n return controller.purge(this.className);\n }\n\n /**\n * Assert if ClassName has been filled\n *\n * @private\n */\n assertClassName() {\n if (!this.className) {\n throw new Error('You must set a Class Name before making any request.');\n }\n }\n\n /**\n * Sets Class Level Permissions when creating / updating a Schema.\n * EXERCISE CAUTION, running this may override CLP for this schema and cannot be reversed\n *\n * @param {object | Parse.CLP} clp Class Level Permissions\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n setCLP(clp) {\n if (clp instanceof _ParseCLP.default) {\n this._clp = clp.toJSON();\n } else {\n this._clp = clp;\n }\n return this;\n }\n\n /**\n * Adding a Field to Create / Update a Schema\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {string} type Can be a (String|Number|Boolean|Date|Parse.File|Parse.GeoPoint|Array|Object|Pointer|Parse.Relation)\n * @param {object} options\n * Valid options are:
\n * schema.addIndex('index_name', { 'field': 1 });\n *\n */\n addIndex(name, index) {\n if (!name) {\n throw new Error('index name may not be null.');\n }\n if (!index) {\n throw new Error('index may not be null.');\n }\n this._indexes[name] = index;\n return this;\n }\n\n /**\n * Adding String Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addString(name, options) {\n return this.addField(name, 'String', options);\n }\n\n /**\n * Adding Number Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addNumber(name, options) {\n return this.addField(name, 'Number', options);\n }\n\n /**\n * Adding Boolean Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addBoolean(name, options) {\n return this.addField(name, 'Boolean', options);\n }\n\n /**\n * Adding Bytes Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addBytes(name, options) {\n return this.addField(name, 'Bytes', options);\n }\n\n /**\n * Adding Date Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addDate(name, options) {\n return this.addField(name, 'Date', options);\n }\n\n /**\n * Adding File Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addFile(name, options) {\n return this.addField(name, 'File', options);\n }\n\n /**\n * Adding GeoPoint Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addGeoPoint(name, options) {\n return this.addField(name, 'GeoPoint', options);\n }\n\n /**\n * Adding Polygon Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addPolygon(name, options) {\n return this.addField(name, 'Polygon', options);\n }\n\n /**\n * Adding Array Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addArray(name, options) {\n return this.addField(name, 'Array', options);\n }\n\n /**\n * Adding Object Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addObject(name, options) {\n return this.addField(name, 'Object', options);\n }\n\n /**\n * Adding Pointer Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {string} targetClass Name of the target Pointer Class\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addPointer(name, targetClass) {\n let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n if (!name) {\n throw new Error('field name may not be null.');\n }\n if (!targetClass) {\n throw new Error('You need to set the targetClass of the Pointer.');\n }\n const fieldOptions = {\n type: 'Pointer',\n targetClass\n };\n if (typeof options.required === 'boolean') {\n fieldOptions.required = options.required;\n }\n if (options.defaultValue !== undefined) {\n fieldOptions.defaultValue = options.defaultValue;\n if (options.defaultValue instanceof _ParseObject.default) {\n fieldOptions.defaultValue = options.defaultValue.toPointer();\n }\n }\n this._fields[name] = fieldOptions;\n return this;\n }\n\n /**\n * Adding Relation Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {string} targetClass Name of the target Pointer Class\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addRelation(name, targetClass) {\n if (!name) {\n throw new Error('field name may not be null.');\n }\n if (!targetClass) {\n throw new Error('You need to set the targetClass of the Relation.');\n }\n this._fields[name] = {\n type: 'Relation',\n targetClass\n };\n return this;\n }\n\n /**\n * Deleting a Field to Update on a Schema\n *\n * @param {string} name Name of the field\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n deleteField(name) {\n this._fields[name] = {\n __op: 'Delete'\n };\n return this;\n }\n\n /**\n * Deleting an Index to Update on a Schema\n *\n * @param {string} name Name of the field\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n deleteIndex(name) {\n this._indexes[name] = {\n __op: 'Delete'\n };\n return this;\n }\n}\nconst DefaultController = {\n send(className, method) {\n let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n const RESTController = _CoreManager.default.getRESTController();\n return RESTController.request(method, `schemas/${className}`, params, {\n useMasterKey: true\n });\n },\n get(className) {\n return this.send(className, 'GET');\n },\n create(className, params) {\n return this.send(className, 'POST', params);\n },\n update(className, params) {\n return this.send(className, 'PUT', params);\n },\n delete(className) {\n return this.send(className, 'DELETE');\n },\n purge(className) {\n const RESTController = _CoreManager.default.getRESTController();\n return RESTController.request('DELETE', `purge/${className}`, {}, {\n useMasterKey: true\n });\n }\n};\n_CoreManager.default.setSchemaController(DefaultController);\nvar _default = exports.default = ParseSchema;","map":{"version":3,"names":["_Object$defineProperty","require","_interopRequireDefault","exports","value","default","_indexOf","_defineProperty2","_CoreManager","_ParseObject","_ParseCLP","FIELD_TYPES","ParseSchema","constructor","className","get","_fields","_indexes","all","controller","getSchemaController","then","response","results","length","Error","assertClassName","save","params","fields","indexes","classLevelPermissions","_clp","create","update","delete","purge","setCLP","clp","toJSON","addField","name","type","options","arguments","undefined","call","addPointer","targetClass","addRelation","fieldOptions","required","defaultValue","__type","iso","Date","base64","addIndex","index","addString","addNumber","addBoolean","addBytes","addDate","addFile","addGeoPoint","addPolygon","addArray","addObject","toPointer","deleteField","__op","deleteIndex","DefaultController","send","method","RESTController","getRESTController","request","useMasterKey","setSchemaController","_default"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/parse/lib/browser/ParseSchema.js"],"sourcesContent":["\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs3/core-js-stable/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs3/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _indexOf = _interopRequireDefault(require(\"@babel/runtime-corejs3/core-js-stable/instance/index-of\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs3/helpers/defineProperty\"));\nvar _CoreManager = _interopRequireDefault(require(\"./CoreManager\"));\nvar _ParseObject = _interopRequireDefault(require(\"./ParseObject\"));\nvar _ParseCLP = _interopRequireDefault(require(\"./ParseCLP\"));\nconst FIELD_TYPES = ['String', 'Number', 'Boolean', 'Bytes', 'Date', 'File', 'GeoPoint', 'Polygon', 'Array', 'Object', 'Pointer', 'Relation'];\n/**\n * A Parse.Schema object is for handling schema data from Parse.\n *
All the schemas methods require MasterKey.\n *\n * When adding fields, you may set required and default values. (Requires Parse Server 3.7.0+)\n *\n *
\n * const options = { required: true, defaultValue: 'hello world' };\n * const schema = new Parse.Schema('MyClass');\n * schema.addString('field', options);\n * schema.addIndex('index_name', { 'field': 1 });\n * schema.save();\n *\n * \n *\n * @alias Parse.Schema\n */\nclass ParseSchema {\n /**\n * @param {string} className Parse Class string.\n */\n constructor(className) {\n (0, _defineProperty2.default)(this, \"className\", void 0);\n (0, _defineProperty2.default)(this, \"_fields\", void 0);\n (0, _defineProperty2.default)(this, \"_indexes\", void 0);\n (0, _defineProperty2.default)(this, \"_clp\", void 0);\n if (typeof className === 'string') {\n if (className === 'User' && _CoreManager.default.get('PERFORM_USER_REWRITE')) {\n this.className = '_User';\n } else {\n this.className = className;\n }\n }\n this._fields = {};\n this._indexes = {};\n }\n\n /**\n * Static method to get all schemas\n *\n * @returns {Promise} A promise that is resolved with the result when\n * the query completes.\n */\n static all() {\n const controller = _CoreManager.default.getSchemaController();\n return controller.get('').then(response => {\n if (response.results.length === 0) {\n throw new Error('Schema not found.');\n }\n return response.results;\n });\n }\n\n /**\n * Get the Schema from Parse\n *\n * @returns {Promise} A promise that is resolved with the result when\n * the query completes.\n */\n get() {\n this.assertClassName();\n const controller = _CoreManager.default.getSchemaController();\n return controller.get(this.className).then(response => {\n if (!response) {\n throw new Error('Schema not found.');\n }\n return response;\n });\n }\n\n /**\n * Create a new Schema on Parse\n *\n * @returns {Promise} A promise that is resolved with the result when\n * the query completes.\n */\n save() {\n this.assertClassName();\n const controller = _CoreManager.default.getSchemaController();\n const params = {\n className: this.className,\n fields: this._fields,\n indexes: this._indexes,\n classLevelPermissions: this._clp\n };\n return controller.create(this.className, params);\n }\n\n /**\n * Update a Schema on Parse\n *\n * @returns {Promise} A promise that is resolved with the result when\n * the query completes.\n */\n update() {\n this.assertClassName();\n const controller = _CoreManager.default.getSchemaController();\n const params = {\n className: this.className,\n fields: this._fields,\n indexes: this._indexes,\n classLevelPermissions: this._clp\n };\n this._fields = {};\n this._indexes = {};\n return controller.update(this.className, params);\n }\n\n /**\n * Removing a Schema from Parse\n * Can only be used on Schema without objects\n *\n * @returns {Promise} A promise that is resolved with the result when\n * the query completes.\n */\n delete() {\n this.assertClassName();\n const controller = _CoreManager.default.getSchemaController();\n return controller.delete(this.className);\n }\n\n /**\n * Removes all objects from a Schema (class) in Parse.\n * EXERCISE CAUTION, running this will delete all objects for this schema and cannot be reversed\n *\n * @returns {Promise} A promise that is resolved with the result when\n * the query completes.\n */\n purge() {\n this.assertClassName();\n const controller = _CoreManager.default.getSchemaController();\n return controller.purge(this.className);\n }\n\n /**\n * Assert if ClassName has been filled\n *\n * @private\n */\n assertClassName() {\n if (!this.className) {\n throw new Error('You must set a Class Name before making any request.');\n }\n }\n\n /**\n * Sets Class Level Permissions when creating / updating a Schema.\n * EXERCISE CAUTION, running this may override CLP for this schema and cannot be reversed\n *\n * @param {object | Parse.CLP} clp Class Level Permissions\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n setCLP(clp) {\n if (clp instanceof _ParseCLP.default) {\n this._clp = clp.toJSON();\n } else {\n this._clp = clp;\n }\n return this;\n }\n\n /**\n * Adding a Field to Create / Update a Schema\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {string} type Can be a (String|Number|Boolean|Date|Parse.File|Parse.GeoPoint|Array|Object|Pointer|Parse.Relation)\n * @param {object} options\n * Valid options are:
\n * schema.addIndex('index_name', { 'field': 1 });\n *\n */\n addIndex(name, index) {\n if (!name) {\n throw new Error('index name may not be null.');\n }\n if (!index) {\n throw new Error('index may not be null.');\n }\n this._indexes[name] = index;\n return this;\n }\n\n /**\n * Adding String Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addString(name, options) {\n return this.addField(name, 'String', options);\n }\n\n /**\n * Adding Number Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addNumber(name, options) {\n return this.addField(name, 'Number', options);\n }\n\n /**\n * Adding Boolean Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addBoolean(name, options) {\n return this.addField(name, 'Boolean', options);\n }\n\n /**\n * Adding Bytes Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addBytes(name, options) {\n return this.addField(name, 'Bytes', options);\n }\n\n /**\n * Adding Date Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addDate(name, options) {\n return this.addField(name, 'Date', options);\n }\n\n /**\n * Adding File Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addFile(name, options) {\n return this.addField(name, 'File', options);\n }\n\n /**\n * Adding GeoPoint Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addGeoPoint(name, options) {\n return this.addField(name, 'GeoPoint', options);\n }\n\n /**\n * Adding Polygon Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addPolygon(name, options) {\n return this.addField(name, 'Polygon', options);\n }\n\n /**\n * Adding Array Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addArray(name, options) {\n return this.addField(name, 'Array', options);\n }\n\n /**\n * Adding Object Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addObject(name, options) {\n return this.addField(name, 'Object', options);\n }\n\n /**\n * Adding Pointer Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {string} targetClass Name of the target Pointer Class\n * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addPointer(name, targetClass) {\n let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n if (!name) {\n throw new Error('field name may not be null.');\n }\n if (!targetClass) {\n throw new Error('You need to set the targetClass of the Pointer.');\n }\n const fieldOptions = {\n type: 'Pointer',\n targetClass\n };\n if (typeof options.required === 'boolean') {\n fieldOptions.required = options.required;\n }\n if (options.defaultValue !== undefined) {\n fieldOptions.defaultValue = options.defaultValue;\n if (options.defaultValue instanceof _ParseObject.default) {\n fieldOptions.defaultValue = options.defaultValue.toPointer();\n }\n }\n this._fields[name] = fieldOptions;\n return this;\n }\n\n /**\n * Adding Relation Field\n *\n * @param {string} name Name of the field that will be created on Parse\n * @param {string} targetClass Name of the target Pointer Class\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n addRelation(name, targetClass) {\n if (!name) {\n throw new Error('field name may not be null.');\n }\n if (!targetClass) {\n throw new Error('You need to set the targetClass of the Relation.');\n }\n this._fields[name] = {\n type: 'Relation',\n targetClass\n };\n return this;\n }\n\n /**\n * Deleting a Field to Update on a Schema\n *\n * @param {string} name Name of the field\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n deleteField(name) {\n this._fields[name] = {\n __op: 'Delete'\n };\n return this;\n }\n\n /**\n * Deleting an Index to Update on a Schema\n *\n * @param {string} name Name of the field\n * @returns {Parse.Schema} Returns the schema, so you can chain this call.\n */\n deleteIndex(name) {\n this._indexes[name] = {\n __op: 'Delete'\n };\n return this;\n }\n}\nconst DefaultController = {\n send(className, method) {\n let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n const RESTController = _CoreManager.default.getRESTController();\n return RESTController.request(method, `schemas/${className}`, params, {\n useMasterKey: true\n });\n },\n get(className) {\n return this.send(className, 'GET');\n },\n create(className, params) {\n return this.send(className, 'POST', params);\n },\n update(className, params) {\n return this.send(className, 'PUT', params);\n },\n delete(className) {\n return this.send(className, 'DELETE');\n },\n purge(className) {\n const RESTController = _CoreManager.default.getRESTController();\n return RESTController.request('DELETE', `purge/${className}`, {}, {\n useMasterKey: true\n });\n }\n};\n_CoreManager.default.setSchemaController(DefaultController);\nvar _default = exports.default = ParseSchema;"],"mappings":"AAAA,YAAY;;AAEZ,IAAIA,sBAAsB,GAAGC,OAAO,CAAC,8DAA8D,CAAC;AACpG,IAAIC,sBAAsB,GAAGD,OAAO,CAAC,sDAAsD,CAAC;AAC5FD,sBAAsB,CAACG,OAAO,EAAE,YAAY,EAAE;EAC5CC,KAAK,EAAE;AACT,CAAC,CAAC;AACFD,OAAO,CAACE,OAAO,GAAG,KAAK,CAAC;AACxB,IAAIC,QAAQ,GAAGJ,sBAAsB,CAACD,OAAO,CAAC,yDAAyD,CAAC,CAAC;AACzG,IAAIM,gBAAgB,GAAGL,sBAAsB,CAACD,OAAO,CAAC,+CAA+C,CAAC,CAAC;AACvG,IAAIO,YAAY,GAAGN,sBAAsB,CAACD,OAAO,CAAC,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