@selfcommunity/api-services 0.7.0-alpha.0 → 0.7.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) 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 +88 -1
  4. package/lib/cjs/index.d.ts +4 -2
  5. package/lib/cjs/index.js +7 -1
  6. package/lib/cjs/services/community/index.d.ts +65 -0
  7. package/lib/cjs/services/community/index.js +70 -0
  8. package/lib/cjs/services/feed_object/index.d.ts +28 -1
  9. package/lib/cjs/services/feed_object/index.js +44 -0
  10. package/lib/cjs/services/payment/index.d.ts +219 -0
  11. package/lib/cjs/services/payment/index.js +218 -0
  12. package/lib/cjs/services/user/index.d.ts +21 -1
  13. package/lib/cjs/services/user/index.js +30 -0
  14. package/lib/cjs/types/feedObject.d.ts +17 -0
  15. package/lib/cjs/types/index.d.ts +3 -2
  16. package/lib/cjs/types/payment.d.ts +137 -0
  17. package/lib/cjs/types/payment.js +2 -0
  18. package/lib/esm/client/index.d.ts +3 -3
  19. package/lib/esm/client/index.js +3 -3
  20. package/lib/esm/constants/Endpoints.js +88 -1
  21. package/lib/esm/index.d.ts +4 -2
  22. package/lib/esm/index.js +3 -1
  23. package/lib/esm/services/community/index.d.ts +65 -0
  24. package/lib/esm/services/community/index.js +65 -0
  25. package/lib/esm/services/feed_object/index.d.ts +28 -1
  26. package/lib/esm/services/feed_object/index.js +44 -0
  27. package/lib/esm/services/payment/index.d.ts +219 -0
  28. package/lib/esm/services/payment/index.js +213 -0
  29. package/lib/esm/services/user/index.d.ts +21 -1
  30. package/lib/esm/services/user/index.js +30 -0
  31. package/lib/esm/types/feedObject.d.ts +17 -0
  32. package/lib/esm/types/index.d.ts +3 -2
  33. package/lib/esm/types/payment.d.ts +137 -0
  34. package/lib/esm/types/payment.js +1 -0
  35. package/lib/umd/740.js +2 -0
  36. package/lib/umd/api-services.js +1 -1
  37. package/package.json +4 -4
  38. package/lib/umd/956.js +0 -2
  39. /package/lib/umd/{956.js.LICENSE.txt → 740.js.LICENSE.txt} +0 -0
