@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.
- package/lib/cjs/index.js +36 -0
- package/lib/cjs/services/category/index.js +168 -286
- package/lib/cjs/services/comment/index.js +107 -186
- package/lib/cjs/services/custom_adv/index.js +31 -51
- package/lib/cjs/services/custom_page/index.js +32 -52
- package/lib/cjs/services/data_portability/index.js +18 -43
- package/lib/cjs/services/embed/index.js +90 -151
- package/lib/cjs/services/feature/index.js +8 -16
- package/lib/cjs/services/feed/index.js +46 -81
- package/lib/cjs/services/feed_object/index.js +339 -505
- package/lib/cjs/services/incubator/index.js +64 -116
- package/lib/cjs/services/insight/index.js +51 -94
- package/lib/cjs/services/legal_page/index.js +60 -101
- package/lib/cjs/services/locality/index.js +14 -30
- package/lib/cjs/services/loyalty/index.js +92 -154
- package/lib/cjs/services/media/index.js +80 -122
- package/lib/cjs/services/moderation/index.js +65 -103
- package/lib/cjs/services/notification/index.js +67 -136
- package/lib/cjs/services/preference/index.js +25 -51
- package/lib/cjs/services/private_message/index.js +98 -177
- package/lib/cjs/services/score/index.js +22 -46
- package/lib/cjs/services/sso/index.js +17 -32
- package/lib/cjs/services/suggestion/index.js +23 -57
- package/lib/cjs/services/tag/index.js +72 -119
- package/lib/cjs/services/user/index.js +420 -767
- package/lib/cjs/services/webhook/index.js +4 -7
- package/lib/cjs/types/baseParams.js +3 -0
- package/lib/cjs/types/category.js +3 -0
- package/lib/cjs/types/comment.js +3 -0
- package/lib/cjs/types/customAdv.js +3 -0
- package/lib/cjs/types/customPage.js +3 -0
- package/lib/cjs/types/embed.js +3 -0
- package/lib/cjs/types/feed.js +3 -0
- package/lib/cjs/types/feedObject.js +3 -0
- package/lib/cjs/types/incubator.js +3 -0
- package/lib/cjs/types/index.js +91 -1
- package/lib/cjs/types/legalPage.js +3 -0
- package/lib/cjs/types/media.js +29 -0
- package/lib/cjs/types/moderation.js +3 -0
- package/lib/cjs/types/notification.js +3 -0
- package/lib/cjs/types/privateMessage.js +3 -0
- package/lib/cjs/types/prize.js +3 -0
- package/lib/cjs/types/sso.js +3 -0
- package/lib/cjs/types/tag.js +3 -0
- package/lib/cjs/types/user.js +3 -0
- package/lib/cjs/utils/apiRequest.js +2 -1
- package/lib/esm/index.js +36 -0
- package/lib/esm/services/category/index.js +168 -286
- package/lib/esm/services/comment/index.js +107 -186
- package/lib/esm/services/custom_adv/index.js +31 -51
- package/lib/esm/services/custom_page/index.js +32 -52
- package/lib/esm/services/data_portability/index.js +18 -43
- package/lib/esm/services/embed/index.js +90 -151
- package/lib/esm/services/feature/index.js +8 -16
- package/lib/esm/services/feed/index.js +46 -81
- package/lib/esm/services/feed_object/index.js +339 -505
- package/lib/esm/services/incubator/index.js +64 -116
- package/lib/esm/services/insight/index.js +51 -94
- package/lib/esm/services/legal_page/index.js +60 -101
- package/lib/esm/services/locality/index.js +14 -30
- package/lib/esm/services/loyalty/index.js +92 -154
- package/lib/esm/services/media/index.js +80 -122
- package/lib/esm/services/moderation/index.js +65 -103
- package/lib/esm/services/notification/index.js +67 -136
- package/lib/esm/services/preference/index.js +25 -51
- package/lib/esm/services/private_message/index.js +98 -177
- package/lib/esm/services/score/index.js +22 -46
- package/lib/esm/services/sso/index.js +17 -32
- package/lib/esm/services/suggestion/index.js +23 -57
- package/lib/esm/services/tag/index.js +72 -119
- package/lib/esm/services/user/index.js +420 -767
- package/lib/esm/services/webhook/index.js +4 -7
- package/lib/esm/types/baseParams.js +3 -0
- package/lib/esm/types/category.js +3 -0
- package/lib/esm/types/comment.js +3 -0
- package/lib/esm/types/customAdv.js +3 -0
- package/lib/esm/types/customPage.js +3 -0
- package/lib/esm/types/embed.js +3 -0
- package/lib/esm/types/feed.js +3 -0
- package/lib/esm/types/feedObject.js +3 -0
- package/lib/esm/types/incubator.js +3 -0
- package/lib/esm/types/index.js +91 -1
- package/lib/esm/types/legalPage.js +3 -0
- package/lib/esm/types/media.js +29 -0
- package/lib/esm/types/moderation.js +3 -0
- package/lib/esm/types/notification.js +3 -0
- package/lib/esm/types/privateMessage.js +3 -0
- package/lib/esm/types/prize.js +3 -0
- package/lib/esm/types/sso.js +3 -0
- package/lib/esm/types/tag.js +3 -0
- package/lib/esm/types/user.js +3 -0
- package/lib/esm/utils/apiRequest.js +2 -1
- package/lib/types/index.d.ts +2 -2
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/services/category/index.d.ts +114 -42
- package/lib/types/services/category/index.d.ts.map +1 -1
- package/lib/types/services/comment/index.d.ts +74 -23
- package/lib/types/services/comment/index.d.ts.map +1 -1
- package/lib/types/services/custom_adv/index.d.ts +26 -9
- package/lib/types/services/custom_adv/index.d.ts.map +1 -1
- package/lib/types/services/custom_page/index.d.ts +26 -9
- package/lib/types/services/custom_page/index.d.ts.map +1 -1
- package/lib/types/services/data_portability/index.d.ts +19 -6
- package/lib/types/services/data_portability/index.d.ts.map +1 -1
- package/lib/types/services/embed/index.d.ts +62 -24
- package/lib/types/services/embed/index.d.ts.map +1 -1
- package/lib/types/services/feature/index.d.ts +11 -3
- package/lib/types/services/feature/index.d.ts.map +1 -1
- package/lib/types/services/feed/index.d.ts +37 -15
- package/lib/types/services/feed/index.d.ts.map +1 -1
- package/lib/types/services/feed_object/index.d.ts +229 -81
- package/lib/types/services/feed_object/index.d.ts.map +1 -1
- package/lib/types/services/incubator/index.d.ts +51 -18
- package/lib/types/services/incubator/index.d.ts.map +1 -1
- package/lib/types/services/insight/index.d.ts +44 -18
- package/lib/types/services/insight/index.d.ts.map +1 -1
- package/lib/types/services/legal_page/index.d.ts +46 -18
- package/lib/types/services/legal_page/index.d.ts.map +1 -1
- package/lib/types/services/locality/index.d.ts +17 -6
- package/lib/types/services/locality/index.d.ts.map +1 -1
- package/lib/types/services/loyalty/index.d.ts +70 -27
- package/lib/types/services/loyalty/index.d.ts.map +1 -1
- package/lib/types/services/media/index.d.ts +55 -18
- package/lib/types/services/media/index.d.ts.map +1 -1
- package/lib/types/services/moderation/index.d.ts +51 -18
- package/lib/types/services/moderation/index.d.ts.map +1 -1
- package/lib/types/services/notification/index.d.ts +63 -27
- package/lib/types/services/notification/index.d.ts.map +1 -1
- package/lib/types/services/preference/index.d.ts +28 -9
- package/lib/types/services/preference/index.d.ts.map +1 -1
- package/lib/types/services/private_message/index.d.ts +68 -24
- package/lib/types/services/private_message/index.d.ts.map +1 -1
- package/lib/types/services/score/index.d.ts +24 -9
- package/lib/types/services/score/index.d.ts.map +1 -1
- package/lib/types/services/sso/index.d.ts +18 -6
- package/lib/types/services/sso/index.d.ts.map +1 -1
- package/lib/types/services/suggestion/index.d.ts +29 -12
- package/lib/types/services/suggestion/index.d.ts.map +1 -1
- package/lib/types/services/tag/index.d.ts +57 -21
- package/lib/types/services/tag/index.d.ts.map +1 -1
- package/lib/types/services/user/index.d.ts +313 -114
- package/lib/types/services/user/index.d.ts.map +1 -1
- package/lib/types/services/webhook/index.d.ts +3 -4
- package/lib/types/services/webhook/index.d.ts.map +1 -1
- package/lib/types/tsconfig.build.tsbuildinfo +1 -1
- package/lib/types/types/baseParams.d.ts +23 -0
- package/lib/types/types/baseParams.d.ts.map +1 -0
- package/lib/types/types/category.d.ts +15 -0
- package/lib/types/types/category.d.ts.map +1 -0
- package/lib/types/types/comment.d.ts +51 -0
- package/lib/types/types/comment.d.ts.map +1 -0
- package/lib/types/types/customAdv.d.ts +19 -0
- package/lib/types/types/customAdv.d.ts.map +1 -0
- package/lib/types/types/customPage.d.ts +24 -0
- package/lib/types/types/customPage.d.ts.map +1 -0
- package/lib/types/types/embed.d.ts +26 -0
- package/lib/types/types/embed.d.ts.map +1 -0
- package/lib/types/types/feed.d.ts +11 -0
- package/lib/types/types/feed.d.ts.map +1 -0
- package/lib/types/types/feedObject.d.ts +56 -0
- package/lib/types/types/feedObject.d.ts.map +1 -0
- package/lib/types/types/incubator.d.ts +33 -0
- package/lib/types/types/incubator.d.ts.map +1 -0
- package/lib/types/types/index.d.ts +19 -1
- package/lib/types/types/index.d.ts.map +1 -1
- package/lib/types/types/legalPage.d.ts +19 -0
- package/lib/types/types/legalPage.d.ts.map +1 -0
- package/lib/types/types/media.d.ts +80 -0
- package/lib/types/types/media.d.ts.map +1 -0
- package/lib/types/types/moderation.d.ts +23 -0
- package/lib/types/types/moderation.d.ts.map +1 -0
- package/lib/types/types/notification.d.ts +31 -0
- package/lib/types/types/notification.d.ts.map +1 -0
- package/lib/types/types/privateMessage.d.ts +176 -0
- package/lib/types/types/privateMessage.d.ts.map +1 -0
- package/lib/types/types/prize.d.ts +47 -0
- package/lib/types/types/prize.d.ts.map +1 -0
- package/lib/types/types/sso.d.ts +12 -0
- package/lib/types/types/sso.d.ts.map +1 -0
- package/lib/types/types/tag.d.ts +39 -0
- package/lib/types/types/tag.d.ts.map +1 -0
- package/lib/types/types/user.d.ts +105 -0
- package/lib/types/types/user.d.ts.map +1 -0
- package/lib/types/utils/apiRequest.d.ts +1 -1
- package/lib/types/utils/apiRequest.d.ts.map +1 -1
- package/lib/umd/api-services.js +1 -1
- package/lib/umd/api-services.js.map +1 -1
- 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
|
|
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
|
|
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
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
|
83
|
-
|
|
84
|
-
|
|
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
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
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
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
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
|
|
235
|
-
|
|
236
|
-
|
|
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
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
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
|
|
360
|
-
|
|
361
|
-
|
|
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
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
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
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
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
|
|
417
|
-
|
|
418
|
-
|
|
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
|
|
436
|
-
|
|
437
|
-
|
|
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
|
|
455
|
-
|
|
456
|
-
|
|
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
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
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
|
|
493
|
-
|
|
494
|
-
|
|
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
|
|
512
|
-
|
|
513
|
-
|
|
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
|
|
531
|
-
|
|
532
|
-
|
|
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
|
|
550
|
-
|
|
551
|
-
|
|
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
|
|
569
|
-
|
|
570
|
-
|
|
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
|
|
588
|
-
|
|
589
|
-
|
|
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
|
|
607
|
-
|
|
608
|
-
|
|
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
|
|
626
|
-
|
|
627
|
-
|
|
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
|
|
645
|
-
|
|
646
|
-
|
|
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
|
|
664
|
-
|
|
665
|
-
|
|
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
|
|
683
|
-
|
|
684
|
-
|
|
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
|
|
702
|
-
|
|
703
|
-
|
|
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
|
|
721
|
-
|
|
722
|
-
|
|
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
|
|
740
|
-
|
|
741
|
-
|
|
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
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
}
|
|
813
|
-
|
|
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
|
|
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
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
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
|
|
861
|
-
|
|
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
|
}
|