@selfcommunity/api-services 0.1.6 → 0.1.7

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 (188) hide show
  1. package/lib/cjs/index.js +36 -0
  2. package/lib/cjs/services/category/index.js +168 -286
  3. package/lib/cjs/services/comment/index.js +107 -186
  4. package/lib/cjs/services/custom_adv/index.js +31 -51
  5. package/lib/cjs/services/custom_page/index.js +32 -52
  6. package/lib/cjs/services/data_portability/index.js +18 -43
  7. package/lib/cjs/services/embed/index.js +90 -151
  8. package/lib/cjs/services/feature/index.js +8 -16
  9. package/lib/cjs/services/feed/index.js +46 -81
  10. package/lib/cjs/services/feed_object/index.js +339 -505
  11. package/lib/cjs/services/incubator/index.js +64 -116
  12. package/lib/cjs/services/insight/index.js +51 -94
  13. package/lib/cjs/services/legal_page/index.js +60 -101
  14. package/lib/cjs/services/locality/index.js +14 -30
  15. package/lib/cjs/services/loyalty/index.js +92 -154
  16. package/lib/cjs/services/media/index.js +80 -122
  17. package/lib/cjs/services/moderation/index.js +65 -103
  18. package/lib/cjs/services/notification/index.js +67 -136
  19. package/lib/cjs/services/preference/index.js +25 -51
  20. package/lib/cjs/services/private_message/index.js +98 -177
  21. package/lib/cjs/services/score/index.js +22 -46
  22. package/lib/cjs/services/sso/index.js +17 -32
  23. package/lib/cjs/services/suggestion/index.js +23 -57
  24. package/lib/cjs/services/tag/index.js +72 -119
  25. package/lib/cjs/services/user/index.js +420 -767
  26. package/lib/cjs/services/webhook/index.js +4 -7
  27. package/lib/cjs/types/baseParams.js +3 -0
  28. package/lib/cjs/types/category.js +3 -0
  29. package/lib/cjs/types/comment.js +3 -0
  30. package/lib/cjs/types/customAdv.js +3 -0
  31. package/lib/cjs/types/customPage.js +3 -0
  32. package/lib/cjs/types/embed.js +3 -0
  33. package/lib/cjs/types/feed.js +3 -0
  34. package/lib/cjs/types/feedObject.js +3 -0
  35. package/lib/cjs/types/incubator.js +3 -0
  36. package/lib/cjs/types/index.js +91 -1
  37. package/lib/cjs/types/legalPage.js +3 -0
  38. package/lib/cjs/types/media.js +29 -0
  39. package/lib/cjs/types/moderation.js +3 -0
  40. package/lib/cjs/types/notification.js +3 -0
  41. package/lib/cjs/types/privateMessage.js +3 -0
  42. package/lib/cjs/types/prize.js +3 -0
  43. package/lib/cjs/types/sso.js +3 -0
  44. package/lib/cjs/types/tag.js +3 -0
  45. package/lib/cjs/types/user.js +3 -0
  46. package/lib/cjs/utils/apiRequest.js +2 -1
  47. package/lib/esm/index.js +36 -0
  48. package/lib/esm/services/category/index.js +168 -286
  49. package/lib/esm/services/comment/index.js +107 -186
  50. package/lib/esm/services/custom_adv/index.js +31 -51
  51. package/lib/esm/services/custom_page/index.js +32 -52
  52. package/lib/esm/services/data_portability/index.js +18 -43
  53. package/lib/esm/services/embed/index.js +90 -151
  54. package/lib/esm/services/feature/index.js +8 -16
  55. package/lib/esm/services/feed/index.js +46 -81
  56. package/lib/esm/services/feed_object/index.js +339 -505
  57. package/lib/esm/services/incubator/index.js +64 -116
  58. package/lib/esm/services/insight/index.js +51 -94
  59. package/lib/esm/services/legal_page/index.js +60 -101
  60. package/lib/esm/services/locality/index.js +14 -30
  61. package/lib/esm/services/loyalty/index.js +92 -154
  62. package/lib/esm/services/media/index.js +80 -122
  63. package/lib/esm/services/moderation/index.js +65 -103
  64. package/lib/esm/services/notification/index.js +67 -136
  65. package/lib/esm/services/preference/index.js +25 -51
  66. package/lib/esm/services/private_message/index.js +98 -177
  67. package/lib/esm/services/score/index.js +22 -46
  68. package/lib/esm/services/sso/index.js +17 -32
  69. package/lib/esm/services/suggestion/index.js +23 -57
  70. package/lib/esm/services/tag/index.js +72 -119
  71. package/lib/esm/services/user/index.js +420 -767
  72. package/lib/esm/services/webhook/index.js +4 -7
  73. package/lib/esm/types/baseParams.js +3 -0
  74. package/lib/esm/types/category.js +3 -0
  75. package/lib/esm/types/comment.js +3 -0
  76. package/lib/esm/types/customAdv.js +3 -0
  77. package/lib/esm/types/customPage.js +3 -0
  78. package/lib/esm/types/embed.js +3 -0
  79. package/lib/esm/types/feed.js +3 -0
  80. package/lib/esm/types/feedObject.js +3 -0
  81. package/lib/esm/types/incubator.js +3 -0
  82. package/lib/esm/types/index.js +91 -1
  83. package/lib/esm/types/legalPage.js +3 -0
  84. package/lib/esm/types/media.js +29 -0
  85. package/lib/esm/types/moderation.js +3 -0
  86. package/lib/esm/types/notification.js +3 -0
  87. package/lib/esm/types/privateMessage.js +3 -0
  88. package/lib/esm/types/prize.js +3 -0
  89. package/lib/esm/types/sso.js +3 -0
  90. package/lib/esm/types/tag.js +3 -0
  91. package/lib/esm/types/user.js +3 -0
  92. package/lib/esm/utils/apiRequest.js +2 -1
  93. package/lib/types/index.d.ts +2 -2
  94. package/lib/types/index.d.ts.map +1 -1
  95. package/lib/types/services/category/index.d.ts +114 -42
  96. package/lib/types/services/category/index.d.ts.map +1 -1
  97. package/lib/types/services/comment/index.d.ts +74 -23
  98. package/lib/types/services/comment/index.d.ts.map +1 -1
  99. package/lib/types/services/custom_adv/index.d.ts +26 -9
  100. package/lib/types/services/custom_adv/index.d.ts.map +1 -1
  101. package/lib/types/services/custom_page/index.d.ts +26 -9
  102. package/lib/types/services/custom_page/index.d.ts.map +1 -1
  103. package/lib/types/services/data_portability/index.d.ts +19 -6
  104. package/lib/types/services/data_portability/index.d.ts.map +1 -1
  105. package/lib/types/services/embed/index.d.ts +62 -24
  106. package/lib/types/services/embed/index.d.ts.map +1 -1
  107. package/lib/types/services/feature/index.d.ts +11 -3
  108. package/lib/types/services/feature/index.d.ts.map +1 -1
  109. package/lib/types/services/feed/index.d.ts +37 -15
  110. package/lib/types/services/feed/index.d.ts.map +1 -1
  111. package/lib/types/services/feed_object/index.d.ts +229 -81
  112. package/lib/types/services/feed_object/index.d.ts.map +1 -1
  113. package/lib/types/services/incubator/index.d.ts +51 -18
  114. package/lib/types/services/incubator/index.d.ts.map +1 -1
  115. package/lib/types/services/insight/index.d.ts +44 -18
  116. package/lib/types/services/insight/index.d.ts.map +1 -1
  117. package/lib/types/services/legal_page/index.d.ts +46 -18
  118. package/lib/types/services/legal_page/index.d.ts.map +1 -1
  119. package/lib/types/services/locality/index.d.ts +17 -6
  120. package/lib/types/services/locality/index.d.ts.map +1 -1
  121. package/lib/types/services/loyalty/index.d.ts +70 -27
  122. package/lib/types/services/loyalty/index.d.ts.map +1 -1
  123. package/lib/types/services/media/index.d.ts +55 -18
  124. package/lib/types/services/media/index.d.ts.map +1 -1
  125. package/lib/types/services/moderation/index.d.ts +51 -18
  126. package/lib/types/services/moderation/index.d.ts.map +1 -1
  127. package/lib/types/services/notification/index.d.ts +63 -27
  128. package/lib/types/services/notification/index.d.ts.map +1 -1
  129. package/lib/types/services/preference/index.d.ts +28 -9
  130. package/lib/types/services/preference/index.d.ts.map +1 -1
  131. package/lib/types/services/private_message/index.d.ts +68 -24
  132. package/lib/types/services/private_message/index.d.ts.map +1 -1
  133. package/lib/types/services/score/index.d.ts +24 -9
  134. package/lib/types/services/score/index.d.ts.map +1 -1
  135. package/lib/types/services/sso/index.d.ts +18 -6
  136. package/lib/types/services/sso/index.d.ts.map +1 -1
  137. package/lib/types/services/suggestion/index.d.ts +29 -12
  138. package/lib/types/services/suggestion/index.d.ts.map +1 -1
  139. package/lib/types/services/tag/index.d.ts +57 -21
  140. package/lib/types/services/tag/index.d.ts.map +1 -1
  141. package/lib/types/services/user/index.d.ts +313 -114
  142. package/lib/types/services/user/index.d.ts.map +1 -1
  143. package/lib/types/services/webhook/index.d.ts +3 -4
  144. package/lib/types/services/webhook/index.d.ts.map +1 -1
  145. package/lib/types/tsconfig.build.tsbuildinfo +1 -1
  146. package/lib/types/types/baseParams.d.ts +23 -0
  147. package/lib/types/types/baseParams.d.ts.map +1 -0
  148. package/lib/types/types/category.d.ts +15 -0
  149. package/lib/types/types/category.d.ts.map +1 -0
  150. package/lib/types/types/comment.d.ts +51 -0
  151. package/lib/types/types/comment.d.ts.map +1 -0
  152. package/lib/types/types/customAdv.d.ts +19 -0
  153. package/lib/types/types/customAdv.d.ts.map +1 -0
  154. package/lib/types/types/customPage.d.ts +24 -0
  155. package/lib/types/types/customPage.d.ts.map +1 -0
  156. package/lib/types/types/embed.d.ts +26 -0
  157. package/lib/types/types/embed.d.ts.map +1 -0
  158. package/lib/types/types/feed.d.ts +11 -0
  159. package/lib/types/types/feed.d.ts.map +1 -0
  160. package/lib/types/types/feedObject.d.ts +56 -0
  161. package/lib/types/types/feedObject.d.ts.map +1 -0
  162. package/lib/types/types/incubator.d.ts +33 -0
  163. package/lib/types/types/incubator.d.ts.map +1 -0
  164. package/lib/types/types/index.d.ts +19 -1
  165. package/lib/types/types/index.d.ts.map +1 -1
  166. package/lib/types/types/legalPage.d.ts +19 -0
  167. package/lib/types/types/legalPage.d.ts.map +1 -0
  168. package/lib/types/types/media.d.ts +80 -0
  169. package/lib/types/types/media.d.ts.map +1 -0
  170. package/lib/types/types/moderation.d.ts +23 -0
  171. package/lib/types/types/moderation.d.ts.map +1 -0
  172. package/lib/types/types/notification.d.ts +31 -0
  173. package/lib/types/types/notification.d.ts.map +1 -0
  174. package/lib/types/types/privateMessage.d.ts +176 -0
  175. package/lib/types/types/privateMessage.d.ts.map +1 -0
  176. package/lib/types/types/prize.d.ts +47 -0
  177. package/lib/types/types/prize.d.ts.map +1 -0
  178. package/lib/types/types/sso.d.ts +12 -0
  179. package/lib/types/types/sso.d.ts.map +1 -0
  180. package/lib/types/types/tag.d.ts +39 -0
  181. package/lib/types/types/tag.d.ts.map +1 -0
  182. package/lib/types/types/user.d.ts +105 -0
  183. package/lib/types/types/user.d.ts.map +1 -0
  184. package/lib/types/utils/apiRequest.d.ts +1 -1
  185. package/lib/types/utils/apiRequest.d.ts.map +1 -1
  186. package/lib/umd/api-services.js +1 -1
  187. package/lib/umd/api-services.js.map +1 -1
  188. package/package.json +4 -4
