@selfcommunity/api-services 0.6.4-alpha.0 → 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,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LiveStreamApiClient = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const Endpoints_1 = tslib_1.__importDefault(require("../../constants/Endpoints"));
|
|
6
|
+
const apiRequest_1 = require("../../utils/apiRequest");
|
|
7
|
+
const url_1 = require("../../utils/url");
|
|
8
|
+
/**
|
|
9
|
+
* Contains all the endpoints needed to manage LiveStreams.
|
|
10
|
+
*/
|
|
11
|
+
class LiveStreamApiClient {
|
|
12
|
+
/**
|
|
13
|
+
* This endpoint performs LiveStreams search
|
|
14
|
+
* @param params
|
|
15
|
+
* @param config
|
|
16
|
+
*/
|
|
17
|
+
static search(params, config) {
|
|
18
|
+
const p = (0, url_1.urlParams)(params);
|
|
19
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: `${Endpoints_1.default.SearchLiveStream.url({})}?${p.toString()}`, method: Endpoints_1.default.SearchLiveStream.method }));
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* This endpoint retrieves a specific LiveStream.
|
|
23
|
+
* @param id
|
|
24
|
+
* @param config
|
|
25
|
+
*/
|
|
26
|
+
static getSpecificInfo(id, config) {
|
|
27
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.GetLiveStreamInfo.url({ id }), method: Endpoints_1.default.GetLiveStreamInfo.method }));
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* This endpoint creates an LiveStream.
|
|
31
|
+
* @param data
|
|
32
|
+
* @param config
|
|
33
|
+
*/
|
|
34
|
+
static create(data, config) {
|
|
35
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.CreateLiveStream.url({}), method: Endpoints_1.default.CreateLiveStream.method, data: data }));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* This endpoint updates an LiveStream.
|
|
39
|
+
* @param id
|
|
40
|
+
* @param data
|
|
41
|
+
* @param config
|
|
42
|
+
*/
|
|
43
|
+
static update(id, data, config) {
|
|
44
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.UpdateLiveStream.url({ id }), method: Endpoints_1.default.UpdateLiveStream.method, data: data }));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* This endpoint patches an LiveStream.
|
|
48
|
+
* @param id
|
|
49
|
+
* @param data
|
|
50
|
+
* @param config
|
|
51
|
+
*/
|
|
52
|
+
static patch(id, data, config) {
|
|
53
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.PatchLiveStream.url({ id }), method: Endpoints_1.default.PatchLiveStream.method, data: data }));
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* This endpoint deletes an LiveStream.
|
|
57
|
+
* @param id
|
|
58
|
+
* @param config
|
|
59
|
+
*/
|
|
60
|
+
static delete(id, config) {
|
|
61
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.DeleteLiveStream.url({ id }), method: Endpoints_1.default.DeleteLiveStream.method }));
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* This endpoint allows to close permanently a room
|
|
65
|
+
* @param id
|
|
66
|
+
* @param config
|
|
67
|
+
*/
|
|
68
|
+
static close(id, config) {
|
|
69
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.CloseLiveStream.url({ id }), method: Endpoints_1.default.CloseLiveStream.method }));
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* This endpoint changes the LiveStream avatar
|
|
73
|
+
* @param id
|
|
74
|
+
* @param data
|
|
75
|
+
* @param config
|
|
76
|
+
*/
|
|
77
|
+
static changeCover(id, data, config) {
|
|
78
|
+
return (0, apiRequest_1.apiRequest)(Object.assign({ url: Endpoints_1.default.PatchLiveStream.url({ id }), method: Endpoints_1.default.PatchLiveStream.method, data }, config));
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* This endpoint allows to attend an LiveStream
|
|
82
|
+
* @param id
|
|
83
|
+
* @param config
|
|
84
|
+
*/
|
|
85
|
+
static join(id, config) {
|
|
86
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.JoinLiveStream.url({ id }), method: Endpoints_1.default.JoinLiveStream.method }));
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* This endpoint remove participant from the specified live stream.
|
|
90
|
+
* If ban=true in the payload the user can no longer join the meet
|
|
91
|
+
* @param id
|
|
92
|
+
* @param data
|
|
93
|
+
* @param config
|
|
94
|
+
*/
|
|
95
|
+
static removeParticipant(id, data, config) {
|
|
96
|
+
return (0, apiRequest_1.apiRequest)(Object.assign({ url: Endpoints_1.default.RemoveParticipant.url({ id }), method: Endpoints_1.default.RemoveParticipant.method, data }, config));
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* This endpoint retrieves LiveStream montlhy duration.
|
|
100
|
+
* @param config
|
|
101
|
+
*/
|
|
102
|
+
static getMonthlyDuration(config) {
|
|
103
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.GetLiveStreamMonthlyDuration.url({}), method: Endpoints_1.default.GetLiveStreamMonthlyDuration.method }));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.LiveStreamApiClient = LiveStreamApiClient;
|
|
107
|
+
/**
|
|
108
|
+
*
|
|
109
|
+
:::tip LiveStream service can be used in the following way:
|
|
110
|
+
|
|
111
|
+
```jsx
|
|
112
|
+
1. Import the service from our library:
|
|
113
|
+
|
|
114
|
+
import {LiveStreamService} from "@selfcommunity/api-services";
|
|
115
|
+
```
|
|
116
|
+
```jsx
|
|
117
|
+
2. Create a function and put the service inside it!
|
|
118
|
+
The async function `search` will return the LiveStreams matching the search query.
|
|
119
|
+
|
|
120
|
+
async searchLiveStreams() {
|
|
121
|
+
return await LiveStreamService.search();
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
```jsx
|
|
125
|
+
In case of required `params`, just add them inside the brackets.
|
|
126
|
+
|
|
127
|
+
async getSpecificInfo(liveStreamId) {
|
|
128
|
+
return await LiveStreamService.getSpecificInfo(liveStreamId);
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
```jsx
|
|
132
|
+
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
|
|
133
|
+
|
|
134
|
+
1. Declare it(or declare them, it is possible to add multiple params)
|
|
135
|
+
|
|
136
|
+
const headers = headers: {Authorization: `Bearer ${yourToken}`}
|
|
137
|
+
|
|
138
|
+
2. Add it inside the brackets and pass it to the function, as shown in the previous example!
|
|
139
|
+
```
|
|
140
|
+
:::
|
|
141
|
+
*/
|
|
142
|
+
class LiveStreamService {
|
|
143
|
+
static search(params, config) {
|
|
144
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
return LiveStreamApiClient.search(params, config);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
static getSpecificInfo(id, config) {
|
|
149
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
150
|
+
return LiveStreamApiClient.getSpecificInfo(id, config);
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
static create(data, config) {
|
|
154
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
155
|
+
return LiveStreamApiClient.create(data, config);
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
static update(id, data, config) {
|
|
159
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
160
|
+
return LiveStreamApiClient.update(id, data, config);
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
static patch(id, data, config) {
|
|
164
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
165
|
+
return LiveStreamApiClient.patch(id, data, config);
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
static delete(id, config) {
|
|
169
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
170
|
+
return LiveStreamApiClient.delete(id, config);
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
static close(id, config) {
|
|
174
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
175
|
+
return LiveStreamApiClient.close(id, config);
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
static changeCover(id, data, config) {
|
|
179
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
180
|
+
return LiveStreamApiClient.changeCover(id, data, config);
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
static join(id, config) {
|
|
184
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
185
|
+
return LiveStreamApiClient.join(id, config);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
static removeParticipant(id, data, config) {
|
|
189
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
190
|
+
return LiveStreamApiClient.removeParticipant(id, data, config);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
static getMonthlyDuration(config) {
|
|
194
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
195
|
+
return LiveStreamApiClient.getMonthlyDuration(config);
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
exports.default = LiveStreamService;
|
|
@@ -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>>;
|
|
@@ -17,6 +17,14 @@ class SuggestionApiClient {
|
|
|
17
17
|
static getCategorySuggestion(params, config) {
|
|
18
18
|
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.CategoriesSuggestion.url({}), method: Endpoints_1.default.CategoriesSuggestion.method, params }));
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* This endpoint retrieves a list of courses suggested to the current user.
|
|
22
|
+
* @param params
|
|
23
|
+
* @param config
|
|
24
|
+
*/
|
|
25
|
+
static getCourseSuggestion(params, config) {
|
|
26
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.CourseSuggestion.url({}), method: Endpoints_1.default.CourseSuggestion.method, params }));
|
|
27
|
+
}
|
|
20
28
|
/**
|
|
21
29
|
* This endpoint retrieves a list of suggested incubators.
|
|
22
30
|
* @param params
|
|
@@ -95,6 +103,11 @@ class SuggestionService {
|
|
|
95
103
|
return SuggestionApiClient.getCategorySuggestion(params, config);
|
|
96
104
|
});
|
|
97
105
|
}
|
|
106
|
+
static getCourseSuggestion(params, config) {
|
|
107
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
return SuggestionApiClient.getCourseSuggestion(params, config);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
98
111
|
static getIncubatorSuggestion(params, config) {
|
|
99
112
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
100
113
|
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
|
}
|
|
@@ -451,6 +451,15 @@ class UserApiClient {
|
|
|
451
451
|
static deleteProviderAssociation(data, config) {
|
|
452
452
|
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { data, url: Endpoints_1.default.DeleteProviderAssociation.url({ id: data.user_id }), method: Endpoints_1.default.DeleteProviderAssociation.method }));
|
|
453
453
|
}
|
|
454
|
+
/**
|
|
455
|
+
* This endpoint retrieves the list of live stream currently started by user identified by ID.
|
|
456
|
+
* @param id
|
|
457
|
+
* @param params
|
|
458
|
+
* @param config
|
|
459
|
+
*/
|
|
460
|
+
static getUserLiveStream(id, params, config) {
|
|
461
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.GetLiveStream.url({ id }), method: Endpoints_1.default.UserFeed.method, params }));
|
|
462
|
+
}
|
|
454
463
|
}
|
|
455
464
|
exports.UserApiClient = UserApiClient;
|
|
456
465
|
/**
|
|
@@ -746,5 +755,10 @@ class UserService {
|
|
|
746
755
|
return UserApiClient.deleteProviderAssociation(data, config);
|
|
747
756
|
});
|
|
748
757
|
}
|
|
758
|
+
static getUserLiveStream(id, params, config) {
|
|
759
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
760
|
+
return UserApiClient.getUserLiveStream(id, params, config);
|
|
761
|
+
});
|
|
762
|
+
}
|
|
749
763
|
}
|
|
750
764
|
exports.default = UserService;
|
|
@@ -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,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CourseInfoViewType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* CourseInfoView enum
|
|
6
|
+
*/
|
|
7
|
+
var CourseInfoViewType;
|
|
8
|
+
(function (CourseInfoViewType) {
|
|
9
|
+
CourseInfoViewType["USER"] = "user";
|
|
10
|
+
CourseInfoViewType["EDIT"] = "edit";
|
|
11
|
+
CourseInfoViewType["DASHBOARD"] = "dashboard";
|
|
12
|
+
})(CourseInfoViewType = exports.CourseInfoViewType || (exports.CourseInfoViewType = {}));
|
package/lib/cjs/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/cjs/types/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OnBoardingStep = exports.MediaTypes = void 0;
|
|
3
|
+
exports.CourseInfoViewType = exports.OnBoardingStep = exports.MediaTypes = void 0;
|
|
4
4
|
const media_1 = require("./media");
|
|
5
5
|
Object.defineProperty(exports, "MediaTypes", { enumerable: true, get: function () { return media_1.MediaTypes; } });
|
|
6
6
|
const onBoarding_1 = require("./onBoarding");
|
|
7
7
|
Object.defineProperty(exports, "OnBoardingStep", { enumerable: true, get: function () { return onBoarding_1.OnBoardingStep; } });
|
|
8
|
+
const course_1 = require("./course");
|
|
9
|
+
Object.defineProperty(exports, "CourseInfoViewType", { enumerable: true, get: function () { return course_1.CourseInfoViewType; } });
|
|
@@ -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
|
+
}
|