@selfcommunity/api-services 0.6.4-alpha.1 → 0.6.4-courses.147
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 +214 -0
- package/lib/cjs/index.d.ts +4 -2
- package/lib/cjs/index.js +8 -1
- package/lib/cjs/services/course/index.d.ts +449 -0
- package/lib/cjs/services/course/index.js +643 -0
- package/lib/cjs/services/live_stream/index.d.ts +140 -0
- package/lib/cjs/services/live_stream/index.js +199 -0
- package/lib/cjs/services/suggestion/index.d.ts +9 -1
- package/lib/cjs/services/suggestion/index.js +13 -0
- package/lib/cjs/services/user/index.d.ts +10 -1
- package/lib/cjs/services/user/index.js +14 -0
- package/lib/cjs/types/course.d.ts +123 -0
- package/lib/cjs/types/course.js +12 -0
- package/lib/cjs/types/index.d.ts +3 -1
- package/lib/cjs/types/index.js +3 -1
- package/lib/cjs/types/liveStream.d.ts +54 -0
- package/lib/cjs/types/liveStream.js +2 -0
- package/lib/esm/constants/Endpoints.js +214 -0
- package/lib/esm/index.d.ts +4 -2
- package/lib/esm/index.js +4 -2
- package/lib/esm/services/course/index.d.ts +449 -0
- package/lib/esm/services/course/index.js +638 -0
- package/lib/esm/services/live_stream/index.d.ts +140 -0
- package/lib/esm/services/live_stream/index.js +194 -0
- package/lib/esm/services/suggestion/index.d.ts +9 -1
- package/lib/esm/services/suggestion/index.js +13 -0
- package/lib/esm/services/user/index.d.ts +10 -1
- package/lib/esm/services/user/index.js +14 -0
- package/lib/esm/types/course.d.ts +123 -0
- package/lib/esm/types/course.js +9 -0
- package/lib/esm/types/index.d.ts +3 -1
- package/lib/esm/types/index.js +2 -1
- package/lib/esm/types/liveStream.d.ts +54 -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
|
@@ -0,0 +1,140 @@
|
|
|
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
|
+
* If ban=true in the payload the user can no longer join the meet
|
|
82
|
+
* @param id
|
|
83
|
+
* @param data
|
|
84
|
+
* @param config
|
|
85
|
+
*/
|
|
86
|
+
static removeParticipant(id: number | string, data: LiveStreamRemoveParticipantParams | FormData, config?: AxiosRequestConfig): Promise<any>;
|
|
87
|
+
/**
|
|
88
|
+
* This endpoint retrieves LiveStream montlhy duration.
|
|
89
|
+
* @param config
|
|
90
|
+
*/
|
|
91
|
+
static getMonthlyDuration(config?: AxiosRequestConfig): Promise<SCLiveStreamMonthlyDurationType>;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
*
|
|
95
|
+
:::tip LiveStream service can be used in the following way:
|
|
96
|
+
|
|
97
|
+
```jsx
|
|
98
|
+
1. Import the service from our library:
|
|
99
|
+
|
|
100
|
+
import {LiveStreamService} from "@selfcommunity/api-services";
|
|
101
|
+
```
|
|
102
|
+
```jsx
|
|
103
|
+
2. Create a function and put the service inside it!
|
|
104
|
+
The async function `search` will return the LiveStreams matching the search query.
|
|
105
|
+
|
|
106
|
+
async searchLiveStreams() {
|
|
107
|
+
return await LiveStreamService.search();
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
```jsx
|
|
111
|
+
In case of required `params`, just add them inside the brackets.
|
|
112
|
+
|
|
113
|
+
async getSpecificInfo(liveStreamId) {
|
|
114
|
+
return await LiveStreamService.getSpecificInfo(liveStreamId);
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
```jsx
|
|
118
|
+
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
|
|
119
|
+
|
|
120
|
+
1. Declare it(or declare them, it is possible to add multiple params)
|
|
121
|
+
|
|
122
|
+
const headers = headers: {Authorization: `Bearer ${yourToken}`}
|
|
123
|
+
|
|
124
|
+
2. Add it inside the brackets and pass it to the function, as shown in the previous example!
|
|
125
|
+
```
|
|
126
|
+
:::
|
|
127
|
+
*/
|
|
128
|
+
export default class LiveStreamService {
|
|
129
|
+
static search(params?: LiveStreamSearchParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCLiveStreamType>>;
|
|
130
|
+
static getSpecificInfo(id: number | string, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
131
|
+
static create(data: LiveStreamCreateParams | FormData, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
132
|
+
static update(id: number | string, data: SCLiveStreamType, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
133
|
+
static patch(id: number | string, data: SCLiveStreamType, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
134
|
+
static delete(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
135
|
+
static close(id: number | string, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
136
|
+
static changeCover(id: number | string, data: FormData, config?: AxiosRequestConfig): Promise<SCLiveStreamType>;
|
|
137
|
+
static join(id: number | string, config?: AxiosRequestConfig): Promise<SCLiveStreamConnectionDetailsType>;
|
|
138
|
+
static removeParticipant(id: number | string, data: LiveStreamRemoveParticipantParams | FormData, config?: AxiosRequestConfig): Promise<any>;
|
|
139
|
+
static getMonthlyDuration(config?: AxiosRequestConfig): Promise<SCLiveStreamMonthlyDurationType>;
|
|
140
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
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
|
+
* If ban=true in the payload the user can no longer join the meet
|
|
88
|
+
* @param id
|
|
89
|
+
* @param data
|
|
90
|
+
* @param config
|
|
91
|
+
*/
|
|
92
|
+
static removeParticipant(id, data, config) {
|
|
93
|
+
return apiRequest(Object.assign({ url: Endpoints.RemoveParticipant.url({ id }), method: Endpoints.RemoveParticipant.method, data }, config));
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* This endpoint retrieves LiveStream montlhy duration.
|
|
97
|
+
* @param config
|
|
98
|
+
*/
|
|
99
|
+
static getMonthlyDuration(config) {
|
|
100
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.GetLiveStreamMonthlyDuration.url({}), method: Endpoints.GetLiveStreamMonthlyDuration.method }));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
*
|
|
105
|
+
:::tip LiveStream service can be used in the following way:
|
|
106
|
+
|
|
107
|
+
```jsx
|
|
108
|
+
1. Import the service from our library:
|
|
109
|
+
|
|
110
|
+
import {LiveStreamService} from "@selfcommunity/api-services";
|
|
111
|
+
```
|
|
112
|
+
```jsx
|
|
113
|
+
2. Create a function and put the service inside it!
|
|
114
|
+
The async function `search` will return the LiveStreams matching the search query.
|
|
115
|
+
|
|
116
|
+
async searchLiveStreams() {
|
|
117
|
+
return await LiveStreamService.search();
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
```jsx
|
|
121
|
+
In case of required `params`, just add them inside the brackets.
|
|
122
|
+
|
|
123
|
+
async getSpecificInfo(liveStreamId) {
|
|
124
|
+
return await LiveStreamService.getSpecificInfo(liveStreamId);
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
```jsx
|
|
128
|
+
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
|
|
129
|
+
|
|
130
|
+
1. Declare it(or declare them, it is possible to add multiple params)
|
|
131
|
+
|
|
132
|
+
const headers = headers: {Authorization: `Bearer ${yourToken}`}
|
|
133
|
+
|
|
134
|
+
2. Add it inside the brackets and pass it to the function, as shown in the previous example!
|
|
135
|
+
```
|
|
136
|
+
:::
|
|
137
|
+
*/
|
|
138
|
+
export default class LiveStreamService {
|
|
139
|
+
static search(params, config) {
|
|
140
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
141
|
+
return LiveStreamApiClient.search(params, config);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
static getSpecificInfo(id, config) {
|
|
145
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
+
return LiveStreamApiClient.getSpecificInfo(id, config);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
static create(data, config) {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
return LiveStreamApiClient.create(data, config);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
static update(id, data, config) {
|
|
155
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
156
|
+
return LiveStreamApiClient.update(id, data, config);
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
static patch(id, data, config) {
|
|
160
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
161
|
+
return LiveStreamApiClient.patch(id, data, config);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
static delete(id, config) {
|
|
165
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
166
|
+
return LiveStreamApiClient.delete(id, config);
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
static close(id, config) {
|
|
170
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
171
|
+
return LiveStreamApiClient.close(id, config);
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
static changeCover(id, data, config) {
|
|
175
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
176
|
+
return LiveStreamApiClient.changeCover(id, data, config);
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
static join(id, config) {
|
|
180
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
181
|
+
return LiveStreamApiClient.join(id, config);
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
static removeParticipant(id, data, config) {
|
|
185
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
186
|
+
return LiveStreamApiClient.removeParticipant(id, data, config);
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
static getMonthlyDuration(config) {
|
|
190
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
191
|
+
return LiveStreamApiClient.getMonthlyDuration(config);
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { BaseGetParams, SCPaginatedResponse } from '../../types';
|
|
2
|
-
import { SCCategoryType, SCEventType, SCFeedObjectType, SCIncubatorType, SCSuggestionType, SCUserType } from '@selfcommunity/types';
|
|
2
|
+
import { SCCategoryType, SCCourseType, SCEventType, SCFeedObjectType, SCIncubatorType, SCSuggestionType, SCUserType } from '@selfcommunity/types';
|
|
3
3
|
import { AxiosRequestConfig } from 'axios';
|
|
4
4
|
export interface SuggestionApiClientInterface {
|
|
5
5
|
getCategorySuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCategoryType>>;
|
|
6
|
+
getCourseSuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
|
|
6
7
|
getIncubatorSuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCIncubatorType>>;
|
|
7
8
|
getPollSuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCFeedObjectType>>;
|
|
8
9
|
getUserSuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
@@ -19,6 +20,12 @@ export declare class SuggestionApiClient {
|
|
|
19
20
|
* @param config
|
|
20
21
|
*/
|
|
21
22
|
static getCategorySuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCategoryType>>;
|
|
23
|
+
/**
|
|
24
|
+
* This endpoint retrieves a list of courses suggested to the current user.
|
|
25
|
+
* @param params
|
|
26
|
+
* @param config
|
|
27
|
+
*/
|
|
28
|
+
static getCourseSuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
|
|
22
29
|
/**
|
|
23
30
|
* This endpoint retrieves a list of suggested incubators.
|
|
24
31
|
* @param params
|
|
@@ -81,6 +88,7 @@ export declare class SuggestionApiClient {
|
|
|
81
88
|
*/
|
|
82
89
|
export default class SuggestionService {
|
|
83
90
|
static getCategorySuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCategoryType>>;
|
|
91
|
+
static getCourseSuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
|
|
84
92
|
static getIncubatorSuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCIncubatorType>>;
|
|
85
93
|
static getPollSuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCFeedObjectType>>;
|
|
86
94
|
static getUserSuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
@@ -14,6 +14,14 @@ export class SuggestionApiClient {
|
|
|
14
14
|
static getCategorySuggestion(params, config) {
|
|
15
15
|
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.CategoriesSuggestion.url({}), method: Endpoints.CategoriesSuggestion.method, params }));
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* This endpoint retrieves a list of courses suggested to the current user.
|
|
19
|
+
* @param params
|
|
20
|
+
* @param config
|
|
21
|
+
*/
|
|
22
|
+
static getCourseSuggestion(params, config) {
|
|
23
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.CourseSuggestion.url({}), method: Endpoints.CourseSuggestion.method, params }));
|
|
24
|
+
}
|
|
17
25
|
/**
|
|
18
26
|
* This endpoint retrieves a list of suggested incubators.
|
|
19
27
|
* @param params
|
|
@@ -91,6 +99,11 @@ export default class SuggestionService {
|
|
|
91
99
|
return SuggestionApiClient.getCategorySuggestion(params, config);
|
|
92
100
|
});
|
|
93
101
|
}
|
|
102
|
+
static getCourseSuggestion(params, config) {
|
|
103
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
return SuggestionApiClient.getCourseSuggestion(params, config);
|
|
105
|
+
});
|
|
106
|
+
}
|
|
94
107
|
static getIncubatorSuggestion(params, config) {
|
|
95
108
|
return __awaiter(this, void 0, void 0, function* () {
|
|
96
109
|
return SuggestionApiClient.getIncubatorSuggestion(params, config);
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CourseCreateParams interface
|
|
3
|
+
*/
|
|
4
|
+
import { SCCoursePrivacyType, SCCourseJoinStatusType, SCCourseTypologyType } from '@selfcommunity/types';
|
|
5
|
+
import { BaseGetParams, BaseSearchParams } from './baseParams';
|
|
6
|
+
export interface CourseCreateParams {
|
|
7
|
+
/**
|
|
8
|
+
* A unique name for the course
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* The course description
|
|
13
|
+
*/
|
|
14
|
+
description?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The course type
|
|
17
|
+
*/
|
|
18
|
+
type: SCCourseTypologyType;
|
|
19
|
+
/**
|
|
20
|
+
* The course privacy
|
|
21
|
+
*/
|
|
22
|
+
privacy: SCCoursePrivacyType;
|
|
23
|
+
/**
|
|
24
|
+
* The categories id
|
|
25
|
+
*/
|
|
26
|
+
categories: number[];
|
|
27
|
+
}
|
|
28
|
+
export interface CourseSectionParams {
|
|
29
|
+
/**
|
|
30
|
+
* A unique name for the course section
|
|
31
|
+
*/
|
|
32
|
+
name: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* CourseUserParams interface.
|
|
36
|
+
*/
|
|
37
|
+
export interface CourseUserParams extends BaseGetParams {
|
|
38
|
+
/**
|
|
39
|
+
* Filter results by subscription_status
|
|
40
|
+
*/
|
|
41
|
+
join_status?: SCCourseJoinStatusType;
|
|
42
|
+
/**
|
|
43
|
+
* Return only courses created by this user id
|
|
44
|
+
*/
|
|
45
|
+
created_by?: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* CourseSearchParams interface.
|
|
49
|
+
*/
|
|
50
|
+
export interface CourseSearchParams extends BaseSearchParams {
|
|
51
|
+
/**
|
|
52
|
+
* The categories ids
|
|
53
|
+
*/
|
|
54
|
+
categories?: number[];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* CourseInfoView enum
|
|
58
|
+
*/
|
|
59
|
+
export declare enum CourseInfoViewType {
|
|
60
|
+
USER = "user",
|
|
61
|
+
EDIT = "edit",
|
|
62
|
+
DASHBOARD = "dashboard"
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* CourseInfoParams interface.
|
|
66
|
+
*/
|
|
67
|
+
export interface CourseInfoParams {
|
|
68
|
+
view?: CourseInfoViewType;
|
|
69
|
+
user?: number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* CourseLessonCommentsParams interface.
|
|
73
|
+
*/
|
|
74
|
+
export interface CourseLessonCommentsParams extends BaseGetParams {
|
|
75
|
+
/**
|
|
76
|
+
* The ordering of the comments; use - for order desc.
|
|
77
|
+
* Default to created_at
|
|
78
|
+
*/
|
|
79
|
+
ordering?: string;
|
|
80
|
+
/**
|
|
81
|
+
* The Id of the parent Course Comment; used for retrieve nested comments
|
|
82
|
+
*/
|
|
83
|
+
parent?: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* CourseUserRoleParams interface.
|
|
87
|
+
*/
|
|
88
|
+
export interface CourseUserRoleParams {
|
|
89
|
+
/**
|
|
90
|
+
* List of id of User to set as managers role.
|
|
91
|
+
* At least one parameter between managers, joined and unjoined is required.
|
|
92
|
+
*/
|
|
93
|
+
managers?: number[];
|
|
94
|
+
/**
|
|
95
|
+
* List of id of User to force to join the course as normal users.
|
|
96
|
+
* At least one parameter between managers, joined and unjoined is required.
|
|
97
|
+
*/
|
|
98
|
+
joined?: number[];
|
|
99
|
+
/**
|
|
100
|
+
* List of id of User to force to unjoin the course.
|
|
101
|
+
* At least one parameter between managers, joined and unjoined is required.
|
|
102
|
+
*/
|
|
103
|
+
unjoined?: number[];
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* CourseUsersParams interface.
|
|
107
|
+
*/
|
|
108
|
+
export interface CourseUsersParams extends BaseGetParams {
|
|
109
|
+
/**
|
|
110
|
+
* Filter by join_status; default: ["manager", "joined"].
|
|
111
|
+
* Only creator, manager and joined are valid status for this route
|
|
112
|
+
*/
|
|
113
|
+
statuses?: SCCourseJoinStatusType[];
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* CourseDashboardUsersParams interface.
|
|
117
|
+
*/
|
|
118
|
+
export interface CourseDashboardUsersParams extends BaseSearchParams {
|
|
119
|
+
/**
|
|
120
|
+
* Filter by join_status; default: ["manager", "joined"]
|
|
121
|
+
*/
|
|
122
|
+
statuses?: SCCourseJoinStatusType[];
|
|
123
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CourseInfoView enum
|
|
3
|
+
*/
|
|
4
|
+
export var CourseInfoViewType;
|
|
5
|
+
(function (CourseInfoViewType) {
|
|
6
|
+
CourseInfoViewType["USER"] = "user";
|
|
7
|
+
CourseInfoViewType["EDIT"] = "edit";
|
|
8
|
+
CourseInfoViewType["DASHBOARD"] = "dashboard";
|
|
9
|
+
})(CourseInfoViewType || (CourseInfoViewType = {}));
|
package/lib/esm/types/index.d.ts
CHANGED
|
@@ -25,5 +25,7 @@ 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
|
-
|
|
30
|
+
import { CourseCreateParams, CourseSearchParams, CourseInfoViewType, CourseInfoParams, CourseLessonCommentsParams, CourseUserRoleParams, CourseUsersParams, CourseDashboardUsersParams } from './course';
|
|
31
|
+
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, CourseCreateParams, CourseSearchParams, CourseInfoViewType, CourseInfoParams, CourseLessonCommentsParams, CourseUserRoleParams, CourseUsersParams, CourseDashboardUsersParams };
|
package/lib/esm/types/index.js
CHANGED
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
/**
|
|
51
|
+
* Ban participant
|
|
52
|
+
*/
|
|
53
|
+
ban?: boolean;
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|