@selfcommunity/api-services 0.1.4 → 0.1.5

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.
Files changed (124) hide show
  1. package/lib/cjs/constants/Endpoints.js +497 -57
  2. package/lib/cjs/index.js +147 -10
  3. package/lib/cjs/services/category/index.js +317 -3
  4. package/lib/cjs/services/comment/index.js +269 -0
  5. package/lib/cjs/services/custom_adv/index.js +85 -0
  6. package/lib/cjs/services/custom_page/index.js +85 -0
  7. package/lib/cjs/services/data_portability/index.js +83 -0
  8. package/lib/cjs/services/dynamic_preference/index.js +85 -0
  9. package/lib/cjs/services/embed/index.js +198 -0
  10. package/lib/cjs/services/feed/index.js +125 -0
  11. package/lib/cjs/services/feed_object/index.js +660 -0
  12. package/lib/cjs/services/incubator/index.js +175 -0
  13. package/lib/cjs/services/insight/index.js +146 -0
  14. package/lib/cjs/services/legal_page/index.js +152 -0
  15. package/lib/cjs/services/locality/index.js +62 -0
  16. package/lib/cjs/services/loyalty/index.js +219 -0
  17. package/lib/cjs/services/media/index.js +175 -0
  18. package/lib/cjs/services/moderation/index.js +156 -0
  19. package/lib/cjs/services/notification/index.js +209 -0
  20. package/lib/cjs/services/private_message/index.js +236 -0
  21. package/lib/cjs/services/score/index.js +83 -0
  22. package/lib/cjs/services/sso/index.js +62 -0
  23. package/lib/cjs/services/suggestion/index.js +104 -0
  24. package/lib/cjs/services/tag/index.js +175 -0
  25. package/lib/cjs/services/user/index.js +995 -9
  26. package/lib/cjs/services/webhook/index.js +290 -0
  27. package/lib/cjs/utils/token.js +15 -0
  28. package/lib/esm/api-services/src/constants/Endpoints.d.ts.map +1 -1
  29. package/lib/esm/api-services/src/index.d.ts +26 -3
  30. package/lib/esm/api-services/src/index.d.ts.map +1 -1
  31. package/lib/esm/api-services/src/services/category/index.d.ts +42 -0
  32. package/lib/esm/api-services/src/services/category/index.d.ts.map +1 -1
  33. package/lib/esm/api-services/src/services/comment/index.d.ts +40 -0
  34. package/lib/esm/api-services/src/services/comment/index.d.ts.map +1 -0
  35. package/lib/esm/api-services/src/services/custom_adv/index.d.ts +16 -0
  36. package/lib/esm/api-services/src/services/custom_adv/index.d.ts.map +1 -0
  37. package/lib/esm/api-services/src/services/custom_page/index.d.ts +16 -0
  38. package/lib/esm/api-services/src/services/custom_page/index.d.ts.map +1 -0
  39. package/lib/esm/api-services/src/services/data_portability/index.d.ts +16 -0
  40. package/lib/esm/api-services/src/services/data_portability/index.d.ts.map +1 -0
  41. package/lib/esm/api-services/src/services/dynamic_preference/index.d.ts +16 -0
  42. package/lib/esm/api-services/src/services/dynamic_preference/index.d.ts.map +1 -0
  43. package/lib/esm/api-services/src/services/embed/index.d.ts +31 -0
  44. package/lib/esm/api-services/src/services/embed/index.d.ts.map +1 -0
  45. package/lib/esm/api-services/src/services/feed/index.d.ts +22 -0
  46. package/lib/esm/api-services/src/services/feed/index.d.ts.map +1 -0
  47. package/lib/esm/api-services/src/services/feed_object/index.d.ts +88 -0
  48. package/lib/esm/api-services/src/services/feed_object/index.d.ts.map +1 -0
  49. package/lib/esm/api-services/src/services/incubator/index.d.ts +28 -0
  50. package/lib/esm/api-services/src/services/incubator/index.d.ts.map +1 -0
  51. package/lib/esm/api-services/src/services/insight/index.d.ts +25 -0
  52. package/lib/esm/api-services/src/services/insight/index.d.ts.map +1 -0
  53. package/lib/esm/api-services/src/services/legal_page/index.d.ts +25 -0
  54. package/lib/esm/api-services/src/services/legal_page/index.d.ts.map +1 -0
  55. package/lib/esm/api-services/src/services/locality/index.d.ts +13 -0
  56. package/lib/esm/api-services/src/services/locality/index.d.ts.map +1 -0
  57. package/lib/esm/api-services/src/services/loyalty/index.d.ts +34 -0
  58. package/lib/esm/api-services/src/services/loyalty/index.d.ts.map +1 -0
  59. package/lib/esm/api-services/src/services/media/index.d.ts +28 -0
  60. package/lib/esm/api-services/src/services/media/index.d.ts.map +1 -0
  61. package/lib/esm/api-services/src/services/moderation/index.d.ts +25 -0
  62. package/lib/esm/api-services/src/services/moderation/index.d.ts.map +1 -0
  63. package/lib/esm/api-services/src/services/notification/index.d.ts +34 -0
  64. package/lib/esm/api-services/src/services/notification/index.d.ts.map +1 -0
  65. package/lib/esm/api-services/src/services/private_message/index.d.ts +37 -0
  66. package/lib/esm/api-services/src/services/private_message/index.d.ts.map +1 -0
  67. package/lib/esm/api-services/src/services/score/index.d.ts +16 -0
  68. package/lib/esm/api-services/src/services/score/index.d.ts.map +1 -0
  69. package/lib/esm/api-services/src/services/sso/index.d.ts +13 -0
  70. package/lib/esm/api-services/src/services/sso/index.d.ts.map +1 -0
  71. package/lib/esm/api-services/src/services/suggestion/index.d.ts +19 -0
  72. package/lib/esm/api-services/src/services/suggestion/index.d.ts.map +1 -0
  73. package/lib/esm/api-services/src/services/tag/index.d.ts +28 -0
  74. package/lib/esm/api-services/src/services/tag/index.d.ts.map +1 -0
  75. package/lib/esm/api-services/src/services/user/index.d.ts +132 -0
  76. package/lib/esm/api-services/src/services/user/index.d.ts.map +1 -1
  77. package/lib/esm/api-services/src/services/webhook/index.d.ts +43 -0
  78. package/lib/esm/api-services/src/services/webhook/index.d.ts.map +1 -0
  79. package/lib/esm/api-services/src/utils/token.d.ts +5 -0
  80. package/lib/esm/api-services/src/utils/token.d.ts.map +1 -1
  81. package/lib/esm/constants/Endpoints.js +497 -57
  82. package/lib/esm/index.js +147 -10
  83. package/lib/esm/services/category/index.js +317 -3
  84. package/lib/esm/services/comment/index.js +269 -0
  85. package/lib/esm/services/custom_adv/index.js +85 -0
  86. package/lib/esm/services/custom_page/index.js +85 -0
  87. package/lib/esm/services/data_portability/index.js +83 -0
  88. package/lib/esm/services/dynamic_preference/index.js +85 -0
  89. package/lib/esm/services/embed/index.js +198 -0
  90. package/lib/esm/services/feed/index.js +125 -0
  91. package/lib/esm/services/feed_object/index.js +660 -0
  92. package/lib/esm/services/incubator/index.js +175 -0
  93. package/lib/esm/services/insight/index.js +146 -0
  94. package/lib/esm/services/legal_page/index.js +152 -0
  95. package/lib/esm/services/locality/index.js +62 -0
  96. package/lib/esm/services/loyalty/index.js +219 -0
  97. package/lib/esm/services/media/index.js +175 -0
  98. package/lib/esm/services/moderation/index.js +156 -0
  99. package/lib/esm/services/notification/index.js +209 -0
  100. package/lib/esm/services/private_message/index.js +236 -0
  101. package/lib/esm/services/score/index.js +83 -0
  102. package/lib/esm/services/sso/index.js +62 -0
  103. package/lib/esm/services/suggestion/index.js +104 -0
  104. package/lib/esm/services/tag/index.js +175 -0
  105. package/lib/esm/services/user/index.js +995 -9
  106. package/lib/esm/services/webhook/index.js +290 -0
  107. package/lib/esm/utils/src/index.d.ts +8 -3
  108. package/lib/esm/utils/src/index.d.ts.map +1 -1
  109. package/lib/esm/utils/src/utils/browser.d.ts +9 -0
  110. package/lib/esm/utils/src/utils/browser.d.ts.map +1 -0
  111. package/lib/esm/utils/src/utils/logger.d.ts +11 -0
  112. package/lib/esm/utils/src/utils/logger.d.ts.map +1 -0
  113. package/lib/esm/utils/src/utils/object.d.ts +13 -0
  114. package/lib/esm/utils/src/utils/object.d.ts.map +1 -0
  115. package/lib/esm/utils/src/utils/string.d.ts +22 -0
  116. package/lib/esm/utils/src/utils/string.d.ts.map +1 -1
  117. package/lib/esm/utils/src/utils/url.d.ts +11 -0
  118. package/lib/esm/utils/src/utils/url.d.ts.map +1 -1
  119. package/lib/esm/utils/src/utils/websocket.d.ts +177 -0
  120. package/lib/esm/utils/src/utils/websocket.d.ts.map +1 -0
  121. package/lib/esm/utils/token.js +15 -0
  122. package/lib/umd/api-services.js +1 -1
  123. package/lib/umd/api-services.js.map +1 -1
  124. package/package.json +4 -4