@@ -0,0 +1,219 @@
1
+ import { AxiosRequestConfig } from 'axios';
2
+ import { BaseGetParams, PaymentContentStatus, SCPaginatedResponse } from '../../types';
3
+ import { CheckoutCreateSessionParams, CheckoutSessionParams, PaymentProductsParams, CustomerPortalCreateSessionParams, PaymentContentStatusParams, PaymentOrderParams, CreatePaymentProductParams } from '../../types/payment';
4
+ import { SCCheckoutSession, SCPaymentOrder, SCCheckoutSessionDetail, SCCheckoutSessionComplete, SCPaymentProduct, SCPaymentPrice, SCPaymentsCustomerPortalSession, SCPaywall } from '@selfcommunity/types';
5
+ export interface PaymentApiClientInterface {
6
+ /**
7
+ * Get payment products related to an object (aka paywalls) of type <content_type> and id <content_id> and the current payment_order
8
+ * @param params
9
+ * @param config
10
+ */
11
+ getPaymentContentStatus(params?: PaymentContentStatusParams, config?: AxiosRequestConfig): Promise<PaymentContentStatus>;
12
+ /**
13
+ * Get payment products related to an object (aka paywalls) of type <content_type> and id <content_id>
14
+ * @param params
15
+ * @param config
16
+ */
17
+ getPaywalls(params?: PaymentProductsParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaywall>>;
18
+ /**
19
+ * Get payment products
20
+ * @param params
21
+ * @param config
22
+ */
23
+ getPaymentProducts(params?: PaymentProductsParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaymentProduct>>;
24
+ /**
25
+ * Get product
26
+ * @param id
27
+ * @param config
28
+ */
29
+ getPaymentProduct(id: number | string, config?: AxiosRequestConfig): Promise<SCPaymentProduct>;
30
+ /**
31
+ * Get prices related to a product
32
+ * @param id
33
+ * @param params
34
+ * @param config
35
+ */
36
+ getPaymentProductPrices(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaymentPrice>>;
37
+ /**
38
+ * Create session checkout with price_id for an object of type <content_type> and id <content_id>
39
+ * @param data
40
+ * @param config
41
+ */
42
+ checkoutCreateSession(data: CheckoutCreateSessionParams | FormData, config?: AxiosRequestConfig): Promise<any>;
43
+ /**
44
+ * This endpoint retrieve checkout session
45
+ * @param params
46
+ * @param config
47
+ */
48
+ getCheckoutSession(params?: CheckoutSessionParams, config?: AxiosRequestConfig): Promise<SCCheckoutSessionDetail>;
49
+ /**
50
+ * Complete session checkout
51
+ * @param data
52
+ * @param config
53
+ */
54
+ checkoutCompleteSession(data: CheckoutSessionParams | FormData, config?: AxiosRequestConfig): Promise<SCCheckoutSessionComplete>;
55
+ /**
56
+ * This endpoint retrieve order history of authenticated user
57
+ * @param params
58
+ * @param config
59
+ */
60
+ getPaymentsOrder(params?: PaymentOrderParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaymentOrder>>;
61
+ /**
62
+ * This endpoint retrieves the single payment order
63
+ * @param id
64
+ * @param config
65
+ */
66
+ getPaymentOrder(id: number | string, config?: AxiosRequestConfig): Promise<SCPaymentOrder>;
67
+ /**
68
+ * This endpoint retrieves the single payment order in pdf format
69
+ * @param id
70
+ * @param config
71
+ */
72
+ getPaymentOrderPdf(id: number | string, config?: AxiosRequestConfig): Promise<Blob>;
73
+ /**
74
+ * This endpoint retrieve customer portal
75
+ * @param data
76
+ * @param config
77
+ */
78
+ getPaymentsCustomerPortal(data: CustomerPortalCreateSessionParams | FormData, config?: AxiosRequestConfig): Promise<SCPaymentsCustomerPortalSession>;
79
+ /**
80
+ * Create payment product
81
+ * @param data
82
+ * @param config
83
+ */
84
+ createPaymentProduct(data: CreatePaymentProductParams | FormData, config?: AxiosRequestConfig): Promise<SCPaymentProduct>;
85
+ }
86
+ /**
87
+ * Contains all the endpoints needed to manage payments.
88
+ */
89
+ export declare class PaymentApiClient {
90
+ /**
91
+ * This endpoint retrieves all the products related to an object of type <content_type> and id <content_id> and the current payment_order
92
+ * @param params
93
+ * @param config
94
+ */
95
+ static getPaymentContentStatus(params?: PaymentContentStatusParams, config?: AxiosRequestConfig): Promise<PaymentContentStatus>;
96
+ /**
97
+ * This endpoint retrieves all the products related to an object of type <content_type> and id <content_id>
98
+ * @param params
99
+ * @param config
100
+ */
101
+ static getPaywalls(params?: PaymentProductsParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaywall>>;
102
+ /**
103
+ * This endpoint retrieves all the payment products
104
+ * @param params
105
+ * @param config
106
+ */
107
+ static getPaymentProducts(params?: PaymentProductsParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaymentProduct>>;
108
+ /**
109
+ * This endpoint retrieves a specific payment product.
110
+ * @param id
111
+ * @param config
112
+ */
113
+ static getPaymentProduct(id: number | string, config?: AxiosRequestConfig): Promise<SCPaymentProduct>;
114
+ /**
115
+ * This endpoint retrieves all the prices related to a product
116
+ * @param id
117
+ * @param params
118
+ * @param config
119
+ */
120
+ static getPaymentProductPrices(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaymentPrice>>;
121
+ /**
122
+ * This endpoint creates a checkout session.
123
+ * @param data
124
+ * @param config
125
+ */
126
+ static checkoutCreateSession(data: CheckoutCreateSessionParams | FormData, config?: AxiosRequestConfig): Promise<SCCheckoutSession>;
127
+ /**
128
+ * Create payment product
129
+ * @param data
130
+ * @param config
131
+ */
132
+ static createPaymentProduct(data: CreatePaymentProductParams | FormData, config?: AxiosRequestConfig): Promise<SCPaymentProduct>;
133
+ /**
134
+ * This endpoint retrieve checkout session
135
+ * @param params
136
+ * @param config
137
+ */
138
+ static getCheckoutSession(params?: CheckoutSessionParams, config?: AxiosRequestConfig): Promise<SCCheckoutSessionDetail>;
139
+ /**
140
+ * This endpoint complete checkout session
141
+ * @param data
142
+ * @param config
143
+ */
144
+ static checkoutCompleteSession(data: CheckoutSessionParams | FormData, config?: AxiosRequestConfig): Promise<SCCheckoutSessionComplete>;
145
+ /**
146
+ * This endpoint retrive order history of authenticated user
147
+ * @param params
148
+ * @param config
149
+ */
150
+ static getPaymentsOrder(params?: PaymentOrderParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaymentOrder>>;
151
+ /**
152
+ * This endpoint retrieves the single payment order
153
+ * @param id
154
+ * @param config
155
+ */
156
+ static getPaymentOrder(id: number | string, config?: AxiosRequestConfig): Promise<SCPaymentOrder>;
157
+ /**
158
+ * This endpoint retrieves the single payment order in pdf format
159
+ * @param id
160
+ * @param config
161
+ */
162
+ static getPaymentOrderPdf(id: number | string, config?: AxiosRequestConfig): Promise<Blob>;
163
+ /**
164
+ * This endpoint retrive customer portal
165
+ * @param data
166
+ * @param config
167
+ */
168
+ static getPaymentsCustomerPortal(data: CustomerPortalCreateSessionParams | FormData, config?: AxiosRequestConfig): Promise<SCPaymentsCustomerPortalSession>;
169
+ }
170
+ /**
171
+ *
172
+ :::tip Payment service can be used in the following way:
173
+
174
+ ```jsx
175
+ 1. Import the service from our library:
176
+
177
+ import {PaymentService} from "@selfcommunity/api-services";
178
+ ```
179
+ ```jsx
180
+ 2. Create a function and put the service inside it!
181
+ The async function `getPaymentProducts` will return the events matching the search query.
182
+
183
+ async getPaymentProducts() {
184
+ return await PaymentService.getPaymentProducts({...});
185
+ }
186
+ ```
187
+ ```jsx
188
+ In case of required `params`, just add them inside the brackets.
189
+
190
+ async getPaymentPrices(eventId) {
191
+ return await PaymentService.getProductPrices(id);
192
+ }
193
+ ```
194
+ ```jsx
195
+ If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
196
+
197
+ 1. Declare it(or declare them, it is possible to add multiple params)
198
+
199
+ const headers = headers: {Authorization: `Bearer ${yourToken}`}
200
+
201
+ 2. Add it inside the brackets and pass it to the function, as shown in the previous example!
202
+ ```
203
+ :::
204
+ */
205
+ export default class PaymentService {
206
+ static getPaymentContentStatus(params?: PaymentContentStatusParams, config?: AxiosRequestConfig): Promise<PaymentContentStatus>;
207
+ static getPaywalls(params?: PaymentProductsParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaywall>>;
208
+ static getPaymentProducts(params?: PaymentProductsParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaymentProduct>>;
209
+ static getPaymentProduct(id: number | string, config?: AxiosRequestConfig): Promise<SCPaymentProduct>;
210
+ static getPaymentProductPrices(id: number | string, params?: PaymentProductsParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaymentPrice>>;
211
+ static checkoutCreateSession(data: CheckoutCreateSessionParams | FormData, config?: AxiosRequestConfig): Promise<SCCheckoutSession>;
212
+ static getCheckoutSession(params?: CheckoutSessionParams, config?: AxiosRequestConfig): Promise<SCCheckoutSessionDetail>;
213
+ static checkoutCompleteSession(data: CheckoutSessionParams | FormData, config?: AxiosRequestConfig): Promise<SCCheckoutSessionComplete>;
214
+ static getPaymentsOrder(params?: PaymentOrderParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaymentOrder>>;
215
+ static getPaymentOrder(id: number | string, config?: AxiosRequestConfig): Promise<SCPaymentOrder>;
216
+ static getPaymentOrderPdf(id: number | string, config?: AxiosRequestConfig): Promise<Blob>;
217
+ static getPaymentsCustomerPortal(data: CustomerPortalCreateSessionParams | FormData, config?: AxiosRequestConfig): Promise<SCPaymentsCustomerPortalSession>;
218
+ static createPaymentProduct(data: CreatePaymentProductParams | FormData, config?: AxiosRequestConfig): Promise<SCPaymentProduct>;
219
+ }
@@ -0,0 +1,218 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaymentApiClient = 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 PaymentApiClient {
12
+ /**
13
+ * This endpoint retrieves all the products related to an object of type <content_type> and id <content_id> and the current payment_order
14
+ * @param params
15
+ * @param config
16
+ */
17
+ static getPaymentContentStatus(params, config) {
18
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { params, url: `${Endpoints_1.default.GetPaymentContentStatus.url({})}`, method: Endpoints_1.default.GetPaymentContentStatus.method }));
19
+ }
20
+ /**
21
+ * This endpoint retrieves all the products related to an object of type <content_type> and id <content_id>
22
+ * @param params
23
+ * @param config
24
+ */
25
+ static getPaywalls(params, config) {
26
+ const p = (0, url_1.urlParams)(params);
27
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: `${Endpoints_1.default.GetPaywalls.url({})}?${p.toString()}`, method: Endpoints_1.default.GetPaywalls.method }));
28
+ }
29
+ /**
30
+ * This endpoint retrieves all the payment products
31
+ * @param params
32
+ * @param config
33
+ */
34
+ static getPaymentProducts(params, config) {
35
+ const p = (0, url_1.urlParams)(params);
36
+ return (0, apiRequest_1.apiRequest)(Object.assign({ url: `${Endpoints_1.default.GetPaymentProducts.url({})}?${p.toString()}`, method: Endpoints_1.default.GetPaymentProducts.method }, config));
37
+ }
38
+ /**
39
+ * This endpoint retrieves a specific payment product.
40
+ * @param id
41
+ * @param config
42
+ */
43
+ static getPaymentProduct(id, config) {
44
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.GetPaymentProduct.url({ id }), method: Endpoints_1.default.GetPaymentProduct.method }));
45
+ }
46
+ /**
47
+ * This endpoint retrieves all the prices related to a product
48
+ * @param id
49
+ * @param params
50
+ * @param config
51
+ */
52
+ static getPaymentProductPrices(id, params, config) {
53
+ const p = (0, url_1.urlParams)(params);
54
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: `${Endpoints_1.default.GetPaymentProductPrices.url({ id })}?${p.toString()}`, method: Endpoints_1.default.GetPaymentProductPrices.method }));
55
+ }
56
+ /**
57
+ * This endpoint creates a checkout session.
58
+ * @param data
59
+ * @param config
60
+ */
61
+ static checkoutCreateSession(data, config) {
62
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.CheckoutCreateSession.url({}), method: Endpoints_1.default.CheckoutCreateSession.method, data }));
63
+ }
64
+ /**
65
+ * Create payment product
66
+ * @param data
67
+ * @param config
68
+ */
69
+ static createPaymentProduct(data, config) {
70
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.CreatePaymentProduct.url({}), method: Endpoints_1.default.CreatePaymentProduct.method, data }));
71
+ }
72
+ /**
73
+ * This endpoint retrieve checkout session
74
+ * @param params
75
+ * @param config
76
+ */
77
+ static getCheckoutSession(params, config) {
78
+ const p = (0, url_1.urlParams)(params);
79
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: `${Endpoints_1.default.GetCheckoutSession.url({})}?${p.toString()}`, method: Endpoints_1.default.GetCheckoutSession.method }));
80
+ }
81
+ /**
82
+ * This endpoint complete checkout session
83
+ * @param data
84
+ * @param config
85
+ */
86
+ static checkoutCompleteSession(data, config) {
87
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.CheckoutSessionComplete.url({}), method: Endpoints_1.default.CheckoutSessionComplete.method, data }));
88
+ }
89
+ /**
90
+ * This endpoint retrive order history of authenticated user
91
+ * @param params
92
+ * @param config
93
+ */
94
+ static getPaymentsOrder(params, config) {
95
+ const p = (0, url_1.urlParams)(params);
96
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: `${Endpoints_1.default.GetPaymentOrders.url({})}?${p.toString()}`, method: Endpoints_1.default.GetPaymentOrders.method }));
97
+ }
98
+ /**
99
+ * This endpoint retrieves the single payment order
100
+ * @param id
101
+ * @param config
102
+ */
103
+ static getPaymentOrder(id, config) {
104
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: `${Endpoints_1.default.GetPaymentOrder.url({ id })}`, method: Endpoints_1.default.GetPaymentOrder.method }));
105
+ }
106
+ /**
107
+ * This endpoint retrieves the single payment order in pdf format
108
+ * @param id
109
+ * @param config
110
+ */
111
+ static getPaymentOrderPdf(id, config) {
112
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: `${Endpoints_1.default.GetPaymentOrderPdf.url({ id })}`, method: Endpoints_1.default.GetPaymentOrderPdf.method }));
113
+ }
114
+ /**
115
+ * This endpoint retrive customer portal
116
+ * @param data
117
+ * @param config
118
+ */
119
+ static getPaymentsCustomerPortal(data, config) {
120
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.CreateCustomerPortalSession.url({}), method: Endpoints_1.default.CreateCustomerPortalSession.method, data }));
121
+ }
122
+ }
123
+ exports.PaymentApiClient = PaymentApiClient;
124
+ /**
125
+ *
126
+ :::tip Payment service can be used in the following way:
127
+
128
+ ```jsx
129
+ 1. Import the service from our library:
130
+
131
+ import {PaymentService} from "@selfcommunity/api-services";
132
+ ```
133
+ ```jsx
134
+ 2. Create a function and put the service inside it!
135
+ The async function `getPaymentProducts` will return the events matching the search query.
136
+
137
+ async getPaymentProducts() {
138
+ return await PaymentService.getPaymentProducts({...});
139
+ }
140
+ ```
141
+ ```jsx
142
+ In case of required `params`, just add them inside the brackets.
143
+
144
+ async getPaymentPrices(eventId) {
145
+ return await PaymentService.getProductPrices(id);
146
+ }
147
+ ```
148
+ ```jsx
149
+ If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
150
+
151
+ 1. Declare it(or declare them, it is possible to add multiple params)
152
+
153
+ const headers = headers: {Authorization: `Bearer ${yourToken}`}
154
+
155
+ 2. Add it inside the brackets and pass it to the function, as shown in the previous example!
156
+ ```
157
+ :::
158
+ */
159
+ class PaymentService {
160
+ static getPaymentContentStatus(params, config) {
161
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
162
+ return PaymentApiClient.getPaymentContentStatus(params, config);
163
+ });
164
+ }
165
+ static getPaywalls(params, config) {
166
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
167
+ return PaymentApiClient.getPaywalls(params, config);
168
+ });
169
+ }
170
+ static getPaymentProducts(params, config) {
171
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
172
+ return PaymentApiClient.getPaymentProducts(params, config);
173
+ });
174
+ }
175
+ static getPaymentProduct(id, config) {
176
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
177
+ return PaymentApiClient.getPaymentProduct(id, config);
178
+ });
179
+ }
180
+ static getPaymentProductPrices(id, params, config) {
181
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
182
+ return PaymentApiClient.getPaymentProductPrices(id, params, config);
183
+ });
184
+ }
185
+ static checkoutCreateSession(data, config) {
186
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
187
+ return PaymentApiClient.checkoutCreateSession(data, config);
188
+ });
189
+ }
190
+ static getCheckoutSession(params, config) {
191
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
192
+ return PaymentApiClient.getCheckoutSession(params, config);
193
+ });
194
+ }
195
+ static checkoutCompleteSession(data, config) {
196
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
197
+ return PaymentApiClient.checkoutCompleteSession(data, config);
198
+ });
199
+ }
200
+ static getPaymentsOrder(params, config) {
201
+ return PaymentApiClient.getPaymentsOrder(params, config);
202
+ }
203
+ static getPaymentOrder(id, config) {
204
+ return PaymentApiClient.getPaymentOrder(id, config);
205
+ }
206
+ static getPaymentOrderPdf(id, config) {
207
+ return PaymentApiClient.getPaymentOrderPdf(id, config);
208
+ }
209
+ static getPaymentsCustomerPortal(data, config) {
210
+ return PaymentApiClient.getPaymentsCustomerPortal(data, config);
211
+ }
212
+ static createPaymentProduct(data, config) {
213
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
214
+ return PaymentApiClient.createPaymentProduct(data, config);
215
+ });
216
+ }
217
+ }
218
+ exports.default = PaymentService;
@@ -1,4 +1,4 @@
1
- import { SCAvatarType, SCCategoryType, SCFeedUnitType, SCLiveStreamType, SCPlatformType, SCTagType, SCUserAutocompleteType, SCUserAvatarType, SCUserChangeEmailType, SCUserConnectionRequestType, SCUserConnectionStatusType, SCUserCounterType, SCUserEmailTokenType, SCUserFollowedStatusType, SCUserFollowerStatusType, SCUserHiddenByStatusType, SCUserHiddenStatusType, SCUserLoyaltyPointsType, SCUserPermissionType, SCUserProviderAssociationType, SCUserSettingsType, SCUserType } from '@selfcommunity/types';
1
+ import { SCAvatarType, SCCategoryType, SCFeedUnitType, SCLiveStreamType, SCPaymentOrder, SCPlatformType, SCTagType, SCUserAutocompleteType, SCUserAvatarType, SCUserChangeEmailType, SCUserConnectionRequestType, SCUserConnectionStatusType, SCUserCounterType, SCUserEmailTokenType, SCUserFollowedStatusType, SCUserFollowerStatusType, SCUserHiddenByStatusType, SCUserHiddenStatusType, SCUserLoyaltyPointsType, SCUserPermissionType, SCUserProviderAssociationType, SCUserSettingsType, SCUserType } from '@selfcommunity/types';
2
2
  import { BaseGetParams, SCPaginatedResponse, UserAutocompleteParams, UserGetParams, UserSearchParams } from '../../types';
