@selfcommunity/api-services 0.7.0-alpha.0 → 0.7.0-alpha.10
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 +105 -0
- package/lib/cjs/index.d.ts +5 -2
- package/lib/cjs/index.js +10 -1
- package/lib/cjs/services/community/index.d.ts +69 -0
- package/lib/cjs/services/community/index.js +74 -0
- package/lib/cjs/services/contact_us/index.d.ts +57 -0
- package/lib/cjs/services/contact_us/index.js +65 -0
- package/lib/cjs/services/custom_menu/index.d.ts +0 -7
- package/lib/cjs/services/custom_menu/index.js +0 -12
- package/lib/cjs/services/feed_object/index.d.ts +28 -1
- package/lib/cjs/services/feed_object/index.js +44 -0
- package/lib/cjs/services/payment/index.d.ts +219 -0
- package/lib/cjs/services/payment/index.js +218 -0
- package/lib/cjs/services/user/index.d.ts +29 -1
- package/lib/cjs/services/user/index.js +43 -0
- package/lib/cjs/types/contactUs.d.ts +25 -0
- package/lib/cjs/types/contactUs.js +5 -0
- package/lib/cjs/types/feedObject.d.ts +17 -0
- package/lib/cjs/types/index.d.ts +4 -2
- package/lib/cjs/types/payment.d.ts +137 -0
- package/lib/cjs/types/payment.js +2 -0
- package/lib/cjs/types/user.d.ts +4 -0
- package/lib/esm/client/index.d.ts +3 -3
- package/lib/esm/client/index.js +3 -3
- package/lib/esm/constants/Endpoints.js +105 -0
- package/lib/esm/index.d.ts +5 -2
- package/lib/esm/index.js +4 -1
- package/lib/esm/services/community/index.d.ts +69 -0
- package/lib/esm/services/community/index.js +69 -0
- package/lib/esm/services/contact_us/index.d.ts +57 -0
- package/lib/esm/services/contact_us/index.js +60 -0
- package/lib/esm/services/custom_menu/index.d.ts +0 -7
- package/lib/esm/services/custom_menu/index.js +0 -12
- package/lib/esm/services/feed_object/index.d.ts +28 -1
- package/lib/esm/services/feed_object/index.js +44 -0
- package/lib/esm/services/payment/index.d.ts +219 -0
- package/lib/esm/services/payment/index.js +213 -0
- package/lib/esm/services/user/index.d.ts +29 -1
- package/lib/esm/services/user/index.js +43 -0
- package/lib/esm/types/contactUs.d.ts +25 -0
- package/lib/esm/types/contactUs.js +4 -0
- package/lib/esm/types/feedObject.d.ts +17 -0
- package/lib/esm/types/index.d.ts +4 -2
- package/lib/esm/types/payment.d.ts +137 -0
- package/lib/esm/types/payment.js +1 -0
- package/lib/esm/types/user.d.ts +4 -0
- package/lib/umd/api-services.js +1 -1
- package/package.json +4 -4
|
@@ -2,17 +2,17 @@ import { AxiosInstance, AxiosResponse } from 'axios';
|
|
|
2
2
|
/**
|
|
3
3
|
* List of all Http methods
|
|
4
4
|
*/
|
|
5
|
-
export type HttpMethod = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
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';
|
|
6
6
|
/**
|
|
7
7
|
* AxiosResponseHeaders interface
|
|
8
8
|
*/
|
|
9
|
-
export type AxiosResponseHeaders = Record<string, string> & {
|
|
9
|
+
export declare type AxiosResponseHeaders = Record<string, string> & {
|
|
10
10
|
'set-cookie'?: string[];
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* General HttpResponse
|
|
14
14
|
*/
|
|
15
|
-
export type HttpResponse<T = unknown, D = any> = AxiosResponse<T, D>;
|
|
15
|
+
export declare type HttpResponse<T = unknown, D = any> = AxiosResponse<T, D>;
|
|
16
16
|
/**
|
|
17
17
|
* Interface for the ApiClient
|
|
18
18
|
*/
|
package/lib/cjs/client/index.js
CHANGED
|
@@ -10,9 +10,6 @@ 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
|
-
}
|
|
16
13
|
constructor(config) {
|
|
17
14
|
/**
|
|
18
15
|
* Set default header
|
|
@@ -54,6 +51,9 @@ class ApiClient {
|
|
|
54
51
|
this.client = this.createClient(config);
|
|
55
52
|
this.setDefaultHeader({ name: 'Content-Type', value: 'application/json', methods: ['post'] });
|
|
56
53
|
}
|
|
54
|
+
createClient(config) {
|
|
55
|
+
return axios_1.default.create(Object.assign(Object.assign(Object.assign({}, (config && config.baseURL && { baseURL: config.baseURL })), (config && config.responseType ? { responseType: config.responseType } : { 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
|
*/
|
|
@@ -154,6 +154,22 @@ const Endpoints = {
|
|
|
154
154
|
url: (0, utils_1.urlReplacer)('/api/v2/$(type)/$(id)/flag/'),
|
|
155
155
|
method: 'POST'
|
|
156
156
|
},
|
|
157
|
+
GetScheduledFeedObjects: {
|
|
158
|
+
url: (0, utils_1.urlReplacer)('/api/v2/$(type)/scheduled/'),
|
|
159
|
+
method: 'GET'
|
|
160
|
+
},
|
|
161
|
+
PublishFeedObject: {
|
|
162
|
+
url: (0, utils_1.urlReplacer)('/api/v2/$(type)/$(id)/publish/'),
|
|
163
|
+
method: 'POST'
|
|
164
|
+
},
|
|
165
|
+
GetDraftedFeedObjects: {
|
|
166
|
+
url: (0, utils_1.urlReplacer)('/api/v2/$(type)/drafted/'),
|
|
167
|
+
method: 'GET'
|
|
168
|
+
},
|
|
169
|
+
GetDownloadCSV: {
|
|
170
|
+
url: (0, utils_1.urlReplacer)('/api/v2/$(type)/$(id)/export/'),
|
|
171
|
+
method: 'GET'
|
|
172
|
+
},
|
|
157
173
|
/**
|
|
158
174
|
* Comments
|
|
159
175
|
*/
|
|
@@ -317,6 +333,10 @@ const Endpoints = {
|
|
|
317
333
|
url: (0, utils_1.urlReplacer)('/api/v2/user/'),
|
|
318
334
|
method: 'GET'
|
|
319
335
|
},
|
|
336
|
+
UserMatchUsernames: {
|
|
337
|
+
url: (0, utils_1.urlReplacer)('/api/v2/user/match/'),
|
|
338
|
+
method: 'POST'
|
|
339
|
+
},
|
|
320
340
|
ListHiddenUsers: {
|
|
321
341
|
url: (0, utils_1.urlReplacer)('/api/v2/user/hidden_users/'),
|
|
322
342
|
method: 'GET'
|
|
@@ -521,6 +541,14 @@ const Endpoints = {
|
|
|
521
541
|
url: (0, utils_1.urlReplacer)('/api/v2/user/$(id)/live_stream/'),
|
|
522
542
|
method: 'GET'
|
|
523
543
|
},
|
|
544
|
+
GetOrderHistory: {
|
|
545
|
+
url: (0, utils_1.urlReplacer)('/api/v2/user/$(id)/order/'),
|
|
546
|
+
method: 'GET'
|
|
547
|
+
},
|
|
548
|
+
GetOrderDetail: {
|
|
549
|
+
url: (0, utils_1.urlReplacer)('/api/v2/user/$(id)/order/$(order)/'),
|
|
550
|
+
method: 'GET'
|
|
551
|
+
},
|
|
524
552
|
/**
|
|
525
553
|
* Broadcast Messages
|
|
526
554
|
*/
|
|
@@ -1572,6 +1600,83 @@ const Endpoints = {
|
|
|
1572
1600
|
GetUserJoinedCourses: {
|
|
1573
1601
|
url: (0, utils_1.urlReplacer)('/api/v2/user/$(id)/courses/'),
|
|
1574
1602
|
method: 'GET'
|
|
1603
|
+
},
|
|
1604
|
+
/**
|
|
1605
|
+
* Community
|
|
1606
|
+
*/
|
|
1607
|
+
GetCommunities: {
|
|
1608
|
+
url: (0, utils_1.urlReplacer)('/api/v2/community/'),
|
|
1609
|
+
method: 'GET'
|
|
1610
|
+
},
|
|
1611
|
+
GetCommunity: {
|
|
1612
|
+
url: (0, utils_1.urlReplacer)('/api/v2/community/$(id)/'),
|
|
1613
|
+
method: 'GET'
|
|
1614
|
+
},
|
|
1615
|
+
/**
|
|
1616
|
+
* Payments/Paywalls
|
|
1617
|
+
*/
|
|
1618
|
+
GetPaymentContentStatus: {
|
|
1619
|
+
url: (0, utils_1.urlReplacer)('/api/v2/payments/content_status/'),
|
|
1620
|
+
method: 'GET'
|
|
1621
|
+
},
|
|
1622
|
+
GetPaywalls: {
|
|
1623
|
+
url: (0, utils_1.urlReplacer)('/api/v2/payments/paywall/'),
|
|
1624
|
+
method: 'GET'
|
|
1625
|
+
},
|
|
1626
|
+
GetPaywall: {
|
|
1627
|
+
url: (0, utils_1.urlReplacer)('/api/v2/payments/paywall/$(id)/'),
|
|
1628
|
+
method: 'GET'
|
|
1629
|
+
},
|
|
1630
|
+
GetPaymentProducts: {
|
|
1631
|
+
url: (0, utils_1.urlReplacer)('/api/v2/payments/payment_product/'),
|
|
1632
|
+
method: 'GET'
|
|
1633
|
+
},
|
|
1634
|
+
GetPaymentProduct: {
|
|
1635
|
+
url: (0, utils_1.urlReplacer)('/api/v2/payments/payment_product/$(id)/'),
|
|
1636
|
+
method: 'GET'
|
|
1637
|
+
},
|
|
1638
|
+
GetPaymentProductPrices: {
|
|
1639
|
+
url: (0, utils_1.urlReplacer)('/api/v2/payments/payment_product/$(id)/'),
|
|
1640
|
+
method: 'GET'
|
|
1641
|
+
},
|
|
1642
|
+
GetCheckoutSession: {
|
|
1643
|
+
url: (0, utils_1.urlReplacer)('/api/v2/payments/checkout_session/'),
|
|
1644
|
+
method: 'GET'
|
|
1645
|
+
},
|
|
1646
|
+
CheckoutCreateSession: {
|
|
1647
|
+
url: (0, utils_1.urlReplacer)('/api/v2/payments/checkout_session/'),
|
|
1648
|
+
method: 'POST'
|
|
1649
|
+
},
|
|
1650
|
+
CheckoutSessionComplete: {
|
|
1651
|
+
url: (0, utils_1.urlReplacer)('/api/v2/payments/checkout_session/complete/'),
|
|
1652
|
+
method: 'POST'
|
|
1653
|
+
},
|
|
1654
|
+
GetPaymentOrders: {
|
|
1655
|
+
url: (0, utils_1.urlReplacer)('/api/v2/payments/payment_order/'),
|
|
1656
|
+
method: 'GET'
|
|
1657
|
+
},
|
|
1658
|
+
GetPaymentOrder: {
|
|
1659
|
+
url: (0, utils_1.urlReplacer)('/api/v2/payments/payment_order/$(id)/'),
|
|
1660
|
+
method: 'GET'
|
|
1661
|
+
},
|
|
1662
|
+
GetPaymentOrderPdf: {
|
|
1663
|
+
url: (0, utils_1.urlReplacer)('/api/v2/payments/payment_order/$(id)/pdf/'),
|
|
1664
|
+
method: 'GET'
|
|
1665
|
+
},
|
|
1666
|
+
CreateCustomerPortalSession: {
|
|
1667
|
+
url: (0, utils_1.urlReplacer)('/api/v2/payments/customer_portal_session/'),
|
|
1668
|
+
method: 'POST'
|
|
1669
|
+
},
|
|
1670
|
+
CreatePaymentProduct: {
|
|
1671
|
+
url: (0, utils_1.urlReplacer)('/api/v2/payments/payment_product/price/'),
|
|
1672
|
+
method: 'POST'
|
|
1673
|
+
},
|
|
1674
|
+
/**
|
|
1675
|
+
* Contact-us Endpoints
|
|
1676
|
+
*/
|
|
1677
|
+
ContactRequest: {
|
|
1678
|
+
url: (0, utils_1.urlReplacer)('/api/v2/contact/request/'),
|
|
1679
|
+
method: 'POST'
|
|
1575
1680
|
}
|
|
1576
1681
|
};
|
|
1577
1682
|
exports.default = Endpoints;
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -51,11 +51,14 @@ import EventService, { EventApiClient, EventApiClientInterface } from './service
|
|
|
51
51
|
import LiveStreamService, { LiveStreamApiClient, LiveStreamApiClientInterface } from './services/live_stream';
|
|
52
52
|
import OnBoardingService, { OnBoardingApiClient, OnBoardingApiClientInterface } from './services/onboarding';
|
|
53
53
|
import CourseService, { CourseApiClient, CourseApiClientInterface } from './services/course';
|
|
54
|
+
import PaymentService, { PaymentApiClient, PaymentApiClientInterface } from './services/payment';
|
|
55
|
+
import CommunityService, { CommunityApiClient, CommunityApiClientInterface } from './services/community';
|
|
56
|
+
import ContactUsService, { ContactUsApiClient, ContactUsApiClientInterface } from './services/contact_us';
|
|
54
57
|
/**
|
|
55
58
|
* Types
|
|
56
59
|
*/
|
|
57
|
-
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, CourseCreateParams, CourseSearchParams, CourseInfoViewType, CourseInfoParams, CourseLessonCommentsParams, CourseUserRoleParams, CourseUsersParams, CourseDashboardUsersParams } from './types';
|
|
60
|
+
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, ScheduledFeedObjParams, FeedParams, LegalPageFilterParams, FeatureParams, ScoreParams, InsightContributionParams, InsightUserParams, InsightEmbedParams, InsightCommonParams, ReactionParams, GroupCreateParams, GroupFeedParams, EventCreateParams, EventFeedParams, EventSearchParams, LiveStreamCreateParams, LiveStreamSearchParams, LiveStreamRemoveParticipantParams, StartStepParams, OnBoardingStep, CourseCreateParams, CourseSearchParams, CourseInfoViewType, CourseInfoParams, CourseLessonCommentsParams, CourseUserRoleParams, CourseUsersParams, CourseDashboardUsersParams, PaymentContentStatusParams, PaymentContentStatus, PaymentProductsParams, CustomerPortalCreateSessionParams, CheckoutSessionParams, CheckoutCreateSessionParams, PaymentOrderParams, ContactUsRequestParams } from './types';
|
|
58
61
|
/**
|
|
59
62
|
* Export all
|
|
60
63
|
*/
|
|
61
|
-
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, CourseCreateParams, CourseSearchParams, CourseInfoParams, CourseInfoViewType, CourseService, CourseApiClientInterface, CourseApiClient, CourseLessonCommentsParams, CourseUserRoleParams, CourseUsersParams, CourseDashboardUsersParams };
|
|
64
|
+
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, ScheduledFeedObjParams, 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, CourseCreateParams, CourseSearchParams, CourseInfoParams, CourseInfoViewType, CourseService, CourseApiClientInterface, CourseApiClient, CourseLessonCommentsParams, CourseUserRoleParams, CourseUsersParams, CourseDashboardUsersParams, PaymentService, PaymentApiClientInterface, PaymentApiClient, CommunityService, CommunityApiClient, CommunityApiClientInterface, PaymentContentStatusParams, PaymentContentStatus, PaymentProductsParams, CustomerPortalCreateSessionParams, CheckoutSessionParams, CheckoutCreateSessionParams, PaymentOrderParams, ContactUsRequestParams, ContactUsService, ContactUsApiClient, ContactUsApiClientInterface };
|
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.CourseApiClient = exports.CourseService = exports.CourseInfoViewType = 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;
|
|
4
|
+
exports.ContactUsApiClient = exports.ContactUsService = exports.CommunityApiClient = exports.CommunityService = exports.PaymentApiClient = exports.PaymentService = exports.CourseApiClient = exports.CourseService = exports.CourseInfoViewType = 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
|
|
@@ -135,6 +135,15 @@ Object.defineProperty(exports, "OnBoardingApiClient", { enumerable: true, get: f
|
|
|
135
135
|
const course_1 = tslib_1.__importStar(require("./services/course"));
|
|
136
136
|
exports.CourseService = course_1.default;
|
|
137
137
|
Object.defineProperty(exports, "CourseApiClient", { enumerable: true, get: function () { return course_1.CourseApiClient; } });
|
|
138
|
+
const payment_1 = tslib_1.__importStar(require("./services/payment"));
|
|
139
|
+
exports.PaymentService = payment_1.default;
|
|
140
|
+
Object.defineProperty(exports, "PaymentApiClient", { enumerable: true, get: function () { return payment_1.PaymentApiClient; } });
|
|
141
|
+
const community_1 = tslib_1.__importStar(require("./services/community"));
|
|
142
|
+
exports.CommunityService = community_1.default;
|
|
143
|
+
Object.defineProperty(exports, "CommunityApiClient", { enumerable: true, get: function () { return community_1.CommunityApiClient; } });
|
|
144
|
+
const contact_us_1 = tslib_1.__importStar(require("./services/contact_us"));
|
|
145
|
+
exports.ContactUsService = contact_us_1.default;
|
|
146
|
+
Object.defineProperty(exports, "ContactUsApiClient", { enumerable: true, get: function () { return contact_us_1.ContactUsApiClient; } });
|
|
138
147
|
/**
|
|
139
148
|
* Types
|
|
140
149
|
*/
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import { BaseGetParams, SCPaginatedResponse } from '../../types';
|
|
3
|
+
import { SCCommunityType } from '@selfcommunity/types';
|
|
4
|
+
export interface CommunityApiClientInterface {
|
|
5
|
+
/**
|
|
6
|
+
* Get list of communities. Used to get the payment products related to the community (aka paywalls)
|
|
7
|
+
* @param params
|
|
8
|
+
* @param config
|
|
9
|
+
*/
|
|
10
|
+
getCommunities(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCommunityType>>;
|
|
11
|
+
/**
|
|
12
|
+
* Get Community
|
|
13
|
+
* @param id
|
|
14
|
+
* @param config
|
|
15
|
+
*/
|
|
16
|
+
getCommunity(id: number | string, config?: AxiosRequestConfig): Promise<SCCommunityType>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Contains all the endpoints needed to manage payments.
|
|
20
|
+
*/
|
|
21
|
+
export declare class CommunityApiClient {
|
|
22
|
+
/**
|
|
23
|
+
* Get list of communities. Used to get the payment products related to the community (aka paywalls)
|
|
24
|
+
* @param params
|
|
25
|
+
* @param config
|
|
26
|
+
*/
|
|
27
|
+
static getCommunities(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCommunityType>>;
|
|
28
|
+
/**
|
|
29
|
+
* Get Community
|
|
30
|
+
* @param id
|
|
31
|
+
* @param config
|
|
32
|
+
*/
|
|
33
|
+
static getCommunity(id: number | string, config?: AxiosRequestConfig): Promise<SCCommunityType>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* :::tip Community service can be used in the following way:
|
|
38
|
+
*
|
|
39
|
+
* 1. Import the service from our library:
|
|
40
|
+
*
|
|
41
|
+
* ```ts
|
|
42
|
+
* import {CommunityService} from "@selfcommunity/api-services";
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* 2. Create a function and put the service inside it! The async function `getCommunities`
|
|
46
|
+
* will return the events matching the search query.
|
|
47
|
+
*
|
|
48
|
+
* ```ts
|
|
49
|
+
* async function getCommunities() {
|
|
50
|
+
* return await CommunityService.getCommunities({...});
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
|
|
55
|
+
*
|
|
56
|
+
* 1. Declare it (or declare multiple params):
|
|
57
|
+
*
|
|
58
|
+
* ```ts
|
|
59
|
+
* const headers = { Authorization: `Bearer ${yourToken}` };
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* 2. Add it inside the brackets and pass it to the function, as shown in the previous example!
|
|
63
|
+
*
|
|
64
|
+
* :::
|
|
65
|
+
*/
|
|
66
|
+
export default class CommunityService {
|
|
67
|
+
static getCommunities(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCommunityType>>;
|
|
68
|
+
static getPaymentProduct(id: number | string, config?: AxiosRequestConfig): Promise<SCCommunityType>;
|
|
69
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommunityApiClient = 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 payments.
|
|
10
|
+
*/
|
|
11
|
+
class CommunityApiClient {
|
|
12
|
+
/**
|
|
13
|
+
* Get list of communities. Used to get the payment products related to the community (aka paywalls)
|
|
14
|
+
* @param params
|
|
15
|
+
* @param config
|
|
16
|
+
*/
|
|
17
|
+
static getCommunities(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.GetCommunities.url({})}?${p.toString()}`, method: Endpoints_1.default.GetCommunities.method }));
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get Community
|
|
23
|
+
* @param id
|
|
24
|
+
* @param config
|
|
25
|
+
*/
|
|
26
|
+
static getCommunity(id, config) {
|
|
27
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.GetCommunity.url({ id }), method: Endpoints_1.default.GetCommunity.method }));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.CommunityApiClient = CommunityApiClient;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* :::tip Community service can be used in the following way:
|
|
34
|
+
*
|
|
35
|
+
* 1. Import the service from our library:
|
|
36
|
+
*
|
|
37
|
+
* ```ts
|
|
38
|
+
* import {CommunityService} from "@selfcommunity/api-services";
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* 2. Create a function and put the service inside it! The async function `getCommunities`
|
|
42
|
+
* will return the events matching the search query.
|
|
43
|
+
*
|
|
44
|
+
* ```ts
|
|
45
|
+
* async function getCommunities() {
|
|
46
|
+
* return await CommunityService.getCommunities({...});
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
|
|
51
|
+
*
|
|
52
|
+
* 1. Declare it (or declare multiple params):
|
|
53
|
+
*
|
|
54
|
+
* ```ts
|
|
55
|
+
* const headers = { Authorization: `Bearer ${yourToken}` };
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* 2. Add it inside the brackets and pass it to the function, as shown in the previous example!
|
|
59
|
+
*
|
|
60
|
+
* :::
|
|
61
|
+
*/
|
|
62
|
+
class CommunityService {
|
|
63
|
+
static getCommunities(params, config) {
|
|
64
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
return CommunityApiClient.getCommunities(params, config);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
static getPaymentProduct(id, config) {
|
|
69
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
return CommunityApiClient.getCommunity(id, config);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.default = CommunityService;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ContactUsRequestParams } from '../../types';
|
|
2
|
+
import { type SCContactUsRequestType } from '@selfcommunity/types';
|
|
3
|
+
import { AxiosRequestConfig } from 'axios';
|
|
4
|
+
export interface ContactUsApiClientInterface {
|
|
5
|
+
request(data?: ContactUsRequestParams, config?: AxiosRequestConfig): Promise<SCContactUsRequestType>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Contains all the endpoints needed to contact-us.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ContactUsApiClient {
|
|
11
|
+
/**
|
|
12
|
+
* This endpoint create an contact request.
|
|
13
|
+
*
|
|
14
|
+
* It requires an authenticated user.
|
|
15
|
+
*
|
|
16
|
+
* @param data
|
|
17
|
+
* @param config
|
|
18
|
+
*/
|
|
19
|
+
static request(data?: ContactUsRequestParams, config?: AxiosRequestConfig): Promise<SCContactUsRequestType>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
:::tip Contact service can be used in the following way:
|
|
24
|
+
```jsx
|
|
25
|
+
1. Import the service from our library:
|
|
26
|
+
|
|
27
|
+
import {ContactService} from "@selfcommunity/api-services";
|
|
28
|
+
```
|
|
29
|
+
```jsx
|
|
30
|
+
2. Create a function and put the service inside it!
|
|
31
|
+
The async function `create` will return the paginated list of categories.
|
|
32
|
+
|
|
33
|
+
async create() {
|
|
34
|
+
return await ContactService.request();
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
```jsx
|
|
38
|
+
In case of required `params`, just add them inside the brackets.
|
|
39
|
+
|
|
40
|
+
async request(data) {
|
|
41
|
+
return await ContactService.request(data);
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
```jsx
|
|
45
|
+
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
|
|
46
|
+
|
|
47
|
+
1. Declare it(or declare them, it is possible to add multiple params)
|
|
48
|
+
|
|
49
|
+
const headers = headers: {Authorization: `Bearer ${yourToken}`}
|
|
50
|
+
|
|
51
|
+
2. Add it inside the brackets and pass it to the function, as shown in the previous example!
|
|
52
|
+
```
|
|
53
|
+
:::
|
|
54
|
+
*/
|
|
55
|
+
export default class ContactUsService {
|
|
56
|
+
static request(data?: ContactUsRequestParams, config?: AxiosRequestConfig): Promise<SCContactUsRequestType>;
|
|
57
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContactUsApiClient = 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
|
+
/**
|
|
8
|
+
* Contains all the endpoints needed to contact-us.
|
|
9
|
+
*/
|
|
10
|
+
class ContactUsApiClient {
|
|
11
|
+
/**
|
|
12
|
+
* This endpoint create an contact request.
|
|
13
|
+
*
|
|
14
|
+
* It requires an authenticated user.
|
|
15
|
+
*
|
|
16
|
+
* @param data
|
|
17
|
+
* @param config
|
|
18
|
+
*/
|
|
19
|
+
static request(data, config) {
|
|
20
|
+
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { data, url: Endpoints_1.default.ContactRequest.url({}), method: Endpoints_1.default.ContactRequest.method }));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.ContactUsApiClient = ContactUsApiClient;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
:::tip Contact service can be used in the following way:
|
|
27
|
+
```jsx
|
|
28
|
+
1. Import the service from our library:
|
|
29
|
+
|
|
30
|
+
import {ContactService} from "@selfcommunity/api-services";
|
|
31
|
+
```
|
|
32
|
+
```jsx
|
|
33
|
+
2. Create a function and put the service inside it!
|
|
34
|
+
The async function `create` will return the paginated list of categories.
|
|
35
|
+
|
|
36
|
+
async create() {
|
|
37
|
+
return await ContactService.request();
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
```jsx
|
|
41
|
+
In case of required `params`, just add them inside the brackets.
|
|
42
|
+
|
|
43
|
+
async request(data) {
|
|
44
|
+
return await ContactService.request(data);
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
```jsx
|
|
48
|
+
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
|
|
49
|
+
|
|
50
|
+
1. Declare it(or declare them, it is possible to add multiple params)
|
|
51
|
+
|
|
52
|
+
const headers = headers: {Authorization: `Bearer ${yourToken}`}
|
|
53
|
+
|
|
54
|
+
2. Add it inside the brackets and pass it to the function, as shown in the previous example!
|
|
55
|
+
```
|
|
56
|
+
:::
|
|
57
|
+
*/
|
|
58
|
+
class ContactUsService {
|
|
59
|
+
static request(data, config) {
|
|
60
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
return ContactUsApiClient.request(data, config);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.default = ContactUsService;
|
|
@@ -4,7 +4,6 @@ import { AxiosRequestConfig } from 'axios';
|
|
|
4
4
|
export interface CustomMenuApiClientInterface {
|
|
5
5
|
getASpecificCustomMenu(id: number | string, config?: AxiosRequestConfig): Promise<SCCustomMenuType>;
|
|
6
6
|
getAllCustomMenus(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCustomMenuType>>;
|
|
7
|
-
getBaseCustomMenu(config?: AxiosRequestConfig): Promise<SCCustomMenuType>;
|
|
8
7
|
searchCustomMenus(params?: BaseSearchParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCustomMenuType>>;
|
|
9
8
|
}
|
|
10
9
|
/**
|
|
@@ -23,11 +22,6 @@ export declare class CustomMenuApiClient {
|
|
|
23
22
|
* @param config
|
|
24
23
|
*/
|
|
25
24
|
static getAllCustomMenus(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCustomMenuType>>;
|
|
26
|
-
/**
|
|
27
|
-
* This endpoint retrieves the base custom menu.
|
|
28
|
-
* @param config
|
|
29
|
-
*/
|
|
30
|
-
static getBaseCustomMenu(config?: AxiosRequestConfig): Promise<SCCustomMenuType>;
|
|
31
25
|
/**
|
|
32
26
|
* This endpoint performs search of a Custom Menu
|
|
33
27
|
* @param params
|
|
@@ -73,6 +67,5 @@ export declare class CustomMenuApiClient {
|
|
|
73
67
|
export default class CustomMenuService {
|
|
74
68
|
static getASpecificCustomMenu(id: number | string, config?: AxiosRequestConfig): Promise<SCCustomMenuType>;
|
|
75
69
|
static getAllCustomMenus(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCustomMenuType>>;
|
|
76
|
-
static getBaseCustomMenu(config?: AxiosRequestConfig): Promise<SCCustomMenuType>;
|
|
77
70
|
static searchCustomMenus(params?: BaseSearchParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCustomMenuType>>;
|
|
78
71
|
}
|
|
@@ -26,13 +26,6 @@ class CustomMenuApiClient {
|
|
|
26
26
|
const p = (0, url_1.urlParams)(params);
|
|
27
27
|
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: `${Endpoints_1.default.GetCustomMenus.url({})}?${p.toString()}`, method: Endpoints_1.default.GetCustomMenus.method }));
|
|
28
28
|
}
|
|
29
|
-
/**
|
|
30
|
-
* This endpoint retrieves the base custom menu.
|
|
31
|
-
* @param config
|
|
32
|
-
*/
|
|
33
|
-
static getBaseCustomMenu(config) {
|
|
34
|
-
return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.CustomMenu.url({ id: 'base' }), method: Endpoints_1.default.CustomMenu.method }));
|
|
35
|
-
}
|
|
36
29
|
/**
|
|
37
30
|
* This endpoint performs search of a Custom Menu
|
|
38
31
|
* @param params
|
|
@@ -90,11 +83,6 @@ class CustomMenuService {
|
|
|
90
83
|
return CustomMenuApiClient.getAllCustomMenus(params, config);
|
|
91
84
|
});
|
|
92
85
|
}
|
|
93
|
-
static getBaseCustomMenu(config) {
|
|
94
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
95
|
-
return CustomMenuApiClient.getBaseCustomMenu(config);
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
86
|
static searchCustomMenus(params, config) {
|
|
99
87
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
100
88
|
return CustomMenuApiClient.searchCustomMenus(params, config);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseGetParams, BaseSearchParams, FeedObjCreateParams, FeedObjectPollVotesSearch, FeedObjGetParams, SCPaginatedResponse } from '../../types';
|
|
1
|
+
import { BaseGetParams, BaseSearchParams, FeedObjCreateParams, FeedObjectPollVotesSearch, FeedObjGetParams, SCPaginatedResponse, ScheduledFeedObjParams } from '../../types';
|
|
2
2
|
import { SCContributionType, SCFeedObjectFollowingStatusType, SCFeedObjectHideStatusType, SCFeedObjectSuspendedStatusType, SCFeedObjectType, SCFlagType, SCFlagTypeEnum, SCPollVoteType, SCUserType, SCVoteType } from '@selfcommunity/types';
|
|
3
3
|
import { AxiosRequestConfig } from 'axios';
|
|
4
4
|
export interface FeedObjectApiClientInterface {
|
|
@@ -29,6 +29,9 @@ export interface FeedObjectApiClientInterface {
|
|
|
29
29
|
feedObjectFlagStatus(type: Exclude<SCContributionType, SCContributionType.COMMENT>, id: number | string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCFlagType>>;
|
|
30
30
|
hideFeedObject(type: Exclude<SCContributionType, SCContributionType.COMMENT>, id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
31
31
|
feedObjectHideStatus(type: Exclude<SCContributionType, SCContributionType.COMMENT>, id: number | string, config?: AxiosRequestConfig): Promise<SCFeedObjectHideStatusType>;
|
|
32
|
+
feedObjectScheduledList(type: Exclude<SCContributionType, SCContributionType.COMMENT>, params?: ScheduledFeedObjParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCFeedObjectType>>;
|
|
33
|
+
feedObjectDraftedList(type: Exclude<SCContributionType, SCContributionType.COMMENT>, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCFeedObjectType>>;
|
|
34
|
+
publishFeedObject(type: Exclude<SCContributionType, SCContributionType.COMMENT>, id: number | string, config?: AxiosRequestConfig): Promise<SCFeedObjectType>;
|
|
32
35
|
}
|
|
33
36
|
/**
|
|
34
37
|
* Contains all the endpoints needed to manage feed objs (discussions-posts-statuses).
|
|
@@ -233,6 +236,27 @@ export declare class FeedObjectApiClient {
|
|
|
233
236
|
* @param config
|
|
234
237
|
*/
|
|
235
238
|
static feedObjectHideStatus(type: Exclude<SCContributionType, SCContributionType.COMMENT>, id: number | string, config?: AxiosRequestConfig): Promise<SCFeedObjectHideStatusType>;
|
|
239
|
+
/**
|
|
240
|
+
* This endpoint retrieves the list of scheduled feed objects
|
|
241
|
+
* @param type
|
|
242
|
+
* @param params
|
|
243
|
+
* @param config
|
|
244
|
+
*/
|
|
245
|
+
static feedObjectScheduledList(type: Exclude<SCContributionType, SCContributionType.COMMENT>, params?: ScheduledFeedObjParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCFeedObjectType>>;
|
|
246
|
+
/**
|
|
247
|
+
* This endpoint retrieves the list of drafted feed objects
|
|
248
|
+
* @param type
|
|
249
|
+
* @param params
|
|
250
|
+
* @param config
|
|
251
|
+
*/
|
|
252
|
+
static feedObjectDraftedList(type: Exclude<SCContributionType, SCContributionType.COMMENT>, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCFeedObjectType>>;
|
|
253
|
+
/**
|
|
254
|
+
* This endpoint publishes a drafted or scheduled the feed obj.
|
|
255
|
+
* @param type
|
|
256
|
+
* @param id
|
|
257
|
+
* @param config
|
|
258
|
+
*/
|
|
259
|
+
static publishFeedObject(type: Exclude<SCContributionType, SCContributionType.COMMENT>, id: number | string, config?: AxiosRequestConfig): Promise<SCFeedObjectType>;
|
|
236
260
|
}
|
|
237
261
|
/**
|
|
238
262
|
*
|
|
@@ -290,4 +314,7 @@ export default class FeedObjectService {
|
|
|
290
314
|
static feedObjectFlagStatus(type: Exclude<SCContributionType, SCContributionType.COMMENT>, id: number | string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCFlagType>>;
|
|
291
315
|
static hideFeedObject(type: Exclude<SCContributionType, SCContributionType.COMMENT>, id: number | string, config?: AxiosRequestConfig): Promise<any>;
|
|
292
316
|
static feedObjectHideStatus(type: Exclude<SCContributionType, SCContributionType.COMMENT>, id: number | string, config?: AxiosRequestConfig): Promise<SCFeedObjectHideStatusType>;
|
|
317
|
+
static feedObjectScheduledList(type: Exclude<SCContributionType, SCContributionType.COMMENT>, params?: ScheduledFeedObjParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCFeedObjectType>>;
|
|
318
|
+
static feedObjectDraftedList(type: Exclude<SCContributionType, SCContributionType.COMMENT>, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCFeedObjectType>>;
|
|
319
|
+
static publishFeedObject(type: Exclude<SCContributionType, SCContributionType.COMMENT>, id: number | string, config?: AxiosRequestConfig): Promise<SCFeedObjectType>;
|
|
293
320
|
}
|