@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.
Files changed (50) hide show
  1. package/lib/cjs/client/index.d.ts +3 -3
  2. package/lib/cjs/client/index.js +3 -3
  3. package/lib/cjs/constants/Endpoints.js +105 -0
  4. package/lib/cjs/index.d.ts +5 -2
  5. package/lib/cjs/index.js +10 -1
  6. package/lib/cjs/services/community/index.d.ts +69 -0
  7. package/lib/cjs/services/community/index.js +74 -0
  8. package/lib/cjs/services/contact_us/index.d.ts +57 -0
  9. package/lib/cjs/services/contact_us/index.js +65 -0
  10. package/lib/cjs/services/custom_menu/index.d.ts +0 -7
  11. package/lib/cjs/services/custom_menu/index.js +0 -12
  12. package/lib/cjs/services/feed_object/index.d.ts +28 -1
  13. package/lib/cjs/services/feed_object/index.js +44 -0
  14. package/lib/cjs/services/payment/index.d.ts +219 -0
  15. package/lib/cjs/services/payment/index.js +218 -0
  16. package/lib/cjs/services/user/index.d.ts +29 -1
  17. package/lib/cjs/services/user/index.js +43 -0
  18. package/lib/cjs/types/contactUs.d.ts +25 -0
  19. package/lib/cjs/types/contactUs.js +5 -0
  20. package/lib/cjs/types/feedObject.d.ts +17 -0
  21. package/lib/cjs/types/index.d.ts +4 -2
  22. package/lib/cjs/types/payment.d.ts +137 -0
  23. package/lib/cjs/types/payment.js +2 -0
  24. package/lib/cjs/types/user.d.ts +4 -0
  25. package/lib/esm/client/index.d.ts +3 -3
  26. package/lib/esm/client/index.js +3 -3
  27. package/lib/esm/constants/Endpoints.js +105 -0
  28. package/lib/esm/index.d.ts +5 -2
  29. package/lib/esm/index.js +4 -1
  30. package/lib/esm/services/community/index.d.ts +69 -0
  31. package/lib/esm/services/community/index.js +69 -0
  32. package/lib/esm/services/contact_us/index.d.ts +57 -0
  33. package/lib/esm/services/contact_us/index.js +60 -0
  34. package/lib/esm/services/custom_menu/index.d.ts +0 -7
  35. package/lib/esm/services/custom_menu/index.js +0 -12
  36. package/lib/esm/services/feed_object/index.d.ts +28 -1
  37. package/lib/esm/services/feed_object/index.js +44 -0
  38. package/lib/esm/services/payment/index.d.ts +219 -0
  39. package/lib/esm/services/payment/index.js +213 -0
  40. package/lib/esm/services/user/index.d.ts +29 -1
  41. package/lib/esm/services/user/index.js +43 -0
  42. package/lib/esm/types/contactUs.d.ts +25 -0
  43. package/lib/esm/types/contactUs.js +4 -0
  44. package/lib/esm/types/feedObject.d.ts +17 -0
  45. package/lib/esm/types/index.d.ts +4 -2
  46. package/lib/esm/types/payment.d.ts +137 -0
  47. package/lib/esm/types/payment.js +1 -0
  48. package/lib/esm/types/user.d.ts +4 -0
  49. package/lib/umd/api-services.js +1 -1
  50. package/package.json +4 -4
@@ -457,6 +457,34 @@ export class UserApiClient {
457
457
  static getUserLiveStream(id, params, config) {
458
458
  return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.GetLiveStream.url({ id }), method: Endpoints.UserFeed.method, params }));
459
459
  }
460
+ /**
461
+ * This endpoint retrieve all order history of authenticated user
462
+ *
463
+ * @param id
464
+ * @param params
465
+ * @param config
466
+ */
467
+ static getOrderHistory(id, params, config) {
468
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.GetOrderHistory.url({ id }), method: Endpoints.GetOrderHistory.method, params }));
469
+ }
470
+ /**
471
+ * This endpoint retrieve detail of an order
472
+ * @param id
473
+ * @param order
474
+ * @param params
475
+ * @param config
476
+ */
477
+ static getOrderDetail(id, order, params, config) {
478
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.GetOrderDetail.url({ id, order }), method: Endpoints.GetOrderDetail.method, params }));
479
+ }
480
+ /**
481
+ * This endpoint retrieve the users corresponding to the sent usernames
482
+ * @param usernames
483
+ * @param config
484
+ */
485
+ static matchUsernames(usernames, config) {
486
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserMatchUsernames.url(), method: Endpoints.UserMatchUsernames.method, data: usernames }));
487
+ }
460
488
  }