@@ -3,873 +3,526 @@
3
3
  exports.__esModule = true;
4
4
  exports.default = exports.UserApiClient = void 0;
5
5
 
6
- var _client = _interopRequireDefault(require("../../client"));
6
+ var _apiRequest = require("../../utils/apiRequest");
7
7
 
8
8
  var _Endpoints = _interopRequireDefault(require("../../constants/Endpoints"));
9
9
 
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
11
 
12
+ /**
13
+ * Contains all the endpoints needed to manage users.
14
+ */
12
15
  class UserApiClient {
16
+ /**
17
+ * This endpoint retrieves the list of all users
18
+ */
13
19
  static getAllUsers() {
14
- return _client.default.request({
15
- url: _Endpoints.default.User.url({}),
16
- method: _Endpoints.default.User.method
17
- }).then(res => {
18
- if (res.status >= 300) {
19
- console.log(`Unable to retrieve users (Response code: ${res.status}).`);
20
- return Promise.reject(res);
21
- }
22
-
23
- return Promise.resolve(res);
24
- }).catch(error => {
25
- console.log('Unable to retrieve users.');
26
- return Promise.reject(error);
27
- });
20
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.User.url({}), _Endpoints.default.User.method);
28
21
  }
22
+ /**
23
+ * This endpoint retrieves the list of all users hidden by the authenticated user
24
+ */
25
+
29
26
 