@@ -27,6 +27,57 @@ class UserApiClient {
27
27
  });
28
28
  }
29
29
 
30
+ static getHiddenUsers() {
31
+ return _client.default.request({
32
+ url: _Endpoints.default.ListHiddenUsers.url(),
33
+ method: _Endpoints.default.ListHiddenUsers.method
34
+ }).then(res => {
35
+ if (res.status >= 300) {
36
+ console.log(`Unable to retrieve hidden users (Response code: ${res.status}).`);
37
+ return Promise.reject(res);
38
+ }
39
+
40
+ return Promise.resolve(res.data);
41
+ }).catch(error => {
42
+ console.log('Unable to retrieve hidden users.');
43
+ return Promise.reject(error);
44
+ });
45
+ }
46
+
47
+ static userAutocomplete() {
48
+ return _client.default.request({
49
+ url: _Endpoints.default.UserAutocomplete.url(),
50
+ method: _Endpoints.default.UserAutocomplete.method
51
+ }).then(res => {
52
+ if (res.status >= 300) {
53
+ console.log(`Unable to retrieve users (Response code: ${res.status}).`);
54
+ return Promise.reject(res);
55
+ }
56
+
57
+ return Promise.resolve(res.data);
58
+ }).catch(error => {
59
+ console.log('Unable to retrieve users.');
60
+ return Promise.reject(error);
61
+ });
62
+ }
63
+
64
+ static userSearch() {
65
+ return _client.default.request({
66
+ url: _Endpoints.default.UserSearch.url(),
67
+ method: _Endpoints.default.UserSearch.method
68
+ }).then(res => {
69
+ if (res.status >= 300) {
70
+ console.log(`Unable to retrieve users (Response code: ${res.status}).`);
71
+ return Promise.reject(res);
72
+ }
73
+
74
+ return Promise.resolve(res.data);
75
+ }).catch(error => {
76
+ console.log('Unable to retrieve users .');
77
+ return Promise.reject(error);
78
+ });
79
+ }
80
+
30
81
  static getSpecificUser(id) {
31
82
  return _client.default.request({
32
83
  url: _Endpoints.default.User.url({
@@ -46,6 +97,177 @@ class UserApiClient {
46
97
  });
47
98
  }
48
99
 
100
+ static getUserCounters(id) {
101
+ return _client.default.request({
102
+ url: _Endpoints.default.UserCounters.url({
103
+ id
104
+ }),
105
+ method: _Endpoints.default.UserCounters.method
106
+ }).then(res => {
107
+ if (res.status >= 300) {
108
+ console.log(`Unable to retrieve counters (Response code: ${res.status}).`);
109
+ return Promise.reject(res);
110
+ }
111
+
112
+ return Promise.resolve(res.data);
113
+ }).catch(error => {
114
+ console.log('Unable to retrieve counters.');
115
+ return Promise.reject(error);
116
+ });
117
+ }
118
+
119
+ static userUpdate(id) {
120
+ return _client.default.request({
121
+ url: _Endpoints.default.UserUpdate.url({
122
+ id
123
+ }),
124
+ method: _Endpoints.default.UserUpdate.method
125
+ }).then(res => {
126
+ if (res.status >= 300) {
127
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
128
+ return Promise.reject(res);
129
+ }
130
+
131
+ return Promise.resolve(res.data);
132
+ }).catch(error => {
133
+ console.log('Unable to perform action.');
134
+ return Promise.reject(error);
135
+ });
136
+ }
137
+
138
+ static userPatch(id) {
139
+ return _client.default.request({
140
+ url: _Endpoints.default.UserPatch.url({
141
+ id
142
+ }),
143
+ method: _Endpoints.default.UserPatch.method
144
+ }).then(res => {
145
+ if (res.status >= 300) {
146
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
147
+ return Promise.reject(res);
148
+ }
149
+
150
+ return Promise.resolve(res.data);
151
+ }).catch(error => {
152
+ console.log('Unable to perform action.');
153
+ return Promise.reject(error);
154
+ });
155
+ }
156
+
157
+ static userDelete(id) {
158
+ return _client.default.request({
159
+ url: _Endpoints.default.UserDelete.url({
160
+ id
161
+ }),
162
+ method: _Endpoints.default.UserDelete.method
163
+ }).then(res => {
164
+ if (res.status >= 300) {
165
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
166
+ return Promise.reject(res);
167
+ }
168
+
169
+ return Promise.resolve(res.data);
170
+ }).catch(error => {
171
+ console.log('Unable to perform action.');
172
+ return Promise.reject(error);
173
+ });
174
+ }
175
+
176
+ static changeUserMail(id) {
177
+ return _client.default.request({
178
+ url: _Endpoints.default.ChangeUserMail.url({
179
+ id
180
+ }),
181
+ method: _Endpoints.default.ChangeUserMail.method
182
+ }).then(res => {
183
+ if (res.status >= 300) {
184
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
185
+ return Promise.reject(res);
186
+ }
187
+
188
+ return Promise.resolve(res.data);
189
+ }).catch(error => {
190
+ console.log('Unable to perform action.');
191
+ return Promise.reject(error);
192
+ });
193
+ }
194
+
195
+ static confirmChangeUserMail(id) {
196
+ return _client.default.request({
197
+ url: _Endpoints.default.ConfirmUserChangeMail.url({
198
+ id
199
+ }),
200
+ method: _Endpoints.default.ConfirmUserChangeMail.method
201
+ }).then(res => {
202
+ if (res.status >= 300) {
203
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
204
+ return Promise.reject(res);
205
+ }
206
+
207
+ return Promise.resolve(res.data);
208
+ }).catch(error => {
209
+ console.log('Unable to perform action.');
210
+ return Promise.reject(error);
211
+ });
212
+ }
213
+
214
+ static changeUserPassword(id) {
215
+ return _client.default.request({
216
+ url: _Endpoints.default.ChangeUserPassword.url({
217
+ id
218
+ }),
219
+ method: _Endpoints.default.ChangeUserPassword.method
220
+ }).then(res => {
221
+ if (res.status >= 300) {
222
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
223
+ return Promise.reject(res);
224
+ }
225
+
226
+ return Promise.resolve(res.data);
227
+ }).catch(error => {
228
+ console.log('Unable to perform action.');
229
+ return Promise.reject(error);
230
+ });
231
+ }
232
+
233
+ static userSettings(id) {
234
+ return _client.default.request({
235
+ url: _Endpoints.default.UserSettings.url({
236
+ id
237
+ }),
238
+ method: _Endpoints.default.UserSettings.method
239
+ }).then(res => {
240
+ if (res.status >= 300) {
241
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
242
+ return Promise.reject(res);
243
+ }
244
+
245
+ return Promise.resolve(res.data);
246
+ }).catch(error => {
247
+ console.log('Unable to perform action.');
248
+ return Promise.reject(error);
249
+ });
250
+ }
251
+
252
+ static userSettingsPatch(id) {
253
+ return _client.default.request({
254
+ url: _Endpoints.default.UserSettingsPatch.url({
255
+ id
256
+ }),
257
+ method: _Endpoints.default.UserSettingsPatch.method
258
+ }).then(res => {
259
+ if (res.status >= 300) {
260
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
261
+ return Promise.reject(res);
262
+ }
263
+
264
+ return Promise.resolve(res.data);
265
+ }).catch(error => {
266
+ console.log('Unable to perform action.');
267
+ return Promise.reject(error);
268
+ });
269
+ }
270
+
49
271
  static getCurrentUser() {
50
272
  return _client.default.request({
51
273
  url: _Endpoints.default.Me.url(),
@@ -63,21 +285,785 @@ class UserApiClient {
63
285
  });
64
286
  }
65
287
 
66
- }
288
+ static getCurrentUserAvatar() {
289
+ return _client.default.request({
290
+ url: _Endpoints.default.MyAvatar.url({}),
291
+ method: _Endpoints.default.MyAvatar.method
292
+ }).then(res => {
293
+ if (res.status >= 300) {
294
+ console.log(`Unable to retrieve user avatar (Response code: ${res.status}).`);
295
+ return Promise.reject(res);
296
+ }
67
297
 
68
- exports.UserApiClient = UserApiClient;
298
+ return Promise.resolve(res.data);
299
+ }).catch(error => {
300
+ console.log('Unable to retrieve user avatar.');
301
+ return Promise.reject(error);
302
+ });
303
+ }
69
304
 
70
- class UserService {
71
- static async getAllUsers() {
72
- return UserApiClient.getAllUsers();
305
+ static getCurrentUserPermission() {
306
+ return _client.default.request({
307
+ url: _Endpoints.default.Permission.url({}),
308
+ method: _Endpoints.default.Permission.method
309
+ }).then(res => {
310
+ if (res.status >= 300) {
311
+ console.log(`Unable to retrieve user permissions (Response code: ${res.status}).`);
312
+ return Promise.reject(res);
313
+ }
314
+
315
+ return Promise.resolve(res.data);
316
+ }).catch(error => {
317
+ console.log('Unable to retrieve user permissions.');
318
+ return Promise.reject(error);
319
+ });
73
320
  }
74
321
 
75
- static async getSpecificUser(id) {
76
- return UserApiClient.getSpecificUser(id);
322
+ static getCurrentUserPlatform() {
323
+ return _client.default.request({
324
+ url: _Endpoints.default.Platform.url({}),
325
+ method: _Endpoints.default.Platform.method
326
+ }).then(res => {
327
+ if (res.status >= 300) {
328
+ console.log(`Unable to retrieve platform (Response code: ${res.status}).`);
329
+ return Promise.reject(res);
330
+ }
331
+
332
+ return Promise.resolve(res.data);
333
+ }).catch(error => {
334
+ console.log('Unable to retrieve platform.');
335
+ return Promise.reject(error);
336
+ });
77
337
  }
78
338
 
79
- static async getCurrentUser() {
80
- return UserApiClient.getCurrentUser();
339
+ static getUserFollowedCategories(id) {
340
+ return _client.default.request({
341
+ url: _Endpoints.default.FollowedCategories.url({
342
+ id
343
+ }),
344
+ method: _Endpoints.default.FollowedCategories.method
345
+ }).then(res => {
346
+ if (res.status >= 300) {
347
+ console.log(`Unable to retrieve categories followed (Response code: ${res.status}).`);
348
+ return Promise.reject(res);
349
+ }
350
+
351
+ return Promise.resolve(res.data);
352
+ }).catch(error => {
353
+ console.log('Unable to retrieve categories followed.');
354
+ return Promise.reject(error);
355
+ });
356
+ }
357
+
358
+ static getUserFeed(id) {
359
+ return _client.default.request({
360
+ url: _Endpoints.default.UserFeed.url({
361
+ id
362
+ }),
363
+ method: _Endpoints.default.UserFeed.method
364
+ }).then(res => {
365
+ if (res.status >= 300) {
366
+ console.log(`Unable to retrieve user feed (Response code: ${res.status}).`);
367
+ return Promise.reject(res);
368
+ }
369
+
370
+ return Promise.resolve(res.data);
371
+ }).catch(error => {
372
+ console.log('Unable to retrieve user feed.');
373
+ return Promise.reject(error);
374
+ });
375
+ }
376
+
377
+ static getUserFollowers(id) {
378
+ return _client.default.request({
379
+ url: _Endpoints.default.UserFollowers.url({
380
+ id
381
+ }),
382
+ method: _Endpoints.default.UserFollowers.method
383
+ }).then(res => {
384
+ if (res.status >= 300) {
385
+ console.log(`Unable to retrieve user followers (Response code: ${res.status}).`);
386
+ return Promise.reject(res);
387
+ }
388
+
389
+ return Promise.resolve(res.data);
390
+ }).catch(error => {
391
+ console.log('Unable to retrieve user followers.');
392
+ return Promise.reject(error);
393
+ });
394
+ }
395
+
396
+ static getUserFollowed(id) {
397
+ return _client.default.request({
398
+ url: _Endpoints.default.UserFollowed.url({
399
+ id
400
+ }),
401
+ method: _Endpoints.default.UserFollowed.method
402
+ }).then(res => {
403
+ if (res.status >= 300) {
404
+ console.log(`Unable to retrieve user followings (Response code: ${res.status}).`);
405
+ return Promise.reject(res);
406
+ }
407
+
408
+ return Promise.resolve(res.data);
409
+ }).catch(error => {
410
+ console.log('Unable to retrieve user followings.');
411
+ return Promise.reject(error);
412
+ });
413
+ }
414
+
415
+ static followUser(id) {
416
+ return _client.default.request({
417
+ url: _Endpoints.default.FollowUser.url({
418
+ id
419
+ }),
420
+ method: _Endpoints.default.FollowUser.method
421
+ }).then(res => {
422
+ if (res.status >= 300) {
423
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
424
+ return Promise.reject(res);
425
+ }
426
+
427
+ return Promise.resolve(res.data);
428
+ }).catch(error => {
429
+ console.log('Unable to perform action.');
430
+ return Promise.reject(error);
431
+ });
432
+ }
433
+
434
+ static checkUserFollowed(id) {
435
+ return _client.default.request({
436
+ url: _Endpoints.default.CheckUserFollowed.url({
437
+ id
438
+ }),
439
+ method: _Endpoints.default.CheckUserFollowed.method
440
+ }).then(res => {
441
+ if (res.status >= 300) {
442
+ console.log(`Unable to retrieve users (Response code: ${res.status}).`);
443
+ return Promise.reject(res);
444
+ }
445
+
446
+ return Promise.resolve(res.data);
447
+ }).catch(error => {
448
+ console.log('Unable to retrieve users .');
449
+ return Promise.reject(error);
450
+ });
451
+ }
452
+
453
+ static checkUserFollower(id) {
454
+ return _client.default.request({
455
+ url: _Endpoints.default.CheckUserFollower.url({
456
+ id
457
+ }),
458
+ method: _Endpoints.default.CheckUserFollower.method
459
+ }).then(res => {
460
+ if (res.status >= 300) {
461
+ console.log(`Unable to retrieve users (Response code: ${res.status}).`);
462
+ return Promise.reject(res);
463
+ }
464
+
465
+ return Promise.resolve(res.data);
466
+ }).catch(error => {
467
+ console.log('Unable to retrieve users .');
468
+ return Promise.reject(error);
469
+ });
470
+ }
471
+
472
+ static getUserConnections(id) {
473
+ return _client.default.request({
474
+ url: _Endpoints.default.UserConnections.url({
475
+ id
476
+ }),
477
+ method: _Endpoints.default.UserConnections.method
478
+ }).then(res => {
479
+ if (res.status >= 300) {
480
+ console.log(`Unable to retrieve user connections (Response code: ${res.status}).`);
481
+ return Promise.reject(res);
482
+ }
483
+
484
+ return Promise.resolve(res.data);
485
+ }).catch(error => {
486
+ console.log('Unable to retrieve user connections.');
487
+ return Promise.reject(error);
488
+ });
489
+ }
490
+
491
+ static checkUserConnections(id) {
492
+ return _client.default.request({
493
+ url: _Endpoints.default.UserCheckConnection.url({
494
+ id
495
+ }),
496
+ method: _Endpoints.default.UserCheckConnection.method
497
+ }).then(res => {
498
+ if (res.status >= 300) {
499
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
500
+ return Promise.reject(res);
501
+ }
502
+
503
+ return Promise.resolve(res.data);
504
+ }).catch(error => {
505
+ console.log('Unable to perform action.');
506
+ return Promise.reject(error);
507
+ });
508
+ }
509
+
510
+ static getUserConnectionRequests(id) {
511
+ return _client.default.request({
512
+ url: _Endpoints.default.UserConnectionRequests.url({
513
+ id
514
+ }),
515
+ method: _Endpoints.default.UserConnectionRequests.method
516
+ }).then(res => {
517
+ if (res.status >= 300) {
518
+ console.log(`Unable to retrieve user connection requests (Response code: ${res.status}).`);
519
+ return Promise.reject(res);
520
+ }
521
+
522
+ return Promise.resolve(res.data);
523
+ }).catch(error => {
524
+ console.log('Unable to retrieve user connection requests.');
525
+ return Promise.reject(error);
526
+ });
527
+ }
528
+
529
+ static getUserRequestConnectionsSent(id) {
530
+ return _client.default.request({
531
+ url: _Endpoints.default.UserRequestConnectionsSent.url({
532
+ id
533
+ }),
534
+ method: _Endpoints.default.UserRequestConnectionsSent.method
535
+ }).then(res => {
536
+ if (res.status >= 300) {
537
+ console.log(`Unable to retrieve user connection requests sent (Response code: ${res.status}).`);
538
+ return Promise.reject(res);
539
+ }
540
+
541
+ return Promise.resolve(res.data);
542
+ }).catch(error => {
543
+ console.log('Unable to retrieve user connection requests sent.');
544
+ return Promise.reject(error);
545
+ });
546
+ }
547
+
548
+ static userAcceptRequestConnection(id) {
549
+ return _client.default.request({
550
+ url: _Endpoints.default.UserAcceptRequestConnection.url({
551
+ id
552
+ }),
553
+ method: _Endpoints.default.UserAcceptRequestConnection.method
554
+ }).then(res => {
555
+ if (res.status >= 300) {
556
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
557
+ return Promise.reject(res);
558
+ }
559
+
560
+ return Promise.resolve(res.data);
561
+ }).catch(error => {
562
+ console.log('Unable to perform action.');
563
+ return Promise.reject(error);
564
+ });
565
+ }
566
+
567
+ static userRequestConnection(id) {
568
+ return _client.default.request({
569
+ url: _Endpoints.default.UserRequestConnection.url({
570
+ id
571
+ }),
572
+ method: _Endpoints.default.UserRequestConnection.method
573
+ }).then(res => {
574
+ if (res.status >= 300) {
575
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
576
+ return Promise.reject(res);
577
+ }
578
+
579
+ return Promise.resolve(res.data);
580
+ }).catch(error => {
581
+ console.log('Unable to perform action.');
582
+ return Promise.reject(error);
583
+ });
584
+ }
585
+
586
+ static userRemoveConnection(id) {
587
+ return _client.default.request({
588
+ url: _Endpoints.default.UserRemoveConnection.url({
589
+ id
590
+ }),
591
+ method: _Endpoints.default.UserRemoveConnection.method
592
+ }).then(res => {
593
+ if (res.status >= 300) {
594
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
595
+ return Promise.reject(res);
596
+ }
597
+
598
+ return Promise.resolve(res.data);
599
+ }).catch(error => {
600
+ console.log('Unable to perform action.');
601
+ return Promise.reject(error);
602
+ });
603
+ }
604
+
605
+ static userCancelRejectConnectionRequest(id) {
606
+ return _client.default.request({
607
+ url: _Endpoints.default.UserCancelRejectConnectionRequest.url({
608
+ id
609
+ }),
610
+ method: _Endpoints.default.UserCancelRejectConnectionRequest.method
611
+ }).then(res => {
612
+ if (res.status >= 300) {
613
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
614
+ return Promise.reject(res);
615
+ }
616
+
617
+ return Promise.resolve(res.data);
618
+ }).catch(error => {
619
+ console.log('Unable to perform action.');
620
+ return Promise.reject(error);
621
+ });
622
+ }
623
+
624
+ static userCancelRequestConnection(id) {
625
+ return _client.default.request({
626
+ url: _Endpoints.default.UserCancelRequestConnection.url({
627
+ id
628
+ }),
629
+ method: _Endpoints.default.UserCancelRequestConnection.method
630
+ }).then(res => {
631
+ if (res.status >= 300) {
632
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
633
+ return Promise.reject(res);
634
+ }
635
+
636
+ return Promise.resolve(res.data);
637
+ }).catch(error => {
638
+ console.log('Unable to perform action.');
639
+ return Promise.reject(error);
640
+ });
641
+ }
642
+
643
+ static userRejectConnectionRequest(id) {
644
+ return _client.default.request({
645
+ url: _Endpoints.default.UserRejectConnectionRequest.url({
646
+ id
647
+ }),
648
+ method: _Endpoints.default.UserRejectConnectionRequest.method
649
+ }).then(res => {
650
+ if (res.status >= 300) {
651
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
652
+ return Promise.reject(res);
653
+ }
654
+
655
+ return Promise.resolve(res.data);
656
+ }).catch(error => {
657
+ console.log('Unable to perform action.');
658
+ return Promise.reject(error);
659
+ });
660
+ }
661
+
662
+ static userMarkSeenConnectionRequest(id) {
663
+ return _client.default.request({
664
+ url: _Endpoints.default.UserMarkSeenConnectionRequest.url({
665
+ id
666
+ }),
667
+ method: _Endpoints.default.UserMarkSeenConnectionRequest.method
668
+ }).then(res => {
669
+ if (res.status >= 300) {
670
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
671
+ return Promise.reject(res);
672
+ }
673
+
674
+ return Promise.resolve(res.data);
675
+ }).catch(error => {
676
+ console.log('Unable to perform action.');
677
+ return Promise.reject(error);
678
+ });
679
+ }
680
+
681
+ static showHideUser(id) {
682
+ return _client.default.request({
683
+ url: _Endpoints.default.UserShowHide.url({
684
+ id
685
+ }),
686
+ method: _Endpoints.default.UserShowHide.method
687
+ }).then(res => {
688
+ if (res.status >= 300) {
689
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
690
+ return Promise.reject(res);
691
+ }
692
+
693
+ return Promise.resolve(res.data);
694
+ }).catch(error => {
695
+ console.log('Unable to perform action.');
696
+ return Promise.reject(error);
697
+ });
698
+ }
699
+
700
+ static checkUserHidden(id) {
701
+ return _client.default.request({
702
+ url: _Endpoints.default.CheckUserHidden.url({
703
+ id
704
+ }),
705
+ method: _Endpoints.default.CheckUserHidden.method
706
+ }).then(res => {
707
+ if (res.status >= 300) {
708
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
709
+ return Promise.reject(res);
710
+ }
711
+
712
+ return Promise.resolve(res.data);
713
+ }).catch(error => {
714
+ console.log('Unable to perform action.');
715
+ return Promise.reject(error);
716
+ });
717
+ }
718
+
719
+ static checkUserHiddenBy(id) {
720
+ return _client.default.request({
721
+ url: _Endpoints.default.CheckUserHiddenBy.url({
722
+ id
723
+ }),
724
+ method: _Endpoints.default.CheckUserHiddenBy.method
725
+ }).then(res => {
726
+ if (res.status >= 300) {
727
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
728
+ return Promise.reject(res);
729
+ }
730
+
731
+ return Promise.resolve(res.data);
732
+ }).catch(error => {
733
+ console.log('Unable to perform action.');
734
+ return Promise.reject(error);
735
+ });
736
+ }
737
+
738
+ static getUserLoyaltyPoints(id) {
739
+ return _client.default.request({
740
+ url: _Endpoints.default.GetUserLoyaltyPoints.url({
741
+ id
742
+ }),
743
+ method: _Endpoints.default.GetUserLoyaltyPoints.method
744
+ }).then(res => {
745
+ if (res.status >= 300) {
746
+ console.log(`Unable to retrieve user loyalty points (Response code: ${res.status}).`);
747
+ return Promise.reject(res);
748
+ }
749
+
750
+ return Promise.resolve(res.data);
751
+ }).catch(error => {
752
+ console.log('Unable to retrieve user loyalty points.');
753
+ return Promise.reject(error);
754
+ });
755
+ }
756
+
757
+ static getUserConnectionStatuses() {
758
+ return _client.default.request({
759
+ url: _Endpoints.default.UserConnectionStatuses.url({}),
760
+ method: _Endpoints.default.UserConnectionStatuses.method
761
+ }).then(res => {
762
+ if (res.status >= 300) {
763
+ console.log(`Unable to retrieve user connection statuses (Response code: ${res.status}).`);
764
+ return Promise.reject(res);
765
+ }
766
+
767
+ return Promise.resolve(res.data);
768
+ }).catch(error => {
769
+ console.log('Unable to retrieve user connection statuses.');
770
+ return Promise.reject(error);
771
+ });
772
+ }
773
+
774
+ static userTagToAddressContribution() {
775
+ return _client.default.request({
776
+ url: _Endpoints.default.UserTagToAddressContribution.url({}),
777
+ method: _Endpoints.default.UserTagToAddressContribution.method
778
+ }).then(res => {
779
+ if (res.status >= 300) {
780
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
781
+ return Promise.reject(res);
782
+ }
783
+
784
+ return Promise.resolve(res.data);
785
+ }).catch(error => {
786
+ console.log('Unable to perform action.');
787
+ return Promise.reject(error);
788
+ });
789
+ }
790
+
791
+ static checkUserEmailToken() {
792
+ return _client.default.request({
793
+ url: _Endpoints.default.CheckEmailToken.url({}),
794
+ method: _Endpoints.default.CheckEmailToken.method
795
+ }).then(res => {
796
+ if (res.status >= 300) {
797
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
798
+ return Promise.reject(res);
799
+ }
800
+
801
+ return Promise.resolve(res.data);
802
+ }).catch(error => {
803
+ console.log('Unable to perform action.');
804
+ return Promise.reject(error);
805
+ });
806
+ }
807
+
808
+ static addUserAvatar() {
809
+ return _client.default.request({
810
+ url: _Endpoints.default.AddAvatar.url({}),
811
+ method: _Endpoints.default.AddAvatar.method
812
+ }).then(res => {
813
+ if (res.status >= 300) {
814
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
815
+ return Promise.reject(res);
816
+ }
817
+
818
+ return Promise.resolve(res.data);
819
+ }).catch(error => {
820
+ console.log('Unable to perform action.');
821
+ return Promise.reject(error);
822
+ });
823
+ }
824
+
825
+ static getUserAvatars() {
826
+ return _client.default.request({
827
+ url: _Endpoints.default.GetAvatars.url({}),
828
+ method: _Endpoints.default.GetAvatars.method
829
+ }).then(res => {
830
+ if (res.status >= 300) {
831
+ console.log(`Unable to retrieve user avatars (Response code: ${res.status}).`);
832
+ return Promise.reject(res);
833
+ }
834
+
835
+ return Promise.resolve(res.data);
836
+ }).catch(error => {
837
+ console.log('Unable to retrieve user avatars.');
838
+ return Promise.reject(error);
839
+ });
840
+ }
841
+
842
+ static removeUserAvatar() {
843
+ return _client.default.request({
844
+ url: _Endpoints.default.RemoveAvatar.url({}),
845
+ method: _Endpoints.default.RemoveAvatar.method
846
+ }).then(res => {
847
+ if (res.status >= 300) {
848
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
849
+ return Promise.reject(res);
850
+ }
851
+
852
+ return Promise.resolve(res.data);
853
+ }).catch(error => {
854
+ console.log('Unable to perform action.');
855
+ return Promise.reject(error);
856
+ });
857
+ }
858
+
859
+ static setUserPrimaryAvatar() {
860
+ return _client.default.request({
861
+ url: _Endpoints.default.SetPrimaryAvatar.url({}),
862
+ method: _Endpoints.default.SetPrimaryAvatar.method
863
+ }).then(res => {
864
+ if (res.status >= 300) {
865
+ console.log(`Unable to perform action (Response code: ${res.status}).`);
866
+ return Promise.reject(res);
867
+ }
868
+
869
+ return Promise.resolve(res.data);
870
+ }).catch(error => {
871
+ console.log('Unable to perform action.');
872
+ return Promise.reject(error);
873
+ });
874
+ }
875
+
876
+ }
877
+
878
+ exports.UserApiClient = UserApiClient;
879
+
880
+ class UserService {
881
+ static async getAllUsers() {
882
+ return UserApiClient.getAllUsers();
883
+ }
884
+
885
+ static async getHiddenUsers() {
886
+ return UserApiClient.getHiddenUsers();
887
+ }
888
+
889
+ static async userAutocomplete() {
890
+ return UserApiClient.userAutocomplete();
891
+ }
892
+
893
+ static async userSearch() {
894
+ return UserApiClient.userSearch();
895
+ }
896
+
897
+ static async getSpecificUser(id) {
898
+ return UserApiClient.getSpecificUser(id);
899
+ }
900
+
901
+ static async getUserCounters(id) {
902
+ return UserApiClient.getUserCounters(id);
903
+ }
904
+
905
+ static async userUpdate(id) {
906
+ return UserApiClient.userUpdate(id);
907
+ }
908
+
909
+ static async userPatch(id) {
910
+ return UserApiClient.userPatch(id);
911
+ }
912
+
913
+ static async userDelete(id) {
914
+ return UserApiClient.userDelete(id);
915
+ }
916
+
917
+ static async changeUserMail(id) {
918
+ return UserApiClient.changeUserMail(id);
919
+ }
920
+
921
+ static async confirmChangeUserMail(id) {
922
+ return UserApiClient.confirmChangeUserMail(id);
923
+ }
924
+
925
+ static async changeUserPassword(id) {
926
+ return UserApiClient.changeUserPassword(id);
927
+ }
928
+
929
+ static async userSettings(id) {
930
+ return UserApiClient.userSettings(id);
931
+ }
932
+
933
+ static async userSettingsPatch(id) {
934
+ return UserApiClient.userSettingsPatch(id);
935
+ }
936
+
937
+ static async getCurrentUser() {
938
+ return UserApiClient.getCurrentUser();
939
+ }
940
+
941
+ static async getCurrentUserAvatar() {
942
+ return UserApiClient.getCurrentUserAvatar();
943
+ }
944
+
945
+ static async getCurrentUserPermission() {
946
+ return UserApiClient.getCurrentUserPermission();
947
+ }
948
+
949
+ static async getCurrentUserPlatform() {
950
+ return UserApiClient.getCurrentUserPlatform();
951
+ }
952
+
953
+ static async getUserFollowedCategories(id) {
954
+ return UserApiClient.getUserFollowedCategories(id);
955
+ }
956
+
957
+ static async getUserFeed(id) {
958
+ return UserApiClient.getUserFeed(id);
959
+ }
960
+
961
+ static async getUserFollowers(id) {
962
+ return UserApiClient.getUserFollowers(id);
963
+ }
964
+
965
+ static async getUserFollowed(id) {
966
+ return UserApiClient.getUserFollowed(id);
967
+ }
968
+
969
+ static async followUser(id) {
970
+ return UserApiClient.followUser(id);
971
+ }
972
+
973
+ static async checkUserFollowed(id) {
974
+ return UserApiClient.checkUserFollowed(id);
975
+ }
976
+
977
+ static async checkUserFollower(id) {
978
+ return UserApiClient.checkUserFollower(id);
979
+ }
980
+
981
+ static async getUserConnections(id) {
982
+ return UserApiClient.getUserConnections(id);
983
+ }
984
+
985
+ static async checkUserConnections(id) {
986
+ return UserApiClient.checkUserConnections(id);
987
+ }
988
+
989
+ static async getUserConnectionRequests(id) {
990
+ return UserApiClient.getUserConnectionRequests(id);
991
+ }
992
+
993
+ static async getUserRequestConnectionsSent(id) {
994
+ return UserApiClient.getUserRequestConnectionsSent(id);
995
+ }
996
+
997
+ static async userAcceptRequestConnection(id) {
998
+ return UserApiClient.userAcceptRequestConnection(id);
999
+ }
1000
+
1001
+ static async userRequestConnection(id) {
1002
+ return UserApiClient.userRequestConnection(id);
1003
+ }
1004
+
1005
+ static async userRemoveConnection(id) {
1006
+ return UserApiClient.userRemoveConnection(id);
1007
+ }
1008
+
1009
+ static async userCancelRejectConnectionRequest(id) {
1010
+ return UserApiClient.userCancelRejectConnectionRequest(id);
1011
+ }
1012
+
1013
+ static async userCancelRequestConnection(id) {
1014
+ return UserApiClient.userCancelRequestConnection(id);
1015
+ }
1016
+
1017
+ static async userRejectConnectionRequest(id) {
1018
+ return UserApiClient.userRejectConnectionRequest(id);
1019
+ }
1020
+
1021
+ static async userMarkSeenConnectionRequest(id) {
1022
+ return UserApiClient.userMarkSeenConnectionRequest(id);
1023
+ }
1024
+
1025
+ static async showHideUser(id) {
1026
+ return UserApiClient.showHideUser(id);
1027
+ }
1028
+
1029
+ static async checkUserHidden(id) {
1030
+ return UserApiClient.checkUserHidden(id);
1031
+ }
1032
+
1033
+ static async checkUserHiddenBy(id) {
1034
+ return UserApiClient.checkUserHiddenBy(id);
1035
+ }
1036
+
1037
+ static async getUserLoyaltyPoints(id) {
1038
+ return UserApiClient.getUserLoyaltyPoints(id);
1039
+ }
1040
+
1041
+ static async getUserConnectionStatuses() {
1042
+ return UserApiClient.getUserConnectionStatuses();
1043
+ }
1044
+
1045
+ static async userTagToAddressContribution() {
1046
+ return UserApiClient.userTagToAddressContribution();
1047
+ }
1048
+
1049
+ static async checkUserEmailToken() {
1050
+ return UserApiClient.checkUserEmailToken();
1051
+ }
1052
+
1053
+ static async addUserAvatar() {
1054
+ return UserApiClient.addUserAvatar();
1055
+ }
1056
+
1057
+ static async getUserAvatars() {
1058
+ return UserApiClient.getUserAvatars();
1059
+ }
1060
+
1061
+ static async removeUserAvatar() {
1062
+ return UserApiClient.removeUserAvatar();
1063
+ }
1064
+
1065
+ static async setUserPrimaryAvatar() {
1066
+ return UserApiClient.setUserPrimaryAvatar();
81
1067
  }
82
1068
 
83
1069
  }