461
489
  /**
462
490
  *
@@ -756,4 +784,19 @@ export default class UserService {
756
784
  return UserApiClient.getUserLiveStream(id, params, config);
757
785
  });
758
786
  }
787
+ static getOrderHistory(id, params, config) {
788
+ return __awaiter(this, void 0, void 0, function* () {
789
+ return UserApiClient.getOrderHistory(id, params, config);
790
+ });
791
+ }
792
+ static getOrderDetail(id, order, params, config) {
793
+ return __awaiter(this, void 0, void 0, function* () {
794
+ return UserApiClient.getOrderDetail(id, order, params, config);
795
+ });
796
+ }
797
+ static matchUsernames(usernames, config) {
798
+ return __awaiter(this, void 0, void 0, function* () {
799
+ return UserApiClient.matchUsernames(usernames, config);
800
+ });
801
+ }
759
802
  }
@@ -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 message text
19
+ */
20
+ message?: string;
21
+ /**
22
+ * Any other properties
23
+ */
24
+ [p: string]: any;
25
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * ContactUsRequestParams interface
3
+ */
4
+ export {};
@@ -43,6 +43,10 @@ export interface FeedObjCreateParams {
43
43
  * The list of tag ids.
44
44
  */
45
45
  addressing?: number[];
46
+ /**
47
+ * If the feed obj is not published yet
48
+ */
49
+ draft?: boolean;
46
50
  }
47
51
  /**
48
52
  * FeedObjectPollVotesSearch interface
@@ -53,3 +57,16 @@ export interface FeedObjectPollVotesSearch extends BaseGetParams {
53
57
  */
54
58
  choice?: number;
55
59
  }
60
+ /**
61
+ * ScheduledFeedObjParams interface
62
+ */
63
+ export interface ScheduledFeedObjParams {
64
+ /**
65
+ * Includes posts that were scheduled and already published
66
+ */
67
+ include_published?: boolean;
68
+ /**
69
+ * Show only posts that were scheduled and already published
70
+ */
71
+ only_published?: boolean;
72
+ }
@@ -16,7 +16,7 @@ import { CustomAdvParams } from './customAdv';
16
16
  import { CustomPageParams, CustomPageSearchParams } from './customPage';
17
17
  import { EmbedUpdateParams, EmbedSearchParams } from './embed';
18
18
  import { BaseGetParams, BaseSearchParams } from './baseParams';
19
- import { FeedObjGetParams, FeedObjCreateParams, FeedObjectPollVotesSearch } from './feedObject';
19
+ import { FeedObjGetParams, FeedObjCreateParams, FeedObjectPollVotesSearch, ScheduledFeedObjParams } from './feedObject';
20
20
  import { FeedParams } from './feed';
21
21
  import { LegalPageFilterParams } from './legalPage';
22
22
  import { FeatureParams } from './feature';