30
27
  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
- });
28
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.ListHiddenUsers.url(), _Endpoints.default.ListHiddenUsers.method);
45
29
  }
30
+ /**
31
+ * This endpoint retrieves the list of all users that meet the search criteria. The user object returned will contain only the following attributes: id, username, real_name, ext_id and avatar.
32
+ * This endpoint is recommended for implementing an autocomplete input field.
33
+ * @param params
34
+ */
46
35
 
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
- });
36
+
37
+ static userAutocomplete(params) {
38
+ const p = new URLSearchParams(params);
39
+ return (0, _apiRequest.apiRequest)(`${_Endpoints.default.UserAutocomplete.url()}?${p.toString()})}`, _Endpoints.default.UserAutocomplete.method);
62
40
  }
41
+ /**
42
+ * This endpoint performs users search.
43
+ * @param params
44
+ */
63
45
 
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
- });
46
+
47
+ static userSearch(params) {
48
+ const p = new URLSearchParams(params);
49
+ return (0, _apiRequest.apiRequest)(`${_Endpoints.default.UserSearch.url()}?${p.toString()})}`, _Endpoints.default.UserSearch.method);
79
50
  }
51
+ /**
52
+ * This endpoint retrieves a specific user's profile identified by ID.
53
+ * @param id
54
+ */
55
+
80
56
 
