@selfcommunity/api-services 0.7.0-alpha.2 → 0.7.0-alpha.3
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 +11 -1
- package/lib/cjs/index.d.ts +3 -2
- package/lib/cjs/index.js +4 -1
- 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/types/contactUs.d.ts +25 -0
- package/lib/cjs/types/contactUs.js +5 -0
- package/lib/cjs/types/index.d.ts +2 -1
- package/lib/esm/constants/Endpoints.js +11 -1
- package/lib/esm/index.d.ts +3 -2
- package/lib/esm/index.js +2 -1
- 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/types/contactUs.d.ts +25 -0
- package/lib/esm/types/contactUs.js +4 -0
- package/lib/esm/types/index.d.ts +2 -1
- package/lib/umd/956.js +2 -0
- package/lib/umd/api-services.js +1 -1
- package/package.json +4 -4
- package/lib/umd/740.js +0 -2
- /package/lib/umd/{740.js.LICENSE.txt → 956.js.LICENSE.txt} +0 -0
|
@@ -1663,6 +1663,16 @@ const Endpoints = {
|
|
|
1663
1663
|
url: (0, utils_1.urlReplacer)('/api/v2/payments/customer_portal_session/'),
|
|
1664
1664
|
method: 'POST'
|
|
1665
1665
|
},
|
|
1666
|
-
CreatePaymentProduct: {
|
|
1666
|
+
CreatePaymentProduct: {
|
|
1667
|
+
url: (0, utils_1.urlReplacer)('/api/v2/payments/payment_product/price/'),
|
|
1668
|
+
method: 'POST'
|
|
1669
|
+
},
|
|
1670
|
+
/**
|
|
1671
|
+
* Contact-us Endpoints
|
|
1672
|
+
*/
|
|
1673
|
+
ContactRequest: {
|
|
1674
|
+
url: (0, utils_1.urlReplacer)('/api/v2/contact/request/'),
|
|
1675
|
+
method: 'POST'
|
|
1676
|
+
}
|
|
1667
1677
|
};
|
|
1668
1678
|
exports.default = Endpoints;
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -53,11 +53,12 @@ import OnBoardingService, { OnBoardingApiClient, OnBoardingApiClientInterface }
|
|
|
53
53
|
import CourseService, { CourseApiClient, CourseApiClientInterface } from './services/course';
|
|
54
54
|
import PaymentService, { PaymentApiClient, PaymentApiClientInterface } from './services/payment';
|
|
55
55
|
import CommunityService, { CommunityApiClient, CommunityApiClientInterface } from './services/community';
|
|
56
|
+
import ContactUsService, { ContactUsApiClient, ContactUsApiClientInterface } from './services/contact_us';
|
|
56
57
|
/**
|
|
57
58
|
* Types
|
|
58
59
|
*/
|
|
59
|
-
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 } 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';
|
|
60
61
|
/**
|
|
61
62
|
* Export all
|
|
62
63
|
*/
|
|
63
|
-
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 };
|
|
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.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;
|
|
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
|
|
@@ -141,6 +141,9 @@ Object.defineProperty(exports, "PaymentApiClient", { enumerable: true, get: func
|
|
|
141
141
|
const community_1 = tslib_1.__importStar(require("./services/community"));
|
|
142
142
|
exports.CommunityService = community_1.default;
|
|
143
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; } });
|
|
144
147
|
/**
|
|
145
148
|
* Types
|
|
146
149
|
*/
|
|
@@ -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);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ContactUsRequestParams interface
|
|
3
|
+
*/
|
|
4
|
+
export interface ContactUsRequestParams {
|
|
5
|
+
/**
|
|
6
|
+
* name field for the account
|
|
7
|
+
*/
|
|
8
|
+
name?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Surname field for the account
|
|
11
|
+
*/
|
|
12
|
+
surname?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Email field for the account
|
|
15
|
+
*/
|
|
16
|
+
email?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Contact request text
|
|
19
|
+
*/
|
|
20
|
+
body?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Any other properties available in user_metadata_definition
|
|
23
|
+
*/
|
|
24
|
+
[p: string]: any;
|
|
25
|
+
}
|
package/lib/cjs/types/index.d.ts
CHANGED
|
@@ -29,4 +29,5 @@ import { LiveStreamCreateParams, LiveStreamSearchParams, LiveStreamRemovePartici
|
|
|
29
29
|
import { StartStepParams, OnBoardingStep } from './onBoarding';
|
|
30
30
|
import { CourseCreateParams, CourseSearchParams, CourseInfoViewType, CourseInfoParams, CourseLessonCommentsParams, CourseUserRoleParams, CourseUsersParams, CourseDashboardUsersParams } from './course';
|
|
31
31
|
import { PaymentContentStatusParams, PaymentContentStatus, PaymentProductsParams, CustomerPortalCreateSessionParams, CheckoutSessionParams, CheckoutCreateSessionParams, PaymentOrderParams } from './payment';
|
|
32
|
-
|
|
32
|
+
import { ContactUsRequestParams } from './contactUs';
|
|
33
|
+
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, ScheduledFeedObjParams, FeedParams, LegalPageFilterParams, FeatureParams, ScoreParams, InsightContributionParams, InsightUserParams, InsightEmbedParams, InsightCommonParams, ReactionParams, GroupCreateParams, GroupFeedParams, EventCreateParams, EventFeedParams, EventRelatedParams, EventSearchParams, LiveStreamCreateParams, LiveStreamSearchParams, LiveStreamRemoveParticipantParams, StartStepParams, OnBoardingStep, CourseCreateParams, CourseSearchParams, CourseInfoViewType, CourseInfoParams, CourseLessonCommentsParams, CourseUserRoleParams, CourseUsersParams, CourseDashboardUsersParams, PaymentContentStatusParams, PaymentContentStatus, PaymentProductsParams, CustomerPortalCreateSessionParams, CheckoutSessionParams, CheckoutCreateSessionParams, PaymentOrderParams, ContactUsRequestParams };
|
|
@@ -1661,6 +1661,16 @@ const Endpoints = {
|
|
|
1661
1661
|
url: urlReplacer('/api/v2/payments/customer_portal_session/'),
|
|
1662
1662
|
method: 'POST'
|
|
1663
1663
|
},
|
|
1664
|
-
CreatePaymentProduct: {
|
|
1664
|
+
CreatePaymentProduct: {
|
|
1665
|
+
url: urlReplacer('/api/v2/payments/payment_product/price/'),
|
|
1666
|
+
method: 'POST'
|
|
1667
|
+
},
|
|
1668
|
+
/**
|
|
1669
|
+
* Contact-us Endpoints
|
|
1670
|
+
*/
|
|
1671
|
+
ContactRequest: {
|
|
1672
|
+
url: urlReplacer('/api/v2/contact/request/'),
|
|
1673
|
+
method: 'POST'
|
|
1674
|
+
}
|
|
1665
1675
|
};
|
|
1666
1676
|
export default Endpoints;
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -53,11 +53,12 @@ import OnBoardingService, { OnBoardingApiClient, OnBoardingApiClientInterface }
|
|
|
53
53
|
import CourseService, { CourseApiClient, CourseApiClientInterface } from './services/course';
|
|
54
54
|
import PaymentService, { PaymentApiClient, PaymentApiClientInterface } from './services/payment';
|
|
55
55
|
import CommunityService, { CommunityApiClient, CommunityApiClientInterface } from './services/community';
|
|
56
|
+
import ContactUsService, { ContactUsApiClient, ContactUsApiClientInterface } from './services/contact_us';
|
|
56
57
|
/**
|
|
57
58
|
* Types
|
|
58
59
|
*/
|
|
59
|
-
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 } 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';
|
|
60
61
|
/**
|
|
61
62
|
* Export all
|
|
62
63
|
*/
|
|
63
|
-
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 };
|
|
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/esm/index.js
CHANGED
|
@@ -53,6 +53,7 @@ import OnBoardingService, { OnBoardingApiClient } from './services/onboarding';
|
|
|
53
53
|
import CourseService, { CourseApiClient } from './services/course';
|
|
54
54
|
import PaymentService, { PaymentApiClient } from './services/payment';
|
|
55
55
|
import CommunityService, { CommunityApiClient } from './services/community';
|
|
56
|
+
import ContactUsService, { ContactUsApiClient } from './services/contact_us';
|
|
56
57
|
/**
|
|
57
58
|
* Types
|
|
58
59
|
*/
|
|
@@ -60,4 +61,4 @@ import { MediaTypes, OnBoardingStep, CourseInfoViewType } from './types';
|
|
|
60
61
|
/**
|
|
61
62
|
* Export all
|
|
62
63
|
*/
|
|
63
|
-
export { http, apiRequest, formatHttpError, formatHttpErrorCode, getCancelTokenSourceRequest, generateJWTToken, parseJwt, urlParams, Endpoints, AccountService, AccountApiClient, PreferenceService, PreferenceApiClient, UserService, UserApiClient, FeatureService, FeatureApiClient, CategoryService, CategoryApiClient, CommentService, CommentApiClient, CustomAdvService, CustomAdvApiClient, CustomMenuService, CustomMenuApiClient, CustomPageService, CustomPageApiClient, DataPortabilityService, DataPortabilityApiClient, EmbedService, EmbedApiClient, FeedService, FeedApiClient, FeedObjectService, FeedObjectApiClient, IncubatorService, IncubatorApiClient, InsightService, InsightApiClient, InviteService, InviteApiClient, LegalPageService, LegalPageApiClient, LocalityService, LocalityApiClient, LoyaltyService, LoyaltyApiClient, MediaService, MediaApiClient, ModerationService, ModerationApiClient, NotificationService, NotificationApiClient, PrivateMessageService, PrivateMessageApiClient, PromoService, PromoApiClient, ScoreService, ScoreApiClient, SSOService, SSOApiClient, SuggestionService, SuggestionApiClient, TagService, TagApiClient, WebhookService, WebhookApiClient, MediaTypes, ReactionService, ReactionApiClient, GroupService, GroupApiClient, EventService, EventApiClient, LiveStreamService, LiveStreamApiClient, OnBoardingService, OnBoardingApiClient, OnBoardingStep, CourseInfoViewType, CourseService, CourseApiClient, PaymentService, PaymentApiClient, CommunityService, CommunityApiClient };
|
|
64
|
+
export { http, apiRequest, formatHttpError, formatHttpErrorCode, getCancelTokenSourceRequest, generateJWTToken, parseJwt, urlParams, Endpoints, AccountService, AccountApiClient, PreferenceService, PreferenceApiClient, UserService, UserApiClient, FeatureService, FeatureApiClient, CategoryService, CategoryApiClient, CommentService, CommentApiClient, CustomAdvService, CustomAdvApiClient, CustomMenuService, CustomMenuApiClient, CustomPageService, CustomPageApiClient, DataPortabilityService, DataPortabilityApiClient, EmbedService, EmbedApiClient, FeedService, FeedApiClient, FeedObjectService, FeedObjectApiClient, IncubatorService, IncubatorApiClient, InsightService, InsightApiClient, InviteService, InviteApiClient, LegalPageService, LegalPageApiClient, LocalityService, LocalityApiClient, LoyaltyService, LoyaltyApiClient, MediaService, MediaApiClient, ModerationService, ModerationApiClient, NotificationService, NotificationApiClient, PrivateMessageService, PrivateMessageApiClient, PromoService, PromoApiClient, ScoreService, ScoreApiClient, SSOService, SSOApiClient, SuggestionService, SuggestionApiClient, TagService, TagApiClient, WebhookService, WebhookApiClient, MediaTypes, ReactionService, ReactionApiClient, GroupService, GroupApiClient, EventService, EventApiClient, LiveStreamService, LiveStreamApiClient, OnBoardingService, OnBoardingApiClient, OnBoardingStep, CourseInfoViewType, CourseService, CourseApiClient, PaymentService, PaymentApiClient, CommunityService, CommunityApiClient, ContactUsService, ContactUsApiClient };
|
|
@@ -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,60 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import Endpoints from '../../constants/Endpoints';
|
|
3
|
+
import { apiRequest } from '../../utils/apiRequest';
|
|
4
|
+
/**
|
|
5
|
+
* Contains all the endpoints needed to contact-us.
|
|
6
|
+
*/
|
|
7
|
+
export class ContactUsApiClient {
|
|
8
|
+
/**
|
|
9
|
+
* This endpoint create an contact request.
|
|
10
|
+
*
|
|
11
|
+
* It requires an authenticated user.
|
|
12
|
+
*
|
|
13
|
+
* @param data
|
|
14
|
+
* @param config
|
|
15
|
+
*/
|
|
16
|
+
static request(data, config) {
|
|
17
|
+
return apiRequest(Object.assign(Object.assign({}, config), { data, url: Endpoints.ContactRequest.url({}), method: Endpoints.ContactRequest.method }));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
:::tip Contact service can be used in the following way:
|
|
23
|
+
```jsx
|
|
24
|
+
1. Import the service from our library:
|
|
25
|
+
|
|
26
|
+
import {ContactService} from "@selfcommunity/api-services";
|
|
27
|
+
```
|
|
28
|
+
```jsx
|
|
29
|
+
2. Create a function and put the service inside it!
|
|
30
|
+
The async function `create` will return the paginated list of categories.
|
|
31
|
+
|
|
32
|
+
async create() {
|
|
33
|
+
return await ContactService.request();
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
```jsx
|
|
37
|
+
In case of required `params`, just add them inside the brackets.
|
|
38
|
+
|
|
39
|
+
async request(data) {
|
|
40
|
+
return await ContactService.request(data);
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
```jsx
|
|
44
|
+
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
|
|
45
|
+
|
|
46
|
+
1. Declare it(or declare them, it is possible to add multiple params)
|
|
47
|
+
|
|
48
|
+
const headers = headers: {Authorization: `Bearer ${yourToken}`}
|
|
49
|
+
|
|
50
|
+
2. Add it inside the brackets and pass it to the function, as shown in the previous example!
|
|
51
|
+
```
|
|
52
|
+
:::
|
|
53
|
+
*/
|
|
54
|
+
export default class ContactUsService {
|
|
55
|
+
static request(data, config) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
return ContactUsApiClient.request(data, config);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -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
|
}
|
|
@@ -23,13 +23,6 @@ export class CustomMenuApiClient {
|
|
|
23
23
|
const p = urlParams(params);
|
|
24
24
|
return apiRequest(Object.assign(Object.assign({}, config), { url: `${Endpoints.GetCustomMenus.url({})}?${p.toString()}`, method: Endpoints.GetCustomMenus.method }));
|
|
25
25
|
}
|
|
26
|
-
/**
|
|
27
|
-
* This endpoint retrieves the base custom menu.
|
|
28
|
-
* @param config
|
|
29
|
-
*/
|
|
30
|
-
static getBaseCustomMenu(config) {
|
|
31
|
-
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.CustomMenu.url({ id: 'base' }), method: Endpoints.CustomMenu.method }));
|
|
32
|
-
}
|
|
33
26
|
/**
|
|
34
27
|
* This endpoint performs search of a Custom Menu
|
|
35
28
|
* @param params
|
|
@@ -86,11 +79,6 @@ export default class CustomMenuService {
|
|
|
86
79
|
return CustomMenuApiClient.getAllCustomMenus(params, config);
|
|
87
80
|
});
|
|
88
81
|
}
|
|
89
|
-
static getBaseCustomMenu(config) {
|
|
90
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
-
return CustomMenuApiClient.getBaseCustomMenu(config);
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
82
|
static searchCustomMenus(params, config) {
|
|
95
83
|
return __awaiter(this, void 0, void 0, function* () {
|
|
96
84
|
return CustomMenuApiClient.searchCustomMenus(params, config);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ContactUsRequestParams interface
|
|
3
|
+
*/
|
|
4
|
+
export interface ContactUsRequestParams {
|
|
5
|
+
/**
|
|
6
|
+
* name field for the account
|
|
7
|
+
*/
|
|
8
|
+
name?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Surname field for the account
|
|
11
|
+
*/
|
|
12
|
+
surname?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Email field for the account
|
|
15
|
+
*/
|
|
16
|
+
email?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Contact request text
|
|
19
|
+
*/
|
|
20
|
+
body?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Any other properties available in user_metadata_definition
|
|
23
|
+
*/
|
|
24
|
+
[p: string]: any;
|
|
25
|
+
}
|
package/lib/esm/types/index.d.ts
CHANGED
|
@@ -29,4 +29,5 @@ import { LiveStreamCreateParams, LiveStreamSearchParams, LiveStreamRemovePartici
|
|
|
29
29
|
import { StartStepParams, OnBoardingStep } from './onBoarding';
|
|
30
30
|
import { CourseCreateParams, CourseSearchParams, CourseInfoViewType, CourseInfoParams, CourseLessonCommentsParams, CourseUserRoleParams, CourseUsersParams, CourseDashboardUsersParams } from './course';
|
|
31
31
|
import { PaymentContentStatusParams, PaymentContentStatus, PaymentProductsParams, CustomerPortalCreateSessionParams, CheckoutSessionParams, CheckoutCreateSessionParams, PaymentOrderParams } from './payment';
|
|
32
|
-
|
|
32
|
+
import { ContactUsRequestParams } from './contactUs';
|
|
33
|
+
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, ScheduledFeedObjParams, FeedParams, LegalPageFilterParams, FeatureParams, ScoreParams, InsightContributionParams, InsightUserParams, InsightEmbedParams, InsightCommonParams, ReactionParams, GroupCreateParams, GroupFeedParams, EventCreateParams, EventFeedParams, EventRelatedParams, EventSearchParams, LiveStreamCreateParams, LiveStreamSearchParams, LiveStreamRemoveParticipantParams, StartStepParams, OnBoardingStep, CourseCreateParams, CourseSearchParams, CourseInfoViewType, CourseInfoParams, CourseLessonCommentsParams, CourseUserRoleParams, CourseUsersParams, CourseDashboardUsersParams, PaymentContentStatusParams, PaymentContentStatus, PaymentProductsParams, CustomerPortalCreateSessionParams, CheckoutSessionParams, CheckoutCreateSessionParams, PaymentOrderParams, ContactUsRequestParams };
|