@@ -28,4 +28,6 @@ import { EventCreateParams, EventFeedParams, EventRelatedParams, EventSearchPara
28
28
  import { LiveStreamCreateParams, LiveStreamSearchParams, LiveStreamRemoveParticipantParams } from './liveStream';
29
29
  import { StartStepParams, OnBoardingStep } from './onBoarding';
30
30
  import { CourseCreateParams, CourseSearchParams, CourseInfoViewType, CourseInfoParams, CourseLessonCommentsParams, CourseUserRoleParams, CourseUsersParams, CourseDashboardUsersParams } from './course';
31
- export { AccountCreateParams, AccountVerifyParams, AccountRecoverParams, AccountResetParams, AccountSearchParams, SCPaginatedResponse, WebhookParamType, WebhookEventsType, SSOSignUpParams, CommentListParams, CommentCreateParams, IncubatorCreateParams, IncubatorSearchParams, LoyaltyPrizeParams, LoyaltyGetPrizeParams, ModerationParams, ModerateContributionParams, FlaggedContributionParams, CustomNotificationParams, UserGetParams, UserAutocompleteParams, UserScoreParams, UserSearchParams, TagParams, TagGetParams, MediaCreateParams, MediaTypes, ChunkUploadCompleteParams, ChunkUploadParams, ThreadParams, ThreadDeleteParams, MessageCreateParams, MessageMediaUploadParams, MessageThumbnailUploadParams, MessageChunkUploadDoneParams, MessageMediaChunksParams, CategoryParams, CustomAdvParams, CustomPageParams, CustomPageSearchParams, EmbedUpdateParams, EmbedSearchParams, BaseGetParams, BaseSearchParams, FeedObjGetParams, FeedObjCreateParams, FeedObjectPollVotesSearch, FeedParams, LegalPageFilterParams, FeatureParams, ScoreParams, InsightContributionParams, InsightUserParams, InsightEmbedParams, InsightCommonParams, ReactionParams, GroupCreateParams, GroupFeedParams, EventCreateParams, EventFeedParams, EventRelatedParams, EventSearchParams, LiveStreamCreateParams, LiveStreamSearchParams, LiveStreamRemoveParticipantParams, StartStepParams, OnBoardingStep, CourseCreateParams, CourseSearchParams, CourseInfoViewType, CourseInfoParams, CourseLessonCommentsParams, CourseUserRoleParams, CourseUsersParams, CourseDashboardUsersParams };
31
+ import { PaymentContentStatusParams, PaymentContentStatus, PaymentProductsParams, CustomerPortalCreateSessionParams, CheckoutSessionParams, CheckoutCreateSessionParams, PaymentOrderParams } from './payment';
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 };
@@ -0,0 +1,137 @@
1
+ import { BaseGetParams, BaseSearchParams } from './baseParams';
2
+ import { SCCheckoutSessionUIMode, SCContentType, SCPaymentOrder, SCPaymentPriceCurrencyType, SCPaywall } from '@selfcommunity/types';
3
+ /**
4
+ * PaymentParams interface.
5
+ */
6
+ export interface PaymentProductsParams extends BaseGetParams {
7
+ /**
8
+ * Content id
9
+ */
10
+ id?: number | string;
11
+ /**
12
+ * Content id
13
+ */
14
+ content_id?: number | string;
15
+ /**
16
+ * Content type
17
+ */
18
+ content_type?: SCContentType;
19
+ }
20
+ export interface CheckoutCreateSessionParams {
21
+ /**
22
+ * Content id
23
+ */
24
+ content_id: number;
25
+ /**
26
+ * Content type
27
+ */
28
+ content_type: SCContentType;
29
+ /**
30
+ * Price id
31
+ */
32
+ payment_price_id: number;
33
+ /**
34
+ * Return url
35
+ */
36
+ return_url?: string;
37
+ /**
38
+ * Success url
39
+ */
40
+ success_url?: string;
41
+ /**
42
+ * Session UI mode
43
+ */
44
+ ui_mode?: SCCheckoutSessionUIMode;
45
+ }
46
+ export interface CheckoutSessionParams {
47
+ /**
48
+ * Session Id
49
+ */
50
+ session_id: string;
51
+ }
52
+ export interface CustomerPortalCreateSessionParams {
53
+ /**
54
+ * Return url
55
+ */
56
+ return_url?: string;
57
+ }
58
+ /**
59
+ * PaymentContentStatusParams interface.
60
+ */
61
+ export interface PaymentContentStatusParams extends BaseGetParams {
62
+ /**
63
+ * Content id
64
+ */
65
+ content_id?: number | string;
66
+ /**
67
+ * Content type
68
+ */
69
+ content_type?: SCContentType;
70
+ }
71
+ /**
72
+ * PaymentOrderParams interface.
73
+ */
74
+ export interface PaymentOrderParams extends BaseSearchParams {
75
+ /**
76
+ * Ordering
77
+ */
78
+ ordering?: string;
79
+ /**
80
+ * The content type
81
+ */
82
+ content_type?: SCContentType;
83
+ /**
84
+ * The creation date
85
+ */
86
+ created_at?: string;
87
+ /**
88
+ * The creation date
89
+ */
90
+ created_at__gte?: string;
91
+ /**
92
+ * The creation date
93
+ */
94
+ created_at__lte?: string;
95
+ }
96
+ /**
97
+ * CreatePaymentProduct interface.
98
+ */
99
+ export interface CreatePaymentProductParams {
100
+ /**
101
+ * Product name
102
+ */
103
+ name: string;
104
+ /**
105
+ * Prduct price
106
+ */
107
+ unit_amount: number;
108
+ /**
109
+ * Description name
110
+ */
111
+ description?: string;
112
+ /**
113
+ * Price currency
114
+ */
115
+ currency?: SCPaymentPriceCurrencyType;
116
+ }
117
+ /**
118
+ * PaymentContentStatus response interface.
119
+ */
120
+ export interface PaymentContentStatus {
121
+ /**
122
+ * Content id
123
+ */
124
+ content_id?: number | string;
125
+ /**
126
+ * Content type
127
+ */
128
+ content_type?: SCContentType;
129
+ /**
130
+ * Payment Order
131
+ */
132
+ payment_order?: SCPaymentOrder;
133
+ /**
134
+ * Price currency
135
+ */
136
+ paywalls?: SCPaywall[];
137
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -27,6 +27,10 @@ export interface UserAutocompleteParams extends BaseSearchParams {
27
27
  * Ordering fields (eg?: ?ordering=username). Minus char is used for descending ordering, eg. -username
28
28
  */
29
29
  ordering?: string;
30
+ /**
31
+ * Filter using the user ids
32
+ */
33
+ exclude?: string;
30
34
  }
31
35
  /**
32
36
  * UserScoreParams interface.