@selfcommunity/api-services 0.5.0-embeds.29 → 0.5.0-live.102
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 +63 -0
- package/lib/cjs/index.d.ts +3 -2
- package/lib/cjs/index.js +4 -1
- 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/services/live_stream/index.d.ts +139 -0
- package/lib/cjs/services/live_stream/index.js +198 -0
- package/lib/cjs/services/user/index.d.ts +10 -1
- package/lib/cjs/services/user/index.js +14 -0
- package/lib/cjs/types/event.d.ts +8 -0
- package/lib/cjs/types/index.d.ts +2 -1
- package/lib/cjs/types/liveStream.d.ts +50 -0
- package/lib/cjs/types/liveStream.js +2 -0
- package/lib/esm/client/index.d.ts +3 -3
- package/lib/esm/client/index.js +3 -3
- package/lib/esm/constants/Endpoints.js +63 -0
- package/lib/esm/index.d.ts +3 -2
- package/lib/esm/index.js +2 -1
- 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/services/live_stream/index.d.ts +139 -0
- package/lib/esm/services/live_stream/index.js +193 -0
- package/lib/esm/services/user/index.d.ts +10 -1
- package/lib/esm/services/user/index.js +14 -0
- package/lib/esm/types/event.d.ts +8 -0
- package/lib/esm/types/index.d.ts +2 -1
- package/lib/esm/types/liveStream.d.ts +50 -0
- package/lib/esm/types/liveStream.js +1 -0
- package/lib/umd/api-services.js +1 -1
- package/lib/umd/api-services.js.LICENSE.txt +2 -0
- package/package.json +117 -112
|
@@ -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);
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { SCLiveStreamConnectionDetailsType, SCLiveStreamMonthlyDurationType, SCLiveStreamType } from '@selfcommunity/types';
|
|
2
|
+
import { AxiosRequestConfig } from 'axios';
|
|
3
|
+
import { SCPaginatedResponse } from '../../types';
|
|
4
|
+
import { LiveStreamCreateParams, LiveStreamRemoveParticipantParams, LiveStreamSearchParams } from '../../types/liveStream';
|
|
5
|
+
export interface LiveStreamApiClientInterface {
|
|
6
|
+
search(params?: LiveStreamSearchParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCLiveStreamType>>;
|
|
7
|
+
getSpecificInfo(id: number | string, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
8
|
+
create(data: LiveStreamCreateParams | FormData, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
9
|
+
update(id: number | string, data: SCLiveStreamType, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
10
|
+
patch(id: number | string, data: SCLiveStreamType, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
11
|
+
delete(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
12
|
+
close(id: number | string, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
13
|
+
changeCover(id: number | string, data: FormData, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
14
|
+
join(id: number | string, config?: AxiosRequestConfig): Promise<SCLiveStreamConnectionDetailsType>;
|
|
15
|
+
removeParticipant(id: number | string, data: LiveStreamRemoveParticipantParams | FormData, config?: AxiosRequestConfig): Promise<any>;
|
|
16
|
+
getMonthlyDuration(config?: AxiosRequestConfig): Promise<SCLiveStreamMonthlyDurationType>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Contains all the endpoints needed to manage LiveStreams.
|
|
20
|
+
*/
|
|
21
|
+
export declare class LiveStreamApiClient {
|
|
22
|
+
/**
|
|
23
|
+
* This endpoint performs LiveStreams search
|
|
24
|
+
* @param params
|
|
25
|
+
* @param config
|
|
26
|
+
*/
|
|
27
|
+
static search(params?: LiveStreamSearchParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCLiveStreamType>>;
|
|
28
|
+
/**
|
|
29
|
+
* This endpoint retrieves a specific LiveStream.
|
|
30
|
+
* @param id
|
|
31
|
+
* @param config
|
|
32
|
+
*/
|
|
33
|
+
static getSpecificInfo(id: number | string, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
34
|
+
/**
|
|
35
|
+
* This endpoint creates an LiveStream.
|
|
36
|
+
* @param data
|
|
37
|
+
* @param config
|
|
38
|
+
*/
|
|
39
|
+
static create(data: LiveStreamCreateParams | FormData, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
40
|
+
/**
|
|
41
|
+
* This endpoint updates an LiveStream.
|
|
42
|
+
* @param id
|
|
43
|
+
* @param data
|
|
44
|
+
* @param config
|
|
45
|
+
*/
|
|
46
|
+
static update(id: number | string, data: SCLiveStreamType, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
47
|
+
/**
|
|
48
|
+
* This endpoint patches an LiveStream.
|
|
49
|
+
* @param id
|
|
50
|
+
* @param data
|
|
51
|
+
* @param config
|
|
52
|
+
*/
|
|
53
|
+
static patch(id: number | string, data: SCLiveStreamType, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
54
|
+
/**
|
|
55
|
+
* This endpoint deletes an LiveStream.
|
|
56
|
+
* @param id
|
|
57
|
+
* @param config
|
|
58
|
+
*/
|
|
59
|
+
static delete(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
60
|
+
/**
|
|
61
|
+
* This endpoint allows to close permanently a room
|
|
62
|
+
* @param id
|
|
63
|
+
* @param config
|
|
64
|
+
*/
|
|
65
|
+
static close(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
66
|
+
/**
|
|
67
|
+
* This endpoint changes the LiveStream avatar
|
|
68
|
+
* @param id
|
|
69
|
+
* @param data
|
|
70
|
+
* @param config
|
|
71
|
+
*/
|
|
72
|
+
static changeCover(id: number | string, data: FormData, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
73
|
+
/**
|
|
74
|
+
* This endpoint allows to attend an LiveStream
|
|
75
|
+
* @param id
|
|
76
|
+
* @param config
|
|
77
|
+
*/
|
|
78
|
+
static join(id: number | string, config?: AxiosRequestConfig): Promise<SCLiveStreamConnectionDetailsType>;
|
|
79
|
+
/**
|
|
80
|
+
* This endpoint remove participant from the specified live stream.
|
|
81
|
+
* @param id
|
|
82
|
+
* @param data
|
|
83
|
+
* @param config
|
|
84
|
+
*/
|
|
85
|
+
static removeParticipant(id: number | string, data: LiveStreamRemoveParticipantParams | FormData, config?: AxiosRequestConfig): Promise<any>;
|
|
86
|
+
/**
|
|
87
|
+
* This endpoint retrieves LiveStream montlhy duration.
|
|
88
|
+
* @param config
|
|
89
|
+
*/
|
|
90
|
+
static getMonthlyDuration(config?: AxiosRequestConfig): Promise<SCLiveStreamMonthlyDurationType>;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
*
|
|
94
|
+
:::tip LiveStream service can be used in the following way:
|
|
95
|
+
|
|
96
|
+
```jsx
|
|
97
|
+
1. Import the service from our library:
|
|
98
|
+
|
|
99
|
+
import {LiveStreamService} from "@selfcommunity/api-services";
|
|
100
|
+
```
|
|
101
|
+
```jsx
|
|
102
|
+
2. Create a function and put the service inside it!
|
|
103
|
+
The async function `search` will return the LiveStreams matching the search query.
|
|
104
|
+
|
|
105
|
+
async searchLiveStreams() {
|
|
106
|
+
return await LiveStreamService.search();
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
```jsx
|
|
110
|
+
In case of required `params`, just add them inside the brackets.
|
|
111
|
+
|
|
112
|
+
async getSpecificInfo(liveStreamId) {
|
|
113
|
+
return await LiveStreamService.getSpecificInfo(liveStreamId);
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
```jsx
|
|
117
|
+
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
|
|
118
|
+
|
|
119
|
+
1. Declare it(or declare them, it is possible to add multiple params)
|
|
120
|
+
|
|
121
|
+
const headers = headers: {Authorization: `Bearer ${yourToken}`}
|
|
122
|
+
|
|
123
|
+
2. Add it inside the brackets and pass it to the function, as shown in the previous example!
|
|
124
|
+
```
|
|
125
|
+
:::
|
|
126
|
+
*/
|
|
127
|
+
export default class LiveStreamService {
|
|
128
|
+
static search(params?: LiveStreamSearchParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCLiveStreamType>>;
|
|
129
|
+
static getSpecificInfo(id: number | string, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
130
|
+
static create(data: LiveStreamCreateParams | FormData, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
131
|
+
static update(id: number | string, data: SCLiveStreamType, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
132
|
+
static patch(id: number | string, data: SCLiveStreamType, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
133
|
+
static delete(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
134
|
+
static close(id: number | string, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
135
|
+
static changeCover(id: number | string, data: FormData, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
136
|
+
static join(id: number | string, config?: AxiosRequestConfig): Promise<SCLiveStreamConnectionDetailsType>;
|
|
137
|
+
static removeParticipant(id: number | string, data: LiveStreamRemoveParticipantParams | FormData, config?: AxiosRequestConfig): Promise<any>;
|
|
138
|
+
static getMonthlyDuration(config?: AxiosRequestConfig): Promise<SCLiveStreamMonthlyDurationType>;
|
|
139
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import Endpoints from '../../constants/Endpoints';
|
|
3
|
+
import { apiRequest } from '../../utils/apiRequest';
|
|
4
|
+
import { urlParams } from '../../utils/url';
|
|
5
|
+
/**
|
|
6
|
+
* Contains all the endpoints needed to manage LiveStreams.
|
|
7
|
+
*/
|
|
8
|
+
export class LiveStreamApiClient {
|
|
9
|
+
/**
|
|
10
|
+
* This endpoint performs LiveStreams search
|
|
11
|
+
* @param params
|
|
12
|
+
* @param config
|
|
13
|
+
*/
|
|
14
|
+
static search(params, config) {
|
|
15
|
+
const p = urlParams(params);
|
|
16
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: `${Endpoints.SearchLiveStream.url({})}?${p.toString()}`, method: Endpoints.SearchLiveStream.method }));
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* This endpoint retrieves a specific LiveStream.
|
|
20
|
+
* @param id
|
|
21
|
+
* @param config
|
|
22
|
+
*/
|
|
23
|
+
static getSpecificInfo(id, config) {
|
|
24
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.GetLiveStreamInfo.url({ id }), method: Endpoints.GetLiveStreamInfo.method }));
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* This endpoint creates an LiveStream.
|
|
28
|
+
* @param data
|
|
29
|
+
* @param config
|
|
30
|
+
*/
|
|
31
|
+
static create(data, config) {
|
|
32
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.CreateLiveStream.url({}), method: Endpoints.CreateLiveStream.method, data: data }));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* This endpoint updates an LiveStream.
|
|
36
|
+
* @param id
|
|
37
|
+
* @param data
|
|
38
|
+
* @param config
|
|
39
|
+
*/
|
|
40
|
+
static update(id, data, config) {
|
|
41
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UpdateLiveStream.url({ id }), method: Endpoints.UpdateLiveStream.method, data: data }));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* This endpoint patches an LiveStream.
|
|
45
|
+
* @param id
|
|
46
|
+
* @param data
|
|
47
|
+
* @param config
|
|
48
|
+
*/
|
|
49
|
+
static patch(id, data, config) {
|
|
50
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.PatchLiveStream.url({ id }), method: Endpoints.PatchLiveStream.method, data: data }));
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* This endpoint deletes an LiveStream.
|
|
54
|
+
* @param id
|
|
55
|
+
* @param config
|
|
56
|
+
*/
|
|
57
|
+
static delete(id, config) {
|
|
58
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.DeleteLiveStream.url({ id }), method: Endpoints.DeleteLiveStream.method }));
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* This endpoint allows to close permanently a room
|
|
62
|
+
* @param id
|
|
63
|
+
* @param config
|
|
64
|
+
*/
|
|
65
|
+
static close(id, config) {
|
|
66
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.CloseLiveStream.url({ id }), method: Endpoints.CloseLiveStream.method }));
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* This endpoint changes the LiveStream avatar
|
|
70
|
+
* @param id
|
|
71
|
+
* @param data
|
|
72
|
+
* @param config
|
|
73
|
+
*/
|
|
74
|
+
static changeCover(id, data, config) {
|
|
75
|
+
return apiRequest(Object.assign({ url: Endpoints.PatchLiveStream.url({ id }), method: Endpoints.PatchLiveStream.method, data }, config));
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* This endpoint allows to attend an LiveStream
|
|
79
|
+
* @param id
|
|
80
|
+
* @param config
|
|
81
|
+
*/
|
|
82
|
+
static join(id, config) {
|
|
83
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.JoinLiveStream.url({ id }), method: Endpoints.JoinLiveStream.method }));
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* This endpoint remove participant from the specified live stream.
|
|
87
|
+
* @param id
|
|
88
|
+
* @param data
|
|
89
|
+
* @param config
|
|
90
|
+
*/
|
|
91
|
+
static removeParticipant(id, data, config) {
|
|
92
|
+
return apiRequest(Object.assign({ url: Endpoints.RemoveParticipant.url({ id }), method: Endpoints.RemoveParticipant.method, data }, config));
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* This endpoint retrieves LiveStream montlhy duration.
|
|
96
|
+
* @param config
|
|
97
|
+
*/
|
|
98
|
+
static getMonthlyDuration(config) {
|
|
99
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.GetLiveStreamMonthlyDuration.url({}), method: Endpoints.GetLiveStreamMonthlyDuration.method }));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
*
|
|
104
|
+
:::tip LiveStream service can be used in the following way:
|
|
105
|
+
|
|
106
|
+
```jsx
|
|
107
|
+
1. Import the service from our library:
|
|
108
|
+
|
|
109
|
+
import {LiveStreamService} from "@selfcommunity/api-services";
|
|
110
|
+
```
|
|
111
|
+
```jsx
|
|
112
|
+
2. Create a function and put the service inside it!
|
|
113
|
+
The async function `search` will return the LiveStreams matching the search query.
|
|
114
|
+
|
|
115
|
+
async searchLiveStreams() {
|
|
116
|
+
return await LiveStreamService.search();
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
```jsx
|
|
120
|
+
In case of required `params`, just add them inside the brackets.
|
|
121
|
+
|
|
122
|
+
async getSpecificInfo(liveStreamId) {
|
|
123
|
+
return await LiveStreamService.getSpecificInfo(liveStreamId);
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
```jsx
|
|
127
|
+
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
|
|
128
|
+
|
|
129
|
+
1. Declare it(or declare them, it is possible to add multiple params)
|
|
130
|
+
|
|
131
|
+
const headers = headers: {Authorization: `Bearer ${yourToken}`}
|
|
132
|
+
|
|
133
|
+
2. Add it inside the brackets and pass it to the function, as shown in the previous example!
|
|
134
|
+
```
|
|
135
|
+
:::
|
|
136
|
+
*/
|
|
137
|
+
export default class LiveStreamService {
|
|
138
|
+
static search(params, config) {
|
|
139
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
140
|
+
return LiveStreamApiClient.search(params, config);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
static getSpecificInfo(id, config) {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
return LiveStreamApiClient.getSpecificInfo(id, config);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
static create(data, config) {
|
|
149
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
150
|
+
return LiveStreamApiClient.create(data, config);
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
static update(id, data, config) {
|
|
154
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
155
|
+
return LiveStreamApiClient.update(id, data, config);
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
static patch(id, data, config) {
|
|
159
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
160
|
+
return LiveStreamApiClient.patch(id, data, config);
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
static delete(id, config) {
|
|
164
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
165
|
+
return LiveStreamApiClient.delete(id, config);
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
static close(id, config) {
|
|
169
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
+
return LiveStreamApiClient.close(id, config);
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
static changeCover(id, data, config) {
|
|
174
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
175
|
+
return LiveStreamApiClient.changeCover(id, data, config);
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
static join(id, config) {
|
|
179
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
180
|
+
return LiveStreamApiClient.join(id, config);
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
static removeParticipant(id, data, config) {
|
|
184
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
185
|
+
return LiveStreamApiClient.removeParticipant(id, data, config);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
static getMonthlyDuration(config) {
|
|
189
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
190
|
+
return LiveStreamApiClient.getMonthlyDuration(config);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SCAvatarType, SCCategoryType, SCFeedUnitType, SCPlatformType, SCTagType, SCUserAutocompleteType, SCUserAvatarType, SCUserChangeEmailType, SCUserConnectionRequestType, SCUserConnectionStatusType, SCUserCounterType, SCUserEmailTokenType, SCUserFollowedStatusType, SCUserFollowerStatusType, SCUserHiddenByStatusType, SCUserHiddenStatusType, SCUserLoyaltyPointsType, SCUserPermissionType, SCUserProviderAssociationType, SCUserSettingsType, SCUserType } from '@selfcommunity/types';
|
|
1
|
+
import { SCAvatarType, SCCategoryType, SCFeedUnitType, SCLiveStreamType, SCPlatformType, SCTagType, SCUserAutocompleteType, SCUserAvatarType, SCUserChangeEmailType, SCUserConnectionRequestType, SCUserConnectionStatusType, SCUserCounterType, SCUserEmailTokenType, SCUserFollowedStatusType, SCUserFollowerStatusType, SCUserHiddenByStatusType, SCUserHiddenStatusType, SCUserLoyaltyPointsType, SCUserPermissionType, SCUserProviderAssociationType, SCUserSettingsType, SCUserType } from '@selfcommunity/types';
|
|
2
2
|
import { BaseGetParams, SCPaginatedResponse, UserAutocompleteParams, UserGetParams, UserSearchParams } from '../../types';
|
|
3
3
|
import { AxiosRequestConfig } from 'axios';
|
|
4
4
|
import { DeleteProviderAssociation } from '../../types/user';
|
|
@@ -54,6 +54,7 @@ export interface UserApiClientInterface {
|
|
|
54
54
|
getProviderAssociations(userId: string | number, config?: AxiosRequestConfig): Promise<SCUserProviderAssociationType[]>;
|
|
55
55
|
createProviderAssociation(data: SCUserProviderAssociationType, config?: AxiosRequestConfig): Promise<SCUserProviderAssociationType>;
|
|
56
56
|
deleteProviderAssociation(data: DeleteProviderAssociation, config?: AxiosRequestConfig): Promise<any>;
|
|
57
|
+
getUserLiveStream(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCLiveStreamType>>;
|
|
57
58
|
}
|
|
58
59
|
/**
|
|
59
60
|
* Contains all the endpoints needed to manage users.
|
|
@@ -384,6 +385,13 @@ export declare class UserApiClient {
|
|
|
384
385
|
* @param config
|
|
385
386
|
*/
|
|
386
387
|
static deleteProviderAssociation(data: DeleteProviderAssociation, config?: AxiosRequestConfig): Promise<any>;
|
|
388
|
+
/**
|
|
389
|
+
* This endpoint retrieves the list of live stream currently started by user identified by ID.
|
|
390
|
+
* @param id
|
|
391
|
+
* @param params
|
|
392
|
+
* @param config
|
|
393
|
+
*/
|
|
394
|
+
static getUserLiveStream(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCLiveStreamType>>;
|
|
387
395
|
}
|
|
388
396
|
/**
|
|
389
397
|
*
|
|
@@ -474,4 +482,5 @@ export default class UserService {
|
|
|
474
482
|
static getProviderAssociations(userId: string | number, config?: AxiosRequestConfig): Promise<SCUserProviderAssociationType[]>;
|
|
475
483
|
static createProviderAssociation(data: SCUserProviderAssociationType, config?: AxiosRequestConfig): Promise<SCUserProviderAssociationType>;
|
|
476
484
|
static deleteProviderAssociation(data: DeleteProviderAssociation, config?: AxiosRequestConfig): Promise<any>;
|
|
485
|
+
static getUserLiveStream(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCLiveStreamType>>;
|
|
477
486
|
}
|
|
@@ -448,6 +448,15 @@ export class UserApiClient {
|
|
|
448
448
|
static deleteProviderAssociation(data, config) {
|
|
449
449
|
return apiRequest(Object.assign(Object.assign({}, config), { data, url: Endpoints.DeleteProviderAssociation.url({ id: data.user_id }), method: Endpoints.DeleteProviderAssociation.method }));
|
|
450
450
|
}
|
|
451
|
+
/**
|
|
452
|
+
* This endpoint retrieves the list of live stream currently started by user identified by ID.
|
|
453
|
+
* @param id
|
|
454
|
+
* @param params
|
|
455
|
+
* @param config
|
|
456
|
+
*/
|
|
457
|
+
static getUserLiveStream(id, params, config) {
|
|
458
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.GetLiveStream.url({ id }), method: Endpoints.UserFeed.method, params }));
|
|
459
|
+
}
|
|
451
460
|
}
|
|
452
461
|
/**
|
|
453
462
|
*
|
|
@@ -742,4 +751,9 @@ export default class UserService {
|
|
|
742
751
|
return UserApiClient.deleteProviderAssociation(data, config);
|
|
743
752
|
});
|
|
744
753
|
}
|
|
754
|
+
static getUserLiveStream(id, params, config) {
|
|
755
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
756
|
+
return UserApiClient.getUserLiveStream(id, params, config);
|
|
757
|
+
});
|
|
758
|
+
}
|
|
745
759
|
}
|
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
|
}
|
package/lib/esm/types/index.d.ts
CHANGED
|
@@ -25,5 +25,6 @@ import { InsightCommonParams, InsightEmbedParams, InsightUserParams, InsightCont
|
|
|
25
25
|
import { ReactionParams } from './reaction';
|
|
26
26
|
import { GroupCreateParams, GroupFeedParams } from './group';
|
|
27
27
|
import { EventCreateParams, EventFeedParams, EventRelatedParams, EventSearchParams } from './event';
|
|
28
|
+
import { LiveStreamCreateParams, LiveStreamSearchParams, LiveStreamRemoveParticipantParams } from './liveStream';
|
|
28
29
|
import { StartStepParams, OnBoardingStep } from './onBoarding';
|
|
29
|
-
export { AccountCreateParams, AccountVerifyParams, AccountRecoverParams, AccountResetParams, AccountSearchParams, SCPaginatedResponse, WebhookParamType, WebhookEventsType, SSOSignUpParams, CommentListParams, CommentCreateParams, IncubatorCreateParams, IncubatorSearchParams, LoyaltyPrizeParams, LoyaltyGetPrizeParams, ModerationParams, ModerateContributionParams, FlaggedContributionParams, CustomNotificationParams, UserGetParams, UserAutocompleteParams, UserScoreParams, UserSearchParams, TagParams, TagGetParams, MediaCreateParams, MediaTypes, ChunkUploadCompleteParams, ChunkUploadParams, ThreadParams, ThreadDeleteParams, MessageCreateParams, MessageMediaUploadParams, MessageThumbnailUploadParams, MessageChunkUploadDoneParams, MessageMediaChunksParams, CategoryParams, CustomAdvParams, CustomPageParams, CustomPageSearchParams, EmbedUpdateParams, EmbedSearchParams, BaseGetParams, BaseSearchParams, FeedObjGetParams, FeedObjCreateParams, FeedObjectPollVotesSearch, FeedParams, LegalPageFilterParams, FeatureParams, ScoreParams, InsightContributionParams, InsightUserParams, InsightEmbedParams, InsightCommonParams, ReactionParams, GroupCreateParams, GroupFeedParams, EventCreateParams, EventFeedParams, EventRelatedParams, EventSearchParams, StartStepParams, OnBoardingStep };
|
|
30
|
+
export { AccountCreateParams, AccountVerifyParams, AccountRecoverParams, AccountResetParams, AccountSearchParams, SCPaginatedResponse, WebhookParamType, WebhookEventsType, SSOSignUpParams, CommentListParams, CommentCreateParams, IncubatorCreateParams, IncubatorSearchParams, LoyaltyPrizeParams, LoyaltyGetPrizeParams, ModerationParams, ModerateContributionParams, FlaggedContributionParams, CustomNotificationParams, UserGetParams, UserAutocompleteParams, UserScoreParams, UserSearchParams, TagParams, TagGetParams, MediaCreateParams, MediaTypes, ChunkUploadCompleteParams, ChunkUploadParams, ThreadParams, ThreadDeleteParams, MessageCreateParams, MessageMediaUploadParams, MessageThumbnailUploadParams, MessageChunkUploadDoneParams, MessageMediaChunksParams, CategoryParams, CustomAdvParams, CustomPageParams, CustomPageSearchParams, EmbedUpdateParams, EmbedSearchParams, BaseGetParams, BaseSearchParams, FeedObjGetParams, FeedObjCreateParams, FeedObjectPollVotesSearch, FeedParams, LegalPageFilterParams, FeatureParams, ScoreParams, InsightContributionParams, InsightUserParams, InsightEmbedParams, InsightCommonParams, ReactionParams, GroupCreateParams, GroupFeedParams, EventCreateParams, EventFeedParams, EventRelatedParams, EventSearchParams, LiveStreamCreateParams, LiveStreamSearchParams, LiveStreamRemoveParticipantParams, StartStepParams, OnBoardingStep };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { BaseSearchParams } from './baseParams';
|
|
2
|
+
/**
|
|
3
|
+
* LiveStreamCreateParams interface
|
|
4
|
+
*/
|
|
5
|
+
export interface LiveStreamCreateParams {
|
|
6
|
+
/**
|
|
7
|
+
* A unique name for the live
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* The livestream description
|
|
12
|
+
*/
|
|
13
|
+
description?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The users to invite to the group
|
|
16
|
+
*/
|
|
17
|
+
invite_users?: number[];
|
|
18
|
+
/**
|
|
19
|
+
* The liveStream image
|
|
20
|
+
*/
|
|
21
|
+
cover?: File;
|
|
22
|
+
/**
|
|
23
|
+
* The liveStream slug
|
|
24
|
+
*/
|
|
25
|
+
slug?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The livestream settings
|
|
28
|
+
*/
|
|
29
|
+
settings?: Record<string, any>;
|
|
30
|
+
}
|
|
31
|
+
export interface LiveStreamSearchParams extends BaseSearchParams {
|
|
32
|
+
/**
|
|
33
|
+
* Id
|
|
34
|
+
*/
|
|
35
|
+
id?: string | number;
|
|
36
|
+
/**
|
|
37
|
+
* Room name
|
|
38
|
+
*/
|
|
39
|
+
room_name?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Slug
|
|
42
|
+
*/
|
|
43
|
+
slug?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface LiveStreamRemoveParticipantParams {
|
|
46
|
+
/**
|
|
47
|
+
* Participant Id
|
|
48
|
+
*/
|
|
49
|
+
participant_id?: string | number;
|
|
50
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|