parse 4.2.0-alpha.5 → 4.2.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -187,7 +187,7 @@ var config /*: Config & { [key: string]: mixed }*/ = {
187
187
  SERVER_AUTH_TOKEN: null,
188
188
  LIVEQUERY_SERVER_URL: null,
189
189
  ENCRYPTED_KEY: null,
190
- VERSION: 'js' + "4.2.0-alpha.5",
190
+ VERSION: 'js' + "4.2.0-alpha.6",
191
191
  APPLICATION_ID: null,
192
192
  JAVASCRIPT_KEY: null,
193
193
  MASTER_KEY: null,
@@ -17,7 +17,7 @@ var _ParseCLP = _interopRequireDefault(require("./ParseCLP"));
17
17
  * @flow
18
18
  */
19
19
  /*:: import type { PermissionsMap } from './ParseCLP';*/
20
- var FIELD_TYPES = ['String', 'Number', 'Boolean', 'Date', 'File', 'GeoPoint', 'Polygon', 'Array', 'Object', 'Pointer', 'Relation'];
20
+ var FIELD_TYPES = ['String', 'Number', 'Boolean', 'Bytes', 'Date', 'File', 'GeoPoint', 'Polygon', 'Array', 'Object', 'Pointer', 'Relation'];
21
21
  /*:: type FieldOptions = {
22
22
  required: boolean,
23
23
  defaultValue: mixed,
@@ -236,6 +236,14 @@ var ParseSchema = /*#__PURE__*/function () {
236
236
  };
237
237
  }
238
238
  }
239
+ if (type === 'Bytes') {
240
+ if (options && options.defaultValue) {
241
+ fieldOptions.defaultValue = {
242
+ __type: 'Bytes',
243
+ base64: options.defaultValue
244
+ };
245
+ }
246
+ }
239
247
  this._fields[name] = fieldOptions;
240
248
  return this;
241
249
  }
@@ -303,6 +311,19 @@ var ParseSchema = /*#__PURE__*/function () {
303
311
  return this.addField(name, 'Boolean', options);
304
312
  }
305
313
 
