@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
|
@@ -0,0 +1,198 @@
|
|
|
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
|
+
* @param id
|
|
91
|
+
* @param data
|
|
92
|
+
* @param config
|
|
93
|
+
*/
|
|
94
|
+
static removeParticipant(id, data, config) {
|
|
95
|
+
return (0, apiRequest_1.apiRequest)(Object.assign({ url: Endpoints_1.default.RemoveParticipant.url({ id }), method: Endpoints_1.default.RemoveParticipant.method, data }, config));
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* This endpoint retrieves LiveStream montlhy duration.
|
|
99
|
+
* @param config
|
|
100
|
+
*/
|
|
101
|
+
static getMonthlyDuration(config) {
|
|
102
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.GetLiveStreamMonthlyDuration.url({}), method: Endpoints_1.default.GetLiveStreamMonthlyDuration.method }));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.LiveStreamApiClient = LiveStreamApiClient;
|
|
106
|
+
/**
|
|
107
|
+
*
|
|
108
|
+
:::tip LiveStream service can be used in the following way:
|
|
109
|
+
|
|
110
|
+
```jsx
|
|
111
|
+
1. Import the service from our library:
|
|
112
|
+
|
|
113
|
+
import {LiveStreamService} from "@selfcommunity/api-services";
|
|
114
|
+
```
|
|
115
|
+
```jsx
|
|
116
|
+
2. Create a function and put the service inside it!
|
|
117
|
+
The async function `search` will return the LiveStreams matching the search query.
|
|
118
|
+
|
|
119
|
+
async searchLiveStreams() {
|
|
120
|
+
return await LiveStreamService.search();
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
```jsx
|
|
124
|
+
In case of required `params`, just add them inside the brackets.
|
|
125
|
+
|
|
126
|
+
async getSpecificInfo(liveStreamId) {
|
|
127
|
+
return await LiveStreamService.getSpecificInfo(liveStreamId);
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
```jsx
|
|
131
|
+
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
|
|
132
|
+
|
|
133
|
+
1. Declare it(or declare them, it is possible to add multiple params)
|
|
134
|
+
|
|
135
|
+
const headers = headers: {Authorization: `Bearer ${yourToken}`}
|
|
136
|
+
|
|
137
|
+
2. Add it inside the brackets and pass it to the function, as shown in the previous example!
|
|
138
|
+
```
|
|
139
|
+
:::
|
|
140
|
+
*/
|
|
141
|
+
class LiveStreamService {
|
|
142
|
+
static search(params, config) {
|
|
143
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
144
|
+
return LiveStreamApiClient.search(params, config);
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
static getSpecificInfo(id, config) {
|
|
148
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
149
|
+
return LiveStreamApiClient.getSpecificInfo(id, config);
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
static create(data, config) {
|
|
153
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
154
|
+
return LiveStreamApiClient.create(data, config);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
static update(id, data, config) {
|
|
158
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
159
|
+
return LiveStreamApiClient.update(id, data, config);
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
static patch(id, data, config) {
|
|
163
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
164
|
+
return LiveStreamApiClient.patch(id, data, config);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
static delete(id, config) {
|
|
168
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
169
|
+
return LiveStreamApiClient.delete(id, config);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
static close(id, config) {
|
|
173
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
174
|
+
return LiveStreamApiClient.close(id, config);
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
static changeCover(id, data, config) {
|
|
178
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
179
|
+
return LiveStreamApiClient.changeCover(id, data, config);
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
static join(id, config) {
|
|
183
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
184
|
+
return LiveStreamApiClient.join(id, config);
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
static removeParticipant(id, data, config) {
|
|
188
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
189
|
+
return LiveStreamApiClient.removeParticipant(id, data, config);
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
static getMonthlyDuration(config) {
|
|
193
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
194
|
+
return LiveStreamApiClient.getMonthlyDuration(config);
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
exports.default = LiveStreamService;
|
|
@@ -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;
|
package/lib/cjs/types/event.d.ts
CHANGED
|
@@ -88,6 +88,10 @@ export interface EventUserParams extends BaseGetParams {
|
|
|
88
88
|
* Filtered past events
|
|
89
89
|
*/
|
|
90
90
|
past?: boolean | number;
|
|
91
|
+
/**
|
|
92
|
+
* Filtered location
|
|
93
|
+
*/
|
|
94
|
+
location?: SCEventLocationType;
|
|
91
95
|
}
|
|
92
96
|
/**
|
|
93
97
|
* EventFeedParams interface.
|
|
@@ -105,4 +109,8 @@ export interface EventSearchParams extends BaseSearchParams {
|
|
|
105
109
|
* Filtered past events
|
|
106
110
|
*/
|
|
107
111
|
past?: boolean | number;
|
|
112
|
+
/**
|
|
113
|
+
* Filtered location
|
|
114
|
+
*/
|
|
115
|
+
location?: SCEventLocationType;
|
|
108
116
|
}
|
package/lib/cjs/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
|
+
}
|
|
@@ -2,17 +2,17 @@ import { AxiosInstance, AxiosResponse } from 'axios';
|
|
|
2
2
|
/**
|
|
3
3
|
* List of all Http methods
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type HttpMethod = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
6
6
|
/**
|
|
7
7
|
* AxiosResponseHeaders interface
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export type AxiosResponseHeaders = Record<string, string> & {
|
|
10
10
|
'set-cookie'?: string[];
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* General HttpResponse
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export type HttpResponse<T = unknown, D = any> = AxiosResponse<T, D>;
|
|
16
16
|
/**
|
|
17
17
|
* Interface for the ApiClient
|
|
18
18
|
*/
|
package/lib/esm/client/index.js
CHANGED
|
@@ -6,6 +6,9 @@ import axios from 'axios';
|
|
|
6
6
|
* should we choose to do so in the future, without it breaking our app.
|
|
7
7
|
*/
|
|
8
8
|
export class ApiClient {
|
|
9
|
+
createClient(config) {
|
|
10
|
+
return axios.create(Object.assign(Object.assign({}, (config && config.baseURL && { baseURL: config.baseURL })), { responseType: 'json', headers: Object.assign({}, (config && config.accessToken && { Authorization: `Token ${config.accessToken}` })), timeout: ApiClient.DEFAULT_TIMEOUT }));
|
|
11
|
+
}
|
|
9
12
|
constructor(config) {
|
|
10
13
|
/**
|
|
11
14
|
* Set default header
|
|
@@ -47,9 +50,6 @@ export class ApiClient {
|
|
|
47
50
|
this.client = this.createClient(config);
|
|
48
51
|
this.setDefaultHeader({ name: 'Content-Type', value: 'application/json', methods: ['post'] });
|
|
49
52
|
}
|
|
50
|
-
createClient(config) {
|
|
51
|
-
return axios.create(Object.assign(Object.assign({}, (config && config.baseURL && { baseURL: config.baseURL })), { responseType: 'json', headers: Object.assign({}, (config && config.accessToken && { Authorization: `Token ${config.accessToken}` })), timeout: ApiClient.DEFAULT_TIMEOUT }));
|
|
52
|
-
}
|
|
53
53
|
/**
|
|
54
54
|
* Get client instance
|
|
55
55
|
*/
|
|
@@ -515,6 +515,10 @@ const Endpoints = {
|
|
|
515
515
|
url: urlReplacer('/api/v2/user/$(id)/provider/'),
|
|
516
516
|
method: 'DELETE'
|
|
517
517
|
},
|
|
518
|
+
GetLiveStream: {
|
|
519
|
+
url: urlReplacer('/api/v2/user/$(id)/live_stream/'),
|
|
520
|
+
method: 'GET'
|
|
521
|
+
},
|
|
518
522
|
/**
|
|
519
523
|
* Broadcast Messages
|
|
520
524
|
*/
|
|
@@ -1159,6 +1163,10 @@ const Endpoints = {
|
|
|
1159
1163
|
url: urlReplacer('/api/v2/group/$(id)/'),
|
|
1160
1164
|
method: 'PATCH'
|
|
1161
1165
|
},
|
|
1166
|
+
DeleteGroup: {
|
|
1167
|
+
url: urlReplacer('/api/v2/group/$(id)/'),
|
|
1168
|
+
method: 'DELETE'
|
|
1169
|
+
},
|
|
1162
1170
|
GetGroupSuggestedUsers: {
|
|
1163
1171
|
url: urlReplacer('/api/v2/group/$(id)/user/?search=$(search)'),
|
|
1164
1172
|
method: 'GET'
|
|
@@ -1322,6 +1330,61 @@ const Endpoints = {
|
|
|
1322
1330
|
url: urlReplacer('/api/v2/event/$(id)/hide/'),
|
|
1323
1331
|
method: 'POST'
|
|
1324
1332
|
},
|
|
1333
|
+
GetEventPhotoGallery: {
|
|
1334
|
+
url: urlReplacer('/api/v2/event/$(id)/gallery/'),
|
|
1335
|
+
method: 'GET'
|
|
1336
|
+
},
|
|
1337
|
+
AddMediaToEventPhotoGallery: {
|
|
1338
|
+
url: urlReplacer('/api/v2/event/$(id)/gallery/'),
|
|
1339
|
+
method: 'POST'
|
|
1340
|
+
},
|
|
1341
|
+
RemoveMediasFromEventPhotoGallery: {
|
|
1342
|
+
url: urlReplacer('/api/v2/event/$(id)/gallery/'),
|
|
1343
|
+
method: 'DELETE'
|
|
1344
|
+
},
|
|
1345
|
+
/**
|
|
1346
|
+
* LiveStream
|
|
1347
|
+
*/
|
|
1348
|
+
GetLiveStreamInfo: {
|
|
1349
|
+
url: urlReplacer('/api/v2/live_stream/$(id)/'),
|
|
1350
|
+
method: 'GET'
|
|
1351
|
+
},
|
|
1352
|
+
SearchLiveStream: {
|
|
1353
|
+
url: urlReplacer('/api/v2/live_stream/search/'),
|
|
1354
|
+
method: 'GET'
|
|
1355
|
+
},
|
|
1356
|
+
CreateLiveStream: {
|
|
1357
|
+
url: urlReplacer('/api/v2/live_stream/'),
|
|
1358
|
+
method: 'POST'
|
|
1359
|
+
},
|
|
1360
|
+
UpdateLiveStream: {
|
|
1361
|
+
url: urlReplacer('/api/v2/live_stream/$(id)/'),
|
|
1362
|
+
method: 'PUT'
|
|
1363
|
+
},
|
|
1364
|
+
DeleteLiveStream: {
|
|
1365
|
+
url: urlReplacer('/api/v2/live_stream/$(id)/'),
|
|
1366
|
+
method: 'DELETE'
|
|
1367
|
+
},
|
|
1368
|
+
PatchLiveStream: {
|
|
1369
|
+
url: urlReplacer('/api/v2/live_stream/$(id)/'),
|
|
1370
|
+
method: 'PATCH'
|
|
1371
|
+
},
|
|
1372
|
+
CloseLiveStream: {
|
|
1373
|
+
url: urlReplacer('/api/v2/live_stream/$(id)/close/'),
|
|
1374
|
+
method: 'POST'
|
|
1375
|
+
},
|
|
1376
|
+
JoinLiveStream: {
|
|
1377
|
+
url: urlReplacer('/api/v2/live_stream/$(id)/join/'),
|
|
1378
|
+
method: 'POST'
|
|
1379
|
+
},
|
|
1380
|
+
RemoveParticipant: {
|
|
1381
|
+
url: urlReplacer('/api/v2/live_stream/$(id)/remove_participant/'),
|
|
1382
|
+
method: 'POST'
|
|
1383
|
+
},
|
|
1384
|
+
GetLiveStreamMonthlyDuration: {
|
|
1385
|
+
url: urlReplacer('/api/v2/live_stream/monthly_duration/'),
|
|
1386
|
+
method: 'GET'
|
|
1387
|
+
},
|
|
1325
1388
|
/**
|
|
1326
1389
|
* OnBoarding
|
|
1327
1390
|
*/
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -48,12 +48,13 @@ import WebhookService, { WebhookApiClient, WebhookApiClientInterface } from './s
|
|
|
48
48
|
import ReactionService, { ReactionApiClient, ReactionApiClientInterface } from './services/reactions';
|
|
49
49
|
import GroupService, { GroupApiClient, GroupApiClientInterface } from './services/group';
|
|
50
50
|
import EventService, { EventApiClient, EventApiClientInterface } from './services/event';
|
|
51
|
+
import LiveStreamService, { LiveStreamApiClient, LiveStreamApiClientInterface } from './services/live_stream';
|
|
51
52
|
import OnBoardingService, { OnBoardingApiClient, OnBoardingApiClientInterface } from './services/onboarding';
|
|
52
53
|
/**
|
|
53
54
|
* Types
|
|
54
55
|
*/
|
|
55
|
-
import { AccountCreateParams, AccountVerifyParams, AccountResetParams, AccountRecoverParams, AccountSearchParams, SCPaginatedResponse, WebhookParamType, WebhookEventsType, SSOSignUpParams, CommentListParams, CommentCreateParams, IncubatorCreateParams, IncubatorSearchParams, LoyaltyPrizeParams, LoyaltyGetPrizeParams, ModerationParams, ModerateContributionParams, FlaggedContributionParams, CustomNotificationParams, UserAutocompleteParams, UserScoreParams, UserSearchParams, TagParams, TagGetParams, MediaCreateParams, MediaTypes, ChunkUploadParams, ChunkUploadCompleteParams, ThreadParams, 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, EventSearchParams, StartStepParams, OnBoardingStep } from './types';
|
|
56
|
+
import { AccountCreateParams, AccountVerifyParams, AccountResetParams, AccountRecoverParams, AccountSearchParams, SCPaginatedResponse, WebhookParamType, WebhookEventsType, SSOSignUpParams, CommentListParams, CommentCreateParams, IncubatorCreateParams, IncubatorSearchParams, LoyaltyPrizeParams, LoyaltyGetPrizeParams, ModerationParams, ModerateContributionParams, FlaggedContributionParams, CustomNotificationParams, UserAutocompleteParams, UserScoreParams, UserSearchParams, TagParams, TagGetParams, MediaCreateParams, MediaTypes, ChunkUploadParams, ChunkUploadCompleteParams, ThreadParams, 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, EventSearchParams, LiveStreamCreateParams, LiveStreamSearchParams, LiveStreamRemoveParticipantParams, StartStepParams, OnBoardingStep } from './types';
|
|
56
57
|
/**
|
|
57
58
|
* Export all
|
|
58
59
|
*/
|
|
59
|
-
export { http, HttpResponse, HttpMethod, apiRequest, formatHttpError, formatHttpErrorCode, getCancelTokenSourceRequest, generateJWTToken, parseJwt, urlParams, Endpoints, EndpointType, AccountService, AccountApiClient, AccountApiClientInterface, PreferenceService, PreferenceApiClient, PreferenceApiClientInterface, UserService, UserApiClient, UserApiClientInterface, FeatureService, FeatureApiClient, FeatureApiClientInterface, CategoryService, CategoryApiClient, CategoryApiClientInterface, CommentService, CommentApiClient, CommentApiClientInterface, CustomAdvService, CustomAdvApiClient, CustomAdvApiClientInterface, CustomMenuService, CustomMenuApiClient, CustomMenuApiClientInterface, CustomPageService, CustomPageApiClient, CustomPageApiClientInterface, DataPortabilityService, DataPortabilityApiClient, DataPortabilityApiClientInterface, EmbedService, EmbedApiClient, EmbedApiClientInterface, FeedService, FeedApiClient, FeedApiClientInterface, FeedObjectService, FeedObjectApiClient, FeedObjectApiClientInterface, IncubatorService, IncubatorApiClient, IncubatorApiClientInterface, InsightService, InsightApiClient, InsightApiClientInterface, InviteService, InviteApiClient, InviteApiClientInterface, LegalPageService, LegalPageApiClient, LegalPageApiClientInterface, LocalityService, LocalityApiClient, LocalityApiClientInterface, LoyaltyService, LoyaltyApiClient, LoyaltyApiClientInterface, MediaService, MediaApiClient, MediaApiClientInterface, ModerationService, ModerationApiClient, ModerationApiClientInterface, NotificationService, NotificationApiClient, NotificationApiClientInterface, PrivateMessageService, PrivateMessageApiClient, PrivateMessageApiClientInterface, PromoService, PromoApiClient, PromoApiClientInterface, ScoreService, ScoreApiClient, ScoreApiClientInterface, SSOService, SSOApiClient, SSOApiClientInterface, SuggestionService, SuggestionApiClient, SuggestionApiClientInterface, TagService, TagApiClient, TagApiClientInterface, WebhookService, WebhookApiClient, WebhookApiClientInterface, SCPaginatedResponse, WebhookParamType, WebhookEventsType, AccountSearchParams, AccountCreateParams, AccountVerifyParams, AccountResetParams, AccountRecoverParams, CommentCreateParams, IncubatorCreateParams, IncubatorSearchParams, SSOSignUpParams, CommentListParams, LoyaltyPrizeParams, LoyaltyGetPrizeParams, ModerationParams, FlaggedContributionParams, ModerateContributionParams, CustomNotificationParams, UserAutocompleteParams, UserScoreParams, UserSearchParams, TagParams, TagGetParams, MediaCreateParams, MediaTypes, ChunkUploadParams, ChunkUploadCompleteParams, ThreadParams, 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, ReactionService, ReactionApiClient, ReactionApiClientInterface, GroupCreateParams, GroupFeedParams, GroupService, GroupApiClient, GroupApiClientInterface, EventCreateParams, EventFeedParams, EventSearchParams, EventService, EventApiClient, EventApiClientInterface, OnBoardingService, OnBoardingApiClientInterface, OnBoardingApiClient, StartStepParams, OnBoardingStep };
|
|
60
|
+
export { http, HttpResponse, HttpMethod, apiRequest, formatHttpError, formatHttpErrorCode, getCancelTokenSourceRequest, generateJWTToken, parseJwt, urlParams, Endpoints, EndpointType, AccountService, AccountApiClient, AccountApiClientInterface, PreferenceService, PreferenceApiClient, PreferenceApiClientInterface, UserService, UserApiClient, UserApiClientInterface, FeatureService, FeatureApiClient, FeatureApiClientInterface, CategoryService, CategoryApiClient, CategoryApiClientInterface, CommentService, CommentApiClient, CommentApiClientInterface, CustomAdvService, CustomAdvApiClient, CustomAdvApiClientInterface, CustomMenuService, CustomMenuApiClient, CustomMenuApiClientInterface, CustomPageService, CustomPageApiClient, CustomPageApiClientInterface, DataPortabilityService, DataPortabilityApiClient, DataPortabilityApiClientInterface, EmbedService, EmbedApiClient, EmbedApiClientInterface, FeedService, FeedApiClient, FeedApiClientInterface, FeedObjectService, FeedObjectApiClient, FeedObjectApiClientInterface, IncubatorService, IncubatorApiClient, IncubatorApiClientInterface, InsightService, InsightApiClient, InsightApiClientInterface, InviteService, InviteApiClient, InviteApiClientInterface, LegalPageService, LegalPageApiClient, LegalPageApiClientInterface, LocalityService, LocalityApiClient, LocalityApiClientInterface, LoyaltyService, LoyaltyApiClient, LoyaltyApiClientInterface, MediaService, MediaApiClient, MediaApiClientInterface, ModerationService, ModerationApiClient, ModerationApiClientInterface, NotificationService, NotificationApiClient, NotificationApiClientInterface, PrivateMessageService, PrivateMessageApiClient, PrivateMessageApiClientInterface, PromoService, PromoApiClient, PromoApiClientInterface, ScoreService, ScoreApiClient, ScoreApiClientInterface, SSOService, SSOApiClient, SSOApiClientInterface, SuggestionService, SuggestionApiClient, SuggestionApiClientInterface, TagService, TagApiClient, TagApiClientInterface, WebhookService, WebhookApiClient, WebhookApiClientInterface, SCPaginatedResponse, WebhookParamType, WebhookEventsType, AccountSearchParams, AccountCreateParams, AccountVerifyParams, AccountResetParams, AccountRecoverParams, CommentCreateParams, IncubatorCreateParams, IncubatorSearchParams, SSOSignUpParams, CommentListParams, LoyaltyPrizeParams, LoyaltyGetPrizeParams, ModerationParams, FlaggedContributionParams, ModerateContributionParams, CustomNotificationParams, UserAutocompleteParams, UserScoreParams, UserSearchParams, TagParams, TagGetParams, MediaCreateParams, MediaTypes, ChunkUploadParams, ChunkUploadCompleteParams, ThreadParams, 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, ReactionService, ReactionApiClient, ReactionApiClientInterface, GroupCreateParams, GroupFeedParams, GroupService, GroupApiClient, GroupApiClientInterface, EventCreateParams, EventFeedParams, EventSearchParams, EventService, EventApiClient, EventApiClientInterface, LiveStreamService, LiveStreamApiClient, LiveStreamApiClientInterface, LiveStreamCreateParams, LiveStreamSearchParams, LiveStreamRemoveParticipantParams, OnBoardingService, OnBoardingApiClientInterface, OnBoardingApiClient, StartStepParams, OnBoardingStep };
|
package/lib/esm/index.js
CHANGED
|
@@ -48,6 +48,7 @@ import WebhookService, { WebhookApiClient } from './services/webhook';
|
|
|
48
48
|
import ReactionService, { ReactionApiClient } from './services/reactions';
|
|
49
49
|
import GroupService, { GroupApiClient } from './services/group';
|
|
50
50
|
import EventService, { EventApiClient } from './services/event';
|
|
51
|
+
import LiveStreamService, { LiveStreamApiClient } from './services/live_stream';
|
|
51
52
|
import OnBoardingService, { OnBoardingApiClient } from './services/onboarding';
|
|
52
53
|
/**
|
|
53
54
|
* Types
|
|
@@ -56,4 +57,4 @@ import { MediaTypes, OnBoardingStep } from './types';
|
|
|
56
57
|
/**
|
|
57
58
|
* Export all
|
|
58
59
|
*/
|
|
59
|
-
export { http, apiRequest, formatHttpError, formatHttpErrorCode, getCancelTokenSourceRequest, generateJWTToken, parseJwt, urlParams, Endpoints, AccountService, AccountApiClient, PreferenceService, PreferenceApiClient, UserService, UserApiClient, FeatureService, FeatureApiClient, CategoryService, CategoryApiClient, CommentService, CommentApiClient, CustomAdvService, CustomAdvApiClient, CustomMenuService, CustomMenuApiClient, CustomPageService, CustomPageApiClient, DataPortabilityService, DataPortabilityApiClient, EmbedService, EmbedApiClient, FeedService, FeedApiClient, FeedObjectService, FeedObjectApiClient, IncubatorService, IncubatorApiClient, InsightService, InsightApiClient, InviteService, InviteApiClient, LegalPageService, LegalPageApiClient, LocalityService, LocalityApiClient, LoyaltyService, LoyaltyApiClient, MediaService, MediaApiClient, ModerationService, ModerationApiClient, NotificationService, NotificationApiClient, PrivateMessageService, PrivateMessageApiClient, PromoService, PromoApiClient, ScoreService, ScoreApiClient, SSOService, SSOApiClient, SuggestionService, SuggestionApiClient, TagService, TagApiClient, WebhookService, WebhookApiClient, MediaTypes, ReactionService, ReactionApiClient, GroupService, GroupApiClient, EventService, EventApiClient, OnBoardingService, OnBoardingApiClient, OnBoardingStep };
|
|
60
|
+
export { http, apiRequest, formatHttpError, formatHttpErrorCode, getCancelTokenSourceRequest, generateJWTToken, parseJwt, urlParams, Endpoints, AccountService, AccountApiClient, PreferenceService, PreferenceApiClient, UserService, UserApiClient, FeatureService, FeatureApiClient, CategoryService, CategoryApiClient, CommentService, CommentApiClient, CustomAdvService, CustomAdvApiClient, CustomMenuService, CustomMenuApiClient, CustomPageService, CustomPageApiClient, DataPortabilityService, DataPortabilityApiClient, EmbedService, EmbedApiClient, FeedService, FeedApiClient, FeedObjectService, FeedObjectApiClient, IncubatorService, IncubatorApiClient, InsightService, InsightApiClient, InviteService, InviteApiClient, LegalPageService, LegalPageApiClient, LocalityService, LocalityApiClient, LoyaltyService, LoyaltyApiClient, MediaService, MediaApiClient, ModerationService, ModerationApiClient, NotificationService, NotificationApiClient, PrivateMessageService, PrivateMessageApiClient, PromoService, PromoApiClient, ScoreService, ScoreApiClient, SSOService, SSOApiClient, SuggestionService, SuggestionApiClient, TagService, TagApiClient, WebhookService, WebhookApiClient, MediaTypes, ReactionService, ReactionApiClient, GroupService, GroupApiClient, EventService, EventApiClient, LiveStreamService, LiveStreamApiClient, OnBoardingService, OnBoardingApiClient, OnBoardingStep };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SCEventType, SCUserType } from '@selfcommunity/types';
|
|
1
|
+
import { SCEventType, SCMediaType, SCUserType } from '@selfcommunity/types';
|
|
3
2
|
import { AxiosRequestConfig } from 'axios';
|
|
4
|
-
import { EventCreateParams, EventSearchParams } from '../../types';
|
|
3
|
+
import { BaseGetParams, BaseSearchParams, EventCreateParams, EventFeedParams, EventRelatedParams, EventSearchParams, SCPaginatedResponse } from '../../types';
|
|
5
4
|
import { EventUserParams } from '../../types/event';
|
|
6
5
|
export interface EventApiClientInterface {
|
|
7
6
|
getUserEvents(params?: EventUserParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCEventType>>;
|
|
@@ -38,6 +37,9 @@ export interface EventApiClientInterface {
|
|
|
38
37
|
getEventRelated(id: number | string, params?: EventRelatedParams, config?: AxiosRequestConfig): Promise<any>;
|
|
39
38
|
showEvent(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
40
39
|
hideEvent(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
40
|
+
getEventPhotoGallery(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCMediaType>>;
|
|
41
|
+
addMediaToEventPhotoGallery(id: number | string, config?: AxiosRequestConfig): Promise<SCMediaType>;
|
|
42
|
+
removeMediasFromEventPhotoGallery(id: number | string, config?: AxiosRequestConfig): Promise<void>;
|
|
41
43
|
}
|
|
42
44
|
/**
|
|
43
45
|
* Contains all the endpoints needed to manage events.
|
|
@@ -242,6 +244,25 @@ export declare class EventApiClient {
|
|
|
242
244
|
* @param config
|
|
243
245
|
*/
|
|
244
246
|
static hideEvent(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
247
|
+
/**
|
|
248
|
+
* This endpoint returns the gallery of a specific event.
|
|
249
|
+
* @param id
|
|
250
|
+
* @param params
|
|
251
|
+
* @param config
|
|
252
|
+
*/
|
|
253
|
+
static getEventPhotoGallery(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCMediaType>>;
|
|
254
|
+
/**
|
|
255
|
+
* This endpoint adds the media in a gallery of a specific event.
|
|
256
|
+
* @param id
|
|
257
|
+
* @param config
|
|
258
|
+
*/
|
|
259
|
+
static addMediaToEventPhotoGallery(id: number | string, config?: AxiosRequestConfig): Promise<SCMediaType>;
|
|
260
|
+
/**
|
|
261
|
+
* This endpoint removes the medias in a gallery of a specific event.
|
|
262
|
+
* @param id
|
|
263
|
+
* @param config
|
|
264
|
+
*/
|
|
265
|
+
static removeMediasFromEventPhotoGallery(id: number | string, config?: AxiosRequestConfig): Promise<void>;
|
|
245
266
|
}
|
|
246
267
|
/**
|
|
247
268
|
*
|
|
@@ -313,4 +334,7 @@ export default class EventService {
|
|
|
313
334
|
static getEventRelated(id: number | string, params?: EventRelatedParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCEventType>>;
|
|
314
335
|
static showEvent(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
315
336
|
static hideEvent(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
337
|
+
static getEventPhotoGallery(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCMediaType>>;
|
|
338
|
+
static addMediaToEventPhotoGallery(id: number | string, config?: AxiosRequestConfig): Promise<SCMediaType>;
|
|
339
|
+
static removeMediasFromEventPhotoGallery(id: number | string, config?: AxiosRequestConfig): Promise<void>;
|
|
316
340
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
|
-
import { apiRequest } from '../../utils/apiRequest';
|
|
3
2
|
import Endpoints from '../../constants/Endpoints';
|
|
3
|
+
import { apiRequest } from '../../utils/apiRequest';
|
|
4
4
|
import { urlParams } from '../../utils/url';
|
|
5
5
|
/**
|
|
6
6
|
* Contains all the endpoints needed to manage events.
|
|
@@ -272,6 +272,32 @@ export class EventApiClient {
|
|
|
272
272
|
static hideEvent(id, config) {
|
|
273
273
|
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.hideEvent.url({ id }), method: Endpoints.hideEvent.method }));
|
|
274
274
|
}
|
|
275
|
+
/**
|
|
276
|
+
* This endpoint returns the gallery of a specific event.
|
|
277
|
+
* @param id
|
|
278
|
+
* @param params
|
|
279
|
+
* @param config
|
|
280
|
+
*/
|
|
281
|
+
static getEventPhotoGallery(id, params, config) {
|
|
282
|
+
const p = urlParams(params);
|
|
283
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: `${Endpoints.GetEventPhotoGallery.url({ id })}?${p.toString()}`, method: Endpoints.GetEventPhotoGallery.method }));
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* This endpoint adds the media in a gallery of a specific event.
|
|
287
|
+
* @param id
|
|
288
|
+
* @param config
|
|
289
|
+
*/
|
|
290
|
+
static addMediaToEventPhotoGallery(id, config) {
|
|
291
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.AddMediaToEventPhotoGallery.url({ id }), method: Endpoints.AddMediaToEventPhotoGallery.method }));
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* This endpoint removes the medias in a gallery of a specific event.
|
|
295
|
+
* @param id
|
|
296
|
+
* @param config
|
|
297
|
+
*/
|
|
298
|
+
static removeMediasFromEventPhotoGallery(id, config) {
|
|
299
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.RemoveMediasFromEventPhotoGallery.url({ id }), method: Endpoints.RemoveMediasFromEventPhotoGallery.method }));
|
|
300
|
+
}
|
|
275
301
|
}
|
|
276
302
|
/**
|
|
277
303
|
*
|
|
@@ -459,4 +485,19 @@ export default class EventService {
|
|
|
459
485
|
return EventApiClient.hideEvent(id, config);
|
|
460
486
|
});
|
|
461
487
|
}
|
|
488
|
+
static getEventPhotoGallery(id, params, config) {
|
|
489
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
490
|
+
return EventApiClient.getEventPhotoGallery(id, params, config);
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
static addMediaToEventPhotoGallery(id, config) {
|
|
494
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
495
|
+
return EventApiClient.addMediaToEventPhotoGallery(id, config);
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
static removeMediasFromEventPhotoGallery(id, config) {
|
|
499
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
500
|
+
return EventApiClient.removeMediasFromEventPhotoGallery(id, config);
|
|
501
|
+
});
|
|
502
|
+
}
|
|
462
503
|
}
|