3
3
  import { AxiosRequestConfig } from 'axios';
4
4
  import { DeleteProviderAssociation } from '../../types/user';
@@ -55,6 +55,8 @@ export interface UserApiClientInterface {
55
55
  createProviderAssociation(data: SCUserProviderAssociationType, config?: AxiosRequestConfig): Promise<SCUserProviderAssociationType>;
56
56
  deleteProviderAssociation(data: DeleteProviderAssociation, config?: AxiosRequestConfig): Promise<any>;
57
57
  getUserLiveStream(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCLiveStreamType>>;
58
+ getOrderHistory(id: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaymentOrder[]>;
59
+ getOrderDetail(id: number, order: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaymentOrder>;
58
60
  }
59
61
  /**
60
62
  * Contains all the endpoints needed to manage users.
@@ -392,6 +394,22 @@ export declare class UserApiClient {
392
394
  * @param config
393
395
  */
394
396
  static getUserLiveStream(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCLiveStreamType>>;
397
+ /**
398
+ * This endpoint retrieve all order history of authenticated user
399
+ *
400
+ * @param id
401
+ * @param params
402
+ * @param config
403
+ */
404
+ static getOrderHistory(id: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaymentOrder>>;
405
+ /**
406
+ * This endpoint retrieve detail of an order
407
+ * @param id
408
+ * @param order
409
+ * @param params
410
+ * @param config
411
+ */
412
+ static getOrderDetail(id: number, order: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaymentOrder>;
395
413
  }
396
414
  /**
397
415
  *
@@ -483,4 +501,6 @@ export default class UserService {
483
501
  static createProviderAssociation(data: SCUserProviderAssociationType, config?: AxiosRequestConfig): Promise<SCUserProviderAssociationType>;
484
502
  static deleteProviderAssociation(data: DeleteProviderAssociation, config?: AxiosRequestConfig): Promise<any>;
485
503
  static getUserLiveStream(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCLiveStreamType>>;
504
+ static getOrderHistory(id: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaymentOrder>>;
505
+ static getOrderDetail(id: number, order: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaymentOrder>;
486
506
  }
@@ -460,6 +460,26 @@ class UserApiClient {
460
460
  static getUserLiveStream(id, params, config) {
461
461
  return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.GetLiveStream.url({ id }), method: Endpoints_1.default.UserFeed.method, params }));
462
462
  }
463
+ /**
464
+ * This endpoint retrieve all order history of authenticated user
465
+ *
466
+ * @param id
467
+ * @param params
468
+ * @param config
469
+ */
470
+ static getOrderHistory(id, params, config) {
471
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.GetOrderHistory.url({ id }), method: Endpoints_1.default.GetOrderHistory.method, params }));
472
+ }
473
+ /**
474
+ * This endpoint retrieve detail of an order
475
+ * @param id
476
+ * @param order
477
+ * @param params
478
+ * @param config
479
+ */
480
+ static getOrderDetail(id, order, params, config) {
481
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.GetOrderDetail.url({ id, order }), method: Endpoints_1.default.GetOrderDetail.method, params }));
482
+ }
463
483
  }
464
484
  exports.UserApiClient = UserApiClient;
465
485
  /**
@@ -760,5 +780,15 @@ class UserService {
760
780
  return UserApiClient.getUserLiveStream(id, params, config);
761
781
  });
762
782
  }
783
+ static getOrderHistory(id, params, config) {
784
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
785
+ return UserApiClient.getOrderHistory(id, params, config);
786
+ });
787
+ }
788
+ static getOrderDetail(id, order, params, config) {
789
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
790
+ return UserApiClient.getOrderDetail(id, order, params, config);
791
+ });
792
+ }
763
793
  }
764
794
  exports.default = UserService;
@@ -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,5 @@ 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
+ 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 };