parse 3.4.3-alpha.1 → 3.4.3-alpha.2

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.
@@ -224,7 +224,7 @@ var config
224
224
  SERVER_AUTH_TOKEN: null,
225
225
  LIVEQUERY_SERVER_URL: null,
226
226
  ENCRYPTED_KEY: null,
227
- VERSION: 'js' + "3.4.3-alpha.1",
227
+ VERSION: 'js' + "3.4.3-alpha.2",
228
228
  APPLICATION_ID: null,
229
229
  JAVASCRIPT_KEY: null,
230
230
  MASTER_KEY: null,
@@ -152,6 +152,8 @@ var ParseRole = /*#__PURE__*/function (_ParseObject) {
152
152
  )
153
153
  /*: ParseObject | boolean*/
154
154
  {
155
+ this._validateName(name);
156
+
155
157
  return this.set('name', name, options);
156
158
  }
157
159
  /**
@@ -192,6 +194,17 @@ var ParseRole = /*#__PURE__*/function (_ParseObject) {
192
194
  {
193
195
  return this.relation('roles');
194
196
  }
197
+ }, {
198
+ key: "_validateName",
199
+ value: function (newName) {
200
+ if (typeof newName !== 'string') {
201
+ throw new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name must be a String.");
202
+ }
203
+
204
+ if (!/^[0-9a-zA-Z\-_ ]+$/.test(newName)) {
205
+ throw new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name can be only contain alphanumeric characters, _, " + '-, and spaces.');
206
+ }
207
+ }
195
208
  }, {
196
209
  key: "validate",
197
210
  value: function (attrs
@@ -217,12 +230,10 @@ var ParseRole = /*#__PURE__*/function (_ParseObject) {
217
230
  return new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name can only be set before it has been saved.");
218
231
  }
219
232
 
220
- if (typeof newName !== 'string') {
221
- return new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name must be a String.");
222
- }
223
-
224
- if (!/^[0-9a-zA-Z\-_ ]+$/.test(newName)) {
225
- return new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name can be only contain alphanumeric characters, _, " + '-, and spaces.');
233
+ try {
234
+ this._validateName(newName);
235
+ } catch (e) {
236
+ return e;
226
237
  }
227
238
  }
228
239
 
@@ -1280,7 +1280,7 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
1280
1280
  * Request an email verification.
1281
1281
  *
1282
1282
  * @param {string} email The email address associated with the user that
1283
- * forgot their password.
1283
+ * needs to verify their email.
1284
1284
  * @param {object} options
1285
1285
  * @static
1286
1286
  * @returns {Promise}
@@ -217,7 +217,7 @@ const config
217
217
  SERVER_AUTH_TOKEN: null,
218
218
  LIVEQUERY_SERVER_URL: null,
219
219
  ENCRYPTED_KEY: null,
220
- VERSION: 'js' + "3.4.3-alpha.1",
220
+ VERSION: 'js' + "3.4.3-alpha.2",
221
221
  APPLICATION_ID: null,
222
222
  JAVASCRIPT_KEY: null,
223
223
  MASTER_KEY: null,
@@ -105,6 +105,8 @@ class ParseRole extends _ParseObject.default {
105
105
  )
106
106
  /*: ParseObject | boolean*/
107
107
  {
108
+ this._validateName(name);
109
+
108
110
  return this.set('name', name, options);
109
111
  }
110
112
  /**
@@ -144,6 +146,16 @@ class ParseRole extends _ParseObject.default {
144
146
  return this.relation('roles');
145
147
  }
146
148
 
149
+ _validateName(newName) {
150
+ if (typeof newName !== 'string') {
151
+ throw new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name must be a String.");
152
+ }
153
+
154
+ if (!/^[0-9a-zA-Z\-_ ]+$/.test(newName)) {
155
+ throw new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name can be only contain alphanumeric characters, _, " + '-, and spaces.');
156
+ }
157
+ }
158
+
147
159
  validate(attrs
148
160
  /*: AttributeMap*/
149
161
  , options
@@ -167,12 +179,10 @@ class ParseRole extends _ParseObject.default {
167
179
  return new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name can only be set before it has been saved.");
168
180
  }
169
181
 
170
- if (typeof newName !== 'string') {
171
- return new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name must be a String.");
172
- }
173
-
174
- if (!/^[0-9a-zA-Z\-_ ]+$/.test(newName)) {
175
- return new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name can be only contain alphanumeric characters, _, " + '-, and spaces.');
182
+ try {
183
+ this._validateName(newName);
184
+ } catch (e) {
185
+ return e;
176
186
  }
177
187
  }
178
188
 
@@ -1012,7 +1012,7 @@ class ParseUser extends _ParseObject.default {
1012
1012
  * Request an email verification.
1013
1013
  *
1014
1014
  * @param {string} email The email address associated with the user that
1015
- * forgot their password.
1015
+ * needs to verify their email.
1016
1016
  * @param {object} options
1017
1017
  * @static
1018
1018
  * @returns {Promise}
@@ -8,7 +8,7 @@ var config = {
8
8
  SERVER_AUTH_TOKEN: null,
9
9
  LIVEQUERY_SERVER_URL: null,
10
10
  ENCRYPTED_KEY: null,
11
- VERSION: 'js' + "3.4.3-alpha.1",
11
+ VERSION: 'js' + "3.4.3-alpha.2",
12
12
  APPLICATION_ID: null,
13
13
  JAVASCRIPT_KEY: null,
14
14
  MASTER_KEY: null,
@@ -88,6 +88,8 @@ var ParseRole = function (_ParseObject) {
88
88
  }, {
89
89
  key: "setName",
90
90
  value: function (name, options) {
91
+ this._validateName(name);
92
+
91
93
  return this.set('name', name, options);
92
94
  }
93
95
  }, {
@@ -100,6 +102,17 @@ var ParseRole = function (_ParseObject) {
100
102
  value: function () {
101
103
  return this.relation('roles');
102
104
  }
105
+ }, {
106
+ key: "_validateName",
107
+ value: function (newName) {
108
+ if (typeof newName !== 'string') {
109
+ throw new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name must be a String.");
110
+ }
111
+
112
+ if (!/^[0-9a-zA-Z\-_ ]+$/.test(newName)) {
113
+ throw new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name can be only contain alphanumeric characters, _, " + '-, and spaces.');
114
+ }
115
+ }
103
116
  }, {
104
117
  key: "validate",
105
118
  value: function (attrs, options) {
@@ -116,12 +129,10 @@ var ParseRole = function (_ParseObject) {
116
129
  return new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name can only be set before it has been saved.");
117
130
  }
118
131
 
119
- if (typeof newName !== 'string') {
120
- return new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name must be a String.");
121
- }
122
-
123
- if (!/^[0-9a-zA-Z\-_ ]+$/.test(newName)) {
124
- return new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name can be only contain alphanumeric characters, _, " + '-, and spaces.');
132
+ try {
133
+ this._validateName(newName);
134
+ } catch (e) {
135
+ return e;
125
136
  }
126
137
  }
127
138
 
@@ -224,7 +224,7 @@ var config
224
224
  SERVER_AUTH_TOKEN: null,
225
225
  LIVEQUERY_SERVER_URL: null,
226
226
  ENCRYPTED_KEY: null,
227
- VERSION: 'js' + "3.4.3-alpha.1",
227
+ VERSION: 'js' + "3.4.3-alpha.2",
228
228
  APPLICATION_ID: null,
229
229
  JAVASCRIPT_KEY: null,
230
230
  MASTER_KEY: null,
@@ -152,6 +152,8 @@ var ParseRole = /*#__PURE__*/function (_ParseObject) {
152
152
  )
153
153
  /*: ParseObject | boolean*/
154
154
  {
155
+ this._validateName(name);
156
+
155
157
  return this.set('name', name, options);
156
158
  }
157
159
  /**
@@ -192,6 +194,17 @@ var ParseRole = /*#__PURE__*/function (_ParseObject) {
192
194
  {
193
195
  return this.relation('roles');
194
196
  }
197
+ }, {
198
+ key: "_validateName",
199
+ value: function (newName) {
200
+ if (typeof newName !== 'string') {
201
+ throw new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name must be a String.");
202
+ }
203
+
204
+ if (!/^[0-9a-zA-Z\-_ ]+$/.test(newName)) {
205
+ throw new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name can be only contain alphanumeric characters, _, " + '-, and spaces.');
206
+ }
207
+ }
195
208
  }, {
196
209
  key: "validate",
197
210
  value: function (attrs
@@ -217,12 +230,10 @@ var ParseRole = /*#__PURE__*/function (_ParseObject) {
217
230
  return new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name can only be set before it has been saved.");
218
231
  }
219
232
 
220
- if (typeof newName !== 'string') {
221
- return new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name must be a String.");
222
- }
223
-
224
- if (!/^[0-9a-zA-Z\-_ ]+$/.test(newName)) {
225
- return new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name can be only contain alphanumeric characters, _, " + '-, and spaces.');
233
+ try {
234
+ this._validateName(newName);
235
+ } catch (e) {
236
+ return e;
226
237
  }
227
238
  }
228
239
 
@@ -1280,7 +1280,7 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
1280
1280
  * Request an email verification.
1281
1281
  *
1282
1282
  * @param {string} email The email address associated with the user that
1283
- * forgot their password.
1283
+ * needs to verify their email.
1284
1284
  * @param {object} options
1285
1285
  * @static
1286
1286
  * @returns {Promise}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parse",
3
- "version": "3.4.3-alpha.1",
3
+ "version": "3.4.3-alpha.2",
4
4
  "description": "The Parse JavaScript SDK",
5
5
  "homepage": "https://parseplatform.org/",
6
6
  "keywords": [
@@ -34,7 +34,7 @@
34
34
  "idb-keyval": "6.0.3",
35
35
  "react-native-crypto-js": "1.0.0",
36
36
  "uuid": "3.4.0",
37
- "ws": "7.5.1",
37
+ "ws": "8.6.0",
38
38
  "xmlhttprequest": "1.8.0"
39
39
  },
40
40
  "devDependencies": {