@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,543 +3,377 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = exports.FeedObjectApiClient = 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 feed objs (discussions-posts-statuses).
|
|
14
|
+
*/
|
|
12
15
|
class FeedObjectApiClient {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
/**
|
|
17
|
+
* This endpoint retrieves all feed objs
|
|
18
|
+
* @param type
|
|
19
|
+
* @param params
|
|
20
|
+
*/
|
|
21
|
+
static getAllFeedObjects(type, params) {
|
|
22
|
+
const p = new URLSearchParams(params);
|
|
23
|
+
return (0, _apiRequest.apiRequest)(`${_Endpoints.default.FeedObjectList.url({
|
|
24
|
+
type
|
|
25
|
+
})}?${p.toString()}`, _Endpoints.default.FeedObjectList.method);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* This endpoint retrieves all uncommented feed objs
|
|
29
|
+
* @param type
|
|
30
|
+
* @param params
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
static getUncommentedFeedObjects(type, params) {
|
|
35
|
+
const p = new URLSearchParams(params);
|
|
36
|
+
return (0, _apiRequest.apiRequest)(`${_Endpoints.default.FeedObjectsUncommented.url({
|
|
37
|
+
type
|
|
38
|
+
})}?${p.toString()}`, _Endpoints.default.FeedObjectsUncommented.method);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* This endpoint performs search operation to feed objs
|
|
42
|
+
* @param type
|
|
43
|
+
*/
|
|
31
44
|
|
|
32
|
-
static getUncommentedFeedObjects(type) {
|
|
33
|
-
return _client.default.request({
|
|
34
|
-
url: _Endpoints.default.FeedObjectsUncommented.url({
|
|
35
|
-
type
|
|
36
|
-
}),
|
|
37
|
-
method: _Endpoints.default.FeedObjectsUncommented.method
|
|
38
|
-
}).then(res => {
|
|
39
|
-
if (res.status >= 300) {
|
|
40
|
-
console.log(`Unable to retrieve uncommented feed object (Response code: ${res.status}).`);
|
|
41
|
-
return Promise.reject(res);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return Promise.resolve(res);
|
|
45
|
-
}).catch(error => {
|
|
46
|
-
console.log('Unable to retrieve uncommented feed object.');
|
|
47
|
-
return Promise.reject(error);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
45
|
|
|
51
46
|
static searchFeedObject(type) {
|
|
52
|
-
return
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}),
|
|
56
|
-
method: _Endpoints.default.SearchFeedObject.method
|
|
57
|
-
}).then(res => {
|
|
58
|
-
if (res.status >= 300) {
|
|
59
|
-
console.log(`Unable to retrieve feed object (Response code: ${res.status}).`);
|
|
60
|
-
return Promise.reject(res);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return Promise.resolve(res);
|
|
64
|
-
}).catch(error => {
|
|
65
|
-
console.log('Unable to retrieve feed object.');
|
|
66
|
-
return Promise.reject(error);
|
|
67
|
-
});
|
|
47
|
+
return (0, _apiRequest.apiRequest)(_Endpoints.default.SearchFeedObject.url({
|
|
48
|
+
type
|
|
49
|
+
}), _Endpoints.default.SearchFeedObject.method);
|
|
68
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* This endpoint creates a feed obj
|
|
53
|
+
* @param type
|
|
54
|
+
* @param data
|
|
55
|
+
*/
|
|
69
56
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
method: _Endpoints.default.CreateFeedObject.method
|
|
76
|
-
}).then(res => {
|
|
77
|
-
if (res.status >= 300) {
|
|
78
|
-
console.log(`Unable to perform action (Response code: ${res.status}).`);
|
|
79
|
-
return Promise.reject(res);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return Promise.resolve(res);
|
|
83
|
-
}).catch(error => {
|
|
84
|
-
console.log('Unable to perform action.');
|
|
85
|
-
return Promise.reject(error);
|
|
86
|
-
});
|
|
57
|
+
|
|
58
|
+
static createFeedObject(type, data) {
|
|
59
|
+
return (0, _apiRequest.apiRequest)(_Endpoints.default.CreateFeedObject.url({
|
|
60
|
+
type
|
|
61
|
+
}), _Endpoints.default.CreateFeedObject.method, data);
|
|
87
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* This endpoint retrieves a specific feed obj using ID
|
|
65
|
+
* @param type
|
|
66
|
+
* @param id
|
|
67
|
+
*/
|
|
68
|
+
|
|
88
69
|
|
|
89
70
|
static getSpecificFeedObject(type, id) {
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}),
|
|
95
|
-
method: _Endpoints.default.FeedObject.method
|
|
96
|
-
}).then(res => {
|
|
97
|
-
if (res.status >= 300) {
|
|
98
|
-
console.log(`Unable to retrieve feed object (Response code: ${res.status}).`);
|
|
99
|
-
return Promise.reject(res);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return Promise.resolve(res);
|
|
103
|
-
}).catch(error => {
|
|
104
|
-
console.log('Unable to retrieve feed object.');
|
|
105
|
-
return Promise.reject(error);
|
|
106
|
-
});
|
|
71
|
+
return (0, _apiRequest.apiRequest)(_Endpoints.default.FeedObject.url({
|
|
72
|
+
type,
|
|
73
|
+
id
|
|
74
|
+
}), _Endpoints.default.FeedObject.method);
|
|
107
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* This endpoint updates a specific feed obj
|
|
78
|
+
* @param type
|
|
79
|
+
* @param id
|
|
80
|
+
* @param data
|
|
81
|
+
*/
|
|
108
82
|
|
|
109
|
-
static updateFeedObject(type, id) {
|
|
110
|
-
return _client.default.request({
|
|
111
|
-
url: _Endpoints.default.UpdateFeedObject.url({
|
|
112
|
-
id,
|
|
113
|
-
type
|
|
114
|
-
}),
|
|
115
|
-
method: _Endpoints.default.UpdateFeedObject.method
|
|
116
|
-
}).then(res => {
|
|
117
|
-
if (res.status >= 300) {
|
|
118
|
-
console.log(`Unable to perform action (Response code: ${res.status}).`);
|
|
119
|
-
return Promise.reject(res);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
return Promise.resolve(res);
|
|
123
|
-
}).catch(error => {
|
|
124
|
-
console.log('Unable to perform action.');
|
|
125
|
-
return Promise.reject(error);
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
83
|
|
|
129
|
-
static
|
|
130
|
-
return
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}),
|
|
135
|
-
method: _Endpoints.default.DeleteFeedObject.method
|
|
136
|
-
}).then(res => {
|
|
137
|
-
if (res.status >= 300) {
|
|
138
|
-
console.log(`Unable to perform action (Response code: ${res.status}).`);
|
|
139
|
-
return Promise.reject(res);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
return Promise.resolve(res);
|
|
143
|
-
}).catch(error => {
|
|
144
|
-
console.log('Unable to perform action.');
|
|
145
|
-
return Promise.reject(error);
|
|
146
|
-
});
|
|
84
|
+
static updateFeedObject(type, id, data) {
|
|
85
|
+
return (0, _apiRequest.apiRequest)(_Endpoints.default.UpdateFeedObject.url({
|
|
86
|
+
id,
|
|
87
|
+
type
|
|
88
|
+
}), _Endpoints.default.UpdateFeedObject.method, data);
|
|
147
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* This endpoint deletes a specific feed obj
|
|
92
|
+
* @param type
|
|
93
|
+
* @param id
|
|
94
|
+
*/
|
|
148
95
|
|
|
149
|
-
static feedObjectContributorsList(type, id) {
|
|
150
|
-
return _client.default.request({
|
|
151
|
-
url: _Endpoints.default.FeedObjectContributorsList.url({
|
|
152
|
-
type,
|
|
153
|
-
id
|
|
154
|
-
}),
|
|
155
|
-
method: _Endpoints.default.FeedObjectContributorsList.method
|
|
156
|
-
}).then(res => {
|
|
157
|
-
if (res.status >= 300) {
|
|
158
|
-
console.log(`Unable to retrieve feed object contributors (Response code: ${res.status}).`);
|
|
159
|
-
return Promise.reject(res);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return Promise.resolve(res);
|
|
163
|
-
}).catch(error => {
|
|
164
|
-
console.log('Unable to retrieve feed object contributors.');
|
|
165
|
-
return Promise.reject(error);
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
96
|
|
|
169
|
-
static
|
|
170
|
-
return
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
97
|
+
static deleteFeedObject(type, id) {
|
|
98
|
+
return (0, _apiRequest.apiRequest)(_Endpoints.default.DeleteFeedObject.url({
|
|
99
|
+
type,
|
|
100
|
+
id
|
|
101
|
+
}), _Endpoints.default.DeleteFeedObject.method);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* This endpoint retrieves all contributors for a specific feed obj
|
|
105
|
+
* @param type
|
|
106
|
+
* @param id
|
|
107
|
+
* @param params
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
static feedObjectContributorsList(type, id, params) {
|
|
112
|
+
const p = new URLSearchParams(params);
|
|
113
|
+
return (0, _apiRequest.apiRequest)(`${_Endpoints.default.FeedObjectContributorsList.url({
|
|
114
|
+
type,
|
|
115
|
+
id
|
|
116
|
+
})}?${p.toString()}`, _Endpoints.default.FeedObjectContributorsList.method);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* This endpoint retrieves all shares for a specific feed obj
|
|
120
|
+
* @param type
|
|
121
|
+
* @param id
|
|
122
|
+
* @param params
|
|
123
|
+
*/
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
static feedObjectSharesList(type, id, params) {
|
|
127
|
+
const p = new URLSearchParams(params);
|
|
128
|
+
return (0, _apiRequest.apiRequest)(`${_Endpoints.default.FeedObjectSharesList.url({
|
|
129
|
+
type,
|
|
130
|
+
id
|
|
131
|
+
})}?${p.toString()}`, _Endpoints.default.FeedObjectSharesList.method);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* This endpoint retrieves all shares users for a specific feed obj
|
|
135
|
+
* @param type
|
|
136
|
+
* @param id
|
|
137
|
+
* @param params
|
|
138
|
+
*/
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
static feedObjectUserSharesList(type, id, params) {
|
|
142
|
+
const p = new URLSearchParams(params);
|
|
143
|
+
return (0, _apiRequest.apiRequest)(`${_Endpoints.default.FeedObjectUserSharesList.url({
|
|
144
|
+
type,
|
|
145
|
+
id
|
|
146
|
+
})}?${p.toString()}`, _Endpoints.default.FeedObjectUserSharesList.method);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
*
|
|
150
|
+
* @param type
|
|
151
|
+
* @param id
|
|
152
|
+
*/
|
|
188
153
|
|
|
189
|
-
static feedObjectUserSharesList(type, id) {
|
|
190
|
-
return _client.default.request({
|
|
191
|
-
url: _Endpoints.default.FeedObjectUserSharesList.url({
|
|
192
|
-
type,
|
|
193
|
-
id
|
|
194
|
-
}),
|
|
195
|
-
method: _Endpoints.default.FeedObjectUserSharesList.method
|
|
196
|
-
}).then(res => {
|
|
197
|
-
if (res.status >= 300) {
|
|
198
|
-
console.log(`Unable to retrieve feed object users shares (Response code: ${res.status}).`);
|
|
199
|
-
return Promise.reject(res);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
return Promise.resolve(res);
|
|
203
|
-
}).catch(error => {
|
|
204
|
-
console.log('Unable to retrieve feed object users shares.');
|
|
205
|
-
return Promise.reject(error);
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
154
|
|
|
209
155
|
static restoreFeedObject(type, id) {
|
|
210
|
-
return
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}),
|
|
215
|
-
method: _Endpoints.default.RestoreFeedObject.method
|
|
216
|
-
}).then(res => {
|
|
217
|
-
if (res.status >= 300) {
|
|
218
|
-
console.log(`Unable to perform action (Response code: ${res.status}).`);
|
|
219
|
-
return Promise.reject(res);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
return Promise.resolve(res);
|
|
223
|
-
}).catch(error => {
|
|
224
|
-
console.log('Unable to perform action.');
|
|
225
|
-
return Promise.reject(error);
|
|
226
|
-
});
|
|
156
|
+
return (0, _apiRequest.apiRequest)(_Endpoints.default.RestoreFeedObject.url({
|
|
157
|
+
type,
|
|
158
|
+
id
|
|
159
|
+
}), _Endpoints.default.RestoreFeedObject.method);
|
|
227
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* This endpoint restores a feed obj
|
|
163
|
+
* @param type
|
|
164
|
+
* @param id
|
|
165
|
+
* @param params
|
|
166
|
+
*/
|
|
228
167
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
}).then(res => {
|
|
237
|
-
if (res.status >= 300) {
|
|
238
|
-
console.log(`Unable to retrieve related feed objects (Response code: ${res.status}).`);
|
|
239
|
-
return Promise.reject(res);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
return Promise.resolve(res);
|
|
243
|
-
}).catch(error => {
|
|
244
|
-
console.log('Unable to retrieve related feed objects.');
|
|
245
|
-
return Promise.reject(error);
|
|
246
|
-
});
|
|
168
|
+
|
|
169
|
+
static relatedFeedObjects(type, id, params) {
|
|
170
|
+
const p = new URLSearchParams(params);
|
|
171
|
+
return (0, _apiRequest.apiRequest)(`${_Endpoints.default.RelatedFeedObjects.url({
|
|
172
|
+
type,
|
|
173
|
+
id
|
|
174
|
+
})}?${p.toString()}`, _Endpoints.default.RelatedFeedObjects.method);
|
|
247
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* This endpoint upvotes a specific feed obj
|
|
178
|
+
* @param type
|
|
179
|
+
* @param id
|
|
180
|
+
*/
|
|
181
|
+
|
|
248
182
|
|
|
249
183
|
static voteFeedObject(type, id) {
|
|
250
|
-
return
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
184
|
+
return (0, _apiRequest.apiRequest)(_Endpoints.default.Vote.url({
|
|
185
|
+
type,
|
|
186
|
+
id
|
|
187
|
+
}), _Endpoints.default.Vote.method);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* This endpoint retrieves all votes for a specific feed obj
|
|
191
|
+
* @param type
|
|
192
|
+
* @param id
|
|
193
|
+
* @param params
|
|
194
|
+
*/
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
static feedObjectVotes(type, id, params) {
|
|
198
|
+
const p = new URLSearchParams(params);
|
|
199
|
+
return (0, _apiRequest.apiRequest)(`${_Endpoints.default.VotesList.url({
|
|
200
|
+
type,
|
|
201
|
+
id
|
|
202
|
+
})}?${p.toString()}`, _Endpoints.default.VotesList.method);
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* This endpoint upvotes a specific poll choice in a feed obj
|
|
206
|
+
* @param type It can be only "discussion" or "post".
|
|
207
|
+
* @param id
|
|
208
|
+
* @param choice
|
|
209
|
+
*/
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
static feedObjectPollVote(type, id, choice) {
|
|
213
|
+
return (0, _apiRequest.apiRequest)(_Endpoints.default.PollVote.url({
|
|
214
|
+
type,
|
|
215
|
+
id
|
|
216
|
+
}), _Endpoints.default.PollVote.method, {
|
|
217
|
+
choice: choice
|
|
266
218
|
});
|
|
267
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* This endpoint retrieves all poll votes for a specific feed obj
|
|
222
|
+
* @param type It can be only "discussion" or "post".
|
|
223
|
+
* @param id
|
|
224
|
+
* @param params
|
|
225
|
+
*/
|
|
268
226
|
|
|
269
|
-
static feedObjectVotes(type, id) {
|
|
270
|
-
return _client.default.request({
|
|
271
|
-
url: _Endpoints.default.VotesList.url({
|
|
272
|
-
type,
|
|
273
|
-
id
|
|
274
|
-
}),
|
|
275
|
-
method: _Endpoints.default.VotesList.method
|
|
276
|
-
}).then(res => {
|
|
277
|
-
if (res.status >= 300) {
|
|
278
|
-
console.log(`Unable to retrieve feed object votes (Response code: ${res.status}).`);
|
|
279
|
-
return Promise.reject(res);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
return Promise.resolve(res);
|
|
283
|
-
}).catch(error => {
|
|
284
|
-
console.log('Unable to retrieve feed object votes.');
|
|
285
|
-
return Promise.reject(error);
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
227
|
|
|
289
|
-
static
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
method: _Endpoints.default.PollVote.method
|
|
296
|
-
}).then(res => {
|
|
297
|
-
if (res.status >= 300) {
|
|
298
|
-
console.log(`Unable to perform action (Response code: ${res.status}).`);
|
|
299
|
-
return Promise.reject(res);
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
return Promise.resolve(res);
|
|
303
|
-
}).catch(error => {
|
|
304
|
-
console.log('Unable to perform action.');
|
|
305
|
-
return Promise.reject(error);
|
|
306
|
-
});
|
|
228
|
+
static feedObjectPollVotesList(type, id, params) {
|
|
229
|
+
const p = new URLSearchParams(params);
|
|
230
|
+
return (0, _apiRequest.apiRequest)(`${_Endpoints.default.PollVotesList.url({
|
|
231
|
+
type,
|
|
232
|
+
id
|
|
233
|
+
})}?${p.toString()}`, _Endpoints.default.PollVotesList.method);
|
|
307
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* This endpoint follows a feed obj
|
|
237
|
+
* @param type
|
|
238
|
+
* @param id
|
|
239
|
+
*/
|
|
308
240
|
|
|
309
|
-
static feedObjectPollVotesList(type, id) {
|
|
310
|
-
return _client.default.request({
|
|
311
|
-
url: _Endpoints.default.PollVotesList.url({
|
|
312
|
-
type,
|
|
313
|
-
id
|
|
314
|
-
}),
|
|
315
|
-
method: _Endpoints.default.PollVotesList.method
|
|
316
|
-
}).then(res => {
|
|
317
|
-
if (res.status >= 300) {
|
|
318
|
-
console.log(`Unable to retrieve poll votes (Response code: ${res.status}).`);
|
|
319
|
-
return Promise.reject(res);
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
return Promise.resolve(res);
|
|
323
|
-
}).catch(error => {
|
|
324
|
-
console.log('Unable to retrieve poll votes.');
|
|
325
|
-
return Promise.reject(error);
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
241
|
|
|
329
242
|
static followFeedObject(type, id) {
|
|
330
|
-
return
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
}),
|
|
334
|
-
method: _Endpoints.default.FollowContribution.method
|
|
335
|
-
}).then(res => {
|
|
336
|
-
if (res.status >= 300) {
|
|
337
|
-
console.log(`Unable to perform follow action (Response code: ${res.status}).`);
|
|
338
|
-
return Promise.reject(res);
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
return Promise.resolve(res);
|
|
342
|
-
}).catch(error => {
|
|
343
|
-
console.log('Unable to perform follow action.');
|
|
344
|
-
return Promise.reject(error);
|
|
345
|
-
});
|
|
243
|
+
return (0, _apiRequest.apiRequest)(_Endpoints.default.FollowContribution.url({
|
|
244
|
+
id
|
|
245
|
+
}), _Endpoints.default.FollowContribution.method);
|
|
346
246
|
}
|
|
247
|
+
/**
|
|
248
|
+
* This endpoint retrieves all feed objs followed by the authenticated user
|
|
249
|
+
* @param type
|
|
250
|
+
* @param params
|
|
251
|
+
*/
|
|
347
252
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}).then(res => {
|
|
355
|
-
if (res.status >= 300) {
|
|
356
|
-
console.log(`Unable to retrieve feed object followings (Response code: ${res.status}).`);
|
|
357
|
-
return Promise.reject(res);
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
return Promise.resolve(res);
|
|
361
|
-
}).catch(error => {
|
|
362
|
-
console.log('Unable to retrieve feed object followings.');
|
|
363
|
-
return Promise.reject(error);
|
|
364
|
-
});
|
|
253
|
+
|
|
254
|
+
static feedObjectFollowingList(type, params) {
|
|
255
|
+
const p = new URLSearchParams(params);
|
|
256
|
+
return (0, _apiRequest.apiRequest)(`${_Endpoints.default.FeedObjectFollowingList.url({
|
|
257
|
+
type
|
|
258
|
+
})}?${p.toString()}`, _Endpoints.default.FeedObjectFollowingList.method);
|
|
365
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* This endpoint returns following = true if the feed obj (identified in path) is followed by the authenticated user
|
|
262
|
+
* @param type
|
|
263
|
+
* @param id
|
|
264
|
+
*/
|
|
265
|
+
|
|
366
266
|
|
|
367
267
|
static checkIfFollowingFeedObject(type, id) {
|
|
368
|
-
return
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
}),
|
|
373
|
-
method: _Endpoints.default.CheckIfFollowingFeedObject.method
|
|
374
|
-
}).then(res => {
|
|
375
|
-
if (res.status >= 300) {
|
|
376
|
-
console.log(`Unable to perform action (Response code: ${res.status}).`);
|
|
377
|
-
return Promise.reject(res);
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
return Promise.resolve(res);
|
|
381
|
-
}).catch(error => {
|
|
382
|
-
console.log('Unable to perform action.');
|
|
383
|
-
return Promise.reject(error);
|
|
384
|
-
});
|
|
268
|
+
return (0, _apiRequest.apiRequest)(_Endpoints.default.CheckIfFollowingFeedObject.url({
|
|
269
|
+
type,
|
|
270
|
+
id
|
|
271
|
+
}), _Endpoints.default.CheckIfFollowingFeedObject.method);
|
|
385
272
|
}
|
|
273
|
+
/**
|
|
274
|
+
* This endpoint suspends the notifications for the selected feed obj
|
|
275
|
+
* @param type
|
|
276
|
+
* @param id
|
|
277
|
+
*/
|
|
278
|
+
|
|
386
279
|
|
|
387
280
|
static suspendFeedObject(type, id) {
|
|
388
|
-
return
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
}),
|
|
393
|
-
method: _Endpoints.default.UserSuspendContributionNotification.method
|
|
394
|
-
}).then(res => {
|
|
395
|
-
if (res.status >= 300) {
|
|
396
|
-
console.log(`Unable to perform action (Response code: ${res.status}).`);
|
|
397
|
-
return Promise.reject(res);
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
return Promise.resolve(res);
|
|
401
|
-
}).catch(error => {
|
|
402
|
-
console.log('Unable to perform action.');
|
|
403
|
-
return Promise.reject(error);
|
|
404
|
-
});
|
|
281
|
+
return (0, _apiRequest.apiRequest)(_Endpoints.default.UserSuspendContributionNotification.url({
|
|
282
|
+
type,
|
|
283
|
+
id
|
|
284
|
+
}), _Endpoints.default.UserSuspendContributionNotification.method);
|
|
405
285
|
}
|
|
286
|
+
/**
|
|
287
|
+
* This endpoint returns suspended = true if the notifications for the feed obj (identified in path) is suspended by the authenticated user
|
|
288
|
+
* @param type
|
|
289
|
+
* @param id
|
|
290
|
+
*/
|
|
291
|
+
|
|
406
292
|
|
|
407
293
|
static checkIfSuspendedFeedObject(type, id) {
|
|
408
|
-
return
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
}),
|
|
413
|
-
method: _Endpoints.default.UserCheckContributionNotificationSuspended.method
|
|
414
|
-
}).then(res => {
|
|
415
|
-
if (res.status >= 300) {
|
|
416
|
-
console.log(`Unable to perform action (Response code: ${res.status}).`);
|
|
417
|
-
return Promise.reject(res);
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
return Promise.resolve(res);
|
|
421
|
-
}).catch(error => {
|
|
422
|
-
console.log('Unable to perform action.');
|
|
423
|
-
return Promise.reject(error);
|
|
424
|
-
});
|
|
294
|
+
return (0, _apiRequest.apiRequest)(_Endpoints.default.UserCheckContributionNotificationSuspended.url({
|
|
295
|
+
type,
|
|
296
|
+
id
|
|
297
|
+
}), _Endpoints.default.UserCheckContributionNotificationSuspended.method);
|
|
425
298
|
}
|
|
299
|
+
/**
|
|
300
|
+
* This endpoint retrieves the list of feed obj which notifications are suspended by the authenticated user
|
|
301
|
+
* @param type
|
|
302
|
+
* @param params
|
|
303
|
+
*/
|
|
426
304
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
}).then(res => {
|
|
434
|
-
if (res.status >= 300) {
|
|
435
|
-
console.log(`Unable to retrieve suspended feed objects (Response code: ${res.status}).`);
|
|
436
|
-
return Promise.reject(res);
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
return Promise.resolve(res);
|
|
440
|
-
}).catch(error => {
|
|
441
|
-
console.log('Unable to retrieve suspended feed objects.');
|
|
442
|
-
return Promise.reject(error);
|
|
443
|
-
});
|
|
305
|
+
|
|
306
|
+
static feedObjectSuspendedList(type, params) {
|
|
307
|
+
const p = new URLSearchParams(params);
|
|
308
|
+
return (0, _apiRequest.apiRequest)(`${_Endpoints.default.UserListContributionNotificationSuspended.url({
|
|
309
|
+
type
|
|
310
|
+
})}?${p.toString()}`, _Endpoints.default.UserListContributionNotificationSuspended.method);
|
|
444
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* This endpoint flags a specific feed obj
|
|
314
|
+
* @param type
|
|
315
|
+
* @param id
|
|
316
|
+
* @param flag_type
|
|
317
|
+
*/
|
|
445
318
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
method: _Endpoints.default.Flag.method
|
|
453
|
-
}).then(res => {
|
|
454
|
-
if (res.status >= 300) {
|
|
455
|
-
console.log(`Unable to perform action (Response code: ${res.status}).`);
|
|
456
|
-
return Promise.reject(res);
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
return Promise.resolve(res);
|
|
460
|
-
}).catch(error => {
|
|
461
|
-
console.log('Unable to perform action.');
|
|
462
|
-
return Promise.reject(error);
|
|
463
|
-
});
|
|
319
|
+
|
|
320
|
+
static flagFeedObject(type, id, flag_type) {
|
|
321
|
+
return (0, _apiRequest.apiRequest)(_Endpoints.default.Flag.url({
|
|
322
|
+
type,
|
|
323
|
+
id
|
|
324
|
+
}), _Endpoints.default.Flag.method, flag_type);
|
|
464
325
|
}
|
|
326
|
+
/**
|
|
327
|
+
* Retrieves, if exists, a flag for this contribute created by the authenticated user
|
|
328
|
+
* @param type
|
|
329
|
+
* @param id
|
|
330
|
+
*/
|
|
331
|
+
|
|
465
332
|
|
|
466
333
|
static feedObjectFlagStatus(type, id) {
|
|
467
|
-
return
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
}),
|
|
472
|
-
method: _Endpoints.default.FlagStatus.method
|
|
473
|
-
}).then(res => {
|
|
474
|
-
if (res.status >= 300) {
|
|
475
|
-
console.log(`Unable to retrieve status (Response code: ${res.status}).`);
|
|
476
|
-
return Promise.reject(res);
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
return Promise.resolve(res);
|
|
480
|
-
}).catch(error => {
|
|
481
|
-
console.log('Unable to retrieve status.');
|
|
482
|
-
return Promise.reject(error);
|
|
483
|
-
});
|
|
334
|
+
return (0, _apiRequest.apiRequest)(_Endpoints.default.FlagStatus.url({
|
|
335
|
+
type,
|
|
336
|
+
id
|
|
337
|
+
}), _Endpoints.default.FlagStatus.method);
|
|
484
338
|
}
|
|
339
|
+
/**
|
|
340
|
+
* This endpoint retrieves a list of flags for a specific feed obj
|
|
341
|
+
* @param type
|
|
342
|
+
* @param id
|
|
343
|
+
*/
|
|
485
344
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
}).then(res => {
|
|
493
|
-
if (res.status >= 300) {
|
|
494
|
-
console.log(`Unable to retrieve flagged feed objects (Response code: ${res.status}).`);
|
|
495
|
-
return Promise.reject(res);
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
return Promise.resolve(res);
|
|
499
|
-
}).catch(error => {
|
|
500
|
-
console.log('Unable to retrieve flagged feed objects.');
|
|
501
|
-
return Promise.reject(error);
|
|
502
|
-
});
|
|
345
|
+
|
|
346
|
+
static feedObjectFlagList(type, id) {
|
|
347
|
+
return (0, _apiRequest.apiRequest)(_Endpoints.default.FeedObjectFlagList.url({
|
|
348
|
+
type,
|
|
349
|
+
id
|
|
350
|
+
}), _Endpoints.default.FeedObjectFlagList.method);
|
|
503
351
|
}
|
|
352
|
+
/**
|
|
353
|
+
* This endpoint hides the feed obj for the logged user. The feed obj must be in show state
|
|
354
|
+
* @param type
|
|
355
|
+
* @param id
|
|
356
|
+
*/
|
|
357
|
+
|
|
504
358
|
|
|
505
359
|
static hideFeedObject(type, id) {
|
|
506
|
-
return
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
}),
|
|
511
|
-
method: _Endpoints.default.HideFeedObject.method
|
|
512
|
-
}).then(res => {
|
|
513
|
-
if (res.status >= 300) {
|
|
514
|
-
console.log(`Unable to perform action (Response code: ${res.status}).`);
|
|
515
|
-
return Promise.reject(res);
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
return Promise.resolve(res);
|
|
519
|
-
}).catch(error => {
|
|
520
|
-
console.log('Unable to perform action.');
|
|
521
|
-
return Promise.reject(error);
|
|
522
|
-
});
|
|
360
|
+
return (0, _apiRequest.apiRequest)(_Endpoints.default.HideFeedObject.url({
|
|
361
|
+
type,
|
|
362
|
+
id
|
|
363
|
+
}), _Endpoints.default.HideFeedObject.method);
|
|
523
364
|
}
|
|
365
|
+
/**
|
|
366
|
+
* This endpoint retrieves if the the feed obj has been hidden by the authenticated user (hidden = true)
|
|
367
|
+
* @param type
|
|
368
|
+
* @param id
|
|
369
|
+
*/
|
|
370
|
+
|
|
524
371
|
|
|
525
372
|
static feedObjectHideStatus(type, id) {
|
|
526
|
-
return
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
}),
|
|
531
|
-
method: _Endpoints.default.FeedObjectHideStatus.method
|
|
532
|
-
}).then(res => {
|
|
533
|
-
if (res.status >= 300) {
|
|
534
|
-
console.log(`Unable to retrieve status (Response code: ${res.status}).`);
|
|
535
|
-
return Promise.reject(res);
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
return Promise.resolve(res);
|
|
539
|
-
}).catch(error => {
|
|
540
|
-
console.log('Unable to retrieve status.');
|
|
541
|
-
return Promise.reject(error);
|
|
542
|
-
});
|
|
373
|
+
return (0, _apiRequest.apiRequest)(_Endpoints.default.FeedObjectHideStatus.url({
|
|
374
|
+
type,
|
|
375
|
+
id
|
|
376
|
+
}), _Endpoints.default.FeedObjectHideStatus.method);
|
|
543
377
|
}
|
|
544
378
|
|
|
545
379
|
}
|
|
@@ -547,76 +381,76 @@ class FeedObjectApiClient {
|
|
|
547
381
|
exports.FeedObjectApiClient = FeedObjectApiClient;
|
|
548
382
|
|
|
549
383
|
class FeedObjectService {
|
|
550
|
-
static async getAllFeedObjects(type) {
|
|
551
|
-
return FeedObjectApiClient.getAllFeedObjects(type);
|
|
384
|
+
static async getAllFeedObjects(type, params) {
|
|
385
|
+
return FeedObjectApiClient.getAllFeedObjects(type, params);
|
|
552
386
|
}
|
|
553
387
|
|
|
554
|
-
static async getUncommentedFeedObjects(type) {
|
|
555
|
-
return FeedObjectApiClient.getUncommentedFeedObjects(type);
|
|
388
|
+
static async getUncommentedFeedObjects(type, params) {
|
|
389
|
+
return FeedObjectApiClient.getUncommentedFeedObjects(type, params);
|
|
556
390
|
}
|
|
557
391
|
|
|
558
392
|
static async searchFeedObject(type) {
|
|
559
393
|
return FeedObjectApiClient.searchFeedObject(type);
|
|
560
394
|
}
|
|
561
395
|
|
|
562
|
-
static async createFeedObject(type) {
|
|
563
|
-
return FeedObjectApiClient.createFeedObject(type);
|
|
396
|
+
static async createFeedObject(type, data) {
|
|
397
|
+
return FeedObjectApiClient.createFeedObject(type, data);
|
|
564
398
|
}
|
|
565
399
|
|
|
566
400
|
static async getSpecificFeedObject(type, id) {
|
|
567
401
|
return FeedObjectApiClient.getSpecificFeedObject(type, id);
|
|
568
402
|
}
|
|
569
403
|
|
|
570
|
-
static async updateFeedObject(type, id) {
|
|
571
|
-
return FeedObjectApiClient.updateFeedObject(type, id);
|
|
404
|
+
static async updateFeedObject(type, id, data) {
|
|
405
|
+
return FeedObjectApiClient.updateFeedObject(type, id, data);
|
|
572
406
|
}
|
|
573
407
|
|
|
574
408
|
static async deleteFeedObject(type, id) {
|
|
575
409
|
return FeedObjectApiClient.deleteFeedObject(type, id);
|
|
576
410
|
}
|
|
577
411
|
|
|
578
|
-
static async feedObjectContributorsList(type, id) {
|
|
579
|
-
return FeedObjectApiClient.feedObjectContributorsList(type, id);
|
|
412
|
+
static async feedObjectContributorsList(type, id, params) {
|
|
413
|
+
return FeedObjectApiClient.feedObjectContributorsList(type, id, params);
|
|
580
414
|
}
|
|
581
415
|
|
|
582
|
-
static async feedObjectSharesList(type, id) {
|
|
583
|
-
return FeedObjectApiClient.feedObjectSharesList(type, id);
|
|
416
|
+
static async feedObjectSharesList(type, id, params) {
|
|
417
|
+
return FeedObjectApiClient.feedObjectSharesList(type, id, params);
|
|
584
418
|
}
|
|
585
419
|
|
|
586
|
-
static async feedObjectUserSharesList(type, id) {
|
|
587
|
-
return FeedObjectApiClient.feedObjectUserSharesList(type, id);
|
|
420
|
+
static async feedObjectUserSharesList(type, id, params) {
|
|
421
|
+
return FeedObjectApiClient.feedObjectUserSharesList(type, id, params);
|
|
588
422
|
}
|
|
589
423
|
|
|
590
424
|
static async restoreFeedObject(type, id) {
|
|
591
425
|
return FeedObjectApiClient.restoreFeedObject(type, id);
|
|
592
426
|
}
|
|
593
427
|
|
|
594
|
-
static async relatedFeedObjects(type, id) {
|
|
595
|
-
return FeedObjectApiClient.relatedFeedObjects(type, id);
|
|
428
|
+
static async relatedFeedObjects(type, id, params) {
|
|
429
|
+
return FeedObjectApiClient.relatedFeedObjects(type, id, params);
|
|
596
430
|
}
|
|
597
431
|
|
|
598
432
|
static async voteFeedObject(type, id) {
|
|
599
433
|
return FeedObjectApiClient.voteFeedObject(type, id);
|
|
600
434
|
}
|
|
601
435
|
|
|
602
|
-
static async feedObjectVotes(type, id) {
|
|
603
|
-
return FeedObjectApiClient.feedObjectVotes(type, id);
|
|
436
|
+
static async feedObjectVotes(type, id, params) {
|
|
437
|
+
return FeedObjectApiClient.feedObjectVotes(type, id, params);
|
|
604
438
|
}
|
|
605
439
|
|
|
606
|
-
static async feedObjectPollVote(type, id) {
|
|
607
|
-
return FeedObjectApiClient.feedObjectPollVote(type, id);
|
|
440
|
+
static async feedObjectPollVote(type, id, choice) {
|
|
441
|
+
return FeedObjectApiClient.feedObjectPollVote(type, id, choice);
|
|
608
442
|
}
|
|
609
443
|
|
|
610
|
-
static async feedObjectPollVotesList(type, id) {
|
|
611
|
-
return FeedObjectApiClient.feedObjectPollVotesList(type, id);
|
|
444
|
+
static async feedObjectPollVotesList(type, id, params) {
|
|
445
|
+
return FeedObjectApiClient.feedObjectPollVotesList(type, id, params);
|
|
612
446
|
}
|
|
613
447
|
|
|
614
448
|
static async followFeedObject(type, id) {
|
|
615
449
|
return FeedObjectApiClient.followFeedObject(type, id);
|
|
616
450
|
}
|
|
617
451
|
|
|
618
|
-
static async feedObjectFollowingList(type) {
|
|
619
|
-
return FeedObjectApiClient.feedObjectFollowingList(type);
|
|
452
|
+
static async feedObjectFollowingList(type, params) {
|
|
453
|
+
return FeedObjectApiClient.feedObjectFollowingList(type, params);
|
|
620
454
|
}
|
|
621
455
|
|
|
622
456
|
static async checkIfFollowingFeedObject(type, id) {
|
|
@@ -631,16 +465,16 @@ class FeedObjectService {
|
|
|
631
465
|
return FeedObjectApiClient.checkIfSuspendedFeedObject(type, id);
|
|
632
466
|
}
|
|
633
467
|
|
|
634
|
-
static async feedObjectSuspendedList(type) {
|
|
635
|
-
return FeedObjectApiClient.feedObjectSuspendedList(type);
|
|
468
|
+
static async feedObjectSuspendedList(type, params) {
|
|
469
|
+
return FeedObjectApiClient.feedObjectSuspendedList(type, params);
|
|
636
470
|
}
|
|
637
471
|
|
|
638
|
-
static async flagFeedObject(type, id) {
|
|
639
|
-
return FeedObjectApiClient.flagFeedObject(type, id);
|
|
472
|
+
static async flagFeedObject(type, id, flag_type) {
|
|
473
|
+
return FeedObjectApiClient.flagFeedObject(type, id, flag_type);
|
|
640
474
|
}
|
|
641
475
|
|
|
642
|
-
static async feedObjectFlagList(type) {
|
|
643
|
-
return FeedObjectApiClient.feedObjectFlagList(type);
|
|
476
|
+
static async feedObjectFlagList(type, id) {
|
|
477
|
+
return FeedObjectApiClient.feedObjectFlagList(type, id);
|
|
644
478
|
}
|
|
645
479
|
|
|
646
480
|
static async feedObjectFlagStatus(type, id) {
|