@selfcommunity/api-services 0.1.28-alpha.3 → 0.1.28
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/services/category/index.d.ts +76 -49
- package/lib/cjs/services/category/index.d.ts.map +1 -1
- package/lib/cjs/services/category/index.js +91 -65
- package/lib/cjs/services/category/index.js.map +1 -1
- package/lib/cjs/services/comment/index.d.ts +55 -34
- package/lib/cjs/services/comment/index.d.ts.map +1 -1
- package/lib/cjs/services/comment/index.js +65 -45
- package/lib/cjs/services/comment/index.js.map +1 -1
- package/lib/cjs/services/custom_adv/index.d.ts +23 -10
- package/lib/cjs/services/custom_adv/index.d.ts.map +1 -1
- package/lib/cjs/services/custom_adv/index.js +25 -13
- package/lib/cjs/services/custom_adv/index.js.map +1 -1
- package/lib/cjs/services/custom_page/index.d.ts +23 -10
- package/lib/cjs/services/custom_page/index.d.ts.map +1 -1
- package/lib/cjs/services/custom_page/index.js +25 -13
- package/lib/cjs/services/custom_page/index.js.map +1 -1
- package/lib/cjs/services/data_portability/index.d.ts +22 -9
- package/lib/cjs/services/data_portability/index.d.ts.map +1 -1
- package/lib/cjs/services/data_portability/index.js +24 -12
- package/lib/cjs/services/data_portability/index.js.map +1 -1
- package/lib/cjs/services/embed/index.d.ts +43 -25
- package/lib/cjs/services/embed/index.d.ts.map +1 -1
- package/lib/cjs/services/embed/index.js +50 -33
- package/lib/cjs/services/embed/index.js.map +1 -1
- package/lib/cjs/services/feature/index.d.ts +14 -3
- package/lib/cjs/services/feature/index.d.ts.map +1 -1
- package/lib/cjs/services/feature/index.js +14 -4
- package/lib/cjs/services/feature/index.js.map +1 -1
- package/lib/cjs/services/feed/index.d.ts +32 -17
- package/lib/cjs/services/feed/index.d.ts.map +1 -1
- package/lib/cjs/services/feed/index.js +36 -22
- package/lib/cjs/services/feed/index.js.map +1 -1
- package/lib/cjs/services/feed_object/index.d.ts +118 -81
- package/lib/cjs/services/feed_object/index.d.ts.map +1 -1
- package/lib/cjs/services/feed_object/index.js +143 -107
- package/lib/cjs/services/feed_object/index.js.map +1 -1
- package/lib/cjs/services/incubator/index.d.ts +39 -22
- package/lib/cjs/services/incubator/index.d.ts.map +1 -1
- package/lib/cjs/services/incubator/index.js +45 -29
- package/lib/cjs/services/incubator/index.js.map +1 -1
- package/lib/cjs/services/insight/index.d.ts +35 -19
- package/lib/cjs/services/insight/index.d.ts.map +1 -1
- package/lib/cjs/services/insight/index.js +40 -25
- package/lib/cjs/services/insight/index.js.map +1 -1
- package/lib/cjs/services/legal_page/index.d.ts +35 -19
- package/lib/cjs/services/legal_page/index.d.ts.map +1 -1
- package/lib/cjs/services/legal_page/index.js +40 -25
- package/lib/cjs/services/legal_page/index.js.map +1 -1
- package/lib/cjs/services/locality/index.d.ts +18 -6
- package/lib/cjs/services/locality/index.d.ts.map +1 -1
- package/lib/cjs/services/locality/index.js +19 -8
- package/lib/cjs/services/locality/index.js.map +1 -1
- package/lib/cjs/services/loyalty/index.d.ts +48 -29
- package/lib/cjs/services/loyalty/index.d.ts.map +1 -1
- package/lib/cjs/services/loyalty/index.js +56 -38
- package/lib/cjs/services/loyalty/index.js.map +1 -1
- package/lib/cjs/services/media/index.d.ts +42 -22
- package/lib/cjs/services/media/index.d.ts.map +1 -1
- package/lib/cjs/services/media/index.js +48 -29
- package/lib/cjs/services/media/index.js.map +1 -1
- package/lib/cjs/services/moderation/index.d.ts +33 -19
- package/lib/cjs/services/moderation/index.d.ts.map +1 -1
- package/lib/cjs/services/moderation/index.js +40 -27
- package/lib/cjs/services/moderation/index.js.map +1 -1
- package/lib/cjs/services/notification/index.d.ts +47 -28
- package/lib/cjs/services/notification/index.d.ts.map +1 -1
- package/lib/cjs/services/notification/index.js +55 -37
- package/lib/cjs/services/notification/index.js.map +1 -1
- package/lib/cjs/services/preference/index.d.ts +23 -10
- package/lib/cjs/services/preference/index.d.ts.map +1 -1
- package/lib/cjs/services/preference/index.js +25 -13
- package/lib/cjs/services/preference/index.js.map +1 -1
- package/lib/cjs/services/private_message/index.d.ts +51 -31
- package/lib/cjs/services/private_message/index.d.ts.map +1 -1
- package/lib/cjs/services/private_message/index.js +60 -41
- package/lib/cjs/services/private_message/index.js.map +1 -1
- package/lib/cjs/services/score/index.d.ts +22 -9
- package/lib/cjs/services/score/index.d.ts.map +1 -1
- package/lib/cjs/services/score/index.js +24 -12
- package/lib/cjs/services/score/index.js.map +1 -1
- package/lib/cjs/services/sso/index.d.ts +18 -6
- package/lib/cjs/services/sso/index.d.ts.map +1 -1
- package/lib/cjs/services/sso/index.js +19 -8
- package/lib/cjs/services/sso/index.js.map +1 -1
- package/lib/cjs/services/suggestion/index.d.ts +26 -12
- package/lib/cjs/services/suggestion/index.d.ts.map +1 -1
- package/lib/cjs/services/suggestion/index.js +29 -16
- package/lib/cjs/services/suggestion/index.js.map +1 -1
- package/lib/cjs/services/tag/index.d.ts +39 -22
- package/lib/cjs/services/tag/index.d.ts.map +1 -1
- package/lib/cjs/services/tag/index.js +45 -29
- package/lib/cjs/services/tag/index.js.map +1 -1
- package/lib/cjs/services/user/index.d.ts +204 -145
- package/lib/cjs/services/user/index.d.ts.map +1 -1
- package/lib/cjs/services/user/index.js +259 -201
- package/lib/cjs/services/user/index.js.map +1 -1
- package/lib/cjs/services/webhook/index.d.ts +59 -37
- package/lib/cjs/services/webhook/index.d.ts.map +1 -1
- package/lib/cjs/services/webhook/index.js +70 -49
- package/lib/cjs/services/webhook/index.js.map +1 -1
- package/lib/cjs/utils/apiRequest.d.ts +2 -1
- package/lib/cjs/utils/apiRequest.d.ts.map +1 -1
- package/lib/cjs/utils/apiRequest.js +4 -8
- package/lib/cjs/utils/apiRequest.js.map +1 -1
- package/lib/esm/services/category/index.d.ts +76 -49
- package/lib/esm/services/category/index.d.ts.map +1 -1
- package/lib/esm/services/category/index.js +91 -65
- package/lib/esm/services/category/index.js.map +1 -1
- package/lib/esm/services/comment/index.d.ts +55 -34
- package/lib/esm/services/comment/index.d.ts.map +1 -1
- package/lib/esm/services/comment/index.js +65 -45
- package/lib/esm/services/comment/index.js.map +1 -1
- package/lib/esm/services/custom_adv/index.d.ts +23 -10
- package/lib/esm/services/custom_adv/index.d.ts.map +1 -1
- package/lib/esm/services/custom_adv/index.js +25 -13
- package/lib/esm/services/custom_adv/index.js.map +1 -1
- package/lib/esm/services/custom_page/index.d.ts +23 -10
- package/lib/esm/services/custom_page/index.d.ts.map +1 -1
- package/lib/esm/services/custom_page/index.js +25 -13
- package/lib/esm/services/custom_page/index.js.map +1 -1
- package/lib/esm/services/data_portability/index.d.ts +22 -9
- package/lib/esm/services/data_portability/index.d.ts.map +1 -1
- package/lib/esm/services/data_portability/index.js +24 -12
- package/lib/esm/services/data_portability/index.js.map +1 -1
- package/lib/esm/services/embed/index.d.ts +43 -25
- package/lib/esm/services/embed/index.d.ts.map +1 -1
- package/lib/esm/services/embed/index.js +50 -33
- package/lib/esm/services/embed/index.js.map +1 -1
- package/lib/esm/services/feature/index.d.ts +14 -3
- package/lib/esm/services/feature/index.d.ts.map +1 -1
- package/lib/esm/services/feature/index.js +14 -4
- package/lib/esm/services/feature/index.js.map +1 -1
- package/lib/esm/services/feed/index.d.ts +32 -17
- package/lib/esm/services/feed/index.d.ts.map +1 -1
- package/lib/esm/services/feed/index.js +36 -22
- package/lib/esm/services/feed/index.js.map +1 -1
- package/lib/esm/services/feed_object/index.d.ts +118 -81
- package/lib/esm/services/feed_object/index.d.ts.map +1 -1
- package/lib/esm/services/feed_object/index.js +143 -107
- package/lib/esm/services/feed_object/index.js.map +1 -1
- package/lib/esm/services/incubator/index.d.ts +39 -22
- package/lib/esm/services/incubator/index.d.ts.map +1 -1
- package/lib/esm/services/incubator/index.js +45 -29
- package/lib/esm/services/incubator/index.js.map +1 -1
- package/lib/esm/services/insight/index.d.ts +35 -19
- package/lib/esm/services/insight/index.d.ts.map +1 -1
- package/lib/esm/services/insight/index.js +40 -25
- package/lib/esm/services/insight/index.js.map +1 -1
- package/lib/esm/services/legal_page/index.d.ts +35 -19
- package/lib/esm/services/legal_page/index.d.ts.map +1 -1
- package/lib/esm/services/legal_page/index.js +40 -25
- package/lib/esm/services/legal_page/index.js.map +1 -1
- package/lib/esm/services/locality/index.d.ts +18 -6
- package/lib/esm/services/locality/index.d.ts.map +1 -1
- package/lib/esm/services/locality/index.js +19 -8
- package/lib/esm/services/locality/index.js.map +1 -1
- package/lib/esm/services/loyalty/index.d.ts +48 -29
- package/lib/esm/services/loyalty/index.d.ts.map +1 -1
- package/lib/esm/services/loyalty/index.js +56 -38
- package/lib/esm/services/loyalty/index.js.map +1 -1
- package/lib/esm/services/media/index.d.ts +42 -22
- package/lib/esm/services/media/index.d.ts.map +1 -1
- package/lib/esm/services/media/index.js +48 -29
- package/lib/esm/services/media/index.js.map +1 -1
- package/lib/esm/services/moderation/index.d.ts +33 -19
- package/lib/esm/services/moderation/index.d.ts.map +1 -1
- package/lib/esm/services/moderation/index.js +40 -27
- package/lib/esm/services/moderation/index.js.map +1 -1
- package/lib/esm/services/notification/index.d.ts +47 -28
- package/lib/esm/services/notification/index.d.ts.map +1 -1
- package/lib/esm/services/notification/index.js +55 -37
- package/lib/esm/services/notification/index.js.map +1 -1
- package/lib/esm/services/preference/index.d.ts +23 -10
- package/lib/esm/services/preference/index.d.ts.map +1 -1
- package/lib/esm/services/preference/index.js +25 -13
- package/lib/esm/services/preference/index.js.map +1 -1
- package/lib/esm/services/private_message/index.d.ts +51 -31
- package/lib/esm/services/private_message/index.d.ts.map +1 -1
- package/lib/esm/services/private_message/index.js +60 -41
- package/lib/esm/services/private_message/index.js.map +1 -1
- package/lib/esm/services/score/index.d.ts +22 -9
- package/lib/esm/services/score/index.d.ts.map +1 -1
- package/lib/esm/services/score/index.js +24 -12
- package/lib/esm/services/score/index.js.map +1 -1
- package/lib/esm/services/sso/index.d.ts +18 -6
- package/lib/esm/services/sso/index.d.ts.map +1 -1
- package/lib/esm/services/sso/index.js +19 -8
- package/lib/esm/services/sso/index.js.map +1 -1
- package/lib/esm/services/suggestion/index.d.ts +26 -12
- package/lib/esm/services/suggestion/index.d.ts.map +1 -1
- package/lib/esm/services/suggestion/index.js +29 -16
- package/lib/esm/services/suggestion/index.js.map +1 -1
- package/lib/esm/services/tag/index.d.ts +39 -22
- package/lib/esm/services/tag/index.d.ts.map +1 -1
- package/lib/esm/services/tag/index.js +45 -29
- package/lib/esm/services/tag/index.js.map +1 -1
- package/lib/esm/services/user/index.d.ts +204 -145
- package/lib/esm/services/user/index.d.ts.map +1 -1
- package/lib/esm/services/user/index.js +259 -201
- package/lib/esm/services/user/index.js.map +1 -1
- package/lib/esm/services/webhook/index.d.ts +59 -37
- package/lib/esm/services/webhook/index.d.ts.map +1 -1
- package/lib/esm/services/webhook/index.js +70 -49
- package/lib/esm/services/webhook/index.js.map +1 -1
- package/lib/esm/utils/apiRequest.d.ts +2 -1
- package/lib/esm/utils/apiRequest.d.ts.map +1 -1
- package/lib/esm/utils/apiRequest.js +4 -8
- package/lib/esm/utils/apiRequest.js.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
|
@@ -16,360 +16,407 @@ export class UserApiClient {
|
|
|
16
16
|
/**
|
|
17
17
|
* This endpoint retrieves the list of all users
|
|
18
18
|
* @param params
|
|
19
|
+
* @param config
|
|
19
20
|
*/
|
|
20
|
-
static getAllUsers(params) {
|
|
21
|
+
static getAllUsers(params, config) {
|
|
21
22
|
const p = new URLSearchParams(params);
|
|
22
|
-
return apiRequest(`${Endpoints.UserList.url({})}?${p.toString()}`, Endpoints.UserList.method);
|
|
23
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: `${Endpoints.UserList.url({})}?${p.toString()}`, method: Endpoints.UserList.method }));
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* This endpoint retrieves the list of all users hidden by the authenticated user
|
|
26
27
|
* @param params
|
|
28
|
+
* @param config
|
|
27
29
|
*/
|
|
28
|
-
static getHiddenUsers(params) {
|
|
30
|
+
static getHiddenUsers(params, config) {
|
|
29
31
|
const p = new URLSearchParams(params);
|
|
30
|
-
return apiRequest(`${Endpoints.ListHiddenUsers.url({})}?${p.toString()}`, Endpoints.ListHiddenUsers.method);
|
|
32
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: `${Endpoints.ListHiddenUsers.url({})}?${p.toString()}`, method: Endpoints.ListHiddenUsers.method }));
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
35
|
* 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.
|
|
34
36
|
* This endpoint is recommended for implementing an autocomplete input field.
|
|
35
37
|
* @param params
|
|
38
|
+
* @param config
|
|
36
39
|
*/
|
|
37
|
-
static userAutocomplete(params) {
|
|
40
|
+
static userAutocomplete(params, config) {
|
|
38
41
|
const p = new URLSearchParams(params);
|
|
39
|
-
return apiRequest(`${Endpoints.UserAutocomplete.url({})}?${p.toString()}`, Endpoints.UserAutocomplete.method);
|
|
42
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: `${Endpoints.UserAutocomplete.url({})}?${p.toString()}`, method: Endpoints.UserAutocomplete.method }));
|
|
40
43
|
}
|
|
41
44
|
/**
|
|
42
45
|
* This endpoint performs users search.
|
|
43
46
|
* @param params
|
|
47
|
+
* @param config
|
|
44
48
|
*/
|
|
45
|
-
static userSearch(params) {
|
|
49
|
+
static userSearch(params, config) {
|
|
46
50
|
const p = new URLSearchParams(params);
|
|
47
|
-
return apiRequest(`${Endpoints.UserSearch.url({})}?${p.toString()}`, Endpoints.UserSearch.method);
|
|
51
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: `${Endpoints.UserSearch.url({})}?${p.toString()}`, method: Endpoints.UserSearch.method }));
|
|
48
52
|
}
|
|
49
53
|
/**
|
|
50
54
|
* This endpoint retrieves a specific user's profile identified by ID.
|
|
51
55
|
* @param id
|
|
56
|
+
* @param config
|
|
52
57
|
*/
|
|
53
|
-
static getSpecificUser(id) {
|
|
54
|
-
return apiRequest(Endpoints.User.url({ id }), Endpoints.User.method);
|
|
58
|
+
static getSpecificUser(id, config) {
|
|
59
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.User.url({ id }), method: Endpoints.User.method }));
|
|
55
60
|
}
|
|
56
61
|
/**
|
|
57
|
-
* This endpoint retrieves the counters of a specific user identified by
|
|
62
|
+
* This endpoint retrieves the counters of a specific user identified by ID.
|
|
58
63
|
* @param id
|
|
64
|
+
* @param config
|
|
59
65
|
*/
|
|
60
|
-
static getUserCounters(id) {
|
|
61
|
-
return apiRequest(Endpoints.UserCounters.url({ id }), Endpoints.UserCounters.method);
|
|
66
|
+
static getUserCounters(id, config) {
|
|
67
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserCounters.url({ id }), method: Endpoints.UserCounters.method }));
|
|
62
68
|
}
|
|
63
69
|
/**
|
|
64
70
|
* This endpoint updates the profile of a user identified by ID. A user can only update their personal data.
|
|
65
|
-
* If the request
|
|
71
|
+
* If the request is willing to update the avatar or the cover the 'Content-Type' request header must be set as 'multipart/form-data', otherwise it can be 'application/x-www-form-urlencoded'.
|
|
66
72
|
* @param id
|
|
67
73
|
* @param data
|
|
74
|
+
* @param config
|
|
68
75
|
*/
|
|
69
|
-
static userUpdate(id, data) {
|
|
70
|
-
return apiRequest(Endpoints.UserUpdate.url({ id }), Endpoints.UserUpdate.method, data);
|
|
76
|
+
static userUpdate(id, data, config) {
|
|
77
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserUpdate.url({ id }), method: Endpoints.UserUpdate.method, data: data }));
|
|
71
78
|
}
|
|
72
79
|
/**
|
|
73
80
|
* This endpoint patches a specific user identified by {id}
|
|
74
81
|
* @param id
|
|
75
82
|
* @param data
|
|
83
|
+
* @param config
|
|
76
84
|
*/
|
|
77
|
-
static userPatch(id, data) {
|
|
78
|
-
return apiRequest(Endpoints.UserPatch.url({ id }), Endpoints.UserPatch.method, data);
|
|
85
|
+
static userPatch(id, data, config) {
|
|
86
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserPatch.url({ id }), method: Endpoints.UserPatch.method, data: data }));
|
|
79
87
|
}
|
|
80
88
|
/**
|
|
81
89
|
* This endpoint deletes a specific user identified by {id}
|
|
82
90
|
* @param id
|
|
83
91
|
* @param hard
|
|
92
|
+
* @param config
|
|
84
93
|
*/
|
|
85
|
-
static userDelete(id, hard) {
|
|
86
|
-
return apiRequest(`${Endpoints.UserDelete.url({ id })}?${hard.toString()}`, Endpoints.UserDelete.method);
|
|
94
|
+
static userDelete(id, hard, config) {
|
|
95
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: `${Endpoints.UserDelete.url({ id })}?${hard.toString()}`, method: Endpoints.UserDelete.method }));
|
|
87
96
|
}
|
|
88
97
|
/**
|
|
89
98
|
* This endpoint changes the email of the authenticated user.
|
|
90
99
|
* @param id
|
|
91
100
|
* @param new_email
|
|
92
101
|
* @param confirm
|
|
102
|
+
* @param config
|
|
93
103
|
*/
|
|
94
|
-
static changeUserMail(id, new_email, confirm) {
|
|
95
|
-
return apiRequest(Endpoints.ChangeUserMail.url({ id }), Endpoints.ChangeUserMail.method, {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
104
|
+
static changeUserMail(id, new_email, confirm, config) {
|
|
105
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.ChangeUserMail.url({ id }), method: Endpoints.ChangeUserMail.method, data: {
|
|
106
|
+
new_email: new_email,
|
|
107
|
+
confirm: confirm
|
|
108
|
+
} }));
|
|
99
109
|
}
|
|
100
110
|
/**
|
|
101
111
|
* This endpoint confirms email change.
|
|
102
112
|
* @param id
|
|
103
113
|
* @param new_email
|
|
104
114
|
* @param validation_code
|
|
115
|
+
* @param config
|
|
105
116
|
*/
|
|
106
|
-
static confirmChangeUserMail(id, new_email, validation_code) {
|
|
107
|
-
return apiRequest(Endpoints.ConfirmUserChangeMail.url({ id }), Endpoints.ConfirmUserChangeMail.method, {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
117
|
+
static confirmChangeUserMail(id, new_email, validation_code, config) {
|
|
118
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.ConfirmUserChangeMail.url({ id }), method: Endpoints.ConfirmUserChangeMail.method, data: {
|
|
119
|
+
new_email: new_email,
|
|
120
|
+
validation_code: validation_code
|
|
121
|
+
} }));
|
|
111
122
|
}
|
|
112
123
|
/**
|
|
113
124
|
* This endpoint changes the password of the authenticated user.
|
|
114
125
|
* @param id
|
|
115
126
|
* @param password
|
|
116
127
|
* @param new_password
|
|
128
|
+
* @param config
|
|
117
129
|
*/
|
|
118
|
-
static changeUserPassword(id, password, new_password) {
|
|
119
|
-
return apiRequest(Endpoints.ChangeUserPassword.url({ id }), Endpoints.ChangeUserPassword.method, {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
130
|
+
static changeUserPassword(id, password, new_password, config) {
|
|
131
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.ChangeUserPassword.url({ id }), method: Endpoints.ChangeUserPassword.method, data: {
|
|
132
|
+
password: password,
|
|
133
|
+
new_password: new_password
|
|
134
|
+
} }));
|
|
123
135
|
}
|
|
124
136
|
/**
|
|
125
137
|
* This endpoint retrieves all current user's settings for the authenticated user.
|
|
126
138
|
* @param id
|
|
139
|
+
* @param config
|
|
127
140
|
*/
|
|
128
|
-
static userSettings(id) {
|
|
129
|
-
return apiRequest(Endpoints.UserSettings.url({ id }), Endpoints.UserSettings.method);
|
|
141
|
+
static userSettings(id, config) {
|
|
142
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserSettings.url({ id }), method: Endpoints.UserSettings.method }));
|
|
130
143
|
}
|
|
131
144
|
/**
|
|
132
145
|
* This endpoint changes the user settings for the authenticated user.
|
|
133
146
|
* @param id
|
|
134
147
|
* @param data
|
|
148
|
+
* @param config
|
|
135
149
|
*/
|
|
136
|
-
static userSettingsPatch(id, data) {
|
|
137
|
-
return apiRequest(Endpoints.UserSettingsPatch.url({ id }), Endpoints.UserSettingsPatch.method, data !== null && data !== void 0 ? data : null);
|
|
150
|
+
static userSettingsPatch(id, data, config) {
|
|
151
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserSettingsPatch.url({ id }), method: Endpoints.UserSettingsPatch.method, data: data !== null && data !== void 0 ? data : null }));
|
|
138
152
|
}
|
|
139
153
|
/**
|
|
140
154
|
* This endpoint returns the user identified by the authentication token.
|
|
155
|
+
* @param config
|
|
141
156
|
*/
|
|
142
|
-
static getCurrentUser() {
|
|
143
|
-
return apiRequest(Endpoints.Me.url(), Endpoints.Me.method);
|
|
157
|
+
static getCurrentUser(config) {
|
|
158
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.Me.url(), method: Endpoints.Me.method }));
|
|
144
159
|
}
|
|
145
160
|
/**
|
|
146
161
|
* This endpoint returns the url to the user's current avatar.
|
|
162
|
+
* @param config
|
|
147
163
|
*/
|
|
148
|
-
static getCurrentUserAvatar() {
|
|
149
|
-
return apiRequest(Endpoints.MyAvatar.url({}), Endpoints.MyAvatar.method);
|
|
164
|
+
static getCurrentUserAvatar(config) {
|
|
165
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.MyAvatar.url({}), method: Endpoints.MyAvatar.method }));
|
|
150
166
|
}
|
|
151
167
|
/**
|
|
152
|
-
* This endpoint returns a list of permissions for the user identified by the authentication token. Some
|
|
168
|
+
* This endpoint returns a list of permissions for the user identified by the authentication token. Some permissions in the list depend on global community settings.
|
|
169
|
+
* @param config
|
|
153
170
|
*/
|
|
154
|
-
static getCurrentUserPermission() {
|
|
155
|
-
return apiRequest(Endpoints.Permission.url({}), Endpoints.Permission.method);
|
|
171
|
+
static getCurrentUserPermission(config) {
|
|
172
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.Permission.url({}), method: Endpoints.Permission.method }));
|
|
156
173
|
}
|
|
157
174
|
/**
|
|
158
175
|
* 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.
|
|
176
|
+
* @param config
|
|
159
177
|
*/
|
|
160
|
-
static getCurrentUserPlatform() {
|
|
161
|
-
return apiRequest(Endpoints.Platform.url({}), Endpoints.Platform.method);
|
|
178
|
+
static getCurrentUserPlatform(config) {
|
|
179
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.Platform.url({}), method: Endpoints.Platform.method }));
|
|
162
180
|
}
|
|
163
181
|
/**
|
|
164
182
|
* This endpoint gets the list of categories followed by the user.
|
|
165
183
|
* @param id
|
|
166
184
|
* @param mutual
|
|
185
|
+
* @param config
|
|
167
186
|
*/
|
|
168
|
-
static getUserFollowedCategories(id, mutual) {
|
|
169
|
-
return apiRequest(Endpoints.FollowedCategories.url({ id, mutual }), Endpoints.FollowedCategories.method);
|
|
187
|
+
static getUserFollowedCategories(id, mutual, config) {
|
|
188
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.FollowedCategories.url({ id, mutual }), method: Endpoints.FollowedCategories.method }));
|
|
170
189
|
}
|
|
171
190
|
/**
|
|
172
191
|
* This endpoint retrieves the list of posts of the user identified by {id}
|
|
173
192
|
* @param id
|
|
193
|
+
* @param config
|
|
174
194
|
*/
|
|
175
|
-
static getUserFeed(id) {
|
|
176
|
-
return apiRequest(Endpoints.UserFeed.url({ id }), Endpoints.UserFeed.method);
|
|
195
|
+
static getUserFeed(id, config) {
|
|
196
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserFeed.url({ id }), method: Endpoints.UserFeed.method }));
|
|
177
197
|
}
|
|
178
198
|
/**
|
|
179
199
|
* This endpoint retrieves the list of followers of a specific user identified by {id}
|
|
180
200
|
* @param id
|
|
181
201
|
* @param mutual
|
|
202
|
+
* @param config
|
|
182
203
|
*/
|
|
183
|
-
static getUserFollowers(id, mutual) {
|
|
184
|
-
return apiRequest(Endpoints.UserFollowers.url({ id, mutual }), Endpoints.UserFollowers.method);
|
|
204
|
+
static getUserFollowers(id, mutual, config) {
|
|
205
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserFollowers.url({ id, mutual }), method: Endpoints.UserFollowers.method }));
|
|
185
206
|
}
|
|
186
207
|
/**
|
|
187
208
|
* This endpoint retrieves the list of following of a specific user identified by {id}.
|
|
188
209
|
* @param id
|
|
189
210
|
* @param mutual
|
|
211
|
+
* @param config
|
|
190
212
|
*/
|
|
191
|
-
static getUserFollowed(id, mutual) {
|
|
192
|
-
return apiRequest(Endpoints.UsersFollowed.url({ id, mutual }), Endpoints.UsersFollowed.method);
|
|
213
|
+
static getUserFollowed(id, mutual, config) {
|
|
214
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UsersFollowed.url({ id, mutual }), method: Endpoints.UsersFollowed.method }));
|
|
193
215
|
}
|
|
194
216
|
/**
|
|
195
217
|
* This endpoint allows a user to follow another user identified by {id}
|
|
196
218
|
* @param id
|
|
219
|
+
* @param config
|
|
197
220
|
*/
|
|
198
|
-
static followUser(id) {
|
|
199
|
-
return apiRequest(Endpoints.FollowUser.url({ id }), Endpoints.FollowUser.method);
|
|
221
|
+
static followUser(id, config) {
|
|
222
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.FollowUser.url({ id }), method: Endpoints.FollowUser.method }));
|
|
200
223
|
}
|
|
201
224
|
/**
|
|
202
225
|
* This endpoint returns is_followed = true if the user (identified in path) is followed by me.
|
|
203
226
|
* @param id
|
|
227
|
+
* @param config
|
|
204
228
|
*/
|
|
205
|
-
static checkUserFollowed(id) {
|
|
206
|
-
return apiRequest(Endpoints.CheckUserFollowed.url({ id }), Endpoints.CheckUserFollowed.method);
|
|
229
|
+
static checkUserFollowed(id, config) {
|
|
230
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.CheckUserFollowed.url({ id }), method: Endpoints.CheckUserFollowed.method }));
|
|
207
231
|
}
|
|
208
232
|
/**
|
|
209
233
|
* This endpoint returns is_follower = true if the user (identified in path) follow me
|
|
210
234
|
* @param id
|
|
235
|
+
* @param config
|
|
211
236
|
*/
|
|
212
|
-
static checkUserFollower(id) {
|
|
213
|
-
return apiRequest(Endpoints.CheckUserFollower.url({ id }), Endpoints.CheckUserFollower.method);
|
|
237
|
+
static checkUserFollower(id, config) {
|
|
238
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.CheckUserFollower.url({ id }), method: Endpoints.CheckUserFollower.method }));
|
|
214
239
|
}
|
|
215
240
|
/**
|
|
216
241
|
* This endpoint retrieves the list of connections of a specific user identified by ID.
|
|
217
242
|
* @param id
|
|
218
243
|
* @param mutual
|
|
244
|
+
* @param config
|
|
219
245
|
*/
|
|
220
|
-
static getUserConnections(id, mutual) {
|
|
221
|
-
return apiRequest(`${Endpoints.UserConnections.url({ id })}?${mutual.toString()}`, Endpoints.UserConnections.method);
|
|
246
|
+
static getUserConnections(id, mutual, config) {
|
|
247
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: `${Endpoints.UserConnections.url({ id })}?${mutual.toString()}`, method: Endpoints.UserConnections.method }));
|
|
222
248
|
}
|
|
223
249
|
/**
|
|
224
250
|
* This endpoint returns is_connection = true if the user (identified in path) is connected with me.
|
|
225
251
|
* @param id
|
|
252
|
+
* @param config
|
|
226
253
|
*/
|
|
227
|
-
static checkUserConnections(id) {
|
|
228
|
-
return apiRequest(Endpoints.UserCheckConnection.url({ id }), Endpoints.UserCheckConnection.method);
|
|
254
|
+
static checkUserConnections(id, config) {
|
|
255
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserCheckConnection.url({ id }), method: Endpoints.UserCheckConnection.method }));
|
|
229
256
|
}
|
|
230
257
|
/**
|
|
231
258
|
* This endpoint retrieves the list of connection requests received by a specific user identified by ID.
|
|
232
259
|
* @param id
|
|
260
|
+
* @param config
|
|
233
261
|
*/
|
|
234
|
-
static getUserConnectionRequests(id) {
|
|
235
|
-
return apiRequest(Endpoints.UserConnectionRequests.url({ id }), Endpoints.UserConnectionRequests.method);
|
|
262
|
+
static getUserConnectionRequests(id, config) {
|
|
263
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserConnectionRequests.url({ id }), method: Endpoints.UserConnectionRequests.method }));
|
|
236
264
|
}
|
|
237
265
|
/**
|
|
238
266
|
* This endpoint retrieves a specific user's list of connection requests sent by user.
|
|
239
267
|
* @param id
|
|
268
|
+
* @param config
|
|
240
269
|
*/
|
|
241
|
-
static getUserRequestConnectionsSent(id) {
|
|
242
|
-
return apiRequest(Endpoints.UserRequestConnectionsSent.url({ id }), Endpoints.UserRequestConnectionsSent.method);
|
|
270
|
+
static getUserRequestConnectionsSent(id, config) {
|
|
271
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserRequestConnectionsSent.url({ id }), method: Endpoints.UserRequestConnectionsSent.method }));
|
|
243
272
|
}
|
|
244
273
|
/**
|
|
245
274
|
* This endpoint accepts a request connection of the user identified by {id}
|
|
246
275
|
* @param id
|
|
276
|
+
* @param config
|
|
247
277
|
*/
|
|
248
|
-
static userAcceptRequestConnection(id) {
|
|
249
|
-
return apiRequest(Endpoints.UserAcceptRequestConnection.url({ id }), Endpoints.UserAcceptRequestConnection.method);
|
|
278
|
+
static userAcceptRequestConnection(id, config) {
|
|
279
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserAcceptRequestConnection.url({ id }), method: Endpoints.UserAcceptRequestConnection.method }));
|
|
250
280
|
}
|
|
251
281
|
/**
|
|
252
282
|
* This endpoint requests a connection to the user identified by {id}
|
|
253
283
|
* @param id
|
|
284
|
+
* @param config
|
|
254
285
|
*/
|
|
255
|
-
static userRequestConnection(id) {
|
|
256
|
-
return apiRequest(Endpoints.UserRequestConnection.url({ id }), Endpoints.UserRequestConnection.method);
|
|
286
|
+
static userRequestConnection(id, config) {
|
|
287
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserRequestConnection.url({ id }), method: Endpoints.UserRequestConnection.method }));
|
|
257
288
|
}
|
|
258
289
|
/**
|
|
259
290
|
* This endpoint removes connection with the user identified by {id}
|
|
260
291
|
* @param id
|
|
292
|
+
* @param config
|
|
261
293
|
*/
|
|
262
|
-
static userRemoveConnection(id) {
|
|
263
|
-
return apiRequest(Endpoints.UserRemoveConnection.url({ id }), Endpoints.UserRemoveConnection.method);
|
|
294
|
+
static userRemoveConnection(id, config) {
|
|
295
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserRemoveConnection.url({ id }), method: Endpoints.UserRemoveConnection.method }));
|
|
264
296
|
}
|
|
265
297
|
/**
|
|
266
298
|
* This endpoint cancels reject connection to a user identified by {id}
|
|
267
299
|
* @param id
|
|
300
|
+
* @param config
|
|
268
301
|
*/
|
|
269
|
-
static userCancelRejectConnectionRequest(id) {
|
|
270
|
-
return apiRequest(Endpoints.UserCancelRejectConnectionRequest.url({ id }), Endpoints.UserCancelRejectConnectionRequest.method);
|
|
302
|
+
static userCancelRejectConnectionRequest(id, config) {
|
|
303
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserCancelRejectConnectionRequest.url({ id }), method: Endpoints.UserCancelRejectConnectionRequest.method }));
|
|
271
304
|
}
|
|
272
305
|
/**
|
|
273
306
|
* This endpoint cancels a request connection for a user.
|
|
274
307
|
* @param id
|
|
308
|
+
* @param config
|
|
275
309
|
*/
|
|
276
|
-
static userCancelRequestConnection(id) {
|
|
277
|
-
return apiRequest(Endpoints.UserCancelRequestConnection.url({ id }), Endpoints.UserCancelRequestConnection.method);
|
|
310
|
+
static userCancelRequestConnection(id, config) {
|
|
311
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserCancelRequestConnection.url({ id }), method: Endpoints.UserCancelRequestConnection.method }));
|
|
278
312
|
}
|
|
279
313
|
/**
|
|
280
314
|
* This endpoint rejects a connection request sent from user identified by {id}
|
|
281
315
|
* @param id
|
|
316
|
+
* @param config
|
|
282
317
|
*/
|
|
283
|
-
static userRejectConnectionRequest(id) {
|
|
284
|
-
return apiRequest(Endpoints.UserRejectConnectionRequest.url({ id }), Endpoints.UserRejectConnectionRequest.method);
|
|
318
|
+
static userRejectConnectionRequest(id, config) {
|
|
319
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserRejectConnectionRequest.url({ id }), method: Endpoints.UserRejectConnectionRequest.method }));
|
|
285
320
|
}
|
|
286
321
|
/**
|
|
287
322
|
* This endpoint marks seen a connection request of user identified by {id} for the authenticated user.
|
|
288
323
|
* @param id
|
|
324
|
+
* @param config
|
|
289
325
|
*/
|
|
290
|
-
static userMarkSeenConnectionRequest(id) {
|
|
291
|
-
return apiRequest(Endpoints.UserMarkSeenConnectionRequest.url({ id }), Endpoints.UserMarkSeenConnectionRequest.method);
|
|
326
|
+
static userMarkSeenConnectionRequest(id, config) {
|
|
327
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserMarkSeenConnectionRequest.url({ id }), method: Endpoints.UserMarkSeenConnectionRequest.method }));
|
|
292
328
|
}
|
|
293
329
|
/**
|
|
294
330
|
* This endpoint shows/hides a user (and its posts) identified by {id} for the authenticated user.
|
|
295
331
|
* @param id
|
|
332
|
+
* @param config
|
|
296
333
|
*/
|
|
297
|
-
static showHideUser(id) {
|
|
298
|
-
return apiRequest(Endpoints.UserShowHide.url({ id }), Endpoints.UserShowHide.method);
|
|
334
|
+
static showHideUser(id, config) {
|
|
335
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserShowHide.url({ id }), method: Endpoints.UserShowHide.method }));
|
|
299
336
|
}
|
|
300
337
|
/**
|
|
301
338
|
* This endpoint returns true if the user (identified in path) is hidden by the authenticated user.
|
|
302
339
|
* @param id
|
|
340
|
+
* @param config
|
|
303
341
|
*/
|
|
304
|
-
static checkUserHidden(id) {
|
|
305
|
-
return apiRequest(Endpoints.CheckUserHidden.url({ id }), Endpoints.CheckUserHidden.method);
|
|
342
|
+
static checkUserHidden(id, config) {
|
|
343
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.CheckUserHidden.url({ id }), method: Endpoints.CheckUserHidden.method }));
|
|
306
344
|
}
|
|
307
345
|
/**
|
|
308
346
|
* This endpoint returns true if the user (identified in path) has hidden by the authenticated user.
|
|
309
347
|
* @param id
|
|
348
|
+
* @param config
|
|
310
349
|
*/
|
|
311
|
-
static checkUserHiddenBy(id) {
|
|
312
|
-
return apiRequest(Endpoints.CheckUserHiddenBy.url({ id }), Endpoints.CheckUserHiddenBy.method);
|
|
350
|
+
static checkUserHiddenBy(id, config) {
|
|
351
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.CheckUserHiddenBy.url({ id }), method: Endpoints.CheckUserHiddenBy.method }));
|
|
313
352
|
}
|
|
314
353
|
/**
|
|
315
354
|
* This endpoint returns user's loyalty points.
|
|
316
355
|
* @param id
|
|
356
|
+
* @param config
|
|
317
357
|
*/
|
|
318
|
-
static getUserLoyaltyPoints(id) {
|
|
319
|
-
return apiRequest(Endpoints.GetUserLoyaltyPoints.url({ id }), Endpoints.GetUserLoyaltyPoints.method);
|
|
358
|
+
static getUserLoyaltyPoints(id, config) {
|
|
359
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.GetUserLoyaltyPoints.url({ id }), method: Endpoints.GetUserLoyaltyPoints.method }));
|
|
320
360
|
}
|
|
321
361
|
/**
|
|
322
362
|
* This endpoint lists the connection/follow statuses of the logged user starting from a users array.
|
|
323
363
|
* @param users
|
|
364
|
+
* @param config
|
|
324
365
|
*/
|
|
325
|
-
static getUserConnectionStatuses(users) {
|
|
326
|
-
return apiRequest(Endpoints.UserConnectionStatuses.url({}), Endpoints.UserConnectionStatuses.method, { users: users });
|
|
366
|
+
static getUserConnectionStatuses(users, config) {
|
|
367
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserConnectionStatuses.url({}), method: Endpoints.UserConnectionStatuses.method, data: { users: users } }));
|
|
327
368
|
}
|
|
328
369
|
/**
|
|
329
370
|
* This endpoint returns user's tags to address a contribution.
|
|
371
|
+
* @param config
|
|
330
372
|
*/
|
|
331
|
-
static userTagToAddressContribution() {
|
|
332
|
-
return apiRequest(Endpoints.UserTagToAddressContribution.url({}), Endpoints.UserTagToAddressContribution.method);
|
|
373
|
+
static userTagToAddressContribution(config) {
|
|
374
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserTagToAddressContribution.url({}), method: Endpoints.UserTagToAddressContribution.method }));
|
|
333
375
|
}
|
|
334
376
|
/**
|
|
335
377
|
* This endpoint checks an email token.
|
|
336
378
|
* @param email_token
|
|
379
|
+
* @param config
|
|
337
380
|
*/
|
|
338
|
-
static checkUserEmailToken(email_token) {
|
|
381
|
+
static checkUserEmailToken(email_token, config) {
|
|
339
382
|
const p = new URLSearchParams({ email_token: email_token });
|
|
340
|
-
return apiRequest(`${Endpoints.CheckEmailToken.url({})}?${p.toString()}`, Endpoints.CheckEmailToken.method);
|
|
383
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: `${Endpoints.CheckEmailToken.url({})}?${p.toString()}`, method: Endpoints.CheckEmailToken.method }));
|
|
341
384
|
}
|
|
342
385
|
/**
|
|
343
386
|
* This endpoint adds an avatar to my avatars.
|
|
344
387
|
* @param avatar
|
|
388
|
+
* @param config
|
|
345
389
|
*/
|
|
346
|
-
static addUserAvatar(avatar) {
|
|
347
|
-
return apiRequest(Endpoints.AddAvatar.url({}), Endpoints.AddAvatar.method, { avatar: avatar });
|
|
390
|
+
static addUserAvatar(avatar, config) {
|
|
391
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.AddAvatar.url({}), method: Endpoints.AddAvatar.method, data: { avatar: avatar } }));
|
|
348
392
|
}
|
|
349
393
|
/**
|
|
350
394
|
* This endpoint retrieves all user avatars.
|
|
395
|
+
* @param config
|
|
351
396
|
*/
|
|
352
|
-
static getUserAvatars() {
|
|
353
|
-
return apiRequest(Endpoints.GetAvatars.url({}), Endpoints.GetAvatars.method);
|
|
397
|
+
static getUserAvatars(config) {
|
|
398
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.GetAvatars.url({}), method: Endpoints.GetAvatars.method }));
|
|
354
399
|
}
|
|
355
400
|
/**
|
|
356
401
|
* This endpoint removes/deletes an avatar from the authenticated user avatars.
|
|
357
402
|
* @param avatar_id
|
|
403
|
+
* @param config
|
|
358
404
|
*/
|
|
359
|
-
static removeUserAvatar(avatar_id) {
|
|
360
|
-
return apiRequest(Endpoints.RemoveAvatar.url({}), Endpoints.RemoveAvatar.method, { avatar_id: avatar_id });
|
|
405
|
+
static removeUserAvatar(avatar_id, config) {
|
|
406
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.RemoveAvatar.url({}), method: Endpoints.RemoveAvatar.method, data: { avatar_id: avatar_id } }));
|
|
361
407
|
}
|
|
362
408
|
/**
|
|
363
409
|
* This endpoint sets the primary avatar for the authenticated user.
|
|
364
410
|
* @param avatar_id
|
|
411
|
+
* @param config
|
|
365
412
|
*/
|
|
366
|
-
static setUserPrimaryAvatar(avatar_id) {
|
|
367
|
-
return apiRequest(Endpoints.SetPrimaryAvatar.url({}), Endpoints.SetPrimaryAvatar.method, { avatar_id: avatar_id });
|
|
413
|
+
static setUserPrimaryAvatar(avatar_id, config) {
|
|
414
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.SetPrimaryAvatar.url({}), method: Endpoints.SetPrimaryAvatar.method, data: { avatar_id: avatar_id } }));
|
|
368
415
|
}
|
|
369
416
|
}
|
|
370
417
|
/**
|
|
371
418
|
*
|
|
372
|
-
:::tipUser service can be used in the following
|
|
419
|
+
:::tipUser service can be used in the following way:
|
|
373
420
|
|
|
374
421
|
```jsx
|
|
375
422
|
1. Import the service from our library:
|
|
@@ -391,242 +438,253 @@ export class UserApiClient {
|
|
|
391
438
|
return await UserService.getSpecificUser(userId);
|
|
392
439
|
}
|
|
393
440
|
```
|
|
441
|
+
|
|
442
|
+
```jsx
|
|
443
|
+
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
|
|
444
|
+
|
|
445
|
+
Ex: If the async function `userUpdate` is willing to update the avatar or the cover the 'Content-Type' request header must be set as 'multipart/form-data'.
|
|
446
|
+
|
|
447
|
+
async getSpecificUser(userId, data, config) {
|
|
448
|
+
const headers = {headers: {'Content-Type': 'multipart/form-data'}}
|
|
449
|
+
return await UserService.getSpecificUser(userId, {avatar: avatar}, headers);
|
|
450
|
+
}
|
|
451
|
+
```
|
|
394
452
|
:::
|
|
395
453
|
*/
|
|
396
454
|
export default class UserService {
|
|
397
|
-
static getAllUsers(params) {
|
|
455
|
+
static getAllUsers(params, config) {
|
|
398
456
|
return __awaiter(this, void 0, void 0, function* () {
|
|
399
|
-
return UserApiClient.getAllUsers(params);
|
|
457
|
+
return UserApiClient.getAllUsers(params, config);
|
|
400
458
|
});
|
|
401
459
|
}
|
|
402
|
-
static getHiddenUsers(params) {
|
|
460
|
+
static getHiddenUsers(params, config) {
|
|
403
461
|
return __awaiter(this, void 0, void 0, function* () {
|
|
404
|
-
return UserApiClient.getHiddenUsers(params);
|
|
462
|
+
return UserApiClient.getHiddenUsers(params, config);
|
|
405
463
|
});
|
|
406
464
|
}
|
|
407
|
-
static userAutocomplete(params) {
|
|
465
|
+
static userAutocomplete(params, config) {
|
|
408
466
|
return __awaiter(this, void 0, void 0, function* () {
|
|
409
|
-
return UserApiClient.userAutocomplete(params);
|
|
467
|
+
return UserApiClient.userAutocomplete(params, config);
|
|
410
468
|
});
|
|
411
469
|
}
|
|
412
|
-
static userSearch(params) {
|
|
470
|
+
static userSearch(params, config) {
|
|
413
471
|
return __awaiter(this, void 0, void 0, function* () {
|
|
414
|
-
return UserApiClient.userSearch(params);
|
|
472
|
+
return UserApiClient.userSearch(params, config);
|
|
415
473
|
});
|
|
416
474
|
}
|
|
417
|
-
static getSpecificUser(id) {
|
|
475
|
+
static getSpecificUser(id, config) {
|
|
418
476
|
return __awaiter(this, void 0, void 0, function* () {
|
|
419
|
-
return UserApiClient.getSpecificUser(id);
|
|
477
|
+
return UserApiClient.getSpecificUser(id, config);
|
|
420
478
|
});
|
|
421
479
|
}
|
|
422
|
-
static getUserCounters(id) {
|
|
480
|
+
static getUserCounters(id, config) {
|
|
423
481
|
return __awaiter(this, void 0, void 0, function* () {
|
|
424
|
-
return UserApiClient.getUserCounters(id);
|
|
482
|
+
return UserApiClient.getUserCounters(id, config);
|
|
425
483
|
});
|
|
426
484
|
}
|
|
427
|
-
static userUpdate(id, data) {
|
|
485
|
+
static userUpdate(id, data, config) {
|
|
428
486
|
return __awaiter(this, void 0, void 0, function* () {
|
|
429
|
-
return UserApiClient.userUpdate(id, data);
|
|
487
|
+
return UserApiClient.userUpdate(id, data, config);
|
|
430
488
|
});
|
|
431
489
|
}
|
|
432
|
-
static userPatch(id, data) {
|
|
490
|
+
static userPatch(id, data, config) {
|
|
433
491
|
return __awaiter(this, void 0, void 0, function* () {
|
|
434
|
-
return UserApiClient.userPatch(id, data);
|
|
492
|
+
return UserApiClient.userPatch(id, data, config);
|
|
435
493
|
});
|
|
436
494
|
}
|
|
437
|
-
static userDelete(id, hard) {
|
|
495
|
+
static userDelete(id, hard, config) {
|
|
438
496
|
return __awaiter(this, void 0, void 0, function* () {
|
|
439
|
-
return UserApiClient.userDelete(id, hard);
|
|
497
|
+
return UserApiClient.userDelete(id, hard, config);
|
|
440
498
|
});
|
|
441
499
|
}
|
|
442
|
-
static changeUserMail(id, new_email, confirm) {
|
|
500
|
+
static changeUserMail(id, new_email, confirm, config) {
|
|
443
501
|
return __awaiter(this, void 0, void 0, function* () {
|
|
444
|
-
return UserApiClient.changeUserMail(id, new_email, confirm);
|
|
502
|
+
return UserApiClient.changeUserMail(id, new_email, confirm, config);
|
|
445
503
|
});
|
|
446
504
|
}
|
|
447
|
-
static confirmChangeUserMail(id, new_email, validation_code) {
|
|
505
|
+
static confirmChangeUserMail(id, new_email, validation_code, config) {
|
|
448
506
|
return __awaiter(this, void 0, void 0, function* () {
|
|
449
|
-
return UserApiClient.confirmChangeUserMail(id, new_email, validation_code);
|
|
507
|
+
return UserApiClient.confirmChangeUserMail(id, new_email, validation_code, config);
|
|
450
508
|
});
|
|
451
509
|
}
|
|
452
|
-
static changeUserPassword(id, password, new_password) {
|
|
510
|
+
static changeUserPassword(id, password, new_password, config) {
|
|
453
511
|
return __awaiter(this, void 0, void 0, function* () {
|
|
454
|
-
return UserApiClient.changeUserPassword(id, password, new_password);
|
|
512
|
+
return UserApiClient.changeUserPassword(id, password, new_password, config);
|
|
455
513
|
});
|
|
456
514
|
}
|
|
457
|
-
static userSettings(id) {
|
|
515
|
+
static userSettings(id, config) {
|
|
458
516
|
return __awaiter(this, void 0, void 0, function* () {
|
|
459
|
-
return UserApiClient.userSettings(id);
|
|
517
|
+
return UserApiClient.userSettings(id, config);
|
|
460
518
|
});
|
|
461
519
|
}
|
|
462
|
-
static userSettingsPatch(id, data) {
|
|
520
|
+
static userSettingsPatch(id, data, config) {
|
|
463
521
|
return __awaiter(this, void 0, void 0, function* () {
|
|
464
|
-
return UserApiClient.userSettingsPatch(id, data);
|
|
522
|
+
return UserApiClient.userSettingsPatch(id, data, config);
|
|
465
523
|
});
|
|
466
524
|
}
|
|
467
|
-
static getCurrentUser() {
|
|
525
|
+
static getCurrentUser(config) {
|
|
468
526
|
return __awaiter(this, void 0, void 0, function* () {
|
|
469
|
-
return UserApiClient.getCurrentUser();
|
|
527
|
+
return UserApiClient.getCurrentUser(config);
|
|
470
528
|
});
|
|
471
529
|
}
|
|
472
|
-
static getCurrentUserAvatar() {
|
|
530
|
+
static getCurrentUserAvatar(config) {
|
|
473
531
|
return __awaiter(this, void 0, void 0, function* () {
|
|
474
|
-
return UserApiClient.getCurrentUserAvatar();
|
|
532
|
+
return UserApiClient.getCurrentUserAvatar(config);
|
|
475
533
|
});
|
|
476
534
|
}
|
|
477
|
-
static getCurrentUserPermission() {
|
|
535
|
+
static getCurrentUserPermission(config) {
|
|
478
536
|
return __awaiter(this, void 0, void 0, function* () {
|
|
479
|
-
return UserApiClient.getCurrentUserPermission();
|
|
537
|
+
return UserApiClient.getCurrentUserPermission(config);
|
|
480
538
|
});
|
|
481
539
|
}
|
|
482
|
-
static getCurrentUserPlatform() {
|
|
540
|
+
static getCurrentUserPlatform(config) {
|
|
483
541
|
return __awaiter(this, void 0, void 0, function* () {
|
|
484
|
-
return UserApiClient.getCurrentUserPlatform();
|
|
542
|
+
return UserApiClient.getCurrentUserPlatform(config);
|
|
485
543
|
});
|
|
486
544
|
}
|
|
487
|
-
static getUserFollowedCategories(id, mutual) {
|
|
545
|
+
static getUserFollowedCategories(id, mutual, config) {
|
|
488
546
|
return __awaiter(this, void 0, void 0, function* () {
|
|
489
|
-
return UserApiClient.getUserFollowedCategories(id, mutual);
|
|
547
|
+
return UserApiClient.getUserFollowedCategories(id, mutual, config);
|
|
490
548
|
});
|
|
491
549
|
}
|
|
492
|
-
static getUserFeed(id) {
|
|
550
|
+
static getUserFeed(id, config) {
|
|
493
551
|
return __awaiter(this, void 0, void 0, function* () {
|
|
494
|
-
return UserApiClient.getUserFeed(id);
|
|
552
|
+
return UserApiClient.getUserFeed(id, config);
|
|
495
553
|
});
|
|
496
554
|
}
|
|
497
|
-
static getUserFollowers(id, mutual) {
|
|
555
|
+
static getUserFollowers(id, mutual, config) {
|
|
498
556
|
return __awaiter(this, void 0, void 0, function* () {
|
|
499
|
-
return UserApiClient.getUserFollowers(id, mutual);
|
|
557
|
+
return UserApiClient.getUserFollowers(id, mutual, config);
|
|
500
558
|
});
|
|
501
559
|
}
|
|
502
|
-
static getUserFollowed(id, mutual) {
|
|
560
|
+
static getUserFollowed(id, mutual, config) {
|
|
503
561
|
return __awaiter(this, void 0, void 0, function* () {
|
|
504
|
-
return UserApiClient.getUserFollowed(id, mutual);
|
|
562
|
+
return UserApiClient.getUserFollowed(id, mutual, config);
|
|
505
563
|
});
|
|
506
564
|
}
|
|
507
|
-
static followUser(id) {
|
|
565
|
+
static followUser(id, config) {
|
|
508
566
|
return __awaiter(this, void 0, void 0, function* () {
|
|
509
|
-
return UserApiClient.followUser(id);
|
|
567
|
+
return UserApiClient.followUser(id, config);
|
|
510
568
|
});
|
|
511
569
|
}
|
|
512
|
-
static checkUserFollowed(id) {
|
|
570
|
+
static checkUserFollowed(id, config) {
|
|
513
571
|
return __awaiter(this, void 0, void 0, function* () {
|
|
514
|
-
return UserApiClient.checkUserFollowed(id);
|
|
572
|
+
return UserApiClient.checkUserFollowed(id, config);
|
|
515
573
|
});
|
|
516
574
|
}
|
|
517
|
-
static checkUserFollower(id) {
|
|
575
|
+
static checkUserFollower(id, config) {
|
|
518
576
|
return __awaiter(this, void 0, void 0, function* () {
|
|
519
|
-
return UserApiClient.checkUserFollower(id);
|
|
577
|
+
return UserApiClient.checkUserFollower(id, config);
|
|
520
578
|
});
|
|
521
579
|
}
|
|
522
|
-
static getUserConnections(id, mutual) {
|
|
580
|
+
static getUserConnections(id, mutual, config) {
|
|
523
581
|
return __awaiter(this, void 0, void 0, function* () {
|
|
524
|
-
return UserApiClient.getUserConnections(id, mutual);
|
|
582
|
+
return UserApiClient.getUserConnections(id, mutual, config);
|
|
525
583
|
});
|
|
526
584
|
}
|
|
527
|
-
static checkUserConnections(id) {
|
|
585
|
+
static checkUserConnections(id, config) {
|
|
528
586
|
return __awaiter(this, void 0, void 0, function* () {
|
|
529
|
-
return UserApiClient.checkUserConnections(id);
|
|
587
|
+
return UserApiClient.checkUserConnections(id, config);
|
|
530
588
|
});
|
|
531
589
|
}
|
|
532
|
-
static getUserConnectionRequests(id) {
|
|
590
|
+
static getUserConnectionRequests(id, config) {
|
|
533
591
|
return __awaiter(this, void 0, void 0, function* () {
|
|
534
|
-
return UserApiClient.getUserConnectionRequests(id);
|
|
592
|
+
return UserApiClient.getUserConnectionRequests(id, config);
|
|
535
593
|
});
|
|
536
594
|
}
|
|
537
|
-
static getUserRequestConnectionsSent(id) {
|
|
595
|
+
static getUserRequestConnectionsSent(id, config) {
|
|
538
596
|
return __awaiter(this, void 0, void 0, function* () {
|
|
539
|
-
return UserApiClient.getUserRequestConnectionsSent(id);
|
|
597
|
+
return UserApiClient.getUserRequestConnectionsSent(id, config);
|
|
540
598
|
});
|
|
541
599
|
}
|
|
542
|
-
static userAcceptRequestConnection(id) {
|
|
600
|
+
static userAcceptRequestConnection(id, config) {
|
|
543
601
|
return __awaiter(this, void 0, void 0, function* () {
|
|
544
|
-
return UserApiClient.userAcceptRequestConnection(id);
|
|
602
|
+
return UserApiClient.userAcceptRequestConnection(id, config);
|
|
545
603
|
});
|
|
546
604
|
}
|
|
547
|
-
static userRequestConnection(id) {
|
|
605
|
+
static userRequestConnection(id, config) {
|
|
548
606
|
return __awaiter(this, void 0, void 0, function* () {
|
|
549
|
-
return UserApiClient.userRequestConnection(id);
|
|
607
|
+
return UserApiClient.userRequestConnection(id, config);
|
|
550
608
|
});
|
|
551
609
|
}
|
|
552
|
-
static userRemoveConnection(id) {
|
|
610
|
+
static userRemoveConnection(id, config) {
|
|
553
611
|
return __awaiter(this, void 0, void 0, function* () {
|
|
554
|
-
return UserApiClient.userRemoveConnection(id);
|
|
612
|
+
return UserApiClient.userRemoveConnection(id, config);
|
|
555
613
|
});
|
|
556
614
|
}
|
|
557
|
-
static userCancelRejectConnectionRequest(id) {
|
|
615
|
+
static userCancelRejectConnectionRequest(id, config) {
|
|
558
616
|
return __awaiter(this, void 0, void 0, function* () {
|
|
559
|
-
return UserApiClient.userCancelRejectConnectionRequest(id);
|
|
617
|
+
return UserApiClient.userCancelRejectConnectionRequest(id, config);
|
|
560
618
|
});
|
|
561
619
|
}
|
|
562
|
-
static userCancelRequestConnection(id) {
|
|
620
|
+
static userCancelRequestConnection(id, config) {
|
|
563
621
|
return __awaiter(this, void 0, void 0, function* () {
|
|
564
|
-
return UserApiClient.userCancelRequestConnection(id);
|
|
622
|
+
return UserApiClient.userCancelRequestConnection(id, config);
|
|
565
623
|
});
|
|
566
624
|
}
|
|
567
|
-
static userRejectConnectionRequest(id) {
|
|
625
|
+
static userRejectConnectionRequest(id, config) {
|
|
568
626
|
return __awaiter(this, void 0, void 0, function* () {
|
|
569
|
-
return UserApiClient.userRejectConnectionRequest(id);
|
|
627
|
+
return UserApiClient.userRejectConnectionRequest(id, config);
|
|
570
628
|
});
|
|
571
629
|
}
|
|
572
|
-
static userMarkSeenConnectionRequest(id) {
|
|
630
|
+
static userMarkSeenConnectionRequest(id, config) {
|
|
573
631
|
return __awaiter(this, void 0, void 0, function* () {
|
|
574
|
-
return UserApiClient.userMarkSeenConnectionRequest(id);
|
|
632
|
+
return UserApiClient.userMarkSeenConnectionRequest(id, config);
|
|
575
633
|
});
|
|
576
634
|
}
|
|
577
|
-
static showHideUser(id) {
|
|
635
|
+
static showHideUser(id, config) {
|
|
578
636
|
return __awaiter(this, void 0, void 0, function* () {
|
|
579
|
-
return UserApiClient.showHideUser(id);
|
|
637
|
+
return UserApiClient.showHideUser(id, config);
|
|
580
638
|
});
|
|
581
639
|
}
|
|
582
|
-
static checkUserHidden(id) {
|
|
640
|
+
static checkUserHidden(id, config) {
|
|
583
641
|
return __awaiter(this, void 0, void 0, function* () {
|
|
584
|
-
return UserApiClient.checkUserHidden(id);
|
|
642
|
+
return UserApiClient.checkUserHidden(id, config);
|
|
585
643
|
});
|
|
586
644
|
}
|
|
587
|
-
static checkUserHiddenBy(id) {
|
|
645
|
+
static checkUserHiddenBy(id, config) {
|
|
588
646
|
return __awaiter(this, void 0, void 0, function* () {
|
|
589
|
-
return UserApiClient.checkUserHiddenBy(id);
|
|
647
|
+
return UserApiClient.checkUserHiddenBy(id, config);
|
|
590
648
|
});
|
|
591
649
|
}
|
|
592
|
-
static getUserLoyaltyPoints(id) {
|
|
650
|
+
static getUserLoyaltyPoints(id, config) {
|
|
593
651
|
return __awaiter(this, void 0, void 0, function* () {
|
|
594
|
-
return UserApiClient.getUserLoyaltyPoints(id);
|
|
652
|
+
return UserApiClient.getUserLoyaltyPoints(id, config);
|
|
595
653
|
});
|
|
596
654
|
}
|
|
597
|
-
static getUserConnectionStatuses(users) {
|
|
655
|
+
static getUserConnectionStatuses(users, config) {
|
|
598
656
|
return __awaiter(this, void 0, void 0, function* () {
|
|
599
|
-
return UserApiClient.getUserConnectionStatuses(users);
|
|
657
|
+
return UserApiClient.getUserConnectionStatuses(users, config);
|
|
600
658
|
});
|
|
601
659
|
}
|
|
602
|
-
static userTagToAddressContribution() {
|
|
660
|
+
static userTagToAddressContribution(config) {
|
|
603
661
|
return __awaiter(this, void 0, void 0, function* () {
|
|
604
|
-
return UserApiClient.userTagToAddressContribution();
|
|
662
|
+
return UserApiClient.userTagToAddressContribution(config);
|
|
605
663
|
});
|
|
606
664
|
}
|
|
607
|
-
static checkUserEmailToken(email_token) {
|
|
665
|
+
static checkUserEmailToken(email_token, config) {
|
|
608
666
|
return __awaiter(this, void 0, void 0, function* () {
|
|
609
|
-
return UserApiClient.checkUserEmailToken(email_token);
|
|
667
|
+
return UserApiClient.checkUserEmailToken(email_token, config);
|
|
610
668
|
});
|
|
611
669
|
}
|
|
612
|
-
static addUserAvatar(avatar) {
|
|
670
|
+
static addUserAvatar(avatar, config) {
|
|
613
671
|
return __awaiter(this, void 0, void 0, function* () {
|
|
614
|
-
return UserApiClient.addUserAvatar(avatar);
|
|
672
|
+
return UserApiClient.addUserAvatar(avatar, config);
|
|
615
673
|
});
|
|
616
674
|
}
|
|
617
|
-
static getUserAvatars() {
|
|
675
|
+
static getUserAvatars(config) {
|
|
618
676
|
return __awaiter(this, void 0, void 0, function* () {
|
|
619
|
-
return UserApiClient.getUserAvatars();
|
|
677
|
+
return UserApiClient.getUserAvatars(config);
|
|
620
678
|
});
|
|
621
679
|
}
|
|
622
|
-
static removeUserAvatar(avatar_id) {
|
|
680
|
+
static removeUserAvatar(avatar_id, config) {
|
|
623
681
|
return __awaiter(this, void 0, void 0, function* () {
|
|
624
|
-
return UserApiClient.removeUserAvatar(avatar_id);
|
|
682
|
+
return UserApiClient.removeUserAvatar(avatar_id, config);
|
|
625
683
|
});
|
|
626
684
|
}
|
|
627
|
-
static setUserPrimaryAvatar(avatar_id) {
|
|
685
|
+
static setUserPrimaryAvatar(avatar_id, config) {
|
|
628
686
|
return __awaiter(this, void 0, void 0, function* () {
|
|
629
|
-
return UserApiClient.setUserPrimaryAvatar(avatar_id);
|
|
687
|
+
return UserApiClient.setUserPrimaryAvatar(avatar_id, config);
|
|
630
688
|
});
|
|
631
689
|
}
|
|
632
690
|
}
|