81
57
  static getSpecificUser(id) {
82
- return _client.default.request({
83
- url: _Endpoints.default.User.url({
84
- id
85
- }),
86
- method: _Endpoints.default.User.method
87
- }).then(res => {
88
- if (res.status >= 300) {
89
- console.log(`Unable to retrieve user (Response code: ${res.status}).`);
90
- return Promise.reject(res);
91
- }
92
-
93
- return Promise.resolve(res);
94
- }).catch(error => {
95
- console.log('Unable to retrieve user.');
96
- return Promise.reject(error);
97
- });
58
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.User.url({
59
+ id
60
+ }), _Endpoints.default.User.method);
98
61
  }
62
+ /**
63
+ * This endpoint retrieves the counters of a specific user identified by Id.
64
+ * @param id
65
+ */
66
+
99
67
 
100
68
  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
- });
69
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.UserCounters.url({
70
+ id
71
+ }), _Endpoints.default.UserCounters.method);
117
72
  }
73
+ /**
74
+ * This endpoint updates the profile of a user identified by ID. A user can only update their personal data.
75
+ * @param id
76
+ * @param data
77
+ */
118
78
 
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
- });
79
+
80
+ static userUpdate(id, data) {
81
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.UserUpdate.url({
82
+ id
83
+ }), _Endpoints.default.UserUpdate.method, data != null ? data : null);
136
84
  }
85
+ /**
86
+ * This endpoint patches a specific user identified by {id}
87
+ * @param id
88
+ * @param data
89
+ */
137
90
 
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
- });
91
+
92
+ static userPatch(id, data) {
93
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.UserPatch.url({
94
+ id
95
+ }), _Endpoints.default.UserPatch.method, data != null ? data : null);
155
96
  }
97
+ /**
98
+ * This endpoint deletes a specific user identified by {id}
99
+ * @param id
100
+ * @param hard
101
+ */
156
102
 
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
- });
103
+
104
+ static userDelete(id, hard) {
105
+ return (0, _apiRequest.apiRequest)(`${_Endpoints.default.UserDelete.url({
106
+ id
107
+ })}?${hard.toString()})}`, _Endpoints.default.UserDelete.method);
174
108
  }
109
+ /**
110
+ * This endpoint changes the email of the authenticated user.
111
+ * @param id
112
+ * @param new_email
113
+ * @param confirm
114
+ */
175
115
 
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);
116
+
117
+ static changeUserMail(id, new_email, confirm) {
118
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.ChangeUserMail.url({
119
+ id
120
+ }), _Endpoints.default.ChangeUserMail.method, {
121
+ new_email: new_email,
122
+ confirm: confirm != null ? confirm : null
192
123
  });
193
124
  }
125
+ /**
126
+ * This endpoint confirms email change.
127
+ * @param id
128
+ * @param new_email
129
+ * @param validation_code
130
+ */
131
+
194
132
 
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);
133
+ static confirmChangeUserMail(id, new_email, validation_code) {
134
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.ConfirmUserChangeMail.url({
135
+ id
136
+ }), _Endpoints.default.ConfirmUserChangeMail.method, {
137
+ new_email: new_email,
138
+ validation_code: validation_code
211
139
  });
212
140
  }
141
+ /**
142
+ * This endpoint changes the password of the authenticated user.
143
+ * @param id
144
+ * @param password
145
+ * @param new_password
146
+ */
147
+
213
148
 
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);
149
+ static changeUserPassword(id, password, new_password) {
150
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.ChangeUserPassword.url({
151
+ id
152
+ }), _Endpoints.default.ChangeUserPassword.method, {
153
+ password: password,
154
+ new_password: new_password
230
155
  });
