@selfcommunity/api-services 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/constants/Endpoints.js +497 -57
- package/lib/cjs/index.js +147 -10
- package/lib/cjs/services/category/index.js +317 -3
- package/lib/cjs/services/comment/index.js +269 -0
- package/lib/cjs/services/custom_adv/index.js +85 -0
- package/lib/cjs/services/custom_page/index.js +85 -0
- package/lib/cjs/services/data_portability/index.js +83 -0
- package/lib/cjs/services/dynamic_preference/index.js +85 -0
- package/lib/cjs/services/embed/index.js +198 -0
- package/lib/cjs/services/feed/index.js +125 -0
- package/lib/cjs/services/feed_object/index.js +660 -0
- package/lib/cjs/services/incubator/index.js +175 -0
- package/lib/cjs/services/insight/index.js +146 -0
- package/lib/cjs/services/legal_page/index.js +152 -0
- package/lib/cjs/services/locality/index.js +62 -0
- package/lib/cjs/services/loyalty/index.js +219 -0
- package/lib/cjs/services/media/index.js +175 -0
- package/lib/cjs/services/moderation/index.js +156 -0
- package/lib/cjs/services/notification/index.js +209 -0
- package/lib/cjs/services/private_message/index.js +236 -0
- package/lib/cjs/services/score/index.js +83 -0
- package/lib/cjs/services/sso/index.js +62 -0
- package/lib/cjs/services/suggestion/index.js +104 -0
- package/lib/cjs/services/tag/index.js +175 -0
- package/lib/cjs/services/user/index.js +995 -9
- package/lib/cjs/services/webhook/index.js +290 -0
- package/lib/cjs/utils/token.js +15 -0
- package/lib/esm/api-services/src/constants/Endpoints.d.ts.map +1 -1
- package/lib/esm/api-services/src/index.d.ts +26 -3
- package/lib/esm/api-services/src/index.d.ts.map +1 -1
- package/lib/esm/api-services/src/services/category/index.d.ts +42 -0
- package/lib/esm/api-services/src/services/category/index.d.ts.map +1 -1
- package/lib/esm/api-services/src/services/comment/index.d.ts +40 -0
- package/lib/esm/api-services/src/services/comment/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/custom_adv/index.d.ts +16 -0
- package/lib/esm/api-services/src/services/custom_adv/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/custom_page/index.d.ts +16 -0
- package/lib/esm/api-services/src/services/custom_page/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/data_portability/index.d.ts +16 -0
- package/lib/esm/api-services/src/services/data_portability/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/dynamic_preference/index.d.ts +16 -0
- package/lib/esm/api-services/src/services/dynamic_preference/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/embed/index.d.ts +31 -0
- package/lib/esm/api-services/src/services/embed/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/feed/index.d.ts +22 -0
- package/lib/esm/api-services/src/services/feed/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/feed_object/index.d.ts +88 -0
- package/lib/esm/api-services/src/services/feed_object/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/incubator/index.d.ts +28 -0
- package/lib/esm/api-services/src/services/incubator/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/insight/index.d.ts +25 -0
- package/lib/esm/api-services/src/services/insight/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/legal_page/index.d.ts +25 -0
- package/lib/esm/api-services/src/services/legal_page/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/locality/index.d.ts +13 -0
- package/lib/esm/api-services/src/services/locality/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/loyalty/index.d.ts +34 -0
- package/lib/esm/api-services/src/services/loyalty/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/media/index.d.ts +28 -0
- package/lib/esm/api-services/src/services/media/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/moderation/index.d.ts +25 -0
- package/lib/esm/api-services/src/services/moderation/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/notification/index.d.ts +34 -0
- package/lib/esm/api-services/src/services/notification/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/private_message/index.d.ts +37 -0
- package/lib/esm/api-services/src/services/private_message/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/score/index.d.ts +16 -0
- package/lib/esm/api-services/src/services/score/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/sso/index.d.ts +13 -0
- package/lib/esm/api-services/src/services/sso/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/suggestion/index.d.ts +19 -0
- package/lib/esm/api-services/src/services/suggestion/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/tag/index.d.ts +28 -0
- package/lib/esm/api-services/src/services/tag/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/services/user/index.d.ts +132 -0
- package/lib/esm/api-services/src/services/user/index.d.ts.map +1 -1
- package/lib/esm/api-services/src/services/webhook/index.d.ts +43 -0
- package/lib/esm/api-services/src/services/webhook/index.d.ts.map +1 -0
- package/lib/esm/api-services/src/utils/token.d.ts +5 -0
- package/lib/esm/api-services/src/utils/token.d.ts.map +1 -1
- package/lib/esm/constants/Endpoints.js +497 -57
- package/lib/esm/index.js +147 -10
- package/lib/esm/services/category/index.js +317 -3
- package/lib/esm/services/comment/index.js +269 -0
- package/lib/esm/services/custom_adv/index.js +85 -0
- package/lib/esm/services/custom_page/index.js +85 -0
- package/lib/esm/services/data_portability/index.js +83 -0
- package/lib/esm/services/dynamic_preference/index.js +85 -0
- package/lib/esm/services/embed/index.js +198 -0
- package/lib/esm/services/feed/index.js +125 -0
- package/lib/esm/services/feed_object/index.js +660 -0
- package/lib/esm/services/incubator/index.js +175 -0
- package/lib/esm/services/insight/index.js +146 -0
- package/lib/esm/services/legal_page/index.js +152 -0
- package/lib/esm/services/locality/index.js +62 -0
- package/lib/esm/services/loyalty/index.js +219 -0
- package/lib/esm/services/media/index.js +175 -0
- package/lib/esm/services/moderation/index.js +156 -0
- package/lib/esm/services/notification/index.js +209 -0
- package/lib/esm/services/private_message/index.js +236 -0
- package/lib/esm/services/score/index.js +83 -0
- package/lib/esm/services/sso/index.js +62 -0
- package/lib/esm/services/suggestion/index.js +104 -0
- package/lib/esm/services/tag/index.js +175 -0
- package/lib/esm/services/user/index.js +995 -9
- package/lib/esm/services/webhook/index.js +290 -0
- package/lib/esm/utils/src/index.d.ts +8 -3
- package/lib/esm/utils/src/index.d.ts.map +1 -1
- package/lib/esm/utils/src/utils/browser.d.ts +9 -0
- package/lib/esm/utils/src/utils/browser.d.ts.map +1 -0
- package/lib/esm/utils/src/utils/logger.d.ts +11 -0
- package/lib/esm/utils/src/utils/logger.d.ts.map +1 -0
- package/lib/esm/utils/src/utils/object.d.ts +13 -0
- package/lib/esm/utils/src/utils/object.d.ts.map +1 -0
- package/lib/esm/utils/src/utils/string.d.ts +22 -0
- package/lib/esm/utils/src/utils/string.d.ts.map +1 -1
- package/lib/esm/utils/src/utils/url.d.ts +11 -0
- package/lib/esm/utils/src/utils/url.d.ts.map +1 -1
- package/lib/esm/utils/src/utils/websocket.d.ts +177 -0
- package/lib/esm/utils/src/utils/websocket.d.ts.map +1 -0
- package/lib/esm/utils/token.js +15 -0
- package/lib/umd/api-services.js +1 -1
- package/lib/umd/api-services.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = exports.CommentApiClient = void 0;
|
|
5
|
+
|
|
6
|
+
var _client = _interopRequireDefault(require("../../client"));
|
|
7
|
+
|
|
8
|
+
var _Endpoints = _interopRequireDefault(require("../../constants/Endpoints"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
class CommentApiClient {
|
|
13
|
+
static getAllComments() {
|
|
14
|
+
return _client.default.request({
|
|
15
|
+
url: _Endpoints.default.Comments.url({}),
|
|
16
|
+
method: _Endpoints.default.Comments.method
|
|
17
|
+
}).then(res => {
|
|
18
|
+
if (res.status >= 300) {
|
|
19
|
+
console.log(`Unable to retrieve comments (Response code: ${res.status}).`);
|
|
20
|
+
return Promise.reject(res);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return Promise.resolve(res);
|
|
24
|
+
}).catch(error => {
|
|
25
|
+
console.log('Unable to retrieve comments.');
|
|
26
|
+
return Promise.reject(error);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static createComment() {
|
|
31
|
+
return _client.default.request({
|
|
32
|
+
url: _Endpoints.default.NewComment.url({}),
|
|
33
|
+
method: _Endpoints.default.NewComment.method
|
|
34
|
+
}).then(res => {
|
|
35
|
+
if (res.status >= 300) {
|
|
36
|
+
console.log(`Unable to perform action (Response code: ${res.status}).`);
|
|
37
|
+
return Promise.reject(res);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return Promise.resolve(res.data);
|
|
41
|
+
}).catch(error => {
|
|
42
|
+
console.log('Unable to perform action.');
|
|
43
|
+
return Promise.reject(error);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
static getASpecificComment(id) {
|
|
48
|
+
return _client.default.request({
|
|
49
|
+
url: _Endpoints.default.Comment.url({
|
|
50
|
+
id
|
|
51
|
+
}),
|
|
52
|
+
method: _Endpoints.default.Comment.method
|
|
53
|
+
}).then(res => {
|
|
54
|
+
if (res.status >= 300) {
|
|
55
|
+
console.log(`Unable to perform action (Response code: ${res.status}).`);
|
|
56
|
+
return Promise.reject(res);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return Promise.resolve(res.data);
|
|
60
|
+
}).catch(error => {
|
|
61
|
+
console.log('Unable to perform action.');
|
|
62
|
+
return Promise.reject(error);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
static updateComment(id) {
|
|
67
|
+
return _client.default.request({
|
|
68
|
+
url: _Endpoints.default.UpdateComment.url({
|
|
69
|
+
id
|
|
70
|
+
}),
|
|
71
|
+
method: _Endpoints.default.UpdateComment.method
|
|
72
|
+
}).then(res => {
|
|
73
|
+
if (res.status >= 300) {
|
|
74
|
+
console.log(`Unable to perform action (Response code: ${res.status}).`);
|
|
75
|
+
return Promise.reject(res);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return Promise.resolve(res.data);
|
|
79
|
+
}).catch(error => {
|
|
80
|
+
console.log('Unable to perform action.');
|
|
81
|
+
return Promise.reject(error);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
static deleteComment(id) {
|
|
86
|
+
return _client.default.request({
|
|
87
|
+
url: _Endpoints.default.DeleteComment.url({
|
|
88
|
+
id
|
|
89
|
+
}),
|
|
90
|
+
method: _Endpoints.default.DeleteComment.method
|
|
91
|
+
}).then(res => {
|
|
92
|
+
if (res.status >= 300) {
|
|
93
|
+
console.log(`Unable to perform action (Response code: ${res.status}).`);
|
|
94
|
+
return Promise.reject(res);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return Promise.resolve(res.data);
|
|
98
|
+
}).catch(error => {
|
|
99
|
+
console.log('Unable to perform action.');
|
|
100
|
+
return Promise.reject(error);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
static restoreComment(id) {
|
|
105
|
+
return _client.default.request({
|
|
106
|
+
url: _Endpoints.default.RestoreComment.url({
|
|
107
|
+
id
|
|
108
|
+
}),
|
|
109
|
+
method: _Endpoints.default.RestoreComment.method
|
|
110
|
+
}).then(res => {
|
|
111
|
+
if (res.status >= 300) {
|
|
112
|
+
console.log(`Unable to perform action (Response code: ${res.status}).`);
|
|
113
|
+
return Promise.reject(res);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return Promise.resolve(res.data);
|
|
117
|
+
}).catch(error => {
|
|
118
|
+
console.log('Unable to perform action.');
|
|
119
|
+
return Promise.reject(error);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
static getSpecificCommentVotesList(id) {
|
|
124
|
+
return _client.default.request({
|
|
125
|
+
url: _Endpoints.default.CommentVotesList.url({
|
|
126
|
+
id
|
|
127
|
+
}),
|
|
128
|
+
method: _Endpoints.default.CommentVotesList.method
|
|
129
|
+
}).then(res => {
|
|
130
|
+
if (res.status >= 300) {
|
|
131
|
+
console.log(`Unable to retrieve votes (Response code: ${res.status}).`);
|
|
132
|
+
return Promise.reject(res);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return Promise.resolve(res.data);
|
|
136
|
+
}).catch(error => {
|
|
137
|
+
console.log('Unable to retrieve votes.');
|
|
138
|
+
return Promise.reject(error);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
static upvoteComment(id) {
|
|
143
|
+
return _client.default.request({
|
|
144
|
+
url: _Endpoints.default.CommentVote.url({
|
|
145
|
+
id
|
|
146
|
+
}),
|
|
147
|
+
method: _Endpoints.default.CommentVote.method
|
|
148
|
+
}).then(res => {
|
|
149
|
+
if (res.status >= 300) {
|
|
150
|
+
console.log(`Unable to perform action (Response code: ${res.status}).`);
|
|
151
|
+
return Promise.reject(res);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return Promise.resolve(res.data);
|
|
155
|
+
}).catch(error => {
|
|
156
|
+
console.log('Unable to perform action.');
|
|
157
|
+
return Promise.reject(error);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
static getSpecificCommentFlags(id) {
|
|
162
|
+
return _client.default.request({
|
|
163
|
+
url: _Endpoints.default.CommentFlagList.url({
|
|
164
|
+
id
|
|
165
|
+
}),
|
|
166
|
+
method: _Endpoints.default.CommentFlagList.method
|
|
167
|
+
}).then(res => {
|
|
168
|
+
if (res.status >= 300) {
|
|
169
|
+
console.log(`Unable to retrieve flags list (Response code: ${res.status}).`);
|
|
170
|
+
return Promise.reject(res);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return Promise.resolve(res.data);
|
|
174
|
+
}).catch(error => {
|
|
175
|
+
console.log('Unable to retrieve flags list.');
|
|
176
|
+
return Promise.reject(error);
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
static flagComment(id) {
|
|
181
|
+
return _client.default.request({
|
|
182
|
+
url: _Endpoints.default.FlagComment.url({
|
|
183
|
+
id
|
|
184
|
+
}),
|
|
185
|
+
method: _Endpoints.default.FlagComment.method
|
|
186
|
+
}).then(res => {
|
|
187
|
+
if (res.status >= 300) {
|
|
188
|
+
console.log(`Unable to perform action (Response code: ${res.status}).`);
|
|
189
|
+
return Promise.reject(res);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return Promise.resolve(res.data);
|
|
193
|
+
}).catch(error => {
|
|
194
|
+
console.log('Unable to perform action.');
|
|
195
|
+
return Promise.reject(error);
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
static getSpecificCommentFlagStatus(id) {
|
|
200
|
+
return _client.default.request({
|
|
201
|
+
url: _Endpoints.default.CommentFlagStatus.url({
|
|
202
|
+
id
|
|
203
|
+
}),
|
|
204
|
+
method: _Endpoints.default.CommentFlagStatus.method
|
|
205
|
+
}).then(res => {
|
|
206
|
+
if (res.status >= 300) {
|
|
207
|
+
console.log(`Unable to retrieve flags status (Response code: ${res.status}).`);
|
|
208
|
+
return Promise.reject(res);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return Promise.resolve(res.data);
|
|
212
|
+
}).catch(error => {
|
|
213
|
+
console.log('Unable to retrieve flags status.');
|
|
214
|
+
return Promise.reject(error);
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
exports.CommentApiClient = CommentApiClient;
|
|
221
|
+
|
|
222
|
+
class CommentService {
|
|
223
|
+
static async getAllComments() {
|
|
224
|
+
return CommentApiClient.getAllComments();
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
static async createComment() {
|
|
228
|
+
return CommentApiClient.createComment();
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
static async getASpecificComment(id) {
|
|
232
|
+
return CommentApiClient.getASpecificComment(id);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
static async updateComment(id) {
|
|
236
|
+
return CommentApiClient.updateComment(id);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
static async deleteComment(id) {
|
|
240
|
+
return CommentApiClient.deleteComment(id);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
static async restoreComment(id) {
|
|
244
|
+
return CommentApiClient.restoreComment(id);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
static async getSpecificCommentVotesList(id) {
|
|
248
|
+
return CommentApiClient.getSpecificCommentVotesList(id);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
static async upvoteComment(id) {
|
|
252
|
+
return CommentApiClient.upvoteComment(id);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
static async getSpecificCommentFlags(id) {
|
|
256
|
+
return CommentApiClient.getSpecificCommentFlags(id);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
static async flagComment(id) {
|
|
260
|
+
return CommentApiClient.flagComment(id);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
static async getSpecificCommentFlagStatus(id) {
|
|
264
|
+
return CommentApiClient.getSpecificCommentFlagStatus(id);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
exports.default = CommentService;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = exports.CustomAdvApiClient = void 0;
|
|
5
|
+
|
|
6
|
+
var _client = _interopRequireDefault(require("../../client"));
|
|
7
|
+
|
|
8
|
+
var _Endpoints = _interopRequireDefault(require("../../constants/Endpoints"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
class CustomAdvApiClient {
|
|
13
|
+
static getASpecificCustomAdv(id) {
|
|
14
|
+
return _client.default.request({
|
|
15
|
+
url: _Endpoints.default.CustomAdv.url({
|
|
16
|
+
id
|
|
17
|
+
}),
|
|
18
|
+
method: _Endpoints.default.CustomAdv.method
|
|
19
|
+
}).then(res => {
|
|
20
|
+
if (res.status >= 300) {
|
|
21
|
+
console.log(`Unable to retrieve custom adv (Response code: ${res.status}).`);
|
|
22
|
+
return Promise.reject(res);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return Promise.resolve(res);
|
|
26
|
+
}).catch(error => {
|
|
27
|
+
console.log('Unable to retrieve custom adv.');
|
|
28
|
+
return Promise.reject(error);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static getAllCustomAdv() {
|
|
33
|
+
return _client.default.request({
|
|
34
|
+
url: _Endpoints.default.CustomAdvList.url({}),
|
|
35
|
+
method: _Endpoints.default.CustomAdvList.method
|
|
36
|
+
}).then(res => {
|
|
37
|
+
if (res.status >= 300) {
|
|
38
|
+
console.log(`Unable to retrieve custom advs (Response code: ${res.status}).`);
|
|
39
|
+
return Promise.reject(res);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return Promise.resolve(res);
|
|
43
|
+
}).catch(error => {
|
|
44
|
+
console.log('Unable to retrieve custom advs.');
|
|
45
|
+
return Promise.reject(error);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static searchCustomAdv() {
|
|
50
|
+
return _client.default.request({
|
|
51
|
+
url: _Endpoints.default.CustomAdvSearch.url({}),
|
|
52
|
+
method: _Endpoints.default.CustomAdvSearch.method
|
|
53
|
+
}).then(res => {
|
|
54
|
+
if (res.status >= 300) {
|
|
55
|
+
console.log(`Unable to retrieve custom advs (Response code: ${res.status}).`);
|
|
56
|
+
return Promise.reject(res);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return Promise.resolve(res);
|
|
60
|
+
}).catch(error => {
|
|
61
|
+
console.log('Unable to retrieve custom advs.');
|
|
62
|
+
return Promise.reject(error);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
exports.CustomAdvApiClient = CustomAdvApiClient;
|
|
69
|
+
|
|
70
|
+
class CustomAdvService {
|
|
71
|
+
static async getASpecificCustomAdv(id) {
|
|
72
|
+
return CustomAdvApiClient.getASpecificCustomAdv(id);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static async getAllCustomAdv() {
|
|
76
|
+
return CustomAdvApiClient.getAllCustomAdv();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
static async searchCustomAdv() {
|
|
80
|
+
return CustomAdvApiClient.searchCustomAdv();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
exports.default = CustomAdvService;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = exports.CustomPageApiClient = void 0;
|
|
5
|
+
|
|
6
|
+
var _client = _interopRequireDefault(require("../../client"));
|
|
7
|
+
|
|
8
|
+
var _Endpoints = _interopRequireDefault(require("../../constants/Endpoints"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
class CustomPageApiClient {
|
|
13
|
+
static getASpecificCustomPage(id) {
|
|
14
|
+
return _client.default.request({
|
|
15
|
+
url: _Endpoints.default.CustomPage.url({
|
|
16
|
+
id
|
|
17
|
+
}),
|
|
18
|
+
method: _Endpoints.default.CustomPage.method
|
|
19
|
+
}).then(res => {
|
|
20
|
+
if (res.status >= 300) {
|
|
21
|
+
console.log(`Unable to retrieve custom page (Response code: ${res.status}).`);
|
|
22
|
+
return Promise.reject(res);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return Promise.resolve(res);
|
|
26
|
+
}).catch(error => {
|
|
27
|
+
console.log('Unable to retrieve custom page.');
|
|
28
|
+
return Promise.reject(error);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static getAllCustomPages() {
|
|
33
|
+
return _client.default.request({
|
|
34
|
+
url: _Endpoints.default.GetCustomPages.url({}),
|
|
35
|
+
method: _Endpoints.default.GetCustomPages.method
|
|
36
|
+
}).then(res => {
|
|
37
|
+
if (res.status >= 300) {
|
|
38
|
+
console.log(`Unable to retrieve custom pages (Response code: ${res.status}).`);
|
|
39
|
+
return Promise.reject(res);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return Promise.resolve(res);
|
|
43
|
+
}).catch(error => {
|
|
44
|
+
console.log('Unable to retrieve custom pages.');
|
|
45
|
+
return Promise.reject(error);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static searchCustomPages() {
|
|
50
|
+
return _client.default.request({
|
|
51
|
+
url: _Endpoints.default.CustomPageSearch.url({}),
|
|
52
|
+
method: _Endpoints.default.CustomPageSearch.method
|
|
53
|
+
}).then(res => {
|
|
54
|
+
if (res.status >= 300) {
|
|
55
|
+
console.log(`Unable to retrieve custom pages (Response code: ${res.status}).`);
|
|
56
|
+
return Promise.reject(res);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return Promise.resolve(res);
|
|
60
|
+
}).catch(error => {
|
|
61
|
+
console.log('Unable to retrieve custom pages.');
|
|
62
|
+
return Promise.reject(error);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
exports.CustomPageApiClient = CustomPageApiClient;
|
|
69
|
+
|
|
70
|
+
class CustomPageService {
|
|
71
|
+
static async getASpecificCustomPage(id) {
|
|
72
|
+
return CustomPageApiClient.getASpecificCustomPage(id);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static async getAllCustomPages() {
|
|
76
|
+
return CustomPageApiClient.getAllCustomPages();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
static async searchCustomPages() {
|
|
80
|
+
return CustomPageApiClient.searchCustomPages();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
exports.default = CustomPageService;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = exports.DataPortabilityApiClient = void 0;
|
|
5
|
+
|
|
6
|
+
var _client = _interopRequireDefault(require("../../client"));
|
|
7
|
+
|
|
8
|
+
var _Endpoints = _interopRequireDefault(require("../../constants/Endpoints"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
class DataPortabilityApiClient {
|
|
13
|
+
static generateDataPortability() {
|
|
14
|
+
return _client.default.request({
|
|
15
|
+
url: _Endpoints.default.GenerateDataPortability.url({}),
|
|
16
|
+
method: _Endpoints.default.GenerateDataPortability.method
|
|
17
|
+
}).then(res => {
|
|
18
|
+
if (res.status >= 300) {
|
|
19
|
+
console.log(`Unable to generate data (Response code: ${res.status}).`);
|
|
20
|
+
return Promise.reject(res);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return Promise.resolve(res);
|
|
24
|
+
}).catch(error => {
|
|
25
|
+
console.log('Unable to generate data.');
|
|
26
|
+
return Promise.reject(error);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static downloadDataPortability() {
|
|
31
|
+
return _client.default.request({
|
|
32
|
+
url: _Endpoints.default.DataPortabilityDownload.url({}),
|
|
33
|
+
method: _Endpoints.default.DataPortabilityDownload.method
|
|
34
|
+
}).then(res => {
|
|
35
|
+
if (res.status >= 300) {
|
|
36
|
+
console.log(`Unable to download data (Response code: ${res.status}).`);
|
|
37
|
+
return Promise.reject(res);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return Promise.resolve(res);
|
|
41
|
+
}).catch(error => {
|
|
42
|
+
console.log('Unable to download data.');
|
|
43
|
+
return Promise.reject(error);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
static dataPortabilityStatus() {
|
|
48
|
+
return _client.default.request({
|
|
49
|
+
url: _Endpoints.default.DataPortabilityStatus.url({}),
|
|
50
|
+
method: _Endpoints.default.DataPortabilityStatus.method
|
|
51
|
+
}).then(res => {
|
|
52
|
+
if (res.status >= 300) {
|
|
53
|
+
console.log(`Unable to retrieve data status (Response code: ${res.status}).`);
|
|
54
|
+
return Promise.reject(res);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return Promise.resolve(res);
|
|
58
|
+
}).catch(error => {
|
|
59
|
+
console.log('Unable to retrieve data status.');
|
|
60
|
+
return Promise.reject(error);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
exports.DataPortabilityApiClient = DataPortabilityApiClient;
|
|
67
|
+
|
|
68
|
+
class DataPortabilityService {
|
|
69
|
+
static async generateDataPortability() {
|
|
70
|
+
return DataPortabilityApiClient.generateDataPortability();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
static async downloadDataPortability() {
|
|
74
|
+
return DataPortabilityApiClient.downloadDataPortability();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
static async dataPortabilityStatus() {
|
|
78
|
+
return DataPortabilityApiClient.dataPortabilityStatus();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
exports.default = DataPortabilityService;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = exports.DynamicPreferenceApiClient = void 0;
|
|
5
|
+
|
|
6
|
+
var _client = _interopRequireDefault(require("../../client"));
|
|
7
|
+
|
|
8
|
+
var _Endpoints = _interopRequireDefault(require("../../constants/Endpoints"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
class DynamicPreferenceApiClient {
|
|
13
|
+
static getASpecificDynamicPreference(id) {
|
|
14
|
+
return _client.default.request({
|
|
15
|
+
url: _Endpoints.default.SpecificPreference.url({
|
|
16
|
+
id
|
|
17
|
+
}),
|
|
18
|
+
method: _Endpoints.default.SpecificPreference.method
|
|
19
|
+
}).then(res => {
|
|
20
|
+
if (res.status >= 300) {
|
|
21
|
+
console.log(`Unable to retrieve preference (Response code: ${res.status}).`);
|
|
22
|
+
return Promise.reject(res);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return Promise.resolve(res);
|
|
26
|
+
}).catch(error => {
|
|
27
|
+
console.log('Unable to retrieve preference.');
|
|
28
|
+
return Promise.reject(error);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static getAllDynamicPreferences() {
|
|
33
|
+
return _client.default.request({
|
|
34
|
+
url: _Endpoints.default.Preferences.url({}),
|
|
35
|
+
method: _Endpoints.default.Preferences.method
|
|
36
|
+
}).then(res => {
|
|
37
|
+
if (res.status >= 300) {
|
|
38
|
+
console.log(`Unable to retrieve preferences (Response code: ${res.status}).`);
|
|
39
|
+
return Promise.reject(res);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return Promise.resolve(res);
|
|
43
|
+
}).catch(error => {
|
|
44
|
+
console.log('Unable to retrieve preferences.');
|
|
45
|
+
return Promise.reject(error);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static searchDynamicPreference() {
|
|
50
|
+
return _client.default.request({
|
|
51
|
+
url: _Endpoints.default.PreferenceSearch.url({}),
|
|
52
|
+
method: _Endpoints.default.PreferenceSearch.method
|
|
53
|
+
}).then(res => {
|
|
54
|
+
if (res.status >= 300) {
|
|
55
|
+
console.log(`Unable to retrieve preferences (Response code: ${res.status}).`);
|
|
56
|
+
return Promise.reject(res);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return Promise.resolve(res);
|
|
60
|
+
}).catch(error => {
|
|
61
|
+
console.log('Unable to retrieve preferences.');
|
|
62
|
+
return Promise.reject(error);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
exports.DynamicPreferenceApiClient = DynamicPreferenceApiClient;
|
|
69
|
+
|
|
70
|
+
class DynamicPreferenceService {
|
|
71
|
+
static async getASpecificDynamicPreference(id) {
|
|
72
|
+
return DynamicPreferenceApiClient.getASpecificDynamicPreference(id);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static async getAllDynamicPreferences() {
|
|
76
|
+
return DynamicPreferenceApiClient.getAllDynamicPreferences();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
static async searchDynamicPreference() {
|
|
80
|
+
return DynamicPreferenceApiClient.searchDynamicPreference();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
exports.default = DynamicPreferenceService;
|