@selfcommunity/api-services 0.6.6 → 0.6.7-alpha.1

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.
@@ -2,17 +2,17 @@ import { AxiosInstance, AxiosResponse } from 'axios';
2
2
  /**
3
3
  * List of all Http methods
4
4
  */
5
- export declare type HttpMethod = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
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 declare type AxiosResponseHeaders = Record<string, string> & {
9
+ export type AxiosResponseHeaders = Record<string, string> & {
10
10
  'set-cookie'?: string[];
11
11
  };
12
12
  /**
13
13
  * General HttpResponse
14
14
  */
15
- export declare type HttpResponse<T = unknown, D = any> = AxiosResponse<T, D>;
15
+ export type HttpResponse<T = unknown, D = any> = AxiosResponse<T, D>;
16
16
  /**
17
17
  * Interface for the ApiClient
18
18
  */
@@ -10,6 +10,9 @@ const axios_1 = tslib_1.__importDefault(require("axios"));
10
10
  * should we choose to do so in the future, without it breaking our app.
11
11
  */
12
12
  class ApiClient {
13
+ createClient(config) {
14
+ return axios_1.default.create(Object.assign(Object.assign({}, (config && config.baseURL && { baseURL: config.baseURL })), { responseType: 'json', headers: Object.assign({}, (config && config.accessToken && { Authorization: `Token ${config.accessToken}` })), timeout: ApiClient.DEFAULT_TIMEOUT }));
15
+ }
13
16
  constructor(config) {
14
17
  /**
15
18
  * Set default header
@@ -51,9 +54,6 @@ class ApiClient {
51
54
  this.client = this.createClient(config);
52
55
  this.setDefaultHeader({ name: 'Content-Type', value: 'application/json', methods: ['post'] });
53
56
  }
54
- createClient(config) {
55
- return axios_1.default.create(Object.assign(Object.assign({}, (config && config.baseURL && { baseURL: config.baseURL })), { responseType: 'json', headers: Object.assign({}, (config && config.accessToken && { Authorization: `Token ${config.accessToken}` })), timeout: ApiClient.DEFAULT_TIMEOUT }));
56
- }
57
57
  /**
58
58
  * Get client instance
59
59
  */
@@ -517,6 +517,10 @@ const Endpoints = {
517
517
  url: (0, utils_1.urlReplacer)('/api/v2/user/$(id)/provider/'),
518
518
  method: 'DELETE'
519
519
  },
520
+ GetLiveStream: {
521
+ url: (0, utils_1.urlReplacer)('/api/v2/user/$(id)/live_stream/'),
522
+ method: 'GET'
523
+ },
520
524
  /**
521
525
  * Broadcast Messages
522
526
  */
@@ -1340,6 +1344,49 @@ const Endpoints = {
1340
1344
  url: (0, utils_1.urlReplacer)('/api/v2/event/$(id)/gallery/'),
1341
1345
  method: 'DELETE'
1342
1346
  },
1347
+ /**
1348
+ * LiveStream
1349
+ */
1350
+ GetLiveStreamInfo: {
1351
+ url: (0, utils_1.urlReplacer)('/api/v2/live_stream/$(id)/'),
1352
+ method: 'GET'
1353
+ },
1354
+ SearchLiveStream: {
1355
+ url: (0, utils_1.urlReplacer)('/api/v2/live_stream/search/'),
1356
+ method: 'GET'
1357
+ },
1358
+ CreateLiveStream: {
1359
+ url: (0, utils_1.urlReplacer)('/api/v2/live_stream/'),
1360
+ method: 'POST'
1361
+ },
1362
+ UpdateLiveStream: {
1363
+ url: (0, utils_1.urlReplacer)('/api/v2/live_stream/$(id)/'),
1364
+ method: 'PUT'
1365
+ },
1366
+ DeleteLiveStream: {
1367
+ url: (0, utils_1.urlReplacer)('/api/v2/live_stream/$(id)/'),
1368
+ method: 'DELETE'
1369
+ },
1370
+ PatchLiveStream: {
1371
+ url: (0, utils_1.urlReplacer)('/api/v2/live_stream/$(id)/'),
1372
+ method: 'PATCH'
1373
+ },
1374
+ CloseLiveStream: {
1375
+ url: (0, utils_1.urlReplacer)('/api/v2/live_stream/$(id)/close/'),
1376
+ method: 'POST'
1377
+ },
1378
+ JoinLiveStream: {
1379
+ url: (0, utils_1.urlReplacer)('/api/v2/live_stream/$(id)/join/'),
1380
+ method: 'POST'
1381
+ },
1382
+ RemoveParticipant: {
1383
+ url: (0, utils_1.urlReplacer)('/api/v2/live_stream/$(id)/remove_participant/'),
1384
+ method: 'POST'
1385
+ },
1386
+ GetLiveStreamMonthlyDuration: {
1387
+ url: (0, utils_1.urlReplacer)('/api/v2/live_stream/monthly_duration/'),
1388
+ method: 'GET'
1389
+ },
1343
1390
  /**
1344
1391
  * OnBoarding
1345
1392
  */
@@ -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/cjs/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ModerationService = exports.MediaApiClient = exports.MediaService = exports.LoyaltyApiClient = exports.LoyaltyService = exports.LocalityApiClient = exports.LocalityService = exports.LegalPageApiClient = exports.LegalPageService = exports.InviteApiClient = exports.InviteService = exports.InsightApiClient = exports.InsightService = exports.IncubatorApiClient = exports.IncubatorService = exports.FeedObjectApiClient = exports.FeedObjectService = exports.FeedApiClient = exports.FeedService = exports.EmbedApiClient = exports.EmbedService = exports.DataPortabilityApiClient = exports.DataPortabilityService = exports.CustomPageApiClient = exports.CustomPageService = exports.CustomMenuApiClient = exports.CustomMenuService = exports.CustomAdvApiClient = exports.CustomAdvService = exports.CommentApiClient = exports.CommentService = exports.CategoryApiClient = exports.CategoryService = exports.FeatureApiClient = exports.FeatureService = exports.UserApiClient = exports.UserService = exports.PreferenceApiClient = exports.PreferenceService = exports.AccountApiClient = exports.AccountService = exports.Endpoints = exports.urlParams = exports.parseJwt = exports.generateJWTToken = exports.getCancelTokenSourceRequest = exports.formatHttpErrorCode = exports.formatHttpError = exports.apiRequest = exports.http = void 0;
4
- exports.OnBoardingStep = exports.OnBoardingApiClient = exports.OnBoardingService = exports.EventApiClient = exports.EventService = exports.GroupApiClient = exports.GroupService = exports.ReactionApiClient = exports.ReactionService = exports.MediaTypes = exports.WebhookApiClient = exports.WebhookService = exports.TagApiClient = exports.TagService = exports.SuggestionApiClient = exports.SuggestionService = exports.SSOApiClient = exports.SSOService = exports.ScoreApiClient = exports.ScoreService = exports.PromoApiClient = exports.PromoService = exports.PrivateMessageApiClient = exports.PrivateMessageService = exports.NotificationApiClient = exports.NotificationService = exports.ModerationApiClient = void 0;
4
+ exports.OnBoardingStep = exports.OnBoardingApiClient = exports.OnBoardingService = exports.LiveStreamApiClient = exports.LiveStreamService = exports.EventApiClient = exports.EventService = exports.GroupApiClient = exports.GroupService = exports.ReactionApiClient = exports.ReactionService = exports.MediaTypes = exports.WebhookApiClient = exports.WebhookService = exports.TagApiClient = exports.TagService = exports.SuggestionApiClient = exports.SuggestionService = exports.SSOApiClient = exports.SSOService = exports.ScoreApiClient = exports.ScoreService = exports.PromoApiClient = exports.PromoService = exports.PrivateMessageApiClient = exports.PrivateMessageService = exports.NotificationApiClient = exports.NotificationService = exports.ModerationApiClient = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  /**
7
7
  * Axios client wrapper
@@ -126,6 +126,9 @@ Object.defineProperty(exports, "GroupApiClient", { enumerable: true, get: functi
126
126
  const event_1 = tslib_1.__importStar(require("./services/event"));
127
127
  exports.EventService = event_1.default;
128
128
  Object.defineProperty(exports, "EventApiClient", { enumerable: true, get: function () { return event_1.EventApiClient; } });
129
+ const live_stream_1 = tslib_1.__importStar(require("./services/live_stream"));
130
+ exports.LiveStreamService = live_stream_1.default;
131
+ Object.defineProperty(exports, "LiveStreamApiClient", { enumerable: true, get: function () { return live_stream_1.LiveStreamApiClient; } });
129
132
  const onboarding_1 = tslib_1.__importStar(require("./services/onboarding"));
130
133
  exports.OnBoardingService = onboarding_1.default;
131
134
  Object.defineProperty(exports, "OnBoardingApiClient", { enumerable: true, get: function () { return onboarding_1.OnBoardingApiClient; } });
@@ -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,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;
@@ -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,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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,17 +2,17 @@ import { AxiosInstance, AxiosResponse } from 'axios';
2
2
  /**
3
3
  * List of all Http methods
4
4
  */
5
- export declare type HttpMethod = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
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 declare type AxiosResponseHeaders = Record<string, string> & {
9
+ export type AxiosResponseHeaders = Record<string, string> & {
10
10
  'set-cookie'?: string[];
11
11
  };
12
12
  /**
13
13
  * General HttpResponse
14
14
  */
15
- export declare type HttpResponse<T = unknown, D = any> = AxiosResponse<T, D>;
15
+ export type HttpResponse<T = unknown, D = any> = AxiosResponse<T, D>;
16
16
  /**
17
17
  * Interface for the ApiClient
18
18
  */