231
156
  }
157
+ /**
158
+ * This endpoint retrieves all current user's settings for the authenticated user.
159
+ * @param id
160
+ */
161
+
232
162
 
233
163
  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
- });
164
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.UserSettings.url({
165
+ id
166
+ }), _Endpoints.default.UserSettings.method);
250
167
  }
168
+ /**
169
+ * This endpoint changes the user settings for the authenticated user.
170
+ * @param id
171
+ * @param data
172
+ */
251
173
 
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
- });
174
+
175
+ static userSettingsPatch(id, data) {
176
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.UserSettingsPatch.url({
177
+ id
178
+ }), _Endpoints.default.UserSettingsPatch.method, data != null ? data : null);
269
179
  }
180
+ /**
181
+ * This endpoint returns the user identified by the authentication token.
182
+ */
183
+
270
184
 
271
185
  static getCurrentUser() {
272
- return _client.default.request({
273
- url: _Endpoints.default.Me.url(),
274
- method: _Endpoints.default.Me.method
275
- }).then(res => {
276
- if (res.status >= 300) {
277
- console.log(`Unable to retrieve user (Response code: ${res.status}).`);
278
- return Promise.reject(res);
279
- }
280
-
281
- return Promise.resolve(res.data);
282
- }).catch(error => {
283
- console.log('Unable to retrieve user profile.');
284
- return Promise.reject(error);
285
- });
186
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.Me.url(), _Endpoints.default.Me.method);
286
187
  }
188
+ /**
189
+ * This endpoint returns the url to the user's current avatar.
190
+ */
191
+
287
192
 
288
193
  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
- }
297
-
298
- return Promise.resolve(res.data);
299
- }).catch(error => {
300
- console.log('Unable to retrieve user avatar.');
301
- return Promise.reject(error);
302
- });
194
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.MyAvatar.url({}), _Endpoints.default.MyAvatar.method);
303
195
  }
196
+ /**
197
+ * This endpoint returns a list of permissions for the user identified by the authentication token. Some of the permissions in the list depend on global community settings.
198
+ */
199
+
304
200
 
305
201
  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
- });
202
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.Permission.url({}), _Endpoints.default.Permission.method);
320
203
  }
204
+ /**
205
+ * This endpoint retrieves the platform url starting from the Authorization user token. Using this url, the logged user (must be a staff member) can access the platform to manage the community.
206
+ */
207
+
321
208
 
322
209
  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
- });
210
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.Platform.url({}), _Endpoints.default.Platform.method);
337
211
  }
212
+ /**
213
+ * This endpoint gets the list of categories followed by the user.
214
+ * @param id
215
+ * @param mutual
216
+ */
338
217
 
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
- });
218
+
219
+ static getUserFollowedCategories(id, mutual) {
220
+ return (0, _apiRequest.apiRequest)(`${_Endpoints.default.FollowedCategories.url({
221
+ id
222
+ })}?${mutual.toString()})}`, _Endpoints.default.FollowedCategories.method);
356
223
  }
224
+ /**
225
+ * This endpoint retrieves the list of posts of the user identified by {id}
226
+ * @param id
227
+ */
228
+
357
229
 
358
230
  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
- });
231
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.UserFeed.url({
232
+ id
233
+ }), _Endpoints.default.UserFeed.method);
375
234
  }
235
+ /**
236
+ * This endpoint retrieves the list of followers of a specific user identified by {id}
237
+ * @param id
238
+ * @param mutual
239
+ */
376
240
 
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
- });
241
+
242
+ static getUserFollowers(id, mutual) {
243
+ return (0, _apiRequest.apiRequest)(`${_Endpoints.default.UserFollowers.url({
244
+ id
245
+ })}?${mutual.toString()})}`, _Endpoints.default.UserFollowers.method);
394
246
  }
247
+ /**
248
+ * This endpoint retrieves the list of following of a specific user identified by {id}.
249
+ * @param id
250
+ * @param mutual
251
+ */
395
252
 
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
- });
253
+
254
+ static getUserFollowed(id, mutual) {
255
+ return (0, _apiRequest.apiRequest)(`${_Endpoints.default.UserFollowed.url({
256
+ id
257
+ })}?${mutual.toString()})`, _Endpoints.default.UserFollowed.method);
413
258
  }
259
+ /**
260
+ * This endpoint allows a user to follow another user identified by {id}
261
+ * @param id
262
+ */
263
+
414
264
 
415
265
  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
- });
266
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.FollowUser.url({
267
+ id
268
+ }), _Endpoints.default.FollowUser.method);
432
269
  }
