@selfcommunity/api-services 0.5.0-embeds.29 → 0.5.0-livestream.48
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/client/index.d.ts +3 -3
- package/lib/cjs/client/index.js +3 -3
- package/lib/cjs/constants/Endpoints.js +16 -0
- package/lib/cjs/services/event/index.d.ts +27 -3
- package/lib/cjs/services/event/index.js +42 -1
- package/lib/cjs/services/group/index.d.ts +8 -0
- package/lib/cjs/services/group/index.js +13 -0
- package/lib/cjs/types/event.d.ts +8 -0
- package/lib/esm/client/index.d.ts +3 -3
- package/lib/esm/client/index.js +3 -3
- package/lib/esm/constants/Endpoints.js +16 -0
- package/lib/esm/services/event/index.d.ts +27 -3
- package/lib/esm/services/event/index.js +42 -1
- package/lib/esm/services/group/index.d.ts +8 -0
- package/lib/esm/services/group/index.js +13 -0
- package/lib/esm/types/event.d.ts +8 -0
- package/lib/umd/api-services.js +1 -1
- package/lib/umd/api-services.js.LICENSE.txt +2 -0
- package/package.json +117 -112
|
@@ -2,17 +2,17 @@ import { AxiosInstance, AxiosResponse } from 'axios';
|
|
|
2
2
|
/**
|
|
3
3
|
* List of all Http methods
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type HttpMethod = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
6
6
|
/**
|
|
7
7
|
* AxiosResponseHeaders interface
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export type AxiosResponseHeaders = Record<string, string> & {
|
|
10
10
|
'set-cookie'?: string[];
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* General HttpResponse
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export type HttpResponse<T = unknown, D = any> = AxiosResponse<T, D>;
|
|
16
16
|
/**
|
|
17
17
|
* Interface for the ApiClient
|
|
18
18
|
*/
|
package/lib/cjs/client/index.js
CHANGED
|
@@ -10,6 +10,9 @@ const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
|
10
10
|
* should we choose to do so in the future, without it breaking our app.
|
|
11
11
|
*/
|
|
12
12
|
class ApiClient {
|
|
13
|
+
createClient(config) {
|
|
14
|
+
return axios_1.default.create(Object.assign(Object.assign({}, (config && config.baseURL && { baseURL: config.baseURL })), { responseType: 'json', headers: Object.assign({}, (config && config.accessToken && { Authorization: `Token ${config.accessToken}` })), timeout: ApiClient.DEFAULT_TIMEOUT }));
|
|
15
|
+
}
|
|
13
16
|
constructor(config) {
|
|
14
17
|
/**
|
|
15
18
|
* Set default header
|
|
@@ -51,9 +54,6 @@ class ApiClient {
|
|
|
51
54
|
this.client = this.createClient(config);
|
|
52
55
|
this.setDefaultHeader({ name: 'Content-Type', value: 'application/json', methods: ['post'] });
|
|
53
56
|
}
|
|
54
|
-
createClient(config) {
|
|
55
|
-
return axios_1.default.create(Object.assign(Object.assign({}, (config && config.baseURL && { baseURL: config.baseURL })), { responseType: 'json', headers: Object.assign({}, (config && config.accessToken && { Authorization: `Token ${config.accessToken}` })), timeout: ApiClient.DEFAULT_TIMEOUT }));
|
|
56
|
-
}
|
|
57
57
|
/**
|
|
58
58
|
* Get client instance
|
|
59
59
|
*/
|
|
@@ -1161,6 +1161,10 @@ const Endpoints = {
|
|
|
1161
1161
|
url: (0, utils_1.urlReplacer)('/api/v2/group/$(id)/'),
|
|
1162
1162
|
method: 'PATCH'
|
|
1163
1163
|
},
|
|
1164
|
+
DeleteGroup: {
|
|
1165
|
+
url: (0, utils_1.urlReplacer)('/api/v2/group/$(id)/'),
|
|
1166
|
+
method: 'DELETE'
|
|
1167
|
+
},
|
|
1164
1168
|
GetGroupSuggestedUsers: {
|
|
1165
1169
|
url: (0, utils_1.urlReplacer)('/api/v2/group/$(id)/user/?search=$(search)'),
|
|
1166
1170
|
method: 'GET'
|
|
@@ -1324,6 +1328,18 @@ const Endpoints = {
|
|
|
1324
1328
|
url: (0, utils_1.urlReplacer)('/api/v2/event/$(id)/hide/'),
|
|
1325
1329
|
method: 'POST'
|
|
1326
1330
|
},
|
|
1331
|
+
GetEventPhotoGallery: {
|
|
1332
|
+
url: (0, utils_1.urlReplacer)('/api/v2/event/$(id)/gallery/'),
|
|
1333
|
+
method: 'GET'
|
|
1334
|
+
},
|
|
1335
|
+
AddMediaToEventPhotoGallery: {
|
|
1336
|
+
url: (0, utils_1.urlReplacer)('/api/v2/event/$(id)/gallery/'),
|
|
1337
|
+
method: 'POST'
|
|
1338
|
+
},
|
|
1339
|
+
RemoveMediasFromEventPhotoGallery: {
|
|
1340
|
+
url: (0, utils_1.urlReplacer)('/api/v2/event/$(id)/gallery/'),
|
|
1341
|
+
method: 'DELETE'
|
|
1342
|
+
},
|
|
1327
1343
|
/**
|
|
1328
1344
|
* OnBoarding
|
|
1329
1345
|
*/
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SCEventType, SCUserType } from '@selfcommunity/types';
|
|
1
|
+
import { SCEventType, SCMediaType, SCUserType } from '@selfcommunity/types';
|
|
3
2
|
import { AxiosRequestConfig } from 'axios';
|
|
4
|
-
import { EventCreateParams, EventSearchParams } from '../../types';
|
|
3
|
+
import { BaseGetParams, BaseSearchParams, EventCreateParams, EventFeedParams, EventRelatedParams, EventSearchParams, SCPaginatedResponse } from '../../types';
|
|
5
4
|
import { EventUserParams } from '../../types/event';
|
|
6
5
|
export interface EventApiClientInterface {
|
|
7
6
|
getUserEvents(params?: EventUserParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCEventType>>;
|
|
@@ -38,6 +37,9 @@ export interface EventApiClientInterface {
|
|
|
38
37
|
getEventRelated(id: number | string, params?: EventRelatedParams, config?: AxiosRequestConfig): Promise<any>;
|
|
39
38
|
showEvent(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
40
39
|
hideEvent(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
40
|
+
getEventPhotoGallery(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCMediaType>>;
|
|
41
|
+
addMediaToEventPhotoGallery(id: number | string, config?: AxiosRequestConfig): Promise<SCMediaType>;
|
|
42
|
+
removeMediasFromEventPhotoGallery(id: number | string, config?: AxiosRequestConfig): Promise<void>;
|
|
41
43
|
}
|
|
42
44
|
/**
|
|
43
45
|
* Contains all the endpoints needed to manage events.
|
|
@@ -242,6 +244,25 @@ export declare class EventApiClient {
|
|
|
242
244
|
* @param config
|
|
243
245
|
*/
|
|
244
246
|
static hideEvent(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
247
|
+
/**
|
|
248
|
+
* This endpoint returns the gallery of a specific event.
|
|
249
|
+
* @param id
|
|
250
|
+
* @param params
|
|
251
|
+
* @param config
|
|
252
|
+
*/
|
|
253
|
+
static getEventPhotoGallery(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCMediaType>>;
|
|
254
|
+
/**
|
|
255
|
+
* This endpoint adds the media in a gallery of a specific event.
|
|
256
|
+
* @param id
|
|
257
|
+
* @param config
|
|
258
|
+
*/
|
|
259
|
+
static addMediaToEventPhotoGallery(id: number | string, config?: AxiosRequestConfig): Promise<SCMediaType>;
|
|
260
|
+
/**
|
|
261
|
+
* This endpoint removes the medias in a gallery of a specific event.
|
|
262
|
+
* @param id
|
|
263
|
+
* @param config
|
|
264
|
+
*/
|
|
265
|
+
static removeMediasFromEventPhotoGallery(id: number | string, config?: AxiosRequestConfig): Promise<void>;
|
|
245
266
|
}
|
|
246
267
|
/**
|
|
247
268
|
*
|
|
@@ -313,4 +334,7 @@ export default class EventService {
|
|
|
313
334
|
static getEventRelated(id: number | string, params?: EventRelatedParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCEventType>>;
|
|
314
335
|
static showEvent(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
315
336
|
static hideEvent(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
337
|
+
static getEventPhotoGallery(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCMediaType>>;
|
|
338
|
+
static addMediaToEventPhotoGallery(id: number | string, config?: AxiosRequestConfig): Promise<SCMediaType>;
|
|
339
|
+
static removeMediasFromEventPhotoGallery(id: number | string, config?: AxiosRequestConfig): Promise<void>;
|
|
316
340
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EventApiClient = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const apiRequest_1 = require("../../utils/apiRequest");
|
|
6
5
|
const Endpoints_1 = tslib_1.__importDefault(require("../../constants/Endpoints"));
|
|
6
|
+
const apiRequest_1 = require("../../utils/apiRequest");
|
|
7
7
|
const url_1 = require("../../utils/url");
|
|
8
8
|
/**
|
|
9
9
|
* Contains all the endpoints needed to manage events.
|
|
@@ -275,6 +275,32 @@ class EventApiClient {
|
|
|
275
275
|
static hideEvent(id, config) {
|
|
276
276
|
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.hideEvent.url({ id }), method: Endpoints_1.default.hideEvent.method }));
|
|
277
277
|
}
|
|
278
|
+
/**
|
|
279
|
+
* This endpoint returns the gallery of a specific event.
|
|
280
|
+
* @param id
|
|
281
|
+
* @param params
|
|
282
|
+
* @param config
|
|
283
|
+
*/
|
|
284
|
+
static getEventPhotoGallery(id, params, config) {
|
|
285
|
+
const p = (0, url_1.urlParams)(params);
|
|
286
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: `${Endpoints_1.default.GetEventPhotoGallery.url({ id })}?${p.toString()}`, method: Endpoints_1.default.GetEventPhotoGallery.method }));
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* This endpoint adds the media in a gallery of a specific event.
|
|
290
|
+
* @param id
|
|
291
|
+
* @param config
|
|
292
|
+
*/
|
|
293
|
+
static addMediaToEventPhotoGallery(id, config) {
|
|
294
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.AddMediaToEventPhotoGallery.url({ id }), method: Endpoints_1.default.AddMediaToEventPhotoGallery.method }));
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* This endpoint removes the medias in a gallery of a specific event.
|
|
298
|
+
* @param id
|
|
299
|
+
* @param config
|
|
300
|
+
*/
|
|
301
|
+
static removeMediasFromEventPhotoGallery(id, config) {
|
|
302
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.RemoveMediasFromEventPhotoGallery.url({ id }), method: Endpoints_1.default.RemoveMediasFromEventPhotoGallery.method }));
|
|
303
|
+
}
|
|
278
304
|
}
|
|
279
305
|
exports.EventApiClient = EventApiClient;
|
|
280
306
|
/**
|
|
@@ -463,5 +489,20 @@ class EventService {
|
|
|
463
489
|
return EventApiClient.hideEvent(id, config);
|
|
464
490
|
});
|
|
465
491
|
}
|
|
492
|
+
static getEventPhotoGallery(id, params, config) {
|
|
493
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
494
|
+
return EventApiClient.getEventPhotoGallery(id, params, config);
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
static addMediaToEventPhotoGallery(id, config) {
|
|
498
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
499
|
+
return EventApiClient.addMediaToEventPhotoGallery(id, config);
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
static removeMediasFromEventPhotoGallery(id, config) {
|
|
503
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
504
|
+
return EventApiClient.removeMediasFromEventPhotoGallery(id, config);
|
|
505
|
+
});
|
|
506
|
+
}
|
|
466
507
|
}
|
|
467
508
|
exports.default = EventService;
|
|
@@ -11,6 +11,7 @@ export interface GroupApiClientInterface {
|
|
|
11
11
|
createGroup(data: GroupCreateParams | FormData, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
12
12
|
updateGroup(id: number | string, data: SCGroupType, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
13
13
|
patchGroup(id: number | string, data: SCGroupType, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
14
|
+
deleteGroup(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
14
15
|
changeGroupAvatarOrCover(id: number | string, data: FormData, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
15
16
|
getGroupMembers(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
16
17
|
getGroupSuggestedUsers(id: number | string, search: string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
@@ -81,6 +82,12 @@ export declare class GroupApiClient {
|
|
|
81
82
|
* @param config
|
|
82
83
|
*/
|
|
83
84
|
static patchGroup(id: number | string, data: SCGroupType, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
85
|
+
/**
|
|
86
|
+
* This endpoint deletes a group.
|
|
87
|
+
* @param id
|
|
88
|
+
* @param config
|
|
89
|
+
*/
|
|
90
|
+
static deleteGroup(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
84
91
|
/**
|
|
85
92
|
* This endpoint changes the group avatar
|
|
86
93
|
* @param id
|
|
@@ -201,6 +208,7 @@ export default class GroupService {
|
|
|
201
208
|
static createGroup(data: GroupCreateParams | FormData, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
202
209
|
static updateGroup(id: number | string, data: SCGroupType, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
203
210
|
static patchGroup(id: number | string, data: SCGroupType, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
211
|
+
static deleteGroup(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
204
212
|
static changeGroupAvatarOrCover(id: number | string, data: FormData, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
205
213
|
static getGroupMembers(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
206
214
|
static getGroupSuggestedUsers(id: number | string, search: string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
@@ -81,6 +81,14 @@ class GroupApiClient {
|
|
|
81
81
|
static patchGroup(id, data, config) {
|
|
82
82
|
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.PatchGroup.url({ id }), method: Endpoints_1.default.PatchGroup.method, data: data }));
|
|
83
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* This endpoint deletes a group.
|
|
86
|
+
* @param id
|
|
87
|
+
* @param config
|
|
88
|
+
*/
|
|
89
|
+
static deleteGroup(id, config) {
|
|
90
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.DeleteGroup.url({ id }), method: Endpoints_1.default.DeleteGroup.method }));
|
|
91
|
+
}
|
|
84
92
|
/**
|
|
85
93
|
* This endpoint changes the group avatar
|
|
86
94
|
* @param id
|
|
@@ -257,6 +265,11 @@ class GroupService {
|
|
|
257
265
|
return GroupApiClient.patchGroup(id, data, config);
|
|
258
266
|
});
|
|
259
267
|
}
|
|
268
|
+
static deleteGroup(id, config) {
|
|
269
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
270
|
+
return GroupApiClient.deleteGroup(id, config);
|
|
271
|
+
});
|
|
272
|
+
}
|
|
260
273
|
static changeGroupAvatarOrCover(id, data, config) {
|
|
261
274
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
262
275
|
return GroupApiClient.changeGroupAvatarOrCover(id, data, config);
|
package/lib/cjs/types/event.d.ts
CHANGED
|
@@ -88,6 +88,10 @@ export interface EventUserParams extends BaseGetParams {
|
|
|
88
88
|
* Filtered past events
|
|
89
89
|
*/
|
|
90
90
|
past?: boolean | number;
|
|
91
|
+
/**
|
|
92
|
+
* Filtered location
|
|
93
|
+
*/
|
|
94
|
+
location?: SCEventLocationType;
|
|
91
95
|
}
|
|
92
96
|
/**
|
|
93
97
|
* EventFeedParams interface.
|
|
@@ -105,4 +109,8 @@ export interface EventSearchParams extends BaseSearchParams {
|
|
|
105
109
|
* Filtered past events
|
|
106
110
|
*/
|
|
107
111
|
past?: boolean | number;
|
|
112
|
+
/**
|
|
113
|
+
* Filtered location
|
|
114
|
+
*/
|
|
115
|
+
location?: SCEventLocationType;
|
|
108
116
|
}
|
|
@@ -2,17 +2,17 @@ import { AxiosInstance, AxiosResponse } from 'axios';
|
|
|
2
2
|
/**
|
|
3
3
|
* List of all Http methods
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type HttpMethod = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
6
6
|
/**
|
|
7
7
|
* AxiosResponseHeaders interface
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export type AxiosResponseHeaders = Record<string, string> & {
|
|
10
10
|
'set-cookie'?: string[];
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* General HttpResponse
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export type HttpResponse<T = unknown, D = any> = AxiosResponse<T, D>;
|
|
16
16
|
/**
|
|
17
17
|
* Interface for the ApiClient
|
|
18
18
|
*/
|
package/lib/esm/client/index.js
CHANGED
|
@@ -6,6 +6,9 @@ import axios from 'axios';
|
|
|
6
6
|
* should we choose to do so in the future, without it breaking our app.
|
|
7
7
|
*/
|
|
8
8
|
export class ApiClient {
|
|
9
|
+
createClient(config) {
|
|
10
|
+
return axios.create(Object.assign(Object.assign({}, (config && config.baseURL && { baseURL: config.baseURL })), { responseType: 'json', headers: Object.assign({}, (config && config.accessToken && { Authorization: `Token ${config.accessToken}` })), timeout: ApiClient.DEFAULT_TIMEOUT }));
|
|
11
|
+
}
|
|
9
12
|
constructor(config) {
|
|
10
13
|
/**
|
|
11
14
|
* Set default header
|
|
@@ -47,9 +50,6 @@ export class ApiClient {
|
|
|
47
50
|
this.client = this.createClient(config);
|
|
48
51
|
this.setDefaultHeader({ name: 'Content-Type', value: 'application/json', methods: ['post'] });
|
|
49
52
|
}
|
|
50
|
-
createClient(config) {
|
|
51
|
-
return axios.create(Object.assign(Object.assign({}, (config && config.baseURL && { baseURL: config.baseURL })), { responseType: 'json', headers: Object.assign({}, (config && config.accessToken && { Authorization: `Token ${config.accessToken}` })), timeout: ApiClient.DEFAULT_TIMEOUT }));
|
|
52
|
-
}
|
|
53
53
|
/**
|
|
54
54
|
* Get client instance
|
|
55
55
|
*/
|
|
@@ -1159,6 +1159,10 @@ const Endpoints = {
|
|
|
1159
1159
|
url: urlReplacer('/api/v2/group/$(id)/'),
|
|
1160
1160
|
method: 'PATCH'
|
|
1161
1161
|
},
|
|
1162
|
+
DeleteGroup: {
|
|
1163
|
+
url: urlReplacer('/api/v2/group/$(id)/'),
|
|
1164
|
+
method: 'DELETE'
|
|
1165
|
+
},
|
|
1162
1166
|
GetGroupSuggestedUsers: {
|
|
1163
1167
|
url: urlReplacer('/api/v2/group/$(id)/user/?search=$(search)'),
|
|
1164
1168
|
method: 'GET'
|
|
@@ -1322,6 +1326,18 @@ const Endpoints = {
|
|
|
1322
1326
|
url: urlReplacer('/api/v2/event/$(id)/hide/'),
|
|
1323
1327
|
method: 'POST'
|
|
1324
1328
|
},
|
|
1329
|
+
GetEventPhotoGallery: {
|
|
1330
|
+
url: urlReplacer('/api/v2/event/$(id)/gallery/'),
|
|
1331
|
+
method: 'GET'
|
|
1332
|
+
},
|
|
1333
|
+
AddMediaToEventPhotoGallery: {
|
|
1334
|
+
url: urlReplacer('/api/v2/event/$(id)/gallery/'),
|
|
1335
|
+
method: 'POST'
|
|
1336
|
+
},
|
|
1337
|
+
RemoveMediasFromEventPhotoGallery: {
|
|
1338
|
+
url: urlReplacer('/api/v2/event/$(id)/gallery/'),
|
|
1339
|
+
method: 'DELETE'
|
|
1340
|
+
},
|
|
1325
1341
|
/**
|
|
1326
1342
|
* OnBoarding
|
|
1327
1343
|
*/
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SCEventType, SCUserType } from '@selfcommunity/types';
|
|
1
|
+
import { SCEventType, SCMediaType, SCUserType } from '@selfcommunity/types';
|
|
3
2
|
import { AxiosRequestConfig } from 'axios';
|
|
4
|
-
import { EventCreateParams, EventSearchParams } from '../../types';
|
|
3
|
+
import { BaseGetParams, BaseSearchParams, EventCreateParams, EventFeedParams, EventRelatedParams, EventSearchParams, SCPaginatedResponse } from '../../types';
|
|
5
4
|
import { EventUserParams } from '../../types/event';
|
|
6
5
|
export interface EventApiClientInterface {
|
|
7
6
|
getUserEvents(params?: EventUserParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCEventType>>;
|
|
@@ -38,6 +37,9 @@ export interface EventApiClientInterface {
|
|
|
38
37
|
getEventRelated(id: number | string, params?: EventRelatedParams, config?: AxiosRequestConfig): Promise<any>;
|
|
39
38
|
showEvent(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
40
39
|
hideEvent(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
40
|
+
getEventPhotoGallery(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCMediaType>>;
|
|
41
|
+
addMediaToEventPhotoGallery(id: number | string, config?: AxiosRequestConfig): Promise<SCMediaType>;
|
|
42
|
+
removeMediasFromEventPhotoGallery(id: number | string, config?: AxiosRequestConfig): Promise<void>;
|
|
41
43
|
}
|
|
42
44
|
/**
|
|
43
45
|
* Contains all the endpoints needed to manage events.
|
|
@@ -242,6 +244,25 @@ export declare class EventApiClient {
|
|
|
242
244
|
* @param config
|
|
243
245
|
*/
|
|
244
246
|
static hideEvent(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
247
|
+
/**
|
|
248
|
+
* This endpoint returns the gallery of a specific event.
|
|
249
|
+
* @param id
|
|
250
|
+
* @param params
|
|
251
|
+
* @param config
|
|
252
|
+
*/
|
|
253
|
+
static getEventPhotoGallery(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCMediaType>>;
|
|
254
|
+
/**
|
|
255
|
+
* This endpoint adds the media in a gallery of a specific event.
|
|
256
|
+
* @param id
|
|
257
|
+
* @param config
|
|
258
|
+
*/
|
|
259
|
+
static addMediaToEventPhotoGallery(id: number | string, config?: AxiosRequestConfig): Promise<SCMediaType>;
|
|
260
|
+
/**
|
|
261
|
+
* This endpoint removes the medias in a gallery of a specific event.
|
|
262
|
+
* @param id
|
|
263
|
+
* @param config
|
|
264
|
+
*/
|
|
265
|
+
static removeMediasFromEventPhotoGallery(id: number | string, config?: AxiosRequestConfig): Promise<void>;
|
|
245
266
|
}
|
|
246
267
|
/**
|
|
247
268
|
*
|
|
@@ -313,4 +334,7 @@ export default class EventService {
|
|
|
313
334
|
static getEventRelated(id: number | string, params?: EventRelatedParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCEventType>>;
|
|
314
335
|
static showEvent(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
315
336
|
static hideEvent(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
337
|
+
static getEventPhotoGallery(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCMediaType>>;
|
|
338
|
+
static addMediaToEventPhotoGallery(id: number | string, config?: AxiosRequestConfig): Promise<SCMediaType>;
|
|
339
|
+
static removeMediasFromEventPhotoGallery(id: number | string, config?: AxiosRequestConfig): Promise<void>;
|
|
316
340
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
|
-
import { apiRequest } from '../../utils/apiRequest';
|
|
3
2
|
import Endpoints from '../../constants/Endpoints';
|
|
3
|
+
import { apiRequest } from '../../utils/apiRequest';
|
|
4
4
|
import { urlParams } from '../../utils/url';
|
|
5
5
|
/**
|
|
6
6
|
* Contains all the endpoints needed to manage events.
|
|
@@ -272,6 +272,32 @@ export class EventApiClient {
|
|
|
272
272
|
static hideEvent(id, config) {
|
|
273
273
|
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.hideEvent.url({ id }), method: Endpoints.hideEvent.method }));
|
|
274
274
|
}
|
|
275
|
+
/**
|
|
276
|
+
* This endpoint returns the gallery of a specific event.
|
|
277
|
+
* @param id
|
|
278
|
+
* @param params
|
|
279
|
+
* @param config
|
|
280
|
+
*/
|
|
281
|
+
static getEventPhotoGallery(id, params, config) {
|
|
282
|
+
const p = urlParams(params);
|
|
283
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: `${Endpoints.GetEventPhotoGallery.url({ id })}?${p.toString()}`, method: Endpoints.GetEventPhotoGallery.method }));
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* This endpoint adds the media in a gallery of a specific event.
|
|
287
|
+
* @param id
|
|
288
|
+
* @param config
|
|
289
|
+
*/
|
|
290
|
+
static addMediaToEventPhotoGallery(id, config) {
|
|
291
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.AddMediaToEventPhotoGallery.url({ id }), method: Endpoints.AddMediaToEventPhotoGallery.method }));
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* This endpoint removes the medias in a gallery of a specific event.
|
|
295
|
+
* @param id
|
|
296
|
+
* @param config
|
|
297
|
+
*/
|
|
298
|
+
static removeMediasFromEventPhotoGallery(id, config) {
|
|
299
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.RemoveMediasFromEventPhotoGallery.url({ id }), method: Endpoints.RemoveMediasFromEventPhotoGallery.method }));
|
|
300
|
+
}
|
|
275
301
|
}
|
|
276
302
|
/**
|
|
277
303
|
*
|
|
@@ -459,4 +485,19 @@ export default class EventService {
|
|
|
459
485
|
return EventApiClient.hideEvent(id, config);
|
|
460
486
|
});
|
|
461
487
|
}
|
|
488
|
+
static getEventPhotoGallery(id, params, config) {
|
|
489
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
490
|
+
return EventApiClient.getEventPhotoGallery(id, params, config);
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
static addMediaToEventPhotoGallery(id, config) {
|
|
494
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
495
|
+
return EventApiClient.addMediaToEventPhotoGallery(id, config);
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
static removeMediasFromEventPhotoGallery(id, config) {
|
|
499
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
500
|
+
return EventApiClient.removeMediasFromEventPhotoGallery(id, config);
|
|
501
|
+
});
|
|
502
|
+
}
|
|
462
503
|
}
|
|
@@ -11,6 +11,7 @@ export interface GroupApiClientInterface {
|
|
|
11
11
|
createGroup(data: GroupCreateParams | FormData, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
12
12
|
updateGroup(id: number | string, data: SCGroupType, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
13
13
|
patchGroup(id: number | string, data: SCGroupType, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
14
|
+
deleteGroup(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
14
15
|
changeGroupAvatarOrCover(id: number | string, data: FormData, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
15
16
|
getGroupMembers(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
16
17
|
getGroupSuggestedUsers(id: number | string, search: string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
@@ -81,6 +82,12 @@ export declare class GroupApiClient {
|
|
|
81
82
|
* @param config
|
|
82
83
|
*/
|
|
83
84
|
static patchGroup(id: number | string, data: SCGroupType, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
85
|
+
/**
|
|
86
|
+
* This endpoint deletes a group.
|
|
87
|
+
* @param id
|
|
88
|
+
* @param config
|
|
89
|
+
*/
|
|
90
|
+
static deleteGroup(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
84
91
|
/**
|
|
85
92
|
* This endpoint changes the group avatar
|
|
86
93
|
* @param id
|
|
@@ -201,6 +208,7 @@ export default class GroupService {
|
|
|
201
208
|
static createGroup(data: GroupCreateParams | FormData, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
202
209
|
static updateGroup(id: number | string, data: SCGroupType, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
203
210
|
static patchGroup(id: number | string, data: SCGroupType, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
211
|
+
static deleteGroup(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
204
212
|
static changeGroupAvatarOrCover(id: number | string, data: FormData, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
205
213
|
static getGroupMembers(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
206
214
|
static getGroupSuggestedUsers(id: number | string, search: string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
@@ -78,6 +78,14 @@ export class GroupApiClient {
|
|
|
78
78
|
static patchGroup(id, data, config) {
|
|
79
79
|
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.PatchGroup.url({ id }), method: Endpoints.PatchGroup.method, data: data }));
|
|
80
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* This endpoint deletes a group.
|
|
83
|
+
* @param id
|
|
84
|
+
* @param config
|
|
85
|
+
*/
|
|
86
|
+
static deleteGroup(id, config) {
|
|
87
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.DeleteGroup.url({ id }), method: Endpoints.DeleteGroup.method }));
|
|
88
|
+
}
|
|
81
89
|
/**
|
|
82
90
|
* This endpoint changes the group avatar
|
|
83
91
|
* @param id
|
|
@@ -253,6 +261,11 @@ export default class GroupService {
|
|
|
253
261
|
return GroupApiClient.patchGroup(id, data, config);
|
|
254
262
|
});
|
|
255
263
|
}
|
|
264
|
+
static deleteGroup(id, config) {
|
|
265
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
266
|
+
return GroupApiClient.deleteGroup(id, config);
|
|
267
|
+
});
|
|
268
|
+
}
|
|
256
269
|
static changeGroupAvatarOrCover(id, data, config) {
|
|
257
270
|
return __awaiter(this, void 0, void 0, function* () {
|
|
258
271
|
return GroupApiClient.changeGroupAvatarOrCover(id, data, config);
|
package/lib/esm/types/event.d.ts
CHANGED
|
@@ -88,6 +88,10 @@ export interface EventUserParams extends BaseGetParams {
|
|
|
88
88
|
* Filtered past events
|
|
89
89
|
*/
|
|
90
90
|
past?: boolean | number;
|
|
91
|
+
/**
|
|
92
|
+
* Filtered location
|
|
93
|
+
*/
|
|
94
|
+
location?: SCEventLocationType;
|
|
91
95
|
}
|
|
92
96
|
/**
|
|
93
97
|
* EventFeedParams interface.
|
|
@@ -105,4 +109,8 @@ export interface EventSearchParams extends BaseSearchParams {
|
|
|
105
109
|
* Filtered past events
|
|
106
110
|
*/
|
|
107
111
|
past?: boolean | number;
|
|
112
|
+
/**
|
|
113
|
+
* Filtered location
|
|
114
|
+
*/
|
|
115
|
+
location?: SCEventLocationType;
|
|
108
116
|
}
|