Skip to content

Commit 302dd45

Browse files
fix missing quotes for param checks
1 parent 8820496 commit 302dd45

File tree

7 files changed

+243
-243
lines changed

7 files changed

+243
-243
lines changed

lib/services/account.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,22 @@ class Account extends Service {
6060
6161
*/
6262
async updateEmail(email, password) {
63-
if (typeof email === undefined) {
63+
if (typeof email === 'undefined') {
6464
throw new AppwriteException('Missing required parameter: "email"');
6565
}
6666

67-
if (typeof password === undefined) {
67+
if (typeof password === 'undefined') {
6868
throw new AppwriteException('Missing required parameter: "password"');
6969
}
7070

7171
let path = '/account/email';
7272
let payload = {};
7373

74-
if (typeof email !== undefined) {
74+
if (typeof email !== 'undefined') {
7575
payload['email'] = email;
7676
}
7777

78-
if (typeof password !== undefined) {
78+
if (typeof password !== 'undefined') {
7979
payload['password'] = password;
8080
}
8181

@@ -114,14 +114,14 @@ class Account extends Service {
114114
115115
*/
116116
async updateName(name) {
117-
if (typeof name === undefined) {
117+
if (typeof name === 'undefined') {
118118
throw new AppwriteException('Missing required parameter: "name"');
119119
}
120120

121121
let path = '/account/name';
122122
let payload = {};
123123

124-
if (typeof name !== undefined) {
124+
if (typeof name !== 'undefined') {
125125
payload['name'] = name;
126126
}
127127

@@ -144,18 +144,18 @@ class Account extends Service {
144144
145145
*/
146146
async updatePassword(password, oldPassword) {
147-
if (typeof password === undefined) {
147+
if (typeof password === 'undefined') {
148148
throw new AppwriteException('Missing required parameter: "password"');
149149
}
150150

151151
let path = '/account/password';
152152
let payload = {};
153153

154-
if (typeof password !== undefined) {
154+
if (typeof password !== 'undefined') {
155155
payload['password'] = password;
156156
}
157157

158-
if (typeof oldPassword !== undefined) {
158+
if (typeof oldPassword !== 'undefined') {
159159
payload['oldPassword'] = oldPassword;
160160
}
161161

@@ -194,14 +194,14 @@ class Account extends Service {
194194
195195
*/
196196
async updatePrefs(prefs) {
197-
if (typeof prefs === undefined) {
197+
if (typeof prefs === 'undefined') {
198198
throw new AppwriteException('Missing required parameter: "prefs"');
199199
}
200200

201201
let path = '/account/prefs';
202202
let payload = {};
203203

204-
if (typeof prefs !== undefined) {
204+
if (typeof prefs !== 'undefined') {
205205
payload['prefs'] = prefs;
206206
}
207207

@@ -229,22 +229,22 @@ class Account extends Service {
229229
230230
*/
231231
async createRecovery(email, url) {
232-
if (typeof email === undefined) {
232+
if (typeof email === 'undefined') {
233233
throw new AppwriteException('Missing required parameter: "email"');
234234
}
235235

236-
if (typeof url === undefined) {
236+
if (typeof url === 'undefined') {
237237
throw new AppwriteException('Missing required parameter: "url"');
238238
}
239239

240240
let path = '/account/recovery';
241241
let payload = {};
242242

243-
if (typeof email !== undefined) {
243+
if (typeof email !== 'undefined') {
244244
payload['email'] = email;
245245
}
246246

247-
if (typeof url !== undefined) {
247+
if (typeof url !== 'undefined') {
248248
payload['url'] = url;
249249
}
250250

@@ -275,38 +275,38 @@ class Account extends Service {
275275
276276
*/
277277
async updateRecovery(userId, secret, password, passwordAgain) {
278-
if (typeof userId === undefined) {
278+
if (typeof userId === 'undefined') {
279279
throw new AppwriteException('Missing required parameter: "userId"');
280280
}
281281

282-
if (typeof secret === undefined) {
282+
if (typeof secret === 'undefined') {
283283
throw new AppwriteException('Missing required parameter: "secret"');
284284
}
285285

286-
if (typeof password === undefined) {
286+
if (typeof password === 'undefined') {
287287
throw new AppwriteException('Missing required parameter: "password"');
288288
}
289289

290-
if (typeof passwordAgain === undefined) {
290+
if (typeof passwordAgain === 'undefined') {
291291
throw new AppwriteException('Missing required parameter: "passwordAgain"');
292292
}
293293

294294
let path = '/account/recovery';
295295
let payload = {};
296296

297-
if (typeof userId !== undefined) {
297+
if (typeof userId !== 'undefined') {
298298
payload['userId'] = userId;
299299
}
300300

301-
if (typeof secret !== undefined) {
301+
if (typeof secret !== 'undefined') {
302302
payload['secret'] = secret;
303303
}
304304

305-
if (typeof password !== undefined) {
305+
if (typeof password !== 'undefined') {
306306
payload['password'] = password;
307307
}
308308

309-
if (typeof passwordAgain !== undefined) {
309+
if (typeof passwordAgain !== 'undefined') {
310310
payload['passwordAgain'] = passwordAgain;
311311
}
312312

@@ -366,7 +366,7 @@ class Account extends Service {
366366
367367
*/
368368
async deleteSession(sessionId) {
369-
if (typeof sessionId === undefined) {
369+
if (typeof sessionId === 'undefined') {
370370
throw new AppwriteException('Missing required parameter: "sessionId"');
371371
}
372372

@@ -403,14 +403,14 @@ class Account extends Service {
403403
404404
*/
405405
async createVerification(url) {
406-
if (typeof url === undefined) {
406+
if (typeof url === 'undefined') {
407407
throw new AppwriteException('Missing required parameter: "url"');
408408
}
409409

410410
let path = '/account/verification';
411411
let payload = {};
412412

413-
if (typeof url !== undefined) {
413+
if (typeof url !== 'undefined') {
414414
payload['url'] = url;
415415
}
416416

@@ -434,22 +434,22 @@ class Account extends Service {
434434
435435
*/
436436
async updateVerification(userId, secret) {
437-
if (typeof userId === undefined) {
437+
if (typeof userId === 'undefined') {
438438
throw new AppwriteException('Missing required parameter: "userId"');
439439
}
440440

441-
if (typeof secret === undefined) {
441+
if (typeof secret === 'undefined') {
442442
throw new AppwriteException('Missing required parameter: "secret"');
443443
}
444444

445445
let path = '/account/verification';
446446
let payload = {};
447447

448-
if (typeof userId !== undefined) {
448+
if (typeof userId !== 'undefined') {
449449
payload['userId'] = userId;
450450
}
451451

452-
if (typeof secret !== undefined) {
452+
if (typeof secret !== 'undefined') {
453453
payload['secret'] = secret;
454454
}
455455

lib/services/avatars.js

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@ class Avatars extends Service {
2020
2121
*/
2222
async getBrowser(code, width, height, quality) {
23-
if (typeof code === undefined) {
23+
if (typeof code === 'undefined') {
2424
throw new AppwriteException('Missing required parameter: "code"');
2525
}
2626

2727
let path = '/avatars/browsers/{code}'.replace('{code}', code);
2828
let payload = {};
2929

30-
if (typeof width !== undefined) {
30+
if (typeof width !== 'undefined') {
3131
payload['width'] = width;
3232
}
3333

34-
if (typeof height !== undefined) {
34+
if (typeof height !== 'undefined') {
3535
payload['height'] = height;
3636
}
3737

38-
if (typeof quality !== undefined) {
38+
if (typeof quality !== 'undefined') {
3939
payload['quality'] = quality;
4040
}
4141

@@ -60,22 +60,22 @@ class Avatars extends Service {
6060
6161
*/
6262
async getCreditCard(code, width, height, quality) {
63-
if (typeof code === undefined) {
63+
if (typeof code === 'undefined') {
6464
throw new AppwriteException('Missing required parameter: "code"');
6565
}
6666

6767
let path = '/avatars/credit-cards/{code}'.replace('{code}', code);
6868
let payload = {};
6969

70-
if (typeof width !== undefined) {
70+
if (typeof width !== 'undefined') {
7171
payload['width'] = width;
7272
}
7373

74-
if (typeof height !== undefined) {
74+
if (typeof height !== 'undefined') {
7575
payload['height'] = height;
7676
}
7777

78-
if (typeof quality !== undefined) {
78+
if (typeof quality !== 'undefined') {
7979
payload['quality'] = quality;
8080
}
8181

@@ -97,14 +97,14 @@ class Avatars extends Service {
9797
9898
*/
9999
async getFavicon(url) {
100-
if (typeof url === undefined) {
100+
if (typeof url === 'undefined') {
101101
throw new AppwriteException('Missing required parameter: "url"');
102102
}
103103

104104
let path = '/avatars/favicon';
105105
let payload = {};
106106

107-
if (typeof url !== undefined) {
107+
if (typeof url !== 'undefined') {
108108
payload['url'] = url;
109109
}
110110

@@ -129,22 +129,22 @@ class Avatars extends Service {
129129
130130
*/
131131
async getFlag(code, width, height, quality) {
132-
if (typeof code === undefined) {
132+
if (typeof code === 'undefined') {
133133
throw new AppwriteException('Missing required parameter: "code"');
134134
}
135135

136136
let path = '/avatars/flags/{code}'.replace('{code}', code);
137137
let payload = {};
138138

139-
if (typeof width !== undefined) {
139+
if (typeof width !== 'undefined') {
140140
payload['width'] = width;
141141
}
142142

143-
if (typeof height !== undefined) {
143+
if (typeof height !== 'undefined') {
144144
payload['height'] = height;
145145
}
146146

147-
if (typeof quality !== undefined) {
147+
if (typeof quality !== 'undefined') {
148148
payload['quality'] = quality;
149149
}
150150

@@ -169,22 +169,22 @@ class Avatars extends Service {
169169
170170
*/
171171
async getImage(url, width, height) {
172-
if (typeof url === undefined) {
172+
if (typeof url === 'undefined') {
173173
throw new AppwriteException('Missing required parameter: "url"');
174174
}
175175

176176
let path = '/avatars/image';
177177
let payload = {};
178178

179-
if (typeof url !== undefined) {
179+
if (typeof url !== 'undefined') {
180180
payload['url'] = url;
181181
}
182182

183-
if (typeof width !== undefined) {
183+
if (typeof width !== 'undefined') {
184184
payload['width'] = width;
185185
}
186186

187-
if (typeof height !== undefined) {
187+
if (typeof height !== 'undefined') {
188188
payload['height'] = height;
189189
}
190190

@@ -220,23 +220,23 @@ class Avatars extends Service {
220220
let path = '/avatars/initials';
221221
let payload = {};
222222

223-
if (typeof name !== undefined) {
223+
if (typeof name !== 'undefined') {
224224
payload['name'] = name;
225225
}
226226

227-
if (typeof width !== undefined) {
227+
if (typeof width !== 'undefined') {
228228
payload['width'] = width;
229229
}
230230

231-
if (typeof height !== undefined) {
231+
if (typeof height !== 'undefined') {
232232
payload['height'] = height;
233233
}
234234

235-
if (typeof color !== undefined) {
235+
if (typeof color !== 'undefined') {
236236
payload['color'] = color;
237237
}
238238

239-
if (typeof background !== undefined) {
239+
if (typeof background !== 'undefined') {
240240
payload['background'] = background;
241241
}
242242

@@ -260,26 +260,26 @@ class Avatars extends Service {
260260
261261
*/
262262
async getQR(text, size, margin, download) {
263-
if (typeof text === undefined) {
263+
if (typeof text === 'undefined') {
264264
throw new AppwriteException('Missing required parameter: "text"');
265265
}
266266

267267
let path = '/avatars/qr';
268268
let payload = {};
269269

270-
if (typeof text !== undefined) {
270+
if (typeof text !== 'undefined') {
271271
payload['text'] = text;
272272
}
273273

274-
if (typeof size !== undefined) {
274+
if (typeof size !== 'undefined') {
275275
payload['size'] = size;
276276
}
277277

278-
if (typeof margin !== undefined) {
278+
if (typeof margin !== 'undefined') {
279279
payload['margin'] = margin;
280280
}
281281

282-
if (typeof download !== undefined) {
282+
if (typeof download !== 'undefined') {
283283
payload['download'] = download;
284284
}
285285

0 commit comments

Comments
 (0)