270
+ /**
271
+ * This endpoint returns is_followed = true if the user (identified in path) is followed by me.
272
+ * @param id
273
+ */
274
+
433
275
 
434
276
  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
- });
277
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.CheckUserFollowed.url({
278
+ id
279
+ }), _Endpoints.default.CheckUserFollowed.method);
451
280
  }
281
+ /**
282
+ * This endpoint returns is_follower = true if the user (identified in path) follow me
283
+ * @param id
284
+ */
285
+
452
286
 
453
287
  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
- });
288
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.CheckUserFollower.url({
289
+ id
290
+ }), _Endpoints.default.CheckUserFollower.method);
470
291
  }
292
+ /**
293
+ * This endpoint retrieves the list of connections of a specific user identified by ID.
294
+ * @param id
295
+ * @param mutual
296
+ */
471
297
 
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
- });
298
+
299
+ static getUserConnections(id, mutual) {
300
+ return (0, _apiRequest.apiRequest)(`${_Endpoints.default.UserConnections.url({
301
+ id
302
+ })}?${mutual.toString()})`, _Endpoints.default.UserConnections.method);
489
303
  }
304
+ /**
305
+ * This endpoint returns is_connection = true if the user (identified in path) is connected with me.
306
+ * @param id
307
+ */
308
+
490
309
 
491
310
  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
- });
311
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.UserCheckConnection.url({
312
+ id
313
+ }), _Endpoints.default.UserCheckConnection.method);
508
314
  }
315
+ /**
316
+ * This endpoint retrieves the list of connection requests received by a specific user identified by ID.
317
+ * @param id
318
+ */
319
+
509
320
 
510
321
  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
- });
322
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.UserConnectionRequests.url({
323
+ id
324
+ }), _Endpoints.default.UserConnectionRequests.method);
527
325
  }
326
+ /**
327
+ * This endpoint retrieves a specific user's list of connection requests sent by user.
328
+ * @param id
329
+ */
330
+
528
331
 
529
332
  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
- });
333
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.UserRequestConnectionsSent.url({
334
+ id
335
+ }), _Endpoints.default.UserRequestConnectionsSent.method);
546
336
  }
337
+ /**
338
+ * This endpoint accepts a request connection of the user identified by {id}
339
+ * @param id
340
+ */
341
+
547
342
 
548
343
  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
- });
344
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.UserAcceptRequestConnection.url({
345
+ id
346
+ }), _Endpoints.default.UserAcceptRequestConnection.method);
565
347
  }
348
+ /**
349
+ * This endpoint requests a connection to the user identified by {id}
350
+ * @param id
351
+ */
352
+
566
353
 
567
354
  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
- });
355
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.UserRequestConnection.url({
356
+ id
357
+ }), _Endpoints.default.UserRequestConnection.method);
584
358
  }
359
+ /**
360
+ * This endpoint removes connection with the user identified by {id}
361
+ * @param id
362
+ */
363
+
585
364
 
586
365
  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
- });
366
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.UserRemoveConnection.url({
367
+ id
368
+ }), _Endpoints.default.UserRemoveConnection.method);
603
369
  }
370
+ /**
371
+ * This endpoint cancels reject connection to a user identified by {id}
372
+ * @param id
373
+ */
374
+
604
375
 
605
376
  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
- });
377
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.UserCancelRejectConnectionRequest.url({
378
+ id
379
+ }), _Endpoints.default.UserCancelRejectConnectionRequest.method);
622
380
  }
381
+ /**
382
+ * This endpoint cancels a request connection for a user.
383
+ * @param id
384
+ */
385
+
623
386
 
624
387
  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
- });
388
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.UserCancelRequestConnection.url({
389
+ id
390
+ }), _Endpoints.default.UserCancelRequestConnection.method);
641
391
  }
392
+ /**
393
+ * This endpoint rejects a connection request sent from user identified by {id}
394
+ * @param id
395
+ */
396
+
642
397
 
643
398
  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
- });
399
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.UserRejectConnectionRequest.url({
400
+ id
401
+ }), _Endpoints.default.UserRejectConnectionRequest.method);
660
402
  }
403
+ /**
404
+ * This endpoint marks seen a connection request of user identified by {id} for the authenticated user.
405
+ * @param id
406
+ */
407
+
661
408
 
662
409
  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
- });
410
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.UserMarkSeenConnectionRequest.url({
411
+ id
412
+ }), _Endpoints.default.UserMarkSeenConnectionRequest.method);
679
413
  }
414
+ /**
415
+ * This endpoint shows/hides a user (and its posts) identified by {id} for the authenticated user.
416
+ * @param id
417
+ */
418
+
680
419
 
681
420
  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
- });
421
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.UserShowHide.url({
422
+ id
423
+ }), _Endpoints.default.UserShowHide.method);
698
424
  }
