@gofynd/fdk-client-javascript 1.4.6 → 1.4.8-beta.2
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/README.md +1 -1
- package/package.json +2 -2
- package/sdk/application/ApplicationClient.d.ts +2 -0
- package/sdk/application/ApplicationClient.js +2 -0
- package/sdk/application/Cart/CartApplicationClient.d.ts +16 -3
- package/sdk/application/Cart/CartApplicationClient.js +118 -13
- package/sdk/application/Cart/CartApplicationModel.d.ts +121 -45
- package/sdk/application/Cart/CartApplicationModel.js +98 -26
- package/sdk/application/Cart/CartApplicationValidator.d.ts +45 -1
- package/sdk/application/Cart/CartApplicationValidator.js +26 -0
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +10 -2
- package/sdk/application/Catalog/CatalogApplicationModel.js +10 -2
- package/sdk/application/Content/ContentApplicationClient.d.ts +1 -1
- package/sdk/application/Content/ContentApplicationClient.js +5 -3
- package/sdk/application/Content/ContentApplicationModel.d.ts +7 -18
- package/sdk/application/Content/ContentApplicationModel.js +6 -20
- package/sdk/application/Content/ContentApplicationValidator.d.ts +10 -0
- package/sdk/application/Content/ContentApplicationValidator.js +4 -0
- package/sdk/application/Lead/LeadApplicationClient.d.ts +0 -27
- package/sdk/application/Lead/LeadApplicationClient.js +0 -167
- package/sdk/application/Lead/LeadApplicationModel.d.ts +1 -146
- package/sdk/application/Lead/LeadApplicationModel.js +0 -126
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +1 -25
- package/sdk/application/Lead/LeadApplicationValidator.js +0 -24
- package/sdk/application/Logistic/LogisticApplicationClient.js +1 -1
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +2 -0
- package/sdk/application/Logistic/LogisticApplicationModel.js +2 -0
- package/sdk/application/Order/OrderApplicationModel.d.ts +72 -9
- package/sdk/application/Order/OrderApplicationModel.js +45 -7
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +27 -20
- package/sdk/application/Payment/PaymentApplicationModel.js +23 -20
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +2 -0
- package/sdk/application/Theme/ThemeApplicationModel.js +2 -0
- package/sdk/application/Webhook/WebhookApplicationClient.d.ts +22 -0
- package/sdk/application/Webhook/WebhookApplicationClient.js +115 -0
- package/sdk/application/Webhook/WebhookApplicationModel.d.ts +37 -0
- package/sdk/application/Webhook/WebhookApplicationModel.js +46 -0
- package/sdk/application/Webhook/WebhookApplicationValidator.d.ts +16 -0
- package/sdk/application/Webhook/WebhookApplicationValidator.js +19 -0
- package/sdk/application/index.d.ts +1 -0
- package/sdk/application/index.js +2 -0
- package/sdk/partner/Lead/LeadPartnerClient.d.ts +0 -23
- package/sdk/partner/Lead/LeadPartnerClient.js +0 -157
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +12 -581
- package/sdk/partner/Lead/LeadPartnerModel.js +14 -403
- package/sdk/partner/Lead/LeadPartnerValidator.d.ts +0 -2
- package/sdk/partner/Lead/LeadPartnerValidator.js +0 -12
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +1 -1
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +4 -4
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +22 -0
- package/sdk/partner/Theme/ThemePartnerClient.js +162 -0
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +119 -1
- package/sdk/partner/Theme/ThemePartnerModel.js +142 -0
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +2 -0
- package/sdk/partner/Theme/ThemePartnerValidator.js +14 -0
- package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +2 -2
- package/sdk/partner/Webhook/WebhookPartnerClient.js +2 -2
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +23 -19
- package/sdk/partner/Webhook/WebhookPartnerModel.js +19 -22
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +43 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +257 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +39 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +45 -0
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +60 -0
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +57 -0
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +304 -43
- package/sdk/platform/Billing/BillingPlatformClient.js +2218 -118
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +1330 -282
- package/sdk/platform/Billing/BillingPlatformModel.js +1808 -590
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +324 -16
- package/sdk/platform/Billing/BillingPlatformValidator.js +340 -12
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +36 -3
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +276 -3
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +93 -1
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +60 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +216 -40
- package/sdk/platform/Cart/CartPlatformModel.js +166 -24
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +11 -7
- package/sdk/platform/Catalog/CatalogPlatformClient.js +37 -14
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +122 -17
- package/sdk/platform/Catalog/CatalogPlatformModel.js +141 -15
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +40 -7
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +19 -5
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +18 -1
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +25 -0
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +10 -0
- package/sdk/platform/Content/ContentPlatformModel.d.ts +8 -4
- package/sdk/platform/Content/ContentPlatformModel.js +8 -4
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +49 -28
- package/sdk/platform/Finance/FinancePlatformClient.js +181 -28
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +350 -127
- package/sdk/platform/Finance/FinancePlatformModel.js +378 -108
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +56 -43
- package/sdk/platform/Finance/FinancePlatformValidator.js +61 -42
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +0 -47
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +0 -321
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +1 -46
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +0 -48
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +2 -25
- package/sdk/platform/Lead/LeadPlatformClient.js +2 -167
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +82 -204
- package/sdk/platform/Lead/LeadPlatformModel.js +98 -178
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +1 -25
- package/sdk/platform/Lead/LeadPlatformValidator.js +0 -24
- package/sdk/platform/Order/OrderPlatformClient.d.ts +11 -1
- package/sdk/platform/Order/OrderPlatformClient.js +82 -5
- package/sdk/platform/Order/OrderPlatformModel.d.ts +270 -29
- package/sdk/platform/Order/OrderPlatformModel.js +139 -28
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +58 -17
- package/sdk/platform/Order/OrderPlatformValidator.js +28 -16
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +14 -2
- package/sdk/platform/Payment/PaymentPlatformModel.js +7 -2
- package/sdk/platform/PlatformApplicationClient.d.ts +2 -0
- package/sdk/platform/PlatformApplicationClient.js +4 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +4 -4
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +12 -0
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +82 -0
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +18 -1
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +14 -0
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +67 -1
- package/sdk/platform/Theme/ThemePlatformModel.js +78 -0
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +24 -40
- package/sdk/platform/Webhook/WebhookPlatformClient.js +78 -221
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +168 -167
- package/sdk/platform/Webhook/WebhookPlatformModel.js +180 -178
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +23 -31
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +28 -42
- package/sdk/platform/index.d.ts +1 -0
- package/sdk/platform/index.js +2 -0
- package/sdk/public/Billing/BillingPublicClient.d.ts +24 -2
- package/sdk/public/Billing/BillingPublicClient.js +156 -3
- package/sdk/public/Billing/BillingPublicModel.d.ts +368 -26
- package/sdk/public/Billing/BillingPublicModel.js +317 -18
- package/sdk/public/Billing/BillingPublicValidator.d.ts +19 -3
- package/sdk/public/Billing/BillingPublicValidator.js +22 -3
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +2 -2
- package/sdk/public/Webhook/WebhookPublicClient.js +2 -2
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +24 -22
- package/sdk/public/Webhook/WebhookPublicModel.js +24 -22
|
@@ -19,18 +19,11 @@ const WebhookPlatformModel = require("./WebhookPlatformModel");
|
|
|
19
19
|
* @property {WebhookPlatformModel.EventProcessRequest} body
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
* @typedef GetEventCountsParam
|
|
24
|
-
* @property {WebhookPlatformModel.RetryEventRequest} body
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
22
|
/**
|
|
28
23
|
* @typedef GetHistoricalReportsParam
|
|
29
24
|
* @property {WebhookPlatformModel.HistoryPayload} body
|
|
30
25
|
*/
|
|
31
26
|
|
|
32
|
-
/** @typedef GetManualRetryStatusParam */
|
|
33
|
-
|
|
34
27
|
/**
|
|
35
28
|
* @typedef GetReportFiltersParam
|
|
36
29
|
* @property {WebhookPlatformModel.ReportFiltersPayload} body
|
|
@@ -55,13 +48,6 @@ const WebhookPlatformModel = require("./WebhookPlatformModel");
|
|
|
55
48
|
* @property {string} extensionId - Extension_id
|
|
56
49
|
*/
|
|
57
50
|
|
|
58
|
-
/** @typedef ManualRetryCancelParam */
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* @typedef ManualRetryOfFailedEventParam
|
|
62
|
-
* @property {WebhookPlatformModel.RetryEventRequest} body
|
|
63
|
-
*/
|
|
64
|
-
|
|
65
51
|
/**
|
|
66
52
|
* @typedef PingWebhookParam
|
|
67
53
|
* @property {WebhookPlatformModel.PingWebhook} body
|
|
@@ -69,12 +55,22 @@ const WebhookPlatformModel = require("./WebhookPlatformModel");
|
|
|
69
55
|
|
|
70
56
|
/**
|
|
71
57
|
* @typedef RegisterSubscriberToEventParam
|
|
72
|
-
* @property {WebhookPlatformModel.
|
|
58
|
+
* @property {WebhookPlatformModel.SubscriberConfigPost} body
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @typedef RegisterSubscriberToEventV2Param
|
|
63
|
+
* @property {WebhookPlatformModel.SubscriberConfigPostRequestV2} body
|
|
73
64
|
*/
|
|
74
65
|
|
|
75
66
|
/**
|
|
76
67
|
* @typedef UpdateSubscriberConfigParam
|
|
77
|
-
* @property {WebhookPlatformModel.
|
|
68
|
+
* @property {WebhookPlatformModel.SubscriberConfigUpdate} body
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @typedef UpdateSubscriberV2Param
|
|
73
|
+
* @property {WebhookPlatformModel.SubscriberConfigUpdateRequestV2} body
|
|
78
74
|
*/
|
|
79
75
|
|
|
80
76
|
class WebhookPlatformValidator {
|
|
@@ -104,13 +100,6 @@ class WebhookPlatformValidator {
|
|
|
104
100
|
}).required();
|
|
105
101
|
}
|
|
106
102
|
|
|
107
|
-
/** @returns {GetEventCountsParam} */
|
|
108
|
-
static getEventCounts() {
|
|
109
|
-
return Joi.object({
|
|
110
|
-
body: WebhookPlatformModel.RetryEventRequest().required(),
|
|
111
|
-
}).required();
|
|
112
|
-
}
|
|
113
|
-
|
|
114
103
|
/** @returns {GetHistoricalReportsParam} */
|
|
115
104
|
static getHistoricalReports() {
|
|
116
105
|
return Joi.object({
|
|
@@ -118,11 +107,6 @@ class WebhookPlatformValidator {
|
|
|
118
107
|
}).required();
|
|
119
108
|
}
|
|
120
109
|
|
|
121
|
-
/** @returns {GetManualRetryStatusParam} */
|
|
122
|
-
static getManualRetryStatus() {
|
|
123
|
-
return Joi.object({}).required();
|
|
124
|
-
}
|
|
125
|
-
|
|
126
110
|
/** @returns {GetReportFiltersParam} */
|
|
127
111
|
static getReportFilters() {
|
|
128
112
|
return Joi.object({
|
|
@@ -155,18 +139,6 @@ class WebhookPlatformValidator {
|
|
|
155
139
|
}).required();
|
|
156
140
|
}
|
|
157
141
|
|
|
158
|
-
/** @returns {ManualRetryCancelParam} */
|
|
159
|
-
static manualRetryCancel() {
|
|
160
|
-
return Joi.object({}).required();
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/** @returns {ManualRetryOfFailedEventParam} */
|
|
164
|
-
static manualRetryOfFailedEvent() {
|
|
165
|
-
return Joi.object({
|
|
166
|
-
body: WebhookPlatformModel.RetryEventRequest().required(),
|
|
167
|
-
}).required();
|
|
168
|
-
}
|
|
169
|
-
|
|
170
142
|
/** @returns {PingWebhookParam} */
|
|
171
143
|
static pingWebhook() {
|
|
172
144
|
return Joi.object({
|
|
@@ -177,14 +149,28 @@ class WebhookPlatformValidator {
|
|
|
177
149
|
/** @returns {RegisterSubscriberToEventParam} */
|
|
178
150
|
static registerSubscriberToEvent() {
|
|
179
151
|
return Joi.object({
|
|
180
|
-
body: WebhookPlatformModel.
|
|
152
|
+
body: WebhookPlatformModel.SubscriberConfigPost().required(),
|
|
153
|
+
}).required();
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** @returns {RegisterSubscriberToEventV2Param} */
|
|
157
|
+
static registerSubscriberToEventV2() {
|
|
158
|
+
return Joi.object({
|
|
159
|
+
body: WebhookPlatformModel.SubscriberConfigPostRequestV2().required(),
|
|
181
160
|
}).required();
|
|
182
161
|
}
|
|
183
162
|
|
|
184
163
|
/** @returns {UpdateSubscriberConfigParam} */
|
|
185
164
|
static updateSubscriberConfig() {
|
|
186
165
|
return Joi.object({
|
|
187
|
-
body: WebhookPlatformModel.
|
|
166
|
+
body: WebhookPlatformModel.SubscriberConfigUpdate().required(),
|
|
167
|
+
}).required();
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** @returns {UpdateSubscriberV2Param} */
|
|
171
|
+
static updateSubscriberV2() {
|
|
172
|
+
return Joi.object({
|
|
173
|
+
body: WebhookPlatformModel.SubscriberConfigUpdateRequestV2().required(),
|
|
188
174
|
}).required();
|
|
189
175
|
}
|
|
190
176
|
}
|
package/sdk/platform/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export const PlatformConfig: typeof import("./PlatformConfig");
|
|
2
2
|
export const PlatformClient: typeof import("./PlatformClient");
|
|
3
3
|
export namespace PlatformModel {
|
|
4
|
+
const AnalyticsPlatformModel: typeof import("./Analytics/AnalyticsPlatformModel");
|
|
4
5
|
const AuditTrailPlatformModel: typeof import("./AuditTrail/AuditTrailPlatformModel");
|
|
5
6
|
const BillingPlatformModel: typeof import("./Billing/BillingPlatformModel");
|
|
6
7
|
const CartPlatformModel: typeof import("./Cart/CartPlatformModel");
|
package/sdk/platform/index.js
CHANGED
|
@@ -2,6 +2,8 @@ module.exports = {
|
|
|
2
2
|
PlatformConfig: require("./PlatformConfig"),
|
|
3
3
|
PlatformClient: require("./PlatformClient"),
|
|
4
4
|
PlatformModel: {
|
|
5
|
+
AnalyticsPlatformModel: require("./Analytics/AnalyticsPlatformModel"),
|
|
6
|
+
|
|
5
7
|
AuditTrailPlatformModel: require("./AuditTrail/AuditTrailPlatformModel"),
|
|
6
8
|
|
|
7
9
|
BillingPlatformModel: require("./Billing/BillingPlatformModel"),
|
|
@@ -3,10 +3,23 @@ declare class Billing {
|
|
|
3
3
|
constructor(_conf: any);
|
|
4
4
|
_conf: any;
|
|
5
5
|
_relativeUrls: {
|
|
6
|
+
getPlanDetails: string;
|
|
6
7
|
getStandardPlans: string;
|
|
8
|
+
planList: string;
|
|
7
9
|
};
|
|
8
10
|
_urls: {};
|
|
9
11
|
updateUrls(urls: any): void;
|
|
12
|
+
/**
|
|
13
|
+
* @param {BillingPublicValidator.GetPlanDetailsParam} arg - Arg object.
|
|
14
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
15
|
+
* @param {import("../PublicAPIClient").Options} - Options
|
|
16
|
+
* @returns {Promise<BillingPublicModel.PlanDetails>} - Success response
|
|
17
|
+
* @name getPlanDetails
|
|
18
|
+
* @summary: Get plan details
|
|
19
|
+
* @description: Get plan details.
|
|
20
|
+
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/billing/getPlanDetails/).
|
|
21
|
+
*/
|
|
22
|
+
getPlanDetails({ planId, requestHeaders }?: BillingPublicValidator.GetPlanDetailsParam, { responseHeaders }?: object): Promise<BillingPublicModel.PlanDetails>;
|
|
10
23
|
/**
|
|
11
24
|
* @param {BillingPublicValidator.GetStandardPlansParam} arg - Arg object.
|
|
12
25
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -14,10 +27,19 @@ declare class Billing {
|
|
|
14
27
|
* @returns {Promise<BillingPublicModel.DetailList>} - Success response
|
|
15
28
|
* @name getStandardPlans
|
|
16
29
|
* @summary: Get Standard/Public Plans
|
|
17
|
-
* @description: Get Standard/Public Plans.
|
|
18
|
-
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/billing/getStandardPlans/).
|
|
30
|
+
* @description: Get Standard/Public Plans. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/billing/getStandardPlans/).
|
|
19
31
|
*/
|
|
20
32
|
getStandardPlans({ platform, requestHeaders }?: BillingPublicValidator.GetStandardPlansParam, { responseHeaders }?: object): Promise<BillingPublicModel.DetailList>;
|
|
33
|
+
/**
|
|
34
|
+
* @param {BillingPublicValidator.PlanListParam} arg - Arg object.
|
|
35
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
36
|
+
* @param {import("../PublicAPIClient").Options} - Options
|
|
37
|
+
* @returns {Promise<BillingPublicModel.PlanList[]>} - Success response
|
|
38
|
+
* @name planList
|
|
39
|
+
* @summary: Get List of all plans
|
|
40
|
+
* @description: Get List of all plans - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/billing/planList/).
|
|
41
|
+
*/
|
|
42
|
+
planList({ requestHeaders }?: any, { responseHeaders }?: object): Promise<BillingPublicModel.PlanList[]>;
|
|
21
43
|
}
|
|
22
44
|
import BillingPublicValidator = require("./BillingPublicValidator");
|
|
23
45
|
import BillingPublicModel = require("./BillingPublicModel");
|
|
@@ -14,7 +14,9 @@ class Billing {
|
|
|
14
14
|
constructor(_conf) {
|
|
15
15
|
this._conf = _conf;
|
|
16
16
|
this._relativeUrls = {
|
|
17
|
-
|
|
17
|
+
getPlanDetails: "/service/public/billing/v1.0/plan/details/{plan_id}",
|
|
18
|
+
getStandardPlans: "/service/public/billing/v1.0/plan/detailed-list/",
|
|
19
|
+
planList: "/service/public/billing/v1.0/plan/list",
|
|
18
20
|
};
|
|
19
21
|
this._urls = Object.entries(this._relativeUrls).reduce(
|
|
20
22
|
(urls, [method, relativeUrl]) => {
|
|
@@ -32,6 +34,85 @@ class Billing {
|
|
|
32
34
|
};
|
|
33
35
|
}
|
|
34
36
|
|
|
37
|
+
/**
|
|
38
|
+
* @param {BillingPublicValidator.GetPlanDetailsParam} arg - Arg object.
|
|
39
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
40
|
+
* @param {import("../PublicAPIClient").Options} - Options
|
|
41
|
+
* @returns {Promise<BillingPublicModel.PlanDetails>} - Success response
|
|
42
|
+
* @name getPlanDetails
|
|
43
|
+
* @summary: Get plan details
|
|
44
|
+
* @description: Get plan details.
|
|
45
|
+
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/billing/getPlanDetails/).
|
|
46
|
+
*/
|
|
47
|
+
async getPlanDetails(
|
|
48
|
+
{ planId, requestHeaders } = { requestHeaders: {} },
|
|
49
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
50
|
+
) {
|
|
51
|
+
const { error } = BillingPublicValidator.getPlanDetails().validate(
|
|
52
|
+
{ planId },
|
|
53
|
+
{ abortEarly: false, allowUnknown: true }
|
|
54
|
+
);
|
|
55
|
+
if (error) {
|
|
56
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Showing warrnings if extra unknown parameters are found
|
|
60
|
+
const {
|
|
61
|
+
error: warrning,
|
|
62
|
+
} = BillingPublicValidator.getPlanDetails().validate(
|
|
63
|
+
{ planId },
|
|
64
|
+
{ abortEarly: false, allowUnknown: false }
|
|
65
|
+
);
|
|
66
|
+
if (warrning) {
|
|
67
|
+
Logger({
|
|
68
|
+
level: "WARN",
|
|
69
|
+
message: `Parameter Validation warrnings for public > Billing > getPlanDetails \n ${warrning}`,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const query_params = {};
|
|
74
|
+
|
|
75
|
+
const xHeaders = {};
|
|
76
|
+
|
|
77
|
+
const response = await PublicAPIClient.execute(
|
|
78
|
+
this._conf,
|
|
79
|
+
"get",
|
|
80
|
+
constructUrl({
|
|
81
|
+
url: this._urls["getPlanDetails"],
|
|
82
|
+
params: { planId },
|
|
83
|
+
}),
|
|
84
|
+
query_params,
|
|
85
|
+
undefined,
|
|
86
|
+
{ ...xHeaders, ...requestHeaders },
|
|
87
|
+
{ responseHeaders }
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
let responseData = response;
|
|
91
|
+
if (responseHeaders) {
|
|
92
|
+
responseData = response[0];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const {
|
|
96
|
+
error: res_error,
|
|
97
|
+
} = BillingPublicModel.PlanDetails().validate(responseData, {
|
|
98
|
+
abortEarly: false,
|
|
99
|
+
allowUnknown: true,
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
if (res_error) {
|
|
103
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
104
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
105
|
+
} else {
|
|
106
|
+
Logger({
|
|
107
|
+
level: "WARN",
|
|
108
|
+
message: `Response Validation Warnings for public > Billing > getPlanDetails \n ${res_error}`,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return response;
|
|
114
|
+
}
|
|
115
|
+
|
|
35
116
|
/**
|
|
36
117
|
* @param {BillingPublicValidator.GetStandardPlansParam} arg - Arg object.
|
|
37
118
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -39,8 +120,7 @@ class Billing {
|
|
|
39
120
|
* @returns {Promise<BillingPublicModel.DetailList>} - Success response
|
|
40
121
|
* @name getStandardPlans
|
|
41
122
|
* @summary: Get Standard/Public Plans
|
|
42
|
-
* @description: Get Standard/Public Plans.
|
|
43
|
-
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/billing/getStandardPlans/).
|
|
123
|
+
* @description: Get Standard/Public Plans. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/billing/getStandardPlans/).
|
|
44
124
|
*/
|
|
45
125
|
async getStandardPlans(
|
|
46
126
|
{ platform, requestHeaders } = { requestHeaders: {} },
|
|
@@ -111,6 +191,79 @@ class Billing {
|
|
|
111
191
|
|
|
112
192
|
return response;
|
|
113
193
|
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @param {BillingPublicValidator.PlanListParam} arg - Arg object.
|
|
197
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
198
|
+
* @param {import("../PublicAPIClient").Options} - Options
|
|
199
|
+
* @returns {Promise<BillingPublicModel.PlanList[]>} - Success response
|
|
200
|
+
* @name planList
|
|
201
|
+
* @summary: Get List of all plans
|
|
202
|
+
* @description: Get List of all plans - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/billing/planList/).
|
|
203
|
+
*/
|
|
204
|
+
async planList(
|
|
205
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
206
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
207
|
+
) {
|
|
208
|
+
const { error } = BillingPublicValidator.planList().validate(
|
|
209
|
+
{},
|
|
210
|
+
{ abortEarly: false, allowUnknown: true }
|
|
211
|
+
);
|
|
212
|
+
if (error) {
|
|
213
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Showing warrnings if extra unknown parameters are found
|
|
217
|
+
const { error: warrning } = BillingPublicValidator.planList().validate(
|
|
218
|
+
{},
|
|
219
|
+
{ abortEarly: false, allowUnknown: false }
|
|
220
|
+
);
|
|
221
|
+
if (warrning) {
|
|
222
|
+
Logger({
|
|
223
|
+
level: "WARN",
|
|
224
|
+
message: `Parameter Validation warrnings for public > Billing > planList \n ${warrning}`,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const query_params = {};
|
|
229
|
+
|
|
230
|
+
const xHeaders = {};
|
|
231
|
+
|
|
232
|
+
const response = await PublicAPIClient.execute(
|
|
233
|
+
this._conf,
|
|
234
|
+
"get",
|
|
235
|
+
constructUrl({
|
|
236
|
+
url: this._urls["planList"],
|
|
237
|
+
params: {},
|
|
238
|
+
}),
|
|
239
|
+
query_params,
|
|
240
|
+
undefined,
|
|
241
|
+
{ ...xHeaders, ...requestHeaders },
|
|
242
|
+
{ responseHeaders }
|
|
243
|
+
);
|
|
244
|
+
|
|
245
|
+
let responseData = response;
|
|
246
|
+
if (responseHeaders) {
|
|
247
|
+
responseData = response[0];
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
const { error: res_error } = Joi.array()
|
|
251
|
+
.items(BillingPublicModel.PlanList())
|
|
252
|
+
.validate(responseData, { abortEarly: false, allowUnknown: true });
|
|
253
|
+
|
|
254
|
+
if (res_error) {
|
|
255
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
256
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
257
|
+
} else {
|
|
258
|
+
Logger({
|
|
259
|
+
level: "WARN",
|
|
260
|
+
message: `Response Validation Warnings for public > Billing > planList \n ${res_error}`,
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
return response;
|
|
266
|
+
}
|
|
114
267
|
}
|
|
115
268
|
|
|
116
269
|
module.exports = Billing;
|