314
+ /**
315
+ * Adding Bytes Field
316
+ *
317
+ * @param {string} name Name of the field that will be created on Parse
318
+ * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
319
+ * @returns {Parse.Schema} Returns the schema, so you can chain this call.
320
+ */
321
+ }, {
322
+ key: "addBytes",
323
+ value: function (name /*: string*/, options /*: FieldOptions*/) {
324
+ return this.addField(name, 'Bytes', options);
325
+ }
326
+
306
327
  /**
307
328
  * Adding Date Field
308
329
  *
@@ -183,7 +183,7 @@ const config /*: Config & { [key: string]: mixed }*/ = {
183
183
  SERVER_AUTH_TOKEN: null,
184
184
  LIVEQUERY_SERVER_URL: null,
185
185
  ENCRYPTED_KEY: null,
186
- VERSION: 'js' + "4.2.0-alpha.5",
186
+ VERSION: 'js' + "4.2.0-alpha.6",
187
187
  APPLICATION_ID: null,
188
188
  JAVASCRIPT_KEY: null,
189
189
  MASTER_KEY: null,
@@ -16,7 +16,7 @@ function _interopRequireDefault(obj) {
16
16
  * @flow
17
17
  */
18
18
  /*:: import type { PermissionsMap } from './ParseCLP';*/
19
- const FIELD_TYPES = ['String', 'Number', 'Boolean', 'Date', 'File', 'GeoPoint', 'Polygon', 'Array', 'Object', 'Pointer', 'Relation'];
19
+ const FIELD_TYPES = ['String', 'Number', 'Boolean', 'Bytes', 'Date', 'File', 'GeoPoint', 'Polygon', 'Array', 'Object', 'Pointer', 'Relation'];
20
20
  /*:: type FieldOptions = {
21
21
  required: boolean,
22
22
  defaultValue: mixed,
@@ -226,6 +226,14 @@ class ParseSchema {
226
226
  };
227
227
  }
228
228
  }
229
+ if (type === 'Bytes') {
230
+ if (options && options.defaultValue) {
231
+ fieldOptions.defaultValue = {
232
+ __type: 'Bytes',
233
+ base64: options.defaultValue
234
+ };
235
+ }
236
+ }
229
237
  this._fields[name] = fieldOptions;
230
238
  return this;
231
239
  }
@@ -285,6 +293,17 @@ class ParseSchema {
285
293
  return this.addField(name, 'Boolean', options);
286
294
  }
287
295
 
296
+ /**
297
+ * Adding Bytes Field
298
+ *
299
+ * @param {string} name Name of the field that will be created on Parse
300
+ * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
301
+ * @returns {Parse.Schema} Returns the schema, so you can chain this call.
302
+ */
303
+ addBytes(name /*: string*/, options /*: FieldOptions*/) {
304
+ return this.addField(name, 'Bytes', options);
305
+ }
306
+
288
307
  /**
289
308
  * Adding Date Field
290
309
  *
@@ -12,7 +12,7 @@ var config = {
12
12
  SERVER_AUTH_TOKEN: null,
13
13
  LIVEQUERY_SERVER_URL: null,
14
14
  ENCRYPTED_KEY: null,
15
- VERSION: 'js' + "4.2.0-alpha.5",
15
+ VERSION: 'js' + "4.2.0-alpha.6",
16
16
  APPLICATION_ID: null,
17
17
  JAVASCRIPT_KEY: null,
18
18
  MASTER_KEY: null,
@@ -8,7 +8,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
8
8
  var _CoreManager = _interopRequireDefault(require("./CoreManager"));
9
9
  var _ParseObject = _interopRequireDefault(require("./ParseObject"));
10
10
  var _ParseCLP = _interopRequireDefault(require("./ParseCLP"));
11
- var FIELD_TYPES = ['String', 'Number', 'Boolean', 'Date', 'File', 'GeoPoint', 'Polygon', 'Array', 'Object', 'Pointer', 'Relation'];
11
+ var FIELD_TYPES = ['String', 'Number', 'Boolean', 'Bytes', 'Date', 'File', 'GeoPoint', 'Polygon', 'Array', 'Object', 'Pointer', 'Relation'];
12
12
  var ParseSchema = function () {
13
13
  function ParseSchema(className) {
14
14
  (0, _classCallCheck2.default)(this, ParseSchema);
@@ -127,6 +127,14 @@ var ParseSchema = function () {
127
127
  };
128
128
  }
129
129
  }
130
+ if (type === 'Bytes') {
131
+ if (options && options.defaultValue) {
132
+ fieldOptions.defaultValue = {
133
+ __type: 'Bytes',
134
+ base64: options.defaultValue
135
+ };
136
+ }
137
+ }
130
138
  this._fields[name] = fieldOptions;
131
139
  return this;
132
140
  }
@@ -157,6 +165,11 @@ var ParseSchema = function () {
157
165
  value: function (name, options) {
158
166
  return this.addField(name, 'Boolean', options);
159
167
  }
168
+ }, {
169
+ key: "addBytes",
170
+ value: function (name, options) {
171
+ return this.addField(name, 'Bytes', options);
172
+ }
160
173
  }, {
161
174
  key: "addDate",
162
175
  value: function (name, options) {
@@ -187,7 +187,7 @@ var config /*: Config & { [key: string]: mixed }*/ = {
187
187
  SERVER_AUTH_TOKEN: null,
188
188
  LIVEQUERY_SERVER_URL: null,
189
189
  ENCRYPTED_KEY: null,
190
- VERSION: 'js' + "4.2.0-alpha.5",
190
+ VERSION: 'js' + "4.2.0-alpha.6",
191
191
  APPLICATION_ID: null,
192
192
  JAVASCRIPT_KEY: null,
193
193
  MASTER_KEY: null,
@@ -17,7 +17,7 @@ var _ParseCLP = _interopRequireDefault(require("./ParseCLP"));
17
17
  * @flow
18
18
  */
19
19
  /*:: import type { PermissionsMap } from './ParseCLP';*/
20
- var FIELD_TYPES = ['String', 'Number', 'Boolean', 'Date', 'File', 'GeoPoint', 'Polygon', 'Array', 'Object', 'Pointer', 'Relation'];
20
+ var FIELD_TYPES = ['String', 'Number', 'Boolean', 'Bytes', 'Date', 'File', 'GeoPoint', 'Polygon', 'Array', 'Object', 'Pointer', 'Relation'];
21
21
  /*:: type FieldOptions = {
22
22
  required: boolean,
23
23
  defaultValue: mixed,
@@ -236,6 +236,14 @@ var ParseSchema = /*#__PURE__*/function () {
236
236
  };
237
237
  }
238
238
  }
239
+ if (type === 'Bytes') {
240
+ if (options && options.defaultValue) {
241
+ fieldOptions.defaultValue = {
242
+ __type: 'Bytes',
243
+ base64: options.defaultValue
244
+ };
245
+ }
246
+ }
239
247
  this._fields[name] = fieldOptions;
240
248
  return this;
241
249
  }
@@ -303,6 +311,19 @@ var ParseSchema = /*#__PURE__*/function () {
303
311
  return this.addField(name, 'Boolean', options);
304
312
  }
305
313
 
314
+ /**
315
+ * Adding Bytes Field
316
+ *
317
+ * @param {string} name Name of the field that will be created on Parse
318
+ * @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
319
+ * @returns {Parse.Schema} Returns the schema, so you can chain this call.
320
+ */
321
+ }, {
322
+ key: "addBytes",
323
+ value: function (name /*: string*/, options /*: FieldOptions*/) {
324
+ return this.addField(name, 'Bytes', options);
325
+ }
326
+
306
327
  /**
307
328
  * Adding Date Field
308
329
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parse",
3
- "version": "4.2.0-alpha.5",
3
+ "version": "4.2.0-alpha.6",
4
4
  "description": "Parse JavaScript SDK",
5
5
  "homepage": "https://parseplatform.org",
6
6
  "keywords": [