425
+ /**
426
+ * This endpoint returns true if the user (identified in path) is hidden by the authenticated user.
427
+ * @param id
428
+ */
429
+
699
430
 
700
431
  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
- });
432
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.CheckUserHidden.url({
433
+ id
434
+ }), _Endpoints.default.CheckUserHidden.method);
717
435
  }
436
+ /**
437
+ * This endpoint returns true if the user (identified in path) has hidden by the authenticated user.
438
+ * @param id
439
+ */
440
+
718
441
 
719
442
  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
- });
443
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.CheckUserHiddenBy.url({
444
+ id
445
+ }), _Endpoints.default.CheckUserHiddenBy.method);
736
446
  }
447
+ /**
448
+ * This endpoint returns user's loyalty points.
449
+ * @param id
450
+ */
451
+
737
452
 
738
453
  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
- });
454
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.GetUserLoyaltyPoints.url({
455
+ id
456
+ }), _Endpoints.default.GetUserLoyaltyPoints.method);
755
457
  }
458
+ /**
459
+ * This endpoint lists the connection/follow statuses of the logged user starting from a users array.
460
+ * @param users
461
+ */
756
462
 
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);
463
+
464
+ static getUserConnectionStatuses(users) {
465
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.UserConnectionStatuses.url({}), _Endpoints.default.UserConnectionStatuses.method, {
466
+ users: users
771
467
  });
772
468
  }
469
+ /**
470
+ * This endpoint returns user's tags to address a contribution.
471
+ */
472
+
773
473
 
774
474
  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
- });
475
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.UserTagToAddressContribution.url({}), _Endpoints.default.UserTagToAddressContribution.method);
789
476
  }
477
+ /**
478
+ * This endpoint checks an email token.
479
+ */
480
+
790
481
 
791
482
  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
- });
483
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.CheckEmailToken.url({}), _Endpoints.default.CheckEmailToken.method);
806
484
  }
485
+ /**
486
+ * This endpoint adds an avatar to my avatars.
487
+ * @param avatar
488
+ */
807
489
 
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);
490
+
491
+ static addUserAvatar(avatar) {
492
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.AddAvatar.url({}), _Endpoints.default.AddAvatar.method, {
493
+ 'Content-Type': 'multipart/form-data'
494
+ }, {
495
+ avatar: avatar
822
496
  });
823
497
  }
498
+ /**
499
+ * This endpoint retrieves all user avatars.
500
+ */
501
+
824
502
 
825
503
  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
- });
504
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.GetAvatars.url({}), _Endpoints.default.GetAvatars.method);
840
505
  }
506
+ /**
507
+ * This endpoint removes/deletes an avatar from the authenticated user avatars.
508
+ * @param avatar_id
509
+ */
841
510
 
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);
511
+
512
+ static removeUserAvatar(avatar_id) {
513
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.RemoveAvatar.url({}), _Endpoints.default.RemoveAvatar.method, {
514
+ avatar_id: avatar_id
856
515
  });
857
516
  }
517
+ /**
518
+ * This endpoint sets the primary avatar for the authenticated user.
519
+ * @param avatar_id
520
+ */
521
+
858
522
 
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);
523
+ static setUserPrimaryAvatar(avatar_id) {
524
+ return (0, _apiRequest.apiRequest)(_Endpoints.default.SetPrimaryAvatar.url({}), _Endpoints.default.SetPrimaryAvatar.method, {
525
+ avatar_id: avatar_id
873
526
  });
874
527
  }
875
528
 
@@ -886,12 +539,12 @@ class UserService {
886
539
  return UserApiClient.getHiddenUsers();
887
540
  }
888
541
 
