@selfcommunity/api-services 0.4.8 → 0.4.9-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.
- package/lib/cjs/constants/Endpoints.js +67 -0
- package/lib/cjs/index.d.ts +3 -2
- package/lib/cjs/index.js +4 -1
- package/lib/cjs/services/group/index.d.ts +198 -0
- package/lib/cjs/services/group/index.js +285 -0
- package/lib/cjs/types/group.d.ts +36 -0
- package/lib/cjs/types/group.js +2 -0
- package/lib/cjs/types/index.d.ts +2 -1
- package/lib/esm/constants/Endpoints.js +67 -0
- package/lib/esm/index.d.ts +3 -2
- package/lib/esm/index.js +2 -1
- package/lib/esm/services/group/index.d.ts +198 -0
- package/lib/esm/services/group/index.js +280 -0
- package/lib/esm/types/group.d.ts +36 -0
- package/lib/esm/types/group.js +1 -0
- package/lib/esm/types/index.d.ts +2 -1
- package/lib/umd/api-services.js +1 -1
- package/package.json +4 -4
|
@@ -1121,6 +1121,73 @@ const Endpoints = {
|
|
|
1121
1121
|
GetSpecificReaction: {
|
|
1122
1122
|
url: (0, utils_1.urlReplacer)('/api/v2/reaction/$(id)/'),
|
|
1123
1123
|
method: 'GET'
|
|
1124
|
+
},
|
|
1125
|
+
/**
|
|
1126
|
+
* Groups
|
|
1127
|
+
*/
|
|
1128
|
+
GetUserGroups: {
|
|
1129
|
+
url: (0, utils_1.urlReplacer)('/api/v2/group/'),
|
|
1130
|
+
method: 'GET'
|
|
1131
|
+
},
|
|
1132
|
+
GetGroupInfo: {
|
|
1133
|
+
url: (0, utils_1.urlReplacer)('/api/v2/group/$(id)/'),
|
|
1134
|
+
method: 'GET'
|
|
1135
|
+
},
|
|
1136
|
+
GetGroupFeed: {
|
|
1137
|
+
url: (0, utils_1.urlReplacer)('/api/v2/group/$(id)/feed/'),
|
|
1138
|
+
method: 'GET'
|
|
1139
|
+
},
|
|
1140
|
+
SearchGroups: {
|
|
1141
|
+
url: (0, utils_1.urlReplacer)('/api/v2/group/$(id)/search/'),
|
|
1142
|
+
method: 'GET'
|
|
1143
|
+
},
|
|
1144
|
+
CreateGroup: {
|
|
1145
|
+
url: (0, utils_1.urlReplacer)('/api/v2/group/'),
|
|
1146
|
+
method: 'POST'
|
|
1147
|
+
},
|
|
1148
|
+
UpdateGroup: {
|
|
1149
|
+
url: (0, utils_1.urlReplacer)('/api/v2/group/$(id)/'),
|
|
1150
|
+
method: 'PUT'
|
|
1151
|
+
},
|
|
1152
|
+
PatchGroup: {
|
|
1153
|
+
url: (0, utils_1.urlReplacer)('/api/v2/group/$(id)/'),
|
|
1154
|
+
method: 'PATCH'
|
|
1155
|
+
},
|
|
1156
|
+
GetGroupSuggestedUsers: {
|
|
1157
|
+
url: (0, utils_1.urlReplacer)('/api/v2/group/$(id)/user/?search=$(search)'),
|
|
1158
|
+
method: 'GET'
|
|
1159
|
+
},
|
|
1160
|
+
GetGroupsSuggestedUsers: {
|
|
1161
|
+
url: (0, utils_1.urlReplacer)('/api/v2/group/user/?search=$(search)'),
|
|
1162
|
+
method: 'GET'
|
|
1163
|
+
},
|
|
1164
|
+
InviteOrAcceptGroupRequest: {
|
|
1165
|
+
url: (0, utils_1.urlReplacer)('/api/v2/group/$(id)/invite/'),
|
|
1166
|
+
method: 'POST'
|
|
1167
|
+
},
|
|
1168
|
+
GetGroupInvitedUsers: {
|
|
1169
|
+
url: (0, utils_1.urlReplacer)('/api/v2/group/$(id)/invite/'),
|
|
1170
|
+
method: 'GET'
|
|
1171
|
+
},
|
|
1172
|
+
GetGroupSubscriptionStatus: {
|
|
1173
|
+
url: (0, utils_1.urlReplacer)('/api/v2/group/$(id)/status/'),
|
|
1174
|
+
method: 'GET'
|
|
1175
|
+
},
|
|
1176
|
+
SubscribeToGroup: {
|
|
1177
|
+
url: (0, utils_1.urlReplacer)('/api/v2/group/$(id)/subscribe/'),
|
|
1178
|
+
method: 'POST'
|
|
1179
|
+
},
|
|
1180
|
+
GetGroupSubscribers: {
|
|
1181
|
+
url: (0, utils_1.urlReplacer)('/api/v2/group/$(id)/subscribe/'),
|
|
1182
|
+
method: 'GET'
|
|
1183
|
+
},
|
|
1184
|
+
GetGroupWaitingApprovalSubscribers: {
|
|
1185
|
+
url: (0, utils_1.urlReplacer)('/api/v2/group/$(id)/request_subscribe/'),
|
|
1186
|
+
method: 'GET'
|
|
1187
|
+
},
|
|
1188
|
+
UnsubscribeFromGroup: {
|
|
1189
|
+
url: (0, utils_1.urlReplacer)('/api/v2/group/$(id)/subscribe/'),
|
|
1190
|
+
method: 'DELETE'
|
|
1124
1191
|
}
|
|
1125
1192
|
};
|
|
1126
1193
|
exports.default = Endpoints;
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -46,11 +46,12 @@ import TagService, { TagApiClient, TagApiClientInterface } from './services/tag'
|
|
|
46
46
|
import UserService, { UserApiClient, UserApiClientInterface } from './services/user';
|
|
47
47
|
import WebhookService, { WebhookApiClient, WebhookApiClientInterface } from './services/webhook';
|
|
48
48
|
import ReactionService, { ReactionApiClient, ReactionApiClientInterface } from './services/reactions';
|
|
49
|
+
import GroupService, { GroupApiClient, GroupApiClientInterface } from './services/group';
|
|
49
50
|
/**
|
|
50
51
|
* Types
|
|
51
52
|
*/
|
|
52
|
-
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 } from './types';
|
|
53
|
+
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 } from './types';
|
|
53
54
|
/**
|
|
54
55
|
* Export all
|
|
55
56
|
*/
|
|
56
|
-
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 };
|
|
57
|
+
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 };
|
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.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.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
|
|
@@ -120,6 +120,9 @@ Object.defineProperty(exports, "WebhookApiClient", { enumerable: true, get: func
|
|
|
120
120
|
const reactions_1 = tslib_1.__importStar(require("./services/reactions"));
|
|
121
121
|
exports.ReactionService = reactions_1.default;
|
|
122
122
|
Object.defineProperty(exports, "ReactionApiClient", { enumerable: true, get: function () { return reactions_1.ReactionApiClient; } });
|
|
123
|
+
const group_1 = tslib_1.__importStar(require("./services/group"));
|
|
124
|
+
exports.GroupService = group_1.default;
|
|
125
|
+
Object.defineProperty(exports, "GroupApiClient", { enumerable: true, get: function () { return group_1.GroupApiClient; } });
|
|
123
126
|
/**
|
|
124
127
|
* Types
|
|
125
128
|
*/
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { BaseGetParams, BaseSearchParams, GroupFeedParams, SCPaginatedResponse } from '../../types';
|
|
2
|
+
import { SCGroupType, SCUserType } from '@selfcommunity/types';
|
|
3
|
+
import { AxiosRequestConfig } from 'axios';
|
|
4
|
+
import { GroupCreateParams } from '../../types';
|
|
5
|
+
export interface GroupApiClientInterface {
|
|
6
|
+
getUserGroups(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCGroupType>>;
|
|
7
|
+
searchGroups(params?: BaseSearchParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCGroupType>>;
|
|
8
|
+
getSpecificGroupInfo(id: number | string, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
9
|
+
getGroupFeed(id: number | string, params?: GroupFeedParams, config?: AxiosRequestConfig): Promise<any>;
|
|
10
|
+
createGroup(data: GroupCreateParams | FormData, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
11
|
+
updateGroup(id: number | string, data: SCGroupType, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
12
|
+
patchGroup(id: number | string, data: SCGroupType, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
13
|
+
changeGroupAvatarOrCover(id: number | string, data: FormData, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
14
|
+
getGroupMembers(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
15
|
+
getGroupSuggestedUsers(id: number | string, search: string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
16
|
+
getGroupsSuggestedUsers(search: string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
17
|
+
getGroupInvitedUsers(id: number | string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
18
|
+
subscribeToGroup(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
19
|
+
unsubscribeFromGroup(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
20
|
+
inviteOrAcceptGroupRequest(id: number | string, data: {
|
|
21
|
+
users: number[];
|
|
22
|
+
}, config?: AxiosRequestConfig): Promise<any>;
|
|
23
|
+
getGroupSubscriptionStatus(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
24
|
+
getGroupWaitingApprovalSubscribers(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Contains all the endpoints needed to manage groups.
|
|
28
|
+
*/
|
|
29
|
+
export declare class GroupApiClient {
|
|
30
|
+
/**
|
|
31
|
+
* This endpoint retrieves all the groups of the logged-in user.
|
|
32
|
+
* @param params
|
|
33
|
+
* @param config
|
|
34
|
+
*/
|
|
35
|
+
static getUserGroups(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCGroupType>>;
|
|
36
|
+
/**
|
|
37
|
+
* This endpoint performs groups search
|
|
38
|
+
* @param params
|
|
39
|
+
* @param config
|
|
40
|
+
*/
|
|
41
|
+
static searchGroups(params?: BaseSearchParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCGroupType>>;
|
|
42
|
+
/**
|
|
43
|
+
* This endpoint retrieves a specific group.
|
|
44
|
+
* @param id
|
|
45
|
+
* @param config
|
|
46
|
+
*/
|
|
47
|
+
static getSpecificGroupInfo(id: number | string, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
48
|
+
/**
|
|
49
|
+
* This endpoint performs groups search
|
|
50
|
+
* @param id
|
|
51
|
+
* @param params
|
|
52
|
+
* @param config
|
|
53
|
+
*/
|
|
54
|
+
static getGroupFeed(id: number | string, params?: GroupFeedParams, config?: AxiosRequestConfig): Promise<any>;
|
|
55
|
+
/**
|
|
56
|
+
* This endpoint creates a group.
|
|
57
|
+
* @param data
|
|
58
|
+
* @param config
|
|
59
|
+
*/
|
|
60
|
+
static createGroup(data: GroupCreateParams | FormData, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
61
|
+
/**
|
|
62
|
+
* This endpoint updates a group.
|
|
63
|
+
* @param id
|
|
64
|
+
* @param data
|
|
65
|
+
* @param config
|
|
66
|
+
*/
|
|
67
|
+
static updateGroup(id: number | string, data: SCGroupType, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
68
|
+
/**
|
|
69
|
+
* This endpoint patches a group.
|
|
70
|
+
* @param id
|
|
71
|
+
* @param data
|
|
72
|
+
* @param config
|
|
73
|
+
*/
|
|
74
|
+
static patchGroup(id: number | string, data: SCGroupType, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
75
|
+
/**
|
|
76
|
+
* This endpoint changes the group avatar
|
|
77
|
+
* @param id
|
|
78
|
+
* @param data
|
|
79
|
+
* @param config
|
|
80
|
+
*/
|
|
81
|
+
static changeGroupAvatarOrCover(id: number | string, data: FormData, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
82
|
+
/**
|
|
83
|
+
* This endpoint returns all subscribers of a specific group.
|
|
84
|
+
* @param id
|
|
85
|
+
* @param params
|
|
86
|
+
* @param config
|
|
87
|
+
*/
|
|
88
|
+
static getGroupMembers(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
89
|
+
/**
|
|
90
|
+
* This endpoint returns a list of suggested users to invite to the group.
|
|
91
|
+
* @param id
|
|
92
|
+
* @param search
|
|
93
|
+
* @param config
|
|
94
|
+
*/
|
|
95
|
+
static getGroupSuggestedUsers(id: number | string, search: string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
96
|
+
/**
|
|
97
|
+
* This endpoint returns a list of suggested users to invite to the groups.
|
|
98
|
+
* @param search
|
|
99
|
+
* @param config
|
|
100
|
+
*/
|
|
101
|
+
static getGroupsSuggestedUsers(search: string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
102
|
+
/**
|
|
103
|
+
* This endpoint returns a list of invited users.
|
|
104
|
+
* @param id
|
|
105
|
+
* @param config
|
|
106
|
+
*/
|
|
107
|
+
static getGroupInvitedUsers(id: number | string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
108
|
+
/**
|
|
109
|
+
* This endpoint subscribes to a group.
|
|
110
|
+
* @param id
|
|
111
|
+
* @param config
|
|
112
|
+
*/
|
|
113
|
+
static subscribeToGroup(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
114
|
+
/**
|
|
115
|
+
* This endpoint unsubscribes from a group.
|
|
116
|
+
* @param id
|
|
117
|
+
* @param config
|
|
118
|
+
*/
|
|
119
|
+
static unsubscribeFromGroup(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
120
|
+
/**
|
|
121
|
+
* This endpoint allows to invite or accept a group invite.
|
|
122
|
+
* @param id
|
|
123
|
+
* @param data
|
|
124
|
+
* @param config
|
|
125
|
+
*/
|
|
126
|
+
static inviteOrAcceptGroupRequest(id: number | string, data: {
|
|
127
|
+
users: number[];
|
|
128
|
+
}, config?: AxiosRequestConfig): Promise<any>;
|
|
129
|
+
/**
|
|
130
|
+
* This endpoint retrieves the group subscription status.
|
|
131
|
+
* @param id
|
|
132
|
+
* @param config
|
|
133
|
+
*/
|
|
134
|
+
static getGroupSubscriptionStatus(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
135
|
+
/**
|
|
136
|
+
* This endpoint returns a list of the users waiting to be added to the group.
|
|
137
|
+
* @param id
|
|
138
|
+
* @param params
|
|
139
|
+
* @param config
|
|
140
|
+
*/
|
|
141
|
+
static getGroupWaitingApprovalSubscribers(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
*
|
|
145
|
+
:::tip Incubator service can be used in the following way:
|
|
146
|
+
|
|
147
|
+
```jsx
|
|
148
|
+
1. Import the service from our library:
|
|
149
|
+
|
|
150
|
+
import {GroupService} from "@selfcommunity/api-services";
|
|
151
|
+
```
|
|
152
|
+
```jsx
|
|
153
|
+
2. Create a function and put the service inside it!
|
|
154
|
+
The async function `searchGroups` will return the groups matching the search query.
|
|
155
|
+
|
|
156
|
+
async searchGroups() {
|
|
157
|
+
return await GroupService.searchGroups();
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
```jsx
|
|
161
|
+
In case of required `params`, just add them inside the brackets.
|
|
162
|
+
|
|
163
|
+
async getSpecificGroupInfo(groupId) {
|
|
164
|
+
return await GroupService.getSpecificGroupInfo(groupId);
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
```jsx
|
|
168
|
+
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
|
|
169
|
+
|
|
170
|
+
1. Declare it(or declare them, it is possible to add multiple params)
|
|
171
|
+
|
|
172
|
+
const headers = headers: {Authorization: `Bearer ${yourToken}`}
|
|
173
|
+
|
|
174
|
+
2. Add it inside the brackets and pass it to the function, as shown in the previous example!
|
|
175
|
+
```
|
|
176
|
+
:::
|
|
177
|
+
*/
|
|
178
|
+
export default class GroupService {
|
|
179
|
+
static getUserGroups(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCGroupType>>;
|
|
180
|
+
static searchGroups(params?: BaseSearchParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCGroupType>>;
|
|
181
|
+
static getSpecificGroupInfo(id: number | string, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
182
|
+
static getGroupFeed(id: number | string, params?: GroupFeedParams, config?: AxiosRequestConfig): Promise<any>;
|
|
183
|
+
static createGroup(data: GroupCreateParams | FormData, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
184
|
+
static updateGroup(id: number | string, data: SCGroupType, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
185
|
+
static patchGroup(id: number | string, data: SCGroupType, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
186
|
+
static changeGroupAvatarOrCover(id: number | string, data: FormData, config?: AxiosRequestConfig): Promise<SCGroupType>;
|
|
187
|
+
static getGroupMembers(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
188
|
+
static getGroupSuggestedUsers(id: number | string, search: string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
189
|
+
static getGroupsSuggestedUsers(search: string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
190
|
+
static getGroupInvitedUsers(id: number | string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
191
|
+
static subscribeToGroup(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
192
|
+
static unsubscribeFromGroup(id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
193
|
+
static inviteOrAcceptGroupRequest(id: number | string, data: {
|
|
194
|
+
users: number[];
|
|
195
|
+
}, config?: AxiosRequestConfig): Promise<any>;
|
|
196
|
+
static getGroupSubscriptionStatus(id: number | string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<any>>;
|
|
197
|
+
static getGroupWaitingApprovalSubscribers(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
|
|
198
|
+
}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GroupApiClient = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const apiRequest_1 = require("../../utils/apiRequest");
|
|
6
|
+
const Endpoints_1 = tslib_1.__importDefault(require("../../constants/Endpoints"));
|
|
7
|
+
const url_1 = require("../../utils/url");
|
|
8
|
+
/**
|
|
9
|
+
* Contains all the endpoints needed to manage groups.
|
|
10
|
+
*/
|
|
11
|
+
class GroupApiClient {
|
|
12
|
+
/**
|
|
13
|
+
* This endpoint retrieves all the groups of the logged-in user.
|
|
14
|
+
* @param params
|
|
15
|
+
* @param config
|
|
16
|
+
*/
|
|
17
|
+
static getUserGroups(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.GetUserGroups.url({})}?${p.toString()}`, method: Endpoints_1.default.GetUserGroups.method }));
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* This endpoint performs groups search
|
|
23
|
+
* @param params
|
|
24
|
+
* @param config
|
|
25
|
+
*/
|
|
26
|
+
static searchGroups(params, config) {
|
|
27
|
+
const p = (0, url_1.urlParams)(params);
|
|
28
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: `${Endpoints_1.default.SearchGroups.url({})}?${p.toString()}`, method: Endpoints_1.default.SearchGroups.method }));
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* This endpoint retrieves a specific group.
|
|
32
|
+
* @param id
|
|
33
|
+
* @param config
|
|
34
|
+
*/
|
|
35
|
+
static getSpecificGroupInfo(id, config) {
|
|
36
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.GetGroupInfo.url({ id }), method: Endpoints_1.default.GetGroupInfo.method }));
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* This endpoint performs groups search
|
|
40
|
+
* @param id
|
|
41
|
+
* @param params
|
|
42
|
+
* @param config
|
|
43
|
+
*/
|
|
44
|
+
static getGroupFeed(id, params, config) {
|
|
45
|
+
const p = (0, url_1.urlParams)(params);
|
|
46
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: `${Endpoints_1.default.GetGroupFeed.url({ id })}?${p.toString()}`, method: Endpoints_1.default.GetGroupFeed.method }));
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* This endpoint creates a group.
|
|
50
|
+
* @param data
|
|
51
|
+
* @param config
|
|
52
|
+
*/
|
|
53
|
+
static createGroup(data, config) {
|
|
54
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.CreateGroup.url({}), method: Endpoints_1.default.CreateGroup.method, data: data }));
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* This endpoint updates a group.
|
|
58
|
+
* @param id
|
|
59
|
+
* @param data
|
|
60
|
+
* @param config
|
|
61
|
+
*/
|
|
62
|
+
static updateGroup(id, data, config) {
|
|
63
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.UpdateGroup.url({ id }), method: Endpoints_1.default.UpdateGroup.method, data: data }));
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* This endpoint patches a group.
|
|
67
|
+
* @param id
|
|
68
|
+
* @param data
|
|
69
|
+
* @param config
|
|
70
|
+
*/
|
|
71
|
+
static patchGroup(id, data, config) {
|
|
72
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.PatchGroup.url({ id }), method: Endpoints_1.default.PatchGroup.method, data: data }));
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* This endpoint changes the group avatar
|
|
76
|
+
* @param id
|
|
77
|
+
* @param data
|
|
78
|
+
* @param config
|
|
79
|
+
*/
|
|
80
|
+
static changeGroupAvatarOrCover(id, data, config) {
|
|
81
|
+
return (0, apiRequest_1.apiRequest)(Object.assign({ url: Endpoints_1.default.PatchGroup.url({ id }), method: Endpoints_1.default.PatchGroup.method, data }, config));
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* This endpoint returns all subscribers of a specific group.
|
|
85
|
+
* @param id
|
|
86
|
+
* @param params
|
|
87
|
+
* @param config
|
|
88
|
+
*/
|
|
89
|
+
static getGroupMembers(id, params, config) {
|
|
90
|
+
const p = (0, url_1.urlParams)(params);
|
|
91
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: `${Endpoints_1.default.GetGroupSubscribers.url({ id })}?${p.toString()}`, method: Endpoints_1.default.GetGroupSubscribers.method }));
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* This endpoint returns a list of suggested users to invite to the group.
|
|
95
|
+
* @param id
|
|
96
|
+
* @param search
|
|
97
|
+
* @param config
|
|
98
|
+
*/
|
|
99
|
+
static getGroupSuggestedUsers(id, search, config) {
|
|
100
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.GetGroupSuggestedUsers.url({ id, search }), method: Endpoints_1.default.GetGroupSuggestedUsers.method }));
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* This endpoint returns a list of suggested users to invite to the groups.
|
|
104
|
+
* @param search
|
|
105
|
+
* @param config
|
|
106
|
+
*/
|
|
107
|
+
static getGroupsSuggestedUsers(search, config) {
|
|
108
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.GetGroupsSuggestedUsers.url({ search }), method: Endpoints_1.default.GetGroupsSuggestedUsers.method }));
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* This endpoint returns a list of invited users.
|
|
112
|
+
* @param id
|
|
113
|
+
* @param config
|
|
114
|
+
*/
|
|
115
|
+
static getGroupInvitedUsers(id, config) {
|
|
116
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.GetGroupInvitedUsers.url({ id }), method: Endpoints_1.default.GetGroupInvitedUsers.method }));
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* This endpoint subscribes to a group.
|
|
120
|
+
* @param id
|
|
121
|
+
* @param config
|
|
122
|
+
*/
|
|
123
|
+
static subscribeToGroup(id, config) {
|
|
124
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.SubscribeToGroup.url({ id }), method: Endpoints_1.default.SubscribeToGroup.method }));
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* This endpoint unsubscribes from a group.
|
|
128
|
+
* @param id
|
|
129
|
+
* @param config
|
|
130
|
+
*/
|
|
131
|
+
static unsubscribeFromGroup(id, config) {
|
|
132
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.UnsubscribeFromGroup.url({ id }), method: Endpoints_1.default.UnsubscribeFromGroup.method }));
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* This endpoint allows to invite or accept a group invite.
|
|
136
|
+
* @param id
|
|
137
|
+
* @param data
|
|
138
|
+
* @param config
|
|
139
|
+
*/
|
|
140
|
+
static inviteOrAcceptGroupRequest(id, data, config) {
|
|
141
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.InviteOrAcceptGroupRequest.url({ id }), method: Endpoints_1.default.InviteOrAcceptGroupRequest.method, data: data }));
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* This endpoint retrieves the group subscription status.
|
|
145
|
+
* @param id
|
|
146
|
+
* @param config
|
|
147
|
+
*/
|
|
148
|
+
static getGroupSubscriptionStatus(id, config) {
|
|
149
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.GetGroupSubscriptionStatus.url({ id }), method: Endpoints_1.default.GetGroupSubscriptionStatus.method }));
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* This endpoint returns a list of the users waiting to be added to the group.
|
|
153
|
+
* @param id
|
|
154
|
+
* @param params
|
|
155
|
+
* @param config
|
|
156
|
+
*/
|
|
157
|
+
static getGroupWaitingApprovalSubscribers(id, params, config) {
|
|
158
|
+
const p = (0, url_1.urlParams)(params);
|
|
159
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: `${Endpoints_1.default.GetGroupWaitingApprovalSubscribers.url({ id })}?${p.toString()}`, method: Endpoints_1.default.GetGroupWaitingApprovalSubscribers.method }));
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
exports.GroupApiClient = GroupApiClient;
|
|
163
|
+
/**
|
|
164
|
+
*
|
|
165
|
+
:::tip Incubator service can be used in the following way:
|
|
166
|
+
|
|
167
|
+
```jsx
|
|
168
|
+
1. Import the service from our library:
|
|
169
|
+
|
|
170
|
+
import {GroupService} from "@selfcommunity/api-services";
|
|
171
|
+
```
|
|
172
|
+
```jsx
|
|
173
|
+
2. Create a function and put the service inside it!
|
|
174
|
+
The async function `searchGroups` will return the groups matching the search query.
|
|
175
|
+
|
|
176
|
+
async searchGroups() {
|
|
177
|
+
return await GroupService.searchGroups();
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
```jsx
|
|
181
|
+
In case of required `params`, just add them inside the brackets.
|
|
182
|
+
|
|
183
|
+
async getSpecificGroupInfo(groupId) {
|
|
184
|
+
return await GroupService.getSpecificGroupInfo(groupId);
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
```jsx
|
|
188
|
+
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
|
|
189
|
+
|
|
190
|
+
1. Declare it(or declare them, it is possible to add multiple params)
|
|
191
|
+
|
|
192
|
+
const headers = headers: {Authorization: `Bearer ${yourToken}`}
|
|
193
|
+
|
|
194
|
+
2. Add it inside the brackets and pass it to the function, as shown in the previous example!
|
|
195
|
+
```
|
|
196
|
+
:::
|
|
197
|
+
*/
|
|
198
|
+
class GroupService {
|
|
199
|
+
static getUserGroups(params, config) {
|
|
200
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
201
|
+
return GroupApiClient.getUserGroups(params, config);
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
static searchGroups(params, config) {
|
|
205
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
206
|
+
return GroupApiClient.searchGroups(params, config);
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
static getSpecificGroupInfo(id, config) {
|
|
210
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
211
|
+
return GroupApiClient.getSpecificGroupInfo(id, config);
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
static getGroupFeed(id, params, config) {
|
|
215
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
216
|
+
return GroupApiClient.getGroupFeed(id, params, config);
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
static createGroup(data, config) {
|
|
220
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
221
|
+
return GroupApiClient.createGroup(data, config);
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
static updateGroup(id, data, config) {
|
|
225
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
226
|
+
return GroupApiClient.updateGroup(id, data, config);
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
static patchGroup(id, data, config) {
|
|
230
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
231
|
+
return GroupApiClient.patchGroup(id, data, config);
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
static changeGroupAvatarOrCover(id, data, config) {
|
|
235
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
236
|
+
return GroupApiClient.changeGroupAvatarOrCover(id, data, config);
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
static getGroupMembers(id, params, config) {
|
|
240
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
241
|
+
return GroupApiClient.getGroupMembers(id, params, config);
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
static getGroupSuggestedUsers(id, search, config) {
|
|
245
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
246
|
+
return GroupApiClient.getGroupSuggestedUsers(id, search, config);
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
static getGroupsSuggestedUsers(search, config) {
|
|
250
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
251
|
+
return GroupApiClient.getGroupsSuggestedUsers(search, config);
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
static getGroupInvitedUsers(id, config) {
|
|
255
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
256
|
+
return GroupApiClient.getGroupInvitedUsers(id, config);
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
static subscribeToGroup(id, config) {
|
|
260
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
261
|
+
return GroupApiClient.subscribeToGroup(id, config);
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
static unsubscribeFromGroup(id, config) {
|
|
265
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
266
|
+
return GroupApiClient.unsubscribeFromGroup(id, config);
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
static inviteOrAcceptGroupRequest(id, data, config) {
|
|
270
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
271
|
+
return GroupApiClient.inviteOrAcceptGroupRequest(id, data, config);
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
static getGroupSubscriptionStatus(id, config) {
|
|
275
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
276
|
+
return GroupApiClient.getGroupSubscriptionStatus(id, config);
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
static getGroupWaitingApprovalSubscribers(id, params, config) {
|
|
280
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
281
|
+
return GroupApiClient.getGroupWaitingApprovalSubscribers(id, params, config);
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
exports.default = GroupService;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GroupCreateParams interface
|
|
3
|
+
*/
|
|
4
|
+
import { SCGroupPrivacyType } from '@selfcommunity/types';
|
|
5
|
+
import { BaseGetParams } from './baseParams';
|
|
6
|
+
export interface GroupCreateParams {
|
|
7
|
+
/**
|
|
8
|
+
* A unique name for the group
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* The group privacy
|
|
13
|
+
*/
|
|
14
|
+
privacy: SCGroupPrivacyType;
|
|
15
|
+
/**
|
|
16
|
+
* The group visibility. It is required when privacy = private.
|
|
17
|
+
*/
|
|
18
|
+
visible?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The group description
|
|
21
|
+
*/
|
|
22
|
+
description?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The users to invite to the group
|
|
25
|
+
*/
|
|
26
|
+
invite_users?: number[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* GroupFeedParams interface.
|
|
30
|
+
*/
|
|
31
|
+
export interface GroupFeedParams extends BaseGetParams {
|
|
32
|
+
/**
|
|
33
|
+
* Which field to use when ordering the results.
|
|
34
|
+
*/
|
|
35
|
+
ordering?: string;
|
|
36
|
+
}
|
package/lib/cjs/types/index.d.ts
CHANGED
|
@@ -23,4 +23,5 @@ import { FeatureParams } from './feature';
|
|
|
23
23
|
import { ScoreParams } from './score';
|
|
24
24
|
import { InsightCommonParams, InsightEmbedParams, InsightUserParams, InsightContributionParams } from './insight';
|
|
25
25
|
import { ReactionParams } from './reaction';
|
|
26
|
-
|
|
26
|
+
import { GroupCreateParams, GroupFeedParams } from './group';
|
|
27
|
+
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 };
|