889
- static async userAutocomplete() {
890
- return UserApiClient.userAutocomplete();
542
+ static async userAutocomplete(params) {
543
+ return UserApiClient.userAutocomplete(params);
891
544
  }
892
545
 
893
- static async userSearch() {
894
- return UserApiClient.userSearch();
546
+ static async userSearch(params) {
547
+ return UserApiClient.userSearch(params);
895
548
  }
896
549
 
897
550
  static async getSpecificUser(id) {
@@ -902,36 +555,36 @@ class UserService {
902
555
  return UserApiClient.getUserCounters(id);
903
556
  }
904
557
 
905
- static async userUpdate(id) {
906
- return UserApiClient.userUpdate(id);
558
+ static async userUpdate(id, data) {
559
+ return UserApiClient.userUpdate(id, data);
907
560
  }
908
561
 
909
- static async userPatch(id) {
910
- return UserApiClient.userPatch(id);
562
+ static async userPatch(id, data) {
563
+ return UserApiClient.userPatch(id, data);
911
564
  }
912
565
 
913
- static async userDelete(id) {
914
- return UserApiClient.userDelete(id);
566
+ static async userDelete(id, hard) {
567
+ return UserApiClient.userDelete(id, hard);
915
568
  }
916
569
 
917
- static async changeUserMail(id) {
918
- return UserApiClient.changeUserMail(id);
570
+ static async changeUserMail(id, new_email, confirm) {
571
+ return UserApiClient.changeUserMail(id, new_email, confirm);
919
572
  }
920
573
 
921
- static async confirmChangeUserMail(id) {
922
- return UserApiClient.confirmChangeUserMail(id);
574
+ static async confirmChangeUserMail(id, new_email, validation_code) {
575
+ return UserApiClient.confirmChangeUserMail(id, new_email, validation_code);
923
576
  }
924
577
 
925
- static async changeUserPassword(id) {
926
- return UserApiClient.changeUserPassword(id);
578
+ static async changeUserPassword(id, password, new_password) {
579
+ return UserApiClient.changeUserPassword(id, password, new_password);
927
580
  }
928
581
 
929
582
  static async userSettings(id) {
930
583
  return UserApiClient.userSettings(id);
931
584
  }
932
585
 
933
- static async userSettingsPatch(id) {
934
- return UserApiClient.userSettingsPatch(id);
586
+ static async userSettingsPatch(id, data) {
587
+ return UserApiClient.userSettingsPatch(id, data);
935
588
  }
936
589
 
937
590
  static async getCurrentUser() {
@@ -950,20 +603,20 @@ class UserService {
950
603
  return UserApiClient.getCurrentUserPlatform();
951
604
  }
952
605
 
953
- static async getUserFollowedCategories(id) {
954
- return UserApiClient.getUserFollowedCategories(id);
606
+ static async getUserFollowedCategories(id, mutual) {
607
+ return UserApiClient.getUserFollowedCategories(id, mutual);
955
608
  }
956
609
 
957
610
  static async getUserFeed(id) {
958
611
  return UserApiClient.getUserFeed(id);
959
612
  }
960
613
 
961
- static async getUserFollowers(id) {
962
- return UserApiClient.getUserFollowers(id);
614
+ static async getUserFollowers(id, mutual) {
615
+ return UserApiClient.getUserFollowers(id, mutual);
963
616
  }
964
617
 
965
- static async getUserFollowed(id) {
966
- return UserApiClient.getUserFollowed(id);
618
+ static async getUserFollowed(id, mutual) {
619
+ return UserApiClient.getUserFollowed(id, mutual);
967
620
  }
968
621
 
969
622
  static async followUser(id) {
@@ -978,8 +631,8 @@ class UserService {
978
631
  return UserApiClient.checkUserFollower(id);
979
632
  }
980
633
 
981
- static async getUserConnections(id) {
982
- return UserApiClient.getUserConnections(id);
634
+ static async getUserConnections(id, mutual) {
635
+ return UserApiClient.getUserConnections(id, mutual);
983
636
  }
984
637
 
985
638
  static async checkUserConnections(id) {
@@ -1038,8 +691,8 @@ class UserService {
1038
691
  return UserApiClient.getUserLoyaltyPoints(id);
1039
692
  }
1040
693
 
1041
- static async getUserConnectionStatuses() {
1042
- return UserApiClient.getUserConnectionStatuses();
694
+ static async getUserConnectionStatuses(users) {
695
+ return UserApiClient.getUserConnectionStatuses(users);
1043
696
  }
1044
697
 
1045
698
  static async userTagToAddressContribution() {
@@ -1050,20 +703,20 @@ class UserService {
1050
703
  return UserApiClient.checkUserEmailToken();
1051
704
  }
1052
705
 
1053
- static async addUserAvatar() {
1054
- return UserApiClient.addUserAvatar();
706
+ static async addUserAvatar(avatar) {
707
+ return UserApiClient.addUserAvatar(avatar);
1055
708
  }
1056
709
 
1057
710
  static async getUserAvatars() {
1058
711
  return UserApiClient.getUserAvatars();
1059
712
  }
1060
713
 
1061
- static async removeUserAvatar() {
1062
- return UserApiClient.removeUserAvatar();
714
+ static async removeUserAvatar(avatar_id) {
715
+ return UserApiClient.removeUserAvatar(avatar_id);
1063
716
  }
1064
717
 
1065
- static async setUserPrimaryAvatar() {
1066
- return UserApiClient.setUserPrimaryAvatar();
718
+ static async setUserPrimaryAvatar(avatar_id) {
719
+ return UserApiClient.setUserPrimaryAvatar(avatar_id);
1067
720
  }
1068
721
 
1069
722
  }